index.js 521 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587
  1. import {getServerConf} from "./ljw.js?v=7"
  2. import {ids as langIds, lang} from './lang.js?v=8'
  3. import {F as Dn, J as _3, L as F3, l as s4, m as r, P as dn, s as ln, z as k4} from "./vendor.js?v=0b990c6e";
  4. var sn = Object.defineProperty;
  5. var En = (u, e, i) => e in u ? sn(u, e, {enumerable: !0, configurable: !0, writable: !0, value: i}) : u[e] = i;
  6. var l = (u, e, i) => (En(u, typeof e != "symbol" ? e + "" : e, i), i), S4 = (u, e, i) => {
  7. if (!e.has(u)) throw TypeError("Cannot " + i)
  8. };
  9. var h = (u, e, i) => (S4(u, e, "read from private field"), i ? i.call(u) : e.get(u)), _u = (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. }, Ue = (u, e, i, n) => (S4(u, e, "write to private field"), n ? n.call(u, i) : e.set(u, i), i), A3 = (u, e, i, n) => ({
  13. set _(a) {
  14. Ue(u, e, a, i)
  15. }, get _() {
  16. return h(u, e, n)
  17. }
  18. }), m3 = (u, e, i) => (S4(u, e, "access private method"), i);
  19. const Bn = 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. Bn();
  38. var N4 = (u => (u[u.I420 = 0] = "I420", u[u.I444 = 1] = "I444", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(N4 || {});
  39. function cn(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 Cn(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 je = (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))(je || {});
  65. function pn(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 An(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 V = (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))(V || {});
  101. function Je(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 E4(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 pu = (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))(pu || {});
  527. function mn(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 Fn(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 da = (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))(da || {});
  578. function _n(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 vn(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 i4 = (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))(i4 || {});
  619. function gn(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 kn(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 hn(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 fn(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 p0 = (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.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(p0 || {});
  680. function xn(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-1:
  704. case"UNRECOGNIZED":
  705. default:
  706. return -1
  707. }
  708. }
  709. function yn(u) {
  710. switch (u) {
  711. case 0:
  712. return "Keyboard";
  713. case 2:
  714. return "Clipboard";
  715. case 3:
  716. return "Audio";
  717. case 4:
  718. return "File";
  719. case 5:
  720. return "Restart";
  721. case 6:
  722. return "Recording";
  723. case 7:
  724. return "BlockInput";
  725. case-1:
  726. default:
  727. return "UNRECOGNIZED"
  728. }
  729. }
  730. var fu = (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))(fu || {});
  731. function bn(u) {
  732. switch (u) {
  733. case 0:
  734. case"Auto":
  735. return 0;
  736. case 1:
  737. case"VP9":
  738. return 1;
  739. case 2:
  740. case"H264":
  741. return 2;
  742. case 3:
  743. case"H265":
  744. return 3;
  745. case 4:
  746. case"VP8":
  747. return 4;
  748. case 5:
  749. case"AV1":
  750. return 5;
  751. case-1:
  752. case"UNRECOGNIZED":
  753. default:
  754. return -1
  755. }
  756. }
  757. function wn(u) {
  758. switch (u) {
  759. case 0:
  760. return "Auto";
  761. case 1:
  762. return "VP9";
  763. case 2:
  764. return "H264";
  765. case 3:
  766. return "H265";
  767. case 4:
  768. return "VP8";
  769. case 5:
  770. return "AV1";
  771. case-1:
  772. default:
  773. return "UNRECOGNIZED"
  774. }
  775. }
  776. var S = (u => (u[u.NotSet = 0] = "NotSet", u[u.No = 1] = "No", u[u.Yes = 2] = "Yes", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(S || {});
  777. function H(u) {
  778. switch (u) {
  779. case 0:
  780. case"NotSet":
  781. return 0;
  782. case 1:
  783. case"No":
  784. return 1;
  785. case 2:
  786. case"Yes":
  787. return 2;
  788. case-1:
  789. case"UNRECOGNIZED":
  790. default:
  791. return -1
  792. }
  793. }
  794. function J(u) {
  795. switch (u) {
  796. case 0:
  797. return "NotSet";
  798. case 1:
  799. return "No";
  800. case 2:
  801. return "Yes";
  802. case-1:
  803. default:
  804. return "UNRECOGNIZED"
  805. }
  806. }
  807. var We = (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))(We || {});
  808. function Sn(u) {
  809. switch (u) {
  810. case 0:
  811. case"BlkStateUnknown":
  812. return 0;
  813. case 2:
  814. case"BlkOnSucceeded":
  815. return 2;
  816. case 3:
  817. case"BlkOnFailed":
  818. return 3;
  819. case 4:
  820. case"BlkOffSucceeded":
  821. return 4;
  822. case 5:
  823. case"BlkOffFailed":
  824. return 5;
  825. case-1:
  826. case"UNRECOGNIZED":
  827. default:
  828. return -1
  829. }
  830. }
  831. function zn(u) {
  832. switch (u) {
  833. case 0:
  834. return "BlkStateUnknown";
  835. case 2:
  836. return "BlkOnSucceeded";
  837. case 3:
  838. return "BlkOnFailed";
  839. case 4:
  840. return "BlkOffSucceeded";
  841. case 5:
  842. return "BlkOffFailed";
  843. case-1:
  844. default:
  845. return "UNRECOGNIZED"
  846. }
  847. }
  848. var su = (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))(su || {});
  849. function Pn(u) {
  850. switch (u) {
  851. case 0:
  852. case"PrvStateUnknown":
  853. return 0;
  854. case 2:
  855. case"PrvOnByOther":
  856. return 2;
  857. case 3:
  858. case"PrvNotSupported":
  859. return 3;
  860. case 4:
  861. case"PrvOnSucceeded":
  862. return 4;
  863. case 5:
  864. case"PrvOnFailedDenied":
  865. return 5;
  866. case 6:
  867. case"PrvOnFailedPlugin":
  868. return 6;
  869. case 7:
  870. case"PrvOnFailed":
  871. return 7;
  872. case 8:
  873. case"PrvOffSucceeded":
  874. return 8;
  875. case 9:
  876. case"PrvOffByPeer":
  877. return 9;
  878. case 10:
  879. case"PrvOffFailed":
  880. return 10;
  881. case 11:
  882. case"PrvOffUnknown":
  883. return 11;
  884. case-1:
  885. case"UNRECOGNIZED":
  886. default:
  887. return -1
  888. }
  889. }
  890. function Rn(u) {
  891. switch (u) {
  892. case 0:
  893. return "PrvStateUnknown";
  894. case 2:
  895. return "PrvOnByOther";
  896. case 3:
  897. return "PrvNotSupported";
  898. case 4:
  899. return "PrvOnSucceeded";
  900. case 5:
  901. return "PrvOnFailedDenied";
  902. case 6:
  903. return "PrvOnFailedPlugin";
  904. case 7:
  905. return "PrvOnFailed";
  906. case 8:
  907. return "PrvOffSucceeded";
  908. case 9:
  909. return "PrvOffByPeer";
  910. case 10:
  911. return "PrvOffFailed";
  912. case 11:
  913. return "PrvOffUnknown";
  914. case-1:
  915. default:
  916. return "UNRECOGNIZED"
  917. }
  918. }
  919. function v3() {
  920. return {data: new Uint8Array(0), key: !1, pts: 0}
  921. }
  922. const A0 = {
  923. encode(u, e = r.Writer.create()) {
  924. 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
  925. }, decode(u, e) {
  926. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  927. let n = e === void 0 ? i.len : i.pos + e;
  928. const a = v3();
  929. for (; i.pos < n;) {
  930. const t = i.uint32();
  931. switch (t >>> 3) {
  932. case 1:
  933. if (t !== 10) break;
  934. a.data = i.bytes();
  935. continue;
  936. case 2:
  937. if (t !== 16) break;
  938. a.key = i.bool();
  939. continue;
  940. case 3:
  941. if (t !== 24) break;
  942. a.pts = W(i.int64());
  943. continue
  944. }
  945. if ((t & 7) === 4 || t === 0) break;
  946. i.skipType(t & 7)
  947. }
  948. return a
  949. }, fromJSON(u) {
  950. return {
  951. data: o(u.data) ? T(u.data) : new Uint8Array(0),
  952. key: o(u.key) ? globalThis.Boolean(u.key) : !1,
  953. pts: o(u.pts) ? globalThis.Number(u.pts) : 0
  954. }
  955. }, toJSON(u) {
  956. const e = {};
  957. return u.data.length !== 0 && (e.data = N(u.data)), u.key !== !1 && (e.key = u.key), u.pts !== 0 && (e.pts = Math.round(u.pts)), e
  958. }, create(u) {
  959. return A0.fromPartial(u != null ? u : {})
  960. }, fromPartial(u) {
  961. var i, n, a;
  962. const e = v3();
  963. 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
  964. }
  965. };
  966. function g3() {
  967. return {frames: []}
  968. }
  969. const k = {
  970. encode(u, e = r.Writer.create()) {
  971. for (const i of u.frames) A0.encode(i, e.uint32(10).fork()).ldelim();
  972. return e
  973. }, decode(u, e) {
  974. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  975. let n = e === void 0 ? i.len : i.pos + e;
  976. const a = g3();
  977. for (; i.pos < n;) {
  978. const t = i.uint32();
  979. switch (t >>> 3) {
  980. case 1:
  981. if (t !== 10) break;
  982. a.frames.push(A0.decode(i, i.uint32()));
  983. continue
  984. }
  985. if ((t & 7) === 4 || t === 0) break;
  986. i.skipType(t & 7)
  987. }
  988. return a
  989. }, fromJSON(u) {
  990. return {frames: globalThis.Array.isArray(u == null ? void 0 : u.frames) ? u.frames.map(e => A0.fromJSON(e)) : []}
  991. }, toJSON(u) {
  992. var i;
  993. const e = {};
  994. return (i = u.frames) != null && i.length && (e.frames = u.frames.map(n => A0.toJSON(n))), e
  995. }, create(u) {
  996. return k.fromPartial(u != null ? u : {})
  997. }, fromPartial(u) {
  998. var i;
  999. const e = g3();
  1000. return e.frames = ((i = u.frames) == null ? void 0 : i.map(n => A0.fromPartial(n))) || [], e
  1001. }
  1002. };
  1003. function k3() {
  1004. return {compress: !1}
  1005. }
  1006. const m0 = {
  1007. encode(u, e = r.Writer.create()) {
  1008. return u.compress !== !1 && e.uint32(8).bool(u.compress), e
  1009. }, decode(u, e) {
  1010. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1011. let n = e === void 0 ? i.len : i.pos + e;
  1012. const a = k3();
  1013. for (; i.pos < n;) {
  1014. const t = i.uint32();
  1015. switch (t >>> 3) {
  1016. case 1:
  1017. if (t !== 8) break;
  1018. a.compress = i.bool();
  1019. continue
  1020. }
  1021. if ((t & 7) === 4 || t === 0) break;
  1022. i.skipType(t & 7)
  1023. }
  1024. return a
  1025. }, fromJSON(u) {
  1026. return {compress: o(u.compress) ? globalThis.Boolean(u.compress) : !1}
  1027. }, toJSON(u) {
  1028. const e = {};
  1029. return u.compress !== !1 && (e.compress = u.compress), e
  1030. }, create(u) {
  1031. return m0.fromPartial(u != null ? u : {})
  1032. }, fromPartial(u) {
  1033. var i;
  1034. const e = k3();
  1035. return e.compress = (i = u.compress) != null ? i : !1, e
  1036. }
  1037. };
  1038. function h3() {
  1039. return {compress: !1, stride: 0}
  1040. }
  1041. const F0 = {
  1042. encode(u, e = r.Writer.create()) {
  1043. return u.compress !== !1 && e.uint32(8).bool(u.compress), u.stride !== 0 && e.uint32(16).int32(u.stride), e
  1044. }, decode(u, e) {
  1045. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1046. let n = e === void 0 ? i.len : i.pos + e;
  1047. const a = h3();
  1048. for (; i.pos < n;) {
  1049. const t = i.uint32();
  1050. switch (t >>> 3) {
  1051. case 1:
  1052. if (t !== 8) break;
  1053. a.compress = i.bool();
  1054. continue;
  1055. case 2:
  1056. if (t !== 16) break;
  1057. a.stride = i.int32();
  1058. continue
  1059. }
  1060. if ((t & 7) === 4 || t === 0) break;
  1061. i.skipType(t & 7)
  1062. }
  1063. return a
  1064. }, fromJSON(u) {
  1065. return {
  1066. compress: o(u.compress) ? globalThis.Boolean(u.compress) : !1,
  1067. stride: o(u.stride) ? globalThis.Number(u.stride) : 0
  1068. }
  1069. }, toJSON(u) {
  1070. const e = {};
  1071. return u.compress !== !1 && (e.compress = u.compress), u.stride !== 0 && (e.stride = Math.round(u.stride)), e
  1072. }, create(u) {
  1073. return F0.fromPartial(u != null ? u : {})
  1074. }, fromPartial(u) {
  1075. var i, n;
  1076. const e = h3();
  1077. return e.compress = (i = u.compress) != null ? i : !1, e.stride = (n = u.stride) != null ? n : 0, e
  1078. }
  1079. };
  1080. function f3() {
  1081. return {
  1082. vp9s: void 0,
  1083. rgb: void 0,
  1084. yuv: void 0,
  1085. h264s: void 0,
  1086. h265s: void 0,
  1087. vp8s: void 0,
  1088. av1s: void 0,
  1089. display: 0
  1090. }
  1091. }
  1092. const _0 = {
  1093. encode(u, e = r.Writer.create()) {
  1094. return u.vp9s !== void 0 && k.encode(u.vp9s, e.uint32(50).fork()).ldelim(), u.rgb !== void 0 && m0.encode(u.rgb, e.uint32(58).fork()).ldelim(), u.yuv !== void 0 && F0.encode(u.yuv, e.uint32(66).fork()).ldelim(), u.h264s !== void 0 && k.encode(u.h264s, e.uint32(82).fork()).ldelim(), u.h265s !== void 0 && k.encode(u.h265s, e.uint32(90).fork()).ldelim(), u.vp8s !== void 0 && k.encode(u.vp8s, e.uint32(98).fork()).ldelim(), u.av1s !== void 0 && k.encode(u.av1s, e.uint32(106).fork()).ldelim(), u.display !== 0 && e.uint32(112).int32(u.display), e
  1095. }, decode(u, e) {
  1096. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1097. let n = e === void 0 ? i.len : i.pos + e;
  1098. const a = f3();
  1099. for (; i.pos < n;) {
  1100. const t = i.uint32();
  1101. switch (t >>> 3) {
  1102. case 6:
  1103. if (t !== 50) break;
  1104. a.vp9s = k.decode(i, i.uint32());
  1105. continue;
  1106. case 7:
  1107. if (t !== 58) break;
  1108. a.rgb = m0.decode(i, i.uint32());
  1109. continue;
  1110. case 8:
  1111. if (t !== 66) break;
  1112. a.yuv = F0.decode(i, i.uint32());
  1113. continue;
  1114. case 10:
  1115. if (t !== 82) break;
  1116. a.h264s = k.decode(i, i.uint32());
  1117. continue;
  1118. case 11:
  1119. if (t !== 90) break;
  1120. a.h265s = k.decode(i, i.uint32());
  1121. continue;
  1122. case 12:
  1123. if (t !== 98) break;
  1124. a.vp8s = k.decode(i, i.uint32());
  1125. continue;
  1126. case 13:
  1127. if (t !== 106) break;
  1128. a.av1s = k.decode(i, i.uint32());
  1129. continue;
  1130. case 14:
  1131. if (t !== 112) break;
  1132. a.display = i.int32();
  1133. continue
  1134. }
  1135. if ((t & 7) === 4 || t === 0) break;
  1136. i.skipType(t & 7)
  1137. }
  1138. return a
  1139. }, fromJSON(u) {
  1140. return {
  1141. vp9s: o(u.vp9s) ? k.fromJSON(u.vp9s) : void 0,
  1142. rgb: o(u.rgb) ? m0.fromJSON(u.rgb) : void 0,
  1143. yuv: o(u.yuv) ? F0.fromJSON(u.yuv) : void 0,
  1144. h264s: o(u.h264s) ? k.fromJSON(u.h264s) : void 0,
  1145. h265s: o(u.h265s) ? k.fromJSON(u.h265s) : void 0,
  1146. vp8s: o(u.vp8s) ? k.fromJSON(u.vp8s) : void 0,
  1147. av1s: o(u.av1s) ? k.fromJSON(u.av1s) : void 0,
  1148. display: o(u.display) ? globalThis.Number(u.display) : 0
  1149. }
  1150. }, toJSON(u) {
  1151. const e = {};
  1152. return u.vp9s !== void 0 && (e.vp9s = k.toJSON(u.vp9s)), u.rgb !== void 0 && (e.rgb = m0.toJSON(u.rgb)), u.yuv !== void 0 && (e.yuv = F0.toJSON(u.yuv)), u.h264s !== void 0 && (e.h264s = k.toJSON(u.h264s)), u.h265s !== void 0 && (e.h265s = k.toJSON(u.h265s)), u.vp8s !== void 0 && (e.vp8s = k.toJSON(u.vp8s)), u.av1s !== void 0 && (e.av1s = k.toJSON(u.av1s)), u.display !== 0 && (e.display = Math.round(u.display)), e
  1153. }, create(u) {
  1154. return _0.fromPartial(u != null ? u : {})
  1155. }, fromPartial(u) {
  1156. var i;
  1157. const e = f3();
  1158. return e.vp9s = u.vp9s !== void 0 && u.vp9s !== null ? k.fromPartial(u.vp9s) : void 0, e.rgb = u.rgb !== void 0 && u.rgb !== null ? m0.fromPartial(u.rgb) : void 0, e.yuv = u.yuv !== void 0 && u.yuv !== null ? F0.fromPartial(u.yuv) : void 0, e.h264s = u.h264s !== void 0 && u.h264s !== null ? k.fromPartial(u.h264s) : void 0, e.h265s = u.h265s !== void 0 && u.h265s !== null ? k.fromPartial(u.h265s) : void 0, e.vp8s = u.vp8s !== void 0 && u.vp8s !== null ? k.fromPartial(u.vp8s) : void 0, e.av1s = u.av1s !== void 0 && u.av1s !== null ? k.fromPartial(u.av1s) : void 0, e.display = (i = u.display) != null ? i : 0, e
  1159. }
  1160. };
  1161. function x3() {
  1162. return {id: "", pk: new Uint8Array(0)}
  1163. }
  1164. const j4 = {
  1165. encode(u, e = r.Writer.create()) {
  1166. return u.id !== "" && e.uint32(10).string(u.id), u.pk.length !== 0 && e.uint32(18).bytes(u.pk), e
  1167. }, decode(u, e) {
  1168. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1169. let n = e === void 0 ? i.len : i.pos + e;
  1170. const a = x3();
  1171. for (; i.pos < n;) {
  1172. const t = i.uint32();
  1173. switch (t >>> 3) {
  1174. case 1:
  1175. if (t !== 10) break;
  1176. a.id = i.string();
  1177. continue;
  1178. case 2:
  1179. if (t !== 18) break;
  1180. a.pk = i.bytes();
  1181. continue
  1182. }
  1183. if ((t & 7) === 4 || t === 0) break;
  1184. i.skipType(t & 7)
  1185. }
  1186. return a
  1187. }, fromJSON(u) {
  1188. return {id: o(u.id) ? globalThis.String(u.id) : "", pk: o(u.pk) ? T(u.pk) : new Uint8Array(0)}
  1189. }, toJSON(u) {
  1190. const e = {};
  1191. return u.id !== "" && (e.id = u.id), u.pk.length !== 0 && (e.pk = N(u.pk)), e
  1192. }, create(u) {
  1193. return j4.fromPartial(u != null ? u : {})
  1194. }, fromPartial(u) {
  1195. var i, n;
  1196. const e = x3();
  1197. return e.id = (i = u.id) != null ? i : "", e.pk = (n = u.pk) != null ? n : new Uint8Array(0), e
  1198. }
  1199. };
  1200. function y3() {
  1201. return {
  1202. x: 0,
  1203. y: 0,
  1204. width: 0,
  1205. height: 0,
  1206. name: "",
  1207. online: !1,
  1208. cursor_embedded: !1,
  1209. original_resolution: void 0,
  1210. scale: 0
  1211. }
  1212. }
  1213. const v0 = {
  1214. encode(u, e = r.Writer.create()) {
  1215. 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 && g.encode(u.original_resolution, e.uint32(66).fork()).ldelim(), u.scale !== 0 && e.uint32(73).double(u.scale), e
  1216. }, decode(u, e) {
  1217. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1218. let n = e === void 0 ? i.len : i.pos + e;
  1219. const a = y3();
  1220. for (; i.pos < n;) {
  1221. const t = i.uint32();
  1222. switch (t >>> 3) {
  1223. case 1:
  1224. if (t !== 8) break;
  1225. a.x = i.sint32();
  1226. continue;
  1227. case 2:
  1228. if (t !== 16) break;
  1229. a.y = i.sint32();
  1230. continue;
  1231. case 3:
  1232. if (t !== 24) break;
  1233. a.width = i.int32();
  1234. continue;
  1235. case 4:
  1236. if (t !== 32) break;
  1237. a.height = i.int32();
  1238. continue;
  1239. case 5:
  1240. if (t !== 42) break;
  1241. a.name = i.string();
  1242. continue;
  1243. case 6:
  1244. if (t !== 48) break;
  1245. a.online = i.bool();
  1246. continue;
  1247. case 7:
  1248. if (t !== 56) break;
  1249. a.cursor_embedded = i.bool();
  1250. continue;
  1251. case 8:
  1252. if (t !== 66) break;
  1253. a.original_resolution = g.decode(i, i.uint32());
  1254. continue;
  1255. case 9:
  1256. if (t !== 73) break;
  1257. a.scale = i.double();
  1258. continue
  1259. }
  1260. if ((t & 7) === 4 || t === 0) break;
  1261. i.skipType(t & 7)
  1262. }
  1263. return a
  1264. }, fromJSON(u) {
  1265. return {
  1266. x: o(u.x) ? globalThis.Number(u.x) : 0,
  1267. y: o(u.y) ? globalThis.Number(u.y) : 0,
  1268. width: o(u.width) ? globalThis.Number(u.width) : 0,
  1269. height: o(u.height) ? globalThis.Number(u.height) : 0,
  1270. name: o(u.name) ? globalThis.String(u.name) : "",
  1271. online: o(u.online) ? globalThis.Boolean(u.online) : !1,
  1272. cursor_embedded: o(u.cursor_embedded) ? globalThis.Boolean(u.cursor_embedded) : !1,
  1273. original_resolution: o(u.original_resolution) ? g.fromJSON(u.original_resolution) : void 0,
  1274. scale: o(u.scale) ? globalThis.Number(u.scale) : 0
  1275. }
  1276. }, toJSON(u) {
  1277. const e = {};
  1278. 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 = g.toJSON(u.original_resolution)), u.scale !== 0 && (e.scale = u.scale), e
  1279. }, create(u) {
  1280. return v0.fromPartial(u != null ? u : {})
  1281. }, fromPartial(u) {
  1282. var i, n, a, t, s, E, D, d;
  1283. const e = y3();
  1284. 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 = (D = u.cursor_embedded) != null ? D : !1, e.original_resolution = u.original_resolution !== void 0 && u.original_resolution !== null ? g.fromPartial(u.original_resolution) : void 0, e.scale = (d = u.scale) != null ? d : 0, e
  1285. }
  1286. };
  1287. function b3() {
  1288. return {host: "", port: 0}
  1289. }
  1290. const g0 = {
  1291. encode(u, e = r.Writer.create()) {
  1292. return u.host !== "" && e.uint32(10).string(u.host), u.port !== 0 && e.uint32(16).int32(u.port), e
  1293. }, decode(u, e) {
  1294. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1295. let n = e === void 0 ? i.len : i.pos + e;
  1296. const a = b3();
  1297. for (; i.pos < n;) {
  1298. const t = i.uint32();
  1299. switch (t >>> 3) {
  1300. case 1:
  1301. if (t !== 10) break;
  1302. a.host = i.string();
  1303. continue;
  1304. case 2:
  1305. if (t !== 16) break;
  1306. a.port = i.int32();
  1307. continue
  1308. }
  1309. if ((t & 7) === 4 || t === 0) break;
  1310. i.skipType(t & 7)
  1311. }
  1312. return a
  1313. }, fromJSON(u) {
  1314. return {host: o(u.host) ? globalThis.String(u.host) : "", port: o(u.port) ? globalThis.Number(u.port) : 0}
  1315. }, toJSON(u) {
  1316. const e = {};
  1317. return u.host !== "" && (e.host = u.host), u.port !== 0 && (e.port = Math.round(u.port)), e
  1318. }, create(u) {
  1319. return g0.fromPartial(u != null ? u : {})
  1320. }, fromPartial(u) {
  1321. var i, n;
  1322. const e = b3();
  1323. return e.host = (i = u.host) != null ? i : "", e.port = (n = u.port) != null ? n : 0, e
  1324. }
  1325. };
  1326. function w3() {
  1327. return {dir: "", show_hidden: !1}
  1328. }
  1329. const xu = {
  1330. encode(u, e = r.Writer.create()) {
  1331. return u.dir !== "" && e.uint32(10).string(u.dir), u.show_hidden !== !1 && e.uint32(16).bool(u.show_hidden), e
  1332. }, decode(u, e) {
  1333. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1334. let n = e === void 0 ? i.len : i.pos + e;
  1335. const a = w3();
  1336. for (; i.pos < n;) {
  1337. const t = i.uint32();
  1338. switch (t >>> 3) {
  1339. case 1:
  1340. if (t !== 10) break;
  1341. a.dir = i.string();
  1342. continue;
  1343. case 2:
  1344. if (t !== 16) break;
  1345. a.show_hidden = i.bool();
  1346. continue
  1347. }
  1348. if ((t & 7) === 4 || t === 0) break;
  1349. i.skipType(t & 7)
  1350. }
  1351. return a
  1352. }, fromJSON(u) {
  1353. return {
  1354. dir: o(u.dir) ? globalThis.String(u.dir) : "",
  1355. show_hidden: o(u.show_hidden) ? globalThis.Boolean(u.show_hidden) : !1
  1356. }
  1357. }, toJSON(u) {
  1358. const e = {};
  1359. return u.dir !== "" && (e.dir = u.dir), u.show_hidden !== !1 && (e.show_hidden = u.show_hidden), e
  1360. }, create(u) {
  1361. return xu.fromPartial(u != null ? u : {})
  1362. }, fromPartial(u) {
  1363. var i, n;
  1364. const e = w3();
  1365. return e.dir = (i = u.dir) != null ? i : "", e.show_hidden = (n = u.show_hidden) != null ? n : !1, e
  1366. }
  1367. };
  1368. function S3() {
  1369. return {}
  1370. }
  1371. const yu = {
  1372. encode(u, e = r.Writer.create()) {
  1373. return e
  1374. }, decode(u, e) {
  1375. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1376. let n = e === void 0 ? i.len : i.pos + e;
  1377. const a = S3();
  1378. for (; i.pos < n;) {
  1379. const t = i.uint32();
  1380. if ((t & 7) === 4 || t === 0) break;
  1381. i.skipType(t & 7)
  1382. }
  1383. return a
  1384. }, fromJSON(u) {
  1385. return {}
  1386. }, toJSON(u) {
  1387. return {}
  1388. }, create(u) {
  1389. return yu.fromPartial(u != null ? u : {})
  1390. }, fromPartial(u) {
  1391. return S3()
  1392. }
  1393. };
  1394. function z3() {
  1395. return {username: "", password: ""}
  1396. }
  1397. const k0 = {
  1398. encode(u, e = r.Writer.create()) {
  1399. return u.username !== "" && e.uint32(10).string(u.username), u.password !== "" && e.uint32(18).string(u.password), e
  1400. }, decode(u, e) {
  1401. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1402. let n = e === void 0 ? i.len : i.pos + e;
  1403. const a = z3();
  1404. for (; i.pos < n;) {
  1405. const t = i.uint32();
  1406. switch (t >>> 3) {
  1407. case 1:
  1408. if (t !== 10) break;
  1409. a.username = i.string();
  1410. continue;
  1411. case 2:
  1412. if (t !== 18) break;
  1413. a.password = i.string();
  1414. continue
  1415. }
  1416. if ((t & 7) === 4 || t === 0) break;
  1417. i.skipType(t & 7)
  1418. }
  1419. return a
  1420. }, fromJSON(u) {
  1421. return {
  1422. username: o(u.username) ? globalThis.String(u.username) : "",
  1423. password: o(u.password) ? globalThis.String(u.password) : ""
  1424. }
  1425. }, toJSON(u) {
  1426. const e = {};
  1427. return u.username !== "" && (e.username = u.username), u.password !== "" && (e.password = u.password), e
  1428. }, create(u) {
  1429. return k0.fromPartial(u != null ? u : {})
  1430. }, fromPartial(u) {
  1431. var i, n;
  1432. const e = z3();
  1433. return e.username = (i = u.username) != null ? i : "", e.password = (n = u.password) != null ? n : "", e
  1434. }
  1435. };
  1436. function P3() {
  1437. return {
  1438. username: "",
  1439. password: new Uint8Array(0),
  1440. my_id: "",
  1441. my_name: "",
  1442. option: void 0,
  1443. file_transfer: void 0,
  1444. port_forward: void 0,
  1445. view_camera: void 0,
  1446. terminal: void 0,
  1447. video_ack_required: !1,
  1448. session_id: 0,
  1449. version: "",
  1450. os_login: void 0,
  1451. my_platform: "",
  1452. hwid: new Uint8Array(0)
  1453. }
  1454. }
  1455. const Y = {
  1456. encode(u, e = r.Writer.create()) {
  1457. 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 && O.encode(u.option, e.uint32(50).fork()).ldelim(), u.file_transfer !== void 0 && xu.encode(u.file_transfer, e.uint32(58).fork()).ldelim(), u.port_forward !== void 0 && g0.encode(u.port_forward, e.uint32(66).fork()).ldelim(), u.view_camera !== void 0 && yu.encode(u.view_camera, e.uint32(122).fork()).ldelim(), u.terminal !== void 0 && bu.encode(u.terminal, e.uint32(130).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 && k0.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
  1458. }, decode(u, e) {
  1459. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1460. let n = e === void 0 ? i.len : i.pos + e;
  1461. const a = P3();
  1462. for (; i.pos < n;) {
  1463. const t = i.uint32();
  1464. switch (t >>> 3) {
  1465. case 1:
  1466. if (t !== 10) break;
  1467. a.username = i.string();
  1468. continue;
  1469. case 2:
  1470. if (t !== 18) break;
  1471. a.password = i.bytes();
  1472. continue;
  1473. case 4:
  1474. if (t !== 34) break;
  1475. a.my_id = i.string();
  1476. continue;
  1477. case 5:
  1478. if (t !== 42) break;
  1479. a.my_name = i.string();
  1480. continue;
  1481. case 6:
  1482. if (t !== 50) break;
  1483. a.option = O.decode(i, i.uint32());
  1484. continue;
  1485. case 7:
  1486. if (t !== 58) break;
  1487. a.file_transfer = xu.decode(i, i.uint32());
  1488. continue;
  1489. case 8:
  1490. if (t !== 66) break;
  1491. a.port_forward = g0.decode(i, i.uint32());
  1492. continue;
  1493. case 15:
  1494. if (t !== 122) break;
  1495. a.view_camera = yu.decode(i, i.uint32());
  1496. continue;
  1497. case 16:
  1498. if (t !== 130) break;
  1499. a.terminal = bu.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 = W(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 = k0.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) ? T(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) ? O.fromJSON(u.option) : void 0,
  1537. file_transfer: o(u.file_transfer) ? xu.fromJSON(u.file_transfer) : void 0,
  1538. port_forward: o(u.port_forward) ? g0.fromJSON(u.port_forward) : void 0,
  1539. view_camera: o(u.view_camera) ? yu.fromJSON(u.view_camera) : void 0,
  1540. terminal: o(u.terminal) ? bu.fromJSON(u.terminal) : void 0,
  1541. video_ack_required: o(u.video_ack_required) ? globalThis.Boolean(u.video_ack_required) : !1,
  1542. session_id: o(u.session_id) ? globalThis.Number(u.session_id) : 0,
  1543. version: o(u.version) ? globalThis.String(u.version) : "",
  1544. os_login: o(u.os_login) ? k0.fromJSON(u.os_login) : void 0,
  1545. my_platform: o(u.my_platform) ? globalThis.String(u.my_platform) : "",
  1546. hwid: o(u.hwid) ? T(u.hwid) : new Uint8Array(0)
  1547. }
  1548. }, toJSON(u) {
  1549. const e = {};
  1550. return u.username !== "" && (e.username = u.username), u.password.length !== 0 && (e.password = N(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 = O.toJSON(u.option)), u.file_transfer !== void 0 && (e.file_transfer = xu.toJSON(u.file_transfer)), u.port_forward !== void 0 && (e.port_forward = g0.toJSON(u.port_forward)), u.view_camera !== void 0 && (e.view_camera = yu.toJSON(u.view_camera)), u.terminal !== void 0 && (e.terminal = bu.toJSON(u.terminal)), 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 = k0.toJSON(u.os_login)), u.my_platform !== "" && (e.my_platform = u.my_platform), u.hwid.length !== 0 && (e.hwid = N(u.hwid)), e
  1551. }, create(u) {
  1552. return Y.fromPartial(u != null ? u : {})
  1553. }, fromPartial(u) {
  1554. var i, n, a, t, s, E, D, d, C;
  1555. const e = P3();
  1556. 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 ? O.fromPartial(u.option) : void 0, e.file_transfer = u.file_transfer !== void 0 && u.file_transfer !== null ? xu.fromPartial(u.file_transfer) : void 0, e.port_forward = u.port_forward !== void 0 && u.port_forward !== null ? g0.fromPartial(u.port_forward) : void 0, e.view_camera = u.view_camera !== void 0 && u.view_camera !== null ? yu.fromPartial(u.view_camera) : void 0, e.terminal = u.terminal !== void 0 && u.terminal !== null ? bu.fromPartial(u.terminal) : 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 = (D = u.version) != null ? D : "", e.os_login = u.os_login !== void 0 && u.os_login !== null ? k0.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
  1557. }
  1558. };
  1559. function R3() {
  1560. return {service_id: ""}
  1561. }
  1562. const bu = {
  1563. encode(u, e = r.Writer.create()) {
  1564. return u.service_id !== "" && e.uint32(10).string(u.service_id), e
  1565. }, decode(u, e) {
  1566. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1567. let n = e === void 0 ? i.len : i.pos + e;
  1568. const a = R3();
  1569. for (; i.pos < n;) {
  1570. const t = i.uint32();
  1571. switch (t >>> 3) {
  1572. case 1:
  1573. if (t !== 10) break;
  1574. a.service_id = i.string();
  1575. continue
  1576. }
  1577. if ((t & 7) === 4 || t === 0) break;
  1578. i.skipType(t & 7)
  1579. }
  1580. return a
  1581. }, fromJSON(u) {
  1582. return {service_id: o(u.service_id) ? globalThis.String(u.service_id) : ""}
  1583. }, toJSON(u) {
  1584. const e = {};
  1585. return u.service_id !== "" && (e.service_id = u.service_id), e
  1586. }, create(u) {
  1587. return bu.fromPartial(u != null ? u : {})
  1588. }, fromPartial(u) {
  1589. var i;
  1590. const e = R3();
  1591. return e.service_id = (i = u.service_id) != null ? i : "", e
  1592. }
  1593. };
  1594. function I3() {
  1595. return {code: "", hwid: new Uint8Array(0)}
  1596. }
  1597. const wu = {
  1598. encode(u, e = r.Writer.create()) {
  1599. return u.code !== "" && e.uint32(10).string(u.code), u.hwid.length !== 0 && e.uint32(18).bytes(u.hwid), e
  1600. }, decode(u, e) {
  1601. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1602. let n = e === void 0 ? i.len : i.pos + e;
  1603. const a = I3();
  1604. for (; i.pos < n;) {
  1605. const t = i.uint32();
  1606. switch (t >>> 3) {
  1607. case 1:
  1608. if (t !== 10) break;
  1609. a.code = i.string();
  1610. continue;
  1611. case 2:
  1612. if (t !== 18) break;
  1613. a.hwid = i.bytes();
  1614. continue
  1615. }
  1616. if ((t & 7) === 4 || t === 0) break;
  1617. i.skipType(t & 7)
  1618. }
  1619. return a
  1620. }, fromJSON(u) {
  1621. return {code: o(u.code) ? globalThis.String(u.code) : "", hwid: o(u.hwid) ? T(u.hwid) : new Uint8Array(0)}
  1622. }, toJSON(u) {
  1623. const e = {};
  1624. return u.code !== "" && (e.code = u.code), u.hwid.length !== 0 && (e.hwid = N(u.hwid)), e
  1625. }, create(u) {
  1626. return wu.fromPartial(u != null ? u : {})
  1627. }, fromPartial(u) {
  1628. var i, n;
  1629. const e = I3();
  1630. return e.code = (i = u.code) != null ? i : "", e.hwid = (n = u.hwid) != null ? n : new Uint8Array(0), e
  1631. }
  1632. };
  1633. function T3() {
  1634. return {text: ""}
  1635. }
  1636. const Su = {
  1637. encode(u, e = r.Writer.create()) {
  1638. return u.text !== "" && e.uint32(10).string(u.text), e
  1639. }, decode(u, e) {
  1640. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1641. let n = e === void 0 ? i.len : i.pos + e;
  1642. const a = T3();
  1643. for (; i.pos < n;) {
  1644. const t = i.uint32();
  1645. switch (t >>> 3) {
  1646. case 1:
  1647. if (t !== 10) break;
  1648. a.text = i.string();
  1649. continue
  1650. }
  1651. if ((t & 7) === 4 || t === 0) break;
  1652. i.skipType(t & 7)
  1653. }
  1654. return a
  1655. }, fromJSON(u) {
  1656. return {text: o(u.text) ? globalThis.String(u.text) : ""}
  1657. }, toJSON(u) {
  1658. const e = {};
  1659. return u.text !== "" && (e.text = u.text), e
  1660. }, create(u) {
  1661. return Su.fromPartial(u != null ? u : {})
  1662. }, fromPartial(u) {
  1663. var i;
  1664. const e = T3();
  1665. return e.text = (i = u.text) != null ? i : "", e
  1666. }
  1667. };
  1668. function N3() {
  1669. return {privacy_mode: !1, terminal: !1}
  1670. }
  1671. const h0 = {
  1672. encode(u, e = r.Writer.create()) {
  1673. return u.privacy_mode !== !1 && e.uint32(8).bool(u.privacy_mode), u.terminal !== !1 && e.uint32(16).bool(u.terminal), e
  1674. }, decode(u, e) {
  1675. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1676. let n = e === void 0 ? i.len : i.pos + e;
  1677. const a = N3();
  1678. for (; i.pos < n;) {
  1679. const t = i.uint32();
  1680. switch (t >>> 3) {
  1681. case 1:
  1682. if (t !== 8) break;
  1683. a.privacy_mode = i.bool();
  1684. continue;
  1685. case 2:
  1686. if (t !== 16) break;
  1687. a.terminal = i.bool();
  1688. continue
  1689. }
  1690. if ((t & 7) === 4 || t === 0) break;
  1691. i.skipType(t & 7)
  1692. }
  1693. return a
  1694. }, fromJSON(u) {
  1695. return {
  1696. privacy_mode: o(u.privacy_mode) ? globalThis.Boolean(u.privacy_mode) : !1,
  1697. terminal: o(u.terminal) ? globalThis.Boolean(u.terminal) : !1
  1698. }
  1699. }, toJSON(u) {
  1700. const e = {};
  1701. return u.privacy_mode !== !1 && (e.privacy_mode = u.privacy_mode), u.terminal !== !1 && (e.terminal = u.terminal), e
  1702. }, create(u) {
  1703. return h0.fromPartial(u != null ? u : {})
  1704. }, fromPartial(u) {
  1705. var i, n;
  1706. const e = N3();
  1707. return e.privacy_mode = (i = u.privacy_mode) != null ? i : !1, e.terminal = (n = u.terminal) != null ? n : !1, e
  1708. }
  1709. };
  1710. function j3() {
  1711. return {vp8: !1, vp9: !1, av1: !1, h264: !1, h265: !1}
  1712. }
  1713. const $ = {
  1714. encode(u, e = r.Writer.create()) {
  1715. 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
  1716. }, decode(u, e) {
  1717. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1718. let n = e === void 0 ? i.len : i.pos + e;
  1719. const a = j3();
  1720. for (; i.pos < n;) {
  1721. const t = i.uint32();
  1722. switch (t >>> 3) {
  1723. case 1:
  1724. if (t !== 8) break;
  1725. a.vp8 = i.bool();
  1726. continue;
  1727. case 2:
  1728. if (t !== 16) break;
  1729. a.vp9 = i.bool();
  1730. continue;
  1731. case 3:
  1732. if (t !== 24) break;
  1733. a.av1 = i.bool();
  1734. continue;
  1735. case 4:
  1736. if (t !== 32) break;
  1737. a.h264 = i.bool();
  1738. continue;
  1739. case 5:
  1740. if (t !== 40) break;
  1741. a.h265 = i.bool();
  1742. continue
  1743. }
  1744. if ((t & 7) === 4 || t === 0) break;
  1745. i.skipType(t & 7)
  1746. }
  1747. return a
  1748. }, fromJSON(u) {
  1749. return {
  1750. vp8: o(u.vp8) ? globalThis.Boolean(u.vp8) : !1,
  1751. vp9: o(u.vp9) ? globalThis.Boolean(u.vp9) : !1,
  1752. av1: o(u.av1) ? globalThis.Boolean(u.av1) : !1,
  1753. h264: o(u.h264) ? globalThis.Boolean(u.h264) : !1,
  1754. h265: o(u.h265) ? globalThis.Boolean(u.h265) : !1
  1755. }
  1756. }, toJSON(u) {
  1757. const e = {};
  1758. 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
  1759. }, create(u) {
  1760. return $.fromPartial(u != null ? u : {})
  1761. }, fromPartial(u) {
  1762. var i, n, a, t, s;
  1763. const e = j3();
  1764. 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
  1765. }
  1766. };
  1767. function O3() {
  1768. return {h264: !1, h265: !1, vp8: !1, av1: !1, i444: void 0}
  1769. }
  1770. const uu = {
  1771. encode(u, e = r.Writer.create()) {
  1772. 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 && $.encode(u.i444, e.uint32(42).fork()).ldelim(), e
  1773. }, decode(u, e) {
  1774. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1775. let n = e === void 0 ? i.len : i.pos + e;
  1776. const a = O3();
  1777. for (; i.pos < n;) {
  1778. const t = i.uint32();
  1779. switch (t >>> 3) {
  1780. case 1:
  1781. if (t !== 8) break;
  1782. a.h264 = i.bool();
  1783. continue;
  1784. case 2:
  1785. if (t !== 16) break;
  1786. a.h265 = i.bool();
  1787. continue;
  1788. case 3:
  1789. if (t !== 24) break;
  1790. a.vp8 = i.bool();
  1791. continue;
  1792. case 4:
  1793. if (t !== 32) break;
  1794. a.av1 = i.bool();
  1795. continue;
  1796. case 5:
  1797. if (t !== 42) break;
  1798. a.i444 = $.decode(i, i.uint32());
  1799. continue
  1800. }
  1801. if ((t & 7) === 4 || t === 0) break;
  1802. i.skipType(t & 7)
  1803. }
  1804. return a
  1805. }, fromJSON(u) {
  1806. return {
  1807. h264: o(u.h264) ? globalThis.Boolean(u.h264) : !1,
  1808. h265: o(u.h265) ? globalThis.Boolean(u.h265) : !1,
  1809. vp8: o(u.vp8) ? globalThis.Boolean(u.vp8) : !1,
  1810. av1: o(u.av1) ? globalThis.Boolean(u.av1) : !1,
  1811. i444: o(u.i444) ? $.fromJSON(u.i444) : void 0
  1812. }
  1813. }, toJSON(u) {
  1814. const e = {};
  1815. 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 = $.toJSON(u.i444)), e
  1816. }, create(u) {
  1817. return uu.fromPartial(u != null ? u : {})
  1818. }, fromPartial(u) {
  1819. var i, n, a, t;
  1820. const e = O3();
  1821. 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 ? $.fromPartial(u.i444) : void 0, e
  1822. }
  1823. };
  1824. function U3() {
  1825. return {
  1826. username: "",
  1827. hostname: "",
  1828. platform: "",
  1829. displays: [],
  1830. current_display: 0,
  1831. sas_enabled: !1,
  1832. version: "",
  1833. features: void 0,
  1834. encoding: void 0,
  1835. resolutions: void 0,
  1836. platform_additions: "",
  1837. windows_sessions: void 0
  1838. }
  1839. }
  1840. const tu = {
  1841. encode(u, e = r.Writer.create()) {
  1842. u.username !== "" && e.uint32(10).string(u.username), u.hostname !== "" && e.uint32(18).string(u.hostname), u.platform !== "" && e.uint32(26).string(u.platform);
  1843. for (const i of u.displays) v0.encode(i, e.uint32(34).fork()).ldelim();
  1844. 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 && h0.encode(u.features, e.uint32(74).fork()).ldelim(), u.encoding !== void 0 && uu.encode(u.encoding, e.uint32(82).fork()).ldelim(), u.resolutions !== void 0 && nu.encode(u.resolutions, e.uint32(90).fork()).ldelim(), u.platform_additions !== "" && e.uint32(98).string(u.platform_additions), u.windows_sessions !== void 0 && re.encode(u.windows_sessions, e.uint32(106).fork()).ldelim(), e
  1845. }, decode(u, e) {
  1846. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1847. let n = e === void 0 ? i.len : i.pos + e;
  1848. const a = U3();
  1849. for (; i.pos < n;) {
  1850. const t = i.uint32();
  1851. switch (t >>> 3) {
  1852. case 1:
  1853. if (t !== 10) break;
  1854. a.username = i.string();
  1855. continue;
  1856. case 2:
  1857. if (t !== 18) break;
  1858. a.hostname = i.string();
  1859. continue;
  1860. case 3:
  1861. if (t !== 26) break;
  1862. a.platform = i.string();
  1863. continue;
  1864. case 4:
  1865. if (t !== 34) break;
  1866. a.displays.push(v0.decode(i, i.uint32()));
  1867. continue;
  1868. case 5:
  1869. if (t !== 40) break;
  1870. a.current_display = i.int32();
  1871. continue;
  1872. case 6:
  1873. if (t !== 48) break;
  1874. a.sas_enabled = i.bool();
  1875. continue;
  1876. case 7:
  1877. if (t !== 58) break;
  1878. a.version = i.string();
  1879. continue;
  1880. case 9:
  1881. if (t !== 74) break;
  1882. a.features = h0.decode(i, i.uint32());
  1883. continue;
  1884. case 10:
  1885. if (t !== 82) break;
  1886. a.encoding = uu.decode(i, i.uint32());
  1887. continue;
  1888. case 11:
  1889. if (t !== 90) break;
  1890. a.resolutions = nu.decode(i, i.uint32());
  1891. continue;
  1892. case 12:
  1893. if (t !== 98) break;
  1894. a.platform_additions = i.string();
  1895. continue;
  1896. case 13:
  1897. if (t !== 106) break;
  1898. a.windows_sessions = re.decode(i, i.uint32());
  1899. continue
  1900. }
  1901. if ((t & 7) === 4 || t === 0) break;
  1902. i.skipType(t & 7)
  1903. }
  1904. return a
  1905. }, fromJSON(u) {
  1906. return {
  1907. username: o(u.username) ? globalThis.String(u.username) : "",
  1908. hostname: o(u.hostname) ? globalThis.String(u.hostname) : "",
  1909. platform: o(u.platform) ? globalThis.String(u.platform) : "",
  1910. displays: globalThis.Array.isArray(u == null ? void 0 : u.displays) ? u.displays.map(e => v0.fromJSON(e)) : [],
  1911. current_display: o(u.current_display) ? globalThis.Number(u.current_display) : 0,
  1912. sas_enabled: o(u.sas_enabled) ? globalThis.Boolean(u.sas_enabled) : !1,
  1913. version: o(u.version) ? globalThis.String(u.version) : "",
  1914. features: o(u.features) ? h0.fromJSON(u.features) : void 0,
  1915. encoding: o(u.encoding) ? uu.fromJSON(u.encoding) : void 0,
  1916. resolutions: o(u.resolutions) ? nu.fromJSON(u.resolutions) : void 0,
  1917. platform_additions: o(u.platform_additions) ? globalThis.String(u.platform_additions) : "",
  1918. windows_sessions: o(u.windows_sessions) ? re.fromJSON(u.windows_sessions) : void 0
  1919. }
  1920. }, toJSON(u) {
  1921. var i;
  1922. const e = {};
  1923. 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 => v0.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 = h0.toJSON(u.features)), u.encoding !== void 0 && (e.encoding = uu.toJSON(u.encoding)), u.resolutions !== void 0 && (e.resolutions = nu.toJSON(u.resolutions)), u.platform_additions !== "" && (e.platform_additions = u.platform_additions), u.windows_sessions !== void 0 && (e.windows_sessions = re.toJSON(u.windows_sessions)), e
  1924. }, create(u) {
  1925. return tu.fromPartial(u != null ? u : {})
  1926. }, fromPartial(u) {
  1927. var i, n, a, t, s, E, D, d;
  1928. const e = U3();
  1929. 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 => v0.fromPartial(C))) || [], e.current_display = (s = u.current_display) != null ? s : 0, e.sas_enabled = (E = u.sas_enabled) != null ? E : !1, e.version = (D = u.version) != null ? D : "", e.features = u.features !== void 0 && u.features !== null ? h0.fromPartial(u.features) : void 0, e.encoding = u.encoding !== void 0 && u.encoding !== null ? uu.fromPartial(u.encoding) : void 0, e.resolutions = u.resolutions !== void 0 && u.resolutions !== null ? nu.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 ? re.fromPartial(u.windows_sessions) : void 0, e
  1930. }
  1931. };
  1932. function M3() {
  1933. return {sid: 0, name: ""}
  1934. }
  1935. const f0 = {
  1936. encode(u, e = r.Writer.create()) {
  1937. return u.sid !== 0 && e.uint32(8).uint32(u.sid), u.name !== "" && e.uint32(18).string(u.name), e
  1938. }, decode(u, e) {
  1939. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1940. let n = e === void 0 ? i.len : i.pos + e;
  1941. const a = M3();
  1942. for (; i.pos < n;) {
  1943. const t = i.uint32();
  1944. switch (t >>> 3) {
  1945. case 1:
  1946. if (t !== 8) break;
  1947. a.sid = i.uint32();
  1948. continue;
  1949. case 2:
  1950. if (t !== 18) break;
  1951. a.name = i.string();
  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 {sid: o(u.sid) ? globalThis.Number(u.sid) : 0, name: o(u.name) ? globalThis.String(u.name) : ""}
  1960. }, toJSON(u) {
  1961. const e = {};
  1962. return u.sid !== 0 && (e.sid = Math.round(u.sid)), u.name !== "" && (e.name = u.name), e
  1963. }, create(u) {
  1964. return f0.fromPartial(u != null ? u : {})
  1965. }, fromPartial(u) {
  1966. var i, n;
  1967. const e = M3();
  1968. return e.sid = (i = u.sid) != null ? i : 0, e.name = (n = u.name) != null ? n : "", e
  1969. }
  1970. };
  1971. function L3() {
  1972. return {error: void 0, peer_info: void 0, enable_trusted_devices: !1}
  1973. }
  1974. const x0 = {
  1975. encode(u, e = r.Writer.create()) {
  1976. return u.error !== void 0 && e.uint32(10).string(u.error), u.peer_info !== void 0 && tu.encode(u.peer_info, e.uint32(18).fork()).ldelim(), u.enable_trusted_devices !== !1 && e.uint32(24).bool(u.enable_trusted_devices), e
  1977. }, decode(u, e) {
  1978. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1979. let n = e === void 0 ? i.len : i.pos + e;
  1980. const a = L3();
  1981. for (; i.pos < n;) {
  1982. const t = i.uint32();
  1983. switch (t >>> 3) {
  1984. case 1:
  1985. if (t !== 10) break;
  1986. a.error = i.string();
  1987. continue;
  1988. case 2:
  1989. if (t !== 18) break;
  1990. a.peer_info = tu.decode(i, i.uint32());
  1991. continue;
  1992. case 3:
  1993. if (t !== 24) break;
  1994. a.enable_trusted_devices = i.bool();
  1995. continue
  1996. }
  1997. if ((t & 7) === 4 || t === 0) break;
  1998. i.skipType(t & 7)
  1999. }
  2000. return a
  2001. }, fromJSON(u) {
  2002. return {
  2003. error: o(u.error) ? globalThis.String(u.error) : void 0,
  2004. peer_info: o(u.peer_info) ? tu.fromJSON(u.peer_info) : void 0,
  2005. enable_trusted_devices: o(u.enable_trusted_devices) ? globalThis.Boolean(u.enable_trusted_devices) : !1
  2006. }
  2007. }, toJSON(u) {
  2008. const e = {};
  2009. return u.error !== void 0 && (e.error = u.error), u.peer_info !== void 0 && (e.peer_info = tu.toJSON(u.peer_info)), u.enable_trusted_devices !== !1 && (e.enable_trusted_devices = u.enable_trusted_devices), e
  2010. }, create(u) {
  2011. return x0.fromPartial(u != null ? u : {})
  2012. }, fromPartial(u) {
  2013. var i, n;
  2014. const e = L3();
  2015. return e.error = (i = u.error) != null ? i : void 0, e.peer_info = u.peer_info !== void 0 && u.peer_info !== null ? tu.fromPartial(u.peer_info) : void 0, e.enable_trusted_devices = (n = u.enable_trusted_devices) != null ? n : !1, e
  2016. }
  2017. };
  2018. function W3() {
  2019. return {scale: 0}
  2020. }
  2021. const y0 = {
  2022. encode(u, e = r.Writer.create()) {
  2023. return u.scale !== 0 && e.uint32(8).int32(u.scale), e
  2024. }, decode(u, e) {
  2025. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2026. let n = e === void 0 ? i.len : i.pos + e;
  2027. const a = W3();
  2028. for (; i.pos < n;) {
  2029. const t = i.uint32();
  2030. switch (t >>> 3) {
  2031. case 1:
  2032. if (t !== 8) break;
  2033. a.scale = i.int32();
  2034. continue
  2035. }
  2036. if ((t & 7) === 4 || t === 0) break;
  2037. i.skipType(t & 7)
  2038. }
  2039. return a
  2040. }, fromJSON(u) {
  2041. return {scale: o(u.scale) ? globalThis.Number(u.scale) : 0}
  2042. }, toJSON(u) {
  2043. const e = {};
  2044. return u.scale !== 0 && (e.scale = Math.round(u.scale)), e
  2045. }, create(u) {
  2046. return y0.fromPartial(u != null ? u : {})
  2047. }, fromPartial(u) {
  2048. var i;
  2049. const e = W3();
  2050. return e.scale = (i = u.scale) != null ? i : 0, e
  2051. }
  2052. };
  2053. function V3() {
  2054. return {x: 0, y: 0}
  2055. }
  2056. const b0 = {
  2057. encode(u, e = r.Writer.create()) {
  2058. return u.x !== 0 && e.uint32(8).int32(u.x), u.y !== 0 && e.uint32(16).int32(u.y), e
  2059. }, decode(u, e) {
  2060. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2061. let n = e === void 0 ? i.len : i.pos + e;
  2062. const a = V3();
  2063. for (; i.pos < n;) {
  2064. const t = i.uint32();
  2065. switch (t >>> 3) {
  2066. case 1:
  2067. if (t !== 8) break;
  2068. a.x = i.int32();
  2069. continue;
  2070. case 2:
  2071. if (t !== 16) break;
  2072. a.y = i.int32();
  2073. continue
  2074. }
  2075. if ((t & 7) === 4 || t === 0) break;
  2076. i.skipType(t & 7)
  2077. }
  2078. return a
  2079. }, fromJSON(u) {
  2080. return {x: o(u.x) ? globalThis.Number(u.x) : 0, y: o(u.y) ? globalThis.Number(u.y) : 0}
  2081. }, toJSON(u) {
  2082. const e = {};
  2083. return u.x !== 0 && (e.x = Math.round(u.x)), u.y !== 0 && (e.y = Math.round(u.y)), e
  2084. }, create(u) {
  2085. return b0.fromPartial(u != null ? u : {})
  2086. }, fromPartial(u) {
  2087. var i, n;
  2088. const e = V3();
  2089. return e.x = (i = u.x) != null ? i : 0, e.y = (n = u.y) != null ? n : 0, e
  2090. }
  2091. };
  2092. function q3() {
  2093. return {x: 0, y: 0}
  2094. }
  2095. const w0 = {
  2096. encode(u, e = r.Writer.create()) {
  2097. return u.x !== 0 && e.uint32(8).int32(u.x), u.y !== 0 && e.uint32(16).int32(u.y), e
  2098. }, decode(u, e) {
  2099. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2100. let n = e === void 0 ? i.len : i.pos + e;
  2101. const a = q3();
  2102. for (; i.pos < n;) {
  2103. const t = i.uint32();
  2104. switch (t >>> 3) {
  2105. case 1:
  2106. if (t !== 8) break;
  2107. a.x = i.int32();
  2108. continue;
  2109. case 2:
  2110. if (t !== 16) break;
  2111. a.y = i.int32();
  2112. continue
  2113. }
  2114. if ((t & 7) === 4 || t === 0) break;
  2115. i.skipType(t & 7)
  2116. }
  2117. return a
  2118. }, fromJSON(u) {
  2119. return {x: o(u.x) ? globalThis.Number(u.x) : 0, y: o(u.y) ? globalThis.Number(u.y) : 0}
  2120. }, toJSON(u) {
  2121. const e = {};
  2122. return u.x !== 0 && (e.x = Math.round(u.x)), u.y !== 0 && (e.y = Math.round(u.y)), e
  2123. }, create(u) {
  2124. return w0.fromPartial(u != null ? u : {})
  2125. }, fromPartial(u) {
  2126. var i, n;
  2127. const e = q3();
  2128. return e.x = (i = u.x) != null ? i : 0, e.y = (n = u.y) != null ? n : 0, e
  2129. }
  2130. };
  2131. function K3() {
  2132. return {x: 0, y: 0}
  2133. }
  2134. const S0 = {
  2135. encode(u, e = r.Writer.create()) {
  2136. return u.x !== 0 && e.uint32(8).int32(u.x), u.y !== 0 && e.uint32(16).int32(u.y), e
  2137. }, decode(u, e) {
  2138. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2139. let n = e === void 0 ? i.len : i.pos + e;
  2140. const a = K3();
  2141. for (; i.pos < n;) {
  2142. const t = i.uint32();
  2143. switch (t >>> 3) {
  2144. case 1:
  2145. if (t !== 8) break;
  2146. a.x = i.int32();
  2147. continue;
  2148. case 2:
  2149. if (t !== 16) break;
  2150. a.y = i.int32();
  2151. continue
  2152. }
  2153. if ((t & 7) === 4 || t === 0) break;
  2154. i.skipType(t & 7)
  2155. }
  2156. return a
  2157. }, fromJSON(u) {
  2158. return {x: o(u.x) ? globalThis.Number(u.x) : 0, y: o(u.y) ? globalThis.Number(u.y) : 0}
  2159. }, toJSON(u) {
  2160. const e = {};
  2161. return u.x !== 0 && (e.x = Math.round(u.x)), u.y !== 0 && (e.y = Math.round(u.y)), e
  2162. }, create(u) {
  2163. return S0.fromPartial(u != null ? u : {})
  2164. }, fromPartial(u) {
  2165. var i, n;
  2166. const e = K3();
  2167. return e.x = (i = u.x) != null ? i : 0, e.y = (n = u.y) != null ? n : 0, e
  2168. }
  2169. };
  2170. function H3() {
  2171. return {scale_update: void 0, pan_start: void 0, pan_update: void 0, pan_end: void 0}
  2172. }
  2173. const z0 = {
  2174. encode(u, e = r.Writer.create()) {
  2175. return u.scale_update !== void 0 && y0.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 && w0.encode(u.pan_update, e.uint32(26).fork()).ldelim(), u.pan_end !== void 0 && S0.encode(u.pan_end, e.uint32(34).fork()).ldelim(), e
  2176. }, decode(u, e) {
  2177. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2178. let n = e === void 0 ? i.len : i.pos + e;
  2179. const a = H3();
  2180. for (; i.pos < n;) {
  2181. const t = i.uint32();
  2182. switch (t >>> 3) {
  2183. case 1:
  2184. if (t !== 10) break;
  2185. a.scale_update = y0.decode(i, i.uint32());
  2186. continue;
  2187. case 2:
  2188. if (t !== 18) break;
  2189. a.pan_start = b0.decode(i, i.uint32());
  2190. continue;
  2191. case 3:
  2192. if (t !== 26) break;
  2193. a.pan_update = w0.decode(i, i.uint32());
  2194. continue;
  2195. case 4:
  2196. if (t !== 34) break;
  2197. a.pan_end = S0.decode(i, i.uint32());
  2198. continue
  2199. }
  2200. if ((t & 7) === 4 || t === 0) break;
  2201. i.skipType(t & 7)
  2202. }
  2203. return a
  2204. }, fromJSON(u) {
  2205. return {
  2206. scale_update: o(u.scale_update) ? y0.fromJSON(u.scale_update) : void 0,
  2207. pan_start: o(u.pan_start) ? b0.fromJSON(u.pan_start) : void 0,
  2208. pan_update: o(u.pan_update) ? w0.fromJSON(u.pan_update) : void 0,
  2209. pan_end: o(u.pan_end) ? S0.fromJSON(u.pan_end) : void 0
  2210. }
  2211. }, toJSON(u) {
  2212. const e = {};
  2213. return u.scale_update !== void 0 && (e.scale_update = y0.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 = w0.toJSON(u.pan_update)), u.pan_end !== void 0 && (e.pan_end = S0.toJSON(u.pan_end)), e
  2214. }, create(u) {
  2215. return z0.fromPartial(u != null ? u : {})
  2216. }, fromPartial(u) {
  2217. const e = H3();
  2218. return e.scale_update = u.scale_update !== void 0 && u.scale_update !== null ? y0.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 ? w0.fromPartial(u.pan_update) : void 0, e.pan_end = u.pan_end !== void 0 && u.pan_end !== null ? S0.fromPartial(u.pan_end) : void 0, e
  2219. }
  2220. };
  2221. function J3() {
  2222. return {touch_event: void 0, modifiers: []}
  2223. }
  2224. const P0 = {
  2225. encode(u, e = r.Writer.create()) {
  2226. u.touch_event !== void 0 && z0.encode(u.touch_event, e.uint32(10).fork()).ldelim(), e.uint32(18).fork();
  2227. for (const i of u.modifiers) e.int32(i);
  2228. return e.ldelim(), e
  2229. }, decode(u, e) {
  2230. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2231. let n = e === void 0 ? i.len : i.pos + e;
  2232. const a = J3();
  2233. for (; i.pos < n;) {
  2234. const t = i.uint32();
  2235. switch (t >>> 3) {
  2236. case 1:
  2237. if (t !== 10) break;
  2238. a.touch_event = z0.decode(i, i.uint32());
  2239. continue;
  2240. case 2:
  2241. if (t === 16) {
  2242. a.modifiers.push(i.int32());
  2243. continue
  2244. }
  2245. if (t === 18) {
  2246. const s = i.uint32() + i.pos;
  2247. for (; i.pos < s;) a.modifiers.push(i.int32());
  2248. continue
  2249. }
  2250. break
  2251. }
  2252. if ((t & 7) === 4 || t === 0) break;
  2253. i.skipType(t & 7)
  2254. }
  2255. return a
  2256. }, fromJSON(u) {
  2257. return {
  2258. touch_event: o(u.touch_event) ? z0.fromJSON(u.touch_event) : void 0,
  2259. modifiers: globalThis.Array.isArray(u == null ? void 0 : u.modifiers) ? u.modifiers.map(e => Je(e)) : []
  2260. }
  2261. }, toJSON(u) {
  2262. var i;
  2263. const e = {};
  2264. return u.touch_event !== void 0 && (e.touch_event = z0.toJSON(u.touch_event)), (i = u.modifiers) != null && i.length && (e.modifiers = u.modifiers.map(n => E4(n))), e
  2265. }, create(u) {
  2266. return P0.fromPartial(u != null ? u : {})
  2267. }, fromPartial(u) {
  2268. var i;
  2269. const e = J3();
  2270. return e.touch_event = u.touch_event !== void 0 && u.touch_event !== null ? z0.fromPartial(u.touch_event) : void 0, e.modifiers = ((i = u.modifiers) == null ? void 0 : i.map(n => n)) || [], e
  2271. }
  2272. };
  2273. function G3() {
  2274. return {mask: 0, x: 0, y: 0, modifiers: []}
  2275. }
  2276. const zu = {
  2277. encode(u, e = r.Writer.create()) {
  2278. 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();
  2279. for (const i of u.modifiers) e.int32(i);
  2280. return e.ldelim(), e
  2281. }, decode(u, e) {
  2282. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2283. let n = e === void 0 ? i.len : i.pos + e;
  2284. const a = G3();
  2285. for (; i.pos < n;) {
  2286. const t = i.uint32();
  2287. switch (t >>> 3) {
  2288. case 1:
  2289. if (t !== 8) break;
  2290. a.mask = i.int32();
  2291. continue;
  2292. case 2:
  2293. if (t !== 16) break;
  2294. a.x = i.sint32();
  2295. continue;
  2296. case 3:
  2297. if (t !== 24) break;
  2298. a.y = i.sint32();
  2299. continue;
  2300. case 4:
  2301. if (t === 32) {
  2302. a.modifiers.push(i.int32());
  2303. continue
  2304. }
  2305. if (t === 34) {
  2306. const s = i.uint32() + i.pos;
  2307. for (; i.pos < s;) a.modifiers.push(i.int32());
  2308. continue
  2309. }
  2310. break
  2311. }
  2312. if ((t & 7) === 4 || t === 0) break;
  2313. i.skipType(t & 7)
  2314. }
  2315. return a
  2316. }, fromJSON(u) {
  2317. return {
  2318. mask: o(u.mask) ? globalThis.Number(u.mask) : 0,
  2319. x: o(u.x) ? globalThis.Number(u.x) : 0,
  2320. y: o(u.y) ? globalThis.Number(u.y) : 0,
  2321. modifiers: globalThis.Array.isArray(u == null ? void 0 : u.modifiers) ? u.modifiers.map(e => Je(e)) : []
  2322. }
  2323. }, toJSON(u) {
  2324. var i;
  2325. const e = {};
  2326. 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 => E4(n))), e
  2327. }, create(u) {
  2328. return zu.fromPartial(u != null ? u : {})
  2329. }, fromPartial(u) {
  2330. var i, n, a, t;
  2331. const e = G3();
  2332. 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
  2333. }
  2334. };
  2335. function Z3() {
  2336. return {
  2337. down: !1,
  2338. press: !1,
  2339. control_key: void 0,
  2340. chr: void 0,
  2341. unicode: void 0,
  2342. seq: void 0,
  2343. win2win_hotkey: void 0,
  2344. modifiers: [],
  2345. mode: 0
  2346. }
  2347. }
  2348. const I = {
  2349. encode(u, e = r.Writer.create()) {
  2350. 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();
  2351. for (const i of u.modifiers) e.int32(i);
  2352. return e.ldelim(), u.mode !== 0 && e.uint32(72).int32(u.mode), e
  2353. }, decode(u, e) {
  2354. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2355. let n = e === void 0 ? i.len : i.pos + e;
  2356. const a = Z3();
  2357. for (; i.pos < n;) {
  2358. const t = i.uint32();
  2359. switch (t >>> 3) {
  2360. case 1:
  2361. if (t !== 8) break;
  2362. a.down = i.bool();
  2363. continue;
  2364. case 2:
  2365. if (t !== 16) break;
  2366. a.press = i.bool();
  2367. continue;
  2368. case 3:
  2369. if (t !== 24) break;
  2370. a.control_key = i.int32();
  2371. continue;
  2372. case 4:
  2373. if (t !== 32) break;
  2374. a.chr = i.uint32();
  2375. continue;
  2376. case 5:
  2377. if (t !== 40) break;
  2378. a.unicode = i.uint32();
  2379. continue;
  2380. case 6:
  2381. if (t !== 50) break;
  2382. a.seq = i.string();
  2383. continue;
  2384. case 7:
  2385. if (t !== 56) break;
  2386. a.win2win_hotkey = i.uint32();
  2387. continue;
  2388. case 8:
  2389. if (t === 64) {
  2390. a.modifiers.push(i.int32());
  2391. continue
  2392. }
  2393. if (t === 66) {
  2394. const s = i.uint32() + i.pos;
  2395. for (; i.pos < s;) a.modifiers.push(i.int32());
  2396. continue
  2397. }
  2398. break;
  2399. case 9:
  2400. if (t !== 72) break;
  2401. a.mode = i.int32();
  2402. continue
  2403. }
  2404. if ((t & 7) === 4 || t === 0) break;
  2405. i.skipType(t & 7)
  2406. }
  2407. return a
  2408. }, fromJSON(u) {
  2409. return {
  2410. down: o(u.down) ? globalThis.Boolean(u.down) : !1,
  2411. press: o(u.press) ? globalThis.Boolean(u.press) : !1,
  2412. control_key: o(u.control_key) ? Je(u.control_key) : void 0,
  2413. chr: o(u.chr) ? globalThis.Number(u.chr) : void 0,
  2414. unicode: o(u.unicode) ? globalThis.Number(u.unicode) : void 0,
  2415. seq: o(u.seq) ? globalThis.String(u.seq) : void 0,
  2416. win2win_hotkey: o(u.win2win_hotkey) ? globalThis.Number(u.win2win_hotkey) : void 0,
  2417. modifiers: globalThis.Array.isArray(u == null ? void 0 : u.modifiers) ? u.modifiers.map(e => Je(e)) : [],
  2418. mode: o(u.mode) ? pn(u.mode) : 0
  2419. }
  2420. }, toJSON(u) {
  2421. var i;
  2422. const e = {};
  2423. return u.down !== !1 && (e.down = u.down), u.press !== !1 && (e.press = u.press), u.control_key !== void 0 && (e.control_key = E4(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 => E4(n))), u.mode !== 0 && (e.mode = An(u.mode)), e
  2424. }, create(u) {
  2425. return I.fromPartial(u != null ? u : {})
  2426. }, fromPartial(u) {
  2427. var i, n, a, t, s, E, D, d, C;
  2428. const e = Z3();
  2429. 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 = (D = u.win2win_hotkey) != null ? D : void 0, e.modifiers = ((d = u.modifiers) == null ? void 0 : d.map(c => c)) || [], e.mode = (C = u.mode) != null ? C : 0, e
  2430. }
  2431. };
  2432. function Q3() {
  2433. return {id: 0, hotx: 0, hoty: 0, width: 0, height: 0, colors: new Uint8Array(0)}
  2434. }
  2435. const R0 = {
  2436. encode(u, e = r.Writer.create()) {
  2437. 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
  2438. }, decode(u, e) {
  2439. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2440. let n = e === void 0 ? i.len : i.pos + e;
  2441. const a = Q3();
  2442. for (; i.pos < n;) {
  2443. const t = i.uint32();
  2444. switch (t >>> 3) {
  2445. case 1:
  2446. if (t !== 8) break;
  2447. a.id = W(i.uint64());
  2448. continue;
  2449. case 2:
  2450. if (t !== 16) break;
  2451. a.hotx = i.sint32();
  2452. continue;
  2453. case 3:
  2454. if (t !== 24) break;
  2455. a.hoty = i.sint32();
  2456. continue;
  2457. case 4:
  2458. if (t !== 32) break;
  2459. a.width = i.int32();
  2460. continue;
  2461. case 5:
  2462. if (t !== 40) break;
  2463. a.height = i.int32();
  2464. continue;
  2465. case 6:
  2466. if (t !== 50) break;
  2467. a.colors = i.bytes();
  2468. continue
  2469. }
  2470. if ((t & 7) === 4 || t === 0) break;
  2471. i.skipType(t & 7)
  2472. }
  2473. return a
  2474. }, fromJSON(u) {
  2475. return {
  2476. id: o(u.id) ? globalThis.Number(u.id) : 0,
  2477. hotx: o(u.hotx) ? globalThis.Number(u.hotx) : 0,
  2478. hoty: o(u.hoty) ? globalThis.Number(u.hoty) : 0,
  2479. width: o(u.width) ? globalThis.Number(u.width) : 0,
  2480. height: o(u.height) ? globalThis.Number(u.height) : 0,
  2481. colors: o(u.colors) ? T(u.colors) : new Uint8Array(0)
  2482. }
  2483. }, toJSON(u) {
  2484. const e = {};
  2485. 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 = N(u.colors)), e
  2486. }, create(u) {
  2487. return R0.fromPartial(u != null ? u : {})
  2488. }, fromPartial(u) {
  2489. var i, n, a, t, s, E;
  2490. const e = Q3();
  2491. 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
  2492. }
  2493. };
  2494. function X3() {
  2495. return {x: 0, y: 0}
  2496. }
  2497. const I0 = {
  2498. encode(u, e = r.Writer.create()) {
  2499. return u.x !== 0 && e.uint32(8).sint32(u.x), u.y !== 0 && e.uint32(16).sint32(u.y), e
  2500. }, decode(u, e) {
  2501. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2502. let n = e === void 0 ? i.len : i.pos + e;
  2503. const a = X3();
  2504. for (; i.pos < n;) {
  2505. const t = i.uint32();
  2506. switch (t >>> 3) {
  2507. case 1:
  2508. if (t !== 8) break;
  2509. a.x = i.sint32();
  2510. continue;
  2511. case 2:
  2512. if (t !== 16) break;
  2513. a.y = i.sint32();
  2514. continue
  2515. }
  2516. if ((t & 7) === 4 || t === 0) break;
  2517. i.skipType(t & 7)
  2518. }
  2519. return a
  2520. }, fromJSON(u) {
  2521. return {x: o(u.x) ? globalThis.Number(u.x) : 0, y: o(u.y) ? globalThis.Number(u.y) : 0}
  2522. }, toJSON(u) {
  2523. const e = {};
  2524. return u.x !== 0 && (e.x = Math.round(u.x)), u.y !== 0 && (e.y = Math.round(u.y)), e
  2525. }, create(u) {
  2526. return I0.fromPartial(u != null ? u : {})
  2527. }, fromPartial(u) {
  2528. var i, n;
  2529. const e = X3();
  2530. return e.x = (i = u.x) != null ? i : 0, e.y = (n = u.y) != null ? n : 0, e
  2531. }
  2532. };
  2533. function Y3() {
  2534. return {salt: "", challenge: ""}
  2535. }
  2536. const T0 = {
  2537. encode(u, e = r.Writer.create()) {
  2538. return u.salt !== "" && e.uint32(10).string(u.salt), u.challenge !== "" && e.uint32(18).string(u.challenge), e
  2539. }, decode(u, e) {
  2540. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2541. let n = e === void 0 ? i.len : i.pos + e;
  2542. const a = Y3();
  2543. for (; i.pos < n;) {
  2544. const t = i.uint32();
  2545. switch (t >>> 3) {
  2546. case 1:
  2547. if (t !== 10) break;
  2548. a.salt = i.string();
  2549. continue;
  2550. case 2:
  2551. if (t !== 18) break;
  2552. a.challenge = i.string();
  2553. continue
  2554. }
  2555. if ((t & 7) === 4 || t === 0) break;
  2556. i.skipType(t & 7)
  2557. }
  2558. return a
  2559. }, fromJSON(u) {
  2560. return {
  2561. salt: o(u.salt) ? globalThis.String(u.salt) : "",
  2562. challenge: o(u.challenge) ? globalThis.String(u.challenge) : ""
  2563. }
  2564. }, toJSON(u) {
  2565. const e = {};
  2566. return u.salt !== "" && (e.salt = u.salt), u.challenge !== "" && (e.challenge = u.challenge), e
  2567. }, create(u) {
  2568. return T0.fromPartial(u != null ? u : {})
  2569. }, fromPartial(u) {
  2570. var i, n;
  2571. const e = Y3();
  2572. return e.salt = (i = u.salt) != null ? i : "", e.challenge = (n = u.challenge) != null ? n : "", e
  2573. }
  2574. };
  2575. function $3() {
  2576. return {compress: !1, content: new Uint8Array(0), width: 0, height: 0, format: 0, special_name: ""}
  2577. }
  2578. const G = {
  2579. encode(u, e = r.Writer.create()) {
  2580. 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
  2581. }, decode(u, e) {
  2582. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2583. let n = e === void 0 ? i.len : i.pos + e;
  2584. const a = $3();
  2585. for (; i.pos < n;) {
  2586. const t = i.uint32();
  2587. switch (t >>> 3) {
  2588. case 1:
  2589. if (t !== 8) break;
  2590. a.compress = i.bool();
  2591. continue;
  2592. case 2:
  2593. if (t !== 18) break;
  2594. a.content = i.bytes();
  2595. continue;
  2596. case 3:
  2597. if (t !== 24) break;
  2598. a.width = i.int32();
  2599. continue;
  2600. case 4:
  2601. if (t !== 32) break;
  2602. a.height = i.int32();
  2603. continue;
  2604. case 5:
  2605. if (t !== 40) break;
  2606. a.format = i.int32();
  2607. continue;
  2608. case 6:
  2609. if (t !== 50) break;
  2610. a.special_name = i.string();
  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 {
  2619. compress: o(u.compress) ? globalThis.Boolean(u.compress) : !1,
  2620. content: o(u.content) ? T(u.content) : new Uint8Array(0),
  2621. width: o(u.width) ? globalThis.Number(u.width) : 0,
  2622. height: o(u.height) ? globalThis.Number(u.height) : 0,
  2623. format: o(u.format) ? mn(u.format) : 0,
  2624. special_name: o(u.special_name) ? globalThis.String(u.special_name) : ""
  2625. }
  2626. }, toJSON(u) {
  2627. const e = {};
  2628. return u.compress !== !1 && (e.compress = u.compress), u.content.length !== 0 && (e.content = N(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 = Fn(u.format)), u.special_name !== "" && (e.special_name = u.special_name), e
  2629. }, create(u) {
  2630. return G.fromPartial(u != null ? u : {})
  2631. }, fromPartial(u) {
  2632. var i, n, a, t, s, E;
  2633. const e = $3();
  2634. 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
  2635. }
  2636. };
  2637. function ui() {
  2638. return {clipboards: []}
  2639. }
  2640. const Pu = {
  2641. encode(u, e = r.Writer.create()) {
  2642. for (const i of u.clipboards) G.encode(i, e.uint32(10).fork()).ldelim();
  2643. return e
  2644. }, decode(u, e) {
  2645. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2646. let n = e === void 0 ? i.len : i.pos + e;
  2647. const a = ui();
  2648. for (; i.pos < n;) {
  2649. const t = i.uint32();
  2650. switch (t >>> 3) {
  2651. case 1:
  2652. if (t !== 10) break;
  2653. a.clipboards.push(G.decode(i, i.uint32()));
  2654. continue
  2655. }
  2656. if ((t & 7) === 4 || t === 0) break;
  2657. i.skipType(t & 7)
  2658. }
  2659. return a
  2660. }, fromJSON(u) {
  2661. return {clipboards: globalThis.Array.isArray(u == null ? void 0 : u.clipboards) ? u.clipboards.map(e => G.fromJSON(e)) : []}
  2662. }, toJSON(u) {
  2663. var i;
  2664. const e = {};
  2665. return (i = u.clipboards) != null && i.length && (e.clipboards = u.clipboards.map(n => G.toJSON(n))), e
  2666. }, create(u) {
  2667. return Pu.fromPartial(u != null ? u : {})
  2668. }, fromPartial(u) {
  2669. var i;
  2670. const e = ui();
  2671. return e.clipboards = ((i = u.clipboards) == null ? void 0 : i.map(n => G.fromPartial(n))) || [], e
  2672. }
  2673. };
  2674. function ei() {
  2675. return {entry_type: 0, name: "", is_hidden: !1, size: 0, modified_time: 0}
  2676. }
  2677. const Z = {
  2678. encode(u, e = r.Writer.create()) {
  2679. 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
  2680. }, decode(u, e) {
  2681. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2682. let n = e === void 0 ? i.len : i.pos + e;
  2683. const a = ei();
  2684. for (; i.pos < n;) {
  2685. const t = i.uint32();
  2686. switch (t >>> 3) {
  2687. case 1:
  2688. if (t !== 8) break;
  2689. a.entry_type = i.int32();
  2690. continue;
  2691. case 2:
  2692. if (t !== 18) break;
  2693. a.name = i.string();
  2694. continue;
  2695. case 3:
  2696. if (t !== 24) break;
  2697. a.is_hidden = i.bool();
  2698. continue;
  2699. case 4:
  2700. if (t !== 32) break;
  2701. a.size = W(i.uint64());
  2702. continue;
  2703. case 5:
  2704. if (t !== 40) break;
  2705. a.modified_time = W(i.uint64());
  2706. continue
  2707. }
  2708. if ((t & 7) === 4 || t === 0) break;
  2709. i.skipType(t & 7)
  2710. }
  2711. return a
  2712. }, fromJSON(u) {
  2713. return {
  2714. entry_type: o(u.entry_type) ? _n(u.entry_type) : 0,
  2715. name: o(u.name) ? globalThis.String(u.name) : "",
  2716. is_hidden: o(u.is_hidden) ? globalThis.Boolean(u.is_hidden) : !1,
  2717. size: o(u.size) ? globalThis.Number(u.size) : 0,
  2718. modified_time: o(u.modified_time) ? globalThis.Number(u.modified_time) : 0
  2719. }
  2720. }, toJSON(u) {
  2721. const e = {};
  2722. return u.entry_type !== 0 && (e.entry_type = vn(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
  2723. }, create(u) {
  2724. return Z.fromPartial(u != null ? u : {})
  2725. }, fromPartial(u) {
  2726. var i, n, a, t, s;
  2727. const e = ei();
  2728. 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
  2729. }
  2730. };
  2731. function ii() {
  2732. return {id: 0, path: "", entries: []}
  2733. }
  2734. const au = {
  2735. encode(u, e = r.Writer.create()) {
  2736. u.id !== 0 && e.uint32(8).int32(u.id), u.path !== "" && e.uint32(18).string(u.path);
  2737. for (const i of u.entries) Z.encode(i, e.uint32(26).fork()).ldelim();
  2738. return e
  2739. }, decode(u, e) {
  2740. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2741. let n = e === void 0 ? i.len : i.pos + e;
  2742. const a = ii();
  2743. for (; i.pos < n;) {
  2744. const t = i.uint32();
  2745. switch (t >>> 3) {
  2746. case 1:
  2747. if (t !== 8) break;
  2748. a.id = i.int32();
  2749. continue;
  2750. case 2:
  2751. if (t !== 18) break;
  2752. a.path = i.string();
  2753. continue;
  2754. case 3:
  2755. if (t !== 26) break;
  2756. a.entries.push(Z.decode(i, i.uint32()));
  2757. continue
  2758. }
  2759. if ((t & 7) === 4 || t === 0) break;
  2760. i.skipType(t & 7)
  2761. }
  2762. return a
  2763. }, fromJSON(u) {
  2764. return {
  2765. id: o(u.id) ? globalThis.Number(u.id) : 0,
  2766. path: o(u.path) ? globalThis.String(u.path) : "",
  2767. entries: globalThis.Array.isArray(u == null ? void 0 : u.entries) ? u.entries.map(e => Z.fromJSON(e)) : []
  2768. }
  2769. }, toJSON(u) {
  2770. var i;
  2771. const e = {};
  2772. 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 => Z.toJSON(n))), e
  2773. }, create(u) {
  2774. return au.fromPartial(u != null ? u : {})
  2775. }, fromPartial(u) {
  2776. var i, n, a;
  2777. const e = ii();
  2778. 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 => Z.fromPartial(t))) || [], e
  2779. }
  2780. };
  2781. function ti() {
  2782. return {path: "", include_hidden: !1}
  2783. }
  2784. const Ru = {
  2785. encode(u, e = r.Writer.create()) {
  2786. return u.path !== "" && e.uint32(10).string(u.path), u.include_hidden !== !1 && e.uint32(16).bool(u.include_hidden), e
  2787. }, decode(u, e) {
  2788. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2789. let n = e === void 0 ? i.len : i.pos + e;
  2790. const a = ti();
  2791. for (; i.pos < n;) {
  2792. const t = i.uint32();
  2793. switch (t >>> 3) {
  2794. case 1:
  2795. if (t !== 10) break;
  2796. a.path = i.string();
  2797. continue;
  2798. case 2:
  2799. if (t !== 16) break;
  2800. a.include_hidden = i.bool();
  2801. continue
  2802. }
  2803. if ((t & 7) === 4 || t === 0) break;
  2804. i.skipType(t & 7)
  2805. }
  2806. return a
  2807. }, fromJSON(u) {
  2808. return {
  2809. path: o(u.path) ? globalThis.String(u.path) : "",
  2810. include_hidden: o(u.include_hidden) ? globalThis.Boolean(u.include_hidden) : !1
  2811. }
  2812. }, toJSON(u) {
  2813. const e = {};
  2814. return u.path !== "" && (e.path = u.path), u.include_hidden !== !1 && (e.include_hidden = u.include_hidden), e
  2815. }, create(u) {
  2816. return Ru.fromPartial(u != null ? u : {})
  2817. }, fromPartial(u) {
  2818. var i, n;
  2819. const e = ti();
  2820. return e.path = (i = u.path) != null ? i : "", e.include_hidden = (n = u.include_hidden) != null ? n : !1, e
  2821. }
  2822. };
  2823. function ai() {
  2824. return {path: "", include_hidden: !1}
  2825. }
  2826. const Iu = {
  2827. encode(u, e = r.Writer.create()) {
  2828. return u.path !== "" && e.uint32(10).string(u.path), u.include_hidden !== !1 && e.uint32(16).bool(u.include_hidden), e
  2829. }, decode(u, e) {
  2830. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2831. let n = e === void 0 ? i.len : i.pos + e;
  2832. const a = ai();
  2833. for (; i.pos < n;) {
  2834. const t = i.uint32();
  2835. switch (t >>> 3) {
  2836. case 1:
  2837. if (t !== 10) break;
  2838. a.path = i.string();
  2839. continue;
  2840. case 2:
  2841. if (t !== 16) break;
  2842. a.include_hidden = i.bool();
  2843. continue
  2844. }
  2845. if ((t & 7) === 4 || t === 0) break;
  2846. i.skipType(t & 7)
  2847. }
  2848. return a
  2849. }, fromJSON(u) {
  2850. return {
  2851. path: o(u.path) ? globalThis.String(u.path) : "",
  2852. include_hidden: o(u.include_hidden) ? globalThis.Boolean(u.include_hidden) : !1
  2853. }
  2854. }, toJSON(u) {
  2855. const e = {};
  2856. return u.path !== "" && (e.path = u.path), u.include_hidden !== !1 && (e.include_hidden = u.include_hidden), e
  2857. }, create(u) {
  2858. return Iu.fromPartial(u != null ? u : {})
  2859. }, fromPartial(u) {
  2860. var i, n;
  2861. const e = ai();
  2862. return e.path = (i = u.path) != null ? i : "", e.include_hidden = (n = u.include_hidden) != null ? n : !1, e
  2863. }
  2864. };
  2865. function ni() {
  2866. return {path: "", empty_dirs: []}
  2867. }
  2868. const N0 = {
  2869. encode(u, e = r.Writer.create()) {
  2870. u.path !== "" && e.uint32(10).string(u.path);
  2871. for (const i of u.empty_dirs) au.encode(i, e.uint32(18).fork()).ldelim();
  2872. return 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 = ni();
  2877. for (; i.pos < n;) {
  2878. const t = i.uint32();
  2879. switch (t >>> 3) {
  2880. case 1:
  2881. if (t !== 10) break;
  2882. a.path = i.string();
  2883. continue;
  2884. case 2:
  2885. if (t !== 18) break;
  2886. a.empty_dirs.push(au.decode(i, i.uint32()));
  2887. continue
  2888. }
  2889. if ((t & 7) === 4 || t === 0) break;
  2890. i.skipType(t & 7)
  2891. }
  2892. return a
  2893. }, fromJSON(u) {
  2894. return {
  2895. path: o(u.path) ? globalThis.String(u.path) : "",
  2896. empty_dirs: globalThis.Array.isArray(u == null ? void 0 : u.empty_dirs) ? u.empty_dirs.map(e => au.fromJSON(e)) : []
  2897. }
  2898. }, toJSON(u) {
  2899. var i;
  2900. const e = {};
  2901. return u.path !== "" && (e.path = u.path), (i = u.empty_dirs) != null && i.length && (e.empty_dirs = u.empty_dirs.map(n => au.toJSON(n))), e
  2902. }, create(u) {
  2903. return N0.fromPartial(u != null ? u : {})
  2904. }, fromPartial(u) {
  2905. var i, n;
  2906. const e = ni();
  2907. return e.path = (i = u.path) != null ? i : "", e.empty_dirs = ((n = u.empty_dirs) == null ? void 0 : n.map(a => au.fromPartial(a))) || [], e
  2908. }
  2909. };
  2910. function oi() {
  2911. return {id: 0, path: "", include_hidden: !1}
  2912. }
  2913. const Tu = {
  2914. encode(u, e = r.Writer.create()) {
  2915. 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
  2916. }, decode(u, e) {
  2917. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2918. let n = e === void 0 ? i.len : i.pos + e;
  2919. const a = oi();
  2920. for (; i.pos < n;) {
  2921. const t = i.uint32();
  2922. switch (t >>> 3) {
  2923. case 1:
  2924. if (t !== 8) break;
  2925. a.id = i.int32();
  2926. continue;
  2927. case 2:
  2928. if (t !== 18) break;
  2929. a.path = i.string();
  2930. continue;
  2931. case 3:
  2932. if (t !== 24) break;
  2933. a.include_hidden = i.bool();
  2934. continue
  2935. }
  2936. if ((t & 7) === 4 || t === 0) break;
  2937. i.skipType(t & 7)
  2938. }
  2939. return a
  2940. }, fromJSON(u) {
  2941. return {
  2942. id: o(u.id) ? globalThis.Number(u.id) : 0,
  2943. path: o(u.path) ? globalThis.String(u.path) : "",
  2944. include_hidden: o(u.include_hidden) ? globalThis.Boolean(u.include_hidden) : !1
  2945. }
  2946. }, toJSON(u) {
  2947. const e = {};
  2948. 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
  2949. }, create(u) {
  2950. return Tu.fromPartial(u != null ? u : {})
  2951. }, fromPartial(u) {
  2952. var i, n, a;
  2953. const e = oi();
  2954. 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
  2955. }
  2956. };
  2957. function ri() {
  2958. return {id: 0, path: "", new_name: ""}
  2959. }
  2960. const Nu = {
  2961. encode(u, e = r.Writer.create()) {
  2962. 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
  2963. }, decode(u, e) {
  2964. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2965. let n = e === void 0 ? i.len : i.pos + e;
  2966. const a = ri();
  2967. for (; i.pos < n;) {
  2968. const t = i.uint32();
  2969. switch (t >>> 3) {
  2970. case 1:
  2971. if (t !== 8) break;
  2972. a.id = i.int32();
  2973. continue;
  2974. case 2:
  2975. if (t !== 18) break;
  2976. a.path = i.string();
  2977. continue;
  2978. case 3:
  2979. if (t !== 26) break;
  2980. a.new_name = i.string();
  2981. continue
  2982. }
  2983. if ((t & 7) === 4 || t === 0) break;
  2984. i.skipType(t & 7)
  2985. }
  2986. return a
  2987. }, fromJSON(u) {
  2988. return {
  2989. id: o(u.id) ? globalThis.Number(u.id) : 0,
  2990. path: o(u.path) ? globalThis.String(u.path) : "",
  2991. new_name: o(u.new_name) ? globalThis.String(u.new_name) : ""
  2992. }
  2993. }, toJSON(u) {
  2994. const e = {};
  2995. 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
  2996. }, create(u) {
  2997. return Nu.fromPartial(u != null ? u : {})
  2998. }, fromPartial(u) {
  2999. var i, n, a;
  3000. const e = ri();
  3001. 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
  3002. }
  3003. };
  3004. function si() {
  3005. return {
  3006. read_dir: void 0,
  3007. send: void 0,
  3008. receive: void 0,
  3009. create: void 0,
  3010. remove_dir: void 0,
  3011. remove_file: void 0,
  3012. all_files: void 0,
  3013. cancel: void 0,
  3014. send_confirm: void 0,
  3015. rename: void 0,
  3016. read_empty_dirs: void 0
  3017. }
  3018. }
  3019. const M = {
  3020. encode(u, e = r.Writer.create()) {
  3021. return u.read_dir !== void 0 && Ru.encode(u.read_dir, e.uint32(10).fork()).ldelim(), u.send !== void 0 && Lu.encode(u.send, e.uint32(18).fork()).ldelim(), u.receive !== void 0 && Vu.encode(u.receive, e.uint32(26).fork()).ldelim(), u.create !== void 0 && Hu.encode(u.create, e.uint32(34).fork()).ldelim(), u.remove_dir !== void 0 && qu.encode(u.remove_dir, e.uint32(42).fork()).ldelim(), u.remove_file !== void 0 && Ku.encode(u.remove_file, e.uint32(50).fork()).ldelim(), u.all_files !== void 0 && Tu.encode(u.all_files, e.uint32(58).fork()).ldelim(), u.cancel !== void 0 && ju.encode(u.cancel, e.uint32(66).fork()).ldelim(), u.send_confirm !== void 0 && Au.encode(u.send_confirm, e.uint32(74).fork()).ldelim(), u.rename !== void 0 && Nu.encode(u.rename, e.uint32(82).fork()).ldelim(), u.read_empty_dirs !== void 0 && Iu.encode(u.read_empty_dirs, e.uint32(90).fork()).ldelim(), e
  3022. }, decode(u, e) {
  3023. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3024. let n = e === void 0 ? i.len : i.pos + e;
  3025. const a = si();
  3026. for (; i.pos < n;) {
  3027. const t = i.uint32();
  3028. switch (t >>> 3) {
  3029. case 1:
  3030. if (t !== 10) break;
  3031. a.read_dir = Ru.decode(i, i.uint32());
  3032. continue;
  3033. case 2:
  3034. if (t !== 18) break;
  3035. a.send = Lu.decode(i, i.uint32());
  3036. continue;
  3037. case 3:
  3038. if (t !== 26) break;
  3039. a.receive = Vu.decode(i, i.uint32());
  3040. continue;
  3041. case 4:
  3042. if (t !== 34) break;
  3043. a.create = Hu.decode(i, i.uint32());
  3044. continue;
  3045. case 5:
  3046. if (t !== 42) break;
  3047. a.remove_dir = qu.decode(i, i.uint32());
  3048. continue;
  3049. case 6:
  3050. if (t !== 50) break;
  3051. a.remove_file = Ku.decode(i, i.uint32());
  3052. continue;
  3053. case 7:
  3054. if (t !== 58) break;
  3055. a.all_files = Tu.decode(i, i.uint32());
  3056. continue;
  3057. case 8:
  3058. if (t !== 66) break;
  3059. a.cancel = ju.decode(i, i.uint32());
  3060. continue;
  3061. case 9:
  3062. if (t !== 74) break;
  3063. a.send_confirm = Au.decode(i, i.uint32());
  3064. continue;
  3065. case 10:
  3066. if (t !== 82) break;
  3067. a.rename = Nu.decode(i, i.uint32());
  3068. continue;
  3069. case 11:
  3070. if (t !== 90) break;
  3071. a.read_empty_dirs = Iu.decode(i, i.uint32());
  3072. continue
  3073. }
  3074. if ((t & 7) === 4 || t === 0) break;
  3075. i.skipType(t & 7)
  3076. }
  3077. return a
  3078. }, fromJSON(u) {
  3079. return {
  3080. read_dir: o(u.read_dir) ? Ru.fromJSON(u.read_dir) : void 0,
  3081. send: o(u.send) ? Lu.fromJSON(u.send) : void 0,
  3082. receive: o(u.receive) ? Vu.fromJSON(u.receive) : void 0,
  3083. create: o(u.create) ? Hu.fromJSON(u.create) : void 0,
  3084. remove_dir: o(u.remove_dir) ? qu.fromJSON(u.remove_dir) : void 0,
  3085. remove_file: o(u.remove_file) ? Ku.fromJSON(u.remove_file) : void 0,
  3086. all_files: o(u.all_files) ? Tu.fromJSON(u.all_files) : void 0,
  3087. cancel: o(u.cancel) ? ju.fromJSON(u.cancel) : void 0,
  3088. send_confirm: o(u.send_confirm) ? Au.fromJSON(u.send_confirm) : void 0,
  3089. rename: o(u.rename) ? Nu.fromJSON(u.rename) : void 0,
  3090. read_empty_dirs: o(u.read_empty_dirs) ? Iu.fromJSON(u.read_empty_dirs) : void 0
  3091. }
  3092. }, toJSON(u) {
  3093. const e = {};
  3094. return u.read_dir !== void 0 && (e.read_dir = Ru.toJSON(u.read_dir)), u.send !== void 0 && (e.send = Lu.toJSON(u.send)), u.receive !== void 0 && (e.receive = Vu.toJSON(u.receive)), u.create !== void 0 && (e.create = Hu.toJSON(u.create)), u.remove_dir !== void 0 && (e.remove_dir = qu.toJSON(u.remove_dir)), u.remove_file !== void 0 && (e.remove_file = Ku.toJSON(u.remove_file)), u.all_files !== void 0 && (e.all_files = Tu.toJSON(u.all_files)), u.cancel !== void 0 && (e.cancel = ju.toJSON(u.cancel)), u.send_confirm !== void 0 && (e.send_confirm = Au.toJSON(u.send_confirm)), u.rename !== void 0 && (e.rename = Nu.toJSON(u.rename)), u.read_empty_dirs !== void 0 && (e.read_empty_dirs = Iu.toJSON(u.read_empty_dirs)), e
  3095. }, create(u) {
  3096. return M.fromPartial(u != null ? u : {})
  3097. }, fromPartial(u) {
  3098. const e = si();
  3099. return e.read_dir = u.read_dir !== void 0 && u.read_dir !== null ? Ru.fromPartial(u.read_dir) : void 0, e.send = u.send !== void 0 && u.send !== null ? Lu.fromPartial(u.send) : void 0, e.receive = u.receive !== void 0 && u.receive !== null ? Vu.fromPartial(u.receive) : void 0, e.create = u.create !== void 0 && u.create !== null ? Hu.fromPartial(u.create) : void 0, e.remove_dir = u.remove_dir !== void 0 && u.remove_dir !== null ? qu.fromPartial(u.remove_dir) : void 0, e.remove_file = u.remove_file !== void 0 && u.remove_file !== null ? Ku.fromPartial(u.remove_file) : void 0, e.all_files = u.all_files !== void 0 && u.all_files !== null ? Tu.fromPartial(u.all_files) : void 0, e.cancel = u.cancel !== void 0 && u.cancel !== null ? ju.fromPartial(u.cancel) : void 0, e.send_confirm = u.send_confirm !== void 0 && u.send_confirm !== null ? Au.fromPartial(u.send_confirm) : void 0, e.rename = u.rename !== void 0 && u.rename !== null ? Nu.fromPartial(u.rename) : void 0, e.read_empty_dirs = u.read_empty_dirs !== void 0 && u.read_empty_dirs !== null ? Iu.fromPartial(u.read_empty_dirs) : void 0, e
  3100. }
  3101. };
  3102. function Ei() {
  3103. return {id: 0}
  3104. }
  3105. const ju = {
  3106. encode(u, e = r.Writer.create()) {
  3107. return u.id !== 0 && e.uint32(8).int32(u.id), e
  3108. }, decode(u, e) {
  3109. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3110. let n = e === void 0 ? i.len : i.pos + e;
  3111. const a = Ei();
  3112. for (; i.pos < n;) {
  3113. const t = i.uint32();
  3114. switch (t >>> 3) {
  3115. case 1:
  3116. if (t !== 8) break;
  3117. a.id = i.int32();
  3118. continue
  3119. }
  3120. if ((t & 7) === 4 || t === 0) break;
  3121. i.skipType(t & 7)
  3122. }
  3123. return a
  3124. }, fromJSON(u) {
  3125. return {id: o(u.id) ? globalThis.Number(u.id) : 0}
  3126. }, toJSON(u) {
  3127. const e = {};
  3128. return u.id !== 0 && (e.id = Math.round(u.id)), e
  3129. }, create(u) {
  3130. return ju.fromPartial(u != null ? u : {})
  3131. }, fromPartial(u) {
  3132. var i;
  3133. const e = Ei();
  3134. return e.id = (i = u.id) != null ? i : 0, e
  3135. }
  3136. };
  3137. function li() {
  3138. return {dir: void 0, block: void 0, error: void 0, done: void 0, digest: void 0, empty_dirs: void 0}
  3139. }
  3140. const Eu = {
  3141. encode(u, e = r.Writer.create()) {
  3142. return u.dir !== void 0 && au.encode(u.dir, e.uint32(10).fork()).ldelim(), u.block !== void 0 && Uu.encode(u.block, e.uint32(18).fork()).ldelim(), u.error !== void 0 && Mu.encode(u.error, e.uint32(26).fork()).ldelim(), u.done !== void 0 && Wu.encode(u.done, e.uint32(34).fork()).ldelim(), u.digest !== void 0 && Ou.encode(u.digest, e.uint32(42).fork()).ldelim(), u.empty_dirs !== void 0 && N0.encode(u.empty_dirs, e.uint32(50).fork()).ldelim(), e
  3143. }, decode(u, e) {
  3144. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3145. let n = e === void 0 ? i.len : i.pos + e;
  3146. const a = li();
  3147. for (; i.pos < n;) {
  3148. const t = i.uint32();
  3149. switch (t >>> 3) {
  3150. case 1:
  3151. if (t !== 10) break;
  3152. a.dir = au.decode(i, i.uint32());
  3153. continue;
  3154. case 2:
  3155. if (t !== 18) break;
  3156. a.block = Uu.decode(i, i.uint32());
  3157. continue;
  3158. case 3:
  3159. if (t !== 26) break;
  3160. a.error = Mu.decode(i, i.uint32());
  3161. continue;
  3162. case 4:
  3163. if (t !== 34) break;
  3164. a.done = Wu.decode(i, i.uint32());
  3165. continue;
  3166. case 5:
  3167. if (t !== 42) break;
  3168. a.digest = Ou.decode(i, i.uint32());
  3169. continue;
  3170. case 6:
  3171. if (t !== 50) break;
  3172. a.empty_dirs = N0.decode(i, i.uint32());
  3173. continue
  3174. }
  3175. if ((t & 7) === 4 || t === 0) break;
  3176. i.skipType(t & 7)
  3177. }
  3178. return a
  3179. }, fromJSON(u) {
  3180. return {
  3181. dir: o(u.dir) ? au.fromJSON(u.dir) : void 0,
  3182. block: o(u.block) ? Uu.fromJSON(u.block) : void 0,
  3183. error: o(u.error) ? Mu.fromJSON(u.error) : void 0,
  3184. done: o(u.done) ? Wu.fromJSON(u.done) : void 0,
  3185. digest: o(u.digest) ? Ou.fromJSON(u.digest) : void 0,
  3186. empty_dirs: o(u.empty_dirs) ? N0.fromJSON(u.empty_dirs) : void 0
  3187. }
  3188. }, toJSON(u) {
  3189. const e = {};
  3190. return u.dir !== void 0 && (e.dir = au.toJSON(u.dir)), u.block !== void 0 && (e.block = Uu.toJSON(u.block)), u.error !== void 0 && (e.error = Mu.toJSON(u.error)), u.done !== void 0 && (e.done = Wu.toJSON(u.done)), u.digest !== void 0 && (e.digest = Ou.toJSON(u.digest)), u.empty_dirs !== void 0 && (e.empty_dirs = N0.toJSON(u.empty_dirs)), e
  3191. }, create(u) {
  3192. return Eu.fromPartial(u != null ? u : {})
  3193. }, fromPartial(u) {
  3194. const e = li();
  3195. return e.dir = u.dir !== void 0 && u.dir !== null ? au.fromPartial(u.dir) : void 0, e.block = u.block !== void 0 && u.block !== null ? Uu.fromPartial(u.block) : void 0, e.error = u.error !== void 0 && u.error !== null ? Mu.fromPartial(u.error) : void 0, e.done = u.done !== void 0 && u.done !== null ? Wu.fromPartial(u.done) : void 0, e.digest = u.digest !== void 0 && u.digest !== null ? Ou.fromPartial(u.digest) : void 0, e.empty_dirs = u.empty_dirs !== void 0 && u.empty_dirs !== null ? N0.fromPartial(u.empty_dirs) : void 0, e
  3196. }
  3197. };
  3198. function Di() {
  3199. return {
  3200. id: 0,
  3201. file_num: 0,
  3202. last_modified: 0,
  3203. file_size: 0,
  3204. is_upload: !1,
  3205. is_identical: !1,
  3206. transferred_size: 0,
  3207. is_resume: !1
  3208. }
  3209. }
  3210. const Ou = {
  3211. encode(u, e = r.Writer.create()) {
  3212. 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), u.transferred_size !== 0 && e.uint32(56).uint64(u.transferred_size), u.is_resume !== !1 && e.uint32(64).bool(u.is_resume), e
  3213. }, decode(u, e) {
  3214. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3215. let n = e === void 0 ? i.len : i.pos + e;
  3216. const a = Di();
  3217. for (; i.pos < n;) {
  3218. const t = i.uint32();
  3219. switch (t >>> 3) {
  3220. case 1:
  3221. if (t !== 8) break;
  3222. a.id = i.int32();
  3223. continue;
  3224. case 2:
  3225. if (t !== 16) break;
  3226. a.file_num = i.sint32();
  3227. continue;
  3228. case 3:
  3229. if (t !== 24) break;
  3230. a.last_modified = W(i.uint64());
  3231. continue;
  3232. case 4:
  3233. if (t !== 32) break;
  3234. a.file_size = W(i.uint64());
  3235. continue;
  3236. case 5:
  3237. if (t !== 40) break;
  3238. a.is_upload = i.bool();
  3239. continue;
  3240. case 6:
  3241. if (t !== 48) break;
  3242. a.is_identical = i.bool();
  3243. continue;
  3244. case 7:
  3245. if (t !== 56) break;
  3246. a.transferred_size = W(i.uint64());
  3247. continue;
  3248. case 8:
  3249. if (t !== 64) break;
  3250. a.is_resume = i.bool();
  3251. continue
  3252. }
  3253. if ((t & 7) === 4 || t === 0) break;
  3254. i.skipType(t & 7)
  3255. }
  3256. return a
  3257. }, fromJSON(u) {
  3258. return {
  3259. id: o(u.id) ? globalThis.Number(u.id) : 0,
  3260. file_num: o(u.file_num) ? globalThis.Number(u.file_num) : 0,
  3261. last_modified: o(u.last_modified) ? globalThis.Number(u.last_modified) : 0,
  3262. file_size: o(u.file_size) ? globalThis.Number(u.file_size) : 0,
  3263. is_upload: o(u.is_upload) ? globalThis.Boolean(u.is_upload) : !1,
  3264. is_identical: o(u.is_identical) ? globalThis.Boolean(u.is_identical) : !1,
  3265. transferred_size: o(u.transferred_size) ? globalThis.Number(u.transferred_size) : 0,
  3266. is_resume: o(u.is_resume) ? globalThis.Boolean(u.is_resume) : !1
  3267. }
  3268. }, toJSON(u) {
  3269. const e = {};
  3270. 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), u.transferred_size !== 0 && (e.transferred_size = Math.round(u.transferred_size)), u.is_resume !== !1 && (e.is_resume = u.is_resume), e
  3271. }, create(u) {
  3272. return Ou.fromPartial(u != null ? u : {})
  3273. }, fromPartial(u) {
  3274. var i, n, a, t, s, E, D, d;
  3275. const e = Di();
  3276. 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.transferred_size = (D = u.transferred_size) != null ? D : 0, e.is_resume = (d = u.is_resume) != null ? d : !1, e
  3277. }
  3278. };
  3279. function di() {
  3280. return {id: 0, file_num: 0, data: new Uint8Array(0), compressed: !1, blk_id: 0}
  3281. }
  3282. const Uu = {
  3283. encode(u, e = r.Writer.create()) {
  3284. 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
  3285. }, decode(u, e) {
  3286. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3287. let n = e === void 0 ? i.len : i.pos + e;
  3288. const a = di();
  3289. for (; i.pos < n;) {
  3290. const t = i.uint32();
  3291. switch (t >>> 3) {
  3292. case 1:
  3293. if (t !== 8) break;
  3294. a.id = i.int32();
  3295. continue;
  3296. case 2:
  3297. if (t !== 16) break;
  3298. a.file_num = i.sint32();
  3299. continue;
  3300. case 3:
  3301. if (t !== 26) break;
  3302. a.data = i.bytes();
  3303. continue;
  3304. case 4:
  3305. if (t !== 32) break;
  3306. a.compressed = i.bool();
  3307. continue;
  3308. case 5:
  3309. if (t !== 40) break;
  3310. a.blk_id = i.uint32();
  3311. continue
  3312. }
  3313. if ((t & 7) === 4 || t === 0) break;
  3314. i.skipType(t & 7)
  3315. }
  3316. return a
  3317. }, fromJSON(u) {
  3318. return {
  3319. id: o(u.id) ? globalThis.Number(u.id) : 0,
  3320. file_num: o(u.file_num) ? globalThis.Number(u.file_num) : 0,
  3321. data: o(u.data) ? T(u.data) : new Uint8Array(0),
  3322. compressed: o(u.compressed) ? globalThis.Boolean(u.compressed) : !1,
  3323. blk_id: o(u.blk_id) ? globalThis.Number(u.blk_id) : 0
  3324. }
  3325. }, toJSON(u) {
  3326. const e = {};
  3327. 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 = N(u.data)), u.compressed !== !1 && (e.compressed = u.compressed), u.blk_id !== 0 && (e.blk_id = Math.round(u.blk_id)), e
  3328. }, create(u) {
  3329. return Uu.fromPartial(u != null ? u : {})
  3330. }, fromPartial(u) {
  3331. var i, n, a, t, s;
  3332. const e = di();
  3333. 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
  3334. }
  3335. };
  3336. function Bi() {
  3337. return {id: 0, error: "", file_num: 0}
  3338. }
  3339. const Mu = {
  3340. encode(u, e = r.Writer.create()) {
  3341. 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
  3342. }, decode(u, e) {
  3343. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3344. let n = e === void 0 ? i.len : i.pos + e;
  3345. const a = Bi();
  3346. for (; i.pos < n;) {
  3347. const t = i.uint32();
  3348. switch (t >>> 3) {
  3349. case 1:
  3350. if (t !== 8) break;
  3351. a.id = i.int32();
  3352. continue;
  3353. case 2:
  3354. if (t !== 18) break;
  3355. a.error = i.string();
  3356. continue;
  3357. case 3:
  3358. if (t !== 24) break;
  3359. a.file_num = i.sint32();
  3360. continue
  3361. }
  3362. if ((t & 7) === 4 || t === 0) break;
  3363. i.skipType(t & 7)
  3364. }
  3365. return a
  3366. }, fromJSON(u) {
  3367. return {
  3368. id: o(u.id) ? globalThis.Number(u.id) : 0,
  3369. error: o(u.error) ? globalThis.String(u.error) : "",
  3370. file_num: o(u.file_num) ? globalThis.Number(u.file_num) : 0
  3371. }
  3372. }, toJSON(u) {
  3373. const e = {};
  3374. 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
  3375. }, create(u) {
  3376. return Mu.fromPartial(u != null ? u : {})
  3377. }, fromPartial(u) {
  3378. var i, n, a;
  3379. const e = Bi();
  3380. 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
  3381. }
  3382. };
  3383. function ci() {
  3384. return {id: 0, path: "", include_hidden: !1, file_num: 0, file_type: 0}
  3385. }
  3386. const Lu = {
  3387. encode(u, e = r.Writer.create()) {
  3388. 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
  3389. }, decode(u, e) {
  3390. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3391. let n = e === void 0 ? i.len : i.pos + e;
  3392. const a = ci();
  3393. for (; i.pos < n;) {
  3394. const t = i.uint32();
  3395. switch (t >>> 3) {
  3396. case 1:
  3397. if (t !== 8) break;
  3398. a.id = i.int32();
  3399. continue;
  3400. case 2:
  3401. if (t !== 18) break;
  3402. a.path = i.string();
  3403. continue;
  3404. case 3:
  3405. if (t !== 24) break;
  3406. a.include_hidden = i.bool();
  3407. continue;
  3408. case 4:
  3409. if (t !== 32) break;
  3410. a.file_num = i.int32();
  3411. continue;
  3412. case 5:
  3413. if (t !== 40) break;
  3414. a.file_type = i.int32();
  3415. continue
  3416. }
  3417. if ((t & 7) === 4 || t === 0) break;
  3418. i.skipType(t & 7)
  3419. }
  3420. return a
  3421. }, fromJSON(u) {
  3422. return {
  3423. id: o(u.id) ? globalThis.Number(u.id) : 0,
  3424. path: o(u.path) ? globalThis.String(u.path) : "",
  3425. include_hidden: o(u.include_hidden) ? globalThis.Boolean(u.include_hidden) : !1,
  3426. file_num: o(u.file_num) ? globalThis.Number(u.file_num) : 0,
  3427. file_type: o(u.file_type) ? hn(u.file_type) : 0
  3428. }
  3429. }, toJSON(u) {
  3430. const e = {};
  3431. 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 = fn(u.file_type)), e
  3432. }, create(u) {
  3433. return Lu.fromPartial(u != null ? u : {})
  3434. }, fromPartial(u) {
  3435. var i, n, a, t, s;
  3436. const e = ci();
  3437. 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
  3438. }
  3439. };
  3440. function Ci() {
  3441. return {id: 0, file_num: 0, skip: void 0, offset_blk: void 0}
  3442. }
  3443. const Au = {
  3444. encode(u, e = r.Writer.create()) {
  3445. 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
  3446. }, decode(u, e) {
  3447. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3448. let n = e === void 0 ? i.len : i.pos + e;
  3449. const a = Ci();
  3450. for (; i.pos < n;) {
  3451. const t = i.uint32();
  3452. switch (t >>> 3) {
  3453. case 1:
  3454. if (t !== 8) break;
  3455. a.id = i.int32();
  3456. continue;
  3457. case 2:
  3458. if (t !== 16) break;
  3459. a.file_num = i.sint32();
  3460. continue;
  3461. case 3:
  3462. if (t !== 24) break;
  3463. a.skip = i.bool();
  3464. continue;
  3465. case 4:
  3466. if (t !== 32) break;
  3467. a.offset_blk = i.uint32();
  3468. continue
  3469. }
  3470. if ((t & 7) === 4 || t === 0) break;
  3471. i.skipType(t & 7)
  3472. }
  3473. return a
  3474. }, fromJSON(u) {
  3475. return {
  3476. id: o(u.id) ? globalThis.Number(u.id) : 0,
  3477. file_num: o(u.file_num) ? globalThis.Number(u.file_num) : 0,
  3478. skip: o(u.skip) ? globalThis.Boolean(u.skip) : void 0,
  3479. offset_blk: o(u.offset_blk) ? globalThis.Number(u.offset_blk) : void 0
  3480. }
  3481. }, toJSON(u) {
  3482. const e = {};
  3483. 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
  3484. }, create(u) {
  3485. return Au.fromPartial(u != null ? u : {})
  3486. }, fromPartial(u) {
  3487. var i, n, a, t;
  3488. const e = Ci();
  3489. 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
  3490. }
  3491. };
  3492. function pi() {
  3493. return {id: 0, file_num: 0}
  3494. }
  3495. const Wu = {
  3496. encode(u, e = r.Writer.create()) {
  3497. return u.id !== 0 && e.uint32(8).int32(u.id), u.file_num !== 0 && e.uint32(16).sint32(u.file_num), e
  3498. }, decode(u, e) {
  3499. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3500. let n = e === void 0 ? i.len : i.pos + e;
  3501. const a = pi();
  3502. for (; i.pos < n;) {
  3503. const t = i.uint32();
  3504. switch (t >>> 3) {
  3505. case 1:
  3506. if (t !== 8) break;
  3507. a.id = i.int32();
  3508. continue;
  3509. case 2:
  3510. if (t !== 16) break;
  3511. a.file_num = i.sint32();
  3512. continue
  3513. }
  3514. if ((t & 7) === 4 || t === 0) break;
  3515. i.skipType(t & 7)
  3516. }
  3517. return a
  3518. }, fromJSON(u) {
  3519. return {id: o(u.id) ? globalThis.Number(u.id) : 0, file_num: o(u.file_num) ? globalThis.Number(u.file_num) : 0}
  3520. }, toJSON(u) {
  3521. const e = {};
  3522. return u.id !== 0 && (e.id = Math.round(u.id)), u.file_num !== 0 && (e.file_num = Math.round(u.file_num)), e
  3523. }, create(u) {
  3524. return Wu.fromPartial(u != null ? u : {})
  3525. }, fromPartial(u) {
  3526. var i, n;
  3527. const e = pi();
  3528. return e.id = (i = u.id) != null ? i : 0, e.file_num = (n = u.file_num) != null ? n : 0, e
  3529. }
  3530. };
  3531. function Ai() {
  3532. return {id: 0, path: "", files: [], file_num: 0, total_size: 0}
  3533. }
  3534. const Vu = {
  3535. encode(u, e = r.Writer.create()) {
  3536. u.id !== 0 && e.uint32(8).int32(u.id), u.path !== "" && e.uint32(18).string(u.path);
  3537. for (const i of u.files) Z.encode(i, e.uint32(26).fork()).ldelim();
  3538. return u.file_num !== 0 && e.uint32(32).int32(u.file_num), u.total_size !== 0 && e.uint32(40).uint64(u.total_size), e
  3539. }, decode(u, e) {
  3540. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3541. let n = e === void 0 ? i.len : i.pos + e;
  3542. const a = Ai();
  3543. for (; i.pos < n;) {
  3544. const t = i.uint32();
  3545. switch (t >>> 3) {
  3546. case 1:
  3547. if (t !== 8) break;
  3548. a.id = i.int32();
  3549. continue;
  3550. case 2:
  3551. if (t !== 18) break;
  3552. a.path = i.string();
  3553. continue;
  3554. case 3:
  3555. if (t !== 26) break;
  3556. a.files.push(Z.decode(i, i.uint32()));
  3557. continue;
  3558. case 4:
  3559. if (t !== 32) break;
  3560. a.file_num = i.int32();
  3561. continue;
  3562. case 5:
  3563. if (t !== 40) break;
  3564. a.total_size = W(i.uint64());
  3565. continue
  3566. }
  3567. if ((t & 7) === 4 || t === 0) break;
  3568. i.skipType(t & 7)
  3569. }
  3570. return a
  3571. }, fromJSON(u) {
  3572. return {
  3573. id: o(u.id) ? globalThis.Number(u.id) : 0,
  3574. path: o(u.path) ? globalThis.String(u.path) : "",
  3575. files: globalThis.Array.isArray(u == null ? void 0 : u.files) ? u.files.map(e => Z.fromJSON(e)) : [],
  3576. file_num: o(u.file_num) ? globalThis.Number(u.file_num) : 0,
  3577. total_size: o(u.total_size) ? globalThis.Number(u.total_size) : 0
  3578. }
  3579. }, toJSON(u) {
  3580. var i;
  3581. const e = {};
  3582. 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 => Z.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
  3583. }, create(u) {
  3584. return Vu.fromPartial(u != null ? u : {})
  3585. }, fromPartial(u) {
  3586. var i, n, a, t, s;
  3587. const e = Ai();
  3588. 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 => Z.fromPartial(E))) || [], e.file_num = (t = u.file_num) != null ? t : 0, e.total_size = (s = u.total_size) != null ? s : 0, e
  3589. }
  3590. };
  3591. function mi() {
  3592. return {id: 0, path: "", recursive: !1}
  3593. }
  3594. const qu = {
  3595. encode(u, e = r.Writer.create()) {
  3596. 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
  3597. }, decode(u, e) {
  3598. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3599. let n = e === void 0 ? i.len : i.pos + e;
  3600. const a = mi();
  3601. for (; i.pos < n;) {
  3602. const t = i.uint32();
  3603. switch (t >>> 3) {
  3604. case 1:
  3605. if (t !== 8) break;
  3606. a.id = i.int32();
  3607. continue;
  3608. case 2:
  3609. if (t !== 18) break;
  3610. a.path = i.string();
  3611. continue;
  3612. case 3:
  3613. if (t !== 24) break;
  3614. a.recursive = i.bool();
  3615. continue
  3616. }
  3617. if ((t & 7) === 4 || t === 0) break;
  3618. i.skipType(t & 7)
  3619. }
  3620. return a
  3621. }, fromJSON(u) {
  3622. return {
  3623. id: o(u.id) ? globalThis.Number(u.id) : 0,
  3624. path: o(u.path) ? globalThis.String(u.path) : "",
  3625. recursive: o(u.recursive) ? globalThis.Boolean(u.recursive) : !1
  3626. }
  3627. }, toJSON(u) {
  3628. const e = {};
  3629. return u.id !== 0 && (e.id = Math.round(u.id)), u.path !== "" && (e.path = u.path), u.recursive !== !1 && (e.recursive = u.recursive), e
  3630. }, create(u) {
  3631. return qu.fromPartial(u != null ? u : {})
  3632. }, fromPartial(u) {
  3633. var i, n, a;
  3634. const e = mi();
  3635. 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
  3636. }
  3637. };
  3638. function Fi() {
  3639. return {id: 0, path: "", file_num: 0}
  3640. }
  3641. const Ku = {
  3642. encode(u, e = r.Writer.create()) {
  3643. 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
  3644. }, decode(u, e) {
  3645. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3646. let n = e === void 0 ? i.len : i.pos + e;
  3647. const a = Fi();
  3648. for (; i.pos < n;) {
  3649. const t = i.uint32();
  3650. switch (t >>> 3) {
  3651. case 1:
  3652. if (t !== 8) break;
  3653. a.id = i.int32();
  3654. continue;
  3655. case 2:
  3656. if (t !== 18) break;
  3657. a.path = i.string();
  3658. continue;
  3659. case 3:
  3660. if (t !== 24) break;
  3661. a.file_num = i.sint32();
  3662. continue
  3663. }
  3664. if ((t & 7) === 4 || t === 0) break;
  3665. i.skipType(t & 7)
  3666. }
  3667. return a
  3668. }, fromJSON(u) {
  3669. return {
  3670. id: o(u.id) ? globalThis.Number(u.id) : 0,
  3671. path: o(u.path) ? globalThis.String(u.path) : "",
  3672. file_num: o(u.file_num) ? globalThis.Number(u.file_num) : 0
  3673. }
  3674. }, toJSON(u) {
  3675. const e = {};
  3676. 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
  3677. }, create(u) {
  3678. return Ku.fromPartial(u != null ? u : {})
  3679. }, fromPartial(u) {
  3680. var i, n, a;
  3681. const e = Fi();
  3682. 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
  3683. }
  3684. };
  3685. function _i() {
  3686. return {id: 0, path: ""}
  3687. }
  3688. const Hu = {
  3689. encode(u, e = r.Writer.create()) {
  3690. return u.id !== 0 && e.uint32(8).int32(u.id), u.path !== "" && e.uint32(18).string(u.path), e
  3691. }, decode(u, e) {
  3692. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3693. let n = e === void 0 ? i.len : i.pos + e;
  3694. const a = _i();
  3695. for (; i.pos < n;) {
  3696. const t = i.uint32();
  3697. switch (t >>> 3) {
  3698. case 1:
  3699. if (t !== 8) break;
  3700. a.id = i.int32();
  3701. continue;
  3702. case 2:
  3703. if (t !== 18) break;
  3704. a.path = i.string();
  3705. continue
  3706. }
  3707. if ((t & 7) === 4 || t === 0) break;
  3708. i.skipType(t & 7)
  3709. }
  3710. return a
  3711. }, fromJSON(u) {
  3712. return {id: o(u.id) ? globalThis.Number(u.id) : 0, path: o(u.path) ? globalThis.String(u.path) : ""}
  3713. }, toJSON(u) {
  3714. const e = {};
  3715. return u.id !== 0 && (e.id = Math.round(u.id)), u.path !== "" && (e.path = u.path), e
  3716. }, create(u) {
  3717. return Hu.fromPartial(u != null ? u : {})
  3718. }, fromPartial(u) {
  3719. var i, n;
  3720. const e = _i();
  3721. return e.id = (i = u.id) != null ? i : 0, e.path = (n = u.path) != null ? n : "", e
  3722. }
  3723. };
  3724. function vi() {
  3725. return {}
  3726. }
  3727. const j0 = {
  3728. encode(u, e = r.Writer.create()) {
  3729. return e
  3730. }, decode(u, e) {
  3731. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3732. let n = e === void 0 ? i.len : i.pos + e;
  3733. const a = vi();
  3734. for (; i.pos < n;) {
  3735. const t = i.uint32();
  3736. if ((t & 7) === 4 || t === 0) break;
  3737. i.skipType(t & 7)
  3738. }
  3739. return a
  3740. }, fromJSON(u) {
  3741. return {}
  3742. }, toJSON(u) {
  3743. return {}
  3744. }, create(u) {
  3745. return j0.fromPartial(u != null ? u : {})
  3746. }, fromPartial(u) {
  3747. return vi()
  3748. }
  3749. };
  3750. function gi() {
  3751. return {id: 0, format: ""}
  3752. }
  3753. const O0 = {
  3754. encode(u, e = r.Writer.create()) {
  3755. return u.id !== 0 && e.uint32(16).int32(u.id), u.format !== "" && e.uint32(26).string(u.format), e
  3756. }, decode(u, e) {
  3757. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3758. let n = e === void 0 ? i.len : i.pos + e;
  3759. const a = gi();
  3760. for (; i.pos < n;) {
  3761. const t = i.uint32();
  3762. switch (t >>> 3) {
  3763. case 2:
  3764. if (t !== 16) break;
  3765. a.id = i.int32();
  3766. continue;
  3767. case 3:
  3768. if (t !== 26) break;
  3769. a.format = i.string();
  3770. continue
  3771. }
  3772. if ((t & 7) === 4 || t === 0) break;
  3773. i.skipType(t & 7)
  3774. }
  3775. return a
  3776. }, fromJSON(u) {
  3777. return {id: o(u.id) ? globalThis.Number(u.id) : 0, format: o(u.format) ? globalThis.String(u.format) : ""}
  3778. }, toJSON(u) {
  3779. const e = {};
  3780. return u.id !== 0 && (e.id = Math.round(u.id)), u.format !== "" && (e.format = u.format), e
  3781. }, create(u) {
  3782. return O0.fromPartial(u != null ? u : {})
  3783. }, fromPartial(u) {
  3784. var i, n;
  3785. const e = gi();
  3786. return e.id = (i = u.id) != null ? i : 0, e.format = (n = u.format) != null ? n : "", e
  3787. }
  3788. };
  3789. function ki() {
  3790. return {formats: []}
  3791. }
  3792. const U0 = {
  3793. encode(u, e = r.Writer.create()) {
  3794. for (const i of u.formats) O0.encode(i, e.uint32(18).fork()).ldelim();
  3795. return e
  3796. }, decode(u, e) {
  3797. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3798. let n = e === void 0 ? i.len : i.pos + e;
  3799. const a = ki();
  3800. for (; i.pos < n;) {
  3801. const t = i.uint32();
  3802. switch (t >>> 3) {
  3803. case 2:
  3804. if (t !== 18) break;
  3805. a.formats.push(O0.decode(i, i.uint32()));
  3806. continue
  3807. }
  3808. if ((t & 7) === 4 || t === 0) break;
  3809. i.skipType(t & 7)
  3810. }
  3811. return a
  3812. }, fromJSON(u) {
  3813. return {formats: globalThis.Array.isArray(u == null ? void 0 : u.formats) ? u.formats.map(e => O0.fromJSON(e)) : []}
  3814. }, toJSON(u) {
  3815. var i;
  3816. const e = {};
  3817. return (i = u.formats) != null && i.length && (e.formats = u.formats.map(n => O0.toJSON(n))), e
  3818. }, create(u) {
  3819. return U0.fromPartial(u != null ? u : {})
  3820. }, fromPartial(u) {
  3821. var i;
  3822. const e = ki();
  3823. return e.formats = ((i = u.formats) == null ? void 0 : i.map(n => O0.fromPartial(n))) || [], e
  3824. }
  3825. };
  3826. function hi() {
  3827. return {msg_flags: 0}
  3828. }
  3829. const M0 = {
  3830. encode(u, e = r.Writer.create()) {
  3831. return u.msg_flags !== 0 && e.uint32(16).int32(u.msg_flags), e
  3832. }, decode(u, e) {
  3833. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3834. let n = e === void 0 ? i.len : i.pos + e;
  3835. const a = hi();
  3836. for (; i.pos < n;) {
  3837. const t = i.uint32();
  3838. switch (t >>> 3) {
  3839. case 2:
  3840. if (t !== 16) break;
  3841. a.msg_flags = i.int32();
  3842. continue
  3843. }
  3844. if ((t & 7) === 4 || t === 0) break;
  3845. i.skipType(t & 7)
  3846. }
  3847. return a
  3848. }, fromJSON(u) {
  3849. return {msg_flags: o(u.msg_flags) ? globalThis.Number(u.msg_flags) : 0}
  3850. }, toJSON(u) {
  3851. const e = {};
  3852. return u.msg_flags !== 0 && (e.msg_flags = Math.round(u.msg_flags)), e
  3853. }, create(u) {
  3854. return M0.fromPartial(u != null ? u : {})
  3855. }, fromPartial(u) {
  3856. var i;
  3857. const e = hi();
  3858. return e.msg_flags = (i = u.msg_flags) != null ? i : 0, e
  3859. }
  3860. };
  3861. function fi() {
  3862. return {requested_format_id: 0}
  3863. }
  3864. const L0 = {
  3865. encode(u, e = r.Writer.create()) {
  3866. return u.requested_format_id !== 0 && e.uint32(16).int32(u.requested_format_id), e
  3867. }, decode(u, e) {
  3868. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3869. let n = e === void 0 ? i.len : i.pos + e;
  3870. const a = fi();
  3871. for (; i.pos < n;) {
  3872. const t = i.uint32();
  3873. switch (t >>> 3) {
  3874. case 2:
  3875. if (t !== 16) break;
  3876. a.requested_format_id = i.int32();
  3877. continue
  3878. }
  3879. if ((t & 7) === 4 || t === 0) break;
  3880. i.skipType(t & 7)
  3881. }
  3882. return a
  3883. }, fromJSON(u) {
  3884. return {requested_format_id: o(u.requested_format_id) ? globalThis.Number(u.requested_format_id) : 0}
  3885. }, toJSON(u) {
  3886. const e = {};
  3887. return u.requested_format_id !== 0 && (e.requested_format_id = Math.round(u.requested_format_id)), e
  3888. }, create(u) {
  3889. return L0.fromPartial(u != null ? u : {})
  3890. }, fromPartial(u) {
  3891. var i;
  3892. const e = fi();
  3893. return e.requested_format_id = (i = u.requested_format_id) != null ? i : 0, e
  3894. }
  3895. };
  3896. function xi() {
  3897. return {msg_flags: 0, format_data: new Uint8Array(0)}
  3898. }
  3899. const W0 = {
  3900. encode(u, e = r.Writer.create()) {
  3901. 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
  3902. }, decode(u, e) {
  3903. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3904. let n = e === void 0 ? i.len : i.pos + e;
  3905. const a = xi();
  3906. for (; i.pos < n;) {
  3907. const t = i.uint32();
  3908. switch (t >>> 3) {
  3909. case 2:
  3910. if (t !== 16) break;
  3911. a.msg_flags = i.int32();
  3912. continue;
  3913. case 3:
  3914. if (t !== 26) break;
  3915. a.format_data = i.bytes();
  3916. continue
  3917. }
  3918. if ((t & 7) === 4 || t === 0) break;
  3919. i.skipType(t & 7)
  3920. }
  3921. return a
  3922. }, fromJSON(u) {
  3923. return {
  3924. msg_flags: o(u.msg_flags) ? globalThis.Number(u.msg_flags) : 0,
  3925. format_data: o(u.format_data) ? T(u.format_data) : new Uint8Array(0)
  3926. }
  3927. }, toJSON(u) {
  3928. const e = {};
  3929. return u.msg_flags !== 0 && (e.msg_flags = Math.round(u.msg_flags)), u.format_data.length !== 0 && (e.format_data = N(u.format_data)), e
  3930. }, create(u) {
  3931. return W0.fromPartial(u != null ? u : {})
  3932. }, fromPartial(u) {
  3933. var i, n;
  3934. const e = xi();
  3935. return e.msg_flags = (i = u.msg_flags) != null ? i : 0, e.format_data = (n = u.format_data) != null ? n : new Uint8Array(0), e
  3936. }
  3937. };
  3938. function yi() {
  3939. return {
  3940. stream_id: 0,
  3941. list_index: 0,
  3942. dw_flags: 0,
  3943. n_position_low: 0,
  3944. n_position_high: 0,
  3945. cb_requested: 0,
  3946. have_clip_data_id: !1,
  3947. clip_data_id: 0
  3948. }
  3949. }
  3950. const V0 = {
  3951. encode(u, e = r.Writer.create()) {
  3952. 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
  3953. }, decode(u, e) {
  3954. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3955. let n = e === void 0 ? i.len : i.pos + e;
  3956. const a = yi();
  3957. for (; i.pos < n;) {
  3958. const t = i.uint32();
  3959. switch (t >>> 3) {
  3960. case 2:
  3961. if (t !== 16) break;
  3962. a.stream_id = i.int32();
  3963. continue;
  3964. case 3:
  3965. if (t !== 24) break;
  3966. a.list_index = i.int32();
  3967. continue;
  3968. case 4:
  3969. if (t !== 32) break;
  3970. a.dw_flags = i.int32();
  3971. continue;
  3972. case 5:
  3973. if (t !== 40) break;
  3974. a.n_position_low = i.int32();
  3975. continue;
  3976. case 6:
  3977. if (t !== 48) break;
  3978. a.n_position_high = i.int32();
  3979. continue;
  3980. case 7:
  3981. if (t !== 56) break;
  3982. a.cb_requested = i.int32();
  3983. continue;
  3984. case 8:
  3985. if (t !== 64) break;
  3986. a.have_clip_data_id = i.bool();
  3987. continue;
  3988. case 9:
  3989. if (t !== 72) break;
  3990. a.clip_data_id = i.int32();
  3991. continue
  3992. }
  3993. if ((t & 7) === 4 || t === 0) break;
  3994. i.skipType(t & 7)
  3995. }
  3996. return a
  3997. }, fromJSON(u) {
  3998. return {
  3999. stream_id: o(u.stream_id) ? globalThis.Number(u.stream_id) : 0,
  4000. list_index: o(u.list_index) ? globalThis.Number(u.list_index) : 0,
  4001. dw_flags: o(u.dw_flags) ? globalThis.Number(u.dw_flags) : 0,
  4002. n_position_low: o(u.n_position_low) ? globalThis.Number(u.n_position_low) : 0,
  4003. n_position_high: o(u.n_position_high) ? globalThis.Number(u.n_position_high) : 0,
  4004. cb_requested: o(u.cb_requested) ? globalThis.Number(u.cb_requested) : 0,
  4005. have_clip_data_id: o(u.have_clip_data_id) ? globalThis.Boolean(u.have_clip_data_id) : !1,
  4006. clip_data_id: o(u.clip_data_id) ? globalThis.Number(u.clip_data_id) : 0
  4007. }
  4008. }, toJSON(u) {
  4009. const e = {};
  4010. 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
  4011. }, create(u) {
  4012. return V0.fromPartial(u != null ? u : {})
  4013. }, fromPartial(u) {
  4014. var i, n, a, t, s, E, D, d;
  4015. const e = yi();
  4016. 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 = (D = u.have_clip_data_id) != null ? D : !1, e.clip_data_id = (d = u.clip_data_id) != null ? d : 0, e
  4017. }
  4018. };
  4019. function bi() {
  4020. return {msg_flags: 0, stream_id: 0, requested_data: new Uint8Array(0)}
  4021. }
  4022. const q0 = {
  4023. encode(u, e = r.Writer.create()) {
  4024. 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
  4025. }, decode(u, e) {
  4026. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4027. let n = e === void 0 ? i.len : i.pos + e;
  4028. const a = bi();
  4029. for (; i.pos < n;) {
  4030. const t = i.uint32();
  4031. switch (t >>> 3) {
  4032. case 3:
  4033. if (t !== 24) break;
  4034. a.msg_flags = i.int32();
  4035. continue;
  4036. case 4:
  4037. if (t !== 32) break;
  4038. a.stream_id = i.int32();
  4039. continue;
  4040. case 5:
  4041. if (t !== 42) break;
  4042. a.requested_data = i.bytes();
  4043. continue
  4044. }
  4045. if ((t & 7) === 4 || t === 0) break;
  4046. i.skipType(t & 7)
  4047. }
  4048. return a
  4049. }, fromJSON(u) {
  4050. return {
  4051. msg_flags: o(u.msg_flags) ? globalThis.Number(u.msg_flags) : 0,
  4052. stream_id: o(u.stream_id) ? globalThis.Number(u.stream_id) : 0,
  4053. requested_data: o(u.requested_data) ? T(u.requested_data) : new Uint8Array(0)
  4054. }
  4055. }, toJSON(u) {
  4056. const e = {};
  4057. 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 = N(u.requested_data)), e
  4058. }, create(u) {
  4059. return q0.fromPartial(u != null ? u : {})
  4060. }, fromPartial(u) {
  4061. var i, n, a;
  4062. const e = bi();
  4063. 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
  4064. }
  4065. };
  4066. function wi() {
  4067. return {}
  4068. }
  4069. const K0 = {
  4070. encode(u, e = r.Writer.create()) {
  4071. return e
  4072. }, decode(u, e) {
  4073. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4074. let n = e === void 0 ? i.len : i.pos + e;
  4075. const a = wi();
  4076. for (; i.pos < n;) {
  4077. const t = i.uint32();
  4078. if ((t & 7) === 4 || t === 0) break;
  4079. i.skipType(t & 7)
  4080. }
  4081. return a
  4082. }, fromJSON(u) {
  4083. return {}
  4084. }, toJSON(u) {
  4085. return {}
  4086. }, create(u) {
  4087. return K0.fromPartial(u != null ? u : {})
  4088. }, fromPartial(u) {
  4089. return wi()
  4090. }
  4091. };
  4092. function Si() {
  4093. return {name: "", size: 0}
  4094. }
  4095. const H0 = {
  4096. encode(u, e = r.Writer.create()) {
  4097. return u.name !== "" && e.uint32(10).string(u.name), u.size !== 0 && e.uint32(16).uint64(u.size), e
  4098. }, decode(u, e) {
  4099. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4100. let n = e === void 0 ? i.len : i.pos + e;
  4101. const a = Si();
  4102. for (; i.pos < n;) {
  4103. const t = i.uint32();
  4104. switch (t >>> 3) {
  4105. case 1:
  4106. if (t !== 10) break;
  4107. a.name = i.string();
  4108. continue;
  4109. case 2:
  4110. if (t !== 16) break;
  4111. a.size = W(i.uint64());
  4112. continue
  4113. }
  4114. if ((t & 7) === 4 || t === 0) break;
  4115. i.skipType(t & 7)
  4116. }
  4117. return a
  4118. }, fromJSON(u) {
  4119. return {name: o(u.name) ? globalThis.String(u.name) : "", size: o(u.size) ? globalThis.Number(u.size) : 0}
  4120. }, toJSON(u) {
  4121. const e = {};
  4122. return u.name !== "" && (e.name = u.name), u.size !== 0 && (e.size = Math.round(u.size)), e
  4123. }, create(u) {
  4124. return H0.fromPartial(u != null ? u : {})
  4125. }, fromPartial(u) {
  4126. var i, n;
  4127. const e = Si();
  4128. return e.name = (i = u.name) != null ? i : "", e.size = (n = u.size) != null ? n : 0, e
  4129. }
  4130. };
  4131. function zi() {
  4132. return {files: []}
  4133. }
  4134. const J0 = {
  4135. encode(u, e = r.Writer.create()) {
  4136. for (const i of u.files) H0.encode(i, e.uint32(10).fork()).ldelim();
  4137. return e
  4138. }, decode(u, e) {
  4139. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4140. let n = e === void 0 ? i.len : i.pos + e;
  4141. const a = zi();
  4142. for (; i.pos < n;) {
  4143. const t = i.uint32();
  4144. switch (t >>> 3) {
  4145. case 1:
  4146. if (t !== 10) break;
  4147. a.files.push(H0.decode(i, i.uint32()));
  4148. continue
  4149. }
  4150. if ((t & 7) === 4 || t === 0) break;
  4151. i.skipType(t & 7)
  4152. }
  4153. return a
  4154. }, fromJSON(u) {
  4155. return {files: globalThis.Array.isArray(u == null ? void 0 : u.files) ? u.files.map(e => H0.fromJSON(e)) : []}
  4156. }, toJSON(u) {
  4157. var i;
  4158. const e = {};
  4159. return (i = u.files) != null && i.length && (e.files = u.files.map(n => H0.toJSON(n))), e
  4160. }, create(u) {
  4161. return J0.fromPartial(u != null ? u : {})
  4162. }, fromPartial(u) {
  4163. var i;
  4164. const e = zi();
  4165. return e.files = ((i = u.files) == null ? void 0 : i.map(n => H0.fromPartial(n))) || [], e
  4166. }
  4167. };
  4168. function Pi() {
  4169. return {
  4170. ready: void 0,
  4171. format_list: void 0,
  4172. format_list_response: void 0,
  4173. format_data_request: void 0,
  4174. format_data_response: void 0,
  4175. file_contents_request: void 0,
  4176. file_contents_response: void 0,
  4177. try_empty: void 0,
  4178. files: void 0
  4179. }
  4180. }
  4181. const G0 = {
  4182. encode(u, e = r.Writer.create()) {
  4183. return u.ready !== void 0 && j0.encode(u.ready, e.uint32(10).fork()).ldelim(), u.format_list !== void 0 && U0.encode(u.format_list, e.uint32(18).fork()).ldelim(), u.format_list_response !== void 0 && M0.encode(u.format_list_response, e.uint32(26).fork()).ldelim(), u.format_data_request !== void 0 && L0.encode(u.format_data_request, e.uint32(34).fork()).ldelim(), u.format_data_response !== void 0 && W0.encode(u.format_data_response, e.uint32(42).fork()).ldelim(), u.file_contents_request !== void 0 && V0.encode(u.file_contents_request, e.uint32(50).fork()).ldelim(), u.file_contents_response !== void 0 && q0.encode(u.file_contents_response, e.uint32(58).fork()).ldelim(), u.try_empty !== void 0 && K0.encode(u.try_empty, e.uint32(66).fork()).ldelim(), u.files !== void 0 && J0.encode(u.files, e.uint32(74).fork()).ldelim(), e
  4184. }, decode(u, e) {
  4185. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4186. let n = e === void 0 ? i.len : i.pos + e;
  4187. const a = Pi();
  4188. for (; i.pos < n;) {
  4189. const t = i.uint32();
  4190. switch (t >>> 3) {
  4191. case 1:
  4192. if (t !== 10) break;
  4193. a.ready = j0.decode(i, i.uint32());
  4194. continue;
  4195. case 2:
  4196. if (t !== 18) break;
  4197. a.format_list = U0.decode(i, i.uint32());
  4198. continue;
  4199. case 3:
  4200. if (t !== 26) break;
  4201. a.format_list_response = M0.decode(i, i.uint32());
  4202. continue;
  4203. case 4:
  4204. if (t !== 34) break;
  4205. a.format_data_request = L0.decode(i, i.uint32());
  4206. continue;
  4207. case 5:
  4208. if (t !== 42) break;
  4209. a.format_data_response = W0.decode(i, i.uint32());
  4210. continue;
  4211. case 6:
  4212. if (t !== 50) break;
  4213. a.file_contents_request = V0.decode(i, i.uint32());
  4214. continue;
  4215. case 7:
  4216. if (t !== 58) break;
  4217. a.file_contents_response = q0.decode(i, i.uint32());
  4218. continue;
  4219. case 8:
  4220. if (t !== 66) break;
  4221. a.try_empty = K0.decode(i, i.uint32());
  4222. continue;
  4223. case 9:
  4224. if (t !== 74) break;
  4225. a.files = J0.decode(i, i.uint32());
  4226. continue
  4227. }
  4228. if ((t & 7) === 4 || t === 0) break;
  4229. i.skipType(t & 7)
  4230. }
  4231. return a
  4232. }, fromJSON(u) {
  4233. return {
  4234. ready: o(u.ready) ? j0.fromJSON(u.ready) : void 0,
  4235. format_list: o(u.format_list) ? U0.fromJSON(u.format_list) : void 0,
  4236. format_list_response: o(u.format_list_response) ? M0.fromJSON(u.format_list_response) : void 0,
  4237. format_data_request: o(u.format_data_request) ? L0.fromJSON(u.format_data_request) : void 0,
  4238. format_data_response: o(u.format_data_response) ? W0.fromJSON(u.format_data_response) : void 0,
  4239. file_contents_request: o(u.file_contents_request) ? V0.fromJSON(u.file_contents_request) : void 0,
  4240. file_contents_response: o(u.file_contents_response) ? q0.fromJSON(u.file_contents_response) : void 0,
  4241. try_empty: o(u.try_empty) ? K0.fromJSON(u.try_empty) : void 0,
  4242. files: o(u.files) ? J0.fromJSON(u.files) : void 0
  4243. }
  4244. }, toJSON(u) {
  4245. const e = {};
  4246. return u.ready !== void 0 && (e.ready = j0.toJSON(u.ready)), u.format_list !== void 0 && (e.format_list = U0.toJSON(u.format_list)), u.format_list_response !== void 0 && (e.format_list_response = M0.toJSON(u.format_list_response)), u.format_data_request !== void 0 && (e.format_data_request = L0.toJSON(u.format_data_request)), u.format_data_response !== void 0 && (e.format_data_response = W0.toJSON(u.format_data_response)), u.file_contents_request !== void 0 && (e.file_contents_request = V0.toJSON(u.file_contents_request)), u.file_contents_response !== void 0 && (e.file_contents_response = q0.toJSON(u.file_contents_response)), u.try_empty !== void 0 && (e.try_empty = K0.toJSON(u.try_empty)), u.files !== void 0 && (e.files = J0.toJSON(u.files)), e
  4247. }, create(u) {
  4248. return G0.fromPartial(u != null ? u : {})
  4249. }, fromPartial(u) {
  4250. const e = Pi();
  4251. return e.ready = u.ready !== void 0 && u.ready !== null ? j0.fromPartial(u.ready) : void 0, e.format_list = u.format_list !== void 0 && u.format_list !== null ? U0.fromPartial(u.format_list) : void 0, e.format_list_response = u.format_list_response !== void 0 && u.format_list_response !== null ? M0.fromPartial(u.format_list_response) : void 0, e.format_data_request = u.format_data_request !== void 0 && u.format_data_request !== null ? L0.fromPartial(u.format_data_request) : void 0, e.format_data_response = u.format_data_response !== void 0 && u.format_data_response !== null ? W0.fromPartial(u.format_data_response) : void 0, e.file_contents_request = u.file_contents_request !== void 0 && u.file_contents_request !== null ? V0.fromPartial(u.file_contents_request) : void 0, e.file_contents_response = u.file_contents_response !== void 0 && u.file_contents_response !== null ? q0.fromPartial(u.file_contents_response) : void 0, e.try_empty = u.try_empty !== void 0 && u.try_empty !== null ? K0.fromPartial(u.try_empty) : void 0, e.files = u.files !== void 0 && u.files !== null ? J0.fromPartial(u.files) : void 0, e
  4252. }
  4253. };
  4254. function Ri() {
  4255. return {width: 0, height: 0}
  4256. }
  4257. const g = {
  4258. encode(u, e = r.Writer.create()) {
  4259. return u.width !== 0 && e.uint32(8).int32(u.width), u.height !== 0 && e.uint32(16).int32(u.height), e
  4260. }, decode(u, e) {
  4261. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4262. let n = e === void 0 ? i.len : i.pos + e;
  4263. const a = Ri();
  4264. for (; i.pos < n;) {
  4265. const t = i.uint32();
  4266. switch (t >>> 3) {
  4267. case 1:
  4268. if (t !== 8) break;
  4269. a.width = i.int32();
  4270. continue;
  4271. case 2:
  4272. if (t !== 16) break;
  4273. a.height = i.int32();
  4274. continue
  4275. }
  4276. if ((t & 7) === 4 || t === 0) break;
  4277. i.skipType(t & 7)
  4278. }
  4279. return a
  4280. }, fromJSON(u) {
  4281. return {
  4282. width: o(u.width) ? globalThis.Number(u.width) : 0,
  4283. height: o(u.height) ? globalThis.Number(u.height) : 0
  4284. }
  4285. }, toJSON(u) {
  4286. const e = {};
  4287. return u.width !== 0 && (e.width = Math.round(u.width)), u.height !== 0 && (e.height = Math.round(u.height)), e
  4288. }, create(u) {
  4289. return g.fromPartial(u != null ? u : {})
  4290. }, fromPartial(u) {
  4291. var i, n;
  4292. const e = Ri();
  4293. return e.width = (i = u.width) != null ? i : 0, e.height = (n = u.height) != null ? n : 0, e
  4294. }
  4295. };
  4296. function Ii() {
  4297. return {display: 0, resolution: void 0}
  4298. }
  4299. const Ju = {
  4300. encode(u, e = r.Writer.create()) {
  4301. return u.display !== 0 && e.uint32(8).int32(u.display), u.resolution !== void 0 && g.encode(u.resolution, e.uint32(18).fork()).ldelim(), e
  4302. }, decode(u, e) {
  4303. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4304. let n = e === void 0 ? i.len : i.pos + e;
  4305. const a = Ii();
  4306. for (; i.pos < n;) {
  4307. const t = i.uint32();
  4308. switch (t >>> 3) {
  4309. case 1:
  4310. if (t !== 8) break;
  4311. a.display = i.int32();
  4312. continue;
  4313. case 2:
  4314. if (t !== 18) break;
  4315. a.resolution = g.decode(i, i.uint32());
  4316. continue
  4317. }
  4318. if ((t & 7) === 4 || t === 0) break;
  4319. i.skipType(t & 7)
  4320. }
  4321. return a
  4322. }, fromJSON(u) {
  4323. return {
  4324. display: o(u.display) ? globalThis.Number(u.display) : 0,
  4325. resolution: o(u.resolution) ? g.fromJSON(u.resolution) : void 0
  4326. }
  4327. }, toJSON(u) {
  4328. const e = {};
  4329. return u.display !== 0 && (e.display = Math.round(u.display)), u.resolution !== void 0 && (e.resolution = g.toJSON(u.resolution)), e
  4330. }, create(u) {
  4331. return Ju.fromPartial(u != null ? u : {})
  4332. }, fromPartial(u) {
  4333. var i;
  4334. const e = Ii();
  4335. return e.display = (i = u.display) != null ? i : 0, e.resolution = u.resolution !== void 0 && u.resolution !== null ? g.fromPartial(u.resolution) : void 0, e
  4336. }
  4337. };
  4338. function Ti() {
  4339. return {resolutions: []}
  4340. }
  4341. const nu = {
  4342. encode(u, e = r.Writer.create()) {
  4343. for (const i of u.resolutions) g.encode(i, e.uint32(10).fork()).ldelim();
  4344. return e
  4345. }, decode(u, e) {
  4346. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4347. let n = e === void 0 ? i.len : i.pos + e;
  4348. const a = Ti();
  4349. for (; i.pos < n;) {
  4350. const t = i.uint32();
  4351. switch (t >>> 3) {
  4352. case 1:
  4353. if (t !== 10) break;
  4354. a.resolutions.push(g.decode(i, i.uint32()));
  4355. continue
  4356. }
  4357. if ((t & 7) === 4 || t === 0) break;
  4358. i.skipType(t & 7)
  4359. }
  4360. return a
  4361. }, fromJSON(u) {
  4362. return {resolutions: globalThis.Array.isArray(u == null ? void 0 : u.resolutions) ? u.resolutions.map(e => g.fromJSON(e)) : []}
  4363. }, toJSON(u) {
  4364. var i;
  4365. const e = {};
  4366. return (i = u.resolutions) != null && i.length && (e.resolutions = u.resolutions.map(n => g.toJSON(n))), e
  4367. }, create(u) {
  4368. return nu.fromPartial(u != null ? u : {})
  4369. }, fromPartial(u) {
  4370. var i;
  4371. const e = Ti();
  4372. return e.resolutions = ((i = u.resolutions) == null ? void 0 : i.map(n => g.fromPartial(n))) || [], e
  4373. }
  4374. };
  4375. function Ni() {
  4376. return {
  4377. display: 0,
  4378. x: 0,
  4379. y: 0,
  4380. width: 0,
  4381. height: 0,
  4382. cursor_embedded: !1,
  4383. resolutions: void 0,
  4384. original_resolution: void 0
  4385. }
  4386. }
  4387. const Gu = {
  4388. encode(u, e = r.Writer.create()) {
  4389. 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 && nu.encode(u.resolutions, e.uint32(58).fork()).ldelim(), u.original_resolution !== void 0 && g.encode(u.original_resolution, e.uint32(66).fork()).ldelim(), e
  4390. }, decode(u, e) {
  4391. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4392. let n = e === void 0 ? i.len : i.pos + e;
  4393. const a = Ni();
  4394. for (; i.pos < n;) {
  4395. const t = i.uint32();
  4396. switch (t >>> 3) {
  4397. case 1:
  4398. if (t !== 8) break;
  4399. a.display = i.int32();
  4400. continue;
  4401. case 2:
  4402. if (t !== 16) break;
  4403. a.x = i.sint32();
  4404. continue;
  4405. case 3:
  4406. if (t !== 24) break;
  4407. a.y = i.sint32();
  4408. continue;
  4409. case 4:
  4410. if (t !== 32) break;
  4411. a.width = i.int32();
  4412. continue;
  4413. case 5:
  4414. if (t !== 40) break;
  4415. a.height = i.int32();
  4416. continue;
  4417. case 6:
  4418. if (t !== 48) break;
  4419. a.cursor_embedded = i.bool();
  4420. continue;
  4421. case 7:
  4422. if (t !== 58) break;
  4423. a.resolutions = nu.decode(i, i.uint32());
  4424. continue;
  4425. case 8:
  4426. if (t !== 66) break;
  4427. a.original_resolution = g.decode(i, i.uint32());
  4428. continue
  4429. }
  4430. if ((t & 7) === 4 || t === 0) break;
  4431. i.skipType(t & 7)
  4432. }
  4433. return a
  4434. }, fromJSON(u) {
  4435. return {
  4436. display: o(u.display) ? globalThis.Number(u.display) : 0,
  4437. x: o(u.x) ? globalThis.Number(u.x) : 0,
  4438. y: o(u.y) ? globalThis.Number(u.y) : 0,
  4439. width: o(u.width) ? globalThis.Number(u.width) : 0,
  4440. height: o(u.height) ? globalThis.Number(u.height) : 0,
  4441. cursor_embedded: o(u.cursor_embedded) ? globalThis.Boolean(u.cursor_embedded) : !1,
  4442. resolutions: o(u.resolutions) ? nu.fromJSON(u.resolutions) : void 0,
  4443. original_resolution: o(u.original_resolution) ? g.fromJSON(u.original_resolution) : void 0
  4444. }
  4445. }, toJSON(u) {
  4446. const e = {};
  4447. 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 = nu.toJSON(u.resolutions)), u.original_resolution !== void 0 && (e.original_resolution = g.toJSON(u.original_resolution)), e
  4448. }, create(u) {
  4449. return Gu.fromPartial(u != null ? u : {})
  4450. }, fromPartial(u) {
  4451. var i, n, a, t, s, E;
  4452. const e = Ni();
  4453. 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 ? nu.fromPartial(u.resolutions) : void 0, e.original_resolution = u.original_resolution !== void 0 && u.original_resolution !== null ? g.fromPartial(u.original_resolution) : void 0, e
  4454. }
  4455. };
  4456. function ji() {
  4457. return {add: [], sub: [], set: []}
  4458. }
  4459. const Zu = {
  4460. encode(u, e = r.Writer.create()) {
  4461. e.uint32(10).fork();
  4462. for (const i of u.add) e.int32(i);
  4463. e.ldelim(), e.uint32(18).fork();
  4464. for (const i of u.sub) e.int32(i);
  4465. e.ldelim(), e.uint32(26).fork();
  4466. for (const i of u.set) e.int32(i);
  4467. return e.ldelim(), e
  4468. }, decode(u, e) {
  4469. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4470. let n = e === void 0 ? i.len : i.pos + e;
  4471. const a = ji();
  4472. for (; i.pos < n;) {
  4473. const t = i.uint32();
  4474. switch (t >>> 3) {
  4475. case 1:
  4476. if (t === 8) {
  4477. a.add.push(i.int32());
  4478. continue
  4479. }
  4480. if (t === 10) {
  4481. const s = i.uint32() + i.pos;
  4482. for (; i.pos < s;) a.add.push(i.int32());
  4483. continue
  4484. }
  4485. break;
  4486. case 2:
  4487. if (t === 16) {
  4488. a.sub.push(i.int32());
  4489. continue
  4490. }
  4491. if (t === 18) {
  4492. const s = i.uint32() + i.pos;
  4493. for (; i.pos < s;) a.sub.push(i.int32());
  4494. continue
  4495. }
  4496. break;
  4497. case 3:
  4498. if (t === 24) {
  4499. a.set.push(i.int32());
  4500. continue
  4501. }
  4502. if (t === 26) {
  4503. const s = i.uint32() + i.pos;
  4504. for (; i.pos < s;) a.set.push(i.int32());
  4505. continue
  4506. }
  4507. break
  4508. }
  4509. if ((t & 7) === 4 || t === 0) break;
  4510. i.skipType(t & 7)
  4511. }
  4512. return a
  4513. }, fromJSON(u) {
  4514. return {
  4515. add: globalThis.Array.isArray(u == null ? void 0 : u.add) ? u.add.map(e => globalThis.Number(e)) : [],
  4516. sub: globalThis.Array.isArray(u == null ? void 0 : u.sub) ? u.sub.map(e => globalThis.Number(e)) : [],
  4517. set: globalThis.Array.isArray(u == null ? void 0 : u.set) ? u.set.map(e => globalThis.Number(e)) : []
  4518. }
  4519. }, toJSON(u) {
  4520. var i, n, a;
  4521. const e = {};
  4522. 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
  4523. }, create(u) {
  4524. return Zu.fromPartial(u != null ? u : {})
  4525. }, fromPartial(u) {
  4526. var i, n, a;
  4527. const e = ji();
  4528. 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
  4529. }
  4530. };
  4531. function Oi() {
  4532. return {display: 0, on: !1}
  4533. }
  4534. const Qu = {
  4535. encode(u, e = r.Writer.create()) {
  4536. return u.display !== 0 && e.uint32(8).int32(u.display), u.on !== !1 && e.uint32(16).bool(u.on), e
  4537. }, decode(u, e) {
  4538. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4539. let n = e === void 0 ? i.len : i.pos + e;
  4540. const a = Oi();
  4541. for (; i.pos < n;) {
  4542. const t = i.uint32();
  4543. switch (t >>> 3) {
  4544. case 1:
  4545. if (t !== 8) break;
  4546. a.display = i.int32();
  4547. continue;
  4548. case 2:
  4549. if (t !== 16) break;
  4550. a.on = i.bool();
  4551. continue
  4552. }
  4553. if ((t & 7) === 4 || t === 0) break;
  4554. i.skipType(t & 7)
  4555. }
  4556. return a
  4557. }, fromJSON(u) {
  4558. return {display: o(u.display) ? globalThis.Number(u.display) : 0, on: o(u.on) ? globalThis.Boolean(u.on) : !1}
  4559. }, toJSON(u) {
  4560. const e = {};
  4561. return u.display !== 0 && (e.display = Math.round(u.display)), u.on !== !1 && (e.on = u.on), e
  4562. }, create(u) {
  4563. return Qu.fromPartial(u != null ? u : {})
  4564. }, fromPartial(u) {
  4565. var i, n;
  4566. const e = Oi();
  4567. return e.display = (i = u.display) != null ? i : 0, e.on = (n = u.on) != null ? n : !1, e
  4568. }
  4569. };
  4570. function Ui() {
  4571. return {impl_key: "", on: !1}
  4572. }
  4573. const Xu = {
  4574. encode(u, e = r.Writer.create()) {
  4575. return u.impl_key !== "" && e.uint32(10).string(u.impl_key), u.on !== !1 && e.uint32(16).bool(u.on), e
  4576. }, decode(u, e) {
  4577. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4578. let n = e === void 0 ? i.len : i.pos + e;
  4579. const a = Ui();
  4580. for (; i.pos < n;) {
  4581. const t = i.uint32();
  4582. switch (t >>> 3) {
  4583. case 1:
  4584. if (t !== 10) break;
  4585. a.impl_key = i.string();
  4586. continue;
  4587. case 2:
  4588. if (t !== 16) break;
  4589. a.on = i.bool();
  4590. continue
  4591. }
  4592. if ((t & 7) === 4 || t === 0) break;
  4593. i.skipType(t & 7)
  4594. }
  4595. return a
  4596. }, fromJSON(u) {
  4597. return {
  4598. impl_key: o(u.impl_key) ? globalThis.String(u.impl_key) : "",
  4599. on: o(u.on) ? globalThis.Boolean(u.on) : !1
  4600. }
  4601. }, toJSON(u) {
  4602. const e = {};
  4603. return u.impl_key !== "" && (e.impl_key = u.impl_key), u.on !== !1 && (e.on = u.on), e
  4604. }, create(u) {
  4605. return Xu.fromPartial(u != null ? u : {})
  4606. }, fromPartial(u) {
  4607. var i, n;
  4608. const e = Ui();
  4609. return e.impl_key = (i = u.impl_key) != null ? i : "", e.on = (n = u.on) != null ? n : !1, e
  4610. }
  4611. };
  4612. function Mi() {
  4613. return {permission: 0, enabled: !1}
  4614. }
  4615. const Z0 = {
  4616. encode(u, e = r.Writer.create()) {
  4617. return u.permission !== 0 && e.uint32(8).int32(u.permission), u.enabled !== !1 && e.uint32(16).bool(u.enabled), e
  4618. }, decode(u, e) {
  4619. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4620. let n = e === void 0 ? i.len : i.pos + e;
  4621. const a = Mi();
  4622. for (; i.pos < n;) {
  4623. const t = i.uint32();
  4624. switch (t >>> 3) {
  4625. case 1:
  4626. if (t !== 8) break;
  4627. a.permission = i.int32();
  4628. continue;
  4629. case 2:
  4630. if (t !== 16) break;
  4631. a.enabled = i.bool();
  4632. continue
  4633. }
  4634. if ((t & 7) === 4 || t === 0) break;
  4635. i.skipType(t & 7)
  4636. }
  4637. return a
  4638. }, fromJSON(u) {
  4639. return {
  4640. permission: o(u.permission) ? xn(u.permission) : 0,
  4641. enabled: o(u.enabled) ? globalThis.Boolean(u.enabled) : !1
  4642. }
  4643. }, toJSON(u) {
  4644. const e = {};
  4645. return u.permission !== 0 && (e.permission = yn(u.permission)), u.enabled !== !1 && (e.enabled = u.enabled), e
  4646. }, create(u) {
  4647. return Z0.fromPartial(u != null ? u : {})
  4648. }, fromPartial(u) {
  4649. var i, n;
  4650. const e = Mi();
  4651. return e.permission = (i = u.permission) != null ? i : 0, e.enabled = (n = u.enabled) != null ? n : !1, e
  4652. }
  4653. };
  4654. function Li() {
  4655. return {
  4656. ability_vp9: 0,
  4657. ability_h264: 0,
  4658. ability_h265: 0,
  4659. prefer: 0,
  4660. ability_vp8: 0,
  4661. ability_av1: 0,
  4662. i444: void 0,
  4663. prefer_chroma: 0
  4664. }
  4665. }
  4666. const Yu = {
  4667. encode(u, e = r.Writer.create()) {
  4668. 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 && $.encode(u.i444, e.uint32(58).fork()).ldelim(), u.prefer_chroma !== 0 && e.uint32(64).int32(u.prefer_chroma), e
  4669. }, decode(u, e) {
  4670. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4671. let n = e === void 0 ? i.len : i.pos + e;
  4672. const a = Li();
  4673. for (; i.pos < n;) {
  4674. const t = i.uint32();
  4675. switch (t >>> 3) {
  4676. case 1:
  4677. if (t !== 8) break;
  4678. a.ability_vp9 = i.int32();
  4679. continue;
  4680. case 2:
  4681. if (t !== 16) break;
  4682. a.ability_h264 = i.int32();
  4683. continue;
  4684. case 3:
  4685. if (t !== 24) break;
  4686. a.ability_h265 = i.int32();
  4687. continue;
  4688. case 4:
  4689. if (t !== 32) break;
  4690. a.prefer = i.int32();
  4691. continue;
  4692. case 5:
  4693. if (t !== 40) break;
  4694. a.ability_vp8 = i.int32();
  4695. continue;
  4696. case 6:
  4697. if (t !== 48) break;
  4698. a.ability_av1 = i.int32();
  4699. continue;
  4700. case 7:
  4701. if (t !== 58) break;
  4702. a.i444 = $.decode(i, i.uint32());
  4703. continue;
  4704. case 8:
  4705. if (t !== 64) break;
  4706. a.prefer_chroma = i.int32();
  4707. continue
  4708. }
  4709. if ((t & 7) === 4 || t === 0) break;
  4710. i.skipType(t & 7)
  4711. }
  4712. return a
  4713. }, fromJSON(u) {
  4714. return {
  4715. ability_vp9: o(u.ability_vp9) ? globalThis.Number(u.ability_vp9) : 0,
  4716. ability_h264: o(u.ability_h264) ? globalThis.Number(u.ability_h264) : 0,
  4717. ability_h265: o(u.ability_h265) ? globalThis.Number(u.ability_h265) : 0,
  4718. prefer: o(u.prefer) ? bn(u.prefer) : 0,
  4719. ability_vp8: o(u.ability_vp8) ? globalThis.Number(u.ability_vp8) : 0,
  4720. ability_av1: o(u.ability_av1) ? globalThis.Number(u.ability_av1) : 0,
  4721. i444: o(u.i444) ? $.fromJSON(u.i444) : void 0,
  4722. prefer_chroma: o(u.prefer_chroma) ? cn(u.prefer_chroma) : 0
  4723. }
  4724. }, toJSON(u) {
  4725. const e = {};
  4726. 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 = wn(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 = $.toJSON(u.i444)), u.prefer_chroma !== 0 && (e.prefer_chroma = Cn(u.prefer_chroma)), e
  4727. }, create(u) {
  4728. return Yu.fromPartial(u != null ? u : {})
  4729. }, fromPartial(u) {
  4730. var i, n, a, t, s, E, D;
  4731. const e = Li();
  4732. 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 ? $.fromPartial(u.i444) : void 0, e.prefer_chroma = (D = u.prefer_chroma) != null ? D : 0, e
  4733. }
  4734. };
  4735. function Wi() {
  4736. return {
  4737. image_quality: 0,
  4738. lock_after_session_end: 0,
  4739. show_remote_cursor: 0,
  4740. privacy_mode: 0,
  4741. block_input: 0,
  4742. custom_image_quality: 0,
  4743. disable_audio: 0,
  4744. disable_clipboard: 0,
  4745. enable_file_transfer: 0,
  4746. supported_decoding: void 0,
  4747. custom_fps: 0,
  4748. disable_keyboard: 0,
  4749. follow_remote_cursor: 0,
  4750. follow_remote_window: 0,
  4751. disable_camera: 0,
  4752. terminal_persistent: 0,
  4753. show_my_cursor: 0
  4754. }
  4755. }
  4756. const O = {
  4757. encode(u, e = r.Writer.create()) {
  4758. 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 && Yu.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), u.terminal_persistent !== 0 && e.uint32(144).int32(u.terminal_persistent), u.show_my_cursor !== 0 && e.uint32(152).int32(u.show_my_cursor), e
  4759. }, decode(u, e) {
  4760. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4761. let n = e === void 0 ? i.len : i.pos + e;
  4762. const a = Wi();
  4763. for (; i.pos < n;) {
  4764. const t = i.uint32();
  4765. switch (t >>> 3) {
  4766. case 1:
  4767. if (t !== 8) break;
  4768. a.image_quality = i.int32();
  4769. continue;
  4770. case 2:
  4771. if (t !== 16) break;
  4772. a.lock_after_session_end = i.int32();
  4773. continue;
  4774. case 3:
  4775. if (t !== 24) break;
  4776. a.show_remote_cursor = i.int32();
  4777. continue;
  4778. case 4:
  4779. if (t !== 32) break;
  4780. a.privacy_mode = i.int32();
  4781. continue;
  4782. case 5:
  4783. if (t !== 40) break;
  4784. a.block_input = i.int32();
  4785. continue;
  4786. case 6:
  4787. if (t !== 48) break;
  4788. a.custom_image_quality = i.int32();
  4789. continue;
  4790. case 7:
  4791. if (t !== 56) break;
  4792. a.disable_audio = i.int32();
  4793. continue;
  4794. case 8:
  4795. if (t !== 64) break;
  4796. a.disable_clipboard = i.int32();
  4797. continue;
  4798. case 9:
  4799. if (t !== 72) break;
  4800. a.enable_file_transfer = i.int32();
  4801. continue;
  4802. case 10:
  4803. if (t !== 82) break;
  4804. a.supported_decoding = Yu.decode(i, i.uint32());
  4805. continue;
  4806. case 11:
  4807. if (t !== 88) break;
  4808. a.custom_fps = i.int32();
  4809. continue;
  4810. case 12:
  4811. if (t !== 96) break;
  4812. a.disable_keyboard = i.int32();
  4813. continue;
  4814. case 15:
  4815. if (t !== 120) break;
  4816. a.follow_remote_cursor = i.int32();
  4817. continue;
  4818. case 16:
  4819. if (t !== 128) break;
  4820. a.follow_remote_window = i.int32();
  4821. continue;
  4822. case 17:
  4823. if (t !== 136) break;
  4824. a.disable_camera = i.int32();
  4825. continue;
  4826. case 18:
  4827. if (t !== 144) break;
  4828. a.terminal_persistent = i.int32();
  4829. continue;
  4830. case 19:
  4831. if (t !== 152) break;
  4832. a.show_my_cursor = i.int32();
  4833. continue
  4834. }
  4835. if ((t & 7) === 4 || t === 0) break;
  4836. i.skipType(t & 7)
  4837. }
  4838. return a
  4839. }, fromJSON(u) {
  4840. return {
  4841. image_quality: o(u.image_quality) ? gn(u.image_quality) : 0,
  4842. lock_after_session_end: o(u.lock_after_session_end) ? H(u.lock_after_session_end) : 0,
  4843. show_remote_cursor: o(u.show_remote_cursor) ? H(u.show_remote_cursor) : 0,
  4844. privacy_mode: o(u.privacy_mode) ? H(u.privacy_mode) : 0,
  4845. block_input: o(u.block_input) ? H(u.block_input) : 0,
  4846. custom_image_quality: o(u.custom_image_quality) ? globalThis.Number(u.custom_image_quality) : 0,
  4847. disable_audio: o(u.disable_audio) ? H(u.disable_audio) : 0,
  4848. disable_clipboard: o(u.disable_clipboard) ? H(u.disable_clipboard) : 0,
  4849. enable_file_transfer: o(u.enable_file_transfer) ? H(u.enable_file_transfer) : 0,
  4850. supported_decoding: o(u.supported_decoding) ? Yu.fromJSON(u.supported_decoding) : void 0,
  4851. custom_fps: o(u.custom_fps) ? globalThis.Number(u.custom_fps) : 0,
  4852. disable_keyboard: o(u.disable_keyboard) ? H(u.disable_keyboard) : 0,
  4853. follow_remote_cursor: o(u.follow_remote_cursor) ? H(u.follow_remote_cursor) : 0,
  4854. follow_remote_window: o(u.follow_remote_window) ? H(u.follow_remote_window) : 0,
  4855. disable_camera: o(u.disable_camera) ? H(u.disable_camera) : 0,
  4856. terminal_persistent: o(u.terminal_persistent) ? H(u.terminal_persistent) : 0,
  4857. show_my_cursor: o(u.show_my_cursor) ? H(u.show_my_cursor) : 0
  4858. }
  4859. }, toJSON(u) {
  4860. const e = {};
  4861. return u.image_quality !== 0 && (e.image_quality = kn(u.image_quality)), u.lock_after_session_end !== 0 && (e.lock_after_session_end = J(u.lock_after_session_end)), u.show_remote_cursor !== 0 && (e.show_remote_cursor = J(u.show_remote_cursor)), u.privacy_mode !== 0 && (e.privacy_mode = J(u.privacy_mode)), u.block_input !== 0 && (e.block_input = J(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 = J(u.disable_audio)), u.disable_clipboard !== 0 && (e.disable_clipboard = J(u.disable_clipboard)), u.enable_file_transfer !== 0 && (e.enable_file_transfer = J(u.enable_file_transfer)), u.supported_decoding !== void 0 && (e.supported_decoding = Yu.toJSON(u.supported_decoding)), u.custom_fps !== 0 && (e.custom_fps = Math.round(u.custom_fps)), u.disable_keyboard !== 0 && (e.disable_keyboard = J(u.disable_keyboard)), u.follow_remote_cursor !== 0 && (e.follow_remote_cursor = J(u.follow_remote_cursor)), u.follow_remote_window !== 0 && (e.follow_remote_window = J(u.follow_remote_window)), u.disable_camera !== 0 && (e.disable_camera = J(u.disable_camera)), u.terminal_persistent !== 0 && (e.terminal_persistent = J(u.terminal_persistent)), u.show_my_cursor !== 0 && (e.show_my_cursor = J(u.show_my_cursor)), e
  4862. }, create(u) {
  4863. return O.fromPartial(u != null ? u : {})
  4864. }, fromPartial(u) {
  4865. var i, n, a, t, s, E, D, d, C, c, p, F, w, y, A, U;
  4866. const e = Wi();
  4867. 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 = (D = u.disable_audio) != null ? D : 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 ? Yu.fromPartial(u.supported_decoding) : void 0, e.custom_fps = (c = u.custom_fps) != null ? c : 0, e.disable_keyboard = (p = u.disable_keyboard) != null ? p : 0, e.follow_remote_cursor = (F = u.follow_remote_cursor) != null ? F : 0, e.follow_remote_window = (w = u.follow_remote_window) != null ? w : 0, e.disable_camera = (y = u.disable_camera) != null ? y : 0, e.terminal_persistent = (A = u.terminal_persistent) != null ? A : 0, e.show_my_cursor = (U = u.show_my_cursor) != null ? U : 0, e
  4868. }
  4869. };
  4870. function Vi() {
  4871. return {time: 0, from_client: !1, last_delay: 0, target_bitrate: 0}
  4872. }
  4873. const Q0 = {
  4874. encode(u, e = r.Writer.create()) {
  4875. 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
  4876. }, decode(u, e) {
  4877. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4878. let n = e === void 0 ? i.len : i.pos + e;
  4879. const a = Vi();
  4880. for (; i.pos < n;) {
  4881. const t = i.uint32();
  4882. switch (t >>> 3) {
  4883. case 1:
  4884. if (t !== 8) break;
  4885. a.time = W(i.int64());
  4886. continue;
  4887. case 2:
  4888. if (t !== 16) break;
  4889. a.from_client = i.bool();
  4890. continue;
  4891. case 3:
  4892. if (t !== 24) break;
  4893. a.last_delay = i.uint32();
  4894. continue;
  4895. case 4:
  4896. if (t !== 32) break;
  4897. a.target_bitrate = i.uint32();
  4898. continue
  4899. }
  4900. if ((t & 7) === 4 || t === 0) break;
  4901. i.skipType(t & 7)
  4902. }
  4903. return a
  4904. }, fromJSON(u) {
  4905. return {
  4906. time: o(u.time) ? globalThis.Number(u.time) : 0,
  4907. from_client: o(u.from_client) ? globalThis.Boolean(u.from_client) : !1,
  4908. last_delay: o(u.last_delay) ? globalThis.Number(u.last_delay) : 0,
  4909. target_bitrate: o(u.target_bitrate) ? globalThis.Number(u.target_bitrate) : 0
  4910. }
  4911. }, toJSON(u) {
  4912. const e = {};
  4913. 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
  4914. }, create(u) {
  4915. return Q0.fromPartial(u != null ? u : {})
  4916. }, fromPartial(u) {
  4917. var i, n, a, t;
  4918. const e = Vi();
  4919. 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
  4920. }
  4921. };
  4922. function qi() {
  4923. return {asymmetric_value: new Uint8Array(0), symmetric_value: new Uint8Array(0)}
  4924. }
  4925. const X = {
  4926. encode(u, e = r.Writer.create()) {
  4927. 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
  4928. }, decode(u, e) {
  4929. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4930. let n = e === void 0 ? i.len : i.pos + e;
  4931. const a = qi();
  4932. for (; i.pos < n;) {
  4933. const t = i.uint32();
  4934. switch (t >>> 3) {
  4935. case 1:
  4936. if (t !== 10) break;
  4937. a.asymmetric_value = i.bytes();
  4938. continue;
  4939. case 2:
  4940. if (t !== 18) break;
  4941. a.symmetric_value = i.bytes();
  4942. continue
  4943. }
  4944. if ((t & 7) === 4 || t === 0) break;
  4945. i.skipType(t & 7)
  4946. }
  4947. return a
  4948. }, fromJSON(u) {
  4949. return {
  4950. asymmetric_value: o(u.asymmetric_value) ? T(u.asymmetric_value) : new Uint8Array(0),
  4951. symmetric_value: o(u.symmetric_value) ? T(u.symmetric_value) : new Uint8Array(0)
  4952. }
  4953. }, toJSON(u) {
  4954. const e = {};
  4955. return u.asymmetric_value.length !== 0 && (e.asymmetric_value = N(u.asymmetric_value)), u.symmetric_value.length !== 0 && (e.symmetric_value = N(u.symmetric_value)), e
  4956. }, create(u) {
  4957. return X.fromPartial(u != null ? u : {})
  4958. }, fromPartial(u) {
  4959. var i, n;
  4960. const e = qi();
  4961. 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
  4962. }
  4963. };
  4964. function Ki() {
  4965. return {id: new Uint8Array(0)}
  4966. }
  4967. const X0 = {
  4968. encode(u, e = r.Writer.create()) {
  4969. return u.id.length !== 0 && e.uint32(10).bytes(u.id), e
  4970. }, decode(u, e) {
  4971. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4972. let n = e === void 0 ? i.len : i.pos + e;
  4973. const a = Ki();
  4974. for (; i.pos < n;) {
  4975. const t = i.uint32();
  4976. switch (t >>> 3) {
  4977. case 1:
  4978. if (t !== 10) break;
  4979. a.id = i.bytes();
  4980. continue
  4981. }
  4982. if ((t & 7) === 4 || t === 0) break;
  4983. i.skipType(t & 7)
  4984. }
  4985. return a
  4986. }, fromJSON(u) {
  4987. return {id: o(u.id) ? T(u.id) : new Uint8Array(0)}
  4988. }, toJSON(u) {
  4989. const e = {};
  4990. return u.id.length !== 0 && (e.id = N(u.id)), e
  4991. }, create(u) {
  4992. return X0.fromPartial(u != null ? u : {})
  4993. }, fromPartial(u) {
  4994. var i;
  4995. const e = Ki();
  4996. return e.id = (i = u.id) != null ? i : new Uint8Array(0), e
  4997. }
  4998. };
  4999. function Hi() {
  5000. return {sample_rate: 0, channels: 0}
  5001. }
  5002. const Y0 = {
  5003. encode(u, e = r.Writer.create()) {
  5004. return u.sample_rate !== 0 && e.uint32(8).uint32(u.sample_rate), u.channels !== 0 && e.uint32(16).uint32(u.channels), e
  5005. }, decode(u, e) {
  5006. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5007. let n = e === void 0 ? i.len : i.pos + e;
  5008. const a = Hi();
  5009. for (; i.pos < n;) {
  5010. const t = i.uint32();
  5011. switch (t >>> 3) {
  5012. case 1:
  5013. if (t !== 8) break;
  5014. a.sample_rate = i.uint32();
  5015. continue;
  5016. case 2:
  5017. if (t !== 16) break;
  5018. a.channels = i.uint32();
  5019. continue
  5020. }
  5021. if ((t & 7) === 4 || t === 0) break;
  5022. i.skipType(t & 7)
  5023. }
  5024. return a
  5025. }, fromJSON(u) {
  5026. return {
  5027. sample_rate: o(u.sample_rate) ? globalThis.Number(u.sample_rate) : 0,
  5028. channels: o(u.channels) ? globalThis.Number(u.channels) : 0
  5029. }
  5030. }, toJSON(u) {
  5031. const e = {};
  5032. return u.sample_rate !== 0 && (e.sample_rate = Math.round(u.sample_rate)), u.channels !== 0 && (e.channels = Math.round(u.channels)), e
  5033. }, create(u) {
  5034. return Y0.fromPartial(u != null ? u : {})
  5035. }, fromPartial(u) {
  5036. var i, n;
  5037. const e = Hi();
  5038. return e.sample_rate = (i = u.sample_rate) != null ? i : 0, e.channels = (n = u.channels) != null ? n : 0, e
  5039. }
  5040. };
  5041. function Ji() {
  5042. return {data: new Uint8Array(0)}
  5043. }
  5044. const $0 = {
  5045. encode(u, e = r.Writer.create()) {
  5046. return u.data.length !== 0 && e.uint32(10).bytes(u.data), e
  5047. }, decode(u, e) {
  5048. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5049. let n = e === void 0 ? i.len : i.pos + e;
  5050. const a = Ji();
  5051. for (; i.pos < n;) {
  5052. const t = i.uint32();
  5053. switch (t >>> 3) {
  5054. case 1:
  5055. if (t !== 10) break;
  5056. a.data = i.bytes();
  5057. continue
  5058. }
  5059. if ((t & 7) === 4 || t === 0) break;
  5060. i.skipType(t & 7)
  5061. }
  5062. return a
  5063. }, fromJSON(u) {
  5064. return {data: o(u.data) ? T(u.data) : new Uint8Array(0)}
  5065. }, toJSON(u) {
  5066. const e = {};
  5067. return u.data.length !== 0 && (e.data = N(u.data)), e
  5068. }, create(u) {
  5069. return $0.fromPartial(u != null ? u : {})
  5070. }, fromPartial(u) {
  5071. var i;
  5072. const e = Ji();
  5073. return e.data = (i = u.data) != null ? i : new Uint8Array(0), e
  5074. }
  5075. };
  5076. function Gi() {
  5077. return {msgtype: "", title: "", text: "", link: ""}
  5078. }
  5079. const ue = {
  5080. encode(u, e = r.Writer.create()) {
  5081. 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
  5082. }, decode(u, e) {
  5083. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5084. let n = e === void 0 ? i.len : i.pos + e;
  5085. const a = Gi();
  5086. for (; i.pos < n;) {
  5087. const t = i.uint32();
  5088. switch (t >>> 3) {
  5089. case 1:
  5090. if (t !== 10) break;
  5091. a.msgtype = i.string();
  5092. continue;
  5093. case 2:
  5094. if (t !== 18) break;
  5095. a.title = i.string();
  5096. continue;
  5097. case 3:
  5098. if (t !== 26) break;
  5099. a.text = i.string();
  5100. continue;
  5101. case 4:
  5102. if (t !== 34) break;
  5103. a.link = i.string();
  5104. continue
  5105. }
  5106. if ((t & 7) === 4 || t === 0) break;
  5107. i.skipType(t & 7)
  5108. }
  5109. return a
  5110. }, fromJSON(u) {
  5111. return {
  5112. msgtype: o(u.msgtype) ? globalThis.String(u.msgtype) : "",
  5113. title: o(u.title) ? globalThis.String(u.title) : "",
  5114. text: o(u.text) ? globalThis.String(u.text) : "",
  5115. link: o(u.link) ? globalThis.String(u.link) : ""
  5116. }
  5117. }, toJSON(u) {
  5118. const e = {};
  5119. 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
  5120. }, create(u) {
  5121. return ue.fromPartial(u != null ? u : {})
  5122. }, fromPartial(u) {
  5123. var i, n, a, t;
  5124. const e = Gi();
  5125. 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
  5126. }
  5127. };
  5128. function Zi() {
  5129. return {privacy_mode_state: void 0, block_input_state: void 0, details: "", impl_key: ""}
  5130. }
  5131. const ee = {
  5132. encode(u, e = r.Writer.create()) {
  5133. 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
  5134. }, decode(u, e) {
  5135. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5136. let n = e === void 0 ? i.len : i.pos + e;
  5137. const a = Zi();
  5138. for (; i.pos < n;) {
  5139. const t = i.uint32();
  5140. switch (t >>> 3) {
  5141. case 1:
  5142. if (t !== 8) break;
  5143. a.privacy_mode_state = i.int32();
  5144. continue;
  5145. case 2:
  5146. if (t !== 16) break;
  5147. a.block_input_state = i.int32();
  5148. continue;
  5149. case 3:
  5150. if (t !== 26) break;
  5151. a.details = i.string();
  5152. continue;
  5153. case 4:
  5154. if (t !== 34) break;
  5155. a.impl_key = i.string();
  5156. continue
  5157. }
  5158. if ((t & 7) === 4 || t === 0) break;
  5159. i.skipType(t & 7)
  5160. }
  5161. return a
  5162. }, fromJSON(u) {
  5163. return {
  5164. privacy_mode_state: o(u.privacy_mode_state) ? Pn(u.privacy_mode_state) : void 0,
  5165. block_input_state: o(u.block_input_state) ? Sn(u.block_input_state) : void 0,
  5166. details: o(u.details) ? globalThis.String(u.details) : "",
  5167. impl_key: o(u.impl_key) ? globalThis.String(u.impl_key) : ""
  5168. }
  5169. }, toJSON(u) {
  5170. const e = {};
  5171. return u.privacy_mode_state !== void 0 && (e.privacy_mode_state = Rn(u.privacy_mode_state)), u.block_input_state !== void 0 && (e.block_input_state = zn(u.block_input_state)), u.details !== "" && (e.details = u.details), u.impl_key !== "" && (e.impl_key = u.impl_key), e
  5172. }, create(u) {
  5173. return ee.fromPartial(u != null ? u : {})
  5174. }, fromPartial(u) {
  5175. var i, n, a, t;
  5176. const e = Zi();
  5177. 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
  5178. }
  5179. };
  5180. function Qi() {
  5181. return {username: "", password: ""}
  5182. }
  5183. const $u = {
  5184. encode(u, e = r.Writer.create()) {
  5185. return u.username !== "" && e.uint32(10).string(u.username), u.password !== "" && e.uint32(18).string(u.password), e
  5186. }, decode(u, e) {
  5187. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5188. let n = e === void 0 ? i.len : i.pos + e;
  5189. const a = Qi();
  5190. for (; i.pos < n;) {
  5191. const t = i.uint32();
  5192. switch (t >>> 3) {
  5193. case 1:
  5194. if (t !== 10) break;
  5195. a.username = i.string();
  5196. continue;
  5197. case 2:
  5198. if (t !== 18) break;
  5199. a.password = i.string();
  5200. continue
  5201. }
  5202. if ((t & 7) === 4 || t === 0) break;
  5203. i.skipType(t & 7)
  5204. }
  5205. return a
  5206. }, fromJSON(u) {
  5207. return {
  5208. username: o(u.username) ? globalThis.String(u.username) : "",
  5209. password: o(u.password) ? globalThis.String(u.password) : ""
  5210. }
  5211. }, toJSON(u) {
  5212. const e = {};
  5213. return u.username !== "" && (e.username = u.username), u.password !== "" && (e.password = u.password), e
  5214. }, create(u) {
  5215. return $u.fromPartial(u != null ? u : {})
  5216. }, fromPartial(u) {
  5217. var i, n;
  5218. const e = Qi();
  5219. return e.username = (i = u.username) != null ? i : "", e.password = (n = u.password) != null ? n : "", e
  5220. }
  5221. };
  5222. function Xi() {
  5223. return {direct: void 0, logon: void 0}
  5224. }
  5225. const vu = {
  5226. encode(u, e = r.Writer.create()) {
  5227. return u.direct !== void 0 && e.uint32(8).bool(u.direct), u.logon !== void 0 && $u.encode(u.logon, e.uint32(18).fork()).ldelim(), e
  5228. }, decode(u, e) {
  5229. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5230. let n = e === void 0 ? i.len : i.pos + e;
  5231. const a = Xi();
  5232. for (; i.pos < n;) {
  5233. const t = i.uint32();
  5234. switch (t >>> 3) {
  5235. case 1:
  5236. if (t !== 8) break;
  5237. a.direct = i.bool();
  5238. continue;
  5239. case 2:
  5240. if (t !== 18) break;
  5241. a.logon = $u.decode(i, i.uint32());
  5242. continue
  5243. }
  5244. if ((t & 7) === 4 || t === 0) break;
  5245. i.skipType(t & 7)
  5246. }
  5247. return a
  5248. }, fromJSON(u) {
  5249. return {
  5250. direct: o(u.direct) ? globalThis.Boolean(u.direct) : void 0,
  5251. logon: o(u.logon) ? $u.fromJSON(u.logon) : void 0
  5252. }
  5253. }, toJSON(u) {
  5254. const e = {};
  5255. return u.direct !== void 0 && (e.direct = u.direct), u.logon !== void 0 && (e.logon = $u.toJSON(u.logon)), e
  5256. }, create(u) {
  5257. return vu.fromPartial(u != null ? u : {})
  5258. }, fromPartial(u) {
  5259. var i;
  5260. const e = Xi();
  5261. return e.direct = (i = u.direct) != null ? i : void 0, e.logon = u.logon !== void 0 && u.logon !== null ? $u.fromPartial(u.logon) : void 0, e
  5262. }
  5263. };
  5264. function Yi() {
  5265. return {uuid: new Uint8Array(0)}
  5266. }
  5267. const ie = {
  5268. encode(u, e = r.Writer.create()) {
  5269. return u.uuid.length !== 0 && e.uint32(10).bytes(u.uuid), e
  5270. }, decode(u, e) {
  5271. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5272. let n = e === void 0 ? i.len : i.pos + e;
  5273. const a = Yi();
  5274. for (; i.pos < n;) {
  5275. const t = i.uint32();
  5276. switch (t >>> 3) {
  5277. case 1:
  5278. if (t !== 10) break;
  5279. a.uuid = i.bytes();
  5280. continue
  5281. }
  5282. if ((t & 7) === 4 || t === 0) break;
  5283. i.skipType(t & 7)
  5284. }
  5285. return a
  5286. }, fromJSON(u) {
  5287. return {uuid: o(u.uuid) ? T(u.uuid) : new Uint8Array(0)}
  5288. }, toJSON(u) {
  5289. const e = {};
  5290. return u.uuid.length !== 0 && (e.uuid = N(u.uuid)), e
  5291. }, create(u) {
  5292. return ie.fromPartial(u != null ? u : {})
  5293. }, fromPartial(u) {
  5294. var i;
  5295. const e = Yi();
  5296. return e.uuid = (i = u.uuid) != null ? i : new Uint8Array(0), e
  5297. }
  5298. };
  5299. function $i() {
  5300. return {uuid: new Uint8Array(0), lr: void 0}
  5301. }
  5302. const te = {
  5303. encode(u, e = r.Writer.create()) {
  5304. return u.uuid.length !== 0 && e.uint32(10).bytes(u.uuid), u.lr !== void 0 && Y.encode(u.lr, e.uint32(18).fork()).ldelim(), e
  5305. }, decode(u, e) {
  5306. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5307. let n = e === void 0 ? i.len : i.pos + e;
  5308. const a = $i();
  5309. for (; i.pos < n;) {
  5310. const t = i.uint32();
  5311. switch (t >>> 3) {
  5312. case 1:
  5313. if (t !== 10) break;
  5314. a.uuid = i.bytes();
  5315. continue;
  5316. case 2:
  5317. if (t !== 18) break;
  5318. a.lr = Y.decode(i, i.uint32());
  5319. continue
  5320. }
  5321. if ((t & 7) === 4 || t === 0) break;
  5322. i.skipType(t & 7)
  5323. }
  5324. return a
  5325. }, fromJSON(u) {
  5326. return {uuid: o(u.uuid) ? T(u.uuid) : new Uint8Array(0), lr: o(u.lr) ? Y.fromJSON(u.lr) : void 0}
  5327. }, toJSON(u) {
  5328. const e = {};
  5329. return u.uuid.length !== 0 && (e.uuid = N(u.uuid)), u.lr !== void 0 && (e.lr = Y.toJSON(u.lr)), e
  5330. }, create(u) {
  5331. return te.fromPartial(u != null ? u : {})
  5332. }, fromPartial(u) {
  5333. var i;
  5334. const e = $i();
  5335. return e.uuid = (i = u.uuid) != null ? i : new Uint8Array(0), e.lr = u.lr !== void 0 && u.lr !== null ? Y.fromPartial(u.lr) : void 0, e
  5336. }
  5337. };
  5338. function ut() {
  5339. return {}
  5340. }
  5341. const ae = {
  5342. encode(u, e = r.Writer.create()) {
  5343. return 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 = ut();
  5348. for (; i.pos < n;) {
  5349. const t = i.uint32();
  5350. if ((t & 7) === 4 || t === 0) break;
  5351. i.skipType(t & 7)
  5352. }
  5353. return a
  5354. }, fromJSON(u) {
  5355. return {}
  5356. }, toJSON(u) {
  5357. return {}
  5358. }, create(u) {
  5359. return ae.fromPartial(u != null ? u : {})
  5360. }, fromPartial(u) {
  5361. return ut()
  5362. }
  5363. };
  5364. function et() {
  5365. return {id: "", content: new Uint8Array(0)}
  5366. }
  5367. const ne = {
  5368. encode(u, e = r.Writer.create()) {
  5369. return u.id !== "" && e.uint32(10).string(u.id), u.content.length !== 0 && e.uint32(18).bytes(u.content), e
  5370. }, decode(u, e) {
  5371. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5372. let n = e === void 0 ? i.len : i.pos + e;
  5373. const a = et();
  5374. for (; i.pos < n;) {
  5375. const t = i.uint32();
  5376. switch (t >>> 3) {
  5377. case 1:
  5378. if (t !== 10) break;
  5379. a.id = i.string();
  5380. continue;
  5381. case 2:
  5382. if (t !== 18) break;
  5383. a.content = i.bytes();
  5384. continue
  5385. }
  5386. if ((t & 7) === 4 || t === 0) break;
  5387. i.skipType(t & 7)
  5388. }
  5389. return a
  5390. }, fromJSON(u) {
  5391. return {id: o(u.id) ? globalThis.String(u.id) : "", content: o(u.content) ? T(u.content) : new Uint8Array(0)}
  5392. }, toJSON(u) {
  5393. const e = {};
  5394. return u.id !== "" && (e.id = u.id), u.content.length !== 0 && (e.content = N(u.content)), e
  5395. }, create(u) {
  5396. return ne.fromPartial(u != null ? u : {})
  5397. }, fromPartial(u) {
  5398. var i, n;
  5399. const e = et();
  5400. return e.id = (i = u.id) != null ? i : "", e.content = (n = u.content) != null ? n : new Uint8Array(0), e
  5401. }
  5402. };
  5403. function it() {
  5404. return {id: "", name: "", msg: ""}
  5405. }
  5406. const oe = {
  5407. encode(u, e = r.Writer.create()) {
  5408. 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
  5409. }, decode(u, e) {
  5410. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5411. let n = e === void 0 ? i.len : i.pos + e;
  5412. const a = it();
  5413. for (; i.pos < n;) {
  5414. const t = i.uint32();
  5415. switch (t >>> 3) {
  5416. case 1:
  5417. if (t !== 10) break;
  5418. a.id = i.string();
  5419. continue;
  5420. case 2:
  5421. if (t !== 18) break;
  5422. a.name = i.string();
  5423. continue;
  5424. case 3:
  5425. if (t !== 26) break;
  5426. a.msg = i.string();
  5427. continue
  5428. }
  5429. if ((t & 7) === 4 || t === 0) break;
  5430. i.skipType(t & 7)
  5431. }
  5432. return a
  5433. }, fromJSON(u) {
  5434. return {
  5435. id: o(u.id) ? globalThis.String(u.id) : "",
  5436. name: o(u.name) ? globalThis.String(u.name) : "",
  5437. msg: o(u.msg) ? globalThis.String(u.msg) : ""
  5438. }
  5439. }, toJSON(u) {
  5440. const e = {};
  5441. return u.id !== "" && (e.id = u.id), u.name !== "" && (e.name = u.name), u.msg !== "" && (e.msg = u.msg), e
  5442. }, create(u) {
  5443. return oe.fromPartial(u != null ? u : {})
  5444. }, fromPartial(u) {
  5445. var i, n, a;
  5446. const e = it();
  5447. return e.id = (i = u.id) != null ? i : "", e.name = (n = u.name) != null ? n : "", e.msg = (a = u.msg) != null ? a : "", e
  5448. }
  5449. };
  5450. function tt() {
  5451. return {sessions: [], current_sid: 0}
  5452. }
  5453. const re = {
  5454. encode(u, e = r.Writer.create()) {
  5455. for (const i of u.sessions) f0.encode(i, e.uint32(10).fork()).ldelim();
  5456. return u.current_sid !== 0 && e.uint32(16).uint32(u.current_sid), e
  5457. }, decode(u, e) {
  5458. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5459. let n = e === void 0 ? i.len : i.pos + e;
  5460. const a = tt();
  5461. for (; i.pos < n;) {
  5462. const t = i.uint32();
  5463. switch (t >>> 3) {
  5464. case 1:
  5465. if (t !== 10) break;
  5466. a.sessions.push(f0.decode(i, i.uint32()));
  5467. continue;
  5468. case 2:
  5469. if (t !== 16) break;
  5470. a.current_sid = i.uint32();
  5471. continue
  5472. }
  5473. if ((t & 7) === 4 || t === 0) break;
  5474. i.skipType(t & 7)
  5475. }
  5476. return a
  5477. }, fromJSON(u) {
  5478. return {
  5479. sessions: globalThis.Array.isArray(u == null ? void 0 : u.sessions) ? u.sessions.map(e => f0.fromJSON(e)) : [],
  5480. current_sid: o(u.current_sid) ? globalThis.Number(u.current_sid) : 0
  5481. }
  5482. }, toJSON(u) {
  5483. var i;
  5484. const e = {};
  5485. return (i = u.sessions) != null && i.length && (e.sessions = u.sessions.map(n => f0.toJSON(n))), u.current_sid !== 0 && (e.current_sid = Math.round(u.current_sid)), e
  5486. }, create(u) {
  5487. return re.fromPartial(u != null ? u : {})
  5488. }, fromPartial(u) {
  5489. var i, n;
  5490. const e = tt();
  5491. return e.sessions = ((i = u.sessions) == null ? void 0 : i.map(a => f0.fromPartial(a))) || [], e.current_sid = (n = u.current_sid) != null ? n : 0, e
  5492. }
  5493. };
  5494. function at() {
  5495. return {switch_display: 0}
  5496. }
  5497. const se = {
  5498. encode(u, e = r.Writer.create()) {
  5499. return u.switch_display !== 0 && e.uint32(8).int32(u.switch_display), e
  5500. }, decode(u, e) {
  5501. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5502. let n = e === void 0 ? i.len : i.pos + e;
  5503. const a = at();
  5504. for (; i.pos < n;) {
  5505. const t = i.uint32();
  5506. switch (t >>> 3) {
  5507. case 1:
  5508. if (t !== 8) break;
  5509. a.switch_display = i.int32();
  5510. continue
  5511. }
  5512. if ((t & 7) === 4 || t === 0) break;
  5513. i.skipType(t & 7)
  5514. }
  5515. return a
  5516. }, fromJSON(u) {
  5517. return {switch_display: o(u.switch_display) ? globalThis.Number(u.switch_display) : 0}
  5518. }, toJSON(u) {
  5519. const e = {};
  5520. return u.switch_display !== 0 && (e.switch_display = Math.round(u.switch_display)), e
  5521. }, create(u) {
  5522. return se.fromPartial(u != null ? u : {})
  5523. }, fromPartial(u) {
  5524. var i;
  5525. const e = at();
  5526. return e.switch_display = (i = u.switch_display) != null ? i : 0, e
  5527. }
  5528. };
  5529. function nt() {
  5530. return {
  5531. chat_message: void 0,
  5532. switch_display: void 0,
  5533. permission_info: void 0,
  5534. option: void 0,
  5535. audio_format: void 0,
  5536. close_reason: void 0,
  5537. refresh_video: void 0,
  5538. video_received: void 0,
  5539. back_notification: void 0,
  5540. restart_remote_device: void 0,
  5541. uac: void 0,
  5542. foreground_window_elevated: void 0,
  5543. stop_service: void 0,
  5544. elevation_request: void 0,
  5545. elevation_response: void 0,
  5546. portable_service_running: void 0,
  5547. switch_sides_request: void 0,
  5548. switch_back: void 0,
  5549. change_resolution: void 0,
  5550. plugin_request: void 0,
  5551. plugin_failure: void 0,
  5552. full_speed_fps: void 0,
  5553. auto_adjust_fps: void 0,
  5554. client_record_status: void 0,
  5555. capture_displays: void 0,
  5556. refresh_video_display: void 0,
  5557. toggle_virtual_display: void 0,
  5558. toggle_privacy_mode: void 0,
  5559. supported_encoding: void 0,
  5560. selected_sid: void 0,
  5561. change_display_resolution: void 0,
  5562. message_query: void 0,
  5563. follow_current_display: void 0
  5564. }
  5565. }
  5566. const f = {
  5567. encode(u, e = r.Writer.create()) {
  5568. return u.chat_message !== void 0 && Su.encode(u.chat_message, e.uint32(34).fork()).ldelim(), u.switch_display !== void 0 && Gu.encode(u.switch_display, e.uint32(42).fork()).ldelim(), u.permission_info !== void 0 && Z0.encode(u.permission_info, e.uint32(50).fork()).ldelim(), u.option !== void 0 && O.encode(u.option, e.uint32(58).fork()).ldelim(), u.audio_format !== void 0 && Y0.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 && ee.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 && vu.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 && ie.encode(u.switch_sides_request, e.uint32(170).fork()).ldelim(), u.switch_back !== void 0 && ae.encode(u.switch_back, e.uint32(178).fork()).ldelim(), u.change_resolution !== void 0 && g.encode(u.change_resolution, e.uint32(194).fork()).ldelim(), u.plugin_request !== void 0 && ne.encode(u.plugin_request, e.uint32(202).fork()).ldelim(), u.plugin_failure !== void 0 && oe.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 && Zu.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 && Qu.encode(u.toggle_virtual_display, e.uint32(258).fork()).ldelim(), u.toggle_privacy_mode !== void 0 && Xu.encode(u.toggle_privacy_mode, e.uint32(266).fork()).ldelim(), u.supported_encoding !== void 0 && uu.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 && Ju.encode(u.change_display_resolution, e.uint32(290).fork()).ldelim(), u.message_query !== void 0 && se.encode(u.message_query, e.uint32(298).fork()).ldelim(), u.follow_current_display !== void 0 && e.uint32(304).int32(u.follow_current_display), e
  5569. }, decode(u, e) {
  5570. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5571. let n = e === void 0 ? i.len : i.pos + e;
  5572. const a = nt();
  5573. for (; i.pos < n;) {
  5574. const t = i.uint32();
  5575. switch (t >>> 3) {
  5576. case 4:
  5577. if (t !== 34) break;
  5578. a.chat_message = Su.decode(i, i.uint32());
  5579. continue;
  5580. case 5:
  5581. if (t !== 42) break;
  5582. a.switch_display = Gu.decode(i, i.uint32());
  5583. continue;
  5584. case 6:
  5585. if (t !== 50) break;
  5586. a.permission_info = Z0.decode(i, i.uint32());
  5587. continue;
  5588. case 7:
  5589. if (t !== 58) break;
  5590. a.option = O.decode(i, i.uint32());
  5591. continue;
  5592. case 8:
  5593. if (t !== 66) break;
  5594. a.audio_format = Y0.decode(i, i.uint32());
  5595. continue;
  5596. case 9:
  5597. if (t !== 74) break;
  5598. a.close_reason = i.string();
  5599. continue;
  5600. case 10:
  5601. if (t !== 80) break;
  5602. a.refresh_video = i.bool();
  5603. continue;
  5604. case 12:
  5605. if (t !== 96) break;
  5606. a.video_received = i.bool();
  5607. continue;
  5608. case 13:
  5609. if (t !== 106) break;
  5610. a.back_notification = ee.decode(i, i.uint32());
  5611. continue;
  5612. case 14:
  5613. if (t !== 112) break;
  5614. a.restart_remote_device = i.bool();
  5615. continue;
  5616. case 15:
  5617. if (t !== 120) break;
  5618. a.uac = i.bool();
  5619. continue;
  5620. case 16:
  5621. if (t !== 128) break;
  5622. a.foreground_window_elevated = i.bool();
  5623. continue;
  5624. case 17:
  5625. if (t !== 136) break;
  5626. a.stop_service = i.bool();
  5627. continue;
  5628. case 18:
  5629. if (t !== 146) break;
  5630. a.elevation_request = vu.decode(i, i.uint32());
  5631. continue;
  5632. case 19:
  5633. if (t !== 154) break;
  5634. a.elevation_response = i.string();
  5635. continue;
  5636. case 20:
  5637. if (t !== 160) break;
  5638. a.portable_service_running = i.bool();
  5639. continue;
  5640. case 21:
  5641. if (t !== 170) break;
  5642. a.switch_sides_request = ie.decode(i, i.uint32());
  5643. continue;
  5644. case 22:
  5645. if (t !== 178) break;
  5646. a.switch_back = ae.decode(i, i.uint32());
  5647. continue;
  5648. case 24:
  5649. if (t !== 194) break;
  5650. a.change_resolution = g.decode(i, i.uint32());
  5651. continue;
  5652. case 25:
  5653. if (t !== 202) break;
  5654. a.plugin_request = ne.decode(i, i.uint32());
  5655. continue;
  5656. case 26:
  5657. if (t !== 210) break;
  5658. a.plugin_failure = oe.decode(i, i.uint32());
  5659. continue;
  5660. case 27:
  5661. if (t !== 216) break;
  5662. a.full_speed_fps = i.uint32();
  5663. continue;
  5664. case 28:
  5665. if (t !== 224) break;
  5666. a.auto_adjust_fps = i.uint32();
  5667. continue;
  5668. case 29:
  5669. if (t !== 232) break;
  5670. a.client_record_status = i.bool();
  5671. continue;
  5672. case 30:
  5673. if (t !== 242) break;
  5674. a.capture_displays = Zu.decode(i, i.uint32());
  5675. continue;
  5676. case 31:
  5677. if (t !== 248) break;
  5678. a.refresh_video_display = i.int32();
  5679. continue;
  5680. case 32:
  5681. if (t !== 258) break;
  5682. a.toggle_virtual_display = Qu.decode(i, i.uint32());
  5683. continue;
  5684. case 33:
  5685. if (t !== 266) break;
  5686. a.toggle_privacy_mode = Xu.decode(i, i.uint32());
  5687. continue;
  5688. case 34:
  5689. if (t !== 274) break;
  5690. a.supported_encoding = uu.decode(i, i.uint32());
  5691. continue;
  5692. case 35:
  5693. if (t !== 280) break;
  5694. a.selected_sid = i.uint32();
  5695. continue;
  5696. case 36:
  5697. if (t !== 290) break;
  5698. a.change_display_resolution = Ju.decode(i, i.uint32());
  5699. continue;
  5700. case 37:
  5701. if (t !== 298) break;
  5702. a.message_query = se.decode(i, i.uint32());
  5703. continue;
  5704. case 38:
  5705. if (t !== 304) break;
  5706. a.follow_current_display = i.int32();
  5707. continue
  5708. }
  5709. if ((t & 7) === 4 || t === 0) break;
  5710. i.skipType(t & 7)
  5711. }
  5712. return a
  5713. }, fromJSON(u) {
  5714. return {
  5715. chat_message: o(u.chat_message) ? Su.fromJSON(u.chat_message) : void 0,
  5716. switch_display: o(u.switch_display) ? Gu.fromJSON(u.switch_display) : void 0,
  5717. permission_info: o(u.permission_info) ? Z0.fromJSON(u.permission_info) : void 0,
  5718. option: o(u.option) ? O.fromJSON(u.option) : void 0,
  5719. audio_format: o(u.audio_format) ? Y0.fromJSON(u.audio_format) : void 0,
  5720. close_reason: o(u.close_reason) ? globalThis.String(u.close_reason) : void 0,
  5721. refresh_video: o(u.refresh_video) ? globalThis.Boolean(u.refresh_video) : void 0,
  5722. video_received: o(u.video_received) ? globalThis.Boolean(u.video_received) : void 0,
  5723. back_notification: o(u.back_notification) ? ee.fromJSON(u.back_notification) : void 0,
  5724. restart_remote_device: o(u.restart_remote_device) ? globalThis.Boolean(u.restart_remote_device) : void 0,
  5725. uac: o(u.uac) ? globalThis.Boolean(u.uac) : void 0,
  5726. foreground_window_elevated: o(u.foreground_window_elevated) ? globalThis.Boolean(u.foreground_window_elevated) : void 0,
  5727. stop_service: o(u.stop_service) ? globalThis.Boolean(u.stop_service) : void 0,
  5728. elevation_request: o(u.elevation_request) ? vu.fromJSON(u.elevation_request) : void 0,
  5729. elevation_response: o(u.elevation_response) ? globalThis.String(u.elevation_response) : void 0,
  5730. portable_service_running: o(u.portable_service_running) ? globalThis.Boolean(u.portable_service_running) : void 0,
  5731. switch_sides_request: o(u.switch_sides_request) ? ie.fromJSON(u.switch_sides_request) : void 0,
  5732. switch_back: o(u.switch_back) ? ae.fromJSON(u.switch_back) : void 0,
  5733. change_resolution: o(u.change_resolution) ? g.fromJSON(u.change_resolution) : void 0,
  5734. plugin_request: o(u.plugin_request) ? ne.fromJSON(u.plugin_request) : void 0,
  5735. plugin_failure: o(u.plugin_failure) ? oe.fromJSON(u.plugin_failure) : void 0,
  5736. full_speed_fps: o(u.full_speed_fps) ? globalThis.Number(u.full_speed_fps) : void 0,
  5737. auto_adjust_fps: o(u.auto_adjust_fps) ? globalThis.Number(u.auto_adjust_fps) : void 0,
  5738. client_record_status: o(u.client_record_status) ? globalThis.Boolean(u.client_record_status) : void 0,
  5739. capture_displays: o(u.capture_displays) ? Zu.fromJSON(u.capture_displays) : void 0,
  5740. refresh_video_display: o(u.refresh_video_display) ? globalThis.Number(u.refresh_video_display) : void 0,
  5741. toggle_virtual_display: o(u.toggle_virtual_display) ? Qu.fromJSON(u.toggle_virtual_display) : void 0,
  5742. toggle_privacy_mode: o(u.toggle_privacy_mode) ? Xu.fromJSON(u.toggle_privacy_mode) : void 0,
  5743. supported_encoding: o(u.supported_encoding) ? uu.fromJSON(u.supported_encoding) : void 0,
  5744. selected_sid: o(u.selected_sid) ? globalThis.Number(u.selected_sid) : void 0,
  5745. change_display_resolution: o(u.change_display_resolution) ? Ju.fromJSON(u.change_display_resolution) : void 0,
  5746. message_query: o(u.message_query) ? se.fromJSON(u.message_query) : void 0,
  5747. follow_current_display: o(u.follow_current_display) ? globalThis.Number(u.follow_current_display) : void 0
  5748. }
  5749. }, toJSON(u) {
  5750. const e = {};
  5751. return u.chat_message !== void 0 && (e.chat_message = Su.toJSON(u.chat_message)), u.switch_display !== void 0 && (e.switch_display = Gu.toJSON(u.switch_display)), u.permission_info !== void 0 && (e.permission_info = Z0.toJSON(u.permission_info)), u.option !== void 0 && (e.option = O.toJSON(u.option)), u.audio_format !== void 0 && (e.audio_format = Y0.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 = ee.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 = vu.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 = ie.toJSON(u.switch_sides_request)), u.switch_back !== void 0 && (e.switch_back = ae.toJSON(u.switch_back)), u.change_resolution !== void 0 && (e.change_resolution = g.toJSON(u.change_resolution)), u.plugin_request !== void 0 && (e.plugin_request = ne.toJSON(u.plugin_request)), u.plugin_failure !== void 0 && (e.plugin_failure = oe.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 = Zu.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 = Qu.toJSON(u.toggle_virtual_display)), u.toggle_privacy_mode !== void 0 && (e.toggle_privacy_mode = Xu.toJSON(u.toggle_privacy_mode)), u.supported_encoding !== void 0 && (e.supported_encoding = uu.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 = Ju.toJSON(u.change_display_resolution)), u.message_query !== void 0 && (e.message_query = se.toJSON(u.message_query)), u.follow_current_display !== void 0 && (e.follow_current_display = Math.round(u.follow_current_display)), e
  5752. }, create(u) {
  5753. return f.fromPartial(u != null ? u : {})
  5754. }, fromPartial(u) {
  5755. var i, n, a, t, s, E, D, d, C, c, p, F, w, y, A;
  5756. const e = nt();
  5757. return e.chat_message = u.chat_message !== void 0 && u.chat_message !== null ? Su.fromPartial(u.chat_message) : void 0, e.switch_display = u.switch_display !== void 0 && u.switch_display !== null ? Gu.fromPartial(u.switch_display) : void 0, e.permission_info = u.permission_info !== void 0 && u.permission_info !== null ? Z0.fromPartial(u.permission_info) : void 0, e.option = u.option !== void 0 && u.option !== null ? O.fromPartial(u.option) : void 0, e.audio_format = u.audio_format !== void 0 && u.audio_format !== null ? Y0.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 ? ee.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 = (D = u.stop_service) != null ? D : void 0, e.elevation_request = u.elevation_request !== void 0 && u.elevation_request !== null ? vu.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 ? ie.fromPartial(u.switch_sides_request) : void 0, e.switch_back = u.switch_back !== void 0 && u.switch_back !== null ? ae.fromPartial(u.switch_back) : void 0, e.change_resolution = u.change_resolution !== void 0 && u.change_resolution !== null ? g.fromPartial(u.change_resolution) : void 0, e.plugin_request = u.plugin_request !== void 0 && u.plugin_request !== null ? ne.fromPartial(u.plugin_request) : void 0, e.plugin_failure = u.plugin_failure !== void 0 && u.plugin_failure !== null ? oe.fromPartial(u.plugin_failure) : void 0, e.full_speed_fps = (c = u.full_speed_fps) != null ? c : void 0, e.auto_adjust_fps = (p = u.auto_adjust_fps) != null ? p : 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 ? Zu.fromPartial(u.capture_displays) : void 0, e.refresh_video_display = (w = u.refresh_video_display) != null ? w : void 0, e.toggle_virtual_display = u.toggle_virtual_display !== void 0 && u.toggle_virtual_display !== null ? Qu.fromPartial(u.toggle_virtual_display) : void 0, e.toggle_privacy_mode = u.toggle_privacy_mode !== void 0 && u.toggle_privacy_mode !== null ? Xu.fromPartial(u.toggle_privacy_mode) : void 0, e.supported_encoding = u.supported_encoding !== void 0 && u.supported_encoding !== null ? uu.fromPartial(u.supported_encoding) : void 0, e.selected_sid = (y = u.selected_sid) != null ? y : void 0, e.change_display_resolution = u.change_display_resolution !== void 0 && u.change_display_resolution !== null ? Ju.fromPartial(u.change_display_resolution) : void 0, e.message_query = u.message_query !== void 0 && u.message_query !== null ? se.fromPartial(u.message_query) : void 0, e.follow_current_display = (A = u.follow_current_display) != null ? A : void 0, e
  5758. }
  5759. };
  5760. function ot() {
  5761. return {req_timestamp: 0, is_connect: !1}
  5762. }
  5763. const Ee = {
  5764. encode(u, e = r.Writer.create()) {
  5765. return u.req_timestamp !== 0 && e.uint32(8).int64(u.req_timestamp), u.is_connect !== !1 && e.uint32(16).bool(u.is_connect), e
  5766. }, decode(u, e) {
  5767. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5768. let n = e === void 0 ? i.len : i.pos + e;
  5769. const a = ot();
  5770. for (; i.pos < n;) {
  5771. const t = i.uint32();
  5772. switch (t >>> 3) {
  5773. case 1:
  5774. if (t !== 8) break;
  5775. a.req_timestamp = W(i.int64());
  5776. continue;
  5777. case 2:
  5778. if (t !== 16) break;
  5779. a.is_connect = i.bool();
  5780. continue
  5781. }
  5782. if ((t & 7) === 4 || t === 0) break;
  5783. i.skipType(t & 7)
  5784. }
  5785. return a
  5786. }, fromJSON(u) {
  5787. return {
  5788. req_timestamp: o(u.req_timestamp) ? globalThis.Number(u.req_timestamp) : 0,
  5789. is_connect: o(u.is_connect) ? globalThis.Boolean(u.is_connect) : !1
  5790. }
  5791. }, toJSON(u) {
  5792. const e = {};
  5793. return u.req_timestamp !== 0 && (e.req_timestamp = Math.round(u.req_timestamp)), u.is_connect !== !1 && (e.is_connect = u.is_connect), e
  5794. }, create(u) {
  5795. return Ee.fromPartial(u != null ? u : {})
  5796. }, fromPartial(u) {
  5797. var i, n;
  5798. const e = ot();
  5799. return e.req_timestamp = (i = u.req_timestamp) != null ? i : 0, e.is_connect = (n = u.is_connect) != null ? n : !1, e
  5800. }
  5801. };
  5802. function rt() {
  5803. return {accepted: !1, req_timestamp: 0, ack_timestamp: 0}
  5804. }
  5805. const le = {
  5806. encode(u, e = r.Writer.create()) {
  5807. 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
  5808. }, decode(u, e) {
  5809. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5810. let n = e === void 0 ? i.len : i.pos + e;
  5811. const a = rt();
  5812. for (; i.pos < n;) {
  5813. const t = i.uint32();
  5814. switch (t >>> 3) {
  5815. case 1:
  5816. if (t !== 8) break;
  5817. a.accepted = i.bool();
  5818. continue;
  5819. case 2:
  5820. if (t !== 16) break;
  5821. a.req_timestamp = W(i.int64());
  5822. continue;
  5823. case 3:
  5824. if (t !== 24) break;
  5825. a.ack_timestamp = W(i.int64());
  5826. continue
  5827. }
  5828. if ((t & 7) === 4 || t === 0) break;
  5829. i.skipType(t & 7)
  5830. }
  5831. return a
  5832. }, fromJSON(u) {
  5833. return {
  5834. accepted: o(u.accepted) ? globalThis.Boolean(u.accepted) : !1,
  5835. req_timestamp: o(u.req_timestamp) ? globalThis.Number(u.req_timestamp) : 0,
  5836. ack_timestamp: o(u.ack_timestamp) ? globalThis.Number(u.ack_timestamp) : 0
  5837. }
  5838. }, toJSON(u) {
  5839. const e = {};
  5840. 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
  5841. }, create(u) {
  5842. return le.fromPartial(u != null ? u : {})
  5843. }, fromPartial(u) {
  5844. var i, n, a;
  5845. const e = rt();
  5846. 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
  5847. }
  5848. };
  5849. function st() {
  5850. return {display: 0, sid: ""}
  5851. }
  5852. const De = {
  5853. encode(u, e = r.Writer.create()) {
  5854. return u.display !== 0 && e.uint32(8).int32(u.display), u.sid !== "" && e.uint32(18).string(u.sid), e
  5855. }, decode(u, e) {
  5856. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5857. let n = e === void 0 ? i.len : i.pos + e;
  5858. const a = st();
  5859. for (; i.pos < n;) {
  5860. const t = i.uint32();
  5861. switch (t >>> 3) {
  5862. case 1:
  5863. if (t !== 8) break;
  5864. a.display = i.int32();
  5865. continue;
  5866. case 2:
  5867. if (t !== 18) break;
  5868. a.sid = i.string();
  5869. continue
  5870. }
  5871. if ((t & 7) === 4 || t === 0) break;
  5872. i.skipType(t & 7)
  5873. }
  5874. return a
  5875. }, fromJSON(u) {
  5876. return {display: o(u.display) ? globalThis.Number(u.display) : 0, sid: o(u.sid) ? globalThis.String(u.sid) : ""}
  5877. }, toJSON(u) {
  5878. const e = {};
  5879. return u.display !== 0 && (e.display = Math.round(u.display)), u.sid !== "" && (e.sid = u.sid), e
  5880. }, create(u) {
  5881. return De.fromPartial(u != null ? u : {})
  5882. }, fromPartial(u) {
  5883. var i, n;
  5884. const e = st();
  5885. return e.display = (i = u.display) != null ? i : 0, e.sid = (n = u.sid) != null ? n : "", e
  5886. }
  5887. };
  5888. function Et() {
  5889. return {sid: "", msg: "", data: new Uint8Array(0)}
  5890. }
  5891. const de = {
  5892. encode(u, e = r.Writer.create()) {
  5893. 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
  5894. }, decode(u, e) {
  5895. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5896. let n = e === void 0 ? i.len : i.pos + e;
  5897. const a = Et();
  5898. for (; i.pos < n;) {
  5899. const t = i.uint32();
  5900. switch (t >>> 3) {
  5901. case 1:
  5902. if (t !== 10) break;
  5903. a.sid = i.string();
  5904. continue;
  5905. case 2:
  5906. if (t !== 18) break;
  5907. a.msg = i.string();
  5908. continue;
  5909. case 3:
  5910. if (t !== 26) break;
  5911. a.data = i.bytes();
  5912. continue
  5913. }
  5914. if ((t & 7) === 4 || t === 0) break;
  5915. i.skipType(t & 7)
  5916. }
  5917. return a
  5918. }, fromJSON(u) {
  5919. return {
  5920. sid: o(u.sid) ? globalThis.String(u.sid) : "",
  5921. msg: o(u.msg) ? globalThis.String(u.msg) : "",
  5922. data: o(u.data) ? T(u.data) : new Uint8Array(0)
  5923. }
  5924. }, toJSON(u) {
  5925. const e = {};
  5926. return u.sid !== "" && (e.sid = u.sid), u.msg !== "" && (e.msg = u.msg), u.data.length !== 0 && (e.data = N(u.data)), e
  5927. }, create(u) {
  5928. return de.fromPartial(u != null ? u : {})
  5929. }, fromPartial(u) {
  5930. var i, n, a;
  5931. const e = Et();
  5932. 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
  5933. }
  5934. };
  5935. function lt() {
  5936. return {terminal_id: 0, rows: 0, cols: 0}
  5937. }
  5938. const u0 = {
  5939. encode(u, e = r.Writer.create()) {
  5940. return u.terminal_id !== 0 && e.uint32(8).int32(u.terminal_id), u.rows !== 0 && e.uint32(16).uint32(u.rows), u.cols !== 0 && e.uint32(24).uint32(u.cols), e
  5941. }, decode(u, e) {
  5942. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5943. let n = e === void 0 ? i.len : i.pos + e;
  5944. const a = lt();
  5945. for (; i.pos < n;) {
  5946. const t = i.uint32();
  5947. switch (t >>> 3) {
  5948. case 1:
  5949. if (t !== 8) break;
  5950. a.terminal_id = i.int32();
  5951. continue;
  5952. case 2:
  5953. if (t !== 16) break;
  5954. a.rows = i.uint32();
  5955. continue;
  5956. case 3:
  5957. if (t !== 24) break;
  5958. a.cols = i.uint32();
  5959. continue
  5960. }
  5961. if ((t & 7) === 4 || t === 0) break;
  5962. i.skipType(t & 7)
  5963. }
  5964. return a
  5965. }, fromJSON(u) {
  5966. return {
  5967. terminal_id: o(u.terminal_id) ? globalThis.Number(u.terminal_id) : 0,
  5968. rows: o(u.rows) ? globalThis.Number(u.rows) : 0,
  5969. cols: o(u.cols) ? globalThis.Number(u.cols) : 0
  5970. }
  5971. }, toJSON(u) {
  5972. const e = {};
  5973. return u.terminal_id !== 0 && (e.terminal_id = Math.round(u.terminal_id)), u.rows !== 0 && (e.rows = Math.round(u.rows)), u.cols !== 0 && (e.cols = Math.round(u.cols)), e
  5974. }, create(u) {
  5975. return u0.fromPartial(u != null ? u : {})
  5976. }, fromPartial(u) {
  5977. var i, n, a;
  5978. const e = lt();
  5979. return e.terminal_id = (i = u.terminal_id) != null ? i : 0, e.rows = (n = u.rows) != null ? n : 0, e.cols = (a = u.cols) != null ? a : 0, e
  5980. }
  5981. };
  5982. function Dt() {
  5983. return {terminal_id: 0, rows: 0, cols: 0}
  5984. }
  5985. const e0 = {
  5986. encode(u, e = r.Writer.create()) {
  5987. return u.terminal_id !== 0 && e.uint32(8).int32(u.terminal_id), u.rows !== 0 && e.uint32(16).uint32(u.rows), u.cols !== 0 && e.uint32(24).uint32(u.cols), e
  5988. }, decode(u, e) {
  5989. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5990. let n = e === void 0 ? i.len : i.pos + e;
  5991. const a = Dt();
  5992. for (; i.pos < n;) {
  5993. const t = i.uint32();
  5994. switch (t >>> 3) {
  5995. case 1:
  5996. if (t !== 8) break;
  5997. a.terminal_id = i.int32();
  5998. continue;
  5999. case 2:
  6000. if (t !== 16) break;
  6001. a.rows = i.uint32();
  6002. continue;
  6003. case 3:
  6004. if (t !== 24) break;
  6005. a.cols = i.uint32();
  6006. continue
  6007. }
  6008. if ((t & 7) === 4 || t === 0) break;
  6009. i.skipType(t & 7)
  6010. }
  6011. return a
  6012. }, fromJSON(u) {
  6013. return {
  6014. terminal_id: o(u.terminal_id) ? globalThis.Number(u.terminal_id) : 0,
  6015. rows: o(u.rows) ? globalThis.Number(u.rows) : 0,
  6016. cols: o(u.cols) ? globalThis.Number(u.cols) : 0
  6017. }
  6018. }, toJSON(u) {
  6019. const e = {};
  6020. return u.terminal_id !== 0 && (e.terminal_id = Math.round(u.terminal_id)), u.rows !== 0 && (e.rows = Math.round(u.rows)), u.cols !== 0 && (e.cols = Math.round(u.cols)), e
  6021. }, create(u) {
  6022. return e0.fromPartial(u != null ? u : {})
  6023. }, fromPartial(u) {
  6024. var i, n, a;
  6025. const e = Dt();
  6026. return e.terminal_id = (i = u.terminal_id) != null ? i : 0, e.rows = (n = u.rows) != null ? n : 0, e.cols = (a = u.cols) != null ? a : 0, e
  6027. }
  6028. };
  6029. function dt() {
  6030. return {terminal_id: 0, data: new Uint8Array(0), compressed: !1}
  6031. }
  6032. const eu = {
  6033. encode(u, e = r.Writer.create()) {
  6034. return u.terminal_id !== 0 && e.uint32(8).int32(u.terminal_id), u.data.length !== 0 && e.uint32(18).bytes(u.data), u.compressed !== !1 && e.uint32(24).bool(u.compressed), e
  6035. }, decode(u, e) {
  6036. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6037. let n = e === void 0 ? i.len : i.pos + e;
  6038. const a = dt();
  6039. for (; i.pos < n;) {
  6040. const t = i.uint32();
  6041. switch (t >>> 3) {
  6042. case 1:
  6043. if (t !== 8) break;
  6044. a.terminal_id = i.int32();
  6045. continue;
  6046. case 2:
  6047. if (t !== 18) break;
  6048. a.data = i.bytes();
  6049. continue;
  6050. case 3:
  6051. if (t !== 24) break;
  6052. a.compressed = i.bool();
  6053. continue
  6054. }
  6055. if ((t & 7) === 4 || t === 0) break;
  6056. i.skipType(t & 7)
  6057. }
  6058. return a
  6059. }, fromJSON(u) {
  6060. return {
  6061. terminal_id: o(u.terminal_id) ? globalThis.Number(u.terminal_id) : 0,
  6062. data: o(u.data) ? T(u.data) : new Uint8Array(0),
  6063. compressed: o(u.compressed) ? globalThis.Boolean(u.compressed) : !1
  6064. }
  6065. }, toJSON(u) {
  6066. const e = {};
  6067. return u.terminal_id !== 0 && (e.terminal_id = Math.round(u.terminal_id)), u.data.length !== 0 && (e.data = N(u.data)), u.compressed !== !1 && (e.compressed = u.compressed), e
  6068. }, create(u) {
  6069. return eu.fromPartial(u != null ? u : {})
  6070. }, fromPartial(u) {
  6071. var i, n, a;
  6072. const e = dt();
  6073. return e.terminal_id = (i = u.terminal_id) != null ? i : 0, e.data = (n = u.data) != null ? n : new Uint8Array(0), e.compressed = (a = u.compressed) != null ? a : !1, e
  6074. }
  6075. };
  6076. function Bt() {
  6077. return {terminal_id: 0}
  6078. }
  6079. const i0 = {
  6080. encode(u, e = r.Writer.create()) {
  6081. return u.terminal_id !== 0 && e.uint32(8).int32(u.terminal_id), e
  6082. }, decode(u, e) {
  6083. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6084. let n = e === void 0 ? i.len : i.pos + e;
  6085. const a = Bt();
  6086. for (; i.pos < n;) {
  6087. const t = i.uint32();
  6088. switch (t >>> 3) {
  6089. case 1:
  6090. if (t !== 8) break;
  6091. a.terminal_id = i.int32();
  6092. continue
  6093. }
  6094. if ((t & 7) === 4 || t === 0) break;
  6095. i.skipType(t & 7)
  6096. }
  6097. return a
  6098. }, fromJSON(u) {
  6099. return {terminal_id: o(u.terminal_id) ? globalThis.Number(u.terminal_id) : 0}
  6100. }, toJSON(u) {
  6101. const e = {};
  6102. return u.terminal_id !== 0 && (e.terminal_id = Math.round(u.terminal_id)), e
  6103. }, create(u) {
  6104. return i0.fromPartial(u != null ? u : {})
  6105. }, fromPartial(u) {
  6106. var i;
  6107. const e = Bt();
  6108. return e.terminal_id = (i = u.terminal_id) != null ? i : 0, e
  6109. }
  6110. };
  6111. function ct() {
  6112. return {open: void 0, data: void 0, resize: void 0, close: void 0}
  6113. }
  6114. const lu = {
  6115. encode(u, e = r.Writer.create()) {
  6116. return u.open !== void 0 && u0.encode(u.open, e.uint32(10).fork()).ldelim(), u.data !== void 0 && eu.encode(u.data, e.uint32(18).fork()).ldelim(), u.resize !== void 0 && e0.encode(u.resize, e.uint32(26).fork()).ldelim(), u.close !== void 0 && i0.encode(u.close, e.uint32(34).fork()).ldelim(), e
  6117. }, decode(u, e) {
  6118. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6119. let n = e === void 0 ? i.len : i.pos + e;
  6120. const a = ct();
  6121. for (; i.pos < n;) {
  6122. const t = i.uint32();
  6123. switch (t >>> 3) {
  6124. case 1:
  6125. if (t !== 10) break;
  6126. a.open = u0.decode(i, i.uint32());
  6127. continue;
  6128. case 2:
  6129. if (t !== 18) break;
  6130. a.data = eu.decode(i, i.uint32());
  6131. continue;
  6132. case 3:
  6133. if (t !== 26) break;
  6134. a.resize = e0.decode(i, i.uint32());
  6135. continue;
  6136. case 4:
  6137. if (t !== 34) break;
  6138. a.close = i0.decode(i, i.uint32());
  6139. continue
  6140. }
  6141. if ((t & 7) === 4 || t === 0) break;
  6142. i.skipType(t & 7)
  6143. }
  6144. return a
  6145. }, fromJSON(u) {
  6146. return {
  6147. open: o(u.open) ? u0.fromJSON(u.open) : void 0,
  6148. data: o(u.data) ? eu.fromJSON(u.data) : void 0,
  6149. resize: o(u.resize) ? e0.fromJSON(u.resize) : void 0,
  6150. close: o(u.close) ? i0.fromJSON(u.close) : void 0
  6151. }
  6152. }, toJSON(u) {
  6153. const e = {};
  6154. return u.open !== void 0 && (e.open = u0.toJSON(u.open)), u.data !== void 0 && (e.data = eu.toJSON(u.data)), u.resize !== void 0 && (e.resize = e0.toJSON(u.resize)), u.close !== void 0 && (e.close = i0.toJSON(u.close)), e
  6155. }, create(u) {
  6156. return lu.fromPartial(u != null ? u : {})
  6157. }, fromPartial(u) {
  6158. const e = ct();
  6159. return e.open = u.open !== void 0 && u.open !== null ? u0.fromPartial(u.open) : void 0, e.data = u.data !== void 0 && u.data !== null ? eu.fromPartial(u.data) : void 0, e.resize = u.resize !== void 0 && u.resize !== null ? e0.fromPartial(u.resize) : void 0, e.close = u.close !== void 0 && u.close !== null ? i0.fromPartial(u.close) : void 0, e
  6160. }
  6161. };
  6162. function Ct() {
  6163. return {terminal_id: 0, success: !1, message: "", pid: 0, service_id: "", persistent_sessions: []}
  6164. }
  6165. const Be = {
  6166. encode(u, e = r.Writer.create()) {
  6167. u.terminal_id !== 0 && e.uint32(8).int32(u.terminal_id), u.success !== !1 && e.uint32(16).bool(u.success), u.message !== "" && e.uint32(26).string(u.message), u.pid !== 0 && e.uint32(32).uint32(u.pid), u.service_id !== "" && e.uint32(42).string(u.service_id), e.uint32(50).fork();
  6168. for (const i of u.persistent_sessions) e.int32(i);
  6169. return e.ldelim(), 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 = Ct();
  6174. for (; i.pos < n;) {
  6175. const t = i.uint32();
  6176. switch (t >>> 3) {
  6177. case 1:
  6178. if (t !== 8) break;
  6179. a.terminal_id = i.int32();
  6180. continue;
  6181. case 2:
  6182. if (t !== 16) break;
  6183. a.success = i.bool();
  6184. continue;
  6185. case 3:
  6186. if (t !== 26) break;
  6187. a.message = i.string();
  6188. continue;
  6189. case 4:
  6190. if (t !== 32) break;
  6191. a.pid = i.uint32();
  6192. continue;
  6193. case 5:
  6194. if (t !== 42) break;
  6195. a.service_id = i.string();
  6196. continue;
  6197. case 6:
  6198. if (t === 48) {
  6199. a.persistent_sessions.push(i.int32());
  6200. continue
  6201. }
  6202. if (t === 50) {
  6203. const s = i.uint32() + i.pos;
  6204. for (; i.pos < s;) a.persistent_sessions.push(i.int32());
  6205. continue
  6206. }
  6207. break
  6208. }
  6209. if ((t & 7) === 4 || t === 0) break;
  6210. i.skipType(t & 7)
  6211. }
  6212. return a
  6213. }, fromJSON(u) {
  6214. return {
  6215. terminal_id: o(u.terminal_id) ? globalThis.Number(u.terminal_id) : 0,
  6216. success: o(u.success) ? globalThis.Boolean(u.success) : !1,
  6217. message: o(u.message) ? globalThis.String(u.message) : "",
  6218. pid: o(u.pid) ? globalThis.Number(u.pid) : 0,
  6219. service_id: o(u.service_id) ? globalThis.String(u.service_id) : "",
  6220. persistent_sessions: globalThis.Array.isArray(u == null ? void 0 : u.persistent_sessions) ? u.persistent_sessions.map(e => globalThis.Number(e)) : []
  6221. }
  6222. }, toJSON(u) {
  6223. var i;
  6224. const e = {};
  6225. return u.terminal_id !== 0 && (e.terminal_id = Math.round(u.terminal_id)), u.success !== !1 && (e.success = u.success), u.message !== "" && (e.message = u.message), u.pid !== 0 && (e.pid = Math.round(u.pid)), u.service_id !== "" && (e.service_id = u.service_id), (i = u.persistent_sessions) != null && i.length && (e.persistent_sessions = u.persistent_sessions.map(n => Math.round(n))), e
  6226. }, create(u) {
  6227. return Be.fromPartial(u != null ? u : {})
  6228. }, fromPartial(u) {
  6229. var i, n, a, t, s, E;
  6230. const e = Ct();
  6231. return e.terminal_id = (i = u.terminal_id) != null ? i : 0, e.success = (n = u.success) != null ? n : !1, e.message = (a = u.message) != null ? a : "", e.pid = (t = u.pid) != null ? t : 0, e.service_id = (s = u.service_id) != null ? s : "", e.persistent_sessions = ((E = u.persistent_sessions) == null ? void 0 : E.map(D => D)) || [], e
  6232. }
  6233. };
  6234. function pt() {
  6235. return {terminal_id: 0, exit_code: 0}
  6236. }
  6237. const ce = {
  6238. encode(u, e = r.Writer.create()) {
  6239. return u.terminal_id !== 0 && e.uint32(8).int32(u.terminal_id), u.exit_code !== 0 && e.uint32(16).int32(u.exit_code), e
  6240. }, decode(u, e) {
  6241. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6242. let n = e === void 0 ? i.len : i.pos + e;
  6243. const a = pt();
  6244. for (; i.pos < n;) {
  6245. const t = i.uint32();
  6246. switch (t >>> 3) {
  6247. case 1:
  6248. if (t !== 8) break;
  6249. a.terminal_id = i.int32();
  6250. continue;
  6251. case 2:
  6252. if (t !== 16) break;
  6253. a.exit_code = i.int32();
  6254. continue
  6255. }
  6256. if ((t & 7) === 4 || t === 0) break;
  6257. i.skipType(t & 7)
  6258. }
  6259. return a
  6260. }, fromJSON(u) {
  6261. return {
  6262. terminal_id: o(u.terminal_id) ? globalThis.Number(u.terminal_id) : 0,
  6263. exit_code: o(u.exit_code) ? globalThis.Number(u.exit_code) : 0
  6264. }
  6265. }, toJSON(u) {
  6266. const e = {};
  6267. return u.terminal_id !== 0 && (e.terminal_id = Math.round(u.terminal_id)), u.exit_code !== 0 && (e.exit_code = Math.round(u.exit_code)), e
  6268. }, create(u) {
  6269. return ce.fromPartial(u != null ? u : {})
  6270. }, fromPartial(u) {
  6271. var i, n;
  6272. const e = pt();
  6273. return e.terminal_id = (i = u.terminal_id) != null ? i : 0, e.exit_code = (n = u.exit_code) != null ? n : 0, e
  6274. }
  6275. };
  6276. function At() {
  6277. return {terminal_id: 0, message: ""}
  6278. }
  6279. const Ce = {
  6280. encode(u, e = r.Writer.create()) {
  6281. return u.terminal_id !== 0 && e.uint32(8).int32(u.terminal_id), u.message !== "" && e.uint32(18).string(u.message), e
  6282. }, decode(u, e) {
  6283. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6284. let n = e === void 0 ? i.len : i.pos + e;
  6285. const a = At();
  6286. for (; i.pos < n;) {
  6287. const t = i.uint32();
  6288. switch (t >>> 3) {
  6289. case 1:
  6290. if (t !== 8) break;
  6291. a.terminal_id = i.int32();
  6292. continue;
  6293. case 2:
  6294. if (t !== 18) break;
  6295. a.message = i.string();
  6296. continue
  6297. }
  6298. if ((t & 7) === 4 || t === 0) break;
  6299. i.skipType(t & 7)
  6300. }
  6301. return a
  6302. }, fromJSON(u) {
  6303. return {
  6304. terminal_id: o(u.terminal_id) ? globalThis.Number(u.terminal_id) : 0,
  6305. message: o(u.message) ? globalThis.String(u.message) : ""
  6306. }
  6307. }, toJSON(u) {
  6308. const e = {};
  6309. return u.terminal_id !== 0 && (e.terminal_id = Math.round(u.terminal_id)), u.message !== "" && (e.message = u.message), e
  6310. }, create(u) {
  6311. return Ce.fromPartial(u != null ? u : {})
  6312. }, fromPartial(u) {
  6313. var i, n;
  6314. const e = At();
  6315. return e.terminal_id = (i = u.terminal_id) != null ? i : 0, e.message = (n = u.message) != null ? n : "", e
  6316. }
  6317. };
  6318. function mt() {
  6319. return {opened: void 0, data: void 0, closed: void 0, error: void 0}
  6320. }
  6321. const pe = {
  6322. encode(u, e = r.Writer.create()) {
  6323. return u.opened !== void 0 && Be.encode(u.opened, e.uint32(10).fork()).ldelim(), u.data !== void 0 && eu.encode(u.data, e.uint32(18).fork()).ldelim(), u.closed !== void 0 && ce.encode(u.closed, e.uint32(26).fork()).ldelim(), u.error !== void 0 && Ce.encode(u.error, e.uint32(34).fork()).ldelim(), e
  6324. }, decode(u, e) {
  6325. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6326. let n = e === void 0 ? i.len : i.pos + e;
  6327. const a = mt();
  6328. for (; i.pos < n;) {
  6329. const t = i.uint32();
  6330. switch (t >>> 3) {
  6331. case 1:
  6332. if (t !== 10) break;
  6333. a.opened = Be.decode(i, i.uint32());
  6334. continue;
  6335. case 2:
  6336. if (t !== 18) break;
  6337. a.data = eu.decode(i, i.uint32());
  6338. continue;
  6339. case 3:
  6340. if (t !== 26) break;
  6341. a.closed = ce.decode(i, i.uint32());
  6342. continue;
  6343. case 4:
  6344. if (t !== 34) break;
  6345. a.error = Ce.decode(i, i.uint32());
  6346. continue
  6347. }
  6348. if ((t & 7) === 4 || t === 0) break;
  6349. i.skipType(t & 7)
  6350. }
  6351. return a
  6352. }, fromJSON(u) {
  6353. return {
  6354. opened: o(u.opened) ? Be.fromJSON(u.opened) : void 0,
  6355. data: o(u.data) ? eu.fromJSON(u.data) : void 0,
  6356. closed: o(u.closed) ? ce.fromJSON(u.closed) : void 0,
  6357. error: o(u.error) ? Ce.fromJSON(u.error) : void 0
  6358. }
  6359. }, toJSON(u) {
  6360. const e = {};
  6361. return u.opened !== void 0 && (e.opened = Be.toJSON(u.opened)), u.data !== void 0 && (e.data = eu.toJSON(u.data)), u.closed !== void 0 && (e.closed = ce.toJSON(u.closed)), u.error !== void 0 && (e.error = Ce.toJSON(u.error)), e
  6362. }, create(u) {
  6363. return pe.fromPartial(u != null ? u : {})
  6364. }, fromPartial(u) {
  6365. const e = mt();
  6366. return e.opened = u.opened !== void 0 && u.opened !== null ? Be.fromPartial(u.opened) : void 0, e.data = u.data !== void 0 && u.data !== null ? eu.fromPartial(u.data) : void 0, e.closed = u.closed !== void 0 && u.closed !== null ? ce.fromPartial(u.closed) : void 0, e.error = u.error !== void 0 && u.error !== null ? Ce.fromPartial(u.error) : void 0, e
  6367. }
  6368. };
  6369. function Ft() {
  6370. return {
  6371. signed_id: void 0,
  6372. public_key: void 0,
  6373. test_delay: void 0,
  6374. video_frame: void 0,
  6375. login_request: void 0,
  6376. login_response: void 0,
  6377. hash: void 0,
  6378. mouse_event: void 0,
  6379. audio_frame: void 0,
  6380. cursor_data: void 0,
  6381. cursor_position: void 0,
  6382. cursor_id: void 0,
  6383. key_event: void 0,
  6384. clipboard: void 0,
  6385. file_action: void 0,
  6386. file_response: void 0,
  6387. misc: void 0,
  6388. cliprdr: void 0,
  6389. message_box: void 0,
  6390. switch_sides_response: void 0,
  6391. voice_call_request: void 0,
  6392. voice_call_response: void 0,
  6393. peer_info: void 0,
  6394. pointer_device_event: void 0,
  6395. auth_2fa: void 0,
  6396. multi_clipboards: void 0,
  6397. screenshot_request: void 0,
  6398. screenshot_response: void 0,
  6399. terminal_action: void 0,
  6400. terminal_response: void 0
  6401. }
  6402. }
  6403. const ru = {
  6404. encode(u, e = r.Writer.create()) {
  6405. return u.signed_id !== void 0 && X0.encode(u.signed_id, e.uint32(26).fork()).ldelim(), u.public_key !== void 0 && X.encode(u.public_key, e.uint32(34).fork()).ldelim(), u.test_delay !== void 0 && Q0.encode(u.test_delay, e.uint32(42).fork()).ldelim(), u.video_frame !== void 0 && _0.encode(u.video_frame, e.uint32(50).fork()).ldelim(), u.login_request !== void 0 && Y.encode(u.login_request, e.uint32(58).fork()).ldelim(), u.login_response !== void 0 && x0.encode(u.login_response, e.uint32(66).fork()).ldelim(), u.hash !== void 0 && T0.encode(u.hash, e.uint32(74).fork()).ldelim(), u.mouse_event !== void 0 && zu.encode(u.mouse_event, e.uint32(82).fork()).ldelim(), u.audio_frame !== void 0 && $0.encode(u.audio_frame, e.uint32(90).fork()).ldelim(), u.cursor_data !== void 0 && R0.encode(u.cursor_data, e.uint32(98).fork()).ldelim(), u.cursor_position !== void 0 && I0.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 && I.encode(u.key_event, e.uint32(122).fork()).ldelim(), u.clipboard !== void 0 && G.encode(u.clipboard, e.uint32(130).fork()).ldelim(), u.file_action !== void 0 && M.encode(u.file_action, e.uint32(138).fork()).ldelim(), u.file_response !== void 0 && Eu.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 && G0.encode(u.cliprdr, e.uint32(162).fork()).ldelim(), u.message_box !== void 0 && ue.encode(u.message_box, e.uint32(170).fork()).ldelim(), u.switch_sides_response !== void 0 && te.encode(u.switch_sides_response, e.uint32(178).fork()).ldelim(), u.voice_call_request !== void 0 && Ee.encode(u.voice_call_request, e.uint32(186).fork()).ldelim(), u.voice_call_response !== void 0 && le.encode(u.voice_call_response, e.uint32(194).fork()).ldelim(), u.peer_info !== void 0 && tu.encode(u.peer_info, e.uint32(202).fork()).ldelim(), u.pointer_device_event !== void 0 && P0.encode(u.pointer_device_event, e.uint32(210).fork()).ldelim(), u.auth_2fa !== void 0 && wu.encode(u.auth_2fa, e.uint32(218).fork()).ldelim(), u.multi_clipboards !== void 0 && Pu.encode(u.multi_clipboards, e.uint32(226).fork()).ldelim(), u.screenshot_request !== void 0 && De.encode(u.screenshot_request, e.uint32(234).fork()).ldelim(), u.screenshot_response !== void 0 && de.encode(u.screenshot_response, e.uint32(242).fork()).ldelim(), u.terminal_action !== void 0 && lu.encode(u.terminal_action, e.uint32(250).fork()).ldelim(), u.terminal_response !== void 0 && pe.encode(u.terminal_response, e.uint32(258).fork()).ldelim(), e
  6406. }, decode(u, e) {
  6407. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6408. let n = e === void 0 ? i.len : i.pos + e;
  6409. const a = Ft();
  6410. for (; i.pos < n;) {
  6411. const t = i.uint32();
  6412. switch (t >>> 3) {
  6413. case 3:
  6414. if (t !== 26) break;
  6415. a.signed_id = X0.decode(i, i.uint32());
  6416. continue;
  6417. case 4:
  6418. if (t !== 34) break;
  6419. a.public_key = X.decode(i, i.uint32());
  6420. continue;
  6421. case 5:
  6422. if (t !== 42) break;
  6423. a.test_delay = Q0.decode(i, i.uint32());
  6424. continue;
  6425. case 6:
  6426. if (t !== 50) break;
  6427. a.video_frame = _0.decode(i, i.uint32());
  6428. continue;
  6429. case 7:
  6430. if (t !== 58) break;
  6431. a.login_request = Y.decode(i, i.uint32());
  6432. continue;
  6433. case 8:
  6434. if (t !== 66) break;
  6435. a.login_response = x0.decode(i, i.uint32());
  6436. continue;
  6437. case 9:
  6438. if (t !== 74) break;
  6439. a.hash = T0.decode(i, i.uint32());
  6440. continue;
  6441. case 10:
  6442. if (t !== 82) break;
  6443. a.mouse_event = zu.decode(i, i.uint32());
  6444. continue;
  6445. case 11:
  6446. if (t !== 90) break;
  6447. a.audio_frame = $0.decode(i, i.uint32());
  6448. continue;
  6449. case 12:
  6450. if (t !== 98) break;
  6451. a.cursor_data = R0.decode(i, i.uint32());
  6452. continue;
  6453. case 13:
  6454. if (t !== 106) break;
  6455. a.cursor_position = I0.decode(i, i.uint32());
  6456. continue;
  6457. case 14:
  6458. if (t !== 112) break;
  6459. a.cursor_id = W(i.uint64());
  6460. continue;
  6461. case 15:
  6462. if (t !== 122) break;
  6463. a.key_event = I.decode(i, i.uint32());
  6464. continue;
  6465. case 16:
  6466. if (t !== 130) break;
  6467. a.clipboard = G.decode(i, i.uint32());
  6468. continue;
  6469. case 17:
  6470. if (t !== 138) break;
  6471. a.file_action = M.decode(i, i.uint32());
  6472. continue;
  6473. case 18:
  6474. if (t !== 146) break;
  6475. a.file_response = Eu.decode(i, i.uint32());
  6476. continue;
  6477. case 19:
  6478. if (t !== 154) break;
  6479. a.misc = f.decode(i, i.uint32());
  6480. continue;
  6481. case 20:
  6482. if (t !== 162) break;
  6483. a.cliprdr = G0.decode(i, i.uint32());
  6484. continue;
  6485. case 21:
  6486. if (t !== 170) break;
  6487. a.message_box = ue.decode(i, i.uint32());
  6488. continue;
  6489. case 22:
  6490. if (t !== 178) break;
  6491. a.switch_sides_response = te.decode(i, i.uint32());
  6492. continue;
  6493. case 23:
  6494. if (t !== 186) break;
  6495. a.voice_call_request = Ee.decode(i, i.uint32());
  6496. continue;
  6497. case 24:
  6498. if (t !== 194) break;
  6499. a.voice_call_response = le.decode(i, i.uint32());
  6500. continue;
  6501. case 25:
  6502. if (t !== 202) break;
  6503. a.peer_info = tu.decode(i, i.uint32());
  6504. continue;
  6505. case 26:
  6506. if (t !== 210) break;
  6507. a.pointer_device_event = P0.decode(i, i.uint32());
  6508. continue;
  6509. case 27:
  6510. if (t !== 218) break;
  6511. a.auth_2fa = wu.decode(i, i.uint32());
  6512. continue;
  6513. case 28:
  6514. if (t !== 226) break;
  6515. a.multi_clipboards = Pu.decode(i, i.uint32());
  6516. continue;
  6517. case 29:
  6518. if (t !== 234) break;
  6519. a.screenshot_request = De.decode(i, i.uint32());
  6520. continue;
  6521. case 30:
  6522. if (t !== 242) break;
  6523. a.screenshot_response = de.decode(i, i.uint32());
  6524. continue;
  6525. case 31:
  6526. if (t !== 250) break;
  6527. a.terminal_action = lu.decode(i, i.uint32());
  6528. continue;
  6529. case 32:
  6530. if (t !== 258) break;
  6531. a.terminal_response = pe.decode(i, i.uint32());
  6532. continue
  6533. }
  6534. if ((t & 7) === 4 || t === 0) break;
  6535. i.skipType(t & 7)
  6536. }
  6537. return a
  6538. }, fromJSON(u) {
  6539. return {
  6540. signed_id: o(u.signed_id) ? X0.fromJSON(u.signed_id) : void 0,
  6541. public_key: o(u.public_key) ? X.fromJSON(u.public_key) : void 0,
  6542. test_delay: o(u.test_delay) ? Q0.fromJSON(u.test_delay) : void 0,
  6543. video_frame: o(u.video_frame) ? _0.fromJSON(u.video_frame) : void 0,
  6544. login_request: o(u.login_request) ? Y.fromJSON(u.login_request) : void 0,
  6545. login_response: o(u.login_response) ? x0.fromJSON(u.login_response) : void 0,
  6546. hash: o(u.hash) ? T0.fromJSON(u.hash) : void 0,
  6547. mouse_event: o(u.mouse_event) ? zu.fromJSON(u.mouse_event) : void 0,
  6548. audio_frame: o(u.audio_frame) ? $0.fromJSON(u.audio_frame) : void 0,
  6549. cursor_data: o(u.cursor_data) ? R0.fromJSON(u.cursor_data) : void 0,
  6550. cursor_position: o(u.cursor_position) ? I0.fromJSON(u.cursor_position) : void 0,
  6551. cursor_id: o(u.cursor_id) ? globalThis.Number(u.cursor_id) : void 0,
  6552. key_event: o(u.key_event) ? I.fromJSON(u.key_event) : void 0,
  6553. clipboard: o(u.clipboard) ? G.fromJSON(u.clipboard) : void 0,
  6554. file_action: o(u.file_action) ? M.fromJSON(u.file_action) : void 0,
  6555. file_response: o(u.file_response) ? Eu.fromJSON(u.file_response) : void 0,
  6556. misc: o(u.misc) ? f.fromJSON(u.misc) : void 0,
  6557. cliprdr: o(u.cliprdr) ? G0.fromJSON(u.cliprdr) : void 0,
  6558. message_box: o(u.message_box) ? ue.fromJSON(u.message_box) : void 0,
  6559. switch_sides_response: o(u.switch_sides_response) ? te.fromJSON(u.switch_sides_response) : void 0,
  6560. voice_call_request: o(u.voice_call_request) ? Ee.fromJSON(u.voice_call_request) : void 0,
  6561. voice_call_response: o(u.voice_call_response) ? le.fromJSON(u.voice_call_response) : void 0,
  6562. peer_info: o(u.peer_info) ? tu.fromJSON(u.peer_info) : void 0,
  6563. pointer_device_event: o(u.pointer_device_event) ? P0.fromJSON(u.pointer_device_event) : void 0,
  6564. auth_2fa: o(u.auth_2fa) ? wu.fromJSON(u.auth_2fa) : void 0,
  6565. multi_clipboards: o(u.multi_clipboards) ? Pu.fromJSON(u.multi_clipboards) : void 0,
  6566. screenshot_request: o(u.screenshot_request) ? De.fromJSON(u.screenshot_request) : void 0,
  6567. screenshot_response: o(u.screenshot_response) ? de.fromJSON(u.screenshot_response) : void 0,
  6568. terminal_action: o(u.terminal_action) ? lu.fromJSON(u.terminal_action) : void 0,
  6569. terminal_response: o(u.terminal_response) ? pe.fromJSON(u.terminal_response) : void 0
  6570. }
  6571. }, toJSON(u) {
  6572. const e = {};
  6573. return u.signed_id !== void 0 && (e.signed_id = X0.toJSON(u.signed_id)), u.public_key !== void 0 && (e.public_key = X.toJSON(u.public_key)), u.test_delay !== void 0 && (e.test_delay = Q0.toJSON(u.test_delay)), u.video_frame !== void 0 && (e.video_frame = _0.toJSON(u.video_frame)), u.login_request !== void 0 && (e.login_request = Y.toJSON(u.login_request)), u.login_response !== void 0 && (e.login_response = x0.toJSON(u.login_response)), u.hash !== void 0 && (e.hash = T0.toJSON(u.hash)), u.mouse_event !== void 0 && (e.mouse_event = zu.toJSON(u.mouse_event)), u.audio_frame !== void 0 && (e.audio_frame = $0.toJSON(u.audio_frame)), u.cursor_data !== void 0 && (e.cursor_data = R0.toJSON(u.cursor_data)), u.cursor_position !== void 0 && (e.cursor_position = I0.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 = I.toJSON(u.key_event)), u.clipboard !== void 0 && (e.clipboard = G.toJSON(u.clipboard)), u.file_action !== void 0 && (e.file_action = M.toJSON(u.file_action)), u.file_response !== void 0 && (e.file_response = Eu.toJSON(u.file_response)), u.misc !== void 0 && (e.misc = f.toJSON(u.misc)), u.cliprdr !== void 0 && (e.cliprdr = G0.toJSON(u.cliprdr)), u.message_box !== void 0 && (e.message_box = ue.toJSON(u.message_box)), u.switch_sides_response !== void 0 && (e.switch_sides_response = te.toJSON(u.switch_sides_response)), u.voice_call_request !== void 0 && (e.voice_call_request = Ee.toJSON(u.voice_call_request)), u.voice_call_response !== void 0 && (e.voice_call_response = le.toJSON(u.voice_call_response)), u.peer_info !== void 0 && (e.peer_info = tu.toJSON(u.peer_info)), u.pointer_device_event !== void 0 && (e.pointer_device_event = P0.toJSON(u.pointer_device_event)), u.auth_2fa !== void 0 && (e.auth_2fa = wu.toJSON(u.auth_2fa)), u.multi_clipboards !== void 0 && (e.multi_clipboards = Pu.toJSON(u.multi_clipboards)), u.screenshot_request !== void 0 && (e.screenshot_request = De.toJSON(u.screenshot_request)), u.screenshot_response !== void 0 && (e.screenshot_response = de.toJSON(u.screenshot_response)), u.terminal_action !== void 0 && (e.terminal_action = lu.toJSON(u.terminal_action)), u.terminal_response !== void 0 && (e.terminal_response = pe.toJSON(u.terminal_response)), e
  6574. }, create(u) {
  6575. return ru.fromPartial(u != null ? u : {})
  6576. }, fromPartial(u) {
  6577. var i;
  6578. const e = Ft();
  6579. return e.signed_id = u.signed_id !== void 0 && u.signed_id !== null ? X0.fromPartial(u.signed_id) : void 0, e.public_key = u.public_key !== void 0 && u.public_key !== null ? X.fromPartial(u.public_key) : void 0, e.test_delay = u.test_delay !== void 0 && u.test_delay !== null ? Q0.fromPartial(u.test_delay) : void 0, e.video_frame = u.video_frame !== void 0 && u.video_frame !== null ? _0.fromPartial(u.video_frame) : void 0, e.login_request = u.login_request !== void 0 && u.login_request !== null ? Y.fromPartial(u.login_request) : void 0, e.login_response = u.login_response !== void 0 && u.login_response !== null ? x0.fromPartial(u.login_response) : void 0, e.hash = u.hash !== void 0 && u.hash !== null ? T0.fromPartial(u.hash) : void 0, e.mouse_event = u.mouse_event !== void 0 && u.mouse_event !== null ? zu.fromPartial(u.mouse_event) : void 0, e.audio_frame = u.audio_frame !== void 0 && u.audio_frame !== null ? $0.fromPartial(u.audio_frame) : void 0, e.cursor_data = u.cursor_data !== void 0 && u.cursor_data !== null ? R0.fromPartial(u.cursor_data) : void 0, e.cursor_position = u.cursor_position !== void 0 && u.cursor_position !== null ? I0.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 ? I.fromPartial(u.key_event) : void 0, e.clipboard = u.clipboard !== void 0 && u.clipboard !== null ? G.fromPartial(u.clipboard) : void 0, e.file_action = u.file_action !== void 0 && u.file_action !== null ? M.fromPartial(u.file_action) : void 0, e.file_response = u.file_response !== void 0 && u.file_response !== null ? Eu.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 ? G0.fromPartial(u.cliprdr) : void 0, e.message_box = u.message_box !== void 0 && u.message_box !== null ? ue.fromPartial(u.message_box) : void 0, e.switch_sides_response = u.switch_sides_response !== void 0 && u.switch_sides_response !== null ? te.fromPartial(u.switch_sides_response) : void 0, e.voice_call_request = u.voice_call_request !== void 0 && u.voice_call_request !== null ? Ee.fromPartial(u.voice_call_request) : void 0, e.voice_call_response = u.voice_call_response !== void 0 && u.voice_call_response !== null ? le.fromPartial(u.voice_call_response) : void 0, e.peer_info = u.peer_info !== void 0 && u.peer_info !== null ? tu.fromPartial(u.peer_info) : void 0, e.pointer_device_event = u.pointer_device_event !== void 0 && u.pointer_device_event !== null ? P0.fromPartial(u.pointer_device_event) : void 0, e.auth_2fa = u.auth_2fa !== void 0 && u.auth_2fa !== null ? wu.fromPartial(u.auth_2fa) : void 0, e.multi_clipboards = u.multi_clipboards !== void 0 && u.multi_clipboards !== null ? Pu.fromPartial(u.multi_clipboards) : void 0, e.screenshot_request = u.screenshot_request !== void 0 && u.screenshot_request !== null ? De.fromPartial(u.screenshot_request) : void 0, e.screenshot_response = u.screenshot_response !== void 0 && u.screenshot_response !== null ? de.fromPartial(u.screenshot_response) : void 0, e.terminal_action = u.terminal_action !== void 0 && u.terminal_action !== null ? lu.fromPartial(u.terminal_action) : void 0, e.terminal_response = u.terminal_response !== void 0 && u.terminal_response !== null ? pe.fromPartial(u.terminal_response) : void 0, e
  6580. }
  6581. };
  6582. function T(u) {
  6583. if (globalThis.Buffer) return Uint8Array.from(globalThis.Buffer.from(u, "base64"));
  6584. {
  6585. const e = globalThis.atob(u), i = new Uint8Array(e.length);
  6586. for (let n = 0; n < e.length; ++n) i[n] = e.charCodeAt(n);
  6587. return i
  6588. }
  6589. }
  6590. function N(u) {
  6591. if (globalThis.Buffer) return globalThis.Buffer.from(u).toString("base64");
  6592. {
  6593. const e = [];
  6594. return u.forEach(i => {
  6595. e.push(globalThis.String.fromCharCode(i))
  6596. }), globalThis.btoa(e.join(""))
  6597. }
  6598. }
  6599. function W(u) {
  6600. if (u.gt(globalThis.Number.MAX_SAFE_INTEGER)) throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
  6601. if (u.lt(globalThis.Number.MIN_SAFE_INTEGER)) throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
  6602. return u.toNumber()
  6603. }
  6604. r.util.Long !== F3 && (r.util.Long = F3, r.configure());
  6605. function o(u) {
  6606. return u != null
  6607. }
  6608. var Ve = (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.TERMINAL = 5] = "TERMINAL", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(Ve || {});
  6609. function Ba(u) {
  6610. switch (u) {
  6611. case 0:
  6612. case"DEFAULT_CONN":
  6613. return 0;
  6614. case 1:
  6615. case"FILE_TRANSFER":
  6616. return 1;
  6617. case 2:
  6618. case"PORT_FORWARD":
  6619. return 2;
  6620. case 3:
  6621. case"RDP":
  6622. return 3;
  6623. case 4:
  6624. case"VIEW_CAMERA":
  6625. return 4;
  6626. case 5:
  6627. case"TERMINAL":
  6628. return 5;
  6629. case-1:
  6630. case"UNRECOGNIZED":
  6631. default:
  6632. return -1
  6633. }
  6634. }
  6635. function ca(u) {
  6636. switch (u) {
  6637. case 0:
  6638. return "DEFAULT_CONN";
  6639. case 1:
  6640. return "FILE_TRANSFER";
  6641. case 2:
  6642. return "PORT_FORWARD";
  6643. case 3:
  6644. return "RDP";
  6645. case 4:
  6646. return "VIEW_CAMERA";
  6647. case 5:
  6648. return "TERMINAL";
  6649. case-1:
  6650. default:
  6651. return "UNRECOGNIZED"
  6652. }
  6653. }
  6654. var Ca = (u => (u[u.UNKNOWN_NAT = 0] = "UNKNOWN_NAT", u[u.ASYMMETRIC = 1] = "ASYMMETRIC", u[u.SYMMETRIC = 2] = "SYMMETRIC", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(Ca || {});
  6655. function h4(u) {
  6656. switch (u) {
  6657. case 0:
  6658. case"UNKNOWN_NAT":
  6659. return 0;
  6660. case 1:
  6661. case"ASYMMETRIC":
  6662. return 1;
  6663. case 2:
  6664. case"SYMMETRIC":
  6665. return 2;
  6666. case-1:
  6667. case"UNRECOGNIZED":
  6668. default:
  6669. return -1
  6670. }
  6671. }
  6672. function f4(u) {
  6673. switch (u) {
  6674. case 0:
  6675. return "UNKNOWN_NAT";
  6676. case 1:
  6677. return "ASYMMETRIC";
  6678. case 2:
  6679. return "SYMMETRIC";
  6680. case-1:
  6681. default:
  6682. return "UNRECOGNIZED"
  6683. }
  6684. }
  6685. function In(u) {
  6686. switch (u) {
  6687. case 0:
  6688. case"OK":
  6689. return 0;
  6690. case 2:
  6691. case"UUID_MISMATCH":
  6692. return 2;
  6693. case 3:
  6694. case"ID_EXISTS":
  6695. return 3;
  6696. case 4:
  6697. case"TOO_FREQUENT":
  6698. return 4;
  6699. case 5:
  6700. case"INVALID_ID_FORMAT":
  6701. return 5;
  6702. case 6:
  6703. case"NOT_SUPPORT":
  6704. return 6;
  6705. case 7:
  6706. case"SERVER_ERROR":
  6707. return 7;
  6708. case-1:
  6709. case"UNRECOGNIZED":
  6710. default:
  6711. return -1
  6712. }
  6713. }
  6714. function Tn(u) {
  6715. switch (u) {
  6716. case 0:
  6717. return "OK";
  6718. case 2:
  6719. return "UUID_MISMATCH";
  6720. case 3:
  6721. return "ID_EXISTS";
  6722. case 4:
  6723. return "TOO_FREQUENT";
  6724. case 5:
  6725. return "INVALID_ID_FORMAT";
  6726. case 6:
  6727. return "NOT_SUPPORT";
  6728. case 7:
  6729. return "SERVER_ERROR";
  6730. case-1:
  6731. default:
  6732. return "UNRECOGNIZED"
  6733. }
  6734. }
  6735. var Ae = (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))(Ae || {});
  6736. function Nn(u) {
  6737. switch (u) {
  6738. case 0:
  6739. case"ID_NOT_EXIST":
  6740. return 0;
  6741. case 2:
  6742. case"OFFLINE":
  6743. return 2;
  6744. case 3:
  6745. case"LICENSE_MISMATCH":
  6746. return 3;
  6747. case 4:
  6748. case"LICENSE_OVERUSE":
  6749. return 4;
  6750. case-1:
  6751. case"UNRECOGNIZED":
  6752. default:
  6753. return -1
  6754. }
  6755. }
  6756. function jn(u) {
  6757. switch (u) {
  6758. case 0:
  6759. return "ID_NOT_EXIST";
  6760. case 2:
  6761. return "OFFLINE";
  6762. case 3:
  6763. return "LICENSE_MISMATCH";
  6764. case 4:
  6765. return "LICENSE_OVERUSE";
  6766. case-1:
  6767. default:
  6768. return "UNRECOGNIZED"
  6769. }
  6770. }
  6771. function _t() {
  6772. return {id: "", serial: 0}
  6773. }
  6774. const me = {
  6775. encode(u, e = r.Writer.create()) {
  6776. return u.id !== "" && e.uint32(10).string(u.id), u.serial !== 0 && e.uint32(16).int32(u.serial), e
  6777. }, decode(u, e) {
  6778. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6779. let n = e === void 0 ? i.len : i.pos + e;
  6780. const a = _t();
  6781. for (; i.pos < n;) {
  6782. const t = i.uint32();
  6783. switch (t >>> 3) {
  6784. case 1:
  6785. if (t !== 10) break;
  6786. a.id = i.string();
  6787. continue;
  6788. case 2:
  6789. if (t !== 16) break;
  6790. a.serial = i.int32();
  6791. continue
  6792. }
  6793. if ((t & 7) === 4 || t === 0) break;
  6794. i.skipType(t & 7)
  6795. }
  6796. return a
  6797. }, fromJSON(u) {
  6798. return {id: B(u.id) ? globalThis.String(u.id) : "", serial: B(u.serial) ? globalThis.Number(u.serial) : 0}
  6799. }, toJSON(u) {
  6800. const e = {};
  6801. return u.id !== "" && (e.id = u.id), u.serial !== 0 && (e.serial = Math.round(u.serial)), e
  6802. }, create(u) {
  6803. return me.fromPartial(u != null ? u : {})
  6804. }, fromPartial(u) {
  6805. var i, n;
  6806. const e = _t();
  6807. return e.id = (i = u.id) != null ? i : "", e.serial = (n = u.serial) != null ? n : 0, e
  6808. }
  6809. };
  6810. function vt() {
  6811. return {request_pk: !1}
  6812. }
  6813. const Fe = {
  6814. encode(u, e = r.Writer.create()) {
  6815. return u.request_pk !== !1 && e.uint32(16).bool(u.request_pk), e
  6816. }, decode(u, e) {
  6817. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6818. let n = e === void 0 ? i.len : i.pos + e;
  6819. const a = vt();
  6820. for (; i.pos < n;) {
  6821. const t = i.uint32();
  6822. switch (t >>> 3) {
  6823. case 2:
  6824. if (t !== 16) break;
  6825. a.request_pk = i.bool();
  6826. continue
  6827. }
  6828. if ((t & 7) === 4 || t === 0) break;
  6829. i.skipType(t & 7)
  6830. }
  6831. return a
  6832. }, fromJSON(u) {
  6833. return {request_pk: B(u.request_pk) ? globalThis.Boolean(u.request_pk) : !1}
  6834. }, toJSON(u) {
  6835. const e = {};
  6836. return u.request_pk !== !1 && (e.request_pk = u.request_pk), e
  6837. }, create(u) {
  6838. return Fe.fromPartial(u != null ? u : {})
  6839. }, fromPartial(u) {
  6840. var i;
  6841. const e = vt();
  6842. return e.request_pk = (i = u.request_pk) != null ? i : !1, e
  6843. }
  6844. };
  6845. function gt() {
  6846. return {
  6847. id: "",
  6848. nat_type: 0,
  6849. licence_key: "",
  6850. conn_type: 0,
  6851. token: "",
  6852. version: "",
  6853. udp_port: 0,
  6854. force_relay: !1,
  6855. upnp_port: 0,
  6856. socket_addr_v6: new Uint8Array(0)
  6857. }
  6858. }
  6859. const t0 = {
  6860. encode(u, e = r.Writer.create()) {
  6861. 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), u.udp_port !== 0 && e.uint32(56).int32(u.udp_port), u.force_relay !== !1 && e.uint32(64).bool(u.force_relay), u.upnp_port !== 0 && e.uint32(72).int32(u.upnp_port), u.socket_addr_v6.length !== 0 && e.uint32(82).bytes(u.socket_addr_v6), e
  6862. }, decode(u, e) {
  6863. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6864. let n = e === void 0 ? i.len : i.pos + e;
  6865. const a = gt();
  6866. for (; i.pos < n;) {
  6867. const t = i.uint32();
  6868. switch (t >>> 3) {
  6869. case 1:
  6870. if (t !== 10) break;
  6871. a.id = i.string();
  6872. continue;
  6873. case 2:
  6874. if (t !== 16) break;
  6875. a.nat_type = i.int32();
  6876. continue;
  6877. case 3:
  6878. if (t !== 26) break;
  6879. a.licence_key = i.string();
  6880. continue;
  6881. case 4:
  6882. if (t !== 32) break;
  6883. a.conn_type = i.int32();
  6884. continue;
  6885. case 5:
  6886. if (t !== 42) break;
  6887. a.token = i.string();
  6888. continue;
  6889. case 6:
  6890. if (t !== 50) break;
  6891. a.version = i.string();
  6892. continue;
  6893. case 7:
  6894. if (t !== 56) break;
  6895. a.udp_port = i.int32();
  6896. continue;
  6897. case 8:
  6898. if (t !== 64) break;
  6899. a.force_relay = i.bool();
  6900. continue;
  6901. case 9:
  6902. if (t !== 72) break;
  6903. a.upnp_port = i.int32();
  6904. continue;
  6905. case 10:
  6906. if (t !== 82) break;
  6907. a.socket_addr_v6 = i.bytes();
  6908. continue
  6909. }
  6910. if ((t & 7) === 4 || t === 0) break;
  6911. i.skipType(t & 7)
  6912. }
  6913. return a
  6914. }, fromJSON(u) {
  6915. return {
  6916. id: B(u.id) ? globalThis.String(u.id) : "",
  6917. nat_type: B(u.nat_type) ? h4(u.nat_type) : 0,
  6918. licence_key: B(u.licence_key) ? globalThis.String(u.licence_key) : "",
  6919. conn_type: B(u.conn_type) ? Ba(u.conn_type) : 0,
  6920. token: B(u.token) ? globalThis.String(u.token) : "",
  6921. version: B(u.version) ? globalThis.String(u.version) : "",
  6922. udp_port: B(u.udp_port) ? globalThis.Number(u.udp_port) : 0,
  6923. force_relay: B(u.force_relay) ? globalThis.Boolean(u.force_relay) : !1,
  6924. upnp_port: B(u.upnp_port) ? globalThis.Number(u.upnp_port) : 0,
  6925. socket_addr_v6: B(u.socket_addr_v6) ? z(u.socket_addr_v6) : new Uint8Array(0)
  6926. }
  6927. }, toJSON(u) {
  6928. const e = {};
  6929. return u.id !== "" && (e.id = u.id), u.nat_type !== 0 && (e.nat_type = f4(u.nat_type)), u.licence_key !== "" && (e.licence_key = u.licence_key), u.conn_type !== 0 && (e.conn_type = ca(u.conn_type)), u.token !== "" && (e.token = u.token), u.version !== "" && (e.version = u.version), u.udp_port !== 0 && (e.udp_port = Math.round(u.udp_port)), u.force_relay !== !1 && (e.force_relay = u.force_relay), u.upnp_port !== 0 && (e.upnp_port = Math.round(u.upnp_port)), u.socket_addr_v6.length !== 0 && (e.socket_addr_v6 = P(u.socket_addr_v6)), e
  6930. }, create(u) {
  6931. return t0.fromPartial(u != null ? u : {})
  6932. }, fromPartial(u) {
  6933. var i, n, a, t, s, E, D, d, C, c;
  6934. const e = gt();
  6935. 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.udp_port = (D = u.udp_port) != null ? D : 0, e.force_relay = (d = u.force_relay) != null ? d : !1, e.upnp_port = (C = u.upnp_port) != null ? C : 0, e.socket_addr_v6 = (c = u.socket_addr_v6) != null ? c : new Uint8Array(0), e
  6936. }
  6937. };
  6938. function kt() {
  6939. return {
  6940. socket_addr: new Uint8Array(0),
  6941. relay_server: "",
  6942. nat_type: 0,
  6943. udp_port: 0,
  6944. force_relay: !1,
  6945. upnp_port: 0,
  6946. socket_addr_v6: new Uint8Array(0)
  6947. }
  6948. }
  6949. const _e = {
  6950. encode(u, e = r.Writer.create()) {
  6951. 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), u.udp_port !== 0 && e.uint32(32).int32(u.udp_port), u.force_relay !== !1 && e.uint32(40).bool(u.force_relay), u.upnp_port !== 0 && e.uint32(48).int32(u.upnp_port), u.socket_addr_v6.length !== 0 && e.uint32(58).bytes(u.socket_addr_v6), e
  6952. }, decode(u, e) {
  6953. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6954. let n = e === void 0 ? i.len : i.pos + e;
  6955. const a = kt();
  6956. for (; i.pos < n;) {
  6957. const t = i.uint32();
  6958. switch (t >>> 3) {
  6959. case 1:
  6960. if (t !== 10) break;
  6961. a.socket_addr = i.bytes();
  6962. continue;
  6963. case 2:
  6964. if (t !== 18) break;
  6965. a.relay_server = i.string();
  6966. continue;
  6967. case 3:
  6968. if (t !== 24) break;
  6969. a.nat_type = i.int32();
  6970. continue;
  6971. case 4:
  6972. if (t !== 32) break;
  6973. a.udp_port = i.int32();
  6974. continue;
  6975. case 5:
  6976. if (t !== 40) break;
  6977. a.force_relay = i.bool();
  6978. continue;
  6979. case 6:
  6980. if (t !== 48) break;
  6981. a.upnp_port = i.int32();
  6982. continue;
  6983. case 7:
  6984. if (t !== 58) break;
  6985. a.socket_addr_v6 = i.bytes();
  6986. continue
  6987. }
  6988. if ((t & 7) === 4 || t === 0) break;
  6989. i.skipType(t & 7)
  6990. }
  6991. return a
  6992. }, fromJSON(u) {
  6993. return {
  6994. socket_addr: B(u.socket_addr) ? z(u.socket_addr) : new Uint8Array(0),
  6995. relay_server: B(u.relay_server) ? globalThis.String(u.relay_server) : "",
  6996. nat_type: B(u.nat_type) ? h4(u.nat_type) : 0,
  6997. udp_port: B(u.udp_port) ? globalThis.Number(u.udp_port) : 0,
  6998. force_relay: B(u.force_relay) ? globalThis.Boolean(u.force_relay) : !1,
  6999. upnp_port: B(u.upnp_port) ? globalThis.Number(u.upnp_port) : 0,
  7000. socket_addr_v6: B(u.socket_addr_v6) ? z(u.socket_addr_v6) : new Uint8Array(0)
  7001. }
  7002. }, toJSON(u) {
  7003. const e = {};
  7004. return u.socket_addr.length !== 0 && (e.socket_addr = P(u.socket_addr)), u.relay_server !== "" && (e.relay_server = u.relay_server), u.nat_type !== 0 && (e.nat_type = f4(u.nat_type)), u.udp_port !== 0 && (e.udp_port = Math.round(u.udp_port)), u.force_relay !== !1 && (e.force_relay = u.force_relay), u.upnp_port !== 0 && (e.upnp_port = Math.round(u.upnp_port)), u.socket_addr_v6.length !== 0 && (e.socket_addr_v6 = P(u.socket_addr_v6)), e
  7005. }, create(u) {
  7006. return _e.fromPartial(u != null ? u : {})
  7007. }, fromPartial(u) {
  7008. var i, n, a, t, s, E, D;
  7009. const e = kt();
  7010. 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.udp_port = (t = u.udp_port) != null ? t : 0, e.force_relay = (s = u.force_relay) != null ? s : !1, e.upnp_port = (E = u.upnp_port) != null ? E : 0, e.socket_addr_v6 = (D = u.socket_addr_v6) != null ? D : new Uint8Array(0), e
  7011. }
  7012. };
  7013. function ht() {
  7014. return {serial: 0}
  7015. }
  7016. const ve = {
  7017. encode(u, e = r.Writer.create()) {
  7018. return u.serial !== 0 && e.uint32(8).int32(u.serial), e
  7019. }, decode(u, e) {
  7020. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  7021. let n = e === void 0 ? i.len : i.pos + e;
  7022. const a = ht();
  7023. for (; i.pos < n;) {
  7024. const t = i.uint32();
  7025. switch (t >>> 3) {
  7026. case 1:
  7027. if (t !== 8) break;
  7028. a.serial = i.int32();
  7029. continue
  7030. }
  7031. if ((t & 7) === 4 || t === 0) break;
  7032. i.skipType(t & 7)
  7033. }
  7034. return a
  7035. }, fromJSON(u) {
  7036. return {serial: B(u.serial) ? globalThis.Number(u.serial) : 0}
  7037. }, toJSON(u) {
  7038. const e = {};
  7039. return u.serial !== 0 && (e.serial = Math.round(u.serial)), e
  7040. }, create(u) {
  7041. return ve.fromPartial(u != null ? u : {})
  7042. }, fromPartial(u) {
  7043. var i;
  7044. const e = ht();
  7045. return e.serial = (i = u.serial) != null ? i : 0, e
  7046. }
  7047. };
  7048. function ft() {
  7049. return {port: 0, cu: void 0}
  7050. }
  7051. const ge = {
  7052. encode(u, e = r.Writer.create()) {
  7053. return u.port !== 0 && e.uint32(8).int32(u.port), u.cu !== void 0 && ou.encode(u.cu, e.uint32(18).fork()).ldelim(), e
  7054. }, decode(u, e) {
  7055. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  7056. let n = e === void 0 ? i.len : i.pos + e;
  7057. const a = ft();
  7058. for (; i.pos < n;) {
  7059. const t = i.uint32();
  7060. switch (t >>> 3) {
  7061. case 1:
  7062. if (t !== 8) break;
  7063. a.port = i.int32();
  7064. continue;
  7065. case 2:
  7066. if (t !== 18) break;
  7067. a.cu = ou.decode(i, i.uint32());
  7068. continue
  7069. }
  7070. if ((t & 7) === 4 || t === 0) break;
  7071. i.skipType(t & 7)
  7072. }
  7073. return a
  7074. }, fromJSON(u) {
  7075. return {port: B(u.port) ? globalThis.Number(u.port) : 0, cu: B(u.cu) ? ou.fromJSON(u.cu) : void 0}
  7076. }, toJSON(u) {
  7077. const e = {};
  7078. return u.port !== 0 && (e.port = Math.round(u.port)), u.cu !== void 0 && (e.cu = ou.toJSON(u.cu)), e
  7079. }, create(u) {
  7080. return ge.fromPartial(u != null ? u : {})
  7081. }, fromPartial(u) {
  7082. var i;
  7083. const e = ft();
  7084. return e.port = (i = u.port) != null ? i : 0, e.cu = u.cu !== void 0 && u.cu !== null ? ou.fromPartial(u.cu) : void 0, e
  7085. }
  7086. };
  7087. function xt() {
  7088. return {
  7089. socket_addr: new Uint8Array(0),
  7090. id: "",
  7091. relay_server: "",
  7092. nat_type: 0,
  7093. version: "",
  7094. upnp_port: 0,
  7095. socket_addr_v6: new Uint8Array(0)
  7096. }
  7097. }
  7098. const ke = {
  7099. encode(u, e = r.Writer.create()) {
  7100. 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), u.upnp_port !== 0 && e.uint32(48).int32(u.upnp_port), u.socket_addr_v6.length !== 0 && e.uint32(58).bytes(u.socket_addr_v6), e
  7101. }, decode(u, e) {
  7102. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  7103. let n = e === void 0 ? i.len : i.pos + e;
  7104. const a = xt();
  7105. for (; i.pos < n;) {
  7106. const t = i.uint32();
  7107. switch (t >>> 3) {
  7108. case 1:
  7109. if (t !== 10) break;
  7110. a.socket_addr = i.bytes();
  7111. continue;
  7112. case 2:
  7113. if (t !== 18) break;
  7114. a.id = i.string();
  7115. continue;
  7116. case 3:
  7117. if (t !== 26) break;
  7118. a.relay_server = i.string();
  7119. continue;
  7120. case 4:
  7121. if (t !== 32) break;
  7122. a.nat_type = i.int32();
  7123. continue;
  7124. case 5:
  7125. if (t !== 42) break;
  7126. a.version = i.string();
  7127. continue;
  7128. case 6:
  7129. if (t !== 48) break;
  7130. a.upnp_port = i.int32();
  7131. continue;
  7132. case 7:
  7133. if (t !== 58) break;
  7134. a.socket_addr_v6 = i.bytes();
  7135. continue
  7136. }
  7137. if ((t & 7) === 4 || t === 0) break;
  7138. i.skipType(t & 7)
  7139. }
  7140. return a
  7141. }, fromJSON(u) {
  7142. return {
  7143. socket_addr: B(u.socket_addr) ? z(u.socket_addr) : new Uint8Array(0),
  7144. id: B(u.id) ? globalThis.String(u.id) : "",
  7145. relay_server: B(u.relay_server) ? globalThis.String(u.relay_server) : "",
  7146. nat_type: B(u.nat_type) ? h4(u.nat_type) : 0,
  7147. version: B(u.version) ? globalThis.String(u.version) : "",
  7148. upnp_port: B(u.upnp_port) ? globalThis.Number(u.upnp_port) : 0,
  7149. socket_addr_v6: B(u.socket_addr_v6) ? z(u.socket_addr_v6) : new Uint8Array(0)
  7150. }
  7151. }, toJSON(u) {
  7152. const e = {};
  7153. return u.socket_addr.length !== 0 && (e.socket_addr = P(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 = f4(u.nat_type)), u.version !== "" && (e.version = u.version), u.upnp_port !== 0 && (e.upnp_port = Math.round(u.upnp_port)), u.socket_addr_v6.length !== 0 && (e.socket_addr_v6 = P(u.socket_addr_v6)), e
  7154. }, create(u) {
  7155. return ke.fromPartial(u != null ? u : {})
  7156. }, fromPartial(u) {
  7157. var i, n, a, t, s, E, D;
  7158. const e = xt();
  7159. 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.upnp_port = (E = u.upnp_port) != null ? E : 0, e.socket_addr_v6 = (D = u.socket_addr_v6) != null ? D : new Uint8Array(0), e
  7160. }
  7161. };
  7162. function yt() {
  7163. return {id: "", uuid: new Uint8Array(0), pk: new Uint8Array(0), old_id: "", no_register_device: !1}
  7164. }
  7165. const he = {
  7166. encode(u, e = r.Writer.create()) {
  7167. 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), u.no_register_device !== !1 && e.uint32(40).bool(u.no_register_device), e
  7168. }, decode(u, e) {
  7169. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  7170. let n = e === void 0 ? i.len : i.pos + e;
  7171. const a = yt();
  7172. for (; i.pos < n;) {
  7173. const t = i.uint32();
  7174. switch (t >>> 3) {
  7175. case 1:
  7176. if (t !== 10) break;
  7177. a.id = i.string();
  7178. continue;
  7179. case 2:
  7180. if (t !== 18) break;
  7181. a.uuid = i.bytes();
  7182. continue;
  7183. case 3:
  7184. if (t !== 26) break;
  7185. a.pk = i.bytes();
  7186. continue;
  7187. case 4:
  7188. if (t !== 34) break;
  7189. a.old_id = i.string();
  7190. continue;
  7191. case 5:
  7192. if (t !== 40) break;
  7193. a.no_register_device = i.bool();
  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 {
  7202. id: B(u.id) ? globalThis.String(u.id) : "",
  7203. uuid: B(u.uuid) ? z(u.uuid) : new Uint8Array(0),
  7204. pk: B(u.pk) ? z(u.pk) : new Uint8Array(0),
  7205. old_id: B(u.old_id) ? globalThis.String(u.old_id) : "",
  7206. no_register_device: B(u.no_register_device) ? globalThis.Boolean(u.no_register_device) : !1
  7207. }
  7208. }, toJSON(u) {
  7209. const e = {};
  7210. return u.id !== "" && (e.id = u.id), u.uuid.length !== 0 && (e.uuid = P(u.uuid)), u.pk.length !== 0 && (e.pk = P(u.pk)), u.old_id !== "" && (e.old_id = u.old_id), u.no_register_device !== !1 && (e.no_register_device = u.no_register_device), e
  7211. }, create(u) {
  7212. return he.fromPartial(u != null ? u : {})
  7213. }, fromPartial(u) {
  7214. var i, n, a, t, s;
  7215. const e = yt();
  7216. 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.no_register_device = (s = u.no_register_device) != null ? s : !1, e
  7217. }
  7218. };
  7219. function bt() {
  7220. return {result: 0, keep_alive: 0}
  7221. }
  7222. const fe = {
  7223. encode(u, e = r.Writer.create()) {
  7224. return u.result !== 0 && e.uint32(8).int32(u.result), u.keep_alive !== 0 && e.uint32(16).int32(u.keep_alive), e
  7225. }, decode(u, e) {
  7226. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  7227. let n = e === void 0 ? i.len : i.pos + e;
  7228. const a = bt();
  7229. for (; i.pos < n;) {
  7230. const t = i.uint32();
  7231. switch (t >>> 3) {
  7232. case 1:
  7233. if (t !== 8) break;
  7234. a.result = i.int32();
  7235. continue;
  7236. case 2:
  7237. if (t !== 16) break;
  7238. a.keep_alive = i.int32();
  7239. continue
  7240. }
  7241. if ((t & 7) === 4 || t === 0) break;
  7242. i.skipType(t & 7)
  7243. }
  7244. return a
  7245. }, fromJSON(u) {
  7246. return {
  7247. result: B(u.result) ? In(u.result) : 0,
  7248. keep_alive: B(u.keep_alive) ? globalThis.Number(u.keep_alive) : 0
  7249. }
  7250. }, toJSON(u) {
  7251. const e = {};
  7252. return u.result !== 0 && (e.result = Tn(u.result)), u.keep_alive !== 0 && (e.keep_alive = Math.round(u.keep_alive)), e
  7253. }, create(u) {
  7254. return fe.fromPartial(u != null ? u : {})
  7255. }, fromPartial(u) {
  7256. var i, n;
  7257. const e = bt();
  7258. return e.result = (i = u.result) != null ? i : 0, e.keep_alive = (n = u.keep_alive) != null ? n : 0, e
  7259. }
  7260. };
  7261. function wt() {
  7262. return {
  7263. socket_addr: new Uint8Array(0),
  7264. pk: new Uint8Array(0),
  7265. failure: 0,
  7266. relay_server: "",
  7267. nat_type: void 0,
  7268. is_local: void 0,
  7269. other_failure: "",
  7270. feedback: 0,
  7271. is_udp: !1,
  7272. upnp_port: 0,
  7273. socket_addr_v6: new Uint8Array(0)
  7274. }
  7275. }
  7276. const xe = {
  7277. encode(u, e = r.Writer.create()) {
  7278. 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), u.is_udp !== !1 && e.uint32(72).bool(u.is_udp), u.upnp_port !== 0 && e.uint32(80).int32(u.upnp_port), u.socket_addr_v6.length !== 0 && e.uint32(90).bytes(u.socket_addr_v6), e
  7279. }, decode(u, e) {
  7280. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  7281. let n = e === void 0 ? i.len : i.pos + e;
  7282. const a = wt();
  7283. for (; i.pos < n;) {
  7284. const t = i.uint32();
  7285. switch (t >>> 3) {
  7286. case 1:
  7287. if (t !== 10) break;
  7288. a.socket_addr = i.bytes();
  7289. continue;
  7290. case 2:
  7291. if (t !== 18) break;
  7292. a.pk = i.bytes();
  7293. continue;
  7294. case 3:
  7295. if (t !== 24) break;
  7296. a.failure = i.int32();
  7297. continue;
  7298. case 4:
  7299. if (t !== 34) break;
  7300. a.relay_server = i.string();
  7301. continue;
  7302. case 5:
  7303. if (t !== 40) break;
  7304. a.nat_type = i.int32();
  7305. continue;
  7306. case 6:
  7307. if (t !== 48) break;
  7308. a.is_local = i.bool();
  7309. continue;
  7310. case 7:
  7311. if (t !== 58) break;
  7312. a.other_failure = i.string();
  7313. continue;
  7314. case 8:
  7315. if (t !== 64) break;
  7316. a.feedback = i.int32();
  7317. continue;
  7318. case 9:
  7319. if (t !== 72) break;
  7320. a.is_udp = i.bool();
  7321. continue;
  7322. case 10:
  7323. if (t !== 80) break;
  7324. a.upnp_port = i.int32();
  7325. continue;
  7326. case 11:
  7327. if (t !== 90) break;
  7328. a.socket_addr_v6 = i.bytes();
  7329. continue
  7330. }
  7331. if ((t & 7) === 4 || t === 0) break;
  7332. i.skipType(t & 7)
  7333. }
  7334. return a
  7335. }, fromJSON(u) {
  7336. return {
  7337. socket_addr: B(u.socket_addr) ? z(u.socket_addr) : new Uint8Array(0),
  7338. pk: B(u.pk) ? z(u.pk) : new Uint8Array(0),
  7339. failure: B(u.failure) ? Nn(u.failure) : 0,
  7340. relay_server: B(u.relay_server) ? globalThis.String(u.relay_server) : "",
  7341. nat_type: B(u.nat_type) ? h4(u.nat_type) : void 0,
  7342. is_local: B(u.is_local) ? globalThis.Boolean(u.is_local) : void 0,
  7343. other_failure: B(u.other_failure) ? globalThis.String(u.other_failure) : "",
  7344. feedback: B(u.feedback) ? globalThis.Number(u.feedback) : 0,
  7345. is_udp: B(u.is_udp) ? globalThis.Boolean(u.is_udp) : !1,
  7346. upnp_port: B(u.upnp_port) ? globalThis.Number(u.upnp_port) : 0,
  7347. socket_addr_v6: B(u.socket_addr_v6) ? z(u.socket_addr_v6) : new Uint8Array(0)
  7348. }
  7349. }, toJSON(u) {
  7350. const e = {};
  7351. return u.socket_addr.length !== 0 && (e.socket_addr = P(u.socket_addr)), u.pk.length !== 0 && (e.pk = P(u.pk)), u.failure !== 0 && (e.failure = jn(u.failure)), u.relay_server !== "" && (e.relay_server = u.relay_server), u.nat_type !== void 0 && (e.nat_type = f4(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)), u.is_udp !== !1 && (e.is_udp = u.is_udp), u.upnp_port !== 0 && (e.upnp_port = Math.round(u.upnp_port)), u.socket_addr_v6.length !== 0 && (e.socket_addr_v6 = P(u.socket_addr_v6)), e
  7352. }, create(u) {
  7353. return xe.fromPartial(u != null ? u : {})
  7354. }, fromPartial(u) {
  7355. var i, n, a, t, s, E, D, d, C, c, p;
  7356. const e = wt();
  7357. 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 = (D = u.other_failure) != null ? D : "", e.feedback = (d = u.feedback) != null ? d : 0, e.is_udp = (C = u.is_udp) != null ? C : !1, e.upnp_port = (c = u.upnp_port) != null ? c : 0, e.socket_addr_v6 = (p = u.socket_addr_v6) != null ? p : new Uint8Array(0), e
  7358. }
  7359. };
  7360. function St() {
  7361. return {serial: 0, rendezvous_servers: []}
  7362. }
  7363. const ou = {
  7364. encode(u, e = r.Writer.create()) {
  7365. u.serial !== 0 && e.uint32(8).int32(u.serial);
  7366. for (const i of u.rendezvous_servers) e.uint32(18).string(i);
  7367. return e
  7368. }, decode(u, e) {
  7369. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  7370. let n = e === void 0 ? i.len : i.pos + e;
  7371. const a = St();
  7372. for (; i.pos < n;) {
  7373. const t = i.uint32();
  7374. switch (t >>> 3) {
  7375. case 1:
  7376. if (t !== 8) break;
  7377. a.serial = i.int32();
  7378. continue;
  7379. case 2:
  7380. if (t !== 18) break;
  7381. a.rendezvous_servers.push(i.string());
  7382. continue
  7383. }
  7384. if ((t & 7) === 4 || t === 0) break;
  7385. i.skipType(t & 7)
  7386. }
  7387. return a
  7388. }, fromJSON(u) {
  7389. return {
  7390. serial: B(u.serial) ? globalThis.Number(u.serial) : 0,
  7391. rendezvous_servers: globalThis.Array.isArray(u == null ? void 0 : u.rendezvous_servers) ? u.rendezvous_servers.map(e => globalThis.String(e)) : []
  7392. }
  7393. }, toJSON(u) {
  7394. var i;
  7395. const e = {};
  7396. return u.serial !== 0 && (e.serial = Math.round(u.serial)), (i = u.rendezvous_servers) != null && i.length && (e.rendezvous_servers = u.rendezvous_servers), e
  7397. }, create(u) {
  7398. return ou.fromPartial(u != null ? u : {})
  7399. }, fromPartial(u) {
  7400. var i, n;
  7401. const e = St();
  7402. return e.serial = (i = u.serial) != null ? i : 0, e.rendezvous_servers = ((n = u.rendezvous_servers) == null ? void 0 : n.map(a => a)) || [], e
  7403. }
  7404. };
  7405. function zt() {
  7406. return {
  7407. id: "",
  7408. uuid: "",
  7409. socket_addr: new Uint8Array(0),
  7410. relay_server: "",
  7411. secure: !1,
  7412. licence_key: "",
  7413. conn_type: 0,
  7414. token: ""
  7415. }
  7416. }
  7417. const a0 = {
  7418. encode(u, e = r.Writer.create()) {
  7419. 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
  7420. }, decode(u, e) {
  7421. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  7422. let n = e === void 0 ? i.len : i.pos + e;
  7423. const a = zt();
  7424. for (; i.pos < n;) {
  7425. const t = i.uint32();
  7426. switch (t >>> 3) {
  7427. case 1:
  7428. if (t !== 10) break;
  7429. a.id = i.string();
  7430. continue;
  7431. case 2:
  7432. if (t !== 18) break;
  7433. a.uuid = i.string();
  7434. continue;
  7435. case 3:
  7436. if (t !== 26) break;
  7437. a.socket_addr = i.bytes();
  7438. continue;
  7439. case 4:
  7440. if (t !== 34) break;
  7441. a.relay_server = i.string();
  7442. continue;
  7443. case 5:
  7444. if (t !== 40) break;
  7445. a.secure = i.bool();
  7446. continue;
  7447. case 6:
  7448. if (t !== 50) break;
  7449. a.licence_key = i.string();
  7450. continue;
  7451. case 7:
  7452. if (t !== 56) break;
  7453. a.conn_type = i.int32();
  7454. continue;
  7455. case 8:
  7456. if (t !== 66) break;
  7457. a.token = i.string();
  7458. continue
  7459. }
  7460. if ((t & 7) === 4 || t === 0) break;
  7461. i.skipType(t & 7)
  7462. }
  7463. return a
  7464. }, fromJSON(u) {
  7465. return {
  7466. id: B(u.id) ? globalThis.String(u.id) : "",
  7467. uuid: B(u.uuid) ? globalThis.String(u.uuid) : "",
  7468. socket_addr: B(u.socket_addr) ? z(u.socket_addr) : new Uint8Array(0),
  7469. relay_server: B(u.relay_server) ? globalThis.String(u.relay_server) : "",
  7470. secure: B(u.secure) ? globalThis.Boolean(u.secure) : !1,
  7471. licence_key: B(u.licence_key) ? globalThis.String(u.licence_key) : "",
  7472. conn_type: B(u.conn_type) ? Ba(u.conn_type) : 0,
  7473. token: B(u.token) ? globalThis.String(u.token) : ""
  7474. }
  7475. }, toJSON(u) {
  7476. const e = {};
  7477. return u.id !== "" && (e.id = u.id), u.uuid !== "" && (e.uuid = u.uuid), u.socket_addr.length !== 0 && (e.socket_addr = P(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 = ca(u.conn_type)), u.token !== "" && (e.token = u.token), e
  7478. }, create(u) {
  7479. return a0.fromPartial(u != null ? u : {})
  7480. }, fromPartial(u) {
  7481. var i, n, a, t, s, E, D, d;
  7482. const e = zt();
  7483. 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 = (D = u.conn_type) != null ? D : 0, e.token = (d = u.token) != null ? d : "", e
  7484. }
  7485. };
  7486. function Pt() {
  7487. return {
  7488. socket_addr: new Uint8Array(0),
  7489. uuid: "",
  7490. relay_server: "",
  7491. id: void 0,
  7492. pk: void 0,
  7493. refuse_reason: "",
  7494. version: "",
  7495. feedback: 0,
  7496. socket_addr_v6: new Uint8Array(0),
  7497. upnp_port: 0
  7498. }
  7499. }
  7500. const ye = {
  7501. encode(u, e = r.Writer.create()) {
  7502. 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), u.socket_addr_v6.length !== 0 && e.uint32(82).bytes(u.socket_addr_v6), u.upnp_port !== 0 && e.uint32(88).int32(u.upnp_port), e
  7503. }, decode(u, e) {
  7504. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  7505. let n = e === void 0 ? i.len : i.pos + e;
  7506. const a = Pt();
  7507. for (; i.pos < n;) {
  7508. const t = i.uint32();
  7509. switch (t >>> 3) {
  7510. case 1:
  7511. if (t !== 10) break;
  7512. a.socket_addr = i.bytes();
  7513. continue;
  7514. case 2:
  7515. if (t !== 18) break;
  7516. a.uuid = i.string();
  7517. continue;
  7518. case 3:
  7519. if (t !== 26) break;
  7520. a.relay_server = i.string();
  7521. continue;
  7522. case 4:
  7523. if (t !== 34) break;
  7524. a.id = i.string();
  7525. continue;
  7526. case 5:
  7527. if (t !== 42) break;
  7528. a.pk = i.bytes();
  7529. continue;
  7530. case 6:
  7531. if (t !== 50) break;
  7532. a.refuse_reason = i.string();
  7533. continue;
  7534. case 7:
  7535. if (t !== 58) break;
  7536. a.version = i.string();
  7537. continue;
  7538. case 9:
  7539. if (t !== 72) break;
  7540. a.feedback = i.int32();
  7541. continue;
  7542. case 10:
  7543. if (t !== 82) break;
  7544. a.socket_addr_v6 = i.bytes();
  7545. continue;
  7546. case 11:
  7547. if (t !== 88) break;
  7548. a.upnp_port = i.int32();
  7549. continue
  7550. }
  7551. if ((t & 7) === 4 || t === 0) break;
  7552. i.skipType(t & 7)
  7553. }
  7554. return a
  7555. }, fromJSON(u) {
  7556. return {
  7557. socket_addr: B(u.socket_addr) ? z(u.socket_addr) : new Uint8Array(0),
  7558. uuid: B(u.uuid) ? globalThis.String(u.uuid) : "",
  7559. relay_server: B(u.relay_server) ? globalThis.String(u.relay_server) : "",
  7560. id: B(u.id) ? globalThis.String(u.id) : void 0,
  7561. pk: B(u.pk) ? z(u.pk) : void 0,
  7562. refuse_reason: B(u.refuse_reason) ? globalThis.String(u.refuse_reason) : "",
  7563. version: B(u.version) ? globalThis.String(u.version) : "",
  7564. feedback: B(u.feedback) ? globalThis.Number(u.feedback) : 0,
  7565. socket_addr_v6: B(u.socket_addr_v6) ? z(u.socket_addr_v6) : new Uint8Array(0),
  7566. upnp_port: B(u.upnp_port) ? globalThis.Number(u.upnp_port) : 0
  7567. }
  7568. }, toJSON(u) {
  7569. const e = {};
  7570. return u.socket_addr.length !== 0 && (e.socket_addr = P(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 = P(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)), u.socket_addr_v6.length !== 0 && (e.socket_addr_v6 = P(u.socket_addr_v6)), u.upnp_port !== 0 && (e.upnp_port = Math.round(u.upnp_port)), e
  7571. }, create(u) {
  7572. return ye.fromPartial(u != null ? u : {})
  7573. }, fromPartial(u) {
  7574. var i, n, a, t, s, E, D, d, C, c;
  7575. const e = Pt();
  7576. 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 = (D = u.version) != null ? D : "", e.feedback = (d = u.feedback) != null ? d : 0, e.socket_addr_v6 = (C = u.socket_addr_v6) != null ? C : new Uint8Array(0), e.upnp_port = (c = u.upnp_port) != null ? c : 0, e
  7577. }
  7578. };
  7579. function Rt() {
  7580. return {url: ""}
  7581. }
  7582. const be = {
  7583. encode(u, e = r.Writer.create()) {
  7584. return u.url !== "" && e.uint32(10).string(u.url), e
  7585. }, decode(u, e) {
  7586. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  7587. let n = e === void 0 ? i.len : i.pos + e;
  7588. const a = Rt();
  7589. for (; i.pos < n;) {
  7590. const t = i.uint32();
  7591. switch (t >>> 3) {
  7592. case 1:
  7593. if (t !== 10) break;
  7594. a.url = i.string();
  7595. continue
  7596. }
  7597. if ((t & 7) === 4 || t === 0) break;
  7598. i.skipType(t & 7)
  7599. }
  7600. return a
  7601. }, fromJSON(u) {
  7602. return {url: B(u.url) ? globalThis.String(u.url) : ""}
  7603. }, toJSON(u) {
  7604. const e = {};
  7605. return u.url !== "" && (e.url = u.url), e
  7606. }, create(u) {
  7607. return be.fromPartial(u != null ? u : {})
  7608. }, fromPartial(u) {
  7609. var i;
  7610. const e = Rt();
  7611. return e.url = (i = u.url) != null ? i : "", e
  7612. }
  7613. };
  7614. function It() {
  7615. return {socket_addr: new Uint8Array(0), relay_server: "", socket_addr_v6: new Uint8Array(0)}
  7616. }
  7617. const we = {
  7618. encode(u, e = r.Writer.create()) {
  7619. return u.socket_addr.length !== 0 && e.uint32(10).bytes(u.socket_addr), u.relay_server !== "" && e.uint32(18).string(u.relay_server), u.socket_addr_v6.length !== 0 && e.uint32(26).bytes(u.socket_addr_v6), e
  7620. }, decode(u, e) {
  7621. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  7622. let n = e === void 0 ? i.len : i.pos + e;
  7623. const a = It();
  7624. for (; i.pos < n;) {
  7625. const t = i.uint32();
  7626. switch (t >>> 3) {
  7627. case 1:
  7628. if (t !== 10) break;
  7629. a.socket_addr = i.bytes();
  7630. continue;
  7631. case 2:
  7632. if (t !== 18) break;
  7633. a.relay_server = i.string();
  7634. continue;
  7635. case 3:
  7636. if (t !== 26) break;
  7637. a.socket_addr_v6 = i.bytes();
  7638. continue
  7639. }
  7640. if ((t & 7) === 4 || t === 0) break;
  7641. i.skipType(t & 7)
  7642. }
  7643. return a
  7644. }, fromJSON(u) {
  7645. return {
  7646. socket_addr: B(u.socket_addr) ? z(u.socket_addr) : new Uint8Array(0),
  7647. relay_server: B(u.relay_server) ? globalThis.String(u.relay_server) : "",
  7648. socket_addr_v6: B(u.socket_addr_v6) ? z(u.socket_addr_v6) : new Uint8Array(0)
  7649. }
  7650. }, toJSON(u) {
  7651. const e = {};
  7652. return u.socket_addr.length !== 0 && (e.socket_addr = P(u.socket_addr)), u.relay_server !== "" && (e.relay_server = u.relay_server), u.socket_addr_v6.length !== 0 && (e.socket_addr_v6 = P(u.socket_addr_v6)), e
  7653. }, create(u) {
  7654. return we.fromPartial(u != null ? u : {})
  7655. }, fromPartial(u) {
  7656. var i, n, a;
  7657. const e = It();
  7658. return e.socket_addr = (i = u.socket_addr) != null ? i : new Uint8Array(0), e.relay_server = (n = u.relay_server) != null ? n : "", e.socket_addr_v6 = (a = u.socket_addr_v6) != null ? a : new Uint8Array(0), e
  7659. }
  7660. };
  7661. function Tt() {
  7662. return {
  7663. socket_addr: new Uint8Array(0),
  7664. local_addr: new Uint8Array(0),
  7665. relay_server: "",
  7666. id: "",
  7667. version: "",
  7668. socket_addr_v6: new Uint8Array(0)
  7669. }
  7670. }
  7671. const Se = {
  7672. encode(u, e = r.Writer.create()) {
  7673. 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), u.socket_addr_v6.length !== 0 && e.uint32(50).bytes(u.socket_addr_v6), e
  7674. }, decode(u, e) {
  7675. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  7676. let n = e === void 0 ? i.len : i.pos + e;
  7677. const a = Tt();
  7678. for (; i.pos < n;) {
  7679. const t = i.uint32();
  7680. switch (t >>> 3) {
  7681. case 1:
  7682. if (t !== 10) break;
  7683. a.socket_addr = i.bytes();
  7684. continue;
  7685. case 2:
  7686. if (t !== 18) break;
  7687. a.local_addr = i.bytes();
  7688. continue;
  7689. case 3:
  7690. if (t !== 26) break;
  7691. a.relay_server = i.string();
  7692. continue;
  7693. case 4:
  7694. if (t !== 34) break;
  7695. a.id = i.string();
  7696. continue;
  7697. case 5:
  7698. if (t !== 42) break;
  7699. a.version = i.string();
  7700. continue;
  7701. case 6:
  7702. if (t !== 50) break;
  7703. a.socket_addr_v6 = i.bytes();
  7704. continue
  7705. }
  7706. if ((t & 7) === 4 || t === 0) break;
  7707. i.skipType(t & 7)
  7708. }
  7709. return a
  7710. }, fromJSON(u) {
  7711. return {
  7712. socket_addr: B(u.socket_addr) ? z(u.socket_addr) : new Uint8Array(0),
  7713. local_addr: B(u.local_addr) ? z(u.local_addr) : new Uint8Array(0),
  7714. relay_server: B(u.relay_server) ? globalThis.String(u.relay_server) : "",
  7715. id: B(u.id) ? globalThis.String(u.id) : "",
  7716. version: B(u.version) ? globalThis.String(u.version) : "",
  7717. socket_addr_v6: B(u.socket_addr_v6) ? z(u.socket_addr_v6) : new Uint8Array(0)
  7718. }
  7719. }, toJSON(u) {
  7720. const e = {};
  7721. return u.socket_addr.length !== 0 && (e.socket_addr = P(u.socket_addr)), u.local_addr.length !== 0 && (e.local_addr = P(u.local_addr)), u.relay_server !== "" && (e.relay_server = u.relay_server), u.id !== "" && (e.id = u.id), u.version !== "" && (e.version = u.version), u.socket_addr_v6.length !== 0 && (e.socket_addr_v6 = P(u.socket_addr_v6)), e
  7722. }, create(u) {
  7723. return Se.fromPartial(u != null ? u : {})
  7724. }, fromPartial(u) {
  7725. var i, n, a, t, s, E;
  7726. const e = Tt();
  7727. 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.socket_addr_v6 = (E = u.socket_addr_v6) != null ? E : new Uint8Array(0), e
  7728. }
  7729. };
  7730. function Nt() {
  7731. return {cmd: "", mac: "", id: "", username: "", hostname: "", platform: "", misc: ""}
  7732. }
  7733. const ze = {
  7734. encode(u, e = r.Writer.create()) {
  7735. 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
  7736. }, decode(u, e) {
  7737. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  7738. let n = e === void 0 ? i.len : i.pos + e;
  7739. const a = Nt();
  7740. for (; i.pos < n;) {
  7741. const t = i.uint32();
  7742. switch (t >>> 3) {
  7743. case 1:
  7744. if (t !== 10) break;
  7745. a.cmd = i.string();
  7746. continue;
  7747. case 2:
  7748. if (t !== 18) break;
  7749. a.mac = i.string();
  7750. continue;
  7751. case 3:
  7752. if (t !== 26) break;
  7753. a.id = i.string();
  7754. continue;
  7755. case 4:
  7756. if (t !== 34) break;
  7757. a.username = i.string();
  7758. continue;
  7759. case 5:
  7760. if (t !== 42) break;
  7761. a.hostname = i.string();
  7762. continue;
  7763. case 6:
  7764. if (t !== 50) break;
  7765. a.platform = i.string();
  7766. continue;
  7767. case 7:
  7768. if (t !== 58) break;
  7769. a.misc = i.string();
  7770. continue
  7771. }
  7772. if ((t & 7) === 4 || t === 0) break;
  7773. i.skipType(t & 7)
  7774. }
  7775. return a
  7776. }, fromJSON(u) {
  7777. return {
  7778. cmd: B(u.cmd) ? globalThis.String(u.cmd) : "",
  7779. mac: B(u.mac) ? globalThis.String(u.mac) : "",
  7780. id: B(u.id) ? globalThis.String(u.id) : "",
  7781. username: B(u.username) ? globalThis.String(u.username) : "",
  7782. hostname: B(u.hostname) ? globalThis.String(u.hostname) : "",
  7783. platform: B(u.platform) ? globalThis.String(u.platform) : "",
  7784. misc: B(u.misc) ? globalThis.String(u.misc) : ""
  7785. }
  7786. }, toJSON(u) {
  7787. const e = {};
  7788. 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
  7789. }, create(u) {
  7790. return ze.fromPartial(u != null ? u : {})
  7791. }, fromPartial(u) {
  7792. var i, n, a, t, s, E, D;
  7793. const e = Nt();
  7794. 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 = (D = u.misc) != null ? D : "", e
  7795. }
  7796. };
  7797. function jt() {
  7798. return {id: "", peers: []}
  7799. }
  7800. const n0 = {
  7801. encode(u, e = r.Writer.create()) {
  7802. u.id !== "" && e.uint32(10).string(u.id);
  7803. for (const i of u.peers) e.uint32(18).string(i);
  7804. return e
  7805. }, decode(u, e) {
  7806. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  7807. let n = e === void 0 ? i.len : i.pos + e;
  7808. const a = jt();
  7809. for (; i.pos < n;) {
  7810. const t = i.uint32();
  7811. switch (t >>> 3) {
  7812. case 1:
  7813. if (t !== 10) break;
  7814. a.id = i.string();
  7815. continue;
  7816. case 2:
  7817. if (t !== 18) break;
  7818. a.peers.push(i.string());
  7819. continue
  7820. }
  7821. if ((t & 7) === 4 || t === 0) break;
  7822. i.skipType(t & 7)
  7823. }
  7824. return a
  7825. }, fromJSON(u) {
  7826. return {
  7827. id: B(u.id) ? globalThis.String(u.id) : "",
  7828. peers: globalThis.Array.isArray(u == null ? void 0 : u.peers) ? u.peers.map(e => globalThis.String(e)) : []
  7829. }
  7830. }, toJSON(u) {
  7831. var i;
  7832. const e = {};
  7833. return u.id !== "" && (e.id = u.id), (i = u.peers) != null && i.length && (e.peers = u.peers), e
  7834. }, create(u) {
  7835. return n0.fromPartial(u != null ? u : {})
  7836. }, fromPartial(u) {
  7837. var i, n;
  7838. const e = jt();
  7839. return e.id = (i = u.id) != null ? i : "", e.peers = ((n = u.peers) == null ? void 0 : n.map(a => a)) || [], e
  7840. }
  7841. };
  7842. function Ot() {
  7843. return {states: new Uint8Array(0)}
  7844. }
  7845. const Pe = {
  7846. encode(u, e = r.Writer.create()) {
  7847. return u.states.length !== 0 && e.uint32(10).bytes(u.states), e
  7848. }, decode(u, e) {
  7849. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  7850. let n = e === void 0 ? i.len : i.pos + e;
  7851. const a = Ot();
  7852. for (; i.pos < n;) {
  7853. const t = i.uint32();
  7854. switch (t >>> 3) {
  7855. case 1:
  7856. if (t !== 10) break;
  7857. a.states = i.bytes();
  7858. continue
  7859. }
  7860. if ((t & 7) === 4 || t === 0) break;
  7861. i.skipType(t & 7)
  7862. }
  7863. return a
  7864. }, fromJSON(u) {
  7865. return {states: B(u.states) ? z(u.states) : new Uint8Array(0)}
  7866. }, toJSON(u) {
  7867. const e = {};
  7868. return u.states.length !== 0 && (e.states = P(u.states)), e
  7869. }, create(u) {
  7870. return Pe.fromPartial(u != null ? u : {})
  7871. }, fromPartial(u) {
  7872. var i;
  7873. const e = Ot();
  7874. return e.states = (i = u.states) != null ? i : new Uint8Array(0), e
  7875. }
  7876. };
  7877. function Ut() {
  7878. return {keys: []}
  7879. }
  7880. const Re = {
  7881. encode(u, e = r.Writer.create()) {
  7882. for (const i of u.keys) e.uint32(10).bytes(i);
  7883. return e
  7884. }, decode(u, e) {
  7885. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  7886. let n = e === void 0 ? i.len : i.pos + e;
  7887. const a = Ut();
  7888. for (; i.pos < n;) {
  7889. const t = i.uint32();
  7890. switch (t >>> 3) {
  7891. case 1:
  7892. if (t !== 10) break;
  7893. a.keys.push(i.bytes());
  7894. continue
  7895. }
  7896. if ((t & 7) === 4 || t === 0) break;
  7897. i.skipType(t & 7)
  7898. }
  7899. return a
  7900. }, fromJSON(u) {
  7901. return {keys: globalThis.Array.isArray(u == null ? void 0 : u.keys) ? u.keys.map(e => z(e)) : []}
  7902. }, toJSON(u) {
  7903. var i;
  7904. const e = {};
  7905. return (i = u.keys) != null && i.length && (e.keys = u.keys.map(n => P(n))), e
  7906. }, create(u) {
  7907. return Re.fromPartial(u != null ? u : {})
  7908. }, fromPartial(u) {
  7909. var i;
  7910. const e = Ut();
  7911. return e.keys = ((i = u.keys) == null ? void 0 : i.map(n => n)) || [], e
  7912. }
  7913. };
  7914. function Mt() {
  7915. return {token: ""}
  7916. }
  7917. const o0 = {
  7918. encode(u, e = r.Writer.create()) {
  7919. return u.token !== "" && e.uint32(10).string(u.token), e
  7920. }, decode(u, e) {
  7921. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  7922. let n = e === void 0 ? i.len : i.pos + e;
  7923. const a = Mt();
  7924. for (; i.pos < n;) {
  7925. const t = i.uint32();
  7926. switch (t >>> 3) {
  7927. case 1:
  7928. if (t !== 10) break;
  7929. a.token = i.string();
  7930. continue
  7931. }
  7932. if ((t & 7) === 4 || t === 0) break;
  7933. i.skipType(t & 7)
  7934. }
  7935. return a
  7936. }, fromJSON(u) {
  7937. return {token: B(u.token) ? globalThis.String(u.token) : ""}
  7938. }, toJSON(u) {
  7939. const e = {};
  7940. return u.token !== "" && (e.token = u.token), e
  7941. }, create(u) {
  7942. return o0.fromPartial(u != null ? u : {})
  7943. }, fromPartial(u) {
  7944. var i;
  7945. const e = Mt();
  7946. return e.token = (i = u.token) != null ? i : "", e
  7947. }
  7948. };
  7949. function Lt() {
  7950. return {
  7951. register_peer: void 0,
  7952. register_peer_response: void 0,
  7953. punch_hole_request: void 0,
  7954. punch_hole: void 0,
  7955. punch_hole_sent: void 0,
  7956. punch_hole_response: void 0,
  7957. fetch_local_addr: void 0,
  7958. local_addr: void 0,
  7959. configure_update: void 0,
  7960. register_pk: void 0,
  7961. register_pk_response: void 0,
  7962. software_update: void 0,
  7963. request_relay: void 0,
  7964. relay_response: void 0,
  7965. test_nat_request: void 0,
  7966. test_nat_response: void 0,
  7967. peer_discovery: void 0,
  7968. online_request: void 0,
  7969. online_response: void 0,
  7970. key_exchange: void 0,
  7971. hc: void 0
  7972. }
  7973. }
  7974. const t4 = {
  7975. encode(u, e = r.Writer.create()) {
  7976. return u.register_peer !== void 0 && me.encode(u.register_peer, e.uint32(50).fork()).ldelim(), u.register_peer_response !== void 0 && Fe.encode(u.register_peer_response, e.uint32(58).fork()).ldelim(), u.punch_hole_request !== void 0 && t0.encode(u.punch_hole_request, e.uint32(66).fork()).ldelim(), u.punch_hole !== void 0 && _e.encode(u.punch_hole, e.uint32(74).fork()).ldelim(), u.punch_hole_sent !== void 0 && ke.encode(u.punch_hole_sent, e.uint32(82).fork()).ldelim(), u.punch_hole_response !== void 0 && xe.encode(u.punch_hole_response, e.uint32(90).fork()).ldelim(), u.fetch_local_addr !== void 0 && we.encode(u.fetch_local_addr, e.uint32(98).fork()).ldelim(), u.local_addr !== void 0 && Se.encode(u.local_addr, e.uint32(106).fork()).ldelim(), u.configure_update !== void 0 && ou.encode(u.configure_update, e.uint32(114).fork()).ldelim(), u.register_pk !== void 0 && he.encode(u.register_pk, e.uint32(122).fork()).ldelim(), u.register_pk_response !== void 0 && fe.encode(u.register_pk_response, e.uint32(130).fork()).ldelim(), u.software_update !== void 0 && be.encode(u.software_update, e.uint32(138).fork()).ldelim(), u.request_relay !== void 0 && a0.encode(u.request_relay, e.uint32(146).fork()).ldelim(), u.relay_response !== void 0 && ye.encode(u.relay_response, e.uint32(154).fork()).ldelim(), u.test_nat_request !== void 0 && ve.encode(u.test_nat_request, e.uint32(162).fork()).ldelim(), u.test_nat_response !== void 0 && ge.encode(u.test_nat_response, e.uint32(170).fork()).ldelim(), u.peer_discovery !== void 0 && ze.encode(u.peer_discovery, e.uint32(178).fork()).ldelim(), u.online_request !== void 0 && n0.encode(u.online_request, e.uint32(186).fork()).ldelim(), u.online_response !== void 0 && Pe.encode(u.online_response, e.uint32(194).fork()).ldelim(), u.key_exchange !== void 0 && Re.encode(u.key_exchange, e.uint32(202).fork()).ldelim(), u.hc !== void 0 && o0.encode(u.hc, e.uint32(210).fork()).ldelim(), e
  7977. }, decode(u, e) {
  7978. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  7979. let n = e === void 0 ? i.len : i.pos + e;
  7980. const a = Lt();
  7981. for (; i.pos < n;) {
  7982. const t = i.uint32();
  7983. switch (t >>> 3) {
  7984. case 6:
  7985. if (t !== 50) break;
  7986. a.register_peer = me.decode(i, i.uint32());
  7987. continue;
  7988. case 7:
  7989. if (t !== 58) break;
  7990. a.register_peer_response = Fe.decode(i, i.uint32());
  7991. continue;
  7992. case 8:
  7993. if (t !== 66) break;
  7994. a.punch_hole_request = t0.decode(i, i.uint32());
  7995. continue;
  7996. case 9:
  7997. if (t !== 74) break;
  7998. a.punch_hole = _e.decode(i, i.uint32());
  7999. continue;
  8000. case 10:
  8001. if (t !== 82) break;
  8002. a.punch_hole_sent = ke.decode(i, i.uint32());
  8003. continue;
  8004. case 11:
  8005. if (t !== 90) break;
  8006. a.punch_hole_response = xe.decode(i, i.uint32());
  8007. continue;
  8008. case 12:
  8009. if (t !== 98) break;
  8010. a.fetch_local_addr = we.decode(i, i.uint32());
  8011. continue;
  8012. case 13:
  8013. if (t !== 106) break;
  8014. a.local_addr = Se.decode(i, i.uint32());
  8015. continue;
  8016. case 14:
  8017. if (t !== 114) break;
  8018. a.configure_update = ou.decode(i, i.uint32());
  8019. continue;
  8020. case 15:
  8021. if (t !== 122) break;
  8022. a.register_pk = he.decode(i, i.uint32());
  8023. continue;
  8024. case 16:
  8025. if (t !== 130) break;
  8026. a.register_pk_response = fe.decode(i, i.uint32());
  8027. continue;
  8028. case 17:
  8029. if (t !== 138) break;
  8030. a.software_update = be.decode(i, i.uint32());
  8031. continue;
  8032. case 18:
  8033. if (t !== 146) break;
  8034. a.request_relay = a0.decode(i, i.uint32());
  8035. continue;
  8036. case 19:
  8037. if (t !== 154) break;
  8038. a.relay_response = ye.decode(i, i.uint32());
  8039. continue;
  8040. case 20:
  8041. if (t !== 162) break;
  8042. a.test_nat_request = ve.decode(i, i.uint32());
  8043. continue;
  8044. case 21:
  8045. if (t !== 170) break;
  8046. a.test_nat_response = ge.decode(i, i.uint32());
  8047. continue;
  8048. case 22:
  8049. if (t !== 178) break;
  8050. a.peer_discovery = ze.decode(i, i.uint32());
  8051. continue;
  8052. case 23:
  8053. if (t !== 186) break;
  8054. a.online_request = n0.decode(i, i.uint32());
  8055. continue;
  8056. case 24:
  8057. if (t !== 194) break;
  8058. a.online_response = Pe.decode(i, i.uint32());
  8059. continue;
  8060. case 25:
  8061. if (t !== 202) break;
  8062. a.key_exchange = Re.decode(i, i.uint32());
  8063. continue;
  8064. case 26:
  8065. if (t !== 210) break;
  8066. a.hc = o0.decode(i, i.uint32());
  8067. continue
  8068. }
  8069. if ((t & 7) === 4 || t === 0) break;
  8070. i.skipType(t & 7)
  8071. }
  8072. return a
  8073. }, fromJSON(u) {
  8074. return {
  8075. register_peer: B(u.register_peer) ? me.fromJSON(u.register_peer) : void 0,
  8076. register_peer_response: B(u.register_peer_response) ? Fe.fromJSON(u.register_peer_response) : void 0,
  8077. punch_hole_request: B(u.punch_hole_request) ? t0.fromJSON(u.punch_hole_request) : void 0,
  8078. punch_hole: B(u.punch_hole) ? _e.fromJSON(u.punch_hole) : void 0,
  8079. punch_hole_sent: B(u.punch_hole_sent) ? ke.fromJSON(u.punch_hole_sent) : void 0,
  8080. punch_hole_response: B(u.punch_hole_response) ? xe.fromJSON(u.punch_hole_response) : void 0,
  8081. fetch_local_addr: B(u.fetch_local_addr) ? we.fromJSON(u.fetch_local_addr) : void 0,
  8082. local_addr: B(u.local_addr) ? Se.fromJSON(u.local_addr) : void 0,
  8083. configure_update: B(u.configure_update) ? ou.fromJSON(u.configure_update) : void 0,
  8084. register_pk: B(u.register_pk) ? he.fromJSON(u.register_pk) : void 0,
  8085. register_pk_response: B(u.register_pk_response) ? fe.fromJSON(u.register_pk_response) : void 0,
  8086. software_update: B(u.software_update) ? be.fromJSON(u.software_update) : void 0,
  8087. request_relay: B(u.request_relay) ? a0.fromJSON(u.request_relay) : void 0,
  8088. relay_response: B(u.relay_response) ? ye.fromJSON(u.relay_response) : void 0,
  8089. test_nat_request: B(u.test_nat_request) ? ve.fromJSON(u.test_nat_request) : void 0,
  8090. test_nat_response: B(u.test_nat_response) ? ge.fromJSON(u.test_nat_response) : void 0,
  8091. peer_discovery: B(u.peer_discovery) ? ze.fromJSON(u.peer_discovery) : void 0,
  8092. online_request: B(u.online_request) ? n0.fromJSON(u.online_request) : void 0,
  8093. online_response: B(u.online_response) ? Pe.fromJSON(u.online_response) : void 0,
  8094. key_exchange: B(u.key_exchange) ? Re.fromJSON(u.key_exchange) : void 0,
  8095. hc: B(u.hc) ? o0.fromJSON(u.hc) : void 0
  8096. }
  8097. }, toJSON(u) {
  8098. const e = {};
  8099. return u.register_peer !== void 0 && (e.register_peer = me.toJSON(u.register_peer)), u.register_peer_response !== void 0 && (e.register_peer_response = Fe.toJSON(u.register_peer_response)), u.punch_hole_request !== void 0 && (e.punch_hole_request = t0.toJSON(u.punch_hole_request)), u.punch_hole !== void 0 && (e.punch_hole = _e.toJSON(u.punch_hole)), u.punch_hole_sent !== void 0 && (e.punch_hole_sent = ke.toJSON(u.punch_hole_sent)), u.punch_hole_response !== void 0 && (e.punch_hole_response = xe.toJSON(u.punch_hole_response)), u.fetch_local_addr !== void 0 && (e.fetch_local_addr = we.toJSON(u.fetch_local_addr)), u.local_addr !== void 0 && (e.local_addr = Se.toJSON(u.local_addr)), u.configure_update !== void 0 && (e.configure_update = ou.toJSON(u.configure_update)), u.register_pk !== void 0 && (e.register_pk = he.toJSON(u.register_pk)), u.register_pk_response !== void 0 && (e.register_pk_response = fe.toJSON(u.register_pk_response)), u.software_update !== void 0 && (e.software_update = be.toJSON(u.software_update)), u.request_relay !== void 0 && (e.request_relay = a0.toJSON(u.request_relay)), u.relay_response !== void 0 && (e.relay_response = ye.toJSON(u.relay_response)), u.test_nat_request !== void 0 && (e.test_nat_request = ve.toJSON(u.test_nat_request)), u.test_nat_response !== void 0 && (e.test_nat_response = ge.toJSON(u.test_nat_response)), u.peer_discovery !== void 0 && (e.peer_discovery = ze.toJSON(u.peer_discovery)), u.online_request !== void 0 && (e.online_request = n0.toJSON(u.online_request)), u.online_response !== void 0 && (e.online_response = Pe.toJSON(u.online_response)), u.key_exchange !== void 0 && (e.key_exchange = Re.toJSON(u.key_exchange)), u.hc !== void 0 && (e.hc = o0.toJSON(u.hc)), e
  8100. }, create(u) {
  8101. return t4.fromPartial(u != null ? u : {})
  8102. }, fromPartial(u) {
  8103. const e = Lt();
  8104. return e.register_peer = u.register_peer !== void 0 && u.register_peer !== null ? me.fromPartial(u.register_peer) : void 0, e.register_peer_response = u.register_peer_response !== void 0 && u.register_peer_response !== null ? Fe.fromPartial(u.register_peer_response) : void 0, e.punch_hole_request = u.punch_hole_request !== void 0 && u.punch_hole_request !== null ? t0.fromPartial(u.punch_hole_request) : void 0, e.punch_hole = u.punch_hole !== void 0 && u.punch_hole !== null ? _e.fromPartial(u.punch_hole) : void 0, e.punch_hole_sent = u.punch_hole_sent !== void 0 && u.punch_hole_sent !== null ? ke.fromPartial(u.punch_hole_sent) : void 0, e.punch_hole_response = u.punch_hole_response !== void 0 && u.punch_hole_response !== null ? xe.fromPartial(u.punch_hole_response) : void 0, e.fetch_local_addr = u.fetch_local_addr !== void 0 && u.fetch_local_addr !== null ? we.fromPartial(u.fetch_local_addr) : void 0, e.local_addr = u.local_addr !== void 0 && u.local_addr !== null ? Se.fromPartial(u.local_addr) : void 0, e.configure_update = u.configure_update !== void 0 && u.configure_update !== null ? ou.fromPartial(u.configure_update) : void 0, e.register_pk = u.register_pk !== void 0 && u.register_pk !== null ? he.fromPartial(u.register_pk) : void 0, e.register_pk_response = u.register_pk_response !== void 0 && u.register_pk_response !== null ? fe.fromPartial(u.register_pk_response) : void 0, e.software_update = u.software_update !== void 0 && u.software_update !== null ? be.fromPartial(u.software_update) : void 0, e.request_relay = u.request_relay !== void 0 && u.request_relay !== null ? a0.fromPartial(u.request_relay) : void 0, e.relay_response = u.relay_response !== void 0 && u.relay_response !== null ? ye.fromPartial(u.relay_response) : void 0, e.test_nat_request = u.test_nat_request !== void 0 && u.test_nat_request !== null ? ve.fromPartial(u.test_nat_request) : void 0, e.test_nat_response = u.test_nat_response !== void 0 && u.test_nat_response !== null ? ge.fromPartial(u.test_nat_response) : void 0, e.peer_discovery = u.peer_discovery !== void 0 && u.peer_discovery !== null ? ze.fromPartial(u.peer_discovery) : void 0, e.online_request = u.online_request !== void 0 && u.online_request !== null ? n0.fromPartial(u.online_request) : void 0, e.online_response = u.online_response !== void 0 && u.online_response !== null ? Pe.fromPartial(u.online_response) : void 0, e.key_exchange = u.key_exchange !== void 0 && u.key_exchange !== null ? Re.fromPartial(u.key_exchange) : void 0, e.hc = u.hc !== void 0 && u.hc !== null ? o0.fromPartial(u.hc) : void 0, e
  8105. }
  8106. };
  8107. function z(u) {
  8108. if (globalThis.Buffer) return Uint8Array.from(globalThis.Buffer.from(u, "base64"));
  8109. {
  8110. const e = globalThis.atob(u), i = new Uint8Array(e.length);
  8111. for (let n = 0; n < e.length; ++n) i[n] = e.charCodeAt(n);
  8112. return i
  8113. }
  8114. }
  8115. function P(u) {
  8116. if (globalThis.Buffer) return globalThis.Buffer.from(u).toString("base64");
  8117. {
  8118. const e = [];
  8119. return u.forEach(i => {
  8120. e.push(globalThis.String.fromCharCode(i))
  8121. }), globalThis.btoa(e.join(""))
  8122. }
  8123. }
  8124. function B(u) {
  8125. return u != null
  8126. }
  8127. class l4 {
  8128. constructor(e, i = !0, n = "") {
  8129. l(this, "_websocket");
  8130. l(this, "_eventHandlers");
  8131. l(this, "_buf");
  8132. l(this, "_status");
  8133. l(this, "_latency");
  8134. l(this, "_secretKey");
  8135. l(this, "_uri");
  8136. l(this, "_isRendezvous");
  8137. l(this, "_recvDataCount");
  8138. l(this, "_tag");
  8139. l(this, "_isProcessing");
  8140. this._eventHandlers = {
  8141. message: void 0,
  8142. open: void 0,
  8143. close: void 0,
  8144. error: void 0,
  8145. status_change: void 0
  8146. }, 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
  8147. }
  8148. resetRecvDataCount() {
  8149. this._recvDataCount = 0
  8150. }
  8151. getRecvDataCount() {
  8152. return this._recvDataCount
  8153. }
  8154. latency() {
  8155. return this._latency
  8156. }
  8157. setSecretKey(e) {
  8158. this._secretKey = [e, 0, 0]
  8159. }
  8160. sendMessage(e) {
  8161. let i = ru.encode(ru.fromPartial(e)).finish(), n = this._secretKey;
  8162. n && (n[1] += 1, i = sa(i, n[1], n[0])), this._websocket.send(i)
  8163. }
  8164. sendRendezvous(e) {
  8165. this._websocket.send(t4.encode(t4.fromPartial(e)).finish())
  8166. }
  8167. sendBytes(e) {
  8168. let i = this._secretKey;
  8169. i && (i[1] += 1, e = sa(e, i[1], i[0])), this._websocket.send(e)
  8170. }
  8171. parseMessage(e) {
  8172. return ru.decode(e)
  8173. }
  8174. parseRendezvous(e) {
  8175. return t4.decode(e)
  8176. }
  8177. off(e) {
  8178. this._eventHandlers[e] = void 0
  8179. }
  8180. on(e, i) {
  8181. this._eventHandlers[e] = i
  8182. }
  8183. setStatus(e) {
  8184. this._status = e, this._eventHandlers.status_change && this._eventHandlers.status_change(e)
  8185. }
  8186. async open(e = 12e3) {
  8187. return new Promise((i, n) => {
  8188. setTimeout(() => {
  8189. this._status != "open" && n(this._status || "Timeout")
  8190. }, e), this._websocket.onopen = () => {
  8191. var a;
  8192. 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)
  8193. }, this._websocket.onclose = a => {
  8194. 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")
  8195. }, this._websocket.onerror = a => {
  8196. if (!this._status) {
  8197. n("Failed to connect to " + (this._isRendezvous ? "rendezvous" : "relay") + " server, " + this._uri);
  8198. return
  8199. }
  8200. this.setStatus(a), console.error("WebSock.onerror: " + this._tag), console.error(a), this._eventHandlers.error && this._eventHandlers.error(a)
  8201. }
  8202. })
  8203. }
  8204. async next(e = 12e3) {
  8205. let i = this._eventHandlers.message;
  8206. this.off("message");
  8207. try {
  8208. let n = await this._next(e);
  8209. return this.on("message", i), n
  8210. } catch (n) {
  8211. throw this.on("message", i), n
  8212. }
  8213. }
  8214. async _next(e = 12e3) {
  8215. const i = (n, a, t) => {
  8216. if (this._buf.length) n(this._buf[0]), this._buf.splice(0, 1); else {
  8217. if (this._status != "open") {
  8218. a(this._status);
  8219. return
  8220. }
  8221. new Date().getTime() > t + e ? a("Timeout") : setTimeout(() => i(n, a, t), 1)
  8222. }
  8223. };
  8224. return new Promise((n, a) => {
  8225. i(n, a, new Date().getTime())
  8226. })
  8227. }
  8228. close() {
  8229. 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 = () => {
  8230. })
  8231. }
  8232. _recv_message(e) {
  8233. if (e.data instanceof window.ArrayBuffer) {
  8234. let i = new Uint8Array(e.data);
  8235. this._recvDataCount += i.length;
  8236. const n = this._secretKey;
  8237. n && (n[2] += 1, i = xs(i, n[2], n[0]));
  8238. let a;
  8239. 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())
  8240. }
  8241. }
  8242. async processQueue() {
  8243. this._isProcessing = !0;
  8244. try {
  8245. for (; this._buf.length > 0 && this._eventHandlers.message;) {
  8246. const e = this._buf.shift();
  8247. await this._eventHandlers.message(e)
  8248. }
  8249. } catch (e) {
  8250. console.log("Error in processQueue: " + e)
  8251. }
  8252. this._isProcessing = !1
  8253. }
  8254. }
  8255. let ku = null;
  8256. const Wt = ".";
  8257. var iu, gu, D0, v4, Cu, g4, pa, Ye;
  8258. class On {
  8259. constructor() {
  8260. _u(this, g4);
  8261. _u(this, iu, null);
  8262. _u(this, gu, {});
  8263. _u(this, D0, {});
  8264. _u(this, v4, 0);
  8265. _u(this, Cu, []);
  8266. _u(this, Ye, async (e, i) => {
  8267. const n = await (await fetch(e)).arrayBuffer(), a = new Blob([n], {type: i});
  8268. return URL.createObjectURL(a)
  8269. })
  8270. }
  8271. async load() {
  8272. if (!h(this, iu)) {
  8273. Ue(this, iu, new Worker("./ffmpeg.js?v=dddac33a", {type: "module"})), m3(this, g4, pa).call(this);
  8274. const e = await h(this, Ye).call(this, `${Wt}/ffmpeg-core.js?v=16fa4bb1`, "text/javascript"),
  8275. i = await h(this, Ye).call(this, `${Wt}/ffmpeg-core.wasm?v=241ebe18`, "application/wasm");
  8276. return this.send({type: "LOAD", data: {coreURL: e, wasmURL: i}})
  8277. }
  8278. }
  8279. async decode(e, i) {
  8280. let n = [i];
  8281. var a = null;
  8282. return h(this, Cu).length > 0 && (a = h(this, Cu).pop(), n.push(a)), this.send({
  8283. type: "DECODE",
  8284. data: {codec: e, data: i, arrayBuffer: a}
  8285. }, n)
  8286. }
  8287. async send({type: e, data: i}, n) {
  8288. return h(this, iu) ? new Promise((a, t) => {
  8289. const s = A3(this, v4)._++;
  8290. h(this, gu)[s] = a, h(this, D0)[s] = t, h(this, iu).postMessage({id: s, type: e, data: i}, n)
  8291. }) : Promise.reject("FFmpeg not loaded")
  8292. }
  8293. close() {
  8294. h(this, iu) && (this.send({type: "CLOSE", data: {}}), h(this, iu).terminate(), Ue(this, iu, null))
  8295. }
  8296. }
  8297. iu = new WeakMap, gu = new WeakMap, D0 = new WeakMap, v4 = new WeakMap, Cu = new WeakMap, g4 = new WeakSet, pa = function () {
  8298. h(this, iu).onmessage = ({data: {id: e, type: i, data: n}}) => {
  8299. i == "LOAD" ? (console.log("FFmpeg loaded"), h(this, gu)[e](n)) : i == "DECODE" ? (h(this, Cu).push(n.data.data), h(this, Cu).length > 8 && h(this, Cu).shift(), h(this, gu)[e](n)) : i == "CLOSE" ? (Ue(this, Cu, []), h(this, gu)[e](n)) : i == "ERROR" ? h(this, D0)[e](n) : h(this, D0)[e](n), delete h(this, gu)[e], delete h(this, D0)[e]
  8300. }
  8301. }, Ye = new WeakMap;
  8302. async function Un() {
  8303. try {
  8304. return ku = new On, ku ? ku.load() : Promise.reject("Failed to create FFmpeg instance")
  8305. } catch (u) {
  8306. return console.log("Failed to load FFmpeg", u), Promise.reject("Failed to load FFmpeg")
  8307. }
  8308. }
  8309. async function Mn(u, e) {
  8310. return ku ? ku.decode(u, e) : Promise.reject("FFmpeg is uninitialized")
  8311. }
  8312. async function Ln() {
  8313. ku && (ku.close(), ku = null)
  8314. }
  8315. const Wn = "Desktop session not ready", Vn = "Desktop xsession failed", qn = "Desktop session another user login",
  8316. Kn = "Desktop xorg not found", Hn = "Desktop none", Jn = "Desktop session not ready, password empty",
  8317. Gn = "Desktop session not ready, password wrong", Zn = "Empty Password", Qn = "Wrong Password",
  8318. Xn = "Wrong 2FA Code", Vt = "2FA Required", Yn = "No Password Access", $n = "Wayland login screen is not supported",
  8319. uo = "x11 expected", Aa = "https://rustdesk.com/docs/en/manual/linux/#x11-required",
  8320. eo = "https://rustdesk.com/docs/en/", io = Aa,
  8321. to = "https://github.com/rustdesk/rustdesk/wiki/Headless-Linux-Support",
  8322. qt = {"rustdesk docs home": eo, "rustdesk docs x11-required": io, "rustdesk x11 headless": to},
  8323. Kt = "Input source 1", ao = "map", Ht = "translate", no = "ShiftLeft", oo = "ShiftRight", qe = "ControlLeft",
  8324. ma = "ControlRight", J4 = "AltLeft", Fa = "AltRight", _a = "MetaLeft", va = "MetaRight", x4 = "Windows",
  8325. G4 = "Linux", Z4 = "Mac OS", ga = "Android", ro = "iOS", so = "web", Eo = "ISO", lo = 1, Do = 2, Jt = 3, Gt = 4,
  8326. $e = 1, u4 = 2, Bo = 4, co = 8, Co = 16, z4 = "public", Zt = "OeVuKk5nlHiXp+APNn0Y3pC1Iwpwn44JGqrQCsWqmBw=",
  8327. po = 1e3, Ao = 6e4, O4 = lang, mo = langIds;
  8328. function Fo(u, e, i, n) {
  8329. return u == "error" && e == "Connection Error" && ((i.indexOf("10054") < 0 || i.indexOf("104") < 0) && n || i.toLowerCase().indexOf("offline") < 0 && i.toLowerCase().indexOf("not 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)
  8330. }
  8331. const _o = {
  8332. VK_A: "a",
  8333. VK_B: "b",
  8334. VK_C: "c",
  8335. VK_D: "d",
  8336. VK_E: "e",
  8337. VK_F: "f",
  8338. VK_G: "g",
  8339. VK_H: "h",
  8340. VK_I: "i",
  8341. VK_J: "j",
  8342. VK_K: "k",
  8343. VK_L: "l",
  8344. VK_M: "m",
  8345. VK_N: "n",
  8346. VK_O: "o",
  8347. VK_P: "p",
  8348. VK_Q: "q",
  8349. VK_R: "r",
  8350. VK_S: "s",
  8351. VK_T: "t",
  8352. VK_U: "u",
  8353. VK_V: "v",
  8354. VK_W: "w",
  8355. VK_X: "x",
  8356. VK_Y: "y",
  8357. VK_Z: "z",
  8358. VK_0: "0",
  8359. VK_1: "1",
  8360. VK_2: "2",
  8361. VK_3: "3",
  8362. VK_4: "4",
  8363. VK_5: "5",
  8364. VK_6: "6",
  8365. VK_7: "7",
  8366. VK_8: "8",
  8367. VK_9: "9",
  8368. VK_COMMA: ",",
  8369. VK_SLASH: "/",
  8370. VK_SEMICOLON: ";",
  8371. VK_QUOTE: "'",
  8372. VK_LBRACKET: "[",
  8373. VK_RBRACKET: "]",
  8374. VK_BACKSLASH: "\\",
  8375. VK_MINUS: "-",
  8376. VK_PLUS: "=",
  8377. VK_DIVIDE: "Divide",
  8378. VK_MULTIPLY: "Multiply",
  8379. VK_SUBTRACT: "Subtract",
  8380. VK_ADD: "Add",
  8381. VK_DECIMAL: "Decimal",
  8382. VK_F1: "F1",
  8383. VK_F2: "F2",
  8384. VK_F3: "F3",
  8385. VK_F4: "F4",
  8386. VK_F5: "F5",
  8387. VK_F6: "F6",
  8388. VK_F7: "F7",
  8389. VK_F8: "F8",
  8390. VK_F9: "F9",
  8391. VK_F10: "F10",
  8392. VK_F11: "F11",
  8393. VK_F12: "F12",
  8394. VK_ENTER: "Return",
  8395. VK_CANCEL: "Cancel",
  8396. VK_BACK: "Backspace",
  8397. VK_TAB: "Tab",
  8398. VK_CLEAR: "Clear",
  8399. VK_RETURN: "Return",
  8400. VK_SHIFT: "Shift",
  8401. VK_CONTROL: "Control",
  8402. VK_MENU: "Alt",
  8403. VK_PAUSE: "Pause",
  8404. VK_CAPITAL: "CapsLock",
  8405. VK_KANA: "Kana",
  8406. VK_HANGUL: "Hangul",
  8407. VK_JUNJA: "Junja",
  8408. VK_FINAL: "Final",
  8409. VK_HANJA: "Hanja",
  8410. VK_KANJI: "Kanji",
  8411. VK_ESCAPE: "Escape",
  8412. VK_CONVERT: "Convert",
  8413. VK_SPACE: "Space",
  8414. VK_PRIOR: "PageUp",
  8415. VK_NEXT: "PageDown",
  8416. VK_END: "End",
  8417. VK_HOME: "Home",
  8418. VK_LEFT: "LeftArrow",
  8419. VK_UP: "UpArrow",
  8420. VK_RIGHT: "RightArrow",
  8421. VK_DOWN: "DownArrow",
  8422. VK_SELECT: "Select",
  8423. VK_PRINT: "Print",
  8424. VK_EXECUTE: "Execute",
  8425. VK_SNAPSHOT: "Snapshot",
  8426. VK_SCROLL: "Scroll",
  8427. VK_INSERT: "Insert",
  8428. VK_DELETE: "Delete",
  8429. VK_HELP: "Help",
  8430. VK_SLEEP: "Sleep",
  8431. VK_SEPARATOR: "Separator",
  8432. VK_NUMPAD0: "Numpad0",
  8433. VK_NUMPAD1: "Numpad1",
  8434. VK_NUMPAD2: "Numpad2",
  8435. VK_NUMPAD3: "Numpad3",
  8436. VK_NUMPAD4: "Numpad4",
  8437. VK_NUMPAD5: "Numpad5",
  8438. VK_NUMPAD6: "Numpad6",
  8439. VK_NUMPAD7: "Numpad7",
  8440. VK_NUMPAD8: "Numpad8",
  8441. VK_NUMPAD9: "Numpad9",
  8442. Apps: "Apps",
  8443. Meta: "Meta",
  8444. RAlt: "RAlt",
  8445. RWin: "RWin",
  8446. RControl: "RControl",
  8447. RShift: "RShift",
  8448. CTRL_ALT_DEL: "CtrlAltDel",
  8449. LOCK_SCREEN: "LockScreen"
  8450. }, U4 = "1.4.2", vo = "2025-09-07 17:24";
  8451. class _ {
  8452. static setItem(e, i) {
  8453. localStorage.setItem(this.prefix + e, i)
  8454. }
  8455. static getItem(e) {
  8456. return localStorage.getItem(this.prefix + e)
  8457. }
  8458. static removeItem(e) {
  8459. localStorage.removeItem(this.prefix + e)
  8460. }
  8461. static clear() {
  8462. for (let e = localStorage.length - 1; e >= 0; e--) {
  8463. const i = localStorage.key(e);
  8464. i && i.startsWith(this.prefix) && localStorage.removeItem(i)
  8465. }
  8466. }
  8467. }
  8468. l(_, "prefix", "wc-");
  8469. class K {
  8470. static async init() {
  8471. if (!this.db) return new Promise((e, i) => {
  8472. const n = indexedDB.open(this.dbName, 1);
  8473. n.onupgradeneeded = a => {
  8474. const t = a.target.result;
  8475. t.objectStoreNames.contains(this.storeName) || t.createObjectStore(this.storeName)
  8476. }, n.onsuccess = async a => {
  8477. this.db = a.target.result;
  8478. try {
  8479. await this.loadCache(), e()
  8480. } catch (t) {
  8481. i(t)
  8482. }
  8483. }, n.onerror = a => {
  8484. i(a.target.error)
  8485. }
  8486. })
  8487. }
  8488. static async loadCache() {
  8489. return new Promise((e, i) => {
  8490. const a = this.db.transaction([this.storeName], "readonly").objectStore(this.storeName), t = a.getAllKeys();
  8491. t.onsuccess = s => {
  8492. const D = s.target.result.map(d => new Promise((C, c) => {
  8493. const p = a.get(d);
  8494. p.onsuccess = F => {
  8495. this.cache[d] = F.target.result, C()
  8496. }, p.onerror = F => {
  8497. c(F.target.error)
  8498. }
  8499. }));
  8500. Promise.all(D).then(() => e()).catch(i)
  8501. }, t.onerror = s => {
  8502. i(s.target.error)
  8503. }
  8504. })
  8505. }
  8506. static setItem(e, i) {
  8507. this.cache[this.prefix + e] = i;
  8508. try {
  8509. if (!this.db) {
  8510. console.warn("IndexedDB not initialized, storing in cache only");
  8511. return
  8512. }
  8513. const t = this.db.transaction([this.storeName], "readwrite").objectStore(this.storeName).put(i, this.prefix + e);
  8514. t.onerror = s => {
  8515. console.error("IndexedDB setItem error:", s.target.error)
  8516. }
  8517. } catch (n) {
  8518. console.warn("Failed to persist to IndexedDB:", n)
  8519. }
  8520. }
  8521. static getItem(e) {
  8522. var i;
  8523. return (i = this.cache[this.prefix + e]) != null ? i : null
  8524. }
  8525. static removeItem(e) {
  8526. delete this.cache[this.prefix + e];
  8527. try {
  8528. if (!this.db) {
  8529. console.warn("IndexedDB not initialized, removing from cache only");
  8530. return
  8531. }
  8532. const a = this.db.transaction([this.storeName], "readwrite").objectStore(this.storeName).delete(this.prefix + e);
  8533. a.onerror = t => {
  8534. console.error("IndexedDB removeItem error:", t.target.error)
  8535. }
  8536. } catch (i) {
  8537. console.warn("Failed to remove from IndexedDB:", i)
  8538. }
  8539. }
  8540. static clear() {
  8541. this.cache = {};
  8542. const n = this.db.transaction([this.storeName], "readwrite").objectStore(this.storeName).clear();
  8543. n.onerror = a => {
  8544. console.error("IndexedDB clear error:", a.target.error)
  8545. }
  8546. }
  8547. }
  8548. l(K, "dbName", "wc-database"), l(K, "storeName", "wc-store"), l(K, "prefix", "wc-"), l(K, "db", null), l(K, "cache", {});
  8549. const mu = () => {
  8550. try {
  8551. return JSON.parse(K.getItem("peers")) || {}
  8552. } catch {
  8553. return {}
  8554. }
  8555. }, Q4 = u => {
  8556. K.setItem("peers", JSON.stringify(u))
  8557. }, go = u => {
  8558. const e = mu();
  8559. delete e[u], Q4(e)
  8560. }, M4 = u => mu()[u], ko = (u, e) => {
  8561. const i = mu();
  8562. i[u] = e, Q4(i)
  8563. }, ho = (u, e) => {
  8564. var n;
  8565. return (n = M4(u)[e]) != null ? n : d0(e)
  8566. }, ka = (u, e, i) => {
  8567. const n = mu(), a = n[u] || {};
  8568. i == null ? delete a[e] : a[e] = i, a.tm = new Date().getTime(), n[u] = a, Q4(n)
  8569. }, X4 = u => _.getItem(`option:local:${u}`), D4 = (u, e) => {
  8570. _.setItem(`option:local:${u}`, e)
  8571. }, fo = u => _.getItem(`option:flutter:local:${u}`), xo = (u, e) => {
  8572. _.setItem(`option:flutter:local:${u}`, e)
  8573. }, ha = async u => {
  8574. const e = Qa(), i = E0.publicKey, n = y4(0), a = e.from_string(u), t = await un(a),
  8575. s = e.crypto_secretbox_easy(t, n, i);
  8576. return q(s)
  8577. }, fa = async u => {
  8578. const e = Qa(), i = E0.publicKey, n = Ie(u), a = e.crypto_secretbox_open_easy(n, y4(0), i), t = await en(a);
  8579. return e.to_string(t)
  8580. }, yo = async u => {
  8581. let e = await ha(u);
  8582. K.setItem("ab", e)
  8583. }, xa = async () => {
  8584. try {
  8585. let u = K.getItem("ab");
  8586. if (u) return JSON.parse(await fa(u))
  8587. } catch (u) {
  8588. console.error("loadAb error", u)
  8589. }
  8590. return {access_token: "", ab_entries: []}
  8591. }, bo = () => {
  8592. K.removeItem("ab")
  8593. }, wo = async u => {
  8594. let e = await ha(u);
  8595. K.setItem("group", e)
  8596. }, So = async () => {
  8597. try {
  8598. let u = K.getItem("group");
  8599. if (u) return JSON.parse(await fa(u))
  8600. } catch (u) {
  8601. console.error("loadGroup error", u)
  8602. }
  8603. return {access_token: "", users: [], peers: []}
  8604. }, zo = () => {
  8605. K.removeItem("group")
  8606. }, Po = u => u.name == "My address book" || u.name == "Legacy address book";
  8607. var ya = wa();
  8608. function Ro() {
  8609. ya = wa()
  8610. }
  8611. const Ge = {}, ba = {};
  8612. function Io(u) {
  8613. const e = /\{(.*?)\}/, i = u.match(e);
  8614. if (i && i[1] !== void 0) {
  8615. const n = u.replace(e, "{}"), a = i[1];
  8616. return [n, a]
  8617. }
  8618. return [u, null]
  8619. }
  8620. function To(u, e) {
  8621. var D;
  8622. let i = (ya || "").toLowerCase();
  8623. i || (u = u.toLowerCase(), u.startsWith("zh") ? i = u.includes("tw") ? "zh-tw" : "zh-cn" : i = ((D = u.split("-")[0]) == null ? void 0 : D.split("_")[0]) || "en");
  8624. const [n, a] = Io(e);
  8625. let t = O4[i];
  8626. const s = O4.en;
  8627. let E = "";
  8628. return t && t[n] ? E = t[n] : i !== "en" && s[n] ? E = s[n] : E = n, a !== null && (E = E.replace("{}", a)), E
  8629. }
  8630. const No = "z".charCodeAt(0), jo = "a".charCodeAt(0);
  8631. function Oo(u, e) {
  8632. const i = _o[u] || u;
  8633. if (i.length == 1) {
  8634. const a = i.charCodeAt(0);
  8635. return !e && (a > No || a < jo) ? I.fromPartial({unicode: a}) : I.fromPartial({chr: a})
  8636. }
  8637. const n = Je(i);
  8638. return n == V.UNRECOGNIZED && console.error("Unknown control key " + i), I.fromPartial({control_key: n})
  8639. }
  8640. async function P4(u) {
  8641. await new Promise(e => setTimeout(e, u))
  8642. }
  8643. function wa() {
  8644. let u = _.getItem("option:local:lang");
  8645. if (u && (u.includes("-") && (u = u.split("-")[1]), u.includes("_") && (u = u.split("_")[1]), O4.hasOwnProperty(u))) return u;
  8646. try {
  8647. const e = window.location.search;
  8648. return new URLSearchParams(e).get("lang") || ""
  8649. } catch {
  8650. return ""
  8651. }
  8652. }
  8653. var E0 = {privateKey: new Uint8Array([]), publicKey: new Uint8Array([])};
  8654. async function Uo() {
  8655. try {
  8656. const u = "app-data";
  8657. try {
  8658. const i = _.getItem(u);
  8659. if (i) {
  8660. const n = JSON.parse(i);
  8661. if (E0 = {
  8662. privateKey: new Uint8Array(Ie(n.a)),
  8663. publicKey: new Uint8Array(Ie(n.b))
  8664. }, E0.publicKey.length === 32 && E0.privateKey.length === 64) return
  8665. }
  8666. } catch (i) {
  8667. console.error(i)
  8668. }
  8669. const e = await Mo();
  8670. _.setItem(u, JSON.stringify({a: q(e.privateKey), b: q(e.publicKey)})), E0 = e
  8671. } catch (u) {
  8672. console.error("failed to init key pair", u)
  8673. }
  8674. }
  8675. function q(u) {
  8676. return gs(u)
  8677. }
  8678. function Ie(u) {
  8679. return c0(u)
  8680. }
  8681. async function Mo() {
  8682. return await Is()
  8683. }
  8684. function Ze() {
  8685. return "web"
  8686. }
  8687. function Sa() {
  8688. return "web"
  8689. }
  8690. function Lo() {
  8691. const u = navigator.userAgent, e = u.match(/(firefox|msie|chrome|safari|trident)/i),
  8692. i = u.match(/(firefox|msie|chrome|safari|trident)[\/\s](\d+)/i);
  8693. return e ? `${e[0]} ${i ? i[2] : ""}` : "Unknown Browser"
  8694. }
  8695. function Y4() {
  8696. return q(E0.publicKey)
  8697. }
  8698. function Wo() {
  8699. return r0([Y4()])
  8700. }
  8701. function r0(u) {
  8702. const e = new ln.exports.Hash;
  8703. return u.forEach(i => (typeof i == "string" && (i = new TextEncoder().encode(i)), e.update(i))), e.digest()
  8704. }
  8705. function $4() {
  8706. const u = navigator.userAgent.toLowerCase();
  8707. return u.includes("win") ? x4 : u.includes("mac") ? Z4 : u.includes("linux") ? G4 : u.includes("android") ? ga : u.includes("iphone") || u.includes("ipad") ? ro : "Unknown OS"
  8708. }
  8709. async function Vo(u, e) {
  8710. for (let i = 0; i < 2; i++) {
  8711. const a = e === void 0 ? await u.next() : await u.next(e);
  8712. if (!(!a || (a == null ? void 0 : a.key_exchange))) return a
  8713. }
  8714. }
  8715. function za() {
  8716. return qo() || ba.key || void 0
  8717. }
  8718. function qo() {
  8719. return _.getItem("key") || void 0
  8720. }
  8721. function Pa() {
  8722. return _.getItem("option:local:access_token") || void 0
  8723. }
  8724. function Ko() {
  8725. return _.getItem("option:local:user_info") || void 0
  8726. }
  8727. function Ke() {
  8728. return l0
  8729. }
  8730. function Qt(u) {
  8731. ba.key = u
  8732. }
  8733. const u3 = {
  8734. Alt: 56,
  8735. AltGr: 57400,
  8736. Backspace: 14,
  8737. CapsLock: 58,
  8738. ControlLeft: 29,
  8739. ControlRight: 57373,
  8740. Delete: 57427,
  8741. UpArrow: 57416,
  8742. DownArrow: 57424,
  8743. LeftArrow: 57419,
  8744. RightArrow: 57421,
  8745. End: 57423,
  8746. Escape: 1,
  8747. F1: 59,
  8748. F2: 60,
  8749. F3: 61,
  8750. F4: 62,
  8751. F5: 63,
  8752. F6: 64,
  8753. F7: 65,
  8754. F8: 66,
  8755. F9: 67,
  8756. F10: 68,
  8757. F11: 87,
  8758. F12: 88,
  8759. F13: 100,
  8760. F14: 101,
  8761. F15: 102,
  8762. F16: 103,
  8763. F17: 104,
  8764. F18: 105,
  8765. F19: 106,
  8766. F20: 107,
  8767. F21: 108,
  8768. F22: 109,
  8769. F23: 110,
  8770. F24: 118,
  8771. Home: 57415,
  8772. MetaLeft: 57435,
  8773. PageDown: 57425,
  8774. PageUp: 57417,
  8775. Return: 28,
  8776. ShiftLeft: 42,
  8777. ShiftRight: 54,
  8778. Space: 57,
  8779. Tab: 15,
  8780. PrintScreen: 57399,
  8781. ScrollLock: 70,
  8782. NumLock: 69,
  8783. BackQuote: 41,
  8784. Num1: 2,
  8785. Num2: 3,
  8786. Num3: 4,
  8787. Num4: 5,
  8788. Num5: 6,
  8789. Num6: 7,
  8790. Num7: 8,
  8791. Num8: 9,
  8792. Num9: 10,
  8793. Num0: 11,
  8794. Minus: 12,
  8795. Equal: 13,
  8796. KeyQ: 16,
  8797. KeyW: 17,
  8798. KeyE: 18,
  8799. KeyR: 19,
  8800. KeyT: 20,
  8801. KeyY: 21,
  8802. KeyU: 22,
  8803. KeyI: 23,
  8804. KeyO: 24,
  8805. KeyP: 25,
  8806. LeftBracket: 26,
  8807. RightBracket: 27,
  8808. BackSlash: 43,
  8809. KeyA: 30,
  8810. KeyS: 31,
  8811. KeyD: 32,
  8812. KeyF: 33,
  8813. KeyG: 34,
  8814. KeyH: 35,
  8815. KeyJ: 36,
  8816. KeyK: 37,
  8817. KeyL: 38,
  8818. SemiColon: 39,
  8819. Quote: 40,
  8820. IntlBackslash: 86,
  8821. IntlRo: 115,
  8822. IntlYen: 125,
  8823. KanaMode: 112,
  8824. KeyZ: 44,
  8825. KeyX: 45,
  8826. KeyC: 46,
  8827. KeyV: 47,
  8828. KeyB: 48,
  8829. KeyN: 49,
  8830. KeyM: 50,
  8831. Comma: 51,
  8832. Dot: 52,
  8833. Slash: 53,
  8834. Insert: 57426,
  8835. KpMinus: 74,
  8836. KpPlus: 78,
  8837. KpMultiply: 55,
  8838. KpDivide: 57397,
  8839. KpDecimal: 83,
  8840. KpReturn: 57372,
  8841. KpEqual: 89,
  8842. KpComma: 126,
  8843. Kp0: 82,
  8844. Kp1: 79,
  8845. Kp2: 80,
  8846. Kp3: 81,
  8847. Kp4: 75,
  8848. Kp5: 76,
  8849. Kp6: 77,
  8850. Kp7: 71,
  8851. Kp8: 72,
  8852. Kp9: 73,
  8853. MetaRight: 57436,
  8854. Apps: 57437,
  8855. VolumeUp: 57392,
  8856. VolumeDown: 57390,
  8857. VolumeMute: 57376,
  8858. Lang1: 123,
  8859. Lang2: 121,
  8860. Lang3: 120,
  8861. Lang4: 119,
  8862. Lang5: 118,
  8863. Kana: 128,
  8864. Hanja: 241
  8865. }, Ho = {
  8866. Alt: 64,
  8867. AltGr: 108,
  8868. Backspace: 22,
  8869. CapsLock: 66,
  8870. ControlLeft: 37,
  8871. ControlRight: 105,
  8872. Delete: 119,
  8873. DownArrow: 116,
  8874. End: 115,
  8875. Escape: 9,
  8876. F1: 67,
  8877. F10: 76,
  8878. F11: 95,
  8879. F12: 96,
  8880. F13: 191,
  8881. F14: 192,
  8882. F15: 193,
  8883. F16: 194,
  8884. F17: 195,
  8885. F18: 196,
  8886. F19: 197,
  8887. F20: 198,
  8888. F21: 199,
  8889. F22: 200,
  8890. F23: 201,
  8891. F24: 202,
  8892. F2: 68,
  8893. F3: 69,
  8894. F4: 70,
  8895. F5: 71,
  8896. F6: 72,
  8897. F7: 73,
  8898. F8: 74,
  8899. F9: 75,
  8900. Home: 110,
  8901. LeftArrow: 113,
  8902. MetaLeft: 133,
  8903. PageDown: 117,
  8904. PageUp: 112,
  8905. Return: 36,
  8906. RightArrow: 114,
  8907. ShiftLeft: 50,
  8908. ShiftRight: 62,
  8909. Space: 65,
  8910. Tab: 23,
  8911. UpArrow: 111,
  8912. PrintScreen: 107,
  8913. ScrollLock: 78,
  8914. Pause: 127,
  8915. NumLock: 77,
  8916. BackQuote: 49,
  8917. Num1: 10,
  8918. Num2: 11,
  8919. Num3: 12,
  8920. Num4: 13,
  8921. Num5: 14,
  8922. Num6: 15,
  8923. Num7: 16,
  8924. Num8: 17,
  8925. Num9: 18,
  8926. Num0: 19,
  8927. Minus: 20,
  8928. Equal: 21,
  8929. KeyQ: 24,
  8930. KeyW: 25,
  8931. KeyE: 26,
  8932. KeyR: 27,
  8933. KeyT: 28,
  8934. KeyY: 29,
  8935. KeyU: 30,
  8936. KeyI: 31,
  8937. KeyO: 32,
  8938. KeyP: 33,
  8939. LeftBracket: 34,
  8940. RightBracket: 35,
  8941. KeyA: 38,
  8942. KeyS: 39,
  8943. KeyD: 40,
  8944. KeyF: 41,
  8945. KeyG: 42,
  8946. KeyH: 43,
  8947. KeyJ: 44,
  8948. KeyK: 45,
  8949. KeyL: 46,
  8950. SemiColon: 47,
  8951. Quote: 48,
  8952. BackSlash: 51,
  8953. IntlBackslash: 94,
  8954. IntlRo: 97,
  8955. IntlYen: 132,
  8956. KanaMode: 101,
  8957. KeyZ: 52,
  8958. KeyX: 53,
  8959. KeyC: 54,
  8960. KeyV: 55,
  8961. KeyB: 56,
  8962. KeyN: 57,
  8963. KeyM: 58,
  8964. Comma: 59,
  8965. Dot: 60,
  8966. Slash: 61,
  8967. Insert: 118,
  8968. KpDecimal: 91,
  8969. KpReturn: 104,
  8970. KpMinus: 82,
  8971. KpPlus: 86,
  8972. KpMultiply: 63,
  8973. KpDivide: 106,
  8974. KpEqual: 125,
  8975. KpComma: 129,
  8976. Kp0: 90,
  8977. Kp1: 87,
  8978. Kp2: 88,
  8979. Kp3: 89,
  8980. Kp4: 83,
  8981. Kp5: 84,
  8982. Kp6: 85,
  8983. Kp7: 79,
  8984. Kp8: 80,
  8985. Kp9: 81,
  8986. MetaRight: 134,
  8987. Apps: 135,
  8988. VolumeUp: 123,
  8989. VolumeDown: 122,
  8990. VolumeMute: 121,
  8991. Lang1: 102,
  8992. Lang2: 100,
  8993. Lang3: 98,
  8994. Lang4: 99,
  8995. Lang5: 93
  8996. }, Jo = {
  8997. Alt: 57,
  8998. AltGr: 58,
  8999. Backspace: 67,
  9000. CapsLock: 115,
  9001. ControlLeft: 113,
  9002. ControlRight: 114,
  9003. Delete: 112,
  9004. DownArrow: 20,
  9005. End: 123,
  9006. Escape: 111,
  9007. F1: 131,
  9008. F10: 140,
  9009. F11: 141,
  9010. F12: 142,
  9011. F2: 132,
  9012. F3: 133,
  9013. F4: 134,
  9014. F5: 135,
  9015. F6: 136,
  9016. F7: 137,
  9017. F8: 138,
  9018. F9: 139,
  9019. Home: 3,
  9020. LeftArrow: 21,
  9021. MetaLeft: 117,
  9022. PageDown: 93,
  9023. PageUp: 92,
  9024. Return: 66,
  9025. RightArrow: 22,
  9026. ShiftLeft: 59,
  9027. ShiftRight: 60,
  9028. Space: 62,
  9029. Tab: 61,
  9030. UpArrow: 19,
  9031. PrintScreen: 120,
  9032. ScrollLock: 116,
  9033. NumLock: 143,
  9034. Pause: 121,
  9035. BackQuote: 75,
  9036. Num1: 8,
  9037. Num2: 9,
  9038. Num3: 10,
  9039. Num4: 11,
  9040. Num5: 12,
  9041. Num6: 13,
  9042. Num7: 14,
  9043. Num8: 15,
  9044. Num9: 16,
  9045. Num0: 7,
  9046. Minus: 69,
  9047. Equal: 70,
  9048. KeyA: 29,
  9049. KeyB: 30,
  9050. KeyC: 31,
  9051. KeyD: 32,
  9052. KeyE: 33,
  9053. KeyF: 34,
  9054. KeyG: 35,
  9055. KeyH: 36,
  9056. KeyI: 37,
  9057. KeyJ: 38,
  9058. KeyK: 39,
  9059. KeyL: 40,
  9060. KeyM: 41,
  9061. KeyN: 42,
  9062. KeyO: 43,
  9063. KeyP: 44,
  9064. KeyQ: 45,
  9065. KeyR: 46,
  9066. KeyS: 47,
  9067. KeyT: 48,
  9068. KeyU: 49,
  9069. KeyV: 50,
  9070. KeyW: 51,
  9071. KeyX: 52,
  9072. KeyY: 53,
  9073. KeyZ: 54,
  9074. LeftBracket: 71,
  9075. RightBracket: 72,
  9076. SemiColon: 74,
  9077. Quote: 75,
  9078. BackSlash: 73,
  9079. KanaMode: 218,
  9080. Comma: 55,
  9081. Dot: 56,
  9082. Slash: 76,
  9083. Insert: 124
  9084. }, Go = {
  9085. 226: "Alt",
  9086. 230: "AltGr",
  9087. 42: "Backspace",
  9088. 57: "CapsLock",
  9089. 224: "ControlLeft",
  9090. 228: "ControlRight",
  9091. 76: "Delete",
  9092. 82: "UpArrow",
  9093. 81: "DownArrow",
  9094. 80: "LeftArrow",
  9095. 79: "RightArrow",
  9096. 77: "End",
  9097. 41: "Escape",
  9098. 58: "F1",
  9099. 59: "F2",
  9100. 60: "F3",
  9101. 61: "F4",
  9102. 62: "F5",
  9103. 63: "F6",
  9104. 64: "F7",
  9105. 65: "F8",
  9106. 66: "F9",
  9107. 67: "F10",
  9108. 68: "F11",
  9109. 69: "F12",
  9110. 104: "F13",
  9111. 105: "F14",
  9112. 106: "F15",
  9113. 107: "F16",
  9114. 108: "F17",
  9115. 109: "F18",
  9116. 110: "F19",
  9117. 111: "F20",
  9118. 112: "F21",
  9119. 113: "F22",
  9120. 114: "F23",
  9121. 115: "F24",
  9122. 74: "Home",
  9123. 227: "MetaLeft",
  9124. 78: "PageDown",
  9125. 75: "PageUp",
  9126. 40: "Return",
  9127. 225: "ShiftLeft",
  9128. 229: "ShiftRight",
  9129. 44: "Space",
  9130. 43: "Tab",
  9131. 70: "PrintScreen",
  9132. 71: "ScrollLock",
  9133. 83: "NumLock",
  9134. 53: "BackQuote",
  9135. 30: "Num1",
  9136. 31: "Num2",
  9137. 32: "Num3",
  9138. 33: "Num4",
  9139. 34: "Num5",
  9140. 35: "Num6",
  9141. 36: "Num7",
  9142. 37: "Num8",
  9143. 38: "Num9",
  9144. 39: "Num0",
  9145. 45: "Minus",
  9146. 46: "Equal",
  9147. 20: "KeyQ",
  9148. 26: "KeyW",
  9149. 8: "KeyE",
  9150. 21: "KeyR",
  9151. 23: "KeyT",
  9152. 28: "KeyY",
  9153. 24: "KeyU",
  9154. 12: "KeyI",
  9155. 18: "KeyO",
  9156. 19: "KeyP",
  9157. 47: "LeftBracket",
  9158. 48: "RightBracket",
  9159. 49: "BackSlash",
  9160. 4: "KeyA",
  9161. 22: "KeyS",
  9162. 7: "KeyD",
  9163. 9: "KeyF",
  9164. 10: "KeyG",
  9165. 11: "KeyH",
  9166. 13: "KeyJ",
  9167. 14: "KeyK",
  9168. 15: "KeyL",
  9169. 51: "SemiColon",
  9170. 52: "Quote",
  9171. 100: "IntlBackslash",
  9172. 135: "IntlRo",
  9173. 137: "IntlYen",
  9174. 29: "KeyZ",
  9175. 27: "KeyX",
  9176. 6: "KeyC",
  9177. 25: "KeyV",
  9178. 5: "KeyB",
  9179. 17: "KeyN",
  9180. 16: "KeyM",
  9181. 54: "Comma",
  9182. 55: "Dot",
  9183. 56: "Slash",
  9184. 73: "Insert",
  9185. 86: "KpMinus",
  9186. 87: "KpPlus",
  9187. 85: "KpMultiply",
  9188. 84: "KpDivide",
  9189. 99: "KpDecimal",
  9190. 88: "KpReturn",
  9191. 103: "KpEqual",
  9192. 133: "KpComma",
  9193. 98: "Kp0",
  9194. 89: "Kp1",
  9195. 90: "Kp2",
  9196. 91: "Kp3",
  9197. 92: "Kp4",
  9198. 93: "Kp5",
  9199. 94: "Kp6",
  9200. 95: "Kp7",
  9201. 96: "Kp8",
  9202. 97: "Kp9",
  9203. 231: "MetaRight",
  9204. 128: "VolumeUp",
  9205. 129: "VolumeDown",
  9206. 127: "VolumeMute",
  9207. 139: "Lang1",
  9208. 138: "Lang2",
  9209. 146: "Lang3",
  9210. 147: "Lang4",
  9211. 148: "Lang5",
  9212. 155: "Cancel",
  9213. 156: "Clear",
  9214. 136: "Kana",
  9215. 145: "Hanja",
  9216. 119: "Select",
  9217. 116: "Execute",
  9218. 117: "Help",
  9219. 159: "Separator"
  9220. }, Zo = {
  9221. KeyA: 0,
  9222. KeyS: 1,
  9223. KeyD: 2,
  9224. KeyF: 3,
  9225. KeyH: 4,
  9226. KeyG: 5,
  9227. KeyZ: 6,
  9228. KeyX: 7,
  9229. KeyC: 8,
  9230. KeyV: 9,
  9231. IntlBackslash: 10,
  9232. KeyB: 11,
  9233. KeyQ: 12,
  9234. KeyW: 13,
  9235. KeyE: 14,
  9236. KeyR: 15,
  9237. KeyY: 16,
  9238. KeyT: 17,
  9239. Num1: 18,
  9240. Num2: 19,
  9241. Num3: 20,
  9242. Num4: 21,
  9243. Num6: 22,
  9244. Num5: 23,
  9245. Equal: 24,
  9246. Num9: 25,
  9247. Num7: 26,
  9248. Minus: 27,
  9249. Num8: 28,
  9250. Num0: 29,
  9251. RightBracket: 30,
  9252. KeyO: 31,
  9253. KeyU: 32,
  9254. LeftBracket: 33,
  9255. KeyI: 34,
  9256. KeyP: 35,
  9257. Return: 36,
  9258. KeyL: 37,
  9259. KeyJ: 38,
  9260. Quote: 39,
  9261. KeyK: 40,
  9262. SemiColon: 41,
  9263. BackSlash: 42,
  9264. Comma: 43,
  9265. Slash: 44,
  9266. KeyN: 45,
  9267. KeyM: 46,
  9268. Dot: 47,
  9269. Tab: 48,
  9270. Space: 49,
  9271. BackQuote: 50,
  9272. Backspace: 51,
  9273. Escape: 53,
  9274. MetaRight: 54,
  9275. MetaLeft: 55,
  9276. ShiftLeft: 56,
  9277. CapsLock: 57,
  9278. Alt: 58,
  9279. ControlLeft: 59,
  9280. ShiftRight: 60,
  9281. AltGr: 61,
  9282. ControlRight: 62,
  9283. Function: 63,
  9284. F17: 64,
  9285. KpDecimal: 65,
  9286. KpMultiply: 67,
  9287. KpPlus: 69,
  9288. NumLock: 71,
  9289. VolumeUp: 72,
  9290. VolumeDown: 73,
  9291. VolumeMute: 74,
  9292. KpDivide: 75,
  9293. KpReturn: 76,
  9294. KpMinus: 78,
  9295. F18: 79,
  9296. F19: 80,
  9297. KpEqual: 81,
  9298. Kp0: 82,
  9299. Kp1: 83,
  9300. Kp2: 84,
  9301. Kp3: 85,
  9302. Kp4: 86,
  9303. Kp5: 87,
  9304. Kp6: 88,
  9305. Kp7: 89,
  9306. F20: 90,
  9307. Kp8: 91,
  9308. Kp9: 92,
  9309. IntlYen: 93,
  9310. IntlRo: 94,
  9311. KpComma: 95,
  9312. F5: 96,
  9313. F6: 97,
  9314. F7: 98,
  9315. F3: 99,
  9316. F8: 100,
  9317. F9: 101,
  9318. Lang2: 102,
  9319. F11: 103,
  9320. Lang1: 104,
  9321. F13: 105,
  9322. F16: 106,
  9323. F14: 107,
  9324. F10: 109,
  9325. F12: 111,
  9326. F15: 113,
  9327. Insert: 114,
  9328. Home: 115,
  9329. PageUp: 116,
  9330. Delete: 117,
  9331. F4: 118,
  9332. End: 119,
  9333. F2: 120,
  9334. PageDown: 121,
  9335. F1: 122,
  9336. LeftArrow: 123,
  9337. RightArrow: 124,
  9338. DownArrow: 125,
  9339. UpArrow: 126,
  9340. Apps: 110
  9341. }, Qo = {
  9342. AltLeft: "Alt",
  9343. AltRight: "AltGr",
  9344. Backspace: "Backspace",
  9345. CapsLock: "CapsLock",
  9346. ControlLeft: "ControlLeft",
  9347. ControlRight: "ControlRight",
  9348. Delete: "Delete",
  9349. ArrowUp: "UpArrow",
  9350. ArrowDown: "DownArrow",
  9351. ArrowLeft: "LeftArrow",
  9352. ArrowRight: "RightArrow",
  9353. End: "End",
  9354. Escape: "Escape",
  9355. F1: "F1",
  9356. F2: "F2",
  9357. F3: "F3",
  9358. F4: "F4",
  9359. F5: "F5",
  9360. F6: "F6",
  9361. F7: "F7",
  9362. F8: "F8",
  9363. F9: "F9",
  9364. F10: "F10",
  9365. F11: "F11",
  9366. F12: "F12",
  9367. F13: "F13",
  9368. F14: "F14",
  9369. F15: "F15",
  9370. F16: "F16",
  9371. F17: "F17",
  9372. F18: "F18",
  9373. F19: "F19",
  9374. F20: "F20",
  9375. F21: "F21",
  9376. F22: "F22",
  9377. F23: "F23",
  9378. F24: "F24",
  9379. Home: "Home",
  9380. MetaLeft: "MetaLeft",
  9381. PageDown: "PageDown",
  9382. PageUp: "PageUp",
  9383. Enter: "Return",
  9384. ShiftLeft: "ShiftLeft",
  9385. ShiftRight: "ShiftRight",
  9386. Space: "Space",
  9387. Tab: "Tab",
  9388. PrintScreen: "PrintScreen",
  9389. ScrollLock: "ScrollLock",
  9390. NumLock: "NumLock",
  9391. Backquote: "BackQuote",
  9392. Digit1: "Num1",
  9393. Digit2: "Num2",
  9394. Digit3: "Num3",
  9395. Digit4: "Num4",
  9396. Digit5: "Num5",
  9397. Digit6: "Num6",
  9398. Digit7: "Num7",
  9399. Digit8: "Num8",
  9400. Digit9: "Num9",
  9401. Digit0: "Num0",
  9402. Minus: "Minus",
  9403. Equal: "Equal",
  9404. KeyQ: "KeyQ",
  9405. KeyW: "KeyW",
  9406. KeyE: "KeyE",
  9407. KeyR: "KeyR",
  9408. KeyT: "KeyT",
  9409. KeyY: "KeyY",
  9410. KeyU: "KeyU",
  9411. KeyI: "KeyI",
  9412. KeyO: "KeyO",
  9413. KeyP: "KeyP",
  9414. BracketLeft: "LeftBracket",
  9415. BracketRight: "RightBracket",
  9416. Backslash: "BackSlash",
  9417. KeyA: "KeyA",
  9418. KeyS: "KeyS",
  9419. KeyD: "KeyD",
  9420. KeyF: "KeyF",
  9421. KeyG: "KeyG",
  9422. KeyH: "KeyH",
  9423. KeyJ: "KeyJ",
  9424. KeyK: "KeyK",
  9425. KeyL: "KeyL",
  9426. Semicolon: "SemiColon",
  9427. Quote: "Quote",
  9428. IntlBackslash: "IntlBackslash",
  9429. IntlRo: "IntlRo",
  9430. IntlYen: "IntlYen",
  9431. KanaMode: "KanaMode",
  9432. KeyZ: "KeyZ",
  9433. KeyX: "KeyX",
  9434. KeyC: "KeyC",
  9435. KeyV: "KeyV",
  9436. KeyB: "KeyB",
  9437. KeyN: "KeyN",
  9438. KeyM: "KeyM",
  9439. Comma: "Comma",
  9440. Period: "Dot",
  9441. Slash: "Slash",
  9442. Insert: "Insert",
  9443. NumpadSubtract: "KpMinus",
  9444. NumpadAdd: "KpPlus",
  9445. NumpadMultiply: "KpMultiply",
  9446. NumpadDivide: "KpDivide",
  9447. NumpadDecimal: "KpDecimal",
  9448. NumpadEnter: "KpReturn",
  9449. NumpadEqual: "KpEqual",
  9450. NumpadComma: "KpComma",
  9451. Numpad0: "Kp0",
  9452. Numpad1: "Kp1",
  9453. Numpad2: "Kp2",
  9454. Numpad3: "Kp3",
  9455. Numpad4: "Kp4",
  9456. Numpad5: "Kp5",
  9457. Numpad6: "Kp6",
  9458. Numpad7: "Kp7",
  9459. Numpad8: "Kp8",
  9460. Numpad9: "Kp9",
  9461. MetaRight: "MetaRight",
  9462. ContextMenu: "Apps",
  9463. AudioVolumeUp: "VolumeUp",
  9464. AudioVolumeDown: "VolumeDown",
  9465. AudioVolumeMute: "VolumeMute",
  9466. NonConvert: "Lang1",
  9467. Convert: "Lang2",
  9468. Lang3: "Lang3",
  9469. Lang4: "Lang4",
  9470. Lang5: "Lang5"
  9471. },
  9472. Xo = 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"]),
  9473. Yo = new Set(["Kp0", "Kp1", "Kp2", "Kp3", "Kp4", "Kp5", "Kp6", "Kp7", "Kp8", "Kp9", "KpMinus", "KpMultiply", "KpDivide", "KpPlus", "KpDecimal"]);
  9474. let Me = !1, du = !1;
  9475. const R = {};
  9476. R[no] = !1;
  9477. R[oo] = !1;
  9478. R[qe] = !1;
  9479. R[ma] = !1;
  9480. R[J4] = !1;
  9481. R[Fa] = !1;
  9482. R[_a] = !1;
  9483. R[va] = !1;
  9484. const Qe = {}, e3 = u => Yo.has(u), i3 = u => Xo.has(u), $o = () => R[qe] || R[ma] || R[J4] || R[Fa] || R[_a] || R[va];
  9485. let v, d4 = !1;
  9486. function ur() {
  9487. if (d4) {
  9488. console.info("Keyboard event listener is already started");
  9489. return
  9490. }
  9491. document.addEventListener("keydown", B4), document.addEventListener("keyup", B4), v || (v = document.createElement("div"), v.setAttribute("contenteditable", "true"), v.id = "hiddenInput", v.style.position = "absolute", v.style.left = "-9999px", v.style.height = "1px", v.style.width = "1px", document.body.appendChild(v), l0 ? v.addEventListener("input", c4) : (F4 || s0) && v.addEventListener("compositionend", c4), v.focus()), d4 = !0, console.info("Keyboard event listener started")
  9492. }
  9493. function L4() {
  9494. if (!d4) {
  9495. console.info("Keyboard event listener is not started");
  9496. return
  9497. }
  9498. document.removeEventListener("keydown", B4), document.removeEventListener("keyup", B4), v && (l0 || F4 ? v.removeEventListener("input", c4) : s0 && v.removeEventListener("compositionend", c4), v.remove(), v = void 0), d4 = !1, console.info("Keyboard event listener stopped")
  9499. }
  9500. function t3(u, e) {
  9501. u.sendMessage({key_event: e})
  9502. }
  9503. function B4(u) {
  9504. const e = B0();
  9505. if (!e) return;
  9506. const i = u.type === "keydown";
  9507. i && !du && u.preventDefault(), Ra(e, u, i)
  9508. }
  9509. function c4(u) {
  9510. var a, t;
  9511. const e = B0();
  9512. if (!e) return;
  9513. u.preventDefault();
  9514. let i = null;
  9515. if ((u instanceof InputEvent || u instanceof CompositionEvent) && (i = u.data), !i) return;
  9516. const n = I.fromPartial({seq: i, mode: je.Translate, down: !0, press: !1});
  9517. t3(e, n), ((t = (a = v == null ? void 0 : v.textContent) == null ? void 0 : a.length) != null ? t : 0) > 10 && (v.textContent = "")
  9518. }
  9519. function Ra(u, e, i) {
  9520. const n = tr(u, e, i);
  9521. for (const a of n) t3(u, a)
  9522. }
  9523. function er(u, e, i, n) {
  9524. const a = Go[e];
  9525. if (!a) {
  9526. console.error("Unknown USB HID code " + e);
  9527. return
  9528. }
  9529. const t = C4(u, a, i);
  9530. if (!t) return;
  9531. const s = e3(a), E = i3(a);
  9532. (E || s) && Ia(t, n, s, E);
  9533. for (const D of t) t3(u, D)
  9534. }
  9535. function ir() {
  9536. const u = B0();
  9537. if (!!u) for (const e in Qe) {
  9538. const i = Qe[e];
  9539. i && Ra(u, i, !1)
  9540. }
  9541. }
  9542. function tr(u, e, i) {
  9543. var d;
  9544. const n = e.code, a = Qo[n];
  9545. if (!a) return console.error("Key code is not supported " + n), [];
  9546. const t = u.getOption("keyboard_mode"), s = ar(e);
  9547. or(e, i), i ? Qe[n] = e : delete Qe[n];
  9548. let E = [];
  9549. switch (t) {
  9550. case ao:
  9551. E = (d = C4(u, a, i)) != null ? d : [];
  9552. break;
  9553. case Ht:
  9554. E = rr(u, e, a, i);
  9555. break
  9556. }
  9557. if (!E) return [];
  9558. const D = e3(a);
  9559. if (t !== Ht || D) {
  9560. const C = i3(a);
  9561. Ia(E, s, D, C)
  9562. }
  9563. return E
  9564. }
  9565. function Ia(u, e, i, n) {
  9566. for (const s of u) n && (e & 1 << 1) != 0 && s.modifiers.push(V.CapsLock), i && (e & 1 << 2) != 0 && s.modifiers.push(V.NumLock)
  9567. }
  9568. function ar(u) {
  9569. let a = 0;
  9570. return u.getModifierState("CapsLock") && (a |= 1 << 1), u.getModifierState("NumLock") && (a |= 1 << 2), u.getModifierState("ScrollLock") && (a |= 1 << 3), a
  9571. }
  9572. function nr(u, e) {
  9573. return u == x4 ? u3[e] : u == G4 ? Ho[e] : u == ga ? Jo[e] : u == Z4 ? (_.getItem("option:local:kb_layout") == Eo && (e == "IntlBackslash" ? e = "BackQuote" : e == "BackQuote" && (e = "IntlBackslash")), Zo[e]) : null
  9574. }
  9575. function or(u, e) {
  9576. const i = u.code;
  9577. i in R && (R[i] = e)
  9578. }
  9579. function C4(u, e, i) {
  9580. const n = u.getPeerPlatform(), a = u.isSwapControlCommand();
  9581. e == "ControlLeft" || e == "ControlRight" ? a && (e = "MetaLeft") : (e == "MetaLeft" || e == "MetaRight") && a && (e = "ControlLeft");
  9582. const t = nr(n, e);
  9583. return t == null ? (console.error("Unknown key code " + e + " for platform " + n), []) : [I.fromPartial({
  9584. chr: t,
  9585. mode: je.Map,
  9586. down: i,
  9587. press: !1
  9588. })]
  9589. }
  9590. function rr(u, e, i, n) {
  9591. const a = v === document.activeElement;
  9592. if (v && v.focus(), F4 && v && a && e.key === "Process") return [];
  9593. const t = i3(i), s = e.key === "Dead";
  9594. if (n && du && t) return s0 ? du = s : du = !1, [];
  9595. if (s) return n && (s0 ? du = !0 : du = !du), du && v && !a && l0 && v.dispatchEvent(new KeyboardEvent(e.type, {...e})), [];
  9596. if (du = !1, !s0 && e3(i)) return C4(u, i, n);
  9597. if (s0 && e.code === "AltRight") return [];
  9598. if (e.key === "AltGraph") return Me && !n && (Me = !1), !Me && n && R[qe] ? (Me = !0, R[qe] = !1, delete Qe[qe], [I.fromPartial({
  9599. chr: u3.ControlLeft,
  9600. mode: je.Map,
  9601. down: !1,
  9602. press: !1
  9603. })]) : [];
  9604. const D = u.getPeerPlatform();
  9605. let d = [];
  9606. return l0 && (d = sr(D, e, n)), (l0 || F4) && d.length === 0 && n && t && (d = Xt(e, n)), l0 && Me || (s0 && n && t && !R[J4] && d.push(...Xt(e, n)), d.length === 0 && d.push(...C4(u, i, n))), d
  9607. }
  9608. function sr(u, e, i) {
  9609. if (u !== x4 || !$o()) return [];
  9610. let n;
  9611. const a = u3[e.code];
  9612. 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 ? [] : [I.fromPartial({
  9613. win2win_hotkey: n,
  9614. mode: je.Translate,
  9615. down: i,
  9616. press: !1
  9617. })])
  9618. }
  9619. function Xt(u, e) {
  9620. return u.key ? [I.fromPartial({seq: u.key, mode: je.Translate, down: e, press: !1})] : []
  9621. }
  9622. class Er {
  9623. constructor(e, i, n, a) {
  9624. l(this, "_uri");
  9625. l(this, "_feedback");
  9626. l(this, "_key");
  9627. l(this, "_token");
  9628. l(this, "_ws");
  9629. l(this, "_interval");
  9630. l(this, "_keepAlive");
  9631. l(this, "_lastRecvMsg");
  9632. l(this, "_aliveFailed");
  9633. this._uri = e, this._feedback = i, this._key = n, this._token = a, this._keepAlive = Ao, this._lastRecvMsg = new Date, this._aliveFailed = !1
  9634. }
  9635. close() {
  9636. var e;
  9637. this._interval && (clearInterval(this._interval), this._interval = void 0), (e = this._ws) == null || e.close(), this._ws = void 0
  9638. }
  9639. async start() {
  9640. if (this._feedback == 0 || !this._uri || !this._token || !this._key) return;
  9641. const e = new l4(this._uri, !0, "health check");
  9642. await e.open(), console.log(new Date + ": Connected to relay server"), this._ws = e;
  9643. const i = o0.fromPartial({token: this._token});
  9644. e.sendRendezvous({hc: i}), this.startInterval(), await this.msgLoop(), this.close()
  9645. }
  9646. startInterval() {
  9647. this._interval = setInterval(() => {
  9648. new Date().getTime() - this._lastRecvMsg.getTime() > this._keepAlive * 3 / 2 && (this._aliveFailed = !0)
  9649. }, po)
  9650. }
  9651. async msgLoop() {
  9652. var e;
  9653. for (this._lastRecvMsg = new Date; ;) {
  9654. if (!this._ws) {
  9655. console.info("HC connection is closed as controlling connection exits");
  9656. break
  9657. }
  9658. try {
  9659. const i = await ((e = this._ws) == null ? void 0 : e.next(300));
  9660. i && (this._lastRecvMsg = new Date, this.handleMsg(i))
  9661. } catch (i) {
  9662. if (i === "Timeout") {
  9663. if (this._aliveFailed) {
  9664. console.error("HC connection is timeout");
  9665. break
  9666. }
  9667. } else {
  9668. console.error("An error occurred on health check:", i);
  9669. break
  9670. }
  9671. }
  9672. }
  9673. }
  9674. handleMsg(e) {
  9675. var i;
  9676. if (e instanceof Uint8Array) {
  9677. (i = this._ws) == null || i.sendBytes(new Uint8Array);
  9678. return
  9679. } else {
  9680. const n = e.register_pk_response;
  9681. n && n.keep_alive > 0 && (this._keepAlive = n.keep_alive * 1e3, console.log("keep_alive: " + this._keepAlive + "ms"))
  9682. }
  9683. }
  9684. }
  9685. let Te = [], Ne = "", p4 = [], Xe = [], A4, W4 = !1;
  9686. const a3 = ["text/plain", "text/html", "image/svg+xml", "image/png"];
  9687. function n3() {
  9688. p4 = [], Xe = [], A4 = void 0
  9689. }
  9690. function lr(u) {
  9691. W4 = u
  9692. }
  9693. function Ta() {
  9694. let u = navigator.userAgent.toLowerCase();
  9695. return !(u.includes("firefox") || u.includes("safari") && !u.includes("chrome"))
  9696. }
  9697. async function Dr() {
  9698. if (!!Ta()) try {
  9699. Te = await navigator.clipboard.read(), Te.length === 0 && (Ne = await navigator.clipboard.readText())
  9700. } catch (u) {
  9701. console.error("Failed to read clipboard items before connection, ", u)
  9702. }
  9703. }
  9704. async function Na(u) {
  9705. if (!!Ta() && !W4) {
  9706. var e = [], i = "";
  9707. for (let n = 0; n < 3; n++) try {
  9708. e = await navigator.clipboard.read(), e.length === 0 && (i = await navigator.clipboard.readText());
  9709. break
  9710. } catch (a) {
  9711. if (a.name === "NotAllowedError" && a.message.includes("Document is not focused")) await new Promise(t => setTimeout(t, 300)); else return
  9712. }
  9713. e.length === 0 && i === "" || (W4 = !0, await dr(e) ? (Te = e, await cr(u)) : i !== Ne && (Ne = i, await Cr(u)))
  9714. }
  9715. }
  9716. async function dr(u) {
  9717. if (u.length !== Te.length) return !0;
  9718. for (let e = 0; e < u.length; e++) {
  9719. const i = u[e], n = Te[e];
  9720. if (!await Br(i, n)) return !0
  9721. }
  9722. return !1
  9723. }
  9724. async function Br(u, e) {
  9725. if (u.types.length !== e.types.length) return !1;
  9726. for (let i = 0; i < u.types.length; i++) {
  9727. if (u.types[i] !== e.types[i]) return !1;
  9728. if (!a3.includes(u.types[i])) continue;
  9729. const n = await u.getType(u.types[i]), a = await e.getType(e.types[i]);
  9730. if (n.size !== a.size) return !1;
  9731. const t = new Uint8Array(await n.arrayBuffer()), s = new Uint8Array(await a.arrayBuffer());
  9732. for (let E = 0; E < t.length; E++) if (t[E] !== s[E]) return !1
  9733. }
  9734. return !0
  9735. }
  9736. function ja(u) {
  9737. switch (u) {
  9738. case"text/plain":
  9739. return pu.Text;
  9740. case"text/html":
  9741. return pu.Html;
  9742. case"image/svg+xml":
  9743. return pu.ImageSvg;
  9744. case"image/png":
  9745. return pu.ImagePng;
  9746. default:
  9747. return pu.UNRECOGNIZED
  9748. }
  9749. }
  9750. async function cr(u) {
  9751. const e = [], i = (await Promise.all(Te.map(async n => {
  9752. const a = [];
  9753. for (const t of n.types) {
  9754. if (!a3.includes(t)) continue;
  9755. const s = await n.getType(t);
  9756. e.push(t), a.push(new Uint8Array(await s.arrayBuffer()))
  9757. }
  9758. return a
  9759. }))).flat();
  9760. e.length !== 0 && $a(i, !0, n => {
  9761. const a = n.map((t, s) => {
  9762. let E = !1;
  9763. t && (E = t.length < Ne.length);
  9764. const D = E && t != null ? t : i[s];
  9765. return G.fromPartial({content: D, compress: E, format: ja(e[s])})
  9766. });
  9767. u.sendMessage(ru.fromPartial({multi_clipboards: Pu.fromPartial({clipboards: a})}))
  9768. })
  9769. }
  9770. async function Cr(u) {
  9771. const e = new TextEncoder().encode(Ne);
  9772. $a(e, !1, i => {
  9773. let n = !1;
  9774. i && (n = i.length < Ne.length);
  9775. const a = n && i != null ? i : e;
  9776. let t = G.fromPartial({content: a, compress: n, format: pu.Text});
  9777. u.sendMessage(ru.fromPartial({clipboard: t}))
  9778. })
  9779. }
  9780. function o3(u, e = void 0) {
  9781. const i = () => {
  9782. try {
  9783. Ps(new TextDecoder().decode(u.content)), n3(), e == null || e()
  9784. } catch (n) {
  9785. console.error("Failed to copy to clipboard, ", n), document.hasFocus() || (A4 = u)
  9786. }
  9787. };
  9788. u.compress ? _4(u.content, !1, n => {
  9789. n && (u.content = n, i())
  9790. }) : i()
  9791. }
  9792. const a4 = document.createElement("canvas"), R4 = a4.getContext("2d");
  9793. function pr(u, e, i) {
  9794. if (a4.width = e, a4.height = i, !R4) return new Uint8Array(0);
  9795. const n = R4.createImageData(e, i);
  9796. return n.data.set(u), R4.putImageData(n, 0, 0), Uint8Array.from(atob(a4.toDataURL("image/png").split(",")[1]), a => a.charCodeAt(0))
  9797. }
  9798. function Ar(u, e = void 0) {
  9799. n3();
  9800. const i = u.clipboards, n = i.filter(a => a.compress).map(a => a.content);
  9801. _4(n, !0, async a => {
  9802. var d;
  9803. let t = 0;
  9804. for (const C of i) C.compress && (C.content = (d = a[t]) != null ? d : C.content, t++), C.compress = !1;
  9805. const s = {};
  9806. for (const C of i) {
  9807. const c = a3.find(p => C.format === ja(p));
  9808. if (c) {
  9809. const p = new Blob([C.content], {type: c});
  9810. s[c] = p
  9811. }
  9812. }
  9813. if (!(s["image/png"] !== void 0)) {
  9814. for (const C of i) if (C.format === pu.ImageRgba) {
  9815. const c = pr(C.content, C.width, C.height);
  9816. c.length > 0 && (s["image/png"] = new Blob([c], {type: "image/png"}));
  9817. break
  9818. }
  9819. }
  9820. if (Object.keys(s).length === 0) return;
  9821. const D = new ClipboardItem(s);
  9822. await Oa(i, D, e)
  9823. })
  9824. }
  9825. async function Oa(u, e, i = void 0) {
  9826. if (!document.hasFocus()) {
  9827. p4 = u, Xe = [e];
  9828. return
  9829. }
  9830. try {
  9831. await navigator.clipboard.write([e]), n3(), i == null || i()
  9832. } catch (n) {
  9833. if (console.error("Failed to write to clipboard, ", n), !document.hasFocus()) {
  9834. p4 = u, Xe = [e];
  9835. return
  9836. }
  9837. const a = u.find(t => t.format === pu.Text);
  9838. a && o3(a, i)
  9839. }
  9840. }
  9841. function Yt() {
  9842. vs("info", "Clipboard is synchronized", 2e3)
  9843. }
  9844. window.addEventListener("focus", function () {
  9845. Xe.length > 0 ? Oa(p4, Xe[0], Yt) : A4 && o3(A4, Yt)
  9846. });
  9847. class mr {
  9848. constructor({id: e, path: i}) {
  9849. l(this, "id");
  9850. l(this, "path");
  9851. l(this, "empty_dirs");
  9852. this.id = e, this.path = i, this.empty_dirs = void 0
  9853. }
  9854. }
  9855. const Bu = class {
  9856. constructor({
  9857. id: e,
  9858. remote: i,
  9859. path: n,
  9860. show_hidden: a,
  9861. is_remote: t,
  9862. is_last_job: s,
  9863. file_num: E,
  9864. files: D,
  9865. conn_id: d,
  9866. total_size: C,
  9867. finished_size: c,
  9868. transferred: p,
  9869. enable_overwrite_detection: F,
  9870. file_confirmed: w,
  9871. file_skipped: y,
  9872. file_is_waiting: A,
  9873. is_dir: U
  9874. }) {
  9875. l(this, "id");
  9876. l(this, "remote");
  9877. l(this, "path");
  9878. l(this, "show_hidden");
  9879. l(this, "is_remote");
  9880. l(this, "is_last_job");
  9881. l(this, "file_num");
  9882. l(this, "files");
  9883. l(this, "conn_id");
  9884. l(this, "total_size");
  9885. l(this, "finished_size");
  9886. l(this, "transferred");
  9887. l(this, "lastTransferred");
  9888. l(this, "enable_overwrite_detection");
  9889. l(this, "file_confirmed");
  9890. l(this, "file_skipped");
  9891. l(this, "file_is_waiting");
  9892. l(this, "default_overwrite_strategy");
  9893. l(this, "is_dir");
  9894. l(this, "stream");
  9895. l(this, "writer");
  9896. l(this, "zip");
  9897. l(this, "currentData");
  9898. l(this, "fileHandles");
  9899. l(this, "currentReader");
  9900. l(this, "write", async (e, i) => {
  9901. var t;
  9902. if (e.id !== this.id) throw new Error("Wrong id");
  9903. const n = e.file_num;
  9904. if (n >= this.files.length) throw new Error("Wrong file number");
  9905. const a = this.is_dir;
  9906. if (n !== this.file_num || a && !this.zip || !a && !this.writer) if (a) {
  9907. if (this.zip || (this.zip = new _3), this.currentData) {
  9908. const s = this.files[this.file_num];
  9909. this.zip.file(s.name, this.currentData), this.currentData = void 0
  9910. }
  9911. this.file_num = e.file_num
  9912. } else {
  9913. this.writer && await this.writer.close(), this.stream && (this.stream = void 0), this.file_num = e.file_num;
  9914. const s = this.files[n], E = Bu.join(this.path, s.name);
  9915. this.stream = streamSaver.createWriteStream(E, {size: s.size}), this.writer = (t = this.stream) == null ? void 0 : t.getWriter()
  9916. }
  9917. if (e.compressed) {
  9918. const s = await en(e.data);
  9919. if (!s) throw new Error("Failed to decompress");
  9920. if (a) this.currentData ? this.currentData = new Uint8Array([...this.currentData, ...s]) : this.currentData = s; else {
  9921. if (!this.writer) throw new Error("file is None");
  9922. try {
  9923. await this.writer.write(s)
  9924. } catch (E) {
  9925. throw V4(this.id, "write failed", this.file_num), i(), E
  9926. }
  9927. }
  9928. this.finished_size += s.length
  9929. } else {
  9930. if (a) this.currentData ? this.currentData = new Uint8Array([...this.currentData, ...e.data]) : this.currentData = e.data; else {
  9931. if (!this.writer) throw new Error("file is None");
  9932. try {
  9933. await this.writer.write(e.data)
  9934. } catch (s) {
  9935. throw V4(this.id, "write failed", this.file_num), i(), s
  9936. }
  9937. }
  9938. this.finished_size += e.data.length
  9939. }
  9940. this.transferred += e.data.length
  9941. });
  9942. l(this, "read", async e => {
  9943. var d;
  9944. let i = this.file_num;
  9945. if (i >= this.files.length) {
  9946. (d = this.currentReader) == null || d.cancel(), this.currentReader = void 0;
  9947. return
  9948. }
  9949. let n = this.files[i];
  9950. if (!this.currentReader) {
  9951. if (!this.fileHandles || !this.fileHandles[i]) throw new Error("file is None");
  9952. let c = (await this.fileHandles[i].getFile()).stream();
  9953. this.currentReader = c.getReader({mode: "byob"}), this.file_confirmed = !1, this.file_is_waiting = !1
  9954. }
  9955. if (this.enable_overwrite_detection && !this.file_confirmed) {
  9956. this.file_is_waiting || (this.send_current_digest(e), this.file_is_waiting = !0);
  9957. return
  9958. }
  9959. const a = 128 * 1024;
  9960. let t = new ArrayBuffer(a), s = !1, E = 0;
  9961. for (; E < t.byteLength;) {
  9962. const {value: C, done: c} = await this.currentReader.read(new Uint8Array(t, E, t.byteLength - E));
  9963. if (!C) {
  9964. this.file_num += 1, this.file_confirmed = !1, this.file_is_waiting = !1, this.currentReader = void 0, t = new ArrayBuffer(0);
  9965. break
  9966. }
  9967. if (E += C.byteLength, t = C.buffer, c) break
  9968. }
  9969. let D = new Uint8Array(t, 0, E);
  9970. if (E === 0) this.file_num += 1, this.currentReader = void 0, this.file_confirmed = !1, this.file_is_waiting = !1; else {
  9971. if (this.finished_size += E, !Tr(Bu.join(this.path, n.name))) {
  9972. const C = await un(new Uint8Array(t, 0, E));
  9973. if (C) C.length < E && (D = new Uint8Array(C), s = !0); else throw new Error("Failed to compress")
  9974. }
  9975. this.transferred += E
  9976. }
  9977. return Uu.fromPartial({id: this.id, file_num: i, data: D, compressed: s})
  9978. });
  9979. l(this, "send_current_digest", async e => {
  9980. if (!this.fileHandles || !this.fileHandles[this.file_num]) throw new Error("file is None");
  9981. let i = await this.fileHandles[this.file_num].getFile();
  9982. if (!i) throw new Error("file is None");
  9983. let n = Math.floor(i.lastModified / 1e3), a = i.size,
  9984. t = Ou.fromPartial({id: this.id, file_num: this.file_num, last_modified: n, file_size: a}),
  9985. s = Eu.fromPartial({digest: t}), E = ru.fromPartial({file_response: s});
  9986. e(E)
  9987. });
  9988. l(this, "read_digest", e => {
  9989. let i = this.files[e.file_num], n = Bu.join(this.path, i.name), a = this.default_overwrite_strategy;
  9990. if (a !== void 0) {
  9991. let t = Au.fromPartial({
  9992. id: e.id,
  9993. file_num: e.file_num,
  9994. offset_blk: a ? 0 : void 0,
  9995. skip: a ? void 0 : !0
  9996. });
  9997. return this.confirm(t), Bu.new_send_confirm(t)
  9998. } else {
  9999. Nr(e.id, e.file_num, n, !0, e.is_identical);
  10000. return
  10001. }
  10002. });
  10003. l(this, "write_digest", e => {
  10004. let i = Au.fromPartial({id: e.id, file_num: e.file_num, offset_blk: 0});
  10005. return this.confirm(i), Bu.new_send_confirm(i)
  10006. });
  10007. l(this, "write_done", (e, i, n) => {
  10008. if (this.writer) {
  10009. this.writer.close();
  10010. return
  10011. }
  10012. if (this.zip || (this.zip = new _3), this.currentData) {
  10013. const t = this.files[this.file_num];
  10014. this.zip.file(t.name, this.currentData), this.currentData = void 0
  10015. }
  10016. if (i != null) {
  10017. const t = i();
  10018. if (t != null) if (t.empty_dirs != null) for (let s of t.empty_dirs) {
  10019. var a = s.substring(t.path.length + 1);
  10020. Ke() ? a = a.replace(/\//g, "\\") : a = a.replace(/\\/g, "/"), this.zip.folder(a)
  10021. } else {
  10022. setTimeout(() => {
  10023. this.write_done(e, i, n)
  10024. }, 1e3);
  10025. return
  10026. }
  10027. }
  10028. this.zip.generateAsync({type: "blob"}).then(t => {
  10029. Dn.exports.saveAs(t, `${this.path}.zip`)
  10030. }), n()
  10031. });
  10032. l(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));
  10033. l(this, "set_file_skipped", () => {
  10034. var e;
  10035. (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
  10036. });
  10037. l(this, "set_file_confirmed", e => {
  10038. this.file_confirmed = e, this.file_skipped = !1
  10039. });
  10040. l(this, "set_file_is_waiting", e => {
  10041. this.file_is_waiting = e
  10042. });
  10043. l(this, "update_job_status", e => {
  10044. if (e <= 0) return;
  10045. let i = Math.floor((this.transferred - this.lastTransferred) / (e * 1 / 1e3));
  10046. this.lastTransferred = this.transferred;
  10047. let n = this.file_num - 1;
  10048. this.job_progress(this.id, n, i, this.finished_size)
  10049. });
  10050. l(this, "job_progress", (e, i, n, a) => {
  10051. m("job_progress", {
  10052. id: e.toString(),
  10053. file_num: i.toString(),
  10054. speed: n.toString(),
  10055. finished_size: a.toString()
  10056. })
  10057. });
  10058. l(this, "job_skipped", () => this.file_skipped && this.files.length === 1);
  10059. l(this, "job_error", () => {
  10060. if (this.job_skipped()) return "skipped"
  10061. });
  10062. l(this, "job_completed", () => !this.enable_overwrite_detection || !this.file_confirmed && !this.file_is_waiting);
  10063. l(this, "remove_download_file", () => {
  10064. if (this.writer) try {
  10065. this.writer.abort()
  10066. } catch {
  10067. }
  10068. this.writer = void 0, this.stream = void 0, this.currentData = void 0, this.zip = void 0
  10069. });
  10070. 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 = D, this.conn_id = d, this.total_size = C, this.finished_size = c, this.transferred = p, this.lastTransferred = 0, this.enable_overwrite_detection = F, this.file_confirmed = w, this.file_skipped = y, this.file_is_waiting = A, this.is_dir = U
  10071. }
  10072. };
  10073. let cu = Bu;
  10074. l(cu, "newWrite", (e, i, n, a, t, s, E, D, d) => {
  10075. let C = E.reduce((p, F) => p + F.size, 0);
  10076. return new Bu({
  10077. id: e,
  10078. remote: i,
  10079. path: n,
  10080. file_num: a,
  10081. show_hidden: t,
  10082. is_remote: s,
  10083. files: E,
  10084. total_size: C,
  10085. enable_overwrite_detection: D,
  10086. is_dir: d,
  10087. is_last_job: !1,
  10088. conn_id: 0,
  10089. finished_size: 0,
  10090. transferred: 0,
  10091. file_confirmed: !1,
  10092. file_skipped: !1,
  10093. file_is_waiting: !1
  10094. })
  10095. }), l(cu, "newRead", (e, i, n, a, t, s, E, D, d) => {
  10096. let C = E.reduce((p, F) => p + F.size, 0), c = new Bu({
  10097. id: e,
  10098. remote: i,
  10099. path: n,
  10100. file_num: a,
  10101. show_hidden: t,
  10102. is_remote: s,
  10103. files: E,
  10104. total_size: C,
  10105. enable_overwrite_detection: D,
  10106. is_dir: !1,
  10107. is_last_job: !1,
  10108. conn_id: 0,
  10109. finished_size: 0,
  10110. transferred: 0,
  10111. file_confirmed: !1,
  10112. file_skipped: !1,
  10113. file_is_waiting: !1
  10114. });
  10115. return c.fileHandles = d, c
  10116. }), l(cu, "new_send_confirm", e => ru.fromPartial({file_action: M.fromPartial({send_confirm: e})})), l(cu, "join", (e, i) => i === "" ? e : e.endsWith("/") || e.endsWith("\\") ? e + i : Ke() ? e + "\\" + i : e + "/" + i);
  10117. const Fr = (u, e, i, n) => {
  10118. let a = Lu.fromPartial({id: u, path: e, include_hidden: n, file_num: i});
  10119. return M.fromPartial({send: a})
  10120. }, $t = (u, e, i, n) => {
  10121. if (!n) return;
  10122. let a = Ku.fromPartial({id: u, path: e, file_num: i});
  10123. return M.fromPartial({remove_file: a})
  10124. }, _r = (u, e, i) => {
  10125. let n = Tu.fromPartial({id: u, path: e, include_hidden: i});
  10126. return M.fromPartial({all_files: n})
  10127. }, vr = (u, e) => {
  10128. let i = Hu.fromPartial({id: u, path: e});
  10129. return M.fromPartial({create: i})
  10130. }, gr = u => {
  10131. let e = ju.fromPartial({id: u});
  10132. return M.fromPartial({cancel: e})
  10133. }, kr = (u, e) => {
  10134. let i = qu.fromPartial({id: u, path: e, recursive: !0});
  10135. return M.fromPartial({remove_dir: i})
  10136. }, hr = (u, e, i) => {
  10137. let n = Nu.fromPartial({id: u, path: e, new_name: i});
  10138. return M.fromPartial({rename: n})
  10139. }, fr = (u, e, i, n, a) => {
  10140. let t = Vu.fromPartial({id: u, path: e, file_num: i, files: n, total_size: a});
  10141. return M.fromPartial({receive: t})
  10142. }, xr = u => {
  10143. let e = Eu.fromPartial({block: u});
  10144. return ru.fromPartial({file_response: e})
  10145. }, ua = (u, e, i) => {
  10146. let n = Eu.fromPartial({error: Mu.fromPartial({id: u, error: e, file_num: i})});
  10147. return ru.fromPartial({file_response: n})
  10148. }, yr = (u, e) => {
  10149. let i = Eu.fromPartial({done: Wu.fromPartial({id: u, file_num: e})});
  10150. return ru.fromPartial({file_response: i})
  10151. }, br = (u, e) => {
  10152. let i = Iu.fromPartial({path: u, include_hidden: e});
  10153. return M.fromPartial({read_empty_dirs: i})
  10154. }, ea = (u, e, i, n, a) => {
  10155. a ? m("update_folder_files", {info: wr(u, e, a)}) : m("file_dir", {is_local: "false", value: Sr(u, i, e)})
  10156. }, wr = (u, e, i) => {
  10157. let n = {
  10158. id: u,
  10159. entries: e.map(a => ({name: a.name, type: a.entry_type, time: a.modified_time, size: a.size})),
  10160. total_size: e.reduce((a, t) => a + t.size, 0)
  10161. };
  10162. return i && (n.num_entries = e.length, delete n.entries), JSON.stringify(n)
  10163. }, Sr = (u, e, i) => {
  10164. let n = {
  10165. id: u,
  10166. path: e,
  10167. entries: i.map(a => ({entry_type: a.entry_type, name: a.name, size: a.size, modified_time: a.modified_time}))
  10168. };
  10169. return JSON.stringify(n)
  10170. }, V4 = (u, e, i) => {
  10171. m("job_error", {id: u.toString(), err: e, file_num: i.toString()})
  10172. }, zr = (u, e) => {
  10173. m("job_done", {id: u.toString(), file_num: e.toString()})
  10174. };
  10175. var C0 = 0;
  10176. const Pr = async (u, e) => {
  10177. try {
  10178. if (u) {
  10179. const i = await window.showDirectoryPicker();
  10180. let n = {name: i.name, size: 0, entry_type: 2, modified_time: 0};
  10181. C0++, e(C0, i), m("selected_files", {handleIndex: C0, file: n})
  10182. } else {
  10183. const i = {multiple: !0}, n = await window.showOpenFilePicker(i);
  10184. for (const a of n) {
  10185. const t = await a.getFile();
  10186. let s = {name: t.name, size: t.size, entry_type: 4, modified_time: Math.floor(t.lastModified / 1e3)};
  10187. C0++, e(C0, a), m("selected_files", {handleIndex: C0, file: s})
  10188. }
  10189. }
  10190. } catch (i) {
  10191. console.error("Failed to choose file:", i)
  10192. }
  10193. }, Rr = async (u, e) => {
  10194. let i = [];
  10195. for (let n of u) if (!n.is_last_job) try {
  10196. let a = await n.read(e);
  10197. if (a) e(xr(a)); else if (n.job_completed()) {
  10198. i.push(n.id);
  10199. let t = n.job_error();
  10200. e(t ? ua(n.id, t, n.file_num) : yr(n.id, n.file_num))
  10201. }
  10202. } catch (a) {
  10203. e(ua(n.id, (a != null ? a : "read failed").toString(), n.file_num))
  10204. }
  10205. return i
  10206. }, Ir = u => {
  10207. let e = u.lastIndexOf(".");
  10208. return e >= 0 ? u.substring(e + 1) : ""
  10209. }, Tr = u => {
  10210. let e = Ir(u);
  10211. return e === "xz" || e === "gz" || e === "zip" || e === "7z" || e === "rar" || e === "bz2" || e === "tgz" || e === "png" || e === "jpg"
  10212. }, Nr = (u, e, i, n, a) => {
  10213. m("override_file_confirm", {
  10214. id: u.toString(),
  10215. file_num: e.toString(),
  10216. read_path: i,
  10217. is_upload: n.toString(),
  10218. is_identical: a.toString()
  10219. })
  10220. }, m4 = (u, e) => u === "" ? e : cu.join(u, e), Ua = async (u, e) => {
  10221. const i = [];
  10222. let n = [];
  10223. for await(const a of u.values()) if (a.kind === "file") i.push(a.getFile().then(t => {
  10224. n.push({
  10225. entry: Z.fromPartial({
  10226. name: m4(e, t.name),
  10227. size: t.size,
  10228. entry_type: da.File,
  10229. modified_time: Math.floor(t.lastModified / 1e3)
  10230. }), handle: a
  10231. })
  10232. })); else if (a.kind === "directory") {
  10233. let t = m4(e, a.name);
  10234. const s = await Ua(a, t);
  10235. n = n.concat(s)
  10236. }
  10237. return await Promise.all(i), n
  10238. }, Ma = async (u, e) => {
  10239. let i = [], n = !0;
  10240. for await(const a of u.values()) {
  10241. if (a.kind === "directory") {
  10242. let t = m4(e, a.name);
  10243. const s = await Ma(a, t);
  10244. i = i.concat(s)
  10245. }
  10246. n = !1
  10247. }
  10248. return n && i.push(m4(e, "")), i
  10249. }, ia = 21116, defaultIdServerPort = 21116, La = "rs-ny.rustdesk.com";
  10250. function jr() {
  10251. const u = window.location.host;
  10252. if (u.indexOf("rustdesk.com") >= 0) return La;
  10253. if (window.location.host.indexOf("localhost:") == 0) return "127.0.0.1";
  10254. const e = u.split(":");
  10255. return e.length > 1 ? e[0] + ":" + (parseInt(e[1]) + 2) : u
  10256. }
  10257. const Or = jr(), ta = 100, e4 = "trust-this-device";
  10258. class Wa {
  10259. constructor() {
  10260. l(this, "_msgs");
  10261. l(this, "_ws");
  10262. l(this, "_interval");
  10263. l(this, "_updateInterval");
  10264. l(this, "_id");
  10265. l(this, "_otherServer");
  10266. l(this, "_hash");
  10267. l(this, "_msgbox");
  10268. l(this, "_draw");
  10269. l(this, "_peerInfo");
  10270. l(this, "_firstFrame");
  10271. l(this, "_frameCount");
  10272. l(this, "_videoFormat");
  10273. l(this, "_password");
  10274. l(this, "_presetPassword");
  10275. l(this, "_sharedPassword");
  10276. l(this, "_passwordSource");
  10277. l(this, "_options");
  10278. l(this, "_fpsCalc");
  10279. l(this, "_updateTs");
  10280. l(this, "_serverPerms");
  10281. l(this, "_elevationRequested");
  10282. l(this, "_supportedEncoding");
  10283. l(this, "_i444");
  10284. l(this, "_healthCheck");
  10285. l(this, "_sessionId");
  10286. l(this, "_isFileTransfer");
  10287. l(this, "_isViewCamera");
  10288. l(this, "_isTerminal");
  10289. l(this, "_isTerminalAdmin");
  10290. l(this, "_readJobs");
  10291. l(this, "_writeJobs");
  10292. l(this, "_removeJobs");
  10293. l(this, "_readRemoteEmptyDirsJobs");
  10294. l(this, "_last_update_jobs_ms");
  10295. l(this, "_fileHandles");
  10296. l(this, "_ftTimer");
  10297. l(this, "_restartingRemoteDevice");
  10298. l(this, "_enableTrustedDevices");
  10299. l(this, "_lastChangeDisplay");
  10300. l(this, "_lastSendFps");
  10301. l(this, "_videoQueue");
  10302. l(this, "_decodingVideo");
  10303. l(this, "_selectedWindowsSessionId");
  10304. l(this, "_supportTerminal");
  10305. l(this, "_remember");
  10306. l(this, "enableEmptyDirs", () => {
  10307. var e;
  10308. return L((e = this._peerInfo) == null ? void 0 : e.version) >= L("1.3.3")
  10309. });
  10310. l(this, "enableOverwriteDetection", () => {
  10311. var e;
  10312. return L((e = this._peerInfo) == null ? void 0 : e.version) >= L("1.1.10")
  10313. });
  10314. this._msgbox = Ka, this._draw = K4, this._msgs = [], this._id = "", this._frameCount = {}, this._fpsCalc = {
  10315. videoTestSpeed: [0, 0],
  10316. skipBegining: 0,
  10317. fps: void 0
  10318. }, this._updateTs = new Date().getTime(), this._serverPerms = {
  10319. keyboardEnabled: !0,
  10320. fileTransferEnabled: !0,
  10321. clipboardEnabled: !0
  10322. }, this._elevationRequested = !1, this._supportedEncoding = uu.fromPartial({}), this._sessionId = 0, this._isFileTransfer = !1, this._isViewCamera = !1, this._isTerminal = !1, this._isTerminalAdmin = !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, this._supportTerminal = !1, this._remember = !1
  10323. }
  10324. getPeerPlatform() {
  10325. var e, i;
  10326. return (i = (e = this._peerInfo) == null ? void 0 : e.platform) != null ? i : ""
  10327. }
  10328. isSupportVirtualDisplay() {
  10329. if (!this._peerInfo || !this._peerInfo.platform_additions) return !1;
  10330. try {
  10331. const e = JSON.parse(this._peerInfo.platform_additions), i = e.is_installed, n = e.idd_impl;
  10332. return i && this._peerInfo.platform == "Windows" && (n == "rustdesk_idd" || n == "amyuni_idd")
  10333. } catch (e) {
  10334. return console.error("Failed to check virtual display support, ", e), !1
  10335. }
  10336. }
  10337. isSupportViewCamera() {
  10338. if (!this._peerInfo || !this._peerInfo.platform_additions) return !1;
  10339. try {
  10340. return JSON.parse(this._peerInfo.platform_additions).support_view_camera
  10341. } catch (e) {
  10342. return console.error("Failed to check view camera support, ", e), !1
  10343. }
  10344. }
  10345. sendMessage(e) {
  10346. var i;
  10347. (i = this._ws) == null || i.sendMessage(e)
  10348. }
  10349. handleRelayId(e) {
  10350. return e.endsWith("\\r") || e.endsWith("/r") ? e.substring(0, e.length - 2) : e
  10351. }
  10352. setRemoteId(e) {
  10353. var t, s, E, D, d;
  10354. let i = Math.floor(Math.random() * Number.MAX_SAFE_INTEGER);
  10355. if (i == 0 && (i = 1), this._sessionId = i, this._restartingRemoteDevice = !1, this._id = e, e.includes("@")) {
  10356. const C = e.split("@"), c = C[0], p = ((t = C[1]) != null ? t : "").split("?"),
  10357. F = (s = p[0]) != null ? s : "", w = (E = p[1]) != null ? E : "",
  10358. y = F == z4 ? Zt : (D = w.split("&").reduce((U, Fu) => {
  10359. const Du = Fu.indexOf("=");
  10360. if (Du != -1) {
  10361. const hu = Fu.substring(0, Du).toLowerCase(), j = Fu.substring(Du + 1);
  10362. U[hu] = j
  10363. }
  10364. return U
  10365. }, {}).key) != null ? D : "", A = this.handleRelayId(c);
  10366. this._otherServer = {realId: A, server: F, key: y}, this._id = `${A}@${F}`
  10367. } else this._id = this.handleRelayId(e);
  10368. const n = (d = mu()[this._id]) != null ? d : {};
  10369. if (this._options = {...this.getUserDefaultToggleOptions(), ...n}, this._otherServer && !this._otherServer.key) {
  10370. const C = this.getOption("other-server-key");
  10371. C && (this._otherServer.key = C)
  10372. }
  10373. const a = this.getOption("password");
  10374. typeof a == "string" && a.length > 0 && (this._remember = !0)
  10375. }
  10376. setSessionInfo(e) {
  10377. this._isFileTransfer = e.isFileTransfer, this._isViewCamera = e.isViewCamera, this._isTerminal = e.isTerminal, this._isTerminalAdmin = Ge.IS_TERMINAL_ADMIN === "Y", delete Ge.IS_TERMINAL_ADMIN, e.is_shared_password ? this._sharedPassword = e.password : this._presetPassword = e.password
  10378. }
  10379. async start() {
  10380. if (an(!1)) {
  10381. Qs(), on();
  10382. return
  10383. }
  10384. try {
  10385. Dr(), await this._start()
  10386. } catch (e) {
  10387. this.msgbox("error", "Connection Error", e.type == "close" ? "Reset by the peer" : String(e))
  10388. }
  10389. }
  10390. getId() {
  10391. var e, i;
  10392. return (i = (e = this._otherServer) == null ? void 0 : e.realId) != null ? i : this._id
  10393. }
  10394. async _start() {
  10395. var F, w;
  10396. let e = this.getId(), i = za(), n = Pa(), a = (F = this._otherServer) == null ? void 0 : F.server;
  10397. this._otherServer && (i = this._otherServer.key, n = "");
  10398. let t = "";
  10399. a ? a == z4 ? t = o4(La) : t = o4(a) : t = n4(), this._options || (this._options = (w = mu()[this._id]) != null ? w : this.getUserDefaultToggleOptions()), this._interval = setInterval(() => {
  10400. var y;
  10401. for (; this._msgs.length;) (y = this._ws) == null || y.sendMessage(this._msgs[0]), this._msgs.splice(0, 1)
  10402. }, 1);
  10403. const s = new l4(t, !0, "rendezvous");
  10404. 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");
  10405. const E = this._isFileTransfer ? Ve.FILE_TRANSFER : this._isViewCamera ? Ve.VIEW_CAMERA : this._isTerminal ? Ve.TERMINAL : Ve.DEFAULT_CONN,
  10406. D = Ca.SYMMETRIC, d = t0.fromPartial({
  10407. id: e,
  10408. licence_key: i,
  10409. conn_type: E,
  10410. nat_type: D,
  10411. token: n,
  10412. version: U4,
  10413. force_relay: !0
  10414. });
  10415. s.sendRendezvous({punch_hole_request: d});
  10416. const C = await s.next();
  10417. s.close(), console.log(new Date + ": Got relay response");
  10418. const c = C.punch_hole_response, p = C.relay_response;
  10419. if (c) {
  10420. if (c != null && c.other_failure) {
  10421. this.msgbox("error", "Error", c == null ? void 0 : c.other_failure);
  10422. return
  10423. }
  10424. if (c.failure != Ae.UNRECOGNIZED) switch (c == null ? void 0 : c.failure) {
  10425. case Ae.ID_NOT_EXIST:
  10426. this.msgbox("error", "Error", "ID does not exist");
  10427. break;
  10428. case Ae.OFFLINE:
  10429. this.msgbox("error", "Error", "Remote desktop is offline");
  10430. break;
  10431. case Ae.LICENSE_MISMATCH:
  10432. this.msgbox("error", "Error", "Key mismatch");
  10433. break;
  10434. case Ae.LICENSE_OVERUSE:
  10435. this.msgbox("error", "Error", "Key overuse");
  10436. break
  10437. }
  10438. } else if (p) {
  10439. if (!p.version) {
  10440. this.msgbox("error", "Error", "Remote version is low, not support web");
  10441. return
  10442. }
  10443. this._healthCheck = new Er(t, p.feedback, i, n), this._healthCheck.start(), await this.connectRelay(p, i)
  10444. }
  10445. }
  10446. async connectRelay(e, i) {
  10447. var d, C;
  10448. const n = e.pk;
  10449. let a = e.relay_server;
  10450. a ? a = o4(a, !0) : a = n4(!0);
  10451. const t = e.uuid;
  10452. console.log(new Date + ": Connecting to relay server: " + a);
  10453. const s = new l4(a, !1, "relay");
  10454. await s.open(), console.log(new Date + ": Connected to relay server"), this._ws = s;
  10455. const E = a0.fromPartial({licence_key: i, uuid: t});
  10456. s.sendRendezvous({request_relay: E});
  10457. const D = await this.secure(n, i) || !1;
  10458. m("connection_ready", {secure: D, direct: !1}), this._updateInterval = setInterval(() => {
  10459. this.updateStatus()
  10460. }, 1e3), (d = this._ws) == null || d.on("message", this.msgHandler.bind(this)), (C = this._ws) == null || C.on("status_change", this.onStatusChange.bind(this))
  10461. }
  10462. async secure(e, i) {
  10463. var F, w, y, A, U, Fu, Du, hu;
  10464. if (e) {
  10465. try {
  10466. if (e = await H4(e, i || Zt), e) {
  10467. const j = j4.decode(e);
  10468. j.id == this.getId() && (e = j.pk)
  10469. }
  10470. (e == null ? void 0 : e.length) != 32 && (e = void 0)
  10471. } catch (j) {
  10472. console.error("Failed to verify id pk, ", j), e = void 0
  10473. }
  10474. e || console.error("Handshake failed: invalid public key from rendezvous server")
  10475. }
  10476. if (!e) {
  10477. const j = X.fromPartial({});
  10478. (F = this._ws) == null || F.sendMessage({public_key: j});
  10479. return
  10480. }
  10481. const n = await ((w = this._ws) == null ? void 0 : w.next());
  10482. let a = n == null ? void 0 : n.signed_id;
  10483. if (!a) {
  10484. console.error("Handshake failed: invalid message type");
  10485. const j = X.fromPartial({});
  10486. (y = this._ws) == null || y.sendMessage({public_key: j});
  10487. return
  10488. }
  10489. try {
  10490. a = await H4(a.id, Uint8Array.from(e))
  10491. } catch (j) {
  10492. console.error("Failed to verify signed id pk, ", j), console.error("pk mismatch, fall back to non-secure");
  10493. const w4 = X.fromPartial({});
  10494. (A = this._ws) == null || A.sendMessage({public_key: w4});
  10495. return
  10496. }
  10497. const t = j4.decode(a), s = t.id, E = t.pk;
  10498. if (s != this.getId()) {
  10499. console.error("Handshake failed: sign failure");
  10500. const j = X.fromPartial({});
  10501. (U = this._ws) == null || U.sendMessage({public_key: j});
  10502. return
  10503. }
  10504. if (E.length != 32) {
  10505. console.error("Handshake failed: invalid public box key length from peer");
  10506. const j = X.fromPartial({});
  10507. (Fu = this._ws) == null || Fu.sendMessage({public_key: j});
  10508. return
  10509. }
  10510. const [D, d] = ks(), C = hs(), c = fs(C, E, D), p = X.fromPartial({asymmetric_value: d, symmetric_value: c});
  10511. return (Du = this._ws) == null || Du.sendMessage({public_key: p}), (hu = this._ws) == null || hu.setSecretKey(C), console.log("secured"), !0
  10512. }
  10513. async msgHandler(e) {
  10514. var i;
  10515. if (this._ws) if (e != null && e.hash) await this.handleHash(e.hash); else if (e != null && e.test_delay) {
  10516. const n = e == null ? void 0 : e.test_delay;
  10517. n.from_client || (m("update_quality_status", {
  10518. delay: `${n.last_delay}`,
  10519. target_bitrate: `${n.target_bitrate}`
  10520. }), (i = this._ws) == null || i.sendMessage({test_delay: n}))
  10521. } 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) o3(e == null ? void 0 : e.clipboard); else if (e != null && e.multi_clipboards) Ar(e == null ? void 0 : e.multi_clipboards); else if (e != null && e.cursor_data) {
  10522. const n = e == null ? void 0 : e.cursor_data;
  10523. _4(n.colors, !1, a => {
  10524. a && (n.colors = a, m("cursor_data", n))
  10525. })
  10526. } else if (e != null && e.cursor_id) m("cursor_id", {id: e == null ? void 0 : e.cursor_id}); else if (e != null && e.cursor_position) m("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) Ss(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) {
  10527. const n = e.file_action;
  10528. await this.handleFileAction(n)
  10529. } else e.terminal_response && this.handleTerminalResponse(e.terminal_response)
  10530. }
  10531. onStatusChange(e) {
  10532. if (e === "" || e === "open") return;
  10533. if (this._restartingRemoteDevice) {
  10534. this.msgbox("restarting", "Restarting remote device", "remote_restarting_tip", "");
  10535. return
  10536. }
  10537. if (e instanceof CloseEvent && e.code == 1e3 || !this._ws) return;
  10538. e && console.error("msgLoop error: ", e);
  10539. const i = "Connection Error";
  10540. let n = "";
  10541. if (e === "Timeout") n = "Connection timeout"; else if (e instanceof CloseEvent) {
  10542. let a = `code: ${e.code}`;
  10543. e.reason && (a += `, reason: ${e.reason}`), n = `Connection closed, ${a}`
  10544. } else e instanceof Error ? n = e.message : typeof e.toString == "function" ? n = e.toString() : n = "";
  10545. this.msgbox("error", i, n, "")
  10546. }
  10547. enterOrLeave(e) {
  10548. e === !1 ? (ir(), L4(), lr(!1)) : (q4(), Na(this))
  10549. }
  10550. makeDisplaysMsg(e) {
  10551. let i = [];
  10552. return e.forEach(n => {
  10553. let a = {};
  10554. 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)
  10555. }), JSON.stringify(i)
  10556. }
  10557. handleSyncPeerInfo(e) {
  10558. this._peerInfo && (this._peerInfo.displays = e.displays), m("sync_peer_info", {displays: this.makeDisplaysMsg(e.displays)}), m("sync_platform_additions", {platform_additions: e.platform_additions})
  10559. }
  10560. handleMsgBox(e) {
  10561. let i = e.link;
  10562. i in qt ? i = qt[i] : (console.warn("Message box ignore link " + i + " for security"), i = ""), this.msgbox(e.msgtype, e.title, e.text, i)
  10563. }
  10564. updateStatus() {
  10565. var s, E;
  10566. const e = new Date().getTime(), i = e - this._updateTs;
  10567. if (i < 1e3) return;
  10568. this._updateTs = e;
  10569. const n = ((s = this._ws) == null ? void 0 : s.getRecvDataCount()) || 0;
  10570. (E = this._ws) == null || E.resetRecvDataCount();
  10571. const a = `${(n / 1024 / i * 1e3).toFixed(2)} kb/s`, t = {};
  10572. for (const D in this._frameCount) if (this._frameCount.hasOwnProperty(D)) {
  10573. const d = this._frameCount[D];
  10574. t[D] = Math.floor(d / (i / 1e3))
  10575. }
  10576. this._frameCount = {}, m("update_quality_status", {speed: a, fps: JSON.stringify(t)})
  10577. }
  10578. handleLoginResponse(e) {
  10579. const i = {
  10580. [$n]: {
  10581. msgtype: "error",
  10582. title: "Login Error",
  10583. text: "Login screen using Wayland is not supported",
  10584. link: "https://rustdesk.com/docs/en/manual/linux/#login-screen",
  10585. try_again: !0
  10586. },
  10587. [Wn]: {msgtype: "session-login", title: "", text: "", link: "", try_again: !0},
  10588. [Vn]: {msgtype: "session-re-login", title: "", text: "", link: "", try_again: !0},
  10589. [qn]: {
  10590. msgtype: "info-nocancel",
  10591. title: "another_user_login_title_tip",
  10592. text: "another_user_login_text_tip",
  10593. link: "",
  10594. try_again: !1
  10595. },
  10596. [Kn]: {
  10597. msgtype: "info-nocancel",
  10598. title: "xorg_not_found_title_tip",
  10599. text: "xorg_not_found_text_tip",
  10600. link: "https://rustdesk.com/docs/en/manual/linux/#login-screen",
  10601. try_again: !0
  10602. },
  10603. [Hn]: {
  10604. msgtype: "info-nocancel",
  10605. title: "no_desktop_title_tip",
  10606. text: "no_desktop_text_tip",
  10607. link: "https://rustdesk.com/docs/en/manual/linux/#login-screen",
  10608. try_again: !0
  10609. },
  10610. [Jn]: {msgtype: "session-login-password", title: "", text: "", link: "", try_again: !0},
  10611. [Gn]: {msgtype: "session-login-re-password", title: "", text: "", link: "", try_again: !0},
  10612. [Yn]: {
  10613. msgtype: "wait-remote-accept-nook",
  10614. title: "Prompt",
  10615. text: "Please wait for the remote side to accept your session request...",
  10616. link: "",
  10617. try_again: !0
  10618. }
  10619. }, n = e.error;
  10620. if (n) if (n == Vt && (this._enableTrustedDevices = e.enable_trusted_devices), n == Zn && (this._password = void 0, this.msgbox("input-password", "Password Required", "", "")), n == Qn) this._password = void 0, this.msgbox("re-input-password", n, "Do you want to enter again?"); else if (n == Xn || n == Vt) this.getOption(e4) == "Y" && this.setOption(e4, void 0), this.msgbox("input-2fa", n, ""); else if (n in i) {
  10621. const a = i[n];
  10622. this.msgbox(a.msgtype, a.title, a.text, a.link)
  10623. } else n.includes(uo) ? this.msgbox("error", "Login Error", n, Aa) : this.msgbox("error", "Login Error", n); else e.peer_info && (this._firstFrame = !1, this.handlePeerInfo(e.peer_info))
  10624. }
  10625. enableTrustedDevices() {
  10626. return this._enableTrustedDevices
  10627. }
  10628. msgbox(e, i, n, a = "") {
  10629. var t;
  10630. (t = this._msgbox) == null || t.call(this, e, i, n, a)
  10631. }
  10632. cancelMsgbox(e) {
  10633. m("cancel_msgbox", {tag: e})
  10634. }
  10635. draw(e, i) {
  10636. K4(e, new Uint8Array(i.data))
  10637. }
  10638. close() {
  10639. var e, i;
  10640. 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 = [], L4(), this._lastChangeDisplay = void 0, this._lastSendFps = void 0, this._videoQueue = [], this._decodingVideo = !1
  10641. }
  10642. refresh() {
  10643. var i;
  10644. const e = f.fromPartial({refresh_video: !0});
  10645. (i = this._ws) == null || i.sendMessage({misc: e})
  10646. }
  10647. setMsgbox(e) {
  10648. this._msgbox = e
  10649. }
  10650. setDraw(e) {
  10651. this._draw = e
  10652. }
  10653. async handleHash(e) {
  10654. this._hash = e;
  10655. let i = this._password;
  10656. (!i || i.length === 0) && this._presetPassword && (i = r0([this._presetPassword, e.salt]), this._passwordSource = {type: "Undefined"});
  10657. let n = this._sharedPassword;
  10658. if (this._sharedPassword = void 0, n && (i = r0([n, e.salt]), this._passwordSource = {
  10659. type: "SharedAb",
  10660. value: n
  10661. }), !i || i.length === 0) {
  10662. const E = this.getOption("password");
  10663. typeof E == "string" && E.length > 0 && (i = Ie(E), this._passwordSource = {type: "Undefined"})
  10664. }
  10665. if (!i || i.length === 0) {
  10666. let E = X4("access_token"), D = await xa();
  10667. if (E && E === D.access_token) {
  10668. let d = D.ab_entries.find(C => Po(C));
  10669. if (d) {
  10670. let C = d.peers.find(c => c.id == this._id);
  10671. if (C) {
  10672. let c = Ie(C.hash);
  10673. c.length > 0 && (i = c, this._passwordSource = {type: "PersonalAb", value: c})
  10674. }
  10675. }
  10676. }
  10677. }
  10678. if (this._password = i, this._isTerminal && this._isTerminalAdmin) {
  10679. !i || i.length === 0 ? this.msgbox("terminal-admin-login-password", "", "") : this.msgbox("terminal-admin-login", "", "");
  10680. return
  10681. }
  10682. let a;
  10683. !i || i.length === 0 ? (a = new Uint8Array(0), this.msgbox("input-password", "Password Required", "")) : a = r0([i, e.challenge]);
  10684. let t = this.getOption("os-username") || "", s = this.getOption("os-password") || "";
  10685. this._sendLoginMessage({os_login: {username: t, password: s}, password: a})
  10686. }
  10687. handle_login_from_ui(e, i, n, a) {
  10688. let t;
  10689. if (n === "") {
  10690. let E = this._password;
  10691. if (!E || E.length === 0) {
  10692. const D = this.getOption("password");
  10693. typeof D == "string" && D.length > 0 && (E = Ie(D), this._passwordSource = {type: "Undefined"})
  10694. }
  10695. t = E
  10696. } else this._passwordSource = {type: "Undefined"}, t = r0([n, this._hash.salt]), this._remember = a;
  10697. this._password = t;
  10698. let s = r0([t != null ? t : Uint8Array.from([]), this._hash.challenge]);
  10699. this._sendLoginMessage({os_login: {username: e, password: i}, password: s})
  10700. }
  10701. changePreferCodec() {
  10702. var a;
  10703. const e = this.getSupportedDecoding(), i = O.fromPartial({supported_decoding: e}),
  10704. n = f.fromPartial({option: i});
  10705. (a = this._ws) == null || a.sendMessage({misc: n})
  10706. }
  10707. async reconnect() {
  10708. this.close(), await this.start()
  10709. }
  10710. _getHwid(e = void 0) {
  10711. return (e != null ? e : this.getOption(e4) == "Y") ? Wo() : new Uint8Array
  10712. }
  10713. _getKeyTerminalServiceId() {
  10714. return this._isTerminalAdmin ? "terminal-admin-service-id" : "terminal-service-id"
  10715. }
  10716. _sendLoginMessage(e) {
  10717. var C;
  10718. const i = this._otherServer ? `${Ze()}@${n4()}` : Ze(), n = Ko();
  10719. let a = Sa();
  10720. if (n) try {
  10721. const c = JSON.parse(n);
  10722. c.name && (a = c.name)
  10723. } catch (c) {
  10724. console.error("Failed to get user info, ", c)
  10725. }
  10726. let t;
  10727. if (this._isFileTransfer) {
  10728. let c = this.getOption("remote_dir"), p = this.getOption("remote_show_hidden") === "Y";
  10729. t = xu.fromPartial({dir: c, show_hidden: p})
  10730. }
  10731. let s;
  10732. this._isViewCamera && (s = yu.fromPartial({}));
  10733. let E;
  10734. this._isTerminal && (E = bu.fromPartial({service_id: this.getOption(this._getKeyTerminalServiceId()) || ""}));
  10735. const D = this._getHwid(), d = Y.fromPartial({
  10736. username: this.getId(),
  10737. my_id: i,
  10738. my_name: a,
  10739. session_id: this._sessionId,
  10740. password: e.password,
  10741. option: this.getOptionMessage(),
  10742. video_ack_required: !0,
  10743. os_login: e.os_login,
  10744. version: U4,
  10745. my_platform: so,
  10746. file_transfer: t,
  10747. view_camera: s,
  10748. terminal: E,
  10749. hwid: D
  10750. });
  10751. (C = this._ws) == null || C.sendMessage({login_request: d})
  10752. }
  10753. getOptionMessage() {
  10754. if (this._isFileTransfer) return;
  10755. if (this._isTerminal) {
  10756. const E = O.fromPartial({});
  10757. return this.getToggleOption("terminal-persistent") ? (E.terminal_persistent = S.Yes, E) : void 0
  10758. }
  10759. let e = 0;
  10760. const i = O.fromPartial({}), n = this.getImageQuality(), a = this.getImageQualityEnum(n, !0), t = S.Yes;
  10761. if (a != null) i.image_quality = a, e += 1; else if (n === "custom") {
  10762. let E = 50, D = this.getOption("custom_image_quality");
  10763. if (D) try {
  10764. E = parseInt(D)
  10765. } catch {
  10766. }
  10767. i.custom_image_quality = E << 8, e += 1;
  10768. let d = this.getOption("custom-fps");
  10769. if (d) try {
  10770. i.custom_fps = parseInt(d), this._lastSendFps = i.custom_fps, e += 1
  10771. } catch {
  10772. }
  10773. }
  10774. const s = this.getOption("view-only");
  10775. 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
  10776. }
  10777. sendVideoReceived() {
  10778. var i;
  10779. const e = f.fromPartial({video_received: !0});
  10780. (i = this._ws) == null || i.sendMessage({misc: e})
  10781. }
  10782. getCodecFormat(e) {
  10783. return e.vp9s ? "VP9" : e.vp8s ? "VP8" : e.av1s ? "AV1" : e.h264s ? "H264" : e.h265s ? "H265" : "Unknown"
  10784. }
  10785. getSupportedEncoding() {
  10786. return this._supportedEncoding
  10787. }
  10788. getSupportedDecoding() {
  10789. let e = this.getOption("codec-preference");
  10790. e == "vp8" ? e = fu.VP8 : e == "vp9" ? e = fu.VP9 : e == "av1" ? e = fu.AV1 : e == "h264" ? e = fu.H264 : e == "h265" ? e = fu.H265 : e = fu.Auto;
  10791. let i = this.getOption("i444") == "Y" ? N4.I444 : N4.I420;
  10792. return Yu.fromPartial({
  10793. ability_vp8: 1,
  10794. ability_vp9: 1,
  10795. ability_av1: 1,
  10796. ability_h264: 1,
  10797. ability_h265: 1,
  10798. prefer: e,
  10799. prefer_chroma: i,
  10800. i444: $.fromPartial({vp9: !0, av1: !0})
  10801. })
  10802. }
  10803. getAlternativeCodecs() {
  10804. const e = this.getSupportedEncoding(), i = this.getSupportedDecoding();
  10805. return JSON.stringify({
  10806. vp8: e.vp8 && i.ability_vp8 == 1,
  10807. av1: e.av1 && i.ability_av1 == 1,
  10808. h264: e.h264 && i.ability_h264 == 1,
  10809. h265: e.h265 && i.ability_h265 == 1
  10810. })
  10811. }
  10812. fpsCalculate(e, i) {
  10813. if (e) {
  10814. this._fpsCalc.skipBegining = 0, this._fpsCalc.videoTestSpeed = [0, 0];
  10815. return
  10816. }
  10817. if (this._fpsCalc.skipBegining < 3) {
  10818. this._fpsCalc.skipBegining += 1;
  10819. return
  10820. }
  10821. 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])
  10822. }
  10823. handleVideoFrame(e) {
  10824. if (!this._firstFrame) {
  10825. this.msgbox("", "", ""), this._firstFrame = !0, this.sendToggleVirtualDisplayMsg(), this.sendTogglePrivacyModeMsg(), q4();
  10826. const i = 0;
  10827. for (let n = 0; n < i; n++) this.sendVideoReceived();
  10828. console.log(`send ${i} video received in advance for high fps`)
  10829. }
  10830. this._videoQueue.push(e), this._decodingVideo || this.processVideoQueue()
  10831. }
  10832. async processVideoQueue() {
  10833. this._decodingVideo = !0;
  10834. try {
  10835. for (; this._videoQueue.length > 0;) await this.handleOneVideoFrame(this._videoQueue.shift())
  10836. } catch (e) {
  10837. console.error("deal video queue failed", e)
  10838. }
  10839. this._decodingVideo = !1
  10840. }
  10841. async handleOneVideoFrame(e) {
  10842. const i = this.getCodecFormat(e), n = this._videoFormat != i;
  10843. n && (this._videoFormat = i, m("update_quality_status", {codec_format: i}));
  10844. var a = new Date().getTime(), t = 0, s = void 0;
  10845. 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 {
  10846. console.log("unknown codec");
  10847. return
  10848. }
  10849. const E = s == null ? void 0 : s.frames.length;
  10850. this._frameCount[e.display] = (this._frameCount[e.display] || 0) + E, this.sendVideoReceived();
  10851. try {
  10852. for (let D = 0; D < E; D++) {
  10853. let d = s.frames[D];
  10854. const C = await Mn(t, d.data.slice(0).buffer);
  10855. if (C.data && E - 1 == D) {
  10856. this.draw(e.display, C.data);
  10857. const c = new Date().getTime();
  10858. this.fpsCalculate(n, c - a);
  10859. const p = C.data.yuvFormat == 5;
  10860. this._i444 != p && (this._i444 = p, m("update_quality_status", {chroma: p ? "4:4:4" : "4:2:0"}))
  10861. }
  10862. }
  10863. } catch (D) {
  10864. console.error("decode error: ", D)
  10865. }
  10866. }
  10867. sendToggleVirtualDisplayMsg() {
  10868. if (!this.isSupportVirtualDisplay()) return;
  10869. const e = this.getOption("virtual-display");
  10870. !e || e.split(",").forEach(i => {
  10871. const n = Number(i);
  10872. isNaN(n) || this._sendToggleVirtualDisplayMsg(n, !0)
  10873. })
  10874. }
  10875. sendTogglePrivacyModeMsg() {
  10876. if (!!this._peerInfo && !(L(this._peerInfo.version) < L("1.2.4")) && this.getOption("privacy-mode")) {
  10877. const e = this.getOption("privacy-mode-impl-key");
  10878. if (e == "privacy_mode_impl_virtual_display" && this.isSupportVirtualDisplay()) return;
  10879. this._sendTogglePrivacyModeMsg(e, !0)
  10880. }
  10881. }
  10882. handlePeerInfo(e) {
  10883. var a, t, s;
  10884. if (this._peerInfo = e, e.features && (this._supportTerminal = e.features.terminal), this._isTerminal && !this._supportTerminal) {
  10885. L(e.version) < L("1.4.1") ? this.msgbox("error", "Remote terminal not supported", "Remote terminal is not supported by the remote side. Please upgrade to version 1.4.1 or higher.") : this.msgbox("error", "Error", "Remote terminal is not supported by the remote side"), this.lcHandlePeerInfo(e), this.close();
  10886. return
  10887. }
  10888. if (this._isViewCamera && !this.isSupportViewCamera()) {
  10889. 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();
  10890. return
  10891. }
  10892. if (e.current_display > e.displays.length && (e.current_display = 0), L(e.version) < L("1.1.10") && this.setPermission("restart", !1), this._isFileTransfer) {
  10893. if (!e.username.length && !((a = e.windows_sessions) != null && a.sessions.length)) {
  10894. this.msgbox("error", "Error", "No active console user logged on, please connect and logon first.");
  10895. return
  10896. }
  10897. } else if (!this._isTerminal && e.displays.length == 0) {
  10898. this.lcHandlePeerInfo(e), m("update_privacy_mode", {}), this.msgbox("error", "Remote Error", "No display");
  10899. return
  10900. }
  10901. m("peer_info", {
  10902. ...e,
  10903. displays: this.makeDisplaysMsg(e.displays),
  10904. resolutions: JSON.stringify(e.resolutions)
  10905. }), !this._isFileTransfer && !this._isTerminal && (this.msgbox("success", "Successful", "Connected, waiting for image..."), this.tryChangeInitResolution(e.current_display));
  10906. const i = this.shouldAutoLogin();
  10907. i && this.inputOsPassword(i);
  10908. const n = (t = this.getOption("info")) == null ? void 0 : t.username;
  10909. n && !e.username && (e.username = n), m("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))
  10910. }
  10911. lcHandlePeerInfo(e) {
  10912. var E;
  10913. let i = M4(this._id) || {};
  10914. i.info = {username: e.username, hostname: e.hostname, platform: e.platform};
  10915. let n = this._password, a = i.password, t = this.getRemember(), s = this._hash;
  10916. t ? n && n.length > 0 && q(n) !== a && !aa(this._passwordSource, n, s) && (i.password = q(n), console.log("remember password of " + this._id)) : n && n.length > 0 && na(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 != z4 && this.setOption("other-server-key", this._otherServer.key), i.password && n && n.length > 0 && !aa(this._passwordSource, n, s) && !na(this._passwordSource, n) && m("sync_peer_hash_password_to_personal_ab", {
  10917. id: this._id,
  10918. hash: q(n)
  10919. }), this.saveConfig(i), e.encoding && (this._supportedEncoding = e.encoding)
  10920. }
  10921. setPermission(e, i) {
  10922. m("permission", {[e]: i})
  10923. }
  10924. shouldAutoLogin() {
  10925. const e = this.getOption("lock-after-session-end"), i = !!this.getOption("auto-login"),
  10926. n = this.getOption("os-password");
  10927. return n && e && i ? n : ""
  10928. }
  10929. handleMisc(e) {
  10930. if (e.audio_format) ws(e.audio_format.channels, e.audio_format.sample_rate); else if (e.chat_message) m("chat_client_mode", {text: e.chat_message.text}); else if (e.permission_info) {
  10931. const i = e.permission_info;
  10932. console.info("Change permission " + i.permission + " -> " + i.enabled);
  10933. let n;
  10934. switch (i.permission) {
  10935. case p0.Keyboard:
  10936. this._serverPerms.keyboardEnabled = i.enabled, n = "keyboard";
  10937. break;
  10938. case p0.Clipboard:
  10939. this._serverPerms.clipboardEnabled = i.enabled, n = "clipboard";
  10940. break;
  10941. case p0.Audio:
  10942. n = "audio";
  10943. break;
  10944. case p0.Restart:
  10945. n = "restart";
  10946. break;
  10947. case p0.BlockInput:
  10948. n = "block_input";
  10949. break;
  10950. default:
  10951. return !0
  10952. }
  10953. this.setPermission(n, i.enabled)
  10954. } else if (e.switch_display) m("switch_display", e.switch_display), this.setCustomResolution(e.switch_display); else {
  10955. if (e.close_reason) return this.msgbox("error", "Connection Error", e.close_reason), this.close(), !1;
  10956. if (e.back_notification) {
  10957. if (!this.handleBackNotification(e.back_notification)) return this.close(), !1
  10958. } 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)
  10959. }
  10960. return !0
  10961. }
  10962. handleTerminalResponse(e) {
  10963. if (e.opened) e.opened.success && e.opened.service_id && this.setOption(this._getKeyTerminalServiceId(), e.opened.service_id), m("terminal_response", {
  10964. type: "opened",
  10965. terminal_id: e.opened.terminal_id,
  10966. success: e.opened.success,
  10967. message: e.opened.message,
  10968. pid: e.opened.pid || 0,
  10969. service_id: e.opened.service_id || ""
  10970. }); else if (e.closed) m("terminal_response", {
  10971. type: "closed",
  10972. terminal_id: e.closed.terminal_id,
  10973. exit_code: e.closed.exit_code
  10974. }); else if (e.error) m("terminal_response", {
  10975. type: "error",
  10976. terminal_id: e.error.terminal_id,
  10977. message: e.error.message
  10978. }); else if (e.data) {
  10979. const i = e.data;
  10980. i.compressed ? _4(i.data, !1, n => {
  10981. n && m("terminal_response", {type: "data", terminal_id: i.terminal_id, data: q(n)})
  10982. }) : m("terminal_response", {type: "data", terminal_id: i.terminal_id, data: q(i.data)})
  10983. }
  10984. }
  10985. portableServiceRunning(e) {
  10986. m("portable_service_running", {running: e.toString()})
  10987. }
  10988. handleFollowCurrentDisplay(e) {
  10989. m("follow_current_display", {display_idx: e.toString()})
  10990. }
  10991. handleBackNotification(e) {
  10992. 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);
  10993. return !0
  10994. }
  10995. updateBlockInputState(e) {
  10996. m("update_block_input_state", {input_state: e ? "on" : "off"})
  10997. }
  10998. handleBackMsgBlockInput(e, i) {
  10999. switch (e) {
  11000. case We.BlkOnSucceeded:
  11001. this.updateBlockInputState(!0);
  11002. break;
  11003. case We.BlkOnFailed:
  11004. this.msgbox("custom-error", "Block user input", i == "" ? "Failed" : i, ""), this.updateBlockInputState(!1);
  11005. break;
  11006. case We.BlkOffSucceeded:
  11007. this.updateBlockInputState(!1);
  11008. break;
  11009. case We.BlkOffFailed:
  11010. this.msgbox("custom-error", "Unblock user input", i == "" ? "Failed" : i, "");
  11011. break
  11012. }
  11013. }
  11014. updatePrivacyMode(e, i) {
  11015. i && (e == "" && (e = "privacy_mode_impl_mag"), this.setOption("privacy-mode-impl-key", e)), this.setOption("privacy-mode", i), m("update_privacy_mode", {})
  11016. }
  11017. handleBackMsgPrivacyMode(e, i, n) {
  11018. switch (e) {
  11019. case su.PrvOnByOther:
  11020. return this.msgbox("error", "Connecting...", "Someone turns on privacy mode, exit", ""), !1;
  11021. case su.PrvNotSupported:
  11022. this.msgbox("custom-error", "Privacy mode", "Unsupported", ""), this.updatePrivacyMode(n, !1);
  11023. break;
  11024. case su.PrvOnSucceeded:
  11025. this.msgbox("custom-nocancel", "Privacy mode", "Enter privacy mode", ""), this.updatePrivacyMode(n, !0);
  11026. break;
  11027. case su.PrvOnFailedDenied:
  11028. this.msgbox("custom-error", "Privacy mode", "Peer denied", ""), this.updatePrivacyMode(n, !1);
  11029. break;
  11030. case su.PrvOnFailedPlugin:
  11031. this.msgbox("custom-error", "Privacy mode", "Please install plugins", ""), this.updatePrivacyMode(n, !1);
  11032. break;
  11033. case su.PrvOnFailed:
  11034. this.msgbox("custom-error", "Privacy mode", i == "" ? "Failed" : i, ""), this.updatePrivacyMode(n, !1);
  11035. break;
  11036. case su.PrvOffSucceeded:
  11037. this.msgbox("custom-nocancel", "Privacy mode", "Exit privacy mode", ""), this.updatePrivacyMode(n, !1);
  11038. break;
  11039. case su.PrvOffFailed:
  11040. this.msgbox("custom-error", "Privacy mode", i == "" ? "Failed to turn off" : i, "");
  11041. break;
  11042. case su.PrvOffUnknown:
  11043. this.msgbox("custom-error", "Privacy mode", "Turned off", ""), this.updatePrivacyMode(n, !1);
  11044. break
  11045. }
  11046. return !0
  11047. }
  11048. getRemember() {
  11049. return this._remember
  11050. }
  11051. getOption(e) {
  11052. var i;
  11053. return (i = this._options[e]) != null ? i : d0(e)
  11054. }
  11055. getUserDefaultToggleOptions() {
  11056. const e = {}, i = {
  11057. "show-remote-cursor": "show_remote_cursor",
  11058. "lock-after-session-end": "lock_after_session_end",
  11059. "privacy-mode": "privacy_mode",
  11060. "enable-file-copy-paste": "enable-file-copy-paste",
  11061. "disable-audio": "disable_audio",
  11062. "disable-clipboard": "disable_clipboard",
  11063. "show-quality-monitor": "show_quality_monitor",
  11064. allow_swap_key: "allow_swap_key",
  11065. "view-only": "view_only",
  11066. "follow-remote-cursor": "follow_remote_cursor",
  11067. "follow-remote-window": "follow_remote_window",
  11068. "terminal-persistent": "terminal-persistent"
  11069. };
  11070. for (const [a, t] of Object.entries(i)) e[a] = d0(t) == "Y";
  11071. const n = ["codec-preference", "custom-fps", "zoom-cursor", "touch-mode", "i444", "swap-left-right-mouse", "collapse_toolbar"];
  11072. for (const a of n) e[a] = d0(a);
  11073. return e
  11074. }
  11075. getToggleOption(e) {
  11076. const i = ["show-remote-cursor", "privacy-mode", "enable-file-copy-paste", "terminal-persistent"],
  11077. n = this._options[e];
  11078. return typeof n == "string" ? n != "" : n != null ? n : !!i.includes(e)
  11079. }
  11080. getStatus() {
  11081. return JSON.stringify({status_num: 10})
  11082. }
  11083. checkConnStatus() {
  11084. }
  11085. saveConfig(e) {
  11086. this._options = e, this._options.tm = new Date().getTime(), ko(this._id, e)
  11087. }
  11088. loadConfig() {
  11089. return M4(this._id) || {}
  11090. }
  11091. setOption(e, i) {
  11092. i == null ? delete this._options[e] : this._options[e] = i, this._options.tm = new Date().getTime(), ka(this._id, e, i)
  11093. }
  11094. setFlutterUiOption(e, i) {
  11095. this.setOption(`flutter_ui:${e}`, i)
  11096. }
  11097. getFlutterUiOption(e) {
  11098. return this.getOption(`flutter_ui:${e}`)
  11099. }
  11100. inputKey(e, i, n, a, t, s, E) {
  11101. var d;
  11102. const D = Oo(e, _s());
  11103. !D || (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), D.down = i, D.press = n, D.modifiers = this.getMod(a, t, s, E), (d = this._ws) == null || d.sendMessage({key_event: D}))
  11104. }
  11105. ctrlAltDel() {
  11106. var i, n;
  11107. const e = I.fromPartial({down: !0});
  11108. ((i = this._peerInfo) == null ? void 0 : i.platform) == "Windows" ? e.control_key = V.CtrlAltDel : (e.control_key = V.Delete, e.modifiers = this.getMod(!0, !0, !1, !1)), (n = this._ws) == null || n.sendMessage({key_event: e})
  11109. }
  11110. restart() {
  11111. var i;
  11112. this._restartingRemoteDevice = !0;
  11113. const e = f.fromPartial({});
  11114. e.restart_remote_device = !0, (i = this._ws) == null || i.sendMessage({misc: e})
  11115. }
  11116. inputString(e) {
  11117. var n;
  11118. const i = I.fromPartial({seq: e});
  11119. (n = this._ws) == null || n.sendMessage({key_event: i})
  11120. }
  11121. send2fa(e) {
  11122. var i;
  11123. try {
  11124. const n = JSON.parse(e), a = n.code, t = n.trust_this_device;
  11125. t && this.setOption(e4, "Y");
  11126. const s = this._getHwid(t), E = wu.fromPartial({code: a, hwid: s});
  11127. (i = this._ws) == null || i.sendMessage({auth_2fa: E})
  11128. } catch {
  11129. console.log('Failed to switch display, invalid param "' + e + '"')
  11130. }
  11131. }
  11132. _captureDisplays({add: e, sub: i, set: n}) {
  11133. var s;
  11134. const a = Zu.fromPartial({add: e, sub: i, set: n}), t = f.fromPartial({capture_displays: a});
  11135. (s = this._ws) == null || s.sendMessage({misc: t})
  11136. }
  11137. switchDisplay(e) {
  11138. var i;
  11139. try {
  11140. const n = JSON.parse(e), a = n.value, t = n.isDesktop;
  11141. if (a.length == 1) {
  11142. let s = this.getCustomResolution(a[0]);
  11143. const E = Gu.fromPartial({display: a[0], width: s ? s[0] : void 0, height: s ? s[1] : void 0}),
  11144. D = f.fromPartial({switch_display: E});
  11145. (i = this._ws) == null || i.sendMessage({misc: D}), t || this._captureDisplays({set: a})
  11146. } else this._captureDisplays({set: a})
  11147. } catch {
  11148. console.log('Failed to switch display, invalid param "' + e + '"')
  11149. }
  11150. }
  11151. elevateDirect() {
  11152. var n;
  11153. const e = vu.fromPartial({direct: !0}), i = f.fromPartial({elevation_request: e});
  11154. (n = this._ws) == null || n.sendMessage({misc: i}), this._elevationRequested = !0
  11155. }
  11156. elevateWithLogon(e) {
  11157. var i;
  11158. try {
  11159. const n = JSON.parse(e), a = $u.fromPartial({username: n.username, password: n.password}),
  11160. t = vu.fromPartial({logon: a}), s = f.fromPartial({elevation_request: t});
  11161. (i = this._ws) == null || i.sendMessage({misc: s}), this._elevationRequested = !0
  11162. } catch {
  11163. console.log('Failed to elevate with logon, invalid param "' + e + '"')
  11164. }
  11165. }
  11166. async inputOsPassword(e) {
  11167. var a, t;
  11168. this.inputMouse(), await P4(50), this.inputMouse(0, 3, 3), await P4(50), this.inputMouse(1 | 1 << 3), this.inputMouse(2 | 1 << 3), await P4(1200);
  11169. const i = I.fromPartial({press: !0, seq: e});
  11170. (a = this._ws) == null || a.sendMessage({key_event: i});
  11171. const n = I.fromPartial({press: !0, control_key: V.Return});
  11172. (t = this._ws) == null || t.sendMessage({key_event: n})
  11173. }
  11174. lockScreen() {
  11175. var i;
  11176. const e = I.fromPartial({down: !0, control_key: V.LockScreen});
  11177. (i = this._ws) == null || i.sendMessage({key_event: e})
  11178. }
  11179. isSwapControlCommand() {
  11180. return this.getToggleOption("allow_swap_key")
  11181. }
  11182. getMod(e, i, n, a) {
  11183. const t = [];
  11184. return e && t.push(V.Alt), i && (this.isSwapControlCommand() ? t.push(V.Meta) : t.push(V.Control)), n && t.push(V.Shift), a && (this.isSwapControlCommand() ? t.push(V.Control) : t.push(V.Meta)), t
  11185. }
  11186. inputMouse(e = 0, i = 0, n = 0, a = !1, t = !1, s = !1, E = !1) {
  11187. var d;
  11188. const D = zu.fromPartial({mask: e, x: i, y: n, modifiers: this.getMod(a, t, s, E)});
  11189. (d = this._ws) == null || d.sendMessage({mouse_event: D})
  11190. }
  11191. toggleOption(e) {
  11192. var s;
  11193. const i = !this._options[e], n = O.fromPartial({}), a = i ? S.Yes : S.No;
  11194. switch (e) {
  11195. case"show-remote-cursor":
  11196. n.show_remote_cursor = a;
  11197. break;
  11198. case"follow-remote-cursor":
  11199. n.follow_remote_cursor = a;
  11200. break;
  11201. case"follow-remote-window":
  11202. n.follow_remote_window = a;
  11203. break;
  11204. case"disable-audio":
  11205. n.disable_audio = a;
  11206. break;
  11207. case"disable-clipboard":
  11208. n.disable_clipboard = a;
  11209. break;
  11210. case"lock-after-session-end":
  11211. n.lock_after_session_end = a;
  11212. break;
  11213. case"privacy-mode":
  11214. n.privacy_mode = a;
  11215. break;
  11216. case"enable-file-copy-paste":
  11217. n.enable_file_transfer = a;
  11218. break;
  11219. case"block-input":
  11220. n.block_input = S.Yes;
  11221. break;
  11222. case"unblock-input":
  11223. n.block_input = S.No;
  11224. break;
  11225. case"show-quality-monitor":
  11226. case"allow_swap_key":
  11227. break;
  11228. case"view-only":
  11229. i ? (n.disable_keyboard = S.Yes, n.disable_clipboard = S.Yes, n.show_remote_cursor = S.Yes, n.enable_file_transfer = S.No, n.lock_after_session_end = S.No) : (n.disable_keyboard = S.No, n.disable_clipboard = this.getToggleOption("disable-clipboard") ? S.Yes : S.No, n.show_remote_cursor = this.getToggleOption("show-remote-cursor") ? S.Yes : S.No, n.enable_file_transfer = this.getToggleOption("enable-file-copy-paste") ? S.Yes : S.No, n.lock_after_session_end = this.getToggleOption("lock-after-session-end") ? S.Yes : S.No);
  11230. break;
  11231. case"terminal-persistent":
  11232. n.terminal_persistent = a;
  11233. break;
  11234. default:
  11235. this.setOption(e, this._options[e] ? void 0 : "Y");
  11236. return
  11237. }
  11238. e.indexOf("block-input") < 0 && this.setOption(e, i);
  11239. const t = f.fromPartial({option: n});
  11240. (s = this._ws) == null || s.sendMessage({misc: t})
  11241. }
  11242. toggleVirtualDisplay(e) {
  11243. try {
  11244. const i = JSON.parse(e);
  11245. this._sendToggleVirtualDisplayMsg(i.index, i.on), this.updateVirtualDisplay(i.index, i.on)
  11246. } catch {
  11247. console.log('Failed to toggle virtual display, invalid param "' + e + '"')
  11248. }
  11249. }
  11250. togglePrivacyMode(e) {
  11251. try {
  11252. const i = JSON.parse(e);
  11253. this._sendTogglePrivacyModeMsg(i.impl_key, i.on)
  11254. } catch {
  11255. console.log('Failed to toggle privacy mode, invalid param "' + e + '"')
  11256. }
  11257. }
  11258. _sendToggleVirtualDisplayMsg(e, i) {
  11259. var t;
  11260. const n = Qu.fromPartial({display: e, on: i}), a = f.fromPartial({toggle_virtual_display: n});
  11261. (t = this._ws) == null || t.sendMessage({misc: a})
  11262. }
  11263. _sendTogglePrivacyModeMsg(e, i) {
  11264. var t;
  11265. const n = Xu.fromPartial({impl_key: e, on: i}), a = f.fromPartial({toggle_privacy_mode: n});
  11266. (t = this._ws) == null || t.sendMessage({misc: a})
  11267. }
  11268. openTerminal(e, i, n) {
  11269. var s;
  11270. const a = u0.fromPartial({terminal_id: e, rows: i, cols: n}), t = lu.fromPartial({open: a});
  11271. (s = this._ws) == null || s.sendMessage({terminal_action: t})
  11272. }
  11273. sendTerminalInput(e, i) {
  11274. var s;
  11275. const n = new TextEncoder, a = eu.fromPartial({terminal_id: e, data: n.encode(i), compressed: !1}),
  11276. t = lu.fromPartial({data: a});
  11277. (s = this._ws) == null || s.sendMessage({terminal_action: t})
  11278. }
  11279. resizeTerminal(e, i, n) {
  11280. var s;
  11281. const a = e0.fromPartial({terminal_id: e, rows: i, cols: n}), t = lu.fromPartial({resize: a});
  11282. (s = this._ws) == null || s.sendMessage({terminal_action: t})
  11283. }
  11284. closeTerminal(e) {
  11285. var a;
  11286. const i = i0.fromPartial({terminal_id: e}), n = lu.fromPartial({close: i});
  11287. (a = this._ws) == null || a.sendMessage({terminal_action: n})
  11288. }
  11289. updateVirtualDisplay(e, i) {
  11290. const n = "virtual-display", a = this.getOption(n);
  11291. if (i) {
  11292. const t = a.split(","), s = t.length;
  11293. e == 0 ? t.splice(0, t.length) : t.indexOf(e.toString()) < 0 && t.push(e.toString()), t.length != s && this.setOption(n, t.join(","))
  11294. } else if (e == -1) a != "" && this.setOption(n, ""); else {
  11295. const t = a.split(","), s = t.length;
  11296. if (e == 0) t.pop(); else {
  11297. const E = t.indexOf(e.toString());
  11298. E >= 0 && t.splice(E, 1)
  11299. }
  11300. t.length != s && this.setOption(n, t.join(","))
  11301. }
  11302. }
  11303. getImageQuality() {
  11304. return this.getOption("image_quality")
  11305. }
  11306. getImageQualityEnum(e, i) {
  11307. switch (e) {
  11308. case"low":
  11309. return i4.Low;
  11310. case"best":
  11311. return i4.Best;
  11312. case"balanced":
  11313. return i ? void 0 : i4.Balanced;
  11314. default:
  11315. return
  11316. }
  11317. }
  11318. setImageQuality(e) {
  11319. var t;
  11320. this.setOption("image_quality", e);
  11321. const i = this.getImageQualityEnum(e, !1);
  11322. if (i == null) return;
  11323. const n = O.fromPartial({image_quality: i}), a = f.fromPartial({option: n});
  11324. (t = this._ws) == null || t.sendMessage({misc: a}), this._lastSendFps != 30 && this.setCustomFps(30, !1)
  11325. }
  11326. setCustomImageQuality(e) {
  11327. var t;
  11328. const i = e << 8, n = O.fromPartial({custom_image_quality: i}), a = f.fromPartial({option: n});
  11329. (t = this._ws) == null || t.sendMessage({misc: a}), this.setOption("custom_image_quality", e.toString()), this.setOption("image_quality", "custom")
  11330. }
  11331. setCustomFps(e, i) {
  11332. var s;
  11333. const n = e, a = O.fromPartial({custom_fps: n}), t = f.fromPartial({option: a});
  11334. (s = this._ws) == null || s.sendMessage({misc: t}), this._lastSendFps = n, i && this.setOption("custom-fps", e.toString())
  11335. }
  11336. sendNote(e, i) {
  11337. let n = i;
  11338. fetch(e, {
  11339. method: "POST",
  11340. headers: {"Content-Type": "application/json"},
  11341. body: JSON.stringify({id: this._id, session_id: this._sessionId, note: n})
  11342. }).then(a => {
  11343. if (!a.ok) throw new Error(a.statusText);
  11344. return a.text()
  11345. }).then(a => {
  11346. console.log("Send note response:", a)
  11347. }).catch(a => {
  11348. console.error("Failed to send note:", a)
  11349. })
  11350. }
  11351. getPlatform() {
  11352. var e;
  11353. return ((e = this._peerInfo) == null ? void 0 : e.platform) || ""
  11354. }
  11355. async handleFileResponse(e) {
  11356. var i, n;
  11357. if (e.dir) {
  11358. let a = e.dir, t = a.entries;
  11359. if (!Ke() && this.getPeerPlatform() == "Windows") for (let s = 0; s < t.length; s++) t[s].name = t[s].name.replace(/\\/g, "/");
  11360. ea(a.id, t, a.path, !1, !1), this._writeJobs.forEach(s => {
  11361. s.id == a.id && (s.files = t)
  11362. }), this._removeJobs[a.id] && (this._removeJobs[a.id].files = t)
  11363. } else if (e.empty_dirs != null) {
  11364. const a = e.empty_dirs;
  11365. 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))
  11366. } else if (e.block) {
  11367. const a = e.block, t = this._writeJobs.find(s => s.id == a.id);
  11368. if (t) try {
  11369. await t.write(a, () => {
  11370. console.log(`cancel job ${t.id} due to write failed`), this.cancelJob(t.id)
  11371. })
  11372. } catch (s) {
  11373. console.log("write file failed", s)
  11374. }
  11375. this.update_jobs_status()
  11376. } else if (e.digest) {
  11377. const a = e.digest;
  11378. if (a.is_upload) {
  11379. const t = this._readJobs.find(s => s.id == a.id);
  11380. if (t) {
  11381. const s = t.read_digest(a);
  11382. s && ((i = this._ws) == null || i.sendMessage(s))
  11383. }
  11384. } else {
  11385. const t = this._writeJobs.find(s => s.id == a.id);
  11386. if (t) {
  11387. const s = t.write_digest(a);
  11388. s && ((n = this._ws) == null || n.sendMessage(s))
  11389. }
  11390. }
  11391. } else if (e.done) {
  11392. const a = e.done, t = this._writeJobs.find(E => E.id == a.id);
  11393. let s;
  11394. 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)
  11395. } else if (e.error) {
  11396. const a = e.error;
  11397. 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)
  11398. }
  11399. }
  11400. removeReadRemoteEmptryDirJob(e) {
  11401. this._readRemoteEmptyDirsJobs = this._readRemoteEmptyDirsJobs.filter(i => i.id != e)
  11402. }
  11403. readRemoteDir(e) {
  11404. var i;
  11405. try {
  11406. const n = JSON.parse(e),
  11407. a = M.fromPartial({read_dir: Ru.fromPartial({path: n.path, include_hidden: n.include_hidden})});
  11408. (i = this._ws) == null || i.sendMessage({file_action: a})
  11409. } catch (n) {
  11410. console.error("Failed to read remote dir:", n)
  11411. }
  11412. }
  11413. async sendFiles(e) {
  11414. var i;
  11415. try {
  11416. const n = JSON.parse(e), {
  11417. id: a,
  11418. path: t,
  11419. to: s,
  11420. file_num: E,
  11421. include_hidden: D,
  11422. is_remote: d,
  11423. is_dir: C
  11424. } = n, c = this.enableOverwriteDetection();
  11425. if (d) {
  11426. this._writeJobs.push(cu.newWrite(a, t, s, E, D, d, [], c, C));
  11427. const p = Fr(a, t, E, D);
  11428. (i = this._ws) == null || i.sendMessage({file_action: p}), C && this.enableEmptyDirs() && (this._readRemoteEmptyDirsJobs.find(F => F.id == a) == null && this._readRemoteEmptyDirsJobs.push(new mr({
  11429. id: a,
  11430. path: t
  11431. })), this.sendMessage({file_action: br(t, D)}))
  11432. }
  11433. } catch (n) {
  11434. console.error("Failed to send files:", n)
  11435. }
  11436. }
  11437. async sendLocalFiles(e) {
  11438. try {
  11439. const i = JSON.parse(e), {
  11440. handle_index: n,
  11441. id: a,
  11442. path: t,
  11443. to: s,
  11444. file_num: E,
  11445. include_hidden: D,
  11446. is_remote: d
  11447. } = i, C = this.enableOverwriteDetection();
  11448. if (!d) try {
  11449. let c = this._fileHandles[n];
  11450. if (!c) throw new Error("Failed to get file handle");
  11451. let p = [], F = [];
  11452. if (c instanceof FileSystemFileHandle) {
  11453. let A = await c.getFile();
  11454. p = [Z.fromPartial({
  11455. size: A.size,
  11456. entry_type: 4,
  11457. modified_time: Math.floor(A.lastModified / 1e3)
  11458. })], F = [c]
  11459. } else {
  11460. let A = await Ua(c, "");
  11461. p = A.map(U => U.entry), F = A.map(U => U.handle)
  11462. }
  11463. let w = cu.newRead(a, t, s, E, D, d, p, C, F);
  11464. ea(a, p, t, !d, !0), this._readJobs.push(w), this._ftTimer || (this._ftTimer = setTimeout(this.readJobTimerCallback.bind(this), ta));
  11465. let y = [...p];
  11466. if (Ke() && this.getPeerPlatform() != "Windows") for (let A = 0; A < y.length; A++) y[A].name = y[A].name.replace(/\\/g, "/");
  11467. if (this.sendMessage({file_action: fr(a, s, E, y, w.total_size)}), this.enableEmptyDirs() && c instanceof FileSystemDirectoryHandle) {
  11468. const A = await Ma(c, c.name);
  11469. A.length > 0 && m("send_emptry_dirs", {dirs: A})
  11470. }
  11471. } catch (c) {
  11472. console.error("Failed to send files:", c), this.handle_job_status(a, -1, (c != null ? c : "Failed to send files").toString())
  11473. }
  11474. } catch (i) {
  11475. console.error("Failed to send files:", i)
  11476. }
  11477. }
  11478. async readJobTimerCallback() {
  11479. let e = await Rr(this._readJobs, this.sendMessage.bind(this));
  11480. 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), ta)
  11481. }
  11482. update_jobs_status() {
  11483. const e = new Date().getTime() - this._last_update_jobs_ms;
  11484. e >= 1e3 && (this._readJobs.forEach(i => {
  11485. i.update_job_status(e)
  11486. }), this._writeJobs.forEach(i => {
  11487. i.update_job_status(e)
  11488. }), this._last_update_jobs_ms = new Date().getTime())
  11489. }
  11490. handle_job_status(e, i, n) {
  11491. var a;
  11492. if (this._removeJobs[e] && this._removeJobs[e].no_confirm) {
  11493. const t = this._removeJobs[e].files;
  11494. if (i + 1 < t.length) {
  11495. const s = this._removeJobs[e].path + this._removeJobs[e].sep + t[i + 1].name;
  11496. if ((a = this._ws) == null || a.sendMessage({file_action: $t(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
  11497. } else delete this._removeJobs[e], console.log("remove jobs:", this._removeJobs)
  11498. }
  11499. n ? V4(e, n, i) : zr(e, i)
  11500. }
  11501. cancelJob(e) {
  11502. var n;
  11503. (n = this._ws) == null || n.sendMessage({file_action: gr(e)});
  11504. let i = this._writeJobs.find(a => a.id == e);
  11505. 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]
  11506. }
  11507. removeAllEmptyDirs(e) {
  11508. var i;
  11509. try {
  11510. const n = JSON.parse(e);
  11511. (i = this._ws) == null || i.sendMessage({file_action: kr(n.id, n.path)})
  11512. } catch (n) {
  11513. console.error("Failed to remove all empty dirs:", n)
  11514. }
  11515. }
  11516. removeFile(e) {
  11517. var i;
  11518. try {
  11519. const n = JSON.parse(e), {id: a, path: t, file_num: s, is_remote: E} = n;
  11520. E && ((i = this._ws) == null || i.sendMessage({file_action: $t(a, t, s, E)}))
  11521. } catch (n) {
  11522. console.error("Failed to remove files:", n)
  11523. }
  11524. }
  11525. readDirToRemoveRecursive(e) {
  11526. var i;
  11527. try {
  11528. const n = JSON.parse(e), {id: a, path: t, is_remote: s, show_hidden: E} = n;
  11529. if (s) {
  11530. (i = this._ws) == null || i.sendMessage({file_action: _r(a, t, E)});
  11531. const D = (d, C) => (d ? C === "Windows" : Ke()) ? "\\" : "/";
  11532. this._removeJobs[a] = {
  11533. path: t,
  11534. files: [],
  11535. no_confirm: !1,
  11536. is_remote: s,
  11537. sep: D(s, this.getPeerPlatform()),
  11538. last_update_job_status: new Date().getTime()
  11539. }
  11540. }
  11541. } catch (n) {
  11542. console.error("Failed to read dir to remove recursive:", n)
  11543. }
  11544. }
  11545. createDir(e) {
  11546. var i;
  11547. try {
  11548. const n = JSON.parse(e), {id: a, path: t, is_remote: s} = n;
  11549. s && ((i = this._ws) == null || i.sendMessage({file_action: vr(a, t)}))
  11550. } catch (n) {
  11551. console.error("Failed to create dir:", n)
  11552. }
  11553. }
  11554. renameFile(e) {
  11555. var i;
  11556. try {
  11557. const n = JSON.parse(e), {id: a, path: t, new_name: s, is_remote: E} = n;
  11558. E && ((i = this._ws) == null || i.sendMessage({file_action: hr(a, t, s)}))
  11559. } catch (n) {
  11560. console.error("Failed to rename file:", n)
  11561. }
  11562. }
  11563. async seletFiles(e) {
  11564. await Pr(e, (i, n) => {
  11565. this._fileHandles[i] = n
  11566. })
  11567. }
  11568. async handleFileAction(e) {
  11569. if (e.send_confirm) {
  11570. const i = e.send_confirm, n = this._readJobs.find(a => a.id == i.id);
  11571. n && n.confirm(i)
  11572. }
  11573. }
  11574. async confirmOverrideFile(e) {
  11575. try {
  11576. const i = JSON.parse(e), {id: n, file_num: a, need_override: t, remember: s, is_upload: E} = i;
  11577. if (E) {
  11578. const D = this._readJobs.find(d => d.id == n);
  11579. D && (s && (D.default_overwrite_strategy = t), D.confirm(Au.fromPartial({
  11580. id: n,
  11581. file_num: a,
  11582. offset_blk: t ? 0 : void 0,
  11583. skip: t ? void 0 : !0
  11584. })))
  11585. }
  11586. } catch (i) {
  11587. console.error("Failed to confirm override file:", i)
  11588. }
  11589. }
  11590. sendChat(e) {
  11591. const i = Su.fromPartial({text: e}), n = f.fromPartial({chat_message: i});
  11592. this.sendMessage({misc: n})
  11593. }
  11594. changeResolution(e) {
  11595. var i;
  11596. try {
  11597. const n = JSON.parse(e), a = g.fromPartial({width: n.width, height: n.height});
  11598. let t;
  11599. this._peerInfo && L(this._peerInfo.version) >= L("1.2.4") ? t = f.fromPartial({
  11600. change_display_resolution: Ju.fromPartial({
  11601. display: n.display,
  11602. resolution: a
  11603. })
  11604. }) : t = f.fromPartial({change_resolution: a}), (i = this._ws) == null || i.sendMessage({misc: t}), this._lastChangeDisplay = {
  11605. display: n.display,
  11606. width: n.width,
  11607. height: n.height,
  11608. time: new Date().getTime()
  11609. }
  11610. } catch (n) {
  11611. console.error("Failed to change resolution:", n)
  11612. }
  11613. }
  11614. setCustomResolution(e) {
  11615. var a, t;
  11616. const i = (s, E) => {
  11617. const D = s.toString(), d = this.loadConfig();
  11618. d.custom_resolutions || (d.custom_resolutions = {}), E ? d.custom_resolutions[D] = {
  11619. w: E[0],
  11620. h: E[1]
  11621. } : delete d.custom_resolutions[D], this.saveConfig(d)
  11622. }, n = () => {
  11623. var s, E, D;
  11624. return ((s = this._lastChangeDisplay) == null ? void 0 : s.display) == e.display && ((E = this._lastChangeDisplay) == null ? void 0 : E.width) == e.width && ((D = this._lastChangeDisplay) == null ? void 0 : D.height) == e.height && new Date().getTime() - this._lastChangeDisplay.time < 15e3
  11625. };
  11626. 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 {
  11627. const s = this._lastChangeDisplay;
  11628. if ((s == null ? void 0 : s.display) == e.display) {
  11629. const E = n() ? [e.width, e.height] : void 0;
  11630. i(e.display, E)
  11631. }
  11632. }
  11633. }
  11634. getCustomResolution(e) {
  11635. const n = this.loadConfig().custom_resolutions;
  11636. if (n) {
  11637. const a = n[e.toString()];
  11638. if (a && a.w && a.h) return [a.w, a.h]
  11639. }
  11640. }
  11641. tryChangeInitResolution(e) {
  11642. const i = this.getCustomResolution(e);
  11643. i && this.changeResolution(JSON.stringify({display: e, width: i[0], height: i[1]}))
  11644. }
  11645. setMultipleWindowsSession(e) {
  11646. let i = [];
  11647. e.forEach(n => {
  11648. let a = {};
  11649. a.sid = n.sid.toString(), a.name = n.name, i.push(a)
  11650. }), m("set_multiple_windows_session", {windows_sessions: JSON.stringify(i)})
  11651. }
  11652. sendSelectedSessionId(e) {
  11653. var n, a;
  11654. const i = parseInt(e);
  11655. if (isNaN(i)) console.error("selected invalid sid: ", e); else {
  11656. this._selectedWindowsSessionId = i;
  11657. const t = f.fromPartial({selected_sid: i});
  11658. (n = this._ws) == null || n.sendMessage({misc: t});
  11659. const s = this._peerInfo;
  11660. 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..."))
  11661. }
  11662. }
  11663. }
  11664. function n4(u = !1) {
  11665. const e = _.getItem("custom-rendezvous-server");
  11666. return o4(e || Or, u)
  11667. }
  11668. const Ur = 21118, Mr = 21119;
  11669. function Lr(u) {
  11670. 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)
  11671. }
  11672. function Wr(u) {
  11673. 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)
  11674. }
  11675. function Vr(u) {
  11676. 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)
  11677. }
  11678. function qr(u) {
  11679. return /^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z][a-z-]{0,61}[a-z]$/i.test(u)
  11680. }
  11681. function Kr(u) {
  11682. return u.startsWith("ws://") || u.startsWith("wss://")
  11683. }
  11684. function Hr() {
  11685. return window.location.protocol === "https:"
  11686. }
  11687. function isHttps() {
  11688. return window.location.protocol === "https:"
  11689. }
  11690. function getUriFromRs(uri, isRelay = false) {
  11691. if (window.ws_host) {
  11692. return window.ws_host + "/ws/" + (isRelay ? "relay" : "id")
  11693. }
  11694. const p = isHttps() ? "wss://" : "ws://"
  11695. const [domain, uriport] = uri.split(":")
  11696. if (!isHttps()) {
  11697. // http 直接走端口
  11698. if (uriport) {
  11699. const port = parseInt(uriport)
  11700. return p + domain + ":" + (port + 2)
  11701. }
  11702. return p + domain + ":" + (defaultIdServerPort + (isRelay ? 3 : 2))
  11703. }
  11704. // https 分情况
  11705. if (!window.location.port) {
  11706. // 443
  11707. return p + domain + "/ws/" + (isRelay ? "relay" : "id")
  11708. }
  11709. // 非443
  11710. return p + domain + ":" + window.location.port + "/ws/" + (isRelay ? "relay" : "id")
  11711. }
  11712. function o4(u, e = !1) {
  11713. if (Kr(u)) return u;
  11714. return getUriFromRs(u, e)
  11715. const i = e ? Mr : Ur, n = e ? "/ws/relay" : "/ws/id", a = Hr() ? "wss" : "ws";
  11716. if (Lr(u)) {
  11717. const t = u.indexOf(":");
  11718. if (t !== -1) {
  11719. const s = u.substring(0, t), E = u.substring(t + 1), D = parseInt(E);
  11720. return isNaN(D) ? `${a}://${s}:${i}` : `${a}://${s}:${D + 2}`
  11721. } else return `${a}://${u}:${i}`
  11722. }
  11723. if (Wr(u)) {
  11724. const t = u.lastIndexOf("]");
  11725. if (t !== -1) {
  11726. const s = u.substring(0, t + 1), E = u.substring(t + 2), D = parseInt(E);
  11727. return isNaN(D) ? `${a}://${s}:${i}` : `${a}://${s}:${D + 2}`
  11728. } else return u.startsWith("[") ? `${a}://${u}:${i}` : `${a}://[${u}]:${i}`
  11729. }
  11730. if (u.includes(":")) {
  11731. const [t, s] = u.split(":");
  11732. if (Vr(u)) return `${a}://${t}${n}`
  11733. } else if (qr(u)) return `${a}://${u}${n}`;
  11734. return u
  11735. }
  11736. const aa = (u, e, i) => e && u.type == "SharedAb" ? q(r0([u.value, i.salt])) === q(e) : !1,
  11737. na = (u, e) => e && u.type == "PersonalAb" ? q(u.value) === q(e) : !1;
  11738. function Jr() {
  11739. return n4()
  11740. }
  11741. function oa(u, e) {
  11742. s3("callback_query_onlines", {onlines: u.join(","), offlines: e.join(",")})
  11743. }
  11744. const onlineCache = {}
  11745. // Query onlines
  11746. async function myQueryOnline(id) {
  11747. const last_online = onlineCache[id]
  11748. if (last_online && new Date().getTime() - last_online < 20 * 1000) {
  11749. return true
  11750. }
  11751. // 映射 方便后期更新
  11752. const maps = {
  11753. uri: n4(),
  11754. ws: l4,
  11755. conn_type: Ve.DEFAULT_CONN,
  11756. nat_type: Ca.SYMMETRIC,
  11757. token: Pa(),
  11758. version: U4,
  11759. licence_key: za(),
  11760. rendezvousPunchHoleRequest: t0,
  11761. rendezvousPunchHoleResponse_Failure: Ae
  11762. }
  11763. const s = new maps.ws(maps.uri, !0, "rendezvous");
  11764. await s.open();
  11765. const punch_hole_request = maps.rendezvousPunchHoleRequest.fromPartial({
  11766. id: id,
  11767. licence_key: maps.licence_key,
  11768. conn_type: maps.conn_type,
  11769. nat_type: maps.nat_type,
  11770. token: maps.token,
  11771. version: maps.version
  11772. });
  11773. s.sendRendezvous({punch_hole_request: punch_hole_request});
  11774. const msg = await s.next();
  11775. s.close();
  11776. let online = false
  11777. const phr = msg.punch_hole_response, rr = msg.relay_response;
  11778. if (phr) {
  11779. online = true
  11780. if (phr != null && phr.other_failure) {
  11781. online = false
  11782. return online
  11783. }
  11784. if (phr.failure != maps.rendezvousPunchHoleResponse_Failure.UNRECOGNIZED) switch (phr == null ? void 0 : phr.failure) {
  11785. case maps.rendezvousPunchHoleResponse_Failure.ID_NOT_EXIST:
  11786. case maps.rendezvousPunchHoleResponse_Failure.OFFLINE:
  11787. case maps.rendezvousPunchHoleResponse_Failure.LICENSE_MISMATCH:
  11788. case maps.rendezvousPunchHoleResponse_Failure.LICENSE_OVERUSE:
  11789. online = false
  11790. break
  11791. }
  11792. } else if (rr) {
  11793. online = true
  11794. if (!rr.version) {
  11795. online = false
  11796. return online
  11797. }
  11798. }
  11799. if (online) {
  11800. onlineCache[id] = new Date().getTime()
  11801. } else if (onlineCache[id]) {
  11802. delete onlineCache[id]
  11803. }
  11804. return online
  11805. }
  11806. async function Gr(u) {
  11807. let e = [];
  11808. try {
  11809. e = JSON.parse(u)
  11810. } catch (a) {
  11811. console.error("Failed to query onlines, ", a);
  11812. return
  11813. }
  11814. if (e.length === 0) return;
  11815. if (window.webclient_magic_queryonline) {
  11816. const onlines = []
  11817. const offlines = []
  11818. for (let i = 0; i < e.length; i++) {
  11819. let online = await myQueryOnline(e[i])
  11820. if (online) {
  11821. onlines.push(e[i])
  11822. } else {
  11823. offlines.push(e[i])
  11824. }
  11825. }
  11826. oa(onlines, offlines)
  11827. n.close()
  11828. return
  11829. }
  11830. const i = Jr(), n = new l4(i, !0, "query onlines");
  11831. try {
  11832. await n.open();
  11833. const a = n0.fromPartial({id: Ze(), peers: e});
  11834. n.sendRendezvous({online_request: a})
  11835. } catch (a) {
  11836. console.error("Failed to query onlines, ", a), oa([], e), n.close();
  11837. return
  11838. }
  11839. for (let a = 0; a < 2; a++) {
  11840. const t = await Vo(n, 3e3);
  11841. if (!t || (t == null ? void 0 : t.key_exchange) || (t == null ? void 0 : t.online_response) === void 0) continue;
  11842. const s = t.online_response.states;
  11843. let E = [], D = [];
  11844. for (let d = 0; d < e.length; d++) {
  11845. const C = 1 << 7 - d % 8;
  11846. (s[Math.floor(d / 8)] & C) === C ? E.push(e[d]) : D.push(e[d])
  11847. }
  11848. oa(E, D), n.close();
  11849. return
  11850. }
  11851. n.close(), console.error("Failed to query online states, no online response")
  11852. }
  11853. const Zr = "rustdesk-client";
  11854. function Qr() {
  11855. if (typeof navigator != "undefined") {
  11856. const u = navigator.platform.toLowerCase();
  11857. return u.includes("win") ? "windows" : u.includes("mac") ? "macos" : u.includes("linux") ? "linux" : u
  11858. }
  11859. return "unknown"
  11860. }
  11861. function Xr() {
  11862. const u = Qr();
  11863. 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"
  11864. }
  11865. function Yr() {
  11866. const u = navigator.userAgent;
  11867. let e = "", i = "";
  11868. if (u.includes("Windows")) {
  11869. e = "windows";
  11870. const n = u.match(/Windows NT (\d+\.\d+)/);
  11871. n && (i = n[1])
  11872. } else if (u.includes("Mac OS X")) {
  11873. e = "macos";
  11874. const n = u.match(/Mac OS X (\d+[._]\d+[._]\d+)/);
  11875. n && (i = n[1].replace(/_/g, "."))
  11876. } else if (u.includes("Linux")) {
  11877. e = "linux";
  11878. const n = u.match(/Linux\s*([\d.]+)?/);
  11879. n && n[1] && (i = n[1])
  11880. } else e = "unknown", i = "";
  11881. return e += "-" + navigator.userAgent, {os: e, os_version: i}
  11882. }
  11883. async function $r(u) {
  11884. const e = "https://api.rustdesk.com/version/latest", {os: i, os_version: n} = Yr(), a = Xr();
  11885. return [{os: i, os_version: n, arch: a, device_id: [], typ: u, host: window.location.host}, e]
  11886. }
  11887. async function us() {
  11888. try {
  11889. const [u, e] = await $r(Zr);
  11890. return await (await fetch(e, {
  11891. method: "POST",
  11892. headers: {"Content-Type": "application/json"},
  11893. body: JSON.stringify(u)
  11894. })).json()
  11895. } catch {
  11896. return null
  11897. }
  11898. }
  11899. const es = 1, is = 60 * 3, He = "Requesting account auth", I4 = "Waiting account auth", ts = "Login account auth";
  11900. class as {
  11901. constructor(e, i, n) {
  11902. l(this, "code");
  11903. l(this, "url");
  11904. l(this, "url_launched");
  11905. this.code = e, this.url = i, this.url_launched = n
  11906. }
  11907. }
  11908. class ns {
  11909. constructor(e, i) {
  11910. l(this, "email_verification");
  11911. l(this, "email_alarm_notification");
  11912. this.email_verification = e, this.email_alarm_notification = i
  11913. }
  11914. }
  11915. class os {
  11916. constructor(e, i, n) {
  11917. l(this, "settings");
  11918. l(this, "login_device_whitelist");
  11919. l(this, "other");
  11920. this.settings = e, this.login_device_whitelist = i, this.other = n
  11921. }
  11922. }
  11923. class r4 {
  11924. }
  11925. l(r4, "Disabled", 0), l(r4, "Normal", 1), l(r4, "Unverified", -1);
  11926. class rs {
  11927. constructor(e, i, n, a, t, s, E, D) {
  11928. l(this, "name");
  11929. l(this, "email");
  11930. l(this, "note");
  11931. l(this, "status");
  11932. l(this, "info");
  11933. l(this, "is_admin");
  11934. l(this, "third_auth_type");
  11935. l(this, "verifier");
  11936. this.name = e, this.email = i, this.note = n, this.status = a, this.info = t, this.is_admin = s, this.third_auth_type = E, this.verifier = D
  11937. }
  11938. }
  11939. class ss {
  11940. constructor(e, i, n, a, t) {
  11941. l(this, "access_token");
  11942. l(this, "type");
  11943. l(this, "tfa_type");
  11944. l(this, "secret");
  11945. l(this, "user");
  11946. this.access_token = e, this.type = i, this.tfa_type = n, this.secret = a, this.user = t
  11947. }
  11948. }
  11949. class Es {
  11950. constructor() {
  11951. l(this, "state_msg");
  11952. l(this, "failed_msg");
  11953. l(this, "code_url");
  11954. l(this, "auth_body");
  11955. l(this, "keep_querying");
  11956. l(this, "running");
  11957. l(this, "query_timeout");
  11958. this.state_msg = He, this.failed_msg = "", this.code_url = null, this.auth_body = null, this.keep_querying = !1, this.running = !1, this.query_timeout = is * 1e3
  11959. }
  11960. }
  11961. class ls {
  11962. constructor(e, i, n, a, t) {
  11963. l(this, "state_msg");
  11964. l(this, "failed_msg");
  11965. l(this, "url");
  11966. l(this, "url_launched");
  11967. l(this, "auth_body");
  11968. this.state_msg = e, this.failed_msg = i, this.url = n, this.url_launched = a, this.auth_body = t
  11969. }
  11970. }
  11971. const x = new Es;
  11972. async function Ds(u, e, i, n) {
  11973. return fetch(`${u}/api/oidc/auth`, {
  11974. method: "POST",
  11975. headers: {"Content-Type": "application/json"},
  11976. body: JSON.stringify({op: e, id: i, uuid: n, deviceInfo: {os: $4(), type: "web client", name: Lo()}})
  11977. }).then(a => a.json())
  11978. }
  11979. async function ds(u, e, i, n) {
  11980. const a = new URL(`${u}/api/oidc/auth-query`);
  11981. return a.searchParams.append("code", e), a.searchParams.append("id", i), a.searchParams.append("uuid", n), fetch(a.toString(), {
  11982. method: "GET",
  11983. headers: {"Content-Type": "application/json"}
  11984. }).then(t => t.json())
  11985. }
  11986. function Bs() {
  11987. x.state_msg = He, x.failed_msg = "", x.keep_querying = !0, x.running = !1, x.code_url = null, x.auth_body = null
  11988. }
  11989. function cs() {
  11990. Bs(), x.running = !0
  11991. }
  11992. function Cs() {
  11993. x.running = !1
  11994. }
  11995. function Va(u) {
  11996. return new Promise(e => setTimeout(e, u * 1e3))
  11997. }
  11998. async function ps(u, e, i, n, a) {
  11999. var t, s, E, D, d, C, c, p, F, w, y;
  12000. try {
  12001. const A = await Ds(u, e, i, n);
  12002. if (console.log("Request oidc auth result: ", A), A.error) {
  12003. Le(He, A.error);
  12004. return
  12005. }
  12006. if (!A.code || !A.url) {
  12007. Le(He, "Invalid auth response");
  12008. return
  12009. }
  12010. const U = window.screen.width, Fu = window.screen.height, Du = 400, hu = 600, j = Math.floor((U - Du) / 2),
  12011. w4 = Math.floor((Fu - hu) / 2), rn = `width=${Du},height=${hu},left=${j},top=${w4}`,
  12012. Oe = window.open(A.url, "_blank", rn);
  12013. Oe && Oe.focus();
  12014. const c3 = new as(A.code, A.url, Oe !== null);
  12015. x.code_url = c3, Le(I4, "");
  12016. const C3 = Date.now(), p3 = x.query_timeout;
  12017. for (; x.keep_querying && Date.now() - C3 < p3;) {
  12018. try {
  12019. const b = await ds(u, c3.code, i, n);
  12020. if (b.error) {
  12021. if (!b.error.includes("No authed oidc is found")) {
  12022. x.state_msg = I4, x.failed_msg = b.error;
  12023. return
  12024. }
  12025. } else {
  12026. b.type === "access_token" && b.user && a && (D4("access_token", b.access_token), D4("user_info", JSON.stringify({
  12027. name: b.user.name,
  12028. status: b.user.status
  12029. }))), x.state_msg = ts, x.auth_body = new ss(b.access_token, b.type, b.tfa_type, b.secret, new rs((t = b.user.name) != null ? t : "", (s = b.user.email) != null ? s : null, (E = b.user.note) != null ? E : null, (D = b.user.status) != null ? D : r4.Normal, new os(new ns((C = (d = b.user.info) == null ? void 0 : d.email_verification) != null ? C : !1, (p = (c = b.user.info) == null ? void 0 : c.email_alarm_notification) != null ? p : !1), [], {}), (F = b.user.is_admin) != null ? F : !1, (w = b.user.third_auth_type) != null ? w : null, (y = b.user.verifier) != null ? y : null)), Oe && Oe.close();
  12030. return
  12031. }
  12032. } catch (b) {
  12033. console.error("Error querying oidc auth: ", b)
  12034. }
  12035. await Va(es)
  12036. }
  12037. Date.now() - C3 >= p3 && Le(I4, "timeout")
  12038. } catch (A) {
  12039. Le(He, A.toString())
  12040. }
  12041. }
  12042. function Le(u, e) {
  12043. x.state_msg = u, x.failed_msg = e
  12044. }
  12045. function As() {
  12046. for (; x.running;) Va(.3)
  12047. }
  12048. function ms() {
  12049. var u, e, i, n;
  12050. return JSON.stringify(new ls(x.state_msg, x.failed_msg, (e = (u = x.code_url) == null ? void 0 : u.url) != null ? e : null, (n = (i = x.code_url) == null ? void 0 : i.url_launched) != null ? n : !1, x.auth_body))
  12051. }
  12052. function qa() {
  12053. x.keep_querying = !1
  12054. }
  12055. function Fs(u, e) {
  12056. const i = Ze(), n = Y4(), a = b4();
  12057. qa(), As(), cs(), setTimeout(() => {
  12058. ps(a, u, i, n, e), Cs()
  12059. }, 0)
  12060. }
  12061. window.curConn = void 0;
  12062. 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));
  12063. const r3 = $4(), l0 = r3 === x4, F4 = r3 === G4, s0 = r3 === Z4, ra = window.location.host;
  12064. function _s() {
  12065. return !isMobile()
  12066. }
  12067. function Ka(u, e, i, n) {
  12068. if (!(!u || u == "error" && !i)) {
  12069. i.toLowerCase();
  12070. var a = Fo(u, e, i) ? "true" : "";
  12071. onGlobalEvent(JSON.stringify({
  12072. name: "msgbox",
  12073. type: u,
  12074. title: e,
  12075. text: i,
  12076. link: n != null ? n : "",
  12077. hasRetry: a
  12078. }))
  12079. }
  12080. }
  12081. function vs(u, e, i) {
  12082. onGlobalEvent(JSON.stringify({name: "toast", type: u, text: e, dur_msec: i}))
  12083. }
  12084. function Ha(u) {
  12085. var e = {};
  12086. 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));
  12087. return e
  12088. }
  12089. function m(u, e) {
  12090. e = Ha(e), e.name = u, onGlobalEvent(JSON.stringify(e))
  12091. }
  12092. function q4() {
  12093. var e;
  12094. ((e = X4("input-source")) != null ? e : Kt) === Kt ? ur() : L4()
  12095. }
  12096. function s3(u, e) {
  12097. e = Ha(e), e.name = u, onRegisteredEvent(JSON.stringify(e))
  12098. }
  12099. function K4(u, e) {
  12100. onRgba(u, e)
  12101. }
  12102. function E3(u) {
  12103. window.curConn = u
  12104. }
  12105. function B0() {
  12106. return window.curConn
  12107. }
  12108. async function Ja() {
  12109. await curConn.start()
  12110. }
  12111. function l3() {
  12112. var u;
  12113. (u = B0()) == null || u.close(), E3(void 0)
  12114. }
  12115. function Ga() {
  12116. var e;
  12117. (e = window.curConn) == null || e.close();
  12118. const u = new Wa;
  12119. return E3(u), u
  12120. }
  12121. let Q;
  12122. async function Za() {
  12123. try {
  12124. Q || (await s4.ready, Q = s4)
  12125. } catch (u) {
  12126. console.error("Failed to init sodium: " + u.message)
  12127. }
  12128. }
  12129. function Qa() {
  12130. return Q
  12131. }
  12132. async function H4(u, e) {
  12133. return await Za(), typeof u == "string" && (u = c0(u)), typeof e == "string" && (e = c0(e)), Q.crypto_sign_open(u, e)
  12134. }
  12135. function c0(u) {
  12136. return Q.from_base64(u, Q.base64_variants.ORIGINAL)
  12137. }
  12138. function gs(u) {
  12139. return Q.to_base64(u, Q.base64_variants.ORIGINAL)
  12140. }
  12141. function ks() {
  12142. const u = Q.crypto_box_keypair(), e = u.privateKey, i = u.publicKey;
  12143. return [e, i]
  12144. }
  12145. function hs() {
  12146. return Q.crypto_secretbox_keygen()
  12147. }
  12148. function fs(u, e, i) {
  12149. const n = Uint8Array.from(Array(24).fill(0));
  12150. return Q.crypto_box_easy(u, n, e, i)
  12151. }
  12152. function y4(u) {
  12153. for (var e = Array(24).fill(0), i = 0; i < e.length && u > 0; i++) {
  12154. var n = u & 255;
  12155. e[i] = n, u = (u - n) / 256
  12156. }
  12157. return Uint8Array.from(e)
  12158. }
  12159. function sa(u, e, i) {
  12160. return Q.crypto_secretbox_easy(u, y4(e), i)
  12161. }
  12162. function xs(u, e, i) {
  12163. return Q.crypto_secretbox_open_easy(u, y4(e), i)
  12164. }
  12165. window.setByName = (u, e) => {
  12166. switch (u) {
  12167. case"connect":
  12168. Ga(), Ja();
  12169. break;
  12170. case"login":
  12171. e = JSON.parse(e), curConn.handle_login_from_ui(e.os_username, e.os_password, e.password, e.remember);
  12172. break;
  12173. case"close":
  12174. l3();
  12175. break;
  12176. case"refresh":
  12177. curConn.refresh();
  12178. break;
  12179. case"reconnect":
  12180. curConn == null || curConn.reconnect();
  12181. break;
  12182. case"toggle_virtual_display":
  12183. curConn.toggleVirtualDisplay(e);
  12184. break;
  12185. case"toggle_privacy_mode":
  12186. curConn.togglePrivacyMode(e);
  12187. break;
  12188. case"image_quality":
  12189. curConn.setImageQuality(e);
  12190. break;
  12191. case"custom_image_quality":
  12192. curConn.setCustomImageQuality(e);
  12193. break;
  12194. case"custom-fps":
  12195. curConn.setCustomFps(e, !0);
  12196. break;
  12197. case"lock_screen":
  12198. curConn.lockScreen();
  12199. break;
  12200. case"ctrl_alt_del":
  12201. curConn.ctrlAltDel();
  12202. break;
  12203. case"switch_display":
  12204. curConn.switchDisplay(e);
  12205. break;
  12206. case"remove_peer":
  12207. go(e);
  12208. break;
  12209. case"input_key":
  12210. 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");
  12211. break;
  12212. case"input_string":
  12213. curConn.inputString(e);
  12214. break;
  12215. case"flutter_key_event":
  12216. e = JSON.parse(e), er(curConn, e.usb_hid, e.down == "true", e.lock_modes);
  12217. break;
  12218. case"send_mouse":
  12219. ys(e);
  12220. break;
  12221. case"send_2fa":
  12222. curConn == null || curConn.send2fa(e);
  12223. break;
  12224. case"option":
  12225. e = JSON.parse(e), _.setItem(e.name, e.value);
  12226. break;
  12227. case"options":
  12228. e = JSON.parse(e);
  12229. for (const [n, a] of Object.entries(a)) _.setItem(n, a);
  12230. break;
  12231. case"option:local": {
  12232. let n = JSON.parse(e);
  12233. if (n.name == 'access_token' && n.value) {
  12234. getServerConf(n.value)
  12235. }
  12236. n.name === "verifier" && la(n.value), n.name === "user_info" && (n.value || la("")), D4(n.name, n.value), n.name === "input-source" && q4(), n.name == "lang" && Ro()
  12237. }
  12238. break;
  12239. case"option:flutter:local":
  12240. e = JSON.parse(e), xo(e.name, e.value);
  12241. break;
  12242. case"option:flutter:peer":
  12243. e = JSON.parse(e), curConn.setFlutterUiOption(e.name, e.value);
  12244. break;
  12245. case"option:user:default":
  12246. Ts(e);
  12247. break;
  12248. case"option:session":
  12249. e = JSON.parse(e), curConn.setOption(e.name, e.value);
  12250. break;
  12251. case"option:peer":
  12252. try {
  12253. e = JSON.parse(e), ka(e.id, e.name, e.value)
  12254. } catch (n) {
  12255. console.error('Failed to set peer option: "' + e + '", ' + n.message)
  12256. }
  12257. break;
  12258. case"option:toggle":
  12259. return curConn.toggleOption(e);
  12260. case"input_os_password":
  12261. curConn.inputOsPassword(e);
  12262. break;
  12263. case"session_add_sync":
  12264. return Os(e);
  12265. case"session_start":
  12266. Us();
  12267. break;
  12268. case"session_close":
  12269. Ms();
  12270. break;
  12271. case"elevate_direct":
  12272. curConn.elevateDirect();
  12273. break;
  12274. case"elevate_with_logon":
  12275. curConn.elevateWithLogon(e);
  12276. break;
  12277. case"peer_exists":
  12278. return !!mu()[e];
  12279. case"restart":
  12280. curConn.restart();
  12281. break;
  12282. case"fav":
  12283. return _.setItem("fav", e);
  12284. case"query_onlines":
  12285. Gr(e);
  12286. break;
  12287. case"change_prefer_codec":
  12288. curConn.changePreferCodec(e);
  12289. break;
  12290. case"cursor":
  12291. Rs(e);
  12292. break;
  12293. case"enter_or_leave":
  12294. curConn == null || curConn.enterOrLeave(e);
  12295. break;
  12296. case"fullscreen":
  12297. e == "Y" ? Ws() : Vs();
  12298. break;
  12299. case"send_note":
  12300. const i = Ya("conn");
  12301. i && (curConn == null || curConn.sendNote(i, e));
  12302. break;
  12303. case"read_remote_dir":
  12304. curConn == null || curConn.readRemoteDir(e);
  12305. break;
  12306. case"send_files":
  12307. curConn == null || curConn.sendFiles(e);
  12308. break;
  12309. case"send_local_files":
  12310. curConn == null || curConn.sendLocalFiles(e);
  12311. break;
  12312. case"cancel_job":
  12313. curConn == null || curConn.cancelJob(e);
  12314. break;
  12315. case"remove_all_empty_dirs":
  12316. curConn == null || curConn.removeAllEmptyDirs(e);
  12317. break;
  12318. case"remove_file":
  12319. curConn == null || curConn.removeFile(e);
  12320. break;
  12321. case"create_dir":
  12322. curConn == null || curConn.createDir(e);
  12323. break;
  12324. case"rename_file":
  12325. curConn == null || curConn.renameFile(e);
  12326. break;
  12327. case"read_dir_to_remove_recursive":
  12328. curConn == null || curConn.readDirToRemoveRecursive(e);
  12329. break;
  12330. case"select_files":
  12331. curConn == null || curConn.seletFiles(e);
  12332. break;
  12333. case"confirm_override_file":
  12334. curConn == null || curConn.confirmOverrideFile(e);
  12335. break;
  12336. case"send_chat":
  12337. curConn == null || curConn.sendChat(e);
  12338. break;
  12339. case"load_ab":
  12340. Hs();
  12341. break;
  12342. case"save_ab":
  12343. yo(e);
  12344. break;
  12345. case"clear_ab":
  12346. bo();
  12347. break;
  12348. case"load_group":
  12349. Js();
  12350. break;
  12351. case"save_group":
  12352. wo(e);
  12353. break;
  12354. case"clear_group":
  12355. zo();
  12356. break;
  12357. case"change_resolution":
  12358. curConn == null || curConn.changeResolution(e);
  12359. break;
  12360. case"selected_sid":
  12361. curConn == null || curConn.sendSelectedSessionId(e);
  12362. break;
  12363. case"account_auth":
  12364. e = JSON.parse(e), Fs(e.op, e.remember);
  12365. break;
  12366. case"account_auth_cancel":
  12367. qa();
  12368. break;
  12369. case"open_terminal":
  12370. e = JSON.parse(e), curConn == null || curConn.openTerminal(e.terminal_id, e.rows, e.cols);
  12371. break;
  12372. case"send_terminal_input":
  12373. e = JSON.parse(e), curConn == null || curConn.sendTerminalInput(e.terminal_id, e.data);
  12374. break;
  12375. case"resize_terminal":
  12376. e = JSON.parse(e), curConn == null || curConn.resizeTerminal(e.terminal_id, e.rows, e.cols);
  12377. break;
  12378. case"close_terminal":
  12379. e = JSON.parse(e), curConn == null || curConn.closeTerminal(e.terminal_id);
  12380. break;
  12381. case"envvar":
  12382. e = JSON.parse(e), e.name && e.value ? Ge[e.name] = e.value : e.name && e.value === null ? delete Ge[e.name] : console.error('Invalid envvar value. Expected an object with "name" (string) and "value" (string or null). Received: ' + JSON.stringify(e));
  12383. break
  12384. }
  12385. };
  12386. function ys(u) {
  12387. if (!curConn) return;
  12388. let e = 0;
  12389. switch (u = JSON.parse(u), u.type) {
  12390. case"down":
  12391. e = lo, setTimeout(() => {
  12392. Na(curConn)
  12393. }, 100);
  12394. break;
  12395. case"up":
  12396. e = Do;
  12397. break;
  12398. case"wheel":
  12399. e = Jt;
  12400. break;
  12401. case"trackpad":
  12402. e = Gt;
  12403. break
  12404. }
  12405. switch (u.buttons) {
  12406. case"left":
  12407. e |= $e << 3;
  12408. break;
  12409. case"right":
  12410. e |= u4 << 3;
  12411. break;
  12412. case"wheel":
  12413. e |= Bo << 3;
  12414. break;
  12415. case"back":
  12416. e |= co << 3;
  12417. break;
  12418. case"forward":
  12419. e |= Co << 3;
  12420. break
  12421. }
  12422. let i = parseInt(u.x || "0"), n = parseInt(u.y || "0");
  12423. (e == Jt || e == Gt) && curConn.getOption("reverse_mouse_wheel") == "Y" && (i = -i, n = -n);
  12424. const a = (e & $e << 3) > 0 ? 1 : 0, t = (e & u4 << 3) > 0 ? 1 : 0;
  12425. a ^ t && curConn.getToggleOption("swap-left-right-mouse") && (a ? e = e & ~($e << 3) | u4 << 3 : e = e & ~(u4 << 3) | $e << 3), curConn.inputMouse(e, i, n, u.alt == "true", u.ctrl == "true", u.shift == "true", u.command == "true")
  12426. }
  12427. window.getByName = (u, e) => {
  12428. let i = bs(u, e);
  12429. return typeof i == "string" || i instanceof String ? i : i == null || i == null ? "" : JSON.stringify(i)
  12430. };
  12431. function bs(u, e) {
  12432. var n, a, t, s, E;
  12433. switch (u) {
  12434. case"remember":
  12435. return curConn.getRemember();
  12436. case"option":
  12437. return _.getItem(e);
  12438. case"options":
  12439. const D = ["custom-rendezvous-server", "relay-server", "api-server", "key"], d = {};
  12440. return D.forEach(c => {
  12441. const p = _.getItem(c);
  12442. p && (d[c] = p)
  12443. }), JSON.stringify(d);
  12444. case"option:local":
  12445. const res = X4(e) || "";
  12446. if (e == 'access_token' && res) {
  12447. getServerConf(res)
  12448. }
  12449. return res;
  12450. case"option:flutter:local":
  12451. return fo(e) || "";
  12452. case"option:flutter:peer":
  12453. return curConn.getFlutterUiOption(e) || "";
  12454. case"image_quality":
  12455. return curConn.getImageQuality();
  12456. case"translate":
  12457. return e = JSON.parse(e), To(e.locale, e.text);
  12458. case"option:user:default":
  12459. return d0(e);
  12460. case"option:session":
  12461. return curConn ? curConn.getOption(e) : d0(e);
  12462. case"option:peer":
  12463. try {
  12464. const c = JSON.parse(e);
  12465. return (n = ho(c.id, c.name)) != null ? n : d0(c.name)
  12466. } catch (c) {
  12467. return console.error('Failed to get peer option: "' + e + '", ' + c.message), ""
  12468. }
  12469. case"option:toggle":
  12470. return curConn == null ? void 0 : curConn.getToggleOption(e);
  12471. case"get_conn_status":
  12472. return curConn ? curConn.getStatus() : JSON.stringify({status_num: 0});
  12473. case"test_if_valid_server":
  12474. break;
  12475. case"version":
  12476. return U4;
  12477. case"load_recent_peers":
  12478. Ns();
  12479. break;
  12480. case"load_fav_peers":
  12481. js();
  12482. break;
  12483. case"fav":
  12484. return (a = _.getItem("fav")) != null ? a : "[]";
  12485. case"load_recent_peers_sync":
  12486. return JSON.stringify({peers: JSON.stringify(d3())});
  12487. case"api_server":
  12488. return b4();
  12489. case"is_using_public_server":
  12490. return !_.getItem("custom-rendezvous-server");
  12491. case"get_version_number":
  12492. return L(e);
  12493. case"audit_server":
  12494. return Ya(e);
  12495. case"alternative_codecs":
  12496. return curConn.getAlternativeCodecs();
  12497. case"screen_info":
  12498. return JSON.stringify({
  12499. frame: {
  12500. l: window.screenX,
  12501. t: window.screenY,
  12502. r: window.screenX + window.innerWidth,
  12503. b: window.screenY + window.innerHeight
  12504. },
  12505. visibleFrame: {
  12506. l: window.screen.availLeft,
  12507. t: window.screen.availTop,
  12508. r: window.screen.availLeft + window.screen.availWidth,
  12509. b: window.screen.availTop + window.screen.availHeight
  12510. },
  12511. scaleFactor: window.devicePixelRatio
  12512. });
  12513. case"main_display":
  12514. return JSON.stringify({
  12515. w: window.screen.availWidth,
  12516. h: window.screen.availHeight,
  12517. scaleFactor: window.devicePixelRatio
  12518. });
  12519. case"langs":
  12520. var i = Object.entries(mo).map(([c, p]) => [c, `${p} (${c})`]);
  12521. return i.sort((c, p) => c[0].localeCompare(p[0])), JSON.stringify(i);
  12522. case"build_date":
  12523. return vo;
  12524. case"my_id":
  12525. return Ze();
  12526. case"my_name":
  12527. return Sa();
  12528. case"uuid":
  12529. return Y4();
  12530. case"local_os":
  12531. return $4();
  12532. case"peer_has_password":
  12533. return ((t = (mu()[e] || {}).password) != null ? t : "") !== "";
  12534. case"fullscreen":
  12535. return qs() ? "Y" : "N";
  12536. case"platform":
  12537. return curConn.getPlatform();
  12538. case"enable_trusted_devices":
  12539. return (s = curConn == null ? void 0 : curConn.enableTrustedDevices()) != null && s ? "Y" : "N";
  12540. case"account_auth_result":
  12541. return ms();
  12542. case"envvar":
  12543. return (E = Ge[e]) != null ? E : ""
  12544. }
  12545. return ""
  12546. }
  12547. let D3 = new Worker("./libopus.js?v=02816afa"), Xa;
  12548. function ws(u, e) {
  12549. Xa = zs(u, e), D3.postMessage({channels: u, sampleRate: e})
  12550. }
  12551. function Ss(u) {
  12552. D3.postMessage(u, [u.buffer])
  12553. }
  12554. window.init = async () => {
  12555. try {
  12556. D3.onmessage = u => {
  12557. Xa.feed(u.data)
  12558. }, await Za(), await Uo(), await Un(), await K.init(), console.log("init done"), onInitFinished(), us(), await Zs(), an(!0)
  12559. } catch (u) {
  12560. console.error("Failed to init: " + u.message), onInitFinished()
  12561. }
  12562. };
  12563. window.onunload = () => {
  12564. console.log("window close"), Ln()
  12565. };
  12566. function zs(u, e) {
  12567. return new dn({channels: u, sampleRate: e, flushingTime: 2e3})
  12568. }
  12569. function Ps(u) {
  12570. if (window.clipboardData && window.clipboardData.setData) return window.clipboardData.setData("Text", u);
  12571. if (document.queryCommandSupported && document.queryCommandSupported("copy")) {
  12572. var e = document.createElement("textarea");
  12573. e.textContent = u, e.style.position = "fixed", document.body.appendChild(e), e.select();
  12574. try {
  12575. return document.execCommand("copy")
  12576. } catch (i) {
  12577. console.warn("Copy to clipboard failed.", i)
  12578. } finally {
  12579. document.body.removeChild(e)
  12580. }
  12581. }
  12582. }
  12583. function L(u) {
  12584. try {
  12585. let e = u.split("-"), i = 0;
  12586. if (e.length > 0) {
  12587. let n = 0;
  12588. for (let a of e[0].split(".")) n = parseInt(a) || 0, i = i * 1e3 + n;
  12589. i -= n, i += n * 10
  12590. }
  12591. return e.length > 1 && (i += parseInt(e[1]) || 0), i
  12592. } catch (e) {
  12593. return console.error('Failed to parse version number: "' + u + '" ' + e.message), 0
  12594. }
  12595. }
  12596. function Rs(u) {
  12597. let e = "auto";
  12598. if (u != "auto") try {
  12599. const t = JSON.parse(u);
  12600. if (!t.url) return;
  12601. e = `url(${t.url}) ${t.hotx} ${t.hoty}, auto`
  12602. } catch (t) {
  12603. console.error("Failed to set custom cursor: " + t.message);
  12604. return
  12605. }
  12606. for (var i = document.body, n = 0; n < i.children.length; n++) {
  12607. var a = i.children[n];
  12608. a.tagName == "FLUTTER-VIEW" && (a.style.cursor = e)
  12609. }
  12610. }
  12611. async function Is() {
  12612. await s4.ready;
  12613. const u = s4.crypto_sign_keypair();
  12614. return {publicKey: u.publicKey, privateKey: u.privateKey}
  12615. }
  12616. function Ts(u) {
  12617. try {
  12618. const e = JSON.parse(u), i = JSON.parse(_.getItem("user-default-options")) || {};
  12619. i[e.name] = e.value, _.setItem("user-default-options", JSON.stringify(i))
  12620. } catch (e) {
  12621. console.error("Failed to set user default options: " + e.message)
  12622. }
  12623. }
  12624. function d0(u) {
  12625. var i, n, a;
  12626. const e = {
  12627. view_style: "original",
  12628. scroll_style: "scrollauto",
  12629. image_quality: "balanced",
  12630. "codec-preference": "auto",
  12631. custom_image_quality: "50",
  12632. "custom-fps": "30"
  12633. };
  12634. try {
  12635. return (n = (i = (JSON.parse(_.getItem("user-default-options")) || {})[u]) != null ? i : e[u]) != null ? n : ""
  12636. } catch (t) {
  12637. return console.error("Failed to get user default options: " + t.message), (a = e[u]) != null ? a : ""
  12638. }
  12639. }
  12640. function d3() {
  12641. const u = [];
  12642. for (const [e, i] of Object.entries(mu())) {
  12643. if (!e) continue;
  12644. const n = i.tm, a = i.info || {}, t = {
  12645. id: e,
  12646. username: a.username || "",
  12647. hostname: a.hostname || "",
  12648. platform: a.platform || "",
  12649. alias: i.alias || ""
  12650. };
  12651. !n || !t || u.push([n, e, t])
  12652. }
  12653. return u.sort().reverse().map(e => e[2])
  12654. }
  12655. function Ns() {
  12656. const u = d3();
  12657. u && s3("load_recent_peers", {peers: JSON.stringify(u)})
  12658. }
  12659. function js() {
  12660. var u;
  12661. try {
  12662. const e = (u = _.getItem("fav")) != null ? u : "[]", i = JSON.parse(e), n = d3().filter(a => i.includes(a.id));
  12663. n && s3("load_fav_peers", {peers: JSON.stringify(n)})
  12664. } catch (e) {
  12665. console.error("Failed to load fav peers: " + e.message)
  12666. }
  12667. }
  12668. function Os(u) {
  12669. var e;
  12670. try {
  12671. const i = JSON.parse(u), n = i.id;
  12672. if (n) {
  12673. (e = window.curConn) == null || e.close();
  12674. const a = new Wa;
  12675. return a.setRemoteId(n), a.setSessionInfo(i), E3(a), D4("last_remote_id", n), ""
  12676. } else return "No id found in session data " + u
  12677. } catch (i) {
  12678. return i.message
  12679. }
  12680. }
  12681. function Us(u) {
  12682. try {
  12683. if (!B0()) return;
  12684. Ja()
  12685. } catch (e) {
  12686. Ka("error", "Error", e.message, "")
  12687. }
  12688. }
  12689. function Ms(u) {
  12690. l3()
  12691. }
  12692. function Ls(u, e) {
  12693. function i(n) {
  12694. return /^([0-9a-fA-F]{0,4}:){1,7}[0-9a-fA-F]{0,4}$/.test(n)
  12695. }
  12696. if (i(u)) {
  12697. if (u.startsWith("[")) {
  12698. let n = u.split("]:");
  12699. if (n.length === 2) {
  12700. let a = parseInt(n[1]) || 0;
  12701. if (a > 0) return `${n[0]}]:${a + e}`
  12702. }
  12703. }
  12704. } else if (u.includes(":")) {
  12705. let n = u.split(":");
  12706. if (n.length === 2) {
  12707. let a = parseInt(n[1]) || 0;
  12708. if (a > 0) return `${n[0]}:${a + e}`
  12709. }
  12710. }
  12711. return u
  12712. }
  12713. function b4() {
  12714. const u = _.getItem("api-server");
  12715. if (u) return u;
  12716. const e = _.getItem("custom-rendezvous-server");
  12717. if (e) {
  12718. let i = Ls(e, -2);
  12719. return i == e ? `http://${i}:${ia - 2}` : `http://${i}`
  12720. }
  12721. return window.location.host.indexOf("localhost:") == 0 ? `http://localhost:${ia - 2}` : window.location.origin
  12722. }
  12723. function Ya(u) {
  12724. return b4() + "/api/audit/" + u
  12725. }
  12726. function $a(u, e, i) {
  12727. try {
  12728. k4.exports.ZstdCodec.run(a => {
  12729. var t = new a.Simple;
  12730. i(e ? u.map(s => t.compress(s, 3)) : t.compress(u, 3))
  12731. })
  12732. } catch (n) {
  12733. console.error("Compress failed: ", n)
  12734. }
  12735. }
  12736. function _4(u, e, i) {
  12737. try {
  12738. k4.exports.ZstdCodec.run(n => {
  12739. var a = new n.Simple;
  12740. i(e ? u.map(t => a.decompress(t)) : a.decompress(u))
  12741. })
  12742. } catch (n) {
  12743. console.error("Decompress failed: ", n)
  12744. }
  12745. }
  12746. async function un(u, e) {
  12747. return new Promise((i, n) => {
  12748. try {
  12749. k4.exports.ZstdCodec.run(a => {
  12750. var t = new a.Simple;
  12751. i(t.compress(u, 3))
  12752. })
  12753. } catch (a) {
  12754. n(a)
  12755. }
  12756. })
  12757. }
  12758. async function en(u, e) {
  12759. return new Promise((i, n) => {
  12760. try {
  12761. k4.exports.ZstdCodec.run(a => {
  12762. var t = new a.Simple;
  12763. i(t.decompress(u))
  12764. })
  12765. } catch (a) {
  12766. n(a)
  12767. }
  12768. })
  12769. }
  12770. function Ws() {
  12771. const u = document.documentElement;
  12772. u.requestFullscreen ? u.requestFullscreen() : u.mozRequestFullScreen ? u.mozRequestFullScreen() : u.webkitRequestFullscreen ? u.webkitRequestFullscreen() : u.msRequestFullscreen && u.msRequestFullscreen()
  12773. }
  12774. function Vs() {
  12775. document.exitFullscreen ? document.exitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen ? document.webkitExitFullscreen() : document.msExitFullscreen && document.msExitFullscreen()
  12776. }
  12777. function qs() {
  12778. return document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement
  12779. }
  12780. var Ea = !1;
  12781. function Ks() {
  12782. Ea || (console.log("listen fullscreen"), Ea = !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)))
  12783. }
  12784. Ks();
  12785. async function Hs() {
  12786. try {
  12787. let u = await xa();
  12788. onLoadAbFinished(JSON.stringify(u))
  12789. } catch (u) {
  12790. console.error("Failed to load ab: " + u.message), onLoadAbFinished("")
  12791. }
  12792. }
  12793. async function Js() {
  12794. try {
  12795. let u = await So();
  12796. onLoadGroupFinished(JSON.stringify(u))
  12797. } catch (u) {
  12798. console.error("Failed to load group: " + u.message), onLoadGroupFinished("")
  12799. }
  12800. }
  12801. function tn() {
  12802. return false
  12803. // return ra.indexOf(new TextDecoder().decode(c0("cnVzdGRlc2suY29t"))) < 0 && ra.indexOf(new TextDecoder().decode(c0("bG9jYWxob3N0"))) != 0
  12804. }
  12805. function T4(u) {
  12806. return new TextDecoder().decode(c0(u))
  12807. }
  12808. function an(u) {
  12809. return tn() && (!Pa() && !za() || B3 < 400) ? (u && setTimeout(on, 100), !0) : !1
  12810. }
  12811. let B3 = 0;
  12812. function Gs() {
  12813. return new TextDecoder().decode(c0("L2FwaS9saWMvd2M="))
  12814. }
  12815. async function Zs() {
  12816. if (tn()) try {
  12817. const u = b4() + Gs(), i = await (await fetch(u)).text(), n = await nn(i);
  12818. B3 = parseInt(n[0])
  12819. } catch {
  12820. }
  12821. }
  12822. async function la(u) {
  12823. if (!u) {
  12824. Qt("");
  12825. return
  12826. }
  12827. try {
  12828. const i = (await nn(u))[2];
  12829. Qt(i)
  12830. } catch (e) {
  12831. console.error("Failed to decode verifier: " + e.message)
  12832. }
  12833. }
  12834. async function nn(u) {
  12835. try {
  12836. return new TextDecoder().decode(await H4(u, "IycjQd4TmWvjjLnYd796Rd+XkK+KG+7GU1Ia7u4+vSw=")).split(":")
  12837. } catch (e) {
  12838. return console.error("Failed to decode: " + e.message), []
  12839. }
  12840. }
  12841. function Qs() {
  12842. window.closeConnection()
  12843. }
  12844. function on() {
  12845. if (B3 < 400) {
  12846. window.dialog(T4("ZXJyb3I="), T4("TGljZW5zZSBXYXJuaW5nCg=="), T4("VG8gdXNlIHRoZSB3ZWIgY2xpZW50LCB5b3UgcmVxdWlyZSBhIGxpY2Vuc2UgdGhhdCBzdXBwb3J0cyBhdCBsZWFzdCAxMCB1c2VycyBhbmQgMzAwIGRldmljZXMgLCBvciBhbiBlcXVpdmFsZW50IHBsYW4gd2l0aCBjb21wYXJhYmxlIHZhbHVlIChlLmcuLCAyMCB1c2VycyBhbmQgMjAwIGRldmljZXMsIG9yIGEgcGxhbiBwcmljZWQgZXF1YWwgdG8gb3IgaGlnaGVyIHRoYW4gdGhlIDEwLXVzZXIvMzAwLWRldmljZSB0aWVyKSAu"));
  12847. return
  12848. }
  12849. window.loginDialog()
  12850. }
  12851. const Da = document.querySelector("#app");
  12852. if (Da) {
  12853. let e = function (i, n, a) {
  12854. !B0() || (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"))
  12855. };
  12856. Da.innerHTML = `
  12857. <div id="connect" style="text-align: center"><table style="display: inline-block">
  12858. <tr><td><span>Host: </span></td><td><input id="host" /></td></tr>
  12859. <tr><td><span>Key: </span></td><td><input id="key" /></td></tr>
  12860. <tr><td><span>Id: </span></td><td><input id="id" /></td></tr>
  12861. <tr><td></td><td><button onclick="connect();">Connect</button></td></tr>
  12862. </table></div>
  12863. <div id="password" style="display: none;">
  12864. <input type="password" id="password" />
  12865. <button id="confirm" onclick="confirm()">Confirm</button>
  12866. <button id="cancel" onclick="cancel();">Cancel</button>
  12867. </div>
  12868. <div id="status" style="display: none;">
  12869. <div id="text" style="line-height: 2em"></div>
  12870. <button id="cancel" onclick="cancel();">Cancel</button>
  12871. </div>
  12872. <div id="canvas" style="display: none;">
  12873. <button id="cancel" onclick="cancel();">Cancel</button>
  12874. <canvas id="player"></canvas>
  12875. <canvas id="test-yuv-decoder-canvas"></canvas>
  12876. </div>
  12877. `;
  12878. let u;
  12879. window.init(), document.body.onload = () => {
  12880. const i = document.querySelector("#host");
  12881. i.value = _.getItem("custom-rendezvous-server");
  12882. const n = document.querySelector("#id");
  12883. n.value = _.getItem("id");
  12884. const a = document.querySelector("#key");
  12885. a.value = _.getItem("key"), u = YUVCanvas.attach(document.getElementById("player"))
  12886. }, window.connect = () => {
  12887. const i = document.querySelector("#host");
  12888. _.setItem("custom-rendezvous-server", i.value);
  12889. const n = document.querySelector("#id");
  12890. _.setItem("id", n.value);
  12891. const a = document.querySelector("#key");
  12892. _.setItem("key", a.value), (async () => {
  12893. const s = Ga();
  12894. s.setMsgbox(e), s.setDraw(E => {
  12895. K4(E), u.drawFrame(E)
  12896. }), 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()
  12897. })()
  12898. }, window.cancel = () => {
  12899. l3(), 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"
  12900. }, window.confirm = () => {
  12901. const i = document.querySelector("input#password").value;
  12902. i && (document.querySelector("div#password").style.display = "none", B0().login(i))
  12903. }
  12904. }