_apidocs.html 725 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title>API</title>
  5. <meta charset="utf-8" />
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  8. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.5/css/bulma.min.css" integrity="sha256-vK3UTo/8wHbaUn+dTQD0X6dzidqc5l7gczvH+Bnowwk=" crossorigin="anonymous" id="bulma-theme-light" />
  9. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulmaswatch@0.7.5/cyborg/bulmaswatch.min.css" integrity="sha256-NEPZJFJGDcH6K+NW0Ij8VtItmbltoDzXHaZ4oBQzuvU=" crossorigin="anonymous" media="none" id="bulma-theme-dark" />
  10. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.9.0/css/fontawesome.min.css" integrity="sha256-AaQqnjfGDRZd/lUp0Dvy7URGOyRsh8g9JdWUkyYxNfI=" crossorigin="anonymous" />
  11. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.9.0/css/solid.min.css" integrity="sha256-3FfMfpeajSEpxWZTFowWZPTv7k3GEu7w4rQv49EWsEY=" crossorigin="anonymous" />
  12. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prism-themes@1.1.0/themes/prism-a11y-dark.css" integrity="sha256-d2qy226pP+oHAtEQPujaiXPslYW1Rmtla3Ivu1fFYxU=" crossorigin="anonymous">
  13. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma-switch@2.0.0/dist/css/bulma-switch.min.css" integrity="sha256-jCV/cXwP13w0GNHLgFx6SFgTNAvJPvS5MIhuE30Ng08=" crossorigin="anonymous">
  14. <style>
  15. @media screen and (min-width: 768px) {
  16. .navbar-burger {
  17. display: none;
  18. }
  19. }
  20. </style>
  21. </head>
  22. <body class="has-navbar-fixed-top">
  23. <script>var main = (function () {
  24. 'use strict';
  25. function noop() { }
  26. const identity = x => x;
  27. function assign(tar, src) {
  28. // @ts-ignore
  29. for (const k in src)
  30. tar[k] = src[k];
  31. return tar;
  32. }
  33. function is_promise(value) {
  34. return value && typeof value === 'object' && typeof value.then === 'function';
  35. }
  36. function add_location(element, file, line, column, char) {
  37. element.__svelte_meta = {
  38. loc: { file, line, column, char }
  39. };
  40. }
  41. function run(fn) {
  42. return fn();
  43. }
  44. function blank_object() {
  45. return Object.create(null);
  46. }
  47. function run_all(fns) {
  48. fns.forEach(run);
  49. }
  50. function is_function(thing) {
  51. return typeof thing === 'function';
  52. }
  53. function safe_not_equal(a, b) {
  54. return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
  55. }
  56. function not_equal(a, b) {
  57. return a != a ? b == b : a !== b;
  58. }
  59. function validate_store(store, name) {
  60. if (!store || typeof store.subscribe !== 'function') {
  61. throw new Error(`'${name}' is not a store with a 'subscribe' method`);
  62. }
  63. }
  64. function subscribe(store, callback) {
  65. const unsub = store.subscribe(callback);
  66. return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;
  67. }
  68. function get_store_value(store) {
  69. let value;
  70. subscribe(store, _ => value = _)();
  71. return value;
  72. }
  73. function component_subscribe(component, store, callback) {
  74. component.$$.on_destroy.push(subscribe(store, callback));
  75. }
  76. function create_slot(definition, ctx, $$scope, fn) {
  77. if (definition) {
  78. const slot_ctx = get_slot_context(definition, ctx, $$scope, fn);
  79. return definition[0](slot_ctx);
  80. }
  81. }
  82. function get_slot_context(definition, ctx, $$scope, fn) {
  83. return definition[1] && fn
  84. ? assign($$scope.ctx.slice(), definition[1](fn(ctx)))
  85. : $$scope.ctx;
  86. }
  87. function get_slot_changes(definition, $$scope, dirty, fn) {
  88. if (definition[2] && fn) {
  89. const lets = definition[2](fn(dirty));
  90. if (typeof $$scope.dirty === 'object') {
  91. const merged = [];
  92. const len = Math.max($$scope.dirty.length, lets.length);
  93. for (let i = 0; i < len; i += 1) {
  94. merged[i] = $$scope.dirty[i] | lets[i];
  95. }
  96. return merged;
  97. }
  98. return $$scope.dirty | lets;
  99. }
  100. return $$scope.dirty;
  101. }
  102. function exclude_internal_props(props) {
  103. const result = {};
  104. for (const k in props)
  105. if (k[0] !== '$')
  106. result[k] = props[k];
  107. return result;
  108. }
  109. function once(fn) {
  110. let ran = false;
  111. return function (...args) {
  112. if (ran)
  113. return;
  114. ran = true;
  115. fn.call(this, ...args);
  116. };
  117. }
  118. function null_to_empty(value) {
  119. return value == null ? '' : value;
  120. }
  121. function set_store_value(store, ret, value = ret) {
  122. store.set(value);
  123. return ret;
  124. }
  125. const has_prop = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
  126. const is_client = typeof window !== 'undefined';
  127. let now = is_client
  128. ? () => window.performance.now()
  129. : () => Date.now();
  130. let raf = is_client ? cb => requestAnimationFrame(cb) : noop;
  131. // used internally for testing
  132. function set_now(fn) {
  133. now = fn;
  134. }
  135. function set_raf(fn) {
  136. raf = fn;
  137. }
  138. const tasks = new Set();
  139. function run_tasks(now) {
  140. tasks.forEach(task => {
  141. if (!task.c(now)) {
  142. tasks.delete(task);
  143. task.f();
  144. }
  145. });
  146. if (tasks.size !== 0)
  147. raf(run_tasks);
  148. }
  149. /**
  150. * For testing purposes only!
  151. */
  152. function clear_loops() {
  153. tasks.clear();
  154. }
  155. /**
  156. * Creates a new task that runs on each raf frame
  157. * until it returns a falsy value or is aborted
  158. */
  159. function loop(callback) {
  160. let task;
  161. if (tasks.size === 0)
  162. raf(run_tasks);
  163. return {
  164. promise: new Promise(fulfill => {
  165. tasks.add(task = { c: callback, f: fulfill });
  166. }),
  167. abort() {
  168. tasks.delete(task);
  169. }
  170. };
  171. }
  172. function append(target, node) {
  173. target.appendChild(node);
  174. }
  175. function insert(target, node, anchor) {
  176. target.insertBefore(node, anchor || null);
  177. }
  178. function detach(node) {
  179. node.parentNode.removeChild(node);
  180. }
  181. function destroy_each(iterations, detaching) {
  182. for (let i = 0; i < iterations.length; i += 1) {
  183. if (iterations[i])
  184. iterations[i].d(detaching);
  185. }
  186. }
  187. function element(name) {
  188. return document.createElement(name);
  189. }
  190. function element_is(name, is) {
  191. return document.createElement(name, { is });
  192. }
  193. function object_without_properties(obj, exclude) {
  194. const target = {};
  195. for (const k in obj) {
  196. if (has_prop(obj, k)
  197. // @ts-ignore
  198. && exclude.indexOf(k) === -1) {
  199. // @ts-ignore
  200. target[k] = obj[k];
  201. }
  202. }
  203. return target;
  204. }
  205. function svg_element(name) {
  206. return document.createElementNS('http://www.w3.org/2000/svg', name);
  207. }
  208. function text(data) {
  209. return document.createTextNode(data);
  210. }
  211. function space() {
  212. return text(' ');
  213. }
  214. function empty() {
  215. return text('');
  216. }
  217. function listen(node, event, handler, options) {
  218. node.addEventListener(event, handler, options);
  219. return () => node.removeEventListener(event, handler, options);
  220. }
  221. function prevent_default(fn) {
  222. return function (event) {
  223. event.preventDefault();
  224. // @ts-ignore
  225. return fn.call(this, event);
  226. };
  227. }
  228. function stop_propagation(fn) {
  229. return function (event) {
  230. event.stopPropagation();
  231. // @ts-ignore
  232. return fn.call(this, event);
  233. };
  234. }
  235. function self$1(fn) {
  236. return function (event) {
  237. // @ts-ignore
  238. if (event.target === this)
  239. fn.call(this, event);
  240. };
  241. }
  242. function attr(node, attribute, value) {
  243. if (value == null)
  244. node.removeAttribute(attribute);
  245. else if (node.getAttribute(attribute) !== value)
  246. node.setAttribute(attribute, value);
  247. }
  248. function set_attributes(node, attributes) {
  249. // @ts-ignore
  250. const descriptors = Object.getOwnPropertyDescriptors(node.__proto__);
  251. for (const key in attributes) {
  252. if (attributes[key] == null) {
  253. node.removeAttribute(key);
  254. }
  255. else if (key === 'style') {
  256. node.style.cssText = attributes[key];
  257. }
  258. else if (descriptors[key] && descriptors[key].set) {
  259. node[key] = attributes[key];
  260. }
  261. else {
  262. attr(node, key, attributes[key]);
  263. }
  264. }
  265. }
  266. function set_svg_attributes(node, attributes) {
  267. for (const key in attributes) {
  268. attr(node, key, attributes[key]);
  269. }
  270. }
  271. function set_custom_element_data(node, prop, value) {
  272. if (prop in node) {
  273. node[prop] = value;
  274. }
  275. else {
  276. attr(node, prop, value);
  277. }
  278. }
  279. function xlink_attr(node, attribute, value) {
  280. node.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);
  281. }
  282. function get_binding_group_value(group) {
  283. const value = [];
  284. for (let i = 0; i < group.length; i += 1) {
  285. if (group[i].checked)
  286. value.push(group[i].__value);
  287. }
  288. return value;
  289. }
  290. function to_number(value) {
  291. return value === '' ? undefined : +value;
  292. }
  293. function time_ranges_to_array(ranges) {
  294. const array = [];
  295. for (let i = 0; i < ranges.length; i += 1) {
  296. array.push({ start: ranges.start(i), end: ranges.end(i) });
  297. }
  298. return array;
  299. }
  300. function children(element) {
  301. return Array.from(element.childNodes);
  302. }
  303. function claim_element(nodes, name, attributes, svg) {
  304. for (let i = 0; i < nodes.length; i += 1) {
  305. const node = nodes[i];
  306. if (node.nodeName === name) {
  307. for (let j = 0; j < node.attributes.length; j += 1) {
  308. const attribute = node.attributes[j];
  309. if (!attributes[attribute.name])
  310. node.removeAttribute(attribute.name);
  311. }
  312. return nodes.splice(i, 1)[0]; // TODO strip unwanted attributes
  313. }
  314. }
  315. return svg ? svg_element(name) : element(name);
  316. }
  317. function claim_text(nodes, data) {
  318. for (let i = 0; i < nodes.length; i += 1) {
  319. const node = nodes[i];
  320. if (node.nodeType === 3) {
  321. node.data = '' + data;
  322. return nodes.splice(i, 1)[0];
  323. }
  324. }
  325. return text(data);
  326. }
  327. function claim_space(nodes) {
  328. return claim_text(nodes, ' ');
  329. }
  330. function set_data(text, data) {
  331. data = '' + data;
  332. if (text.data !== data)
  333. text.data = data;
  334. }
  335. function set_input_value(input, value) {
  336. if (value != null || input.value) {
  337. input.value = value;
  338. }
  339. }
  340. function set_input_type(input, type) {
  341. try {
  342. input.type = type;
  343. }
  344. catch (e) {
  345. // do nothing
  346. }
  347. }
  348. function set_style(node, key, value, important) {
  349. node.style.setProperty(key, value, important ? 'important' : '');
  350. }
  351. function select_option(select, value) {
  352. for (let i = 0; i < select.options.length; i += 1) {
  353. const option = select.options[i];
  354. if (option.__value === value) {
  355. option.selected = true;
  356. return;
  357. }
  358. }
  359. }
  360. function select_options(select, value) {
  361. for (let i = 0; i < select.options.length; i += 1) {
  362. const option = select.options[i];
  363. option.selected = ~value.indexOf(option.__value);
  364. }
  365. }
  366. function select_value(select) {
  367. const selected_option = select.querySelector(':checked') || select.options[0];
  368. return selected_option && selected_option.__value;
  369. }
  370. function select_multiple_value(select) {
  371. return [].map.call(select.querySelectorAll(':checked'), option => option.__value);
  372. }
  373. function add_resize_listener(element, fn) {
  374. if (getComputedStyle(element).position === 'static') {
  375. element.style.position = 'relative';
  376. }
  377. const object = document.createElement('object');
  378. object.setAttribute('style', 'display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;');
  379. object.setAttribute('aria-hidden', 'true');
  380. object.type = 'text/html';
  381. object.tabIndex = -1;
  382. let win;
  383. object.onload = () => {
  384. win = object.contentDocument.defaultView;
  385. win.addEventListener('resize', fn);
  386. };
  387. if (/Trident/.test(navigator.userAgent)) {
  388. element.appendChild(object);
  389. object.data = 'about:blank';
  390. }
  391. else {
  392. object.data = 'about:blank';
  393. element.appendChild(object);
  394. }
  395. return {
  396. cancel: () => {
  397. win && win.removeEventListener && win.removeEventListener('resize', fn);
  398. element.removeChild(object);
  399. }
  400. };
  401. }
  402. function toggle_class(element, name, toggle) {
  403. element.classList[toggle ? 'add' : 'remove'](name);
  404. }
  405. function custom_event(type, detail) {
  406. const e = document.createEvent('CustomEvent');
  407. e.initCustomEvent(type, false, false, detail);
  408. return e;
  409. }
  410. class HtmlTag {
  411. constructor(html, anchor = null) {
  412. this.e = element('div');
  413. this.a = anchor;
  414. this.u(html);
  415. }
  416. m(target, anchor = null) {
  417. for (let i = 0; i < this.n.length; i += 1) {
  418. insert(target, this.n[i], anchor);
  419. }
  420. this.t = target;
  421. }
  422. u(html) {
  423. this.e.innerHTML = html;
  424. this.n = Array.from(this.e.childNodes);
  425. }
  426. p(html) {
  427. this.d();
  428. this.u(html);
  429. this.m(this.t, this.a);
  430. }
  431. d() {
  432. this.n.forEach(detach);
  433. }
  434. }
  435. let stylesheet;
  436. let active = 0;
  437. let current_rules = {};
  438. // https://github.com/darkskyapp/string-hash/blob/master/index.js
  439. function hash(str) {
  440. let hash = 5381;
  441. let i = str.length;
  442. while (i--)
  443. hash = ((hash << 5) - hash) ^ str.charCodeAt(i);
  444. return hash >>> 0;
  445. }
  446. function create_rule(node, a, b, duration, delay, ease, fn, uid = 0) {
  447. const step = 16.666 / duration;
  448. let keyframes = '{\n';
  449. for (let p = 0; p <= 1; p += step) {
  450. const t = a + (b - a) * ease(p);
  451. keyframes += p * 100 + `%{${fn(t, 1 - t)}}\n`;
  452. }
  453. const rule = keyframes + `100% {${fn(b, 1 - b)}}\n}`;
  454. const name = `__svelte_${hash(rule)}_${uid}`;
  455. if (!current_rules[name]) {
  456. if (!stylesheet) {
  457. const style = element('style');
  458. document.head.appendChild(style);
  459. stylesheet = style.sheet;
  460. }
  461. current_rules[name] = true;
  462. stylesheet.insertRule(`@keyframes ${name} ${rule}`, stylesheet.cssRules.length);
  463. }
  464. const animation = node.style.animation || '';
  465. node.style.animation = `${animation ? `${animation}, ` : ``}${name} ${duration}ms linear ${delay}ms 1 both`;
  466. active += 1;
  467. return name;
  468. }
  469. function delete_rule(node, name) {
  470. node.style.animation = (node.style.animation || '')
  471. .split(', ')
  472. .filter(name
  473. ? anim => anim.indexOf(name) < 0 // remove specific animation
  474. : anim => anim.indexOf('__svelte') === -1 // remove all Svelte animations
  475. )
  476. .join(', ');
  477. if (name && !--active)
  478. clear_rules();
  479. }
  480. function clear_rules() {
  481. raf(() => {
  482. if (active)
  483. return;
  484. let i = stylesheet.cssRules.length;
  485. while (i--)
  486. stylesheet.deleteRule(i);
  487. current_rules = {};
  488. });
  489. }
  490. function create_animation(node, from, fn, params) {
  491. if (!from)
  492. return noop;
  493. const to = node.getBoundingClientRect();
  494. if (from.left === to.left && from.right === to.right && from.top === to.top && from.bottom === to.bottom)
  495. return noop;
  496. const { delay = 0, duration = 300, easing = identity,
  497. // @ts-ignore todo: should this be separated from destructuring? Or start/end added to public api and documentation?
  498. start: start_time = now() + delay,
  499. // @ts-ignore todo:
  500. end = start_time + duration, tick = noop, css } = fn(node, { from, to }, params);
  501. let running = true;
  502. let started = false;
  503. let name;
  504. function start() {
  505. if (css) {
  506. name = create_rule(node, 0, 1, duration, delay, easing, css);
  507. }
  508. if (!delay) {
  509. started = true;
  510. }
  511. }
  512. function stop() {
  513. if (css)
  514. delete_rule(node, name);
  515. running = false;
  516. }
  517. loop(now => {
  518. if (!started && now >= start_time) {
  519. started = true;
  520. }
  521. if (started && now >= end) {
  522. tick(1, 0);
  523. stop();
  524. }
  525. if (!running) {
  526. return false;
  527. }
  528. if (started) {
  529. const p = now - start_time;
  530. const t = 0 + 1 * easing(p / duration);
  531. tick(t, 1 - t);
  532. }
  533. return true;
  534. });
  535. start();
  536. tick(0, 1);
  537. return stop;
  538. }
  539. function fix_position(node) {
  540. const style = getComputedStyle(node);
  541. if (style.position !== 'absolute' && style.position !== 'fixed') {
  542. const { width, height } = style;
  543. const a = node.getBoundingClientRect();
  544. node.style.position = 'absolute';
  545. node.style.width = width;
  546. node.style.height = height;
  547. add_transform(node, a);
  548. }
  549. }
  550. function add_transform(node, a) {
  551. const b = node.getBoundingClientRect();
  552. if (a.left !== b.left || a.top !== b.top) {
  553. const style = getComputedStyle(node);
  554. const transform = style.transform === 'none' ? '' : style.transform;
  555. node.style.transform = `${transform} translate(${a.left - b.left}px, ${a.top - b.top}px)`;
  556. }
  557. }
  558. let current_component;
  559. function set_current_component(component) {
  560. current_component = component;
  561. }
  562. function get_current_component() {
  563. if (!current_component)
  564. throw new Error(`Function called outside component initialization`);
  565. return current_component;
  566. }
  567. function beforeUpdate(fn) {
  568. get_current_component().$$.before_update.push(fn);
  569. }
  570. function onMount(fn) {
  571. get_current_component().$$.on_mount.push(fn);
  572. }
  573. function afterUpdate(fn) {
  574. get_current_component().$$.after_update.push(fn);
  575. }
  576. function onDestroy(fn) {
  577. get_current_component().$$.on_destroy.push(fn);
  578. }
  579. function createEventDispatcher() {
  580. const component = get_current_component();
  581. return (type, detail) => {
  582. const callbacks = component.$$.callbacks[type];
  583. if (callbacks) {
  584. // TODO are there situations where events could be dispatched
  585. // in a server (non-DOM) environment?
  586. const event = custom_event(type, detail);
  587. callbacks.slice().forEach(fn => {
  588. fn.call(component, event);
  589. });
  590. }
  591. };
  592. }
  593. function setContext(key, context) {
  594. get_current_component().$$.context.set(key, context);
  595. }
  596. function getContext(key) {
  597. return get_current_component().$$.context.get(key);
  598. }
  599. // TODO figure out if we still want to support
  600. // shorthand events, or if we want to implement
  601. // a real bubbling mechanism
  602. function bubble(component, event) {
  603. const callbacks = component.$$.callbacks[event.type];
  604. if (callbacks) {
  605. callbacks.slice().forEach(fn => fn(event));
  606. }
  607. }
  608. const dirty_components = [];
  609. const intros = { enabled: false };
  610. const binding_callbacks = [];
  611. const render_callbacks = [];
  612. const flush_callbacks = [];
  613. const resolved_promise = Promise.resolve();
  614. let update_scheduled = false;
  615. function schedule_update() {
  616. if (!update_scheduled) {
  617. update_scheduled = true;
  618. resolved_promise.then(flush);
  619. }
  620. }
  621. function tick() {
  622. schedule_update();
  623. return resolved_promise;
  624. }
  625. function add_render_callback(fn) {
  626. render_callbacks.push(fn);
  627. }
  628. function add_flush_callback(fn) {
  629. flush_callbacks.push(fn);
  630. }
  631. function flush() {
  632. const seen_callbacks = new Set();
  633. do {
  634. // first, call beforeUpdate functions
  635. // and update components
  636. while (dirty_components.length) {
  637. const component = dirty_components.shift();
  638. set_current_component(component);
  639. update(component.$$);
  640. }
  641. while (binding_callbacks.length)
  642. binding_callbacks.pop()();
  643. // then, once components are updated, call
  644. // afterUpdate functions. This may cause
  645. // subsequent updates...
  646. for (let i = 0; i < render_callbacks.length; i += 1) {
  647. const callback = render_callbacks[i];
  648. if (!seen_callbacks.has(callback)) {
  649. callback();
  650. // ...so guard against infinite loops
  651. seen_callbacks.add(callback);
  652. }
  653. }
  654. render_callbacks.length = 0;
  655. } while (dirty_components.length);
  656. while (flush_callbacks.length) {
  657. flush_callbacks.pop()();
  658. }
  659. update_scheduled = false;
  660. }
  661. function update($$) {
  662. if ($$.fragment !== null) {
  663. $$.update();
  664. run_all($$.before_update);
  665. const dirty = $$.dirty;
  666. $$.dirty = [-1];
  667. $$.fragment && $$.fragment.p($$.ctx, dirty);
  668. $$.after_update.forEach(add_render_callback);
  669. }
  670. }
  671. let promise;
  672. function wait() {
  673. if (!promise) {
  674. promise = Promise.resolve();
  675. promise.then(() => {
  676. promise = null;
  677. });
  678. }
  679. return promise;
  680. }
  681. function dispatch(node, direction, kind) {
  682. node.dispatchEvent(custom_event(`${direction ? 'intro' : 'outro'}${kind}`));
  683. }
  684. const outroing = new Set();
  685. let outros;
  686. function group_outros() {
  687. outros = {
  688. r: 0,
  689. c: [],
  690. p: outros // parent group
  691. };
  692. }
  693. function check_outros() {
  694. if (!outros.r) {
  695. run_all(outros.c);
  696. }
  697. outros = outros.p;
  698. }
  699. function transition_in(block, local) {
  700. if (block && block.i) {
  701. outroing.delete(block);
  702. block.i(local);
  703. }
  704. }
  705. function transition_out(block, local, detach, callback) {
  706. if (block && block.o) {
  707. if (outroing.has(block))
  708. return;
  709. outroing.add(block);
  710. outros.c.push(() => {
  711. outroing.delete(block);
  712. if (callback) {
  713. if (detach)
  714. block.d(1);
  715. callback();
  716. }
  717. });
  718. block.o(local);
  719. }
  720. }
  721. const null_transition = { duration: 0 };
  722. function create_in_transition(node, fn, params) {
  723. let config = fn(node, params);
  724. let running = false;
  725. let animation_name;
  726. let task;
  727. let uid = 0;
  728. function cleanup() {
  729. if (animation_name)
  730. delete_rule(node, animation_name);
  731. }
  732. function go() {
  733. const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;
  734. if (css)
  735. animation_name = create_rule(node, 0, 1, duration, delay, easing, css, uid++);
  736. tick(0, 1);
  737. const start_time = now() + delay;
  738. const end_time = start_time + duration;
  739. if (task)
  740. task.abort();
  741. running = true;
  742. add_render_callback(() => dispatch(node, true, 'start'));
  743. task = loop(now => {
  744. if (running) {
  745. if (now >= end_time) {
  746. tick(1, 0);
  747. dispatch(node, true, 'end');
  748. cleanup();
  749. return running = false;
  750. }
  751. if (now >= start_time) {
  752. const t = easing((now - start_time) / duration);
  753. tick(t, 1 - t);
  754. }
  755. }
  756. return running;
  757. });
  758. }
  759. let started = false;
  760. return {
  761. start() {
  762. if (started)
  763. return;
  764. delete_rule(node);
  765. if (is_function(config)) {
  766. config = config();
  767. wait().then(go);
  768. }
  769. else {
  770. go();
  771. }
  772. },
  773. invalidate() {
  774. started = false;
  775. },
  776. end() {
  777. if (running) {
  778. cleanup();
  779. running = false;
  780. }
  781. }
  782. };
  783. }
  784. function create_out_transition(node, fn, params) {
  785. let config = fn(node, params);
  786. let running = true;
  787. let animation_name;
  788. const group = outros;
  789. group.r += 1;
  790. function go() {
  791. const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;
  792. if (css)
  793. animation_name = create_rule(node, 1, 0, duration, delay, easing, css);
  794. const start_time = now() + delay;
  795. const end_time = start_time + duration;
  796. add_render_callback(() => dispatch(node, false, 'start'));
  797. loop(now => {
  798. if (running) {
  799. if (now >= end_time) {
  800. tick(0, 1);
  801. dispatch(node, false, 'end');
  802. if (!--group.r) {
  803. // this will result in `end()` being called,
  804. // so we don't need to clean up here
  805. run_all(group.c);
  806. }
  807. return false;
  808. }
  809. if (now >= start_time) {
  810. const t = easing((now - start_time) / duration);
  811. tick(1 - t, t);
  812. }
  813. }
  814. return running;
  815. });
  816. }
  817. if (is_function(config)) {
  818. wait().then(() => {
  819. // @ts-ignore
  820. config = config();
  821. go();
  822. });
  823. }
  824. else {
  825. go();
  826. }
  827. return {
  828. end(reset) {
  829. if (reset && config.tick) {
  830. config.tick(1, 0);
  831. }
  832. if (running) {
  833. if (animation_name)
  834. delete_rule(node, animation_name);
  835. running = false;
  836. }
  837. }
  838. };
  839. }
  840. function create_bidirectional_transition(node, fn, params, intro) {
  841. let config = fn(node, params);
  842. let t = intro ? 0 : 1;
  843. let running_program = null;
  844. let pending_program = null;
  845. let animation_name = null;
  846. function clear_animation() {
  847. if (animation_name)
  848. delete_rule(node, animation_name);
  849. }
  850. function init(program, duration) {
  851. const d = program.b - t;
  852. duration *= Math.abs(d);
  853. return {
  854. a: t,
  855. b: program.b,
  856. d,
  857. duration,
  858. start: program.start,
  859. end: program.start + duration,
  860. group: program.group
  861. };
  862. }
  863. function go(b) {
  864. const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;
  865. const program = {
  866. start: now() + delay,
  867. b
  868. };
  869. if (!b) {
  870. // @ts-ignore todo: improve typings
  871. program.group = outros;
  872. outros.r += 1;
  873. }
  874. if (running_program) {
  875. pending_program = program;
  876. }
  877. else {
  878. // if this is an intro, and there's a delay, we need to do
  879. // an initial tick and/or apply CSS animation immediately
  880. if (css) {
  881. clear_animation();
  882. animation_name = create_rule(node, t, b, duration, delay, easing, css);
  883. }
  884. if (b)
  885. tick(0, 1);
  886. running_program = init(program, duration);
  887. add_render_callback(() => dispatch(node, b, 'start'));
  888. loop(now => {
  889. if (pending_program && now > pending_program.start) {
  890. running_program = init(pending_program, duration);
  891. pending_program = null;
  892. dispatch(node, running_program.b, 'start');
  893. if (css) {
  894. clear_animation();
  895. animation_name = create_rule(node, t, running_program.b, running_program.duration, 0, easing, config.css);
  896. }
  897. }
  898. if (running_program) {
  899. if (now >= running_program.end) {
  900. tick(t = running_program.b, 1 - t);
  901. dispatch(node, running_program.b, 'end');
  902. if (!pending_program) {
  903. // we're done
  904. if (running_program.b) {
  905. // intro — we can tidy up immediately
  906. clear_animation();
  907. }
  908. else {
  909. // outro — needs to be coordinated
  910. if (!--running_program.group.r)
  911. run_all(running_program.group.c);
  912. }
  913. }
  914. running_program = null;
  915. }
  916. else if (now >= running_program.start) {
  917. const p = now - running_program.start;
  918. t = running_program.a + running_program.d * easing(p / running_program.duration);
  919. tick(t, 1 - t);
  920. }
  921. }
  922. return !!(running_program || pending_program);
  923. });
  924. }
  925. }
  926. return {
  927. run(b) {
  928. if (is_function(config)) {
  929. wait().then(() => {
  930. // @ts-ignore
  931. config = config();
  932. go(b);
  933. });
  934. }
  935. else {
  936. go(b);
  937. }
  938. },
  939. end() {
  940. clear_animation();
  941. running_program = pending_program = null;
  942. }
  943. };
  944. }
  945. function handle_promise(promise, info) {
  946. const token = info.token = {};
  947. function update(type, index, key, value) {
  948. if (info.token !== token)
  949. return;
  950. info.resolved = value;
  951. let child_ctx = info.ctx;
  952. if (key !== undefined) {
  953. child_ctx = child_ctx.slice();
  954. child_ctx[key] = value;
  955. }
  956. const block = type && (info.current = type)(child_ctx);
  957. let needs_flush = false;
  958. if (info.block) {
  959. if (info.blocks) {
  960. info.blocks.forEach((block, i) => {
  961. if (i !== index && block) {
  962. group_outros();
  963. transition_out(block, 1, 1, () => {
  964. info.blocks[i] = null;
  965. });
  966. check_outros();
  967. }
  968. });
  969. }
  970. else {
  971. info.block.d(1);
  972. }
  973. block.c();
  974. transition_in(block, 1);
  975. block.m(info.mount(), info.anchor);
  976. needs_flush = true;
  977. }
  978. info.block = block;
  979. if (info.blocks)
  980. info.blocks[index] = block;
  981. if (needs_flush) {
  982. flush();
  983. }
  984. }
  985. if (is_promise(promise)) {
  986. const current_component = get_current_component();
  987. promise.then(value => {
  988. set_current_component(current_component);
  989. update(info.then, 1, info.value, value);
  990. set_current_component(null);
  991. }, error => {
  992. set_current_component(current_component);
  993. update(info.catch, 2, info.error, error);
  994. set_current_component(null);
  995. });
  996. // if we previously had a then/catch block, destroy it
  997. if (info.current !== info.pending) {
  998. update(info.pending, 0);
  999. return true;
  1000. }
  1001. }
  1002. else {
  1003. if (info.current !== info.then) {
  1004. update(info.then, 1, info.value, promise);
  1005. return true;
  1006. }
  1007. info.resolved = promise;
  1008. }
  1009. }
  1010. const globals = (typeof window !== 'undefined' ? window : global);
  1011. function destroy_block(block, lookup) {
  1012. block.d(1);
  1013. lookup.delete(block.key);
  1014. }
  1015. function outro_and_destroy_block(block, lookup) {
  1016. transition_out(block, 1, 1, () => {
  1017. lookup.delete(block.key);
  1018. });
  1019. }
  1020. function fix_and_destroy_block(block, lookup) {
  1021. block.f();
  1022. destroy_block(block, lookup);
  1023. }
  1024. function fix_and_outro_and_destroy_block(block, lookup) {
  1025. block.f();
  1026. outro_and_destroy_block(block, lookup);
  1027. }
  1028. function update_keyed_each(old_blocks, dirty, get_key, dynamic, ctx, list, lookup, node, destroy, create_each_block, next, get_context) {
  1029. let o = old_blocks.length;
  1030. let n = list.length;
  1031. let i = o;
  1032. const old_indexes = {};
  1033. while (i--)
  1034. old_indexes[old_blocks[i].key] = i;
  1035. const new_blocks = [];
  1036. const new_lookup = new Map();
  1037. const deltas = new Map();
  1038. i = n;
  1039. while (i--) {
  1040. const child_ctx = get_context(ctx, list, i);
  1041. const key = get_key(child_ctx);
  1042. let block = lookup.get(key);
  1043. if (!block) {
  1044. block = create_each_block(key, child_ctx);
  1045. block.c();
  1046. }
  1047. else if (dynamic) {
  1048. block.p(child_ctx, dirty);
  1049. }
  1050. new_lookup.set(key, new_blocks[i] = block);
  1051. if (key in old_indexes)
  1052. deltas.set(key, Math.abs(i - old_indexes[key]));
  1053. }
  1054. const will_move = new Set();
  1055. const did_move = new Set();
  1056. function insert(block) {
  1057. transition_in(block, 1);
  1058. block.m(node, next);
  1059. lookup.set(block.key, block);
  1060. next = block.first;
  1061. n--;
  1062. }
  1063. while (o && n) {
  1064. const new_block = new_blocks[n - 1];
  1065. const old_block = old_blocks[o - 1];
  1066. const new_key = new_block.key;
  1067. const old_key = old_block.key;
  1068. if (new_block === old_block) {
  1069. // do nothing
  1070. next = new_block.first;
  1071. o--;
  1072. n--;
  1073. }
  1074. else if (!new_lookup.has(old_key)) {
  1075. // remove old block
  1076. destroy(old_block, lookup);
  1077. o--;
  1078. }
  1079. else if (!lookup.has(new_key) || will_move.has(new_key)) {
  1080. insert(new_block);
  1081. }
  1082. else if (did_move.has(old_key)) {
  1083. o--;
  1084. }
  1085. else if (deltas.get(new_key) > deltas.get(old_key)) {
  1086. did_move.add(new_key);
  1087. insert(new_block);
  1088. }
  1089. else {
  1090. will_move.add(old_key);
  1091. o--;
  1092. }
  1093. }
  1094. while (o--) {
  1095. const old_block = old_blocks[o];
  1096. if (!new_lookup.has(old_block.key))
  1097. destroy(old_block, lookup);
  1098. }
  1099. while (n)
  1100. insert(new_blocks[n - 1]);
  1101. return new_blocks;
  1102. }
  1103. function measure(blocks) {
  1104. const rects = {};
  1105. let i = blocks.length;
  1106. while (i--)
  1107. rects[blocks[i].key] = blocks[i].node.getBoundingClientRect();
  1108. return rects;
  1109. }
  1110. function get_spread_update(levels, updates) {
  1111. const update = {};
  1112. const to_null_out = {};
  1113. const accounted_for = { $$scope: 1 };
  1114. let i = levels.length;
  1115. while (i--) {
  1116. const o = levels[i];
  1117. const n = updates[i];
  1118. if (n) {
  1119. for (const key in o) {
  1120. if (!(key in n))
  1121. to_null_out[key] = 1;
  1122. }
  1123. for (const key in n) {
  1124. if (!accounted_for[key]) {
  1125. update[key] = n[key];
  1126. accounted_for[key] = 1;
  1127. }
  1128. }
  1129. levels[i] = n;
  1130. }
  1131. else {
  1132. for (const key in o) {
  1133. accounted_for[key] = 1;
  1134. }
  1135. }
  1136. }
  1137. for (const key in to_null_out) {
  1138. if (!(key in update))
  1139. update[key] = undefined;
  1140. }
  1141. return update;
  1142. }
  1143. function get_spread_object(spread_props) {
  1144. return typeof spread_props === 'object' && spread_props !== null ? spread_props : {};
  1145. }
  1146. // source: https://html.spec.whatwg.org/multipage/indices.html
  1147. const boolean_attributes = new Set([
  1148. 'allowfullscreen',
  1149. 'allowpaymentrequest',
  1150. 'async',
  1151. 'autofocus',
  1152. 'autoplay',
  1153. 'checked',
  1154. 'controls',
  1155. 'default',
  1156. 'defer',
  1157. 'disabled',
  1158. 'formnovalidate',
  1159. 'hidden',
  1160. 'ismap',
  1161. 'loop',
  1162. 'multiple',
  1163. 'muted',
  1164. 'nomodule',
  1165. 'novalidate',
  1166. 'open',
  1167. 'playsinline',
  1168. 'readonly',
  1169. 'required',
  1170. 'reversed',
  1171. 'selected'
  1172. ]);
  1173. const invalid_attribute_name_character = /[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u;
  1174. // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
  1175. // https://infra.spec.whatwg.org/#noncharacter
  1176. function spread(args, classes_to_add) {
  1177. const attributes = Object.assign({}, ...args);
  1178. if (classes_to_add) {
  1179. if (attributes.class == null) {
  1180. attributes.class = classes_to_add;
  1181. }
  1182. else {
  1183. attributes.class += ' ' + classes_to_add;
  1184. }
  1185. }
  1186. let str = '';
  1187. Object.keys(attributes).forEach(name => {
  1188. if (invalid_attribute_name_character.test(name))
  1189. return;
  1190. const value = attributes[name];
  1191. if (value === true)
  1192. str += " " + name;
  1193. else if (boolean_attributes.has(name.toLowerCase())) {
  1194. if (value)
  1195. str += " " + name;
  1196. }
  1197. else if (value != null) {
  1198. str += " " + name + "=" + JSON.stringify(String(value)
  1199. .replace(/"/g, '&#34;')
  1200. .replace(/'/g, '&#39;'));
  1201. }
  1202. });
  1203. return str;
  1204. }
  1205. const escaped = {
  1206. '"': '&quot;',
  1207. "'": '&#39;',
  1208. '&': '&amp;',
  1209. '<': '&lt;',
  1210. '>': '&gt;'
  1211. };
  1212. function escape$1(html) {
  1213. return String(html).replace(/["'&<>]/g, match => escaped[match]);
  1214. }
  1215. function each(items, fn) {
  1216. let str = '';
  1217. for (let i = 0; i < items.length; i += 1) {
  1218. str += fn(items[i], i);
  1219. }
  1220. return str;
  1221. }
  1222. const missing_component = {
  1223. $$render: () => ''
  1224. };
  1225. function validate_component(component, name) {
  1226. if (!component || !component.$$render) {
  1227. if (name === 'svelte:component')
  1228. name += ' this={...}';
  1229. throw new Error(`<${name}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules`);
  1230. }
  1231. return component;
  1232. }
  1233. function debug(file, line, column, values) {
  1234. console.log(`{@debug} ${file ? file + ' ' : ''}(${line}:${column})`); // eslint-disable-line no-console
  1235. console.log(values); // eslint-disable-line no-console
  1236. return '';
  1237. }
  1238. let on_destroy;
  1239. function create_ssr_component(fn) {
  1240. function $$render(result, props, bindings, slots) {
  1241. const parent_component = current_component;
  1242. const $$ = {
  1243. on_destroy,
  1244. context: new Map(parent_component ? parent_component.$$.context : []),
  1245. // these will be immediately discarded
  1246. on_mount: [],
  1247. before_update: [],
  1248. after_update: [],
  1249. callbacks: blank_object()
  1250. };
  1251. set_current_component({ $$ });
  1252. const html = fn(result, props, bindings, slots);
  1253. set_current_component(parent_component);
  1254. return html;
  1255. }
  1256. return {
  1257. render: (props = {}, options = {}) => {
  1258. on_destroy = [];
  1259. const result = { head: '', css: new Set() };
  1260. const html = $$render(result, props, {}, options);
  1261. run_all(on_destroy);
  1262. return {
  1263. html,
  1264. css: {
  1265. code: Array.from(result.css).map(css => css.code).join('\n'),
  1266. map: null // TODO
  1267. },
  1268. head: result.head
  1269. };
  1270. },
  1271. $$render
  1272. };
  1273. }
  1274. function add_attribute(name, value, boolean) {
  1275. if (value == null || (boolean && !value))
  1276. return '';
  1277. return ` ${name}${value === true ? '' : `=${typeof value === 'string' ? JSON.stringify(escape$1(value)) : `"${value}"`}`}`;
  1278. }
  1279. function add_classes(classes) {
  1280. return classes ? ` class="${classes}"` : ``;
  1281. }
  1282. function bind(component, name, callback) {
  1283. const index = component.$$.props[name];
  1284. if (index !== undefined) {
  1285. component.$$.bound[index] = callback;
  1286. callback(component.$$.ctx[index]);
  1287. }
  1288. }
  1289. function create_component(block) {
  1290. block && block.c();
  1291. }
  1292. function claim_component(block, parent_nodes) {
  1293. block && block.l(parent_nodes);
  1294. }
  1295. function mount_component(component, target, anchor) {
  1296. const { fragment, on_mount, on_destroy, after_update } = component.$$;
  1297. fragment && fragment.m(target, anchor);
  1298. // onMount happens before the initial afterUpdate
  1299. add_render_callback(() => {
  1300. const new_on_destroy = on_mount.map(run).filter(is_function);
  1301. if (on_destroy) {
  1302. on_destroy.push(...new_on_destroy);
  1303. }
  1304. else {
  1305. // Edge case - component was destroyed immediately,
  1306. // most likely as a result of a binding initialising
  1307. run_all(new_on_destroy);
  1308. }
  1309. component.$$.on_mount = [];
  1310. });
  1311. after_update.forEach(add_render_callback);
  1312. }
  1313. function destroy_component(component, detaching) {
  1314. const $$ = component.$$;
  1315. if ($$.fragment !== null) {
  1316. run_all($$.on_destroy);
  1317. $$.fragment && $$.fragment.d(detaching);
  1318. // TODO null out other refs, including component.$$ (but need to
  1319. // preserve final state?)
  1320. $$.on_destroy = $$.fragment = null;
  1321. $$.ctx = [];
  1322. }
  1323. }
  1324. function make_dirty(component, i) {
  1325. if (component.$$.dirty[0] === -1) {
  1326. dirty_components.push(component);
  1327. schedule_update();
  1328. component.$$.dirty.fill(0);
  1329. }
  1330. component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31));
  1331. }
  1332. function init(component, options, instance, create_fragment, not_equal, props, dirty = [-1]) {
  1333. const parent_component = current_component;
  1334. set_current_component(component);
  1335. const prop_values = options.props || {};
  1336. const $$ = component.$$ = {
  1337. fragment: null,
  1338. ctx: null,
  1339. // state
  1340. props,
  1341. update: noop,
  1342. not_equal,
  1343. bound: blank_object(),
  1344. // lifecycle
  1345. on_mount: [],
  1346. on_destroy: [],
  1347. before_update: [],
  1348. after_update: [],
  1349. context: new Map(parent_component ? parent_component.$$.context : []),
  1350. // everything else
  1351. callbacks: blank_object(),
  1352. dirty
  1353. };
  1354. let ready = false;
  1355. $$.ctx = instance
  1356. ? instance(component, prop_values, (i, ret, value = ret) => {
  1357. if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {
  1358. if ($$.bound[i])
  1359. $$.bound[i](value);
  1360. if (ready)
  1361. make_dirty(component, i);
  1362. }
  1363. return ret;
  1364. })
  1365. : [];
  1366. $$.update();
  1367. ready = true;
  1368. run_all($$.before_update);
  1369. // `false` as a special case of no DOM component
  1370. $$.fragment = create_fragment ? create_fragment($$.ctx) : false;
  1371. if (options.target) {
  1372. if (options.hydrate) {
  1373. // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
  1374. $$.fragment && $$.fragment.l(children(options.target));
  1375. }
  1376. else {
  1377. // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
  1378. $$.fragment && $$.fragment.c();
  1379. }
  1380. if (options.intro)
  1381. transition_in(component.$$.fragment);
  1382. mount_component(component, options.target, options.anchor);
  1383. flush();
  1384. }
  1385. set_current_component(parent_component);
  1386. }
  1387. let SvelteElement;
  1388. if (typeof HTMLElement === 'function') {
  1389. SvelteElement = class extends HTMLElement {
  1390. constructor() {
  1391. super();
  1392. this.attachShadow({ mode: 'open' });
  1393. }
  1394. connectedCallback() {
  1395. // @ts-ignore todo: improve typings
  1396. for (const key in this.$$.slotted) {
  1397. // @ts-ignore todo: improve typings
  1398. this.appendChild(this.$$.slotted[key]);
  1399. }
  1400. }
  1401. attributeChangedCallback(attr, _oldValue, newValue) {
  1402. this[attr] = newValue;
  1403. }
  1404. $destroy() {
  1405. destroy_component(this, 1);
  1406. this.$destroy = noop;
  1407. }
  1408. $on(type, callback) {
  1409. // TODO should this delegate to addEventListener?
  1410. const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));
  1411. callbacks.push(callback);
  1412. return () => {
  1413. const index = callbacks.indexOf(callback);
  1414. if (index !== -1)
  1415. callbacks.splice(index, 1);
  1416. };
  1417. }
  1418. $set() {
  1419. // overridden by instance, if it has props
  1420. }
  1421. };
  1422. }
  1423. class SvelteComponent {
  1424. $destroy() {
  1425. destroy_component(this, 1);
  1426. this.$destroy = noop;
  1427. }
  1428. $on(type, callback) {
  1429. const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));
  1430. callbacks.push(callback);
  1431. return () => {
  1432. const index = callbacks.indexOf(callback);
  1433. if (index !== -1)
  1434. callbacks.splice(index, 1);
  1435. };
  1436. }
  1437. $set() {
  1438. // overridden by instance, if it has props
  1439. }
  1440. }
  1441. function dispatch_dev(type, detail) {
  1442. document.dispatchEvent(custom_event(type, detail));
  1443. }
  1444. function append_dev(target, node) {
  1445. dispatch_dev("SvelteDOMInsert", { target, node });
  1446. append(target, node);
  1447. }
  1448. function insert_dev(target, node, anchor) {
  1449. dispatch_dev("SvelteDOMInsert", { target, node, anchor });
  1450. insert(target, node, anchor);
  1451. }
  1452. function detach_dev(node) {
  1453. dispatch_dev("SvelteDOMRemove", { node });
  1454. detach(node);
  1455. }
  1456. function detach_between_dev(before, after) {
  1457. while (before.nextSibling && before.nextSibling !== after) {
  1458. detach_dev(before.nextSibling);
  1459. }
  1460. }
  1461. function detach_before_dev(after) {
  1462. while (after.previousSibling) {
  1463. detach_dev(after.previousSibling);
  1464. }
  1465. }
  1466. function detach_after_dev(before) {
  1467. while (before.nextSibling) {
  1468. detach_dev(before.nextSibling);
  1469. }
  1470. }
  1471. function listen_dev(node, event, handler, options, has_prevent_default, has_stop_propagation) {
  1472. const modifiers = options === true ? ["capture"] : options ? Array.from(Object.keys(options)) : [];
  1473. if (has_prevent_default)
  1474. modifiers.push('preventDefault');
  1475. if (has_stop_propagation)
  1476. modifiers.push('stopPropagation');
  1477. dispatch_dev("SvelteDOMAddEventListener", { node, event, handler, modifiers });
  1478. const dispose = listen(node, event, handler, options);
  1479. return () => {
  1480. dispatch_dev("SvelteDOMRemoveEventListener", { node, event, handler, modifiers });
  1481. dispose();
  1482. };
  1483. }
  1484. function attr_dev(node, attribute, value) {
  1485. attr(node, attribute, value);
  1486. if (value == null)
  1487. dispatch_dev("SvelteDOMRemoveAttribute", { node, attribute });
  1488. else
  1489. dispatch_dev("SvelteDOMSetAttribute", { node, attribute, value });
  1490. }
  1491. function prop_dev(node, property, value) {
  1492. node[property] = value;
  1493. dispatch_dev("SvelteDOMSetProperty", { node, property, value });
  1494. }
  1495. function dataset_dev(node, property, value) {
  1496. node.dataset[property] = value;
  1497. dispatch_dev("SvelteDOMSetDataset", { node, property, value });
  1498. }
  1499. function set_data_dev(text, data) {
  1500. data = '' + data;
  1501. if (text.data === data)
  1502. return;
  1503. dispatch_dev("SvelteDOMSetData", { node: text, data });
  1504. text.data = data;
  1505. }
  1506. class SvelteComponentDev extends SvelteComponent {
  1507. constructor(options) {
  1508. if (!options || (!options.target && !options.$$inline)) {
  1509. throw new Error(`'target' is a required option`);
  1510. }
  1511. super();
  1512. }
  1513. $destroy() {
  1514. super.$destroy();
  1515. this.$destroy = () => {
  1516. console.warn(`Component was already destroyed`); // eslint-disable-line no-console
  1517. };
  1518. }
  1519. }
  1520. function loop_guard(timeout) {
  1521. const start = Date.now();
  1522. return () => {
  1523. if (Date.now() - start > timeout) {
  1524. throw new Error(`Infinite loop detected`);
  1525. }
  1526. };
  1527. }
  1528. 'use strict';
  1529. var has = Object.prototype.hasOwnProperty
  1530. , undef;
  1531. /**
  1532. * Decode a URI encoded string.
  1533. *
  1534. * @param {String} input The URI encoded string.
  1535. * @returns {String|Null} The decoded string.
  1536. * @api private
  1537. */
  1538. function decode(input) {
  1539. try {
  1540. return decodeURIComponent(input.replace(/\+/g, ' '));
  1541. } catch (e) {
  1542. return null;
  1543. }
  1544. }
  1545. /**
  1546. * Attempts to encode a given input.
  1547. *
  1548. * @param {String} input The string that needs to be encoded.
  1549. * @returns {String|Null} The encoded string.
  1550. * @api private
  1551. */
  1552. function encode(input) {
  1553. try {
  1554. return encodeURIComponent(input);
  1555. } catch (e) {
  1556. return null;
  1557. }
  1558. }
  1559. /**
  1560. * Simple query string parser.
  1561. *
  1562. * @param {String} query The query string that needs to be parsed.
  1563. * @returns {Object}
  1564. * @api public
  1565. */
  1566. function querystring(query) {
  1567. var parser = /([^=?&]+)=?([^&]*)/g
  1568. , result = {}
  1569. , part;
  1570. while (part = parser.exec(query)) {
  1571. var key = decode(part[1])
  1572. , value = decode(part[2]);
  1573. //
  1574. // Prevent overriding of existing properties. This ensures that build-in
  1575. // methods like `toString` or __proto__ are not overriden by malicious
  1576. // querystrings.
  1577. //
  1578. // In the case if failed decoding, we want to omit the key/value pairs
  1579. // from the result.
  1580. //
  1581. if (key === null || value === null || key in result) continue;
  1582. result[key] = value;
  1583. }
  1584. return result;
  1585. }
  1586. /**
  1587. * Transform a query string to an object.
  1588. *
  1589. * @param {Object} obj Object that should be transformed.
  1590. * @param {String} prefix Optional prefix.
  1591. * @returns {String}
  1592. * @api public
  1593. */
  1594. function querystringify(obj, prefix) {
  1595. prefix = prefix || '';
  1596. var pairs = []
  1597. , value
  1598. , key;
  1599. //
  1600. // Optionally prefix with a '?' if needed
  1601. //
  1602. if ('string' !== typeof prefix) prefix = '?';
  1603. for (key in obj) {
  1604. if (has.call(obj, key)) {
  1605. value = obj[key];
  1606. //
  1607. // Edge cases where we actually want to encode the value to an empty
  1608. // string instead of the stringified value.
  1609. //
  1610. if (!value && (value === null || value === undef || isNaN(value))) {
  1611. value = '';
  1612. }
  1613. key = encodeURIComponent(key);
  1614. value = encodeURIComponent(value);
  1615. //
  1616. // If we failed to encode the strings, we should bail out as we don't
  1617. // want to add invalid strings to the query.
  1618. //
  1619. if (key === null || value === null) continue;
  1620. pairs.push(key +'='+ value);
  1621. }
  1622. }
  1623. return pairs.length ? prefix + pairs.join('&') : '';
  1624. }
  1625. //
  1626. // Expose the module.
  1627. //
  1628. var stringify = querystringify;
  1629. var parse = querystring;
  1630. var querystringify_1 = {
  1631. stringify: stringify,
  1632. parse: parse
  1633. };
  1634. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  1635. function commonjsRequire () {
  1636. throw new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs');
  1637. }
  1638. function unwrapExports (x) {
  1639. return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
  1640. }
  1641. function createCommonjsModule(fn, module) {
  1642. return module = { exports: {} }, fn(module, module.exports), module.exports;
  1643. }
  1644. function getCjsExportFromNamespace (n) {
  1645. return n && n['default'] || n;
  1646. }
  1647. var prism = createCommonjsModule(function (module) {
  1648. /* **********************************************
  1649. Begin prism-core.js
  1650. ********************************************** */
  1651. var _self = (typeof window !== 'undefined')
  1652. ? window // if in browser
  1653. : (
  1654. (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope)
  1655. ? self // if in worker
  1656. : {} // if in node js
  1657. );
  1658. /**
  1659. * Prism: Lightweight, robust, elegant syntax highlighting
  1660. * MIT license http://www.opensource.org/licenses/mit-license.php/
  1661. * @author Lea Verou http://lea.verou.me
  1662. */
  1663. var Prism = (function (_self){
  1664. // Private helper vars
  1665. var lang = /\blang(?:uage)?-([\w-]+)\b/i;
  1666. var uniqueId = 0;
  1667. var _ = {
  1668. manual: _self.Prism && _self.Prism.manual,
  1669. disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler,
  1670. util: {
  1671. encode: function (tokens) {
  1672. if (tokens instanceof Token) {
  1673. return new Token(tokens.type, _.util.encode(tokens.content), tokens.alias);
  1674. } else if (Array.isArray(tokens)) {
  1675. return tokens.map(_.util.encode);
  1676. } else {
  1677. return tokens.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/\u00a0/g, ' ');
  1678. }
  1679. },
  1680. type: function (o) {
  1681. return Object.prototype.toString.call(o).slice(8, -1);
  1682. },
  1683. objId: function (obj) {
  1684. if (!obj['__id']) {
  1685. Object.defineProperty(obj, '__id', { value: ++uniqueId });
  1686. }
  1687. return obj['__id'];
  1688. },
  1689. // Deep clone a language definition (e.g. to extend it)
  1690. clone: function deepClone(o, visited) {
  1691. var clone, id, type = _.util.type(o);
  1692. visited = visited || {};
  1693. switch (type) {
  1694. case 'Object':
  1695. id = _.util.objId(o);
  1696. if (visited[id]) {
  1697. return visited[id];
  1698. }
  1699. clone = {};
  1700. visited[id] = clone;
  1701. for (var key in o) {
  1702. if (o.hasOwnProperty(key)) {
  1703. clone[key] = deepClone(o[key], visited);
  1704. }
  1705. }
  1706. return clone;
  1707. case 'Array':
  1708. id = _.util.objId(o);
  1709. if (visited[id]) {
  1710. return visited[id];
  1711. }
  1712. clone = [];
  1713. visited[id] = clone;
  1714. o.forEach(function (v, i) {
  1715. clone[i] = deepClone(v, visited);
  1716. });
  1717. return clone;
  1718. default:
  1719. return o;
  1720. }
  1721. }
  1722. },
  1723. languages: {
  1724. extend: function (id, redef) {
  1725. var lang = _.util.clone(_.languages[id]);
  1726. for (var key in redef) {
  1727. lang[key] = redef[key];
  1728. }
  1729. return lang;
  1730. },
  1731. /**
  1732. * Insert a token before another token in a language literal
  1733. * As this needs to recreate the object (we cannot actually insert before keys in object literals),
  1734. * we cannot just provide an object, we need an object and a key.
  1735. * @param inside The key (or language id) of the parent
  1736. * @param before The key to insert before.
  1737. * @param insert Object with the key/value pairs to insert
  1738. * @param root The object that contains `inside`. If equal to Prism.languages, it can be omitted.
  1739. */
  1740. insertBefore: function (inside, before, insert, root) {
  1741. root = root || _.languages;
  1742. var grammar = root[inside];
  1743. var ret = {};
  1744. for (var token in grammar) {
  1745. if (grammar.hasOwnProperty(token)) {
  1746. if (token == before) {
  1747. for (var newToken in insert) {
  1748. if (insert.hasOwnProperty(newToken)) {
  1749. ret[newToken] = insert[newToken];
  1750. }
  1751. }
  1752. }
  1753. // Do not insert token which also occur in insert. See #1525
  1754. if (!insert.hasOwnProperty(token)) {
  1755. ret[token] = grammar[token];
  1756. }
  1757. }
  1758. }
  1759. var old = root[inside];
  1760. root[inside] = ret;
  1761. // Update references in other language definitions
  1762. _.languages.DFS(_.languages, function(key, value) {
  1763. if (value === old && key != inside) {
  1764. this[key] = ret;
  1765. }
  1766. });
  1767. return ret;
  1768. },
  1769. // Traverse a language definition with Depth First Search
  1770. DFS: function DFS(o, callback, type, visited) {
  1771. visited = visited || {};
  1772. var objId = _.util.objId;
  1773. for (var i in o) {
  1774. if (o.hasOwnProperty(i)) {
  1775. callback.call(o, i, o[i], type || i);
  1776. var property = o[i],
  1777. propertyType = _.util.type(property);
  1778. if (propertyType === 'Object' && !visited[objId(property)]) {
  1779. visited[objId(property)] = true;
  1780. DFS(property, callback, null, visited);
  1781. }
  1782. else if (propertyType === 'Array' && !visited[objId(property)]) {
  1783. visited[objId(property)] = true;
  1784. DFS(property, callback, i, visited);
  1785. }
  1786. }
  1787. }
  1788. }
  1789. },
  1790. plugins: {},
  1791. highlightAll: function(async, callback) {
  1792. _.highlightAllUnder(document, async, callback);
  1793. },
  1794. highlightAllUnder: function(container, async, callback) {
  1795. var env = {
  1796. callback: callback,
  1797. selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
  1798. };
  1799. _.hooks.run('before-highlightall', env);
  1800. var elements = container.querySelectorAll(env.selector);
  1801. for (var i=0, element; element = elements[i++];) {
  1802. _.highlightElement(element, async === true, env.callback);
  1803. }
  1804. },
  1805. highlightElement: function(element, async, callback) {
  1806. // Find language
  1807. var language = 'none', grammar, parent = element;
  1808. while (parent && !lang.test(parent.className)) {
  1809. parent = parent.parentNode;
  1810. }
  1811. if (parent) {
  1812. language = (parent.className.match(lang) || [,'none'])[1].toLowerCase();
  1813. grammar = _.languages[language];
  1814. }
  1815. // Set language on the element, if not present
  1816. element.className = element.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
  1817. if (element.parentNode) {
  1818. // Set language on the parent, for styling
  1819. parent = element.parentNode;
  1820. if (/pre/i.test(parent.nodeName)) {
  1821. parent.className = parent.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
  1822. }
  1823. }
  1824. var code = element.textContent;
  1825. var env = {
  1826. element: element,
  1827. language: language,
  1828. grammar: grammar,
  1829. code: code
  1830. };
  1831. var insertHighlightedCode = function (highlightedCode) {
  1832. env.highlightedCode = highlightedCode;
  1833. _.hooks.run('before-insert', env);
  1834. env.element.innerHTML = env.highlightedCode;
  1835. _.hooks.run('after-highlight', env);
  1836. _.hooks.run('complete', env);
  1837. callback && callback.call(env.element);
  1838. };
  1839. _.hooks.run('before-sanity-check', env);
  1840. if (!env.code) {
  1841. _.hooks.run('complete', env);
  1842. return;
  1843. }
  1844. _.hooks.run('before-highlight', env);
  1845. if (!env.grammar) {
  1846. insertHighlightedCode(_.util.encode(env.code));
  1847. return;
  1848. }
  1849. if (async && _self.Worker) {
  1850. var worker = new Worker(_.filename);
  1851. worker.onmessage = function(evt) {
  1852. insertHighlightedCode(evt.data);
  1853. };
  1854. worker.postMessage(JSON.stringify({
  1855. language: env.language,
  1856. code: env.code,
  1857. immediateClose: true
  1858. }));
  1859. }
  1860. else {
  1861. insertHighlightedCode(_.highlight(env.code, env.grammar, env.language));
  1862. }
  1863. },
  1864. highlight: function (text, grammar, language) {
  1865. var env = {
  1866. code: text,
  1867. grammar: grammar,
  1868. language: language
  1869. };
  1870. _.hooks.run('before-tokenize', env);
  1871. env.tokens = _.tokenize(env.code, env.grammar);
  1872. _.hooks.run('after-tokenize', env);
  1873. return Token.stringify(_.util.encode(env.tokens), env.language);
  1874. },
  1875. matchGrammar: function (text, strarr, grammar, index, startPos, oneshot, target) {
  1876. for (var token in grammar) {
  1877. if(!grammar.hasOwnProperty(token) || !grammar[token]) {
  1878. continue;
  1879. }
  1880. if (token == target) {
  1881. return;
  1882. }
  1883. var patterns = grammar[token];
  1884. patterns = (_.util.type(patterns) === "Array") ? patterns : [patterns];
  1885. for (var j = 0; j < patterns.length; ++j) {
  1886. var pattern = patterns[j],
  1887. inside = pattern.inside,
  1888. lookbehind = !!pattern.lookbehind,
  1889. greedy = !!pattern.greedy,
  1890. lookbehindLength = 0,
  1891. alias = pattern.alias;
  1892. if (greedy && !pattern.pattern.global) {
  1893. // Without the global flag, lastIndex won't work
  1894. var flags = pattern.pattern.toString().match(/[imuy]*$/)[0];
  1895. pattern.pattern = RegExp(pattern.pattern.source, flags + "g");
  1896. }
  1897. pattern = pattern.pattern || pattern;
  1898. // Don’t cache length as it changes during the loop
  1899. for (var i = index, pos = startPos; i < strarr.length; pos += strarr[i].length, ++i) {
  1900. var str = strarr[i];
  1901. if (strarr.length > text.length) {
  1902. // Something went terribly wrong, ABORT, ABORT!
  1903. return;
  1904. }
  1905. if (str instanceof Token) {
  1906. continue;
  1907. }
  1908. if (greedy && i != strarr.length - 1) {
  1909. pattern.lastIndex = pos;
  1910. var match = pattern.exec(text);
  1911. if (!match) {
  1912. break;
  1913. }
  1914. var from = match.index + (lookbehind ? match[1].length : 0),
  1915. to = match.index + match[0].length,
  1916. k = i,
  1917. p = pos;
  1918. for (var len = strarr.length; k < len && (p < to || (!strarr[k].type && !strarr[k - 1].greedy)); ++k) {
  1919. p += strarr[k].length;
  1920. // Move the index i to the element in strarr that is closest to from
  1921. if (from >= p) {
  1922. ++i;
  1923. pos = p;
  1924. }
  1925. }
  1926. // If strarr[i] is a Token, then the match starts inside another Token, which is invalid
  1927. if (strarr[i] instanceof Token) {
  1928. continue;
  1929. }
  1930. // Number of tokens to delete and replace with the new match
  1931. delNum = k - i;
  1932. str = text.slice(pos, p);
  1933. match.index -= pos;
  1934. } else {
  1935. pattern.lastIndex = 0;
  1936. var match = pattern.exec(str),
  1937. delNum = 1;
  1938. }
  1939. if (!match) {
  1940. if (oneshot) {
  1941. break;
  1942. }
  1943. continue;
  1944. }
  1945. if(lookbehind) {
  1946. lookbehindLength = match[1] ? match[1].length : 0;
  1947. }
  1948. var from = match.index + lookbehindLength,
  1949. match = match[0].slice(lookbehindLength),
  1950. to = from + match.length,
  1951. before = str.slice(0, from),
  1952. after = str.slice(to);
  1953. var args = [i, delNum];
  1954. if (before) {
  1955. ++i;
  1956. pos += before.length;
  1957. args.push(before);
  1958. }
  1959. var wrapped = new Token(token, inside? _.tokenize(match, inside) : match, alias, match, greedy);
  1960. args.push(wrapped);
  1961. if (after) {
  1962. args.push(after);
  1963. }
  1964. Array.prototype.splice.apply(strarr, args);
  1965. if (delNum != 1)
  1966. _.matchGrammar(text, strarr, grammar, i, pos, true, token);
  1967. if (oneshot)
  1968. break;
  1969. }
  1970. }
  1971. }
  1972. },
  1973. tokenize: function(text, grammar) {
  1974. var strarr = [text];
  1975. var rest = grammar.rest;
  1976. if (rest) {
  1977. for (var token in rest) {
  1978. grammar[token] = rest[token];
  1979. }
  1980. delete grammar.rest;
  1981. }
  1982. _.matchGrammar(text, strarr, grammar, 0, 0, false);
  1983. return strarr;
  1984. },
  1985. hooks: {
  1986. all: {},
  1987. add: function (name, callback) {
  1988. var hooks = _.hooks.all;
  1989. hooks[name] = hooks[name] || [];
  1990. hooks[name].push(callback);
  1991. },
  1992. run: function (name, env) {
  1993. var callbacks = _.hooks.all[name];
  1994. if (!callbacks || !callbacks.length) {
  1995. return;
  1996. }
  1997. for (var i=0, callback; callback = callbacks[i++];) {
  1998. callback(env);
  1999. }
  2000. }
  2001. },
  2002. Token: Token
  2003. };
  2004. _self.Prism = _;
  2005. function Token(type, content, alias, matchedStr, greedy) {
  2006. this.type = type;
  2007. this.content = content;
  2008. this.alias = alias;
  2009. // Copy of the full string this token was created from
  2010. this.length = (matchedStr || "").length|0;
  2011. this.greedy = !!greedy;
  2012. }
  2013. Token.stringify = function(o, language) {
  2014. if (typeof o == 'string') {
  2015. return o;
  2016. }
  2017. if (Array.isArray(o)) {
  2018. return o.map(function(element) {
  2019. return Token.stringify(element, language);
  2020. }).join('');
  2021. }
  2022. var env = {
  2023. type: o.type,
  2024. content: Token.stringify(o.content, language),
  2025. tag: 'span',
  2026. classes: ['token', o.type],
  2027. attributes: {},
  2028. language: language
  2029. };
  2030. if (o.alias) {
  2031. var aliases = Array.isArray(o.alias) ? o.alias : [o.alias];
  2032. Array.prototype.push.apply(env.classes, aliases);
  2033. }
  2034. _.hooks.run('wrap', env);
  2035. var attributes = Object.keys(env.attributes).map(function(name) {
  2036. return name + '="' + (env.attributes[name] || '').replace(/"/g, '&quot;') + '"';
  2037. }).join(' ');
  2038. return '<' + env.tag + ' class="' + env.classes.join(' ') + '"' + (attributes ? ' ' + attributes : '') + '>' + env.content + '</' + env.tag + '>';
  2039. };
  2040. if (!_self.document) {
  2041. if (!_self.addEventListener) {
  2042. // in Node.js
  2043. return _;
  2044. }
  2045. if (!_.disableWorkerMessageHandler) {
  2046. // In worker
  2047. _self.addEventListener('message', function (evt) {
  2048. var message = JSON.parse(evt.data),
  2049. lang = message.language,
  2050. code = message.code,
  2051. immediateClose = message.immediateClose;
  2052. _self.postMessage(_.highlight(code, _.languages[lang], lang));
  2053. if (immediateClose) {
  2054. _self.close();
  2055. }
  2056. }, false);
  2057. }
  2058. return _;
  2059. }
  2060. //Get current script and highlight
  2061. var script = document.currentScript || [].slice.call(document.getElementsByTagName("script")).pop();
  2062. if (script) {
  2063. _.filename = script.src;
  2064. if (!_.manual && !script.hasAttribute('data-manual')) {
  2065. if(document.readyState !== "loading") {
  2066. if (window.requestAnimationFrame) {
  2067. window.requestAnimationFrame(_.highlightAll);
  2068. } else {
  2069. window.setTimeout(_.highlightAll, 16);
  2070. }
  2071. }
  2072. else {
  2073. document.addEventListener('DOMContentLoaded', _.highlightAll);
  2074. }
  2075. }
  2076. }
  2077. return _;
  2078. })(_self);
  2079. if ('object' !== 'undefined' && module.exports) {
  2080. module.exports = Prism;
  2081. }
  2082. // hack for components to work correctly in node.js
  2083. if (typeof commonjsGlobal !== 'undefined') {
  2084. commonjsGlobal.Prism = Prism;
  2085. }
  2086. /* **********************************************
  2087. Begin prism-markup.js
  2088. ********************************************** */
  2089. Prism.languages.markup = {
  2090. 'comment': /<!--[\s\S]*?-->/,
  2091. 'prolog': /<\?[\s\S]+?\?>/,
  2092. 'doctype': /<!DOCTYPE[\s\S]+?>/i,
  2093. 'cdata': /<!\[CDATA\[[\s\S]*?]]>/i,
  2094. 'tag': {
  2095. pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/i,
  2096. greedy: true,
  2097. inside: {
  2098. 'tag': {
  2099. pattern: /^<\/?[^\s>\/]+/i,
  2100. inside: {
  2101. 'punctuation': /^<\/?/,
  2102. 'namespace': /^[^\s>\/:]+:/
  2103. }
  2104. },
  2105. 'attr-value': {
  2106. pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/i,
  2107. inside: {
  2108. 'punctuation': [
  2109. /^=/,
  2110. {
  2111. pattern: /^(\s*)["']|["']$/,
  2112. lookbehind: true
  2113. }
  2114. ]
  2115. }
  2116. },
  2117. 'punctuation': /\/?>/,
  2118. 'attr-name': {
  2119. pattern: /[^\s>\/]+/,
  2120. inside: {
  2121. 'namespace': /^[^\s>\/:]+:/
  2122. }
  2123. }
  2124. }
  2125. },
  2126. 'entity': /&#?[\da-z]{1,8};/i
  2127. };
  2128. Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] =
  2129. Prism.languages.markup['entity'];
  2130. // Plugin to make entity title show the real entity, idea by Roman Komarov
  2131. Prism.hooks.add('wrap', function(env) {
  2132. if (env.type === 'entity') {
  2133. env.attributes['title'] = env.content.replace(/&amp;/, '&');
  2134. }
  2135. });
  2136. Object.defineProperty(Prism.languages.markup.tag, 'addInlined', {
  2137. /**
  2138. * Adds an inlined language to markup.
  2139. *
  2140. * An example of an inlined language is CSS with `<style>` tags.
  2141. *
  2142. * @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as
  2143. * case insensitive.
  2144. * @param {string} lang The language key.
  2145. * @example
  2146. * addInlined('style', 'css');
  2147. */
  2148. value: function addInlined(tagName, lang) {
  2149. var includedCdataInside = {};
  2150. includedCdataInside['language-' + lang] = {
  2151. pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
  2152. lookbehind: true,
  2153. inside: Prism.languages[lang]
  2154. };
  2155. includedCdataInside['cdata'] = /^<!\[CDATA\[|\]\]>$/i;
  2156. var inside = {
  2157. 'included-cdata': {
  2158. pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
  2159. inside: includedCdataInside
  2160. }
  2161. };
  2162. inside['language-' + lang] = {
  2163. pattern: /[\s\S]+/,
  2164. inside: Prism.languages[lang]
  2165. };
  2166. var def = {};
  2167. def[tagName] = {
  2168. pattern: RegExp(/(<__[\s\S]*?>)(?:<!\[CDATA\[[\s\S]*?\]\]>\s*|[\s\S])*?(?=<\/__>)/.source.replace(/__/g, tagName), 'i'),
  2169. lookbehind: true,
  2170. greedy: true,
  2171. inside: inside
  2172. };
  2173. Prism.languages.insertBefore('markup', 'cdata', def);
  2174. }
  2175. });
  2176. Prism.languages.xml = Prism.languages.extend('markup', {});
  2177. Prism.languages.html = Prism.languages.markup;
  2178. Prism.languages.mathml = Prism.languages.markup;
  2179. Prism.languages.svg = Prism.languages.markup;
  2180. /* **********************************************
  2181. Begin prism-css.js
  2182. ********************************************** */
  2183. (function (Prism) {
  2184. var string = /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;
  2185. Prism.languages.css = {
  2186. 'comment': /\/\*[\s\S]*?\*\//,
  2187. 'atrule': {
  2188. pattern: /@[\w-]+[\s\S]*?(?:;|(?=\s*\{))/,
  2189. inside: {
  2190. 'rule': /@[\w-]+/
  2191. // See rest below
  2192. }
  2193. },
  2194. 'url': {
  2195. pattern: RegExp('url\\((?:' + string.source + '|[^\n\r()]*)\\)', 'i'),
  2196. inside: {
  2197. 'function': /^url/i,
  2198. 'punctuation': /^\(|\)$/
  2199. }
  2200. },
  2201. 'selector': RegExp('[^{}\\s](?:[^{};"\']|' + string.source + ')*?(?=\\s*\\{)'),
  2202. 'string': {
  2203. pattern: string,
  2204. greedy: true
  2205. },
  2206. 'property': /[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,
  2207. 'important': /!important\b/i,
  2208. 'function': /[-a-z0-9]+(?=\()/i,
  2209. 'punctuation': /[(){};:,]/
  2210. };
  2211. Prism.languages.css['atrule'].inside.rest = Prism.languages.css;
  2212. var markup = Prism.languages.markup;
  2213. if (markup) {
  2214. markup.tag.addInlined('style', 'css');
  2215. Prism.languages.insertBefore('inside', 'attr-value', {
  2216. 'style-attr': {
  2217. pattern: /\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i,
  2218. inside: {
  2219. 'attr-name': {
  2220. pattern: /^\s*style/i,
  2221. inside: markup.tag.inside
  2222. },
  2223. 'punctuation': /^\s*=\s*['"]|['"]\s*$/,
  2224. 'attr-value': {
  2225. pattern: /.+/i,
  2226. inside: Prism.languages.css
  2227. }
  2228. },
  2229. alias: 'language-css'
  2230. }
  2231. }, markup.tag);
  2232. }
  2233. }(Prism));
  2234. /* **********************************************
  2235. Begin prism-clike.js
  2236. ********************************************** */
  2237. Prism.languages.clike = {
  2238. 'comment': [
  2239. {
  2240. pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
  2241. lookbehind: true
  2242. },
  2243. {
  2244. pattern: /(^|[^\\:])\/\/.*/,
  2245. lookbehind: true,
  2246. greedy: true
  2247. }
  2248. ],
  2249. 'string': {
  2250. pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
  2251. greedy: true
  2252. },
  2253. 'class-name': {
  2254. pattern: /((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,
  2255. lookbehind: true,
  2256. inside: {
  2257. punctuation: /[.\\]/
  2258. }
  2259. },
  2260. 'keyword': /\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,
  2261. 'boolean': /\b(?:true|false)\b/,
  2262. 'function': /\w+(?=\()/,
  2263. 'number': /\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,
  2264. 'operator': /--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,
  2265. 'punctuation': /[{}[\];(),.:]/
  2266. };
  2267. /* **********************************************
  2268. Begin prism-javascript.js
  2269. ********************************************** */
  2270. Prism.languages.javascript = Prism.languages.extend('clike', {
  2271. 'class-name': [
  2272. Prism.languages.clike['class-name'],
  2273. {
  2274. pattern: /(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,
  2275. lookbehind: true
  2276. }
  2277. ],
  2278. 'keyword': [
  2279. {
  2280. pattern: /((?:^|})\s*)(?:catch|finally)\b/,
  2281. lookbehind: true
  2282. },
  2283. {
  2284. pattern: /(^|[^.])\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,
  2285. lookbehind: true
  2286. },
  2287. ],
  2288. 'number': /\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,
  2289. // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
  2290. 'function': /#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
  2291. 'operator': /-[-=]?|\+[+=]?|!=?=?|<<?=?|>>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/
  2292. });
  2293. Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;
  2294. Prism.languages.insertBefore('javascript', 'keyword', {
  2295. 'regex': {
  2296. pattern: /((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=\s*($|[\r\n,.;})\]]))/,
  2297. lookbehind: true,
  2298. greedy: true
  2299. },
  2300. // This must be declared before keyword because we use "function" inside the look-forward
  2301. 'function-variable': {
  2302. pattern: /#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,
  2303. alias: 'function'
  2304. },
  2305. 'parameter': [
  2306. {
  2307. pattern: /(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,
  2308. lookbehind: true,
  2309. inside: Prism.languages.javascript
  2310. },
  2311. {
  2312. pattern: /[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,
  2313. inside: Prism.languages.javascript
  2314. },
  2315. {
  2316. pattern: /(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,
  2317. lookbehind: true,
  2318. inside: Prism.languages.javascript
  2319. },
  2320. {
  2321. pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,
  2322. lookbehind: true,
  2323. inside: Prism.languages.javascript
  2324. }
  2325. ],
  2326. 'constant': /\b[A-Z](?:[A-Z_]|\dx?)*\b/
  2327. });
  2328. Prism.languages.insertBefore('javascript', 'string', {
  2329. 'template-string': {
  2330. pattern: /`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}|(?!\${)[^\\`])*`/,
  2331. greedy: true,
  2332. inside: {
  2333. 'template-punctuation': {
  2334. pattern: /^`|`$/,
  2335. alias: 'string'
  2336. },
  2337. 'interpolation': {
  2338. pattern: /((?:^|[^\\])(?:\\{2})*)\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}/,
  2339. lookbehind: true,
  2340. inside: {
  2341. 'interpolation-punctuation': {
  2342. pattern: /^\${|}$/,
  2343. alias: 'punctuation'
  2344. },
  2345. rest: Prism.languages.javascript
  2346. }
  2347. },
  2348. 'string': /[\s\S]+/
  2349. }
  2350. }
  2351. });
  2352. if (Prism.languages.markup) {
  2353. Prism.languages.markup.tag.addInlined('script', 'javascript');
  2354. }
  2355. Prism.languages.js = Prism.languages.javascript;
  2356. /* **********************************************
  2357. Begin prism-file-highlight.js
  2358. ********************************************** */
  2359. (function () {
  2360. if (typeof self === 'undefined' || !self.Prism || !self.document || !document.querySelector) {
  2361. return;
  2362. }
  2363. /**
  2364. * @param {Element} [container=document]
  2365. */
  2366. self.Prism.fileHighlight = function(container) {
  2367. container = container || document;
  2368. var Extensions = {
  2369. 'js': 'javascript',
  2370. 'py': 'python',
  2371. 'rb': 'ruby',
  2372. 'ps1': 'powershell',
  2373. 'psm1': 'powershell',
  2374. 'sh': 'bash',
  2375. 'bat': 'batch',
  2376. 'h': 'c',
  2377. 'tex': 'latex'
  2378. };
  2379. Array.prototype.slice.call(container.querySelectorAll('pre[data-src]')).forEach(function (pre) {
  2380. // ignore if already loaded
  2381. if (pre.hasAttribute('data-src-loaded')) {
  2382. return;
  2383. }
  2384. // load current
  2385. var src = pre.getAttribute('data-src');
  2386. var language, parent = pre;
  2387. var lang = /\blang(?:uage)?-([\w-]+)\b/i;
  2388. while (parent && !lang.test(parent.className)) {
  2389. parent = parent.parentNode;
  2390. }
  2391. if (parent) {
  2392. language = (pre.className.match(lang) || [, ''])[1];
  2393. }
  2394. if (!language) {
  2395. var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
  2396. language = Extensions[extension] || extension;
  2397. }
  2398. var code = document.createElement('code');
  2399. code.className = 'language-' + language;
  2400. pre.textContent = '';
  2401. code.textContent = 'Loading…';
  2402. pre.appendChild(code);
  2403. var xhr = new XMLHttpRequest();
  2404. xhr.open('GET', src, true);
  2405. xhr.onreadystatechange = function () {
  2406. if (xhr.readyState == 4) {
  2407. if (xhr.status < 400 && xhr.responseText) {
  2408. code.textContent = xhr.responseText;
  2409. Prism.highlightElement(code);
  2410. // mark as loaded
  2411. pre.setAttribute('data-src-loaded', '');
  2412. }
  2413. else if (xhr.status >= 400) {
  2414. code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
  2415. }
  2416. else {
  2417. code.textContent = '✖ Error: File does not exist or is empty';
  2418. }
  2419. }
  2420. };
  2421. xhr.send(null);
  2422. });
  2423. if (Prism.plugins.toolbar) {
  2424. Prism.plugins.toolbar.registerButton('download-file', function (env) {
  2425. var pre = env.element.parentNode;
  2426. if (!pre || !/pre/i.test(pre.nodeName) || !pre.hasAttribute('data-src') || !pre.hasAttribute('data-download-link')) {
  2427. return;
  2428. }
  2429. var src = pre.getAttribute('data-src');
  2430. var a = document.createElement('a');
  2431. a.textContent = pre.getAttribute('data-download-link-label') || 'Download';
  2432. a.setAttribute('download', '');
  2433. a.href = src;
  2434. return a;
  2435. });
  2436. }
  2437. };
  2438. document.addEventListener('DOMContentLoaded', function () {
  2439. // execute inside handler, for dropping Event as argument
  2440. self.Prism.fileHighlight();
  2441. });
  2442. })();
  2443. });
  2444. var marked = createCommonjsModule(function (module, exports) {
  2445. /**
  2446. * marked - a markdown parser
  2447. * Copyright (c) 2011-2018, Christopher Jeffrey. (MIT Licensed)
  2448. * https://github.com/markedjs/marked
  2449. */
  2450. ;(function(root) {
  2451. 'use strict';
  2452. /**
  2453. * Block-Level Grammar
  2454. */
  2455. var block = {
  2456. newline: /^\n+/,
  2457. code: /^( {4}[^\n]+\n*)+/,
  2458. fences: /^ {0,3}(`{3,}|~{3,})([^`~\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,
  2459. hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,
  2460. heading: /^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,
  2461. blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,
  2462. list: /^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,
  2463. html: '^ {0,3}(?:' // optional indentation
  2464. + '<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)' // (1)
  2465. + '|comment[^\\n]*(\\n+|$)' // (2)
  2466. + '|<\\?[\\s\\S]*?\\?>\\n*' // (3)
  2467. + '|<![A-Z][\\s\\S]*?>\\n*' // (4)
  2468. + '|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*' // (5)
  2469. + '|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)' // (6)
  2470. + '|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)' // (7) open tag
  2471. + '|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)' // (7) closing tag
  2472. + ')',
  2473. def: /^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,
  2474. nptable: noop,
  2475. table: noop,
  2476. lheading: /^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,
  2477. // regex template, placeholders will be replaced according to different paragraph
  2478. // interruption rules of commonmark and the original markdown spec:
  2479. _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,
  2480. text: /^[^\n]+/
  2481. };
  2482. block._label = /(?!\s*\])(?:\\[\[\]]|[^\[\]])+/;
  2483. block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
  2484. block.def = edit(block.def)
  2485. .replace('label', block._label)
  2486. .replace('title', block._title)
  2487. .getRegex();
  2488. block.bullet = /(?:[*+-]|\d{1,9}\.)/;
  2489. block.item = /^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/;
  2490. block.item = edit(block.item, 'gm')
  2491. .replace(/bull/g, block.bullet)
  2492. .getRegex();
  2493. block.list = edit(block.list)
  2494. .replace(/bull/g, block.bullet)
  2495. .replace('hr', '\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))')
  2496. .replace('def', '\\n+(?=' + block.def.source + ')')
  2497. .getRegex();
  2498. block._tag = 'address|article|aside|base|basefont|blockquote|body|caption'
  2499. + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'
  2500. + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'
  2501. + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'
  2502. + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr'
  2503. + '|track|ul';
  2504. block._comment = /<!--(?!-?>)[\s\S]*?-->/;
  2505. block.html = edit(block.html, 'i')
  2506. .replace('comment', block._comment)
  2507. .replace('tag', block._tag)
  2508. .replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/)
  2509. .getRegex();
  2510. block.paragraph = edit(block._paragraph)
  2511. .replace('hr', block.hr)
  2512. .replace('heading', ' {0,3}#{1,6} +')
  2513. .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs
  2514. .replace('blockquote', ' {0,3}>')
  2515. .replace('fences', ' {0,3}(?:`{3,}|~{3,})[^`\\n]*\\n')
  2516. .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
  2517. .replace('html', '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)')
  2518. .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks
  2519. .getRegex();
  2520. block.blockquote = edit(block.blockquote)
  2521. .replace('paragraph', block.paragraph)
  2522. .getRegex();
  2523. /**
  2524. * Normal Block Grammar
  2525. */
  2526. block.normal = merge({}, block);
  2527. /**
  2528. * GFM Block Grammar
  2529. */
  2530. block.gfm = merge({}, block.normal, {
  2531. nptable: /^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/,
  2532. table: /^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/
  2533. });
  2534. /**
  2535. * Pedantic grammar (original John Gruber's loose markdown specification)
  2536. */
  2537. block.pedantic = merge({}, block.normal, {
  2538. html: edit(
  2539. '^ *(?:comment *(?:\\n|\\s*$)'
  2540. + '|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)' // closed tag
  2541. + '|<tag(?:"[^"]*"|\'[^\']*\'|\\s[^\'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))')
  2542. .replace('comment', block._comment)
  2543. .replace(/tag/g, '(?!(?:'
  2544. + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'
  2545. + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'
  2546. + '\\b)\\w+(?!:|[^\\w\\s@]*@)\\b')
  2547. .getRegex(),
  2548. def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
  2549. heading: /^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,
  2550. fences: noop, // fences not supported
  2551. paragraph: edit(block.normal._paragraph)
  2552. .replace('hr', block.hr)
  2553. .replace('heading', ' *#{1,6} *[^\n]')
  2554. .replace('lheading', block.lheading)
  2555. .replace('blockquote', ' {0,3}>')
  2556. .replace('|fences', '')
  2557. .replace('|list', '')
  2558. .replace('|html', '')
  2559. .getRegex()
  2560. });
  2561. /**
  2562. * Block Lexer
  2563. */
  2564. function Lexer(options) {
  2565. this.tokens = [];
  2566. this.tokens.links = Object.create(null);
  2567. this.options = options || marked.defaults;
  2568. this.rules = block.normal;
  2569. if (this.options.pedantic) {
  2570. this.rules = block.pedantic;
  2571. } else if (this.options.gfm) {
  2572. this.rules = block.gfm;
  2573. }
  2574. }
  2575. /**
  2576. * Expose Block Rules
  2577. */
  2578. Lexer.rules = block;
  2579. /**
  2580. * Static Lex Method
  2581. */
  2582. Lexer.lex = function(src, options) {
  2583. var lexer = new Lexer(options);
  2584. return lexer.lex(src);
  2585. };
  2586. /**
  2587. * Preprocessing
  2588. */
  2589. Lexer.prototype.lex = function(src) {
  2590. src = src
  2591. .replace(/\r\n|\r/g, '\n')
  2592. .replace(/\t/g, ' ')
  2593. .replace(/\u00a0/g, ' ')
  2594. .replace(/\u2424/g, '\n');
  2595. return this.token(src, true);
  2596. };
  2597. /**
  2598. * Lexing
  2599. */
  2600. Lexer.prototype.token = function(src, top) {
  2601. src = src.replace(/^ +$/gm, '');
  2602. var next,
  2603. loose,
  2604. cap,
  2605. bull,
  2606. b,
  2607. item,
  2608. listStart,
  2609. listItems,
  2610. t,
  2611. space,
  2612. i,
  2613. tag,
  2614. l,
  2615. isordered,
  2616. istask,
  2617. ischecked;
  2618. while (src) {
  2619. // newline
  2620. if (cap = this.rules.newline.exec(src)) {
  2621. src = src.substring(cap[0].length);
  2622. if (cap[0].length > 1) {
  2623. this.tokens.push({
  2624. type: 'space'
  2625. });
  2626. }
  2627. }
  2628. // code
  2629. if (cap = this.rules.code.exec(src)) {
  2630. var lastToken = this.tokens[this.tokens.length - 1];
  2631. src = src.substring(cap[0].length);
  2632. // An indented code block cannot interrupt a paragraph.
  2633. if (lastToken && lastToken.type === 'paragraph') {
  2634. lastToken.text += '\n' + cap[0].trimRight();
  2635. } else {
  2636. cap = cap[0].replace(/^ {4}/gm, '');
  2637. this.tokens.push({
  2638. type: 'code',
  2639. codeBlockStyle: 'indented',
  2640. text: !this.options.pedantic
  2641. ? rtrim(cap, '\n')
  2642. : cap
  2643. });
  2644. }
  2645. continue;
  2646. }
  2647. // fences
  2648. if (cap = this.rules.fences.exec(src)) {
  2649. src = src.substring(cap[0].length);
  2650. this.tokens.push({
  2651. type: 'code',
  2652. lang: cap[2] ? cap[2].trim() : cap[2],
  2653. text: cap[3] || ''
  2654. });
  2655. continue;
  2656. }
  2657. // heading
  2658. if (cap = this.rules.heading.exec(src)) {
  2659. src = src.substring(cap[0].length);
  2660. this.tokens.push({
  2661. type: 'heading',
  2662. depth: cap[1].length,
  2663. text: cap[2]
  2664. });
  2665. continue;
  2666. }
  2667. // table no leading pipe (gfm)
  2668. if (cap = this.rules.nptable.exec(src)) {
  2669. item = {
  2670. type: 'table',
  2671. header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')),
  2672. align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
  2673. cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : []
  2674. };
  2675. if (item.header.length === item.align.length) {
  2676. src = src.substring(cap[0].length);
  2677. for (i = 0; i < item.align.length; i++) {
  2678. if (/^ *-+: *$/.test(item.align[i])) {
  2679. item.align[i] = 'right';
  2680. } else if (/^ *:-+: *$/.test(item.align[i])) {
  2681. item.align[i] = 'center';
  2682. } else if (/^ *:-+ *$/.test(item.align[i])) {
  2683. item.align[i] = 'left';
  2684. } else {
  2685. item.align[i] = null;
  2686. }
  2687. }
  2688. for (i = 0; i < item.cells.length; i++) {
  2689. item.cells[i] = splitCells(item.cells[i], item.header.length);
  2690. }
  2691. this.tokens.push(item);
  2692. continue;
  2693. }
  2694. }
  2695. // hr
  2696. if (cap = this.rules.hr.exec(src)) {
  2697. src = src.substring(cap[0].length);
  2698. this.tokens.push({
  2699. type: 'hr'
  2700. });
  2701. continue;
  2702. }
  2703. // blockquote
  2704. if (cap = this.rules.blockquote.exec(src)) {
  2705. src = src.substring(cap[0].length);
  2706. this.tokens.push({
  2707. type: 'blockquote_start'
  2708. });
  2709. cap = cap[0].replace(/^ *> ?/gm, '');
  2710. // Pass `top` to keep the current
  2711. // "toplevel" state. This is exactly
  2712. // how markdown.pl works.
  2713. this.token(cap, top);
  2714. this.tokens.push({
  2715. type: 'blockquote_end'
  2716. });
  2717. continue;
  2718. }
  2719. // list
  2720. if (cap = this.rules.list.exec(src)) {
  2721. src = src.substring(cap[0].length);
  2722. bull = cap[2];
  2723. isordered = bull.length > 1;
  2724. listStart = {
  2725. type: 'list_start',
  2726. ordered: isordered,
  2727. start: isordered ? +bull : '',
  2728. loose: false
  2729. };
  2730. this.tokens.push(listStart);
  2731. // Get each top-level item.
  2732. cap = cap[0].match(this.rules.item);
  2733. listItems = [];
  2734. next = false;
  2735. l = cap.length;
  2736. i = 0;
  2737. for (; i < l; i++) {
  2738. item = cap[i];
  2739. // Remove the list item's bullet
  2740. // so it is seen as the next token.
  2741. space = item.length;
  2742. item = item.replace(/^ *([*+-]|\d+\.) */, '');
  2743. // Outdent whatever the
  2744. // list item contains. Hacky.
  2745. if (~item.indexOf('\n ')) {
  2746. space -= item.length;
  2747. item = !this.options.pedantic
  2748. ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '')
  2749. : item.replace(/^ {1,4}/gm, '');
  2750. }
  2751. // Determine whether the next list item belongs here.
  2752. // Backpedal if it does not belong in this list.
  2753. if (i !== l - 1) {
  2754. b = block.bullet.exec(cap[i + 1])[0];
  2755. if (bull.length > 1 ? b.length === 1
  2756. : (b.length > 1 || (this.options.smartLists && b !== bull))) {
  2757. src = cap.slice(i + 1).join('\n') + src;
  2758. i = l - 1;
  2759. }
  2760. }
  2761. // Determine whether item is loose or not.
  2762. // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/
  2763. // for discount behavior.
  2764. loose = next || /\n\n(?!\s*$)/.test(item);
  2765. if (i !== l - 1) {
  2766. next = item.charAt(item.length - 1) === '\n';
  2767. if (!loose) loose = next;
  2768. }
  2769. if (loose) {
  2770. listStart.loose = true;
  2771. }
  2772. // Check for task list items
  2773. istask = /^\[[ xX]\] /.test(item);
  2774. ischecked = undefined;
  2775. if (istask) {
  2776. ischecked = item[1] !== ' ';
  2777. item = item.replace(/^\[[ xX]\] +/, '');
  2778. }
  2779. t = {
  2780. type: 'list_item_start',
  2781. task: istask,
  2782. checked: ischecked,
  2783. loose: loose
  2784. };
  2785. listItems.push(t);
  2786. this.tokens.push(t);
  2787. // Recurse.
  2788. this.token(item, false);
  2789. this.tokens.push({
  2790. type: 'list_item_end'
  2791. });
  2792. }
  2793. if (listStart.loose) {
  2794. l = listItems.length;
  2795. i = 0;
  2796. for (; i < l; i++) {
  2797. listItems[i].loose = true;
  2798. }
  2799. }
  2800. this.tokens.push({
  2801. type: 'list_end'
  2802. });
  2803. continue;
  2804. }
  2805. // html
  2806. if (cap = this.rules.html.exec(src)) {
  2807. src = src.substring(cap[0].length);
  2808. this.tokens.push({
  2809. type: this.options.sanitize
  2810. ? 'paragraph'
  2811. : 'html',
  2812. pre: !this.options.sanitizer
  2813. && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),
  2814. text: this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0])) : cap[0]
  2815. });
  2816. continue;
  2817. }
  2818. // def
  2819. if (top && (cap = this.rules.def.exec(src))) {
  2820. src = src.substring(cap[0].length);
  2821. if (cap[3]) cap[3] = cap[3].substring(1, cap[3].length - 1);
  2822. tag = cap[1].toLowerCase().replace(/\s+/g, ' ');
  2823. if (!this.tokens.links[tag]) {
  2824. this.tokens.links[tag] = {
  2825. href: cap[2],
  2826. title: cap[3]
  2827. };
  2828. }
  2829. continue;
  2830. }
  2831. // table (gfm)
  2832. if (cap = this.rules.table.exec(src)) {
  2833. item = {
  2834. type: 'table',
  2835. header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')),
  2836. align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
  2837. cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : []
  2838. };
  2839. if (item.header.length === item.align.length) {
  2840. src = src.substring(cap[0].length);
  2841. for (i = 0; i < item.align.length; i++) {
  2842. if (/^ *-+: *$/.test(item.align[i])) {
  2843. item.align[i] = 'right';
  2844. } else if (/^ *:-+: *$/.test(item.align[i])) {
  2845. item.align[i] = 'center';
  2846. } else if (/^ *:-+ *$/.test(item.align[i])) {
  2847. item.align[i] = 'left';
  2848. } else {
  2849. item.align[i] = null;
  2850. }
  2851. }
  2852. for (i = 0; i < item.cells.length; i++) {
  2853. item.cells[i] = splitCells(
  2854. item.cells[i].replace(/^ *\| *| *\| *$/g, ''),
  2855. item.header.length);
  2856. }
  2857. this.tokens.push(item);
  2858. continue;
  2859. }
  2860. }
  2861. // lheading
  2862. if (cap = this.rules.lheading.exec(src)) {
  2863. src = src.substring(cap[0].length);
  2864. this.tokens.push({
  2865. type: 'heading',
  2866. depth: cap[2].charAt(0) === '=' ? 1 : 2,
  2867. text: cap[1]
  2868. });
  2869. continue;
  2870. }
  2871. // top-level paragraph
  2872. if (top && (cap = this.rules.paragraph.exec(src))) {
  2873. src = src.substring(cap[0].length);
  2874. this.tokens.push({
  2875. type: 'paragraph',
  2876. text: cap[1].charAt(cap[1].length - 1) === '\n'
  2877. ? cap[1].slice(0, -1)
  2878. : cap[1]
  2879. });
  2880. continue;
  2881. }
  2882. // text
  2883. if (cap = this.rules.text.exec(src)) {
  2884. // Top-level should never reach here.
  2885. src = src.substring(cap[0].length);
  2886. this.tokens.push({
  2887. type: 'text',
  2888. text: cap[0]
  2889. });
  2890. continue;
  2891. }
  2892. if (src) {
  2893. throw new Error('Infinite loop on byte: ' + src.charCodeAt(0));
  2894. }
  2895. }
  2896. return this.tokens;
  2897. };
  2898. /**
  2899. * Inline-Level Grammar
  2900. */
  2901. var inline = {
  2902. escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
  2903. autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/,
  2904. url: noop,
  2905. tag: '^comment'
  2906. + '|^</[a-zA-Z][\\w:-]*\\s*>' // self-closing tag
  2907. + '|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>' // open tag
  2908. + '|^<\\?[\\s\\S]*?\\?>' // processing instruction, e.g. <?php ?>
  2909. + '|^<![a-zA-Z]+\\s[\\s\\S]*?>' // declaration, e.g. <!DOCTYPE html>
  2910. + '|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>', // CDATA section
  2911. link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,
  2912. reflink: /^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,
  2913. nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,
  2914. strong: /^__([^\s_])__(?!_)|^\*\*([^\s*])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/,
  2915. em: /^_([^\s_])_(?!_)|^\*([^\s*<\[])\*(?!\*)|^_([^\s<][\s\S]*?[^\s_])_(?!_|[^\spunctuation])|^_([^\s_<][\s\S]*?[^\s])_(?!_|[^\spunctuation])|^\*([^\s<"][\s\S]*?[^\s\*])\*(?!\*|[^\spunctuation])|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/,
  2916. code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,
  2917. br: /^( {2,}|\\)\n(?!\s*$)/,
  2918. del: noop,
  2919. text: /^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/
  2920. };
  2921. // list of punctuation marks from common mark spec
  2922. // without ` and ] to workaround Rule 17 (inline code blocks/links)
  2923. inline._punctuation = '!"#$%&\'()*+,\\-./:;<=>?@\\[^_{|}~';
  2924. inline.em = edit(inline.em).replace(/punctuation/g, inline._punctuation).getRegex();
  2925. inline._escapes = /\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;
  2926. inline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;
  2927. inline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;
  2928. inline.autolink = edit(inline.autolink)
  2929. .replace('scheme', inline._scheme)
  2930. .replace('email', inline._email)
  2931. .getRegex();
  2932. inline._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;
  2933. inline.tag = edit(inline.tag)
  2934. .replace('comment', block._comment)
  2935. .replace('attribute', inline._attribute)
  2936. .getRegex();
  2937. inline._label = /(?:\[[^\[\]]*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
  2938. inline._href = /<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/;
  2939. inline._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;
  2940. inline.link = edit(inline.link)
  2941. .replace('label', inline._label)
  2942. .replace('href', inline._href)
  2943. .replace('title', inline._title)
  2944. .getRegex();
  2945. inline.reflink = edit(inline.reflink)
  2946. .replace('label', inline._label)
  2947. .getRegex();
  2948. /**
  2949. * Normal Inline Grammar
  2950. */
  2951. inline.normal = merge({}, inline);
  2952. /**
  2953. * Pedantic Inline Grammar
  2954. */
  2955. inline.pedantic = merge({}, inline.normal, {
  2956. strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
  2957. em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,
  2958. link: edit(/^!?\[(label)\]\((.*?)\)/)
  2959. .replace('label', inline._label)
  2960. .getRegex(),
  2961. reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/)
  2962. .replace('label', inline._label)
  2963. .getRegex()
  2964. });
  2965. /**
  2966. * GFM Inline Grammar
  2967. */
  2968. inline.gfm = merge({}, inline.normal, {
  2969. escape: edit(inline.escape).replace('])', '~|])').getRegex(),
  2970. _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,
  2971. url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,
  2972. _backpedal: /(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,
  2973. del: /^~+(?=\S)([\s\S]*?\S)~+/,
  2974. text: /^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/
  2975. });
  2976. inline.gfm.url = edit(inline.gfm.url, 'i')
  2977. .replace('email', inline.gfm._extended_email)
  2978. .getRegex();
  2979. /**
  2980. * GFM + Line Breaks Inline Grammar
  2981. */
  2982. inline.breaks = merge({}, inline.gfm, {
  2983. br: edit(inline.br).replace('{2,}', '*').getRegex(),
  2984. text: edit(inline.gfm.text)
  2985. .replace('\\b_', '\\b_| {2,}\\n')
  2986. .replace(/\{2,\}/g, '*')
  2987. .getRegex()
  2988. });
  2989. /**
  2990. * Inline Lexer & Compiler
  2991. */
  2992. function InlineLexer(links, options) {
  2993. this.options = options || marked.defaults;
  2994. this.links = links;
  2995. this.rules = inline.normal;
  2996. this.renderer = this.options.renderer || new Renderer();
  2997. this.renderer.options = this.options;
  2998. if (!this.links) {
  2999. throw new Error('Tokens array requires a `links` property.');
  3000. }
  3001. if (this.options.pedantic) {
  3002. this.rules = inline.pedantic;
  3003. } else if (this.options.gfm) {
  3004. if (this.options.breaks) {
  3005. this.rules = inline.breaks;
  3006. } else {
  3007. this.rules = inline.gfm;
  3008. }
  3009. }
  3010. }
  3011. /**
  3012. * Expose Inline Rules
  3013. */
  3014. InlineLexer.rules = inline;
  3015. /**
  3016. * Static Lexing/Compiling Method
  3017. */
  3018. InlineLexer.output = function(src, links, options) {
  3019. var inline = new InlineLexer(links, options);
  3020. return inline.output(src);
  3021. };
  3022. /**
  3023. * Lexing/Compiling
  3024. */
  3025. InlineLexer.prototype.output = function(src) {
  3026. var out = '',
  3027. link,
  3028. text,
  3029. href,
  3030. title,
  3031. cap,
  3032. prevCapZero;
  3033. while (src) {
  3034. // escape
  3035. if (cap = this.rules.escape.exec(src)) {
  3036. src = src.substring(cap[0].length);
  3037. out += escape(cap[1]);
  3038. continue;
  3039. }
  3040. // tag
  3041. if (cap = this.rules.tag.exec(src)) {
  3042. if (!this.inLink && /^<a /i.test(cap[0])) {
  3043. this.inLink = true;
  3044. } else if (this.inLink && /^<\/a>/i.test(cap[0])) {
  3045. this.inLink = false;
  3046. }
  3047. if (!this.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) {
  3048. this.inRawBlock = true;
  3049. } else if (this.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) {
  3050. this.inRawBlock = false;
  3051. }
  3052. src = src.substring(cap[0].length);
  3053. out += this.options.sanitize
  3054. ? this.options.sanitizer
  3055. ? this.options.sanitizer(cap[0])
  3056. : escape(cap[0])
  3057. : cap[0];
  3058. continue;
  3059. }
  3060. // link
  3061. if (cap = this.rules.link.exec(src)) {
  3062. var lastParenIndex = findClosingBracket(cap[2], '()');
  3063. if (lastParenIndex > -1) {
  3064. var linkLen = 4 + cap[1].length + lastParenIndex;
  3065. cap[2] = cap[2].substring(0, lastParenIndex);
  3066. cap[0] = cap[0].substring(0, linkLen).trim();
  3067. cap[3] = '';
  3068. }
  3069. src = src.substring(cap[0].length);
  3070. this.inLink = true;
  3071. href = cap[2];
  3072. if (this.options.pedantic) {
  3073. link = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href);
  3074. if (link) {
  3075. href = link[1];
  3076. title = link[3];
  3077. } else {
  3078. title = '';
  3079. }
  3080. } else {
  3081. title = cap[3] ? cap[3].slice(1, -1) : '';
  3082. }
  3083. href = href.trim().replace(/^<([\s\S]*)>$/, '$1');
  3084. out += this.outputLink(cap, {
  3085. href: InlineLexer.escapes(href),
  3086. title: InlineLexer.escapes(title)
  3087. });
  3088. this.inLink = false;
  3089. continue;
  3090. }
  3091. // reflink, nolink
  3092. if ((cap = this.rules.reflink.exec(src))
  3093. || (cap = this.rules.nolink.exec(src))) {
  3094. src = src.substring(cap[0].length);
  3095. link = (cap[2] || cap[1]).replace(/\s+/g, ' ');
  3096. link = this.links[link.toLowerCase()];
  3097. if (!link || !link.href) {
  3098. out += cap[0].charAt(0);
  3099. src = cap[0].substring(1) + src;
  3100. continue;
  3101. }
  3102. this.inLink = true;
  3103. out += this.outputLink(cap, link);
  3104. this.inLink = false;
  3105. continue;
  3106. }
  3107. // strong
  3108. if (cap = this.rules.strong.exec(src)) {
  3109. src = src.substring(cap[0].length);
  3110. out += this.renderer.strong(this.output(cap[4] || cap[3] || cap[2] || cap[1]));
  3111. continue;
  3112. }
  3113. // em
  3114. if (cap = this.rules.em.exec(src)) {
  3115. src = src.substring(cap[0].length);
  3116. out += this.renderer.em(this.output(cap[6] || cap[5] || cap[4] || cap[3] || cap[2] || cap[1]));
  3117. continue;
  3118. }
  3119. // code
  3120. if (cap = this.rules.code.exec(src)) {
  3121. src = src.substring(cap[0].length);
  3122. out += this.renderer.codespan(escape(cap[2].trim(), true));
  3123. continue;
  3124. }
  3125. // br
  3126. if (cap = this.rules.br.exec(src)) {
  3127. src = src.substring(cap[0].length);
  3128. out += this.renderer.br();
  3129. continue;
  3130. }
  3131. // del (gfm)
  3132. if (cap = this.rules.del.exec(src)) {
  3133. src = src.substring(cap[0].length);
  3134. out += this.renderer.del(this.output(cap[1]));
  3135. continue;
  3136. }
  3137. // autolink
  3138. if (cap = this.rules.autolink.exec(src)) {
  3139. src = src.substring(cap[0].length);
  3140. if (cap[2] === '@') {
  3141. text = escape(this.mangle(cap[1]));
  3142. href = 'mailto:' + text;
  3143. } else {
  3144. text = escape(cap[1]);
  3145. href = text;
  3146. }
  3147. out += this.renderer.link(href, null, text);
  3148. continue;
  3149. }
  3150. // url (gfm)
  3151. if (!this.inLink && (cap = this.rules.url.exec(src))) {
  3152. if (cap[2] === '@') {
  3153. text = escape(cap[0]);
  3154. href = 'mailto:' + text;
  3155. } else {
  3156. // do extended autolink path validation
  3157. do {
  3158. prevCapZero = cap[0];
  3159. cap[0] = this.rules._backpedal.exec(cap[0])[0];
  3160. } while (prevCapZero !== cap[0]);
  3161. text = escape(cap[0]);
  3162. if (cap[1] === 'www.') {
  3163. href = 'http://' + text;
  3164. } else {
  3165. href = text;
  3166. }
  3167. }
  3168. src = src.substring(cap[0].length);
  3169. out += this.renderer.link(href, null, text);
  3170. continue;
  3171. }
  3172. // text
  3173. if (cap = this.rules.text.exec(src)) {
  3174. src = src.substring(cap[0].length);
  3175. if (this.inRawBlock) {
  3176. out += this.renderer.text(this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0])) : cap[0]);
  3177. } else {
  3178. out += this.renderer.text(escape(this.smartypants(cap[0])));
  3179. }
  3180. continue;
  3181. }
  3182. if (src) {
  3183. throw new Error('Infinite loop on byte: ' + src.charCodeAt(0));
  3184. }
  3185. }
  3186. return out;
  3187. };
  3188. InlineLexer.escapes = function(text) {
  3189. return text ? text.replace(InlineLexer.rules._escapes, '$1') : text;
  3190. };
  3191. /**
  3192. * Compile Link
  3193. */
  3194. InlineLexer.prototype.outputLink = function(cap, link) {
  3195. var href = link.href,
  3196. title = link.title ? escape(link.title) : null;
  3197. return cap[0].charAt(0) !== '!'
  3198. ? this.renderer.link(href, title, this.output(cap[1]))
  3199. : this.renderer.image(href, title, escape(cap[1]));
  3200. };
  3201. /**
  3202. * Smartypants Transformations
  3203. */
  3204. InlineLexer.prototype.smartypants = function(text) {
  3205. if (!this.options.smartypants) return text;
  3206. return text
  3207. // em-dashes
  3208. .replace(/---/g, '\u2014')
  3209. // en-dashes
  3210. .replace(/--/g, '\u2013')
  3211. // opening singles
  3212. .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018')
  3213. // closing singles & apostrophes
  3214. .replace(/'/g, '\u2019')
  3215. // opening doubles
  3216. .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c')
  3217. // closing doubles
  3218. .replace(/"/g, '\u201d')
  3219. // ellipses
  3220. .replace(/\.{3}/g, '\u2026');
  3221. };
  3222. /**
  3223. * Mangle Links
  3224. */
  3225. InlineLexer.prototype.mangle = function(text) {
  3226. if (!this.options.mangle) return text;
  3227. var out = '',
  3228. l = text.length,
  3229. i = 0,
  3230. ch;
  3231. for (; i < l; i++) {
  3232. ch = text.charCodeAt(i);
  3233. if (Math.random() > 0.5) {
  3234. ch = 'x' + ch.toString(16);
  3235. }
  3236. out += '&#' + ch + ';';
  3237. }
  3238. return out;
  3239. };
  3240. /**
  3241. * Renderer
  3242. */
  3243. function Renderer(options) {
  3244. this.options = options || marked.defaults;
  3245. }
  3246. Renderer.prototype.code = function(code, infostring, escaped) {
  3247. var lang = (infostring || '').match(/\S*/)[0];
  3248. if (this.options.highlight) {
  3249. var out = this.options.highlight(code, lang);
  3250. if (out != null && out !== code) {
  3251. escaped = true;
  3252. code = out;
  3253. }
  3254. }
  3255. if (!lang) {
  3256. return '<pre><code>'
  3257. + (escaped ? code : escape(code, true))
  3258. + '</code></pre>';
  3259. }
  3260. return '<pre><code class="'
  3261. + this.options.langPrefix
  3262. + escape(lang, true)
  3263. + '">'
  3264. + (escaped ? code : escape(code, true))
  3265. + '</code></pre>\n';
  3266. };
  3267. Renderer.prototype.blockquote = function(quote) {
  3268. return '<blockquote>\n' + quote + '</blockquote>\n';
  3269. };
  3270. Renderer.prototype.html = function(html) {
  3271. return html;
  3272. };
  3273. Renderer.prototype.heading = function(text, level, raw, slugger) {
  3274. if (this.options.headerIds) {
  3275. return '<h'
  3276. + level
  3277. + ' id="'
  3278. + this.options.headerPrefix
  3279. + slugger.slug(raw)
  3280. + '">'
  3281. + text
  3282. + '</h'
  3283. + level
  3284. + '>\n';
  3285. }
  3286. // ignore IDs
  3287. return '<h' + level + '>' + text + '</h' + level + '>\n';
  3288. };
  3289. Renderer.prototype.hr = function() {
  3290. return this.options.xhtml ? '<hr/>\n' : '<hr>\n';
  3291. };
  3292. Renderer.prototype.list = function(body, ordered, start) {
  3293. var type = ordered ? 'ol' : 'ul',
  3294. startatt = (ordered && start !== 1) ? (' start="' + start + '"') : '';
  3295. return '<' + type + startatt + '>\n' + body + '</' + type + '>\n';
  3296. };
  3297. Renderer.prototype.listitem = function(text) {
  3298. return '<li>' + text + '</li>\n';
  3299. };
  3300. Renderer.prototype.checkbox = function(checked) {
  3301. return '<input '
  3302. + (checked ? 'checked="" ' : '')
  3303. + 'disabled="" type="checkbox"'
  3304. + (this.options.xhtml ? ' /' : '')
  3305. + '> ';
  3306. };
  3307. Renderer.prototype.paragraph = function(text) {
  3308. return '<p>' + text + '</p>\n';
  3309. };
  3310. Renderer.prototype.table = function(header, body) {
  3311. if (body) body = '<tbody>' + body + '</tbody>';
  3312. return '<table>\n'
  3313. + '<thead>\n'
  3314. + header
  3315. + '</thead>\n'
  3316. + body
  3317. + '</table>\n';
  3318. };
  3319. Renderer.prototype.tablerow = function(content) {
  3320. return '<tr>\n' + content + '</tr>\n';
  3321. };
  3322. Renderer.prototype.tablecell = function(content, flags) {
  3323. var type = flags.header ? 'th' : 'td';
  3324. var tag = flags.align
  3325. ? '<' + type + ' align="' + flags.align + '">'
  3326. : '<' + type + '>';
  3327. return tag + content + '</' + type + '>\n';
  3328. };
  3329. // span level renderer
  3330. Renderer.prototype.strong = function(text) {
  3331. return '<strong>' + text + '</strong>';
  3332. };
  3333. Renderer.prototype.em = function(text) {
  3334. return '<em>' + text + '</em>';
  3335. };
  3336. Renderer.prototype.codespan = function(text) {
  3337. return '<code>' + text + '</code>';
  3338. };
  3339. Renderer.prototype.br = function() {
  3340. return this.options.xhtml ? '<br/>' : '<br>';
  3341. };
  3342. Renderer.prototype.del = function(text) {
  3343. return '<del>' + text + '</del>';
  3344. };
  3345. Renderer.prototype.link = function(href, title, text) {
  3346. href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);
  3347. if (href === null) {
  3348. return text;
  3349. }
  3350. var out = '<a href="' + escape(href) + '"';
  3351. if (title) {
  3352. out += ' title="' + title + '"';
  3353. }
  3354. out += '>' + text + '</a>';
  3355. return out;
  3356. };
  3357. Renderer.prototype.image = function(href, title, text) {
  3358. href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);
  3359. if (href === null) {
  3360. return text;
  3361. }
  3362. var out = '<img src="' + href + '" alt="' + text + '"';
  3363. if (title) {
  3364. out += ' title="' + title + '"';
  3365. }
  3366. out += this.options.xhtml ? '/>' : '>';
  3367. return out;
  3368. };
  3369. Renderer.prototype.text = function(text) {
  3370. return text;
  3371. };
  3372. /**
  3373. * TextRenderer
  3374. * returns only the textual part of the token
  3375. */
  3376. function TextRenderer() {}
  3377. // no need for block level renderers
  3378. TextRenderer.prototype.strong =
  3379. TextRenderer.prototype.em =
  3380. TextRenderer.prototype.codespan =
  3381. TextRenderer.prototype.del =
  3382. TextRenderer.prototype.text = function(text) {
  3383. return text;
  3384. };
  3385. TextRenderer.prototype.link =
  3386. TextRenderer.prototype.image = function(href, title, text) {
  3387. return '' + text;
  3388. };
  3389. TextRenderer.prototype.br = function() {
  3390. return '';
  3391. };
  3392. /**
  3393. * Parsing & Compiling
  3394. */
  3395. function Parser(options) {
  3396. this.tokens = [];
  3397. this.token = null;
  3398. this.options = options || marked.defaults;
  3399. this.options.renderer = this.options.renderer || new Renderer();
  3400. this.renderer = this.options.renderer;
  3401. this.renderer.options = this.options;
  3402. this.slugger = new Slugger();
  3403. }
  3404. /**
  3405. * Static Parse Method
  3406. */
  3407. Parser.parse = function(src, options) {
  3408. var parser = new Parser(options);
  3409. return parser.parse(src);
  3410. };
  3411. /**
  3412. * Parse Loop
  3413. */
  3414. Parser.prototype.parse = function(src) {
  3415. this.inline = new InlineLexer(src.links, this.options);
  3416. // use an InlineLexer with a TextRenderer to extract pure text
  3417. this.inlineText = new InlineLexer(
  3418. src.links,
  3419. merge({}, this.options, { renderer: new TextRenderer() })
  3420. );
  3421. this.tokens = src.reverse();
  3422. var out = '';
  3423. while (this.next()) {
  3424. out += this.tok();
  3425. }
  3426. return out;
  3427. };
  3428. /**
  3429. * Next Token
  3430. */
  3431. Parser.prototype.next = function() {
  3432. this.token = this.tokens.pop();
  3433. return this.token;
  3434. };
  3435. /**
  3436. * Preview Next Token
  3437. */
  3438. Parser.prototype.peek = function() {
  3439. return this.tokens[this.tokens.length - 1] || 0;
  3440. };
  3441. /**
  3442. * Parse Text Tokens
  3443. */
  3444. Parser.prototype.parseText = function() {
  3445. var body = this.token.text;
  3446. while (this.peek().type === 'text') {
  3447. body += '\n' + this.next().text;
  3448. }
  3449. return this.inline.output(body);
  3450. };
  3451. /**
  3452. * Parse Current Token
  3453. */
  3454. Parser.prototype.tok = function() {
  3455. switch (this.token.type) {
  3456. case 'space': {
  3457. return '';
  3458. }
  3459. case 'hr': {
  3460. return this.renderer.hr();
  3461. }
  3462. case 'heading': {
  3463. return this.renderer.heading(
  3464. this.inline.output(this.token.text),
  3465. this.token.depth,
  3466. unescape(this.inlineText.output(this.token.text)),
  3467. this.slugger);
  3468. }
  3469. case 'code': {
  3470. return this.renderer.code(this.token.text,
  3471. this.token.lang,
  3472. this.token.escaped);
  3473. }
  3474. case 'table': {
  3475. var header = '',
  3476. body = '',
  3477. i,
  3478. row,
  3479. cell,
  3480. j;
  3481. // header
  3482. cell = '';
  3483. for (i = 0; i < this.token.header.length; i++) {
  3484. cell += this.renderer.tablecell(
  3485. this.inline.output(this.token.header[i]),
  3486. { header: true, align: this.token.align[i] }
  3487. );
  3488. }
  3489. header += this.renderer.tablerow(cell);
  3490. for (i = 0; i < this.token.cells.length; i++) {
  3491. row = this.token.cells[i];
  3492. cell = '';
  3493. for (j = 0; j < row.length; j++) {
  3494. cell += this.renderer.tablecell(
  3495. this.inline.output(row[j]),
  3496. { header: false, align: this.token.align[j] }
  3497. );
  3498. }
  3499. body += this.renderer.tablerow(cell);
  3500. }
  3501. return this.renderer.table(header, body);
  3502. }
  3503. case 'blockquote_start': {
  3504. body = '';
  3505. while (this.next().type !== 'blockquote_end') {
  3506. body += this.tok();
  3507. }
  3508. return this.renderer.blockquote(body);
  3509. }
  3510. case 'list_start': {
  3511. body = '';
  3512. var ordered = this.token.ordered,
  3513. start = this.token.start;
  3514. while (this.next().type !== 'list_end') {
  3515. body += this.tok();
  3516. }
  3517. return this.renderer.list(body, ordered, start);
  3518. }
  3519. case 'list_item_start': {
  3520. body = '';
  3521. var loose = this.token.loose;
  3522. var checked = this.token.checked;
  3523. var task = this.token.task;
  3524. if (this.token.task) {
  3525. body += this.renderer.checkbox(checked);
  3526. }
  3527. while (this.next().type !== 'list_item_end') {
  3528. body += !loose && this.token.type === 'text'
  3529. ? this.parseText()
  3530. : this.tok();
  3531. }
  3532. return this.renderer.listitem(body, task, checked);
  3533. }
  3534. case 'html': {
  3535. // TODO parse inline content if parameter markdown=1
  3536. return this.renderer.html(this.token.text);
  3537. }
  3538. case 'paragraph': {
  3539. return this.renderer.paragraph(this.inline.output(this.token.text));
  3540. }
  3541. case 'text': {
  3542. return this.renderer.paragraph(this.parseText());
  3543. }
  3544. default: {
  3545. var errMsg = 'Token with "' + this.token.type + '" type was not found.';
  3546. if (this.options.silent) {
  3547. console.log(errMsg);
  3548. } else {
  3549. throw new Error(errMsg);
  3550. }
  3551. }
  3552. }
  3553. };
  3554. /**
  3555. * Slugger generates header id
  3556. */
  3557. function Slugger() {
  3558. this.seen = {};
  3559. }
  3560. /**
  3561. * Convert string to unique id
  3562. */
  3563. Slugger.prototype.slug = function(value) {
  3564. var slug = value
  3565. .toLowerCase()
  3566. .trim()
  3567. .replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, '')
  3568. .replace(/\s/g, '-');
  3569. if (this.seen.hasOwnProperty(slug)) {
  3570. var originalSlug = slug;
  3571. do {
  3572. this.seen[originalSlug]++;
  3573. slug = originalSlug + '-' + this.seen[originalSlug];
  3574. } while (this.seen.hasOwnProperty(slug));
  3575. }
  3576. this.seen[slug] = 0;
  3577. return slug;
  3578. };
  3579. /**
  3580. * Helpers
  3581. */
  3582. function escape(html, encode) {
  3583. if (encode) {
  3584. if (escape.escapeTest.test(html)) {
  3585. return html.replace(escape.escapeReplace, function(ch) { return escape.replacements[ch]; });
  3586. }
  3587. } else {
  3588. if (escape.escapeTestNoEncode.test(html)) {
  3589. return html.replace(escape.escapeReplaceNoEncode, function(ch) { return escape.replacements[ch]; });
  3590. }
  3591. }
  3592. return html;
  3593. }
  3594. escape.escapeTest = /[&<>"']/;
  3595. escape.escapeReplace = /[&<>"']/g;
  3596. escape.replacements = {
  3597. '&': '&amp;',
  3598. '<': '&lt;',
  3599. '>': '&gt;',
  3600. '"': '&quot;',
  3601. "'": '&#39;'
  3602. };
  3603. escape.escapeTestNoEncode = /[<>"']|&(?!#?\w+;)/;
  3604. escape.escapeReplaceNoEncode = /[<>"']|&(?!#?\w+;)/g;
  3605. function unescape(html) {
  3606. // explicitly match decimal, hex, and named HTML entities
  3607. return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, function(_, n) {
  3608. n = n.toLowerCase();
  3609. if (n === 'colon') return ':';
  3610. if (n.charAt(0) === '#') {
  3611. return n.charAt(1) === 'x'
  3612. ? String.fromCharCode(parseInt(n.substring(2), 16))
  3613. : String.fromCharCode(+n.substring(1));
  3614. }
  3615. return '';
  3616. });
  3617. }
  3618. function edit(regex, opt) {
  3619. regex = regex.source || regex;
  3620. opt = opt || '';
  3621. return {
  3622. replace: function(name, val) {
  3623. val = val.source || val;
  3624. val = val.replace(/(^|[^\[])\^/g, '$1');
  3625. regex = regex.replace(name, val);
  3626. return this;
  3627. },
  3628. getRegex: function() {
  3629. return new RegExp(regex, opt);
  3630. }
  3631. };
  3632. }
  3633. function cleanUrl(sanitize, base, href) {
  3634. if (sanitize) {
  3635. try {
  3636. var prot = decodeURIComponent(unescape(href))
  3637. .replace(/[^\w:]/g, '')
  3638. .toLowerCase();
  3639. } catch (e) {
  3640. return null;
  3641. }
  3642. if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) {
  3643. return null;
  3644. }
  3645. }
  3646. if (base && !originIndependentUrl.test(href)) {
  3647. href = resolveUrl(base, href);
  3648. }
  3649. try {
  3650. href = encodeURI(href).replace(/%25/g, '%');
  3651. } catch (e) {
  3652. return null;
  3653. }
  3654. return href;
  3655. }
  3656. function resolveUrl(base, href) {
  3657. if (!baseUrls[' ' + base]) {
  3658. // we can ignore everything in base after the last slash of its path component,
  3659. // but we might need to add _that_
  3660. // https://tools.ietf.org/html/rfc3986#section-3
  3661. if (/^[^:]+:\/*[^/]*$/.test(base)) {
  3662. baseUrls[' ' + base] = base + '/';
  3663. } else {
  3664. baseUrls[' ' + base] = rtrim(base, '/', true);
  3665. }
  3666. }
  3667. base = baseUrls[' ' + base];
  3668. if (href.slice(0, 2) === '//') {
  3669. return base.replace(/:[\s\S]*/, ':') + href;
  3670. } else if (href.charAt(0) === '/') {
  3671. return base.replace(/(:\/*[^/]*)[\s\S]*/, '$1') + href;
  3672. } else {
  3673. return base + href;
  3674. }
  3675. }
  3676. var baseUrls = {};
  3677. var originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;
  3678. function noop() {}
  3679. noop.exec = noop;
  3680. function merge(obj) {
  3681. var i = 1,
  3682. target,
  3683. key;
  3684. for (; i < arguments.length; i++) {
  3685. target = arguments[i];
  3686. for (key in target) {
  3687. if (Object.prototype.hasOwnProperty.call(target, key)) {
  3688. obj[key] = target[key];
  3689. }
  3690. }
  3691. }
  3692. return obj;
  3693. }
  3694. function splitCells(tableRow, count) {
  3695. // ensure that every cell-delimiting pipe has a space
  3696. // before it to distinguish it from an escaped pipe
  3697. var row = tableRow.replace(/\|/g, function(match, offset, str) {
  3698. var escaped = false,
  3699. curr = offset;
  3700. while (--curr >= 0 && str[curr] === '\\') escaped = !escaped;
  3701. if (escaped) {
  3702. // odd number of slashes means | is escaped
  3703. // so we leave it alone
  3704. return '|';
  3705. } else {
  3706. // add space before unescaped |
  3707. return ' |';
  3708. }
  3709. }),
  3710. cells = row.split(/ \|/),
  3711. i = 0;
  3712. if (cells.length > count) {
  3713. cells.splice(count);
  3714. } else {
  3715. while (cells.length < count) cells.push('');
  3716. }
  3717. for (; i < cells.length; i++) {
  3718. // leading or trailing whitespace is ignored per the gfm spec
  3719. cells[i] = cells[i].trim().replace(/\\\|/g, '|');
  3720. }
  3721. return cells;
  3722. }
  3723. // Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').
  3724. // /c*$/ is vulnerable to REDOS.
  3725. // invert: Remove suffix of non-c chars instead. Default falsey.
  3726. function rtrim(str, c, invert) {
  3727. if (str.length === 0) {
  3728. return '';
  3729. }
  3730. // Length of suffix matching the invert condition.
  3731. var suffLen = 0;
  3732. // Step left until we fail to match the invert condition.
  3733. while (suffLen < str.length) {
  3734. var currChar = str.charAt(str.length - suffLen - 1);
  3735. if (currChar === c && !invert) {
  3736. suffLen++;
  3737. } else if (currChar !== c && invert) {
  3738. suffLen++;
  3739. } else {
  3740. break;
  3741. }
  3742. }
  3743. return str.substr(0, str.length - suffLen);
  3744. }
  3745. function findClosingBracket(str, b) {
  3746. if (str.indexOf(b[1]) === -1) {
  3747. return -1;
  3748. }
  3749. var level = 0;
  3750. for (var i = 0; i < str.length; i++) {
  3751. if (str[i] === '\\') {
  3752. i++;
  3753. } else if (str[i] === b[0]) {
  3754. level++;
  3755. } else if (str[i] === b[1]) {
  3756. level--;
  3757. if (level < 0) {
  3758. return i;
  3759. }
  3760. }
  3761. }
  3762. return -1;
  3763. }
  3764. function checkSanitizeDeprecation(opt) {
  3765. if (opt && opt.sanitize && !opt.silent) {
  3766. console.warn('marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options');
  3767. }
  3768. }
  3769. /**
  3770. * Marked
  3771. */
  3772. function marked(src, opt, callback) {
  3773. // throw error in case of non string input
  3774. if (typeof src === 'undefined' || src === null) {
  3775. throw new Error('marked(): input parameter is undefined or null');
  3776. }
  3777. if (typeof src !== 'string') {
  3778. throw new Error('marked(): input parameter is of type '
  3779. + Object.prototype.toString.call(src) + ', string expected');
  3780. }
  3781. if (callback || typeof opt === 'function') {
  3782. if (!callback) {
  3783. callback = opt;
  3784. opt = null;
  3785. }
  3786. opt = merge({}, marked.defaults, opt || {});
  3787. checkSanitizeDeprecation(opt);
  3788. var highlight = opt.highlight,
  3789. tokens,
  3790. pending,
  3791. i = 0;
  3792. try {
  3793. tokens = Lexer.lex(src, opt);
  3794. } catch (e) {
  3795. return callback(e);
  3796. }
  3797. pending = tokens.length;
  3798. var done = function(err) {
  3799. if (err) {
  3800. opt.highlight = highlight;
  3801. return callback(err);
  3802. }
  3803. var out;
  3804. try {
  3805. out = Parser.parse(tokens, opt);
  3806. } catch (e) {
  3807. err = e;
  3808. }
  3809. opt.highlight = highlight;
  3810. return err
  3811. ? callback(err)
  3812. : callback(null, out);
  3813. };
  3814. if (!highlight || highlight.length < 3) {
  3815. return done();
  3816. }
  3817. delete opt.highlight;
  3818. if (!pending) return done();
  3819. for (; i < tokens.length; i++) {
  3820. (function(token) {
  3821. if (token.type !== 'code') {
  3822. return --pending || done();
  3823. }
  3824. return highlight(token.text, token.lang, function(err, code) {
  3825. if (err) return done(err);
  3826. if (code == null || code === token.text) {
  3827. return --pending || done();
  3828. }
  3829. token.text = code;
  3830. token.escaped = true;
  3831. --pending || done();
  3832. });
  3833. })(tokens[i]);
  3834. }
  3835. return;
  3836. }
  3837. try {
  3838. if (opt) opt = merge({}, marked.defaults, opt);
  3839. checkSanitizeDeprecation(opt);
  3840. return Parser.parse(Lexer.lex(src, opt), opt);
  3841. } catch (e) {
  3842. e.message += '\nPlease report this to https://github.com/markedjs/marked.';
  3843. if ((opt || marked.defaults).silent) {
  3844. return '<p>An error occurred:</p><pre>'
  3845. + escape(e.message + '', true)
  3846. + '</pre>';
  3847. }
  3848. throw e;
  3849. }
  3850. }
  3851. /**
  3852. * Options
  3853. */
  3854. marked.options =
  3855. marked.setOptions = function(opt) {
  3856. merge(marked.defaults, opt);
  3857. return marked;
  3858. };
  3859. marked.getDefaults = function() {
  3860. return {
  3861. baseUrl: null,
  3862. breaks: false,
  3863. gfm: true,
  3864. headerIds: true,
  3865. headerPrefix: '',
  3866. highlight: null,
  3867. langPrefix: 'language-',
  3868. mangle: true,
  3869. pedantic: false,
  3870. renderer: new Renderer(),
  3871. sanitize: false,
  3872. sanitizer: null,
  3873. silent: false,
  3874. smartLists: false,
  3875. smartypants: false,
  3876. xhtml: false
  3877. };
  3878. };
  3879. marked.defaults = marked.getDefaults();
  3880. /**
  3881. * Expose
  3882. */
  3883. marked.Parser = Parser;
  3884. marked.parser = Parser.parse;
  3885. marked.Renderer = Renderer;
  3886. marked.TextRenderer = TextRenderer;
  3887. marked.Lexer = Lexer;
  3888. marked.lexer = Lexer.lex;
  3889. marked.InlineLexer = InlineLexer;
  3890. marked.inlineLexer = InlineLexer.output;
  3891. marked.Slugger = Slugger;
  3892. marked.parse = marked;
  3893. if ('object' !== 'undefined' && 'object' === 'object') {
  3894. module.exports = marked;
  3895. } else if (typeof undefined === 'function' && undefined.amd) {
  3896. undefined(function() { return marked; });
  3897. } else {
  3898. root.marked = marked;
  3899. }
  3900. })(commonjsGlobal || (typeof window !== 'undefined' ? window : commonjsGlobal));
  3901. });
  3902. var speakingurl = createCommonjsModule(function (module) {
  3903. (function (root) {
  3904. 'use strict';
  3905. /**
  3906. * charMap
  3907. * @type {Object}
  3908. */
  3909. var charMap = {
  3910. // latin
  3911. 'À': 'A',
  3912. 'Á': 'A',
  3913. 'Â': 'A',
  3914. 'Ã': 'A',
  3915. 'Ä': 'Ae',
  3916. 'Å': 'A',
  3917. 'Æ': 'AE',
  3918. 'Ç': 'C',
  3919. 'È': 'E',
  3920. 'É': 'E',
  3921. 'Ê': 'E',
  3922. 'Ë': 'E',
  3923. 'Ì': 'I',
  3924. 'Í': 'I',
  3925. 'Î': 'I',
  3926. 'Ï': 'I',
  3927. 'Ð': 'D',
  3928. 'Ñ': 'N',
  3929. 'Ò': 'O',
  3930. 'Ó': 'O',
  3931. 'Ô': 'O',
  3932. 'Õ': 'O',
  3933. 'Ö': 'Oe',
  3934. 'Ő': 'O',
  3935. 'Ø': 'O',
  3936. 'Ù': 'U',
  3937. 'Ú': 'U',
  3938. 'Û': 'U',
  3939. 'Ü': 'Ue',
  3940. 'Ű': 'U',
  3941. 'Ý': 'Y',
  3942. 'Þ': 'TH',
  3943. 'ß': 'ss',
  3944. 'à': 'a',
  3945. 'á': 'a',
  3946. 'â': 'a',
  3947. 'ã': 'a',
  3948. 'ä': 'ae',
  3949. 'å': 'a',
  3950. 'æ': 'ae',
  3951. 'ç': 'c',
  3952. 'è': 'e',
  3953. 'é': 'e',
  3954. 'ê': 'e',
  3955. 'ë': 'e',
  3956. 'ì': 'i',
  3957. 'í': 'i',
  3958. 'î': 'i',
  3959. 'ï': 'i',
  3960. 'ð': 'd',
  3961. 'ñ': 'n',
  3962. 'ò': 'o',
  3963. 'ó': 'o',
  3964. 'ô': 'o',
  3965. 'õ': 'o',
  3966. 'ö': 'oe',
  3967. 'ő': 'o',
  3968. 'ø': 'o',
  3969. 'ù': 'u',
  3970. 'ú': 'u',
  3971. 'û': 'u',
  3972. 'ü': 'ue',
  3973. 'ű': 'u',
  3974. 'ý': 'y',
  3975. 'þ': 'th',
  3976. 'ÿ': 'y',
  3977. 'ẞ': 'SS',
  3978. // language specific
  3979. // Arabic
  3980. 'ا': 'a',
  3981. 'أ': 'a',
  3982. 'إ': 'i',
  3983. 'آ': 'aa',
  3984. 'ؤ': 'u',
  3985. 'ئ': 'e',
  3986. 'ء': 'a',
  3987. 'ب': 'b',
  3988. 'ت': 't',
  3989. 'ث': 'th',
  3990. 'ج': 'j',
  3991. 'ح': 'h',
  3992. 'خ': 'kh',
  3993. 'د': 'd',
  3994. 'ذ': 'th',
  3995. 'ر': 'r',
  3996. 'ز': 'z',
  3997. 'س': 's',
  3998. 'ش': 'sh',
  3999. 'ص': 's',
  4000. 'ض': 'dh',
  4001. 'ط': 't',
  4002. 'ظ': 'z',
  4003. 'ع': 'a',
  4004. 'غ': 'gh',
  4005. 'ف': 'f',
  4006. 'ق': 'q',
  4007. 'ك': 'k',
  4008. 'ل': 'l',
  4009. 'م': 'm',
  4010. 'ن': 'n',
  4011. 'ه': 'h',
  4012. 'و': 'w',
  4013. 'ي': 'y',
  4014. 'ى': 'a',
  4015. 'ة': 'h',
  4016. 'ﻻ': 'la',
  4017. 'ﻷ': 'laa',
  4018. 'ﻹ': 'lai',
  4019. 'ﻵ': 'laa',
  4020. // Persian additional characters than Arabic
  4021. 'گ': 'g',
  4022. 'چ': 'ch',
  4023. 'پ': 'p',
  4024. 'ژ': 'zh',
  4025. 'ک': 'k',
  4026. 'ی': 'y',
  4027. // Arabic diactrics
  4028. 'َ': 'a',
  4029. 'ً': 'an',
  4030. 'ِ': 'e',
  4031. 'ٍ': 'en',
  4032. 'ُ': 'u',
  4033. 'ٌ': 'on',
  4034. 'ْ': '',
  4035. // Arabic numbers
  4036. '٠': '0',
  4037. '١': '1',
  4038. '٢': '2',
  4039. '٣': '3',
  4040. '٤': '4',
  4041. '٥': '5',
  4042. '٦': '6',
  4043. '٧': '7',
  4044. '٨': '8',
  4045. '٩': '9',
  4046. // Persian numbers
  4047. '۰': '0',
  4048. '۱': '1',
  4049. '۲': '2',
  4050. '۳': '3',
  4051. '۴': '4',
  4052. '۵': '5',
  4053. '۶': '6',
  4054. '۷': '7',
  4055. '۸': '8',
  4056. '۹': '9',
  4057. // Burmese consonants
  4058. 'က': 'k',
  4059. 'ခ': 'kh',
  4060. 'ဂ': 'g',
  4061. 'ဃ': 'ga',
  4062. 'င': 'ng',
  4063. 'စ': 's',
  4064. 'ဆ': 'sa',
  4065. 'ဇ': 'z',
  4066. 'စျ': 'za',
  4067. 'ည': 'ny',
  4068. 'ဋ': 't',
  4069. 'ဌ': 'ta',
  4070. 'ဍ': 'd',
  4071. 'ဎ': 'da',
  4072. 'ဏ': 'na',
  4073. 'တ': 't',
  4074. 'ထ': 'ta',
  4075. 'ဒ': 'd',
  4076. 'ဓ': 'da',
  4077. 'န': 'n',
  4078. 'ပ': 'p',
  4079. 'ဖ': 'pa',
  4080. 'ဗ': 'b',
  4081. 'ဘ': 'ba',
  4082. 'မ': 'm',
  4083. 'ယ': 'y',
  4084. 'ရ': 'ya',
  4085. 'လ': 'l',
  4086. 'ဝ': 'w',
  4087. 'သ': 'th',
  4088. 'ဟ': 'h',
  4089. 'ဠ': 'la',
  4090. 'အ': 'a',
  4091. // consonant character combos
  4092. 'ြ': 'y',
  4093. 'ျ': 'ya',
  4094. 'ွ': 'w',
  4095. 'ြွ': 'yw',
  4096. 'ျွ': 'ywa',
  4097. 'ှ': 'h',
  4098. // independent vowels
  4099. 'ဧ': 'e',
  4100. '၏': '-e',
  4101. 'ဣ': 'i',
  4102. 'ဤ': '-i',
  4103. 'ဉ': 'u',
  4104. 'ဦ': '-u',
  4105. 'ဩ': 'aw',
  4106. 'သြော': 'aw',
  4107. 'ဪ': 'aw',
  4108. // numbers
  4109. '၀': '0',
  4110. '၁': '1',
  4111. '၂': '2',
  4112. '၃': '3',
  4113. '၄': '4',
  4114. '၅': '5',
  4115. '၆': '6',
  4116. '၇': '7',
  4117. '၈': '8',
  4118. '၉': '9',
  4119. // virama and tone marks which are silent in transliteration
  4120. '္': '',
  4121. '့': '',
  4122. 'း': '',
  4123. // Czech
  4124. 'č': 'c',
  4125. 'ď': 'd',
  4126. 'ě': 'e',
  4127. 'ň': 'n',
  4128. 'ř': 'r',
  4129. 'š': 's',
  4130. 'ť': 't',
  4131. 'ů': 'u',
  4132. 'ž': 'z',
  4133. 'Č': 'C',
  4134. 'Ď': 'D',
  4135. 'Ě': 'E',
  4136. 'Ň': 'N',
  4137. 'Ř': 'R',
  4138. 'Š': 'S',
  4139. 'Ť': 'T',
  4140. 'Ů': 'U',
  4141. 'Ž': 'Z',
  4142. // Dhivehi
  4143. 'ހ': 'h',
  4144. 'ށ': 'sh',
  4145. 'ނ': 'n',
  4146. 'ރ': 'r',
  4147. 'ބ': 'b',
  4148. 'ޅ': 'lh',
  4149. 'ކ': 'k',
  4150. 'އ': 'a',
  4151. 'ވ': 'v',
  4152. 'މ': 'm',
  4153. 'ފ': 'f',
  4154. 'ދ': 'dh',
  4155. 'ތ': 'th',
  4156. 'ލ': 'l',
  4157. 'ގ': 'g',
  4158. 'ޏ': 'gn',
  4159. 'ސ': 's',
  4160. 'ޑ': 'd',
  4161. 'ޒ': 'z',
  4162. 'ޓ': 't',
  4163. 'ޔ': 'y',
  4164. 'ޕ': 'p',
  4165. 'ޖ': 'j',
  4166. 'ޗ': 'ch',
  4167. 'ޘ': 'tt',
  4168. 'ޙ': 'hh',
  4169. 'ޚ': 'kh',
  4170. 'ޛ': 'th',
  4171. 'ޜ': 'z',
  4172. 'ޝ': 'sh',
  4173. 'ޞ': 's',
  4174. 'ޟ': 'd',
  4175. 'ޠ': 't',
  4176. 'ޡ': 'z',
  4177. 'ޢ': 'a',
  4178. 'ޣ': 'gh',
  4179. 'ޤ': 'q',
  4180. 'ޥ': 'w',
  4181. 'ަ': 'a',
  4182. 'ާ': 'aa',
  4183. 'ި': 'i',
  4184. 'ީ': 'ee',
  4185. 'ު': 'u',
  4186. 'ޫ': 'oo',
  4187. 'ެ': 'e',
  4188. 'ޭ': 'ey',
  4189. 'ޮ': 'o',
  4190. 'ޯ': 'oa',
  4191. 'ް': '',
  4192. // Georgian https://en.wikipedia.org/wiki/Romanization_of_Georgian
  4193. // National system (2002)
  4194. 'ა': 'a',
  4195. 'ბ': 'b',
  4196. 'გ': 'g',
  4197. 'დ': 'd',
  4198. 'ე': 'e',
  4199. 'ვ': 'v',
  4200. 'ზ': 'z',
  4201. 'თ': 't',
  4202. 'ი': 'i',
  4203. 'კ': 'k',
  4204. 'ლ': 'l',
  4205. 'მ': 'm',
  4206. 'ნ': 'n',
  4207. 'ო': 'o',
  4208. 'პ': 'p',
  4209. 'ჟ': 'zh',
  4210. 'რ': 'r',
  4211. 'ს': 's',
  4212. 'ტ': 't',
  4213. 'უ': 'u',
  4214. 'ფ': 'p',
  4215. 'ქ': 'k',
  4216. 'ღ': 'gh',
  4217. 'ყ': 'q',
  4218. 'შ': 'sh',
  4219. 'ჩ': 'ch',
  4220. 'ც': 'ts',
  4221. 'ძ': 'dz',
  4222. 'წ': 'ts',
  4223. 'ჭ': 'ch',
  4224. 'ხ': 'kh',
  4225. 'ჯ': 'j',
  4226. 'ჰ': 'h',
  4227. // Greek
  4228. 'α': 'a',
  4229. 'β': 'v',
  4230. 'γ': 'g',
  4231. 'δ': 'd',
  4232. 'ε': 'e',
  4233. 'ζ': 'z',
  4234. 'η': 'i',
  4235. 'θ': 'th',
  4236. 'ι': 'i',
  4237. 'κ': 'k',
  4238. 'λ': 'l',
  4239. 'μ': 'm',
  4240. 'ν': 'n',
  4241. 'ξ': 'ks',
  4242. 'ο': 'o',
  4243. 'π': 'p',
  4244. 'ρ': 'r',
  4245. 'σ': 's',
  4246. 'τ': 't',
  4247. 'υ': 'y',
  4248. 'φ': 'f',
  4249. 'χ': 'x',
  4250. 'ψ': 'ps',
  4251. 'ω': 'o',
  4252. 'ά': 'a',
  4253. 'έ': 'e',
  4254. 'ί': 'i',
  4255. 'ό': 'o',
  4256. 'ύ': 'y',
  4257. 'ή': 'i',
  4258. 'ώ': 'o',
  4259. 'ς': 's',
  4260. 'ϊ': 'i',
  4261. 'ΰ': 'y',
  4262. 'ϋ': 'y',
  4263. 'ΐ': 'i',
  4264. 'Α': 'A',
  4265. 'Β': 'B',
  4266. 'Γ': 'G',
  4267. 'Δ': 'D',
  4268. 'Ε': 'E',
  4269. 'Ζ': 'Z',
  4270. 'Η': 'I',
  4271. 'Θ': 'TH',
  4272. 'Ι': 'I',
  4273. 'Κ': 'K',
  4274. 'Λ': 'L',
  4275. 'Μ': 'M',
  4276. 'Ν': 'N',
  4277. 'Ξ': 'KS',
  4278. 'Ο': 'O',
  4279. 'Π': 'P',
  4280. 'Ρ': 'R',
  4281. 'Σ': 'S',
  4282. 'Τ': 'T',
  4283. 'Υ': 'Y',
  4284. 'Φ': 'F',
  4285. 'Χ': 'X',
  4286. 'Ψ': 'PS',
  4287. 'Ω': 'O',
  4288. 'Ά': 'A',
  4289. 'Έ': 'E',
  4290. 'Ί': 'I',
  4291. 'Ό': 'O',
  4292. 'Ύ': 'Y',
  4293. 'Ή': 'I',
  4294. 'Ώ': 'O',
  4295. 'Ϊ': 'I',
  4296. 'Ϋ': 'Y',
  4297. // Latvian
  4298. 'ā': 'a',
  4299. // 'č': 'c', // duplicate
  4300. 'ē': 'e',
  4301. 'ģ': 'g',
  4302. 'ī': 'i',
  4303. 'ķ': 'k',
  4304. 'ļ': 'l',
  4305. 'ņ': 'n',
  4306. // 'š': 's', // duplicate
  4307. 'ū': 'u',
  4308. // 'ž': 'z', // duplicate
  4309. 'Ā': 'A',
  4310. // 'Č': 'C', // duplicate
  4311. 'Ē': 'E',
  4312. 'Ģ': 'G',
  4313. 'Ī': 'I',
  4314. 'Ķ': 'k',
  4315. 'Ļ': 'L',
  4316. 'Ņ': 'N',
  4317. // 'Š': 'S', // duplicate
  4318. 'Ū': 'U',
  4319. // 'Ž': 'Z', // duplicate
  4320. // Macedonian
  4321. 'Ќ': 'Kj',
  4322. 'ќ': 'kj',
  4323. 'Љ': 'Lj',
  4324. 'љ': 'lj',
  4325. 'Њ': 'Nj',
  4326. 'њ': 'nj',
  4327. 'Тс': 'Ts',
  4328. 'тс': 'ts',
  4329. // Polish
  4330. 'ą': 'a',
  4331. 'ć': 'c',
  4332. 'ę': 'e',
  4333. 'ł': 'l',
  4334. 'ń': 'n',
  4335. // 'ó': 'o', // duplicate
  4336. 'ś': 's',
  4337. 'ź': 'z',
  4338. 'ż': 'z',
  4339. 'Ą': 'A',
  4340. 'Ć': 'C',
  4341. 'Ę': 'E',
  4342. 'Ł': 'L',
  4343. 'Ń': 'N',
  4344. 'Ś': 'S',
  4345. 'Ź': 'Z',
  4346. 'Ż': 'Z',
  4347. // Ukranian
  4348. 'Є': 'Ye',
  4349. 'І': 'I',
  4350. 'Ї': 'Yi',
  4351. 'Ґ': 'G',
  4352. 'є': 'ye',
  4353. 'і': 'i',
  4354. 'ї': 'yi',
  4355. 'ґ': 'g',
  4356. // Romanian
  4357. 'ă': 'a',
  4358. 'Ă': 'A',
  4359. 'ș': 's',
  4360. 'Ș': 'S',
  4361. // 'ş': 's', // duplicate
  4362. // 'Ş': 'S', // duplicate
  4363. 'ț': 't',
  4364. 'Ț': 'T',
  4365. 'ţ': 't',
  4366. 'Ţ': 'T',
  4367. // Russian https://en.wikipedia.org/wiki/Romanization_of_Russian
  4368. // ICAO
  4369. 'а': 'a',
  4370. 'б': 'b',
  4371. 'в': 'v',
  4372. 'г': 'g',
  4373. 'д': 'd',
  4374. 'е': 'e',
  4375. 'ё': 'yo',
  4376. 'ж': 'zh',
  4377. 'з': 'z',
  4378. 'и': 'i',
  4379. 'й': 'i',
  4380. 'к': 'k',
  4381. 'л': 'l',
  4382. 'м': 'm',
  4383. 'н': 'n',
  4384. 'о': 'o',
  4385. 'п': 'p',
  4386. 'р': 'r',
  4387. 'с': 's',
  4388. 'т': 't',
  4389. 'у': 'u',
  4390. 'ф': 'f',
  4391. 'х': 'kh',
  4392. 'ц': 'c',
  4393. 'ч': 'ch',
  4394. 'ш': 'sh',
  4395. 'щ': 'sh',
  4396. 'ъ': '',
  4397. 'ы': 'y',
  4398. 'ь': '',
  4399. 'э': 'e',
  4400. 'ю': 'yu',
  4401. 'я': 'ya',
  4402. 'А': 'A',
  4403. 'Б': 'B',
  4404. 'В': 'V',
  4405. 'Г': 'G',
  4406. 'Д': 'D',
  4407. 'Е': 'E',
  4408. 'Ё': 'Yo',
  4409. 'Ж': 'Zh',
  4410. 'З': 'Z',
  4411. 'И': 'I',
  4412. 'Й': 'I',
  4413. 'К': 'K',
  4414. 'Л': 'L',
  4415. 'М': 'M',
  4416. 'Н': 'N',
  4417. 'О': 'O',
  4418. 'П': 'P',
  4419. 'Р': 'R',
  4420. 'С': 'S',
  4421. 'Т': 'T',
  4422. 'У': 'U',
  4423. 'Ф': 'F',
  4424. 'Х': 'Kh',
  4425. 'Ц': 'C',
  4426. 'Ч': 'Ch',
  4427. 'Ш': 'Sh',
  4428. 'Щ': 'Sh',
  4429. 'Ъ': '',
  4430. 'Ы': 'Y',
  4431. 'Ь': '',
  4432. 'Э': 'E',
  4433. 'Ю': 'Yu',
  4434. 'Я': 'Ya',
  4435. // Serbian
  4436. 'ђ': 'dj',
  4437. 'ј': 'j',
  4438. // 'љ': 'lj', // duplicate
  4439. // 'њ': 'nj', // duplicate
  4440. 'ћ': 'c',
  4441. 'џ': 'dz',
  4442. 'Ђ': 'Dj',
  4443. 'Ј': 'j',
  4444. // 'Љ': 'Lj', // duplicate
  4445. // 'Њ': 'Nj', // duplicate
  4446. 'Ћ': 'C',
  4447. 'Џ': 'Dz',
  4448. // Slovak
  4449. 'ľ': 'l',
  4450. 'ĺ': 'l',
  4451. 'ŕ': 'r',
  4452. 'Ľ': 'L',
  4453. 'Ĺ': 'L',
  4454. 'Ŕ': 'R',
  4455. // Turkish
  4456. 'ş': 's',
  4457. 'Ş': 'S',
  4458. 'ı': 'i',
  4459. 'İ': 'I',
  4460. // 'ç': 'c', // duplicate
  4461. // 'Ç': 'C', // duplicate
  4462. // 'ü': 'u', // duplicate, see langCharMap
  4463. // 'Ü': 'U', // duplicate, see langCharMap
  4464. // 'ö': 'o', // duplicate, see langCharMap
  4465. // 'Ö': 'O', // duplicate, see langCharMap
  4466. 'ğ': 'g',
  4467. 'Ğ': 'G',
  4468. // Vietnamese
  4469. 'ả': 'a',
  4470. 'Ả': 'A',
  4471. 'ẳ': 'a',
  4472. 'Ẳ': 'A',
  4473. 'ẩ': 'a',
  4474. 'Ẩ': 'A',
  4475. 'đ': 'd',
  4476. 'Đ': 'D',
  4477. 'ẹ': 'e',
  4478. 'Ẹ': 'E',
  4479. 'ẽ': 'e',
  4480. 'Ẽ': 'E',
  4481. 'ẻ': 'e',
  4482. 'Ẻ': 'E',
  4483. 'ế': 'e',
  4484. 'Ế': 'E',
  4485. 'ề': 'e',
  4486. 'Ề': 'E',
  4487. 'ệ': 'e',
  4488. 'Ệ': 'E',
  4489. 'ễ': 'e',
  4490. 'Ễ': 'E',
  4491. 'ể': 'e',
  4492. 'Ể': 'E',
  4493. 'ỏ': 'o',
  4494. 'ọ': 'o',
  4495. 'Ọ': 'o',
  4496. 'ố': 'o',
  4497. 'Ố': 'O',
  4498. 'ồ': 'o',
  4499. 'Ồ': 'O',
  4500. 'ổ': 'o',
  4501. 'Ổ': 'O',
  4502. 'ộ': 'o',
  4503. 'Ộ': 'O',
  4504. 'ỗ': 'o',
  4505. 'Ỗ': 'O',
  4506. 'ơ': 'o',
  4507. 'Ơ': 'O',
  4508. 'ớ': 'o',
  4509. 'Ớ': 'O',
  4510. 'ờ': 'o',
  4511. 'Ờ': 'O',
  4512. 'ợ': 'o',
  4513. 'Ợ': 'O',
  4514. 'ỡ': 'o',
  4515. 'Ỡ': 'O',
  4516. 'Ở': 'o',
  4517. 'ở': 'o',
  4518. 'ị': 'i',
  4519. 'Ị': 'I',
  4520. 'ĩ': 'i',
  4521. 'Ĩ': 'I',
  4522. 'ỉ': 'i',
  4523. 'Ỉ': 'i',
  4524. 'ủ': 'u',
  4525. 'Ủ': 'U',
  4526. 'ụ': 'u',
  4527. 'Ụ': 'U',
  4528. 'ũ': 'u',
  4529. 'Ũ': 'U',
  4530. 'ư': 'u',
  4531. 'Ư': 'U',
  4532. 'ứ': 'u',
  4533. 'Ứ': 'U',
  4534. 'ừ': 'u',
  4535. 'Ừ': 'U',
  4536. 'ự': 'u',
  4537. 'Ự': 'U',
  4538. 'ữ': 'u',
  4539. 'Ữ': 'U',
  4540. 'ử': 'u',
  4541. 'Ử': 'ư',
  4542. 'ỷ': 'y',
  4543. 'Ỷ': 'y',
  4544. 'ỳ': 'y',
  4545. 'Ỳ': 'Y',
  4546. 'ỵ': 'y',
  4547. 'Ỵ': 'Y',
  4548. 'ỹ': 'y',
  4549. 'Ỹ': 'Y',
  4550. 'ạ': 'a',
  4551. 'Ạ': 'A',
  4552. 'ấ': 'a',
  4553. 'Ấ': 'A',
  4554. 'ầ': 'a',
  4555. 'Ầ': 'A',
  4556. 'ậ': 'a',
  4557. 'Ậ': 'A',
  4558. 'ẫ': 'a',
  4559. 'Ẫ': 'A',
  4560. // 'ă': 'a', // duplicate
  4561. // 'Ă': 'A', // duplicate
  4562. 'ắ': 'a',
  4563. 'Ắ': 'A',
  4564. 'ằ': 'a',
  4565. 'Ằ': 'A',
  4566. 'ặ': 'a',
  4567. 'Ặ': 'A',
  4568. 'ẵ': 'a',
  4569. 'Ẵ': 'A',
  4570. "⓪": "0",
  4571. "①": "1",
  4572. "②": "2",
  4573. "③": "3",
  4574. "④": "4",
  4575. "⑤": "5",
  4576. "⑥": "6",
  4577. "⑦": "7",
  4578. "⑧": "8",
  4579. "⑨": "9",
  4580. "⑩": "10",
  4581. "⑪": "11",
  4582. "⑫": "12",
  4583. "⑬": "13",
  4584. "⑭": "14",
  4585. "⑮": "15",
  4586. "⑯": "16",
  4587. "⑰": "17",
  4588. "⑱": "18",
  4589. "⑲": "18",
  4590. "⑳": "18",
  4591. "⓵": "1",
  4592. "⓶": "2",
  4593. "⓷": "3",
  4594. "⓸": "4",
  4595. "⓹": "5",
  4596. "⓺": "6",
  4597. "⓻": "7",
  4598. "⓼": "8",
  4599. "⓽": "9",
  4600. "⓾": "10",
  4601. "⓿": "0",
  4602. "⓫": "11",
  4603. "⓬": "12",
  4604. "⓭": "13",
  4605. "⓮": "14",
  4606. "⓯": "15",
  4607. "⓰": "16",
  4608. "⓱": "17",
  4609. "⓲": "18",
  4610. "⓳": "19",
  4611. "⓴": "20",
  4612. "Ⓐ": "A",
  4613. "Ⓑ": "B",
  4614. "Ⓒ": "C",
  4615. "Ⓓ": "D",
  4616. "Ⓔ": "E",
  4617. "Ⓕ": "F",
  4618. "Ⓖ": "G",
  4619. "Ⓗ": "H",
  4620. "Ⓘ": "I",
  4621. "Ⓙ": "J",
  4622. "Ⓚ": "K",
  4623. "Ⓛ": "L",
  4624. "Ⓜ": "M",
  4625. "Ⓝ": "N",
  4626. "Ⓞ": "O",
  4627. "Ⓟ": "P",
  4628. "Ⓠ": "Q",
  4629. "Ⓡ": "R",
  4630. "Ⓢ": "S",
  4631. "Ⓣ": "T",
  4632. "Ⓤ": "U",
  4633. "Ⓥ": "V",
  4634. "Ⓦ": "W",
  4635. "Ⓧ": "X",
  4636. "Ⓨ": "Y",
  4637. "Ⓩ": "Z",
  4638. "ⓐ": "a",
  4639. "ⓑ": "b",
  4640. "ⓒ": "c",
  4641. "ⓓ": "d",
  4642. "ⓔ": "e",
  4643. "ⓕ": "f",
  4644. "ⓖ": "g",
  4645. "ⓗ": "h",
  4646. "ⓘ": "i",
  4647. "ⓙ": "j",
  4648. "ⓚ": "k",
  4649. "ⓛ": "l",
  4650. "ⓜ": "m",
  4651. "ⓝ": "n",
  4652. "ⓞ": "o",
  4653. "ⓟ": "p",
  4654. "ⓠ": "q",
  4655. "ⓡ": "r",
  4656. "ⓢ": "s",
  4657. "ⓣ": "t",
  4658. "ⓤ": "u",
  4659. "ⓦ": "v",
  4660. "ⓥ": "w",
  4661. "ⓧ": "x",
  4662. "ⓨ": "y",
  4663. "ⓩ": "z",
  4664. // symbols
  4665. '“': '"',
  4666. '”': '"',
  4667. '‘': "'",
  4668. '’': "'",
  4669. '∂': 'd',
  4670. 'ƒ': 'f',
  4671. '™': '(TM)',
  4672. '©': '(C)',
  4673. 'œ': 'oe',
  4674. 'Œ': 'OE',
  4675. '®': '(R)',
  4676. '†': '+',
  4677. '℠': '(SM)',
  4678. '…': '...',
  4679. '˚': 'o',
  4680. 'º': 'o',
  4681. 'ª': 'a',
  4682. '•': '*',
  4683. '၊': ',',
  4684. '။': '.',
  4685. // currency
  4686. '$': 'USD',
  4687. '€': 'EUR',
  4688. '₢': 'BRN',
  4689. '₣': 'FRF',
  4690. '£': 'GBP',
  4691. '₤': 'ITL',
  4692. '₦': 'NGN',
  4693. '₧': 'ESP',
  4694. '₩': 'KRW',
  4695. '₪': 'ILS',
  4696. '₫': 'VND',
  4697. '₭': 'LAK',
  4698. '₮': 'MNT',
  4699. '₯': 'GRD',
  4700. '₱': 'ARS',
  4701. '₲': 'PYG',
  4702. '₳': 'ARA',
  4703. '₴': 'UAH',
  4704. '₵': 'GHS',
  4705. '¢': 'cent',
  4706. '¥': 'CNY',
  4707. '元': 'CNY',
  4708. '円': 'YEN',
  4709. '﷼': 'IRR',
  4710. '₠': 'EWE',
  4711. '฿': 'THB',
  4712. '₨': 'INR',
  4713. '₹': 'INR',
  4714. '₰': 'PF',
  4715. '₺': 'TRY',
  4716. '؋': 'AFN',
  4717. '₼': 'AZN',
  4718. 'лв': 'BGN',
  4719. '៛': 'KHR',
  4720. '₡': 'CRC',
  4721. '₸': 'KZT',
  4722. 'ден': 'MKD',
  4723. 'zł': 'PLN',
  4724. '₽': 'RUB',
  4725. '₾': 'GEL'
  4726. };
  4727. /**
  4728. * special look ahead character array
  4729. * These characters form with consonants to become 'single'/consonant combo
  4730. * @type [Array]
  4731. */
  4732. var lookAheadCharArray = [
  4733. // burmese
  4734. '်',
  4735. // Dhivehi
  4736. 'ް'
  4737. ];
  4738. /**
  4739. * diatricMap for languages where transliteration changes entirely as more diatrics are added
  4740. * @type {Object}
  4741. */
  4742. var diatricMap = {
  4743. // Burmese
  4744. // dependent vowels
  4745. 'ာ': 'a',
  4746. 'ါ': 'a',
  4747. 'ေ': 'e',
  4748. 'ဲ': 'e',
  4749. 'ိ': 'i',
  4750. 'ီ': 'i',
  4751. 'ို': 'o',
  4752. 'ု': 'u',
  4753. 'ူ': 'u',
  4754. 'ေါင်': 'aung',
  4755. 'ော': 'aw',
  4756. 'ော်': 'aw',
  4757. 'ေါ': 'aw',
  4758. 'ေါ်': 'aw',
  4759. '်': '်', // this is special case but the character will be converted to latin in the code
  4760. 'က်': 'et',
  4761. 'ိုက်': 'aik',
  4762. 'ောက်': 'auk',
  4763. 'င်': 'in',
  4764. 'ိုင်': 'aing',
  4765. 'ောင်': 'aung',
  4766. 'စ်': 'it',
  4767. 'ည်': 'i',
  4768. 'တ်': 'at',
  4769. 'ိတ်': 'eik',
  4770. 'ုတ်': 'ok',
  4771. 'ွတ်': 'ut',
  4772. 'ေတ်': 'it',
  4773. 'ဒ်': 'd',
  4774. 'ိုဒ်': 'ok',
  4775. 'ုဒ်': 'ait',
  4776. 'န်': 'an',
  4777. 'ာန်': 'an',
  4778. 'ိန်': 'ein',
  4779. 'ုန်': 'on',
  4780. 'ွန်': 'un',
  4781. 'ပ်': 'at',
  4782. 'ိပ်': 'eik',
  4783. 'ုပ်': 'ok',
  4784. 'ွပ်': 'ut',
  4785. 'န်ုပ်': 'nub',
  4786. 'မ်': 'an',
  4787. 'ိမ်': 'ein',
  4788. 'ုမ်': 'on',
  4789. 'ွမ်': 'un',
  4790. 'ယ်': 'e',
  4791. 'ိုလ်': 'ol',
  4792. 'ဉ်': 'in',
  4793. 'ံ': 'an',
  4794. 'ိံ': 'ein',
  4795. 'ုံ': 'on',
  4796. // Dhivehi
  4797. 'ައް': 'ah',
  4798. 'ަށް': 'ah'
  4799. };
  4800. /**
  4801. * langCharMap language specific characters translations
  4802. * @type {Object}
  4803. */
  4804. var langCharMap = {
  4805. 'en': {}, // default language
  4806. 'az': { // Azerbaijani
  4807. 'ç': 'c',
  4808. 'ə': 'e',
  4809. 'ğ': 'g',
  4810. 'ı': 'i',
  4811. 'ö': 'o',
  4812. 'ş': 's',
  4813. 'ü': 'u',
  4814. 'Ç': 'C',
  4815. 'Ə': 'E',
  4816. 'Ğ': 'G',
  4817. 'İ': 'I',
  4818. 'Ö': 'O',
  4819. 'Ş': 'S',
  4820. 'Ü': 'U'
  4821. },
  4822. 'cs': { // Czech
  4823. 'č': 'c',
  4824. 'ď': 'd',
  4825. 'ě': 'e',
  4826. 'ň': 'n',
  4827. 'ř': 'r',
  4828. 'š': 's',
  4829. 'ť': 't',
  4830. 'ů': 'u',
  4831. 'ž': 'z',
  4832. 'Č': 'C',
  4833. 'Ď': 'D',
  4834. 'Ě': 'E',
  4835. 'Ň': 'N',
  4836. 'Ř': 'R',
  4837. 'Š': 'S',
  4838. 'Ť': 'T',
  4839. 'Ů': 'U',
  4840. 'Ž': 'Z'
  4841. },
  4842. 'fi': { // Finnish
  4843. // 'å': 'a', duplicate see charMap/latin
  4844. // 'Å': 'A', duplicate see charMap/latin
  4845. 'ä': 'a', // ok
  4846. 'Ä': 'A', // ok
  4847. 'ö': 'o', // ok
  4848. 'Ö': 'O' // ok
  4849. },
  4850. 'hu': { // Hungarian
  4851. 'ä': 'a', // ok
  4852. 'Ä': 'A', // ok
  4853. // 'á': 'a', duplicate see charMap/latin
  4854. // 'Á': 'A', duplicate see charMap/latin
  4855. 'ö': 'o', // ok
  4856. 'Ö': 'O', // ok
  4857. // 'ő': 'o', duplicate see charMap/latin
  4858. // 'Ő': 'O', duplicate see charMap/latin
  4859. 'ü': 'u',
  4860. 'Ü': 'U',
  4861. 'ű': 'u',
  4862. 'Ű': 'U'
  4863. },
  4864. 'lt': { // Lithuanian
  4865. 'ą': 'a',
  4866. 'č': 'c',
  4867. 'ę': 'e',
  4868. 'ė': 'e',
  4869. 'į': 'i',
  4870. 'š': 's',
  4871. 'ų': 'u',
  4872. 'ū': 'u',
  4873. 'ž': 'z',
  4874. 'Ą': 'A',
  4875. 'Č': 'C',
  4876. 'Ę': 'E',
  4877. 'Ė': 'E',
  4878. 'Į': 'I',
  4879. 'Š': 'S',
  4880. 'Ų': 'U',
  4881. 'Ū': 'U'
  4882. },
  4883. 'lv': { // Latvian
  4884. 'ā': 'a',
  4885. 'č': 'c',
  4886. 'ē': 'e',
  4887. 'ģ': 'g',
  4888. 'ī': 'i',
  4889. 'ķ': 'k',
  4890. 'ļ': 'l',
  4891. 'ņ': 'n',
  4892. 'š': 's',
  4893. 'ū': 'u',
  4894. 'ž': 'z',
  4895. 'Ā': 'A',
  4896. 'Č': 'C',
  4897. 'Ē': 'E',
  4898. 'Ģ': 'G',
  4899. 'Ī': 'i',
  4900. 'Ķ': 'k',
  4901. 'Ļ': 'L',
  4902. 'Ņ': 'N',
  4903. 'Š': 'S',
  4904. 'Ū': 'u',
  4905. 'Ž': 'Z'
  4906. },
  4907. 'pl': { // Polish
  4908. 'ą': 'a',
  4909. 'ć': 'c',
  4910. 'ę': 'e',
  4911. 'ł': 'l',
  4912. 'ń': 'n',
  4913. 'ó': 'o',
  4914. 'ś': 's',
  4915. 'ź': 'z',
  4916. 'ż': 'z',
  4917. 'Ą': 'A',
  4918. 'Ć': 'C',
  4919. 'Ę': 'e',
  4920. 'Ł': 'L',
  4921. 'Ń': 'N',
  4922. 'Ó': 'O',
  4923. 'Ś': 'S',
  4924. 'Ź': 'Z',
  4925. 'Ż': 'Z'
  4926. },
  4927. 'sv': { // Swedish
  4928. // 'å': 'a', duplicate see charMap/latin
  4929. // 'Å': 'A', duplicate see charMap/latin
  4930. 'ä': 'a', // ok
  4931. 'Ä': 'A', // ok
  4932. 'ö': 'o', // ok
  4933. 'Ö': 'O' // ok
  4934. },
  4935. 'sk': { // Slovak
  4936. 'ä': 'a',
  4937. 'Ä': 'A'
  4938. },
  4939. 'sr': { // Serbian
  4940. 'љ': 'lj',
  4941. 'њ': 'nj',
  4942. 'Љ': 'Lj',
  4943. 'Њ': 'Nj',
  4944. 'đ': 'dj',
  4945. 'Đ': 'Dj'
  4946. },
  4947. 'tr': { // Turkish
  4948. 'Ü': 'U',
  4949. 'Ö': 'O',
  4950. 'ü': 'u',
  4951. 'ö': 'o'
  4952. }
  4953. };
  4954. /**
  4955. * symbolMap language specific symbol translations
  4956. * translations must be transliterated already
  4957. * @type {Object}
  4958. */
  4959. var symbolMap = {
  4960. 'ar': {
  4961. '∆': 'delta',
  4962. '∞': 'la-nihaya',
  4963. '♥': 'hob',
  4964. '&': 'wa',
  4965. '|': 'aw',
  4966. '<': 'aqal-men',
  4967. '>': 'akbar-men',
  4968. '∑': 'majmou',
  4969. '¤': 'omla'
  4970. },
  4971. 'az': {},
  4972. 'ca': {
  4973. '∆': 'delta',
  4974. '∞': 'infinit',
  4975. '♥': 'amor',
  4976. '&': 'i',
  4977. '|': 'o',
  4978. '<': 'menys que',
  4979. '>': 'mes que',
  4980. '∑': 'suma dels',
  4981. '¤': 'moneda'
  4982. },
  4983. 'cs': {
  4984. '∆': 'delta',
  4985. '∞': 'nekonecno',
  4986. '♥': 'laska',
  4987. '&': 'a',
  4988. '|': 'nebo',
  4989. '<': 'mensi nez',
  4990. '>': 'vetsi nez',
  4991. '∑': 'soucet',
  4992. '¤': 'mena'
  4993. },
  4994. 'de': {
  4995. '∆': 'delta',
  4996. '∞': 'unendlich',
  4997. '♥': 'Liebe',
  4998. '&': 'und',
  4999. '|': 'oder',
  5000. '<': 'kleiner als',
  5001. '>': 'groesser als',
  5002. '∑': 'Summe von',
  5003. '¤': 'Waehrung'
  5004. },
  5005. 'dv': {
  5006. '∆': 'delta',
  5007. '∞': 'kolunulaa',
  5008. '♥': 'loabi',
  5009. '&': 'aai',
  5010. '|': 'noonee',
  5011. '<': 'ah vure kuda',
  5012. '>': 'ah vure bodu',
  5013. '∑': 'jumula',
  5014. '¤': 'faisaa'
  5015. },
  5016. 'en': {
  5017. '∆': 'delta',
  5018. '∞': 'infinity',
  5019. '♥': 'love',
  5020. '&': 'and',
  5021. '|': 'or',
  5022. '<': 'less than',
  5023. '>': 'greater than',
  5024. '∑': 'sum',
  5025. '¤': 'currency'
  5026. },
  5027. 'es': {
  5028. '∆': 'delta',
  5029. '∞': 'infinito',
  5030. '♥': 'amor',
  5031. '&': 'y',
  5032. '|': 'u',
  5033. '<': 'menos que',
  5034. '>': 'mas que',
  5035. '∑': 'suma de los',
  5036. '¤': 'moneda'
  5037. },
  5038. 'fa': {
  5039. '∆': 'delta',
  5040. '∞': 'bi-nahayat',
  5041. '♥': 'eshgh',
  5042. '&': 'va',
  5043. '|': 'ya',
  5044. '<': 'kamtar-az',
  5045. '>': 'bishtar-az',
  5046. '∑': 'majmooe',
  5047. '¤': 'vahed'
  5048. },
  5049. 'fi': {
  5050. '∆': 'delta',
  5051. '∞': 'aarettomyys',
  5052. '♥': 'rakkaus',
  5053. '&': 'ja',
  5054. '|': 'tai',
  5055. '<': 'pienempi kuin',
  5056. '>': 'suurempi kuin',
  5057. '∑': 'summa',
  5058. '¤': 'valuutta'
  5059. },
  5060. 'fr': {
  5061. '∆': 'delta',
  5062. '∞': 'infiniment',
  5063. '♥': 'Amour',
  5064. '&': 'et',
  5065. '|': 'ou',
  5066. '<': 'moins que',
  5067. '>': 'superieure a',
  5068. '∑': 'somme des',
  5069. '¤': 'monnaie'
  5070. },
  5071. 'ge': {
  5072. '∆': 'delta',
  5073. '∞': 'usasruloba',
  5074. '♥': 'siqvaruli',
  5075. '&': 'da',
  5076. '|': 'an',
  5077. '<': 'naklebi',
  5078. '>': 'meti',
  5079. '∑': 'jami',
  5080. '¤': 'valuta'
  5081. },
  5082. 'gr': {},
  5083. 'hu': {
  5084. '∆': 'delta',
  5085. '∞': 'vegtelen',
  5086. '♥': 'szerelem',
  5087. '&': 'es',
  5088. '|': 'vagy',
  5089. '<': 'kisebb mint',
  5090. '>': 'nagyobb mint',
  5091. '∑': 'szumma',
  5092. '¤': 'penznem'
  5093. },
  5094. 'it': {
  5095. '∆': 'delta',
  5096. '∞': 'infinito',
  5097. '♥': 'amore',
  5098. '&': 'e',
  5099. '|': 'o',
  5100. '<': 'minore di',
  5101. '>': 'maggiore di',
  5102. '∑': 'somma',
  5103. '¤': 'moneta'
  5104. },
  5105. 'lt': {
  5106. '∆': 'delta',
  5107. '∞': 'begalybe',
  5108. '♥': 'meile',
  5109. '&': 'ir',
  5110. '|': 'ar',
  5111. '<': 'maziau nei',
  5112. '>': 'daugiau nei',
  5113. '∑': 'suma',
  5114. '¤': 'valiuta'
  5115. },
  5116. 'lv': {
  5117. '∆': 'delta',
  5118. '∞': 'bezgaliba',
  5119. '♥': 'milestiba',
  5120. '&': 'un',
  5121. '|': 'vai',
  5122. '<': 'mazak neka',
  5123. '>': 'lielaks neka',
  5124. '∑': 'summa',
  5125. '¤': 'valuta'
  5126. },
  5127. 'my': {
  5128. '∆': 'kwahkhyaet',
  5129. '∞': 'asaonasme',
  5130. '♥': 'akhyait',
  5131. '&': 'nhin',
  5132. '|': 'tho',
  5133. '<': 'ngethaw',
  5134. '>': 'kyithaw',
  5135. '∑': 'paungld',
  5136. '¤': 'ngwekye'
  5137. },
  5138. 'mk': {},
  5139. 'nl': {
  5140. '∆': 'delta',
  5141. '∞': 'oneindig',
  5142. '♥': 'liefde',
  5143. '&': 'en',
  5144. '|': 'of',
  5145. '<': 'kleiner dan',
  5146. '>': 'groter dan',
  5147. '∑': 'som',
  5148. '¤': 'valuta'
  5149. },
  5150. 'pl': {
  5151. '∆': 'delta',
  5152. '∞': 'nieskonczonosc',
  5153. '♥': 'milosc',
  5154. '&': 'i',
  5155. '|': 'lub',
  5156. '<': 'mniejsze niz',
  5157. '>': 'wieksze niz',
  5158. '∑': 'suma',
  5159. '¤': 'waluta'
  5160. },
  5161. 'pt': {
  5162. '∆': 'delta',
  5163. '∞': 'infinito',
  5164. '♥': 'amor',
  5165. '&': 'e',
  5166. '|': 'ou',
  5167. '<': 'menor que',
  5168. '>': 'maior que',
  5169. '∑': 'soma',
  5170. '¤': 'moeda'
  5171. },
  5172. 'ro': {
  5173. '∆': 'delta',
  5174. '∞': 'infinit',
  5175. '♥': 'dragoste',
  5176. '&': 'si',
  5177. '|': 'sau',
  5178. '<': 'mai mic ca',
  5179. '>': 'mai mare ca',
  5180. '∑': 'suma',
  5181. '¤': 'valuta'
  5182. },
  5183. 'ru': {
  5184. '∆': 'delta',
  5185. '∞': 'beskonechno',
  5186. '♥': 'lubov',
  5187. '&': 'i',
  5188. '|': 'ili',
  5189. '<': 'menshe',
  5190. '>': 'bolshe',
  5191. '∑': 'summa',
  5192. '¤': 'valjuta'
  5193. },
  5194. 'sk': {
  5195. '∆': 'delta',
  5196. '∞': 'nekonecno',
  5197. '♥': 'laska',
  5198. '&': 'a',
  5199. '|': 'alebo',
  5200. '<': 'menej ako',
  5201. '>': 'viac ako',
  5202. '∑': 'sucet',
  5203. '¤': 'mena'
  5204. },
  5205. 'sr': {},
  5206. 'tr': {
  5207. '∆': 'delta',
  5208. '∞': 'sonsuzluk',
  5209. '♥': 'ask',
  5210. '&': 've',
  5211. '|': 'veya',
  5212. '<': 'kucuktur',
  5213. '>': 'buyuktur',
  5214. '∑': 'toplam',
  5215. '¤': 'para birimi'
  5216. },
  5217. 'uk': {
  5218. '∆': 'delta',
  5219. '∞': 'bezkinechnist',
  5220. '♥': 'lubov',
  5221. '&': 'i',
  5222. '|': 'abo',
  5223. '<': 'menshe',
  5224. '>': 'bilshe',
  5225. '∑': 'suma',
  5226. '¤': 'valjuta'
  5227. },
  5228. 'vn': {
  5229. '∆': 'delta',
  5230. '∞': 'vo cuc',
  5231. '♥': 'yeu',
  5232. '&': 'va',
  5233. '|': 'hoac',
  5234. '<': 'nho hon',
  5235. '>': 'lon hon',
  5236. '∑': 'tong',
  5237. '¤': 'tien te'
  5238. }
  5239. };
  5240. var uricChars = [';', '?', ':', '@', '&', '=', '+', '$', ',', '/'].join('');
  5241. var uricNoSlashChars = [';', '?', ':', '@', '&', '=', '+', '$', ','].join('');
  5242. var markChars = ['.', '!', '~', '*', "'", '(', ')'].join('');
  5243. /**
  5244. * getSlug
  5245. * @param {string} input input string
  5246. * @param {object|string} opts config object or separator string/char
  5247. * @api public
  5248. * @return {string} sluggified string
  5249. */
  5250. var getSlug = function getSlug(input, opts) {
  5251. var separator = '-';
  5252. var result = '';
  5253. var diatricString = '';
  5254. var convertSymbols = true;
  5255. var customReplacements = {};
  5256. var maintainCase;
  5257. var titleCase;
  5258. var truncate;
  5259. var uricFlag;
  5260. var uricNoSlashFlag;
  5261. var markFlag;
  5262. var symbol;
  5263. var langChar;
  5264. var lucky;
  5265. var i;
  5266. var ch;
  5267. var l;
  5268. var lastCharWasSymbol;
  5269. var lastCharWasDiatric;
  5270. var allowedChars = '';
  5271. if (typeof input !== 'string') {
  5272. return '';
  5273. }
  5274. if (typeof opts === 'string') {
  5275. separator = opts;
  5276. }
  5277. symbol = symbolMap.en;
  5278. langChar = langCharMap.en;
  5279. if (typeof opts === 'object') {
  5280. maintainCase = opts.maintainCase || false;
  5281. customReplacements = (opts.custom && typeof opts.custom === 'object') ? opts.custom : customReplacements;
  5282. truncate = (+opts.truncate > 1 && opts.truncate) || false;
  5283. uricFlag = opts.uric || false;
  5284. uricNoSlashFlag = opts.uricNoSlash || false;
  5285. markFlag = opts.mark || false;
  5286. convertSymbols = (opts.symbols === false || opts.lang === false) ? false : true;
  5287. separator = opts.separator || separator;
  5288. if (uricFlag) {
  5289. allowedChars += uricChars;
  5290. }
  5291. if (uricNoSlashFlag) {
  5292. allowedChars += uricNoSlashChars;
  5293. }
  5294. if (markFlag) {
  5295. allowedChars += markChars;
  5296. }
  5297. symbol = (opts.lang && symbolMap[opts.lang] && convertSymbols) ?
  5298. symbolMap[opts.lang] : (convertSymbols ? symbolMap.en : {});
  5299. langChar = (opts.lang && langCharMap[opts.lang]) ?
  5300. langCharMap[opts.lang] :
  5301. opts.lang === false || opts.lang === true ? {} : langCharMap.en;
  5302. // if titleCase config is an Array, rewrite to object format
  5303. if (opts.titleCase && typeof opts.titleCase.length === 'number' && Array.prototype.toString.call(opts.titleCase)) {
  5304. opts.titleCase.forEach(function (v) {
  5305. customReplacements[v + ''] = v + '';
  5306. });
  5307. titleCase = true;
  5308. } else {
  5309. titleCase = !!opts.titleCase;
  5310. }
  5311. // if custom config is an Array, rewrite to object format
  5312. if (opts.custom && typeof opts.custom.length === 'number' && Array.prototype.toString.call(opts.custom)) {
  5313. opts.custom.forEach(function (v) {
  5314. customReplacements[v + ''] = v + '';
  5315. });
  5316. }
  5317. // custom replacements
  5318. Object.keys(customReplacements).forEach(function (v) {
  5319. var r;
  5320. if (v.length > 1) {
  5321. r = new RegExp('\\b' + escapeChars(v) + '\\b', 'gi');
  5322. } else {
  5323. r = new RegExp(escapeChars(v), 'gi');
  5324. }
  5325. input = input.replace(r, customReplacements[v]);
  5326. });
  5327. // add all custom replacement to allowed charlist
  5328. for (ch in customReplacements) {
  5329. allowedChars += ch;
  5330. }
  5331. }
  5332. allowedChars += separator;
  5333. // escape all necessary chars
  5334. allowedChars = escapeChars(allowedChars);
  5335. // trim whitespaces
  5336. input = input.replace(/(^\s+|\s+$)/g, '');
  5337. lastCharWasSymbol = false;
  5338. lastCharWasDiatric = false;
  5339. for (i = 0, l = input.length; i < l; i++) {
  5340. ch = input[i];
  5341. if (isReplacedCustomChar(ch, customReplacements)) {
  5342. // don't convert a already converted char
  5343. lastCharWasSymbol = false;
  5344. } else if (langChar[ch]) {
  5345. // process language specific diactrics chars conversion
  5346. ch = lastCharWasSymbol && langChar[ch].match(/[A-Za-z0-9]/) ? ' ' + langChar[ch] : langChar[ch];
  5347. lastCharWasSymbol = false;
  5348. } else if (ch in charMap) {
  5349. // the transliteration changes entirely when some special characters are added
  5350. if (i + 1 < l && lookAheadCharArray.indexOf(input[i + 1]) >= 0) {
  5351. diatricString += ch;
  5352. ch = '';
  5353. } else if (lastCharWasDiatric === true) {
  5354. ch = diatricMap[diatricString] + charMap[ch];
  5355. diatricString = '';
  5356. } else {
  5357. // process diactrics chars
  5358. ch = lastCharWasSymbol && charMap[ch].match(/[A-Za-z0-9]/) ? ' ' + charMap[ch] : charMap[ch];
  5359. }
  5360. lastCharWasSymbol = false;
  5361. lastCharWasDiatric = false;
  5362. } else if (ch in diatricMap) {
  5363. diatricString += ch;
  5364. ch = '';
  5365. // end of string, put the whole meaningful word
  5366. if (i === l - 1) {
  5367. ch = diatricMap[diatricString];
  5368. }
  5369. lastCharWasDiatric = true;
  5370. } else if (
  5371. // process symbol chars
  5372. symbol[ch] && !(uricFlag && uricChars
  5373. .indexOf(ch) !== -1) && !(uricNoSlashFlag && uricNoSlashChars
  5374. // .indexOf(ch) !== -1) && !(markFlag && markChars
  5375. .indexOf(ch) !== -1)) {
  5376. ch = lastCharWasSymbol || result.substr(-1).match(/[A-Za-z0-9]/) ? separator + symbol[ch] : symbol[ch];
  5377. ch += input[i + 1] !== void 0 && input[i + 1].match(/[A-Za-z0-9]/) ? separator : '';
  5378. lastCharWasSymbol = true;
  5379. } else {
  5380. if (lastCharWasDiatric === true) {
  5381. ch = diatricMap[diatricString] + ch;
  5382. diatricString = '';
  5383. lastCharWasDiatric = false;
  5384. } else if (lastCharWasSymbol && (/[A-Za-z0-9]/.test(ch) || result.substr(-1).match(/A-Za-z0-9]/))) {
  5385. // process latin chars
  5386. ch = ' ' + ch;
  5387. }
  5388. lastCharWasSymbol = false;
  5389. }
  5390. // add allowed chars
  5391. result += ch.replace(new RegExp('[^\\w\\s' + allowedChars + '_-]', 'g'), separator);
  5392. }
  5393. if (titleCase) {
  5394. result = result.replace(/(\w)(\S*)/g, function (_, i, r) {
  5395. var j = i.toUpperCase() + (r !== null ? r : '');
  5396. return (Object.keys(customReplacements).indexOf(j.toLowerCase()) < 0) ? j : j.toLowerCase();
  5397. });
  5398. }
  5399. // eliminate duplicate separators
  5400. // add separator
  5401. // trim separators from start and end
  5402. result = result.replace(/\s+/g, separator)
  5403. .replace(new RegExp('\\' + separator + '+', 'g'), separator)
  5404. .replace(new RegExp('(^\\' + separator + '+|\\' + separator + '+$)', 'g'), '');
  5405. if (truncate && result.length > truncate) {
  5406. lucky = result.charAt(truncate) === separator;
  5407. result = result.slice(0, truncate);
  5408. if (!lucky) {
  5409. result = result.slice(0, result.lastIndexOf(separator));
  5410. }
  5411. }
  5412. if (!maintainCase && !titleCase) {
  5413. result = result.toLowerCase();
  5414. }
  5415. return result;
  5416. };
  5417. /**
  5418. * createSlug curried(opts)(input)
  5419. * @param {object|string} opts config object or input string
  5420. * @return {Function} function getSlugWithConfig()
  5421. **/
  5422. var createSlug = function createSlug(opts) {
  5423. /**
  5424. * getSlugWithConfig
  5425. * @param {string} input string
  5426. * @return {string} slug string
  5427. */
  5428. return function getSlugWithConfig(input) {
  5429. return getSlug(input, opts);
  5430. };
  5431. };
  5432. /**
  5433. * escape Chars
  5434. * @param {string} input string
  5435. */
  5436. var escapeChars = function escapeChars(input) {
  5437. return input.replace(/[-\\^$*+?.()|[\]{}\/]/g, '\\$&');
  5438. };
  5439. /**
  5440. * check if the char is an already converted char from custom list
  5441. * @param {char} ch character to check
  5442. * @param {object} customReplacements custom translation map
  5443. */
  5444. var isReplacedCustomChar = function (ch, customReplacements) {
  5445. for (var c in customReplacements) {
  5446. if (customReplacements[c] === ch) {
  5447. return true;
  5448. }
  5449. }
  5450. };
  5451. if ('object' !== 'undefined' && module.exports) {
  5452. // export functions for use in Node
  5453. module.exports = getSlug;
  5454. module.exports.createSlug = createSlug;
  5455. } else if (typeof undefined !== 'undefined' && undefined.amd) {
  5456. // export function for use in AMD
  5457. undefined([], function () {
  5458. return getSlug;
  5459. });
  5460. } else {
  5461. // don't overwrite global if exists
  5462. try {
  5463. if (root.getSlug || root.createSlug) {
  5464. throw 'speakingurl: globals exists /(getSlug|createSlug)/';
  5465. } else {
  5466. root.getSlug = getSlug;
  5467. root.createSlug = createSlug;
  5468. }
  5469. } catch (e) {}
  5470. }
  5471. })(commonjsGlobal);
  5472. });
  5473. var speakingurl_1 = speakingurl.createSlug;
  5474. var speakingurl$1 = speakingurl;
  5475. var urlJoin = createCommonjsModule(function (module) {
  5476. (function (name, context, definition) {
  5477. if ('object' !== 'undefined' && module.exports) module.exports = definition();
  5478. else if (typeof undefined === 'function' && undefined.amd) undefined(definition);
  5479. else context[name] = definition();
  5480. })('urljoin', commonjsGlobal, function () {
  5481. function normalize (strArray) {
  5482. var resultArray = [];
  5483. if (strArray.length === 0) { return ''; }
  5484. if (typeof strArray[0] !== 'string') {
  5485. throw new TypeError('Url must be a string. Received ' + strArray[0]);
  5486. }
  5487. // If the first part is a plain protocol, we combine it with the next part.
  5488. if (strArray[0].match(/^[^/:]+:\/*$/) && strArray.length > 1) {
  5489. var first = strArray.shift();
  5490. strArray[0] = first + strArray[0];
  5491. }
  5492. // There must be two or three slashes in the file protocol, two slashes in anything else.
  5493. if (strArray[0].match(/^file:\/\/\//)) {
  5494. strArray[0] = strArray[0].replace(/^([^/:]+):\/*/, '$1:///');
  5495. } else {
  5496. strArray[0] = strArray[0].replace(/^([^/:]+):\/*/, '$1://');
  5497. }
  5498. for (var i = 0; i < strArray.length; i++) {
  5499. var component = strArray[i];
  5500. if (typeof component !== 'string') {
  5501. throw new TypeError('Url must be a string. Received ' + component);
  5502. }
  5503. if (component === '') { continue; }
  5504. if (i > 0) {
  5505. // Removing the starting slashes for each component but the first.
  5506. component = component.replace(/^[\/]+/, '');
  5507. }
  5508. if (i < strArray.length - 1) {
  5509. // Removing the ending slashes for each component but the last.
  5510. component = component.replace(/[\/]+$/, '');
  5511. } else {
  5512. // For the last component we will combine multiple slashes to a single one.
  5513. component = component.replace(/[\/]+$/, '/');
  5514. }
  5515. resultArray.push(component);
  5516. }
  5517. var str = resultArray.join('/');
  5518. // Each input component is now separated by a single slash except the possible first plain protocol part.
  5519. // remove trailing slash before parameters or hash
  5520. str = str.replace(/\/(\?|&|#[^!])/g, '$1');
  5521. // replace ? in parameters with &
  5522. var parts = str.split('?');
  5523. str = parts.shift() + (parts.length > 0 ? '?': '') + parts.join('&');
  5524. return str;
  5525. }
  5526. return function () {
  5527. var input;
  5528. if (typeof arguments[0] === 'object') {
  5529. input = arguments[0];
  5530. } else {
  5531. input = [].slice.call(arguments);
  5532. }
  5533. return normalize(input);
  5534. };
  5535. });
  5536. });
  5537. var uritemplate = createCommonjsModule(function (module) {
  5538. /*global unescape, module, define, window, global*/
  5539. /*
  5540. UriTemplate Copyright (c) 2012-2013 Franz Antesberger. All Rights Reserved.
  5541. Available via the MIT license.
  5542. */
  5543. (function (exportCallback) {
  5544. "use strict";
  5545. var UriTemplateError = (function () {
  5546. function UriTemplateError (options) {
  5547. this.options = options;
  5548. }
  5549. UriTemplateError.prototype.toString = function () {
  5550. if (JSON && JSON.stringify) {
  5551. return JSON.stringify(this.options);
  5552. }
  5553. else {
  5554. return this.options;
  5555. }
  5556. };
  5557. return UriTemplateError;
  5558. }());
  5559. var objectHelper = (function () {
  5560. function isArray (value) {
  5561. return Object.prototype.toString.apply(value) === '[object Array]';
  5562. }
  5563. function isString (value) {
  5564. return Object.prototype.toString.apply(value) === '[object String]';
  5565. }
  5566. function isNumber (value) {
  5567. return Object.prototype.toString.apply(value) === '[object Number]';
  5568. }
  5569. function isBoolean (value) {
  5570. return Object.prototype.toString.apply(value) === '[object Boolean]';
  5571. }
  5572. function join (arr, separator) {
  5573. var
  5574. result = '',
  5575. first = true,
  5576. index;
  5577. for (index = 0; index < arr.length; index += 1) {
  5578. if (first) {
  5579. first = false;
  5580. }
  5581. else {
  5582. result += separator;
  5583. }
  5584. result += arr[index];
  5585. }
  5586. return result;
  5587. }
  5588. function map (arr, mapper) {
  5589. var
  5590. result = [],
  5591. index = 0;
  5592. for (; index < arr.length; index += 1) {
  5593. result.push(mapper(arr[index]));
  5594. }
  5595. return result;
  5596. }
  5597. function filter (arr, predicate) {
  5598. var
  5599. result = [],
  5600. index = 0;
  5601. for (; index < arr.length; index += 1) {
  5602. if (predicate(arr[index])) {
  5603. result.push(arr[index]);
  5604. }
  5605. }
  5606. return result;
  5607. }
  5608. function deepFreezeUsingObjectFreeze (object) {
  5609. if (typeof object !== "object" || object === null) {
  5610. return object;
  5611. }
  5612. Object.freeze(object);
  5613. var property, propertyName;
  5614. for (propertyName in object) {
  5615. if (object.hasOwnProperty(propertyName)) {
  5616. property = object[propertyName];
  5617. // be aware, arrays are 'object', too
  5618. if (typeof property === "object") {
  5619. deepFreeze(property);
  5620. }
  5621. }
  5622. }
  5623. return object;
  5624. }
  5625. function deepFreeze (object) {
  5626. if (typeof Object.freeze === 'function') {
  5627. return deepFreezeUsingObjectFreeze(object);
  5628. }
  5629. return object;
  5630. }
  5631. return {
  5632. isArray: isArray,
  5633. isString: isString,
  5634. isNumber: isNumber,
  5635. isBoolean: isBoolean,
  5636. join: join,
  5637. map: map,
  5638. filter: filter,
  5639. deepFreeze: deepFreeze
  5640. };
  5641. }());
  5642. var charHelper = (function () {
  5643. function isAlpha (chr) {
  5644. return (chr >= 'a' && chr <= 'z') || ((chr >= 'A' && chr <= 'Z'));
  5645. }
  5646. function isDigit (chr) {
  5647. return chr >= '0' && chr <= '9';
  5648. }
  5649. function isHexDigit (chr) {
  5650. return isDigit(chr) || (chr >= 'a' && chr <= 'f') || (chr >= 'A' && chr <= 'F');
  5651. }
  5652. return {
  5653. isAlpha: isAlpha,
  5654. isDigit: isDigit,
  5655. isHexDigit: isHexDigit
  5656. };
  5657. }());
  5658. var pctEncoder = (function () {
  5659. var utf8 = {
  5660. encode: function (chr) {
  5661. // see http://ecmanaut.blogspot.de/2006/07/encoding-decoding-utf8-in-javascript.html
  5662. return unescape(encodeURIComponent(chr));
  5663. },
  5664. numBytes: function (firstCharCode) {
  5665. if (firstCharCode <= 0x7F) {
  5666. return 1;
  5667. }
  5668. else if (0xC2 <= firstCharCode && firstCharCode <= 0xDF) {
  5669. return 2;
  5670. }
  5671. else if (0xE0 <= firstCharCode && firstCharCode <= 0xEF) {
  5672. return 3;
  5673. }
  5674. else if (0xF0 <= firstCharCode && firstCharCode <= 0xF4) {
  5675. return 4;
  5676. }
  5677. // no valid first octet
  5678. return 0;
  5679. },
  5680. isValidFollowingCharCode: function (charCode) {
  5681. return 0x80 <= charCode && charCode <= 0xBF;
  5682. }
  5683. };
  5684. /**
  5685. * encodes a character, if needed or not.
  5686. * @param chr
  5687. * @return pct-encoded character
  5688. */
  5689. function encodeCharacter (chr) {
  5690. var
  5691. result = '',
  5692. octets = utf8.encode(chr),
  5693. octet,
  5694. index;
  5695. for (index = 0; index < octets.length; index += 1) {
  5696. octet = octets.charCodeAt(index);
  5697. result += '%' + (octet < 0x10 ? '0' : '') + octet.toString(16).toUpperCase();
  5698. }
  5699. return result;
  5700. }
  5701. /**
  5702. * Returns, whether the given text at start is in the form 'percent hex-digit hex-digit', like '%3F'
  5703. * @param text
  5704. * @param start
  5705. * @return {boolean|*|*}
  5706. */
  5707. function isPercentDigitDigit (text, start) {
  5708. return text.charAt(start) === '%' && charHelper.isHexDigit(text.charAt(start + 1)) && charHelper.isHexDigit(text.charAt(start + 2));
  5709. }
  5710. /**
  5711. * Parses a hex number from start with length 2.
  5712. * @param text a string
  5713. * @param start the start index of the 2-digit hex number
  5714. * @return {Number}
  5715. */
  5716. function parseHex2 (text, start) {
  5717. return parseInt(text.substr(start, 2), 16);
  5718. }
  5719. /**
  5720. * Returns whether or not the given char sequence is a correctly pct-encoded sequence.
  5721. * @param chr
  5722. * @return {boolean}
  5723. */
  5724. function isPctEncoded (chr) {
  5725. if (!isPercentDigitDigit(chr, 0)) {
  5726. return false;
  5727. }
  5728. var firstCharCode = parseHex2(chr, 1);
  5729. var numBytes = utf8.numBytes(firstCharCode);
  5730. if (numBytes === 0) {
  5731. return false;
  5732. }
  5733. for (var byteNumber = 1; byteNumber < numBytes; byteNumber += 1) {
  5734. if (!isPercentDigitDigit(chr, 3*byteNumber) || !utf8.isValidFollowingCharCode(parseHex2(chr, 3*byteNumber + 1))) {
  5735. return false;
  5736. }
  5737. }
  5738. return true;
  5739. }
  5740. /**
  5741. * Reads as much as needed from the text, e.g. '%20' or '%C3%B6'. It does not decode!
  5742. * @param text
  5743. * @param startIndex
  5744. * @return the character or pct-string of the text at startIndex
  5745. */
  5746. function pctCharAt(text, startIndex) {
  5747. var chr = text.charAt(startIndex);
  5748. if (!isPercentDigitDigit(text, startIndex)) {
  5749. return chr;
  5750. }
  5751. var utf8CharCode = parseHex2(text, startIndex + 1);
  5752. var numBytes = utf8.numBytes(utf8CharCode);
  5753. if (numBytes === 0) {
  5754. return chr;
  5755. }
  5756. for (var byteNumber = 1; byteNumber < numBytes; byteNumber += 1) {
  5757. if (!isPercentDigitDigit(text, startIndex + 3 * byteNumber) || !utf8.isValidFollowingCharCode(parseHex2(text, startIndex + 3 * byteNumber + 1))) {
  5758. return chr;
  5759. }
  5760. }
  5761. return text.substr(startIndex, 3 * numBytes);
  5762. }
  5763. return {
  5764. encodeCharacter: encodeCharacter,
  5765. isPctEncoded: isPctEncoded,
  5766. pctCharAt: pctCharAt
  5767. };
  5768. }());
  5769. var rfcCharHelper = (function () {
  5770. /**
  5771. * Returns if an character is an varchar character according 2.3 of rfc 6570
  5772. * @param chr
  5773. * @return (Boolean)
  5774. */
  5775. function isVarchar (chr) {
  5776. return charHelper.isAlpha(chr) || charHelper.isDigit(chr) || chr === '_' || pctEncoder.isPctEncoded(chr);
  5777. }
  5778. /**
  5779. * Returns if chr is an unreserved character according 1.5 of rfc 6570
  5780. * @param chr
  5781. * @return {Boolean}
  5782. */
  5783. function isUnreserved (chr) {
  5784. return charHelper.isAlpha(chr) || charHelper.isDigit(chr) || chr === '-' || chr === '.' || chr === '_' || chr === '~';
  5785. }
  5786. /**
  5787. * Returns if chr is an reserved character according 1.5 of rfc 6570
  5788. * or the percent character mentioned in 3.2.1.
  5789. * @param chr
  5790. * @return {Boolean}
  5791. */
  5792. function isReserved (chr) {
  5793. return chr === ':' || chr === '/' || chr === '?' || chr === '#' || chr === '[' || chr === ']' || chr === '@' || chr === '!' || chr === '$' || chr === '&' || chr === '(' ||
  5794. chr === ')' || chr === '*' || chr === '+' || chr === ',' || chr === ';' || chr === '=' || chr === "'";
  5795. }
  5796. return {
  5797. isVarchar: isVarchar,
  5798. isUnreserved: isUnreserved,
  5799. isReserved: isReserved
  5800. };
  5801. }());
  5802. /**
  5803. * encoding of rfc 6570
  5804. */
  5805. var encodingHelper = (function () {
  5806. function encode (text, passReserved) {
  5807. var
  5808. result = '',
  5809. index,
  5810. chr = '';
  5811. if (typeof text === "number" || typeof text === "boolean") {
  5812. text = text.toString();
  5813. }
  5814. for (index = 0; index < text.length; index += chr.length) {
  5815. chr = text.charAt(index);
  5816. result += rfcCharHelper.isUnreserved(chr) || (passReserved && rfcCharHelper.isReserved(chr)) ? chr : pctEncoder.encodeCharacter(chr);
  5817. }
  5818. return result;
  5819. }
  5820. function encodePassReserved (text) {
  5821. return encode(text, true);
  5822. }
  5823. function encodeLiteralCharacter (literal, index) {
  5824. var chr = pctEncoder.pctCharAt(literal, index);
  5825. if (chr.length > 1) {
  5826. return chr;
  5827. }
  5828. else {
  5829. return rfcCharHelper.isReserved(chr) || rfcCharHelper.isUnreserved(chr) ? chr : pctEncoder.encodeCharacter(chr);
  5830. }
  5831. }
  5832. function encodeLiteral (literal) {
  5833. var
  5834. result = '',
  5835. index,
  5836. chr = '';
  5837. for (index = 0; index < literal.length; index += chr.length) {
  5838. chr = pctEncoder.pctCharAt(literal, index);
  5839. if (chr.length > 1) {
  5840. result += chr;
  5841. }
  5842. else {
  5843. result += rfcCharHelper.isReserved(chr) || rfcCharHelper.isUnreserved(chr) ? chr : pctEncoder.encodeCharacter(chr);
  5844. }
  5845. }
  5846. return result;
  5847. }
  5848. return {
  5849. encode: encode,
  5850. encodePassReserved: encodePassReserved,
  5851. encodeLiteral: encodeLiteral,
  5852. encodeLiteralCharacter: encodeLiteralCharacter
  5853. };
  5854. }());
  5855. // the operators defined by rfc 6570
  5856. var operators = (function () {
  5857. var
  5858. bySymbol = {};
  5859. function create (symbol) {
  5860. bySymbol[symbol] = {
  5861. symbol: symbol,
  5862. separator: (symbol === '?') ? '&' : (symbol === '' || symbol === '+' || symbol === '#') ? ',' : symbol,
  5863. named: symbol === ';' || symbol === '&' || symbol === '?',
  5864. ifEmpty: (symbol === '&' || symbol === '?') ? '=' : '',
  5865. first: (symbol === '+' ) ? '' : symbol,
  5866. encode: (symbol === '+' || symbol === '#') ? encodingHelper.encodePassReserved : encodingHelper.encode,
  5867. toString: function () {
  5868. return this.symbol;
  5869. }
  5870. };
  5871. }
  5872. create('');
  5873. create('+');
  5874. create('#');
  5875. create('.');
  5876. create('/');
  5877. create(';');
  5878. create('?');
  5879. create('&');
  5880. return {
  5881. valueOf: function (chr) {
  5882. if (bySymbol[chr]) {
  5883. return bySymbol[chr];
  5884. }
  5885. if ("=,!@|".indexOf(chr) >= 0) {
  5886. return null;
  5887. }
  5888. return bySymbol[''];
  5889. }
  5890. };
  5891. }());
  5892. /**
  5893. * Detects, whether a given element is defined in the sense of rfc 6570
  5894. * Section 2.3 of the RFC makes clear defintions:
  5895. * * undefined and null are not defined.
  5896. * * the empty string is defined
  5897. * * an array ("list") is defined, if it is not empty (even if all elements are not defined)
  5898. * * an object ("map") is defined, if it contains at least one property with defined value
  5899. * @param object
  5900. * @return {Boolean}
  5901. */
  5902. function isDefined (object) {
  5903. var
  5904. propertyName;
  5905. if (object === null || object === undefined) {
  5906. return false;
  5907. }
  5908. if (objectHelper.isArray(object)) {
  5909. // Section 2.3: A variable defined as a list value is considered undefined if the list contains zero members
  5910. return object.length > 0;
  5911. }
  5912. if (typeof object === "string" || typeof object === "number" || typeof object === "boolean") {
  5913. // falsy values like empty strings, false or 0 are "defined"
  5914. return true;
  5915. }
  5916. // else Object
  5917. for (propertyName in object) {
  5918. if (object.hasOwnProperty(propertyName) && isDefined(object[propertyName])) {
  5919. return true;
  5920. }
  5921. }
  5922. return false;
  5923. }
  5924. var LiteralExpression = (function () {
  5925. function LiteralExpression (literal) {
  5926. this.literal = encodingHelper.encodeLiteral(literal);
  5927. }
  5928. LiteralExpression.prototype.expand = function () {
  5929. return this.literal;
  5930. };
  5931. LiteralExpression.prototype.toString = LiteralExpression.prototype.expand;
  5932. return LiteralExpression;
  5933. }());
  5934. var parse = (function () {
  5935. function parseExpression (expressionText) {
  5936. var
  5937. operator,
  5938. varspecs = [],
  5939. varspec = null,
  5940. varnameStart = null,
  5941. maxLengthStart = null,
  5942. index,
  5943. chr = '';
  5944. function closeVarname () {
  5945. var varname = expressionText.substring(varnameStart, index);
  5946. if (varname.length === 0) {
  5947. throw new UriTemplateError({expressionText: expressionText, message: "a varname must be specified", position: index});
  5948. }
  5949. varspec = {varname: varname, exploded: false, maxLength: null};
  5950. varnameStart = null;
  5951. }
  5952. function closeMaxLength () {
  5953. if (maxLengthStart === index) {
  5954. throw new UriTemplateError({expressionText: expressionText, message: "after a ':' you have to specify the length", position: index});
  5955. }
  5956. varspec.maxLength = parseInt(expressionText.substring(maxLengthStart, index), 10);
  5957. maxLengthStart = null;
  5958. }
  5959. operator = (function (operatorText) {
  5960. var op = operators.valueOf(operatorText);
  5961. if (op === null) {
  5962. throw new UriTemplateError({expressionText: expressionText, message: "illegal use of reserved operator", position: index, operator: operatorText});
  5963. }
  5964. return op;
  5965. }(expressionText.charAt(0)));
  5966. index = operator.symbol.length;
  5967. varnameStart = index;
  5968. for (; index < expressionText.length; index += chr.length) {
  5969. chr = pctEncoder.pctCharAt(expressionText, index);
  5970. if (varnameStart !== null) {
  5971. // the spec says: varname = varchar *( ["."] varchar )
  5972. // so a dot is allowed except for the first char
  5973. if (chr === '.') {
  5974. if (varnameStart === index) {
  5975. throw new UriTemplateError({expressionText: expressionText, message: "a varname MUST NOT start with a dot", position: index});
  5976. }
  5977. continue;
  5978. }
  5979. if (rfcCharHelper.isVarchar(chr)) {
  5980. continue;
  5981. }
  5982. closeVarname();
  5983. }
  5984. if (maxLengthStart !== null) {
  5985. if (index === maxLengthStart && chr === '0') {
  5986. throw new UriTemplateError({expressionText: expressionText, message: "A :prefix must not start with digit 0", position: index});
  5987. }
  5988. if (charHelper.isDigit(chr)) {
  5989. if (index - maxLengthStart >= 4) {
  5990. throw new UriTemplateError({expressionText: expressionText, message: "A :prefix must have max 4 digits", position: index});
  5991. }
  5992. continue;
  5993. }
  5994. closeMaxLength();
  5995. }
  5996. if (chr === ':') {
  5997. if (varspec.maxLength !== null) {
  5998. throw new UriTemplateError({expressionText: expressionText, message: "only one :maxLength is allowed per varspec", position: index});
  5999. }
  6000. if (varspec.exploded) {
  6001. throw new UriTemplateError({expressionText: expressionText, message: "an exploeded varspec MUST NOT be varspeced", position: index});
  6002. }
  6003. maxLengthStart = index + 1;
  6004. continue;
  6005. }
  6006. if (chr === '*') {
  6007. if (varspec === null) {
  6008. throw new UriTemplateError({expressionText: expressionText, message: "exploded without varspec", position: index});
  6009. }
  6010. if (varspec.exploded) {
  6011. throw new UriTemplateError({expressionText: expressionText, message: "exploded twice", position: index});
  6012. }
  6013. if (varspec.maxLength) {
  6014. throw new UriTemplateError({expressionText: expressionText, message: "an explode (*) MUST NOT follow to a prefix", position: index});
  6015. }
  6016. varspec.exploded = true;
  6017. continue;
  6018. }
  6019. // the only legal character now is the comma
  6020. if (chr === ',') {
  6021. varspecs.push(varspec);
  6022. varspec = null;
  6023. varnameStart = index + 1;
  6024. continue;
  6025. }
  6026. throw new UriTemplateError({expressionText: expressionText, message: "illegal character", character: chr, position: index});
  6027. } // for chr
  6028. if (varnameStart !== null) {
  6029. closeVarname();
  6030. }
  6031. if (maxLengthStart !== null) {
  6032. closeMaxLength();
  6033. }
  6034. varspecs.push(varspec);
  6035. return new VariableExpression(expressionText, operator, varspecs);
  6036. }
  6037. function parse (uriTemplateText) {
  6038. // assert filled string
  6039. var
  6040. index,
  6041. chr,
  6042. expressions = [],
  6043. braceOpenIndex = null,
  6044. literalStart = 0;
  6045. for (index = 0; index < uriTemplateText.length; index += 1) {
  6046. chr = uriTemplateText.charAt(index);
  6047. if (literalStart !== null) {
  6048. if (chr === '}') {
  6049. throw new UriTemplateError({templateText: uriTemplateText, message: "unopened brace closed", position: index});
  6050. }
  6051. if (chr === '{') {
  6052. if (literalStart < index) {
  6053. expressions.push(new LiteralExpression(uriTemplateText.substring(literalStart, index)));
  6054. }
  6055. literalStart = null;
  6056. braceOpenIndex = index;
  6057. }
  6058. continue;
  6059. }
  6060. if (braceOpenIndex !== null) {
  6061. // here just { is forbidden
  6062. if (chr === '{') {
  6063. throw new UriTemplateError({templateText: uriTemplateText, message: "brace already opened", position: index});
  6064. }
  6065. if (chr === '}') {
  6066. if (braceOpenIndex + 1 === index) {
  6067. throw new UriTemplateError({templateText: uriTemplateText, message: "empty braces", position: braceOpenIndex});
  6068. }
  6069. try {
  6070. expressions.push(parseExpression(uriTemplateText.substring(braceOpenIndex + 1, index)));
  6071. }
  6072. catch (error) {
  6073. if (error.prototype === UriTemplateError.prototype) {
  6074. throw new UriTemplateError({templateText: uriTemplateText, message: error.options.message, position: braceOpenIndex + error.options.position, details: error.options});
  6075. }
  6076. throw error;
  6077. }
  6078. braceOpenIndex = null;
  6079. literalStart = index + 1;
  6080. }
  6081. continue;
  6082. }
  6083. throw new Error('reached unreachable code');
  6084. }
  6085. if (braceOpenIndex !== null) {
  6086. throw new UriTemplateError({templateText: uriTemplateText, message: "unclosed brace", position: braceOpenIndex});
  6087. }
  6088. if (literalStart < uriTemplateText.length) {
  6089. expressions.push(new LiteralExpression(uriTemplateText.substr(literalStart)));
  6090. }
  6091. return new UriTemplate(uriTemplateText, expressions);
  6092. }
  6093. return parse;
  6094. }());
  6095. var VariableExpression = (function () {
  6096. // helper function if JSON is not available
  6097. function prettyPrint (value) {
  6098. return (JSON && JSON.stringify) ? JSON.stringify(value) : value;
  6099. }
  6100. function isEmpty (value) {
  6101. if (!isDefined(value)) {
  6102. return true;
  6103. }
  6104. if (objectHelper.isString(value)) {
  6105. return value === '';
  6106. }
  6107. if (objectHelper.isNumber(value) || objectHelper.isBoolean(value)) {
  6108. return false;
  6109. }
  6110. if (objectHelper.isArray(value)) {
  6111. return value.length === 0;
  6112. }
  6113. for (var propertyName in value) {
  6114. if (value.hasOwnProperty(propertyName)) {
  6115. return false;
  6116. }
  6117. }
  6118. return true;
  6119. }
  6120. function propertyArray (object) {
  6121. var
  6122. result = [],
  6123. propertyName;
  6124. for (propertyName in object) {
  6125. if (object.hasOwnProperty(propertyName)) {
  6126. result.push({name: propertyName, value: object[propertyName]});
  6127. }
  6128. }
  6129. return result;
  6130. }
  6131. function VariableExpression (templateText, operator, varspecs) {
  6132. this.templateText = templateText;
  6133. this.operator = operator;
  6134. this.varspecs = varspecs;
  6135. }
  6136. VariableExpression.prototype.toString = function () {
  6137. return this.templateText;
  6138. };
  6139. function expandSimpleValue(varspec, operator, value) {
  6140. var result = '';
  6141. value = value.toString();
  6142. if (operator.named) {
  6143. result += encodingHelper.encodeLiteral(varspec.varname);
  6144. if (value === '') {
  6145. result += operator.ifEmpty;
  6146. return result;
  6147. }
  6148. result += '=';
  6149. }
  6150. if (varspec.maxLength !== null) {
  6151. value = value.substr(0, varspec.maxLength);
  6152. }
  6153. result += operator.encode(value);
  6154. return result;
  6155. }
  6156. function valueDefined (nameValue) {
  6157. return isDefined(nameValue.value);
  6158. }
  6159. function expandNotExploded(varspec, operator, value) {
  6160. var
  6161. arr = [],
  6162. result = '';
  6163. if (operator.named) {
  6164. result += encodingHelper.encodeLiteral(varspec.varname);
  6165. if (isEmpty(value)) {
  6166. result += operator.ifEmpty;
  6167. return result;
  6168. }
  6169. result += '=';
  6170. }
  6171. if (objectHelper.isArray(value)) {
  6172. arr = value;
  6173. arr = objectHelper.filter(arr, isDefined);
  6174. arr = objectHelper.map(arr, operator.encode);
  6175. result += objectHelper.join(arr, ',');
  6176. }
  6177. else {
  6178. arr = propertyArray(value);
  6179. arr = objectHelper.filter(arr, valueDefined);
  6180. arr = objectHelper.map(arr, function (nameValue) {
  6181. return operator.encode(nameValue.name) + ',' + operator.encode(nameValue.value);
  6182. });
  6183. result += objectHelper.join(arr, ',');
  6184. }
  6185. return result;
  6186. }
  6187. function expandExplodedNamed (varspec, operator, value) {
  6188. var
  6189. isArray = objectHelper.isArray(value),
  6190. arr = [];
  6191. if (isArray) {
  6192. arr = value;
  6193. arr = objectHelper.filter(arr, isDefined);
  6194. arr = objectHelper.map(arr, function (listElement) {
  6195. var tmp = encodingHelper.encodeLiteral(varspec.varname);
  6196. if (isEmpty(listElement)) {
  6197. tmp += operator.ifEmpty;
  6198. }
  6199. else {
  6200. tmp += '=' + operator.encode(listElement);
  6201. }
  6202. return tmp;
  6203. });
  6204. }
  6205. else {
  6206. arr = propertyArray(value);
  6207. arr = objectHelper.filter(arr, valueDefined);
  6208. arr = objectHelper.map(arr, function (nameValue) {
  6209. var tmp = encodingHelper.encodeLiteral(nameValue.name);
  6210. if (isEmpty(nameValue.value)) {
  6211. tmp += operator.ifEmpty;
  6212. }
  6213. else {
  6214. tmp += '=' + operator.encode(nameValue.value);
  6215. }
  6216. return tmp;
  6217. });
  6218. }
  6219. return objectHelper.join(arr, operator.separator);
  6220. }
  6221. function expandExplodedUnnamed (operator, value) {
  6222. var
  6223. arr = [],
  6224. result = '';
  6225. if (objectHelper.isArray(value)) {
  6226. arr = value;
  6227. arr = objectHelper.filter(arr, isDefined);
  6228. arr = objectHelper.map(arr, operator.encode);
  6229. result += objectHelper.join(arr, operator.separator);
  6230. }
  6231. else {
  6232. arr = propertyArray(value);
  6233. arr = objectHelper.filter(arr, function (nameValue) {
  6234. return isDefined(nameValue.value);
  6235. });
  6236. arr = objectHelper.map(arr, function (nameValue) {
  6237. return operator.encode(nameValue.name) + '=' + operator.encode(nameValue.value);
  6238. });
  6239. result += objectHelper.join(arr, operator.separator);
  6240. }
  6241. return result;
  6242. }
  6243. VariableExpression.prototype.expand = function (variables) {
  6244. var
  6245. expanded = [],
  6246. index,
  6247. varspec,
  6248. value,
  6249. valueIsArr,
  6250. oneExploded = false,
  6251. operator = this.operator;
  6252. // expand each varspec and join with operator's separator
  6253. for (index = 0; index < this.varspecs.length; index += 1) {
  6254. varspec = this.varspecs[index];
  6255. value = variables[varspec.varname];
  6256. // if (!isDefined(value)) {
  6257. // if (variables.hasOwnProperty(varspec.name)) {
  6258. if (value === null || value === undefined) {
  6259. continue;
  6260. }
  6261. if (varspec.exploded) {
  6262. oneExploded = true;
  6263. }
  6264. valueIsArr = objectHelper.isArray(value);
  6265. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  6266. expanded.push(expandSimpleValue(varspec, operator, value));
  6267. }
  6268. else if (varspec.maxLength && isDefined(value)) {
  6269. // 2.4.1 of the spec says: "Prefix modifiers are not applicable to variables that have composite values."
  6270. throw new Error('Prefix modifiers are not applicable to variables that have composite values. You tried to expand ' + this + " with " + prettyPrint(value));
  6271. }
  6272. else if (!varspec.exploded) {
  6273. if (operator.named || !isEmpty(value)) {
  6274. expanded.push(expandNotExploded(varspec, operator, value));
  6275. }
  6276. }
  6277. else if (isDefined(value)) {
  6278. if (operator.named) {
  6279. expanded.push(expandExplodedNamed(varspec, operator, value));
  6280. }
  6281. else {
  6282. expanded.push(expandExplodedUnnamed(operator, value));
  6283. }
  6284. }
  6285. }
  6286. if (expanded.length === 0) {
  6287. return "";
  6288. }
  6289. else {
  6290. return operator.first + objectHelper.join(expanded, operator.separator);
  6291. }
  6292. };
  6293. return VariableExpression;
  6294. }());
  6295. var UriTemplate = (function () {
  6296. function UriTemplate (templateText, expressions) {
  6297. this.templateText = templateText;
  6298. this.expressions = expressions;
  6299. objectHelper.deepFreeze(this);
  6300. }
  6301. UriTemplate.prototype.toString = function () {
  6302. return this.templateText;
  6303. };
  6304. UriTemplate.prototype.expand = function (variables) {
  6305. // this.expressions.map(function (expression) {return expression.expand(variables);}).join('');
  6306. var
  6307. index,
  6308. result = '';
  6309. for (index = 0; index < this.expressions.length; index += 1) {
  6310. result += this.expressions[index].expand(variables);
  6311. }
  6312. return result;
  6313. };
  6314. UriTemplate.parse = parse;
  6315. UriTemplate.UriTemplateError = UriTemplateError;
  6316. return UriTemplate;
  6317. }());
  6318. exportCallback(UriTemplate);
  6319. }(function (UriTemplate) {
  6320. "use strict";
  6321. // export UriTemplate, when module is present, or pass it to window or global
  6322. if ('object' !== "undefined") {
  6323. module.exports = UriTemplate;
  6324. }
  6325. else if (typeof undefined === "function") {
  6326. undefined([],function() {
  6327. return UriTemplate;
  6328. });
  6329. }
  6330. else if (typeof window !== "undefined") {
  6331. window.UriTemplate = UriTemplate;
  6332. }
  6333. else {
  6334. commonjsGlobal.UriTemplate = UriTemplate;
  6335. }
  6336. }
  6337. ));
  6338. });
  6339. var store2 = createCommonjsModule(function (module) {
  6340. /*! store2 - v2.10.0 - 2019-09-27
  6341. * Copyright (c) 2019 Nathan Bubna; Licensed (MIT OR GPL-3.0) */
  6342. ;(function(window, define) {
  6343. var _ = {
  6344. version: "2.10.0",
  6345. areas: {},
  6346. apis: {},
  6347. // utilities
  6348. inherit: function(api, o) {
  6349. for (var p in api) {
  6350. if (!o.hasOwnProperty(p)) {
  6351. Object.defineProperty(o, p, Object.getOwnPropertyDescriptor(api, p));
  6352. }
  6353. }
  6354. return o;
  6355. },
  6356. stringify: function(d) {
  6357. return d === undefined || typeof d === "function" ? d+'' : JSON.stringify(d);
  6358. },
  6359. parse: function(s) {
  6360. // if it doesn't parse, return as is
  6361. try{ return JSON.parse(s); }catch(e){ return s; }
  6362. },
  6363. // extension hooks
  6364. fn: function(name, fn) {
  6365. _.storeAPI[name] = fn;
  6366. for (var api in _.apis) {
  6367. _.apis[api][name] = fn;
  6368. }
  6369. },
  6370. get: function(area, key){ return area.getItem(key); },
  6371. set: function(area, key, string){ area.setItem(key, string); },
  6372. remove: function(area, key){ area.removeItem(key); },
  6373. key: function(area, i){ return area.key(i); },
  6374. length: function(area){ return area.length; },
  6375. clear: function(area){ area.clear(); },
  6376. // core functions
  6377. Store: function(id, area, namespace) {
  6378. var store = _.inherit(_.storeAPI, function(key, data, overwrite) {
  6379. if (arguments.length === 0){ return store.getAll(); }
  6380. if (typeof data === "function"){ return store.transact(key, data, overwrite); }// fn=data, alt=overwrite
  6381. if (data !== undefined){ return store.set(key, data, overwrite); }
  6382. if (typeof key === "string" || typeof key === "number"){ return store.get(key); }
  6383. if (typeof key === "function"){ return store.each(key); }
  6384. if (!key){ return store.clear(); }
  6385. return store.setAll(key, data);// overwrite=data, data=key
  6386. });
  6387. store._id = id;
  6388. try {
  6389. var testKey = '_-bad-_';
  6390. area.setItem(testKey, 'wolf');
  6391. store._area = area;
  6392. area.removeItem(testKey);
  6393. } catch (e) {}
  6394. if (!store._area) {
  6395. store._area = _.storage('fake');
  6396. }
  6397. store._ns = namespace || '';
  6398. if (!_.areas[id]) {
  6399. _.areas[id] = store._area;
  6400. }
  6401. if (!_.apis[store._ns+store._id]) {
  6402. _.apis[store._ns+store._id] = store;
  6403. }
  6404. return store;
  6405. },
  6406. storeAPI: {
  6407. // admin functions
  6408. area: function(id, area) {
  6409. var store = this[id];
  6410. if (!store || !store.area) {
  6411. store = _.Store(id, area, this._ns);//new area-specific api in this namespace
  6412. if (!this[id]){ this[id] = store; }
  6413. }
  6414. return store;
  6415. },
  6416. namespace: function(namespace, singleArea) {
  6417. if (!namespace){
  6418. return this._ns ? this._ns.substring(0,this._ns.length-1) : '';
  6419. }
  6420. var ns = namespace, store = this[ns];
  6421. if (!store || !store.namespace) {
  6422. store = _.Store(this._id, this._area, this._ns+ns+'.');//new namespaced api
  6423. if (!this[ns]){ this[ns] = store; }
  6424. if (!singleArea) {
  6425. for (var name in _.areas) {
  6426. store.area(name, _.areas[name]);
  6427. }
  6428. }
  6429. }
  6430. return store;
  6431. },
  6432. isFake: function(){ return this._area.name === 'fake'; },
  6433. toString: function() {
  6434. return 'store'+(this._ns?'.'+this.namespace():'')+'['+this._id+']';
  6435. },
  6436. // storage functions
  6437. has: function(key) {
  6438. if (this._area.has) {
  6439. return this._area.has(this._in(key));//extension hook
  6440. }
  6441. return !!(this._in(key) in this._area);
  6442. },
  6443. size: function(){ return this.keys().length; },
  6444. each: function(fn, fill) {// fill is used by keys(fillList) and getAll(fillList))
  6445. for (var i=0, m=_.length(this._area); i<m; i++) {
  6446. var key = this._out(_.key(this._area, i));
  6447. if (key !== undefined) {
  6448. if (fn.call(this, key, this.get(key), fill) === false) {
  6449. break;
  6450. }
  6451. }
  6452. if (m > _.length(this._area)) { m--; i--; }// in case of removeItem
  6453. }
  6454. return fill || this;
  6455. },
  6456. keys: function(fillList) {
  6457. return this.each(function(k, v, list){ list.push(k); }, fillList || []);
  6458. },
  6459. get: function(key, alt) {
  6460. var s = _.get(this._area, this._in(key));
  6461. return s !== null ? _.parse(s) : alt || s;// support alt for easy default mgmt
  6462. },
  6463. getAll: function(fillObj) {
  6464. return this.each(function(k, v, all){ all[k] = v; }, fillObj || {});
  6465. },
  6466. transact: function(key, fn, alt) {
  6467. var val = this.get(key, alt),
  6468. ret = fn(val);
  6469. this.set(key, ret === undefined ? val : ret);
  6470. return this;
  6471. },
  6472. set: function(key, data, overwrite) {
  6473. var d = this.get(key);
  6474. if (d != null && overwrite === false) {
  6475. return data;
  6476. }
  6477. return _.set(this._area, this._in(key), _.stringify(data), overwrite) || d;
  6478. },
  6479. setAll: function(data, overwrite) {
  6480. var changed, val;
  6481. for (var key in data) {
  6482. val = data[key];
  6483. if (this.set(key, val, overwrite) !== val) {
  6484. changed = true;
  6485. }
  6486. }
  6487. return changed;
  6488. },
  6489. add: function(key, data) {
  6490. var d = this.get(key);
  6491. if (d instanceof Array) {
  6492. data = d.concat(data);
  6493. } else if (d !== null) {
  6494. var type = typeof d;
  6495. if (type === typeof data && type === 'object') {
  6496. for (var k in data) {
  6497. d[k] = data[k];
  6498. }
  6499. data = d;
  6500. } else {
  6501. data = d + data;
  6502. }
  6503. }
  6504. _.set(this._area, this._in(key), _.stringify(data));
  6505. return data;
  6506. },
  6507. remove: function(key, alt) {
  6508. var d = this.get(key, alt);
  6509. _.remove(this._area, this._in(key));
  6510. return d;
  6511. },
  6512. clear: function() {
  6513. if (!this._ns) {
  6514. _.clear(this._area);
  6515. } else {
  6516. this.each(function(k){ _.remove(this._area, this._in(k)); }, 1);
  6517. }
  6518. return this;
  6519. },
  6520. clearAll: function() {
  6521. var area = this._area;
  6522. for (var id in _.areas) {
  6523. if (_.areas.hasOwnProperty(id)) {
  6524. this._area = _.areas[id];
  6525. this.clear();
  6526. }
  6527. }
  6528. this._area = area;
  6529. return this;
  6530. },
  6531. // internal use functions
  6532. _in: function(k) {
  6533. if (typeof k !== "string"){ k = _.stringify(k); }
  6534. return this._ns ? this._ns + k : k;
  6535. },
  6536. _out: function(k) {
  6537. return this._ns ?
  6538. k && k.indexOf(this._ns) === 0 ?
  6539. k.substring(this._ns.length) :
  6540. undefined : // so each() knows to skip it
  6541. k;
  6542. }
  6543. },// end _.storeAPI
  6544. storage: function(name) {
  6545. return _.inherit(_.storageAPI, { items: {}, name: name });
  6546. },
  6547. storageAPI: {
  6548. length: 0,
  6549. has: function(k){ return this.items.hasOwnProperty(k); },
  6550. key: function(i) {
  6551. var c = 0;
  6552. for (var k in this.items){
  6553. if (this.has(k) && i === c++) {
  6554. return k;
  6555. }
  6556. }
  6557. },
  6558. setItem: function(k, v) {
  6559. if (!this.has(k)) {
  6560. this.length++;
  6561. }
  6562. this.items[k] = v;
  6563. },
  6564. removeItem: function(k) {
  6565. if (this.has(k)) {
  6566. delete this.items[k];
  6567. this.length--;
  6568. }
  6569. },
  6570. getItem: function(k){ return this.has(k) ? this.items[k] : null; },
  6571. clear: function(){ for (var k in this.items){ this.removeItem(k); } }
  6572. }// end _.storageAPI
  6573. };
  6574. var store =
  6575. // safely set this up (throws error in IE10/32bit mode for local files)
  6576. _.Store("local", (function(){try{ return localStorage; }catch(e){}})());
  6577. store.local = store;// for completeness
  6578. store._ = _;// for extenders and debuggers...
  6579. // safely setup store.session (throws exception in FF for file:/// urls)
  6580. store.area("session", (function(){try{ return sessionStorage; }catch(e){}})());
  6581. store.area("page", _.storage("page"));
  6582. if (typeof define === 'function' && define.amd !== undefined) {
  6583. define('store2', [], function () {
  6584. return store;
  6585. });
  6586. } else if ('object' !== 'undefined' && module.exports) {
  6587. module.exports = store;
  6588. } else {
  6589. // expose the primary store fn to the global object and save conflicts
  6590. if (window.store){ _.conflict = window.store; }
  6591. window.store = store;
  6592. }
  6593. })(commonjsGlobal, commonjsGlobal && commonjsGlobal.define);
  6594. });
  6595. 'use strict';
  6596. var bind$1 = function bind(fn, thisArg) {
  6597. return function wrap() {
  6598. var args = new Array(arguments.length);
  6599. for (var i = 0; i < args.length; i++) {
  6600. args[i] = arguments[i];
  6601. }
  6602. return fn.apply(thisArg, args);
  6603. };
  6604. };
  6605. /*!
  6606. * Determine if an object is a Buffer
  6607. *
  6608. * @author Feross Aboukhadijeh <https://feross.org>
  6609. * @license MIT
  6610. */
  6611. var isBuffer = function isBuffer (obj) {
  6612. return obj != null && obj.constructor != null &&
  6613. typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
  6614. };
  6615. 'use strict';
  6616. /*global toString:true*/
  6617. // utils is a library of generic helper functions non-specific to axios
  6618. var toString = Object.prototype.toString;
  6619. /**
  6620. * Determine if a value is an Array
  6621. *
  6622. * @param {Object} val The value to test
  6623. * @returns {boolean} True if value is an Array, otherwise false
  6624. */
  6625. function isArray(val) {
  6626. return toString.call(val) === '[object Array]';
  6627. }
  6628. /**
  6629. * Determine if a value is an ArrayBuffer
  6630. *
  6631. * @param {Object} val The value to test
  6632. * @returns {boolean} True if value is an ArrayBuffer, otherwise false
  6633. */
  6634. function isArrayBuffer(val) {
  6635. return toString.call(val) === '[object ArrayBuffer]';
  6636. }
  6637. /**
  6638. * Determine if a value is a FormData
  6639. *
  6640. * @param {Object} val The value to test
  6641. * @returns {boolean} True if value is an FormData, otherwise false
  6642. */
  6643. function isFormData(val) {
  6644. return (typeof FormData !== 'undefined') && (val instanceof FormData);
  6645. }
  6646. /**
  6647. * Determine if a value is a view on an ArrayBuffer
  6648. *
  6649. * @param {Object} val The value to test
  6650. * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
  6651. */
  6652. function isArrayBufferView(val) {
  6653. var result;
  6654. if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
  6655. result = ArrayBuffer.isView(val);
  6656. } else {
  6657. result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
  6658. }
  6659. return result;
  6660. }
  6661. /**
  6662. * Determine if a value is a String
  6663. *
  6664. * @param {Object} val The value to test
  6665. * @returns {boolean} True if value is a String, otherwise false
  6666. */
  6667. function isString(val) {
  6668. return typeof val === 'string';
  6669. }
  6670. /**
  6671. * Determine if a value is a Number
  6672. *
  6673. * @param {Object} val The value to test
  6674. * @returns {boolean} True if value is a Number, otherwise false
  6675. */
  6676. function isNumber(val) {
  6677. return typeof val === 'number';
  6678. }
  6679. /**
  6680. * Determine if a value is undefined
  6681. *
  6682. * @param {Object} val The value to test
  6683. * @returns {boolean} True if the value is undefined, otherwise false
  6684. */
  6685. function isUndefined(val) {
  6686. return typeof val === 'undefined';
  6687. }
  6688. /**
  6689. * Determine if a value is an Object
  6690. *
  6691. * @param {Object} val The value to test
  6692. * @returns {boolean} True if value is an Object, otherwise false
  6693. */
  6694. function isObject(val) {
  6695. return val !== null && typeof val === 'object';
  6696. }
  6697. /**
  6698. * Determine if a value is a Date
  6699. *
  6700. * @param {Object} val The value to test
  6701. * @returns {boolean} True if value is a Date, otherwise false
  6702. */
  6703. function isDate(val) {
  6704. return toString.call(val) === '[object Date]';
  6705. }
  6706. /**
  6707. * Determine if a value is a File
  6708. *
  6709. * @param {Object} val The value to test
  6710. * @returns {boolean} True if value is a File, otherwise false
  6711. */
  6712. function isFile(val) {
  6713. return toString.call(val) === '[object File]';
  6714. }
  6715. /**
  6716. * Determine if a value is a Blob
  6717. *
  6718. * @param {Object} val The value to test
  6719. * @returns {boolean} True if value is a Blob, otherwise false
  6720. */
  6721. function isBlob(val) {
  6722. return toString.call(val) === '[object Blob]';
  6723. }
  6724. /**
  6725. * Determine if a value is a Function
  6726. *
  6727. * @param {Object} val The value to test
  6728. * @returns {boolean} True if value is a Function, otherwise false
  6729. */
  6730. function isFunction(val) {
  6731. return toString.call(val) === '[object Function]';
  6732. }
  6733. /**
  6734. * Determine if a value is a Stream
  6735. *
  6736. * @param {Object} val The value to test
  6737. * @returns {boolean} True if value is a Stream, otherwise false
  6738. */
  6739. function isStream(val) {
  6740. return isObject(val) && isFunction(val.pipe);
  6741. }
  6742. /**
  6743. * Determine if a value is a URLSearchParams object
  6744. *
  6745. * @param {Object} val The value to test
  6746. * @returns {boolean} True if value is a URLSearchParams object, otherwise false
  6747. */
  6748. function isURLSearchParams(val) {
  6749. return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
  6750. }
  6751. /**
  6752. * Trim excess whitespace off the beginning and end of a string
  6753. *
  6754. * @param {String} str The String to trim
  6755. * @returns {String} The String freed of excess whitespace
  6756. */
  6757. function trim(str) {
  6758. return str.replace(/^\s*/, '').replace(/\s*$/, '');
  6759. }
  6760. /**
  6761. * Determine if we're running in a standard browser environment
  6762. *
  6763. * This allows axios to run in a web worker, and react-native.
  6764. * Both environments support XMLHttpRequest, but not fully standard globals.
  6765. *
  6766. * web workers:
  6767. * typeof window -> undefined
  6768. * typeof document -> undefined
  6769. *
  6770. * react-native:
  6771. * navigator.product -> 'ReactNative'
  6772. * nativescript
  6773. * navigator.product -> 'NativeScript' or 'NS'
  6774. */
  6775. function isStandardBrowserEnv() {
  6776. if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
  6777. navigator.product === 'NativeScript' ||
  6778. navigator.product === 'NS')) {
  6779. return false;
  6780. }
  6781. return (
  6782. typeof window !== 'undefined' &&
  6783. typeof document !== 'undefined'
  6784. );
  6785. }
  6786. /**
  6787. * Iterate over an Array or an Object invoking a function for each item.
  6788. *
  6789. * If `obj` is an Array callback will be called passing
  6790. * the value, index, and complete array for each item.
  6791. *
  6792. * If 'obj' is an Object callback will be called passing
  6793. * the value, key, and complete object for each property.
  6794. *
  6795. * @param {Object|Array} obj The object to iterate
  6796. * @param {Function} fn The callback to invoke for each item
  6797. */
  6798. function forEach(obj, fn) {
  6799. // Don't bother if no value provided
  6800. if (obj === null || typeof obj === 'undefined') {
  6801. return;
  6802. }
  6803. // Force an array if not already something iterable
  6804. if (typeof obj !== 'object') {
  6805. /*eslint no-param-reassign:0*/
  6806. obj = [obj];
  6807. }
  6808. if (isArray(obj)) {
  6809. // Iterate over array values
  6810. for (var i = 0, l = obj.length; i < l; i++) {
  6811. fn.call(null, obj[i], i, obj);
  6812. }
  6813. } else {
  6814. // Iterate over object keys
  6815. for (var key in obj) {
  6816. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  6817. fn.call(null, obj[key], key, obj);
  6818. }
  6819. }
  6820. }
  6821. }
  6822. /**
  6823. * Accepts varargs expecting each argument to be an object, then
  6824. * immutably merges the properties of each object and returns result.
  6825. *
  6826. * When multiple objects contain the same key the later object in
  6827. * the arguments list will take precedence.
  6828. *
  6829. * Example:
  6830. *
  6831. * ```js
  6832. * var result = merge({foo: 123}, {foo: 456});
  6833. * console.log(result.foo); // outputs 456
  6834. * ```
  6835. *
  6836. * @param {Object} obj1 Object to merge
  6837. * @returns {Object} Result of all merge properties
  6838. */
  6839. function merge(/* obj1, obj2, obj3, ... */) {
  6840. var result = {};
  6841. function assignValue(val, key) {
  6842. if (typeof result[key] === 'object' && typeof val === 'object') {
  6843. result[key] = merge(result[key], val);
  6844. } else {
  6845. result[key] = val;
  6846. }
  6847. }
  6848. for (var i = 0, l = arguments.length; i < l; i++) {
  6849. forEach(arguments[i], assignValue);
  6850. }
  6851. return result;
  6852. }
  6853. /**
  6854. * Function equal to merge with the difference being that no reference
  6855. * to original objects is kept.
  6856. *
  6857. * @see merge
  6858. * @param {Object} obj1 Object to merge
  6859. * @returns {Object} Result of all merge properties
  6860. */
  6861. function deepMerge(/* obj1, obj2, obj3, ... */) {
  6862. var result = {};
  6863. function assignValue(val, key) {
  6864. if (typeof result[key] === 'object' && typeof val === 'object') {
  6865. result[key] = deepMerge(result[key], val);
  6866. } else if (typeof val === 'object') {
  6867. result[key] = deepMerge({}, val);
  6868. } else {
  6869. result[key] = val;
  6870. }
  6871. }
  6872. for (var i = 0, l = arguments.length; i < l; i++) {
  6873. forEach(arguments[i], assignValue);
  6874. }
  6875. return result;
  6876. }
  6877. /**
  6878. * Extends object a by mutably adding to it the properties of object b.
  6879. *
  6880. * @param {Object} a The object to be extended
  6881. * @param {Object} b The object to copy properties from
  6882. * @param {Object} thisArg The object to bind function to
  6883. * @return {Object} The resulting value of object a
  6884. */
  6885. function extend(a, b, thisArg) {
  6886. forEach(b, function assignValue(val, key) {
  6887. if (thisArg && typeof val === 'function') {
  6888. a[key] = bind$1(val, thisArg);
  6889. } else {
  6890. a[key] = val;
  6891. }
  6892. });
  6893. return a;
  6894. }
  6895. var utils = {
  6896. isArray: isArray,
  6897. isArrayBuffer: isArrayBuffer,
  6898. isBuffer: isBuffer,
  6899. isFormData: isFormData,
  6900. isArrayBufferView: isArrayBufferView,
  6901. isString: isString,
  6902. isNumber: isNumber,
  6903. isObject: isObject,
  6904. isUndefined: isUndefined,
  6905. isDate: isDate,
  6906. isFile: isFile,
  6907. isBlob: isBlob,
  6908. isFunction: isFunction,
  6909. isStream: isStream,
  6910. isURLSearchParams: isURLSearchParams,
  6911. isStandardBrowserEnv: isStandardBrowserEnv,
  6912. forEach: forEach,
  6913. merge: merge,
  6914. deepMerge: deepMerge,
  6915. extend: extend,
  6916. trim: trim
  6917. };
  6918. var utils_1 = utils.isArray;
  6919. var utils_2 = utils.isArrayBuffer;
  6920. var utils_3 = utils.isBuffer;
  6921. var utils_4 = utils.isFormData;
  6922. var utils_5 = utils.isArrayBufferView;
  6923. var utils_6 = utils.isString;
  6924. var utils_7 = utils.isNumber;
  6925. var utils_8 = utils.isObject;
  6926. var utils_9 = utils.isUndefined;
  6927. var utils_10 = utils.isDate;
  6928. var utils_11 = utils.isFile;
  6929. var utils_12 = utils.isBlob;
  6930. var utils_13 = utils.isFunction;
  6931. var utils_14 = utils.isStream;
  6932. var utils_15 = utils.isURLSearchParams;
  6933. var utils_16 = utils.isStandardBrowserEnv;
  6934. var utils_17 = utils.forEach;
  6935. var utils_18 = utils.merge;
  6936. var utils_19 = utils.deepMerge;
  6937. var utils_20 = utils.extend;
  6938. var utils_21 = utils.trim;
  6939. 'use strict';
  6940. function encode$1(val) {
  6941. return encodeURIComponent(val).
  6942. replace(/%40/gi, '@').
  6943. replace(/%3A/gi, ':').
  6944. replace(/%24/g, '$').
  6945. replace(/%2C/gi, ',').
  6946. replace(/%20/g, '+').
  6947. replace(/%5B/gi, '[').
  6948. replace(/%5D/gi, ']');
  6949. }
  6950. /**
  6951. * Build a URL by appending params to the end
  6952. *
  6953. * @param {string} url The base of the url (e.g., http://www.google.com)
  6954. * @param {object} [params] The params to be appended
  6955. * @returns {string} The formatted url
  6956. */
  6957. var buildURL = function buildURL(url, params, paramsSerializer) {
  6958. /*eslint no-param-reassign:0*/
  6959. if (!params) {
  6960. return url;
  6961. }
  6962. var serializedParams;
  6963. if (paramsSerializer) {
  6964. serializedParams = paramsSerializer(params);
  6965. } else if (utils.isURLSearchParams(params)) {
  6966. serializedParams = params.toString();
  6967. } else {
  6968. var parts = [];
  6969. utils.forEach(params, function serialize(val, key) {
  6970. if (val === null || typeof val === 'undefined') {
  6971. return;
  6972. }
  6973. if (utils.isArray(val)) {
  6974. key = key + '[]';
  6975. } else {
  6976. val = [val];
  6977. }
  6978. utils.forEach(val, function parseValue(v) {
  6979. if (utils.isDate(v)) {
  6980. v = v.toISOString();
  6981. } else if (utils.isObject(v)) {
  6982. v = JSON.stringify(v);
  6983. }
  6984. parts.push(encode$1(key) + '=' + encode$1(v));
  6985. });
  6986. });
  6987. serializedParams = parts.join('&');
  6988. }
  6989. if (serializedParams) {
  6990. var hashmarkIndex = url.indexOf('#');
  6991. if (hashmarkIndex !== -1) {
  6992. url = url.slice(0, hashmarkIndex);
  6993. }
  6994. url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
  6995. }
  6996. return url;
  6997. };
  6998. 'use strict';
  6999. function InterceptorManager() {
  7000. this.handlers = [];
  7001. }
  7002. /**
  7003. * Add a new interceptor to the stack
  7004. *
  7005. * @param {Function} fulfilled The function to handle `then` for a `Promise`
  7006. * @param {Function} rejected The function to handle `reject` for a `Promise`
  7007. *
  7008. * @return {Number} An ID used to remove interceptor later
  7009. */
  7010. InterceptorManager.prototype.use = function use(fulfilled, rejected) {
  7011. this.handlers.push({
  7012. fulfilled: fulfilled,
  7013. rejected: rejected
  7014. });
  7015. return this.handlers.length - 1;
  7016. };
  7017. /**
  7018. * Remove an interceptor from the stack
  7019. *
  7020. * @param {Number} id The ID that was returned by `use`
  7021. */
  7022. InterceptorManager.prototype.eject = function eject(id) {
  7023. if (this.handlers[id]) {
  7024. this.handlers[id] = null;
  7025. }
  7026. };
  7027. /**
  7028. * Iterate over all the registered interceptors
  7029. *
  7030. * This method is particularly useful for skipping over any
  7031. * interceptors that may have become `null` calling `eject`.
  7032. *
  7033. * @param {Function} fn The function to call for each interceptor
  7034. */
  7035. InterceptorManager.prototype.forEach = function forEach(fn) {
  7036. utils.forEach(this.handlers, function forEachHandler(h) {
  7037. if (h !== null) {
  7038. fn(h);
  7039. }
  7040. });
  7041. };
  7042. var InterceptorManager_1 = InterceptorManager;
  7043. 'use strict';
  7044. /**
  7045. * Transform the data for a request or a response
  7046. *
  7047. * @param {Object|String} data The data to be transformed
  7048. * @param {Array} headers The headers for the request or response
  7049. * @param {Array|Function} fns A single function or Array of functions
  7050. * @returns {*} The resulting transformed data
  7051. */
  7052. var transformData = function transformData(data, headers, fns) {
  7053. /*eslint no-param-reassign:0*/
  7054. utils.forEach(fns, function transform(fn) {
  7055. data = fn(data, headers);
  7056. });
  7057. return data;
  7058. };
  7059. 'use strict';
  7060. var isCancel = function isCancel(value) {
  7061. return !!(value && value.__CANCEL__);
  7062. };
  7063. 'use strict';
  7064. var normalizeHeaderName = function normalizeHeaderName(headers, normalizedName) {
  7065. utils.forEach(headers, function processHeader(value, name) {
  7066. if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
  7067. headers[normalizedName] = value;
  7068. delete headers[name];
  7069. }
  7070. });
  7071. };
  7072. 'use strict';
  7073. /**
  7074. * Update an Error with the specified config, error code, and response.
  7075. *
  7076. * @param {Error} error The error to update.
  7077. * @param {Object} config The config.
  7078. * @param {string} [code] The error code (for example, 'ECONNABORTED').
  7079. * @param {Object} [request] The request.
  7080. * @param {Object} [response] The response.
  7081. * @returns {Error} The error.
  7082. */
  7083. var enhanceError = function enhanceError(error, config, code, request, response) {
  7084. error.config = config;
  7085. if (code) {
  7086. error.code = code;
  7087. }
  7088. error.request = request;
  7089. error.response = response;
  7090. error.isAxiosError = true;
  7091. error.toJSON = function() {
  7092. return {
  7093. // Standard
  7094. message: this.message,
  7095. name: this.name,
  7096. // Microsoft
  7097. description: this.description,
  7098. number: this.number,
  7099. // Mozilla
  7100. fileName: this.fileName,
  7101. lineNumber: this.lineNumber,
  7102. columnNumber: this.columnNumber,
  7103. stack: this.stack,
  7104. // Axios
  7105. config: this.config,
  7106. code: this.code
  7107. };
  7108. };
  7109. return error;
  7110. };
  7111. 'use strict';
  7112. /**
  7113. * Create an Error with the specified message, config, error code, request and response.
  7114. *
  7115. * @param {string} message The error message.
  7116. * @param {Object} config The config.
  7117. * @param {string} [code] The error code (for example, 'ECONNABORTED').
  7118. * @param {Object} [request] The request.
  7119. * @param {Object} [response] The response.
  7120. * @returns {Error} The created error.
  7121. */
  7122. var createError = function createError(message, config, code, request, response) {
  7123. var error = new Error(message);
  7124. return enhanceError(error, config, code, request, response);
  7125. };
  7126. 'use strict';
  7127. /**
  7128. * Resolve or reject a Promise based on response status.
  7129. *
  7130. * @param {Function} resolve A function that resolves the promise.
  7131. * @param {Function} reject A function that rejects the promise.
  7132. * @param {object} response The response.
  7133. */
  7134. var settle = function settle(resolve, reject, response) {
  7135. var validateStatus = response.config.validateStatus;
  7136. if (!validateStatus || validateStatus(response.status)) {
  7137. resolve(response);
  7138. } else {
  7139. reject(createError(
  7140. 'Request failed with status code ' + response.status,
  7141. response.config,
  7142. null,
  7143. response.request,
  7144. response
  7145. ));
  7146. }
  7147. };
  7148. 'use strict';
  7149. // Headers whose duplicates are ignored by node
  7150. // c.f. https://nodejs.org/api/http.html#http_message_headers
  7151. var ignoreDuplicateOf = [
  7152. 'age', 'authorization', 'content-length', 'content-type', 'etag',
  7153. 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
  7154. 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
  7155. 'referer', 'retry-after', 'user-agent'
  7156. ];
  7157. /**
  7158. * Parse headers into an object
  7159. *
  7160. * ```
  7161. * Date: Wed, 27 Aug 2014 08:58:49 GMT
  7162. * Content-Type: application/json
  7163. * Connection: keep-alive
  7164. * Transfer-Encoding: chunked
  7165. * ```
  7166. *
  7167. * @param {String} headers Headers needing to be parsed
  7168. * @returns {Object} Headers parsed into an object
  7169. */
  7170. var parseHeaders = function parseHeaders(headers) {
  7171. var parsed = {};
  7172. var key;
  7173. var val;
  7174. var i;
  7175. if (!headers) { return parsed; }
  7176. utils.forEach(headers.split('\n'), function parser(line) {
  7177. i = line.indexOf(':');
  7178. key = utils.trim(line.substr(0, i)).toLowerCase();
  7179. val = utils.trim(line.substr(i + 1));
  7180. if (key) {
  7181. if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
  7182. return;
  7183. }
  7184. if (key === 'set-cookie') {
  7185. parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
  7186. } else {
  7187. parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
  7188. }
  7189. }
  7190. });
  7191. return parsed;
  7192. };
  7193. 'use strict';
  7194. var isURLSameOrigin = (
  7195. utils.isStandardBrowserEnv() ?
  7196. // Standard browser envs have full support of the APIs needed to test
  7197. // whether the request URL is of the same origin as current location.
  7198. (function standardBrowserEnv() {
  7199. var msie = /(msie|trident)/i.test(navigator.userAgent);
  7200. var urlParsingNode = document.createElement('a');
  7201. var originURL;
  7202. /**
  7203. * Parse a URL to discover it's components
  7204. *
  7205. * @param {String} url The URL to be parsed
  7206. * @returns {Object}
  7207. */
  7208. function resolveURL(url) {
  7209. var href = url;
  7210. if (msie) {
  7211. // IE needs attribute set twice to normalize properties
  7212. urlParsingNode.setAttribute('href', href);
  7213. href = urlParsingNode.href;
  7214. }
  7215. urlParsingNode.setAttribute('href', href);
  7216. // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
  7217. return {
  7218. href: urlParsingNode.href,
  7219. protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
  7220. host: urlParsingNode.host,
  7221. search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
  7222. hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
  7223. hostname: urlParsingNode.hostname,
  7224. port: urlParsingNode.port,
  7225. pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
  7226. urlParsingNode.pathname :
  7227. '/' + urlParsingNode.pathname
  7228. };
  7229. }
  7230. originURL = resolveURL(window.location.href);
  7231. /**
  7232. * Determine if a URL shares the same origin as the current location
  7233. *
  7234. * @param {String} requestURL The URL to test
  7235. * @returns {boolean} True if URL shares the same origin, otherwise false
  7236. */
  7237. return function isURLSameOrigin(requestURL) {
  7238. var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
  7239. return (parsed.protocol === originURL.protocol &&
  7240. parsed.host === originURL.host);
  7241. };
  7242. })() :
  7243. // Non standard browser envs (web workers, react-native) lack needed support.
  7244. (function nonStandardBrowserEnv() {
  7245. return function isURLSameOrigin() {
  7246. return true;
  7247. };
  7248. })()
  7249. );
  7250. 'use strict';
  7251. var cookies = (
  7252. utils.isStandardBrowserEnv() ?
  7253. // Standard browser envs support document.cookie
  7254. (function standardBrowserEnv() {
  7255. return {
  7256. write: function write(name, value, expires, path, domain, secure) {
  7257. var cookie = [];
  7258. cookie.push(name + '=' + encodeURIComponent(value));
  7259. if (utils.isNumber(expires)) {
  7260. cookie.push('expires=' + new Date(expires).toGMTString());
  7261. }
  7262. if (utils.isString(path)) {
  7263. cookie.push('path=' + path);
  7264. }
  7265. if (utils.isString(domain)) {
  7266. cookie.push('domain=' + domain);
  7267. }
  7268. if (secure === true) {
  7269. cookie.push('secure');
  7270. }
  7271. document.cookie = cookie.join('; ');
  7272. },
  7273. read: function read(name) {
  7274. var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
  7275. return (match ? decodeURIComponent(match[3]) : null);
  7276. },
  7277. remove: function remove(name) {
  7278. this.write(name, '', Date.now() - 86400000);
  7279. }
  7280. };
  7281. })() :
  7282. // Non standard browser env (web workers, react-native) lack needed support.
  7283. (function nonStandardBrowserEnv() {
  7284. return {
  7285. write: function write() {},
  7286. read: function read() { return null; },
  7287. remove: function remove() {}
  7288. };
  7289. })()
  7290. );
  7291. 'use strict';
  7292. var xhr = function xhrAdapter(config) {
  7293. return new Promise(function dispatchXhrRequest(resolve, reject) {
  7294. var requestData = config.data;
  7295. var requestHeaders = config.headers;
  7296. if (utils.isFormData(requestData)) {
  7297. delete requestHeaders['Content-Type']; // Let the browser set it
  7298. }
  7299. var request = new XMLHttpRequest();
  7300. // HTTP basic authentication
  7301. if (config.auth) {
  7302. var username = config.auth.username || '';
  7303. var password = config.auth.password || '';
  7304. requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
  7305. }
  7306. request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);
  7307. // Set the request timeout in MS
  7308. request.timeout = config.timeout;
  7309. // Listen for ready state
  7310. request.onreadystatechange = function handleLoad() {
  7311. if (!request || request.readyState !== 4) {
  7312. return;
  7313. }
  7314. // The request errored out and we didn't get a response, this will be
  7315. // handled by onerror instead
  7316. // With one exception: request that using file: protocol, most browsers
  7317. // will return status as 0 even though it's a successful request
  7318. if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
  7319. return;
  7320. }
  7321. // Prepare the response
  7322. var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
  7323. var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;
  7324. var response = {
  7325. data: responseData,
  7326. status: request.status,
  7327. statusText: request.statusText,
  7328. headers: responseHeaders,
  7329. config: config,
  7330. request: request
  7331. };
  7332. settle(resolve, reject, response);
  7333. // Clean up request
  7334. request = null;
  7335. };
  7336. // Handle browser request cancellation (as opposed to a manual cancellation)
  7337. request.onabort = function handleAbort() {
  7338. if (!request) {
  7339. return;
  7340. }
  7341. reject(createError('Request aborted', config, 'ECONNABORTED', request));
  7342. // Clean up request
  7343. request = null;
  7344. };
  7345. // Handle low level network errors
  7346. request.onerror = function handleError() {
  7347. // Real errors are hidden from us by the browser
  7348. // onerror should only fire if it's a network error
  7349. reject(createError('Network Error', config, null, request));
  7350. // Clean up request
  7351. request = null;
  7352. };
  7353. // Handle timeout
  7354. request.ontimeout = function handleTimeout() {
  7355. reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED',
  7356. request));
  7357. // Clean up request
  7358. request = null;
  7359. };
  7360. // Add xsrf header
  7361. // This is only done if running in a standard browser environment.
  7362. // Specifically not if we're in a web worker, or react-native.
  7363. if (utils.isStandardBrowserEnv()) {
  7364. var cookies$1 = cookies;
  7365. // Add xsrf header
  7366. var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?
  7367. cookies$1.read(config.xsrfCookieName) :
  7368. undefined;
  7369. if (xsrfValue) {
  7370. requestHeaders[config.xsrfHeaderName] = xsrfValue;
  7371. }
  7372. }
  7373. // Add headers to the request
  7374. if ('setRequestHeader' in request) {
  7375. utils.forEach(requestHeaders, function setRequestHeader(val, key) {
  7376. if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
  7377. // Remove Content-Type if data is undefined
  7378. delete requestHeaders[key];
  7379. } else {
  7380. // Otherwise add header to the request
  7381. request.setRequestHeader(key, val);
  7382. }
  7383. });
  7384. }
  7385. // Add withCredentials to request if needed
  7386. if (config.withCredentials) {
  7387. request.withCredentials = true;
  7388. }
  7389. // Add responseType to request if needed
  7390. if (config.responseType) {
  7391. try {
  7392. request.responseType = config.responseType;
  7393. } catch (e) {
  7394. // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.
  7395. // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.
  7396. if (config.responseType !== 'json') {
  7397. throw e;
  7398. }
  7399. }
  7400. }
  7401. // Handle progress if needed
  7402. if (typeof config.onDownloadProgress === 'function') {
  7403. request.addEventListener('progress', config.onDownloadProgress);
  7404. }
  7405. // Not all browsers support upload events
  7406. if (typeof config.onUploadProgress === 'function' && request.upload) {
  7407. request.upload.addEventListener('progress', config.onUploadProgress);
  7408. }
  7409. if (config.cancelToken) {
  7410. // Handle cancellation
  7411. config.cancelToken.promise.then(function onCanceled(cancel) {
  7412. if (!request) {
  7413. return;
  7414. }
  7415. request.abort();
  7416. reject(cancel);
  7417. // Clean up request
  7418. request = null;
  7419. });
  7420. }
  7421. if (requestData === undefined) {
  7422. requestData = null;
  7423. }
  7424. // Send the request
  7425. request.send(requestData);
  7426. });
  7427. };
  7428. 'use strict';
  7429. var DEFAULT_CONTENT_TYPE = {
  7430. 'Content-Type': 'application/x-www-form-urlencoded'
  7431. };
  7432. function setContentTypeIfUnset(headers, value) {
  7433. if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
  7434. headers['Content-Type'] = value;
  7435. }
  7436. }
  7437. function getDefaultAdapter() {
  7438. var adapter;
  7439. // Only Node.JS has a process variable that is of [[Class]] process
  7440. if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
  7441. // For node use HTTP adapter
  7442. adapter = xhr;
  7443. } else if (typeof XMLHttpRequest !== 'undefined') {
  7444. // For browsers use XHR adapter
  7445. adapter = xhr;
  7446. }
  7447. return adapter;
  7448. }
  7449. var defaults = {
  7450. adapter: getDefaultAdapter(),
  7451. transformRequest: [function transformRequest(data, headers) {
  7452. normalizeHeaderName(headers, 'Accept');
  7453. normalizeHeaderName(headers, 'Content-Type');
  7454. if (utils.isFormData(data) ||
  7455. utils.isArrayBuffer(data) ||
  7456. utils.isBuffer(data) ||
  7457. utils.isStream(data) ||
  7458. utils.isFile(data) ||
  7459. utils.isBlob(data)
  7460. ) {
  7461. return data;
  7462. }
  7463. if (utils.isArrayBufferView(data)) {
  7464. return data.buffer;
  7465. }
  7466. if (utils.isURLSearchParams(data)) {
  7467. setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
  7468. return data.toString();
  7469. }
  7470. if (utils.isObject(data)) {
  7471. setContentTypeIfUnset(headers, 'application/json;charset=utf-8');
  7472. return JSON.stringify(data);
  7473. }
  7474. return data;
  7475. }],
  7476. transformResponse: [function transformResponse(data) {
  7477. /*eslint no-param-reassign:0*/
  7478. if (typeof data === 'string') {
  7479. try {
  7480. data = JSON.parse(data);
  7481. } catch (e) { /* Ignore */ }
  7482. }
  7483. return data;
  7484. }],
  7485. /**
  7486. * A timeout in milliseconds to abort a request. If set to 0 (default) a
  7487. * timeout is not created.
  7488. */
  7489. timeout: 0,
  7490. xsrfCookieName: 'XSRF-TOKEN',
  7491. xsrfHeaderName: 'X-XSRF-TOKEN',
  7492. maxContentLength: -1,
  7493. validateStatus: function validateStatus(status) {
  7494. return status >= 200 && status < 300;
  7495. }
  7496. };
  7497. defaults.headers = {
  7498. common: {
  7499. 'Accept': 'application/json, text/plain, */*'
  7500. }
  7501. };
  7502. utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
  7503. defaults.headers[method] = {};
  7504. });
  7505. utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
  7506. defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
  7507. });
  7508. var defaults_1 = defaults;
  7509. 'use strict';
  7510. /**
  7511. * Determines whether the specified URL is absolute
  7512. *
  7513. * @param {string} url The URL to test
  7514. * @returns {boolean} True if the specified URL is absolute, otherwise false
  7515. */
  7516. var isAbsoluteURL = function isAbsoluteURL(url) {
  7517. // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
  7518. // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
  7519. // by any combination of letters, digits, plus, period, or hyphen.
  7520. return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
  7521. };
  7522. 'use strict';
  7523. /**
  7524. * Creates a new URL by combining the specified URLs
  7525. *
  7526. * @param {string} baseURL The base URL
  7527. * @param {string} relativeURL The relative URL
  7528. * @returns {string} The combined URL
  7529. */
  7530. var combineURLs = function combineURLs(baseURL, relativeURL) {
  7531. return relativeURL
  7532. ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
  7533. : baseURL;
  7534. };
  7535. 'use strict';
  7536. /**
  7537. * Throws a `Cancel` if cancellation has been requested.
  7538. */
  7539. function throwIfCancellationRequested(config) {
  7540. if (config.cancelToken) {
  7541. config.cancelToken.throwIfRequested();
  7542. }
  7543. }
  7544. /**
  7545. * Dispatch a request to the server using the configured adapter.
  7546. *
  7547. * @param {object} config The config that is to be used for the request
  7548. * @returns {Promise} The Promise to be fulfilled
  7549. */
  7550. var dispatchRequest = function dispatchRequest(config) {
  7551. throwIfCancellationRequested(config);
  7552. // Support baseURL config
  7553. if (config.baseURL && !isAbsoluteURL(config.url)) {
  7554. config.url = combineURLs(config.baseURL, config.url);
  7555. }
  7556. // Ensure headers exist
  7557. config.headers = config.headers || {};
  7558. // Transform request data
  7559. config.data = transformData(
  7560. config.data,
  7561. config.headers,
  7562. config.transformRequest
  7563. );
  7564. // Flatten headers
  7565. config.headers = utils.merge(
  7566. config.headers.common || {},
  7567. config.headers[config.method] || {},
  7568. config.headers || {}
  7569. );
  7570. utils.forEach(
  7571. ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
  7572. function cleanHeaderConfig(method) {
  7573. delete config.headers[method];
  7574. }
  7575. );
  7576. var adapter = config.adapter || defaults_1.adapter;
  7577. return adapter(config).then(function onAdapterResolution(response) {
  7578. throwIfCancellationRequested(config);
  7579. // Transform response data
  7580. response.data = transformData(
  7581. response.data,
  7582. response.headers,
  7583. config.transformResponse
  7584. );
  7585. return response;
  7586. }, function onAdapterRejection(reason) {
  7587. if (!isCancel(reason)) {
  7588. throwIfCancellationRequested(config);
  7589. // Transform response data
  7590. if (reason && reason.response) {
  7591. reason.response.data = transformData(
  7592. reason.response.data,
  7593. reason.response.headers,
  7594. config.transformResponse
  7595. );
  7596. }
  7597. }
  7598. return Promise.reject(reason);
  7599. });
  7600. };
  7601. 'use strict';
  7602. /**
  7603. * Config-specific merge-function which creates a new config-object
  7604. * by merging two configuration objects together.
  7605. *
  7606. * @param {Object} config1
  7607. * @param {Object} config2
  7608. * @returns {Object} New object resulting from merging config2 to config1
  7609. */
  7610. var mergeConfig = function mergeConfig(config1, config2) {
  7611. // eslint-disable-next-line no-param-reassign
  7612. config2 = config2 || {};
  7613. var config = {};
  7614. utils.forEach(['url', 'method', 'params', 'data'], function valueFromConfig2(prop) {
  7615. if (typeof config2[prop] !== 'undefined') {
  7616. config[prop] = config2[prop];
  7617. }
  7618. });
  7619. utils.forEach(['headers', 'auth', 'proxy'], function mergeDeepProperties(prop) {
  7620. if (utils.isObject(config2[prop])) {
  7621. config[prop] = utils.deepMerge(config1[prop], config2[prop]);
  7622. } else if (typeof config2[prop] !== 'undefined') {
  7623. config[prop] = config2[prop];
  7624. } else if (utils.isObject(config1[prop])) {
  7625. config[prop] = utils.deepMerge(config1[prop]);
  7626. } else if (typeof config1[prop] !== 'undefined') {
  7627. config[prop] = config1[prop];
  7628. }
  7629. });
  7630. utils.forEach([
  7631. 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',
  7632. 'timeout', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',
  7633. 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'maxContentLength',
  7634. 'validateStatus', 'maxRedirects', 'httpAgent', 'httpsAgent', 'cancelToken',
  7635. 'socketPath'
  7636. ], function defaultToConfig2(prop) {
  7637. if (typeof config2[prop] !== 'undefined') {
  7638. config[prop] = config2[prop];
  7639. } else if (typeof config1[prop] !== 'undefined') {
  7640. config[prop] = config1[prop];
  7641. }
  7642. });
  7643. return config;
  7644. };
  7645. 'use strict';
  7646. /**
  7647. * Create a new instance of Axios
  7648. *
  7649. * @param {Object} instanceConfig The default config for the instance
  7650. */
  7651. function Axios(instanceConfig) {
  7652. this.defaults = instanceConfig;
  7653. this.interceptors = {
  7654. request: new InterceptorManager_1(),
  7655. response: new InterceptorManager_1()
  7656. };
  7657. }
  7658. /**
  7659. * Dispatch a request
  7660. *
  7661. * @param {Object} config The config specific for this request (merged with this.defaults)
  7662. */
  7663. Axios.prototype.request = function request(config) {
  7664. /*eslint no-param-reassign:0*/
  7665. // Allow for axios('example/url'[, config]) a la fetch API
  7666. if (typeof config === 'string') {
  7667. config = arguments[1] || {};
  7668. config.url = arguments[0];
  7669. } else {
  7670. config = config || {};
  7671. }
  7672. config = mergeConfig(this.defaults, config);
  7673. config.method = config.method ? config.method.toLowerCase() : 'get';
  7674. // Hook up interceptors middleware
  7675. var chain = [dispatchRequest, undefined];
  7676. var promise = Promise.resolve(config);
  7677. this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
  7678. chain.unshift(interceptor.fulfilled, interceptor.rejected);
  7679. });
  7680. this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
  7681. chain.push(interceptor.fulfilled, interceptor.rejected);
  7682. });
  7683. while (chain.length) {
  7684. promise = promise.then(chain.shift(), chain.shift());
  7685. }
  7686. return promise;
  7687. };
  7688. Axios.prototype.getUri = function getUri(config) {
  7689. config = mergeConfig(this.defaults, config);
  7690. return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, '');
  7691. };
  7692. // Provide aliases for supported request methods
  7693. utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
  7694. /*eslint func-names:0*/
  7695. Axios.prototype[method] = function(url, config) {
  7696. return this.request(utils.merge(config || {}, {
  7697. method: method,
  7698. url: url
  7699. }));
  7700. };
  7701. });
  7702. utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
  7703. /*eslint func-names:0*/
  7704. Axios.prototype[method] = function(url, data, config) {
  7705. return this.request(utils.merge(config || {}, {
  7706. method: method,
  7707. url: url,
  7708. data: data
  7709. }));
  7710. };
  7711. });
  7712. var Axios_1 = Axios;
  7713. 'use strict';
  7714. /**
  7715. * A `Cancel` is an object that is thrown when an operation is canceled.
  7716. *
  7717. * @class
  7718. * @param {string=} message The message.
  7719. */
  7720. function Cancel(message) {
  7721. this.message = message;
  7722. }
  7723. Cancel.prototype.toString = function toString() {
  7724. return 'Cancel' + (this.message ? ': ' + this.message : '');
  7725. };
  7726. Cancel.prototype.__CANCEL__ = true;
  7727. var Cancel_1 = Cancel;
  7728. 'use strict';
  7729. /**
  7730. * A `CancelToken` is an object that can be used to request cancellation of an operation.
  7731. *
  7732. * @class
  7733. * @param {Function} executor The executor function.
  7734. */
  7735. function CancelToken(executor) {
  7736. if (typeof executor !== 'function') {
  7737. throw new TypeError('executor must be a function.');
  7738. }
  7739. var resolvePromise;
  7740. this.promise = new Promise(function promiseExecutor(resolve) {
  7741. resolvePromise = resolve;
  7742. });
  7743. var token = this;
  7744. executor(function cancel(message) {
  7745. if (token.reason) {
  7746. // Cancellation has already been requested
  7747. return;
  7748. }
  7749. token.reason = new Cancel_1(message);
  7750. resolvePromise(token.reason);
  7751. });
  7752. }
  7753. /**
  7754. * Throws a `Cancel` if cancellation has been requested.
  7755. */
  7756. CancelToken.prototype.throwIfRequested = function throwIfRequested() {
  7757. if (this.reason) {
  7758. throw this.reason;
  7759. }
  7760. };
  7761. /**
  7762. * Returns an object that contains a new `CancelToken` and a function that, when called,
  7763. * cancels the `CancelToken`.
  7764. */
  7765. CancelToken.source = function source() {
  7766. var cancel;
  7767. var token = new CancelToken(function executor(c) {
  7768. cancel = c;
  7769. });
  7770. return {
  7771. token: token,
  7772. cancel: cancel
  7773. };
  7774. };
  7775. var CancelToken_1 = CancelToken;
  7776. 'use strict';
  7777. /**
  7778. * Syntactic sugar for invoking a function and expanding an array for arguments.
  7779. *
  7780. * Common use case would be to use `Function.prototype.apply`.
  7781. *
  7782. * ```js
  7783. * function f(x, y, z) {}
  7784. * var args = [1, 2, 3];
  7785. * f.apply(null, args);
  7786. * ```
  7787. *
  7788. * With `spread` this example can be re-written.
  7789. *
  7790. * ```js
  7791. * spread(function(x, y, z) {})([1, 2, 3]);
  7792. * ```
  7793. *
  7794. * @param {Function} callback
  7795. * @returns {Function}
  7796. */
  7797. var spread$1 = function spread(callback) {
  7798. return function wrap(arr) {
  7799. return callback.apply(null, arr);
  7800. };
  7801. };
  7802. 'use strict';
  7803. /**
  7804. * Create an instance of Axios
  7805. *
  7806. * @param {Object} defaultConfig The default config for the instance
  7807. * @return {Axios} A new instance of Axios
  7808. */
  7809. function createInstance(defaultConfig) {
  7810. var context = new Axios_1(defaultConfig);
  7811. var instance = bind$1(Axios_1.prototype.request, context);
  7812. // Copy axios.prototype to instance
  7813. utils.extend(instance, Axios_1.prototype, context);
  7814. // Copy context to instance
  7815. utils.extend(instance, context);
  7816. return instance;
  7817. }
  7818. // Create the default instance to be exported
  7819. var axios = createInstance(defaults_1);
  7820. // Expose Axios class to allow class inheritance
  7821. axios.Axios = Axios_1;
  7822. // Factory for creating new instances
  7823. axios.create = function create(instanceConfig) {
  7824. return createInstance(mergeConfig(axios.defaults, instanceConfig));
  7825. };
  7826. // Expose Cancel & CancelToken
  7827. axios.Cancel = Cancel_1;
  7828. axios.CancelToken = CancelToken_1;
  7829. axios.isCancel = isCancel;
  7830. // Expose all/spread
  7831. axios.all = function all(promises) {
  7832. return Promise.all(promises);
  7833. };
  7834. axios.spread = spread$1;
  7835. var axios_1 = axios;
  7836. // Allow use of default import syntax in TypeScript
  7837. var default_1 = axios;
  7838. axios_1.default = default_1;
  7839. var axios$1 = axios_1;
  7840. 'use strict';
  7841. var has$1 = Object.prototype.hasOwnProperty;
  7842. var isArray$1 = Array.isArray;
  7843. var hexTable = (function () {
  7844. var array = [];
  7845. for (var i = 0; i < 256; ++i) {
  7846. array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
  7847. }
  7848. return array;
  7849. }());
  7850. var compactQueue = function compactQueue(queue) {
  7851. while (queue.length > 1) {
  7852. var item = queue.pop();
  7853. var obj = item.obj[item.prop];
  7854. if (isArray$1(obj)) {
  7855. var compacted = [];
  7856. for (var j = 0; j < obj.length; ++j) {
  7857. if (typeof obj[j] !== 'undefined') {
  7858. compacted.push(obj[j]);
  7859. }
  7860. }
  7861. item.obj[item.prop] = compacted;
  7862. }
  7863. }
  7864. };
  7865. var arrayToObject = function arrayToObject(source, options) {
  7866. var obj = options && options.plainObjects ? Object.create(null) : {};
  7867. for (var i = 0; i < source.length; ++i) {
  7868. if (typeof source[i] !== 'undefined') {
  7869. obj[i] = source[i];
  7870. }
  7871. }
  7872. return obj;
  7873. };
  7874. var merge$1 = function merge(target, source, options) {
  7875. /* eslint no-param-reassign: 0 */
  7876. if (!source) {
  7877. return target;
  7878. }
  7879. if (typeof source !== 'object') {
  7880. if (isArray$1(target)) {
  7881. target.push(source);
  7882. } else if (target && typeof target === 'object') {
  7883. if ((options && (options.plainObjects || options.allowPrototypes)) || !has$1.call(Object.prototype, source)) {
  7884. target[source] = true;
  7885. }
  7886. } else {
  7887. return [target, source];
  7888. }
  7889. return target;
  7890. }
  7891. if (!target || typeof target !== 'object') {
  7892. return [target].concat(source);
  7893. }
  7894. var mergeTarget = target;
  7895. if (isArray$1(target) && !isArray$1(source)) {
  7896. mergeTarget = arrayToObject(target, options);
  7897. }
  7898. if (isArray$1(target) && isArray$1(source)) {
  7899. source.forEach(function (item, i) {
  7900. if (has$1.call(target, i)) {
  7901. var targetItem = target[i];
  7902. if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
  7903. target[i] = merge(targetItem, item, options);
  7904. } else {
  7905. target.push(item);
  7906. }
  7907. } else {
  7908. target[i] = item;
  7909. }
  7910. });
  7911. return target;
  7912. }
  7913. return Object.keys(source).reduce(function (acc, key) {
  7914. var value = source[key];
  7915. if (has$1.call(acc, key)) {
  7916. acc[key] = merge(acc[key], value, options);
  7917. } else {
  7918. acc[key] = value;
  7919. }
  7920. return acc;
  7921. }, mergeTarget);
  7922. };
  7923. var assign$1 = function assignSingleSource(target, source) {
  7924. return Object.keys(source).reduce(function (acc, key) {
  7925. acc[key] = source[key];
  7926. return acc;
  7927. }, target);
  7928. };
  7929. var decode$1 = function (str, decoder, charset) {
  7930. var strWithoutPlus = str.replace(/\+/g, ' ');
  7931. if (charset === 'iso-8859-1') {
  7932. // unescape never throws, no try...catch needed:
  7933. return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
  7934. }
  7935. // utf-8
  7936. try {
  7937. return decodeURIComponent(strWithoutPlus);
  7938. } catch (e) {
  7939. return strWithoutPlus;
  7940. }
  7941. };
  7942. var encode$2 = function encode(str, defaultEncoder, charset) {
  7943. // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
  7944. // It has been adapted here for stricter adherence to RFC 3986
  7945. if (str.length === 0) {
  7946. return str;
  7947. }
  7948. var string = str;
  7949. if (typeof str === 'symbol') {
  7950. string = Symbol.prototype.toString.call(str);
  7951. } else if (typeof str !== 'string') {
  7952. string = String(str);
  7953. }
  7954. if (charset === 'iso-8859-1') {
  7955. return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
  7956. return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
  7957. });
  7958. }
  7959. var out = '';
  7960. for (var i = 0; i < string.length; ++i) {
  7961. var c = string.charCodeAt(i);
  7962. if (
  7963. c === 0x2D // -
  7964. || c === 0x2E // .
  7965. || c === 0x5F // _
  7966. || c === 0x7E // ~
  7967. || (c >= 0x30 && c <= 0x39) // 0-9
  7968. || (c >= 0x41 && c <= 0x5A) // a-z
  7969. || (c >= 0x61 && c <= 0x7A) // A-Z
  7970. ) {
  7971. out += string.charAt(i);
  7972. continue;
  7973. }
  7974. if (c < 0x80) {
  7975. out = out + hexTable[c];
  7976. continue;
  7977. }
  7978. if (c < 0x800) {
  7979. out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
  7980. continue;
  7981. }
  7982. if (c < 0xD800 || c >= 0xE000) {
  7983. out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
  7984. continue;
  7985. }
  7986. i += 1;
  7987. c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
  7988. out += hexTable[0xF0 | (c >> 18)]
  7989. + hexTable[0x80 | ((c >> 12) & 0x3F)]
  7990. + hexTable[0x80 | ((c >> 6) & 0x3F)]
  7991. + hexTable[0x80 | (c & 0x3F)];
  7992. }
  7993. return out;
  7994. };
  7995. var compact = function compact(value) {
  7996. var queue = [{ obj: { o: value }, prop: 'o' }];
  7997. var refs = [];
  7998. for (var i = 0; i < queue.length; ++i) {
  7999. var item = queue[i];
  8000. var obj = item.obj[item.prop];
  8001. var keys = Object.keys(obj);
  8002. for (var j = 0; j < keys.length; ++j) {
  8003. var key = keys[j];
  8004. var val = obj[key];
  8005. if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
  8006. queue.push({ obj: obj, prop: key });
  8007. refs.push(val);
  8008. }
  8009. }
  8010. }
  8011. compactQueue(queue);
  8012. return value;
  8013. };
  8014. var isRegExp = function isRegExp(obj) {
  8015. return Object.prototype.toString.call(obj) === '[object RegExp]';
  8016. };
  8017. var isBuffer$1 = function isBuffer(obj) {
  8018. if (!obj || typeof obj !== 'object') {
  8019. return false;
  8020. }
  8021. return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
  8022. };
  8023. var combine = function combine(a, b) {
  8024. return [].concat(a, b);
  8025. };
  8026. var utils$1 = {
  8027. arrayToObject: arrayToObject,
  8028. assign: assign$1,
  8029. combine: combine,
  8030. compact: compact,
  8031. decode: decode$1,
  8032. encode: encode$2,
  8033. isBuffer: isBuffer$1,
  8034. isRegExp: isRegExp,
  8035. merge: merge$1
  8036. };
  8037. var utils_1$1 = utils$1.arrayToObject;
  8038. var utils_2$1 = utils$1.assign;
  8039. var utils_3$1 = utils$1.combine;
  8040. var utils_4$1 = utils$1.compact;
  8041. var utils_5$1 = utils$1.decode;
  8042. var utils_6$1 = utils$1.encode;
  8043. var utils_7$1 = utils$1.isBuffer;
  8044. var utils_8$1 = utils$1.isRegExp;
  8045. var utils_9$1 = utils$1.merge;
  8046. 'use strict';
  8047. var replace = String.prototype.replace;
  8048. var percentTwenties = /%20/g;
  8049. var Format = {
  8050. RFC1738: 'RFC1738',
  8051. RFC3986: 'RFC3986'
  8052. };
  8053. var formats = utils$1.assign(
  8054. {
  8055. 'default': Format.RFC3986,
  8056. formatters: {
  8057. RFC1738: function (value) {
  8058. return replace.call(value, percentTwenties, '+');
  8059. },
  8060. RFC3986: function (value) {
  8061. return String(value);
  8062. }
  8063. }
  8064. },
  8065. Format
  8066. );
  8067. 'use strict';
  8068. var has$2 = Object.prototype.hasOwnProperty;
  8069. var arrayPrefixGenerators = {
  8070. brackets: function brackets(prefix) {
  8071. return prefix + '[]';
  8072. },
  8073. comma: 'comma',
  8074. indices: function indices(prefix, key) {
  8075. return prefix + '[' + key + ']';
  8076. },
  8077. repeat: function repeat(prefix) {
  8078. return prefix;
  8079. }
  8080. };
  8081. var isArray$2 = Array.isArray;
  8082. var push = Array.prototype.push;
  8083. var pushToArray = function (arr, valueOrArray) {
  8084. push.apply(arr, isArray$2(valueOrArray) ? valueOrArray : [valueOrArray]);
  8085. };
  8086. var toISO = Date.prototype.toISOString;
  8087. var defaultFormat = formats['default'];
  8088. var defaults$1 = {
  8089. addQueryPrefix: false,
  8090. allowDots: false,
  8091. charset: 'utf-8',
  8092. charsetSentinel: false,
  8093. delimiter: '&',
  8094. encode: true,
  8095. encoder: utils$1.encode,
  8096. encodeValuesOnly: false,
  8097. format: defaultFormat,
  8098. formatter: formats.formatters[defaultFormat],
  8099. // deprecated
  8100. indices: false,
  8101. serializeDate: function serializeDate(date) {
  8102. return toISO.call(date);
  8103. },
  8104. skipNulls: false,
  8105. strictNullHandling: false
  8106. };
  8107. var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
  8108. return typeof v === 'string'
  8109. || typeof v === 'number'
  8110. || typeof v === 'boolean'
  8111. || typeof v === 'symbol'
  8112. || typeof v === 'bigint';
  8113. };
  8114. var stringify$1 = function stringify(
  8115. object,
  8116. prefix,
  8117. generateArrayPrefix,
  8118. strictNullHandling,
  8119. skipNulls,
  8120. encoder,
  8121. filter,
  8122. sort,
  8123. allowDots,
  8124. serializeDate,
  8125. formatter,
  8126. encodeValuesOnly,
  8127. charset
  8128. ) {
  8129. var obj = object;
  8130. if (typeof filter === 'function') {
  8131. obj = filter(prefix, obj);
  8132. } else if (obj instanceof Date) {
  8133. obj = serializeDate(obj);
  8134. } else if (generateArrayPrefix === 'comma' && isArray$2(obj)) {
  8135. obj = obj.join(',');
  8136. }
  8137. if (obj === null) {
  8138. if (strictNullHandling) {
  8139. return encoder && !encodeValuesOnly ? encoder(prefix, defaults$1.encoder, charset, 'key') : prefix;
  8140. }
  8141. obj = '';
  8142. }
  8143. if (isNonNullishPrimitive(obj) || utils$1.isBuffer(obj)) {
  8144. if (encoder) {
  8145. var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults$1.encoder, charset, 'key');
  8146. return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults$1.encoder, charset, 'value'))];
  8147. }
  8148. return [formatter(prefix) + '=' + formatter(String(obj))];
  8149. }
  8150. var values = [];
  8151. if (typeof obj === 'undefined') {
  8152. return values;
  8153. }
  8154. var objKeys;
  8155. if (isArray$2(filter)) {
  8156. objKeys = filter;
  8157. } else {
  8158. var keys = Object.keys(obj);
  8159. objKeys = sort ? keys.sort(sort) : keys;
  8160. }
  8161. for (var i = 0; i < objKeys.length; ++i) {
  8162. var key = objKeys[i];
  8163. if (skipNulls && obj[key] === null) {
  8164. continue;
  8165. }
  8166. if (isArray$2(obj)) {
  8167. pushToArray(values, stringify(
  8168. obj[key],
  8169. typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix,
  8170. generateArrayPrefix,
  8171. strictNullHandling,
  8172. skipNulls,
  8173. encoder,
  8174. filter,
  8175. sort,
  8176. allowDots,
  8177. serializeDate,
  8178. formatter,
  8179. encodeValuesOnly,
  8180. charset
  8181. ));
  8182. } else {
  8183. pushToArray(values, stringify(
  8184. obj[key],
  8185. prefix + (allowDots ? '.' + key : '[' + key + ']'),
  8186. generateArrayPrefix,
  8187. strictNullHandling,
  8188. skipNulls,
  8189. encoder,
  8190. filter,
  8191. sort,
  8192. allowDots,
  8193. serializeDate,
  8194. formatter,
  8195. encodeValuesOnly,
  8196. charset
  8197. ));
  8198. }
  8199. }
  8200. return values;
  8201. };
  8202. var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
  8203. if (!opts) {
  8204. return defaults$1;
  8205. }
  8206. if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') {
  8207. throw new TypeError('Encoder has to be a function.');
  8208. }
  8209. var charset = opts.charset || defaults$1.charset;
  8210. if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
  8211. throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
  8212. }
  8213. var format = formats['default'];
  8214. if (typeof opts.format !== 'undefined') {
  8215. if (!has$2.call(formats.formatters, opts.format)) {
  8216. throw new TypeError('Unknown format option provided.');
  8217. }
  8218. format = opts.format;
  8219. }
  8220. var formatter = formats.formatters[format];
  8221. var filter = defaults$1.filter;
  8222. if (typeof opts.filter === 'function' || isArray$2(opts.filter)) {
  8223. filter = opts.filter;
  8224. }
  8225. return {
  8226. addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults$1.addQueryPrefix,
  8227. allowDots: typeof opts.allowDots === 'undefined' ? defaults$1.allowDots : !!opts.allowDots,
  8228. charset: charset,
  8229. charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults$1.charsetSentinel,
  8230. delimiter: typeof opts.delimiter === 'undefined' ? defaults$1.delimiter : opts.delimiter,
  8231. encode: typeof opts.encode === 'boolean' ? opts.encode : defaults$1.encode,
  8232. encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults$1.encoder,
  8233. encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults$1.encodeValuesOnly,
  8234. filter: filter,
  8235. formatter: formatter,
  8236. serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults$1.serializeDate,
  8237. skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults$1.skipNulls,
  8238. sort: typeof opts.sort === 'function' ? opts.sort : null,
  8239. strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults$1.strictNullHandling
  8240. };
  8241. };
  8242. var stringify_1 = function (object, opts) {
  8243. var obj = object;
  8244. var options = normalizeStringifyOptions(opts);
  8245. var objKeys;
  8246. var filter;
  8247. if (typeof options.filter === 'function') {
  8248. filter = options.filter;
  8249. obj = filter('', obj);
  8250. } else if (isArray$2(options.filter)) {
  8251. filter = options.filter;
  8252. objKeys = filter;
  8253. }
  8254. var keys = [];
  8255. if (typeof obj !== 'object' || obj === null) {
  8256. return '';
  8257. }
  8258. var arrayFormat;
  8259. if (opts && opts.arrayFormat in arrayPrefixGenerators) {
  8260. arrayFormat = opts.arrayFormat;
  8261. } else if (opts && 'indices' in opts) {
  8262. arrayFormat = opts.indices ? 'indices' : 'repeat';
  8263. } else {
  8264. arrayFormat = 'indices';
  8265. }
  8266. var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
  8267. if (!objKeys) {
  8268. objKeys = Object.keys(obj);
  8269. }
  8270. if (options.sort) {
  8271. objKeys.sort(options.sort);
  8272. }
  8273. for (var i = 0; i < objKeys.length; ++i) {
  8274. var key = objKeys[i];
  8275. if (options.skipNulls && obj[key] === null) {
  8276. continue;
  8277. }
  8278. pushToArray(keys, stringify$1(
  8279. obj[key],
  8280. key,
  8281. generateArrayPrefix,
  8282. options.strictNullHandling,
  8283. options.skipNulls,
  8284. options.encode ? options.encoder : null,
  8285. options.filter,
  8286. options.sort,
  8287. options.allowDots,
  8288. options.serializeDate,
  8289. options.formatter,
  8290. options.encodeValuesOnly,
  8291. options.charset
  8292. ));
  8293. }
  8294. var joined = keys.join(options.delimiter);
  8295. var prefix = options.addQueryPrefix === true ? '?' : '';
  8296. if (options.charsetSentinel) {
  8297. if (options.charset === 'iso-8859-1') {
  8298. // encodeURIComponent('&#10003;'), the "numeric entity" representation of a checkmark
  8299. prefix += 'utf8=%26%2310003%3B&';
  8300. } else {
  8301. // encodeURIComponent('✓')
  8302. prefix += 'utf8=%E2%9C%93&';
  8303. }
  8304. }
  8305. return joined.length > 0 ? prefix + joined : '';
  8306. };
  8307. 'use strict';
  8308. var has$3 = Object.prototype.hasOwnProperty;
  8309. var isArray$3 = Array.isArray;
  8310. var defaults$2 = {
  8311. allowDots: false,
  8312. allowPrototypes: false,
  8313. arrayLimit: 20,
  8314. charset: 'utf-8',
  8315. charsetSentinel: false,
  8316. comma: false,
  8317. decoder: utils$1.decode,
  8318. delimiter: '&',
  8319. depth: 5,
  8320. ignoreQueryPrefix: false,
  8321. interpretNumericEntities: false,
  8322. parameterLimit: 1000,
  8323. parseArrays: true,
  8324. plainObjects: false,
  8325. strictNullHandling: false
  8326. };
  8327. var interpretNumericEntities = function (str) {
  8328. return str.replace(/&#(\d+);/g, function ($0, numberStr) {
  8329. return String.fromCharCode(parseInt(numberStr, 10));
  8330. });
  8331. };
  8332. // This is what browsers will submit when the ✓ character occurs in an
  8333. // application/x-www-form-urlencoded body and the encoding of the page containing
  8334. // the form is iso-8859-1, or when the submitted form has an accept-charset
  8335. // attribute of iso-8859-1. Presumably also with other charsets that do not contain
  8336. // the ✓ character, such as us-ascii.
  8337. var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')
  8338. // These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
  8339. var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
  8340. var parseValues = function parseQueryStringValues(str, options) {
  8341. var obj = {};
  8342. var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
  8343. var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
  8344. var parts = cleanStr.split(options.delimiter, limit);
  8345. var skipIndex = -1; // Keep track of where the utf8 sentinel was found
  8346. var i;
  8347. var charset = options.charset;
  8348. if (options.charsetSentinel) {
  8349. for (i = 0; i < parts.length; ++i) {
  8350. if (parts[i].indexOf('utf8=') === 0) {
  8351. if (parts[i] === charsetSentinel) {
  8352. charset = 'utf-8';
  8353. } else if (parts[i] === isoSentinel) {
  8354. charset = 'iso-8859-1';
  8355. }
  8356. skipIndex = i;
  8357. i = parts.length; // The eslint settings do not allow break;
  8358. }
  8359. }
  8360. }
  8361. for (i = 0; i < parts.length; ++i) {
  8362. if (i === skipIndex) {
  8363. continue;
  8364. }
  8365. var part = parts[i];
  8366. var bracketEqualsPos = part.indexOf(']=');
  8367. var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
  8368. var key, val;
  8369. if (pos === -1) {
  8370. key = options.decoder(part, defaults$2.decoder, charset, 'key');
  8371. val = options.strictNullHandling ? null : '';
  8372. } else {
  8373. key = options.decoder(part.slice(0, pos), defaults$2.decoder, charset, 'key');
  8374. val = options.decoder(part.slice(pos + 1), defaults$2.decoder, charset, 'value');
  8375. }
  8376. if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
  8377. val = interpretNumericEntities(val);
  8378. }
  8379. if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
  8380. val = val.split(',');
  8381. }
  8382. if (part.indexOf('[]=') > -1) {
  8383. val = isArray$3(val) ? [val] : val;
  8384. }
  8385. if (has$3.call(obj, key)) {
  8386. obj[key] = utils$1.combine(obj[key], val);
  8387. } else {
  8388. obj[key] = val;
  8389. }
  8390. }
  8391. return obj;
  8392. };
  8393. var parseObject = function (chain, val, options) {
  8394. var leaf = val;
  8395. for (var i = chain.length - 1; i >= 0; --i) {
  8396. var obj;
  8397. var root = chain[i];
  8398. if (root === '[]' && options.parseArrays) {
  8399. obj = [].concat(leaf);
  8400. } else {
  8401. obj = options.plainObjects ? Object.create(null) : {};
  8402. var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
  8403. var index = parseInt(cleanRoot, 10);
  8404. if (!options.parseArrays && cleanRoot === '') {
  8405. obj = { 0: leaf };
  8406. } else if (
  8407. !isNaN(index)
  8408. && root !== cleanRoot
  8409. && String(index) === cleanRoot
  8410. && index >= 0
  8411. && (options.parseArrays && index <= options.arrayLimit)
  8412. ) {
  8413. obj = [];
  8414. obj[index] = leaf;
  8415. } else {
  8416. obj[cleanRoot] = leaf;
  8417. }
  8418. }
  8419. leaf = obj;
  8420. }
  8421. return leaf;
  8422. };
  8423. var parseKeys = function parseQueryStringKeys(givenKey, val, options) {
  8424. if (!givenKey) {
  8425. return;
  8426. }
  8427. // Transform dot notation to bracket notation
  8428. var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
  8429. // The regex chunks
  8430. var brackets = /(\[[^[\]]*])/;
  8431. var child = /(\[[^[\]]*])/g;
  8432. // Get the parent
  8433. var segment = options.depth > 0 && brackets.exec(key);
  8434. var parent = segment ? key.slice(0, segment.index) : key;
  8435. // Stash the parent if it exists
  8436. var keys = [];
  8437. if (parent) {
  8438. // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
  8439. if (!options.plainObjects && has$3.call(Object.prototype, parent)) {
  8440. if (!options.allowPrototypes) {
  8441. return;
  8442. }
  8443. }
  8444. keys.push(parent);
  8445. }
  8446. // Loop through children appending to the array until we hit depth
  8447. var i = 0;
  8448. while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
  8449. i += 1;
  8450. if (!options.plainObjects && has$3.call(Object.prototype, segment[1].slice(1, -1))) {
  8451. if (!options.allowPrototypes) {
  8452. return;
  8453. }
  8454. }
  8455. keys.push(segment[1]);
  8456. }
  8457. // If there's a remainder, just add whatever is left
  8458. if (segment) {
  8459. keys.push('[' + key.slice(segment.index) + ']');
  8460. }
  8461. return parseObject(keys, val, options);
  8462. };
  8463. var normalizeParseOptions = function normalizeParseOptions(opts) {
  8464. if (!opts) {
  8465. return defaults$2;
  8466. }
  8467. if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
  8468. throw new TypeError('Decoder has to be a function.');
  8469. }
  8470. if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
  8471. throw new Error('The charset option must be either utf-8, iso-8859-1, or undefined');
  8472. }
  8473. var charset = typeof opts.charset === 'undefined' ? defaults$2.charset : opts.charset;
  8474. return {
  8475. allowDots: typeof opts.allowDots === 'undefined' ? defaults$2.allowDots : !!opts.allowDots,
  8476. allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults$2.allowPrototypes,
  8477. arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults$2.arrayLimit,
  8478. charset: charset,
  8479. charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults$2.charsetSentinel,
  8480. comma: typeof opts.comma === 'boolean' ? opts.comma : defaults$2.comma,
  8481. decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults$2.decoder,
  8482. delimiter: typeof opts.delimiter === 'string' || utils$1.isRegExp(opts.delimiter) ? opts.delimiter : defaults$2.delimiter,
  8483. // eslint-disable-next-line no-implicit-coercion, no-extra-parens
  8484. depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults$2.depth,
  8485. ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
  8486. interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults$2.interpretNumericEntities,
  8487. parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults$2.parameterLimit,
  8488. parseArrays: opts.parseArrays !== false,
  8489. plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults$2.plainObjects,
  8490. strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults$2.strictNullHandling
  8491. };
  8492. };
  8493. var parse$1 = function (str, opts) {
  8494. var options = normalizeParseOptions(opts);
  8495. if (str === '' || str === null || typeof str === 'undefined') {
  8496. return options.plainObjects ? Object.create(null) : {};
  8497. }
  8498. var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
  8499. var obj = options.plainObjects ? Object.create(null) : {};
  8500. // Iterate over the keys and setup the new object
  8501. var keys = Object.keys(tempObj);
  8502. for (var i = 0; i < keys.length; ++i) {
  8503. var key = keys[i];
  8504. var newObj = parseKeys(key, tempObj[key], options);
  8505. obj = utils$1.merge(obj, newObj, options);
  8506. }
  8507. return utils$1.compact(obj);
  8508. };
  8509. 'use strict';
  8510. var lib = {
  8511. formats: formats,
  8512. parse: parse$1,
  8513. stringify: stringify_1
  8514. };
  8515. var lib_1 = lib.formats;
  8516. var lib_2 = lib.parse;
  8517. var lib_3 = lib.stringify;
  8518. var client = function(axios, { url, ...credentials }) {
  8519. const config = {
  8520. url,
  8521. method: 'post',
  8522. data: lib.stringify(credentials)
  8523. };
  8524. return () => axios(config).then(res => res.data);
  8525. };
  8526. function getMaxAge(res) {
  8527. return res.expires_in;
  8528. }
  8529. function headerFormatter(res) {
  8530. return 'Bearer ' + res.access_token;
  8531. }
  8532. var interceptor = function (tokenProvider, authenticate) {
  8533. const getToken = tokenProvider.tokenCache(authenticate, { getMaxAge });
  8534. return tokenProvider({ getToken, headerFormatter });
  8535. };
  8536. var src = {
  8537. client: client,
  8538. interceptor: interceptor
  8539. };
  8540. var src_1 = src.client;
  8541. var src_2 = src.interceptor;
  8542. 'use strict';
  8543. /**
  8544. * Check if we're required to add a port number.
  8545. *
  8546. * @see https://url.spec.whatwg.org/#default-port
  8547. * @param {Number|String} port Port number we need to check
  8548. * @param {String} protocol Protocol we need to check against.
  8549. * @returns {Boolean} Is it a default port for the given protocol
  8550. * @api private
  8551. */
  8552. var requiresPort = function required(port, protocol) {
  8553. protocol = protocol.split(':')[0];
  8554. port = +port;
  8555. if (!port) return false;
  8556. switch (protocol) {
  8557. case 'http':
  8558. case 'ws':
  8559. return port !== 80;
  8560. case 'https':
  8561. case 'wss':
  8562. return port !== 443;
  8563. case 'ftp':
  8564. return port !== 21;
  8565. case 'gopher':
  8566. return port !== 70;
  8567. case 'file':
  8568. return false;
  8569. }
  8570. return port !== 0;
  8571. };
  8572. 'use strict';
  8573. var slashes = /^[A-Za-z][A-Za-z0-9+-.]*:\/\//
  8574. , protocolre = /^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i
  8575. , whitespace = '[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]'
  8576. , left = new RegExp('^'+ whitespace +'+');
  8577. /**
  8578. * Trim a given string.
  8579. *
  8580. * @param {String} str String to trim.
  8581. * @public
  8582. */
  8583. function trimLeft(str) {
  8584. return (str ? str : '').toString().replace(left, '');
  8585. }
  8586. /**
  8587. * These are the parse rules for the URL parser, it informs the parser
  8588. * about:
  8589. *
  8590. * 0. The char it Needs to parse, if it's a string it should be done using
  8591. * indexOf, RegExp using exec and NaN means set as current value.
  8592. * 1. The property we should set when parsing this value.
  8593. * 2. Indication if it's backwards or forward parsing, when set as number it's
  8594. * the value of extra chars that should be split off.
  8595. * 3. Inherit from location if non existing in the parser.
  8596. * 4. `toLowerCase` the resulting value.
  8597. */
  8598. var rules = [
  8599. ['#', 'hash'], // Extract from the back.
  8600. ['?', 'query'], // Extract from the back.
  8601. function sanitize(address) { // Sanitize what is left of the address
  8602. return address.replace('\\', '/');
  8603. },
  8604. ['/', 'pathname'], // Extract from the back.
  8605. ['@', 'auth', 1], // Extract from the front.
  8606. [NaN, 'host', undefined, 1, 1], // Set left over value.
  8607. [/:(\d+)$/, 'port', undefined, 1], // RegExp the back.
  8608. [NaN, 'hostname', undefined, 1, 1] // Set left over.
  8609. ];
  8610. /**
  8611. * These properties should not be copied or inherited from. This is only needed
  8612. * for all non blob URL's as a blob URL does not include a hash, only the
  8613. * origin.
  8614. *
  8615. * @type {Object}
  8616. * @private
  8617. */
  8618. var ignore = { hash: 1, query: 1 };
  8619. /**
  8620. * The location object differs when your code is loaded through a normal page,
  8621. * Worker or through a worker using a blob. And with the blobble begins the
  8622. * trouble as the location object will contain the URL of the blob, not the
  8623. * location of the page where our code is loaded in. The actual origin is
  8624. * encoded in the `pathname` so we can thankfully generate a good "default"
  8625. * location from it so we can generate proper relative URL's again.
  8626. *
  8627. * @param {Object|String} loc Optional default location object.
  8628. * @returns {Object} lolcation object.
  8629. * @public
  8630. */
  8631. function lolcation(loc) {
  8632. var globalVar;
  8633. if (typeof window !== 'undefined') globalVar = window;
  8634. else if (typeof commonjsGlobal !== 'undefined') globalVar = commonjsGlobal;
  8635. else if (typeof self !== 'undefined') globalVar = self;
  8636. else globalVar = {};
  8637. var location = globalVar.location || {};
  8638. loc = loc || location;
  8639. var finaldestination = {}
  8640. , type = typeof loc
  8641. , key;
  8642. if ('blob:' === loc.protocol) {
  8643. finaldestination = new Url(unescape(loc.pathname), {});
  8644. } else if ('string' === type) {
  8645. finaldestination = new Url(loc, {});
  8646. for (key in ignore) delete finaldestination[key];
  8647. } else if ('object' === type) {
  8648. for (key in loc) {
  8649. if (key in ignore) continue;
  8650. finaldestination[key] = loc[key];
  8651. }
  8652. if (finaldestination.slashes === undefined) {
  8653. finaldestination.slashes = slashes.test(loc.href);
  8654. }
  8655. }
  8656. return finaldestination;
  8657. }
  8658. /**
  8659. * @typedef ProtocolExtract
  8660. * @type Object
  8661. * @property {String} protocol Protocol matched in the URL, in lowercase.
  8662. * @property {Boolean} slashes `true` if protocol is followed by "//", else `false`.
  8663. * @property {String} rest Rest of the URL that is not part of the protocol.
  8664. */
  8665. /**
  8666. * Extract protocol information from a URL with/without double slash ("//").
  8667. *
  8668. * @param {String} address URL we want to extract from.
  8669. * @return {ProtocolExtract} Extracted information.
  8670. * @private
  8671. */
  8672. function extractProtocol(address) {
  8673. address = trimLeft(address);
  8674. var match = protocolre.exec(address);
  8675. return {
  8676. protocol: match[1] ? match[1].toLowerCase() : '',
  8677. slashes: !!match[2],
  8678. rest: match[3]
  8679. };
  8680. }
  8681. /**
  8682. * Resolve a relative URL pathname against a base URL pathname.
  8683. *
  8684. * @param {String} relative Pathname of the relative URL.
  8685. * @param {String} base Pathname of the base URL.
  8686. * @return {String} Resolved pathname.
  8687. * @private
  8688. */
  8689. function resolve(relative, base) {
  8690. if (relative === '') return base;
  8691. var path = (base || '/').split('/').slice(0, -1).concat(relative.split('/'))
  8692. , i = path.length
  8693. , last = path[i - 1]
  8694. , unshift = false
  8695. , up = 0;
  8696. while (i--) {
  8697. if (path[i] === '.') {
  8698. path.splice(i, 1);
  8699. } else if (path[i] === '..') {
  8700. path.splice(i, 1);
  8701. up++;
  8702. } else if (up) {
  8703. if (i === 0) unshift = true;
  8704. path.splice(i, 1);
  8705. up--;
  8706. }
  8707. }
  8708. if (unshift) path.unshift('');
  8709. if (last === '.' || last === '..') path.push('');
  8710. return path.join('/');
  8711. }
  8712. /**
  8713. * The actual URL instance. Instead of returning an object we've opted-in to
  8714. * create an actual constructor as it's much more memory efficient and
  8715. * faster and it pleases my OCD.
  8716. *
  8717. * It is worth noting that we should not use `URL` as class name to prevent
  8718. * clashes with the global URL instance that got introduced in browsers.
  8719. *
  8720. * @constructor
  8721. * @param {String} address URL we want to parse.
  8722. * @param {Object|String} [location] Location defaults for relative paths.
  8723. * @param {Boolean|Function} [parser] Parser for the query string.
  8724. * @private
  8725. */
  8726. function Url(address, location, parser) {
  8727. address = trimLeft(address);
  8728. if (!(this instanceof Url)) {
  8729. return new Url(address, location, parser);
  8730. }
  8731. var relative, extracted, parse, instruction, index, key
  8732. , instructions = rules.slice()
  8733. , type = typeof location
  8734. , url = this
  8735. , i = 0;
  8736. //
  8737. // The following if statements allows this module two have compatibility with
  8738. // 2 different API:
  8739. //
  8740. // 1. Node.js's `url.parse` api which accepts a URL, boolean as arguments
  8741. // where the boolean indicates that the query string should also be parsed.
  8742. //
  8743. // 2. The `URL` interface of the browser which accepts a URL, object as
  8744. // arguments. The supplied object will be used as default values / fall-back
  8745. // for relative paths.
  8746. //
  8747. if ('object' !== type && 'string' !== type) {
  8748. parser = location;
  8749. location = null;
  8750. }
  8751. if (parser && 'function' !== typeof parser) parser = querystringify_1.parse;
  8752. location = lolcation(location);
  8753. //
  8754. // Extract protocol information before running the instructions.
  8755. //
  8756. extracted = extractProtocol(address || '');
  8757. relative = !extracted.protocol && !extracted.slashes;
  8758. url.slashes = extracted.slashes || relative && location.slashes;
  8759. url.protocol = extracted.protocol || location.protocol || '';
  8760. address = extracted.rest;
  8761. //
  8762. // When the authority component is absent the URL starts with a path
  8763. // component.
  8764. //
  8765. if (!extracted.slashes) instructions[3] = [/(.*)/, 'pathname'];
  8766. for (; i < instructions.length; i++) {
  8767. instruction = instructions[i];
  8768. if (typeof instruction === 'function') {
  8769. address = instruction(address);
  8770. continue;
  8771. }
  8772. parse = instruction[0];
  8773. key = instruction[1];
  8774. if (parse !== parse) {
  8775. url[key] = address;
  8776. } else if ('string' === typeof parse) {
  8777. if (~(index = address.indexOf(parse))) {
  8778. if ('number' === typeof instruction[2]) {
  8779. url[key] = address.slice(0, index);
  8780. address = address.slice(index + instruction[2]);
  8781. } else {
  8782. url[key] = address.slice(index);
  8783. address = address.slice(0, index);
  8784. }
  8785. }
  8786. } else if ((index = parse.exec(address))) {
  8787. url[key] = index[1];
  8788. address = address.slice(0, index.index);
  8789. }
  8790. url[key] = url[key] || (
  8791. relative && instruction[3] ? location[key] || '' : ''
  8792. );
  8793. //
  8794. // Hostname, host and protocol should be lowercased so they can be used to
  8795. // create a proper `origin`.
  8796. //
  8797. if (instruction[4]) url[key] = url[key].toLowerCase();
  8798. }
  8799. //
  8800. // Also parse the supplied query string in to an object. If we're supplied
  8801. // with a custom parser as function use that instead of the default build-in
  8802. // parser.
  8803. //
  8804. if (parser) url.query = parser(url.query);
  8805. //
  8806. // If the URL is relative, resolve the pathname against the base URL.
  8807. //
  8808. if (
  8809. relative
  8810. && location.slashes
  8811. && url.pathname.charAt(0) !== '/'
  8812. && (url.pathname !== '' || location.pathname !== '')
  8813. ) {
  8814. url.pathname = resolve(url.pathname, location.pathname);
  8815. }
  8816. //
  8817. // We should not add port numbers if they are already the default port number
  8818. // for a given protocol. As the host also contains the port number we're going
  8819. // override it with the hostname which contains no port number.
  8820. //
  8821. if (!requiresPort(url.port, url.protocol)) {
  8822. url.host = url.hostname;
  8823. url.port = '';
  8824. }
  8825. //
  8826. // Parse down the `auth` for the username and password.
  8827. //
  8828. url.username = url.password = '';
  8829. if (url.auth) {
  8830. instruction = url.auth.split(':');
  8831. url.username = instruction[0] || '';
  8832. url.password = instruction[1] || '';
  8833. }
  8834. url.origin = url.protocol && url.host && url.protocol !== 'file:'
  8835. ? url.protocol +'//'+ url.host
  8836. : 'null';
  8837. //
  8838. // The href is just the compiled result.
  8839. //
  8840. url.href = url.toString();
  8841. }
  8842. /**
  8843. * This is convenience method for changing properties in the URL instance to
  8844. * insure that they all propagate correctly.
  8845. *
  8846. * @param {String} part Property we need to adjust.
  8847. * @param {Mixed} value The newly assigned value.
  8848. * @param {Boolean|Function} fn When setting the query, it will be the function
  8849. * used to parse the query.
  8850. * When setting the protocol, double slash will be
  8851. * removed from the final url if it is true.
  8852. * @returns {URL} URL instance for chaining.
  8853. * @public
  8854. */
  8855. function set(part, value, fn) {
  8856. var url = this;
  8857. switch (part) {
  8858. case 'query':
  8859. if ('string' === typeof value && value.length) {
  8860. value = (fn || querystringify_1.parse)(value);
  8861. }
  8862. url[part] = value;
  8863. break;
  8864. case 'port':
  8865. url[part] = value;
  8866. if (!requiresPort(value, url.protocol)) {
  8867. url.host = url.hostname;
  8868. url[part] = '';
  8869. } else if (value) {
  8870. url.host = url.hostname +':'+ value;
  8871. }
  8872. break;
  8873. case 'hostname':
  8874. url[part] = value;
  8875. if (url.port) value += ':'+ url.port;
  8876. url.host = value;
  8877. break;
  8878. case 'host':
  8879. url[part] = value;
  8880. if (/:\d+$/.test(value)) {
  8881. value = value.split(':');
  8882. url.port = value.pop();
  8883. url.hostname = value.join(':');
  8884. } else {
  8885. url.hostname = value;
  8886. url.port = '';
  8887. }
  8888. break;
  8889. case 'protocol':
  8890. url.protocol = value.toLowerCase();
  8891. url.slashes = !fn;
  8892. break;
  8893. case 'pathname':
  8894. case 'hash':
  8895. if (value) {
  8896. var char = part === 'pathname' ? '/' : '#';
  8897. url[part] = value.charAt(0) !== char ? char + value : value;
  8898. } else {
  8899. url[part] = value;
  8900. }
  8901. break;
  8902. default:
  8903. url[part] = value;
  8904. }
  8905. for (var i = 0; i < rules.length; i++) {
  8906. var ins = rules[i];
  8907. if (ins[4]) url[ins[1]] = url[ins[1]].toLowerCase();
  8908. }
  8909. url.origin = url.protocol && url.host && url.protocol !== 'file:'
  8910. ? url.protocol +'//'+ url.host
  8911. : 'null';
  8912. url.href = url.toString();
  8913. return url;
  8914. }
  8915. /**
  8916. * Transform the properties back in to a valid and full URL string.
  8917. *
  8918. * @param {Function} stringify Optional query stringify function.
  8919. * @returns {String} Compiled version of the URL.
  8920. * @public
  8921. */
  8922. function toString$1(stringify) {
  8923. if (!stringify || 'function' !== typeof stringify) stringify = querystringify_1.stringify;
  8924. var query
  8925. , url = this
  8926. , protocol = url.protocol;
  8927. if (protocol && protocol.charAt(protocol.length - 1) !== ':') protocol += ':';
  8928. var result = protocol + (url.slashes ? '//' : '');
  8929. if (url.username) {
  8930. result += url.username;
  8931. if (url.password) result += ':'+ url.password;
  8932. result += '@';
  8933. }
  8934. result += url.host + url.pathname;
  8935. query = 'object' === typeof url.query ? stringify(url.query) : url.query;
  8936. if (query) result += '?' !== query.charAt(0) ? '?'+ query : query;
  8937. if (url.hash) result += url.hash;
  8938. return result;
  8939. }
  8940. Url.prototype = { set: set, toString: toString$1 };
  8941. //
  8942. // Expose the URL parser and some additional properties that might be useful for
  8943. // others or testing.
  8944. //
  8945. Url.extractProtocol = extractProtocol;
  8946. Url.location = lolcation;
  8947. Url.trimLeft = trimLeft;
  8948. Url.qs = querystringify_1;
  8949. var urlParse = Url;
  8950. var index_min = createCommonjsModule(function (module) {
  8951. module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n});},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0});},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";r.r(t);var n={statusCodes:[401]};t.default=function e(t,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u=t.interceptors.response.use(function(e){return e},function(s){var i=o.hasOwnProperty("statusCodes")&&o.statusCodes.length?o.statusCodes:n.statusCodes;if(!s.response||s.response.status&&-1===i.indexOf(+s.response.status))return Promise.reject(s);t.interceptors.response.eject(u);var c=r(s),f=t.interceptors.request.use(function(e){return c.then(function(){return e})});return c.then(function(){return t.interceptors.request.eject(f),t(s.response.config)}).catch(function(e){return t.interceptors.request.eject(f),Promise.reject(e)}).finally(function(){return e(t,r,o)})});return t};}]);
  8952. });
  8953. var createAuthRefreshInterceptor = unwrapExports(index_min);
  8954. /* global DOMException */
  8955. var clipboardCopy_1 = clipboardCopy;
  8956. function clipboardCopy (text) {
  8957. // Use the Async Clipboard API when available. Requires a secure browing
  8958. // context (i.e. HTTPS)
  8959. if (navigator.clipboard) {
  8960. return navigator.clipboard.writeText(text).catch(function (err) {
  8961. throw (err !== undefined ? err : new DOMException('The request is not allowed', 'NotAllowedError'))
  8962. })
  8963. }
  8964. // ...Otherwise, use document.execCommand() fallback
  8965. // Put the text to copy into a <span>
  8966. var span = document.createElement('span');
  8967. span.textContent = text;
  8968. // Preserve consecutive spaces and newlines
  8969. span.style.whiteSpace = 'pre';
  8970. // Add the <span> to the page
  8971. document.body.appendChild(span);
  8972. // Make a selection object representing the range of text selected by the user
  8973. var selection = window.getSelection();
  8974. var range = window.document.createRange();
  8975. selection.removeAllRanges();
  8976. range.selectNode(span);
  8977. selection.addRange(range);
  8978. // Copy text to the clipboard
  8979. var success = false;
  8980. try {
  8981. success = window.document.execCommand('copy');
  8982. } catch (err) {
  8983. console.log('error', err);
  8984. }
  8985. // Cleanup
  8986. selection.removeAllRanges();
  8987. window.document.body.removeChild(span);
  8988. return success
  8989. ? Promise.resolve()
  8990. : Promise.reject(new DOMException('The request is not allowed', 'NotAllowedError'))
  8991. }
  8992. const subscriber_queue = [];
  8993. /**
  8994. * Creates a `Readable` store that allows reading by subscription.
  8995. * @param value initial value
  8996. * @param {StartStopNotifier}start start and stop notifications for subscriptions
  8997. */
  8998. function readable(value, start) {
  8999. return {
  9000. subscribe: writable(value, start).subscribe,
  9001. };
  9002. }
  9003. /**
  9004. * Create a `Writable` store that allows both updating and reading by subscription.
  9005. * @param {*=}value initial value
  9006. * @param {StartStopNotifier=}start start and stop notifications for subscriptions
  9007. */
  9008. function writable(value, start = noop) {
  9009. let stop;
  9010. const subscribers = [];
  9011. function set(new_value) {
  9012. if (safe_not_equal(value, new_value)) {
  9013. value = new_value;
  9014. if (stop) { // store is ready
  9015. const run_queue = !subscriber_queue.length;
  9016. for (let i = 0; i < subscribers.length; i += 1) {
  9017. const s = subscribers[i];
  9018. s[1]();
  9019. subscriber_queue.push(s, value);
  9020. }
  9021. if (run_queue) {
  9022. for (let i = 0; i < subscriber_queue.length; i += 2) {
  9023. subscriber_queue[i][0](subscriber_queue[i + 1]);
  9024. }
  9025. subscriber_queue.length = 0;
  9026. }
  9027. }
  9028. }
  9029. }
  9030. function update(fn) {
  9031. set(fn(value));
  9032. }
  9033. function subscribe(run, invalidate = noop) {
  9034. const subscriber = [run, invalidate];
  9035. subscribers.push(subscriber);
  9036. if (subscribers.length === 1) {
  9037. stop = start(set) || noop;
  9038. }
  9039. run(value);
  9040. return () => {
  9041. const index = subscribers.indexOf(subscriber);
  9042. if (index !== -1) {
  9043. subscribers.splice(index, 1);
  9044. }
  9045. if (subscribers.length === 0) {
  9046. stop();
  9047. stop = null;
  9048. }
  9049. };
  9050. }
  9051. return { set, update, subscribe };
  9052. }
  9053. function derived(stores, fn, initial_value) {
  9054. const single = !Array.isArray(stores);
  9055. const stores_array = single
  9056. ? [stores]
  9057. : stores;
  9058. const auto = fn.length < 2;
  9059. return readable(initial_value, (set) => {
  9060. let inited = false;
  9061. const values = [];
  9062. let pending = 0;
  9063. let cleanup = noop;
  9064. const sync = () => {
  9065. if (pending) {
  9066. return;
  9067. }
  9068. cleanup();
  9069. const result = fn(single ? values[0] : values, set);
  9070. if (auto) {
  9071. set(result);
  9072. }
  9073. else {
  9074. cleanup = is_function(result) ? result : noop;
  9075. }
  9076. };
  9077. const unsubscribers = stores_array.map((store, i) => store.subscribe((value) => {
  9078. values[i] = value;
  9079. pending &= ~(1 << i);
  9080. if (inited) {
  9081. sync();
  9082. }
  9083. }, () => {
  9084. pending |= (1 << i);
  9085. }));
  9086. inited = true;
  9087. sync();
  9088. return function stop() {
  9089. run_all(unsubscribers);
  9090. cleanup();
  9091. };
  9092. });
  9093. }
  9094. const env = writable("");
  9095. const token = writable("");
  9096. env.subscribe(val => {
  9097. if (val != "") {
  9098. store2.set("env", val);
  9099. }
  9100. });
  9101. function unique(value, index, self) {
  9102. return self.indexOf(value) === index;
  9103. }
  9104. function add(data, val) {
  9105. const arr = data.split(";");
  9106. arr.push(val);
  9107. return arr
  9108. .filter(unique)
  9109. .filter(String)
  9110. .join(";");
  9111. }
  9112. function remove(data, val) {
  9113. return data
  9114. .split(";")
  9115. .filter(v => v != val)
  9116. .join(";");
  9117. }
  9118. function createAuth() {
  9119. const { subscribe, update } = writable("");
  9120. return {
  9121. subscribe,
  9122. add: val => update(data => add(data, val)),
  9123. remove: val => update(data => remove(data, val))
  9124. };
  9125. }
  9126. const auth = createAuth();
  9127. prism.languages.json = {
  9128. property: {
  9129. pattern: /"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,
  9130. greedy: true
  9131. },
  9132. string: {
  9133. pattern: /"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,
  9134. greedy: true
  9135. },
  9136. comment: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
  9137. number: /-?\d+\.?\d*(e[+-]?\d+)?/i,
  9138. punctuation: /[{}[\],]/,
  9139. operator: /:/,
  9140. boolean: /\b(?:true|false)\b/,
  9141. null: {
  9142. pattern: /\bnull\b/,
  9143. alias: "keyword"
  9144. }
  9145. };
  9146. const highlight = function(code, lang) {
  9147. const supported = ["xml", "json"];
  9148. if (!supported.includes(lang)) {
  9149. lang = "markup";
  9150. }
  9151. return prism.highlight(code, prism.languages[lang], lang);
  9152. };
  9153. marked.setOptions({
  9154. highlight
  9155. });
  9156. const renderer = new marked.Renderer();
  9157. renderer.pre = renderer.code;
  9158. renderer.code = function(code, infostring, escaped) {
  9159. const out = this.pre(code, infostring, escaped);
  9160. return out.replace("<pre>", `<pre class="language-${infostring}">`);
  9161. };
  9162. const markdown = function(source) {
  9163. return source ? marked(source, { renderer: renderer }) : "";
  9164. };
  9165. const toc = function(source) {
  9166. if (!source) {
  9167. return [];
  9168. }
  9169. const tokens = marked.lexer(source);
  9170. const headings = tokens.filter(elem => elem.type === "heading");
  9171. const depths = headings.map(head => head.depth);
  9172. const minDepth = Math.min(...depths);
  9173. return headings.map(head => ({
  9174. text: head.text,
  9175. level: head.depth - minDepth
  9176. }));
  9177. };
  9178. const colorize = function(str, prefix = "is-") {
  9179. switch (str) {
  9180. case "get":
  9181. return `${prefix}success`;
  9182. case "post":
  9183. return `${prefix}link`;
  9184. case "put":
  9185. return `${prefix}primary`;
  9186. case "patch":
  9187. return `${prefix}info`;
  9188. case "delete":
  9189. return `${prefix}danger`;
  9190. case 200:
  9191. case 201:
  9192. case 202:
  9193. case 204:
  9194. return `${prefix}info`;
  9195. case 401:
  9196. case 403:
  9197. case 404:
  9198. case 422:
  9199. return `${prefix}warning`;
  9200. case 500:
  9201. return `${prefix}danger`;
  9202. }
  9203. };
  9204. const slugify = function(str) {
  9205. return speakingurl$1(str, "-");
  9206. };
  9207. const alias = str => {
  9208. return str && str.match("json") ? "json" : "markup";
  9209. };
  9210. const stringify$2 = obj => {
  9211. if (typeof obj === "string") {
  9212. return obj;
  9213. }
  9214. if (obj) {
  9215. return JSON.stringify(obj, null, " ");
  9216. }
  9217. return "";
  9218. };
  9219. const expandUrl = (uri, obj) => {
  9220. const tpl = uritemplate.parse(uri);
  9221. return tpl.expand(obj);
  9222. };
  9223. const actionFilter = (act, regex) => {
  9224. return (
  9225. act.path.match(regex) || act.method.match(regex) || act.title.match(regex)
  9226. );
  9227. };
  9228. const filteredItem = (title, key, items) => {
  9229. if (items.length === 0) {
  9230. return false;
  9231. }
  9232. return { title: title, [key]: items };
  9233. };
  9234. function escape$2(text) {
  9235. return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
  9236. }
  9237. const filterActions = (tagActions, query) => {
  9238. if (query.startsWith("g:")) {
  9239. return tagActions
  9240. .map(tag => {
  9241. const children = tag.children.filter(child => {
  9242. return slugify(child.title) === query.substr(2);
  9243. });
  9244. return filteredItem(tag.title, "children", children.filter(Boolean));
  9245. })
  9246. .filter(Boolean);
  9247. }
  9248. const regex = new RegExp(escape$2(query), "gi");
  9249. return tagActions
  9250. .map(tag => {
  9251. const children = tag.children.map(child => {
  9252. const actions = child.actions.filter(act => actionFilter(act, regex));
  9253. return filteredItem(child.title, "actions", actions);
  9254. });
  9255. return filteredItem(tag.title, "children", children.filter(Boolean));
  9256. })
  9257. .filter(Boolean);
  9258. };
  9259. const basePath = config => {
  9260. if (config.basePath.endsWith("/")) {
  9261. return config.basePath;
  9262. } else {
  9263. return config.basePath + "/";
  9264. }
  9265. };
  9266. const tokenName = env => `token:${env}`;
  9267. const setToken = (env, token) => store2.session.set(tokenName(env), token);
  9268. const getToken = env => store2.session.get(tokenName(env));
  9269. const removeToken = env => store2.session.remove(tokenName(env));
  9270. const refreshTokenName = env => `refresh-token:${env}`;
  9271. const setRefreshToken = (env, token) =>
  9272. store2.session.set(refreshTokenName(env), token);
  9273. const getRefreshToken = env => store2.session.get(refreshTokenName(env));
  9274. const removeRefreshToken = env => store2.session.remove(refreshTokenName(env));
  9275. const isAuth = (environment, name) => {
  9276. return environment.auth && environment.auth.name === name;
  9277. };
  9278. const pushHistory = href => history.pushState(history.state, "", href);
  9279. const requestToken = async (client, options) => {
  9280. const authRequest = src.client(client, options);
  9281. const authCode = await authRequest();
  9282. if (typeof authCode === "string") {
  9283. const authParsed = querystringify_1.parse(authCode);
  9284. return {
  9285. accessToken: authParsed.access_token,
  9286. refreshToken: authParsed.refresh_token
  9287. };
  9288. }
  9289. return {
  9290. accessToken: authCode.access_token,
  9291. refreshToken: authCode.refresh_token
  9292. };
  9293. };
  9294. const exchangeToken = async (code, options) => {
  9295. return requestToken(axios$1.create(), {
  9296. url: options.tokenUrl,
  9297. grant_type: "authorization_code",
  9298. client_id: options.clientId,
  9299. client_secret: options.clientSecret,
  9300. redirect_uri: options.callbackUrl,
  9301. code: code
  9302. });
  9303. };
  9304. const populate = arr => {
  9305. return arr
  9306. .filter(obj => obj.used)
  9307. .reduce((prev, cur) => {
  9308. prev[cur.name] = cur.value;
  9309. return prev;
  9310. }, {});
  9311. };
  9312. const allowBody = action => {
  9313. return ["put", "post", "patch"].includes(action.method);
  9314. };
  9315. const refreshInterceptor = (env, options) => {
  9316. const refreshToken = getRefreshToken(env);
  9317. return async failedRequest => {
  9318. const {
  9319. accessToken: newAccessToken,
  9320. refreshToken: newRefreshToken
  9321. } = await requestToken(axios$1, {
  9322. url: options.tokenUrl,
  9323. grant_type: "refresh_token",
  9324. client_id: options.clientId,
  9325. client_secret: options.clientSecret,
  9326. refresh_token: refreshToken
  9327. });
  9328. if (newAccessToken) {
  9329. token.set(newAccessToken);
  9330. setToken(env, newAccessToken);
  9331. }
  9332. if (newRefreshToken) {
  9333. setRefreshToken(env, newRefreshToken);
  9334. }
  9335. failedRequest.response.config.headers[
  9336. "Authorization"
  9337. ] = `Bearer ${newAccessToken}`;
  9338. };
  9339. };
  9340. const sendRequest = (
  9341. env,
  9342. environment,
  9343. action,
  9344. { headers, parameters, body }
  9345. ) => {
  9346. const client = axios$1.create({
  9347. baseURL: environment.url
  9348. });
  9349. const options = {
  9350. method: action.method,
  9351. headers: populate(headers)
  9352. };
  9353. if (environment.auth) {
  9354. switch (environment.auth.name) {
  9355. case "basic":
  9356. options.auth = environment.auth.options;
  9357. break;
  9358. case "apikey":
  9359. options.headers[environment.auth.options.header] =
  9360. environment.auth.options.key;
  9361. break;
  9362. case "oauth2":
  9363. options.headers["Authorization"] = `Bearer ${getToken(env)}`;
  9364. break;
  9365. }
  9366. }
  9367. const expandedUrl = expandUrl(action.pathTemplate, populate(parameters));
  9368. const destUrl = urlParse(expandedUrl, true);
  9369. options.params = destUrl.query;
  9370. options.url = destUrl.pathname;
  9371. if (allowBody(action)) {
  9372. options.data = body;
  9373. }
  9374. if (isAuth(environment, "oauth2")) {
  9375. createAuthRefreshInterceptor(
  9376. client,
  9377. refreshInterceptor(env, environment.auth.options)
  9378. );
  9379. }
  9380. return client.request(options);
  9381. };
  9382. const copyUrl = (url, parameters) => {
  9383. const expandedUrl = expandUrl(url.pathname, populate(parameters));
  9384. clipboardCopy_1(url.origin + expandedUrl);
  9385. };
  9386. const getEnv = () => store2.get("env");
  9387. /* usr/local/lib/node_modules/snowboard/templates/winter/components/MenuItem.svelte generated by Svelte v3.16.5 */
  9388. function add_css() {
  9389. var style = element("style");
  9390. style.id = "svelte-39af3j-style";
  9391. style.textContent = ".tag.svelte-39af3j{width:3.5rem}.menu-ellipsis.svelte-39af3j{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;padding:0.25em 0.75em}.menu-action.svelte-39af3j{vertical-align:middle}";
  9392. append(document.head, style);
  9393. }
  9394. function get_each_context(ctx, list, i) {
  9395. const child_ctx = ctx.slice();
  9396. child_ctx[7] = list[i];
  9397. return child_ctx;
  9398. }
  9399. // (30:0) {#if title}
  9400. function create_if_block_1(ctx) {
  9401. let li;
  9402. let a0;
  9403. let t0;
  9404. let a0_data_slug_value;
  9405. let a0_href_value;
  9406. let t1;
  9407. let a1;
  9408. let span;
  9409. let i;
  9410. let dispose;
  9411. return {
  9412. c() {
  9413. li = element("li");
  9414. a0 = element("a");
  9415. t0 = text(/*title*/ ctx[1]);
  9416. t1 = space();
  9417. a1 = element("a");
  9418. span = element("span");
  9419. i = element("i");
  9420. attr(a0, "data-slug", a0_data_slug_value = slugify(/*title*/ ctx[1]));
  9421. attr(a0, "href", a0_href_value = "#/g~" + slugify(/*title*/ ctx[1]));
  9422. attr(a0, "class", "is-inline-block");
  9423. attr(i, "class", "fas");
  9424. toggle_class(i, "fa-chevron-right", /*hidden*/ ctx[0]);
  9425. toggle_class(i, "fa-chevron-down", !/*hidden*/ ctx[0]);
  9426. attr(span, "class", "icon is-small has-text-grey-light");
  9427. attr(a1, "href", "javascript:void(0)");
  9428. attr(a1, "class", "is-inline-block is-pulled-right");
  9429. dispose = [
  9430. listen(a0, "click", /*handleGroupClick*/ ctx[5]),
  9431. listen(a1, "click", /*click_handler*/ ctx[6])
  9432. ];
  9433. },
  9434. m(target, anchor) {
  9435. insert(target, li, anchor);
  9436. append(li, a0);
  9437. append(a0, t0);
  9438. append(li, t1);
  9439. append(li, a1);
  9440. append(a1, span);
  9441. append(span, i);
  9442. },
  9443. p(ctx, dirty) {
  9444. if (dirty & /*title*/ 2) set_data(t0, /*title*/ ctx[1]);
  9445. if (dirty & /*title*/ 2 && a0_data_slug_value !== (a0_data_slug_value = slugify(/*title*/ ctx[1]))) {
  9446. attr(a0, "data-slug", a0_data_slug_value);
  9447. }
  9448. if (dirty & /*title*/ 2 && a0_href_value !== (a0_href_value = "#/g~" + slugify(/*title*/ ctx[1]))) {
  9449. attr(a0, "href", a0_href_value);
  9450. }
  9451. if (dirty & /*hidden*/ 1) {
  9452. toggle_class(i, "fa-chevron-right", /*hidden*/ ctx[0]);
  9453. }
  9454. if (dirty & /*hidden*/ 1) {
  9455. toggle_class(i, "fa-chevron-down", !/*hidden*/ ctx[0]);
  9456. }
  9457. },
  9458. d(detaching) {
  9459. if (detaching) detach(li);
  9460. run_all(dispose);
  9461. }
  9462. };
  9463. }
  9464. // (53:0) {#if actions.length > 0}
  9465. function create_if_block(ctx) {
  9466. let li;
  9467. let ul;
  9468. let each_value = /*actions*/ ctx[2];
  9469. let each_blocks = [];
  9470. for (let i = 0; i < each_value.length; i += 1) {
  9471. each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
  9472. }
  9473. return {
  9474. c() {
  9475. li = element("li");
  9476. ul = element("ul");
  9477. for (let i = 0; i < each_blocks.length; i += 1) {
  9478. each_blocks[i].c();
  9479. }
  9480. toggle_class(li, "is-hidden", /*hidden*/ ctx[0]);
  9481. },
  9482. m(target, anchor) {
  9483. insert(target, li, anchor);
  9484. append(li, ul);
  9485. for (let i = 0; i < each_blocks.length; i += 1) {
  9486. each_blocks[i].m(ul, null);
  9487. }
  9488. },
  9489. p(ctx, dirty) {
  9490. if (dirty & /*actions, currentSlug, handleClick, colorize*/ 28) {
  9491. each_value = /*actions*/ ctx[2];
  9492. let i;
  9493. for (i = 0; i < each_value.length; i += 1) {
  9494. const child_ctx = get_each_context(ctx, each_value, i);
  9495. if (each_blocks[i]) {
  9496. each_blocks[i].p(child_ctx, dirty);
  9497. } else {
  9498. each_blocks[i] = create_each_block(child_ctx);
  9499. each_blocks[i].c();
  9500. each_blocks[i].m(ul, null);
  9501. }
  9502. }
  9503. for (; i < each_blocks.length; i += 1) {
  9504. each_blocks[i].d(1);
  9505. }
  9506. each_blocks.length = each_value.length;
  9507. }
  9508. if (dirty & /*hidden*/ 1) {
  9509. toggle_class(li, "is-hidden", /*hidden*/ ctx[0]);
  9510. }
  9511. },
  9512. d(detaching) {
  9513. if (detaching) detach(li);
  9514. destroy_each(each_blocks, detaching);
  9515. }
  9516. };
  9517. }
  9518. // (56:6) {#each actions as action}
  9519. function create_each_block(ctx) {
  9520. let li;
  9521. let a;
  9522. let code;
  9523. let t0_value = /*action*/ ctx[7].method + "";
  9524. let t0;
  9525. let code_class_value;
  9526. let t1;
  9527. let span;
  9528. let t2_value = /*action*/ ctx[7].title + "";
  9529. let t2;
  9530. let a_data_slug_value;
  9531. let a_href_value;
  9532. let t3;
  9533. let dispose;
  9534. return {
  9535. c() {
  9536. li = element("li");
  9537. a = element("a");
  9538. code = element("code");
  9539. t0 = text(t0_value);
  9540. t1 = space();
  9541. span = element("span");
  9542. t2 = text(t2_value);
  9543. t3 = space();
  9544. attr(code, "class", code_class_value = "tag " + colorize(/*action*/ ctx[7].method) + " is-uppercase" + " svelte-39af3j");
  9545. attr(span, "class", "menu-action svelte-39af3j");
  9546. attr(a, "data-slug", a_data_slug_value = /*action*/ ctx[7].slug);
  9547. attr(a, "href", a_href_value = "#/" + /*action*/ ctx[7].slug);
  9548. attr(a, "class", "menu-ellipsis svelte-39af3j");
  9549. toggle_class(a, "is-active", /*action*/ ctx[7].slug === /*currentSlug*/ ctx[3]);
  9550. dispose = listen(a, "click", /*handleClick*/ ctx[4]);
  9551. },
  9552. m(target, anchor) {
  9553. insert(target, li, anchor);
  9554. append(li, a);
  9555. append(a, code);
  9556. append(code, t0);
  9557. append(a, t1);
  9558. append(a, span);
  9559. append(span, t2);
  9560. append(li, t3);
  9561. },
  9562. p(ctx, dirty) {
  9563. if (dirty & /*actions*/ 4 && t0_value !== (t0_value = /*action*/ ctx[7].method + "")) set_data(t0, t0_value);
  9564. if (dirty & /*actions*/ 4 && code_class_value !== (code_class_value = "tag " + colorize(/*action*/ ctx[7].method) + " is-uppercase" + " svelte-39af3j")) {
  9565. attr(code, "class", code_class_value);
  9566. }
  9567. if (dirty & /*actions*/ 4 && t2_value !== (t2_value = /*action*/ ctx[7].title + "")) set_data(t2, t2_value);
  9568. if (dirty & /*actions*/ 4 && a_data_slug_value !== (a_data_slug_value = /*action*/ ctx[7].slug)) {
  9569. attr(a, "data-slug", a_data_slug_value);
  9570. }
  9571. if (dirty & /*actions*/ 4 && a_href_value !== (a_href_value = "#/" + /*action*/ ctx[7].slug)) {
  9572. attr(a, "href", a_href_value);
  9573. }
  9574. if (dirty & /*actions, currentSlug*/ 12) {
  9575. toggle_class(a, "is-active", /*action*/ ctx[7].slug === /*currentSlug*/ ctx[3]);
  9576. }
  9577. },
  9578. d(detaching) {
  9579. if (detaching) detach(li);
  9580. dispose();
  9581. }
  9582. };
  9583. }
  9584. function create_fragment(ctx) {
  9585. let t;
  9586. let if_block1_anchor;
  9587. let if_block0 = /*title*/ ctx[1] && create_if_block_1(ctx);
  9588. let if_block1 = /*actions*/ ctx[2].length > 0 && create_if_block(ctx);
  9589. return {
  9590. c() {
  9591. if (if_block0) if_block0.c();
  9592. t = space();
  9593. if (if_block1) if_block1.c();
  9594. if_block1_anchor = empty();
  9595. },
  9596. m(target, anchor) {
  9597. if (if_block0) if_block0.m(target, anchor);
  9598. insert(target, t, anchor);
  9599. if (if_block1) if_block1.m(target, anchor);
  9600. insert(target, if_block1_anchor, anchor);
  9601. },
  9602. p(ctx, [dirty]) {
  9603. if (/*title*/ ctx[1]) {
  9604. if (if_block0) {
  9605. if_block0.p(ctx, dirty);
  9606. } else {
  9607. if_block0 = create_if_block_1(ctx);
  9608. if_block0.c();
  9609. if_block0.m(t.parentNode, t);
  9610. }
  9611. } else if (if_block0) {
  9612. if_block0.d(1);
  9613. if_block0 = null;
  9614. }
  9615. if (/*actions*/ ctx[2].length > 0) {
  9616. if (if_block1) {
  9617. if_block1.p(ctx, dirty);
  9618. } else {
  9619. if_block1 = create_if_block(ctx);
  9620. if_block1.c();
  9621. if_block1.m(if_block1_anchor.parentNode, if_block1_anchor);
  9622. }
  9623. } else if (if_block1) {
  9624. if_block1.d(1);
  9625. if_block1 = null;
  9626. }
  9627. },
  9628. i: noop,
  9629. o: noop,
  9630. d(detaching) {
  9631. if (if_block0) if_block0.d(detaching);
  9632. if (detaching) detach(t);
  9633. if (if_block1) if_block1.d(detaching);
  9634. if (detaching) detach(if_block1_anchor);
  9635. }
  9636. };
  9637. }
  9638. function instance($$self, $$props, $$invalidate) {
  9639. let { title } = $$props;
  9640. let { actions } = $$props;
  9641. let { currentSlug } = $$props;
  9642. let { hidden = false } = $$props;
  9643. let { handleClick } = $$props;
  9644. let { handleGroupClick } = $$props;
  9645. const click_handler = () => $$invalidate(0, hidden = !hidden);
  9646. $$self.$set = $$props => {
  9647. if ("title" in $$props) $$invalidate(1, title = $$props.title);
  9648. if ("actions" in $$props) $$invalidate(2, actions = $$props.actions);
  9649. if ("currentSlug" in $$props) $$invalidate(3, currentSlug = $$props.currentSlug);
  9650. if ("hidden" in $$props) $$invalidate(0, hidden = $$props.hidden);
  9651. if ("handleClick" in $$props) $$invalidate(4, handleClick = $$props.handleClick);
  9652. if ("handleGroupClick" in $$props) $$invalidate(5, handleGroupClick = $$props.handleGroupClick);
  9653. };
  9654. return [
  9655. hidden,
  9656. title,
  9657. actions,
  9658. currentSlug,
  9659. handleClick,
  9660. handleGroupClick,
  9661. click_handler
  9662. ];
  9663. }
  9664. class MenuItem extends SvelteComponent {
  9665. constructor(options) {
  9666. super();
  9667. if (!document.getElementById("svelte-39af3j-style")) add_css();
  9668. init(this, options, instance, create_fragment, safe_not_equal, {
  9669. title: 1,
  9670. actions: 2,
  9671. currentSlug: 3,
  9672. hidden: 0,
  9673. handleClick: 4,
  9674. handleGroupClick: 5
  9675. });
  9676. }
  9677. }
  9678. /* usr/local/lib/node_modules/snowboard/templates/winter/panels/MenuPanel.svelte generated by Svelte v3.16.5 */
  9679. function add_css$1() {
  9680. var style = element("style");
  9681. style.id = "svelte-fvssqr-style";
  9682. style.textContent = ".hero.svelte-fvssqr,.menu-wrapper.svelte-fvssqr{padding:0 2.75rem 0 2rem}.hero.svelte-fvssqr{position:sticky;top:54px;background-color:#fafafa;margin-bottom:1.5rem}.hero.is-darkmode.svelte-fvssqr{background-color:#000}.hero-body.svelte-fvssqr{padding:1.5rem 0;box-shadow:0 2px 0 0 #f5f5f5}.hero-body.is-darkmode.svelte-fvssqr{box-shadow:0 2px 0 0 #363636}.menu-wrapper.svelte-fvssqr::-webkit-scrollbar{display:none}@media screen and (min-width: 768px){.hero.svelte-fvssqr,.menu-wrapper.svelte-fvssqr{width:-moz-calc(25% - 0.5rem);width:-webkit-calc(25% - 0.5rem);width:-o-calc(25% - 0.5rem);width:calc(25% - 0.5rem)}.hero.svelte-fvssqr{position:fixed;padding:0 1.25rem}.menu-wrapper.svelte-fvssqr{position:fixed;top:140px;padding:1.5rem 1.25rem 1.25rem;height:-moz-calc(100% - 150px - 2.5rem);height:-webkit-calc(100% - 150px - 2.5rem);height:-o-calc(100% - 150px - 2.5rem);height:calc(100% - 150px - 2.5rem);overflow:-moz-scrollbars-none;-ms-overflow-style:none;overflow-x:hidden;overflow-y:auto;transition:opacity 0.3s, left 0.3s}.menu.is-collapsed.svelte-fvssqr{width:3rem}.is-collapsed.svelte-fvssqr .hero.svelte-fvssqr,.is-collapsed.svelte-fvssqr .hero-body.svelte-fvssqr{width:calc(3rem - 2px)}.is-collapsed.svelte-fvssqr .hero.svelte-fvssqr{padding-left:0;padding-right:0}.is-collapsed.svelte-fvssqr .hero-body.svelte-fvssqr{padding-left:0.3175rem;padding-right:0.3175rem;box-shadow:none}.is-collapsed.svelte-fvssqr .input.is-rounded.svelte-fvssqr{padding-left:0;padding-right:0;opacity:0}.is-collapsed.svelte-fvssqr .icon-input-search.svelte-fvssqr{color:#b5b5b5;background-color:#eee;-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%;cursor:pointer;pointer-events:auto}.is-collapsed.svelte-fvssqr .icon-input-search.svelte-fvssqr:hover{color:#999;background-color:#e0e0e0}.is-collapsed.svelte-fvssqr .is-darkmode .icon-input-search.svelte-fvssqr{color:#ccc;background-color:#484848}.is-collapsed.svelte-fvssqr .is-darkmode .icon-input-search.svelte-fvssqr:hover{color:#fff;background-color:#484848}.is-collapsed.svelte-fvssqr .menu-wrapper.svelte-fvssqr{left:-30%;opacity:0}}";
  9683. append(document.head, style);
  9684. }
  9685. function get_each_context_1(ctx, list, i) {
  9686. const child_ctx = ctx.slice();
  9687. child_ctx[17] = list[i];
  9688. return child_ctx;
  9689. }
  9690. function get_each_context$1(ctx, list, i) {
  9691. const child_ctx = ctx.slice();
  9692. child_ctx[14] = list[i];
  9693. return child_ctx;
  9694. }
  9695. function get_each_context_2(ctx, list, i) {
  9696. const child_ctx = ctx.slice();
  9697. child_ctx[20] = list[i];
  9698. return child_ctx;
  9699. }
  9700. // (165:4) {#if query === ''}
  9701. function create_if_block_1$1(ctx) {
  9702. let ul;
  9703. let li;
  9704. let a;
  9705. let t0;
  9706. let a_href_value;
  9707. let t1;
  9708. let dispose;
  9709. let if_block = /*tagHeaders*/ ctx[2] && create_if_block_2(ctx);
  9710. return {
  9711. c() {
  9712. ul = element("ul");
  9713. li = element("li");
  9714. a = element("a");
  9715. t0 = text("Introduction");
  9716. t1 = space();
  9717. if (if_block) if_block.c();
  9718. attr(a, "href", a_href_value = basePath(/*config*/ ctx[1]));
  9719. attr(ul, "class", "menu-list");
  9720. dispose = listen(a, "click", prevent_default(/*tocClick*/ ctx[9]));
  9721. },
  9722. m(target, anchor) {
  9723. insert(target, ul, anchor);
  9724. append(ul, li);
  9725. append(li, a);
  9726. append(a, t0);
  9727. append(ul, t1);
  9728. if (if_block) if_block.m(ul, null);
  9729. },
  9730. p(ctx, dirty) {
  9731. if (dirty & /*config*/ 2 && a_href_value !== (a_href_value = basePath(/*config*/ ctx[1]))) {
  9732. attr(a, "href", a_href_value);
  9733. }
  9734. if (/*tagHeaders*/ ctx[2]) {
  9735. if (if_block) {
  9736. if_block.p(ctx, dirty);
  9737. } else {
  9738. if_block = create_if_block_2(ctx);
  9739. if_block.c();
  9740. if_block.m(ul, null);
  9741. }
  9742. } else if (if_block) {
  9743. if_block.d(1);
  9744. if_block = null;
  9745. }
  9746. },
  9747. d(detaching) {
  9748. if (detaching) detach(ul);
  9749. if (if_block) if_block.d();
  9750. dispose();
  9751. }
  9752. };
  9753. }
  9754. // (172:8) {#if tagHeaders}
  9755. function create_if_block_2(ctx) {
  9756. let li;
  9757. let ul;
  9758. let each_value_2 = /*tagHeaders*/ ctx[2];
  9759. let each_blocks = [];
  9760. for (let i = 0; i < each_value_2.length; i += 1) {
  9761. each_blocks[i] = create_each_block_2(get_each_context_2(ctx, each_value_2, i));
  9762. }
  9763. return {
  9764. c() {
  9765. li = element("li");
  9766. ul = element("ul");
  9767. for (let i = 0; i < each_blocks.length; i += 1) {
  9768. each_blocks[i].c();
  9769. }
  9770. },
  9771. m(target, anchor) {
  9772. insert(target, li, anchor);
  9773. append(li, ul);
  9774. for (let i = 0; i < each_blocks.length; i += 1) {
  9775. each_blocks[i].m(ul, null);
  9776. }
  9777. },
  9778. p(ctx, dirty) {
  9779. if (dirty & /*tagHeaders, headerLink, tocClick*/ 516) {
  9780. each_value_2 = /*tagHeaders*/ ctx[2];
  9781. let i;
  9782. for (i = 0; i < each_value_2.length; i += 1) {
  9783. const child_ctx = get_each_context_2(ctx, each_value_2, i);
  9784. if (each_blocks[i]) {
  9785. each_blocks[i].p(child_ctx, dirty);
  9786. } else {
  9787. each_blocks[i] = create_each_block_2(child_ctx);
  9788. each_blocks[i].c();
  9789. each_blocks[i].m(ul, null);
  9790. }
  9791. }
  9792. for (; i < each_blocks.length; i += 1) {
  9793. each_blocks[i].d(1);
  9794. }
  9795. each_blocks.length = each_value_2.length;
  9796. }
  9797. },
  9798. d(detaching) {
  9799. if (detaching) detach(li);
  9800. destroy_each(each_blocks, detaching);
  9801. }
  9802. };
  9803. }
  9804. // (176:16) {#if header.level === 0}
  9805. function create_if_block_3(ctx) {
  9806. let li;
  9807. let a;
  9808. let t0_value = /*header*/ ctx[20].text + "";
  9809. let t0;
  9810. let a_href_value;
  9811. let t1;
  9812. let dispose;
  9813. return {
  9814. c() {
  9815. li = element("li");
  9816. a = element("a");
  9817. t0 = text(t0_value);
  9818. t1 = space();
  9819. attr(a, "href", a_href_value = "#" + headerLink(/*header*/ ctx[20].text));
  9820. dispose = listen(a, "click", /*tocClick*/ ctx[9]);
  9821. },
  9822. m(target, anchor) {
  9823. insert(target, li, anchor);
  9824. append(li, a);
  9825. append(a, t0);
  9826. append(li, t1);
  9827. },
  9828. p(ctx, dirty) {
  9829. if (dirty & /*tagHeaders*/ 4 && t0_value !== (t0_value = /*header*/ ctx[20].text + "")) set_data(t0, t0_value);
  9830. if (dirty & /*tagHeaders*/ 4 && a_href_value !== (a_href_value = "#" + headerLink(/*header*/ ctx[20].text))) {
  9831. attr(a, "href", a_href_value);
  9832. }
  9833. },
  9834. d(detaching) {
  9835. if (detaching) detach(li);
  9836. dispose();
  9837. }
  9838. };
  9839. }
  9840. // (175:14) {#each tagHeaders as header}
  9841. function create_each_block_2(ctx) {
  9842. let if_block_anchor;
  9843. let if_block = /*header*/ ctx[20].level === 0 && create_if_block_3(ctx);
  9844. return {
  9845. c() {
  9846. if (if_block) if_block.c();
  9847. if_block_anchor = empty();
  9848. },
  9849. m(target, anchor) {
  9850. if (if_block) if_block.m(target, anchor);
  9851. insert(target, if_block_anchor, anchor);
  9852. },
  9853. p(ctx, dirty) {
  9854. if (/*header*/ ctx[20].level === 0) {
  9855. if (if_block) {
  9856. if_block.p(ctx, dirty);
  9857. } else {
  9858. if_block = create_if_block_3(ctx);
  9859. if_block.c();
  9860. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  9861. }
  9862. } else if (if_block) {
  9863. if_block.d(1);
  9864. if_block = null;
  9865. }
  9866. },
  9867. d(detaching) {
  9868. if (if_block) if_block.d(detaching);
  9869. if (detaching) detach(if_block_anchor);
  9870. }
  9871. };
  9872. }
  9873. // (191:6) {#if tag.title}
  9874. function create_if_block$1(ctx) {
  9875. let p;
  9876. let t_value = /*tag*/ ctx[14].title + "";
  9877. let t;
  9878. return {
  9879. c() {
  9880. p = element("p");
  9881. t = text(t_value);
  9882. attr(p, "class", "menu-label");
  9883. },
  9884. m(target, anchor) {
  9885. insert(target, p, anchor);
  9886. append(p, t);
  9887. },
  9888. p(ctx, dirty) {
  9889. if (dirty & /*filteredActions*/ 2048 && t_value !== (t_value = /*tag*/ ctx[14].title + "")) set_data(t, t_value);
  9890. },
  9891. d(detaching) {
  9892. if (detaching) detach(p);
  9893. }
  9894. };
  9895. }
  9896. // (196:8) {#each tag.children as child}
  9897. function create_each_block_1(ctx) {
  9898. let current;
  9899. const menuitem = new MenuItem({
  9900. props: {
  9901. title: /*child*/ ctx[17].title,
  9902. actions: /*child*/ ctx[17].actions,
  9903. hidden: /*actionsCount*/ ctx[4] > 50,
  9904. currentSlug: /*currentSlug*/ ctx[3],
  9905. handleClick: /*handleClick*/ ctx[7],
  9906. handleGroupClick: /*handleGroupClick*/ ctx[8]
  9907. }
  9908. });
  9909. return {
  9910. c() {
  9911. create_component(menuitem.$$.fragment);
  9912. },
  9913. m(target, anchor) {
  9914. mount_component(menuitem, target, anchor);
  9915. current = true;
  9916. },
  9917. p(ctx, dirty) {
  9918. const menuitem_changes = {};
  9919. if (dirty & /*filteredActions*/ 2048) menuitem_changes.title = /*child*/ ctx[17].title;
  9920. if (dirty & /*filteredActions*/ 2048) menuitem_changes.actions = /*child*/ ctx[17].actions;
  9921. if (dirty & /*actionsCount*/ 16) menuitem_changes.hidden = /*actionsCount*/ ctx[4] > 50;
  9922. if (dirty & /*currentSlug*/ 8) menuitem_changes.currentSlug = /*currentSlug*/ ctx[3];
  9923. if (dirty & /*handleClick*/ 128) menuitem_changes.handleClick = /*handleClick*/ ctx[7];
  9924. if (dirty & /*handleGroupClick*/ 256) menuitem_changes.handleGroupClick = /*handleGroupClick*/ ctx[8];
  9925. menuitem.$set(menuitem_changes);
  9926. },
  9927. i(local) {
  9928. if (current) return;
  9929. transition_in(menuitem.$$.fragment, local);
  9930. current = true;
  9931. },
  9932. o(local) {
  9933. transition_out(menuitem.$$.fragment, local);
  9934. current = false;
  9935. },
  9936. d(detaching) {
  9937. destroy_component(menuitem, detaching);
  9938. }
  9939. };
  9940. }
  9941. // (190:4) {#each filteredActions as tag}
  9942. function create_each_block$1(ctx) {
  9943. let t0;
  9944. let ul;
  9945. let t1;
  9946. let current;
  9947. let if_block = /*tag*/ ctx[14].title && create_if_block$1(ctx);
  9948. let each_value_1 = /*tag*/ ctx[14].children;
  9949. let each_blocks = [];
  9950. for (let i = 0; i < each_value_1.length; i += 1) {
  9951. each_blocks[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i));
  9952. }
  9953. const out = i => transition_out(each_blocks[i], 1, 1, () => {
  9954. each_blocks[i] = null;
  9955. });
  9956. return {
  9957. c() {
  9958. if (if_block) if_block.c();
  9959. t0 = space();
  9960. ul = element("ul");
  9961. for (let i = 0; i < each_blocks.length; i += 1) {
  9962. each_blocks[i].c();
  9963. }
  9964. t1 = space();
  9965. attr(ul, "class", "menu-list");
  9966. },
  9967. m(target, anchor) {
  9968. if (if_block) if_block.m(target, anchor);
  9969. insert(target, t0, anchor);
  9970. insert(target, ul, anchor);
  9971. for (let i = 0; i < each_blocks.length; i += 1) {
  9972. each_blocks[i].m(ul, null);
  9973. }
  9974. append(ul, t1);
  9975. current = true;
  9976. },
  9977. p(ctx, dirty) {
  9978. if (/*tag*/ ctx[14].title) {
  9979. if (if_block) {
  9980. if_block.p(ctx, dirty);
  9981. } else {
  9982. if_block = create_if_block$1(ctx);
  9983. if_block.c();
  9984. if_block.m(t0.parentNode, t0);
  9985. }
  9986. } else if (if_block) {
  9987. if_block.d(1);
  9988. if_block = null;
  9989. }
  9990. if (dirty & /*filteredActions, actionsCount, currentSlug, handleClick, handleGroupClick*/ 2456) {
  9991. each_value_1 = /*tag*/ ctx[14].children;
  9992. let i;
  9993. for (i = 0; i < each_value_1.length; i += 1) {
  9994. const child_ctx = get_each_context_1(ctx, each_value_1, i);
  9995. if (each_blocks[i]) {
  9996. each_blocks[i].p(child_ctx, dirty);
  9997. transition_in(each_blocks[i], 1);
  9998. } else {
  9999. each_blocks[i] = create_each_block_1(child_ctx);
  10000. each_blocks[i].c();
  10001. transition_in(each_blocks[i], 1);
  10002. each_blocks[i].m(ul, t1);
  10003. }
  10004. }
  10005. group_outros();
  10006. for (i = each_value_1.length; i < each_blocks.length; i += 1) {
  10007. out(i);
  10008. }
  10009. check_outros();
  10010. }
  10011. },
  10012. i(local) {
  10013. if (current) return;
  10014. for (let i = 0; i < each_value_1.length; i += 1) {
  10015. transition_in(each_blocks[i]);
  10016. }
  10017. current = true;
  10018. },
  10019. o(local) {
  10020. each_blocks = each_blocks.filter(Boolean);
  10021. for (let i = 0; i < each_blocks.length; i += 1) {
  10022. transition_out(each_blocks[i]);
  10023. }
  10024. current = false;
  10025. },
  10026. d(detaching) {
  10027. if (if_block) if_block.d(detaching);
  10028. if (detaching) detach(t0);
  10029. if (detaching) detach(ul);
  10030. destroy_each(each_blocks, detaching);
  10031. }
  10032. };
  10033. }
  10034. function create_fragment$1(ctx) {
  10035. let aside;
  10036. let section;
  10037. let div1;
  10038. let div0;
  10039. let p0;
  10040. let input;
  10041. let t0;
  10042. let span;
  10043. let t1;
  10044. let div2;
  10045. let p1;
  10046. let t3;
  10047. let t4;
  10048. let current;
  10049. let dispose;
  10050. let if_block = /*query*/ ctx[0] === "" && create_if_block_1$1(ctx);
  10051. let each_value = /*filteredActions*/ ctx[11];
  10052. let each_blocks = [];
  10053. for (let i = 0; i < each_value.length; i += 1) {
  10054. each_blocks[i] = create_each_block$1(get_each_context$1(ctx, each_value, i));
  10055. }
  10056. const out = i => transition_out(each_blocks[i], 1, 1, () => {
  10057. each_blocks[i] = null;
  10058. });
  10059. return {
  10060. c() {
  10061. aside = element("aside");
  10062. section = element("section");
  10063. div1 = element("div");
  10064. div0 = element("div");
  10065. p0 = element("p");
  10066. input = element("input");
  10067. t0 = space();
  10068. span = element("span");
  10069. span.innerHTML = `<i class="fas fa-search"></i>`;
  10070. t1 = space();
  10071. div2 = element("div");
  10072. p1 = element("p");
  10073. p1.textContent = "API";
  10074. t3 = space();
  10075. if (if_block) if_block.c();
  10076. t4 = space();
  10077. for (let i = 0; i < each_blocks.length; i += 1) {
  10078. each_blocks[i].c();
  10079. }
  10080. attr(input, "id", "search-input-text");
  10081. attr(input, "class", "input is-rounded svelte-fvssqr");
  10082. attr(input, "placeholder", "Filter by path, method, and title...");
  10083. attr(span, "class", "icon is-right icon-input-search svelte-fvssqr");
  10084. attr(p0, "class", "control has-icons-right");
  10085. attr(div0, "class", "field");
  10086. attr(div1, "class", "hero-body svelte-fvssqr");
  10087. toggle_class(div1, "is-darkmode", /*isDarkmode*/ ctx[6]);
  10088. attr(section, "class", "hero is-sticky svelte-fvssqr");
  10089. toggle_class(section, "is-darkmode", /*isDarkmode*/ ctx[6]);
  10090. attr(p1, "class", "menu-label");
  10091. attr(div2, "class", "menu-wrapper svelte-fvssqr");
  10092. attr(aside, "class", "menu svelte-fvssqr");
  10093. toggle_class(aside, "is-collapsed", /*isCollapsed*/ ctx[5]);
  10094. dispose = [
  10095. listen(input, "input", /*input_input_handler*/ ctx[13]),
  10096. listen(span, "click", /*searchClick*/ ctx[10])
  10097. ];
  10098. },
  10099. m(target, anchor) {
  10100. insert(target, aside, anchor);
  10101. append(aside, section);
  10102. append(section, div1);
  10103. append(div1, div0);
  10104. append(div0, p0);
  10105. append(p0, input);
  10106. set_input_value(input, /*query*/ ctx[0]);
  10107. append(p0, t0);
  10108. append(p0, span);
  10109. append(aside, t1);
  10110. append(aside, div2);
  10111. append(div2, p1);
  10112. append(div2, t3);
  10113. if (if_block) if_block.m(div2, null);
  10114. append(div2, t4);
  10115. for (let i = 0; i < each_blocks.length; i += 1) {
  10116. each_blocks[i].m(div2, null);
  10117. }
  10118. current = true;
  10119. },
  10120. p(ctx, [dirty]) {
  10121. if (dirty & /*query*/ 1 && input.value !== /*query*/ ctx[0]) {
  10122. set_input_value(input, /*query*/ ctx[0]);
  10123. }
  10124. if (dirty & /*isDarkmode*/ 64) {
  10125. toggle_class(div1, "is-darkmode", /*isDarkmode*/ ctx[6]);
  10126. }
  10127. if (dirty & /*isDarkmode*/ 64) {
  10128. toggle_class(section, "is-darkmode", /*isDarkmode*/ ctx[6]);
  10129. }
  10130. if (/*query*/ ctx[0] === "") {
  10131. if (if_block) {
  10132. if_block.p(ctx, dirty);
  10133. } else {
  10134. if_block = create_if_block_1$1(ctx);
  10135. if_block.c();
  10136. if_block.m(div2, t4);
  10137. }
  10138. } else if (if_block) {
  10139. if_block.d(1);
  10140. if_block = null;
  10141. }
  10142. if (dirty & /*filteredActions, actionsCount, currentSlug, handleClick, handleGroupClick*/ 2456) {
  10143. each_value = /*filteredActions*/ ctx[11];
  10144. let i;
  10145. for (i = 0; i < each_value.length; i += 1) {
  10146. const child_ctx = get_each_context$1(ctx, each_value, i);
  10147. if (each_blocks[i]) {
  10148. each_blocks[i].p(child_ctx, dirty);
  10149. transition_in(each_blocks[i], 1);
  10150. } else {
  10151. each_blocks[i] = create_each_block$1(child_ctx);
  10152. each_blocks[i].c();
  10153. transition_in(each_blocks[i], 1);
  10154. each_blocks[i].m(div2, null);
  10155. }
  10156. }
  10157. group_outros();
  10158. for (i = each_value.length; i < each_blocks.length; i += 1) {
  10159. out(i);
  10160. }
  10161. check_outros();
  10162. }
  10163. if (dirty & /*isCollapsed*/ 32) {
  10164. toggle_class(aside, "is-collapsed", /*isCollapsed*/ ctx[5]);
  10165. }
  10166. },
  10167. i(local) {
  10168. if (current) return;
  10169. for (let i = 0; i < each_value.length; i += 1) {
  10170. transition_in(each_blocks[i]);
  10171. }
  10172. current = true;
  10173. },
  10174. o(local) {
  10175. each_blocks = each_blocks.filter(Boolean);
  10176. for (let i = 0; i < each_blocks.length; i += 1) {
  10177. transition_out(each_blocks[i]);
  10178. }
  10179. current = false;
  10180. },
  10181. d(detaching) {
  10182. if (detaching) detach(aside);
  10183. if (if_block) if_block.d();
  10184. destroy_each(each_blocks, detaching);
  10185. run_all(dispose);
  10186. }
  10187. };
  10188. }
  10189. function headerLink(text) {
  10190. return text.toLowerCase().replace(/\s/g, "-");
  10191. }
  10192. function instance$1($$self, $$props, $$invalidate) {
  10193. let { config = {} } = $$props;
  10194. let { tagActions = [] } = $$props;
  10195. let { tagHeaders = [] } = $$props;
  10196. let { currentSlug } = $$props;
  10197. let { actionsCount } = $$props;
  10198. let { isCollapsed } = $$props;
  10199. let { isDarkmode } = $$props;
  10200. let { handleClick } = $$props;
  10201. let { handleGroupClick } = $$props;
  10202. let { tocClick } = $$props;
  10203. let { searchClick } = $$props;
  10204. let { query } = $$props;
  10205. function input_input_handler() {
  10206. query = this.value;
  10207. $$invalidate(0, query);
  10208. }
  10209. $$self.$set = $$props => {
  10210. if ("config" in $$props) $$invalidate(1, config = $$props.config);
  10211. if ("tagActions" in $$props) $$invalidate(12, tagActions = $$props.tagActions);
  10212. if ("tagHeaders" in $$props) $$invalidate(2, tagHeaders = $$props.tagHeaders);
  10213. if ("currentSlug" in $$props) $$invalidate(3, currentSlug = $$props.currentSlug);
  10214. if ("actionsCount" in $$props) $$invalidate(4, actionsCount = $$props.actionsCount);
  10215. if ("isCollapsed" in $$props) $$invalidate(5, isCollapsed = $$props.isCollapsed);
  10216. if ("isDarkmode" in $$props) $$invalidate(6, isDarkmode = $$props.isDarkmode);
  10217. if ("handleClick" in $$props) $$invalidate(7, handleClick = $$props.handleClick);
  10218. if ("handleGroupClick" in $$props) $$invalidate(8, handleGroupClick = $$props.handleGroupClick);
  10219. if ("tocClick" in $$props) $$invalidate(9, tocClick = $$props.tocClick);
  10220. if ("searchClick" in $$props) $$invalidate(10, searchClick = $$props.searchClick);
  10221. if ("query" in $$props) $$invalidate(0, query = $$props.query);
  10222. };
  10223. let filteredActions;
  10224. $$self.$$.update = () => {
  10225. if ($$self.$$.dirty & /*tagActions, query*/ 4097) {
  10226. $$invalidate(11, filteredActions = filterActions(tagActions, query));
  10227. }
  10228. };
  10229. return [
  10230. query,
  10231. config,
  10232. tagHeaders,
  10233. currentSlug,
  10234. actionsCount,
  10235. isCollapsed,
  10236. isDarkmode,
  10237. handleClick,
  10238. handleGroupClick,
  10239. tocClick,
  10240. searchClick,
  10241. filteredActions,
  10242. tagActions,
  10243. input_input_handler
  10244. ];
  10245. }
  10246. class MenuPanel extends SvelteComponent {
  10247. constructor(options) {
  10248. super();
  10249. if (!document.getElementById("svelte-fvssqr-style")) add_css$1();
  10250. init(this, options, instance$1, create_fragment$1, safe_not_equal, {
  10251. config: 1,
  10252. tagActions: 12,
  10253. tagHeaders: 2,
  10254. currentSlug: 3,
  10255. actionsCount: 4,
  10256. isCollapsed: 5,
  10257. isDarkmode: 6,
  10258. handleClick: 7,
  10259. handleGroupClick: 8,
  10260. tocClick: 9,
  10261. searchClick: 10,
  10262. query: 0
  10263. });
  10264. }
  10265. }
  10266. /* usr/local/lib/node_modules/snowboard/templates/winter/tables/HeaderTable.svelte generated by Svelte v3.16.5 */
  10267. function get_each_context$2(ctx, list, i) {
  10268. const child_ctx = ctx.slice();
  10269. child_ctx[1] = list[i].name;
  10270. child_ctx[2] = list[i].example;
  10271. return child_ctx;
  10272. }
  10273. // (5:0) {#if headers.length > 0}
  10274. function create_if_block$2(ctx) {
  10275. let table;
  10276. let thead;
  10277. let t1;
  10278. let tbody;
  10279. let each_value = /*headers*/ ctx[0];
  10280. let each_blocks = [];
  10281. for (let i = 0; i < each_value.length; i += 1) {
  10282. each_blocks[i] = create_each_block$2(get_each_context$2(ctx, each_value, i));
  10283. }
  10284. return {
  10285. c() {
  10286. table = element("table");
  10287. thead = element("thead");
  10288. thead.innerHTML = `<tr><th colspan="2">Headers</th></tr>`;
  10289. t1 = space();
  10290. tbody = element("tbody");
  10291. for (let i = 0; i < each_blocks.length; i += 1) {
  10292. each_blocks[i].c();
  10293. }
  10294. attr(table, "class", "table is-stripped is-fullwidth");
  10295. },
  10296. m(target, anchor) {
  10297. insert(target, table, anchor);
  10298. append(table, thead);
  10299. append(table, t1);
  10300. append(table, tbody);
  10301. for (let i = 0; i < each_blocks.length; i += 1) {
  10302. each_blocks[i].m(tbody, null);
  10303. }
  10304. },
  10305. p(ctx, dirty) {
  10306. if (dirty & /*headers*/ 1) {
  10307. each_value = /*headers*/ ctx[0];
  10308. let i;
  10309. for (i = 0; i < each_value.length; i += 1) {
  10310. const child_ctx = get_each_context$2(ctx, each_value, i);
  10311. if (each_blocks[i]) {
  10312. each_blocks[i].p(child_ctx, dirty);
  10313. } else {
  10314. each_blocks[i] = create_each_block$2(child_ctx);
  10315. each_blocks[i].c();
  10316. each_blocks[i].m(tbody, null);
  10317. }
  10318. }
  10319. for (; i < each_blocks.length; i += 1) {
  10320. each_blocks[i].d(1);
  10321. }
  10322. each_blocks.length = each_value.length;
  10323. }
  10324. },
  10325. d(detaching) {
  10326. if (detaching) detach(table);
  10327. destroy_each(each_blocks, detaching);
  10328. }
  10329. };
  10330. }
  10331. // (13:6) {#each headers as { name, example }}
  10332. function create_each_block$2(ctx) {
  10333. let tr;
  10334. let td0;
  10335. let t0_value = /*name*/ ctx[1] + "";
  10336. let t0;
  10337. let t1;
  10338. let td1;
  10339. let code;
  10340. let t2_value = /*example*/ ctx[2] + "";
  10341. let t2;
  10342. let t3;
  10343. return {
  10344. c() {
  10345. tr = element("tr");
  10346. td0 = element("td");
  10347. t0 = text(t0_value);
  10348. t1 = space();
  10349. td1 = element("td");
  10350. code = element("code");
  10351. t2 = text(t2_value);
  10352. t3 = space();
  10353. },
  10354. m(target, anchor) {
  10355. insert(target, tr, anchor);
  10356. append(tr, td0);
  10357. append(td0, t0);
  10358. append(tr, t1);
  10359. append(tr, td1);
  10360. append(td1, code);
  10361. append(code, t2);
  10362. append(tr, t3);
  10363. },
  10364. p(ctx, dirty) {
  10365. if (dirty & /*headers*/ 1 && t0_value !== (t0_value = /*name*/ ctx[1] + "")) set_data(t0, t0_value);
  10366. if (dirty & /*headers*/ 1 && t2_value !== (t2_value = /*example*/ ctx[2] + "")) set_data(t2, t2_value);
  10367. },
  10368. d(detaching) {
  10369. if (detaching) detach(tr);
  10370. }
  10371. };
  10372. }
  10373. function create_fragment$2(ctx) {
  10374. let if_block_anchor;
  10375. let if_block = /*headers*/ ctx[0].length > 0 && create_if_block$2(ctx);
  10376. return {
  10377. c() {
  10378. if (if_block) if_block.c();
  10379. if_block_anchor = empty();
  10380. },
  10381. m(target, anchor) {
  10382. if (if_block) if_block.m(target, anchor);
  10383. insert(target, if_block_anchor, anchor);
  10384. },
  10385. p(ctx, [dirty]) {
  10386. if (/*headers*/ ctx[0].length > 0) {
  10387. if (if_block) {
  10388. if_block.p(ctx, dirty);
  10389. } else {
  10390. if_block = create_if_block$2(ctx);
  10391. if_block.c();
  10392. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  10393. }
  10394. } else if (if_block) {
  10395. if_block.d(1);
  10396. if_block = null;
  10397. }
  10398. },
  10399. i: noop,
  10400. o: noop,
  10401. d(detaching) {
  10402. if (if_block) if_block.d(detaching);
  10403. if (detaching) detach(if_block_anchor);
  10404. }
  10405. };
  10406. }
  10407. function instance$2($$self, $$props, $$invalidate) {
  10408. let { headers = [] } = $$props;
  10409. $$self.$set = $$props => {
  10410. if ("headers" in $$props) $$invalidate(0, headers = $$props.headers);
  10411. };
  10412. return [headers];
  10413. }
  10414. class HeaderTable extends SvelteComponent {
  10415. constructor(options) {
  10416. super();
  10417. init(this, options, instance$2, create_fragment$2, safe_not_equal, { headers: 0 });
  10418. }
  10419. }
  10420. /* usr/local/lib/node_modules/snowboard/templates/winter/components/CodeBlock.svelte generated by Svelte v3.16.5 */
  10421. function create_if_block$3(ctx) {
  10422. let pre;
  10423. let code;
  10424. let raw_value = highlight(stringify$2(/*body*/ ctx[0]), /*mime*/ ctx[1]) + "";
  10425. let code_class_value;
  10426. let pre_class_value;
  10427. return {
  10428. c() {
  10429. pre = element("pre");
  10430. code = element("code");
  10431. attr(code, "class", code_class_value = "language-" + /*mime*/ ctx[1]);
  10432. attr(pre, "class", pre_class_value = "language-" + /*mime*/ ctx[1]);
  10433. },
  10434. m(target, anchor) {
  10435. insert(target, pre, anchor);
  10436. append(pre, code);
  10437. code.innerHTML = raw_value;
  10438. },
  10439. p(ctx, dirty) {
  10440. if (dirty & /*body, mime*/ 3 && raw_value !== (raw_value = highlight(stringify$2(/*body*/ ctx[0]), /*mime*/ ctx[1]) + "")) code.innerHTML = raw_value;;
  10441. if (dirty & /*mime*/ 2 && code_class_value !== (code_class_value = "language-" + /*mime*/ ctx[1])) {
  10442. attr(code, "class", code_class_value);
  10443. }
  10444. if (dirty & /*mime*/ 2 && pre_class_value !== (pre_class_value = "language-" + /*mime*/ ctx[1])) {
  10445. attr(pre, "class", pre_class_value);
  10446. }
  10447. },
  10448. d(detaching) {
  10449. if (detaching) detach(pre);
  10450. }
  10451. };
  10452. }
  10453. function create_fragment$3(ctx) {
  10454. let if_block_anchor;
  10455. let if_block = /*body*/ ctx[0] && create_if_block$3(ctx);
  10456. return {
  10457. c() {
  10458. if (if_block) if_block.c();
  10459. if_block_anchor = empty();
  10460. },
  10461. m(target, anchor) {
  10462. if (if_block) if_block.m(target, anchor);
  10463. insert(target, if_block_anchor, anchor);
  10464. },
  10465. p(ctx, [dirty]) {
  10466. if (/*body*/ ctx[0]) {
  10467. if (if_block) {
  10468. if_block.p(ctx, dirty);
  10469. } else {
  10470. if_block = create_if_block$3(ctx);
  10471. if_block.c();
  10472. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  10473. }
  10474. } else if (if_block) {
  10475. if_block.d(1);
  10476. if_block = null;
  10477. }
  10478. },
  10479. i: noop,
  10480. o: noop,
  10481. d(detaching) {
  10482. if (if_block) if_block.d(detaching);
  10483. if (detaching) detach(if_block_anchor);
  10484. }
  10485. };
  10486. }
  10487. function instance$3($$self, $$props, $$invalidate) {
  10488. let { type } = $$props;
  10489. let { body } = $$props;
  10490. $$self.$set = $$props => {
  10491. if ("type" in $$props) $$invalidate(2, type = $$props.type);
  10492. if ("body" in $$props) $$invalidate(0, body = $$props.body);
  10493. };
  10494. let mime;
  10495. $$self.$$.update = () => {
  10496. if ($$self.$$.dirty & /*type*/ 4) {
  10497. $$invalidate(1, mime = alias(type));
  10498. }
  10499. };
  10500. return [body, mime, type];
  10501. }
  10502. class CodeBlock extends SvelteComponent {
  10503. constructor(options) {
  10504. super();
  10505. init(this, options, instance$3, create_fragment$3, safe_not_equal, { type: 2, body: 0 });
  10506. }
  10507. }
  10508. /* usr/local/lib/node_modules/snowboard/templates/winter/panels/CodePanel.svelte generated by Svelte v3.16.5 */
  10509. function add_css$2() {
  10510. var style = element("style");
  10511. style.id = "svelte-15v28ah-style";
  10512. style.textContent = ".tab-content.svelte-15v28ah{display:none}.tab-content.is-active.svelte-15v28ah{display:block}";
  10513. append(document.head, style);
  10514. }
  10515. // (32:0) {#if example || schema}
  10516. function create_if_block$4(ctx) {
  10517. let div2;
  10518. let div0;
  10519. let ul;
  10520. let li0;
  10521. let a0;
  10522. let t1;
  10523. let li1;
  10524. let a1;
  10525. let t3;
  10526. let div1;
  10527. let section0;
  10528. let section0_class_value;
  10529. let t4;
  10530. let section1;
  10531. let section1_class_value;
  10532. let current;
  10533. let dispose;
  10534. const codeblock0 = new CodeBlock({
  10535. props: {
  10536. type: /*contentType*/ ctx[0],
  10537. body: /*example*/ ctx[1]
  10538. }
  10539. });
  10540. const codeblock1 = new CodeBlock({
  10541. props: {
  10542. type: "application/json",
  10543. body: /*schema*/ ctx[2]
  10544. }
  10545. });
  10546. return {
  10547. c() {
  10548. div2 = element("div");
  10549. div0 = element("div");
  10550. ul = element("ul");
  10551. li0 = element("li");
  10552. a0 = element("a");
  10553. a0.textContent = "Body";
  10554. t1 = space();
  10555. li1 = element("li");
  10556. a1 = element("a");
  10557. a1.textContent = "Schema";
  10558. t3 = space();
  10559. div1 = element("div");
  10560. section0 = element("section");
  10561. create_component(codeblock0.$$.fragment);
  10562. t4 = space();
  10563. section1 = element("section");
  10564. create_component(codeblock1.$$.fragment);
  10565. attr(a0, "data-index", "0");
  10566. attr(a0, "href", "javascript:void(0)");
  10567. toggle_class(li0, "is-active", /*tabIndex*/ ctx[7] === 0);
  10568. attr(a1, "data-index", "1");
  10569. attr(a1, "href", "javascript:void(0)");
  10570. toggle_class(li1, "is-active", /*tabIndex*/ ctx[7] === 1);
  10571. attr(div0, "class", "tabs is-fullwidth");
  10572. toggle_class(div0, "is-toggle", /*asToggle*/ ctx[3]);
  10573. attr(section0, "class", section0_class_value = "tab-content " + /*activeBody*/ ctx[5] + " svelte-15v28ah");
  10574. attr(section1, "class", section1_class_value = "tab-content " + /*activeSchema*/ ctx[6] + " svelte-15v28ah");
  10575. attr(div2, "class", "tabs-with-content");
  10576. dispose = [
  10577. listen(a0, "click", /*tabSelect*/ ctx[4]),
  10578. listen(a1, "click", /*tabSelect*/ ctx[4])
  10579. ];
  10580. },
  10581. m(target, anchor) {
  10582. insert(target, div2, anchor);
  10583. append(div2, div0);
  10584. append(div0, ul);
  10585. append(ul, li0);
  10586. append(li0, a0);
  10587. append(ul, t1);
  10588. append(ul, li1);
  10589. append(li1, a1);
  10590. append(div2, t3);
  10591. append(div2, div1);
  10592. append(div1, section0);
  10593. mount_component(codeblock0, section0, null);
  10594. append(div1, t4);
  10595. append(div1, section1);
  10596. mount_component(codeblock1, section1, null);
  10597. current = true;
  10598. },
  10599. p(ctx, dirty) {
  10600. if (dirty & /*tabIndex*/ 128) {
  10601. toggle_class(li0, "is-active", /*tabIndex*/ ctx[7] === 0);
  10602. }
  10603. if (dirty & /*tabIndex*/ 128) {
  10604. toggle_class(li1, "is-active", /*tabIndex*/ ctx[7] === 1);
  10605. }
  10606. if (dirty & /*asToggle*/ 8) {
  10607. toggle_class(div0, "is-toggle", /*asToggle*/ ctx[3]);
  10608. }
  10609. const codeblock0_changes = {};
  10610. if (dirty & /*contentType*/ 1) codeblock0_changes.type = /*contentType*/ ctx[0];
  10611. if (dirty & /*example*/ 2) codeblock0_changes.body = /*example*/ ctx[1];
  10612. codeblock0.$set(codeblock0_changes);
  10613. if (!current || dirty & /*activeBody*/ 32 && section0_class_value !== (section0_class_value = "tab-content " + /*activeBody*/ ctx[5] + " svelte-15v28ah")) {
  10614. attr(section0, "class", section0_class_value);
  10615. }
  10616. const codeblock1_changes = {};
  10617. if (dirty & /*schema*/ 4) codeblock1_changes.body = /*schema*/ ctx[2];
  10618. codeblock1.$set(codeblock1_changes);
  10619. if (!current || dirty & /*activeSchema*/ 64 && section1_class_value !== (section1_class_value = "tab-content " + /*activeSchema*/ ctx[6] + " svelte-15v28ah")) {
  10620. attr(section1, "class", section1_class_value);
  10621. }
  10622. },
  10623. i(local) {
  10624. if (current) return;
  10625. transition_in(codeblock0.$$.fragment, local);
  10626. transition_in(codeblock1.$$.fragment, local);
  10627. current = true;
  10628. },
  10629. o(local) {
  10630. transition_out(codeblock0.$$.fragment, local);
  10631. transition_out(codeblock1.$$.fragment, local);
  10632. current = false;
  10633. },
  10634. d(detaching) {
  10635. if (detaching) detach(div2);
  10636. destroy_component(codeblock0);
  10637. destroy_component(codeblock1);
  10638. run_all(dispose);
  10639. }
  10640. };
  10641. }
  10642. function create_fragment$4(ctx) {
  10643. let if_block_anchor;
  10644. let current;
  10645. let if_block = (/*example*/ ctx[1] || /*schema*/ ctx[2]) && create_if_block$4(ctx);
  10646. return {
  10647. c() {
  10648. if (if_block) if_block.c();
  10649. if_block_anchor = empty();
  10650. },
  10651. m(target, anchor) {
  10652. if (if_block) if_block.m(target, anchor);
  10653. insert(target, if_block_anchor, anchor);
  10654. current = true;
  10655. },
  10656. p(ctx, [dirty]) {
  10657. if (/*example*/ ctx[1] || /*schema*/ ctx[2]) {
  10658. if (if_block) {
  10659. if_block.p(ctx, dirty);
  10660. transition_in(if_block, 1);
  10661. } else {
  10662. if_block = create_if_block$4(ctx);
  10663. if_block.c();
  10664. transition_in(if_block, 1);
  10665. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  10666. }
  10667. } else if (if_block) {
  10668. group_outros();
  10669. transition_out(if_block, 1, 1, () => {
  10670. if_block = null;
  10671. });
  10672. check_outros();
  10673. }
  10674. },
  10675. i(local) {
  10676. if (current) return;
  10677. transition_in(if_block);
  10678. current = true;
  10679. },
  10680. o(local) {
  10681. transition_out(if_block);
  10682. current = false;
  10683. },
  10684. d(detaching) {
  10685. if (if_block) if_block.d(detaching);
  10686. if (detaching) detach(if_block_anchor);
  10687. }
  10688. };
  10689. }
  10690. function instance$4($$self, $$props, $$invalidate) {
  10691. let { contentType } = $$props;
  10692. let { example } = $$props;
  10693. let { schema } = $$props;
  10694. let { asToggle } = $$props;
  10695. let activeBody = "is-active";
  10696. let activeSchema = "";
  10697. let tabIndex = 0;
  10698. const tabSelect = event => {
  10699. const index = event.target.dataset["index"];
  10700. $$invalidate(7, tabIndex = parseInt(index, 10));
  10701. };
  10702. $$self.$set = $$props => {
  10703. if ("contentType" in $$props) $$invalidate(0, contentType = $$props.contentType);
  10704. if ("example" in $$props) $$invalidate(1, example = $$props.example);
  10705. if ("schema" in $$props) $$invalidate(2, schema = $$props.schema);
  10706. if ("asToggle" in $$props) $$invalidate(3, asToggle = $$props.asToggle);
  10707. };
  10708. $$self.$$.update = () => {
  10709. if ($$self.$$.dirty & /*tabIndex*/ 128) {
  10710. $$invalidate(5, activeBody = tabIndex === 0 ? "is-active" : "");
  10711. }
  10712. if ($$self.$$.dirty & /*tabIndex*/ 128) {
  10713. $$invalidate(6, activeSchema = tabIndex === 1 ? "is-active" : "");
  10714. }
  10715. };
  10716. return [
  10717. contentType,
  10718. example,
  10719. schema,
  10720. asToggle,
  10721. tabSelect,
  10722. activeBody,
  10723. activeSchema,
  10724. tabIndex
  10725. ];
  10726. }
  10727. class CodePanel extends SvelteComponent {
  10728. constructor(options) {
  10729. super();
  10730. if (!document.getElementById("svelte-15v28ah-style")) add_css$2();
  10731. init(this, options, instance$4, create_fragment$4, safe_not_equal, {
  10732. contentType: 0,
  10733. example: 1,
  10734. schema: 2,
  10735. asToggle: 3,
  10736. tabSelect: 4
  10737. });
  10738. }
  10739. get tabSelect() {
  10740. return this.$$.ctx[4];
  10741. }
  10742. }
  10743. /* usr/local/lib/node_modules/snowboard/templates/winter/panels/RequestPanel.svelte generated by Svelte v3.16.5 */
  10744. function create_if_block_1$2(ctx) {
  10745. let div;
  10746. let raw_value = markdown(/*description*/ ctx[0]) + "";
  10747. return {
  10748. c() {
  10749. div = element("div");
  10750. attr(div, "class", "content");
  10751. },
  10752. m(target, anchor) {
  10753. insert(target, div, anchor);
  10754. div.innerHTML = raw_value;
  10755. },
  10756. p(ctx, dirty) {
  10757. if (dirty & /*description*/ 1 && raw_value !== (raw_value = markdown(/*description*/ ctx[0]) + "")) div.innerHTML = raw_value;;
  10758. },
  10759. d(detaching) {
  10760. if (detaching) detach(div);
  10761. }
  10762. };
  10763. }
  10764. // (26:0) {#if showRequest}
  10765. function create_if_block$5(ctx) {
  10766. let hr;
  10767. return {
  10768. c() {
  10769. hr = element("hr");
  10770. },
  10771. m(target, anchor) {
  10772. insert(target, hr, anchor);
  10773. },
  10774. d(detaching) {
  10775. if (detaching) detach(hr);
  10776. }
  10777. };
  10778. }
  10779. function create_fragment$5(ctx) {
  10780. let t0;
  10781. let t1;
  10782. let t2;
  10783. let if_block1_anchor;
  10784. let current;
  10785. let if_block0 = /*description*/ ctx[0] && create_if_block_1$2(ctx);
  10786. const headertable = new HeaderTable({ props: { headers: /*headers*/ ctx[1] } });
  10787. const codepanel = new CodePanel({
  10788. props: {
  10789. contentType: /*contentType*/ ctx[2],
  10790. example: /*example*/ ctx[3],
  10791. schema: /*schema*/ ctx[4],
  10792. asToggle: true
  10793. }
  10794. });
  10795. let if_block1 = /*showRequest*/ ctx[5] && create_if_block$5(ctx);
  10796. return {
  10797. c() {
  10798. if (if_block0) if_block0.c();
  10799. t0 = space();
  10800. create_component(headertable.$$.fragment);
  10801. t1 = space();
  10802. create_component(codepanel.$$.fragment);
  10803. t2 = space();
  10804. if (if_block1) if_block1.c();
  10805. if_block1_anchor = empty();
  10806. },
  10807. m(target, anchor) {
  10808. if (if_block0) if_block0.m(target, anchor);
  10809. insert(target, t0, anchor);
  10810. mount_component(headertable, target, anchor);
  10811. insert(target, t1, anchor);
  10812. mount_component(codepanel, target, anchor);
  10813. insert(target, t2, anchor);
  10814. if (if_block1) if_block1.m(target, anchor);
  10815. insert(target, if_block1_anchor, anchor);
  10816. current = true;
  10817. },
  10818. p(ctx, [dirty]) {
  10819. if (/*description*/ ctx[0]) {
  10820. if (if_block0) {
  10821. if_block0.p(ctx, dirty);
  10822. } else {
  10823. if_block0 = create_if_block_1$2(ctx);
  10824. if_block0.c();
  10825. if_block0.m(t0.parentNode, t0);
  10826. }
  10827. } else if (if_block0) {
  10828. if_block0.d(1);
  10829. if_block0 = null;
  10830. }
  10831. const headertable_changes = {};
  10832. if (dirty & /*headers*/ 2) headertable_changes.headers = /*headers*/ ctx[1];
  10833. headertable.$set(headertable_changes);
  10834. const codepanel_changes = {};
  10835. if (dirty & /*contentType*/ 4) codepanel_changes.contentType = /*contentType*/ ctx[2];
  10836. if (dirty & /*example*/ 8) codepanel_changes.example = /*example*/ ctx[3];
  10837. if (dirty & /*schema*/ 16) codepanel_changes.schema = /*schema*/ ctx[4];
  10838. codepanel.$set(codepanel_changes);
  10839. if (/*showRequest*/ ctx[5]) {
  10840. if (!if_block1) {
  10841. if_block1 = create_if_block$5(ctx);
  10842. if_block1.c();
  10843. if_block1.m(if_block1_anchor.parentNode, if_block1_anchor);
  10844. } else {
  10845. }
  10846. } else if (if_block1) {
  10847. if_block1.d(1);
  10848. if_block1 = null;
  10849. }
  10850. },
  10851. i(local) {
  10852. if (current) return;
  10853. transition_in(headertable.$$.fragment, local);
  10854. transition_in(codepanel.$$.fragment, local);
  10855. current = true;
  10856. },
  10857. o(local) {
  10858. transition_out(headertable.$$.fragment, local);
  10859. transition_out(codepanel.$$.fragment, local);
  10860. current = false;
  10861. },
  10862. d(detaching) {
  10863. if (if_block0) if_block0.d(detaching);
  10864. if (detaching) detach(t0);
  10865. destroy_component(headertable, detaching);
  10866. if (detaching) detach(t1);
  10867. destroy_component(codepanel, detaching);
  10868. if (detaching) detach(t2);
  10869. if (if_block1) if_block1.d(detaching);
  10870. if (detaching) detach(if_block1_anchor);
  10871. }
  10872. };
  10873. }
  10874. function instance$5($$self, $$props, $$invalidate) {
  10875. let { description } = $$props;
  10876. let { headers } = $$props;
  10877. let { contentType } = $$props;
  10878. let { example } = $$props;
  10879. let { schema } = $$props;
  10880. $$self.$set = $$props => {
  10881. if ("description" in $$props) $$invalidate(0, description = $$props.description);
  10882. if ("headers" in $$props) $$invalidate(1, headers = $$props.headers);
  10883. if ("contentType" in $$props) $$invalidate(2, contentType = $$props.contentType);
  10884. if ("example" in $$props) $$invalidate(3, example = $$props.example);
  10885. if ("schema" in $$props) $$invalidate(4, schema = $$props.schema);
  10886. };
  10887. let showRequest;
  10888. $$self.$$.update = () => {
  10889. if ($$self.$$.dirty & /*description, headers, example*/ 11) {
  10890. $$invalidate(5, showRequest = !!(description || headers.length !== 0 || example));
  10891. }
  10892. };
  10893. return [description, headers, contentType, example, schema, showRequest];
  10894. }
  10895. class RequestPanel extends SvelteComponent {
  10896. constructor(options) {
  10897. super();
  10898. init(this, options, instance$5, create_fragment$5, safe_not_equal, {
  10899. description: 0,
  10900. headers: 1,
  10901. contentType: 2,
  10902. example: 3,
  10903. schema: 4
  10904. });
  10905. }
  10906. }
  10907. /* usr/local/lib/node_modules/snowboard/templates/winter/panels/ResponsePanel.svelte generated by Svelte v3.16.5 */
  10908. function create_else_block(ctx) {
  10909. let t_value = (/*contentType*/ ctx[4] || "Response") + "";
  10910. let t;
  10911. return {
  10912. c() {
  10913. t = text(t_value);
  10914. },
  10915. m(target, anchor) {
  10916. insert(target, t, anchor);
  10917. },
  10918. p(ctx, dirty) {
  10919. if (dirty & /*contentType*/ 16 && t_value !== (t_value = (/*contentType*/ ctx[4] || "Response") + "")) set_data(t, t_value);
  10920. },
  10921. d(detaching) {
  10922. if (detaching) detach(t);
  10923. }
  10924. };
  10925. }
  10926. // (19:6) {#if title}
  10927. function create_if_block_2$1(ctx) {
  10928. let t0;
  10929. let t1;
  10930. return {
  10931. c() {
  10932. t0 = text("Response ");
  10933. t1 = text(/*title*/ ctx[0]);
  10934. },
  10935. m(target, anchor) {
  10936. insert(target, t0, anchor);
  10937. insert(target, t1, anchor);
  10938. },
  10939. p(ctx, dirty) {
  10940. if (dirty & /*title*/ 1) set_data(t1, /*title*/ ctx[0]);
  10941. },
  10942. d(detaching) {
  10943. if (detaching) detach(t0);
  10944. if (detaching) detach(t1);
  10945. }
  10946. };
  10947. }
  10948. // (23:6) {#if title !== ''}
  10949. function create_if_block_1$3(ctx) {
  10950. let span;
  10951. let t_value = (/*contentType*/ ctx[4] || "") + "";
  10952. let t;
  10953. return {
  10954. c() {
  10955. span = element("span");
  10956. t = text(t_value);
  10957. attr(span, "class", "tag is-medium is-white");
  10958. },
  10959. m(target, anchor) {
  10960. insert(target, span, anchor);
  10961. append(span, t);
  10962. },
  10963. p(ctx, dirty) {
  10964. if (dirty & /*contentType*/ 16 && t_value !== (t_value = (/*contentType*/ ctx[4] || "") + "")) set_data(t, t_value);
  10965. },
  10966. d(detaching) {
  10967. if (detaching) detach(span);
  10968. }
  10969. };
  10970. }
  10971. // (30:4) {#if description}
  10972. function create_if_block$6(ctx) {
  10973. let div;
  10974. let raw_value = markdown(/*description*/ ctx[1]) + "";
  10975. return {
  10976. c() {
  10977. div = element("div");
  10978. attr(div, "class", "content");
  10979. },
  10980. m(target, anchor) {
  10981. insert(target, div, anchor);
  10982. div.innerHTML = raw_value;
  10983. },
  10984. p(ctx, dirty) {
  10985. if (dirty & /*description*/ 2 && raw_value !== (raw_value = markdown(/*description*/ ctx[1]) + "")) div.innerHTML = raw_value;;
  10986. },
  10987. d(detaching) {
  10988. if (detaching) detach(div);
  10989. }
  10990. };
  10991. }
  10992. function create_fragment$6(ctx) {
  10993. let div1;
  10994. let header;
  10995. let p;
  10996. let t0;
  10997. let a;
  10998. let t1;
  10999. let code;
  11000. let t2;
  11001. let code_class_value;
  11002. let t3;
  11003. let div0;
  11004. let t4;
  11005. let t5;
  11006. let current;
  11007. function select_block_type(ctx, dirty) {
  11008. if (/*title*/ ctx[0]) return create_if_block_2$1;
  11009. return create_else_block;
  11010. }
  11011. let current_block_type = select_block_type(ctx, -1);
  11012. let if_block0 = current_block_type(ctx);
  11013. let if_block1 = /*title*/ ctx[0] !== "" && create_if_block_1$3(ctx);
  11014. let if_block2 = /*description*/ ctx[1] && create_if_block$6(ctx);
  11015. const headertable = new HeaderTable({ props: { headers: /*headers*/ ctx[2] } });
  11016. const codepanel = new CodePanel({
  11017. props: {
  11018. contentType: /*contentType*/ ctx[4],
  11019. example: /*example*/ ctx[5],
  11020. schema: /*schema*/ ctx[6]
  11021. }
  11022. });
  11023. return {
  11024. c() {
  11025. div1 = element("div");
  11026. header = element("header");
  11027. p = element("p");
  11028. if_block0.c();
  11029. t0 = space();
  11030. a = element("a");
  11031. if (if_block1) if_block1.c();
  11032. t1 = space();
  11033. code = element("code");
  11034. t2 = text(/*statusCode*/ ctx[3]);
  11035. t3 = space();
  11036. div0 = element("div");
  11037. if (if_block2) if_block2.c();
  11038. t4 = space();
  11039. create_component(headertable.$$.fragment);
  11040. t5 = space();
  11041. create_component(codepanel.$$.fragment);
  11042. attr(p, "class", "card-header-title");
  11043. attr(code, "class", code_class_value = "tag is-medium " + colorize(/*statusCode*/ ctx[3]));
  11044. attr(a, "href", "javascript:void(0)");
  11045. attr(a, "class", "card-header-icon is-family-code");
  11046. attr(header, "class", "card-header");
  11047. attr(div0, "class", "card-content");
  11048. attr(div1, "class", "card");
  11049. },
  11050. m(target, anchor) {
  11051. insert(target, div1, anchor);
  11052. append(div1, header);
  11053. append(header, p);
  11054. if_block0.m(p, null);
  11055. append(header, t0);
  11056. append(header, a);
  11057. if (if_block1) if_block1.m(a, null);
  11058. append(a, t1);
  11059. append(a, code);
  11060. append(code, t2);
  11061. append(div1, t3);
  11062. append(div1, div0);
  11063. if (if_block2) if_block2.m(div0, null);
  11064. append(div0, t4);
  11065. mount_component(headertable, div0, null);
  11066. append(div0, t5);
  11067. mount_component(codepanel, div0, null);
  11068. current = true;
  11069. },
  11070. p(ctx, [dirty]) {
  11071. if (current_block_type === (current_block_type = select_block_type(ctx, dirty)) && if_block0) {
  11072. if_block0.p(ctx, dirty);
  11073. } else {
  11074. if_block0.d(1);
  11075. if_block0 = current_block_type(ctx);
  11076. if (if_block0) {
  11077. if_block0.c();
  11078. if_block0.m(p, null);
  11079. }
  11080. }
  11081. if (/*title*/ ctx[0] !== "") {
  11082. if (if_block1) {
  11083. if_block1.p(ctx, dirty);
  11084. } else {
  11085. if_block1 = create_if_block_1$3(ctx);
  11086. if_block1.c();
  11087. if_block1.m(a, t1);
  11088. }
  11089. } else if (if_block1) {
  11090. if_block1.d(1);
  11091. if_block1 = null;
  11092. }
  11093. if (!current || dirty & /*statusCode*/ 8) set_data(t2, /*statusCode*/ ctx[3]);
  11094. if (!current || dirty & /*statusCode*/ 8 && code_class_value !== (code_class_value = "tag is-medium " + colorize(/*statusCode*/ ctx[3]))) {
  11095. attr(code, "class", code_class_value);
  11096. }
  11097. if (/*description*/ ctx[1]) {
  11098. if (if_block2) {
  11099. if_block2.p(ctx, dirty);
  11100. } else {
  11101. if_block2 = create_if_block$6(ctx);
  11102. if_block2.c();
  11103. if_block2.m(div0, t4);
  11104. }
  11105. } else if (if_block2) {
  11106. if_block2.d(1);
  11107. if_block2 = null;
  11108. }
  11109. const headertable_changes = {};
  11110. if (dirty & /*headers*/ 4) headertable_changes.headers = /*headers*/ ctx[2];
  11111. headertable.$set(headertable_changes);
  11112. const codepanel_changes = {};
  11113. if (dirty & /*contentType*/ 16) codepanel_changes.contentType = /*contentType*/ ctx[4];
  11114. if (dirty & /*example*/ 32) codepanel_changes.example = /*example*/ ctx[5];
  11115. if (dirty & /*schema*/ 64) codepanel_changes.schema = /*schema*/ ctx[6];
  11116. codepanel.$set(codepanel_changes);
  11117. },
  11118. i(local) {
  11119. if (current) return;
  11120. transition_in(headertable.$$.fragment, local);
  11121. transition_in(codepanel.$$.fragment, local);
  11122. current = true;
  11123. },
  11124. o(local) {
  11125. transition_out(headertable.$$.fragment, local);
  11126. transition_out(codepanel.$$.fragment, local);
  11127. current = false;
  11128. },
  11129. d(detaching) {
  11130. if (detaching) detach(div1);
  11131. if_block0.d();
  11132. if (if_block1) if_block1.d();
  11133. if (if_block2) if_block2.d();
  11134. destroy_component(headertable);
  11135. destroy_component(codepanel);
  11136. }
  11137. };
  11138. }
  11139. function instance$6($$self, $$props, $$invalidate) {
  11140. let { title } = $$props;
  11141. let { description } = $$props;
  11142. let { headers } = $$props;
  11143. let { statusCode } = $$props;
  11144. let { contentType } = $$props;
  11145. let { example } = $$props;
  11146. let { schema } = $$props;
  11147. $$self.$set = $$props => {
  11148. if ("title" in $$props) $$invalidate(0, title = $$props.title);
  11149. if ("description" in $$props) $$invalidate(1, description = $$props.description);
  11150. if ("headers" in $$props) $$invalidate(2, headers = $$props.headers);
  11151. if ("statusCode" in $$props) $$invalidate(3, statusCode = $$props.statusCode);
  11152. if ("contentType" in $$props) $$invalidate(4, contentType = $$props.contentType);
  11153. if ("example" in $$props) $$invalidate(5, example = $$props.example);
  11154. if ("schema" in $$props) $$invalidate(6, schema = $$props.schema);
  11155. };
  11156. return [title, description, headers, statusCode, contentType, example, schema];
  11157. }
  11158. class ResponsePanel extends SvelteComponent {
  11159. constructor(options) {
  11160. super();
  11161. init(this, options, instance$6, create_fragment$6, safe_not_equal, {
  11162. title: 0,
  11163. description: 1,
  11164. headers: 2,
  11165. statusCode: 3,
  11166. contentType: 4,
  11167. example: 5,
  11168. schema: 6
  11169. });
  11170. }
  11171. }
  11172. /* usr/local/lib/node_modules/snowboard/templates/winter/tables/ParameterTable.svelte generated by Svelte v3.16.5 */
  11173. function get_each_context$3(ctx, list, i) {
  11174. const child_ctx = ctx.slice();
  11175. child_ctx[2] = list[i].name;
  11176. child_ctx[3] = list[i].example;
  11177. child_ctx[4] = list[i].required;
  11178. child_ctx[5] = list[i].description;
  11179. child_ctx[6] = list[i].schema;
  11180. return child_ctx;
  11181. }
  11182. // (36:10) {:else}
  11183. function create_else_block$1(ctx) {
  11184. let div;
  11185. return {
  11186. c() {
  11187. div = element("div");
  11188. div.textContent = "-";
  11189. attr(div, "class", "content");
  11190. },
  11191. m(target, anchor) {
  11192. insert(target, div, anchor);
  11193. },
  11194. p: noop,
  11195. d(detaching) {
  11196. if (detaching) detach(div);
  11197. }
  11198. };
  11199. }
  11200. // (32:10) {#if description}
  11201. function create_if_block_2$2(ctx) {
  11202. let div;
  11203. let raw_value = markdown(/*description*/ ctx[5]) + "";
  11204. return {
  11205. c() {
  11206. div = element("div");
  11207. attr(div, "class", "content");
  11208. },
  11209. m(target, anchor) {
  11210. insert(target, div, anchor);
  11211. div.innerHTML = raw_value;
  11212. },
  11213. p(ctx, dirty) {
  11214. if (dirty & /*parameters*/ 2 && raw_value !== (raw_value = markdown(/*description*/ ctx[5]) + "")) div.innerHTML = raw_value;;
  11215. },
  11216. d(detaching) {
  11217. if (detaching) detach(div);
  11218. }
  11219. };
  11220. }
  11221. // (40:10) {#if example}
  11222. function create_if_block_1$4(ctx) {
  11223. let div;
  11224. let span;
  11225. let t1;
  11226. let code;
  11227. let t2_value = /*example*/ ctx[3] + "";
  11228. let t2;
  11229. return {
  11230. c() {
  11231. div = element("div");
  11232. span = element("span");
  11233. span.textContent = "Example:";
  11234. t1 = space();
  11235. code = element("code");
  11236. t2 = text(t2_value);
  11237. attr(code, "class", "tag");
  11238. },
  11239. m(target, anchor) {
  11240. insert(target, div, anchor);
  11241. append(div, span);
  11242. append(div, t1);
  11243. append(div, code);
  11244. append(code, t2);
  11245. },
  11246. p(ctx, dirty) {
  11247. if (dirty & /*parameters*/ 2 && t2_value !== (t2_value = /*example*/ ctx[3] + "")) set_data(t2, t2_value);
  11248. },
  11249. d(detaching) {
  11250. if (detaching) detach(div);
  11251. }
  11252. };
  11253. }
  11254. // (47:10) {#if schema.enum}
  11255. function create_if_block$7(ctx) {
  11256. let div;
  11257. let span;
  11258. let t1;
  11259. let code;
  11260. let t2_value = /*schema*/ ctx[6].enum + "";
  11261. let t2;
  11262. return {
  11263. c() {
  11264. div = element("div");
  11265. span = element("span");
  11266. span.textContent = "Values:";
  11267. t1 = space();
  11268. code = element("code");
  11269. t2 = text(t2_value);
  11270. },
  11271. m(target, anchor) {
  11272. insert(target, div, anchor);
  11273. append(div, span);
  11274. append(div, t1);
  11275. append(div, code);
  11276. append(code, t2);
  11277. },
  11278. p(ctx, dirty) {
  11279. if (dirty & /*parameters*/ 2 && t2_value !== (t2_value = /*schema*/ ctx[6].enum + "")) set_data(t2, t2_value);
  11280. },
  11281. d(detaching) {
  11282. if (detaching) detach(div);
  11283. }
  11284. };
  11285. }
  11286. // (15:4) {#each parameters as { name, example, required, description, schema }}
  11287. function create_each_block$3(ctx) {
  11288. let tr;
  11289. let td0;
  11290. let code;
  11291. let t0_value = /*name*/ ctx[2] + "";
  11292. let t0;
  11293. let t1;
  11294. let td1;
  11295. let div;
  11296. let span0;
  11297. let t2_value = /*schema*/ ctx[6].type + "";
  11298. let t2;
  11299. let t3;
  11300. let span1;
  11301. let t4_value = (/*required*/ ctx[4] ? "required" : "optional") + "";
  11302. let t4;
  11303. let t5;
  11304. let td2;
  11305. let t6;
  11306. let t7;
  11307. let t8;
  11308. function select_block_type(ctx, dirty) {
  11309. if (/*description*/ ctx[5]) return create_if_block_2$2;
  11310. return create_else_block$1;
  11311. }
  11312. let current_block_type = select_block_type(ctx, -1);
  11313. let if_block0 = current_block_type(ctx);
  11314. let if_block1 = /*example*/ ctx[3] && create_if_block_1$4(ctx);
  11315. let if_block2 = /*schema*/ ctx[6].enum && create_if_block$7(ctx);
  11316. return {
  11317. c() {
  11318. tr = element("tr");
  11319. td0 = element("td");
  11320. code = element("code");
  11321. t0 = text(t0_value);
  11322. t1 = space();
  11323. td1 = element("td");
  11324. div = element("div");
  11325. span0 = element("span");
  11326. t2 = text(t2_value);
  11327. t3 = space();
  11328. span1 = element("span");
  11329. t4 = text(t4_value);
  11330. t5 = space();
  11331. td2 = element("td");
  11332. if_block0.c();
  11333. t6 = space();
  11334. if (if_block1) if_block1.c();
  11335. t7 = space();
  11336. if (if_block2) if_block2.c();
  11337. t8 = space();
  11338. attr(span0, "class", "tag");
  11339. attr(span1, "class", "tag");
  11340. toggle_class(span1, "is-dark", /*required*/ ctx[4]);
  11341. toggle_class(span1, "is-white", !/*required*/ ctx[4]);
  11342. attr(div, "class", "tags has-addons");
  11343. },
  11344. m(target, anchor) {
  11345. insert(target, tr, anchor);
  11346. append(tr, td0);
  11347. append(td0, code);
  11348. append(code, t0);
  11349. append(tr, t1);
  11350. append(tr, td1);
  11351. append(td1, div);
  11352. append(div, span0);
  11353. append(span0, t2);
  11354. append(div, t3);
  11355. append(div, span1);
  11356. append(span1, t4);
  11357. append(tr, t5);
  11358. append(tr, td2);
  11359. if_block0.m(td2, null);
  11360. append(td2, t6);
  11361. if (if_block1) if_block1.m(td2, null);
  11362. append(td2, t7);
  11363. if (if_block2) if_block2.m(td2, null);
  11364. append(tr, t8);
  11365. },
  11366. p(ctx, dirty) {
  11367. if (dirty & /*parameters*/ 2 && t0_value !== (t0_value = /*name*/ ctx[2] + "")) set_data(t0, t0_value);
  11368. if (dirty & /*parameters*/ 2 && t2_value !== (t2_value = /*schema*/ ctx[6].type + "")) set_data(t2, t2_value);
  11369. if (dirty & /*parameters*/ 2 && t4_value !== (t4_value = (/*required*/ ctx[4] ? "required" : "optional") + "")) set_data(t4, t4_value);
  11370. if (dirty & /*parameters*/ 2) {
  11371. toggle_class(span1, "is-dark", /*required*/ ctx[4]);
  11372. }
  11373. if (dirty & /*parameters*/ 2) {
  11374. toggle_class(span1, "is-white", !/*required*/ ctx[4]);
  11375. }
  11376. if (current_block_type === (current_block_type = select_block_type(ctx, dirty)) && if_block0) {
  11377. if_block0.p(ctx, dirty);
  11378. } else {
  11379. if_block0.d(1);
  11380. if_block0 = current_block_type(ctx);
  11381. if (if_block0) {
  11382. if_block0.c();
  11383. if_block0.m(td2, t6);
  11384. }
  11385. }
  11386. if (/*example*/ ctx[3]) {
  11387. if (if_block1) {
  11388. if_block1.p(ctx, dirty);
  11389. } else {
  11390. if_block1 = create_if_block_1$4(ctx);
  11391. if_block1.c();
  11392. if_block1.m(td2, t7);
  11393. }
  11394. } else if (if_block1) {
  11395. if_block1.d(1);
  11396. if_block1 = null;
  11397. }
  11398. if (/*schema*/ ctx[6].enum) {
  11399. if (if_block2) {
  11400. if_block2.p(ctx, dirty);
  11401. } else {
  11402. if_block2 = create_if_block$7(ctx);
  11403. if_block2.c();
  11404. if_block2.m(td2, null);
  11405. }
  11406. } else if (if_block2) {
  11407. if_block2.d(1);
  11408. if_block2 = null;
  11409. }
  11410. },
  11411. d(detaching) {
  11412. if (detaching) detach(tr);
  11413. if_block0.d();
  11414. if (if_block1) if_block1.d();
  11415. if (if_block2) if_block2.d();
  11416. }
  11417. };
  11418. }
  11419. function create_fragment$7(ctx) {
  11420. let table;
  11421. let thead;
  11422. let tr;
  11423. let th;
  11424. let t0;
  11425. let t1;
  11426. let tbody;
  11427. let each_value = /*parameters*/ ctx[1];
  11428. let each_blocks = [];
  11429. for (let i = 0; i < each_value.length; i += 1) {
  11430. each_blocks[i] = create_each_block$3(get_each_context$3(ctx, each_value, i));
  11431. }
  11432. return {
  11433. c() {
  11434. table = element("table");
  11435. thead = element("thead");
  11436. tr = element("tr");
  11437. th = element("th");
  11438. t0 = text(/*title*/ ctx[0]);
  11439. t1 = space();
  11440. tbody = element("tbody");
  11441. for (let i = 0; i < each_blocks.length; i += 1) {
  11442. each_blocks[i].c();
  11443. }
  11444. attr(th, "colspan", "3");
  11445. attr(table, "class", "table table-bordered is-bordered is-fullwidth");
  11446. },
  11447. m(target, anchor) {
  11448. insert(target, table, anchor);
  11449. append(table, thead);
  11450. append(thead, tr);
  11451. append(tr, th);
  11452. append(th, t0);
  11453. append(table, t1);
  11454. append(table, tbody);
  11455. for (let i = 0; i < each_blocks.length; i += 1) {
  11456. each_blocks[i].m(tbody, null);
  11457. }
  11458. },
  11459. p(ctx, [dirty]) {
  11460. if (dirty & /*title*/ 1) set_data(t0, /*title*/ ctx[0]);
  11461. if (dirty & /*parameters, markdown*/ 2) {
  11462. each_value = /*parameters*/ ctx[1];
  11463. let i;
  11464. for (i = 0; i < each_value.length; i += 1) {
  11465. const child_ctx = get_each_context$3(ctx, each_value, i);
  11466. if (each_blocks[i]) {
  11467. each_blocks[i].p(child_ctx, dirty);
  11468. } else {
  11469. each_blocks[i] = create_each_block$3(child_ctx);
  11470. each_blocks[i].c();
  11471. each_blocks[i].m(tbody, null);
  11472. }
  11473. }
  11474. for (; i < each_blocks.length; i += 1) {
  11475. each_blocks[i].d(1);
  11476. }
  11477. each_blocks.length = each_value.length;
  11478. }
  11479. },
  11480. i: noop,
  11481. o: noop,
  11482. d(detaching) {
  11483. if (detaching) detach(table);
  11484. destroy_each(each_blocks, detaching);
  11485. }
  11486. };
  11487. }
  11488. function instance$7($$self, $$props, $$invalidate) {
  11489. let { title } = $$props;
  11490. let { parameters } = $$props;
  11491. $$self.$set = $$props => {
  11492. if ("title" in $$props) $$invalidate(0, title = $$props.title);
  11493. if ("parameters" in $$props) $$invalidate(1, parameters = $$props.parameters);
  11494. };
  11495. return [title, parameters];
  11496. }
  11497. class ParameterTable extends SvelteComponent {
  11498. constructor(options) {
  11499. super();
  11500. init(this, options, instance$7, create_fragment$7, safe_not_equal, { title: 0, parameters: 1 });
  11501. }
  11502. }
  11503. /* usr/local/lib/node_modules/snowboard/templates/winter/panels/ParameterPanel.svelte generated by Svelte v3.16.5 */
  11504. function create_if_block_1$5(ctx) {
  11505. let current;
  11506. const parametertable = new ParameterTable({
  11507. props: {
  11508. parameters: /*pathParameters*/ ctx[0],
  11509. title: "Path Parameters"
  11510. }
  11511. });
  11512. return {
  11513. c() {
  11514. create_component(parametertable.$$.fragment);
  11515. },
  11516. m(target, anchor) {
  11517. mount_component(parametertable, target, anchor);
  11518. current = true;
  11519. },
  11520. p(ctx, dirty) {
  11521. const parametertable_changes = {};
  11522. if (dirty & /*pathParameters*/ 1) parametertable_changes.parameters = /*pathParameters*/ ctx[0];
  11523. parametertable.$set(parametertable_changes);
  11524. },
  11525. i(local) {
  11526. if (current) return;
  11527. transition_in(parametertable.$$.fragment, local);
  11528. current = true;
  11529. },
  11530. o(local) {
  11531. transition_out(parametertable.$$.fragment, local);
  11532. current = false;
  11533. },
  11534. d(detaching) {
  11535. destroy_component(parametertable, detaching);
  11536. }
  11537. };
  11538. }
  11539. // (14:0) {#if queryParameters.length > 0}
  11540. function create_if_block$8(ctx) {
  11541. let current;
  11542. const parametertable = new ParameterTable({
  11543. props: {
  11544. parameters: /*queryParameters*/ ctx[1],
  11545. title: "Query Parameters"
  11546. }
  11547. });
  11548. return {
  11549. c() {
  11550. create_component(parametertable.$$.fragment);
  11551. },
  11552. m(target, anchor) {
  11553. mount_component(parametertable, target, anchor);
  11554. current = true;
  11555. },
  11556. p(ctx, dirty) {
  11557. const parametertable_changes = {};
  11558. if (dirty & /*queryParameters*/ 2) parametertable_changes.parameters = /*queryParameters*/ ctx[1];
  11559. parametertable.$set(parametertable_changes);
  11560. },
  11561. i(local) {
  11562. if (current) return;
  11563. transition_in(parametertable.$$.fragment, local);
  11564. current = true;
  11565. },
  11566. o(local) {
  11567. transition_out(parametertable.$$.fragment, local);
  11568. current = false;
  11569. },
  11570. d(detaching) {
  11571. destroy_component(parametertable, detaching);
  11572. }
  11573. };
  11574. }
  11575. function create_fragment$8(ctx) {
  11576. let t;
  11577. let if_block1_anchor;
  11578. let current;
  11579. let if_block0 = /*pathParameters*/ ctx[0].length > 0 && create_if_block_1$5(ctx);
  11580. let if_block1 = /*queryParameters*/ ctx[1].length > 0 && create_if_block$8(ctx);
  11581. return {
  11582. c() {
  11583. if (if_block0) if_block0.c();
  11584. t = space();
  11585. if (if_block1) if_block1.c();
  11586. if_block1_anchor = empty();
  11587. },
  11588. m(target, anchor) {
  11589. if (if_block0) if_block0.m(target, anchor);
  11590. insert(target, t, anchor);
  11591. if (if_block1) if_block1.m(target, anchor);
  11592. insert(target, if_block1_anchor, anchor);
  11593. current = true;
  11594. },
  11595. p(ctx, [dirty]) {
  11596. if (/*pathParameters*/ ctx[0].length > 0) {
  11597. if (if_block0) {
  11598. if_block0.p(ctx, dirty);
  11599. transition_in(if_block0, 1);
  11600. } else {
  11601. if_block0 = create_if_block_1$5(ctx);
  11602. if_block0.c();
  11603. transition_in(if_block0, 1);
  11604. if_block0.m(t.parentNode, t);
  11605. }
  11606. } else if (if_block0) {
  11607. group_outros();
  11608. transition_out(if_block0, 1, 1, () => {
  11609. if_block0 = null;
  11610. });
  11611. check_outros();
  11612. }
  11613. if (/*queryParameters*/ ctx[1].length > 0) {
  11614. if (if_block1) {
  11615. if_block1.p(ctx, dirty);
  11616. transition_in(if_block1, 1);
  11617. } else {
  11618. if_block1 = create_if_block$8(ctx);
  11619. if_block1.c();
  11620. transition_in(if_block1, 1);
  11621. if_block1.m(if_block1_anchor.parentNode, if_block1_anchor);
  11622. }
  11623. } else if (if_block1) {
  11624. group_outros();
  11625. transition_out(if_block1, 1, 1, () => {
  11626. if_block1 = null;
  11627. });
  11628. check_outros();
  11629. }
  11630. },
  11631. i(local) {
  11632. if (current) return;
  11633. transition_in(if_block0);
  11634. transition_in(if_block1);
  11635. current = true;
  11636. },
  11637. o(local) {
  11638. transition_out(if_block0);
  11639. transition_out(if_block1);
  11640. current = false;
  11641. },
  11642. d(detaching) {
  11643. if (if_block0) if_block0.d(detaching);
  11644. if (detaching) detach(t);
  11645. if (if_block1) if_block1.d(detaching);
  11646. if (detaching) detach(if_block1_anchor);
  11647. }
  11648. };
  11649. }
  11650. function instance$8($$self, $$props, $$invalidate) {
  11651. let { parameters = [] } = $$props;
  11652. $$self.$set = $$props => {
  11653. if ("parameters" in $$props) $$invalidate(2, parameters = $$props.parameters);
  11654. };
  11655. let pathParameters;
  11656. let queryParameters;
  11657. $$self.$$.update = () => {
  11658. if ($$self.$$.dirty & /*parameters*/ 4) {
  11659. $$invalidate(0, pathParameters = parameters.filter(param => param.location === "path"));
  11660. }
  11661. if ($$self.$$.dirty & /*parameters*/ 4) {
  11662. $$invalidate(1, queryParameters = parameters.filter(param => param.location === "query"));
  11663. }
  11664. };
  11665. return [pathParameters, queryParameters, parameters];
  11666. }
  11667. class ParameterPanel extends SvelteComponent {
  11668. constructor(options) {
  11669. super();
  11670. init(this, options, instance$8, create_fragment$8, safe_not_equal, { parameters: 2 });
  11671. }
  11672. }
  11673. /* usr/local/lib/node_modules/snowboard/templates/winter/components/LoginButton.svelte generated by Svelte v3.16.5 */
  11674. function create_fragment$9(ctx) {
  11675. let a;
  11676. let span0;
  11677. let t0;
  11678. let span1;
  11679. return {
  11680. c() {
  11681. a = element("a");
  11682. span0 = element("span");
  11683. span0.innerHTML = `<i class="fas fa-sign-in-alt" aria-hidden="true"></i>`;
  11684. t0 = space();
  11685. span1 = element("span");
  11686. span1.textContent = "Login";
  11687. attr(span0, "class", "icon");
  11688. attr(a, "href", /*authorizeUrl*/ ctx[1]);
  11689. attr(a, "class", "button is-dark is-rounded");
  11690. toggle_class(a, "is-fullwidth", /*fullWidth*/ ctx[0]);
  11691. },
  11692. m(target, anchor) {
  11693. insert(target, a, anchor);
  11694. append(a, span0);
  11695. append(a, t0);
  11696. append(a, span1);
  11697. },
  11698. p(ctx, [dirty]) {
  11699. if (dirty & /*authorizeUrl*/ 2) {
  11700. attr(a, "href", /*authorizeUrl*/ ctx[1]);
  11701. }
  11702. if (dirty & /*fullWidth*/ 1) {
  11703. toggle_class(a, "is-fullwidth", /*fullWidth*/ ctx[0]);
  11704. }
  11705. },
  11706. i: noop,
  11707. o: noop,
  11708. d(detaching) {
  11709. if (detaching) detach(a);
  11710. }
  11711. };
  11712. }
  11713. function instance$9($$self, $$props, $$invalidate) {
  11714. let { authOptions } = $$props;
  11715. let { fullWidth } = $$props;
  11716. $$self.$set = $$props => {
  11717. if ("authOptions" in $$props) $$invalidate(2, authOptions = $$props.authOptions);
  11718. if ("fullWidth" in $$props) $$invalidate(0, fullWidth = $$props.fullWidth);
  11719. };
  11720. let authorizeParams;
  11721. let authorizeUrl;
  11722. $$self.$$.update = () => {
  11723. if ($$self.$$.dirty & /*authOptions*/ 4) {
  11724. $$invalidate(3, authorizeParams = querystringify_1.stringify(
  11725. {
  11726. client_id: authOptions.clientId,
  11727. redirect_uri: authOptions.callbackUrl,
  11728. response_type: "code",
  11729. scope: authOptions.scopes || ""
  11730. },
  11731. true
  11732. ));
  11733. }
  11734. if ($$self.$$.dirty & /*authOptions, authorizeParams*/ 12) {
  11735. $$invalidate(1, authorizeUrl = `${authOptions.authorizeUrl}${authorizeParams}`);
  11736. }
  11737. };
  11738. return [fullWidth, authorizeUrl, authOptions];
  11739. }
  11740. class LoginButton extends SvelteComponent {
  11741. constructor(options) {
  11742. super();
  11743. init(this, options, instance$9, create_fragment$9, safe_not_equal, { authOptions: 2, fullWidth: 0 });
  11744. }
  11745. }
  11746. /* usr/local/lib/node_modules/snowboard/templates/winter/components/LogoutButton.svelte generated by Svelte v3.16.5 */
  11747. function create_fragment$a(ctx) {
  11748. let a;
  11749. let dispose;
  11750. return {
  11751. c() {
  11752. a = element("a");
  11753. a.innerHTML = `<span class="icon has-text-grey"><i class="fas fa-sign-out-alt" aria-hidden="true"></i></span>
  11754. <span>Logout</span>`;
  11755. attr(a, "href", "javascript:void(0)");
  11756. attr(a, "class", "button is-light");
  11757. dispose = listen(a, "click", /*handleClick*/ ctx[0]);
  11758. },
  11759. m(target, anchor) {
  11760. insert(target, a, anchor);
  11761. },
  11762. p: noop,
  11763. i: noop,
  11764. o: noop,
  11765. d(detaching) {
  11766. if (detaching) detach(a);
  11767. dispose();
  11768. }
  11769. };
  11770. }
  11771. function instance$a($$self, $$props, $$invalidate) {
  11772. let $env;
  11773. component_subscribe($$self, env, $$value => $$invalidate(1, $env = $$value));
  11774. function handleClick() {
  11775. auth.remove($env);
  11776. removeToken($env);
  11777. removeRefreshToken($env);
  11778. }
  11779. return [handleClick];
  11780. }
  11781. class LogoutButton extends SvelteComponent {
  11782. constructor(options) {
  11783. super();
  11784. init(this, options, instance$a, create_fragment$a, safe_not_equal, {});
  11785. }
  11786. }
  11787. /* usr/local/lib/node_modules/snowboard/templates/winter/panels/SelectorPanel.svelte generated by Svelte v3.16.5 */
  11788. function add_css$3() {
  11789. var style = element("style");
  11790. style.id = "svelte-cjzzpf-style";
  11791. style.textContent = ".icon-info.svelte-cjzzpf{cursor:pointer}.content.svelte-cjzzpf{padding:1rem 1.5rem}";
  11792. append(document.head, style);
  11793. }
  11794. function get_each_context$4(ctx, list, i) {
  11795. const child_ctx = ctx.slice();
  11796. child_ctx[8] = list[i];
  11797. return child_ctx;
  11798. }
  11799. // (44:0) {#if isAuth(environment, 'oauth2')}
  11800. function create_if_block_1$6(ctx) {
  11801. let show_if;
  11802. let current_block_type_index;
  11803. let if_block;
  11804. let if_block_anchor;
  11805. let current;
  11806. const if_block_creators = [create_if_block_2$3, create_if_block_3$1, create_else_block_1];
  11807. const if_blocks = [];
  11808. function select_block_type(ctx, dirty) {
  11809. if (/*authenticating*/ ctx[1]) return 0;
  11810. if (dirty & /*$auth, $env*/ 48) show_if = !!/*$auth*/ ctx[5].includes(/*$env*/ ctx[4]);
  11811. if (show_if) return 1;
  11812. return 2;
  11813. }
  11814. current_block_type_index = select_block_type(ctx, -1);
  11815. if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
  11816. return {
  11817. c() {
  11818. if_block.c();
  11819. if_block_anchor = empty();
  11820. },
  11821. m(target, anchor) {
  11822. if_blocks[current_block_type_index].m(target, anchor);
  11823. insert(target, if_block_anchor, anchor);
  11824. current = true;
  11825. },
  11826. p(ctx, dirty) {
  11827. let previous_block_index = current_block_type_index;
  11828. current_block_type_index = select_block_type(ctx, dirty);
  11829. if (current_block_type_index === previous_block_index) {
  11830. if_blocks[current_block_type_index].p(ctx, dirty);
  11831. } else {
  11832. group_outros();
  11833. transition_out(if_blocks[previous_block_index], 1, 1, () => {
  11834. if_blocks[previous_block_index] = null;
  11835. });
  11836. check_outros();
  11837. if_block = if_blocks[current_block_type_index];
  11838. if (!if_block) {
  11839. if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
  11840. if_block.c();
  11841. }
  11842. transition_in(if_block, 1);
  11843. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  11844. }
  11845. },
  11846. i(local) {
  11847. if (current) return;
  11848. transition_in(if_block);
  11849. current = true;
  11850. },
  11851. o(local) {
  11852. transition_out(if_block);
  11853. current = false;
  11854. },
  11855. d(detaching) {
  11856. if_blocks[current_block_type_index].d(detaching);
  11857. if (detaching) detach(if_block_anchor);
  11858. }
  11859. };
  11860. }
  11861. // (59:2) {:else}
  11862. function create_else_block_1(ctx) {
  11863. let div1;
  11864. let div0;
  11865. let p;
  11866. let current;
  11867. const loginbutton = new LoginButton({
  11868. props: {
  11869. authOptions: /*environment*/ ctx[3].auth.options
  11870. }
  11871. });
  11872. return {
  11873. c() {
  11874. div1 = element("div");
  11875. div0 = element("div");
  11876. p = element("p");
  11877. create_component(loginbutton.$$.fragment);
  11878. attr(p, "class", "control");
  11879. attr(div0, "class", "field is-grouped");
  11880. attr(div1, "class", "navbar-item");
  11881. },
  11882. m(target, anchor) {
  11883. insert(target, div1, anchor);
  11884. append(div1, div0);
  11885. append(div0, p);
  11886. mount_component(loginbutton, p, null);
  11887. current = true;
  11888. },
  11889. p(ctx, dirty) {
  11890. const loginbutton_changes = {};
  11891. if (dirty & /*environment*/ 8) loginbutton_changes.authOptions = /*environment*/ ctx[3].auth.options;
  11892. loginbutton.$set(loginbutton_changes);
  11893. },
  11894. i(local) {
  11895. if (current) return;
  11896. transition_in(loginbutton.$$.fragment, local);
  11897. current = true;
  11898. },
  11899. o(local) {
  11900. transition_out(loginbutton.$$.fragment, local);
  11901. current = false;
  11902. },
  11903. d(detaching) {
  11904. if (detaching) detach(div1);
  11905. destroy_component(loginbutton);
  11906. }
  11907. };
  11908. }
  11909. // (51:33)
  11910. function create_if_block_3$1(ctx) {
  11911. let div1;
  11912. let div0;
  11913. let p;
  11914. let current;
  11915. const logoutbutton = new LogoutButton({});
  11916. return {
  11917. c() {
  11918. div1 = element("div");
  11919. div0 = element("div");
  11920. p = element("p");
  11921. create_component(logoutbutton.$$.fragment);
  11922. attr(p, "class", "control");
  11923. attr(div0, "class", "field is-grouped");
  11924. attr(div1, "class", "navbar-item");
  11925. },
  11926. m(target, anchor) {
  11927. insert(target, div1, anchor);
  11928. append(div1, div0);
  11929. append(div0, p);
  11930. mount_component(logoutbutton, p, null);
  11931. current = true;
  11932. },
  11933. p: noop,
  11934. i(local) {
  11935. if (current) return;
  11936. transition_in(logoutbutton.$$.fragment, local);
  11937. current = true;
  11938. },
  11939. o(local) {
  11940. transition_out(logoutbutton.$$.fragment, local);
  11941. current = false;
  11942. },
  11943. d(detaching) {
  11944. if (detaching) detach(div1);
  11945. destroy_component(logoutbutton);
  11946. }
  11947. };
  11948. }
  11949. // (45:2) {#if authenticating}
  11950. function create_if_block_2$3(ctx) {
  11951. let div;
  11952. return {
  11953. c() {
  11954. div = element("div");
  11955. div.innerHTML = `<span class="icon is-medium has-text-danger"><i class="fas fa-2x fa-spinner fa-pulse"></i></span>`;
  11956. attr(div, "class", "navbar-item");
  11957. },
  11958. m(target, anchor) {
  11959. insert(target, div, anchor);
  11960. },
  11961. p: noop,
  11962. i: noop,
  11963. o: noop,
  11964. d(detaching) {
  11965. if (detaching) detach(div);
  11966. }
  11967. };
  11968. }
  11969. // (76:4) {#each Object.keys(environments) as envName}
  11970. function create_each_block$4(ctx) {
  11971. let a;
  11972. let t0_value = /*envName*/ ctx[8] + "";
  11973. let t0;
  11974. let t1;
  11975. let a_data_name_value;
  11976. let dispose;
  11977. return {
  11978. c() {
  11979. a = element("a");
  11980. t0 = text(t0_value);
  11981. t1 = space();
  11982. attr(a, "data-name", a_data_name_value = /*envName*/ ctx[8]);
  11983. attr(a, "href", "javascript:void(0)");
  11984. attr(a, "class", "navbar-item");
  11985. dispose = listen(a, "click", /*handleClick*/ ctx[6]);
  11986. },
  11987. m(target, anchor) {
  11988. insert(target, a, anchor);
  11989. append(a, t0);
  11990. append(a, t1);
  11991. },
  11992. p(ctx, dirty) {
  11993. if (dirty & /*environments*/ 1 && t0_value !== (t0_value = /*envName*/ ctx[8] + "")) set_data(t0, t0_value);
  11994. if (dirty & /*environments*/ 1 && a_data_name_value !== (a_data_name_value = /*envName*/ ctx[8])) {
  11995. attr(a, "data-name", a_data_name_value);
  11996. }
  11997. },
  11998. d(detaching) {
  11999. if (detaching) detach(a);
  12000. dispose();
  12001. }
  12002. };
  12003. }
  12004. // (102:8) {:else}
  12005. function create_else_block$2(ctx) {
  12006. let span;
  12007. return {
  12008. c() {
  12009. span = element("span");
  12010. span.textContent = "None";
  12011. attr(span, "class", "is-capitalized");
  12012. },
  12013. m(target, anchor) {
  12014. insert(target, span, anchor);
  12015. },
  12016. p: noop,
  12017. d(detaching) {
  12018. if (detaching) detach(span);
  12019. }
  12020. };
  12021. }
  12022. // (100:8) {#if environment.auth}
  12023. function create_if_block$9(ctx) {
  12024. let span;
  12025. let t_value = /*environment*/ ctx[3].auth.name + "";
  12026. let t;
  12027. return {
  12028. c() {
  12029. span = element("span");
  12030. t = text(t_value);
  12031. attr(span, "class", "is-capitalized");
  12032. },
  12033. m(target, anchor) {
  12034. insert(target, span, anchor);
  12035. append(span, t);
  12036. },
  12037. p(ctx, dirty) {
  12038. if (dirty & /*environment*/ 8 && t_value !== (t_value = /*environment*/ ctx[3].auth.name + "")) set_data(t, t_value);
  12039. },
  12040. d(detaching) {
  12041. if (detaching) detach(span);
  12042. }
  12043. };
  12044. }
  12045. function create_fragment$b(ctx) {
  12046. let show_if = isAuth(/*environment*/ ctx[3], "oauth2");
  12047. let t0;
  12048. let div1;
  12049. let a0;
  12050. let t1;
  12051. let t2;
  12052. let div0;
  12053. let t3;
  12054. let div4;
  12055. let a1;
  12056. let t4;
  12057. let div3;
  12058. let div2;
  12059. let p0;
  12060. let t5;
  12061. let t6_value = /*environment*/ ctx[3].url + "";
  12062. let t6;
  12063. let t7;
  12064. let p1;
  12065. let t8;
  12066. let current;
  12067. let dispose;
  12068. let if_block0 = show_if && create_if_block_1$6(ctx);
  12069. let each_value = Object.keys(/*environments*/ ctx[0]);
  12070. let each_blocks = [];
  12071. for (let i = 0; i < each_value.length; i += 1) {
  12072. each_blocks[i] = create_each_block$4(get_each_context$4(ctx, each_value, i));
  12073. }
  12074. function select_block_type_1(ctx, dirty) {
  12075. if (/*environment*/ ctx[3].auth) return create_if_block$9;
  12076. return create_else_block$2;
  12077. }
  12078. let current_block_type = select_block_type_1(ctx, -1);
  12079. let if_block1 = current_block_type(ctx);
  12080. return {
  12081. c() {
  12082. if (if_block0) if_block0.c();
  12083. t0 = space();
  12084. div1 = element("div");
  12085. a0 = element("a");
  12086. t1 = text(/*$env*/ ctx[4]);
  12087. t2 = space();
  12088. div0 = element("div");
  12089. for (let i = 0; i < each_blocks.length; i += 1) {
  12090. each_blocks[i].c();
  12091. }
  12092. t3 = space();
  12093. div4 = element("div");
  12094. a1 = element("a");
  12095. a1.innerHTML = `<span class="icon icon-info is-medium has-text-grey-light svelte-cjzzpf"><i class="fas fa-lg fa-info-circle"></i></span>`;
  12096. t4 = space();
  12097. div3 = element("div");
  12098. div2 = element("div");
  12099. p0 = element("p");
  12100. t5 = text("BaseURL: ");
  12101. t6 = text(t6_value);
  12102. t7 = space();
  12103. p1 = element("p");
  12104. t8 = text("Auth:\n ");
  12105. if_block1.c();
  12106. attr(a0, "href", "javascript:void(0)");
  12107. attr(a0, "class", "navbar-link");
  12108. attr(div0, "class", "navbar-dropdown is-right");
  12109. attr(div1, "class", "navbar-item has-dropdown is-capitalized");
  12110. toggle_class(div1, "is-active", /*show*/ ctx[2]);
  12111. attr(a1, "href", "javascript:void(0)");
  12112. attr(a1, "class", "navbar-link is-arrowless");
  12113. attr(div2, "class", "content svelte-cjzzpf");
  12114. attr(div3, "class", "navbar-dropdown is-right");
  12115. attr(div4, "class", "navbar-item has-dropdown is-hoverable");
  12116. dispose = listen(a0, "click", /*toggleClick*/ ctx[7]);
  12117. },
  12118. m(target, anchor) {
  12119. if (if_block0) if_block0.m(target, anchor);
  12120. insert(target, t0, anchor);
  12121. insert(target, div1, anchor);
  12122. append(div1, a0);
  12123. append(a0, t1);
  12124. append(div1, t2);
  12125. append(div1, div0);
  12126. for (let i = 0; i < each_blocks.length; i += 1) {
  12127. each_blocks[i].m(div0, null);
  12128. }
  12129. insert(target, t3, anchor);
  12130. insert(target, div4, anchor);
  12131. append(div4, a1);
  12132. append(div4, t4);
  12133. append(div4, div3);
  12134. append(div3, div2);
  12135. append(div2, p0);
  12136. append(p0, t5);
  12137. append(p0, t6);
  12138. append(div2, t7);
  12139. append(div2, p1);
  12140. append(p1, t8);
  12141. if_block1.m(p1, null);
  12142. current = true;
  12143. },
  12144. p(ctx, [dirty]) {
  12145. if (dirty & /*environment*/ 8) show_if = isAuth(/*environment*/ ctx[3], "oauth2");
  12146. if (show_if) {
  12147. if (if_block0) {
  12148. if_block0.p(ctx, dirty);
  12149. transition_in(if_block0, 1);
  12150. } else {
  12151. if_block0 = create_if_block_1$6(ctx);
  12152. if_block0.c();
  12153. transition_in(if_block0, 1);
  12154. if_block0.m(t0.parentNode, t0);
  12155. }
  12156. } else if (if_block0) {
  12157. group_outros();
  12158. transition_out(if_block0, 1, 1, () => {
  12159. if_block0 = null;
  12160. });
  12161. check_outros();
  12162. }
  12163. if (!current || dirty & /*$env*/ 16) set_data(t1, /*$env*/ ctx[4]);
  12164. if (dirty & /*Object, environments, handleClick*/ 65) {
  12165. each_value = Object.keys(/*environments*/ ctx[0]);
  12166. let i;
  12167. for (i = 0; i < each_value.length; i += 1) {
  12168. const child_ctx = get_each_context$4(ctx, each_value, i);
  12169. if (each_blocks[i]) {
  12170. each_blocks[i].p(child_ctx, dirty);
  12171. } else {
  12172. each_blocks[i] = create_each_block$4(child_ctx);
  12173. each_blocks[i].c();
  12174. each_blocks[i].m(div0, null);
  12175. }
  12176. }
  12177. for (; i < each_blocks.length; i += 1) {
  12178. each_blocks[i].d(1);
  12179. }
  12180. each_blocks.length = each_value.length;
  12181. }
  12182. if (dirty & /*show*/ 4) {
  12183. toggle_class(div1, "is-active", /*show*/ ctx[2]);
  12184. }
  12185. if ((!current || dirty & /*environment*/ 8) && t6_value !== (t6_value = /*environment*/ ctx[3].url + "")) set_data(t6, t6_value);
  12186. if (current_block_type === (current_block_type = select_block_type_1(ctx, dirty)) && if_block1) {
  12187. if_block1.p(ctx, dirty);
  12188. } else {
  12189. if_block1.d(1);
  12190. if_block1 = current_block_type(ctx);
  12191. if (if_block1) {
  12192. if_block1.c();
  12193. if_block1.m(p1, null);
  12194. }
  12195. }
  12196. },
  12197. i(local) {
  12198. if (current) return;
  12199. transition_in(if_block0);
  12200. current = true;
  12201. },
  12202. o(local) {
  12203. transition_out(if_block0);
  12204. current = false;
  12205. },
  12206. d(detaching) {
  12207. if (if_block0) if_block0.d(detaching);
  12208. if (detaching) detach(t0);
  12209. if (detaching) detach(div1);
  12210. destroy_each(each_blocks, detaching);
  12211. if (detaching) detach(t3);
  12212. if (detaching) detach(div4);
  12213. if_block1.d();
  12214. dispose();
  12215. }
  12216. };
  12217. }
  12218. function instance$b($$self, $$props, $$invalidate) {
  12219. let $env;
  12220. let $auth;
  12221. component_subscribe($$self, env, $$value => $$invalidate(4, $env = $$value));
  12222. component_subscribe($$self, auth, $$value => $$invalidate(5, $auth = $$value));
  12223. let { environments } = $$props;
  12224. let { authenticating } = $$props;
  12225. let show = false;
  12226. function handleClick(event) {
  12227. $$invalidate(2, show = false);
  12228. const envName = event.target.dataset["name"];
  12229. env.set(envName);
  12230. const authToken = getToken($env);
  12231. if (authToken) {
  12232. auth.add(envName);
  12233. token.set(authToken);
  12234. }
  12235. }
  12236. function toggleClick() {
  12237. $$invalidate(2, show = !show);
  12238. }
  12239. $$self.$set = $$props => {
  12240. if ("environments" in $$props) $$invalidate(0, environments = $$props.environments);
  12241. if ("authenticating" in $$props) $$invalidate(1, authenticating = $$props.authenticating);
  12242. };
  12243. let environment;
  12244. $$self.$$.update = () => {
  12245. if ($$self.$$.dirty & /*environments, $env*/ 17) {
  12246. $$invalidate(3, environment = environments[$env]);
  12247. }
  12248. };
  12249. return [
  12250. environments,
  12251. authenticating,
  12252. show,
  12253. environment,
  12254. $env,
  12255. $auth,
  12256. handleClick,
  12257. toggleClick
  12258. ];
  12259. }
  12260. class SelectorPanel extends SvelteComponent {
  12261. constructor(options) {
  12262. super();
  12263. if (!document.getElementById("svelte-cjzzpf-style")) add_css$3();
  12264. init(this, options, instance$b, create_fragment$b, safe_not_equal, { environments: 0, authenticating: 1 });
  12265. }
  12266. }
  12267. /* usr/local/lib/node_modules/snowboard/templates/winter/components/ToggleIcon.svelte generated by Svelte v3.16.5 */
  12268. function add_css$4() {
  12269. var style = element("style");
  12270. style.id = "svelte-o7a14x-style";
  12271. style.textContent = ".toggle-icon.svelte-o7a14x{cursor:pointer}";
  12272. append(document.head, style);
  12273. }
  12274. function create_fragment$c(ctx) {
  12275. let span;
  12276. let i;
  12277. let span_class_value;
  12278. let dispose;
  12279. return {
  12280. c() {
  12281. span = element("span");
  12282. i = element("i");
  12283. attr(i, "class", "fas");
  12284. toggle_class(i, "fa-chevron-up", !/*show*/ ctx[0]);
  12285. toggle_class(i, "fa-chevron-down", /*show*/ ctx[0]);
  12286. attr(span, "class", span_class_value = "toggle-icon icon " + /*additionalClass*/ ctx[2] + " svelte-o7a14x");
  12287. toggle_class(span, "has-text-grey", !/*dark*/ ctx[1]);
  12288. dispose = listen(span, "click", /*toggle*/ ctx[3]);
  12289. },
  12290. m(target, anchor) {
  12291. insert(target, span, anchor);
  12292. append(span, i);
  12293. },
  12294. p(ctx, [dirty]) {
  12295. if (dirty & /*show*/ 1) {
  12296. toggle_class(i, "fa-chevron-up", !/*show*/ ctx[0]);
  12297. }
  12298. if (dirty & /*show*/ 1) {
  12299. toggle_class(i, "fa-chevron-down", /*show*/ ctx[0]);
  12300. }
  12301. if (dirty & /*additionalClass*/ 4 && span_class_value !== (span_class_value = "toggle-icon icon " + /*additionalClass*/ ctx[2] + " svelte-o7a14x")) {
  12302. attr(span, "class", span_class_value);
  12303. }
  12304. if (dirty & /*additionalClass, dark*/ 6) {
  12305. toggle_class(span, "has-text-grey", !/*dark*/ ctx[1]);
  12306. }
  12307. },
  12308. i: noop,
  12309. o: noop,
  12310. d(detaching) {
  12311. if (detaching) detach(span);
  12312. dispose();
  12313. }
  12314. };
  12315. }
  12316. function instance$c($$self, $$props, $$invalidate) {
  12317. let { dark = false } = $$props;
  12318. let { show = false } = $$props;
  12319. let { additionalClass = "" } = $$props;
  12320. let { handleClick } = $$props;
  12321. function toggle(event) {
  12322. $$invalidate(0, show = !show);
  12323. handleClick(event);
  12324. }
  12325. $$self.$set = $$props => {
  12326. if ("dark" in $$props) $$invalidate(1, dark = $$props.dark);
  12327. if ("show" in $$props) $$invalidate(0, show = $$props.show);
  12328. if ("additionalClass" in $$props) $$invalidate(2, additionalClass = $$props.additionalClass);
  12329. if ("handleClick" in $$props) $$invalidate(4, handleClick = $$props.handleClick);
  12330. };
  12331. return [show, dark, additionalClass, toggle, handleClick];
  12332. }
  12333. class ToggleIcon extends SvelteComponent {
  12334. constructor(options) {
  12335. super();
  12336. if (!document.getElementById("svelte-o7a14x-style")) add_css$4();
  12337. init(this, options, instance$c, create_fragment$c, safe_not_equal, {
  12338. dark: 1,
  12339. show: 0,
  12340. additionalClass: 2,
  12341. handleClick: 4
  12342. });
  12343. }
  12344. }
  12345. /* usr/local/lib/node_modules/snowboard/templates/winter/panels/CollapsiblePanel.svelte generated by Svelte v3.16.5 */
  12346. function add_css$5() {
  12347. var style = element("style");
  12348. style.id = "svelte-1hkyt70-style";
  12349. style.textContent = ".panel-section.svelte-1hkyt70{padding:1em;border:1px solid #dbdbdb;border-top:none}.panel-button.svelte-1hkyt70{border-radius:4px}.panel-dark.svelte-1hkyt70{border:1px solid #363636}.panel-section.is-darkmode.svelte-1hkyt70{background-color:#222 !important;border-color:#333}";
  12350. append(document.head, style);
  12351. }
  12352. const get_body_slot_changes = dirty => ({});
  12353. const get_body_slot_context = ctx => ({});
  12354. const get_heading_slot_changes = dirty => ({});
  12355. const get_heading_slot_context = ctx => ({});
  12356. function create_fragment$d(ctx) {
  12357. let div2;
  12358. let div0;
  12359. let t0;
  12360. let t1;
  12361. let div1;
  12362. let current;
  12363. const heading_slot_template = /*$$slots*/ ctx[4].heading;
  12364. const heading_slot = create_slot(heading_slot_template, ctx, /*$$scope*/ ctx[3], get_heading_slot_context);
  12365. const toggleicon = new ToggleIcon({
  12366. props: {
  12367. dark: /*dark*/ ctx[1],
  12368. show: /*show*/ ctx[0],
  12369. additionalClass: "is-pulled-right",
  12370. handleClick: /*func*/ ctx[5]
  12371. }
  12372. });
  12373. const body_slot_template = /*$$slots*/ ctx[4].body;
  12374. const body_slot = create_slot(body_slot_template, ctx, /*$$scope*/ ctx[3], get_body_slot_context);
  12375. return {
  12376. c() {
  12377. div2 = element("div");
  12378. div0 = element("div");
  12379. if (heading_slot) heading_slot.c();
  12380. t0 = space();
  12381. create_component(toggleicon.$$.fragment);
  12382. t1 = space();
  12383. div1 = element("div");
  12384. if (body_slot) body_slot.c();
  12385. attr(div0, "class", "panel-heading svelte-1hkyt70");
  12386. toggle_class(div0, "has-background-dark", /*dark*/ ctx[1]);
  12387. toggle_class(div0, "has-text-white", /*dark*/ ctx[1]);
  12388. toggle_class(div0, "panel-dark", /*dark*/ ctx[1]);
  12389. toggle_class(div0, "panel-button", !/*show*/ ctx[0]);
  12390. attr(div1, "class", "panel-section has-background-white svelte-1hkyt70");
  12391. toggle_class(div1, "is-hidden", !/*show*/ ctx[0]);
  12392. toggle_class(div1, "is-darkmode", /*isDarkmode*/ ctx[2]);
  12393. attr(div2, "class", "panel");
  12394. },
  12395. m(target, anchor) {
  12396. insert(target, div2, anchor);
  12397. append(div2, div0);
  12398. if (heading_slot) {
  12399. heading_slot.m(div0, null);
  12400. }
  12401. append(div0, t0);
  12402. mount_component(toggleicon, div0, null);
  12403. append(div2, t1);
  12404. append(div2, div1);
  12405. if (body_slot) {
  12406. body_slot.m(div1, null);
  12407. }
  12408. current = true;
  12409. },
  12410. p(ctx, [dirty]) {
  12411. if (heading_slot && heading_slot.p && dirty & /*$$scope*/ 8) {
  12412. heading_slot.p(get_slot_context(heading_slot_template, ctx, /*$$scope*/ ctx[3], get_heading_slot_context), get_slot_changes(heading_slot_template, /*$$scope*/ ctx[3], dirty, get_heading_slot_changes));
  12413. }
  12414. const toggleicon_changes = {};
  12415. if (dirty & /*dark*/ 2) toggleicon_changes.dark = /*dark*/ ctx[1];
  12416. if (dirty & /*show*/ 1) toggleicon_changes.show = /*show*/ ctx[0];
  12417. if (dirty & /*show*/ 1) toggleicon_changes.handleClick = /*func*/ ctx[5];
  12418. toggleicon.$set(toggleicon_changes);
  12419. if (dirty & /*dark*/ 2) {
  12420. toggle_class(div0, "has-background-dark", /*dark*/ ctx[1]);
  12421. }
  12422. if (dirty & /*dark*/ 2) {
  12423. toggle_class(div0, "has-text-white", /*dark*/ ctx[1]);
  12424. }
  12425. if (dirty & /*dark*/ 2) {
  12426. toggle_class(div0, "panel-dark", /*dark*/ ctx[1]);
  12427. }
  12428. if (dirty & /*show*/ 1) {
  12429. toggle_class(div0, "panel-button", !/*show*/ ctx[0]);
  12430. }
  12431. if (body_slot && body_slot.p && dirty & /*$$scope*/ 8) {
  12432. body_slot.p(get_slot_context(body_slot_template, ctx, /*$$scope*/ ctx[3], get_body_slot_context), get_slot_changes(body_slot_template, /*$$scope*/ ctx[3], dirty, get_body_slot_changes));
  12433. }
  12434. if (dirty & /*show*/ 1) {
  12435. toggle_class(div1, "is-hidden", !/*show*/ ctx[0]);
  12436. }
  12437. if (dirty & /*isDarkmode*/ 4) {
  12438. toggle_class(div1, "is-darkmode", /*isDarkmode*/ ctx[2]);
  12439. }
  12440. },
  12441. i(local) {
  12442. if (current) return;
  12443. transition_in(heading_slot, local);
  12444. transition_in(toggleicon.$$.fragment, local);
  12445. transition_in(body_slot, local);
  12446. current = true;
  12447. },
  12448. o(local) {
  12449. transition_out(heading_slot, local);
  12450. transition_out(toggleicon.$$.fragment, local);
  12451. transition_out(body_slot, local);
  12452. current = false;
  12453. },
  12454. d(detaching) {
  12455. if (detaching) detach(div2);
  12456. if (heading_slot) heading_slot.d(detaching);
  12457. destroy_component(toggleicon);
  12458. if (body_slot) body_slot.d(detaching);
  12459. }
  12460. };
  12461. }
  12462. function instance$d($$self, $$props, $$invalidate) {
  12463. let { dark = false } = $$props;
  12464. let { show = false } = $$props;
  12465. let { isDarkmode } = $$props;
  12466. let { $$slots = {}, $$scope } = $$props;
  12467. const func = () => $$invalidate(0, show = !show);
  12468. $$self.$set = $$props => {
  12469. if ("dark" in $$props) $$invalidate(1, dark = $$props.dark);
  12470. if ("show" in $$props) $$invalidate(0, show = $$props.show);
  12471. if ("isDarkmode" in $$props) $$invalidate(2, isDarkmode = $$props.isDarkmode);
  12472. if ("$$scope" in $$props) $$invalidate(3, $$scope = $$props.$$scope);
  12473. };
  12474. return [show, dark, isDarkmode, $$scope, $$slots, func];
  12475. }
  12476. class CollapsiblePanel extends SvelteComponent {
  12477. constructor(options) {
  12478. super();
  12479. if (!document.getElementById("svelte-1hkyt70-style")) add_css$5();
  12480. init(this, options, instance$d, create_fragment$d, safe_not_equal, { dark: 1, show: 0, isDarkmode: 2 });
  12481. }
  12482. }
  12483. /* usr/local/lib/node_modules/snowboard/templates/winter/components/FieldDisabled.svelte generated by Svelte v3.16.5 */
  12484. function add_css$6() {
  12485. var style = element("style");
  12486. style.id = "svelte-a7ak6u-style";
  12487. style.textContent = ".control-switch.svelte-a7ak6u{padding-top:0.4rem}.has-border.svelte-a7ak6u{border-color:#dbdbdb}";
  12488. append(document.head, style);
  12489. }
  12490. function create_fragment$e(ctx) {
  12491. let div;
  12492. let p0;
  12493. let input0;
  12494. let input0_id_value;
  12495. let t0;
  12496. let label;
  12497. let label_for_value;
  12498. let t1;
  12499. let p1;
  12500. let input1;
  12501. let t2;
  12502. let p2;
  12503. let input2;
  12504. return {
  12505. c() {
  12506. div = element("div");
  12507. p0 = element("p");
  12508. input0 = element("input");
  12509. t0 = space();
  12510. label = element("label");
  12511. t1 = space();
  12512. p1 = element("p");
  12513. input1 = element("input");
  12514. t2 = space();
  12515. p2 = element("p");
  12516. input2 = element("input");
  12517. attr(input0, "class", "switch is-rounded is-success");
  12518. attr(input0, "id", input0_id_value = "h-" + /*name*/ ctx[0]);
  12519. attr(input0, "type", "checkbox");
  12520. input0.checked = true;
  12521. input0.disabled = true;
  12522. attr(label, "for", label_for_value = "h-" + /*name*/ ctx[0]);
  12523. attr(p0, "class", "control control-switch svelte-a7ak6u");
  12524. attr(input1, "class", "input is-rounded has-border svelte-a7ak6u");
  12525. attr(input1, "type", "text");
  12526. attr(input1, "placeholder", /*placeholder*/ ctx[1]);
  12527. input1.disabled = true;
  12528. attr(p1, "class", "control");
  12529. attr(input2, "class", "input is-rounded has-border is-family-code svelte-a7ak6u");
  12530. attr(input2, "type", "text");
  12531. input2.value = /*value*/ ctx[2];
  12532. input2.disabled = true;
  12533. attr(p2, "class", "control is-expanded");
  12534. attr(div, "class", "field has-addons");
  12535. },
  12536. m(target, anchor) {
  12537. insert(target, div, anchor);
  12538. append(div, p0);
  12539. append(p0, input0);
  12540. append(p0, t0);
  12541. append(p0, label);
  12542. append(div, t1);
  12543. append(div, p1);
  12544. append(p1, input1);
  12545. append(div, t2);
  12546. append(div, p2);
  12547. append(p2, input2);
  12548. },
  12549. p(ctx, [dirty]) {
  12550. if (dirty & /*name*/ 1 && input0_id_value !== (input0_id_value = "h-" + /*name*/ ctx[0])) {
  12551. attr(input0, "id", input0_id_value);
  12552. }
  12553. if (dirty & /*name*/ 1 && label_for_value !== (label_for_value = "h-" + /*name*/ ctx[0])) {
  12554. attr(label, "for", label_for_value);
  12555. }
  12556. if (dirty & /*placeholder*/ 2) {
  12557. attr(input1, "placeholder", /*placeholder*/ ctx[1]);
  12558. }
  12559. if (dirty & /*value*/ 4) {
  12560. input2.value = /*value*/ ctx[2];
  12561. }
  12562. },
  12563. i: noop,
  12564. o: noop,
  12565. d(detaching) {
  12566. if (detaching) detach(div);
  12567. }
  12568. };
  12569. }
  12570. function instance$e($$self, $$props, $$invalidate) {
  12571. let { name } = $$props;
  12572. let { placeholder } = $$props;
  12573. let { value } = $$props;
  12574. $$self.$set = $$props => {
  12575. if ("name" in $$props) $$invalidate(0, name = $$props.name);
  12576. if ("placeholder" in $$props) $$invalidate(1, placeholder = $$props.placeholder);
  12577. if ("value" in $$props) $$invalidate(2, value = $$props.value);
  12578. };
  12579. return [name, placeholder, value];
  12580. }
  12581. class FieldDisabled extends SvelteComponent {
  12582. constructor(options) {
  12583. super();
  12584. if (!document.getElementById("svelte-a7ak6u-style")) add_css$6();
  12585. init(this, options, instance$e, create_fragment$e, safe_not_equal, { name: 0, placeholder: 1, value: 2 });
  12586. }
  12587. }
  12588. /* usr/local/lib/node_modules/snowboard/templates/winter/components/FieldSwitch.svelte generated by Svelte v3.16.5 */
  12589. function add_css$7() {
  12590. var style = element("style");
  12591. style.id = "svelte-a7ak6u-style";
  12592. style.textContent = ".control-switch.svelte-a7ak6u{padding-top:0.4rem}.has-border.svelte-a7ak6u{border-color:#dbdbdb}";
  12593. append(document.head, style);
  12594. }
  12595. function create_fragment$f(ctx) {
  12596. let div;
  12597. let p0;
  12598. let input0;
  12599. let input0_id_value;
  12600. let t0;
  12601. let label;
  12602. let label_for_value;
  12603. let t1;
  12604. let p1;
  12605. let input1;
  12606. let t2;
  12607. let p2;
  12608. let input2;
  12609. let dispose;
  12610. return {
  12611. c() {
  12612. div = element("div");
  12613. p0 = element("p");
  12614. input0 = element("input");
  12615. t0 = space();
  12616. label = element("label");
  12617. t1 = space();
  12618. p1 = element("p");
  12619. input1 = element("input");
  12620. t2 = space();
  12621. p2 = element("p");
  12622. input2 = element("input");
  12623. attr(input0, "class", "switch is-rounded is-success");
  12624. attr(input0, "id", input0_id_value = "p-" + /*name*/ ctx[3]);
  12625. attr(input0, "type", "checkbox");
  12626. input0.disabled = /*required*/ ctx[2];
  12627. attr(label, "for", label_for_value = "p-" + /*name*/ ctx[3]);
  12628. attr(p0, "class", "control control-switch svelte-a7ak6u");
  12629. attr(input1, "class", "input is-rounded has-border svelte-a7ak6u");
  12630. attr(input1, "type", "text");
  12631. attr(input1, "placeholder", /*name*/ ctx[3]);
  12632. input1.disabled = true;
  12633. attr(p1, "class", "control");
  12634. attr(input2, "class", "input has-border is-family-code svelte-a7ak6u");
  12635. attr(input2, "type", "text");
  12636. toggle_class(input2, "is-rounded", /*rounded*/ ctx[4]);
  12637. attr(p2, "class", "control is-expanded");
  12638. attr(div, "class", "field has-addons");
  12639. dispose = [
  12640. listen(input0, "change", /*input0_change_handler*/ ctx[5]),
  12641. listen(input2, "input", /*input2_input_handler*/ ctx[6])
  12642. ];
  12643. },
  12644. m(target, anchor) {
  12645. insert(target, div, anchor);
  12646. append(div, p0);
  12647. append(p0, input0);
  12648. input0.checked = /*used*/ ctx[0];
  12649. append(p0, t0);
  12650. append(p0, label);
  12651. append(div, t1);
  12652. append(div, p1);
  12653. append(p1, input1);
  12654. append(div, t2);
  12655. append(div, p2);
  12656. append(p2, input2);
  12657. set_input_value(input2, /*value*/ ctx[1]);
  12658. },
  12659. p(ctx, [dirty]) {
  12660. if (dirty & /*name*/ 8 && input0_id_value !== (input0_id_value = "p-" + /*name*/ ctx[3])) {
  12661. attr(input0, "id", input0_id_value);
  12662. }
  12663. if (dirty & /*required*/ 4) {
  12664. input0.disabled = /*required*/ ctx[2];
  12665. }
  12666. if (dirty & /*used*/ 1) {
  12667. input0.checked = /*used*/ ctx[0];
  12668. }
  12669. if (dirty & /*name*/ 8 && label_for_value !== (label_for_value = "p-" + /*name*/ ctx[3])) {
  12670. attr(label, "for", label_for_value);
  12671. }
  12672. if (dirty & /*name*/ 8) {
  12673. attr(input1, "placeholder", /*name*/ ctx[3]);
  12674. }
  12675. if (dirty & /*value*/ 2 && input2.value !== /*value*/ ctx[1]) {
  12676. set_input_value(input2, /*value*/ ctx[1]);
  12677. }
  12678. if (dirty & /*rounded*/ 16) {
  12679. toggle_class(input2, "is-rounded", /*rounded*/ ctx[4]);
  12680. }
  12681. },
  12682. i: noop,
  12683. o: noop,
  12684. d(detaching) {
  12685. if (detaching) detach(div);
  12686. run_all(dispose);
  12687. }
  12688. };
  12689. }
  12690. function instance$f($$self, $$props, $$invalidate) {
  12691. let { used } = $$props;
  12692. let { required } = $$props;
  12693. let { name } = $$props;
  12694. let { value } = $$props;
  12695. let { rounded } = $$props;
  12696. function input0_change_handler() {
  12697. used = this.checked;
  12698. $$invalidate(0, used);
  12699. }
  12700. function input2_input_handler() {
  12701. value = this.value;
  12702. $$invalidate(1, value);
  12703. }
  12704. $$self.$set = $$props => {
  12705. if ("used" in $$props) $$invalidate(0, used = $$props.used);
  12706. if ("required" in $$props) $$invalidate(2, required = $$props.required);
  12707. if ("name" in $$props) $$invalidate(3, name = $$props.name);
  12708. if ("value" in $$props) $$invalidate(1, value = $$props.value);
  12709. if ("rounded" in $$props) $$invalidate(4, rounded = $$props.rounded);
  12710. };
  12711. return [
  12712. used,
  12713. value,
  12714. required,
  12715. name,
  12716. rounded,
  12717. input0_change_handler,
  12718. input2_input_handler
  12719. ];
  12720. }
  12721. class FieldSwitch extends SvelteComponent {
  12722. constructor(options) {
  12723. super();
  12724. if (!document.getElementById("svelte-a7ak6u-style")) add_css$7();
  12725. init(this, options, instance$f, create_fragment$f, safe_not_equal, {
  12726. used: 0,
  12727. required: 2,
  12728. name: 3,
  12729. value: 1,
  12730. rounded: 4
  12731. });
  12732. }
  12733. }
  12734. /* usr/local/lib/node_modules/snowboard/templates/winter/panels/PlaygroundPanel.svelte generated by Svelte v3.16.5 */
  12735. function add_css$8() {
  12736. var style = element("style");
  12737. style.id = "svelte-c3oocm-style";
  12738. style.textContent = ".small-section.svelte-c3oocm{padding-top:0.5rem}.button-left.svelte-c3oocm{justify-content:left}.control-switch.svelte-c3oocm{padding-top:0.4rem}.container-content.svelte-c3oocm{padding:0.5rem 1rem;border-radius:4px;margin-top:0.5rem;background-color:#2b2b2b}.content-header.svelte-c3oocm{color:#fff;border-bottom:dashed 1px #777;padding-top:0.5rem;padding-bottom:1rem}.hero-small.svelte-c3oocm{padding:1.5rem}.has-border.svelte-c3oocm{border-color:#dbdbdb}.hero-rounded.svelte-c3oocm{border-radius:4px}";
  12739. append(document.head, style);
  12740. }
  12741. function get_each_context$5(ctx, list, i) {
  12742. const child_ctx = ctx.slice();
  12743. child_ctx[29] = list[i][0];
  12744. child_ctx[30] = list[i][1];
  12745. return child_ctx;
  12746. }
  12747. function get_each_context_1$1(ctx, list, i) {
  12748. const child_ctx = ctx.slice();
  12749. child_ctx[33] = list[i];
  12750. child_ctx[34] = list;
  12751. child_ctx[35] = i;
  12752. return child_ctx;
  12753. }
  12754. function get_each_context_2$1(ctx, list, i) {
  12755. const child_ctx = ctx.slice();
  12756. child_ctx[36] = list[i];
  12757. child_ctx[37] = list;
  12758. child_ctx[38] = i;
  12759. return child_ctx;
  12760. }
  12761. // (126:2) <span slot="heading">
  12762. function create_heading_slot(ctx) {
  12763. let span;
  12764. return {
  12765. c() {
  12766. span = element("span");
  12767. span.textContent = "Playground";
  12768. attr(span, "slot", "heading");
  12769. },
  12770. m(target, anchor) {
  12771. insert(target, span, anchor);
  12772. },
  12773. d(detaching) {
  12774. if (detaching) detach(span);
  12775. }
  12776. };
  12777. }
  12778. // (135:8) {:else}
  12779. function create_else_block_4(ctx) {
  12780. let a;
  12781. let span0;
  12782. let t0_value = /*currentAction*/ ctx[5].method + "";
  12783. let t0;
  12784. let t1;
  12785. let span1;
  12786. let t2_value = /*currentUrl*/ ctx[12].origin + "";
  12787. let t2;
  12788. let t3;
  12789. let span2;
  12790. let t4_value = /*currentUrl*/ ctx[12].pathname + "";
  12791. let t4;
  12792. let dispose;
  12793. return {
  12794. c() {
  12795. a = element("a");
  12796. span0 = element("span");
  12797. t0 = text(t0_value);
  12798. t1 = text("\n  \n ");
  12799. span1 = element("span");
  12800. t2 = text(t2_value);
  12801. t3 = space();
  12802. span2 = element("span");
  12803. t4 = text(t4_value);
  12804. attr(span0, "class", "is-uppercase has-text-weight-bold");
  12805. attr(span2, "class", "has-text-weight-bold");
  12806. attr(a, "href", "javascript:void(0)");
  12807. attr(a, "class", "button button-left is-warning is-family-code is-fullwidth svelte-c3oocm");
  12808. dispose = listen(a, "click", /*handleCopy*/ ctx[17]);
  12809. },
  12810. m(target, anchor) {
  12811. insert(target, a, anchor);
  12812. append(a, span0);
  12813. append(span0, t0);
  12814. append(a, t1);
  12815. append(a, span1);
  12816. append(span1, t2);
  12817. append(a, t3);
  12818. append(a, span2);
  12819. append(span2, t4);
  12820. },
  12821. p(ctx, dirty) {
  12822. if (dirty[0] & /*currentAction*/ 32 && t0_value !== (t0_value = /*currentAction*/ ctx[5].method + "")) set_data(t0, t0_value);
  12823. if (dirty[0] & /*currentUrl*/ 4096 && t2_value !== (t2_value = /*currentUrl*/ ctx[12].origin + "")) set_data(t2, t2_value);
  12824. if (dirty[0] & /*currentUrl*/ 4096 && t4_value !== (t4_value = /*currentUrl*/ ctx[12].pathname + "")) set_data(t4, t4_value);
  12825. },
  12826. d(detaching) {
  12827. if (detaching) detach(a);
  12828. dispose();
  12829. }
  12830. };
  12831. }
  12832. // (130:8) {#if copying}
  12833. function create_if_block_11(ctx) {
  12834. let button;
  12835. return {
  12836. c() {
  12837. button = element("button");
  12838. button.innerHTML = `<span>URL has been copied to clipboard.</span>`;
  12839. attr(button, "class", "button button-left is-warning is-family-code is-fullwidth svelte-c3oocm");
  12840. },
  12841. m(target, anchor) {
  12842. insert(target, button, anchor);
  12843. },
  12844. p: noop,
  12845. d(detaching) {
  12846. if (detaching) detach(button);
  12847. }
  12848. };
  12849. }
  12850. // (154:8) {:else}
  12851. function create_else_block_3(ctx) {
  12852. let button;
  12853. let dispose;
  12854. return {
  12855. c() {
  12856. button = element("button");
  12857. button.innerHTML = `<span class="icon"><i class="fas fa-paper-plane"></i></span>
  12858. <span>Send</span>`;
  12859. attr(button, "class", "button is-success is-fullwidth");
  12860. dispose = listen(button, "click", /*handleClick*/ ctx[15]);
  12861. },
  12862. m(target, anchor) {
  12863. insert(target, button, anchor);
  12864. },
  12865. p: noop,
  12866. i: noop,
  12867. o: noop,
  12868. d(detaching) {
  12869. if (detaching) detach(button);
  12870. dispose();
  12871. }
  12872. };
  12873. }
  12874. // (150:8) {#if isAuth(environment, 'oauth2') && !$auth.includes($env)}
  12875. function create_if_block_10(ctx) {
  12876. let current;
  12877. const loginbutton = new LoginButton({
  12878. props: {
  12879. authOptions: /*environment*/ ctx[10].auth.options,
  12880. fullWidth: true
  12881. }
  12882. });
  12883. return {
  12884. c() {
  12885. create_component(loginbutton.$$.fragment);
  12886. },
  12887. m(target, anchor) {
  12888. mount_component(loginbutton, target, anchor);
  12889. current = true;
  12890. },
  12891. p(ctx, dirty) {
  12892. const loginbutton_changes = {};
  12893. if (dirty[0] & /*environment*/ 1024) loginbutton_changes.authOptions = /*environment*/ ctx[10].auth.options;
  12894. loginbutton.$set(loginbutton_changes);
  12895. },
  12896. i(local) {
  12897. if (current) return;
  12898. transition_in(loginbutton.$$.fragment, local);
  12899. current = true;
  12900. },
  12901. o(local) {
  12902. transition_out(loginbutton.$$.fragment, local);
  12903. current = false;
  12904. },
  12905. d(detaching) {
  12906. destroy_component(loginbutton, detaching);
  12907. }
  12908. };
  12909. }
  12910. // (186:6) {:else}
  12911. function create_else_block_2(ctx) {
  12912. let each_1_anchor;
  12913. let current;
  12914. let each_value_2 = /*requestHeaders*/ ctx[0];
  12915. let each_blocks = [];
  12916. for (let i = 0; i < each_value_2.length; i += 1) {
  12917. each_blocks[i] = create_each_block_2$1(get_each_context_2$1(ctx, each_value_2, i));
  12918. }
  12919. const out = i => transition_out(each_blocks[i], 1, 1, () => {
  12920. each_blocks[i] = null;
  12921. });
  12922. return {
  12923. c() {
  12924. for (let i = 0; i < each_blocks.length; i += 1) {
  12925. each_blocks[i].c();
  12926. }
  12927. each_1_anchor = empty();
  12928. },
  12929. m(target, anchor) {
  12930. for (let i = 0; i < each_blocks.length; i += 1) {
  12931. each_blocks[i].m(target, anchor);
  12932. }
  12933. insert(target, each_1_anchor, anchor);
  12934. current = true;
  12935. },
  12936. p(ctx, dirty) {
  12937. if (dirty[0] & /*requestHeaders*/ 1) {
  12938. each_value_2 = /*requestHeaders*/ ctx[0];
  12939. let i;
  12940. for (i = 0; i < each_value_2.length; i += 1) {
  12941. const child_ctx = get_each_context_2$1(ctx, each_value_2, i);
  12942. if (each_blocks[i]) {
  12943. each_blocks[i].p(child_ctx, dirty);
  12944. transition_in(each_blocks[i], 1);
  12945. } else {
  12946. each_blocks[i] = create_each_block_2$1(child_ctx);
  12947. each_blocks[i].c();
  12948. transition_in(each_blocks[i], 1);
  12949. each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor);
  12950. }
  12951. }
  12952. group_outros();
  12953. for (i = each_value_2.length; i < each_blocks.length; i += 1) {
  12954. out(i);
  12955. }
  12956. check_outros();
  12957. }
  12958. },
  12959. i(local) {
  12960. if (current) return;
  12961. for (let i = 0; i < each_value_2.length; i += 1) {
  12962. transition_in(each_blocks[i]);
  12963. }
  12964. current = true;
  12965. },
  12966. o(local) {
  12967. each_blocks = each_blocks.filter(Boolean);
  12968. for (let i = 0; i < each_blocks.length; i += 1) {
  12969. transition_out(each_blocks[i]);
  12970. }
  12971. current = false;
  12972. },
  12973. d(detaching) {
  12974. destroy_each(each_blocks, detaching);
  12975. if (detaching) detach(each_1_anchor);
  12976. }
  12977. };
  12978. }
  12979. // (182:6) {#if requestHeaders.length === 0 && !environment.auth}
  12980. function create_if_block_9(ctx) {
  12981. let p;
  12982. return {
  12983. c() {
  12984. p = element("p");
  12985. p.innerHTML = `<em>No configurable headers.</em>`;
  12986. },
  12987. m(target, anchor) {
  12988. insert(target, p, anchor);
  12989. },
  12990. p: noop,
  12991. i: noop,
  12992. o: noop,
  12993. d(detaching) {
  12994. if (detaching) detach(p);
  12995. }
  12996. };
  12997. }
  12998. // (187:8) {#each requestHeaders as header}
  12999. function create_each_block_2$1(ctx) {
  13000. let updating_used;
  13001. let updating_value;
  13002. let current;
  13003. function fieldswitch_used_binding(value) {
  13004. /*fieldswitch_used_binding*/ ctx[23].call(null, value, /*header*/ ctx[36]);
  13005. }
  13006. function fieldswitch_value_binding(value_1) {
  13007. /*fieldswitch_value_binding*/ ctx[24].call(null, value_1, /*header*/ ctx[36]);
  13008. }
  13009. let fieldswitch_props = {
  13010. name: /*header*/ ctx[36].name,
  13011. required: /*header*/ ctx[36].required,
  13012. rounded: true
  13013. };
  13014. if (/*header*/ ctx[36].used !== void 0) {
  13015. fieldswitch_props.used = /*header*/ ctx[36].used;
  13016. }
  13017. if (/*header*/ ctx[36].value !== void 0) {
  13018. fieldswitch_props.value = /*header*/ ctx[36].value;
  13019. }
  13020. const fieldswitch = new FieldSwitch({ props: fieldswitch_props });
  13021. binding_callbacks.push(() => bind(fieldswitch, "used", fieldswitch_used_binding));
  13022. binding_callbacks.push(() => bind(fieldswitch, "value", fieldswitch_value_binding));
  13023. return {
  13024. c() {
  13025. create_component(fieldswitch.$$.fragment);
  13026. },
  13027. m(target, anchor) {
  13028. mount_component(fieldswitch, target, anchor);
  13029. current = true;
  13030. },
  13031. p(new_ctx, dirty) {
  13032. ctx = new_ctx;
  13033. const fieldswitch_changes = {};
  13034. if (dirty[0] & /*requestHeaders*/ 1) fieldswitch_changes.name = /*header*/ ctx[36].name;
  13035. if (dirty[0] & /*requestHeaders*/ 1) fieldswitch_changes.required = /*header*/ ctx[36].required;
  13036. if (!updating_used && dirty[0] & /*requestHeaders*/ 1) {
  13037. updating_used = true;
  13038. fieldswitch_changes.used = /*header*/ ctx[36].used;
  13039. add_flush_callback(() => updating_used = false);
  13040. }
  13041. if (!updating_value && dirty[0] & /*requestHeaders*/ 1) {
  13042. updating_value = true;
  13043. fieldswitch_changes.value = /*header*/ ctx[36].value;
  13044. add_flush_callback(() => updating_value = false);
  13045. }
  13046. fieldswitch.$set(fieldswitch_changes);
  13047. },
  13048. i(local) {
  13049. if (current) return;
  13050. transition_in(fieldswitch.$$.fragment, local);
  13051. current = true;
  13052. },
  13053. o(local) {
  13054. transition_out(fieldswitch.$$.fragment, local);
  13055. current = false;
  13056. },
  13057. d(detaching) {
  13058. destroy_component(fieldswitch, detaching);
  13059. }
  13060. };
  13061. }
  13062. // (197:6) {#if isAuth(environment, 'basic')}
  13063. function create_if_block_8(ctx) {
  13064. let current;
  13065. const fielddisabled = new FieldDisabled({
  13066. props: {
  13067. name: "authorization",
  13068. placeholder: "Authorization",
  13069. value: "Basic " + basicAuth(/*environment*/ ctx[10].auth.options.username, /*environment*/ ctx[10].auth.options.password)
  13070. }
  13071. });
  13072. return {
  13073. c() {
  13074. create_component(fielddisabled.$$.fragment);
  13075. },
  13076. m(target, anchor) {
  13077. mount_component(fielddisabled, target, anchor);
  13078. current = true;
  13079. },
  13080. p(ctx, dirty) {
  13081. const fielddisabled_changes = {};
  13082. if (dirty[0] & /*environment*/ 1024) fielddisabled_changes.value = "Basic " + basicAuth(/*environment*/ ctx[10].auth.options.username, /*environment*/ ctx[10].auth.options.password);
  13083. fielddisabled.$set(fielddisabled_changes);
  13084. },
  13085. i(local) {
  13086. if (current) return;
  13087. transition_in(fielddisabled.$$.fragment, local);
  13088. current = true;
  13089. },
  13090. o(local) {
  13091. transition_out(fielddisabled.$$.fragment, local);
  13092. current = false;
  13093. },
  13094. d(detaching) {
  13095. destroy_component(fielddisabled, detaching);
  13096. }
  13097. };
  13098. }
  13099. // (204:6) {#if isAuth(environment, 'apikey')}
  13100. function create_if_block_7(ctx) {
  13101. let current;
  13102. const fielddisabled = new FieldDisabled({
  13103. props: {
  13104. name: "authorization",
  13105. placeholder: /*environment*/ ctx[10].auth.options.header,
  13106. value: /*environment*/ ctx[10].auth.options.key
  13107. }
  13108. });
  13109. return {
  13110. c() {
  13111. create_component(fielddisabled.$$.fragment);
  13112. },
  13113. m(target, anchor) {
  13114. mount_component(fielddisabled, target, anchor);
  13115. current = true;
  13116. },
  13117. p(ctx, dirty) {
  13118. const fielddisabled_changes = {};
  13119. if (dirty[0] & /*environment*/ 1024) fielddisabled_changes.placeholder = /*environment*/ ctx[10].auth.options.header;
  13120. if (dirty[0] & /*environment*/ 1024) fielddisabled_changes.value = /*environment*/ ctx[10].auth.options.key;
  13121. fielddisabled.$set(fielddisabled_changes);
  13122. },
  13123. i(local) {
  13124. if (current) return;
  13125. transition_in(fielddisabled.$$.fragment, local);
  13126. current = true;
  13127. },
  13128. o(local) {
  13129. transition_out(fielddisabled.$$.fragment, local);
  13130. current = false;
  13131. },
  13132. d(detaching) {
  13133. destroy_component(fielddisabled, detaching);
  13134. }
  13135. };
  13136. }
  13137. // (211:6) {#if isAuth(environment, 'oauth2')}
  13138. function create_if_block_5(ctx) {
  13139. let show_if = /*$auth*/ ctx[13].includes(/*$env*/ ctx[11]);
  13140. let if_block_anchor;
  13141. let current;
  13142. let if_block = show_if && create_if_block_6(ctx);
  13143. return {
  13144. c() {
  13145. if (if_block) if_block.c();
  13146. if_block_anchor = empty();
  13147. },
  13148. m(target, anchor) {
  13149. if (if_block) if_block.m(target, anchor);
  13150. insert(target, if_block_anchor, anchor);
  13151. current = true;
  13152. },
  13153. p(ctx, dirty) {
  13154. if (dirty[0] & /*$auth, $env*/ 10240) show_if = /*$auth*/ ctx[13].includes(/*$env*/ ctx[11]);
  13155. if (show_if) {
  13156. if (if_block) {
  13157. if_block.p(ctx, dirty);
  13158. transition_in(if_block, 1);
  13159. } else {
  13160. if_block = create_if_block_6(ctx);
  13161. if_block.c();
  13162. transition_in(if_block, 1);
  13163. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  13164. }
  13165. } else if (if_block) {
  13166. group_outros();
  13167. transition_out(if_block, 1, 1, () => {
  13168. if_block = null;
  13169. });
  13170. check_outros();
  13171. }
  13172. },
  13173. i(local) {
  13174. if (current) return;
  13175. transition_in(if_block);
  13176. current = true;
  13177. },
  13178. o(local) {
  13179. transition_out(if_block);
  13180. current = false;
  13181. },
  13182. d(detaching) {
  13183. if (if_block) if_block.d(detaching);
  13184. if (detaching) detach(if_block_anchor);
  13185. }
  13186. };
  13187. }
  13188. // (212:8) {#if $auth.includes($env)}
  13189. function create_if_block_6(ctx) {
  13190. let current;
  13191. const fielddisabled = new FieldDisabled({
  13192. props: {
  13193. name: "authorization",
  13194. placeholder: "Authorization",
  13195. value: "Bearer " + /*$token*/ ctx[14]
  13196. }
  13197. });
  13198. return {
  13199. c() {
  13200. create_component(fielddisabled.$$.fragment);
  13201. },
  13202. m(target, anchor) {
  13203. mount_component(fielddisabled, target, anchor);
  13204. current = true;
  13205. },
  13206. p(ctx, dirty) {
  13207. const fielddisabled_changes = {};
  13208. if (dirty[0] & /*$token*/ 16384) fielddisabled_changes.value = "Bearer " + /*$token*/ ctx[14];
  13209. fielddisabled.$set(fielddisabled_changes);
  13210. },
  13211. i(local) {
  13212. if (current) return;
  13213. transition_in(fielddisabled.$$.fragment, local);
  13214. current = true;
  13215. },
  13216. o(local) {
  13217. transition_out(fielddisabled.$$.fragment, local);
  13218. current = false;
  13219. },
  13220. d(detaching) {
  13221. destroy_component(fielddisabled, detaching);
  13222. }
  13223. };
  13224. }
  13225. // (226:6) {:else}
  13226. function create_else_block_1$1(ctx) {
  13227. let each_1_anchor;
  13228. let current;
  13229. let each_value_1 = /*requestParameters*/ ctx[1];
  13230. let each_blocks = [];
  13231. for (let i = 0; i < each_value_1.length; i += 1) {
  13232. each_blocks[i] = create_each_block_1$1(get_each_context_1$1(ctx, each_value_1, i));
  13233. }
  13234. const out = i => transition_out(each_blocks[i], 1, 1, () => {
  13235. each_blocks[i] = null;
  13236. });
  13237. return {
  13238. c() {
  13239. for (let i = 0; i < each_blocks.length; i += 1) {
  13240. each_blocks[i].c();
  13241. }
  13242. each_1_anchor = empty();
  13243. },
  13244. m(target, anchor) {
  13245. for (let i = 0; i < each_blocks.length; i += 1) {
  13246. each_blocks[i].m(target, anchor);
  13247. }
  13248. insert(target, each_1_anchor, anchor);
  13249. current = true;
  13250. },
  13251. p(ctx, dirty) {
  13252. if (dirty[0] & /*requestParameters*/ 2) {
  13253. each_value_1 = /*requestParameters*/ ctx[1];
  13254. let i;
  13255. for (i = 0; i < each_value_1.length; i += 1) {
  13256. const child_ctx = get_each_context_1$1(ctx, each_value_1, i);
  13257. if (each_blocks[i]) {
  13258. each_blocks[i].p(child_ctx, dirty);
  13259. transition_in(each_blocks[i], 1);
  13260. } else {
  13261. each_blocks[i] = create_each_block_1$1(child_ctx);
  13262. each_blocks[i].c();
  13263. transition_in(each_blocks[i], 1);
  13264. each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor);
  13265. }
  13266. }
  13267. group_outros();
  13268. for (i = each_value_1.length; i < each_blocks.length; i += 1) {
  13269. out(i);
  13270. }
  13271. check_outros();
  13272. }
  13273. },
  13274. i(local) {
  13275. if (current) return;
  13276. for (let i = 0; i < each_value_1.length; i += 1) {
  13277. transition_in(each_blocks[i]);
  13278. }
  13279. current = true;
  13280. },
  13281. o(local) {
  13282. each_blocks = each_blocks.filter(Boolean);
  13283. for (let i = 0; i < each_blocks.length; i += 1) {
  13284. transition_out(each_blocks[i]);
  13285. }
  13286. current = false;
  13287. },
  13288. d(detaching) {
  13289. destroy_each(each_blocks, detaching);
  13290. if (detaching) detach(each_1_anchor);
  13291. }
  13292. };
  13293. }
  13294. // (222:6) {#if requestParameters.length === 0}
  13295. function create_if_block_4(ctx) {
  13296. let p;
  13297. return {
  13298. c() {
  13299. p = element("p");
  13300. p.innerHTML = `<em>No configurable parameters.</em>`;
  13301. },
  13302. m(target, anchor) {
  13303. insert(target, p, anchor);
  13304. },
  13305. p: noop,
  13306. i: noop,
  13307. o: noop,
  13308. d(detaching) {
  13309. if (detaching) detach(p);
  13310. }
  13311. };
  13312. }
  13313. // (227:8) {#each requestParameters as param}
  13314. function create_each_block_1$1(ctx) {
  13315. let updating_used;
  13316. let updating_value;
  13317. let current;
  13318. function fieldswitch_used_binding_1(value) {
  13319. /*fieldswitch_used_binding_1*/ ctx[25].call(null, value, /*param*/ ctx[33]);
  13320. }
  13321. function fieldswitch_value_binding_1(value_1) {
  13322. /*fieldswitch_value_binding_1*/ ctx[26].call(null, value_1, /*param*/ ctx[33]);
  13323. }
  13324. let fieldswitch_props = {
  13325. name: /*param*/ ctx[33].name,
  13326. required: /*param*/ ctx[33].required
  13327. };
  13328. if (/*param*/ ctx[33].used !== void 0) {
  13329. fieldswitch_props.used = /*param*/ ctx[33].used;
  13330. }
  13331. if (/*param*/ ctx[33].value !== void 0) {
  13332. fieldswitch_props.value = /*param*/ ctx[33].value;
  13333. }
  13334. const fieldswitch = new FieldSwitch({ props: fieldswitch_props });
  13335. binding_callbacks.push(() => bind(fieldswitch, "used", fieldswitch_used_binding_1));
  13336. binding_callbacks.push(() => bind(fieldswitch, "value", fieldswitch_value_binding_1));
  13337. return {
  13338. c() {
  13339. create_component(fieldswitch.$$.fragment);
  13340. },
  13341. m(target, anchor) {
  13342. mount_component(fieldswitch, target, anchor);
  13343. current = true;
  13344. },
  13345. p(new_ctx, dirty) {
  13346. ctx = new_ctx;
  13347. const fieldswitch_changes = {};
  13348. if (dirty[0] & /*requestParameters*/ 2) fieldswitch_changes.name = /*param*/ ctx[33].name;
  13349. if (dirty[0] & /*requestParameters*/ 2) fieldswitch_changes.required = /*param*/ ctx[33].required;
  13350. if (!updating_used && dirty[0] & /*requestParameters*/ 2) {
  13351. updating_used = true;
  13352. fieldswitch_changes.used = /*param*/ ctx[33].used;
  13353. add_flush_callback(() => updating_used = false);
  13354. }
  13355. if (!updating_value && dirty[0] & /*requestParameters*/ 2) {
  13356. updating_value = true;
  13357. fieldswitch_changes.value = /*param*/ ctx[33].value;
  13358. add_flush_callback(() => updating_value = false);
  13359. }
  13360. fieldswitch.$set(fieldswitch_changes);
  13361. },
  13362. i(local) {
  13363. if (current) return;
  13364. transition_in(fieldswitch.$$.fragment, local);
  13365. current = true;
  13366. },
  13367. o(local) {
  13368. transition_out(fieldswitch.$$.fragment, local);
  13369. current = false;
  13370. },
  13371. d(detaching) {
  13372. destroy_component(fieldswitch, detaching);
  13373. }
  13374. };
  13375. }
  13376. // (243:6) {:else}
  13377. function create_else_block$3(ctx) {
  13378. let p;
  13379. return {
  13380. c() {
  13381. p = element("p");
  13382. p.innerHTML = `<i>Body is only available for POST, PUT and PATCH.</i>`;
  13383. },
  13384. m(target, anchor) {
  13385. insert(target, p, anchor);
  13386. },
  13387. p: noop,
  13388. d(detaching) {
  13389. if (detaching) detach(p);
  13390. }
  13391. };
  13392. }
  13393. // (238:6) {#if allowBody(currentAction)}
  13394. function create_if_block_3$2(ctx) {
  13395. let textarea;
  13396. let dispose;
  13397. return {
  13398. c() {
  13399. textarea = element("textarea");
  13400. attr(textarea, "class", "textarea is-family-code");
  13401. attr(textarea, "rows", "8");
  13402. dispose = listen(textarea, "input", /*textarea_input_handler*/ ctx[27]);
  13403. },
  13404. m(target, anchor) {
  13405. insert(target, textarea, anchor);
  13406. set_input_value(textarea, /*requestBody*/ ctx[2]);
  13407. },
  13408. p(ctx, dirty) {
  13409. if (dirty[0] & /*requestBody*/ 4) {
  13410. set_input_value(textarea, /*requestBody*/ ctx[2]);
  13411. }
  13412. },
  13413. d(detaching) {
  13414. if (detaching) detach(textarea);
  13415. dispose();
  13416. }
  13417. };
  13418. }
  13419. // (283:4) {:catch}
  13420. function create_catch_block(ctx) {
  13421. let div;
  13422. return {
  13423. c() {
  13424. div = element("div");
  13425. div.textContent = " ";
  13426. },
  13427. m(target, anchor) {
  13428. insert(target, div, anchor);
  13429. },
  13430. p: noop,
  13431. i: noop,
  13432. o: noop,
  13433. d(detaching) {
  13434. if (detaching) detach(div);
  13435. }
  13436. };
  13437. }
  13438. // (256:4) {:then value}
  13439. function create_then_block(ctx) {
  13440. let show_if = Object.keys(/*value*/ ctx[28]).length > 0;
  13441. let if_block_anchor;
  13442. let current;
  13443. let if_block = show_if && create_if_block_1$7(ctx);
  13444. return {
  13445. c() {
  13446. if (if_block) if_block.c();
  13447. if_block_anchor = empty();
  13448. },
  13449. m(target, anchor) {
  13450. if (if_block) if_block.m(target, anchor);
  13451. insert(target, if_block_anchor, anchor);
  13452. current = true;
  13453. },
  13454. p(ctx, dirty) {
  13455. if (dirty[0] & /*response*/ 64) show_if = Object.keys(/*value*/ ctx[28]).length > 0;
  13456. if (show_if) {
  13457. if (if_block) {
  13458. if_block.p(ctx, dirty);
  13459. transition_in(if_block, 1);
  13460. } else {
  13461. if_block = create_if_block_1$7(ctx);
  13462. if_block.c();
  13463. transition_in(if_block, 1);
  13464. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  13465. }
  13466. } else if (if_block) {
  13467. group_outros();
  13468. transition_out(if_block, 1, 1, () => {
  13469. if_block = null;
  13470. });
  13471. check_outros();
  13472. }
  13473. },
  13474. i(local) {
  13475. if (current) return;
  13476. transition_in(if_block);
  13477. current = true;
  13478. },
  13479. o(local) {
  13480. transition_out(if_block);
  13481. current = false;
  13482. },
  13483. d(detaching) {
  13484. if (if_block) if_block.d(detaching);
  13485. if (detaching) detach(if_block_anchor);
  13486. }
  13487. };
  13488. }
  13489. // (257:6) {#if Object.keys(value).length > 0}
  13490. function create_if_block_1$7(ctx) {
  13491. let div1;
  13492. let section1;
  13493. let section0;
  13494. let div0;
  13495. let h1;
  13496. let t0_value = /*value*/ ctx[28].status + "";
  13497. let t0;
  13498. let t1;
  13499. let t2_value = /*value*/ ctx[28].statusText + "";
  13500. let t2;
  13501. let section1_class_value;
  13502. let t3;
  13503. let show_if = Object.keys(/*value*/ ctx[28].headers).length > 0;
  13504. let current;
  13505. let if_block = show_if && create_if_block_2$4(ctx);
  13506. return {
  13507. c() {
  13508. div1 = element("div");
  13509. section1 = element("section");
  13510. section0 = element("section");
  13511. div0 = element("div");
  13512. h1 = element("h1");
  13513. t0 = text(t0_value);
  13514. t1 = space();
  13515. t2 = text(t2_value);
  13516. t3 = space();
  13517. if (if_block) if_block.c();
  13518. attr(h1, "class", "title");
  13519. attr(div0, "class", "container has-text-centered");
  13520. attr(section0, "class", "hero-body hero-small svelte-c3oocm");
  13521. attr(section1, "class", section1_class_value = "hero hero-rounded " + colorize(/*value*/ ctx[28].status) + " svelte-c3oocm");
  13522. attr(div1, "class", "small-section svelte-c3oocm");
  13523. },
  13524. m(target, anchor) {
  13525. insert(target, div1, anchor);
  13526. append(div1, section1);
  13527. append(section1, section0);
  13528. append(section0, div0);
  13529. append(div0, h1);
  13530. append(h1, t0);
  13531. append(h1, t1);
  13532. append(h1, t2);
  13533. append(div1, t3);
  13534. if (if_block) if_block.m(div1, null);
  13535. current = true;
  13536. },
  13537. p(ctx, dirty) {
  13538. if ((!current || dirty[0] & /*response*/ 64) && t0_value !== (t0_value = /*value*/ ctx[28].status + "")) set_data(t0, t0_value);
  13539. if ((!current || dirty[0] & /*response*/ 64) && t2_value !== (t2_value = /*value*/ ctx[28].statusText + "")) set_data(t2, t2_value);
  13540. if (!current || dirty[0] & /*response*/ 64 && section1_class_value !== (section1_class_value = "hero hero-rounded " + colorize(/*value*/ ctx[28].status) + " svelte-c3oocm")) {
  13541. attr(section1, "class", section1_class_value);
  13542. }
  13543. if (dirty[0] & /*response*/ 64) show_if = Object.keys(/*value*/ ctx[28].headers).length > 0;
  13544. if (show_if) {
  13545. if (if_block) {
  13546. if_block.p(ctx, dirty);
  13547. transition_in(if_block, 1);
  13548. } else {
  13549. if_block = create_if_block_2$4(ctx);
  13550. if_block.c();
  13551. transition_in(if_block, 1);
  13552. if_block.m(div1, null);
  13553. }
  13554. } else if (if_block) {
  13555. group_outros();
  13556. transition_out(if_block, 1, 1, () => {
  13557. if_block = null;
  13558. });
  13559. check_outros();
  13560. }
  13561. },
  13562. i(local) {
  13563. if (current) return;
  13564. transition_in(if_block);
  13565. current = true;
  13566. },
  13567. o(local) {
  13568. transition_out(if_block);
  13569. current = false;
  13570. },
  13571. d(detaching) {
  13572. if (detaching) detach(div1);
  13573. if (if_block) if_block.d();
  13574. }
  13575. };
  13576. }
  13577. // (267:10) {#if Object.keys(value.headers).length > 0}
  13578. function create_if_block_2$4(ctx) {
  13579. let div1;
  13580. let div0;
  13581. let t;
  13582. let current;
  13583. let each_value = Object.entries(/*value*/ ctx[28].headers);
  13584. let each_blocks = [];
  13585. for (let i = 0; i < each_value.length; i += 1) {
  13586. each_blocks[i] = create_each_block$5(get_each_context$5(ctx, each_value, i));
  13587. }
  13588. const codeblock = new CodeBlock({
  13589. props: {
  13590. type: contentType(/*value*/ ctx[28].headers),
  13591. body: /*value*/ ctx[28].data
  13592. }
  13593. });
  13594. return {
  13595. c() {
  13596. div1 = element("div");
  13597. div0 = element("div");
  13598. for (let i = 0; i < each_blocks.length; i += 1) {
  13599. each_blocks[i].c();
  13600. }
  13601. t = space();
  13602. create_component(codeblock.$$.fragment);
  13603. attr(div0, "class", "content-header svelte-c3oocm");
  13604. attr(div1, "class", "container container-content svelte-c3oocm");
  13605. },
  13606. m(target, anchor) {
  13607. insert(target, div1, anchor);
  13608. append(div1, div0);
  13609. for (let i = 0; i < each_blocks.length; i += 1) {
  13610. each_blocks[i].m(div0, null);
  13611. }
  13612. append(div1, t);
  13613. mount_component(codeblock, div1, null);
  13614. current = true;
  13615. },
  13616. p(ctx, dirty) {
  13617. if (dirty[0] & /*response*/ 64) {
  13618. each_value = Object.entries(/*value*/ ctx[28].headers);
  13619. let i;
  13620. for (i = 0; i < each_value.length; i += 1) {
  13621. const child_ctx = get_each_context$5(ctx, each_value, i);
  13622. if (each_blocks[i]) {
  13623. each_blocks[i].p(child_ctx, dirty);
  13624. } else {
  13625. each_blocks[i] = create_each_block$5(child_ctx);
  13626. each_blocks[i].c();
  13627. each_blocks[i].m(div0, null);
  13628. }
  13629. }
  13630. for (; i < each_blocks.length; i += 1) {
  13631. each_blocks[i].d(1);
  13632. }
  13633. each_blocks.length = each_value.length;
  13634. }
  13635. const codeblock_changes = {};
  13636. if (dirty[0] & /*response*/ 64) codeblock_changes.type = contentType(/*value*/ ctx[28].headers);
  13637. if (dirty[0] & /*response*/ 64) codeblock_changes.body = /*value*/ ctx[28].data;
  13638. codeblock.$set(codeblock_changes);
  13639. },
  13640. i(local) {
  13641. if (current) return;
  13642. transition_in(codeblock.$$.fragment, local);
  13643. current = true;
  13644. },
  13645. o(local) {
  13646. transition_out(codeblock.$$.fragment, local);
  13647. current = false;
  13648. },
  13649. d(detaching) {
  13650. if (detaching) detach(div1);
  13651. destroy_each(each_blocks, detaching);
  13652. destroy_component(codeblock);
  13653. }
  13654. };
  13655. }
  13656. // (270:16) {#each Object.entries(value.headers) as [key, val]}
  13657. function create_each_block$5(ctx) {
  13658. let p;
  13659. let span;
  13660. let t0_value = /*key*/ ctx[29] + "";
  13661. let t0;
  13662. let t1;
  13663. let t2_value = /*val*/ ctx[30] + "";
  13664. let t2;
  13665. let t3;
  13666. return {
  13667. c() {
  13668. p = element("p");
  13669. span = element("span");
  13670. t0 = text(t0_value);
  13671. t1 = text("\n : ");
  13672. t2 = text(t2_value);
  13673. t3 = space();
  13674. attr(span, "class", "is-capitalized");
  13675. attr(p, "class", "is-family-code");
  13676. },
  13677. m(target, anchor) {
  13678. insert(target, p, anchor);
  13679. append(p, span);
  13680. append(span, t0);
  13681. append(p, t1);
  13682. append(p, t2);
  13683. append(p, t3);
  13684. },
  13685. p(ctx, dirty) {
  13686. if (dirty[0] & /*response*/ 64 && t0_value !== (t0_value = /*key*/ ctx[29] + "")) set_data(t0, t0_value);
  13687. if (dirty[0] & /*response*/ 64 && t2_value !== (t2_value = /*val*/ ctx[30] + "")) set_data(t2, t2_value);
  13688. },
  13689. d(detaching) {
  13690. if (detaching) detach(p);
  13691. }
  13692. };
  13693. }
  13694. // (250:21) <div class="section has-text-centered"> <span class="icon is-medium has-text-danger"> <i class="fas fa-2x fa-spinner fa-pulse" /> </span> </div> {:then value}
  13695. function create_pending_block(ctx) {
  13696. let div;
  13697. return {
  13698. c() {
  13699. div = element("div");
  13700. div.innerHTML = `<span class="icon is-medium has-text-danger"><i class="fas fa-2x fa-spinner fa-pulse"></i></span>`;
  13701. attr(div, "class", "section has-text-centered");
  13702. },
  13703. m(target, anchor) {
  13704. insert(target, div, anchor);
  13705. },
  13706. p: noop,
  13707. i: noop,
  13708. o: noop,
  13709. d(detaching) {
  13710. if (detaching) detach(div);
  13711. }
  13712. };
  13713. }
  13714. // (287:4) {#if error}
  13715. function create_if_block$a(ctx) {
  13716. let div1;
  13717. let section1;
  13718. let section0;
  13719. let div0;
  13720. let p;
  13721. let t;
  13722. return {
  13723. c() {
  13724. div1 = element("div");
  13725. section1 = element("section");
  13726. section0 = element("section");
  13727. div0 = element("div");
  13728. p = element("p");
  13729. t = text(/*error*/ ctx[8]);
  13730. attr(p, "class", "subtitle");
  13731. attr(div0, "class", "container");
  13732. attr(section0, "class", "hero-body");
  13733. attr(section1, "class", "hero is-danger");
  13734. attr(div1, "class", "small-section svelte-c3oocm");
  13735. },
  13736. m(target, anchor) {
  13737. insert(target, div1, anchor);
  13738. append(div1, section1);
  13739. append(section1, section0);
  13740. append(section0, div0);
  13741. append(div0, p);
  13742. append(p, t);
  13743. },
  13744. p(ctx, dirty) {
  13745. if (dirty[0] & /*error*/ 256) set_data(t, /*error*/ ctx[8]);
  13746. },
  13747. d(detaching) {
  13748. if (detaching) detach(div1);
  13749. }
  13750. };
  13751. }
  13752. // (127:2) <div slot="body">
  13753. function create_body_slot(ctx) {
  13754. let div0;
  13755. let div3;
  13756. let div1;
  13757. let t0;
  13758. let div2;
  13759. let show_if_4;
  13760. let current_block_type_index;
  13761. let if_block1;
  13762. let t1;
  13763. let div4;
  13764. let ul;
  13765. let li0;
  13766. let a0;
  13767. let t3;
  13768. let li1;
  13769. let a1;
  13770. let t5;
  13771. let li2;
  13772. let a2;
  13773. let t7;
  13774. let div5;
  13775. let current_block_type_index_1;
  13776. let if_block2;
  13777. let t8;
  13778. let show_if_3 = isAuth(/*environment*/ ctx[10], "basic");
  13779. let t9;
  13780. let show_if_2 = isAuth(/*environment*/ ctx[10], "apikey");
  13781. let t10;
  13782. let show_if_1 = isAuth(/*environment*/ ctx[10], "oauth2");
  13783. let t11;
  13784. let div6;
  13785. let current_block_type_index_2;
  13786. let if_block6;
  13787. let t12;
  13788. let div7;
  13789. let show_if;
  13790. let t13;
  13791. let promise;
  13792. let t14;
  13793. let current;
  13794. let dispose;
  13795. function select_block_type(ctx, dirty) {
  13796. if (/*copying*/ ctx[9]) return create_if_block_11;
  13797. return create_else_block_4;
  13798. }
  13799. let current_block_type = select_block_type(ctx, -1);
  13800. let if_block0 = current_block_type(ctx);
  13801. const if_block_creators = [create_if_block_10, create_else_block_3];
  13802. const if_blocks = [];
  13803. function select_block_type_1(ctx, dirty) {
  13804. if (dirty[0] & /*environment, $auth, $env*/ 11264) show_if_4 = !!(isAuth(/*environment*/ ctx[10], "oauth2") && !/*$auth*/ ctx[13].includes(/*$env*/ ctx[11]));
  13805. if (show_if_4) return 0;
  13806. return 1;
  13807. }
  13808. current_block_type_index = select_block_type_1(ctx, -1);
  13809. if_block1 = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
  13810. const if_block_creators_1 = [create_if_block_9, create_else_block_2];
  13811. const if_blocks_1 = [];
  13812. function select_block_type_2(ctx, dirty) {
  13813. if (/*requestHeaders*/ ctx[0].length === 0 && !/*environment*/ ctx[10].auth) return 0;
  13814. return 1;
  13815. }
  13816. current_block_type_index_1 = select_block_type_2(ctx, -1);
  13817. if_block2 = if_blocks_1[current_block_type_index_1] = if_block_creators_1[current_block_type_index_1](ctx);
  13818. let if_block3 = show_if_3 && create_if_block_8(ctx);
  13819. let if_block4 = show_if_2 && create_if_block_7(ctx);
  13820. let if_block5 = show_if_1 && create_if_block_5(ctx);
  13821. const if_block_creators_2 = [create_if_block_4, create_else_block_1$1];
  13822. const if_blocks_2 = [];
  13823. function select_block_type_3(ctx, dirty) {
  13824. if (/*requestParameters*/ ctx[1].length === 0) return 0;
  13825. return 1;
  13826. }
  13827. current_block_type_index_2 = select_block_type_3(ctx, -1);
  13828. if_block6 = if_blocks_2[current_block_type_index_2] = if_block_creators_2[current_block_type_index_2](ctx);
  13829. function select_block_type_4(ctx, dirty) {
  13830. if (show_if == null || dirty[0] & /*currentAction*/ 32) show_if = !!allowBody(/*currentAction*/ ctx[5]);
  13831. if (show_if) return create_if_block_3$2;
  13832. return create_else_block$3;
  13833. }
  13834. let current_block_type_1 = select_block_type_4(ctx, -1);
  13835. let if_block7 = current_block_type_1(ctx);
  13836. let info = {
  13837. ctx,
  13838. current: null,
  13839. token: null,
  13840. pending: create_pending_block,
  13841. then: create_then_block,
  13842. catch: create_catch_block,
  13843. value: 28,
  13844. blocks: [,,,]
  13845. };
  13846. handle_promise(promise = /*response*/ ctx[6], info);
  13847. let if_block8 = /*error*/ ctx[8] && create_if_block$a(ctx);
  13848. return {
  13849. c() {
  13850. div0 = element("div");
  13851. div3 = element("div");
  13852. div1 = element("div");
  13853. if_block0.c();
  13854. t0 = space();
  13855. div2 = element("div");
  13856. if_block1.c();
  13857. t1 = space();
  13858. div4 = element("div");
  13859. ul = element("ul");
  13860. li0 = element("li");
  13861. a0 = element("a");
  13862. a0.textContent = "Headers";
  13863. t3 = space();
  13864. li1 = element("li");
  13865. a1 = element("a");
  13866. a1.textContent = "Parameters";
  13867. t5 = space();
  13868. li2 = element("li");
  13869. a2 = element("a");
  13870. a2.textContent = "Body";
  13871. t7 = space();
  13872. div5 = element("div");
  13873. if_block2.c();
  13874. t8 = space();
  13875. if (if_block3) if_block3.c();
  13876. t9 = space();
  13877. if (if_block4) if_block4.c();
  13878. t10 = space();
  13879. if (if_block5) if_block5.c();
  13880. t11 = space();
  13881. div6 = element("div");
  13882. if_block6.c();
  13883. t12 = space();
  13884. div7 = element("div");
  13885. if_block7.c();
  13886. t13 = space();
  13887. info.block.c();
  13888. t14 = space();
  13889. if (if_block8) if_block8.c();
  13890. attr(div1, "class", "column");
  13891. attr(div2, "class", "column is-one-fifth");
  13892. attr(div3, "class", "columns");
  13893. attr(a0, "href", "javascript:void(0)");
  13894. toggle_class(li0, "is-active", /*requestTab*/ ctx[7] === 0);
  13895. attr(a1, "href", "javascript:void(0)");
  13896. toggle_class(li1, "is-active", /*requestTab*/ ctx[7] === 1);
  13897. attr(a2, "href", "javascript:void(0)");
  13898. toggle_class(li2, "is-active", /*requestTab*/ ctx[7] === 2);
  13899. attr(div4, "class", "tabs is-boxed");
  13900. attr(div5, "class", "section-headers");
  13901. toggle_class(div5, "is-hidden", /*requestTab*/ ctx[7] != 0);
  13902. attr(div6, "class", "section-parameters");
  13903. toggle_class(div6, "is-hidden", /*requestTab*/ ctx[7] != 1);
  13904. attr(div7, "class", "section-body");
  13905. toggle_class(div7, "is-hidden", /*requestTab*/ ctx[7] != 2);
  13906. attr(div0, "slot", "body");
  13907. dispose = [
  13908. listen(a0, "click", /*click_handler*/ ctx[20]),
  13909. listen(a1, "click", /*click_handler_1*/ ctx[21]),
  13910. listen(a2, "click", /*click_handler_2*/ ctx[22])
  13911. ];
  13912. },
  13913. m(target, anchor) {
  13914. insert(target, div0, anchor);
  13915. append(div0, div3);
  13916. append(div3, div1);
  13917. if_block0.m(div1, null);
  13918. append(div3, t0);
  13919. append(div3, div2);
  13920. if_blocks[current_block_type_index].m(div2, null);
  13921. append(div0, t1);
  13922. append(div0, div4);
  13923. append(div4, ul);
  13924. append(ul, li0);
  13925. append(li0, a0);
  13926. append(ul, t3);
  13927. append(ul, li1);
  13928. append(li1, a1);
  13929. append(ul, t5);
  13930. append(ul, li2);
  13931. append(li2, a2);
  13932. append(div0, t7);
  13933. append(div0, div5);
  13934. if_blocks_1[current_block_type_index_1].m(div5, null);
  13935. append(div5, t8);
  13936. if (if_block3) if_block3.m(div5, null);
  13937. append(div5, t9);
  13938. if (if_block4) if_block4.m(div5, null);
  13939. append(div5, t10);
  13940. if (if_block5) if_block5.m(div5, null);
  13941. append(div0, t11);
  13942. append(div0, div6);
  13943. if_blocks_2[current_block_type_index_2].m(div6, null);
  13944. append(div0, t12);
  13945. append(div0, div7);
  13946. if_block7.m(div7, null);
  13947. append(div0, t13);
  13948. info.block.m(div0, info.anchor = null);
  13949. info.mount = () => div0;
  13950. info.anchor = t14;
  13951. append(div0, t14);
  13952. if (if_block8) if_block8.m(div0, null);
  13953. current = true;
  13954. },
  13955. p(new_ctx, dirty) {
  13956. ctx = new_ctx;
  13957. if (current_block_type === (current_block_type = select_block_type(ctx, dirty)) && if_block0) {
  13958. if_block0.p(ctx, dirty);
  13959. } else {
  13960. if_block0.d(1);
  13961. if_block0 = current_block_type(ctx);
  13962. if (if_block0) {
  13963. if_block0.c();
  13964. if_block0.m(div1, null);
  13965. }
  13966. }
  13967. let previous_block_index = current_block_type_index;
  13968. current_block_type_index = select_block_type_1(ctx, dirty);
  13969. if (current_block_type_index === previous_block_index) {
  13970. if_blocks[current_block_type_index].p(ctx, dirty);
  13971. } else {
  13972. group_outros();
  13973. transition_out(if_blocks[previous_block_index], 1, 1, () => {
  13974. if_blocks[previous_block_index] = null;
  13975. });
  13976. check_outros();
  13977. if_block1 = if_blocks[current_block_type_index];
  13978. if (!if_block1) {
  13979. if_block1 = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
  13980. if_block1.c();
  13981. }
  13982. transition_in(if_block1, 1);
  13983. if_block1.m(div2, null);
  13984. }
  13985. if (dirty[0] & /*requestTab*/ 128) {
  13986. toggle_class(li0, "is-active", /*requestTab*/ ctx[7] === 0);
  13987. }
  13988. if (dirty[0] & /*requestTab*/ 128) {
  13989. toggle_class(li1, "is-active", /*requestTab*/ ctx[7] === 1);
  13990. }
  13991. if (dirty[0] & /*requestTab*/ 128) {
  13992. toggle_class(li2, "is-active", /*requestTab*/ ctx[7] === 2);
  13993. }
  13994. let previous_block_index_1 = current_block_type_index_1;
  13995. current_block_type_index_1 = select_block_type_2(ctx, dirty);
  13996. if (current_block_type_index_1 === previous_block_index_1) {
  13997. if_blocks_1[current_block_type_index_1].p(ctx, dirty);
  13998. } else {
  13999. group_outros();
  14000. transition_out(if_blocks_1[previous_block_index_1], 1, 1, () => {
  14001. if_blocks_1[previous_block_index_1] = null;
  14002. });
  14003. check_outros();
  14004. if_block2 = if_blocks_1[current_block_type_index_1];
  14005. if (!if_block2) {
  14006. if_block2 = if_blocks_1[current_block_type_index_1] = if_block_creators_1[current_block_type_index_1](ctx);
  14007. if_block2.c();
  14008. }
  14009. transition_in(if_block2, 1);
  14010. if_block2.m(div5, t8);
  14011. }
  14012. if (dirty[0] & /*environment*/ 1024) show_if_3 = isAuth(/*environment*/ ctx[10], "basic");
  14013. if (show_if_3) {
  14014. if (if_block3) {
  14015. if_block3.p(ctx, dirty);
  14016. transition_in(if_block3, 1);
  14017. } else {
  14018. if_block3 = create_if_block_8(ctx);
  14019. if_block3.c();
  14020. transition_in(if_block3, 1);
  14021. if_block3.m(div5, t9);
  14022. }
  14023. } else if (if_block3) {
  14024. group_outros();
  14025. transition_out(if_block3, 1, 1, () => {
  14026. if_block3 = null;
  14027. });
  14028. check_outros();
  14029. }
  14030. if (dirty[0] & /*environment*/ 1024) show_if_2 = isAuth(/*environment*/ ctx[10], "apikey");
  14031. if (show_if_2) {
  14032. if (if_block4) {
  14033. if_block4.p(ctx, dirty);
  14034. transition_in(if_block4, 1);
  14035. } else {
  14036. if_block4 = create_if_block_7(ctx);
  14037. if_block4.c();
  14038. transition_in(if_block4, 1);
  14039. if_block4.m(div5, t10);
  14040. }
  14041. } else if (if_block4) {
  14042. group_outros();
  14043. transition_out(if_block4, 1, 1, () => {
  14044. if_block4 = null;
  14045. });
  14046. check_outros();
  14047. }
  14048. if (dirty[0] & /*environment*/ 1024) show_if_1 = isAuth(/*environment*/ ctx[10], "oauth2");
  14049. if (show_if_1) {
  14050. if (if_block5) {
  14051. if_block5.p(ctx, dirty);
  14052. transition_in(if_block5, 1);
  14053. } else {
  14054. if_block5 = create_if_block_5(ctx);
  14055. if_block5.c();
  14056. transition_in(if_block5, 1);
  14057. if_block5.m(div5, null);
  14058. }
  14059. } else if (if_block5) {
  14060. group_outros();
  14061. transition_out(if_block5, 1, 1, () => {
  14062. if_block5 = null;
  14063. });
  14064. check_outros();
  14065. }
  14066. if (dirty[0] & /*requestTab*/ 128) {
  14067. toggle_class(div5, "is-hidden", /*requestTab*/ ctx[7] != 0);
  14068. }
  14069. let previous_block_index_2 = current_block_type_index_2;
  14070. current_block_type_index_2 = select_block_type_3(ctx, dirty);
  14071. if (current_block_type_index_2 === previous_block_index_2) {
  14072. if_blocks_2[current_block_type_index_2].p(ctx, dirty);
  14073. } else {
  14074. group_outros();
  14075. transition_out(if_blocks_2[previous_block_index_2], 1, 1, () => {
  14076. if_blocks_2[previous_block_index_2] = null;
  14077. });
  14078. check_outros();
  14079. if_block6 = if_blocks_2[current_block_type_index_2];
  14080. if (!if_block6) {
  14081. if_block6 = if_blocks_2[current_block_type_index_2] = if_block_creators_2[current_block_type_index_2](ctx);
  14082. if_block6.c();
  14083. }
  14084. transition_in(if_block6, 1);
  14085. if_block6.m(div6, null);
  14086. }
  14087. if (dirty[0] & /*requestTab*/ 128) {
  14088. toggle_class(div6, "is-hidden", /*requestTab*/ ctx[7] != 1);
  14089. }
  14090. if (current_block_type_1 === (current_block_type_1 = select_block_type_4(ctx, dirty)) && if_block7) {
  14091. if_block7.p(ctx, dirty);
  14092. } else {
  14093. if_block7.d(1);
  14094. if_block7 = current_block_type_1(ctx);
  14095. if (if_block7) {
  14096. if_block7.c();
  14097. if_block7.m(div7, null);
  14098. }
  14099. }
  14100. if (dirty[0] & /*requestTab*/ 128) {
  14101. toggle_class(div7, "is-hidden", /*requestTab*/ ctx[7] != 2);
  14102. }
  14103. info.ctx = ctx;
  14104. if (dirty[0] & /*response*/ 64 && promise !== (promise = /*response*/ ctx[6]) && handle_promise(promise, info)) {
  14105. } else {
  14106. const child_ctx = ctx.slice();
  14107. child_ctx[28] = info.resolved;
  14108. info.block.p(child_ctx, dirty);
  14109. }
  14110. if (/*error*/ ctx[8]) {
  14111. if (if_block8) {
  14112. if_block8.p(ctx, dirty);
  14113. } else {
  14114. if_block8 = create_if_block$a(ctx);
  14115. if_block8.c();
  14116. if_block8.m(div0, null);
  14117. }
  14118. } else if (if_block8) {
  14119. if_block8.d(1);
  14120. if_block8 = null;
  14121. }
  14122. },
  14123. i(local) {
  14124. if (current) return;
  14125. transition_in(if_block1);
  14126. transition_in(if_block2);
  14127. transition_in(if_block3);
  14128. transition_in(if_block4);
  14129. transition_in(if_block5);
  14130. transition_in(if_block6);
  14131. transition_in(info.block);
  14132. current = true;
  14133. },
  14134. o(local) {
  14135. transition_out(if_block1);
  14136. transition_out(if_block2);
  14137. transition_out(if_block3);
  14138. transition_out(if_block4);
  14139. transition_out(if_block5);
  14140. transition_out(if_block6);
  14141. for (let i = 0; i < 3; i += 1) {
  14142. const block = info.blocks[i];
  14143. transition_out(block);
  14144. }
  14145. current = false;
  14146. },
  14147. d(detaching) {
  14148. if (detaching) detach(div0);
  14149. if_block0.d();
  14150. if_blocks[current_block_type_index].d();
  14151. if_blocks_1[current_block_type_index_1].d();
  14152. if (if_block3) if_block3.d();
  14153. if (if_block4) if_block4.d();
  14154. if (if_block5) if_block5.d();
  14155. if_blocks_2[current_block_type_index_2].d();
  14156. if_block7.d();
  14157. info.block.d();
  14158. info.token = null;
  14159. info = null;
  14160. if (if_block8) if_block8.d();
  14161. run_all(dispose);
  14162. }
  14163. };
  14164. }
  14165. // (125:0) <CollapsiblePanel dark={true} {isDarkmode} {show}>
  14166. function create_default_slot(ctx) {
  14167. let t;
  14168. let current;
  14169. return {
  14170. c() {
  14171. t = space();
  14172. },
  14173. m(target, anchor) {
  14174. insert(target, t, anchor);
  14175. },
  14176. p: noop,
  14177. i: noop,
  14178. o: noop,
  14179. d(detaching) {
  14180. if (detaching) detach(t);
  14181. }
  14182. };
  14183. }
  14184. function create_fragment$g(ctx) {
  14185. let current;
  14186. const collapsiblepanel = new CollapsiblePanel({
  14187. props: {
  14188. dark: true,
  14189. isDarkmode: /*isDarkmode*/ ctx[4],
  14190. show: /*show*/ ctx[3],
  14191. $$slots: {
  14192. default: [create_default_slot],
  14193. body: [create_body_slot],
  14194. heading: [create_heading_slot]
  14195. },
  14196. $$scope: { ctx }
  14197. }
  14198. });
  14199. return {
  14200. c() {
  14201. create_component(collapsiblepanel.$$.fragment);
  14202. },
  14203. m(target, anchor) {
  14204. mount_component(collapsiblepanel, target, anchor);
  14205. current = true;
  14206. },
  14207. p(ctx, dirty) {
  14208. const collapsiblepanel_changes = {};
  14209. if (dirty[0] & /*isDarkmode*/ 16) collapsiblepanel_changes.isDarkmode = /*isDarkmode*/ ctx[4];
  14210. if (dirty[0] & /*show*/ 8) collapsiblepanel_changes.show = /*show*/ ctx[3];
  14211. if (dirty[0] & /*error, response, requestTab, currentAction, requestBody, requestParameters, environment, $auth, $env, $token, requestHeaders, copying, currentUrl*/ 32743 | dirty[1] & /*$$scope*/ 256) {
  14212. collapsiblepanel_changes.$$scope = { dirty, ctx };
  14213. }
  14214. collapsiblepanel.$set(collapsiblepanel_changes);
  14215. },
  14216. i(local) {
  14217. if (current) return;
  14218. transition_in(collapsiblepanel.$$.fragment, local);
  14219. current = true;
  14220. },
  14221. o(local) {
  14222. transition_out(collapsiblepanel.$$.fragment, local);
  14223. current = false;
  14224. },
  14225. d(detaching) {
  14226. destroy_component(collapsiblepanel, detaching);
  14227. }
  14228. };
  14229. }
  14230. function contentType(headers) {
  14231. return headers && headers["content-type"];
  14232. }
  14233. function basicAuth(username, password) {
  14234. return btoa(`${username}:${password}`);
  14235. }
  14236. function instance$g($$self, $$props, $$invalidate) {
  14237. let $env;
  14238. let $auth;
  14239. let $token;
  14240. component_subscribe($$self, env, $$value => $$invalidate(11, $env = $$value));
  14241. component_subscribe($$self, auth, $$value => $$invalidate(13, $auth = $$value));
  14242. component_subscribe($$self, token, $$value => $$invalidate(14, $token = $$value));
  14243. let { show = true } = $$props;
  14244. let { isDarkmode } = $$props;
  14245. let { environments } = $$props;
  14246. let { currentAction } = $$props;
  14247. let { currentSample } = $$props;
  14248. let { requestHeaders } = $$props;
  14249. let { requestParameters } = $$props;
  14250. let { requestBody } = $$props;
  14251. let response = {};
  14252. let requestTab = 0;
  14253. let error;
  14254. let copying = false;
  14255. afterUpdate(() => {
  14256. $$invalidate(6, response = {});
  14257. });
  14258. function handleClick() {
  14259. $$invalidate(8, error = undefined);
  14260. $$invalidate(6, response = sendRequest($env, environment, currentAction, {
  14261. headers: requestHeaders,
  14262. parameters: requestParameters,
  14263. body: requestBody
  14264. }).catch(function (err) {
  14265. $$invalidate(8, error = err);
  14266. return Promise.reject(err);
  14267. }));
  14268. }
  14269. function handleTab(index) {
  14270. $$invalidate(8, error = undefined);
  14271. $$invalidate(7, requestTab = index);
  14272. }
  14273. function handleCopy() {
  14274. $$invalidate(9, copying = true);
  14275. setTimeout(
  14276. () => {
  14277. $$invalidate(9, copying = false);
  14278. },
  14279. 2000
  14280. );
  14281. copyUrl(currentUrl, requestParameters);
  14282. }
  14283. const click_handler = () => handleTab(0);
  14284. const click_handler_1 = () => handleTab(1);
  14285. const click_handler_2 = () => handleTab(2);
  14286. function fieldswitch_used_binding(value, header) {
  14287. header.used = value;
  14288. $$invalidate(0, requestHeaders);
  14289. }
  14290. function fieldswitch_value_binding(value_1, header) {
  14291. header.value = value_1;
  14292. $$invalidate(0, requestHeaders);
  14293. }
  14294. function fieldswitch_used_binding_1(value, param) {
  14295. param.used = value;
  14296. $$invalidate(1, requestParameters);
  14297. }
  14298. function fieldswitch_value_binding_1(value_1, param) {
  14299. param.value = value_1;
  14300. $$invalidate(1, requestParameters);
  14301. }
  14302. function textarea_input_handler() {
  14303. requestBody = this.value;
  14304. $$invalidate(2, requestBody);
  14305. }
  14306. $$self.$set = $$props => {
  14307. if ("show" in $$props) $$invalidate(3, show = $$props.show);
  14308. if ("isDarkmode" in $$props) $$invalidate(4, isDarkmode = $$props.isDarkmode);
  14309. if ("environments" in $$props) $$invalidate(18, environments = $$props.environments);
  14310. if ("currentAction" in $$props) $$invalidate(5, currentAction = $$props.currentAction);
  14311. if ("currentSample" in $$props) $$invalidate(19, currentSample = $$props.currentSample);
  14312. if ("requestHeaders" in $$props) $$invalidate(0, requestHeaders = $$props.requestHeaders);
  14313. if ("requestParameters" in $$props) $$invalidate(1, requestParameters = $$props.requestParameters);
  14314. if ("requestBody" in $$props) $$invalidate(2, requestBody = $$props.requestBody);
  14315. };
  14316. let environment;
  14317. let currentUrl;
  14318. $$self.$$.update = () => {
  14319. if ($$self.$$.dirty[0] & /*environments, $env*/ 264192) {
  14320. $$invalidate(10, environment = environments[$env]);
  14321. }
  14322. if ($$self.$$.dirty[0] & /*environment, currentAction*/ 1056) {
  14323. $$invalidate(12, currentUrl = urlParse(urlJoin(environment.url, currentAction.path)));
  14324. }
  14325. if ($$self.$$.dirty[0] & /*currentUrl*/ 4096) {
  14326. {
  14327. $$invalidate(8, error = currentUrl && undefined);
  14328. }
  14329. }
  14330. };
  14331. return [
  14332. requestHeaders,
  14333. requestParameters,
  14334. requestBody,
  14335. show,
  14336. isDarkmode,
  14337. currentAction,
  14338. response,
  14339. requestTab,
  14340. error,
  14341. copying,
  14342. environment,
  14343. $env,
  14344. currentUrl,
  14345. $auth,
  14346. $token,
  14347. handleClick,
  14348. handleTab,
  14349. handleCopy,
  14350. environments,
  14351. currentSample,
  14352. click_handler,
  14353. click_handler_1,
  14354. click_handler_2,
  14355. fieldswitch_used_binding,
  14356. fieldswitch_value_binding,
  14357. fieldswitch_used_binding_1,
  14358. fieldswitch_value_binding_1,
  14359. textarea_input_handler
  14360. ];
  14361. }
  14362. class PlaygroundPanel extends SvelteComponent {
  14363. constructor(options) {
  14364. super();
  14365. if (!document.getElementById("svelte-c3oocm-style")) add_css$8();
  14366. init(
  14367. this,
  14368. options,
  14369. instance$g,
  14370. create_fragment$g,
  14371. safe_not_equal,
  14372. {
  14373. show: 3,
  14374. isDarkmode: 4,
  14375. environments: 18,
  14376. currentAction: 5,
  14377. currentSample: 19,
  14378. requestHeaders: 0,
  14379. requestParameters: 1,
  14380. requestBody: 2
  14381. },
  14382. [-1, -1]
  14383. );
  14384. }
  14385. }
  14386. /* usr/local/lib/node_modules/snowboard/templates/winter/panels/ScenarioPanel.svelte generated by Svelte v3.16.5 */
  14387. function create_else_block$4(ctx) {
  14388. let current;
  14389. const collapsiblepanel = new CollapsiblePanel({
  14390. props: {
  14391. isDarkmode: /*isDarkmode*/ ctx[4],
  14392. show: /*show*/ ctx[0],
  14393. $$slots: {
  14394. default: [create_default_slot$1],
  14395. body: [create_body_slot$1],
  14396. heading: [create_heading_slot$1]
  14397. },
  14398. $$scope: { ctx }
  14399. }
  14400. });
  14401. return {
  14402. c() {
  14403. create_component(collapsiblepanel.$$.fragment);
  14404. },
  14405. m(target, anchor) {
  14406. mount_component(collapsiblepanel, target, anchor);
  14407. current = true;
  14408. },
  14409. p(ctx, dirty) {
  14410. const collapsiblepanel_changes = {};
  14411. if (dirty & /*isDarkmode*/ 16) collapsiblepanel_changes.isDarkmode = /*isDarkmode*/ ctx[4];
  14412. if (dirty & /*show*/ 1) collapsiblepanel_changes.show = /*show*/ ctx[0];
  14413. if (dirty & /*$$scope, response, request, index*/ 142) {
  14414. collapsiblepanel_changes.$$scope = { dirty, ctx };
  14415. }
  14416. collapsiblepanel.$set(collapsiblepanel_changes);
  14417. },
  14418. i(local) {
  14419. if (current) return;
  14420. transition_in(collapsiblepanel.$$.fragment, local);
  14421. current = true;
  14422. },
  14423. o(local) {
  14424. transition_out(collapsiblepanel.$$.fragment, local);
  14425. current = false;
  14426. },
  14427. d(detaching) {
  14428. destroy_component(collapsiblepanel, detaching);
  14429. }
  14430. };
  14431. }
  14432. // (30:0) {#if request.title === ''}
  14433. function create_if_block$b(ctx) {
  14434. let current;
  14435. const responsepanel = new ResponsePanel({
  14436. props: {
  14437. title: /*response*/ ctx[3].title,
  14438. description: /*response*/ ctx[3].description,
  14439. statusCode: /*response*/ ctx[3].statusCode,
  14440. headers: /*response*/ ctx[3].headers,
  14441. contentType: /*response*/ ctx[3].contentType,
  14442. example: /*response*/ ctx[3].example,
  14443. schema: /*response*/ ctx[3].schema
  14444. }
  14445. });
  14446. return {
  14447. c() {
  14448. create_component(responsepanel.$$.fragment);
  14449. },
  14450. m(target, anchor) {
  14451. mount_component(responsepanel, target, anchor);
  14452. current = true;
  14453. },
  14454. p(ctx, dirty) {
  14455. const responsepanel_changes = {};
  14456. if (dirty & /*response*/ 8) responsepanel_changes.title = /*response*/ ctx[3].title;
  14457. if (dirty & /*response*/ 8) responsepanel_changes.description = /*response*/ ctx[3].description;
  14458. if (dirty & /*response*/ 8) responsepanel_changes.statusCode = /*response*/ ctx[3].statusCode;
  14459. if (dirty & /*response*/ 8) responsepanel_changes.headers = /*response*/ ctx[3].headers;
  14460. if (dirty & /*response*/ 8) responsepanel_changes.contentType = /*response*/ ctx[3].contentType;
  14461. if (dirty & /*response*/ 8) responsepanel_changes.example = /*response*/ ctx[3].example;
  14462. if (dirty & /*response*/ 8) responsepanel_changes.schema = /*response*/ ctx[3].schema;
  14463. responsepanel.$set(responsepanel_changes);
  14464. },
  14465. i(local) {
  14466. if (current) return;
  14467. transition_in(responsepanel.$$.fragment, local);
  14468. current = true;
  14469. },
  14470. o(local) {
  14471. transition_out(responsepanel.$$.fragment, local);
  14472. current = false;
  14473. },
  14474. d(detaching) {
  14475. destroy_component(responsepanel, detaching);
  14476. }
  14477. };
  14478. }
  14479. // (41:4) <span slot="heading">
  14480. function create_heading_slot$1(ctx) {
  14481. let span;
  14482. let t_value = /*title*/ ctx[5](/*index*/ ctx[1]) + "";
  14483. let t;
  14484. return {
  14485. c() {
  14486. span = element("span");
  14487. t = text(t_value);
  14488. attr(span, "slot", "heading");
  14489. },
  14490. m(target, anchor) {
  14491. insert(target, span, anchor);
  14492. append(span, t);
  14493. },
  14494. p(ctx, dirty) {
  14495. if (dirty & /*index*/ 2 && t_value !== (t_value = /*title*/ ctx[5](/*index*/ ctx[1]) + "")) set_data(t, t_value);
  14496. },
  14497. d(detaching) {
  14498. if (detaching) detach(span);
  14499. }
  14500. };
  14501. }
  14502. // (42:4) <div slot="body">
  14503. function create_body_slot$1(ctx) {
  14504. let div;
  14505. let t;
  14506. let current;
  14507. const requestpanel = new RequestPanel({
  14508. props: {
  14509. description: /*request*/ ctx[2].description,
  14510. headers: /*request*/ ctx[2].headers,
  14511. contentType: /*request*/ ctx[2].contentType,
  14512. example: /*request*/ ctx[2].example,
  14513. schema: /*request*/ ctx[2].schema
  14514. }
  14515. });
  14516. const responsepanel = new ResponsePanel({
  14517. props: {
  14518. title: /*response*/ ctx[3].title,
  14519. description: /*response*/ ctx[3].description,
  14520. statusCode: /*response*/ ctx[3].statusCode,
  14521. headers: /*response*/ ctx[3].headers,
  14522. contentType: /*response*/ ctx[3].contentType,
  14523. example: /*response*/ ctx[3].example,
  14524. schema: /*response*/ ctx[3].schema
  14525. }
  14526. });
  14527. return {
  14528. c() {
  14529. div = element("div");
  14530. create_component(requestpanel.$$.fragment);
  14531. t = space();
  14532. create_component(responsepanel.$$.fragment);
  14533. attr(div, "slot", "body");
  14534. },
  14535. m(target, anchor) {
  14536. insert(target, div, anchor);
  14537. mount_component(requestpanel, div, null);
  14538. append(div, t);
  14539. mount_component(responsepanel, div, null);
  14540. current = true;
  14541. },
  14542. p(ctx, dirty) {
  14543. const requestpanel_changes = {};
  14544. if (dirty & /*request*/ 4) requestpanel_changes.description = /*request*/ ctx[2].description;
  14545. if (dirty & /*request*/ 4) requestpanel_changes.headers = /*request*/ ctx[2].headers;
  14546. if (dirty & /*request*/ 4) requestpanel_changes.contentType = /*request*/ ctx[2].contentType;
  14547. if (dirty & /*request*/ 4) requestpanel_changes.example = /*request*/ ctx[2].example;
  14548. if (dirty & /*request*/ 4) requestpanel_changes.schema = /*request*/ ctx[2].schema;
  14549. requestpanel.$set(requestpanel_changes);
  14550. const responsepanel_changes = {};
  14551. if (dirty & /*response*/ 8) responsepanel_changes.title = /*response*/ ctx[3].title;
  14552. if (dirty & /*response*/ 8) responsepanel_changes.description = /*response*/ ctx[3].description;
  14553. if (dirty & /*response*/ 8) responsepanel_changes.statusCode = /*response*/ ctx[3].statusCode;
  14554. if (dirty & /*response*/ 8) responsepanel_changes.headers = /*response*/ ctx[3].headers;
  14555. if (dirty & /*response*/ 8) responsepanel_changes.contentType = /*response*/ ctx[3].contentType;
  14556. if (dirty & /*response*/ 8) responsepanel_changes.example = /*response*/ ctx[3].example;
  14557. if (dirty & /*response*/ 8) responsepanel_changes.schema = /*response*/ ctx[3].schema;
  14558. responsepanel.$set(responsepanel_changes);
  14559. },
  14560. i(local) {
  14561. if (current) return;
  14562. transition_in(requestpanel.$$.fragment, local);
  14563. transition_in(responsepanel.$$.fragment, local);
  14564. current = true;
  14565. },
  14566. o(local) {
  14567. transition_out(requestpanel.$$.fragment, local);
  14568. transition_out(responsepanel.$$.fragment, local);
  14569. current = false;
  14570. },
  14571. d(detaching) {
  14572. if (detaching) detach(div);
  14573. destroy_component(requestpanel);
  14574. destroy_component(responsepanel);
  14575. }
  14576. };
  14577. }
  14578. // (40:2) <CollapsiblePanel {isDarkmode} {show}>
  14579. function create_default_slot$1(ctx) {
  14580. let t;
  14581. let current;
  14582. return {
  14583. c() {
  14584. t = space();
  14585. },
  14586. m(target, anchor) {
  14587. insert(target, t, anchor);
  14588. },
  14589. p: noop,
  14590. i: noop,
  14591. o: noop,
  14592. d(detaching) {
  14593. if (detaching) detach(t);
  14594. }
  14595. };
  14596. }
  14597. function create_fragment$h(ctx) {
  14598. let current_block_type_index;
  14599. let if_block;
  14600. let if_block_anchor;
  14601. let current;
  14602. const if_block_creators = [create_if_block$b, create_else_block$4];
  14603. const if_blocks = [];
  14604. function select_block_type(ctx, dirty) {
  14605. if (/*request*/ ctx[2].title === "") return 0;
  14606. return 1;
  14607. }
  14608. current_block_type_index = select_block_type(ctx, -1);
  14609. if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
  14610. return {
  14611. c() {
  14612. if_block.c();
  14613. if_block_anchor = empty();
  14614. },
  14615. m(target, anchor) {
  14616. if_blocks[current_block_type_index].m(target, anchor);
  14617. insert(target, if_block_anchor, anchor);
  14618. current = true;
  14619. },
  14620. p(ctx, [dirty]) {
  14621. let previous_block_index = current_block_type_index;
  14622. current_block_type_index = select_block_type(ctx, dirty);
  14623. if (current_block_type_index === previous_block_index) {
  14624. if_blocks[current_block_type_index].p(ctx, dirty);
  14625. } else {
  14626. group_outros();
  14627. transition_out(if_blocks[previous_block_index], 1, 1, () => {
  14628. if_blocks[previous_block_index] = null;
  14629. });
  14630. check_outros();
  14631. if_block = if_blocks[current_block_type_index];
  14632. if (!if_block) {
  14633. if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
  14634. if_block.c();
  14635. }
  14636. transition_in(if_block, 1);
  14637. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  14638. }
  14639. },
  14640. i(local) {
  14641. if (current) return;
  14642. transition_in(if_block);
  14643. current = true;
  14644. },
  14645. o(local) {
  14646. transition_out(if_block);
  14647. current = false;
  14648. },
  14649. d(detaching) {
  14650. if_blocks[current_block_type_index].d(detaching);
  14651. if (detaching) detach(if_block_anchor);
  14652. }
  14653. };
  14654. }
  14655. function instance$h($$self, $$props, $$invalidate) {
  14656. let { show } = $$props;
  14657. let { count } = $$props;
  14658. let { index } = $$props;
  14659. let { request } = $$props;
  14660. let { response } = $$props;
  14661. let { isDarkmode } = $$props;
  14662. function title(index) {
  14663. if (request.title) {
  14664. return `Request ${request.title}`;
  14665. }
  14666. if (count === 1) {
  14667. return "Request";
  14668. } else {
  14669. return `Request ${index + 1}`;
  14670. }
  14671. }
  14672. $$self.$set = $$props => {
  14673. if ("show" in $$props) $$invalidate(0, show = $$props.show);
  14674. if ("count" in $$props) $$invalidate(6, count = $$props.count);
  14675. if ("index" in $$props) $$invalidate(1, index = $$props.index);
  14676. if ("request" in $$props) $$invalidate(2, request = $$props.request);
  14677. if ("response" in $$props) $$invalidate(3, response = $$props.response);
  14678. if ("isDarkmode" in $$props) $$invalidate(4, isDarkmode = $$props.isDarkmode);
  14679. };
  14680. return [show, index, request, response, isDarkmode, title, count];
  14681. }
  14682. class ScenarioPanel extends SvelteComponent {
  14683. constructor(options) {
  14684. super();
  14685. init(this, options, instance$h, create_fragment$h, safe_not_equal, {
  14686. show: 0,
  14687. count: 6,
  14688. index: 1,
  14689. request: 2,
  14690. response: 3,
  14691. isDarkmode: 4
  14692. });
  14693. }
  14694. }
  14695. /* usr/local/lib/node_modules/snowboard/templates/winter.svelte generated by Svelte v3.16.5 */
  14696. const { document: document_1 } = globals;
  14697. function add_css$9() {
  14698. var style = element("style");
  14699. style.id = "svelte-1jcck2f-style";
  14700. style.textContent = "html{height:100%}body{min-height:100%}.sidenav.svelte-1jcck2f{padding:1rem 0 1rem 0.75rem}.main.svelte-1jcck2f{padding:3rem;background-color:#fff;box-shadow:0 2px 0 2px #f5f5f5}.main.is-darkmode.svelte-1jcck2f{background-color:#000;box-shadow:0 2px 0 2px #363636}.breadcrumb-right.svelte-1jcck2f{margin-top:0.3em}.box-wrapper.svelte-1jcck2f{border-radius:0}.body-inner.svelte-1jcck2f{min-height:100vh;background-color:#fafafa}.body-inner.is-darkmode.svelte-1jcck2f{background-color:#000}.is-darkmode .input, .is-darkmode .select select, .is-darkmode\n .textarea{background-color:#484848;border-color:#484848;color:#fff}.is-darkmode .input:hover, .is-darkmode\n .is-hovered.input, .is-darkmode .is-hovered.textarea, .is-darkmode\n .select\n select.is-hovered, .is-darkmode .select select:hover, .is-darkmode\n .textarea:hover{border-color:#666}.is-darkmode .select select.is-focused, .is-darkmode\n .select\n select:active, .is-darkmode .select select:focus, .is-darkmode\n .textarea:active, .is-darkmode .textarea:focus{border-color:#888}.is-darkmode .input::placeholder, .is-darkmode\n .select\n select::placeholder, .is-darkmode .textarea::placeholder{color:#ccc}code[class*=\"language-\"], pre[class*=\"language-\"]{font-family:monospace}.token.number, .token.tag{display:inline;padding:inherit;font-size:inherit;line-height:inherit;text-align:inherit;vertical-align:inherit;border-radius:inherit;font-weight:inherit;white-space:inherit;background:inherit;margin:inherit}.icon-brand.svelte-1jcck2f{margin-right:0.5rem}.menu-collapsible.svelte-1jcck2f{display:none;position:fixed;width:calc(25% - 0.5rem);height:calc(2.5rem + 10px);left:0;bottom:0;font-size:1.33333em;line-height:calc(2.5rem + 5px);text-align:center;color:#b5b5b5;font-weight:300;border-top:1px solid #eee;box-shadow:2px 0 0 #f5f5f5;cursor:pointer}.menu-collapsible.svelte-1jcck2f:hover{background:rgba(0, 0, 0, 0.05);box-shadow:2px 0 0 #eee;border-color:#e8e8e8}.menu-collapsible.is-darkmode.svelte-1jcck2f{border-color:#363636;box-shadow:2px 0 0 #363636}.menu-collapsible.is-darkmode.svelte-1jcck2f:hover{background:rgba(255, 255, 255, 0.2);border-color:#363636;box-shadow:2px 0 0 #363636}.footer.is-darkmode.svelte-1jcck2f{background-color:#000}.footer.svelte-1jcck2f .content.svelte-1jcck2f{transition:margin 0.3s}@media screen and (min-width: 768px){.menu-collapsible.svelte-1jcck2f{display:block}.is-collapsed.svelte-1jcck2f .sidenav.svelte-1jcck2f{width:3.75rem}.is-collapsed.svelte-1jcck2f .main.svelte-1jcck2f{width:calc(100% - 4.5rem)}.is-collapsed.svelte-1jcck2f .menu-collapsible.svelte-1jcck2f{width:calc(3rem - 2px)}.menu-collapsible.svelte-1jcck2f,.sidenav.svelte-1jcck2f,.main.svelte-1jcck2f{transition:width 0.3s}}";
  14701. append(document_1.head, style);
  14702. }
  14703. function get_each_context$6(ctx, list, i) {
  14704. const child_ctx = ctx.slice();
  14705. child_ctx[22] = list[i].request;
  14706. child_ctx[23] = list[i].response;
  14707. child_ctx[12] = i;
  14708. return child_ctx;
  14709. }
  14710. function get_each_context_1$2(ctx, list, i) {
  14711. const child_ctx = ctx.slice();
  14712. child_ctx[25] = list[i];
  14713. child_ctx[12] = i;
  14714. return child_ctx;
  14715. }
  14716. // (438:8) {#if config.playground.enabled}
  14717. function create_if_block_8$1(ctx) {
  14718. let current;
  14719. const selectorpanel = new SelectorPanel({
  14720. props: {
  14721. environments: /*config*/ ctx[4].playground.environments,
  14722. authenticating: /*authenticating*/ ctx[7]
  14723. }
  14724. });
  14725. return {
  14726. c() {
  14727. create_component(selectorpanel.$$.fragment);
  14728. },
  14729. m(target, anchor) {
  14730. mount_component(selectorpanel, target, anchor);
  14731. current = true;
  14732. },
  14733. p(ctx, dirty) {
  14734. const selectorpanel_changes = {};
  14735. if (dirty & /*config*/ 16) selectorpanel_changes.environments = /*config*/ ctx[4].playground.environments;
  14736. if (dirty & /*authenticating*/ 128) selectorpanel_changes.authenticating = /*authenticating*/ ctx[7];
  14737. selectorpanel.$set(selectorpanel_changes);
  14738. },
  14739. i(local) {
  14740. if (current) return;
  14741. transition_in(selectorpanel.$$.fragment, local);
  14742. current = true;
  14743. },
  14744. o(local) {
  14745. transition_out(selectorpanel.$$.fragment, local);
  14746. current = false;
  14747. },
  14748. d(detaching) {
  14749. destroy_component(selectorpanel, detaching);
  14750. }
  14751. };
  14752. }
  14753. // (443:8) {#if darkMode.enable}
  14754. function create_if_block_7$1(ctx) {
  14755. let div;
  14756. let a;
  14757. let span;
  14758. let i;
  14759. let dispose;
  14760. return {
  14761. c() {
  14762. div = element("div");
  14763. a = element("a");
  14764. span = element("span");
  14765. i = element("i");
  14766. attr(i, "class", "fas fa-lg");
  14767. toggle_class(i, "fa-moon", /*darkMode*/ ctx[9].active);
  14768. toggle_class(i, "fa-sun", !/*darkMode*/ ctx[9].active);
  14769. attr(span, "class", "icon is-medium has-text-grey-light");
  14770. attr(a, "href", "javascript:void(0)");
  14771. attr(a, "title", "Dark Mode");
  14772. attr(a, "class", "navbar-link is-arrowless");
  14773. attr(div, "class", "navbar-item has-dropdown is-hoverable");
  14774. dispose = listen(a, "click", /*darkToggle*/ ctx[19]);
  14775. },
  14776. m(target, anchor) {
  14777. insert(target, div, anchor);
  14778. append(div, a);
  14779. append(a, span);
  14780. append(span, i);
  14781. },
  14782. p(ctx, dirty) {
  14783. if (dirty & /*darkMode*/ 512) {
  14784. toggle_class(i, "fa-moon", /*darkMode*/ ctx[9].active);
  14785. }
  14786. if (dirty & /*darkMode*/ 512) {
  14787. toggle_class(i, "fa-sun", !/*darkMode*/ ctx[9].active);
  14788. }
  14789. },
  14790. d(detaching) {
  14791. if (detaching) detach(div);
  14792. dispose();
  14793. }
  14794. };
  14795. }
  14796. // (485:8) {#if collapsed}
  14797. function create_if_block_6$1(ctx) {
  14798. let span;
  14799. return {
  14800. c() {
  14801. span = element("span");
  14802. span.textContent = "»";
  14803. attr(span, "class", "icon");
  14804. attr(span, "title", "Expand [");
  14805. },
  14806. m(target, anchor) {
  14807. insert(target, span, anchor);
  14808. },
  14809. d(detaching) {
  14810. if (detaching) detach(span);
  14811. }
  14812. };
  14813. }
  14814. // (488:8) {#if !collapsed}
  14815. function create_if_block_5$1(ctx) {
  14816. let span0;
  14817. let t1;
  14818. let span1;
  14819. return {
  14820. c() {
  14821. span0 = element("span");
  14822. span0.textContent = "«";
  14823. t1 = space();
  14824. span1 = element("span");
  14825. span1.textContent = "Collapse sidebar";
  14826. attr(span0, "class", "icon");
  14827. attr(span1, "class", "fa-xs");
  14828. },
  14829. m(target, anchor) {
  14830. insert(target, span0, anchor);
  14831. insert(target, t1, anchor);
  14832. insert(target, span1, anchor);
  14833. },
  14834. d(detaching) {
  14835. if (detaching) detach(span0);
  14836. if (detaching) detach(t1);
  14837. if (detaching) detach(span1);
  14838. }
  14839. };
  14840. }
  14841. // (498:6) {#if index === -1}
  14842. function create_if_block_4$1(ctx) {
  14843. let div;
  14844. let raw_value = markdown(/*description*/ ctx[1]) + "";
  14845. return {
  14846. c() {
  14847. div = element("div");
  14848. attr(div, "class", "content");
  14849. },
  14850. m(target, anchor) {
  14851. insert(target, div, anchor);
  14852. div.innerHTML = raw_value;
  14853. },
  14854. p(ctx, dirty) {
  14855. if (dirty & /*description*/ 2 && raw_value !== (raw_value = markdown(/*description*/ ctx[1]) + "")) div.innerHTML = raw_value;;
  14856. },
  14857. d(detaching) {
  14858. if (detaching) detach(div);
  14859. }
  14860. };
  14861. }
  14862. // (504:6) {#if currentAction}
  14863. function create_if_block$c(ctx) {
  14864. let div2;
  14865. let div0;
  14866. let h1;
  14867. let t0_value = /*currentAction*/ ctx[10].title + "";
  14868. let t0;
  14869. let t1;
  14870. let div1;
  14871. let nav;
  14872. let ul;
  14873. let t2;
  14874. let hr;
  14875. let t3;
  14876. let div3;
  14877. let code0;
  14878. let t4_value = /*currentAction*/ ctx[10].method + "";
  14879. let t4;
  14880. let code0_class_value;
  14881. let t5;
  14882. let code1;
  14883. let t6_value = /*currentAction*/ ctx[10].pathTemplate + "";
  14884. let t6;
  14885. let t7;
  14886. let div4;
  14887. let raw_value = markdown(/*currentAction*/ ctx[10].description) + "";
  14888. let t8;
  14889. let t9;
  14890. let t10;
  14891. let each1_anchor;
  14892. let current;
  14893. let each_value_1 = /*currentAction*/ ctx[10].tags;
  14894. let each_blocks_1 = [];
  14895. for (let i = 0; i < each_value_1.length; i += 1) {
  14896. each_blocks_1[i] = create_each_block_1$2(get_each_context_1$2(ctx, each_value_1, i));
  14897. }
  14898. let if_block = /*config*/ ctx[4].playground.enabled && create_if_block_1$8(ctx);
  14899. const parameterpanel = new ParameterPanel({
  14900. props: {
  14901. parameters: /*currentAction*/ ctx[10].parameters
  14902. }
  14903. });
  14904. let each_value = /*currentAction*/ ctx[10].transactions;
  14905. let each_blocks = [];
  14906. for (let i = 0; i < each_value.length; i += 1) {
  14907. each_blocks[i] = create_each_block$6(get_each_context$6(ctx, each_value, i));
  14908. }
  14909. const out = i => transition_out(each_blocks[i], 1, 1, () => {
  14910. each_blocks[i] = null;
  14911. });
  14912. return {
  14913. c() {
  14914. div2 = element("div");
  14915. div0 = element("div");
  14916. h1 = element("h1");
  14917. t0 = text(t0_value);
  14918. t1 = space();
  14919. div1 = element("div");
  14920. nav = element("nav");
  14921. ul = element("ul");
  14922. for (let i = 0; i < each_blocks_1.length; i += 1) {
  14923. each_blocks_1[i].c();
  14924. }
  14925. t2 = space();
  14926. hr = element("hr");
  14927. t3 = space();
  14928. div3 = element("div");
  14929. code0 = element("code");
  14930. t4 = text(t4_value);
  14931. t5 = space();
  14932. code1 = element("code");
  14933. t6 = text(t6_value);
  14934. t7 = space();
  14935. div4 = element("div");
  14936. t8 = space();
  14937. if (if_block) if_block.c();
  14938. t9 = space();
  14939. create_component(parameterpanel.$$.fragment);
  14940. t10 = space();
  14941. for (let i = 0; i < each_blocks.length; i += 1) {
  14942. each_blocks[i].c();
  14943. }
  14944. each1_anchor = empty();
  14945. attr(h1, "class", "title is-4");
  14946. attr(div0, "class", "column");
  14947. attr(nav, "class", "breadcrumb breadcrumb-right is-pulled-right svelte-1jcck2f");
  14948. attr(nav, "aria-label", "breadcrumbs");
  14949. attr(div1, "class", "column");
  14950. attr(div2, "class", "columns");
  14951. attr(code0, "class", code0_class_value = "tag is-uppercase " + colorize(/*currentAction*/ ctx[10].method) + " svelte-1jcck2f");
  14952. attr(code1, "class", "tag ");
  14953. attr(div3, "class", "tags has-addons are-large");
  14954. attr(div4, "class", "content");
  14955. },
  14956. m(target, anchor) {
  14957. insert(target, div2, anchor);
  14958. append(div2, div0);
  14959. append(div0, h1);
  14960. append(h1, t0);
  14961. append(div2, t1);
  14962. append(div2, div1);
  14963. append(div1, nav);
  14964. append(nav, ul);
  14965. for (let i = 0; i < each_blocks_1.length; i += 1) {
  14966. each_blocks_1[i].m(ul, null);
  14967. }
  14968. insert(target, t2, anchor);
  14969. insert(target, hr, anchor);
  14970. insert(target, t3, anchor);
  14971. insert(target, div3, anchor);
  14972. append(div3, code0);
  14973. append(code0, t4);
  14974. append(div3, t5);
  14975. append(div3, code1);
  14976. append(code1, t6);
  14977. insert(target, t7, anchor);
  14978. insert(target, div4, anchor);
  14979. div4.innerHTML = raw_value;
  14980. insert(target, t8, anchor);
  14981. if (if_block) if_block.m(target, anchor);
  14982. insert(target, t9, anchor);
  14983. mount_component(parameterpanel, target, anchor);
  14984. insert(target, t10, anchor);
  14985. for (let i = 0; i < each_blocks.length; i += 1) {
  14986. each_blocks[i].m(target, anchor);
  14987. }
  14988. insert(target, each1_anchor, anchor);
  14989. current = true;
  14990. },
  14991. p(ctx, dirty) {
  14992. if ((!current || dirty & /*currentAction*/ 1024) && t0_value !== (t0_value = /*currentAction*/ ctx[10].title + "")) set_data(t0, t0_value);
  14993. if (dirty & /*currentAction, slugify, handleGroupClick*/ 17408) {
  14994. each_value_1 = /*currentAction*/ ctx[10].tags;
  14995. let i;
  14996. for (i = 0; i < each_value_1.length; i += 1) {
  14997. const child_ctx = get_each_context_1$2(ctx, each_value_1, i);
  14998. if (each_blocks_1[i]) {
  14999. each_blocks_1[i].p(child_ctx, dirty);
  15000. } else {
  15001. each_blocks_1[i] = create_each_block_1$2(child_ctx);
  15002. each_blocks_1[i].c();
  15003. each_blocks_1[i].m(ul, null);
  15004. }
  15005. }
  15006. for (; i < each_blocks_1.length; i += 1) {
  15007. each_blocks_1[i].d(1);
  15008. }
  15009. each_blocks_1.length = each_value_1.length;
  15010. }
  15011. if ((!current || dirty & /*currentAction*/ 1024) && t4_value !== (t4_value = /*currentAction*/ ctx[10].method + "")) set_data(t4, t4_value);
  15012. if (!current || dirty & /*currentAction*/ 1024 && code0_class_value !== (code0_class_value = "tag is-uppercase " + colorize(/*currentAction*/ ctx[10].method) + " svelte-1jcck2f")) {
  15013. attr(code0, "class", code0_class_value);
  15014. }
  15015. if ((!current || dirty & /*currentAction*/ 1024) && t6_value !== (t6_value = /*currentAction*/ ctx[10].pathTemplate + "")) set_data(t6, t6_value);
  15016. if ((!current || dirty & /*currentAction*/ 1024) && raw_value !== (raw_value = markdown(/*currentAction*/ ctx[10].description) + "")) div4.innerHTML = raw_value;;
  15017. if (/*config*/ ctx[4].playground.enabled) {
  15018. if (if_block) {
  15019. if_block.p(ctx, dirty);
  15020. transition_in(if_block, 1);
  15021. } else {
  15022. if_block = create_if_block_1$8(ctx);
  15023. if_block.c();
  15024. transition_in(if_block, 1);
  15025. if_block.m(t9.parentNode, t9);
  15026. }
  15027. } else if (if_block) {
  15028. group_outros();
  15029. transition_out(if_block, 1, 1, () => {
  15030. if_block = null;
  15031. });
  15032. check_outros();
  15033. }
  15034. const parameterpanel_changes = {};
  15035. if (dirty & /*currentAction*/ 1024) parameterpanel_changes.parameters = /*currentAction*/ ctx[10].parameters;
  15036. parameterpanel.$set(parameterpanel_changes);
  15037. if (dirty & /*darkMode, currentAction*/ 1536) {
  15038. each_value = /*currentAction*/ ctx[10].transactions;
  15039. let i;
  15040. for (i = 0; i < each_value.length; i += 1) {
  15041. const child_ctx = get_each_context$6(ctx, each_value, i);
  15042. if (each_blocks[i]) {
  15043. each_blocks[i].p(child_ctx, dirty);
  15044. transition_in(each_blocks[i], 1);
  15045. } else {
  15046. each_blocks[i] = create_each_block$6(child_ctx);
  15047. each_blocks[i].c();
  15048. transition_in(each_blocks[i], 1);
  15049. each_blocks[i].m(each1_anchor.parentNode, each1_anchor);
  15050. }
  15051. }
  15052. group_outros();
  15053. for (i = each_value.length; i < each_blocks.length; i += 1) {
  15054. out(i);
  15055. }
  15056. check_outros();
  15057. }
  15058. },
  15059. i(local) {
  15060. if (current) return;
  15061. transition_in(if_block);
  15062. transition_in(parameterpanel.$$.fragment, local);
  15063. for (let i = 0; i < each_value.length; i += 1) {
  15064. transition_in(each_blocks[i]);
  15065. }
  15066. current = true;
  15067. },
  15068. o(local) {
  15069. transition_out(if_block);
  15070. transition_out(parameterpanel.$$.fragment, local);
  15071. each_blocks = each_blocks.filter(Boolean);
  15072. for (let i = 0; i < each_blocks.length; i += 1) {
  15073. transition_out(each_blocks[i]);
  15074. }
  15075. current = false;
  15076. },
  15077. d(detaching) {
  15078. if (detaching) detach(div2);
  15079. destroy_each(each_blocks_1, detaching);
  15080. if (detaching) detach(t2);
  15081. if (detaching) detach(hr);
  15082. if (detaching) detach(t3);
  15083. if (detaching) detach(div3);
  15084. if (detaching) detach(t7);
  15085. if (detaching) detach(div4);
  15086. if (detaching) detach(t8);
  15087. if (if_block) if_block.d(detaching);
  15088. if (detaching) detach(t9);
  15089. destroy_component(parameterpanel, detaching);
  15090. if (detaching) detach(t10);
  15091. destroy_each(each_blocks, detaching);
  15092. if (detaching) detach(each1_anchor);
  15093. }
  15094. };
  15095. }
  15096. // (518:20) {:else}
  15097. function create_else_block$5(ctx) {
  15098. let a;
  15099. let t_value = /*tag*/ ctx[25] + "";
  15100. let t;
  15101. let a_data_slug_value;
  15102. let a_href_value;
  15103. let dispose;
  15104. return {
  15105. c() {
  15106. a = element("a");
  15107. t = text(t_value);
  15108. attr(a, "data-slug", a_data_slug_value = slugify(/*tag*/ ctx[25]));
  15109. attr(a, "href", a_href_value = "#/g~" + slugify(/*tag*/ ctx[25]));
  15110. dispose = listen(a, "click", /*handleGroupClick*/ ctx[14]);
  15111. },
  15112. m(target, anchor) {
  15113. insert(target, a, anchor);
  15114. append(a, t);
  15115. },
  15116. p(ctx, dirty) {
  15117. if (dirty & /*currentAction*/ 1024 && t_value !== (t_value = /*tag*/ ctx[25] + "")) set_data(t, t_value);
  15118. if (dirty & /*currentAction*/ 1024 && a_data_slug_value !== (a_data_slug_value = slugify(/*tag*/ ctx[25]))) {
  15119. attr(a, "data-slug", a_data_slug_value);
  15120. }
  15121. if (dirty & /*currentAction*/ 1024 && a_href_value !== (a_href_value = "#/g~" + slugify(/*tag*/ ctx[25]))) {
  15122. attr(a, "href", a_href_value);
  15123. }
  15124. },
  15125. d(detaching) {
  15126. if (detaching) detach(a);
  15127. dispose();
  15128. }
  15129. };
  15130. }
  15131. // (516:20) {#if index === 0}
  15132. function create_if_block_3$3(ctx) {
  15133. let a;
  15134. let t_value = /*tag*/ ctx[25] + "";
  15135. let t;
  15136. return {
  15137. c() {
  15138. a = element("a");
  15139. t = text(t_value);
  15140. attr(a, "href", "javascript:void(0)");
  15141. },
  15142. m(target, anchor) {
  15143. insert(target, a, anchor);
  15144. append(a, t);
  15145. },
  15146. p(ctx, dirty) {
  15147. if (dirty & /*currentAction*/ 1024 && t_value !== (t_value = /*tag*/ ctx[25] + "")) set_data(t, t_value);
  15148. },
  15149. d(detaching) {
  15150. if (detaching) detach(a);
  15151. }
  15152. };
  15153. }
  15154. // (514:16) {#each currentAction.tags as tag, index}
  15155. function create_each_block_1$2(ctx) {
  15156. let li;
  15157. let t;
  15158. function select_block_type(ctx, dirty) {
  15159. if (/*index*/ ctx[12] === 0) return create_if_block_3$3;
  15160. return create_else_block$5;
  15161. }
  15162. let current_block_type = select_block_type(ctx, -1);
  15163. let if_block = current_block_type(ctx);
  15164. return {
  15165. c() {
  15166. li = element("li");
  15167. if_block.c();
  15168. t = space();
  15169. },
  15170. m(target, anchor) {
  15171. insert(target, li, anchor);
  15172. if_block.m(li, null);
  15173. append(li, t);
  15174. },
  15175. p(ctx, dirty) {
  15176. if_block.p(ctx, dirty);
  15177. },
  15178. d(detaching) {
  15179. if (detaching) detach(li);
  15180. if_block.d();
  15181. }
  15182. };
  15183. }
  15184. // (546:8) {#if config.playground.enabled}
  15185. function create_if_block_1$8(ctx) {
  15186. let if_block_anchor;
  15187. let current;
  15188. let if_block = /*environment*/ ctx[11].playground !== false && create_if_block_2$5(ctx);
  15189. return {
  15190. c() {
  15191. if (if_block) if_block.c();
  15192. if_block_anchor = empty();
  15193. },
  15194. m(target, anchor) {
  15195. if (if_block) if_block.m(target, anchor);
  15196. insert(target, if_block_anchor, anchor);
  15197. current = true;
  15198. },
  15199. p(ctx, dirty) {
  15200. if (/*environment*/ ctx[11].playground !== false) {
  15201. if (if_block) {
  15202. if_block.p(ctx, dirty);
  15203. transition_in(if_block, 1);
  15204. } else {
  15205. if_block = create_if_block_2$5(ctx);
  15206. if_block.c();
  15207. transition_in(if_block, 1);
  15208. if_block.m(if_block_anchor.parentNode, if_block_anchor);
  15209. }
  15210. } else if (if_block) {
  15211. group_outros();
  15212. transition_out(if_block, 1, 1, () => {
  15213. if_block = null;
  15214. });
  15215. check_outros();
  15216. }
  15217. },
  15218. i(local) {
  15219. if (current) return;
  15220. transition_in(if_block);
  15221. current = true;
  15222. },
  15223. o(local) {
  15224. transition_out(if_block);
  15225. current = false;
  15226. },
  15227. d(detaching) {
  15228. if (if_block) if_block.d(detaching);
  15229. if (detaching) detach(if_block_anchor);
  15230. }
  15231. };
  15232. }
  15233. // (547:10) {#if environment.playground !== false}
  15234. function create_if_block_2$5(ctx) {
  15235. let current;
  15236. const playgroundpanel = new PlaygroundPanel({
  15237. props: {
  15238. currentAction: /*currentAction*/ ctx[10],
  15239. environments: /*config*/ ctx[4].playground.environments,
  15240. currentSample: sample(/*currentAction*/ ctx[10]),
  15241. requestHeaders: headersMap(/*currentAction*/ ctx[10]),
  15242. requestParameters: parametersMap(/*currentAction*/ ctx[10]),
  15243. requestBody: bodyMap(/*currentAction*/ ctx[10]),
  15244. isDarkmode: /*darkMode*/ ctx[9].active
  15245. }
  15246. });
  15247. return {
  15248. c() {
  15249. create_component(playgroundpanel.$$.fragment);
  15250. },
  15251. m(target, anchor) {
  15252. mount_component(playgroundpanel, target, anchor);
  15253. current = true;
  15254. },
  15255. p(ctx, dirty) {
  15256. const playgroundpanel_changes = {};
  15257. if (dirty & /*currentAction*/ 1024) playgroundpanel_changes.currentAction = /*currentAction*/ ctx[10];
  15258. if (dirty & /*config*/ 16) playgroundpanel_changes.environments = /*config*/ ctx[4].playground.environments;
  15259. if (dirty & /*currentAction*/ 1024) playgroundpanel_changes.currentSample = sample(/*currentAction*/ ctx[10]);
  15260. if (dirty & /*currentAction*/ 1024) playgroundpanel_changes.requestHeaders = headersMap(/*currentAction*/ ctx[10]);
  15261. if (dirty & /*currentAction*/ 1024) playgroundpanel_changes.requestParameters = parametersMap(/*currentAction*/ ctx[10]);
  15262. if (dirty & /*currentAction*/ 1024) playgroundpanel_changes.requestBody = bodyMap(/*currentAction*/ ctx[10]);
  15263. if (dirty & /*darkMode*/ 512) playgroundpanel_changes.isDarkmode = /*darkMode*/ ctx[9].active;
  15264. playgroundpanel.$set(playgroundpanel_changes);
  15265. },
  15266. i(local) {
  15267. if (current) return;
  15268. transition_in(playgroundpanel.$$.fragment, local);
  15269. current = true;
  15270. },
  15271. o(local) {
  15272. transition_out(playgroundpanel.$$.fragment, local);
  15273. current = false;
  15274. },
  15275. d(detaching) {
  15276. destroy_component(playgroundpanel, detaching);
  15277. }
  15278. };
  15279. }
  15280. // (561:8) {#each currentAction.transactions as { request, response }
  15281. function create_each_block$6(ctx) {
  15282. let current;
  15283. const scenariopanel = new ScenarioPanel({
  15284. props: {
  15285. show: /*index*/ ctx[12] === 0,
  15286. isDarkmode: /*darkMode*/ ctx[9].active,
  15287. request: /*request*/ ctx[22],
  15288. response: /*response*/ ctx[23],
  15289. index: /*index*/ ctx[12],
  15290. count: /*currentAction*/ ctx[10].transactions.length
  15291. }
  15292. });
  15293. return {
  15294. c() {
  15295. create_component(scenariopanel.$$.fragment);
  15296. },
  15297. m(target, anchor) {
  15298. mount_component(scenariopanel, target, anchor);
  15299. current = true;
  15300. },
  15301. p(ctx, dirty) {
  15302. const scenariopanel_changes = {};
  15303. if (dirty & /*darkMode*/ 512) scenariopanel_changes.isDarkmode = /*darkMode*/ ctx[9].active;
  15304. if (dirty & /*currentAction*/ 1024) scenariopanel_changes.request = /*request*/ ctx[22];
  15305. if (dirty & /*currentAction*/ 1024) scenariopanel_changes.response = /*response*/ ctx[23];
  15306. if (dirty & /*currentAction*/ 1024) scenariopanel_changes.count = /*currentAction*/ ctx[10].transactions.length;
  15307. scenariopanel.$set(scenariopanel_changes);
  15308. },
  15309. i(local) {
  15310. if (current) return;
  15311. transition_in(scenariopanel.$$.fragment, local);
  15312. current = true;
  15313. },
  15314. o(local) {
  15315. transition_out(scenariopanel.$$.fragment, local);
  15316. current = false;
  15317. },
  15318. d(detaching) {
  15319. destroy_component(scenariopanel, detaching);
  15320. }
  15321. };
  15322. }
  15323. function create_fragment$i(ctx) {
  15324. let div8;
  15325. let nav;
  15326. let div0;
  15327. let a0;
  15328. let span0;
  15329. let t0;
  15330. let span1;
  15331. let t1;
  15332. let t2;
  15333. let a1;
  15334. let t5;
  15335. let div2;
  15336. let div1;
  15337. let t6;
  15338. let t7;
  15339. let div6;
  15340. let div4;
  15341. let t8;
  15342. let div3;
  15343. let t9;
  15344. let t10;
  15345. let div5;
  15346. let t11;
  15347. let t12;
  15348. let footer;
  15349. let div7;
  15350. let p;
  15351. let strong0;
  15352. let t13;
  15353. let t14;
  15354. let a2;
  15355. let current;
  15356. let dispose;
  15357. let if_block0 = /*config*/ ctx[4].playground.enabled && create_if_block_8$1(ctx);
  15358. let if_block1 = /*darkMode*/ ctx[9].enable && create_if_block_7$1(ctx);
  15359. const menupanel = new MenuPanel({
  15360. props: {
  15361. tagActions: /*tagActions*/ ctx[3],
  15362. tagHeaders: toc(/*description*/ ctx[1]),
  15363. currentSlug: /*currentAction*/ ctx[10] && /*currentAction*/ ctx[10].slug,
  15364. actionsCount: /*actions*/ ctx[2].length,
  15365. isCollapsed: /*collapsed*/ ctx[6],
  15366. isDarkmode: /*darkMode*/ ctx[9].active,
  15367. query: /*query*/ ctx[8],
  15368. config: /*config*/ ctx[4],
  15369. handleClick: /*handleClick*/ ctx[13],
  15370. handleGroupClick: /*handleGroupClick*/ ctx[14],
  15371. tocClick: /*tocClick*/ ctx[15],
  15372. searchClick: /*searchClick*/ ctx[18]
  15373. }
  15374. });
  15375. let if_block2 = /*collapsed*/ ctx[6] && create_if_block_6$1(ctx);
  15376. let if_block3 = !/*collapsed*/ ctx[6] && create_if_block_5$1(ctx);
  15377. let if_block4 = /*index*/ ctx[12] === -1 && create_if_block_4$1(ctx);
  15378. let if_block5 = /*currentAction*/ ctx[10] && create_if_block$c(ctx);
  15379. return {
  15380. c() {
  15381. div8 = element("div");
  15382. nav = element("nav");
  15383. div0 = element("div");
  15384. a0 = element("a");
  15385. span0 = element("span");
  15386. span0.innerHTML = `<i class="fas fa-lg fa-chalkboard"></i>`;
  15387. t0 = space();
  15388. span1 = element("span");
  15389. t1 = text(/*title*/ ctx[0]);
  15390. t2 = space();
  15391. a1 = element("a");
  15392. a1.innerHTML = `<span aria-hidden="true"></span>
  15393. <span aria-hidden="true"></span>
  15394. <span aria-hidden="true"></span>`;
  15395. t5 = space();
  15396. div2 = element("div");
  15397. div1 = element("div");
  15398. if (if_block0) if_block0.c();
  15399. t6 = space();
  15400. if (if_block1) if_block1.c();
  15401. t7 = space();
  15402. div6 = element("div");
  15403. div4 = element("div");
  15404. create_component(menupanel.$$.fragment);
  15405. t8 = space();
  15406. div3 = element("div");
  15407. if (if_block2) if_block2.c();
  15408. t9 = space();
  15409. if (if_block3) if_block3.c();
  15410. t10 = space();
  15411. div5 = element("div");
  15412. if (if_block4) if_block4.c();
  15413. t11 = space();
  15414. if (if_block5) if_block5.c();
  15415. t12 = space();
  15416. footer = element("footer");
  15417. div7 = element("div");
  15418. p = element("p");
  15419. strong0 = element("strong");
  15420. t13 = text(/*title*/ ctx[0]);
  15421. t14 = text("\n powered by\n ");
  15422. a2 = element("a");
  15423. a2.innerHTML = `<strong>Snowboard.</strong>`;
  15424. attr(span0, "class", "icon icon-brand is-medium has-text-grey-light svelte-1jcck2f");
  15425. attr(span1, "class", "title is-4");
  15426. attr(a0, "href", "javascript:void(0)");
  15427. attr(a0, "class", "navbar-item");
  15428. attr(a1, "href", "javascript:void(0)");
  15429. attr(a1, "role", "button");
  15430. attr(a1, "class", "navbar-burger");
  15431. attr(a1, "aria-label", "menu");
  15432. attr(a1, "aria-expanded", "false");
  15433. attr(a1, "data-target", "mainnav");
  15434. attr(div0, "class", "navbar-brand");
  15435. attr(div1, "class", "navbar-end");
  15436. attr(div2, "class", "navbar-menu");
  15437. attr(nav, "class", "navbar is-fixed-top has-shadow");
  15438. attr(nav, "role", "navigation");
  15439. attr(nav, "aria-label", "main navigation");
  15440. attr(div3, "class", "menu-collapsible svelte-1jcck2f");
  15441. toggle_class(div3, "is-darkmode", /*darkMode*/ ctx[9].active);
  15442. attr(div4, "class", "column is-one-quarter sidenav svelte-1jcck2f");
  15443. attr(div4, "id", "mainnav");
  15444. toggle_class(div4, "is-hidden-mobile", /*showMenu*/ ctx[5]);
  15445. attr(div5, "class", "column is-three-quarters main svelte-1jcck2f");
  15446. toggle_class(div5, "is-darkmode", /*darkMode*/ ctx[9].active);
  15447. attr(div6, "class", "columns svelte-1jcck2f");
  15448. toggle_class(div6, "is-collapsed", /*collapsed*/ ctx[6]);
  15449. attr(a2, "href", "https://github.com/bukalapak/snowboard");
  15450. attr(a2, "target", "_blank");
  15451. attr(div7, "class", "content column is-paddingless has-text-centered svelte-1jcck2f");
  15452. toggle_class(div7, "is-offset-one-quarter", !/*collapsed*/ ctx[6]);
  15453. attr(footer, "class", "footer svelte-1jcck2f");
  15454. toggle_class(footer, "is-darkmode", /*darkMode*/ ctx[9].active);
  15455. attr(div8, "class", "body-inner svelte-1jcck2f");
  15456. toggle_class(div8, "is-darkmode", /*darkMode*/ ctx[9].active);
  15457. dispose = [
  15458. listen(a1, "click", /*burgerClick*/ ctx[16]),
  15459. listen(div3, "click", /*collapseToggle*/ ctx[17])
  15460. ];
  15461. },
  15462. m(target, anchor) {
  15463. insert(target, div8, anchor);
  15464. append(div8, nav);
  15465. append(nav, div0);
  15466. append(div0, a0);
  15467. append(a0, span0);
  15468. append(a0, t0);
  15469. append(a0, span1);
  15470. append(span1, t1);
  15471. append(div0, t2);
  15472. append(div0, a1);
  15473. append(nav, t5);
  15474. append(nav, div2);
  15475. append(div2, div1);
  15476. if (if_block0) if_block0.m(div1, null);
  15477. append(div1, t6);
  15478. if (if_block1) if_block1.m(div1, null);
  15479. append(div8, t7);
  15480. append(div8, div6);
  15481. append(div6, div4);
  15482. mount_component(menupanel, div4, null);
  15483. append(div4, t8);
  15484. append(div4, div3);
  15485. if (if_block2) if_block2.m(div3, null);
  15486. append(div3, t9);
  15487. if (if_block3) if_block3.m(div3, null);
  15488. append(div6, t10);
  15489. append(div6, div5);
  15490. if (if_block4) if_block4.m(div5, null);
  15491. append(div5, t11);
  15492. if (if_block5) if_block5.m(div5, null);
  15493. append(div8, t12);
  15494. append(div8, footer);
  15495. append(footer, div7);
  15496. append(div7, p);
  15497. append(p, strong0);
  15498. append(strong0, t13);
  15499. append(p, t14);
  15500. append(p, a2);
  15501. current = true;
  15502. },
  15503. p(ctx, [dirty]) {
  15504. if (!current || dirty & /*title*/ 1) set_data(t1, /*title*/ ctx[0]);
  15505. if (/*config*/ ctx[4].playground.enabled) {
  15506. if (if_block0) {
  15507. if_block0.p(ctx, dirty);
  15508. transition_in(if_block0, 1);
  15509. } else {
  15510. if_block0 = create_if_block_8$1(ctx);
  15511. if_block0.c();
  15512. transition_in(if_block0, 1);
  15513. if_block0.m(div1, t6);
  15514. }
  15515. } else if (if_block0) {
  15516. group_outros();
  15517. transition_out(if_block0, 1, 1, () => {
  15518. if_block0 = null;
  15519. });
  15520. check_outros();
  15521. }
  15522. if (/*darkMode*/ ctx[9].enable) {
  15523. if (if_block1) {
  15524. if_block1.p(ctx, dirty);
  15525. } else {
  15526. if_block1 = create_if_block_7$1(ctx);
  15527. if_block1.c();
  15528. if_block1.m(div1, null);
  15529. }
  15530. } else if (if_block1) {
  15531. if_block1.d(1);
  15532. if_block1 = null;
  15533. }
  15534. const menupanel_changes = {};
  15535. if (dirty & /*tagActions*/ 8) menupanel_changes.tagActions = /*tagActions*/ ctx[3];
  15536. if (dirty & /*description*/ 2) menupanel_changes.tagHeaders = toc(/*description*/ ctx[1]);
  15537. if (dirty & /*currentAction*/ 1024) menupanel_changes.currentSlug = /*currentAction*/ ctx[10] && /*currentAction*/ ctx[10].slug;
  15538. if (dirty & /*actions*/ 4) menupanel_changes.actionsCount = /*actions*/ ctx[2].length;
  15539. if (dirty & /*collapsed*/ 64) menupanel_changes.isCollapsed = /*collapsed*/ ctx[6];
  15540. if (dirty & /*darkMode*/ 512) menupanel_changes.isDarkmode = /*darkMode*/ ctx[9].active;
  15541. if (dirty & /*query*/ 256) menupanel_changes.query = /*query*/ ctx[8];
  15542. if (dirty & /*config*/ 16) menupanel_changes.config = /*config*/ ctx[4];
  15543. menupanel.$set(menupanel_changes);
  15544. if (/*collapsed*/ ctx[6]) {
  15545. if (!if_block2) {
  15546. if_block2 = create_if_block_6$1(ctx);
  15547. if_block2.c();
  15548. if_block2.m(div3, t9);
  15549. } else {
  15550. }
  15551. } else if (if_block2) {
  15552. if_block2.d(1);
  15553. if_block2 = null;
  15554. }
  15555. if (!/*collapsed*/ ctx[6]) {
  15556. if (!if_block3) {
  15557. if_block3 = create_if_block_5$1(ctx);
  15558. if_block3.c();
  15559. if_block3.m(div3, null);
  15560. } else {
  15561. }
  15562. } else if (if_block3) {
  15563. if_block3.d(1);
  15564. if_block3 = null;
  15565. }
  15566. if (dirty & /*darkMode*/ 512) {
  15567. toggle_class(div3, "is-darkmode", /*darkMode*/ ctx[9].active);
  15568. }
  15569. if (dirty & /*showMenu*/ 32) {
  15570. toggle_class(div4, "is-hidden-mobile", /*showMenu*/ ctx[5]);
  15571. }
  15572. if (/*index*/ ctx[12] === -1) {
  15573. if (if_block4) {
  15574. if_block4.p(ctx, dirty);
  15575. } else {
  15576. if_block4 = create_if_block_4$1(ctx);
  15577. if_block4.c();
  15578. if_block4.m(div5, t11);
  15579. }
  15580. } else if (if_block4) {
  15581. if_block4.d(1);
  15582. if_block4 = null;
  15583. }
  15584. if (/*currentAction*/ ctx[10]) {
  15585. if (if_block5) {
  15586. if_block5.p(ctx, dirty);
  15587. transition_in(if_block5, 1);
  15588. } else {
  15589. if_block5 = create_if_block$c(ctx);
  15590. if_block5.c();
  15591. transition_in(if_block5, 1);
  15592. if_block5.m(div5, null);
  15593. }
  15594. } else if (if_block5) {
  15595. group_outros();
  15596. transition_out(if_block5, 1, 1, () => {
  15597. if_block5 = null;
  15598. });
  15599. check_outros();
  15600. }
  15601. if (dirty & /*darkMode*/ 512) {
  15602. toggle_class(div5, "is-darkmode", /*darkMode*/ ctx[9].active);
  15603. }
  15604. if (dirty & /*collapsed*/ 64) {
  15605. toggle_class(div6, "is-collapsed", /*collapsed*/ ctx[6]);
  15606. }
  15607. if (!current || dirty & /*title*/ 1) set_data(t13, /*title*/ ctx[0]);
  15608. if (dirty & /*collapsed*/ 64) {
  15609. toggle_class(div7, "is-offset-one-quarter", !/*collapsed*/ ctx[6]);
  15610. }
  15611. if (dirty & /*darkMode*/ 512) {
  15612. toggle_class(footer, "is-darkmode", /*darkMode*/ ctx[9].active);
  15613. }
  15614. if (dirty & /*darkMode*/ 512) {
  15615. toggle_class(div8, "is-darkmode", /*darkMode*/ ctx[9].active);
  15616. }
  15617. },
  15618. i(local) {
  15619. if (current) return;
  15620. transition_in(if_block0);
  15621. transition_in(menupanel.$$.fragment, local);
  15622. transition_in(if_block5);
  15623. current = true;
  15624. },
  15625. o(local) {
  15626. transition_out(if_block0);
  15627. transition_out(menupanel.$$.fragment, local);
  15628. transition_out(if_block5);
  15629. current = false;
  15630. },
  15631. d(detaching) {
  15632. if (detaching) detach(div8);
  15633. if (if_block0) if_block0.d();
  15634. if (if_block1) if_block1.d();
  15635. destroy_component(menupanel);
  15636. if (if_block2) if_block2.d();
  15637. if (if_block3) if_block3.d();
  15638. if (if_block4) if_block4.d();
  15639. if (if_block5) if_block5.d();
  15640. run_all(dispose);
  15641. }
  15642. };
  15643. }
  15644. function sample(action) {
  15645. return action.transactions[0].request;
  15646. }
  15647. function headersMap(action) {
  15648. return sample(action).headers.filter(header => header.name != "Authorization").map(header => {
  15649. return {
  15650. used: true,
  15651. required: false,
  15652. name: header.name,
  15653. value: header.example || ""
  15654. };
  15655. });
  15656. }
  15657. function parametersMap(action) {
  15658. return action.parameters.map(param => {
  15659. return {
  15660. used: param.required,
  15661. required: param.required,
  15662. name: param.name,
  15663. value: param.example || ""
  15664. };
  15665. });
  15666. }
  15667. function bodyMap(action) {
  15668. const example = sample(action).example;
  15669. return stringify$2(example);
  15670. }
  15671. function instance$i($$self, $$props, $$invalidate) {
  15672. let $env;
  15673. component_subscribe($$self, env, $$value => $$invalidate(20, $env = $$value));
  15674. let { title } = $$props;
  15675. let { description } = $$props;
  15676. let { actions } = $$props;
  15677. let { tagActions } = $$props;
  15678. let { config } = $$props;
  15679. let index = -1;
  15680. function handleClick(event) {
  15681. let target = event.target;
  15682. if (target.nodeName == "SPAN") {
  15683. target = target.parentElement;
  15684. }
  15685. const slug = target.dataset["slug"];
  15686. $$invalidate(12, index = actions.findIndex(el => el.slug === slug));
  15687. document.body.scrollTop = document.documentElement.scrollTop = 0;
  15688. }
  15689. function handleGroupClick(event) {
  15690. const groupSlug = event.target.dataset["slug"];
  15691. const firstAction = firstGroupAction(groupSlug);
  15692. if (firstAction) {
  15693. const slug = firstAction.slug;
  15694. $$invalidate(12, index = actions.findIndex(el => el.slug === slug));
  15695. $$invalidate(8, query = `g:${groupSlug}`);
  15696. document.body.scrollTop = document.documentElement.scrollTop = 0;
  15697. }
  15698. }
  15699. function firstGroupAction(groupSlug) {
  15700. let matches = [];
  15701. tagActions.forEach(tag => {
  15702. matches = matches.concat(tag.children.filter(child => slugify(child.title) === groupSlug));
  15703. });
  15704. if (matches.length > 0) {
  15705. return matches[0].actions[0];
  15706. }
  15707. }
  15708. function tocClick(event) {
  15709. $$invalidate(12, index = -1);
  15710. let href = event.target.getAttribute("href");
  15711. pushHistory(href);
  15712. }
  15713. if (config.playground.enabled) {
  15714. const savedEnv = getEnv();
  15715. if (savedEnv && Object.keys(config.playground.environments).includes(savedEnv)) {
  15716. env.set(savedEnv);
  15717. } else {
  15718. env.set(config.playground.env);
  15719. }
  15720. const authToken = getToken($env);
  15721. if (authToken) {
  15722. auth.add($env);
  15723. token.set(authToken);
  15724. }
  15725. }
  15726. let showMenu = true;
  15727. let collapsed = false;
  15728. let authenticating = false;
  15729. let query = "";
  15730. function burgerClick() {
  15731. $$invalidate(5, showMenu = !showMenu);
  15732. }
  15733. function collapseToggle() {
  15734. $$invalidate(6, collapsed = !collapsed);
  15735. }
  15736. function searchClick() {
  15737. collapseToggle();
  15738. const searchInput = document.getElementById("search-input-text");
  15739. if (searchInput) {
  15740. searchInput.focus();
  15741. }
  15742. }
  15743. const darkMode = {
  15744. enable: true,
  15745. store: window.localStorage,
  15746. toggle: "darkmode-toggle",
  15747. mode: ["light", "dark"],
  15748. active: false
  15749. };
  15750. function darkToggle() {
  15751. $$invalidate(9, darkMode.active = !darkMode.active, darkMode);
  15752. document.getElementById(`bulma-theme-${darkMode.mode[Number(!darkMode.active)]}`).media = "none";
  15753. document.getElementById(`bulma-theme-${darkMode.mode[Number(darkMode.active)]}`).media = "";
  15754. darkMode.store.setItem(darkMode.toggle, darkMode.mode[Number(darkMode.active)]);
  15755. }
  15756. if (darkMode.store.getItem(darkMode.toggle) === darkMode.mode[1]) {
  15757. darkToggle();
  15758. }
  15759. onMount(async () => {
  15760. if (isAuth(environment, "oauth2")) {
  15761. const authParam = querystringify_1.parse(location.search);
  15762. if (authParam.code) {
  15763. $$invalidate(7, authenticating = true);
  15764. pushHistory(basePath(config));
  15765. const { accessToken, refreshToken } = await exchangeToken(authParam.code, environment.auth.options);
  15766. if (accessToken) {
  15767. setToken($env, accessToken);
  15768. auth.add($env);
  15769. token.set(accessToken);
  15770. if (refreshToken) {
  15771. setRefreshToken($env, refreshToken);
  15772. }
  15773. }
  15774. $$invalidate(7, authenticating = false);
  15775. }
  15776. }
  15777. const hash = location.hash;
  15778. if (hash.match("#/")) {
  15779. let slug = hash.replace("#/", "");
  15780. if (slug.startsWith("g~")) {
  15781. const groupSlug = slug.substr(2);
  15782. const firstAction = firstGroupAction(groupSlug);
  15783. if (firstAction) {
  15784. slug = firstAction.slug;
  15785. $$invalidate(8, query = `g:${groupSlug}`);
  15786. }
  15787. }
  15788. $$invalidate(12, index = actions.findIndex(el => el.slug === slug));
  15789. }
  15790. });
  15791. document.onkeyup = function (e) {
  15792. if ((e.which || e.keyCode) == 219) {
  15793. collapseToggle();
  15794. }
  15795. };
  15796. $$self.$set = $$props => {
  15797. if ("title" in $$props) $$invalidate(0, title = $$props.title);
  15798. if ("description" in $$props) $$invalidate(1, description = $$props.description);
  15799. if ("actions" in $$props) $$invalidate(2, actions = $$props.actions);
  15800. if ("tagActions" in $$props) $$invalidate(3, tagActions = $$props.tagActions);
  15801. if ("config" in $$props) $$invalidate(4, config = $$props.config);
  15802. };
  15803. let currentAction;
  15804. let environment;
  15805. $$self.$$.update = () => {
  15806. if ($$self.$$.dirty & /*actions, index*/ 4100) {
  15807. $$invalidate(10, currentAction = actions[index]);
  15808. }
  15809. if ($$self.$$.dirty & /*currentAction, title*/ 1025) {
  15810. {
  15811. document.title = currentAction && `${currentAction.title} - ${title}` || title;
  15812. }
  15813. }
  15814. if ($$self.$$.dirty & /*config, $env*/ 1048592) {
  15815. $$invalidate(11, environment = config.playground.enabled && config.playground.environments[$env]);
  15816. }
  15817. };
  15818. return [
  15819. title,
  15820. description,
  15821. actions,
  15822. tagActions,
  15823. config,
  15824. showMenu,
  15825. collapsed,
  15826. authenticating,
  15827. query,
  15828. darkMode,
  15829. currentAction,
  15830. environment,
  15831. index,
  15832. handleClick,
  15833. handleGroupClick,
  15834. tocClick,
  15835. burgerClick,
  15836. collapseToggle,
  15837. searchClick,
  15838. darkToggle
  15839. ];
  15840. }
  15841. class Winter extends SvelteComponent {
  15842. constructor(options) {
  15843. super();
  15844. if (!document_1.getElementById("svelte-1jcck2f-style")) add_css$9();
  15845. init(this, options, instance$i, create_fragment$i, safe_not_equal, {
  15846. title: 0,
  15847. description: 1,
  15848. actions: 2,
  15849. tagActions: 3,
  15850. config: 4
  15851. });
  15852. }
  15853. }
  15854. const app = new Winter({
  15855. target: document.body,
  15856. props: {"title":"mailcow API","description":"mailcow is complete e-mailing solution with advanced antispam, antivirus, nice UI and API.\n\nIn order to use this API you have to create a API key and add your IP address to the whitelist of allowed IPs this can be done by logging into the Mailcow UI using your admin account, then go to Configuration > Access > Edit administrator details > API. There you will find a collapsed API menu.\n\n**This documentation is in Work In Progress status. It contains only few endpoints.**","version":"","servers":[{"url":"https://mailcow.host/"}],"tags":[{"title":"Domains","description":"","children":[{"title":"Get domains","description":"","children":[]},{"title":"Create domain","description":"","children":[]},{"title":"Update domain","description":"","children":[]},{"title":"Delete domain","description":"","children":[]}]},{"title":"Domain antispam policies","description":"You can create antispam whitelist and blacklist policies","children":[{"title":"List whitelist domain policy","description":"","children":[]},{"title":"List blacklist domain policy","description":"","children":[]},{"title":"Create domain policy","description":"","children":[]},{"title":"Delete domain policy","description":"","children":[]}]},{"title":"Mailboxes","description":"","children":[{"title":"Get mailboxes","description":"","children":[]},{"title":"Create mailbox","description":"","children":[]},{"title":"Update mailbox","description":"","children":[]},{"title":"Delete mailbox","description":"","children":[]},{"title":"Quarantine Notifications","description":"","children":[]}]},{"title":"Aliases","description":"","children":[{"title":"Get aliases","description":"","children":[]},{"title":"Create alias","description":"","children":[]},{"title":"Update alias","description":"","children":[]},{"title":"Delete alias","description":"","children":[]}]},{"title":"Sync jobs","description":"","children":[{"title":"Get sync jobs","description":"","children":[]},{"title":"Create sync job","description":"","children":[]},{"title":"Update sync job","description":"","children":[]},{"title":"Delete sync job","description":"","children":[]}]},{"title":"Fordwarding Hosts","description":"","children":[{"title":"Get Forwarding Hosts","description":"","children":[]},{"title":"Add Forward Host","description":"","children":[]}]},{"title":"Logs","description":"","children":[{"title":"Get Postfix logs","description":"","children":[]},{"title":"Get Rspamd logs","description":"","children":[]},{"title":"Get Dovecot logs","description":"","children":[]},{"title":"Get ACME logs","description":"","children":[]},{"title":"Get SOGo logs","description":"","children":[]},{"title":"Get Watchdog logs","description":"","children":[]},{"title":"Get Api logs","description":"","children":[]},{"title":"Get Ratelimit logs","description":"","children":[]},{"title":"Get Netfilter logs","description":"","children":[]},{"title":"Get Autodiscover logs","description":"","children":[]}]},{"title":"Queue Manager","description":"","children":[{"title":"Get Queue","description":"","children":[]},{"title":"Flush Queue","description":"","children":[]},{"title":"Delete Queue","description":"","children":[]}]},{"title":"Quarantine","description":"","children":[{"title":"Get mails in Quarantine","description":"","children":[]},{"title":"Delete mails in Quarantine","description":"","children":[]}]},{"title":"Fail2Ban","description":"","children":[{"title":"Get Fail2Ban Config","description":"","children":[]},{"title":"Edit Fail2Ban","description":"","children":[]}]},{"title":"DKIM","description":"","children":[{"title":"Get DKIM Key","description":"","children":[]},{"title":"Generate DKIM Key","description":"","children":[]},{"title":"Duplicate DKIM Key","description":"","children":[]},{"title":"Delete DKIM Key","description":"","children":[]}]},{"title":"Domain admin","description":"","children":[{"title":"Get Domain Admins","description":"","children":[]},{"title":"Create Domain Admin user","description":"","children":[]},{"title":"Delete Domain Admin","description":"","children":[]}]},{"title":"Address Rewriting","description":"","children":[{"title":"Get BCC Map","description":"","children":[]},{"title":"Create BCC Map","description":"","children":[]},{"title":"Delete BCC Map","description":"","children":[]},{"title":"Get Recipient Map","description":"","children":[]},{"title":"Create Recipient Map","description":"","children":[]},{"title":"Delete Recipient Map","description":"","children":[]}]},{"title":"Outgoing TLS Policy Map Overrides","description":"","children":[{"title":"Get TLS Policy Map","description":"","children":[]},{"title":"Create TLS Policy Map","description":"","children":[]},{"title":"Delete TLS Policy Map","description":"","children":[]}]},{"title":"oAuth Clients","description":"","children":[{"title":"Get oAuth Clients","description":"","children":[]},{"title":"Create oAuth Client","description":"","children":[]},{"title":"Delete oAuth Client","description":"","children":[]}]},{"title":"Routing","description":"","children":[{"title":"Get Sender-Dependent Transports","description":"","children":[]},{"title":"Create Sender-Dependent Transports","description":"","children":[]},{"title":"Delete Sender-Dependent Transports","description":"","children":[]},{"title":"Get Transport Maps","description":"","children":[]},{"title":"Create Transport Maps","description":"","children":[]},{"title":"Delete Transport Maps","description":"","children":[]}]},{"title":"Resources","description":"","children":[{"title":"Get Resources","description":"","children":[]},{"title":"Create Resources","description":"","children":[]},{"title":"Delete Resources","description":"","children":[]}]},{"title":"App Passwords","description":"","children":[{"title":"Get App Password","description":"","children":[]},{"title":"Create App Password","description":"","children":[]},{"title":"Delete App Password","description":"","children":[]}]},{"title":"status","description":"","children":[{"title":"Get container status","description":"","children":[]},{"title":"Get vmail status","description":"","children":[]},{"title":"Get solr status","description":"","children":[]}]}],"actions":[{"title":"Get domains","path":"/api/v1/get/domain/{id}","pathTemplate":"/api/v1/get/domain/{id}","slug":"get~api~v1~get~domain~id","method":"get","description":"\nYou can list all domains existing in system.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","mailcow.tld"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"max_new_mailbox_quota\": 10737418240,\n \"def_new_mailbox_quota\": 3221225472,\n \"quota_used_in_domain\": \"0\",\n \"mboxes_in_domain\": 0,\n \"mboxes_left\": 10,\n \"domain_name\": \"domain.tld\",\n \"description\": \"Some description\",\n \"max_num_aliases_for_domain\": 400,\n \"max_num_mboxes_for_domain\": 10,\n \"def_quota_for_mbox\": 3221225472,\n \"max_quota_for_mbox\": 10737418240,\n \"max_quota_for_domain\": 10737418240,\n \"relayhost\": \"0\",\n \"backupmx\": \"&#10008;\",\n \"gal\": \"&#10008;\",\n \"backupmx_int\": 0,\n \"gal_int\": 0,\n \"lang\": \"en\",\n \"rl\": false,\n \"active\": \"&#10004;\",\n \"active_int\": 1,\n \"relay_all_recipients\": \"&#10008;\",\n \"relay_all_recipients_int\": 0,\n \"aliases_in_domain\": 0,\n \"aliases_left\": 400\n },\n {\n \"max_new_mailbox_quota\": 10737418240,\n \"def_new_mailbox_quota\": 3221225472,\n \"quota_used_in_domain\": \"0\",\n \"mboxes_in_domain\": 0,\n \"mboxes_left\": 10,\n \"domain_name\": \"domain2.tld\",\n \"description\": \"domain description\",\n \"max_num_aliases_for_domain\": 400,\n \"max_num_mboxes_for_domain\": 10,\n \"def_quota_for_mbox\": 3221225472,\n \"max_quota_for_mbox\": 10737418240,\n \"max_quota_for_domain\": 10737418240,\n \"relayhost\": \"0\",\n \"backupmx\": \"&#10004;\",\n \"gal\": \"&#10008;\",\n \"backupmx_int\": 1,\n \"gal_int\": 0,\n \"lang\": \"cs\",\n \"rl\": false,\n \"active\": \"&#10004;\",\n \"active_int\": 1,\n \"relay_all_recipients\": \"&#10008;\",\n \"relay_all_recipients_int\": 0,\n \"aliases_in_domain\": 0,\n \"aliases_left\": 400\n }\n]\n","schema":""}}],"tags":["Domains","Get domains"]},{"title":"Create domain","path":"/api/v1/add/domain","pathTemplate":"/api/v1/add/domain","slug":"post~api~v1~add~domain","method":"post","description":"\nYou may create your own domain using this action. It takes a JSON object containing a domain informations.","parameters":[],"transactions":[{"request":{"title":"json","description":"You can also define rate limiting. If `rl_value` is not empty string, them ratelimit object is created and returned in response.","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"domain","description":"Fully qualified domain name","required":false,"members":[],"schema":{"type":"string"}},{"key":"description","description":"Description of domain","required":false,"members":[],"schema":{"type":"string"}},{"key":"aliases","description":"limit count of aliases associated with this domain","required":false,"members":[],"schema":{"type":"number"}},{"key":"mailboxes","description":"limit count of mailboxes associated with this domain","required":false,"members":[],"schema":{"type":"number"}},{"key":"defquota","description":"predefined mailbox quota in `add mailbox` form","required":false,"members":[],"schema":{"type":"number"}},{"key":"maxquota","description":"maximum quota per mailbox","required":false,"members":[],"schema":{"type":"number"}},{"key":"quota","description":"maximum quota for this domain (for all mailboxes in sum)","required":false,"members":[],"schema":{"type":"number"}},{"key":"active","description":"is domain active or not","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"rl_value","description":"rate limit value","required":false,"members":[],"schema":{"type":"number"}},{"key":"rl_frame","required":false,"members":[],"schema":{"type":"enum"}},{"key":"backupmx","description":"relay domain or not","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"relay_all_recipients","description":"if not, them you have to create \"dummy\" mailbox for each address to relay","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"lang","description":"language code","required":false,"members":[],"schema":{"type":"enum"}}]},"example":"{\n \"domain\":\"domain.tld\",\n \"description\":\"some decsription\",\n \"aliases\":\"400\",\n \"mailboxes\":\"10\",\n \"defquota\":\"3072\",\n \"maxquota\":\"10240\",\n \"quota\":\"10240\",\n \"active\":\"1\",\n \"rl_value\":\"10\",\n \"rl_frame\":\"s\",\n \"backupmx\":\"0\",\n \"relay_all_recipients\":\"0\",\n \"lang\":\"cs\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"domain\": {\n \"type\": \"string\"\n },\n \"description\": {\n \"type\": \"string\"\n },\n \"aliases\": {\n \"type\": \"number\"\n },\n \"mailboxes\": {\n \"type\": \"number\"\n },\n \"defquota\": {\n \"type\": \"number\"\n },\n \"maxquota\": {\n \"type\": \"number\"\n },\n \"quota\": {\n \"type\": \"number\"\n },\n \"active\": {\n \"type\": \"boolean\"\n },\n \"rl_value\": {\n \"type\": \"number\"\n },\n \"rl_frame\": {\n \"enum\": [\n \"s\",\n \"m\",\n \"h\"\n ]\n },\n \"backupmx\": {\n \"type\": \"boolean\"\n },\n \"relay_all_recipients\": {\n \"type\": \"boolean\"\n },\n \"lang\": {\n \"enum\": [\n \"sk\",\n \"cs\",\n \"de\",\n \"en\",\n \"es\",\n \"fr\",\n \"lv\",\n \"nl\",\n \"pl\",\n \"pt\",\n \"ru\",\n \"it\",\n \"ca\"\n ]\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":" [\n {\n \"type\": \"success\",\n \"log\": [\n \"ratelimit\",\n \"edit\",\n \"domain\",\n {\n \"rl_value\": \"10\",\n \"rl_frame\": \"s\",\n \"object\": \"domain.tld\"\n }\n ],\n \"msg\": [\n \"rl_saved\",\n \"domain.tld\"\n ]\n },\n {\n \"type\": \"success\",\n \"log\": [\n \"mailbox\",\n \"add\",\n \"domain\",\n {\n \"domain\": \"domain.tld\",\n \"description\": \"some decsription\",\n \"aliases\": \"400\",\n \"mailboxes\": \"10\",\n \"defquota\": \"3072\",\n \"maxquota\": \"10240\",\n \"quota\": \"10240\",\n \"active\": \"1\",\n \"rl_value\": \"10\",\n \"rl_frame\": \"s\",\n \"backupmx\": \"0\",\n \"relay_all_recipients\": \"0\",\n \"lang\":\"cs\"\n },\n null\n ],\n \"msg\": [\n \"domain_added\",\n \"domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Domains","Create domain"]},{"title":"Update domain","path":"/api/v1/edit/domain","pathTemplate":"/api/v1/edit/domain","slug":"post~api~v1~edit~domain","method":"post","description":"\nYou can update one or more domains per request. You can also send just attributes you want to change. \nExample: You can add domain names to items list and in attr object just include `\"active\": \"0\"` to deactivate domains.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["domain_name"],"description":"contains list of domain names you want update","required":false,"members":[],"schema":{"type":"array"}},{"key":"attr","value":{},"required":false,"members":[],"schema":{"type":"object"}}]},"example":"{\n \"items\":[\n \"domain.tld\"\n ],\n \"attr\":{\n \"description\":\"domain description\",\n \"aliases\":\"400\",\n \"mailboxes\":\"10\",\n \"defquota\":\"3072\",\n \"maxquota\":\"10240\",\n \"quota\":\"10240\",\n \"active\":\"1\",\n \"gal\":\"1\",\n \"relayhost\":\"2\",\n \"backupmx\":\"1\",\n \"relay_all_recipients\":\"0\",\n \"lang\":\"cs\"\n }\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n },\n \"attr\": {\n \"type\": \"object\",\n \"properties\": {\n \"description\": {\n \"type\": \"string\"\n },\n \"aliases\": {\n \"type\": \"number\"\n },\n \"mailboxes\": {\n \"type\": \"number\"\n },\n \"defquota\": {\n \"type\": \"number\"\n },\n \"maxquota\": {\n \"type\": \"number\"\n },\n \"quota\": {\n \"type\": \"number\"\n },\n \"active\": {\n \"type\": \"boolean\"\n },\n \"gal\": {\n \"type\": \"boolean\"\n },\n \"relayhost\": {\n \"type\": \"number\"\n },\n \"backupmx\": {\n \"type\": \"boolean\"\n },\n \"relay_all_recipients\": {\n \"type\": \"boolean\"\n },\n \"lang\": {\n \"enum\": [\n \"sk\",\n \"cs\",\n \"de\",\n \"en\",\n \"es\",\n \"fr\",\n \"lv\",\n \"nl\",\n \"pl\",\n \"pt\",\n \"ru\",\n \"it\",\n \"ca\"\n ]\n }\n }\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"edit\",\n \"domain\",\n {\n \"domain\":[\n \"domain.tld\"\n ],\n \"description\":\"domain description\",\n \"aliases\":\"400\",\n \"mailboxes\":\"10\",\n \"defquota\":\"3072\",\n \"maxquota\":\"10240\",\n \"quota\":\"10240\",\n \"active\":\"1\",\n \"gal\":\"1\",\n \"relayhost\":\"2\",\n \"backupmx\":\"1\",\n \"relay_all_recipients\":\"0\",\n \"lang:\"cs\"\n },\n null\n ],\n \"msg\":[\n \"domain_modified\",\n \"domain.tld\"\n ]\n }\n] \n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Domains","Update domain"]},{"title":"Delete domain","path":"/api/v1/delete/domain","pathTemplate":"/api/v1/delete/domain","slug":"post~api~v1~delete~domain","method":"post","description":"\nYou can delete one or more domains.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["domain_name"],"description":"contains list of domains you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n \"domain.tld\",\n \"domain2.tld\"\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"delete\",\n \"domain\",\n {\n \"domain\":[\n \"domain.tld\",\n \"domain2.tld\"\n ]\n },\n null\n ],\n \"msg\":[\n \"domain_removed\",\n \"domain.tld\"\n ]\n },\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"delete\",\n \"domain\",\n {\n \"domain\":[\n \"domain.tld\",\n \"domain2.tld\"\n ]\n },\n null\n ],\n \"msg\":[\n \"domain_removed\",\n \"domain2.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Domains","Delete domain"]},{"title":"List whitelist domain policy","path":"/api/v1/get/policy_wl_domain/{domain}","pathTemplate":"/api/v1/get/policy_wl_domain/{domain}","slug":"get~api~v1~get~policy~wl~domain~domain","method":"get","description":"\nYou can list all whitelist policies per domain.","parameters":[{"location":"path","name":"domain","description":"name of domain","required":true,"schema":{"type":"string"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"object\": \"domain.tld\",\n \"value\": \"*@gooddomain.tld\",\n \"prefid\": 1\n }\n]\n","schema":""}}],"tags":["Domain antispam policies","List whitelist domain policy"]},{"title":"List blacklist domain policy","path":"/api/v1/get/policy_bl_domain/{domain}","pathTemplate":"/api/v1/get/policy_bl_domain/{domain}","slug":"get~api~v1~get~policy~bl~domain~domain","method":"get","description":"\nYou can list all blacklist policies per domain.","parameters":[{"location":"path","name":"domain","description":"name of domain","required":true,"schema":{"type":"string"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"object\": \"domain.tld\",\n \"value\": \"*@baddomain.tld\",\n \"prefid\": 2\n }\n]\n","schema":""}}],"tags":["Domain antispam policies","List blacklist domain policy"]},{"title":"Create domain policy","path":"/api/v1/add/domain-policy","pathTemplate":"/api/v1/add/domain-policy","slug":"post~api~v1~add~domain-policy","method":"post","description":"\nYou may create your own domain policy using this action. It takes a JSON object containing a domain informations.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"domain","description":"domain name to which policy is associated to","required":false,"members":[],"schema":{"type":"string"}},{"key":"object_list","required":false,"members":[],"schema":{"type":"enum"}},{"key":"object_from","description":"exact address or use wildcard to match whole domain","required":false,"members":[],"schema":{"type":"string"}}]},"example":"{\n \"domain\":\"domain.tld\",\n \"object_list\":\"bl\",\n \"object_from\":\"*@baddomain.tld\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"domain\": {\n \"type\": \"string\"\n },\n \"object_list\": {\n \"enum\": [\n \"wl\",\n \"bl\"\n ]\n },\n \"object_from\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"policy\",\n \"add\",\n \"domain\",\n {\n \"domain\":\"domain.tld\",\n \"object_list\":\"bl\",\n \"object_from\":\"*@baddomain.tld\"\n }\n ],\n \"msg\":[\n \"domain_modified\",\n \"domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Domain antispam policies","Create domain policy"]},{"title":"Delete domain policy","path":"/api/v1/delete/domain-policy","pathTemplate":"/api/v1/delete/domain-policy","slug":"post~api~v1~delete~domain-policy","method":"post","description":"\nYou can delete one o more domain policies.","parameters":[],"transactions":[{"request":{"title":"json","description":"Delete domain policy by ID","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of domain policys you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n \"1\",\n \"2\"\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":" [\n {\n \"type\":\"success\",\n \"log\":[\n \"policy\",\n \"delete\",\n \"domain\",\n {\n \"prefid\":[\n \"1\",\n \"2\"\n ]\n }\n ],\n \"msg\":[\n \"item_deleted\",\n \"1\"\n ]\n },\n {\n \"type\":\"success\",\n \"log\":[\n \"policy\",\n \"delete\",\n \"domain\",\n {\n \"prefid\":[\n \"1\",\n \"2\"\n ]\n }\n ],\n \"msg\":[\n \"item_deleted\",\n \"2\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Domain antispam policies","Delete domain policy"]},{"title":"Get mailboxes","path":"/api/v1/get/mailbox/{id}","pathTemplate":"/api/v1/get/mailbox/{id}","slug":"get~api~v1~get~mailbox~id","method":"get","description":"\nYou can list all mailboxes existing in system.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","user@domain.tld"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"max_new_quota\":10737418240,\n \"username\":\"info@doman3.tld\",\n \"rl\":false,\n \"is_relayed\":0,\n \"name\":\"Full name\",\n \"active\":\"&#10004;\",\n \"active_int\":1,\n \"domain\":\"doman3.tld\",\n \"local_part\":\"info\",\n \"quota\":3221225472,\n \"attributes\":{\n \"force_pw_update\":\"0\",\n \"tls_enforce_in\":\"0\",\n \"tls_enforce_out\":\"0\",\n \"sogo_access\":\"1\",\n \"mailbox_format\":\"maildir:\",\n \"quarantine_notification\":\"never\"\n },\n \"quota_used\":0,\n \"percent_in_use\":0,\n \"messages\":0,\n \"spam_aliases\":0,\n \"percent_class\":\"success\"\n }\n]\n","schema":""}}],"tags":["Mailboxes","Get mailboxes"]},{"title":"Create mailbox","path":"/api/v1/add/mailbox","pathTemplate":"/api/v1/add/mailbox","slug":"post~api~v1~add~mailbox","method":"post","description":"\nYou may create your own mailbox using this action. It takes a JSON object containing a domain informations.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"local_part","description":"left part of email address","required":false,"members":[],"schema":{"type":"string"}},{"key":"domain","description":"domain name","required":false,"members":[],"schema":{"type":"string"}},{"key":"name","description":"Full name of the mailbox user","required":false,"members":[],"schema":{"type":"string"}},{"key":"quota","description":"mailbox quota","required":false,"members":[],"schema":{"type":"number"}},{"key":"pasword","description":"mailbox password","required":false,"members":[],"schema":{"type":"string"}},{"key":"password2","description":"mailbox password for confirmation","required":false,"members":[],"schema":{"type":"string"}},{"key":"active","description":"is mailbox active or not","required":false,"members":[],"schema":{"type":"boolean"}}]},"example":"{\n \"local_part\":\"info\",\n \"domain\":\"domain.tld\",\n \"name\":\"Full name\",\n \"quota\":\"3072\",\n \"password\":\"atedismonsin\",\n \"password2\":\"atedismonsin\",\n \"active\":\"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"local_part\": {\n \"type\": \"string\"\n },\n \"domain\": {\n \"type\": \"string\"\n },\n \"name\": {\n \"type\": \"string\"\n },\n \"quota\": {\n \"type\": \"number\"\n },\n \"pasword\": {\n \"type\": \"string\"\n },\n \"password2\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"boolean\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"add\",\n \"mailbox\",\n {\n \"local_part\":\"info\",\n \"domain\":\"domain.tld\",\n \"name\":\"Full name\",\n \"quota\":\"3072\",\n \"password\":\"*\",\n \"password2\":\"*\",\n \"active\":\"1\"\n },\n null\n ],\n \"msg\":[\n \"mailbox_added\",\n \"info@domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Mailboxes","Create mailbox"]},{"title":"Update mailbox","path":"/api/v1/edit/mailbox","pathTemplate":"/api/v1/edit/mailbox","slug":"post~api~v1~edit~mailbox","method":"post","description":"\nYou can update one or more mailboxes per request. You can also send just attributes you want to change","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["mailbox_name"],"description":"contains list of mailboxes you want update","required":false,"members":[],"schema":{"type":"array"}},{"key":"attr","value":{"sender_acl":["default","info@domain2.tld","domain3.tld","asterix"]},"required":false,"members":[],"schema":{"type":"object"}}]},"example":"{\n \"items\":[\n \"info@domain.tld\"\n ],\n \"attr\":{\n \"name\":\"Full name\",\n \"quota\":\"3072\",\n \"password\":\"\",\n \"password2\":\"\",\n \"active\":\"1\",\n \"sender_acl\":[\n \"default\",\n \"info@domain2.tld\",\n \"domain3.tld\",\n \"*\"\n ],\n \"force_pw_update\":\"0\",\n \"sogo_access\":\"1\"\n }\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n },\n \"attr\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"quota\": {\n \"type\": \"number\"\n },\n \"pasword\": {\n \"type\": \"string\"\n },\n \"password2\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"boolean\"\n },\n \"sender_acl\": {\n \"type\": \"array\"\n },\n \"force_pw_update\": {\n \"type\": \"boolean\"\n },\n \"sogo_access\": {\n \"type\": \"boolean\"\n }\n }\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"edit\",\n \"mailbox\",\n {\n \"username\":[\n \"info@domain.tld\"\n ],\n \"name\":\"Full name\",\n \"quota\":\"3072\",\n \"password\":\"*\",\n \"password2\":\"*\",\n \"active\":\"1\",\n \"sender_acl\":[\n \"default\",\n \"info@domain2.tld\",\n \"domain3.tld\",\n \"*\"\n ],\n \"force_pw_update\":\"0\",\n \"sogo_access\":\"1\"\n },\n null\n ],\n \"msg\":[\n \"mailbox_modified\",\n \"info@domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Mailboxes","Update mailbox"]},{"title":"Delete mailbox","path":"/api/v1/delete/mailbox","pathTemplate":"/api/v1/delete/mailbox","slug":"post~api~v1~delete~mailbox","method":"post","description":"\nYou can delete one or more mailboxes.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["local_part@domain"],"description":"contains list of mailboxes you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n \"info@domain.tld\",\n \"sales@domain.tld\"\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"delete\",\n \"mailbox\",\n {\n \"username\":[\n \"info@domain.tld\",\n \"sales@domain.tld\"\n ]\n },\n null\n ],\n \"msg\":[\n \"mailbox_removed\",\n \"info@domain.tld\"\n ]\n },\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"delete\",\n \"mailbox\",\n {\n \"username\":[\n \"info@domain.tld\",\n \"sales@domain.tld\"\n ]\n },\n null\n ],\n \"msg\":[\n \"mailbox_removed\",\n \"sales@domain.tld\"\n ]\n }\n] \n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Mailboxes","Delete mailbox"]},{"title":"Quarantine Notifications","path":"/api/v1/edit/quarantine_notification","pathTemplate":"/api/v1/edit/quarantine_notification","slug":"post~api~v1~edit~quarantine~notification","method":"post","description":"\nYou can update one or more mailboxes per request.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["mailbox_name"],"description":"contains list of mailboxes you want set qurantine notifications","required":false,"members":[],"schema":{"type":"array"}},{"key":"attr","value":{},"required":false,"members":[],"schema":{"type":"object"}}]},"example":"{\n \"items\":[\n \"mailbox1@domain.tld\",\n \"mailbox2@domain.tld\"\n ],\n \"attr\":{\n \"quarantine_notification\":\"hourly\"\n }\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n },\n \"attr\": {\n \"type\": \"object\",\n \"properties\": {\n \"quarantine_notification\": {\n \"enum\": [\n \"hourly\",\n \"daily\",\n \"weekly\",\n \"never\"\n ]\n }\n }\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"","schema":""}}],"tags":["Mailboxes","Quarantine Notifications"]},{"title":"Get aliases","path":"/api/v1/get/alias/{id}","pathTemplate":"/api/v1/get/alias/{id}","slug":"get~api~v1~get~alias~id","method":"get","description":"\nYou can list mailbox aliases existing in system.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","1","2","5","10"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"in_primary_domain\": \"\",\n \"id\": 6,\n \"domain\": \"domain.tld\",\n \"public_comment\": null,\n \"private_comment\": null,\n \"goto\": \"destination@domain.tld\",\n \"address\": \"alias@domain.tld\",\n \"is_catch_all\": 0,\n \"active\": \"&#10004;\",\n \"active_int\": 1,\n \"created\": \"2019-04-04 19:29:49\",\n \"modified\": null\n },\n {\n \"in_primary_domain\": \"\",\n \"id\": 10,\n \"domain\": \"domain.tld\",\n \"public_comment\": null,\n \"private_comment\": null,\n \"goto\": \"destination@domain.tld\",\n \"address\": \"@domain.tld\",\n \"is_catch_all\": 1,\n \"active\": \"&#10004;\",\n \"active_int\": 1,\n \"created\": \"2019-04-27 13:42:39\",\n \"modified\": null\n }\n]\n","schema":""}}],"tags":["Aliases","Get aliases"]},{"title":"Create alias","path":"/api/v1/add/alias","pathTemplate":"/api/v1/add/alias","slug":"post~api~v1~add~alias","method":"post","description":"\nYou may create your own mailbox alias using this action. It takes a JSON object containing a domain informations. \nOnly one `goto*` option can be used, for ex. if you want learn as spam, then send just `goto_spam = 1` in request body.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"address","description":"alias address, for catchall use \"@domain.tld\"","required":false,"members":[],"schema":{"type":"string"}},{"key":"goto","description":"destination address, comma separated","required":false,"members":[],"schema":{"type":"string"}},{"key":"goto_null","description":"silently ignore","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"goto_spam","description":"learn as spam","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"goto_ham","description":"learn as ham","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"active","description":"is alias active or not","required":false,"members":[],"schema":{"type":"boolean"}}]},"example":"{\n \"address\":\"alias@domain.tld\",\n \"goto\":\"destination@domain.tld\",\n \"active\":\"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"address\": {\n \"type\": \"string\"\n },\n \"goto\": {\n \"type\": \"string\"\n },\n \"goto_null\": {\n \"type\": \"boolean\"\n },\n \"goto_spam\": {\n \"type\": \"boolean\"\n },\n \"goto_ham\": {\n \"type\": \"boolean\"\n },\n \"active\": {\n \"type\": \"boolean\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"add\",\n \"alias\",\n {\n \"address\":\"alias@domain.tld\",\n \"goto\":\"destination@domain.tld\",\n \"active\":\"1\"\n },\n null\n ],\n \"msg\":[\n \"alias_added\",\n \"alias@domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Aliases","Create alias"]},{"title":"Update alias","path":"/api/v1/edit/alias","pathTemplate":"/api/v1/edit/alias","slug":"post~api~v1~edit~alias","method":"post","description":"\nYou can update one or more aliases per request. You can also send just attributes you want to change","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of aliases you want update","required":false,"members":[],"schema":{"type":"array"}},{"key":"attr","value":{},"required":false,"members":[],"schema":{"type":"object"}}]},"example":"{\n \"items\":[\n \"6\"\n ],\n \"attr\":{\n \"address\":\"alias@domain.tld\",\n \"goto\":\"destination@domain.tld\",\n \"private_comment\":\"private comment\",\n \"public_comment\":\"public comment\",\n \"active\":\"1\"\n }\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n },\n \"attr\": {\n \"type\": \"object\",\n \"properties\": {\n \"address\": {\n \"type\": \"string\"\n },\n \"goto\": {\n \"type\": \"string\"\n },\n \"goto_null\": {\n \"type\": \"boolean\"\n },\n \"goto_spam\": {\n \"type\": \"boolean\"\n },\n \"goto_ham\": {\n \"type\": \"boolean\"\n },\n \"private_comment\": {\n \"type\": \"string\"\n },\n \"public_comment\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"boolean\"\n }\n }\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"edit\",\n \"alias\",\n {\n \"id\":[\n \"6\"\n ],\n \"address\":\"alias@domain.tld\",\n \"goto\":\"destination@domain.tld\",\n \"private_comment\":\"private comment\",\n \"public_comment\":\"public comment\",\n \"active\":\"1\"\n },\n null\n ],\n \"msg\":[\n \"alias_modified\",\n \"alias@domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Aliases","Update alias"]},{"title":"Delete alias","path":"/api/v1/delete/alias","pathTemplate":"/api/v1/delete/alias","slug":"post~api~v1~delete~alias","method":"post","description":"\nYou can delete one or more aliases.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"[\n \"6\",\n \"9\"\n]\n","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"delete\",\n \"alias\",\n {\n \"id\":[\n \"6\",\n \"9\"\n ]\n },\n null\n ],\n \"msg\":[\n \"alias_removed\",\n \"alias@domain.tld\"\n ]\n },\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"delete\",\n \"alias\",\n {\n \"id\":[\n \"6\",\n \"9\"\n ]\n },\n null\n ],\n \"msg\":[\n \"alias_removed\",\n \"alias2@domain.tld\"\n ]\n }\n] \n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Aliases","Delete alias"]},{"title":"Get sync jobs","path":"/api/v1/get/syncjobs/all/no_log","pathTemplate":"/api/v1/get/syncjobs/all/no_log","slug":"get~api~v1~get~syncjobs~all~no~log","method":"get","description":"\nYou can list all syn jobs existing in system.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 1,\n \"user2\": \"mailbox@domain.tld\",\n \"host1\": \"imap.server.tld\",\n \"authmech1\": \"PLAIN\",\n \"regextrans2\": \"\",\n \"authmd51\": 0,\n \"domain2\": \"\",\n \"subfolder2\": \"External\",\n \"user1\": \"username\",\n \"exclude\": \"(?i)spam|(?i)junk\",\n \"maxage\": 0,\n \"mins_interval\": \"20\",\n \"maxbytespersecond\": \"0\",\n \"port1\": 993,\n \"enc1\": \"TLS\",\n \"delete2duplicates\": 1,\n \"delete1\": 0,\n \"delete2\": 0,\n \"automap\": 1,\n \"skipcrossduplicates\": 0,\n \"custom_params\": \"\",\n \"timeout1\": 600,\n \"timeout2\": 600,\n \"subscribeall\": 1,\n \"is_running\": 0,\n \"last_run\": \"2019-05-22 11:40:02\",\n \"created\": \"2019-05-22 11:37:25\",\n \"modified\": \"2019-05-22 11:40:02\",\n \"active\": \"&#10003;\",\n \"active_int\": 1,\n \"log\": \"\"\n }\n]\n","schema":""}}],"tags":["Sync jobs","Get sync jobs"]},{"title":"Create sync job","path":"/api/v1/add/syncjob","pathTemplate":"/api/v1/add/syncjob","slug":"post~api~v1~add~syncjob","method":"post","description":"\nYou can create new sync job using this action. It takes a JSON object containing a domain informations.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"username","description":"The target mailbox","required":false,"members":[],"schema":{"type":"string"}},{"key":"delete2duplicates","description":"Delete duplicates on destination","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"delete1","description":"Delete from source when completed","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"delete2","description":"Delete messages on destination that are not on source","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"automap","description":"Try to automap folders (\"Sent items\", \"Sent\" => \"Sent\" etc.)","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"skipcrossduplicates","description":"Skip duplicate messages across folders (first come, first serve)","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"active","description":"Is sync job active","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"subscribeall","description":"Subscribe all folders","required":false,"members":[],"schema":{"type":"boolean"}},{"key":"host1","description":"Hostname","required":false,"members":[],"schema":{"type":"string"}},{"key":"port1","description":"Port","required":false,"members":[],"schema":{"type":"string"}},{"key":"user1","description":"Username","required":false,"members":[],"schema":{"type":"string"}},{"key":"password1","description":"Password","required":false,"members":[],"schema":{"type":"string"}},{"key":"enc1","description":"Encryption","required":false,"members":[],"schema":{"type":"enum"}},{"key":"mins_interval","description":"Interval (min)","required":false,"members":[],"schema":{"type":"number"}},{"key":"subfolder2","description":"Sync into subfolder on destination (empty = do not use subfolder)","required":false,"members":[],"schema":{"type":"string"}},{"key":"maxage","description":"Maximum age of messages in days that will be polled from remote (0 = ignore age)","required":false,"members":[],"schema":{"type":"number"}},{"key":"maxbytespersecond","description":"Max. bytes per second (0 = unlimited)","required":false,"members":[],"schema":{"type":"number"}},{"key":"timeout1","description":"Timeout for connection to remote host","required":false,"members":[],"schema":{"type":"number"}},{"key":"timeout2","description":"Timeout for connection to local host","required":false,"members":[],"schema":{"type":"number"}},{"key":"exclude","description":"Exclude objects (regex)","required":false,"members":[],"schema":{"type":"string"}},{"key":"custom_params","description":"Custom parameters passed to imapsync command","required":false,"members":[],"schema":{"type":"string"}}]},"example":"{\n \"username\":\"mailbox@domain.tld\",\n \"host1\":\"imap.server.tld\",\n \"port1\":\"993\",\n \"user1\":\"username\",\n \"password1\":\"supersecret\",\n \"enc1\":\"SSL\",\n \"mins_interval\":\"20\",\n \"subfolder2\":\"External\",\n \"maxage\":\"0\",\n \"maxbytespersecond\":\"0\",\n \"timeout1\":\"600\",\n \"timeout2\":\"600\",\n \"exclude\":\"(?i)spam|(?i)junk\",\n \"custom_params\":\"\",\n \"delete2duplicates\":\"1\",\n \"delete1\":\"0\",\n \"delete2\":\"0\",\n \"automap\":\"1\",\n \"skipcrossduplicates\":\"0\",\n \"subscribeall\":\"1\",\n \"active\":\"1\",\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"username\": {\n \"type\": \"string\"\n },\n \"delete2duplicates\": {\n \"type\": \"boolean\"\n },\n \"delete1\": {\n \"type\": \"boolean\"\n },\n \"delete2\": {\n \"type\": \"boolean\"\n },\n \"automap\": {\n \"type\": \"boolean\"\n },\n \"skipcrossduplicates\": {\n \"type\": \"boolean\"\n },\n \"active\": {\n \"type\": \"boolean\"\n },\n \"subscribeall\": {\n \"type\": \"boolean\"\n },\n \"host1\": {\n \"type\": \"string\"\n },\n \"port1\": {\n \"type\": \"string\"\n },\n \"user1\": {\n \"type\": \"string\"\n },\n \"password1\": {\n \"type\": \"string\"\n },\n \"enc1\": {\n \"enum\": [\n \"TLS\",\n \"SSL\",\n \"PLAIN\"\n ]\n },\n \"mins_interval\": {\n \"type\": \"number\"\n },\n \"subfolder2\": {\n \"type\": \"string\"\n },\n \"maxage\": {\n \"type\": \"number\"\n },\n \"maxbytespersecond\": {\n \"type\": \"number\"\n },\n \"timeout1\": {\n \"type\": \"number\"\n },\n \"timeout2\": {\n \"type\": \"number\"\n },\n \"exclude\": {\n \"type\": \"string\"\n },\n \"custom_params\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\":\"success\",\n \"log\":[\n \"mailbox\",\n \"add\",\n \"syncjob\",\n {\n \"username\":\"mailbox@domain.tld\",\n \"host1\":\"imap.server.tld\",\n \"port1\":993,\n \"user1\":\"username\",\n \"password1\":\"supersecret\",\n \"enc1\":\"SSL\",\n \"mins_interval\":\"20\",\n \"subfolder2\":\"External\",\n \"maxage\":\"0\",\n \"maxbytespersecond\":\"0\",\n \"timeout1\":\"600\",\n \"timeout2\":\"600\",\n \"exclude\":\"(?i)spam|(?i)junk\",\n \"custom_params\":\"\",\n \"delete2duplicates\":\"1\",\n \"delete1\":\"0\",\n \"delete2\":\"0\",\n \"automap\":\"1\",\n \"skipcrossduplicates\":\"0\",\n \"subscribeall\":\"1\",\n \"active\":\"1\"\n },\n null\n ],\n \"msg\":[\n \"mailbox_modified\",\n \"mailbox@domain.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Sync jobs","Create sync job"]},{"title":"Update sync job","path":"/api/v1/edit/syncjob","pathTemplate":"/api/v1/edit/syncjob","slug":"post~api~v1~edit~syncjob","method":"post","description":"\nYou can update one or more sync jobs per request. You can also send just attributes you want to change.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of aliases you want update","required":false,"members":[],"schema":{"type":"array"}},{"key":"attr","value":{},"required":false,"members":[],"schema":{"type":"object"}}]},"example":"{\n \"items\":[\n \"1\"\n ],\n \"attr\":{\n \"delete2duplicates\":\"1\",\n \"delete1\":\"0\",\n \"delete2\":\"0\",\n \"automap\":\"1\",\n \"skipcrossduplicates\":\"0\",\n \"active\":\"1\",\n \"subscribeall\":\"1\",\n \"host1\":\"imap.server.tld\",\n \"port1\":\"993\",\n \"user1\":\"username\",\n \"password1\":\"supersecret\",\n \"enc1\":\"SSL\",\n \"mins_interval\":\"20\",\n \"subfolder2\":\"External\",\n \"maxage\":\"0\",\n \"maxbytespersecond\":\"0\",\n \"timeout1\":\"600\",\n \"timeout2\":\"600\",\n \"exclude\":\"(?i)spam|(?i)junk\",\n \"custom_params\":\"\"\n }\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n },\n \"attr\": {\n \"type\": \"object\",\n \"properties\": {\n \"delete2duplicates\": {\n \"type\": \"boolean\"\n },\n \"delete1\": {\n \"type\": \"boolean\"\n },\n \"delete2\": {\n \"type\": \"boolean\"\n },\n \"automap\": {\n \"type\": \"boolean\"\n },\n \"skipcrossduplicates\": {\n \"type\": \"boolean\"\n },\n \"active\": {\n \"type\": \"boolean\"\n },\n \"subscribeall\": {\n \"type\": \"boolean\"\n },\n \"host1\": {\n \"type\": \"string\"\n },\n \"port1\": {\n \"type\": \"string\"\n },\n \"user1\": {\n \"type\": \"string\"\n },\n \"password1\": {\n \"type\": \"string\"\n },\n \"enc1\": {\n \"enum\": [\n \"TLS\",\n \"SSL\",\n \"PLAIN\"\n ]\n },\n \"mins_interval\": {\n \"type\": \"number\"\n },\n \"subfolder2\": {\n \"type\": \"string\"\n },\n \"maxage\": {\n \"type\": \"number\"\n },\n \"maxbytespersecond\": {\n \"type\": \"number\"\n },\n \"timeout1\": {\n \"type\": \"number\"\n },\n \"timeout2\": {\n \"type\": \"number\"\n },\n \"exclude\": {\n \"type\": \"string\"\n },\n \"custom_params\": {\n \"type\": \"string\"\n }\n }\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"{\n \"type\": \"success\",\n \"log\": [\n \"entity\",\n \"action\",\n \"object\",\n {}\n ],\n \"msg\": [\n \"message\",\n \"entity name\"\n ]\n}","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Sync jobs","Update sync job"]},{"title":"Delete sync job","path":"/api/v1/delete/syncjob","pathTemplate":"/api/v1/delete/syncjob","slug":"post~api~v1~delete~syncjob","method":"post","description":"\nYou can delete one or more sync jobs.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of aliases you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n \"6\",\n \"9\"\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"{\n \"type\": \"success\",\n \"log\": [\n \"entity\",\n \"action\",\n \"object\",\n {}\n ],\n \"msg\": [\n \"message\",\n \"entity name\"\n ]\n}","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Sync jobs","Delete sync job"]},{"title":"Get Forwarding Hosts","path":"/api/v1/get/fwdhost/all","pathTemplate":"/api/v1/get/fwdhost/all","slug":"get~api~v1~get~fwdhost~all","method":"get","description":"\nYou can list all Forwarding Hosts in your system.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"host\": \"5.1.76.202\",\n \"source\": \"hosted.mailcow.de\",\n \"keep_spam\": \"yes\"\n },\n {\n \"host\": \"2a00:f820:417::202\",\n \"source\": \"hosted.mailcow.de\",\n \"keep_spam\": \"yes\"\n }\n]\n","schema":""}}],"tags":["Fordwarding Hosts","Get Forwarding Hosts"]},{"title":"Add Forward Host","path":"/api/v1/add/fwdhost","pathTemplate":"/api/v1/add/fwdhost","slug":"post~api~v1~add~fwdhost","method":"post","description":"\nAdd a new Forwarding host to mailcow. You can chose to enable or disable spam filtering of incoming emails by specifing `filter_spam` 0 = inactive, 1 = active.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"hostname","description":"contains the hostname you want to add","required":false,"members":[],"schema":{"type":"string"}},{"key":"filter_spam","description":"1 to enable spam filter, 0 to disable spam filter","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"hostname\": \"hosted.mailcow.de\",\n \"filter_spam\": \"0\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"hostname\": {\n \"type\": \"string\"\n },\n \"filter_spam\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"fwdhost\",\n \"add\",\n {\n \"hostname\": \"hosted.mailcow.de\",\n \"filter_spam\": \"0\"\n }\n ],\n \"msg\": [\n \"forwarding_host_added\",\n \"5.1.76.202, 2a00:f820:417::202\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Fordwarding Hosts","Add Forward Host"]},{"title":"Get Postfix logs","path":"/api/v1/get/logs/postfix/{count}","pathTemplate":"/api/v1/get/logs/postfix/{count}","slug":"get~api~v1~get~logs~postfix~count","method":"get","description":"\nThis Api endpoint lists all Postfix logs. \nTip: You can limit how many logs you want to get by using `/<count>` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": \"1569937433\",\n \"program\": \"postfix/qmgr\",\n \"priority\": \"info\",\n \"message\": \"EF1711500458: removed\"\n }\n]\n","schema":""}}],"tags":["Logs","Get Postfix logs"]},{"title":"Get Rspamd logs","path":"/api/v1/get/logs/rspamd-history/{count}","pathTemplate":"/api/v1/get/logs/rspamd-history/{count}","slug":"get~api~v1~get~logs~rspamd-history~count","method":"get","description":"\nThis Api endpoint lists all Rspamd logs. \nTip: You can limit how many logs you want to get by using `/<count>` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n {\n \"time_virtual\": 0.235653,\n \"rcpt_mime\": [\n \"github@mailcow.tld\"\n ],\n \"message-id\": \"cm.0521259281087.phrkjuk.wdljulyl.i@cmail20.com\",\n \"ip\": \"1.1.1.1\",\n \"rcpt_smtp\": [\n \"github@mailcow.tld\"\n ],\n \"action\": \"soft reject\",\n \"time_real\": 2.856102,\n \"score\": 11.59,\n \"is_skipped\": false,\n \"size\": 35513,\n \"user\": \"unknown\",\n \"sender_mime\": \"noreply@github.com\",\n \"symbols\": {\n \"FROM_NEQ_ENVFROM\": {\n \"metric_score\": 0,\n \"options\": [\n \"noreply@github.com\",\n \"GitHub-phrkjuk1wdljulyl1i@cmail20.com\"\n ],\n \"score\": 0,\n \"name\": \"FROM_NEQ_ENVFROM\",\n \"description\": \"From address is different to the envelope\"\n },\n \"FORGED_SENDER\": {\n \"metric_score\": 0.3,\n \"options\": [\n \"noreply@github.com\",\n \"GitHub-phrkjuk1wdljulyl1i@cmail20.com\"\n ],\n \"score\": 0.3,\n \"name\": \"FORGED_SENDER\",\n \"description\": \"Sender is forged (different From: header and smtp MAIL FROM: addresses)\"\n },\n \"RWL_MAILSPIKE_NEUTRAL\": {\n \"metric_score\": 0,\n \"options\": [\n \"17.21.55.203.rep.mailspike.net : 127.0.0.13\"\n ],\n \"score\": 0,\n \"name\": \"RWL_MAILSPIKE_NEUTRAL\",\n \"description\": \"Neutral result from Mailspike\"\n },\n \"HAS_LIST_UNSUB\": {\n \"metric_score\": -0.01,\n \"score\": -0.01,\n \"name\": \"HAS_LIST_UNSUB\",\n \"description\": \"Has List-Unsubscribe header\"\n },\n \"URI_COUNT_ODD\": {\n \"metric_score\": 1,\n \"options\": [\n \"25\"\n ],\n \"score\": 1,\n \"name\": \"URI_COUNT_ODD\",\n \"description\": \"Odd number of URIs in multipart\\/alternative message\"\n },\n \"MIME_TRACE\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"MIME_TRACE\",\n \"options\": [\n \"0:+\",\n \"1:+\",\n \"2:~\"\n ]\n },\n \"R_DKIM_ALLOW\": {\n \"metric_score\": -0.2,\n \"options\": [\n \"github.com:s=cm\",\n \"cmail2.com:s=cs2013\"\n ],\n \"score\": 0,\n \"name\": \"R_DKIM_ALLOW\",\n \"description\": \"DKIM verification succeed\"\n },\n \"FROM_HAS_DN\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"FROM_HAS_DN\",\n \"description\": \"From header has a display name\"\n },\n \"MIME_GOOD\": {\n \"metric_score\": -0.1,\n \"options\": [\n \"multipart\\/alternative\",\n \"text\\/plain\"\n ],\n \"score\": -0.1,\n \"name\": \"MIME_GOOD\",\n \"description\": \"Known content-type\"\n },\n \"REPLYTO_ADDR_EQ_FROM\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"REPLYTO_ADDR_EQ_FROM\",\n \"description\": \"Reply-To header is identical to SMTP From\"\n },\n \"TO_MATCH_ENVRCPT_ALL\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"TO_MATCH_ENVRCPT_ALL\",\n \"description\": \"All of the recipients match the envelope\"\n },\n \"ASN\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"ASN\",\n \"options\": [\n \"asn:55819, ipnet:203.55.21.0\\/24, country:AU\"\n ]\n },\n \"HTML_SHORT_LINK_IMG_1\": {\n \"metric_score\": 2,\n \"score\": 2,\n \"name\": \"HTML_SHORT_LINK_IMG_1\",\n \"description\": \"Short html part (0..1K) with a link to an image\"\n },\n \"SCHAALIT_URI_823\": {\n \"metric_score\": 5,\n \"score\": 5,\n \"name\": \"SCHAALIT_URI_823\",\n \"options\": [\n \"SCHAALIT_URI_823\"\n ]\n },\n \"DMARC_POLICY_ALLOW\": {\n \"metric_score\": -0.5,\n \"options\": [\n \"github.com\",\n \"none\"\n ],\n \"score\": 0,\n \"name\": \"DMARC_POLICY_ALLOW\",\n \"description\": \"DMARC permit policy\"\n },\n \"MANY_INVISIBLE_PARTS\": {\n \"metric_score\": 1,\n \"options\": [\n \"4\"\n ],\n \"score\": 0.3,\n \"name\": \"MANY_INVISIBLE_PARTS\",\n \"description\": \"Many parts are visually hidden\"\n },\n \"DKIM_TRACE\": {\n \"metric_score\": 0,\n \"options\": [\n \"github.com:+\",\n \"cmail2.com:+\"\n ],\n \"score\": 0,\n \"name\": \"DKIM_TRACE\",\n \"description\": \"DKIM trace symbol\"\n },\n \"MX_GOOD\": {\n \"metric_score\": -0.01,\n \"options\": [\n \"mx20.inbound.createsend.com\",\n \"mx21.inbound.createsend.com\"\n ],\n \"score\": -0.01,\n \"name\": \"MX_GOOD\",\n \"description\": \"MX was ok\"\n },\n \"TO_DN_ALL\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"TO_DN_ALL\",\n \"description\": \"All the recipients have display names\"\n },\n \"RCPT_MAILCOW_DOMAIN\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"RCPT_MAILCOW_DOMAIN\",\n \"options\": [\n \"gc-mc.de\"\n ]\n },\n \"XM_UA_NO_VERSION\": {\n \"metric_score\": 0.01,\n \"score\": 0.01,\n \"name\": \"XM_UA_NO_VERSION\",\n \"description\": \"X-Mailer\\/User-Agent has no version\"\n },\n \"HAS_REPLYTO\": {\n \"metric_score\": 0,\n \"options\": [\n \"noreply@github.com\"\n ],\n \"score\": 0,\n \"name\": \"HAS_REPLYTO\",\n \"description\": \"Has Reply-To header\"\n },\n \"R_SPF_ALLOW\": {\n \"metric_score\": -0.2,\n \"options\": [\n \"+ip4:203.55.21.0\\/24\"\n ],\n \"score\": 0,\n \"name\": \"R_SPF_ALLOW\",\n \"description\": \"SPF verification allows sending\"\n },\n \"URIBL_GREY\": {\n \"metric_score\": 1.5,\n \"options\": [\n \"cmail2.com.multi.uribl.com\",\n \"cmail20.com.multi.uribl.com\",\n \"updatemyprofile.com.multi.uribl.com\"\n ],\n \"score\": 1.5,\n \"name\": \"URIBL_GREY\",\n \"description\": \"uribl.com grey url\"\n },\n \"CLAM_VIRUS_FAIL\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"CLAM_VIRUS_FAIL\",\n \"options\": [\n \"failed to scan and retransmits exceed\"\n ]\n },\n \"GREYLIST\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"GREYLIST\",\n \"options\": [\n \"greylisted\",\n \"Wed, 25 Sep 2019 19:27:10 GMT\",\n \"new record\"\n ]\n },\n \"ARC_NA\": {\n \"metric_score\": 0,\n \"score\": 0,\n \"name\": \"ARC_NA\",\n \"description\": \"ARC signature absent\"\n },\n \"RCVD_COUNT_ZERO\": {\n \"metric_score\": 0,\n \"options\": [\n \"0\"\n ],\n \"score\": 0,\n \"name\": \"RCVD_COUNT_ZERO\",\n \"description\": \"Message has no Received headers\"\n },\n \"BAD_REP_POLICIES\": {\n \"metric_score\": 0.1,\n \"score\": 0.1,\n \"name\": \"BAD_REP_POLICIES\",\n \"description\": \"Contains valid policies but are also marked by fuzzy\\/bayes\\/surbl\\/rbl\"\n },\n \"RCPT_COUNT_ONE\": {\n \"metric_score\": 0,\n \"options\": [\n \"1\"\n ],\n \"score\": 0,\n \"name\": \"RCPT_COUNT_ONE\",\n \"description\": \"One recipient\"\n },\n \"RBL_UCEPROTECT_LEVEL1\": {\n \"metric_score\": 3.5,\n \"score\": 3.5,\n \"name\": \"RBL_UCEPROTECT_LEVEL1\",\n \"options\": [\n \"17.21.55.203.dnsbl-1.uceprotect.net\"\n ]\n },\n \"DWL_DNSWL_HI\": {\n \"metric_score\": -3.5,\n \"options\": [\n \"github.com.dwl.dnswl.org : 127.0.9.3\"\n ],\n \"score\": -3.5,\n \"name\": \"DWL_DNSWL_HI\",\n \"description\": \"Message has a valid dkim signature originated from domain listed at https:\\/\\/www.dnswl.org, high trust\"\n },\n \"RCVD_IN_DNSWL_NONE\": {\n \"metric_score\": 0,\n \"options\": [\n \"17.21.55.203.list.dnswl.org : 127.0.15.0\"\n ],\n \"score\": 0,\n \"name\": \"RCVD_IN_DNSWL_NONE\",\n \"description\": \"Sender listed at https:\\/\\/www.dnswl.org, no trust\"\n },\n \"RBL_UCEPROTECT_LEVEL2\": {\n \"metric_score\": 1.5,\n \"score\": 1.5,\n \"name\": \"RBL_UCEPROTECT_LEVEL2\",\n \"options\": [\n \"17.21.55.203.dnsbl-2.uceprotect.net\"\n ]\n }\n },\n \"subject\": \"[mailcow/mailcow-dockerized] Unable to change name of alias email address (#2997)\",\n \"required_score\": 15,\n \"unix_time\": 1569439327,\n \"sender_smtp\": \"GitHub-phrkjuk1wdljulyl1i@cmail20.com\"\n }\n}\n","schema":""}}],"tags":["Logs","Get Rspamd logs"]},{"title":"Get Dovecot logs","path":"/api/v1/get/logs/dovecot/{count}","pathTemplate":"/api/v1/get/logs/dovecot/{count}","slug":"get~api~v1~get~logs~dovecot~count","method":"get","description":"\nThis Api endpoint lists all Dovecot logs. \nTip: You can limit how many logs you want to get by using `/<count>` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": \"1569938740\",\n \"program\": \"dovecot\",\n \"priority\": \"info\",\n \"message\": \"managesieve-login: Disconnected (no auth attempts in 0 secs): user=<>, rip=172.22.1.3, lip=172.22.1.250\"\n }\n]\n","schema":""}}],"tags":["Logs","Get Dovecot logs"]},{"title":"Get ACME logs","path":"/api/v1/get/logs/acme/{count}","pathTemplate":"/api/v1/get/logs/acme/{count}","slug":"get~api~v1~get~logs~acme~count","method":"get","description":"\nThis Api endpoint lists all ACME logs from issued Lets Enctypts certificates. \nTip: You can limit how many logs you want to get by using `/<count>` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": \"1569927728\",\n \"message\": \"Certificate validation done, neither changed nor due for renewal, sleeping for another day.\"\n }\n]\n","schema":""}}],"tags":["Logs","Get ACME logs"]},{"title":"Get SOGo logs","path":"/api/v1/get/logs/sogo/{count}","pathTemplate":"/api/v1/get/logs/sogo/{count}","slug":"get~api~v1~get~logs~sogo~count","method":"get","description":"\nThis Api endpoint lists all SOGo logs. \nTip: You can limit how many logs you want to get by using `/<count>` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": \"1569938874\",\n \"program\": \"sogod\",\n \"priority\": \"notice\",\n \"message\": \"[109]: mailcowdockerized_watchdog-mailcow_1.mailcowdockerized_mailcow-network \\\"GET \\/SOGo.index\\/ HTTP\\/1.1\\\" 200 2531\\/0 0.005 - - 0\"\n }\n]\n","schema":""}}],"tags":["Logs","Get SOGo logs"]},{"title":"Get Watchdog logs","path":"/api/v1/get/logs/watchdog/{count}","pathTemplate":"/api/v1/get/logs/watchdog/{count}","slug":"get~api~v1~get~logs~watchdog~count","method":"get","description":"\nThis Api endpoint lists all Watchdog logs. \nTip: You can limit how many logs you want to get by using `/<count>` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": \"1569938958\",\n \"service\": \"Fail2ban\",\n \"lvl\": \"100\",\n \"hpnow\": \"1\",\n \"hptotal\": \"1\",\n \"hpdiff\": \"0\"\n },\n {\n \"time\": \"1569938956\",\n \"service\": \"Rspamd\",\n \"lvl\": \"100\",\n \"hpnow\": \"5\",\n \"hptotal\": \"5\",\n \"hpdiff\": \"0\"\n }\n]\n","schema":""}}],"tags":["Logs","Get Watchdog logs"]},{"title":"Get Api logs","path":"/api/v1/get/logs/api/{count}","pathTemplate":"/api/v1/get/logs/api/{count}","slug":"get~api~v1~get~logs~api~count","method":"get","description":"\nThis Api endpoint lists all Api logs. \nTip: You can limit how many logs you want to get by using `/<count>` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": 1569939001,\n \"uri\": \"\\/api\\/v1\\/get\\/logs\\/api\\/2\",\n \"method\": \"GET\",\n \"remote\": \"1.1.1.1\",\n \"data\": \"\"\n }\n]\n","schema":""}}],"tags":["Logs","Get Api logs"]},{"title":"Get Ratelimit logs","path":"/api/v1/get/logs/ratelimited/{count}","pathTemplate":"/api/v1/get/logs/ratelimited/{count}","slug":"get~api~v1~get~logs~ratelimited~count","method":"get","description":"\nThis Api endpoint lists all Ratelimit logs. \nTip: You can limit how many logs you want to get by using `/<count>` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": 1569269003,\n \"rcpt\": \"hello@mailcow.email\",\n \"from\": \"awesome@mailcow.email\",\n \"user\": \"awesome@mailcow.email\",\n \"rl_info\": \"mailcow(RLsdz3tuabozgd4oacbdh8kc78)\",\n \"rl_name\": \"mailcow\",\n \"rl_hash\": \"RLsdz3tuabozgd4oacbdh8kc78\",\n \"qid\": \"E3CF91500458\",\n \"ip\": \"172.22.1.248\",\n \"message_id\": \"6a-5d892500-7-240abd80@90879116\",\n \"header_subject\": \"Mailcow is amazing\",\n \"header_from\": \"\\\"Awesome\\\" <awesome@mailcow.email>\"\n }\n]\n","schema":""}}],"tags":["Logs","Get Ratelimit logs"]},{"title":"Get Netfilter logs","path":"/api/v1/get/logs/netfilter/{count}","pathTemplate":"/api/v1/get/logs/netfilter/{count}","slug":"get~api~v1~get~logs~netfilter~count","method":"get","description":"\nThis Api endpoint lists all Netfilter logs. \nTip: You can limit how many logs you want to get by using `/<count>` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": 1569754911,\n \"priority\": \"info\",\n \"message\": \"Whitelist was changed, it has 1 entries\"\n },\n {\n \"time\": 1569754911,\n \"priority\": \"crit\",\n \"message\": \"Add host\\/network 1.1.1.1\\/32 to blacklist\"\n }\n]\n","schema":""}}],"tags":["Logs","Get Netfilter logs"]},{"title":"Get Autodiscover logs","path":"/api/v1/get/logs/autodiscover/{count}","pathTemplate":"/api/v1/get/logs/autodiscover/{count}","slug":"get~api~v1~get~logs~autodiscover~count","method":"get","description":"\nThis Api endpoint lists all Autodiscover logs. \nTip: You can limit how many logs you want to get by using `/<count>` at the end of the api url.","parameters":[{"location":"path","name":"count","description":"Number of logs to return","required":false,"schema":{"type":"number"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"time\": 1569684212,\n \"ua\": \"Microsoft Office\\/16.0 (Windows NT 6.2; MAPICPL 16.0.11328; Pro)\",\n \"user\": \"awesome@mailcow.de\",\n \"service\": \"activesync\"\n }\n]\n","schema":""}}],"tags":["Logs","Get Autodiscover logs"]},{"title":"Get Queue","path":"/api/v1/get/mailq/all","pathTemplate":"/api/v1/get/mailq/all","slug":"get~api~v1~get~mailq~all","method":"get","description":"\nGet the current mail queue and everything it contains.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"queue_name\": \"incoming\",\n \"queue_id\": \"B98C6260CA1\",\n \"arrival_time\": 1570091234,\n \"message_size\": 1848,\n \"sender\": \"sender@mailcow.tld\",\n \"recipients\": [\n \"recipient@awesomecow.tld\"\n ]\n }\n]\n","schema":""}}],"tags":["Queue Manager","Get Queue"]},{"title":"Flush Queue","path":"/api/v1/edit/mailq","pathTemplate":"/api/v1/edit/mailq","slug":"post~api~v1~edit~mailq","method":"post","description":"\nUsing this API you can flush the current mail queue. This will try to deliver all mails currently in it.\nThis API uses the command: `postqueue -f`","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"action","description":"use flush to flush the mail queue","required":false,"members":[],"schema":{"type":"string"}}]},"example":"{ \n \"action\":\"flush\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"action\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"type\": \"success\",\n \"msg\": \"Task completed\"\n}\n","schema":""}}],"tags":["Queue Manager","Flush Queue"]},{"title":"Delete Queue","path":"/api/v1/delete/mailq","pathTemplate":"/api/v1/delete/mailq","slug":"post~api~v1~delete~mailq","method":"post","description":"\nUsing this API you can delete the current mail queue. This will delete all mails in it.\nThis API uses the command: `postsuper -d`","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"action","description":"use super_delete to delete the mail queue","required":false,"members":[],"schema":{"type":"string"}}]},"example":"{\n \"action\":\"super_delete\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"action\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"type\": \"success\",\n \"msg\": \"Task completed\"\n}\n","schema":""}}],"tags":["Queue Manager","Delete Queue"]},{"title":"Get mails in Quarantine","path":"/api/v1/get/quarantine/all","pathTemplate":"/api/v1/get/quarantine/all","slug":"get~api~v1~get~quarantine~all","method":"get","description":"\nGet all mails that are currently in Quarantine.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"id\": 33,\n \"qid\": \"8224615004C1\",\n \"subject\": \"mailcow is awesome\",\n \"virus_flag\": 0,\n \"score\": 15.48,\n \"rcpt\": \"admin@domain.tld\",\n \"sender\": \"bounces@send.domain.tld\",\n \"created\": 1572688831,\n \"notified\": 1\n}\n","schema":""}}],"tags":["Quarantine","Get mails in Quarantine"]},{"title":"Delete mails in Quarantine","path":"/api/v1/delete/qitem","pathTemplate":"/api/v1/delete/qitem","slug":"post~api~v1~delete~qitem","method":"post","description":"\nUsing this endpoint you can delete a email from quarantine, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of emails you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"33\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"quarantine\",\n \"delete\",\n {\n \"id\": [\n \"33\"\n ]\n }\n ],\n \"msg\": [\n \"item_deleted\",\n \"33\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Quarantine","Delete mails in Quarantine"]},{"title":"Get Fail2Ban Config","path":"/api/v1/get/fail2ban","pathTemplate":"/api/v1/get/fail2ban","slug":"get~api~v1~get~fail2ban","method":"get","description":"\nGets the current Fail2Ban configuration.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"ban_time\": 604800,\n \"netban_ipv4\": 32,\n \"netban_ipv6\": 128,\n \"max_attempts\": 1,\n \"retry_window\": 7200,\n \"whitelist\": \"1.1.1.1\",\n \"blacklist\": \"45.82.153.37\\/32\\n92.118.38.52\\/32\",\n \"perm_bans\": [\n \"45.82.153.37\\/32\",\n \"92.118.38.52\\/32\"\n ]\n}\n","schema":""}}],"tags":["Fail2Ban","Get Fail2Ban Config"]},{"title":"Edit Fail2Ban","path":"/api/v1/edit/fail2ban","pathTemplate":"/api/v1/edit/fail2ban","slug":"post~api~v1~edit~fail2ban","method":"post","description":"\nUsing this endpoint you can edit the Fail2Ban config and black or whitelist new ips.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":[],"description":"has to be none","required":false,"members":[],"schema":{"type":"array"}},{"key":"attr","value":{},"description":"array containing the fail2ban settings","required":false,"members":[],"schema":{"type":"object"}}]},"example":"{ \n \"items\":[\n \"none\"\n ],\n \"attr\": {\n \"ban_time\": \"86400\",\n \"max_attempts\": \"5\",\n \"retry_window\": \"600\",\n \"netban_ipv4\": \"24\",\n \"netban_ipv6\": \"64\",\n \"whitelist\": \"mailcow.tld\",\n \"blacklist\": \"10.100.6.5/32,10.100.8.4/32\"\n }\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n },\n \"attr\": {\n \"type\": \"object\",\n \"properties\": {\n \"ban_time\": {\n \"type\": \"number\"\n },\n \"max_attempts\": {\n \"type\": \"number\"\n },\n \"retry_window\": {\n \"type\": \"number\"\n },\n \"netban_ipv4\": {\n \"type\": \"number\"\n },\n \"netban_ipv6\": {\n \"type\": \"number\"\n },\n \"whitelist\": {\n \"type\": \"string\"\n },\n \"backlist\": {\n \"type\": \"string\"\n }\n }\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n \"type\": \"success\",\n \"log\": [\n \"fail2ban\",\n \"edit\",\n {\n \"network\": [\n \"none\"\n ],\n \"ban_time\": \"86400\",\n \"max_attempts\": \"5\",\n \"retry_window\": \"600\",\n \"netban_ipv4\": \"24\",\n \"netban_ipv6\": \"64\",\n \"whitelist\": \"mailcow.tld\",\n \"blacklist\": \"10.100.6.5/32,10.100.8.4/32\"\n }\n ],\n \"msg\": \"f2b_modified\"\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Fail2Ban","Edit Fail2Ban"]},{"title":"Get DKIM Key","path":"/api/v1/get/dkim/{domain}","pathTemplate":"/api/v1/get/dkim/{domain}","slug":"get~api~v1~get~dkim~domain","method":"get","description":"\nUsing this endpoint you can get the DKIM public key for a specific domain.","parameters":[{"location":"path","name":"domain","description":"name of domain","required":true,"schema":{"type":"string"}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"pubkey\": \"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA21tUSjyasQy/hJmVjPnlRGfzx6TPhYj8mXY9DVOzSAE64Gddw/GnE/GcCR6WXNT23u9q4zPnz1IPoNt5kFOps8vg/iNqrcH++494noaZuYyFPPFnebkfryO4EvEyxC/c66qts+gnOUml+M8uv5WObBJld2gG12jLwFM0263J/N6J8LuUsaXOB2uCIfx8Nf4zjuJ6Ieez2uyHNK5dXjDLfKA4mTr+EEK6W6e34M4KN1liWM6r9Oy5S1FlLrD42VpURxxBZtBiEtaJPEKSQuk6GQz8ihu7W20Yr53tyCdaORu8dhxXVUWVf+GjuuMEdAmQCjYkarXdYCrt56Psw703kwIDAQAB\",\n \"length\": \"2048\",\n \"dkim_txt\": \"v=DKIM1;k=rsa;t=s;s=email;p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA21tUSjyasQy/hJmVjPnlRGfzx6TPhYj8mXY9DVOzSAE64Gddw/GnE/GcCR6WXNT23u9q4zPnz1IPoNt5kFOps8vg/iNqrcH++494noaZuYyFPPFnebkfryO4EvEyxC/c66qts+gnOUml+M8uv5WObBJld2gG12jLwFM0263J/N6J8LuUsaXOB2uCIfx8Nf4zjuJ6Ieez2uyHNK5dXjDLfKA4mTr+EEK6W6e34M4KN1liWM6r9Oy5S1FlLrD42VpURxxBZtBiEtaJPEKSQuk6GQz8ihu7W20Yr53tyCdaORu8dhxXVUWVf+GjuuMEdAmQCjYkarXdYCrt56Psw703kwIDAQAB\",\n \"dkim_selector\": \"dkim\",\n \"privkey\": \"\"\n}\n","schema":""}}],"tags":["DKIM","Get DKIM Key"]},{"title":"Generate DKIM Key","path":"/api/v1/add/dkim","pathTemplate":"/api/v1/add/dkim","slug":"post~api~v1~add~dkim","method":"post","description":"\nUsing this endpoint you can generate new DKIM keys.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"domain","description":"the domain which a key should be generated for","required":false,"members":[],"schema":{"type":"string"}},{"key":"dkim_selector","description":"the DKIM selector default dkim","required":false,"members":[],"schema":{"type":"string"}},{"key":"key_size","description":"the key size (1024 or 2048)","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"domains\":\"mailcow.tld\",\n \"dkim_selector\":\"dkim\",\n \"key_size\":\"2048\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"domain\": {\n \"type\": \"string\"\n },\n \"dkim_selector\": {\n \"type\": \"string\"\n },\n \"key_size\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"dkim\",\n \"add\",\n {\n \"domains\": \"hanspeterlol.de\",\n \"dkim_selector\": \"dkim\",\n \"key_size\": \"2048\"\n }\n ],\n \"msg\": [\n \"dkim_added\",\n \"hanspeterlol.de\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["DKIM","Generate DKIM Key"]},{"title":"Duplicate DKIM Key","path":"/api/v1/add/dkim_duplicate","pathTemplate":"/api/v1/add/dkim_duplicate","slug":"post~api~v1~add~dkim~duplicate","method":"post","description":"\nUsing this endpoint you can duplicate the DKIM Key of one domain.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"fron_domain","description":"the domain where the dkim key should be copied from","required":false,"members":[],"schema":{"type":"string"}},{"key":"to_domain","description":"the domain where the dkim key should be copied to","required":false,"members":[],"schema":{"type":"string"}}]},"example":"{\n \"from_domain\":\"mailcow.tld\",\n \"to_domain\":\"awesomecow.tld\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"fron_domain\": {\n \"type\": \"string\"\n },\n \"to_domain\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"dkim\",\n \"duplicate\",\n {\n \"from_domain\": \"mailcow.tld\",\n \"to_domain\": \"awesomecow.tld\"\n }\n ],\n \"msg\": [\n \"dkim_duplicated\",\n \"mailcow.tld\",\n \"awesomecow.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["DKIM","Duplicate DKIM Key"]},{"title":"Delete DKIM Key","path":"/api/v1/delete/dkim","pathTemplate":"/api/v1/delete/dkim","slug":"post~api~v1~delete~dkim","method":"post","description":"\nUsing this endpoint a existing DKIM Key can be deleted","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"[\"mailcow.tld\"]\n","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"dkim\",\n \"delete\",\n {\n \"domains\": [\n \"mailcow.tld\"\n ]\n }\n ],\n \"msg\": [\n \"dkim_removed\",\n \"mailcow.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["DKIM","Delete DKIM Key"]},{"title":"Get Domain Admins","path":"/api/v1/get/domain-admin/all","pathTemplate":"/api/v1/get/domain-admin/all","slug":"get~api~v1~get~domain-admin~all","method":"get","description":"\n","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"username\": \"testadmin\",\n \"tfa_active\": \"&#10005;\",\n \"active\": \"&#10003;\",\n \"tfa_active_int\": null,\n \"active_int\": 1,\n \"created\": \"2019-10-02 10:29:41\",\n \"selected_domains\": [\n \"mailcow.tld\"\n ],\n \"unselected_domains\": [\n \"awesomemailcow.de\",\n \"mailcowisgreat.de\"\n ]\n }\n]\n","schema":""}}],"tags":["Domain admin","Get Domain Admins"]},{"title":"Create Domain Admin user","path":"/api/v1/add/domain-admin","pathTemplate":"/api/v1/add/domain-admin","slug":"post~api~v1~add~domain-admin","method":"post","description":"\nUsing this endpoint you can create a new Domain Admin user. This user has full control over a domain, and can create new mailboxes and aliases.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"username","description":"the username for the admin user","required":false,"members":[],"schema":{"type":"string"}},{"key":"domains","description":"the domains the user should be a admin of","required":false,"members":[],"schema":{"type":"string"}},{"key":"password","description":"domain admin user password","required":false,"members":[],"schema":{"type":"string"}},{"key":"password2","description":"domain admin user password","required":false,"members":[],"schema":{"type":"string"}},{"key":"active","description":"1 for a active user account 0 for a disabled user account","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"username\": \"testadmin\",\n \"domains\": \"mailcow.tld\",\n \"password\": \"supersecurepw\",\n \"password2\": \"supersecurepw\",\n \"active\": \"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"username\": {\n \"type\": \"string\"\n },\n \"domains\": {\n \"type\": \"string\"\n },\n \"password\": {\n \"type\": \"string\"\n },\n \"password2\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"domain_admin\",\n \"add\",\n {\n \"username\": \"testadmin\",\n \"domains\": \"mailcow.tld\",\n \"password\": \"*\",\n \"password2\": \"*\",\n \"active\": \"1\"\n }\n ],\n \"msg\": [\n \"domain_admin_added\",\n \"testadmin\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Domain admin","Create Domain Admin user"]},{"title":"Delete Domain Admin","path":"/api/v1/delete/domain-admin","pathTemplate":"/api/v1/delete/domain-admin","slug":"post~api~v1~delete~domain-admin","method":"post","description":"\nUsing this endpoint a existing Domain Admin user can be deleted.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["username"],"description":"contains list of usernames of the users you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"testadmin\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"domain_admin\",\n \"delete\",\n {\n \"username\": [\n \"testadmin\"\n ]\n }\n ],\n \"msg\": [\n \"domain_admin_removed\",\n \"testadmin\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Domain admin","Delete Domain Admin"]},{"title":"Get BCC Map","path":"/api/v1/get/bcc/{id}","pathTemplate":"/api/v1/get/bcc/{id}","slug":"get~api~v1~get~bcc~id","method":"get","description":"\nUsing this endpoint you can get all BCC maps.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","1","2","5","10"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 3,\n \"local_dest\": \"@mailcow.tld\",\n \"bcc_dest\": \"bcc@awesomecow.tld\",\n \"active_int\": 1,\n \"active\": \"&#10003;\",\n \"type\": \"sender\",\n \"created\": \"2019-10-02 21:44:34\",\n \"domain\": \"mailcow.tld\",\n \"modified\": null\n }\n]\n","schema":""}}],"tags":["Address Rewriting","Get BCC Map"]},{"title":"Create BCC Map","path":"/api/v1/add/bcc","pathTemplate":"/api/v1/add/bcc","slug":"post~api~v1~add~bcc","method":"post","description":"\nUsing this endpoint you can create a BCC map to forward all mails via a bcc for a given domain.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"local_dest","description":"the domain which emails should be forwarded","required":false,"members":[],"schema":{"type":"string"}},{"key":"type","description":"the type of bcc map can be `sender` or `recipient`","required":false,"members":[],"schema":{"type":"string"}},{"key":"bcc_dest","description":"the email address where all mails should be send to","required":false,"members":[],"schema":{"type":"string"}},{"key":"active","description":"1 for a active user account 0 for a disabled user account","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"local_dest\": \"mailcow.tld\",\n \"type\": \"sender\",\n \"bcc_dest\": \"bcc@awesomecow.tld\",\n \"active\": \"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"local_dest\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"type\": \"string\"\n },\n \"bcc_dest\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"bcc\",\n \"add\",\n {\n \"local_dest\": \"mailcow.tld\",\n \"type\": \"sender\",\n \"bcc_dest\": \"bcc@awesomecow.tld\",\n \"active\": \"1\"\n },\n null\n ],\n \"msg\": \"bcc_saved\"\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Address Rewriting","Create BCC Map"]},{"title":"Delete BCC Map","path":"/api/v1/delete/bcc","pathTemplate":"/api/v1/delete/bcc","slug":"post~api~v1~delete~bcc","method":"post","description":"\nUsing this endpoint you can delete a BCC map, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of bcc maps you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"3\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"bcc\",\n \"delete\",\n {\n \"id\": [\n \"4\"\n ]\n },\n null\n ],\n \"msg\": [\n \"bcc_deleted\",\n \"4\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Address Rewriting","Delete BCC Map"]},{"title":"Get Recipient Map","path":"/api/v1/get/recipient_map/{id}","pathTemplate":"/api/v1/get/recipient_map/{id}","slug":"get~api~v1~get~recipient~map~id","method":"get","description":"\nUsing this endpoint you can get all recipient maps.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","1","2","5","10"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 3,\n \"recipient_map_old\": \"recipient@mailcow.tld\",\n \"recipient_map_new\": \"target@mailcow.tld\",\n \"active_int\": 1,\n \"active\": \"&#10003;\",\n \"created\": \"2019-10-02 22:06:29\",\n \"modified\": null\n }\n]\n","schema":""}}],"tags":["Address Rewriting","Get Recipient Map"]},{"title":"Create Recipient Map","path":"/api/v1/add/recipient_map","pathTemplate":"/api/v1/add/recipient_map","slug":"post~api~v1~add~recipient~map","method":"post","description":"\nUsing this endpoint you can create a recipient map to forward all mails from one email address to another.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"recipient_map_old","description":"the email address which emails should be forwarded","required":false,"members":[],"schema":{"type":"string"}},{"key":"recipient_map_new","description":"the email address that should receive the forwarded emails","required":false,"members":[],"schema":{"type":"string"}},{"key":"active","description":"1 for a active user account 0 for a disabled user account","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"recipient_map_old\": \"recipient@mailcow.tld\",\n \"recipient_map_new\": \"target@mailcow.tld\",\n \"active\": \"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"recipient_map_old\": {\n \"type\": \"string\"\n },\n \"recipient_map_new\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"recipient_map\",\n \"add\",\n {\n \"recipient_map_old\": \"recipient@mailcow.tld\",\n \"recipient_map_new\": \"target@mailcow.tld\",\n \"active\": \"1\"\n },\n null\n ],\n \"msg\": [\n \"recipient_map_entry_saved\",\n \"recipient@mailcow.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Address Rewriting","Create Recipient Map"]},{"title":"Delete Recipient Map","path":"/api/v1/delete/recipient_map","pathTemplate":"/api/v1/delete/recipient_map","slug":"post~api~v1~delete~recipient~map","method":"post","description":"\nUsing this endpoint you can delete a recipient map, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of recipient maps you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"1\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"recipient_map\",\n \"delete\",\n {\n \"id\": [\n \"1\"\n ]\n },\n null\n ],\n \"msg\": [\n \"recipient_map_entry_deleted\",\n \"1\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Address Rewriting","Delete Recipient Map"]},{"title":"Get TLS Policy Map","path":"/api/v1/get/tls-policy-map/{id}","pathTemplate":"/api/v1/get/tls-policy-map/{id}","slug":"get~api~v1~get~tls-policy-map~id","method":"get","description":"\nUsing this endpoint you can get all TLS policy map override maps.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","1","2","5","10"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 1,\n \"dest\": \"mailcow.tld\",\n \"policy\": \"encrypt\",\n \"parameters\": \"\",\n \"active_int\": 1,\n \"active\": \"&#10003;\",\n \"created\": \"2019-10-03 08:42:12\",\n \"modified\": null\n }\n]\n","schema":""}}],"tags":["Outgoing TLS Policy Map Overrides","Get TLS Policy Map"]},{"title":"Create TLS Policy Map","path":"/api/v1/add/tls-policy-map","pathTemplate":"/api/v1/add/tls-policy-map","slug":"post~api~v1~add~tls-policy-map","method":"post","description":"\nUsing this endpoint you can create a TLS policy map override.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"dest","description":"the target domain or email address","required":false,"members":[],"schema":{"type":"string"}},{"key":"policy","description":"the policy","required":false,"members":[],"schema":{"type":"enum"}},{"key":"parameters","description":"custom parameters you find out more about them [here](http://www.postfix.org/postconf.5.html#smtp_tls_policy_maps)","required":false,"members":[],"schema":{"type":"string"}},{"key":"active","description":"1 for a active user account 0 for a disabled user account","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"dest\": \"mailcow.tld\",\n \"policy\": \"encrypt\",\n \"parameters\": \"\",\n \"active\": \"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"dest\": {\n \"type\": \"string\"\n },\n \"policy\": {\n \"enum\": [\n \"none\",\n \"may\",\n \"encrypt\",\n \"dane\",\n \"fingerprint\",\n \"verify\",\n \"secure\"\n ]\n },\n \"parameters\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"tls_policy_maps\",\n \"add\",\n {\n \"dest\": \"mailcow.tld\",\n \"policy\": \"encrypt\",\n \"parameters\": \"\",\n \"active\": \"1\"\n },\n null\n ],\n \"msg\": [\n \"tls_policy_map_entry_saved\",\n \"mailcow.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Outgoing TLS Policy Map Overrides","Create TLS Policy Map"]},{"title":"Delete TLS Policy Map","path":"/api/v1/delete/tls-policy-map","pathTemplate":"/api/v1/delete/tls-policy-map","slug":"post~api~v1~delete~tls-policy-map","method":"post","description":"\nUsing this endpoint you can delete a TLS Policy Map, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of tls policy maps you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"3\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"tls_policy_maps\",\n \"delete\",\n {\n \"id\": [\n \"1\"\n ]\n },\n null\n ],\n \"msg\": [\n \"tls_policy_map_entry_deleted\",\n \"1\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Outgoing TLS Policy Map Overrides","Delete TLS Policy Map"]},{"title":"Get oAuth Clients","path":"/api/v1/get/oauth2-client/{id}","pathTemplate":"/api/v1/get/oauth2-client/{id}","slug":"get~api~v1~get~oauth2-client~id","method":"get","description":"\nUsing this endpoint you can get all oAuth clients.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","1","2","5","10"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 1,\n \"client_id\": \"17c76aaa88c0\",\n \"client_secret\": \"73fc668a88147e32a31ff80c\",\n \"redirect_uri\": \"https:\\/\\/mailcow.tld\",\n \"grant_types\": null,\n \"scope\": \"profile\",\n \"user_id\": null\n }\n]\n","schema":""}}],"tags":["oAuth Clients","Get oAuth Clients"]},{"title":"Create oAuth Client","path":"/api/v1/add/oauth2-client","pathTemplate":"/api/v1/add/oauth2-client","slug":"post~api~v1~add~oauth2-client","method":"post","description":"\nUsing this endpoint you can create a oAuth clients.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"redirect_uri","description":"the uri where you should be redirected after oAuth","required":false,"members":[],"schema":{"type":"string"}}]},"example":"{\n \"redirect_uri\":\"https://mailcow.tld\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"redirect_uri\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"oauth2\",\n \"add\",\n \"client\",\n {\n \"redirect_uri\": \"https:\\/\\/mailcow.tld\"\n }\n ],\n \"msg\": \"Added client access\"\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["oAuth Clients","Create oAuth Client"]},{"title":"Delete oAuth Client","path":"/api/v1/delete/oauth2-client","pathTemplate":"/api/v1/delete/oauth2-client","slug":"post~api~v1~delete~oauth2-client","method":"post","description":"\nUsing this endpoint you can delete a oAuth client, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of oAuth clients you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"3\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"oauth2\",\n \"delete\",\n \"client\",\n {\n \"id\": [\n \"1\"\n ]\n }\n ],\n \"msg\": [\n \"items_deleted\",\n \"1\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["oAuth Clients","Delete oAuth Client"]},{"title":"Get Sender-Dependent Transports","path":"/api/v1/get/relayhost/{id}","pathTemplate":"/api/v1/get/relayhost/{id}","slug":"get~api~v1~get~relayhost~id","method":"get","description":"\nUsing this endpoint you can get all Sender-Dependent Transports.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","1","2","5","10"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 1,\n \"hostname\": \"mailcow.tld:25\",\n \"username\": \"testuser\",\n \"password\": \"supersecurepassword\",\n \"active_int\": 1,\n \"password_short\": \"tes...\",\n \"active\": \"&#10003;\",\n \"used_by_domains\": \"\"\n }\n]\n","schema":""}}],"tags":["Routing","Get Sender-Dependent Transports"]},{"title":"Create Sender-Dependent Transports","path":"/api/v1/add/relayhost","pathTemplate":"/api/v1/add/relayhost","slug":"post~api~v1~add~relayhost","method":"post","description":"\nUsing this endpoint you can create Sender-Dependent Transports.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"hostname","description":"the hostname of the smtp server with port","required":false,"members":[],"schema":{"type":"string"}},{"key":"username","description":"the username used to authenticate","required":false,"members":[],"schema":{"type":"string"}},{"key":"password","description":"the password for the smtp user","required":false,"members":[],"schema":{"type":"string"}}]},"example":"{\n \"hostname\": \"mailcow.tld:25\",\n \"username\": \"testuser\",\n \"password\": \"supersecurepassword\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"hostname\": {\n \"type\": \"string\"\n },\n \"username\": {\n \"type\": \"string\"\n },\n \"password\": {\n \"type\": \"string\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"relayhost\",\n \"add\",\n {\n \"hostname\": \"mailcow.tld:25\",\n \"username\": \"testuser\",\n \"password\": \"supersecurepassword\"\n }\n ],\n \"msg\": [\n \"relayhost_added\",\n \"\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Routing","Create Sender-Dependent Transports"]},{"title":"Delete Sender-Dependent Transports","path":"/api/v1/delete/relayhost","pathTemplate":"/api/v1/delete/relayhost","slug":"post~api~v1~delete~relayhost","method":"post","description":"\nUsing this endpoint you can delete a Sender-Dependent Transport, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of Sender-Dependent Transport you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"1\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"relayhost\",\n \"delete\",\n {\n \"id\": [\n \"1\"\n ]\n }\n ],\n \"msg\": [\n \"relayhost_removed\",\n \"1\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Routing","Delete Sender-Dependent Transports"]},{"title":"Get Transport Maps","path":"/api/v1/get/transport/{id}","pathTemplate":"/api/v1/get/transport/{id}","slug":"get~api~v1~get~transport~id","method":"get","description":"\nUsing this endpoint you can get all Transport Maps.","parameters":[{"location":"path","name":"id","description":"id of entry you want to get","required":true,"example":"all","schema":{"type":"string","enum":["all","1","2","5","10"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 1,\n \"destination\": \"example.org\",\n \"nexthop\": \"host:25\",\n \"username\": \"testuser\",\n \"password\": \"supersecurepw\",\n \"active_int\": 1,\n \"lookup_mx_int\": 0,\n \"password_short\": \"sup...\",\n \"active\": \"&#10003;\",\n \"lookup_mx\": \"&#10005;\"\n }\n]\n","schema":""}}],"tags":["Routing","Get Transport Maps"]},{"title":"Create Transport Maps","path":"/api/v1/add/transport/all","pathTemplate":"/api/v1/add/transport/all","slug":"post~api~v1~add~transport~all","method":"post","description":"\nUsing this endpoint you can create Sender-Dependent Transports.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"destination","required":false,"members":[],"schema":{"type":"string"}},{"key":"nexthop","required":false,"members":[],"schema":{"type":"string"}},{"key":"username","description":"the username used to authenticate","required":false,"members":[],"schema":{"type":"string"}},{"key":"password","description":"the password for the smtp user","required":false,"members":[],"schema":{"type":"string"}},{"key":"active","description":"1 for a active transport map 0 for a disabled transport map","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"destination\": \"example.org\",\n \"nexthop\": \"host:25\",\n \"username\": \"testuser\",\n \"password\": \"supersecurepw\",\n \"active\": \"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"destination\": {\n \"type\": \"string\"\n },\n \"nexthop\": {\n \"type\": \"string\"\n },\n \"username\": {\n \"type\": \"string\"\n },\n \"password\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"transport\",\n \"add\",\n {\n \"destination\": \"example2.org\",\n \"nexthop\": \"host:25\",\n \"username\": \"testuser\",\n \"password\": \"supersecurepw\",\n \"active\": \"1\"\n }\n ],\n \"msg\": [\n \"relayhost_added\",\n \"\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Routing","Create Transport Maps"]},{"title":"Delete Transport Maps","path":"/api/v1/delete/transport","pathTemplate":"/api/v1/delete/transport","slug":"post~api~v1~delete~transport","method":"post","description":"\nUsing this endpoint you can delete a Transport Maps, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of transport maps you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"1\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"transport\",\n \"delete\",\n {\n \"id\": [\n \"1\"\n ]\n }\n ],\n \"msg\": [\n \"relayhost_removed\",\n \"1\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Routing","Delete Transport Maps"]},{"title":"Get Resources","path":"/api/v1/get/resource/all","pathTemplate":"/api/v1/get/resource/all","slug":"get~api~v1~get~resource~all","method":"get","description":"\nUsing this endpoint you can get all Resources.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"name\": \"test@mailcow.tld\",\n \"kind\": \"location\",\n \"multiple_bookings\": 0,\n \"description\": \"test\",\n \"active\": \"&#10003;\",\n \"active_int\": 1,\n \"domain\": \"mailcow.tld\",\n \"local_part\": \"test\"\n }\n]\n","schema":""}}],"tags":["Resources","Get Resources"]},{"title":"Create Resources","path":"/api/v1/add/resource","pathTemplate":"/api/v1/add/resource","slug":"post~api~v1~add~resource","method":"post","description":"\nUsing this endpoint you can create Resources.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"description","description":"a description of the resource","required":false,"members":[],"schema":{"type":"string"}},{"key":"domain","description":"the domain for which the resource should be","required":false,"members":[],"schema":{"type":"string"}},{"key":"kind","description":"the kind of recouse","required":false,"members":[],"schema":{"type":"enum"}},{"key":"multiple_bookings_select","required":false,"members":[],"schema":{"type":"enum"}},{"key":"multiple_bookings_custom","description":"always empty","required":false,"members":[],"schema":{"type":"number"}},{"key":"multiple_bookings","required":false,"members":[],"schema":{"type":"enum"}},{"key":"active","description":"1 for a active transport map 0 for a disabled transport map","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"description\": \"test\",\n \"domain\": \"mailcow.tld\",\n \"kind\": \"location\",\n \"multiple_bookings_select\": \"0\",\n \"multiple_bookings_custom\": \"\",\n \"multiple_bookings\": \"0\",\n \"active\": \"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"description\": {\n \"type\": \"string\"\n },\n \"domain\": {\n \"type\": \"string\"\n },\n \"kind\": {\n \"enum\": [\n \"location\",\n \"group\",\n \"thing\"\n ]\n },\n \"multiple_bookings_select\": {\n \"enum\": [\n \"-1\",\n \"1\",\n \"custom\"\n ]\n },\n \"multiple_bookings_custom\": {\n \"type\": \"number\"\n },\n \"multiple_bookings\": {\n \"enum\": [\n \"-1\",\n \"1\",\n \"custom\"\n ]\n },\n \"active\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"mailbox\",\n \"add\",\n \"resource\",\n {\n \"description\": \"test\",\n \"domain\": \"mailcow.tld\",\n \"kind\": \"location\",\n \"multiple_bookings_select\": \"0\",\n \"multiple_bookings_custom\": \"\",\n \"multiple_bookings\": \"0\",\n \"active\": \"1\"\n },\n null\n ],\n \"msg\": [\n \"resource_added\",\n \"mailcow.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Resources","Create Resources"]},{"title":"Delete Resources","path":"/api/v1/delete/resource","pathTemplate":"/api/v1/delete/resource","slug":"post~api~v1~delete~resource","method":"post","description":"\nUsing this endpoint you can delete a Resources, for this you have to know its ID. You can get the ID using the GET method.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["description@domain"],"description":"contains list of Resources you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"test@mailcow.tld\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"mailbox\",\n \"delete\",\n \"resource\",\n {\n \"name\": [\n \"test@mailcow.tld\"\n ]\n },\n null\n ],\n \"msg\": [\n \"resource_removed\",\n \"test@mailcow.tld\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["Resources","Delete Resources"]},{"title":"Get App Password","path":"/api/v1/get/app-passwd/all/{mailbox}","pathTemplate":"/api/v1/get/app-passwd/all/{mailbox}","slug":"get~api~v1~get~app-passwd~all~mailbox","method":"get","description":"\nUsing this endpoint you can get all app passwords from a specific mailbox.","parameters":[{"location":"path","name":"mailbox","description":"mailbox of entry you want to get","required":true,"example":"hello@mailcow.email","schema":{"type":"string","enum":["hello@mailcow.email"]}}],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"[\n {\n \"id\": 2,\n \"name\": \"emclient\",\n \"mailbox\": \"hello@mailcow.email\",\n \"domain\": \"mailcow.email\",\n \"created\": \"2019-12-21 16:04:55\",\n \"modified\": null,\n \"active_int\": 1,\n \"active\": \"&#10003;\"\n }\n]\n","schema":""}}],"tags":["App Passwords","Get App Password"]},{"title":"Create App Password","path":"/api/v1/add/app-passwd","pathTemplate":"/api/v1/add/app-passwd","slug":"post~api~v1~add~app-passwd","method":"post","description":"\nUsing this endpoint you can create a new app password for a specific mailbox.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"username","description":"the username user@domain.tld","required":false,"members":[],"schema":{"type":"string"}},{"key":"app_name","description":"name of the app password","required":false,"members":[],"schema":{"type":"string"}},{"key":"app_passwd","description":"the password","required":false,"members":[],"schema":{"type":"string"}},{"key":"app_passwd2","description":"the password for confirmation","required":false,"members":[],"schema":{"type":"string"}},{"key":"active","description":"1 for a active transport map 0 for a disabled transport map","required":false,"members":[],"schema":{"type":"number"}}]},"example":"{\n \"username\": \"hello@mailcow.email\"\n \"app_name\": \"emclient\",\n \"app_passwd\": \"keyleudecticidechothistishownsan31\",\n \"app_passwd2\": \"keyleudecticidechothistishownsan31\",\n \"active\": \"1\"\n}\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"username\": {\n \"type\": \"string\"\n },\n \"app_name\": {\n \"type\": \"string\"\n },\n \"app_passwd\": {\n \"type\": \"string\"\n },\n \"app_passwd2\": {\n \"type\": \"string\"\n },\n \"active\": {\n \"type\": \"number\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"app_passwd\",\n \"add\",\n {\n \"username\": \"hello@mailcow.email\",\n \"app_name\": \"emclient\",\n \"app_passwd\": \"keyleudecticidechothistishownsan31\",\n \"app_passwd2\": \"keyleudecticidechothistishownsan31\",\n \"active\": \"1\"\n }\n ],\n \"msg\": \"app_passwd_added\"\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["App Passwords","Create App Password"]},{"title":"Delete App Password","path":"/api/v1/delete/app-passwd","pathTemplate":"/api/v1/delete/app-passwd","slug":"post~api~v1~delete~app-passwd","method":"post","description":"\nUsing this endpoint you can delete a single app password.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"items","value":["id"],"description":"contains list of app passwords you want to delete","required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\"1\"]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"items\": {\n \"type\": \"array\"\n }\n }\n}"},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"structure":{"schema":{"type":"object"},"members":[{"key":"type","required":false,"members":[],"schema":{"type":"enum"}},{"key":"log","value":["entity","action","object",{}],"description":"contains request object","required":false,"members":[[]],"schema":{"type":"array"}},{"key":"msg","value":["message","entity name"],"required":false,"members":[],"schema":{"type":"array"}}]},"example":"[\n {\n \"type\": \"success\",\n \"log\": [\n \"app_passwd\",\n \"delete\",\n {\n \"id\": [\n \"2\"\n ]\n }\n ],\n \"msg\": [\n \"app_passwd_removed\",\n \"2\"\n ]\n }\n]\n","schema":"{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"enum\": [\n \"success\",\n \"danger\",\n \"error\"\n ]\n },\n \"log\": {\n \"type\": \"array\"\n },\n \"msg\": {\n \"type\": \"array\"\n }\n }\n}"}}],"tags":["App Passwords","Delete App Password"]},{"title":"Get container status","path":"/api/v1/get/status/containers","pathTemplate":"/api/v1/get/status/containers","slug":"get~api~v1~get~status~containers","method":"get","description":"\nUsing this endpoint you can get the status of all containers and when hey where started and a few other details.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"ipv6nat-mailcow\": {\n \"type\": \"info\",\n \"container\": \"ipv6nat-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:06:37.273225445Z\",\n \"image\": \"robbertkl/ipv6nat\"\n },\n \"netfilter-mailcow\": {\n \"type\": \"info\",\n \"container\": \"netfilter-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:09.851559297Z\",\n \"image\": \"mailcow/netfilter:1.31\"\n },\n \"rspamd-mailcow\": {\n \"type\": \"info\",\n \"container\": \"rspamd-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:12.456075355Z\",\n \"image\": \"mailcow/rspamd:1.56\"\n },\n \"acme-mailcow\": {\n \"type\": \"info\",\n \"container\": \"acme-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:08.270660275Z\",\n \"image\": \"mailcow/acme:1.63\"\n },\n \"dovecot-mailcow\": {\n \"type\": \"info\",\n \"container\": \"dovecot-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:08.988680259Z\",\n \"image\": \"mailcow/dovecot:1.104\"\n },\n \"postfix-mailcow\": {\n \"type\": \"info\",\n \"container\": \"postfix-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:07.186717617Z\",\n \"image\": \"mailcow/postfix:1.44\"\n },\n \"nginx-mailcow\": {\n \"type\": \"info\",\n \"container\": \"nginx-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:12.9843038Z\",\n \"image\": \"nginx:mainline-alpine\"\n },\n \"mysql-mailcow\": {\n \"type\": \"info\",\n \"container\": \"mysql-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:02.201937528Z\",\n \"image\": \"mariadb:10.3\"\n },\n \"php-fpm-mailcow\": {\n \"type\": \"info\",\n \"container\": \"php-fpm-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:00.955808957Z\",\n \"image\": \"mailcow/phpfpm:1.55\"\n },\n \"clamd-mailcow\": {\n \"type\": \"info\",\n \"container\": \"clamd-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T21:00:01.622856172Z\",\n \"image\": \"mailcow/clamd:1.35\"\n },\n \"memcached-mailcow\": {\n \"type\": \"info\",\n \"container\": \"memcached-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T20:59:58.0907785Z\",\n \"image\": \"memcached:alpine\"\n },\n \"solr-mailcow\": {\n \"type\": \"info\",\n \"container\": \"solr-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T20:59:59.635413798Z\",\n \"image\": \"mailcow/solr:1.7\"\n },\n \"olefy-mailcow\": {\n \"type\": \"info\",\n \"container\": \"olefy-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T20:59:59.676259274Z\",\n \"image\": \"mailcow/olefy:1.2\"\n },\n \"sogo-mailcow\": {\n \"type\": \"info\",\n \"container\": \"sogo-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T20:59:58.382274592Z\",\n \"image\": \"mailcow/sogo:1.65\"\n },\n \"unbound-mailcow\": {\n \"type\": \"info\",\n \"container\": \"unbound-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T20:59:58.760595825Z\",\n \"image\": \"mailcow/unbound:1.10\"\n },\n \"dockerapi-mailcow\": {\n \"type\": \"info\",\n \"container\": \"dockerapi-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T20:59:59.984797808Z\",\n \"image\": \"mailcow/dockerapi:1.36\"\n },\n \"redis-mailcow\": {\n \"type\": \"info\",\n \"container\": \"redis-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T20:59:56.827166834Z\",\n \"image\": \"redis:5-alpine\"\n },\n \"watchdog-mailcow\": {\n \"type\": \"info\",\n \"container\": \"watchdog-mailcow\",\n \"state\": \"running\",\n \"started_at\": \"2019-12-22T20:59:56.028660382Z\",\n \"image\": \"mailcow/watchdog:1.65\"\n }\n}\n","schema":""}}],"tags":["status","Get container status"]},{"title":"Get vmail status","path":"/api/v1/get/status/vmail","pathTemplate":"/api/v1/get/status/vmail","slug":"get~api~v1~get~status~vmail","method":"get","description":"\nUsing this endpoint you can get the status of the vmail and the amount of used storage.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"type\": \"info\",\n \"disk\": \"/dev/mapper/mail--vg-root\",\n \"used\": \"11G\",\n \"total\": \"41G\",\n \"used_percent\": \"28%\"\n}\n","schema":""}}],"tags":["status","Get vmail status"]},{"title":"Get solr status","path":"/api/v1/get/status/solr","pathTemplate":"/api/v1/get/status/solr","slug":"get~api~v1~get~status~solr","method":"get","description":"\nUsing this endpoint you can get the status of all containers and when hey where started and a few other details.","parameters":[],"transactions":[{"request":{"title":"json","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}},{"name":"X-API-Key","example":"api-key-string","required":false,"schema":{"type":"string"}}],"example":"","schema":""},"response":{"statusCode":200,"title":"","description":"","contentType":"application/json","headers":[{"name":"Content-Type","example":"application/json","required":false,"schema":{"type":"string"}}],"example":"{\n \"type\": \"info\",\n \"solr_enabled\": false,\n \"solr_size\": null,\n \"solr_documents\": null\n}\n","schema":""}}],"tags":["status","Get solr status"]}],"tagActions":[{"title":"Domains","children":[{"title":"Get domains","actions":[{"title":"Get domains","method":"get","path":"/api/v1/get/domain/{id}","slug":"get~api~v1~get~domain~id"}]},{"title":"Create domain","actions":[{"title":"Create domain","method":"post","path":"/api/v1/add/domain","slug":"post~api~v1~add~domain"}]},{"title":"Update domain","actions":[{"title":"Update domain","method":"post","path":"/api/v1/edit/domain","slug":"post~api~v1~edit~domain"}]},{"title":"Delete domain","actions":[{"title":"Delete domain","method":"post","path":"/api/v1/delete/domain","slug":"post~api~v1~delete~domain"}]}]},{"title":"Domain antispam policies","children":[{"title":"List whitelist domain policy","actions":[{"title":"List whitelist domain policy","method":"get","path":"/api/v1/get/policy_wl_domain/{domain}","slug":"get~api~v1~get~policy~wl~domain~domain"}]},{"title":"List blacklist domain policy","actions":[{"title":"List blacklist domain policy","method":"get","path":"/api/v1/get/policy_bl_domain/{domain}","slug":"get~api~v1~get~policy~bl~domain~domain"}]},{"title":"Create domain policy","actions":[{"title":"Create domain policy","method":"post","path":"/api/v1/add/domain-policy","slug":"post~api~v1~add~domain-policy"}]},{"title":"Delete domain policy","actions":[{"title":"Delete domain policy","method":"post","path":"/api/v1/delete/domain-policy","slug":"post~api~v1~delete~domain-policy"}]}]},{"title":"Mailboxes","children":[{"title":"Get mailboxes","actions":[{"title":"Get mailboxes","method":"get","path":"/api/v1/get/mailbox/{id}","slug":"get~api~v1~get~mailbox~id"}]},{"title":"Create mailbox","actions":[{"title":"Create mailbox","method":"post","path":"/api/v1/add/mailbox","slug":"post~api~v1~add~mailbox"}]},{"title":"Update mailbox","actions":[{"title":"Update mailbox","method":"post","path":"/api/v1/edit/mailbox","slug":"post~api~v1~edit~mailbox"}]},{"title":"Delete mailbox","actions":[{"title":"Delete mailbox","method":"post","path":"/api/v1/delete/mailbox","slug":"post~api~v1~delete~mailbox"}]},{"title":"Quarantine Notifications","actions":[{"title":"Quarantine Notifications","method":"post","path":"/api/v1/edit/quarantine_notification","slug":"post~api~v1~edit~quarantine~notification"}]}]},{"title":"Aliases","children":[{"title":"Get aliases","actions":[{"title":"Get aliases","method":"get","path":"/api/v1/get/alias/{id}","slug":"get~api~v1~get~alias~id"}]},{"title":"Create alias","actions":[{"title":"Create alias","method":"post","path":"/api/v1/add/alias","slug":"post~api~v1~add~alias"}]},{"title":"Update alias","actions":[{"title":"Update alias","method":"post","path":"/api/v1/edit/alias","slug":"post~api~v1~edit~alias"}]},{"title":"Delete alias","actions":[{"title":"Delete alias","method":"post","path":"/api/v1/delete/alias","slug":"post~api~v1~delete~alias"}]}]},{"title":"Sync jobs","children":[{"title":"Get sync jobs","actions":[{"title":"Get sync jobs","method":"get","path":"/api/v1/get/syncjobs/all/no_log","slug":"get~api~v1~get~syncjobs~all~no~log"}]},{"title":"Create sync job","actions":[{"title":"Create sync job","method":"post","path":"/api/v1/add/syncjob","slug":"post~api~v1~add~syncjob"}]},{"title":"Update sync job","actions":[{"title":"Update sync job","method":"post","path":"/api/v1/edit/syncjob","slug":"post~api~v1~edit~syncjob"}]},{"title":"Delete sync job","actions":[{"title":"Delete sync job","method":"post","path":"/api/v1/delete/syncjob","slug":"post~api~v1~delete~syncjob"}]}]},{"title":"Fordwarding Hosts","children":[{"title":"Get Forwarding Hosts","actions":[{"title":"Get Forwarding Hosts","method":"get","path":"/api/v1/get/fwdhost/all","slug":"get~api~v1~get~fwdhost~all"}]},{"title":"Add Forward Host","actions":[{"title":"Add Forward Host","method":"post","path":"/api/v1/add/fwdhost","slug":"post~api~v1~add~fwdhost"}]}]},{"title":"Logs","children":[{"title":"Get Postfix logs","actions":[{"title":"Get Postfix logs","method":"get","path":"/api/v1/get/logs/postfix/{count}","slug":"get~api~v1~get~logs~postfix~count"}]},{"title":"Get Rspamd logs","actions":[{"title":"Get Rspamd logs","method":"get","path":"/api/v1/get/logs/rspamd-history/{count}","slug":"get~api~v1~get~logs~rspamd-history~count"}]},{"title":"Get Dovecot logs","actions":[{"title":"Get Dovecot logs","method":"get","path":"/api/v1/get/logs/dovecot/{count}","slug":"get~api~v1~get~logs~dovecot~count"}]},{"title":"Get ACME logs","actions":[{"title":"Get ACME logs","method":"get","path":"/api/v1/get/logs/acme/{count}","slug":"get~api~v1~get~logs~acme~count"}]},{"title":"Get SOGo logs","actions":[{"title":"Get SOGo logs","method":"get","path":"/api/v1/get/logs/sogo/{count}","slug":"get~api~v1~get~logs~sogo~count"}]},{"title":"Get Watchdog logs","actions":[{"title":"Get Watchdog logs","method":"get","path":"/api/v1/get/logs/watchdog/{count}","slug":"get~api~v1~get~logs~watchdog~count"}]},{"title":"Get Api logs","actions":[{"title":"Get Api logs","method":"get","path":"/api/v1/get/logs/api/{count}","slug":"get~api~v1~get~logs~api~count"}]},{"title":"Get Ratelimit logs","actions":[{"title":"Get Ratelimit logs","method":"get","path":"/api/v1/get/logs/ratelimited/{count}","slug":"get~api~v1~get~logs~ratelimited~count"}]},{"title":"Get Netfilter logs","actions":[{"title":"Get Netfilter logs","method":"get","path":"/api/v1/get/logs/netfilter/{count}","slug":"get~api~v1~get~logs~netfilter~count"}]},{"title":"Get Autodiscover logs","actions":[{"title":"Get Autodiscover logs","method":"get","path":"/api/v1/get/logs/autodiscover/{count}","slug":"get~api~v1~get~logs~autodiscover~count"}]}]},{"title":"Queue Manager","children":[{"title":"Get Queue","actions":[{"title":"Get Queue","method":"get","path":"/api/v1/get/mailq/all","slug":"get~api~v1~get~mailq~all"}]},{"title":"Flush Queue","actions":[{"title":"Flush Queue","method":"post","path":"/api/v1/edit/mailq","slug":"post~api~v1~edit~mailq"}]},{"title":"Delete Queue","actions":[{"title":"Delete Queue","method":"post","path":"/api/v1/delete/mailq","slug":"post~api~v1~delete~mailq"}]}]},{"title":"Quarantine","children":[{"title":"Get mails in Quarantine","actions":[{"title":"Get mails in Quarantine","method":"get","path":"/api/v1/get/quarantine/all","slug":"get~api~v1~get~quarantine~all"}]},{"title":"Delete mails in Quarantine","actions":[{"title":"Delete mails in Quarantine","method":"post","path":"/api/v1/delete/qitem","slug":"post~api~v1~delete~qitem"}]}]},{"title":"Fail2Ban","children":[{"title":"Get Fail2Ban Config","actions":[{"title":"Get Fail2Ban Config","method":"get","path":"/api/v1/get/fail2ban","slug":"get~api~v1~get~fail2ban"}]},{"title":"Edit Fail2Ban","actions":[{"title":"Edit Fail2Ban","method":"post","path":"/api/v1/edit/fail2ban","slug":"post~api~v1~edit~fail2ban"}]}]},{"title":"DKIM","children":[{"title":"Get DKIM Key","actions":[{"title":"Get DKIM Key","method":"get","path":"/api/v1/get/dkim/{domain}","slug":"get~api~v1~get~dkim~domain"}]},{"title":"Generate DKIM Key","actions":[{"title":"Generate DKIM Key","method":"post","path":"/api/v1/add/dkim","slug":"post~api~v1~add~dkim"}]},{"title":"Duplicate DKIM Key","actions":[{"title":"Duplicate DKIM Key","method":"post","path":"/api/v1/add/dkim_duplicate","slug":"post~api~v1~add~dkim~duplicate"}]},{"title":"Delete DKIM Key","actions":[{"title":"Delete DKIM Key","method":"post","path":"/api/v1/delete/dkim","slug":"post~api~v1~delete~dkim"}]}]},{"title":"Domain admin","children":[{"title":"Get Domain Admins","actions":[{"title":"Get Domain Admins","method":"get","path":"/api/v1/get/domain-admin/all","slug":"get~api~v1~get~domain-admin~all"}]},{"title":"Create Domain Admin user","actions":[{"title":"Create Domain Admin user","method":"post","path":"/api/v1/add/domain-admin","slug":"post~api~v1~add~domain-admin"}]},{"title":"Delete Domain Admin","actions":[{"title":"Delete Domain Admin","method":"post","path":"/api/v1/delete/domain-admin","slug":"post~api~v1~delete~domain-admin"}]}]},{"title":"Address Rewriting","children":[{"title":"Get BCC Map","actions":[{"title":"Get BCC Map","method":"get","path":"/api/v1/get/bcc/{id}","slug":"get~api~v1~get~bcc~id"}]},{"title":"Create BCC Map","actions":[{"title":"Create BCC Map","method":"post","path":"/api/v1/add/bcc","slug":"post~api~v1~add~bcc"}]},{"title":"Delete BCC Map","actions":[{"title":"Delete BCC Map","method":"post","path":"/api/v1/delete/bcc","slug":"post~api~v1~delete~bcc"}]},{"title":"Get Recipient Map","actions":[{"title":"Get Recipient Map","method":"get","path":"/api/v1/get/recipient_map/{id}","slug":"get~api~v1~get~recipient~map~id"}]},{"title":"Create Recipient Map","actions":[{"title":"Create Recipient Map","method":"post","path":"/api/v1/add/recipient_map","slug":"post~api~v1~add~recipient~map"}]},{"title":"Delete Recipient Map","actions":[{"title":"Delete Recipient Map","method":"post","path":"/api/v1/delete/recipient_map","slug":"post~api~v1~delete~recipient~map"}]}]},{"title":"Outgoing TLS Policy Map Overrides","children":[{"title":"Get TLS Policy Map","actions":[{"title":"Get TLS Policy Map","method":"get","path":"/api/v1/get/tls-policy-map/{id}","slug":"get~api~v1~get~tls-policy-map~id"}]},{"title":"Create TLS Policy Map","actions":[{"title":"Create TLS Policy Map","method":"post","path":"/api/v1/add/tls-policy-map","slug":"post~api~v1~add~tls-policy-map"}]},{"title":"Delete TLS Policy Map","actions":[{"title":"Delete TLS Policy Map","method":"post","path":"/api/v1/delete/tls-policy-map","slug":"post~api~v1~delete~tls-policy-map"}]}]},{"title":"oAuth Clients","children":[{"title":"Get oAuth Clients","actions":[{"title":"Get oAuth Clients","method":"get","path":"/api/v1/get/oauth2-client/{id}","slug":"get~api~v1~get~oauth2-client~id"}]},{"title":"Create oAuth Client","actions":[{"title":"Create oAuth Client","method":"post","path":"/api/v1/add/oauth2-client","slug":"post~api~v1~add~oauth2-client"}]},{"title":"Delete oAuth Client","actions":[{"title":"Delete oAuth Client","method":"post","path":"/api/v1/delete/oauth2-client","slug":"post~api~v1~delete~oauth2-client"}]}]},{"title":"Routing","children":[{"title":"Get Sender-Dependent Transports","actions":[{"title":"Get Sender-Dependent Transports","method":"get","path":"/api/v1/get/relayhost/{id}","slug":"get~api~v1~get~relayhost~id"}]},{"title":"Create Sender-Dependent Transports","actions":[{"title":"Create Sender-Dependent Transports","method":"post","path":"/api/v1/add/relayhost","slug":"post~api~v1~add~relayhost"}]},{"title":"Delete Sender-Dependent Transports","actions":[{"title":"Delete Sender-Dependent Transports","method":"post","path":"/api/v1/delete/relayhost","slug":"post~api~v1~delete~relayhost"}]},{"title":"Get Transport Maps","actions":[{"title":"Get Transport Maps","method":"get","path":"/api/v1/get/transport/{id}","slug":"get~api~v1~get~transport~id"}]},{"title":"Create Transport Maps","actions":[{"title":"Create Transport Maps","method":"post","path":"/api/v1/add/transport/all","slug":"post~api~v1~add~transport~all"}]},{"title":"Delete Transport Maps","actions":[{"title":"Delete Transport Maps","method":"post","path":"/api/v1/delete/transport","slug":"post~api~v1~delete~transport"}]}]},{"title":"Resources","children":[{"title":"Get Resources","actions":[{"title":"Get Resources","method":"get","path":"/api/v1/get/resource/all","slug":"get~api~v1~get~resource~all"}]},{"title":"Create Resources","actions":[{"title":"Create Resources","method":"post","path":"/api/v1/add/resource","slug":"post~api~v1~add~resource"}]},{"title":"Delete Resources","actions":[{"title":"Delete Resources","method":"post","path":"/api/v1/delete/resource","slug":"post~api~v1~delete~resource"}]}]},{"title":"App Passwords","children":[{"title":"Get App Password","actions":[{"title":"Get App Password","method":"get","path":"/api/v1/get/app-passwd/all/{mailbox}","slug":"get~api~v1~get~app-passwd~all~mailbox"}]},{"title":"Create App Password","actions":[{"title":"Create App Password","method":"post","path":"/api/v1/add/app-passwd","slug":"post~api~v1~add~app-passwd"}]},{"title":"Delete App Password","actions":[{"title":"Delete App Password","method":"post","path":"/api/v1/delete/app-passwd","slug":"post~api~v1~delete~app-passwd"}]}]},{"title":"status","children":[{"title":"Get container status","actions":[{"title":"Get container status","method":"get","path":"/api/v1/get/status/containers","slug":"get~api~v1~get~status~containers"}]},{"title":"Get vmail status","actions":[{"title":"Get vmail status","method":"get","path":"/api/v1/get/status/vmail","slug":"get~api~v1~get~status~vmail"}]},{"title":"Get solr status","actions":[{"title":"Get solr status","method":"get","path":"/api/v1/get/status/solr","slug":"get~api~v1~get~status~solr"}]}]}],"config":{"playground":{"enabled":true,"env":"easy","environments":{"easy":{"playground":false,"url":"/"},"advanced":{"url":"/"}}},"sidebar":{"groupOrder":"auto"},"basePath":"/","stylesheets":[]}}
  15857. });
  15858. return app;
  15859. }());
  15860. </script>
  15861. </body>
  15862. </html>