ckeditor.js 5.3 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010560115601256013560145601556016560175601856019560205602156022560235602456025560265602756028560295603056031560325603356034560355603656037560385603956040560415604256043560445604556046560475604856049560505605156052560535605456055560565605756058560595606056061560625606356064560655606656067560685606956070560715607256073560745607556076560775607856079560805608156082560835608456085560865608756088560895609056091560925609356094560955609656097560985609956100561015610256103561045610556106561075610856109561105611156112561135611456115561165611756118561195612056121561225612356124561255612656127561285612956130561315613256133561345613556136561375613856139561405614156142561435614456145561465614756148561495615056151561525615356154561555615656157561585615956160561615616256163561645616556166561675616856169561705617156172561735617456175561765617756178561795618056181561825618356184561855618656187561885618956190561915619256193561945619556196561975619856199562005620156202562035620456205562065620756208562095621056211562125621356214562155621656217562185621956220562215622256223562245622556226562275622856229562305623156232562335623456235562365623756238562395624056241562425624356244562455624656247562485624956250562515625256253562545625556256562575625856259562605626156262562635626456265562665626756268562695627056271562725627356274562755627656277562785627956280562815628256283562845628556286562875628856289562905629156292562935629456295562965629756298562995630056301563025630356304563055630656307563085630956310563115631256313563145631556316563175631856319563205632156322563235632456325563265632756328563295633056331563325633356334563355633656337563385633956340563415634256343563445634556346563475634856349563505635156352563535635456355563565635756358563595636056361563625636356364563655636656367563685636956370563715637256373563745637556376563775637856379563805638156382563835638456385563865638756388563895639056391563925639356394563955639656397563985639956400564015640256403564045640556406564075640856409564105641156412564135641456415564165641756418564195642056421564225642356424564255642656427564285642956430564315643256433564345643556436564375643856439564405644156442564435644456445564465644756448564495645056451564525645356454564555645656457564585645956460564615646256463564645646556466564675646856469564705647156472564735647456475564765647756478564795648056481564825648356484564855648656487564885648956490564915649256493564945649556496564975649856499565005650156502565035650456505565065650756508565095651056511565125651356514565155651656517565185651956520565215652256523565245652556526565275652856529565305653156532565335653456535565365653756538565395654056541565425654356544565455654656547565485654956550565515655256553565545655556556565575655856559565605656156562565635656456565565665656756568565695657056571565725657356574565755657656577565785657956580565815658256583565845658556586565875658856589565905659156592565935659456595565965659756598565995660056601566025660356604566055660656607566085660956610566115661256613566145661556616566175661856619566205662156622566235662456625566265662756628566295663056631566325663356634566355663656637566385663956640566415664256643566445664556646566475664856649566505665156652566535665456655566565665756658566595666056661566625666356664566655666656667566685666956670566715667256673566745667556676566775667856679566805668156682566835668456685566865668756688566895669056691566925669356694566955669656697566985669956700567015670256703567045670556706567075670856709567105671156712567135671456715567165671756718567195672056721567225672356724567255672656727567285672956730567315673256733567345673556736567375673856739567405674156742567435674456745567465674756748567495675056751567525675356754567555675656757567585675956760567615676256763567645676556766567675676856769567705677156772567735677456775567765677756778567795678056781567825678356784567855678656787567885678956790567915679256793567945679556796567975679856799568005680156802568035680456805568065680756808568095681056811568125681356814568155681656817568185681956820568215682256823568245682556826568275682856829568305683156832568335683456835568365683756838568395684056841568425684356844568455684656847568485684956850568515685256853568545685556856568575685856859568605686156862568635686456865568665686756868568695687056871568725687356874568755687656877568785687956880568815688256883568845688556886568875688856889568905689156892568935689456895568965689756898568995690056901569025690356904569055690656907569085690956910569115691256913569145691556916569175691856919569205692156922569235692456925569265692756928569295693056931569325693356934569355693656937569385693956940569415694256943569445694556946569475694856949569505695156952569535695456955569565695756958569595696056961569625696356964569655696656967569685696956970569715697256973569745697556976569775697856979569805698156982569835698456985569865698756988569895699056991569925699356994569955699656997569985699957000570015700257003570045700557006570075700857009570105701157012570135701457015570165701757018570195702057021570225702357024570255702657027570285702957030570315703257033570345703557036570375703857039570405704157042570435704457045570465704757048570495705057051570525705357054570555705657057570585705957060570615706257063570645706557066570675706857069570705707157072570735707457075570765707757078570795708057081570825708357084570855708657087570885708957090570915709257093570945709557096570975709857099571005710157102571035710457105571065710757108571095711057111571125711357114571155711657117571185711957120571215712257123571245712557126571275712857129571305713157132571335713457135571365713757138571395714057141571425714357144571455714657147571485714957150571515715257153571545715557156571575715857159571605716157162571635716457165571665716757168571695717057171571725717357174571755717657177571785717957180571815718257183571845718557186571875718857189571905719157192571935719457195571965719757198571995720057201572025720357204572055720657207572085720957210572115721257213572145721557216572175721857219572205722157222572235722457225572265722757228572295723057231572325723357234572355723657237572385723957240572415724257243572445724557246572475724857249572505725157252572535725457255572565725757258572595726057261572625726357264572655726657267572685726957270572715727257273572745727557276572775727857279572805728157282572835728457285572865728757288572895729057291572925729357294572955729657297572985729957300573015730257303573045730557306573075730857309573105731157312573135731457315573165731757318573195732057321573225732357324573255732657327573285732957330573315733257333573345733557336573375733857339573405734157342573435734457345573465734757348573495735057351573525735357354573555735657357573585735957360573615736257363573645736557366573675736857369573705737157372573735737457375573765737757378573795738057381573825738357384573855738657387573885738957390573915739257393573945739557396573975739857399574005740157402574035740457405574065740757408574095741057411574125741357414574155741657417574185741957420574215742257423574245742557426574275742857429574305743157432574335743457435574365743757438574395744057441574425744357444574455744657447574485744957450574515745257453574545745557456574575745857459574605746157462574635746457465574665746757468574695747057471574725747357474574755747657477574785747957480574815748257483574845748557486574875748857489574905749157492574935749457495574965749757498574995750057501575025750357504575055750657507575085750957510575115751257513575145751557516575175751857519575205752157522575235752457525575265752757528575295753057531575325753357534575355753657537575385753957540575415754257543575445754557546575475754857549575505755157552575535755457555575565755757558575595756057561575625756357564575655756657567575685756957570575715757257573575745757557576575775757857579575805758157582575835758457585575865758757588575895759057591575925759357594575955759657597575985759957600576015760257603576045760557606576075760857609576105761157612576135761457615576165761757618576195762057621576225762357624576255762657627576285762957630576315763257633576345763557636576375763857639576405764157642576435764457645576465764757648576495765057651576525765357654576555765657657576585765957660576615766257663576645766557666576675766857669576705767157672576735767457675576765767757678576795768057681576825768357684576855768657687576885768957690576915769257693576945769557696576975769857699577005770157702577035770457705577065770757708577095771057711577125771357714577155771657717577185771957720577215772257723577245772557726577275772857729577305773157732577335773457735577365773757738577395774057741577425774357744577455774657747577485774957750577515775257753577545775557756577575775857759577605776157762577635776457765577665776757768577695777057771577725777357774577755777657777577785777957780577815778257783577845778557786577875778857789577905779157792577935779457795577965779757798577995780057801578025780357804578055780657807578085780957810578115781257813578145781557816578175781857819578205782157822578235782457825578265782757828578295783057831578325783357834578355783657837578385783957840578415784257843578445784557846578475784857849578505785157852578535785457855578565785757858578595786057861578625786357864578655786657867578685786957870578715787257873578745787557876578775787857879578805788157882578835788457885578865788757888578895789057891578925789357894578955789657897578985789957900579015790257903579045790557906579075790857909579105791157912579135791457915579165791757918579195792057921579225792357924579255792657927579285792957930579315793257933579345793557936579375793857939579405794157942579435794457945579465794757948579495795057951579525795357954579555795657957579585795957960579615796257963579645796557966579675796857969579705797157972579735797457975579765797757978579795798057981579825798357984579855798657987579885798957990579915799257993579945799557996579975799857999580005800158002580035800458005580065800758008580095801058011580125801358014580155801658017580185801958020580215802258023580245802558026580275802858029580305803158032580335803458035580365803758038580395804058041580425804358044580455804658047580485804958050580515805258053580545805558056580575805858059580605806158062580635806458065580665806758068580695807058071580725807358074580755807658077580785807958080580815808258083580845808558086580875808858089580905809158092580935809458095580965809758098580995810058101581025810358104581055810658107581085810958110581115811258113581145811558116581175811858119581205812158122581235812458125581265812758128581295813058131581325813358134581355813658137581385813958140581415814258143581445814558146581475814858149581505815158152581535815458155581565815758158581595816058161581625816358164581655816658167581685816958170581715817258173581745817558176581775817858179581805818158182581835818458185581865818758188581895819058191581925819358194581955819658197581985819958200582015820258203582045820558206582075820858209582105821158212582135821458215582165821758218582195822058221582225822358224582255822658227582285822958230582315823258233582345823558236582375823858239582405824158242582435824458245582465824758248582495825058251582525825358254582555825658257582585825958260582615826258263582645826558266582675826858269582705827158272582735827458275582765827758278582795828058281582825828358284582855828658287582885828958290582915829258293582945829558296582975829858299583005830158302583035830458305583065830758308583095831058311583125831358314583155831658317583185831958320583215832258323583245832558326583275832858329583305833158332583335833458335583365833758338583395834058341583425834358344583455834658347583485834958350583515835258353583545835558356583575835858359583605836158362583635836458365583665836758368583695837058371583725837358374583755837658377583785837958380583815838258383583845838558386583875838858389583905839158392583935839458395583965839758398583995840058401584025840358404584055840658407584085840958410584115841258413584145841558416584175841858419584205842158422584235842458425584265842758428584295843058431584325843358434584355843658437584385843958440584415844258443584445844558446584475844858449584505845158452584535845458455584565845758458584595846058461584625846358464584655846658467584685846958470584715847258473584745847558476584775847858479584805848158482584835848458485584865848758488584895849058491584925849358494584955849658497584985849958500585015850258503585045850558506585075850858509585105851158512585135851458515585165851758518585195852058521585225852358524585255852658527585285852958530585315853258533585345853558536585375853858539585405854158542585435854458545585465854758548585495855058551585525855358554585555855658557585585855958560585615856258563585645856558566585675856858569585705857158572585735857458575585765857758578585795858058581585825858358584585855858658587585885858958590585915859258593585945859558596585975859858599586005860158602586035860458605586065860758608586095861058611586125861358614586155861658617586185861958620586215862258623586245862558626586275862858629586305863158632586335863458635586365863758638586395864058641586425864358644586455864658647586485864958650586515865258653586545865558656586575865858659586605866158662586635866458665586665866758668586695867058671586725867358674586755867658677586785867958680586815868258683586845868558686586875868858689586905869158692586935869458695586965869758698586995870058701587025870358704587055870658707587085870958710587115871258713587145871558716587175871858719587205872158722587235872458725587265872758728587295873058731587325873358734587355873658737587385873958740587415874258743587445874558746587475874858749587505875158752587535875458755587565875758758587595876058761587625876358764587655876658767587685876958770587715877258773587745877558776587775877858779587805878158782587835878458785587865878758788587895879058791587925879358794587955879658797587985879958800588015880258803588045880558806588075880858809588105881158812588135881458815588165881758818588195882058821588225882358824588255882658827588285882958830588315883258833588345883558836588375883858839588405884158842588435884458845588465884758848588495885058851588525885358854588555885658857588585885958860588615886258863588645886558866588675886858869588705887158872588735887458875588765887758878588795888058881588825888358884588855888658887588885888958890588915889258893588945889558896588975889858899589005890158902589035890458905589065890758908589095891058911589125891358914589155891658917589185891958920589215892258923589245892558926589275892858929589305893158932589335893458935589365893758938589395894058941589425894358944589455894658947589485894958950589515895258953589545895558956589575895858959589605896158962589635896458965589665896758968589695897058971589725897358974589755897658977589785897958980589815898258983589845898558986589875898858989589905899158992589935899458995589965899758998589995900059001590025900359004590055900659007590085900959010590115901259013590145901559016590175901859019590205902159022590235902459025590265902759028590295903059031590325903359034590355903659037590385903959040590415904259043590445904559046590475904859049590505905159052590535905459055590565905759058590595906059061590625906359064590655906659067590685906959070590715907259073590745907559076590775907859079590805908159082590835908459085590865908759088590895909059091590925909359094590955909659097590985909959100591015910259103591045910559106591075910859109591105911159112591135911459115591165911759118591195912059121591225912359124591255912659127591285912959130591315913259133591345913559136591375913859139591405914159142591435914459145591465914759148591495915059151591525915359154591555915659157591585915959160591615916259163591645916559166591675916859169591705917159172591735917459175591765917759178591795918059181591825918359184591855918659187591885918959190591915919259193591945919559196591975919859199592005920159202592035920459205592065920759208592095921059211592125921359214592155921659217592185921959220592215922259223592245922559226592275922859229592305923159232592335923459235592365923759238592395924059241592425924359244592455924659247592485924959250592515925259253592545925559256592575925859259592605926159262592635926459265592665926759268592695927059271592725927359274592755927659277592785927959280592815928259283592845928559286592875928859289592905929159292592935929459295592965929759298592995930059301593025930359304593055930659307593085930959310593115931259313593145931559316593175931859319593205932159322593235932459325593265932759328593295933059331593325933359334593355933659337593385933959340593415934259343593445934559346593475934859349593505935159352593535935459355593565935759358593595936059361593625936359364593655936659367593685936959370593715937259373593745937559376593775937859379593805938159382593835938459385593865938759388593895939059391593925939359394593955939659397593985939959400594015940259403594045940559406594075940859409594105941159412594135941459415594165941759418594195942059421594225942359424594255942659427594285942959430594315943259433594345943559436594375943859439594405944159442594435944459445594465944759448594495945059451594525945359454594555945659457594585945959460594615946259463594645946559466594675946859469594705947159472594735947459475594765947759478594795948059481594825948359484594855948659487594885948959490594915949259493594945949559496594975949859499595005950159502595035950459505595065950759508595095951059511595125951359514595155951659517595185951959520595215952259523595245952559526595275952859529595305953159532595335953459535595365953759538595395954059541595425954359544595455954659547595485954959550595515955259553595545955559556595575955859559595605956159562595635956459565595665956759568595695957059571595725957359574595755957659577595785957959580595815958259583595845958559586595875958859589595905959159592595935959459595595965959759598595995960059601596025960359604596055960659607596085960959610596115961259613596145961559616596175961859619596205962159622596235962459625596265962759628596295963059631596325963359634596355963659637596385963959640596415964259643596445964559646596475964859649596505965159652596535965459655596565965759658596595966059661596625966359664596655966659667596685966959670596715967259673596745967559676596775967859679596805968159682596835968459685596865968759688596895969059691596925969359694596955969659697596985969959700597015970259703597045970559706597075970859709597105971159712597135971459715597165971759718597195972059721597225972359724597255972659727597285972959730597315973259733597345973559736597375973859739597405974159742597435974459745597465974759748597495975059751597525975359754597555975659757597585975959760597615976259763597645976559766597675976859769597705977159772597735977459775597765977759778597795978059781597825978359784597855978659787597885978959790597915979259793597945979559796597975979859799598005980159802598035980459805598065980759808598095981059811598125981359814598155981659817598185981959820598215982259823598245982559826598275982859829598305983159832598335983459835598365983759838598395984059841598425984359844598455984659847598485984959850598515985259853598545985559856598575985859859598605986159862598635986459865598665986759868598695987059871598725987359874598755987659877598785987959880598815988259883598845988559886598875988859889598905989159892598935989459895598965989759898598995990059901599025990359904599055990659907599085990959910599115991259913599145991559916599175991859919599205992159922599235992459925599265992759928599295993059931599325993359934599355993659937599385993959940599415994259943599445994559946599475994859949599505995159952599535995459955599565995759958599595996059961599625996359964599655996659967599685996959970599715997259973599745997559976599775997859979599805998159982599835998459985599865998759988599895999059991599925999359994599955999659997599985999960000600016000260003600046000560006600076000860009600106001160012600136001460015600166001760018600196002060021600226002360024600256002660027600286002960030600316003260033600346003560036600376003860039600406004160042600436004460045600466004760048600496005060051600526005360054600556005660057600586005960060600616006260063600646006560066600676006860069600706007160072600736007460075600766007760078600796008060081600826008360084600856008660087600886008960090600916009260093600946009560096600976009860099601006010160102601036010460105601066010760108601096011060111601126011360114601156011660117601186011960120601216012260123601246012560126601276012860129601306013160132601336013460135601366013760138601396014060141601426014360144601456014660147601486014960150601516015260153601546015560156601576015860159601606016160162601636016460165601666016760168601696017060171601726017360174601756017660177601786017960180601816018260183601846018560186601876018860189601906019160192601936019460195601966019760198601996020060201602026020360204602056020660207602086020960210602116021260213602146021560216602176021860219602206022160222602236022460225602266022760228602296023060231602326023360234602356023660237602386023960240602416024260243602446024560246602476024860249602506025160252602536025460255602566025760258602596026060261602626026360264602656026660267602686026960270602716027260273602746027560276602776027860279602806028160282602836028460285602866028760288602896029060291602926029360294602956029660297602986029960300603016030260303603046030560306603076030860309603106031160312603136031460315603166031760318603196032060321603226032360324603256032660327603286032960330603316033260333603346033560336603376033860339603406034160342603436034460345603466034760348603496035060351603526035360354603556035660357603586035960360603616036260363603646036560366603676036860369603706037160372603736037460375603766037760378603796038060381603826038360384603856038660387603886038960390603916039260393603946039560396603976039860399604006040160402604036040460405604066040760408604096041060411604126041360414604156041660417604186041960420604216042260423604246042560426604276042860429604306043160432604336043460435604366043760438604396044060441604426044360444604456044660447604486044960450604516045260453604546045560456604576045860459604606046160462604636046460465604666046760468604696047060471604726047360474604756047660477604786047960480604816048260483604846048560486604876048860489604906049160492604936049460495604966049760498604996050060501605026050360504605056050660507605086050960510605116051260513605146051560516605176051860519605206052160522605236052460525605266052760528605296053060531605326053360534605356053660537605386053960540605416054260543605446054560546605476054860549605506055160552605536055460555605566055760558605596056060561605626056360564605656056660567605686056960570605716057260573605746057560576605776057860579605806058160582605836058460585605866058760588605896059060591605926059360594605956059660597605986059960600606016060260603606046060560606606076060860609606106061160612606136061460615606166061760618606196062060621606226062360624606256062660627606286062960630606316063260633606346063560636606376063860639606406064160642606436064460645606466064760648606496065060651606526065360654606556065660657606586065960660606616066260663606646066560666606676066860669606706067160672606736067460675606766067760678606796068060681606826068360684606856068660687606886068960690606916069260693606946069560696606976069860699607006070160702607036070460705607066070760708607096071060711607126071360714607156071660717607186071960720607216072260723607246072560726607276072860729607306073160732607336073460735607366073760738607396074060741607426074360744607456074660747607486074960750607516075260753607546075560756607576075860759607606076160762607636076460765607666076760768607696077060771607726077360774607756077660777607786077960780607816078260783607846078560786607876078860789607906079160792607936079460795607966079760798607996080060801608026080360804608056080660807608086080960810608116081260813608146081560816608176081860819608206082160822608236082460825608266082760828608296083060831608326083360834608356083660837608386083960840608416084260843608446084560846608476084860849608506085160852608536085460855608566085760858608596086060861608626086360864608656086660867608686086960870608716087260873608746087560876608776087860879608806088160882608836088460885608866088760888608896089060891608926089360894608956089660897608986089960900609016090260903609046090560906609076090860909609106091160912609136091460915609166091760918609196092060921609226092360924609256092660927609286092960930609316093260933609346093560936609376093860939609406094160942609436094460945609466094760948609496095060951609526095360954609556095660957609586095960960609616096260963609646096560966609676096860969609706097160972609736097460975609766097760978609796098060981609826098360984609856098660987609886098960990609916099260993609946099560996609976099860999610006100161002610036100461005610066100761008610096101061011610126101361014610156101661017610186101961020610216102261023610246102561026610276102861029610306103161032610336103461035610366103761038610396104061041610426104361044610456104661047610486104961050610516105261053610546105561056610576105861059610606106161062610636106461065610666106761068610696107061071610726107361074610756107661077610786107961080610816108261083610846108561086610876108861089610906109161092610936109461095610966109761098610996110061101611026110361104611056110661107611086110961110611116111261113611146111561116611176111861119611206112161122611236112461125611266112761128611296113061131611326113361134611356113661137611386113961140611416114261143611446114561146611476114861149611506115161152611536115461155611566115761158611596116061161611626116361164611656116661167611686116961170611716117261173611746117561176611776117861179611806118161182611836118461185611866118761188611896119061191611926119361194611956119661197611986119961200612016120261203612046120561206612076120861209612106121161212612136121461215612166121761218612196122061221612226122361224612256122661227612286122961230612316123261233612346123561236612376123861239612406124161242612436124461245612466124761248612496125061251612526125361254612556125661257612586125961260612616126261263612646126561266612676126861269612706127161272612736127461275612766127761278612796128061281612826128361284612856128661287612886128961290612916129261293612946129561296612976129861299613006130161302613036130461305613066130761308613096131061311613126131361314613156131661317613186131961320613216132261323613246132561326613276132861329613306133161332613336133461335613366133761338613396134061341613426134361344613456134661347613486134961350613516135261353613546135561356613576135861359613606136161362613636136461365613666136761368613696137061371613726137361374613756137661377613786137961380613816138261383613846138561386613876138861389613906139161392613936139461395613966139761398613996140061401614026140361404614056140661407614086140961410614116141261413614146141561416614176141861419614206142161422614236142461425614266142761428614296143061431614326143361434614356143661437614386143961440614416144261443614446144561446614476144861449614506145161452614536145461455614566145761458614596146061461614626146361464614656146661467614686146961470614716147261473614746147561476614776147861479614806148161482614836148461485614866148761488614896149061491614926149361494614956149661497614986149961500615016150261503615046150561506615076150861509615106151161512615136151461515615166151761518615196152061521615226152361524615256152661527615286152961530615316153261533615346153561536615376153861539615406154161542615436154461545615466154761548615496155061551615526155361554615556155661557615586155961560615616156261563615646156561566615676156861569615706157161572615736157461575615766157761578615796158061581615826158361584615856158661587615886158961590615916159261593615946159561596615976159861599616006160161602616036160461605616066160761608616096161061611616126161361614616156161661617616186161961620616216162261623616246162561626616276162861629616306163161632616336163461635616366163761638616396164061641616426164361644616456164661647616486164961650616516165261653616546165561656616576165861659616606166161662616636166461665616666166761668616696167061671616726167361674616756167661677616786167961680616816168261683616846168561686616876168861689616906169161692616936169461695616966169761698616996170061701617026170361704617056170661707617086170961710617116171261713617146171561716617176171861719617206172161722617236172461725617266172761728617296173061731617326173361734617356173661737617386173961740617416174261743617446174561746617476174861749617506175161752617536175461755617566175761758617596176061761617626176361764617656176661767617686176961770617716177261773617746177561776617776177861779617806178161782617836178461785617866178761788617896179061791617926179361794617956179661797617986179961800618016180261803618046180561806618076180861809618106181161812618136181461815618166181761818618196182061821618226182361824618256182661827618286182961830618316183261833618346183561836618376183861839618406184161842618436184461845618466184761848618496185061851618526185361854618556185661857618586185961860618616186261863618646186561866618676186861869618706187161872618736187461875618766187761878618796188061881618826188361884618856188661887618886188961890618916189261893618946189561896618976189861899619006190161902619036190461905619066190761908619096191061911619126191361914619156191661917619186191961920619216192261923619246192561926619276192861929619306193161932619336193461935619366193761938619396194061941619426194361944619456194661947619486194961950619516195261953619546195561956619576195861959619606196161962619636196461965619666196761968619696197061971619726197361974619756197661977619786197961980619816198261983619846198561986619876198861989619906199161992619936199461995619966199761998619996200062001620026200362004620056200662007620086200962010620116201262013620146201562016620176201862019620206202162022620236202462025620266202762028620296203062031620326203362034620356203662037620386203962040620416204262043620446204562046620476204862049620506205162052620536205462055620566205762058620596206062061620626206362064620656206662067620686206962070620716207262073620746207562076620776207862079620806208162082620836208462085620866208762088620896209062091620926209362094620956209662097620986209962100621016210262103621046210562106621076210862109621106211162112621136211462115621166211762118621196212062121621226212362124621256212662127621286212962130621316213262133621346213562136621376213862139621406214162142621436214462145621466214762148621496215062151621526215362154621556215662157621586215962160621616216262163621646216562166621676216862169621706217162172621736217462175621766217762178621796218062181621826218362184621856218662187621886218962190621916219262193621946219562196621976219862199622006220162202622036220462205622066220762208622096221062211622126221362214622156221662217622186221962220622216222262223622246222562226622276222862229622306223162232622336223462235622366223762238622396224062241622426224362244622456224662247622486224962250622516225262253622546225562256622576225862259622606226162262622636226462265622666226762268622696227062271622726227362274622756227662277622786227962280622816228262283622846228562286622876228862289622906229162292622936229462295622966229762298622996230062301623026230362304623056230662307623086230962310623116231262313623146231562316623176231862319623206232162322623236232462325623266232762328623296233062331623326233362334623356233662337623386233962340623416234262343623446234562346623476234862349623506235162352623536235462355623566235762358623596236062361623626236362364623656236662367623686236962370623716237262373623746237562376623776237862379623806238162382623836238462385623866238762388623896239062391623926239362394623956239662397623986239962400624016240262403624046240562406624076240862409624106241162412624136241462415624166241762418624196242062421624226242362424624256242662427624286242962430624316243262433624346243562436624376243862439624406244162442624436244462445624466244762448624496245062451624526245362454624556245662457624586245962460624616246262463624646246562466624676246862469624706247162472624736247462475624766247762478624796248062481624826248362484624856248662487624886248962490624916249262493624946249562496624976249862499625006250162502625036250462505625066250762508625096251062511625126251362514625156251662517625186251962520625216252262523625246252562526625276252862529625306253162532625336253462535625366253762538625396254062541625426254362544625456254662547625486254962550625516255262553625546255562556625576255862559625606256162562625636256462565625666256762568625696257062571625726257362574625756257662577625786257962580625816258262583625846258562586625876258862589625906259162592625936259462595625966259762598625996260062601626026260362604626056260662607626086260962610626116261262613626146261562616626176261862619626206262162622626236262462625626266262762628626296263062631626326263362634626356263662637626386263962640626416264262643626446264562646626476264862649626506265162652626536265462655626566265762658626596266062661626626266362664626656266662667626686266962670626716267262673626746267562676626776267862679626806268162682626836268462685626866268762688626896269062691626926269362694626956269662697626986269962700627016270262703627046270562706627076270862709627106271162712627136271462715627166271762718627196272062721627226272362724627256272662727627286272962730627316273262733627346273562736627376273862739627406274162742627436274462745627466274762748627496275062751627526275362754627556275662757627586275962760627616276262763627646276562766627676276862769627706277162772627736277462775627766277762778627796278062781627826278362784627856278662787627886278962790627916279262793627946279562796627976279862799628006280162802628036280462805628066280762808628096281062811628126281362814628156281662817628186281962820628216282262823628246282562826628276282862829628306283162832628336283462835628366283762838628396284062841628426284362844628456284662847628486284962850628516285262853628546285562856628576285862859628606286162862628636286462865628666286762868628696287062871628726287362874628756287662877628786287962880628816288262883628846288562886628876288862889628906289162892628936289462895628966289762898628996290062901629026290362904629056290662907629086290962910629116291262913629146291562916629176291862919629206292162922629236292462925629266292762928629296293062931629326293362934629356293662937629386293962940629416294262943629446294562946629476294862949629506295162952629536295462955629566295762958629596296062961629626296362964629656296662967629686296962970629716297262973629746297562976629776297862979629806298162982629836298462985629866298762988629896299062991629926299362994629956299662997629986299963000630016300263003630046300563006630076300863009630106301163012630136301463015630166301763018630196302063021630226302363024630256302663027630286302963030630316303263033630346303563036630376303863039630406304163042630436304463045630466304763048630496305063051630526305363054630556305663057630586305963060630616306263063630646306563066630676306863069630706307163072630736307463075630766307763078630796308063081630826308363084630856308663087630886308963090630916309263093630946309563096630976309863099631006310163102631036310463105631066310763108631096311063111631126311363114631156311663117631186311963120631216312263123631246312563126631276312863129631306313163132631336313463135631366313763138631396314063141631426314363144631456314663147631486314963150631516315263153631546315563156631576315863159631606316163162631636316463165631666316763168631696317063171631726317363174631756317663177631786317963180631816318263183631846318563186631876318863189631906319163192631936319463195631966319763198631996320063201632026320363204632056320663207632086320963210632116321263213632146321563216632176321863219632206322163222632236322463225632266322763228632296323063231632326323363234632356323663237632386323963240632416324263243632446324563246632476324863249632506325163252632536325463255632566325763258632596326063261632626326363264632656326663267632686326963270632716327263273632746327563276632776327863279632806328163282632836328463285632866328763288632896329063291632926329363294632956329663297632986329963300633016330263303633046330563306633076330863309633106331163312633136331463315633166331763318633196332063321633226332363324633256332663327633286332963330633316333263333633346333563336633376333863339633406334163342633436334463345633466334763348633496335063351633526335363354633556335663357633586335963360633616336263363633646336563366633676336863369633706337163372633736337463375633766337763378633796338063381633826338363384633856338663387633886338963390633916339263393633946339563396633976339863399634006340163402634036340463405634066340763408634096341063411634126341363414634156341663417634186341963420634216342263423634246342563426634276342863429634306343163432634336343463435634366343763438634396344063441634426344363444634456344663447634486344963450634516345263453634546345563456634576345863459634606346163462634636346463465634666346763468634696347063471634726347363474634756347663477634786347963480634816348263483634846348563486634876348863489634906349163492634936349463495634966349763498634996350063501635026350363504635056350663507635086350963510635116351263513635146351563516635176351863519635206352163522635236352463525635266352763528635296353063531635326353363534635356353663537635386353963540635416354263543635446354563546635476354863549635506355163552635536355463555635566355763558635596356063561635626356363564635656356663567635686356963570635716357263573635746357563576635776357863579635806358163582635836358463585635866358763588635896359063591635926359363594635956359663597635986359963600636016360263603636046360563606636076360863609636106361163612636136361463615636166361763618636196362063621636226362363624636256362663627636286362963630636316363263633636346363563636636376363863639636406364163642636436364463645636466364763648636496365063651636526365363654636556365663657636586365963660636616366263663636646366563666636676366863669636706367163672636736367463675636766367763678636796368063681636826368363684636856368663687636886368963690636916369263693636946369563696636976369863699637006370163702637036370463705637066370763708637096371063711637126371363714637156371663717637186371963720637216372263723637246372563726637276372863729637306373163732637336373463735637366373763738637396374063741637426374363744637456374663747637486374963750637516375263753637546375563756637576375863759637606376163762637636376463765637666376763768637696377063771637726377363774637756377663777637786377963780637816378263783637846378563786637876378863789637906379163792637936379463795637966379763798637996380063801638026380363804638056380663807638086380963810638116381263813638146381563816638176381863819638206382163822638236382463825638266382763828638296383063831638326383363834638356383663837638386383963840638416384263843638446384563846638476384863849638506385163852638536385463855638566385763858638596386063861638626386363864638656386663867638686386963870638716387263873638746387563876638776387863879638806388163882638836388463885638866388763888638896389063891638926389363894638956389663897638986389963900639016390263903639046390563906639076390863909639106391163912639136391463915639166391763918639196392063921639226392363924639256392663927639286392963930639316393263933639346393563936639376393863939639406394163942639436394463945639466394763948639496395063951639526395363954639556395663957639586395963960639616396263963639646396563966639676396863969639706397163972639736397463975639766397763978639796398063981639826398363984639856398663987639886398963990639916399263993639946399563996639976399863999640006400164002640036400464005640066400764008640096401064011640126401364014640156401664017640186401964020640216402264023640246402564026640276402864029640306403164032640336403464035640366403764038640396404064041640426404364044640456404664047640486404964050640516405264053640546405564056640576405864059640606406164062640636406464065640666406764068640696407064071640726407364074640756407664077640786407964080640816408264083640846408564086640876408864089640906409164092640936409464095640966409764098640996410064101641026410364104641056410664107641086410964110641116411264113641146411564116641176411864119641206412164122641236412464125641266412764128641296413064131641326413364134641356413664137641386413964140641416414264143641446414564146641476414864149641506415164152641536415464155641566415764158641596416064161641626416364164641656416664167641686416964170641716417264173641746417564176641776417864179641806418164182641836418464185641866418764188641896419064191641926419364194641956419664197641986419964200642016420264203642046420564206642076420864209642106421164212642136421464215642166421764218642196422064221642226422364224642256422664227642286422964230642316423264233642346423564236642376423864239642406424164242642436424464245642466424764248642496425064251642526425364254642556425664257642586425964260642616426264263642646426564266642676426864269642706427164272642736427464275642766427764278642796428064281642826428364284642856428664287642886428964290642916429264293642946429564296642976429864299643006430164302643036430464305643066430764308643096431064311643126431364314643156431664317643186431964320643216432264323643246432564326643276432864329643306433164332643336433464335643366433764338643396434064341643426434364344643456434664347643486434964350643516435264353643546435564356643576435864359643606436164362643636436464365643666436764368643696437064371643726437364374643756437664377643786437964380643816438264383643846438564386643876438864389643906439164392643936439464395643966439764398643996440064401644026440364404644056440664407644086440964410644116441264413644146441564416644176441864419644206442164422644236442464425644266442764428644296443064431644326443364434644356443664437644386443964440644416444264443644446444564446644476444864449644506445164452644536445464455644566445764458644596446064461644626446364464644656446664467644686446964470644716447264473644746447564476644776447864479644806448164482644836448464485644866448764488644896449064491644926449364494644956449664497644986449964500645016450264503645046450564506645076450864509645106451164512645136451464515645166451764518645196452064521645226452364524645256452664527645286452964530645316453264533645346453564536645376453864539645406454164542645436454464545645466454764548645496455064551645526455364554645556455664557645586455964560645616456264563645646456564566645676456864569645706457164572645736457464575645766457764578645796458064581645826458364584645856458664587645886458964590645916459264593645946459564596645976459864599646006460164602646036460464605646066460764608646096461064611646126461364614646156461664617646186461964620646216462264623646246462564626646276462864629646306463164632646336463464635646366463764638646396464064641646426464364644646456464664647646486464964650646516465264653646546465564656646576465864659646606466164662646636466464665646666466764668646696467064671646726467364674646756467664677646786467964680646816468264683646846468564686646876468864689646906469164692646936469464695646966469764698646996470064701647026470364704647056470664707647086470964710647116471264713647146471564716647176471864719647206472164722647236472464725647266472764728647296473064731647326473364734647356473664737647386473964740647416474264743647446474564746647476474864749647506475164752647536475464755647566475764758647596476064761647626476364764647656476664767647686476964770647716477264773647746477564776647776477864779647806478164782647836478464785647866478764788647896479064791647926479364794647956479664797647986479964800648016480264803648046480564806648076480864809648106481164812648136481464815648166481764818648196482064821648226482364824648256482664827648286482964830648316483264833648346483564836648376483864839648406484164842648436484464845648466484764848648496485064851648526485364854648556485664857648586485964860648616486264863648646486564866648676486864869648706487164872648736487464875648766487764878648796488064881648826488364884648856488664887648886488964890648916489264893648946489564896648976489864899649006490164902649036490464905649066490764908649096491064911649126491364914649156491664917649186491964920649216492264923649246492564926649276492864929649306493164932649336493464935649366493764938649396494064941649426494364944649456494664947649486494964950649516495264953649546495564956649576495864959649606496164962649636496464965649666496764968649696497064971649726497364974649756497664977649786497964980649816498264983649846498564986649876498864989649906499164992649936499464995649966499764998649996500065001650026500365004650056500665007650086500965010650116501265013650146501565016650176501865019650206502165022650236502465025650266502765028650296503065031650326503365034650356503665037650386503965040650416504265043650446504565046650476504865049650506505165052650536505465055650566505765058650596506065061650626506365064650656506665067650686506965070650716507265073650746507565076650776507865079650806508165082650836508465085650866508765088650896509065091650926509365094650956509665097650986509965100651016510265103651046510565106651076510865109651106511165112651136511465115651166511765118651196512065121651226512365124651256512665127651286512965130651316513265133651346513565136651376513865139651406514165142651436514465145651466514765148651496515065151651526515365154651556515665157651586515965160651616516265163651646516565166651676516865169651706517165172651736517465175651766517765178651796518065181651826518365184651856518665187651886518965190651916519265193651946519565196651976519865199652006520165202652036520465205652066520765208652096521065211652126521365214652156521665217652186521965220652216522265223652246522565226652276522865229652306523165232652336523465235652366523765238652396524065241652426524365244652456524665247652486524965250652516525265253652546525565256652576525865259652606526165262652636526465265652666526765268652696527065271652726527365274652756527665277652786527965280652816528265283652846528565286652876528865289652906529165292652936529465295652966529765298652996530065301653026530365304653056530665307653086530965310653116531265313653146531565316653176531865319653206532165322653236532465325653266532765328653296533065331653326533365334653356533665337653386533965340653416534265343653446534565346653476534865349653506535165352653536535465355653566535765358653596536065361653626536365364653656536665367653686536965370653716537265373653746537565376653776537865379653806538165382653836538465385653866538765388653896539065391653926539365394653956539665397653986539965400654016540265403654046540565406654076540865409654106541165412654136541465415654166541765418654196542065421654226542365424654256542665427654286542965430654316543265433654346543565436654376543865439654406544165442654436544465445654466544765448654496545065451654526545365454654556545665457654586545965460654616546265463654646546565466654676546865469654706547165472654736547465475654766547765478654796548065481654826548365484654856548665487654886548965490654916549265493654946549565496654976549865499655006550165502655036550465505655066550765508655096551065511655126551365514655156551665517655186551965520655216552265523655246552565526655276552865529655306553165532655336553465535655366553765538655396554065541655426554365544655456554665547655486554965550655516555265553655546555565556655576555865559655606556165562655636556465565655666556765568655696557065571655726557365574655756557665577655786557965580655816558265583655846558565586655876558865589655906559165592655936559465595655966559765598655996560065601656026560365604656056560665607656086560965610656116561265613656146561565616656176561865619656206562165622656236562465625656266562765628656296563065631656326563365634656356563665637656386563965640656416564265643656446564565646656476564865649656506565165652656536565465655656566565765658656596566065661656626566365664656656566665667656686566965670656716567265673656746567565676656776567865679656806568165682656836568465685656866568765688656896569065691656926569365694656956569665697656986569965700657016570265703657046570565706657076570865709657106571165712657136571465715657166571765718657196572065721657226572365724657256572665727657286572965730657316573265733657346573565736657376573865739657406574165742657436574465745657466574765748657496575065751657526575365754657556575665757657586575965760657616576265763657646576565766657676576865769657706577165772657736577465775657766577765778657796578065781657826578365784657856578665787657886578965790657916579265793657946579565796657976579865799658006580165802658036580465805658066580765808658096581065811658126581365814658156581665817658186581965820658216582265823658246582565826658276582865829658306583165832658336583465835658366583765838658396584065841658426584365844658456584665847658486584965850658516585265853658546585565856658576585865859658606586165862658636586465865658666586765868658696587065871658726587365874658756587665877658786587965880658816588265883658846588565886658876588865889658906589165892658936589465895658966589765898658996590065901659026590365904659056590665907659086590965910659116591265913659146591565916659176591865919659206592165922659236592465925659266592765928659296593065931659326593365934659356593665937659386593965940659416594265943659446594565946659476594865949659506595165952659536595465955659566595765958659596596065961659626596365964659656596665967659686596965970659716597265973659746597565976659776597865979659806598165982659836598465985659866598765988659896599065991659926599365994659956599665997659986599966000660016600266003660046600566006660076600866009660106601166012660136601466015660166601766018660196602066021660226602366024660256602666027660286602966030660316603266033660346603566036660376603866039660406604166042660436604466045660466604766048660496605066051660526605366054660556605666057660586605966060660616606266063660646606566066660676606866069660706607166072660736607466075660766607766078660796608066081660826608366084660856608666087660886608966090660916609266093660946609566096660976609866099661006610166102661036610466105661066610766108661096611066111661126611366114661156611666117661186611966120661216612266123661246612566126661276612866129661306613166132661336613466135661366613766138661396614066141661426614366144661456614666147661486614966150661516615266153661546615566156661576615866159661606616166162661636616466165661666616766168661696617066171661726617366174661756617666177661786617966180661816618266183661846618566186661876618866189661906619166192661936619466195661966619766198661996620066201662026620366204662056620666207662086620966210662116621266213662146621566216662176621866219662206622166222662236622466225662266622766228662296623066231662326623366234662356623666237662386623966240662416624266243662446624566246662476624866249662506625166252662536625466255662566625766258662596626066261662626626366264662656626666267662686626966270662716627266273662746627566276662776627866279662806628166282662836628466285662866628766288662896629066291662926629366294662956629666297662986629966300663016630266303663046630566306663076630866309663106631166312663136631466315663166631766318663196632066321663226632366324663256632666327663286632966330663316633266333663346633566336663376633866339663406634166342663436634466345663466634766348663496635066351663526635366354663556635666357663586635966360663616636266363663646636566366663676636866369663706637166372663736637466375663766637766378663796638066381663826638366384663856638666387663886638966390663916639266393663946639566396663976639866399664006640166402664036640466405664066640766408664096641066411664126641366414664156641666417664186641966420664216642266423664246642566426664276642866429664306643166432664336643466435664366643766438664396644066441664426644366444664456644666447664486644966450664516645266453664546645566456664576645866459664606646166462664636646466465664666646766468664696647066471664726647366474664756647666477664786647966480664816648266483664846648566486664876648866489664906649166492664936649466495664966649766498664996650066501665026650366504665056650666507665086650966510665116651266513665146651566516665176651866519665206652166522665236652466525665266652766528665296653066531665326653366534665356653666537665386653966540665416654266543665446654566546665476654866549665506655166552665536655466555665566655766558665596656066561665626656366564665656656666567665686656966570665716657266573665746657566576665776657866579665806658166582665836658466585665866658766588665896659066591665926659366594665956659666597665986659966600666016660266603666046660566606666076660866609666106661166612666136661466615666166661766618666196662066621666226662366624666256662666627666286662966630666316663266633666346663566636666376663866639666406664166642666436664466645666466664766648666496665066651666526665366654666556665666657666586665966660666616666266663666646666566666666676666866669666706667166672666736667466675666766667766678666796668066681666826668366684666856668666687666886668966690666916669266693666946669566696666976669866699667006670166702667036670466705667066670766708667096671066711667126671366714667156671666717667186671966720667216672266723667246672566726667276672866729667306673166732667336673466735667366673766738667396674066741667426674366744667456674666747667486674966750667516675266753667546675566756667576675866759667606676166762667636676466765667666676766768667696677066771667726677366774667756677666777667786677966780667816678266783667846678566786667876678866789667906679166792667936679466795667966679766798667996680066801668026680366804668056680666807668086680966810668116681266813668146681566816668176681866819668206682166822668236682466825668266682766828668296683066831668326683366834668356683666837668386683966840668416684266843668446684566846668476684866849668506685166852668536685466855668566685766858668596686066861668626686366864668656686666867668686686966870668716687266873668746687566876668776687866879668806688166882668836688466885668866688766888668896689066891668926689366894668956689666897668986689966900669016690266903669046690566906669076690866909669106691166912669136691466915669166691766918669196692066921669226692366924669256692666927669286692966930669316693266933669346693566936669376693866939669406694166942669436694466945669466694766948669496695066951669526695366954669556695666957669586695966960669616696266963669646696566966669676696866969669706697166972669736697466975669766697766978669796698066981669826698366984669856698666987669886698966990669916699266993669946699566996669976699866999670006700167002670036700467005670066700767008670096701067011670126701367014670156701667017670186701967020670216702267023670246702567026670276702867029670306703167032670336703467035670366703767038670396704067041670426704367044670456704667047670486704967050670516705267053670546705567056670576705867059670606706167062670636706467065670666706767068670696707067071670726707367074670756707667077670786707967080670816708267083670846708567086670876708867089670906709167092670936709467095670966709767098670996710067101671026710367104671056710667107671086710967110671116711267113671146711567116671176711867119671206712167122671236712467125671266712767128671296713067131671326713367134671356713667137671386713967140671416714267143671446714567146671476714867149671506715167152671536715467155671566715767158671596716067161671626716367164671656716667167671686716967170671716717267173671746717567176671776717867179671806718167182671836718467185671866718767188671896719067191671926719367194671956719667197671986719967200672016720267203672046720567206672076720867209672106721167212672136721467215672166721767218672196722067221672226722367224672256722667227672286722967230672316723267233672346723567236672376723867239672406724167242672436724467245672466724767248672496725067251672526725367254672556725667257672586725967260672616726267263672646726567266672676726867269672706727167272672736727467275672766727767278672796728067281672826728367284672856728667287672886728967290672916729267293672946729567296672976729867299673006730167302673036730467305673066730767308673096731067311673126731367314673156731667317673186731967320673216732267323673246732567326673276732867329673306733167332673336733467335673366733767338673396734067341673426734367344673456734667347673486734967350673516735267353673546735567356673576735867359673606736167362673636736467365673666736767368673696737067371673726737367374673756737667377673786737967380673816738267383673846738567386673876738867389673906739167392673936739467395673966739767398673996740067401674026740367404674056740667407674086740967410674116741267413674146741567416674176741867419674206742167422674236742467425674266742767428674296743067431674326743367434674356743667437674386743967440674416744267443674446744567446674476744867449674506745167452674536745467455674566745767458674596746067461674626746367464674656746667467674686746967470674716747267473674746747567476674776747867479674806748167482674836748467485674866748767488674896749067491674926749367494674956749667497674986749967500675016750267503675046750567506675076750867509675106751167512675136751467515675166751767518675196752067521675226752367524675256752667527675286752967530675316753267533675346753567536675376753867539675406754167542675436754467545675466754767548675496755067551675526755367554675556755667557675586755967560675616756267563675646756567566675676756867569675706757167572675736757467575675766757767578675796758067581675826758367584675856758667587675886758967590675916759267593675946759567596675976759867599676006760167602676036760467605676066760767608676096761067611676126761367614676156761667617676186761967620676216762267623676246762567626676276762867629676306763167632676336763467635676366763767638676396764067641676426764367644676456764667647676486764967650676516765267653676546765567656676576765867659676606766167662676636766467665676666766767668676696767067671676726767367674676756767667677676786767967680676816768267683676846768567686676876768867689676906769167692676936769467695676966769767698676996770067701677026770367704677056770667707677086770967710677116771267713677146771567716677176771867719677206772167722677236772467725677266772767728677296773067731677326773367734677356773667737677386773967740677416774267743677446774567746677476774867749677506775167752677536775467755677566775767758677596776067761677626776367764677656776667767677686776967770677716777267773677746777567776677776777867779677806778167782677836778467785677866778767788677896779067791677926779367794677956779667797677986779967800678016780267803678046780567806678076780867809678106781167812678136781467815678166781767818678196782067821678226782367824678256782667827678286782967830678316783267833678346783567836678376783867839678406784167842678436784467845678466784767848678496785067851678526785367854678556785667857678586785967860678616786267863678646786567866678676786867869678706787167872678736787467875678766787767878678796788067881678826788367884678856788667887678886788967890678916789267893678946789567896678976789867899679006790167902679036790467905679066790767908679096791067911679126791367914679156791667917679186791967920679216792267923679246792567926679276792867929679306793167932679336793467935679366793767938679396794067941679426794367944679456794667947679486794967950679516795267953679546795567956679576795867959679606796167962679636796467965679666796767968679696797067971679726797367974679756797667977679786797967980679816798267983679846798567986679876798867989679906799167992679936799467995679966799767998679996800068001680026800368004680056800668007680086800968010680116801268013680146801568016680176801868019680206802168022680236802468025680266802768028680296803068031680326803368034680356803668037680386803968040680416804268043680446804568046680476804868049680506805168052680536805468055680566805768058680596806068061680626806368064680656806668067680686806968070680716807268073680746807568076680776807868079680806808168082680836808468085680866808768088680896809068091680926809368094680956809668097680986809968100681016810268103681046810568106681076810868109681106811168112681136811468115681166811768118681196812068121681226812368124681256812668127681286812968130681316813268133681346813568136681376813868139681406814168142681436814468145681466814768148681496815068151681526815368154681556815668157681586815968160681616816268163681646816568166681676816868169681706817168172681736817468175681766817768178681796818068181681826818368184681856818668187681886818968190681916819268193681946819568196681976819868199682006820168202682036820468205682066820768208682096821068211682126821368214682156821668217682186821968220682216822268223682246822568226682276822868229682306823168232682336823468235682366823768238682396824068241682426824368244682456824668247682486824968250682516825268253682546825568256682576825868259682606826168262682636826468265682666826768268682696827068271682726827368274682756827668277682786827968280682816828268283682846828568286682876828868289682906829168292682936829468295682966829768298682996830068301683026830368304683056830668307683086830968310683116831268313683146831568316683176831868319683206832168322683236832468325683266832768328683296833068331683326833368334683356833668337683386833968340683416834268343683446834568346683476834868349683506835168352683536835468355683566835768358683596836068361683626836368364683656836668367683686836968370683716837268373683746837568376683776837868379683806838168382683836838468385683866838768388683896839068391683926839368394683956839668397683986839968400684016840268403684046840568406684076840868409684106841168412684136841468415684166841768418684196842068421684226842368424684256842668427684286842968430684316843268433684346843568436684376843868439684406844168442684436844468445684466844768448684496845068451684526845368454684556845668457684586845968460684616846268463684646846568466684676846868469684706847168472684736847468475684766847768478684796848068481684826848368484684856848668487684886848968490684916849268493684946849568496684976849868499685006850168502685036850468505685066850768508685096851068511685126851368514685156851668517685186851968520685216852268523685246852568526685276852868529685306853168532685336853468535685366853768538685396854068541685426854368544685456854668547685486854968550685516855268553685546855568556685576855868559685606856168562685636856468565685666856768568685696857068571685726857368574685756857668577685786857968580685816858268583685846858568586685876858868589685906859168592685936859468595685966859768598685996860068601686026860368604686056860668607686086860968610686116861268613686146861568616686176861868619686206862168622686236862468625686266862768628686296863068631686326863368634686356863668637686386863968640686416864268643686446864568646686476864868649686506865168652686536865468655686566865768658686596866068661686626866368664686656866668667686686866968670686716867268673686746867568676686776867868679686806868168682686836868468685686866868768688686896869068691686926869368694686956869668697686986869968700687016870268703687046870568706687076870868709687106871168712687136871468715687166871768718687196872068721687226872368724687256872668727687286872968730687316873268733687346873568736687376873868739687406874168742687436874468745687466874768748687496875068751687526875368754687556875668757687586875968760687616876268763687646876568766687676876868769687706877168772687736877468775687766877768778687796878068781687826878368784687856878668787687886878968790687916879268793687946879568796687976879868799688006880168802688036880468805688066880768808688096881068811688126881368814688156881668817688186881968820688216882268823688246882568826688276882868829688306883168832688336883468835688366883768838688396884068841688426884368844688456884668847688486884968850688516885268853688546885568856688576885868859688606886168862688636886468865688666886768868688696887068871688726887368874688756887668877688786887968880688816888268883688846888568886688876888868889688906889168892688936889468895688966889768898688996890068901689026890368904689056890668907689086890968910689116891268913689146891568916689176891868919689206892168922689236892468925689266892768928689296893068931689326893368934689356893668937689386893968940689416894268943689446894568946689476894868949689506895168952689536895468955689566895768958689596896068961689626896368964689656896668967689686896968970689716897268973689746897568976689776897868979689806898168982689836898468985689866898768988689896899068991689926899368994689956899668997689986899969000690016900269003690046900569006690076900869009690106901169012690136901469015690166901769018690196902069021690226902369024690256902669027690286902969030690316903269033690346903569036690376903869039690406904169042690436904469045690466904769048690496905069051690526905369054690556905669057690586905969060690616906269063690646906569066690676906869069690706907169072690736907469075690766907769078690796908069081690826908369084690856908669087690886908969090690916909269093690946909569096690976909869099691006910169102691036910469105691066910769108691096911069111691126911369114691156911669117691186911969120691216912269123691246912569126691276912869129691306913169132691336913469135691366913769138691396914069141691426914369144691456914669147691486914969150691516915269153691546915569156691576915869159691606916169162691636916469165691666916769168691696917069171691726917369174691756917669177691786917969180691816918269183691846918569186691876918869189691906919169192691936919469195691966919769198691996920069201692026920369204692056920669207692086920969210692116921269213692146921569216692176921869219692206922169222692236922469225692266922769228692296923069231692326923369234692356923669237692386923969240692416924269243692446924569246692476924869249692506925169252692536925469255692566925769258692596926069261692626926369264692656926669267692686926969270692716927269273692746927569276692776927869279692806928169282692836928469285692866928769288692896929069291692926929369294692956929669297692986929969300693016930269303693046930569306693076930869309693106931169312693136931469315693166931769318693196932069321693226932369324693256932669327693286932969330693316933269333693346933569336693376933869339693406934169342693436934469345693466934769348693496935069351693526935369354693556935669357693586935969360693616936269363693646936569366693676936869369693706937169372693736937469375693766937769378693796938069381693826938369384693856938669387693886938969390693916939269393693946939569396693976939869399694006940169402694036940469405694066940769408694096941069411694126941369414694156941669417694186941969420694216942269423694246942569426694276942869429694306943169432694336943469435694366943769438694396944069441694426944369444694456944669447694486944969450694516945269453694546945569456694576945869459694606946169462694636946469465694666946769468694696947069471694726947369474694756947669477694786947969480694816948269483694846948569486694876948869489694906949169492694936949469495694966949769498694996950069501695026950369504695056950669507695086950969510695116951269513695146951569516695176951869519695206952169522695236952469525695266952769528695296953069531695326953369534695356953669537695386953969540695416954269543695446954569546695476954869549695506955169552695536955469555695566955769558695596956069561695626956369564695656956669567695686956969570695716957269573695746957569576695776957869579695806958169582695836958469585695866958769588695896959069591695926959369594695956959669597695986959969600696016960269603696046960569606696076960869609696106961169612696136961469615696166961769618696196962069621696226962369624696256962669627696286962969630696316963269633696346963569636696376963869639696406964169642696436964469645696466964769648696496965069651696526965369654696556965669657696586965969660696616966269663696646966569666696676966869669696706967169672696736967469675696766967769678696796968069681696826968369684696856968669687696886968969690696916969269693696946969569696696976969869699697006970169702697036970469705697066970769708697096971069711697126971369714697156971669717697186971969720697216972269723697246972569726697276972869729697306973169732697336973469735697366973769738697396974069741697426974369744697456974669747697486974969750697516975269753697546975569756697576975869759697606976169762697636976469765697666976769768697696977069771697726977369774697756977669777697786977969780697816978269783697846978569786697876978869789697906979169792697936979469795697966979769798697996980069801698026980369804698056980669807698086980969810698116981269813698146981569816698176981869819698206982169822698236982469825698266982769828698296983069831698326983369834698356983669837698386983969840698416984269843698446984569846698476984869849698506985169852698536985469855698566985769858698596986069861698626986369864698656986669867698686986969870698716987269873698746987569876698776987869879698806988169882698836988469885698866988769888698896989069891698926989369894698956989669897698986989969900699016990269903699046990569906699076990869909699106991169912699136991469915699166991769918699196992069921699226992369924699256992669927699286992969930699316993269933699346993569936699376993869939699406994169942699436994469945699466994769948699496995069951699526995369954699556995669957699586995969960699616996269963699646996569966699676996869969699706997169972699736997469975699766997769978699796998069981699826998369984699856998669987699886998969990699916999269993699946999569996699976999869999700007000170002700037000470005700067000770008700097001070011700127001370014700157001670017700187001970020700217002270023700247002570026700277002870029700307003170032700337003470035700367003770038700397004070041700427004370044700457004670047700487004970050700517005270053700547005570056700577005870059700607006170062700637006470065700667006770068700697007070071700727007370074700757007670077700787007970080700817008270083700847008570086700877008870089700907009170092700937009470095700967009770098700997010070101701027010370104701057010670107701087010970110701117011270113701147011570116701177011870119701207012170122701237012470125701267012770128701297013070131701327013370134701357013670137701387013970140701417014270143701447014570146701477014870149701507015170152701537015470155701567015770158701597016070161701627016370164701657016670167701687016970170701717017270173701747017570176701777017870179701807018170182701837018470185701867018770188701897019070191701927019370194701957019670197701987019970200702017020270203702047020570206702077020870209702107021170212702137021470215702167021770218702197022070221702227022370224702257022670227702287022970230702317023270233702347023570236702377023870239702407024170242702437024470245702467024770248702497025070251702527025370254702557025670257702587025970260702617026270263702647026570266702677026870269702707027170272702737027470275702767027770278702797028070281702827028370284702857028670287702887028970290702917029270293702947029570296702977029870299703007030170302703037030470305703067030770308703097031070311703127031370314703157031670317703187031970320703217032270323703247032570326703277032870329703307033170332703337033470335703367033770338703397034070341703427034370344703457034670347703487034970350703517035270353703547035570356703577035870359703607036170362703637036470365703667036770368703697037070371703727037370374703757037670377703787037970380703817038270383703847038570386703877038870389703907039170392703937039470395703967039770398703997040070401704027040370404704057040670407704087040970410704117041270413704147041570416704177041870419704207042170422704237042470425704267042770428704297043070431704327043370434704357043670437704387043970440704417044270443704447044570446704477044870449704507045170452704537045470455704567045770458704597046070461704627046370464704657046670467704687046970470704717047270473704747047570476704777047870479704807048170482704837048470485704867048770488704897049070491704927049370494704957049670497704987049970500705017050270503705047050570506705077050870509705107051170512705137051470515705167051770518705197052070521705227052370524705257052670527705287052970530705317053270533705347053570536705377053870539705407054170542705437054470545705467054770548705497055070551705527055370554705557055670557705587055970560705617056270563705647056570566705677056870569705707057170572705737057470575705767057770578705797058070581705827058370584705857058670587705887058970590705917059270593705947059570596705977059870599706007060170602706037060470605706067060770608706097061070611706127061370614706157061670617706187061970620706217062270623706247062570626706277062870629706307063170632706337063470635706367063770638706397064070641706427064370644706457064670647706487064970650706517065270653706547065570656706577065870659706607066170662706637066470665706667066770668706697067070671706727067370674706757067670677706787067970680706817068270683706847068570686706877068870689706907069170692706937069470695706967069770698706997070070701707027070370704707057070670707707087070970710707117071270713707147071570716707177071870719707207072170722707237072470725707267072770728707297073070731707327073370734707357073670737707387073970740707417074270743707447074570746707477074870749707507075170752707537075470755707567075770758707597076070761707627076370764707657076670767707687076970770707717077270773707747077570776707777077870779707807078170782707837078470785707867078770788707897079070791707927079370794707957079670797707987079970800708017080270803708047080570806708077080870809708107081170812708137081470815708167081770818708197082070821708227082370824708257082670827708287082970830708317083270833708347083570836708377083870839708407084170842708437084470845708467084770848708497085070851708527085370854708557085670857708587085970860708617086270863708647086570866708677086870869708707087170872708737087470875708767087770878708797088070881708827088370884708857088670887708887088970890708917089270893708947089570896708977089870899709007090170902709037090470905709067090770908709097091070911709127091370914709157091670917709187091970920709217092270923709247092570926709277092870929709307093170932709337093470935709367093770938709397094070941709427094370944709457094670947709487094970950709517095270953709547095570956709577095870959709607096170962709637096470965709667096770968709697097070971709727097370974709757097670977709787097970980709817098270983709847098570986709877098870989709907099170992709937099470995709967099770998709997100071001710027100371004710057100671007710087100971010710117101271013710147101571016710177101871019710207102171022710237102471025710267102771028710297103071031710327103371034710357103671037710387103971040710417104271043710447104571046710477104871049710507105171052710537105471055710567105771058710597106071061710627106371064710657106671067710687106971070710717107271073710747107571076710777107871079710807108171082710837108471085710867108771088710897109071091710927109371094710957109671097710987109971100711017110271103711047110571106711077110871109711107111171112711137111471115711167111771118711197112071121711227112371124711257112671127711287112971130711317113271133711347113571136711377113871139711407114171142711437114471145711467114771148711497115071151711527115371154711557115671157711587115971160711617116271163711647116571166711677116871169711707117171172711737117471175711767117771178711797118071181711827118371184711857118671187711887118971190711917119271193711947119571196711977119871199712007120171202712037120471205712067120771208712097121071211712127121371214712157121671217712187121971220712217122271223712247122571226712277122871229712307123171232712337123471235712367123771238712397124071241712427124371244712457124671247712487124971250712517125271253712547125571256712577125871259712607126171262712637126471265712667126771268712697127071271712727127371274712757127671277712787127971280712817128271283712847128571286712877128871289712907129171292712937129471295712967129771298712997130071301713027130371304713057130671307713087130971310713117131271313713147131571316713177131871319713207132171322713237132471325713267132771328713297133071331713327133371334713357133671337713387133971340713417134271343713447134571346713477134871349713507135171352713537135471355713567135771358713597136071361713627136371364713657136671367713687136971370713717137271373713747137571376713777137871379713807138171382713837138471385713867138771388713897139071391713927139371394713957139671397713987139971400714017140271403714047140571406714077140871409714107141171412714137141471415714167141771418714197142071421714227142371424714257142671427714287142971430714317143271433714347143571436714377143871439714407144171442714437144471445714467144771448714497145071451714527145371454714557145671457714587145971460714617146271463714647146571466714677146871469714707147171472714737147471475714767147771478714797148071481714827148371484714857148671487714887148971490714917149271493714947149571496714977149871499715007150171502715037150471505715067150771508715097151071511715127151371514715157151671517715187151971520715217152271523715247152571526715277152871529715307153171532715337153471535715367153771538715397154071541715427154371544715457154671547715487154971550715517155271553715547155571556715577155871559715607156171562715637156471565715667156771568715697157071571715727157371574715757157671577715787157971580715817158271583715847158571586715877158871589715907159171592715937159471595715967159771598715997160071601716027160371604716057160671607716087160971610716117161271613716147161571616716177161871619716207162171622716237162471625716267162771628716297163071631716327163371634716357163671637716387163971640716417164271643716447164571646716477164871649716507165171652716537165471655716567165771658716597166071661716627166371664716657166671667716687166971670716717167271673716747167571676716777167871679716807168171682716837168471685716867168771688716897169071691716927169371694716957169671697716987169971700717017170271703717047170571706717077170871709717107171171712717137171471715717167171771718717197172071721717227172371724717257172671727717287172971730717317173271733717347173571736717377173871739717407174171742717437174471745717467174771748717497175071751717527175371754717557175671757717587175971760717617176271763717647176571766717677176871769717707177171772717737177471775717767177771778717797178071781717827178371784717857178671787717887178971790717917179271793717947179571796717977179871799718007180171802718037180471805718067180771808718097181071811718127181371814718157181671817718187181971820718217182271823718247182571826718277182871829718307183171832718337183471835718367183771838718397184071841718427184371844718457184671847718487184971850718517185271853718547185571856718577185871859718607186171862718637186471865718667186771868718697187071871718727187371874718757187671877718787187971880718817188271883718847188571886718877188871889718907189171892718937189471895718967189771898718997190071901719027190371904719057190671907719087190971910719117191271913719147191571916719177191871919719207192171922719237192471925719267192771928719297193071931719327193371934719357193671937719387193971940719417194271943719447194571946719477194871949719507195171952719537195471955719567195771958719597196071961719627196371964719657196671967719687196971970719717197271973719747197571976719777197871979719807198171982719837198471985719867198771988719897199071991719927199371994719957199671997719987199972000720017200272003720047200572006720077200872009720107201172012720137201472015720167201772018720197202072021720227202372024720257202672027720287202972030720317203272033720347203572036720377203872039720407204172042720437204472045720467204772048720497205072051720527205372054720557205672057720587205972060720617206272063720647206572066720677206872069720707207172072720737207472075720767207772078720797208072081720827208372084720857208672087720887208972090720917209272093720947209572096720977209872099721007210172102721037210472105721067210772108721097211072111721127211372114721157211672117721187211972120721217212272123721247212572126721277212872129721307213172132721337213472135721367213772138721397214072141721427214372144721457214672147721487214972150721517215272153721547215572156721577215872159721607216172162721637216472165721667216772168721697217072171721727217372174721757217672177721787217972180721817218272183721847218572186721877218872189721907219172192721937219472195721967219772198721997220072201722027220372204722057220672207722087220972210722117221272213722147221572216722177221872219722207222172222722237222472225722267222772228722297223072231722327223372234722357223672237722387223972240722417224272243722447224572246722477224872249722507225172252722537225472255722567225772258722597226072261722627226372264722657226672267722687226972270722717227272273722747227572276722777227872279722807228172282722837228472285722867228772288722897229072291722927229372294722957229672297722987229972300723017230272303723047230572306723077230872309723107231172312723137231472315723167231772318723197232072321723227232372324723257232672327723287232972330723317233272333723347233572336723377233872339723407234172342723437234472345723467234772348723497235072351723527235372354723557235672357723587235972360723617236272363723647236572366723677236872369723707237172372723737237472375723767237772378723797238072381723827238372384723857238672387723887238972390723917239272393723947239572396723977239872399724007240172402724037240472405724067240772408724097241072411724127241372414724157241672417724187241972420724217242272423724247242572426724277242872429724307243172432724337243472435724367243772438724397244072441724427244372444724457244672447724487244972450724517245272453724547245572456724577245872459724607246172462724637246472465724667246772468724697247072471724727247372474724757247672477724787247972480724817248272483724847248572486724877248872489724907249172492724937249472495724967249772498724997250072501725027250372504725057250672507725087250972510725117251272513725147251572516725177251872519725207252172522725237252472525725267252772528725297253072531725327253372534725357253672537725387253972540725417254272543725447254572546725477254872549725507255172552725537255472555725567255772558725597256072561725627256372564725657256672567725687256972570725717257272573725747257572576725777257872579725807258172582725837258472585725867258772588725897259072591725927259372594725957259672597725987259972600726017260272603726047260572606726077260872609726107261172612726137261472615726167261772618726197262072621726227262372624726257262672627726287262972630726317263272633726347263572636726377263872639726407264172642726437264472645726467264772648726497265072651726527265372654726557265672657726587265972660726617266272663726647266572666726677266872669726707267172672726737267472675726767267772678726797268072681726827268372684726857268672687726887268972690726917269272693726947269572696726977269872699727007270172702727037270472705727067270772708727097271072711727127271372714727157271672717727187271972720727217272272723727247272572726727277272872729727307273172732727337273472735727367273772738727397274072741727427274372744727457274672747727487274972750727517275272753727547275572756727577275872759727607276172762727637276472765727667276772768727697277072771727727277372774727757277672777727787277972780727817278272783727847278572786727877278872789727907279172792727937279472795727967279772798727997280072801728027280372804728057280672807728087280972810728117281272813728147281572816728177281872819728207282172822728237282472825728267282772828728297283072831728327283372834728357283672837728387283972840728417284272843728447284572846728477284872849728507285172852728537285472855728567285772858728597286072861728627286372864728657286672867728687286972870728717287272873728747287572876728777287872879728807288172882728837288472885728867288772888728897289072891728927289372894728957289672897728987289972900729017290272903729047290572906729077290872909729107291172912729137291472915729167291772918729197292072921729227292372924729257292672927729287292972930729317293272933729347293572936729377293872939729407294172942729437294472945729467294772948729497295072951729527295372954729557295672957729587295972960729617296272963729647296572966729677296872969729707297172972729737297472975729767297772978729797298072981729827298372984729857298672987729887298972990729917299272993729947299572996729977299872999730007300173002730037300473005730067300773008730097301073011730127301373014730157301673017730187301973020730217302273023730247302573026730277302873029730307303173032730337303473035730367303773038730397304073041730427304373044730457304673047730487304973050730517305273053730547305573056730577305873059730607306173062730637306473065730667306773068730697307073071730727307373074730757307673077730787307973080730817308273083730847308573086730877308873089730907309173092730937309473095730967309773098730997310073101731027310373104731057310673107731087310973110731117311273113731147311573116731177311873119731207312173122731237312473125731267312773128731297313073131731327313373134731357313673137731387313973140731417314273143731447314573146731477314873149731507315173152731537315473155731567315773158731597316073161731627316373164731657316673167731687316973170731717317273173731747317573176731777317873179731807318173182731837318473185731867318773188731897319073191731927319373194731957319673197731987319973200732017320273203732047320573206732077320873209732107321173212732137321473215732167321773218732197322073221732227322373224732257322673227732287322973230732317323273233732347323573236732377323873239732407324173242732437324473245732467324773248732497325073251732527325373254732557325673257732587325973260732617326273263732647326573266732677326873269732707327173272732737327473275732767327773278732797328073281732827328373284732857328673287732887328973290732917329273293732947329573296732977329873299733007330173302733037330473305733067330773308733097331073311733127331373314733157331673317733187331973320733217332273323733247332573326733277332873329733307333173332733337333473335733367333773338733397334073341733427334373344733457334673347733487334973350733517335273353733547335573356733577335873359733607336173362733637336473365733667336773368733697337073371733727337373374733757337673377733787337973380733817338273383733847338573386733877338873389733907339173392733937339473395733967339773398733997340073401734027340373404734057340673407734087340973410734117341273413734147341573416734177341873419734207342173422734237342473425734267342773428734297343073431734327343373434734357343673437734387343973440734417344273443734447344573446734477344873449734507345173452734537345473455734567345773458734597346073461734627346373464734657346673467734687346973470734717347273473734747347573476734777347873479734807348173482734837348473485734867348773488734897349073491734927349373494734957349673497734987349973500735017350273503735047350573506735077350873509735107351173512735137351473515735167351773518735197352073521735227352373524735257352673527735287352973530735317353273533735347353573536735377353873539735407354173542735437354473545735467354773548735497355073551735527355373554735557355673557735587355973560735617356273563735647356573566735677356873569735707357173572735737357473575735767357773578735797358073581735827358373584735857358673587735887358973590735917359273593735947359573596735977359873599736007360173602736037360473605736067360773608736097361073611736127361373614736157361673617736187361973620736217362273623736247362573626736277362873629736307363173632736337363473635736367363773638736397364073641736427364373644736457364673647736487364973650736517365273653736547365573656736577365873659736607366173662736637366473665736667366773668736697367073671736727367373674736757367673677736787367973680736817368273683736847368573686736877368873689736907369173692736937369473695736967369773698736997370073701737027370373704737057370673707737087370973710737117371273713737147371573716737177371873719737207372173722737237372473725737267372773728737297373073731737327373373734737357373673737737387373973740737417374273743737447374573746737477374873749737507375173752737537375473755737567375773758737597376073761737627376373764737657376673767737687376973770737717377273773737747377573776737777377873779737807378173782737837378473785737867378773788737897379073791737927379373794737957379673797737987379973800738017380273803738047380573806738077380873809738107381173812738137381473815738167381773818738197382073821738227382373824738257382673827738287382973830738317383273833738347383573836738377383873839738407384173842738437384473845738467384773848738497385073851738527385373854738557385673857738587385973860738617386273863738647386573866738677386873869738707387173872738737387473875738767387773878738797388073881738827388373884738857388673887738887388973890738917389273893738947389573896738977389873899739007390173902739037390473905739067390773908739097391073911739127391373914739157391673917739187391973920739217392273923739247392573926739277392873929739307393173932739337393473935739367393773938739397394073941739427394373944739457394673947739487394973950739517395273953739547395573956739577395873959739607396173962739637396473965739667396773968739697397073971739727397373974739757397673977739787397973980739817398273983739847398573986739877398873989739907399173992739937399473995739967399773998739997400074001740027400374004740057400674007740087400974010740117401274013740147401574016740177401874019740207402174022740237402474025740267402774028740297403074031740327403374034740357403674037740387403974040740417404274043740447404574046740477404874049740507405174052740537405474055740567405774058740597406074061740627406374064740657406674067740687406974070740717407274073740747407574076740777407874079740807408174082740837408474085740867408774088740897409074091740927409374094740957409674097740987409974100741017410274103741047410574106741077410874109741107411174112741137411474115741167411774118741197412074121741227412374124741257412674127741287412974130741317413274133741347413574136741377413874139741407414174142741437414474145741467414774148741497415074151741527415374154741557415674157741587415974160741617416274163741647416574166741677416874169741707417174172741737417474175741767417774178741797418074181741827418374184741857418674187741887418974190741917419274193741947419574196741977419874199742007420174202742037420474205742067420774208742097421074211742127421374214742157421674217742187421974220742217422274223742247422574226742277422874229742307423174232742337423474235742367423774238742397424074241742427424374244742457424674247742487424974250742517425274253742547425574256742577425874259742607426174262742637426474265742667426774268742697427074271742727427374274742757427674277742787427974280742817428274283742847428574286742877428874289742907429174292742937429474295742967429774298742997430074301743027430374304743057430674307743087430974310743117431274313743147431574316743177431874319743207432174322743237432474325743267432774328743297433074331743327433374334743357433674337743387433974340743417434274343743447434574346743477434874349743507435174352743537435474355743567435774358743597436074361743627436374364743657436674367743687436974370743717437274373743747437574376743777437874379743807438174382743837438474385743867438774388743897439074391743927439374394743957439674397743987439974400744017440274403744047440574406744077440874409744107441174412744137441474415744167441774418744197442074421744227442374424744257442674427744287442974430744317443274433744347443574436744377443874439744407444174442744437444474445744467444774448744497445074451744527445374454744557445674457744587445974460744617446274463744647446574466744677446874469744707447174472744737447474475744767447774478744797448074481744827448374484744857448674487744887448974490744917449274493744947449574496744977449874499745007450174502745037450474505745067450774508745097451074511745127451374514745157451674517745187451974520745217452274523745247452574526745277452874529745307453174532745337453474535745367453774538745397454074541745427454374544745457454674547745487454974550745517455274553745547455574556745577455874559745607456174562745637456474565745667456774568745697457074571745727457374574745757457674577745787457974580745817458274583745847458574586745877458874589745907459174592745937459474595745967459774598745997460074601746027460374604746057460674607746087460974610746117461274613746147461574616746177461874619746207462174622746237462474625746267462774628746297463074631746327463374634746357463674637746387463974640746417464274643746447464574646746477464874649746507465174652746537465474655746567465774658746597466074661746627466374664746657466674667746687466974670746717467274673746747467574676746777467874679746807468174682746837468474685746867468774688746897469074691746927469374694746957469674697746987469974700747017470274703747047470574706747077470874709747107471174712747137471474715747167471774718747197472074721747227472374724747257472674727747287472974730747317473274733747347473574736747377473874739747407474174742747437474474745747467474774748747497475074751747527475374754747557475674757747587475974760747617476274763747647476574766747677476874769747707477174772747737477474775747767477774778747797478074781747827478374784747857478674787747887478974790747917479274793747947479574796747977479874799748007480174802748037480474805748067480774808748097481074811748127481374814748157481674817748187481974820748217482274823748247482574826748277482874829748307483174832748337483474835748367483774838748397484074841748427484374844748457484674847748487484974850748517485274853748547485574856748577485874859748607486174862748637486474865748667486774868748697487074871748727487374874748757487674877748787487974880748817488274883748847488574886748877488874889748907489174892748937489474895748967489774898748997490074901749027490374904749057490674907749087490974910749117491274913749147491574916749177491874919749207492174922749237492474925749267492774928749297493074931749327493374934749357493674937749387493974940749417494274943749447494574946749477494874949749507495174952749537495474955749567495774958749597496074961749627496374964749657496674967749687496974970749717497274973749747497574976749777497874979749807498174982749837498474985749867498774988749897499074991749927499374994749957499674997749987499975000750017500275003750047500575006750077500875009750107501175012750137501475015750167501775018750197502075021750227502375024750257502675027750287502975030750317503275033750347503575036750377503875039750407504175042750437504475045750467504775048750497505075051750527505375054750557505675057750587505975060750617506275063750647506575066750677506875069750707507175072750737507475075750767507775078750797508075081750827508375084750857508675087750887508975090750917509275093750947509575096750977509875099751007510175102751037510475105751067510775108751097511075111751127511375114751157511675117751187511975120751217512275123751247512575126751277512875129751307513175132751337513475135751367513775138751397514075141751427514375144751457514675147751487514975150751517515275153751547515575156751577515875159751607516175162751637516475165751667516775168751697517075171751727517375174751757517675177751787517975180751817518275183751847518575186751877518875189751907519175192751937519475195751967519775198751997520075201752027520375204752057520675207752087520975210752117521275213752147521575216752177521875219752207522175222752237522475225752267522775228752297523075231752327523375234752357523675237752387523975240752417524275243752447524575246752477524875249752507525175252752537525475255752567525775258752597526075261752627526375264752657526675267752687526975270752717527275273752747527575276752777527875279752807528175282752837528475285752867528775288752897529075291752927529375294752957529675297752987529975300753017530275303753047530575306753077530875309753107531175312753137531475315753167531775318753197532075321753227532375324753257532675327753287532975330753317533275333753347533575336753377533875339753407534175342753437534475345753467534775348753497535075351753527535375354753557535675357753587535975360753617536275363753647536575366753677536875369753707537175372753737537475375753767537775378753797538075381753827538375384753857538675387753887538975390753917539275393753947539575396753977539875399754007540175402754037540475405754067540775408754097541075411754127541375414754157541675417754187541975420754217542275423754247542575426754277542875429754307543175432754337543475435754367543775438754397544075441754427544375444754457544675447754487544975450754517545275453754547545575456754577545875459754607546175462754637546475465754667546775468754697547075471754727547375474754757547675477754787547975480754817548275483754847548575486754877548875489754907549175492754937549475495754967549775498754997550075501755027550375504755057550675507755087550975510755117551275513755147551575516755177551875519755207552175522755237552475525755267552775528755297553075531755327553375534755357553675537755387553975540755417554275543755447554575546755477554875549755507555175552755537555475555755567555775558755597556075561755627556375564755657556675567755687556975570755717557275573755747557575576755777557875579755807558175582755837558475585755867558775588755897559075591755927559375594755957559675597755987559975600756017560275603756047560575606756077560875609756107561175612756137561475615756167561775618756197562075621756227562375624756257562675627756287562975630756317563275633756347563575636756377563875639756407564175642756437564475645756467564775648756497565075651756527565375654756557565675657756587565975660756617566275663756647566575666756677566875669756707567175672756737567475675756767567775678756797568075681756827568375684756857568675687756887568975690756917569275693756947569575696756977569875699757007570175702757037570475705757067570775708757097571075711757127571375714757157571675717757187571975720757217572275723757247572575726757277572875729757307573175732757337573475735757367573775738757397574075741757427574375744757457574675747757487574975750757517575275753757547575575756757577575875759757607576175762757637576475765757667576775768757697577075771757727577375774757757577675777757787577975780757817578275783757847578575786757877578875789757907579175792757937579475795757967579775798757997580075801758027580375804758057580675807758087580975810758117581275813758147581575816758177581875819758207582175822758237582475825758267582775828758297583075831758327583375834758357583675837758387583975840758417584275843758447584575846758477584875849758507585175852758537585475855758567585775858758597586075861758627586375864758657586675867758687586975870758717587275873758747587575876758777587875879758807588175882758837588475885758867588775888758897589075891758927589375894758957589675897758987589975900759017590275903759047590575906759077590875909759107591175912759137591475915759167591775918759197592075921759227592375924759257592675927759287592975930759317593275933759347593575936759377593875939759407594175942759437594475945759467594775948759497595075951759527595375954759557595675957759587595975960759617596275963759647596575966759677596875969759707597175972759737597475975759767597775978759797598075981759827598375984759857598675987759887598975990759917599275993759947599575996759977599875999760007600176002760037600476005760067600776008760097601076011760127601376014760157601676017760187601976020760217602276023760247602576026760277602876029760307603176032760337603476035760367603776038760397604076041760427604376044760457604676047760487604976050760517605276053760547605576056760577605876059760607606176062760637606476065760667606776068760697607076071760727607376074760757607676077760787607976080760817608276083760847608576086760877608876089760907609176092760937609476095760967609776098760997610076101761027610376104761057610676107761087610976110761117611276113761147611576116761177611876119761207612176122761237612476125761267612776128761297613076131761327613376134761357613676137761387613976140761417614276143761447614576146761477614876149761507615176152761537615476155761567615776158761597616076161761627616376164761657616676167761687616976170761717617276173761747617576176761777617876179761807618176182761837618476185761867618776188761897619076191761927619376194761957619676197761987619976200762017620276203762047620576206762077620876209762107621176212762137621476215762167621776218762197622076221762227622376224762257622676227762287622976230762317623276233762347623576236762377623876239762407624176242762437624476245762467624776248762497625076251762527625376254762557625676257762587625976260762617626276263762647626576266762677626876269762707627176272762737627476275762767627776278762797628076281762827628376284762857628676287762887628976290762917629276293762947629576296762977629876299763007630176302763037630476305763067630776308763097631076311763127631376314763157631676317763187631976320763217632276323763247632576326763277632876329763307633176332763337633476335763367633776338763397634076341763427634376344763457634676347763487634976350763517635276353763547635576356763577635876359763607636176362763637636476365763667636776368763697637076371763727637376374763757637676377763787637976380763817638276383763847638576386763877638876389763907639176392763937639476395763967639776398763997640076401764027640376404764057640676407764087640976410764117641276413764147641576416764177641876419764207642176422764237642476425764267642776428764297643076431764327643376434764357643676437764387643976440764417644276443764447644576446764477644876449764507645176452764537645476455764567645776458764597646076461764627646376464764657646676467764687646976470764717647276473764747647576476764777647876479764807648176482764837648476485764867648776488764897649076491764927649376494764957649676497764987649976500765017650276503765047650576506765077650876509765107651176512765137651476515765167651776518765197652076521765227652376524765257652676527765287652976530765317653276533765347653576536765377653876539765407654176542765437654476545765467654776548765497655076551765527655376554765557655676557765587655976560765617656276563765647656576566765677656876569765707657176572765737657476575765767657776578765797658076581765827658376584765857658676587765887658976590765917659276593765947659576596765977659876599766007660176602766037660476605766067660776608766097661076611766127661376614766157661676617766187661976620766217662276623766247662576626766277662876629766307663176632766337663476635766367663776638766397664076641766427664376644766457664676647766487664976650766517665276653766547665576656766577665876659766607666176662766637666476665766667666776668766697667076671766727667376674766757667676677766787667976680766817668276683766847668576686766877668876689766907669176692766937669476695766967669776698766997670076701767027670376704767057670676707767087670976710767117671276713767147671576716767177671876719767207672176722767237672476725767267672776728767297673076731767327673376734767357673676737767387673976740767417674276743767447674576746767477674876749767507675176752767537675476755767567675776758767597676076761767627676376764767657676676767767687676976770767717677276773767747677576776767777677876779767807678176782767837678476785767867678776788767897679076791767927679376794767957679676797767987679976800768017680276803768047680576806768077680876809768107681176812768137681476815768167681776818768197682076821768227682376824768257682676827768287682976830768317683276833768347683576836768377683876839768407684176842768437684476845768467684776848768497685076851768527685376854768557685676857768587685976860768617686276863768647686576866768677686876869768707687176872768737687476875768767687776878768797688076881768827688376884768857688676887768887688976890768917689276893768947689576896768977689876899769007690176902769037690476905769067690776908769097691076911769127691376914769157691676917769187691976920769217692276923769247692576926769277692876929769307693176932769337693476935769367693776938769397694076941769427694376944769457694676947769487694976950769517695276953769547695576956769577695876959769607696176962769637696476965769667696776968769697697076971769727697376974769757697676977769787697976980769817698276983769847698576986769877698876989769907699176992769937699476995769967699776998769997700077001770027700377004770057700677007770087700977010770117701277013770147701577016770177701877019770207702177022770237702477025770267702777028770297703077031770327703377034770357703677037770387703977040770417704277043770447704577046770477704877049770507705177052770537705477055770567705777058770597706077061770627706377064770657706677067770687706977070770717707277073770747707577076770777707877079770807708177082770837708477085770867708777088770897709077091770927709377094770957709677097770987709977100771017710277103771047710577106771077710877109771107711177112771137711477115771167711777118771197712077121771227712377124771257712677127771287712977130771317713277133771347713577136771377713877139771407714177142771437714477145771467714777148771497715077151771527715377154771557715677157771587715977160771617716277163771647716577166771677716877169771707717177172771737717477175771767717777178771797718077181771827718377184771857718677187771887718977190771917719277193771947719577196771977719877199772007720177202772037720477205772067720777208772097721077211772127721377214772157721677217772187721977220772217722277223772247722577226772277722877229772307723177232772337723477235772367723777238772397724077241772427724377244772457724677247772487724977250772517725277253772547725577256772577725877259772607726177262772637726477265772667726777268772697727077271772727727377274772757727677277772787727977280772817728277283772847728577286772877728877289772907729177292772937729477295772967729777298772997730077301773027730377304773057730677307773087730977310773117731277313773147731577316773177731877319773207732177322773237732477325773267732777328773297733077331773327733377334773357733677337773387733977340773417734277343773447734577346773477734877349773507735177352773537735477355773567735777358773597736077361773627736377364773657736677367773687736977370773717737277373773747737577376773777737877379773807738177382773837738477385773867738777388773897739077391773927739377394773957739677397773987739977400774017740277403774047740577406774077740877409774107741177412774137741477415774167741777418774197742077421774227742377424774257742677427774287742977430774317743277433774347743577436774377743877439774407744177442774437744477445774467744777448774497745077451774527745377454774557745677457774587745977460774617746277463774647746577466774677746877469774707747177472774737747477475774767747777478774797748077481774827748377484774857748677487774887748977490774917749277493774947749577496774977749877499775007750177502775037750477505775067750777508775097751077511775127751377514775157751677517775187751977520775217752277523775247752577526775277752877529775307753177532775337753477535775367753777538775397754077541775427754377544775457754677547775487754977550775517755277553775547755577556775577755877559775607756177562775637756477565775667756777568775697757077571775727757377574775757757677577775787757977580775817758277583775847758577586775877758877589775907759177592775937759477595775967759777598775997760077601776027760377604776057760677607776087760977610776117761277613776147761577616776177761877619776207762177622776237762477625776267762777628776297763077631776327763377634776357763677637776387763977640776417764277643776447764577646776477764877649776507765177652776537765477655776567765777658776597766077661776627766377664776657766677667776687766977670776717767277673776747767577676776777767877679776807768177682776837768477685776867768777688776897769077691776927769377694776957769677697776987769977700777017770277703777047770577706777077770877709777107771177712777137771477715777167771777718777197772077721777227772377724777257772677727777287772977730777317773277733777347773577736777377773877739777407774177742777437774477745777467774777748777497775077751777527775377754777557775677757777587775977760777617776277763777647776577766777677776877769777707777177772777737777477775777767777777778777797778077781777827778377784777857778677787777887778977790777917779277793777947779577796777977779877799778007780177802778037780477805778067780777808778097781077811778127781377814778157781677817778187781977820778217782277823778247782577826778277782877829778307783177832778337783477835778367783777838778397784077841778427784377844778457784677847778487784977850778517785277853778547785577856778577785877859778607786177862778637786477865778667786777868778697787077871778727787377874778757787677877778787787977880778817788277883778847788577886778877788877889778907789177892778937789477895778967789777898778997790077901779027790377904779057790677907779087790977910779117791277913779147791577916779177791877919779207792177922779237792477925779267792777928779297793077931779327793377934779357793677937779387793977940779417794277943779447794577946779477794877949779507795177952779537795477955779567795777958779597796077961779627796377964779657796677967779687796977970779717797277973779747797577976779777797877979779807798177982779837798477985779867798777988779897799077991779927799377994779957799677997779987799978000780017800278003780047800578006780077800878009780107801178012780137801478015780167801778018780197802078021780227802378024780257802678027780287802978030780317803278033780347803578036780377803878039780407804178042780437804478045780467804778048780497805078051780527805378054780557805678057780587805978060780617806278063780647806578066780677806878069780707807178072780737807478075780767807778078780797808078081780827808378084780857808678087780887808978090780917809278093780947809578096780977809878099781007810178102781037810478105781067810778108781097811078111781127811378114781157811678117781187811978120781217812278123781247812578126781277812878129781307813178132781337813478135781367813778138781397814078141781427814378144781457814678147781487814978150781517815278153781547815578156781577815878159781607816178162781637816478165781667816778168781697817078171781727817378174781757817678177781787817978180781817818278183781847818578186781877818878189781907819178192781937819478195781967819778198781997820078201782027820378204782057820678207782087820978210782117821278213782147821578216782177821878219782207822178222782237822478225782267822778228782297823078231782327823378234782357823678237782387823978240782417824278243782447824578246782477824878249782507825178252782537825478255782567825778258782597826078261782627826378264782657826678267782687826978270782717827278273782747827578276782777827878279782807828178282782837828478285782867828778288782897829078291782927829378294782957829678297782987829978300783017830278303783047830578306783077830878309783107831178312783137831478315783167831778318783197832078321783227832378324783257832678327783287832978330783317833278333783347833578336783377833878339783407834178342783437834478345783467834778348783497835078351783527835378354783557835678357783587835978360783617836278363783647836578366783677836878369783707837178372783737837478375783767837778378783797838078381783827838378384783857838678387783887838978390783917839278393783947839578396783977839878399784007840178402784037840478405784067840778408784097841078411784127841378414784157841678417784187841978420784217842278423784247842578426784277842878429784307843178432784337843478435784367843778438784397844078441784427844378444784457844678447784487844978450784517845278453784547845578456784577845878459784607846178462784637846478465784667846778468784697847078471784727847378474784757847678477784787847978480784817848278483784847848578486784877848878489784907849178492784937849478495784967849778498784997850078501785027850378504785057850678507785087850978510785117851278513785147851578516785177851878519785207852178522785237852478525785267852778528785297853078531785327853378534785357853678537785387853978540785417854278543785447854578546785477854878549785507855178552785537855478555785567855778558785597856078561785627856378564785657856678567785687856978570785717857278573785747857578576785777857878579785807858178582785837858478585785867858778588785897859078591785927859378594785957859678597785987859978600786017860278603786047860578606786077860878609786107861178612786137861478615786167861778618786197862078621786227862378624786257862678627786287862978630786317863278633786347863578636786377863878639786407864178642786437864478645786467864778648786497865078651786527865378654786557865678657786587865978660786617866278663786647866578666786677866878669786707867178672786737867478675786767867778678786797868078681786827868378684786857868678687786887868978690786917869278693786947869578696786977869878699787007870178702787037870478705787067870778708787097871078711787127871378714787157871678717787187871978720787217872278723787247872578726787277872878729787307873178732787337873478735787367873778738787397874078741787427874378744787457874678747787487874978750787517875278753787547875578756787577875878759787607876178762787637876478765787667876778768787697877078771787727877378774787757877678777787787877978780787817878278783787847878578786787877878878789787907879178792787937879478795787967879778798787997880078801788027880378804788057880678807788087880978810788117881278813788147881578816788177881878819788207882178822788237882478825788267882778828788297883078831788327883378834788357883678837788387883978840788417884278843788447884578846788477884878849788507885178852788537885478855788567885778858788597886078861788627886378864788657886678867788687886978870788717887278873788747887578876788777887878879788807888178882788837888478885788867888778888788897889078891788927889378894788957889678897788987889978900789017890278903789047890578906789077890878909789107891178912789137891478915789167891778918789197892078921789227892378924789257892678927789287892978930789317893278933789347893578936789377893878939789407894178942789437894478945789467894778948789497895078951789527895378954789557895678957789587895978960789617896278963789647896578966789677896878969789707897178972789737897478975789767897778978789797898078981789827898378984789857898678987789887898978990789917899278993789947899578996789977899878999790007900179002790037900479005790067900779008790097901079011790127901379014790157901679017790187901979020790217902279023790247902579026790277902879029790307903179032790337903479035790367903779038790397904079041790427904379044790457904679047790487904979050790517905279053790547905579056790577905879059790607906179062790637906479065790667906779068790697907079071790727907379074790757907679077790787907979080790817908279083790847908579086790877908879089790907909179092790937909479095790967909779098790997910079101791027910379104791057910679107791087910979110791117911279113791147911579116791177911879119791207912179122791237912479125791267912779128791297913079131791327913379134791357913679137791387913979140791417914279143791447914579146791477914879149791507915179152791537915479155791567915779158791597916079161791627916379164791657916679167791687916979170791717917279173791747917579176791777917879179791807918179182791837918479185791867918779188791897919079191791927919379194791957919679197791987919979200792017920279203792047920579206792077920879209792107921179212792137921479215792167921779218792197922079221792227922379224792257922679227792287922979230792317923279233792347923579236792377923879239792407924179242792437924479245792467924779248792497925079251792527925379254792557925679257792587925979260792617926279263792647926579266792677926879269792707927179272792737927479275792767927779278792797928079281792827928379284792857928679287792887928979290792917929279293792947929579296792977929879299793007930179302793037930479305793067930779308793097931079311793127931379314793157931679317793187931979320793217932279323793247932579326793277932879329793307933179332793337933479335793367933779338793397934079341793427934379344793457934679347793487934979350793517935279353793547935579356793577935879359793607936179362793637936479365793667936779368793697937079371793727937379374793757937679377793787937979380793817938279383793847938579386793877938879389793907939179392793937939479395793967939779398793997940079401794027940379404794057940679407794087940979410794117941279413794147941579416794177941879419794207942179422794237942479425794267942779428794297943079431794327943379434794357943679437794387943979440794417944279443794447944579446794477944879449794507945179452794537945479455794567945779458794597946079461794627946379464794657946679467794687946979470794717947279473794747947579476794777947879479794807948179482794837948479485794867948779488794897949079491794927949379494794957949679497794987949979500795017950279503795047950579506795077950879509795107951179512795137951479515795167951779518795197952079521795227952379524795257952679527795287952979530795317953279533795347953579536795377953879539795407954179542795437954479545795467954779548795497955079551795527955379554795557955679557795587955979560795617956279563795647956579566795677956879569795707957179572795737957479575795767957779578795797958079581795827958379584795857958679587795887958979590795917959279593795947959579596795977959879599796007960179602796037960479605796067960779608796097961079611796127961379614796157961679617796187961979620796217962279623796247962579626796277962879629796307963179632796337963479635796367963779638796397964079641796427964379644796457964679647796487964979650796517965279653796547965579656796577965879659796607966179662796637966479665796667966779668796697967079671796727967379674796757967679677796787967979680796817968279683796847968579686796877968879689796907969179692796937969479695796967969779698796997970079701797027970379704797057970679707797087970979710797117971279713797147971579716797177971879719797207972179722797237972479725797267972779728797297973079731797327973379734797357973679737797387973979740797417974279743797447974579746797477974879749797507975179752797537975479755797567975779758797597976079761797627976379764797657976679767797687976979770797717977279773797747977579776797777977879779797807978179782797837978479785797867978779788797897979079791797927979379794797957979679797797987979979800798017980279803798047980579806798077980879809798107981179812798137981479815798167981779818798197982079821798227982379824798257982679827798287982979830798317983279833798347983579836798377983879839798407984179842798437984479845798467984779848798497985079851798527985379854798557985679857798587985979860798617986279863798647986579866798677986879869798707987179872798737987479875798767987779878798797988079881798827988379884798857988679887798887988979890798917989279893798947989579896798977989879899799007990179902799037990479905799067990779908799097991079911799127991379914799157991679917799187991979920799217992279923799247992579926799277992879929799307993179932799337993479935799367993779938799397994079941799427994379944799457994679947799487994979950799517995279953799547995579956799577995879959799607996179962799637996479965799667996779968799697997079971799727997379974799757997679977799787997979980799817998279983799847998579986799877998879989799907999179992799937999479995799967999779998799998000080001800028000380004800058000680007800088000980010800118001280013800148001580016800178001880019800208002180022800238002480025800268002780028800298003080031800328003380034800358003680037800388003980040800418004280043800448004580046800478004880049800508005180052800538005480055800568005780058800598006080061800628006380064800658006680067800688006980070800718007280073800748007580076800778007880079800808008180082800838008480085800868008780088800898009080091800928009380094800958009680097800988009980100801018010280103801048010580106801078010880109801108011180112801138011480115801168011780118801198012080121801228012380124801258012680127801288012980130801318013280133801348013580136801378013880139801408014180142801438014480145801468014780148801498015080151801528015380154801558015680157801588015980160801618016280163801648016580166801678016880169801708017180172801738017480175801768017780178801798018080181801828018380184801858018680187801888018980190801918019280193801948019580196801978019880199802008020180202802038020480205802068020780208802098021080211802128021380214802158021680217802188021980220802218022280223802248022580226802278022880229802308023180232802338023480235802368023780238802398024080241802428024380244802458024680247802488024980250802518025280253802548025580256802578025880259802608026180262802638026480265802668026780268802698027080271802728027380274802758027680277802788027980280802818028280283802848028580286802878028880289802908029180292802938029480295802968029780298802998030080301803028030380304803058030680307803088030980310803118031280313803148031580316803178031880319803208032180322803238032480325803268032780328803298033080331803328033380334803358033680337803388033980340803418034280343803448034580346803478034880349803508035180352803538035480355803568035780358803598036080361803628036380364803658036680367803688036980370803718037280373803748037580376803778037880379803808038180382803838038480385803868038780388803898039080391803928039380394803958039680397803988039980400804018040280403804048040580406804078040880409804108041180412804138041480415804168041780418804198042080421804228042380424804258042680427804288042980430804318043280433804348043580436804378043880439804408044180442804438044480445804468044780448804498045080451804528045380454804558045680457804588045980460804618046280463804648046580466804678046880469804708047180472804738047480475804768047780478804798048080481804828048380484804858048680487804888048980490804918049280493804948049580496804978049880499805008050180502805038050480505805068050780508805098051080511805128051380514805158051680517805188051980520805218052280523805248052580526805278052880529805308053180532805338053480535805368053780538805398054080541805428054380544805458054680547805488054980550805518055280553805548055580556805578055880559805608056180562805638056480565805668056780568805698057080571805728057380574805758057680577805788057980580805818058280583805848058580586805878058880589805908059180592805938059480595805968059780598805998060080601806028060380604806058060680607806088060980610806118061280613806148061580616806178061880619806208062180622806238062480625806268062780628806298063080631806328063380634806358063680637806388063980640806418064280643806448064580646806478064880649806508065180652806538065480655806568065780658806598066080661806628066380664806658066680667806688066980670806718067280673806748067580676806778067880679806808068180682806838068480685806868068780688806898069080691806928069380694806958069680697806988069980700807018070280703807048070580706807078070880709807108071180712807138071480715807168071780718807198072080721807228072380724807258072680727807288072980730807318073280733807348073580736807378073880739807408074180742807438074480745807468074780748807498075080751807528075380754807558075680757807588075980760807618076280763807648076580766807678076880769807708077180772807738077480775807768077780778807798078080781807828078380784807858078680787807888078980790807918079280793807948079580796807978079880799808008080180802808038080480805808068080780808808098081080811808128081380814808158081680817808188081980820808218082280823808248082580826808278082880829808308083180832808338083480835808368083780838808398084080841808428084380844808458084680847808488084980850808518085280853808548085580856808578085880859808608086180862808638086480865808668086780868808698087080871808728087380874808758087680877808788087980880808818088280883808848088580886808878088880889808908089180892808938089480895808968089780898808998090080901809028090380904809058090680907809088090980910809118091280913809148091580916809178091880919809208092180922809238092480925809268092780928809298093080931809328093380934809358093680937809388093980940809418094280943809448094580946809478094880949809508095180952809538095480955809568095780958809598096080961809628096380964809658096680967809688096980970809718097280973809748097580976809778097880979809808098180982809838098480985809868098780988809898099080991809928099380994809958099680997809988099981000810018100281003810048100581006810078100881009810108101181012810138101481015810168101781018810198102081021810228102381024810258102681027810288102981030810318103281033810348103581036810378103881039810408104181042810438104481045810468104781048810498105081051810528105381054810558105681057810588105981060810618106281063810648106581066810678106881069810708107181072810738107481075810768107781078810798108081081810828108381084810858108681087810888108981090810918109281093810948109581096810978109881099811008110181102811038110481105811068110781108811098111081111811128111381114811158111681117811188111981120811218112281123811248112581126811278112881129811308113181132811338113481135811368113781138811398114081141811428114381144811458114681147811488114981150811518115281153811548115581156811578115881159811608116181162811638116481165811668116781168811698117081171811728117381174811758117681177811788117981180811818118281183811848118581186811878118881189811908119181192811938119481195811968119781198811998120081201812028120381204812058120681207812088120981210812118121281213812148121581216812178121881219812208122181222812238122481225812268122781228812298123081231812328123381234812358123681237812388123981240812418124281243812448124581246812478124881249812508125181252812538125481255812568125781258812598126081261812628126381264812658126681267812688126981270812718127281273812748127581276812778127881279812808128181282812838128481285812868128781288812898129081291812928129381294812958129681297812988129981300813018130281303813048130581306813078130881309813108131181312813138131481315813168131781318813198132081321813228132381324813258132681327813288132981330813318133281333813348133581336813378133881339813408134181342813438134481345813468134781348813498135081351813528135381354813558135681357813588135981360813618136281363813648136581366813678136881369813708137181372813738137481375813768137781378813798138081381813828138381384813858138681387813888138981390813918139281393813948139581396813978139881399814008140181402814038140481405814068140781408814098141081411814128141381414814158141681417814188141981420814218142281423814248142581426814278142881429814308143181432814338143481435814368143781438814398144081441814428144381444814458144681447814488144981450814518145281453814548145581456814578145881459814608146181462814638146481465814668146781468814698147081471814728147381474814758147681477814788147981480814818148281483814848148581486814878148881489814908149181492814938149481495814968149781498814998150081501815028150381504815058150681507815088150981510815118151281513815148151581516815178151881519815208152181522815238152481525815268152781528815298153081531815328153381534815358153681537815388153981540815418154281543815448154581546815478154881549815508155181552815538155481555815568155781558815598156081561815628156381564815658156681567815688156981570815718157281573815748157581576815778157881579815808158181582815838158481585815868158781588815898159081591815928159381594815958159681597815988159981600816018160281603816048160581606816078160881609816108161181612816138161481615816168161781618816198162081621816228162381624816258162681627816288162981630816318163281633816348163581636816378163881639816408164181642816438164481645816468164781648816498165081651816528165381654816558165681657816588165981660816618166281663816648166581666816678166881669816708167181672816738167481675816768167781678816798168081681816828168381684816858168681687816888168981690816918169281693816948169581696816978169881699817008170181702817038170481705817068170781708817098171081711817128171381714817158171681717817188171981720817218172281723817248172581726817278172881729817308173181732817338173481735817368173781738817398174081741817428174381744817458174681747817488174981750817518175281753817548175581756817578175881759817608176181762817638176481765817668176781768817698177081771817728177381774817758177681777817788177981780817818178281783817848178581786817878178881789817908179181792817938179481795817968179781798817998180081801818028180381804818058180681807818088180981810818118181281813818148181581816818178181881819818208182181822818238182481825818268182781828818298183081831818328183381834818358183681837818388183981840818418184281843818448184581846818478184881849818508185181852818538185481855818568185781858818598186081861818628186381864818658186681867818688186981870818718187281873818748187581876818778187881879818808188181882818838188481885818868188781888818898189081891818928189381894818958189681897818988189981900819018190281903819048190581906819078190881909819108191181912819138191481915819168191781918819198192081921819228192381924819258192681927819288192981930819318193281933819348193581936819378193881939819408194181942819438194481945819468194781948819498195081951819528195381954819558195681957819588195981960819618196281963819648196581966819678196881969819708197181972819738197481975819768197781978819798198081981819828198381984819858198681987819888198981990819918199281993819948199581996819978199881999820008200182002820038200482005820068200782008820098201082011820128201382014820158201682017820188201982020820218202282023820248202582026820278202882029820308203182032820338203482035820368203782038820398204082041820428204382044820458204682047820488204982050820518205282053820548205582056820578205882059820608206182062820638206482065820668206782068820698207082071820728207382074820758207682077820788207982080820818208282083820848208582086820878208882089820908209182092820938209482095820968209782098820998210082101821028210382104821058210682107821088210982110821118211282113821148211582116821178211882119821208212182122821238212482125821268212782128821298213082131821328213382134821358213682137821388213982140821418214282143821448214582146821478214882149821508215182152821538215482155821568215782158821598216082161821628216382164821658216682167821688216982170821718217282173821748217582176821778217882179821808218182182821838218482185821868218782188821898219082191821928219382194821958219682197821988219982200822018220282203822048220582206822078220882209822108221182212822138221482215822168221782218822198222082221822228222382224822258222682227822288222982230822318223282233822348223582236822378223882239822408224182242822438224482245822468224782248822498225082251822528225382254822558225682257822588225982260822618226282263822648226582266822678226882269822708227182272822738227482275822768227782278822798228082281822828228382284822858228682287822888228982290822918229282293822948229582296822978229882299823008230182302823038230482305823068230782308823098231082311823128231382314823158231682317823188231982320823218232282323823248232582326823278232882329823308233182332823338233482335823368233782338823398234082341823428234382344823458234682347823488234982350823518235282353823548235582356823578235882359823608236182362823638236482365823668236782368823698237082371823728237382374823758237682377823788237982380823818238282383823848238582386823878238882389823908239182392823938239482395823968239782398823998240082401824028240382404824058240682407824088240982410824118241282413824148241582416824178241882419824208242182422824238242482425824268242782428824298243082431824328243382434824358243682437824388243982440824418244282443824448244582446824478244882449824508245182452824538245482455824568245782458824598246082461824628246382464824658246682467824688246982470824718247282473824748247582476824778247882479824808248182482824838248482485824868248782488824898249082491824928249382494824958249682497824988249982500825018250282503825048250582506825078250882509825108251182512825138251482515825168251782518825198252082521825228252382524825258252682527825288252982530825318253282533825348253582536825378253882539825408254182542825438254482545825468254782548825498255082551825528255382554825558255682557825588255982560825618256282563825648256582566825678256882569825708257182572825738257482575825768257782578825798258082581825828258382584825858258682587825888258982590825918259282593825948259582596825978259882599826008260182602826038260482605826068260782608826098261082611826128261382614826158261682617826188261982620826218262282623826248262582626826278262882629826308263182632826338263482635826368263782638826398264082641826428264382644826458264682647826488264982650826518265282653826548265582656826578265882659826608266182662826638266482665826668266782668826698267082671826728267382674826758267682677826788267982680826818268282683826848268582686826878268882689826908269182692826938269482695826968269782698826998270082701827028270382704827058270682707827088270982710827118271282713827148271582716827178271882719827208272182722827238272482725827268272782728827298273082731827328273382734827358273682737827388273982740827418274282743827448274582746827478274882749827508275182752827538275482755827568275782758827598276082761827628276382764827658276682767827688276982770827718277282773827748277582776827778277882779827808278182782827838278482785827868278782788827898279082791827928279382794827958279682797827988279982800828018280282803828048280582806828078280882809828108281182812828138281482815828168281782818828198282082821828228282382824828258282682827828288282982830828318283282833828348283582836828378283882839828408284182842828438284482845828468284782848828498285082851828528285382854828558285682857828588285982860828618286282863828648286582866828678286882869828708287182872828738287482875828768287782878828798288082881828828288382884828858288682887828888288982890828918289282893828948289582896828978289882899829008290182902829038290482905829068290782908829098291082911829128291382914829158291682917829188291982920829218292282923829248292582926829278292882929829308293182932829338293482935829368293782938829398294082941829428294382944829458294682947829488294982950829518295282953829548295582956829578295882959829608296182962829638296482965829668296782968829698297082971829728297382974829758297682977829788297982980829818298282983829848298582986829878298882989829908299182992829938299482995829968299782998829998300083001830028300383004830058300683007830088300983010830118301283013830148301583016830178301883019830208302183022830238302483025830268302783028830298303083031830328303383034830358303683037830388303983040830418304283043830448304583046830478304883049830508305183052830538305483055830568305783058830598306083061830628306383064830658306683067830688306983070830718307283073830748307583076830778307883079830808308183082830838308483085830868308783088830898309083091830928309383094830958309683097830988309983100831018310283103831048310583106831078310883109831108311183112831138311483115831168311783118831198312083121831228312383124831258312683127831288312983130831318313283133831348313583136831378313883139831408314183142831438314483145831468314783148831498315083151831528315383154831558315683157831588315983160831618316283163831648316583166831678316883169831708317183172831738317483175831768317783178831798318083181831828318383184831858318683187831888318983190831918319283193831948319583196831978319883199832008320183202832038320483205832068320783208832098321083211832128321383214832158321683217832188321983220832218322283223832248322583226832278322883229832308323183232832338323483235832368323783238832398324083241832428324383244832458324683247832488324983250832518325283253832548325583256832578325883259832608326183262832638326483265832668326783268832698327083271832728327383274832758327683277832788327983280832818328283283832848328583286832878328883289832908329183292832938329483295832968329783298832998330083301833028330383304833058330683307833088330983310833118331283313833148331583316833178331883319833208332183322833238332483325833268332783328833298333083331833328333383334833358333683337833388333983340833418334283343833448334583346833478334883349833508335183352833538335483355833568335783358833598336083361833628336383364833658336683367833688336983370833718337283373833748337583376833778337883379833808338183382833838338483385833868338783388833898339083391833928339383394833958339683397833988339983400834018340283403834048340583406834078340883409834108341183412834138341483415834168341783418834198342083421834228342383424834258342683427834288342983430834318343283433834348343583436834378343883439834408344183442834438344483445834468344783448834498345083451834528345383454834558345683457834588345983460834618346283463834648346583466834678346883469834708347183472834738347483475834768347783478834798348083481834828348383484834858348683487834888348983490834918349283493834948349583496834978349883499835008350183502835038350483505835068350783508835098351083511835128351383514835158351683517835188351983520835218352283523835248352583526835278352883529835308353183532835338353483535835368353783538835398354083541835428354383544835458354683547835488354983550835518355283553835548355583556835578355883559835608356183562835638356483565835668356783568835698357083571835728357383574835758357683577835788357983580835818358283583835848358583586835878358883589835908359183592835938359483595835968359783598835998360083601836028360383604836058360683607836088360983610836118361283613836148361583616836178361883619836208362183622836238362483625836268362783628836298363083631836328363383634836358363683637836388363983640836418364283643836448364583646836478364883649836508365183652836538365483655836568365783658836598366083661836628366383664836658366683667836688366983670836718367283673836748367583676836778367883679836808368183682836838368483685836868368783688836898369083691836928369383694836958369683697836988369983700837018370283703837048370583706837078370883709837108371183712837138371483715837168371783718837198372083721837228372383724837258372683727837288372983730837318373283733837348373583736837378373883739837408374183742837438374483745837468374783748837498375083751837528375383754837558375683757837588375983760837618376283763837648376583766837678376883769837708377183772837738377483775837768377783778837798378083781837828378383784837858378683787837888378983790837918379283793837948379583796837978379883799838008380183802838038380483805838068380783808838098381083811838128381383814838158381683817838188381983820838218382283823838248382583826838278382883829838308383183832838338383483835838368383783838838398384083841838428384383844838458384683847838488384983850838518385283853838548385583856838578385883859838608386183862838638386483865838668386783868838698387083871838728387383874838758387683877838788387983880838818388283883838848388583886838878388883889838908389183892838938389483895838968389783898838998390083901839028390383904839058390683907839088390983910839118391283913839148391583916839178391883919839208392183922839238392483925839268392783928839298393083931839328393383934839358393683937839388393983940839418394283943839448394583946839478394883949839508395183952839538395483955839568395783958839598396083961839628396383964839658396683967839688396983970839718397283973839748397583976839778397883979839808398183982839838398483985839868398783988839898399083991839928399383994839958399683997839988399984000840018400284003840048400584006840078400884009840108401184012840138401484015840168401784018840198402084021840228402384024840258402684027840288402984030840318403284033840348403584036840378403884039840408404184042840438404484045840468404784048840498405084051840528405384054840558405684057840588405984060840618406284063840648406584066840678406884069840708407184072840738407484075840768407784078840798408084081840828408384084840858408684087840888408984090840918409284093840948409584096840978409884099841008410184102841038410484105841068410784108841098411084111841128411384114841158411684117841188411984120841218412284123841248412584126841278412884129841308413184132841338413484135841368413784138841398414084141841428414384144841458414684147841488414984150841518415284153841548415584156841578415884159841608416184162841638416484165841668416784168841698417084171841728417384174841758417684177841788417984180841818418284183841848418584186841878418884189841908419184192841938419484195841968419784198841998420084201842028420384204842058420684207842088420984210842118421284213842148421584216842178421884219842208422184222842238422484225842268422784228842298423084231842328423384234842358423684237842388423984240842418424284243842448424584246842478424884249842508425184252842538425484255842568425784258842598426084261842628426384264842658426684267842688426984270842718427284273842748427584276842778427884279842808428184282842838428484285842868428784288842898429084291842928429384294842958429684297842988429984300843018430284303843048430584306843078430884309843108431184312843138431484315843168431784318843198432084321843228432384324843258432684327843288432984330843318433284333843348433584336843378433884339843408434184342843438434484345843468434784348843498435084351843528435384354843558435684357843588435984360843618436284363843648436584366843678436884369843708437184372843738437484375843768437784378843798438084381843828438384384843858438684387843888438984390843918439284393843948439584396843978439884399844008440184402844038440484405844068440784408844098441084411844128441384414844158441684417844188441984420844218442284423844248442584426844278442884429844308443184432844338443484435844368443784438844398444084441844428444384444844458444684447844488444984450844518445284453844548445584456844578445884459844608446184462844638446484465844668446784468844698447084471844728447384474844758447684477844788447984480844818448284483844848448584486844878448884489844908449184492844938449484495844968449784498844998450084501845028450384504845058450684507845088450984510845118451284513845148451584516845178451884519845208452184522845238452484525845268452784528845298453084531845328453384534845358453684537845388453984540845418454284543845448454584546845478454884549845508455184552845538455484555845568455784558845598456084561845628456384564845658456684567845688456984570845718457284573845748457584576845778457884579845808458184582845838458484585845868458784588845898459084591845928459384594845958459684597845988459984600846018460284603846048460584606846078460884609846108461184612846138461484615846168461784618846198462084621846228462384624846258462684627846288462984630846318463284633846348463584636846378463884639846408464184642846438464484645846468464784648846498465084651846528465384654846558465684657846588465984660846618466284663846648466584666846678466884669846708467184672846738467484675846768467784678846798468084681846828468384684846858468684687846888468984690846918469284693846948469584696846978469884699847008470184702847038470484705847068470784708847098471084711847128471384714847158471684717847188471984720847218472284723847248472584726847278472884729847308473184732847338473484735847368473784738847398474084741847428474384744847458474684747847488474984750847518475284753847548475584756847578475884759847608476184762847638476484765847668476784768847698477084771847728477384774847758477684777847788477984780847818478284783847848478584786847878478884789847908479184792847938479484795847968479784798847998480084801848028480384804848058480684807848088480984810848118481284813848148481584816848178481884819848208482184822848238482484825848268482784828848298483084831848328483384834848358483684837848388483984840848418484284843848448484584846848478484884849848508485184852848538485484855848568485784858848598486084861848628486384864848658486684867848688486984870848718487284873848748487584876848778487884879848808488184882848838488484885848868488784888848898489084891848928489384894848958489684897848988489984900849018490284903849048490584906849078490884909849108491184912849138491484915849168491784918849198492084921849228492384924849258492684927849288492984930849318493284933849348493584936849378493884939849408494184942849438494484945849468494784948849498495084951849528495384954849558495684957849588495984960849618496284963849648496584966849678496884969849708497184972849738497484975849768497784978849798498084981849828498384984849858498684987849888498984990849918499284993849948499584996849978499884999850008500185002850038500485005850068500785008850098501085011850128501385014850158501685017850188501985020850218502285023850248502585026850278502885029850308503185032850338503485035850368503785038850398504085041850428504385044850458504685047850488504985050850518505285053850548505585056850578505885059850608506185062850638506485065850668506785068850698507085071850728507385074850758507685077850788507985080850818508285083850848508585086850878508885089850908509185092850938509485095850968509785098850998510085101851028510385104851058510685107851088510985110851118511285113851148511585116851178511885119851208512185122851238512485125851268512785128851298513085131851328513385134851358513685137851388513985140851418514285143851448514585146851478514885149851508515185152851538515485155851568515785158851598516085161851628516385164851658516685167851688516985170851718517285173851748517585176851778517885179851808518185182851838518485185851868518785188851898519085191851928519385194851958519685197851988519985200852018520285203852048520585206852078520885209852108521185212852138521485215852168521785218852198522085221852228522385224852258522685227852288522985230852318523285233852348523585236852378523885239852408524185242852438524485245852468524785248852498525085251852528525385254852558525685257852588525985260852618526285263852648526585266852678526885269852708527185272852738527485275852768527785278852798528085281852828528385284852858528685287852888528985290852918529285293852948529585296852978529885299853008530185302853038530485305853068530785308853098531085311853128531385314853158531685317853188531985320853218532285323853248532585326853278532885329853308533185332853338533485335853368533785338853398534085341853428534385344853458534685347853488534985350853518535285353853548535585356853578535885359853608536185362853638536485365853668536785368853698537085371853728537385374853758537685377853788537985380853818538285383853848538585386853878538885389853908539185392853938539485395853968539785398853998540085401854028540385404854058540685407854088540985410854118541285413854148541585416854178541885419854208542185422854238542485425854268542785428854298543085431854328543385434854358543685437854388543985440854418544285443854448544585446854478544885449854508545185452854538545485455854568545785458854598546085461854628546385464854658546685467854688546985470854718547285473854748547585476854778547885479854808548185482854838548485485854868548785488854898549085491854928549385494854958549685497854988549985500855018550285503855048550585506855078550885509855108551185512855138551485515855168551785518855198552085521855228552385524855258552685527855288552985530855318553285533855348553585536855378553885539855408554185542855438554485545855468554785548855498555085551855528555385554855558555685557855588555985560855618556285563855648556585566855678556885569855708557185572855738557485575855768557785578855798558085581855828558385584855858558685587855888558985590855918559285593855948559585596855978559885599856008560185602856038560485605856068560785608856098561085611856128561385614856158561685617856188561985620856218562285623856248562585626856278562885629856308563185632856338563485635856368563785638856398564085641856428564385644856458564685647856488564985650856518565285653856548565585656856578565885659856608566185662856638566485665856668566785668856698567085671856728567385674856758567685677856788567985680856818568285683856848568585686856878568885689856908569185692856938569485695856968569785698856998570085701857028570385704857058570685707857088570985710857118571285713857148571585716857178571885719857208572185722857238572485725857268572785728857298573085731857328573385734857358573685737857388573985740857418574285743857448574585746857478574885749857508575185752857538575485755857568575785758857598576085761857628576385764857658576685767857688576985770857718577285773857748577585776857778577885779857808578185782857838578485785857868578785788857898579085791857928579385794857958579685797857988579985800858018580285803858048580585806858078580885809858108581185812858138581485815858168581785818858198582085821858228582385824858258582685827858288582985830858318583285833858348583585836858378583885839858408584185842858438584485845858468584785848858498585085851858528585385854858558585685857858588585985860858618586285863858648586585866858678586885869858708587185872858738587485875858768587785878858798588085881858828588385884858858588685887858888588985890858918589285893858948589585896858978589885899859008590185902859038590485905859068590785908859098591085911859128591385914859158591685917859188591985920859218592285923859248592585926859278592885929859308593185932859338593485935859368593785938859398594085941859428594385944859458594685947859488594985950859518595285953859548595585956859578595885959859608596185962859638596485965859668596785968859698597085971859728597385974859758597685977859788597985980859818598285983859848598585986859878598885989859908599185992859938599485995859968599785998859998600086001860028600386004860058600686007860088600986010860118601286013860148601586016860178601886019860208602186022860238602486025860268602786028860298603086031860328603386034860358603686037860388603986040860418604286043860448604586046860478604886049860508605186052860538605486055860568605786058860598606086061860628606386064860658606686067860688606986070860718607286073860748607586076860778607886079860808608186082860838608486085860868608786088860898609086091860928609386094860958609686097860988609986100861018610286103861048610586106861078610886109861108611186112861138611486115861168611786118861198612086121861228612386124861258612686127861288612986130861318613286133861348613586136861378613886139861408614186142861438614486145861468614786148861498615086151861528615386154861558615686157861588615986160861618616286163861648616586166861678616886169861708617186172861738617486175861768617786178861798618086181861828618386184861858618686187861888618986190861918619286193861948619586196861978619886199862008620186202862038620486205862068620786208862098621086211862128621386214862158621686217862188621986220862218622286223862248622586226862278622886229862308623186232862338623486235862368623786238862398624086241862428624386244862458624686247862488624986250862518625286253862548625586256862578625886259862608626186262862638626486265862668626786268862698627086271862728627386274862758627686277862788627986280862818628286283862848628586286862878628886289862908629186292862938629486295862968629786298862998630086301863028630386304863058630686307863088630986310863118631286313863148631586316863178631886319863208632186322863238632486325863268632786328863298633086331863328633386334863358633686337863388633986340863418634286343863448634586346863478634886349863508635186352863538635486355863568635786358863598636086361863628636386364863658636686367863688636986370863718637286373863748637586376863778637886379863808638186382863838638486385863868638786388863898639086391863928639386394863958639686397863988639986400864018640286403864048640586406864078640886409864108641186412864138641486415864168641786418864198642086421864228642386424864258642686427864288642986430864318643286433864348643586436864378643886439864408644186442864438644486445864468644786448864498645086451864528645386454864558645686457864588645986460864618646286463864648646586466864678646886469864708647186472864738647486475864768647786478864798648086481864828648386484864858648686487864888648986490864918649286493864948649586496864978649886499865008650186502865038650486505865068650786508865098651086511865128651386514865158651686517865188651986520865218652286523865248652586526865278652886529865308653186532865338653486535865368653786538865398654086541865428654386544865458654686547865488654986550865518655286553865548655586556865578655886559865608656186562865638656486565865668656786568865698657086571865728657386574865758657686577865788657986580865818658286583865848658586586865878658886589865908659186592865938659486595865968659786598865998660086601866028660386604866058660686607866088660986610866118661286613866148661586616866178661886619866208662186622866238662486625866268662786628866298663086631866328663386634866358663686637866388663986640866418664286643866448664586646866478664886649866508665186652866538665486655866568665786658866598666086661866628666386664866658666686667866688666986670866718667286673866748667586676866778667886679866808668186682866838668486685866868668786688866898669086691866928669386694866958669686697866988669986700867018670286703867048670586706867078670886709867108671186712867138671486715867168671786718867198672086721867228672386724867258672686727867288672986730867318673286733867348673586736867378673886739867408674186742867438674486745867468674786748867498675086751867528675386754867558675686757867588675986760867618676286763867648676586766867678676886769867708677186772867738677486775867768677786778867798678086781867828678386784867858678686787867888678986790867918679286793867948679586796867978679886799868008680186802868038680486805868068680786808868098681086811868128681386814868158681686817868188681986820868218682286823868248682586826868278682886829868308683186832868338683486835868368683786838868398684086841868428684386844868458684686847868488684986850868518685286853868548685586856868578685886859868608686186862868638686486865868668686786868868698687086871868728687386874868758687686877868788687986880868818688286883868848688586886868878688886889868908689186892868938689486895868968689786898868998690086901869028690386904869058690686907869088690986910869118691286913869148691586916869178691886919869208692186922869238692486925869268692786928869298693086931869328693386934869358693686937869388693986940869418694286943869448694586946869478694886949869508695186952869538695486955869568695786958869598696086961869628696386964869658696686967869688696986970869718697286973869748697586976869778697886979869808698186982869838698486985869868698786988869898699086991869928699386994869958699686997869988699987000870018700287003870048700587006870078700887009870108701187012870138701487015870168701787018870198702087021870228702387024870258702687027870288702987030870318703287033870348703587036870378703887039870408704187042870438704487045870468704787048870498705087051870528705387054870558705687057870588705987060870618706287063870648706587066870678706887069870708707187072870738707487075870768707787078870798708087081870828708387084870858708687087870888708987090870918709287093870948709587096870978709887099871008710187102871038710487105871068710787108871098711087111871128711387114871158711687117871188711987120871218712287123871248712587126871278712887129871308713187132871338713487135871368713787138871398714087141871428714387144871458714687147871488714987150871518715287153871548715587156871578715887159871608716187162871638716487165871668716787168871698717087171871728717387174871758717687177871788717987180871818718287183871848718587186871878718887189871908719187192871938719487195871968719787198871998720087201872028720387204872058720687207872088720987210872118721287213872148721587216872178721887219872208722187222872238722487225872268722787228872298723087231872328723387234872358723687237872388723987240872418724287243872448724587246872478724887249872508725187252872538725487255872568725787258872598726087261872628726387264872658726687267872688726987270872718727287273872748727587276872778727887279872808728187282872838728487285872868728787288872898729087291872928729387294872958729687297872988729987300873018730287303873048730587306873078730887309873108731187312873138731487315873168731787318873198732087321873228732387324873258732687327873288732987330873318733287333873348733587336873378733887339873408734187342873438734487345873468734787348873498735087351873528735387354873558735687357873588735987360873618736287363873648736587366873678736887369873708737187372873738737487375873768737787378873798738087381873828738387384873858738687387873888738987390873918739287393873948739587396873978739887399874008740187402874038740487405874068740787408874098741087411874128741387414874158741687417874188741987420874218742287423874248742587426874278742887429874308743187432874338743487435874368743787438874398744087441874428744387444874458744687447874488744987450874518745287453874548745587456874578745887459874608746187462874638746487465874668746787468874698747087471874728747387474874758747687477874788747987480874818748287483874848748587486874878748887489874908749187492874938749487495874968749787498874998750087501875028750387504875058750687507875088750987510875118751287513875148751587516875178751887519875208752187522875238752487525875268752787528875298753087531875328753387534875358753687537875388753987540875418754287543875448754587546875478754887549875508755187552875538755487555875568755787558875598756087561875628756387564875658756687567875688756987570875718757287573875748757587576875778757887579875808758187582875838758487585875868758787588875898759087591875928759387594875958759687597875988759987600876018760287603876048760587606876078760887609876108761187612876138761487615876168761787618876198762087621876228762387624876258762687627876288762987630876318763287633876348763587636876378763887639876408764187642876438764487645876468764787648876498765087651876528765387654876558765687657876588765987660876618766287663876648766587666876678766887669876708767187672876738767487675876768767787678876798768087681876828768387684876858768687687876888768987690876918769287693876948769587696876978769887699877008770187702877038770487705877068770787708877098771087711877128771387714877158771687717877188771987720877218772287723877248772587726877278772887729877308773187732877338773487735877368773787738877398774087741877428774387744877458774687747877488774987750877518775287753877548775587756877578775887759877608776187762877638776487765877668776787768877698777087771877728777387774877758777687777877788777987780877818778287783877848778587786877878778887789877908779187792877938779487795877968779787798877998780087801878028780387804878058780687807878088780987810878118781287813878148781587816878178781887819878208782187822878238782487825878268782787828878298783087831878328783387834878358783687837878388783987840878418784287843878448784587846878478784887849878508785187852878538785487855878568785787858878598786087861878628786387864878658786687867878688786987870878718787287873878748787587876878778787887879878808788187882878838788487885878868788787888878898789087891878928789387894878958789687897878988789987900879018790287903879048790587906879078790887909879108791187912879138791487915879168791787918879198792087921879228792387924879258792687927879288792987930879318793287933879348793587936879378793887939879408794187942879438794487945879468794787948879498795087951879528795387954879558795687957879588795987960879618796287963879648796587966879678796887969879708797187972879738797487975879768797787978879798798087981879828798387984879858798687987879888798987990879918799287993879948799587996879978799887999880008800188002880038800488005880068800788008880098801088011880128801388014880158801688017880188801988020880218802288023880248802588026880278802888029880308803188032880338803488035880368803788038880398804088041880428804388044880458804688047880488804988050880518805288053880548805588056880578805888059880608806188062880638806488065880668806788068880698807088071880728807388074880758807688077880788807988080880818808288083880848808588086880878808888089880908809188092880938809488095880968809788098880998810088101881028810388104881058810688107881088810988110881118811288113881148811588116881178811888119881208812188122881238812488125881268812788128881298813088131881328813388134881358813688137881388813988140881418814288143881448814588146881478814888149881508815188152881538815488155881568815788158881598816088161881628816388164881658816688167881688816988170881718817288173881748817588176881778817888179881808818188182881838818488185881868818788188881898819088191881928819388194881958819688197881988819988200882018820288203882048820588206882078820888209882108821188212882138821488215882168821788218882198822088221882228822388224882258822688227882288822988230882318823288233882348823588236882378823888239882408824188242882438824488245882468824788248882498825088251882528825388254882558825688257882588825988260882618826288263882648826588266882678826888269882708827188272882738827488275882768827788278882798828088281882828828388284882858828688287882888828988290882918829288293882948829588296882978829888299883008830188302883038830488305883068830788308883098831088311883128831388314883158831688317883188831988320883218832288323883248832588326883278832888329883308833188332883338833488335883368833788338883398834088341883428834388344883458834688347883488834988350883518835288353883548835588356883578835888359883608836188362883638836488365883668836788368883698837088371883728837388374883758837688377883788837988380883818838288383883848838588386883878838888389883908839188392883938839488395883968839788398883998840088401884028840388404884058840688407884088840988410884118841288413884148841588416884178841888419884208842188422884238842488425884268842788428884298843088431884328843388434884358843688437884388843988440884418844288443884448844588446884478844888449884508845188452884538845488455884568845788458884598846088461884628846388464884658846688467884688846988470884718847288473884748847588476884778847888479884808848188482884838848488485884868848788488884898849088491884928849388494884958849688497884988849988500885018850288503885048850588506885078850888509885108851188512885138851488515885168851788518885198852088521885228852388524885258852688527885288852988530885318853288533885348853588536885378853888539885408854188542885438854488545885468854788548885498855088551885528855388554885558855688557885588855988560885618856288563885648856588566885678856888569885708857188572885738857488575885768857788578885798858088581885828858388584885858858688587885888858988590885918859288593885948859588596885978859888599886008860188602886038860488605886068860788608886098861088611886128861388614886158861688617886188861988620886218862288623886248862588626886278862888629886308863188632886338863488635886368863788638886398864088641886428864388644886458864688647886488864988650886518865288653886548865588656886578865888659886608866188662886638866488665886668866788668886698867088671886728867388674886758867688677886788867988680886818868288683886848868588686886878868888689886908869188692886938869488695886968869788698886998870088701887028870388704887058870688707887088870988710887118871288713887148871588716887178871888719887208872188722887238872488725887268872788728887298873088731887328873388734887358873688737887388873988740887418874288743887448874588746887478874888749887508875188752887538875488755887568875788758887598876088761887628876388764887658876688767887688876988770887718877288773887748877588776887778877888779887808878188782887838878488785887868878788788887898879088791887928879388794887958879688797887988879988800888018880288803888048880588806888078880888809888108881188812888138881488815888168881788818888198882088821888228882388824888258882688827888288882988830888318883288833888348883588836888378883888839888408884188842888438884488845888468884788848888498885088851888528885388854888558885688857888588885988860888618886288863888648886588866888678886888869888708887188872888738887488875888768887788878888798888088881888828888388884888858888688887888888888988890888918889288893888948889588896888978889888899889008890188902889038890488905889068890788908889098891088911889128891388914889158891688917889188891988920889218892288923889248892588926889278892888929889308893188932889338893488935889368893788938889398894088941889428894388944889458894688947889488894988950889518895288953889548895588956889578895888959889608896188962889638896488965889668896788968889698897088971889728897388974889758897688977889788897988980889818898288983889848898588986889878898888989889908899188992889938899488995889968899788998889998900089001890028900389004890058900689007890088900989010890118901289013890148901589016890178901889019890208902189022890238902489025890268902789028890298903089031890328903389034890358903689037890388903989040890418904289043890448904589046890478904889049890508905189052890538905489055890568905789058890598906089061890628906389064890658906689067890688906989070890718907289073890748907589076890778907889079890808908189082890838908489085890868908789088890898909089091890928909389094890958909689097890988909989100891018910289103891048910589106891078910889109891108911189112891138911489115891168911789118891198912089121891228912389124891258912689127891288912989130891318913289133891348913589136891378913889139891408914189142891438914489145891468914789148891498915089151891528915389154891558915689157891588915989160891618916289163891648916589166891678916889169891708917189172891738917489175891768917789178891798918089181891828918389184891858918689187891888918989190891918919289193891948919589196891978919889199892008920189202892038920489205892068920789208892098921089211892128921389214892158921689217892188921989220892218922289223892248922589226892278922889229892308923189232892338923489235892368923789238892398924089241892428924389244892458924689247892488924989250892518925289253892548925589256892578925889259892608926189262892638926489265892668926789268892698927089271892728927389274892758927689277892788927989280892818928289283892848928589286892878928889289892908929189292892938929489295892968929789298892998930089301893028930389304893058930689307893088930989310893118931289313893148931589316893178931889319893208932189322893238932489325893268932789328893298933089331893328933389334893358933689337893388933989340893418934289343893448934589346893478934889349893508935189352893538935489355893568935789358893598936089361893628936389364893658936689367893688936989370893718937289373893748937589376893778937889379893808938189382893838938489385893868938789388893898939089391893928939389394893958939689397893988939989400894018940289403894048940589406894078940889409894108941189412894138941489415894168941789418894198942089421894228942389424894258942689427894288942989430894318943289433894348943589436894378943889439894408944189442894438944489445894468944789448894498945089451894528945389454894558945689457894588945989460894618946289463894648946589466894678946889469894708947189472894738947489475894768947789478894798948089481894828948389484894858948689487894888948989490894918949289493894948949589496894978949889499895008950189502895038950489505895068950789508895098951089511895128951389514895158951689517895188951989520895218952289523895248952589526895278952889529895308953189532895338953489535895368953789538895398954089541895428954389544895458954689547895488954989550895518955289553895548955589556895578955889559895608956189562895638956489565895668956789568895698957089571895728957389574895758957689577895788957989580895818958289583895848958589586895878958889589895908959189592895938959489595895968959789598895998960089601896028960389604896058960689607896088960989610896118961289613896148961589616896178961889619896208962189622896238962489625896268962789628896298963089631896328963389634896358963689637896388963989640896418964289643896448964589646896478964889649896508965189652896538965489655896568965789658896598966089661896628966389664896658966689667896688966989670896718967289673896748967589676896778967889679896808968189682896838968489685896868968789688896898969089691896928969389694896958969689697896988969989700897018970289703897048970589706897078970889709897108971189712897138971489715897168971789718897198972089721897228972389724897258972689727897288972989730897318973289733897348973589736897378973889739897408974189742897438974489745897468974789748897498975089751897528975389754897558975689757897588975989760897618976289763897648976589766897678976889769897708977189772897738977489775897768977789778897798978089781897828978389784897858978689787897888978989790897918979289793897948979589796897978979889799898008980189802898038980489805898068980789808898098981089811898128981389814898158981689817898188981989820898218982289823898248982589826898278982889829898308983189832898338983489835898368983789838898398984089841898428984389844898458984689847898488984989850898518985289853898548985589856898578985889859898608986189862898638986489865898668986789868898698987089871898728987389874898758987689877898788987989880898818988289883898848988589886898878988889889898908989189892898938989489895898968989789898898998990089901899028990389904899058990689907899088990989910899118991289913899148991589916899178991889919899208992189922899238992489925899268992789928899298993089931899328993389934899358993689937899388993989940899418994289943899448994589946899478994889949899508995189952899538995489955899568995789958899598996089961899628996389964899658996689967899688996989970899718997289973899748997589976899778997889979899808998189982899838998489985899868998789988899898999089991899928999389994899958999689997899988999990000900019000290003900049000590006900079000890009900109001190012900139001490015900169001790018900199002090021900229002390024900259002690027900289002990030900319003290033900349003590036900379003890039900409004190042900439004490045900469004790048900499005090051900529005390054900559005690057900589005990060900619006290063900649006590066900679006890069900709007190072900739007490075900769007790078900799008090081900829008390084900859008690087900889008990090900919009290093900949009590096900979009890099901009010190102901039010490105901069010790108901099011090111901129011390114901159011690117901189011990120901219012290123901249012590126901279012890129901309013190132901339013490135901369013790138901399014090141901429014390144901459014690147901489014990150901519015290153901549015590156901579015890159901609016190162901639016490165901669016790168901699017090171901729017390174901759017690177901789017990180901819018290183901849018590186901879018890189901909019190192901939019490195901969019790198901999020090201902029020390204902059020690207902089020990210902119021290213902149021590216902179021890219902209022190222902239022490225902269022790228902299023090231902329023390234902359023690237902389023990240902419024290243902449024590246902479024890249902509025190252902539025490255902569025790258902599026090261902629026390264902659026690267902689026990270902719027290273902749027590276902779027890279902809028190282902839028490285902869028790288902899029090291902929029390294902959029690297902989029990300903019030290303903049030590306903079030890309903109031190312903139031490315903169031790318903199032090321903229032390324903259032690327903289032990330903319033290333903349033590336903379033890339903409034190342903439034490345903469034790348903499035090351903529035390354903559035690357903589035990360903619036290363903649036590366903679036890369903709037190372903739037490375903769037790378903799038090381903829038390384903859038690387903889038990390903919039290393903949039590396903979039890399904009040190402904039040490405904069040790408904099041090411904129041390414904159041690417904189041990420904219042290423904249042590426904279042890429904309043190432904339043490435904369043790438904399044090441904429044390444904459044690447904489044990450904519045290453904549045590456904579045890459904609046190462904639046490465904669046790468904699047090471904729047390474904759047690477904789047990480904819048290483904849048590486904879048890489904909049190492904939049490495904969049790498904999050090501905029050390504905059050690507905089050990510905119051290513905149051590516905179051890519905209052190522905239052490525905269052790528905299053090531905329053390534905359053690537905389053990540905419054290543905449054590546905479054890549905509055190552905539055490555905569055790558905599056090561905629056390564905659056690567905689056990570905719057290573905749057590576905779057890579905809058190582905839058490585905869058790588905899059090591905929059390594905959059690597905989059990600906019060290603906049060590606906079060890609906109061190612906139061490615906169061790618906199062090621906229062390624906259062690627906289062990630906319063290633906349063590636906379063890639906409064190642906439064490645906469064790648906499065090651906529065390654906559065690657906589065990660906619066290663906649066590666906679066890669906709067190672906739067490675906769067790678906799068090681906829068390684906859068690687906889068990690906919069290693906949069590696906979069890699907009070190702907039070490705907069070790708907099071090711907129071390714907159071690717907189071990720907219072290723907249072590726907279072890729907309073190732907339073490735907369073790738907399074090741907429074390744907459074690747907489074990750907519075290753907549075590756907579075890759907609076190762907639076490765907669076790768907699077090771907729077390774907759077690777907789077990780907819078290783907849078590786907879078890789907909079190792907939079490795907969079790798907999080090801908029080390804908059080690807908089080990810908119081290813908149081590816908179081890819908209082190822908239082490825908269082790828908299083090831908329083390834908359083690837908389083990840908419084290843908449084590846908479084890849908509085190852908539085490855908569085790858908599086090861908629086390864908659086690867908689086990870908719087290873908749087590876908779087890879908809088190882908839088490885908869088790888908899089090891908929089390894908959089690897908989089990900909019090290903909049090590906909079090890909909109091190912909139091490915909169091790918909199092090921909229092390924909259092690927909289092990930909319093290933909349093590936909379093890939909409094190942909439094490945909469094790948909499095090951909529095390954909559095690957909589095990960909619096290963909649096590966909679096890969909709097190972909739097490975909769097790978909799098090981909829098390984909859098690987909889098990990909919099290993909949099590996909979099890999910009100191002910039100491005910069100791008910099101091011910129101391014910159101691017910189101991020910219102291023910249102591026910279102891029910309103191032910339103491035910369103791038910399104091041910429104391044910459104691047910489104991050910519105291053910549105591056910579105891059910609106191062910639106491065910669106791068910699107091071910729107391074910759107691077910789107991080910819108291083910849108591086910879108891089910909109191092910939109491095910969109791098910999110091101911029110391104911059110691107911089110991110911119111291113911149111591116911179111891119911209112191122911239112491125911269112791128911299113091131911329113391134911359113691137911389113991140911419114291143911449114591146911479114891149911509115191152911539115491155911569115791158911599116091161911629116391164911659116691167911689116991170911719117291173911749117591176911779117891179911809118191182911839118491185911869118791188911899119091191911929119391194911959119691197911989119991200912019120291203912049120591206912079120891209912109121191212912139121491215912169121791218912199122091221912229122391224912259122691227912289122991230912319123291233912349123591236912379123891239912409124191242912439124491245912469124791248912499125091251912529125391254912559125691257912589125991260912619126291263912649126591266912679126891269912709127191272912739127491275912769127791278912799128091281912829128391284912859128691287912889128991290912919129291293912949129591296912979129891299913009130191302913039130491305913069130791308913099131091311913129131391314913159131691317913189131991320913219132291323913249132591326913279132891329913309133191332913339133491335913369133791338913399134091341913429134391344913459134691347913489134991350913519135291353913549135591356913579135891359913609136191362913639136491365913669136791368913699137091371913729137391374913759137691377913789137991380913819138291383913849138591386913879138891389913909139191392913939139491395913969139791398913999140091401914029140391404914059140691407914089140991410914119141291413914149141591416914179141891419914209142191422914239142491425914269142791428914299143091431914329143391434914359143691437914389143991440914419144291443914449144591446914479144891449914509145191452914539145491455914569145791458914599146091461914629146391464914659146691467914689146991470914719147291473914749147591476914779147891479914809148191482914839148491485914869148791488914899149091491914929149391494914959149691497914989149991500915019150291503915049150591506915079150891509915109151191512915139151491515915169151791518915199152091521915229152391524915259152691527915289152991530915319153291533915349153591536915379153891539915409154191542915439154491545915469154791548915499155091551915529155391554915559155691557915589155991560915619156291563915649156591566915679156891569915709157191572915739157491575915769157791578915799158091581915829158391584915859158691587915889158991590915919159291593915949159591596915979159891599916009160191602916039160491605916069160791608916099161091611916129161391614916159161691617916189161991620916219162291623916249162591626916279162891629916309163191632916339163491635916369163791638916399164091641916429164391644916459164691647916489164991650916519165291653916549165591656916579165891659916609166191662916639166491665916669166791668916699167091671916729167391674916759167691677916789167991680916819168291683916849168591686916879168891689916909169191692916939169491695916969169791698916999170091701917029170391704917059170691707917089170991710917119171291713917149171591716917179171891719917209172191722917239172491725917269172791728917299173091731917329173391734917359173691737917389173991740917419174291743917449174591746917479174891749917509175191752917539175491755917569175791758917599176091761917629176391764917659176691767917689176991770917719177291773917749177591776917779177891779917809178191782917839178491785917869178791788917899179091791917929179391794917959179691797917989179991800918019180291803918049180591806918079180891809918109181191812918139181491815918169181791818918199182091821918229182391824918259182691827918289182991830918319183291833918349183591836918379183891839918409184191842918439184491845918469184791848918499185091851918529185391854918559185691857918589185991860918619186291863918649186591866918679186891869918709187191872918739187491875918769187791878918799188091881918829188391884918859188691887918889188991890918919189291893918949189591896918979189891899919009190191902919039190491905919069190791908919099191091911919129191391914919159191691917919189191991920919219192291923919249192591926919279192891929919309193191932919339193491935919369193791938919399194091941919429194391944919459194691947919489194991950919519195291953919549195591956919579195891959919609196191962919639196491965919669196791968919699197091971919729197391974919759197691977919789197991980919819198291983919849198591986919879198891989919909199191992919939199491995919969199791998919999200092001920029200392004920059200692007920089200992010920119201292013920149201592016920179201892019920209202192022920239202492025920269202792028920299203092031920329203392034920359203692037920389203992040920419204292043920449204592046920479204892049920509205192052920539205492055920569205792058920599206092061920629206392064920659206692067920689206992070920719207292073920749207592076920779207892079920809208192082920839208492085920869208792088920899209092091920929209392094920959209692097920989209992100921019210292103921049210592106921079210892109921109211192112921139211492115921169211792118921199212092121921229212392124921259212692127921289212992130921319213292133921349213592136921379213892139921409214192142921439214492145921469214792148921499215092151921529215392154921559215692157921589215992160921619216292163921649216592166921679216892169921709217192172921739217492175921769217792178921799218092181921829218392184921859218692187921889218992190921919219292193921949219592196921979219892199922009220192202922039220492205922069220792208922099221092211922129221392214922159221692217922189221992220922219222292223922249222592226922279222892229922309223192232922339223492235922369223792238922399224092241922429224392244922459224692247922489224992250922519225292253922549225592256922579225892259922609226192262922639226492265922669226792268922699227092271922729227392274922759227692277922789227992280922819228292283922849228592286922879228892289922909229192292922939229492295922969229792298922999230092301923029230392304923059230692307923089230992310923119231292313923149231592316923179231892319923209232192322923239232492325923269232792328923299233092331923329233392334923359233692337923389233992340923419234292343923449234592346923479234892349923509235192352923539235492355923569235792358923599236092361923629236392364923659236692367923689236992370923719237292373923749237592376923779237892379923809238192382923839238492385923869238792388923899239092391923929239392394923959239692397923989239992400924019240292403924049240592406924079240892409924109241192412924139241492415924169241792418924199242092421924229242392424924259242692427924289242992430924319243292433924349243592436924379243892439924409244192442924439244492445924469244792448924499245092451924529245392454924559245692457924589245992460924619246292463924649246592466924679246892469924709247192472924739247492475924769247792478924799248092481924829248392484924859248692487924889248992490924919249292493924949249592496924979249892499925009250192502925039250492505925069250792508925099251092511925129251392514925159251692517925189251992520925219252292523925249252592526925279252892529925309253192532925339253492535925369253792538925399254092541925429254392544925459254692547925489254992550925519255292553925549255592556925579255892559925609256192562925639256492565925669256792568925699257092571925729257392574925759257692577925789257992580925819258292583925849258592586925879258892589925909259192592925939259492595925969259792598925999260092601926029260392604926059260692607926089260992610926119261292613926149261592616926179261892619926209262192622926239262492625926269262792628926299263092631926329263392634926359263692637926389263992640926419264292643926449264592646926479264892649926509265192652926539265492655926569265792658926599266092661926629266392664926659266692667926689266992670926719267292673926749267592676926779267892679926809268192682926839268492685926869268792688926899269092691926929269392694926959269692697926989269992700927019270292703927049270592706927079270892709927109271192712927139271492715927169271792718927199272092721927229272392724927259272692727927289272992730927319273292733927349273592736927379273892739927409274192742927439274492745927469274792748927499275092751927529275392754927559275692757927589275992760927619276292763927649276592766927679276892769927709277192772927739277492775927769277792778927799278092781927829278392784927859278692787927889278992790927919279292793927949279592796927979279892799928009280192802928039280492805928069280792808928099281092811928129281392814928159281692817928189281992820928219282292823928249282592826928279282892829928309283192832928339283492835928369283792838928399284092841928429284392844928459284692847928489284992850928519285292853928549285592856928579285892859928609286192862928639286492865928669286792868928699287092871928729287392874928759287692877928789287992880928819288292883928849288592886928879288892889928909289192892928939289492895928969289792898928999290092901929029290392904929059290692907929089290992910929119291292913929149291592916929179291892919929209292192922929239292492925929269292792928929299293092931929329293392934929359293692937929389293992940929419294292943929449294592946929479294892949929509295192952929539295492955929569295792958929599296092961929629296392964929659296692967929689296992970929719297292973929749297592976929779297892979929809298192982929839298492985929869298792988929899299092991929929299392994929959299692997929989299993000930019300293003930049300593006930079300893009930109301193012930139301493015930169301793018930199302093021930229302393024930259302693027930289302993030930319303293033930349303593036930379303893039930409304193042930439304493045930469304793048930499305093051930529305393054930559305693057930589305993060930619306293063930649306593066930679306893069930709307193072930739307493075930769307793078930799308093081930829308393084930859308693087930889308993090930919309293093930949309593096930979309893099931009310193102931039310493105931069310793108931099311093111931129311393114931159311693117931189311993120931219312293123931249312593126931279312893129931309313193132931339313493135931369313793138931399314093141931429314393144931459314693147931489314993150931519315293153931549315593156931579315893159931609316193162931639316493165931669316793168931699317093171931729317393174931759317693177931789317993180931819318293183931849318593186931879318893189931909319193192931939319493195931969319793198931999320093201932029320393204932059320693207932089320993210932119321293213932149321593216932179321893219932209322193222932239322493225932269322793228932299323093231932329323393234932359323693237932389323993240932419324293243932449324593246932479324893249932509325193252932539325493255932569325793258932599326093261932629326393264932659326693267932689326993270932719327293273932749327593276932779327893279932809328193282932839328493285932869328793288932899329093291932929329393294932959329693297932989329993300933019330293303933049330593306933079330893309933109331193312933139331493315933169331793318933199332093321933229332393324933259332693327933289332993330933319333293333933349333593336933379333893339933409334193342933439334493345933469334793348933499335093351933529335393354933559335693357933589335993360933619336293363933649336593366933679336893369933709337193372933739337493375933769337793378933799338093381933829338393384933859338693387933889338993390933919339293393933949339593396933979339893399934009340193402934039340493405934069340793408934099341093411934129341393414934159341693417934189341993420934219342293423934249342593426934279342893429934309343193432934339343493435934369343793438934399344093441934429344393444934459344693447934489344993450934519345293453934549345593456934579345893459934609346193462934639346493465934669346793468934699347093471934729347393474934759347693477934789347993480934819348293483934849348593486934879348893489934909349193492934939349493495934969349793498934999350093501935029350393504935059350693507935089350993510935119351293513935149351593516935179351893519935209352193522935239352493525935269352793528935299353093531935329353393534935359353693537935389353993540935419354293543935449354593546935479354893549935509355193552935539355493555935569355793558935599356093561935629356393564935659356693567935689356993570935719357293573935749357593576935779357893579935809358193582935839358493585935869358793588935899359093591935929359393594935959359693597935989359993600936019360293603936049360593606936079360893609936109361193612936139361493615936169361793618936199362093621936229362393624936259362693627936289362993630936319363293633936349363593636936379363893639936409364193642936439364493645936469364793648936499365093651936529365393654936559365693657936589365993660936619366293663936649366593666936679366893669936709367193672936739367493675936769367793678936799368093681936829368393684936859368693687936889368993690936919369293693936949369593696936979369893699937009370193702937039370493705937069370793708937099371093711937129371393714937159371693717937189371993720937219372293723937249372593726937279372893729937309373193732937339373493735937369373793738937399374093741937429374393744937459374693747937489374993750937519375293753937549375593756937579375893759937609376193762937639376493765937669376793768937699377093771937729377393774937759377693777937789377993780937819378293783937849378593786937879378893789937909379193792937939379493795937969379793798937999380093801938029380393804938059380693807938089380993810938119381293813938149381593816938179381893819938209382193822938239382493825938269382793828938299383093831938329383393834938359383693837938389383993840938419384293843938449384593846938479384893849938509385193852938539385493855938569385793858938599386093861938629386393864938659386693867938689386993870938719387293873938749387593876938779387893879938809388193882938839388493885938869388793888938899389093891938929389393894938959389693897938989389993900939019390293903939049390593906939079390893909939109391193912939139391493915939169391793918939199392093921939229392393924939259392693927939289392993930939319393293933939349393593936939379393893939939409394193942939439394493945939469394793948939499395093951939529395393954939559395693957939589395993960939619396293963939649396593966939679396893969939709397193972939739397493975939769397793978939799398093981939829398393984939859398693987939889398993990939919399293993939949399593996939979399893999940009400194002940039400494005940069400794008940099401094011940129401394014940159401694017940189401994020940219402294023940249402594026940279402894029940309403194032940339403494035940369403794038940399404094041940429404394044940459404694047940489404994050940519405294053940549405594056940579405894059940609406194062940639406494065940669406794068940699407094071940729407394074940759407694077940789407994080940819408294083940849408594086940879408894089940909409194092940939409494095940969409794098940999410094101941029410394104941059410694107941089410994110941119411294113941149411594116941179411894119941209412194122941239412494125941269412794128941299413094131941329413394134941359413694137941389413994140941419414294143941449414594146941479414894149941509415194152941539415494155941569415794158941599416094161941629416394164941659416694167941689416994170941719417294173941749417594176941779417894179941809418194182941839418494185941869418794188941899419094191941929419394194941959419694197941989419994200942019420294203942049420594206942079420894209942109421194212942139421494215942169421794218942199422094221942229422394224942259422694227942289422994230942319423294233942349423594236942379423894239942409424194242942439424494245942469424794248942499425094251942529425394254942559425694257942589425994260942619426294263942649426594266942679426894269942709427194272942739427494275942769427794278942799428094281942829428394284942859428694287942889428994290942919429294293942949429594296942979429894299943009430194302943039430494305943069430794308943099431094311943129431394314943159431694317943189431994320943219432294323943249432594326943279432894329943309433194332943339433494335943369433794338943399434094341943429434394344943459434694347943489434994350943519435294353943549435594356943579435894359943609436194362943639436494365943669436794368943699437094371943729437394374943759437694377943789437994380943819438294383943849438594386943879438894389943909439194392943939439494395943969439794398943999440094401944029440394404944059440694407944089440994410944119441294413944149441594416944179441894419944209442194422944239442494425944269442794428944299443094431944329443394434944359443694437944389443994440944419444294443944449444594446944479444894449944509445194452944539445494455944569445794458944599446094461944629446394464944659446694467944689446994470944719447294473944749447594476944779447894479944809448194482944839448494485944869448794488944899449094491944929449394494944959449694497944989449994500945019450294503945049450594506945079450894509945109451194512945139451494515945169451794518945199452094521945229452394524945259452694527945289452994530945319453294533945349453594536945379453894539945409454194542945439454494545945469454794548945499455094551945529455394554945559455694557945589455994560945619456294563945649456594566945679456894569945709457194572945739457494575945769457794578945799458094581945829458394584945859458694587945889458994590945919459294593945949459594596945979459894599946009460194602946039460494605946069460794608946099461094611946129461394614946159461694617946189461994620946219462294623946249462594626946279462894629946309463194632946339463494635946369463794638946399464094641946429464394644946459464694647946489464994650946519465294653946549465594656946579465894659946609466194662946639466494665946669466794668946699467094671946729467394674946759467694677946789467994680946819468294683946849468594686946879468894689946909469194692946939469494695946969469794698946999470094701947029470394704947059470694707947089470994710947119471294713947149471594716947179471894719947209472194722947239472494725947269472794728947299473094731947329473394734947359473694737947389473994740947419474294743947449474594746947479474894749947509475194752947539475494755947569475794758947599476094761947629476394764947659476694767947689476994770947719477294773947749477594776947779477894779947809478194782947839478494785947869478794788947899479094791947929479394794947959479694797947989479994800948019480294803948049480594806948079480894809948109481194812948139481494815948169481794818948199482094821948229482394824948259482694827948289482994830948319483294833948349483594836948379483894839948409484194842948439484494845948469484794848948499485094851948529485394854948559485694857948589485994860948619486294863948649486594866948679486894869948709487194872948739487494875948769487794878948799488094881948829488394884948859488694887948889488994890948919489294893948949489594896948979489894899949009490194902949039490494905949069490794908949099491094911949129491394914949159491694917949189491994920949219492294923949249492594926949279492894929949309493194932949339493494935949369493794938949399494094941949429494394944949459494694947949489494994950949519495294953949549495594956949579495894959949609496194962949639496494965949669496794968949699497094971949729497394974949759497694977949789497994980949819498294983949849498594986949879498894989949909499194992949939499494995949969499794998949999500095001950029500395004950059500695007950089500995010950119501295013950149501595016950179501895019950209502195022950239502495025950269502795028950299503095031950329503395034950359503695037950389503995040950419504295043950449504595046950479504895049950509505195052950539505495055950569505795058950599506095061950629506395064950659506695067950689506995070950719507295073950749507595076950779507895079950809508195082950839508495085950869508795088950899509095091950929509395094950959509695097950989509995100951019510295103951049510595106951079510895109951109511195112951139511495115951169511795118951199512095121951229512395124951259512695127951289512995130951319513295133951349513595136951379513895139951409514195142951439514495145951469514795148951499515095151951529515395154951559515695157951589515995160951619516295163951649516595166951679516895169951709517195172951739517495175951769517795178951799518095181951829518395184951859518695187951889518995190951919519295193951949519595196951979519895199952009520195202952039520495205952069520795208952099521095211952129521395214952159521695217952189521995220952219522295223952249522595226952279522895229952309523195232952339523495235952369523795238952399524095241952429524395244952459524695247952489524995250952519525295253952549525595256952579525895259952609526195262952639526495265952669526795268952699527095271952729527395274952759527695277952789527995280952819528295283952849528595286952879528895289952909529195292952939529495295952969529795298952999530095301953029530395304953059530695307953089530995310953119531295313953149531595316953179531895319953209532195322953239532495325953269532795328953299533095331953329533395334953359533695337953389533995340953419534295343953449534595346953479534895349953509535195352953539535495355953569535795358953599536095361953629536395364953659536695367953689536995370953719537295373953749537595376953779537895379953809538195382953839538495385953869538795388953899539095391953929539395394953959539695397953989539995400954019540295403954049540595406954079540895409954109541195412954139541495415954169541795418954199542095421954229542395424954259542695427954289542995430954319543295433954349543595436954379543895439954409544195442954439544495445954469544795448954499545095451954529545395454954559545695457954589545995460954619546295463954649546595466954679546895469954709547195472954739547495475954769547795478954799548095481954829548395484954859548695487954889548995490954919549295493954949549595496954979549895499955009550195502955039550495505955069550795508955099551095511955129551395514955159551695517955189551995520955219552295523955249552595526955279552895529955309553195532955339553495535955369553795538955399554095541955429554395544955459554695547955489554995550955519555295553955549555595556955579555895559955609556195562955639556495565955669556795568955699557095571955729557395574955759557695577955789557995580955819558295583955849558595586955879558895589955909559195592955939559495595955969559795598955999560095601956029560395604956059560695607956089560995610956119561295613956149561595616956179561895619956209562195622956239562495625956269562795628956299563095631956329563395634956359563695637956389563995640956419564295643956449564595646956479564895649956509565195652956539565495655956569565795658956599566095661956629566395664956659566695667956689566995670956719567295673956749567595676956779567895679956809568195682956839568495685956869568795688956899569095691956929569395694956959569695697956989569995700957019570295703957049570595706957079570895709957109571195712957139571495715957169571795718957199572095721957229572395724957259572695727957289572995730957319573295733957349573595736957379573895739957409574195742957439574495745957469574795748957499575095751957529575395754957559575695757957589575995760957619576295763957649576595766957679576895769957709577195772957739577495775957769577795778957799578095781957829578395784957859578695787957889578995790957919579295793957949579595796957979579895799958009580195802958039580495805958069580795808958099581095811958129581395814958159581695817958189581995820958219582295823958249582595826958279582895829958309583195832958339583495835958369583795838958399584095841958429584395844958459584695847958489584995850958519585295853958549585595856958579585895859958609586195862958639586495865958669586795868958699587095871958729587395874958759587695877958789587995880958819588295883958849588595886958879588895889958909589195892958939589495895958969589795898958999590095901959029590395904959059590695907959089590995910959119591295913959149591595916959179591895919959209592195922959239592495925959269592795928959299593095931959329593395934959359593695937959389593995940959419594295943959449594595946959479594895949959509595195952959539595495955959569595795958959599596095961959629596395964959659596695967959689596995970959719597295973959749597595976959779597895979959809598195982959839598495985959869598795988959899599095991959929599395994959959599695997959989599996000960019600296003960049600596006960079600896009960109601196012960139601496015960169601796018960199602096021960229602396024960259602696027960289602996030960319603296033960349603596036960379603896039960409604196042960439604496045960469604796048960499605096051960529605396054960559605696057960589605996060960619606296063960649606596066960679606896069960709607196072960739607496075960769607796078960799608096081960829608396084960859608696087960889608996090960919609296093960949609596096960979609896099961009610196102961039610496105961069610796108961099611096111961129611396114961159611696117961189611996120961219612296123961249612596126961279612896129961309613196132961339613496135961369613796138961399614096141961429614396144961459614696147961489614996150961519615296153961549615596156961579615896159961609616196162961639616496165961669616796168961699617096171961729617396174961759617696177961789617996180961819618296183961849618596186961879618896189961909619196192961939619496195961969619796198961999620096201962029620396204962059620696207962089620996210962119621296213962149621596216962179621896219962209622196222962239622496225962269622796228962299623096231962329623396234962359623696237962389623996240962419624296243962449624596246962479624896249962509625196252962539625496255962569625796258962599626096261962629626396264962659626696267962689626996270962719627296273962749627596276962779627896279962809628196282962839628496285962869628796288962899629096291962929629396294962959629696297962989629996300963019630296303963049630596306963079630896309963109631196312963139631496315963169631796318963199632096321963229632396324963259632696327963289632996330963319633296333963349633596336963379633896339963409634196342963439634496345963469634796348963499635096351963529635396354963559635696357963589635996360963619636296363963649636596366963679636896369963709637196372963739637496375963769637796378963799638096381963829638396384963859638696387963889638996390963919639296393963949639596396963979639896399964009640196402964039640496405964069640796408964099641096411964129641396414964159641696417964189641996420964219642296423964249642596426964279642896429964309643196432964339643496435964369643796438964399644096441964429644396444964459644696447964489644996450964519645296453964549645596456964579645896459964609646196462964639646496465964669646796468964699647096471964729647396474964759647696477964789647996480964819648296483964849648596486964879648896489964909649196492964939649496495964969649796498964999650096501965029650396504965059650696507965089650996510965119651296513965149651596516965179651896519965209652196522965239652496525965269652796528965299653096531965329653396534965359653696537965389653996540965419654296543965449654596546965479654896549965509655196552965539655496555965569655796558965599656096561965629656396564965659656696567965689656996570965719657296573965749657596576965779657896579965809658196582965839658496585965869658796588965899659096591965929659396594965959659696597965989659996600966019660296603966049660596606966079660896609966109661196612966139661496615966169661796618966199662096621966229662396624966259662696627966289662996630966319663296633966349663596636966379663896639966409664196642966439664496645966469664796648966499665096651966529665396654966559665696657966589665996660966619666296663966649666596666966679666896669966709667196672966739667496675966769667796678966799668096681966829668396684966859668696687966889668996690966919669296693966949669596696966979669896699967009670196702967039670496705967069670796708967099671096711967129671396714967159671696717967189671996720967219672296723967249672596726967279672896729967309673196732967339673496735967369673796738967399674096741967429674396744967459674696747967489674996750967519675296753967549675596756967579675896759967609676196762967639676496765967669676796768967699677096771967729677396774967759677696777967789677996780967819678296783967849678596786967879678896789967909679196792967939679496795967969679796798967999680096801968029680396804968059680696807968089680996810968119681296813968149681596816968179681896819968209682196822968239682496825968269682796828968299683096831968329683396834968359683696837968389683996840968419684296843968449684596846968479684896849968509685196852968539685496855968569685796858968599686096861968629686396864968659686696867968689686996870968719687296873968749687596876968779687896879968809688196882968839688496885968869688796888968899689096891968929689396894968959689696897968989689996900969019690296903969049690596906969079690896909969109691196912969139691496915969169691796918969199692096921969229692396924969259692696927969289692996930969319693296933969349693596936969379693896939969409694196942969439694496945969469694796948969499695096951969529695396954969559695696957969589695996960969619696296963969649696596966969679696896969969709697196972969739697496975969769697796978969799698096981969829698396984969859698696987969889698996990969919699296993969949699596996969979699896999970009700197002970039700497005970069700797008970099701097011970129701397014970159701697017970189701997020970219702297023970249702597026970279702897029970309703197032970339703497035970369703797038970399704097041970429704397044970459704697047970489704997050970519705297053970549705597056970579705897059970609706197062970639706497065970669706797068970699707097071970729707397074970759707697077970789707997080970819708297083970849708597086970879708897089970909709197092970939709497095970969709797098970999710097101971029710397104971059710697107971089710997110971119711297113971149711597116971179711897119971209712197122971239712497125971269712797128971299713097131971329713397134971359713697137971389713997140971419714297143971449714597146971479714897149971509715197152971539715497155971569715797158971599716097161971629716397164971659716697167971689716997170971719717297173971749717597176971779717897179971809718197182971839718497185971869718797188971899719097191971929719397194971959719697197971989719997200972019720297203972049720597206972079720897209972109721197212972139721497215972169721797218972199722097221972229722397224972259722697227972289722997230972319723297233972349723597236972379723897239972409724197242972439724497245972469724797248972499725097251972529725397254972559725697257972589725997260972619726297263972649726597266972679726897269972709727197272972739727497275972769727797278972799728097281972829728397284972859728697287972889728997290972919729297293972949729597296972979729897299973009730197302973039730497305973069730797308973099731097311973129731397314973159731697317973189731997320973219732297323973249732597326973279732897329973309733197332973339733497335973369733797338973399734097341973429734397344973459734697347973489734997350973519735297353973549735597356973579735897359973609736197362973639736497365973669736797368973699737097371973729737397374973759737697377973789737997380973819738297383973849738597386973879738897389973909739197392973939739497395973969739797398973999740097401974029740397404974059740697407974089740997410974119741297413974149741597416974179741897419974209742197422974239742497425974269742797428974299743097431974329743397434974359743697437974389743997440974419744297443974449744597446974479744897449974509745197452974539745497455974569745797458974599746097461974629746397464974659746697467974689746997470974719747297473974749747597476974779747897479974809748197482974839748497485974869748797488974899749097491974929749397494974959749697497974989749997500975019750297503975049750597506975079750897509975109751197512975139751497515975169751797518975199752097521975229752397524975259752697527975289752997530975319753297533975349753597536975379753897539975409754197542975439754497545975469754797548975499755097551975529755397554975559755697557975589755997560975619756297563975649756597566975679756897569975709757197572975739757497575975769757797578975799758097581975829758397584975859758697587975889758997590975919759297593975949759597596975979759897599976009760197602976039760497605976069760797608976099761097611976129761397614976159761697617976189761997620976219762297623976249762597626976279762897629976309763197632976339763497635976369763797638976399764097641976429764397644976459764697647976489764997650976519765297653976549765597656976579765897659976609766197662976639766497665976669766797668976699767097671976729767397674976759767697677976789767997680976819768297683976849768597686976879768897689976909769197692976939769497695976969769797698976999770097701977029770397704977059770697707977089770997710977119771297713977149771597716977179771897719977209772197722977239772497725977269772797728977299773097731977329773397734977359773697737977389773997740977419774297743977449774597746977479774897749977509775197752977539775497755977569775797758977599776097761977629776397764977659776697767977689776997770977719777297773977749777597776977779777897779977809778197782977839778497785977869778797788977899779097791977929779397794977959779697797977989779997800978019780297803978049780597806978079780897809978109781197812978139781497815978169781797818978199782097821978229782397824978259782697827978289782997830978319783297833978349783597836978379783897839978409784197842978439784497845978469784797848978499785097851978529785397854978559785697857978589785997860978619786297863978649786597866978679786897869978709787197872978739787497875978769787797878978799788097881978829788397884978859788697887978889788997890978919789297893978949789597896978979789897899979009790197902979039790497905979069790797908979099791097911979129791397914979159791697917979189791997920979219792297923979249792597926979279792897929979309793197932979339793497935979369793797938979399794097941979429794397944979459794697947979489794997950979519795297953979549795597956979579795897959979609796197962979639796497965979669796797968979699797097971979729797397974979759797697977979789797997980979819798297983979849798597986979879798897989979909799197992979939799497995979969799797998979999800098001980029800398004980059800698007980089800998010980119801298013980149801598016980179801898019980209802198022980239802498025980269802798028980299803098031980329803398034980359803698037980389803998040980419804298043980449804598046980479804898049980509805198052980539805498055980569805798058980599806098061980629806398064980659806698067980689806998070980719807298073980749807598076980779807898079980809808198082980839808498085980869808798088980899809098091980929809398094980959809698097980989809998100981019810298103981049810598106981079810898109981109811198112981139811498115981169811798118981199812098121981229812398124981259812698127981289812998130981319813298133981349813598136981379813898139981409814198142981439814498145981469814798148981499815098151981529815398154981559815698157981589815998160981619816298163981649816598166981679816898169981709817198172981739817498175981769817798178981799818098181981829818398184981859818698187981889818998190981919819298193981949819598196981979819898199982009820198202982039820498205982069820798208982099821098211982129821398214982159821698217982189821998220982219822298223982249822598226982279822898229982309823198232982339823498235982369823798238982399824098241982429824398244982459824698247982489824998250982519825298253982549825598256982579825898259982609826198262982639826498265982669826798268982699827098271982729827398274982759827698277982789827998280982819828298283982849828598286982879828898289982909829198292982939829498295982969829798298982999830098301983029830398304983059830698307983089830998310983119831298313983149831598316983179831898319983209832198322983239832498325983269832798328983299833098331983329833398334983359833698337983389833998340983419834298343983449834598346983479834898349983509835198352983539835498355983569835798358983599836098361983629836398364983659836698367983689836998370983719837298373983749837598376983779837898379983809838198382983839838498385983869838798388983899839098391983929839398394983959839698397983989839998400984019840298403984049840598406984079840898409984109841198412984139841498415984169841798418984199842098421984229842398424984259842698427984289842998430984319843298433984349843598436984379843898439984409844198442984439844498445984469844798448984499845098451984529845398454984559845698457984589845998460984619846298463984649846598466984679846898469984709847198472984739847498475984769847798478984799848098481984829848398484984859848698487984889848998490984919849298493984949849598496984979849898499985009850198502985039850498505985069850798508985099851098511985129851398514985159851698517985189851998520985219852298523985249852598526985279852898529985309853198532985339853498535985369853798538985399854098541985429854398544985459854698547985489854998550985519855298553985549855598556985579855898559985609856198562985639856498565985669856798568985699857098571985729857398574985759857698577985789857998580985819858298583985849858598586985879858898589985909859198592985939859498595985969859798598985999860098601986029860398604986059860698607986089860998610986119861298613986149861598616986179861898619986209862198622986239862498625986269862798628986299863098631986329863398634986359863698637986389863998640986419864298643986449864598646986479864898649986509865198652986539865498655986569865798658986599866098661986629866398664986659866698667986689866998670986719867298673986749867598676986779867898679986809868198682986839868498685986869868798688986899869098691986929869398694986959869698697986989869998700987019870298703987049870598706987079870898709987109871198712987139871498715987169871798718987199872098721987229872398724987259872698727987289872998730987319873298733987349873598736987379873898739987409874198742987439874498745987469874798748987499875098751987529875398754987559875698757987589875998760987619876298763987649876598766987679876898769987709877198772987739877498775987769877798778987799878098781987829878398784987859878698787987889878998790987919879298793987949879598796987979879898799988009880198802988039880498805988069880798808988099881098811988129881398814988159881698817988189881998820988219882298823988249882598826988279882898829988309883198832988339883498835988369883798838988399884098841988429884398844988459884698847988489884998850988519885298853988549885598856988579885898859988609886198862988639886498865988669886798868988699887098871988729887398874988759887698877988789887998880988819888298883988849888598886988879888898889988909889198892988939889498895988969889798898988999890098901989029890398904989059890698907989089890998910989119891298913989149891598916989179891898919989209892198922989239892498925989269892798928989299893098931989329893398934989359893698937989389893998940989419894298943989449894598946989479894898949989509895198952989539895498955989569895798958989599896098961989629896398964989659896698967989689896998970989719897298973989749897598976989779897898979989809898198982989839898498985989869898798988989899899098991989929899398994989959899698997989989899999000990019900299003990049900599006990079900899009990109901199012990139901499015990169901799018990199902099021990229902399024990259902699027990289902999030990319903299033990349903599036990379903899039990409904199042990439904499045990469904799048990499905099051990529905399054990559905699057990589905999060990619906299063990649906599066990679906899069990709907199072990739907499075990769907799078990799908099081990829908399084990859908699087990889908999090990919909299093990949909599096990979909899099991009910199102991039910499105991069910799108991099911099111991129911399114991159911699117991189911999120991219912299123991249912599126991279912899129991309913199132991339913499135991369913799138991399914099141991429914399144991459914699147991489914999150991519915299153991549915599156991579915899159991609916199162991639916499165991669916799168991699917099171991729917399174991759917699177991789917999180991819918299183991849918599186991879918899189991909919199192991939919499195991969919799198991999920099201992029920399204992059920699207992089920999210992119921299213992149921599216992179921899219992209922199222992239922499225992269922799228992299923099231992329923399234992359923699237992389923999240992419924299243992449924599246992479924899249992509925199252992539925499255992569925799258992599926099261992629926399264992659926699267992689926999270992719927299273992749927599276992779927899279992809928199282992839928499285992869928799288992899929099291992929929399294992959929699297992989929999300993019930299303993049930599306993079930899309993109931199312993139931499315993169931799318993199932099321993229932399324993259932699327993289932999330993319933299333993349933599336993379933899339993409934199342993439934499345993469934799348993499935099351993529935399354993559935699357993589935999360993619936299363993649936599366993679936899369993709937199372993739937499375993769937799378993799938099381993829938399384993859938699387993889938999390993919939299393993949939599396993979939899399994009940199402994039940499405994069940799408994099941099411994129941399414994159941699417994189941999420994219942299423994249942599426994279942899429994309943199432994339943499435994369943799438994399944099441994429944399444994459944699447994489944999450994519945299453994549945599456994579945899459994609946199462994639946499465994669946799468994699947099471994729947399474994759947699477994789947999480994819948299483994849948599486994879948899489994909949199492994939949499495994969949799498994999950099501995029950399504995059950699507995089950999510995119951299513995149951599516995179951899519995209952199522995239952499525995269952799528995299953099531995329953399534995359953699537995389953999540995419954299543995449954599546995479954899549995509955199552995539955499555995569955799558995599956099561995629956399564995659956699567995689956999570995719957299573995749957599576995779957899579995809958199582995839958499585995869958799588995899959099591995929959399594995959959699597995989959999600996019960299603996049960599606996079960899609996109961199612996139961499615996169961799618996199962099621996229962399624996259962699627996289962999630996319963299633996349963599636996379963899639996409964199642996439964499645996469964799648996499965099651996529965399654996559965699657996589965999660996619966299663996649966599666996679966899669996709967199672996739967499675996769967799678996799968099681996829968399684996859968699687996889968999690996919969299693996949969599696996979969899699997009970199702997039970499705997069970799708997099971099711997129971399714997159971699717997189971999720997219972299723997249972599726997279972899729997309973199732997339973499735997369973799738997399974099741997429974399744997459974699747997489974999750997519975299753997549975599756997579975899759997609976199762997639976499765997669976799768997699977099771997729977399774997759977699777997789977999780997819978299783997849978599786997879978899789997909979199792997939979499795997969979799798997999980099801998029980399804998059980699807998089980999810998119981299813998149981599816998179981899819998209982199822998239982499825998269982799828998299983099831998329983399834998359983699837998389983999840998419984299843998449984599846998479984899849998509985199852998539985499855998569985799858998599986099861998629986399864998659986699867998689986999870998719987299873998749987599876998779987899879998809988199882998839988499885998869988799888998899989099891998929989399894998959989699897998989989999900999019990299903999049990599906999079990899909999109991199912999139991499915999169991799918999199992099921999229992399924999259992699927999289992999930999319993299933999349993599936999379993899939999409994199942999439994499945999469994799948999499995099951999529995399954999559995699957999589995999960999619996299963999649996599966999679996899969999709997199972999739997499975999769997799978999799998099981999829998399984999859998699987999889998999990999919999299993999949999599996999979999899999100000100001100002100003100004100005100006100007100008100009100010100011100012100013100014100015100016100017100018100019100020100021100022100023100024100025100026100027100028100029100030100031100032100033100034100035100036100037100038100039100040100041100042100043100044100045100046100047100048100049100050100051100052100053100054100055100056100057100058100059100060100061100062100063100064100065100066100067100068100069100070100071100072100073100074100075100076100077100078100079100080100081100082100083100084100085100086100087100088100089100090100091100092100093100094100095100096100097100098100099100100100101100102100103100104100105100106100107100108100109100110100111100112100113100114100115100116100117100118100119100120100121100122100123100124100125100126100127100128100129100130100131100132100133100134100135100136100137100138100139100140100141100142100143100144100145100146100147100148100149100150100151100152100153100154100155100156100157100158100159100160100161100162100163100164100165100166100167100168100169100170100171100172100173100174100175100176100177100178100179100180100181100182100183100184100185100186100187100188100189100190100191100192100193100194100195100196100197100198100199100200100201100202100203100204100205100206100207100208100209100210100211100212100213100214100215100216100217100218100219100220100221100222100223100224100225100226100227100228100229100230100231100232100233100234100235100236100237100238100239100240100241100242100243100244100245100246100247100248100249100250100251100252100253100254100255100256100257100258100259100260100261100262100263100264100265100266100267100268100269100270100271100272100273100274100275100276100277100278100279100280100281100282100283100284100285100286100287100288100289100290100291100292100293100294100295100296100297100298100299100300100301100302100303100304100305100306100307100308100309100310100311100312100313100314100315100316100317100318100319100320100321100322100323100324100325100326100327100328100329100330100331100332100333100334100335100336100337100338100339100340100341100342100343100344100345100346100347100348100349100350100351100352100353100354100355100356100357100358100359100360100361100362100363100364100365100366100367100368100369100370100371100372100373100374100375100376100377100378100379100380100381100382100383100384100385100386100387100388100389100390100391100392100393100394100395100396100397100398100399100400100401100402100403100404100405100406100407100408100409100410100411100412100413100414100415100416100417100418100419100420100421100422100423100424100425100426100427100428100429100430100431100432100433100434100435100436100437100438100439100440100441100442100443100444100445100446100447100448100449100450100451100452100453100454100455100456100457100458100459100460100461100462100463100464100465100466100467100468100469100470100471100472100473100474100475100476100477100478100479100480100481100482100483100484100485100486100487100488100489100490100491100492100493100494100495100496100497100498100499100500100501100502100503100504100505100506100507100508100509100510100511100512100513100514100515100516100517100518100519100520100521100522100523100524100525100526100527100528100529100530100531100532100533100534100535100536100537100538100539100540100541100542100543100544100545100546100547100548100549100550100551100552100553100554100555100556100557100558100559100560100561100562100563100564100565100566100567100568100569100570100571100572100573100574100575100576100577100578100579100580100581100582100583100584100585100586100587100588100589100590100591100592100593100594100595100596100597100598100599100600100601100602100603100604100605100606100607100608100609100610100611100612100613100614100615100616100617100618100619100620100621100622100623100624100625100626100627100628100629100630100631100632100633100634100635100636100637100638100639100640100641100642100643100644100645100646100647100648100649100650100651100652100653100654100655100656100657100658100659100660100661100662100663100664100665100666100667100668100669100670100671100672100673100674100675100676100677100678100679100680100681100682100683100684100685100686100687100688100689100690100691100692100693100694100695100696100697100698100699100700100701100702100703100704100705100706100707100708100709100710100711100712100713100714100715100716100717100718100719100720100721100722100723100724100725100726100727100728100729100730100731100732100733100734100735100736100737100738100739100740100741100742100743100744100745100746100747100748100749100750100751100752100753100754100755100756100757100758100759100760100761100762100763100764100765100766100767100768100769100770100771100772100773100774100775100776100777100778100779100780100781100782100783100784100785100786100787100788100789100790100791100792100793100794100795100796100797100798100799100800100801100802100803100804100805100806100807100808100809100810100811100812100813100814100815100816100817100818100819100820100821100822100823100824100825100826100827100828100829100830100831100832100833100834100835100836100837100838100839100840100841100842100843100844100845100846100847100848100849100850100851100852100853100854100855100856100857100858100859100860100861100862100863100864100865100866100867100868100869100870100871100872100873100874100875100876100877100878100879100880100881100882100883100884100885100886100887100888100889100890100891100892100893100894100895100896100897100898100899100900100901100902100903100904100905100906100907100908100909100910100911100912100913100914100915100916100917100918100919100920100921100922100923100924100925100926100927100928100929100930100931100932100933100934100935100936100937100938100939100940100941100942100943100944100945100946100947100948100949100950100951100952100953100954100955100956100957100958100959100960100961100962100963100964100965100966100967100968100969100970100971100972100973100974100975100976100977100978100979100980100981100982100983100984100985100986100987100988100989100990100991100992100993100994100995100996100997100998100999101000101001101002101003101004101005101006101007101008101009101010101011101012101013101014101015101016101017101018101019101020101021101022101023101024101025101026101027101028101029101030101031101032101033101034101035101036101037101038101039101040101041101042101043101044101045101046101047101048101049101050101051101052101053101054101055101056101057101058101059101060101061101062101063101064101065101066101067101068101069101070101071101072101073101074101075101076101077101078101079101080101081101082101083101084101085101086101087101088101089101090101091101092101093101094101095101096101097101098101099101100101101101102101103101104101105101106101107101108101109101110101111101112101113101114101115101116101117101118101119101120101121101122101123101124101125101126101127101128101129101130101131101132101133101134101135101136101137101138101139101140101141101142101143101144101145101146101147101148101149101150101151101152101153101154101155101156101157101158101159101160101161101162101163101164101165101166101167101168101169101170101171101172101173101174101175101176101177101178101179101180101181101182101183101184101185101186101187101188101189101190101191101192101193101194101195101196101197101198101199101200101201101202101203101204101205101206101207101208101209101210101211101212101213101214101215101216101217101218101219101220101221101222101223101224101225101226101227101228101229101230101231101232101233101234101235101236101237101238101239101240101241101242101243101244101245101246101247101248101249101250101251101252101253101254101255101256101257101258101259101260101261101262101263101264101265101266101267101268101269101270101271101272101273101274101275101276101277101278101279101280101281101282101283101284101285101286101287101288101289101290101291101292101293101294101295101296101297101298101299101300101301101302101303101304101305101306101307101308101309101310101311101312101313101314101315101316101317101318101319101320101321101322101323101324101325101326101327101328101329101330101331101332101333101334101335101336101337101338101339101340101341101342101343101344101345101346101347101348101349101350101351101352101353101354101355101356101357101358101359101360101361101362101363101364101365101366101367101368101369101370101371101372101373101374101375101376101377101378101379101380101381101382101383101384101385101386101387101388101389101390101391101392101393101394101395101396101397101398101399101400101401101402101403101404101405101406101407101408101409101410101411101412101413101414101415101416101417101418101419101420101421101422101423101424101425101426101427101428101429101430101431101432101433101434101435101436101437101438101439101440101441101442101443101444101445101446101447101448101449101450101451101452101453101454101455101456101457101458101459101460101461101462101463101464101465101466101467101468101469101470101471101472101473101474101475101476101477101478101479101480101481101482101483101484101485101486101487101488101489101490101491101492101493101494101495101496101497101498101499101500101501101502101503101504101505101506101507101508101509101510101511101512101513101514101515101516101517101518101519101520101521101522101523101524101525101526101527101528101529101530101531101532101533101534101535101536101537101538101539101540101541101542101543101544101545101546101547101548101549101550101551101552101553101554101555101556101557101558101559101560101561101562101563101564101565101566101567101568101569101570101571101572101573101574101575101576101577101578101579101580101581101582101583101584101585101586101587101588101589101590101591101592101593101594101595101596101597101598101599101600101601101602101603101604101605101606101607101608101609101610101611101612101613101614101615101616101617101618101619101620101621101622101623101624101625101626101627101628101629101630101631101632101633101634101635101636101637101638101639101640101641101642101643101644101645101646101647101648101649101650101651101652101653101654101655101656101657101658101659101660101661101662101663101664101665101666101667101668101669101670101671101672101673101674101675101676101677101678101679101680101681101682101683101684101685101686101687101688101689101690101691101692101693101694101695101696101697101698101699101700101701101702101703101704101705101706101707101708101709101710101711101712101713101714101715101716101717101718101719101720101721101722101723101724101725101726101727101728101729101730101731101732101733101734101735101736101737101738101739101740101741101742101743101744101745101746101747101748101749101750101751101752101753101754101755101756101757101758101759101760101761101762101763101764101765101766101767101768101769101770101771101772101773101774101775101776101777101778101779101780101781101782101783101784101785101786101787101788101789101790101791101792101793101794101795101796101797101798101799101800101801101802101803101804101805101806101807101808101809101810101811101812101813101814101815101816101817101818101819101820101821101822101823101824101825101826101827101828101829101830101831101832101833101834101835101836101837101838101839101840101841101842101843101844101845101846101847101848101849101850101851101852101853101854101855101856101857101858101859101860101861101862101863101864101865101866101867101868101869101870101871101872101873101874101875101876101877101878101879101880101881101882101883101884101885101886101887101888101889101890101891101892101893101894101895101896101897101898101899101900101901101902101903101904101905101906101907101908101909101910101911101912101913101914101915101916101917101918101919101920101921101922101923101924101925101926101927101928101929101930101931101932101933101934101935101936101937101938101939101940101941101942101943101944101945101946101947101948101949101950101951101952101953101954101955101956101957101958101959101960101961101962101963101964101965101966101967101968101969101970101971101972101973101974101975101976101977101978101979101980101981101982101983101984101985101986101987101988101989101990101991101992101993101994101995101996101997101998101999102000102001102002102003102004102005102006102007102008102009102010102011102012102013102014102015102016102017102018102019102020102021102022102023102024102025102026102027102028102029102030102031102032102033102034102035102036102037102038102039102040102041102042102043102044102045102046102047102048102049102050102051102052102053102054102055102056102057102058102059102060102061102062102063102064102065102066102067102068102069102070102071102072102073102074102075102076102077102078102079102080102081102082102083102084102085102086102087102088102089102090102091102092102093102094102095102096102097102098102099102100102101102102102103102104102105102106102107102108102109102110102111102112102113102114102115102116102117102118102119102120102121102122102123102124102125102126102127102128102129102130102131102132102133102134102135102136102137102138102139102140102141102142102143102144102145102146102147102148102149102150102151102152102153102154102155102156102157102158102159102160102161102162102163102164102165102166102167102168102169102170102171102172102173102174102175102176102177102178102179102180102181102182102183102184102185102186102187102188102189102190102191102192102193102194102195102196102197102198102199102200102201102202102203102204102205102206102207102208102209102210102211102212102213102214102215102216102217102218102219102220102221102222102223102224102225102226102227102228102229102230102231102232102233102234102235102236102237102238102239102240102241102242102243102244102245102246102247102248102249102250102251102252102253102254102255102256102257102258102259102260102261102262102263102264102265102266102267102268102269102270102271102272102273102274102275102276102277102278102279102280102281102282102283102284102285102286102287102288102289102290102291102292102293102294102295102296102297102298102299102300102301102302102303102304102305102306102307102308102309102310102311102312102313102314102315102316102317102318102319102320102321102322102323102324102325102326102327102328102329102330102331102332102333102334102335102336102337102338102339102340102341102342102343102344102345102346102347102348102349102350102351102352102353102354102355102356102357102358102359102360102361102362102363102364102365102366102367102368102369102370102371102372102373102374102375102376102377102378102379102380102381102382102383102384102385102386102387102388102389102390102391102392102393102394102395102396102397102398102399102400102401102402102403102404102405102406102407102408102409102410102411102412102413102414102415102416102417102418102419102420102421102422102423102424102425102426102427102428102429102430102431102432102433102434102435102436102437102438102439102440102441102442102443102444102445102446102447102448102449102450102451102452102453102454102455102456102457102458102459102460102461102462102463102464102465102466102467102468102469102470102471102472102473102474102475102476102477102478102479102480102481102482102483102484102485102486102487102488102489102490102491102492102493102494102495102496102497102498102499102500102501102502102503102504102505102506102507102508102509102510102511102512102513102514102515102516102517102518102519102520102521102522102523102524102525102526102527102528102529102530102531102532102533102534102535102536102537102538102539102540102541102542102543102544102545102546102547102548102549102550102551102552102553102554102555102556102557102558102559102560102561102562102563102564102565102566102567102568102569102570102571102572102573102574102575102576102577102578102579102580102581102582102583102584102585102586102587102588102589102590102591102592102593102594102595102596102597102598102599102600102601102602102603102604102605102606102607102608102609102610102611102612102613102614102615102616102617102618102619102620102621102622102623102624102625102626102627102628102629102630102631102632102633102634102635102636102637102638102639102640102641102642102643102644102645102646102647102648102649102650102651102652102653102654102655102656102657102658102659102660102661102662102663102664102665102666102667102668102669102670102671102672102673102674102675102676102677102678102679102680102681102682102683102684102685102686102687102688102689102690102691102692102693102694102695102696102697102698102699102700102701102702102703102704102705102706102707102708102709102710102711102712102713102714102715102716102717102718102719102720102721102722102723102724102725102726102727102728102729102730102731102732102733102734102735102736102737102738102739102740102741102742102743102744102745102746102747102748102749102750102751102752102753102754102755102756102757102758102759102760102761102762102763102764102765102766102767102768102769102770102771102772102773102774102775102776102777102778102779102780102781102782102783102784102785102786102787102788102789102790102791102792102793102794102795102796102797102798102799102800102801102802102803102804102805102806102807102808102809102810102811102812102813102814102815102816102817102818102819102820102821102822102823102824102825102826102827102828102829102830102831102832102833102834102835102836102837102838102839102840102841102842102843102844102845102846102847102848102849102850102851102852102853102854102855102856102857102858102859102860102861102862102863102864102865102866102867102868102869102870102871102872102873102874102875102876102877102878102879102880102881102882102883102884102885102886102887102888102889102890102891102892102893102894102895102896102897102898102899102900102901102902102903102904102905102906102907102908102909102910102911102912102913102914102915102916102917102918102919102920102921102922102923102924102925102926102927102928102929102930102931102932102933102934102935102936102937102938102939102940102941102942102943102944102945102946102947102948102949102950102951102952102953102954102955102956102957102958102959102960102961102962102963102964102965102966102967102968102969102970102971102972102973102974102975102976102977102978102979102980102981102982102983102984102985102986102987102988102989102990102991102992102993102994102995102996102997102998102999103000103001103002103003103004103005103006103007103008103009103010103011103012103013103014103015103016103017103018103019103020103021103022103023103024103025103026103027103028103029103030103031103032103033103034103035103036103037103038103039103040103041103042103043103044103045103046103047103048103049103050103051103052103053103054103055103056103057103058103059103060103061103062103063103064103065103066103067103068103069103070103071103072103073103074103075103076103077103078103079103080103081103082103083103084103085103086103087103088103089103090103091103092103093103094103095103096103097103098103099103100103101103102103103103104103105103106103107103108103109103110103111103112103113103114103115103116103117103118103119103120103121103122103123103124103125103126103127103128103129103130103131103132103133103134103135103136103137103138103139103140103141103142103143103144103145103146103147103148103149103150103151103152103153103154103155103156103157103158103159103160103161103162103163103164103165103166103167103168103169103170103171103172103173103174103175103176103177103178103179103180103181103182103183103184103185103186103187103188103189103190103191103192103193103194103195103196103197103198103199103200103201103202103203103204103205103206103207103208103209103210103211103212103213103214103215103216103217103218103219103220103221103222103223103224103225103226103227103228103229103230103231103232103233103234103235103236103237103238103239103240103241103242103243103244103245103246103247103248103249103250103251103252103253103254103255103256103257103258103259103260103261103262103263103264103265103266103267103268103269103270103271103272103273103274103275103276103277103278103279103280103281103282103283103284103285103286103287103288103289103290103291103292103293103294103295103296103297103298103299103300103301103302103303103304103305103306103307103308103309103310103311103312103313103314103315103316103317103318103319103320103321103322103323103324103325103326103327103328103329103330103331103332103333103334103335103336103337103338103339103340103341103342103343103344103345103346103347103348103349103350103351103352103353103354103355103356103357103358103359103360103361103362103363103364103365103366103367103368103369103370103371103372103373103374103375103376103377103378103379103380103381103382103383103384103385103386103387103388103389103390103391103392103393103394103395103396103397103398103399103400103401103402103403103404103405103406103407103408103409103410103411103412103413103414103415103416103417103418103419103420103421103422103423103424103425103426103427103428103429103430103431103432103433103434103435103436103437103438103439103440103441103442103443103444103445103446103447103448103449103450103451103452103453103454103455103456103457103458103459103460103461103462103463103464103465103466103467103468103469103470103471103472103473103474103475103476103477103478103479103480103481103482103483103484103485103486103487103488103489103490103491103492103493103494103495103496103497103498103499103500103501103502103503103504103505103506103507103508103509103510103511103512103513103514103515103516103517103518103519103520103521103522103523103524103525103526103527103528103529103530103531103532103533103534103535103536103537103538103539103540103541103542103543103544103545103546103547103548103549103550103551103552103553103554103555103556103557103558103559103560103561103562103563103564103565103566103567103568103569103570103571103572103573103574103575103576103577103578103579103580103581103582103583103584103585103586103587103588103589103590103591103592103593103594103595103596103597103598103599103600103601103602103603103604103605103606103607103608103609103610103611103612103613103614103615103616103617103618103619103620103621103622103623103624103625103626103627103628103629103630103631103632103633103634103635103636103637103638103639103640103641103642103643103644103645103646103647103648103649103650103651103652103653103654103655103656103657103658103659103660103661103662103663103664103665103666103667103668103669103670103671103672103673103674103675103676103677103678103679103680103681103682103683103684103685103686103687103688103689103690103691103692103693103694103695103696103697103698103699103700103701103702103703103704103705103706103707103708103709103710103711103712103713103714103715103716103717103718103719103720103721103722103723103724103725103726103727103728103729103730103731103732103733103734103735103736103737103738103739103740103741103742103743103744103745103746103747103748103749103750103751103752103753103754103755103756103757103758103759103760103761103762103763103764103765103766103767103768103769103770103771103772103773103774103775103776103777103778103779103780103781103782103783103784103785103786103787103788103789103790103791103792103793103794103795103796103797103798103799103800103801103802103803103804103805103806103807103808103809103810103811103812103813103814103815103816103817103818103819103820103821103822103823103824103825103826103827103828103829103830103831103832103833103834103835103836103837103838103839103840103841103842103843103844103845103846103847103848103849103850103851103852103853103854103855103856103857103858103859103860103861103862103863103864103865103866103867103868103869103870103871103872103873103874103875103876103877103878103879103880103881103882103883103884103885103886103887103888103889103890103891103892103893103894103895103896103897103898103899103900103901103902103903103904103905103906103907103908103909103910103911103912103913103914103915103916103917103918103919103920103921103922103923103924103925103926103927103928103929103930103931103932103933103934103935103936103937103938103939103940103941103942103943103944103945103946103947103948103949103950103951103952103953103954103955103956103957103958103959103960103961103962103963103964103965103966103967103968103969103970103971103972103973103974103975103976103977103978103979103980103981103982103983103984103985103986103987103988103989103990103991103992103993103994103995103996103997103998103999104000104001104002104003104004104005104006104007104008104009104010104011104012104013104014104015104016104017104018104019104020104021104022104023104024104025104026104027104028104029104030104031104032104033104034104035104036104037104038104039104040104041104042104043104044104045104046104047104048104049104050104051104052104053104054104055104056104057104058104059104060104061104062104063104064104065104066104067104068104069104070104071104072104073104074104075104076104077104078104079104080104081104082104083104084104085104086104087104088104089104090104091104092104093104094104095104096104097104098104099104100104101104102104103104104104105104106104107104108104109104110104111104112104113104114104115104116104117104118104119104120104121104122104123104124104125104126104127104128104129104130104131104132104133104134104135104136104137104138104139104140104141104142104143104144104145104146104147104148104149104150104151104152104153104154104155104156104157104158104159104160104161104162104163104164104165104166104167104168104169104170104171104172104173104174104175104176104177104178104179104180104181104182104183104184104185104186104187104188104189104190104191104192104193104194104195104196104197104198104199104200104201104202104203104204104205104206104207104208104209104210104211104212104213104214104215104216104217104218104219104220104221104222104223104224104225104226104227104228104229104230104231104232104233104234104235104236104237104238104239104240104241104242104243104244104245104246104247104248104249104250104251104252104253104254104255104256104257104258104259104260104261104262104263104264104265104266104267104268104269104270104271104272104273104274104275104276104277104278104279104280104281104282104283104284104285104286104287104288104289104290104291104292104293104294104295104296104297104298104299104300104301104302104303104304104305104306104307104308104309104310104311104312104313104314104315104316104317104318104319104320104321104322104323104324104325104326104327104328104329104330104331104332104333104334104335104336104337104338104339104340104341104342104343104344104345104346104347104348104349104350104351104352104353104354104355104356104357104358104359104360104361104362104363104364104365104366104367104368104369104370104371104372104373104374104375104376104377104378104379104380104381104382104383104384104385104386104387104388104389104390104391104392104393104394104395104396104397104398104399104400104401104402104403104404104405104406104407104408104409104410104411104412104413104414104415104416104417104418104419104420104421104422104423104424104425104426104427104428104429104430104431104432104433104434104435104436104437104438104439104440104441104442104443104444104445104446104447104448104449104450104451104452104453104454104455104456104457104458104459104460104461104462104463104464104465104466104467104468104469104470104471104472104473104474104475104476104477104478104479104480104481104482104483104484104485104486104487104488104489104490104491104492104493104494104495104496104497104498104499104500104501104502104503104504104505104506104507104508104509104510104511104512104513104514104515104516104517104518104519104520104521104522104523104524104525104526104527104528104529104530104531104532104533104534104535104536104537104538104539104540104541104542104543104544104545104546104547104548104549104550104551104552104553104554104555104556104557104558104559104560104561104562104563104564104565104566104567104568104569104570104571104572104573104574104575104576104577104578104579104580104581104582104583104584104585104586104587104588104589104590104591104592104593104594104595104596104597104598104599104600104601104602104603104604104605104606104607104608104609104610104611104612104613104614104615104616104617104618104619104620104621104622104623104624104625104626104627104628104629104630104631104632104633104634104635104636104637104638104639104640104641104642104643104644104645104646104647104648104649104650104651104652104653104654104655104656104657104658104659104660104661104662104663104664104665104666104667104668104669104670104671104672104673104674104675104676104677104678104679104680104681104682104683104684104685104686104687104688104689104690104691104692104693104694104695104696104697104698104699104700104701104702104703104704104705104706104707104708104709104710104711104712104713104714104715104716104717104718104719104720104721104722104723104724104725104726104727104728104729104730104731104732104733104734104735104736104737104738104739104740104741104742104743104744104745104746104747104748104749104750104751104752104753104754104755104756104757104758104759104760104761104762104763104764104765104766104767104768104769104770104771104772104773104774104775104776104777104778104779104780104781104782104783104784104785104786104787104788104789104790104791104792104793104794104795104796104797104798104799104800104801104802104803104804104805104806104807104808104809104810104811104812104813104814104815104816104817104818104819104820104821104822104823104824104825104826104827104828104829104830104831104832104833104834104835104836104837104838104839104840104841104842104843104844104845104846104847104848104849104850104851104852104853104854104855104856104857104858104859104860104861104862104863104864104865104866104867104868104869104870104871104872104873104874104875104876104877104878104879104880104881104882104883104884104885104886104887104888104889104890104891104892104893104894104895104896104897104898104899104900104901104902104903104904104905104906104907104908104909104910104911104912104913104914104915104916104917104918104919104920104921104922104923104924104925104926104927104928104929104930104931104932104933104934104935104936104937104938104939104940104941104942104943104944104945104946104947104948104949104950104951104952104953104954104955104956104957104958104959104960104961104962104963104964104965104966104967104968104969104970104971104972104973104974104975104976104977104978104979104980104981104982104983104984104985104986104987104988104989104990104991104992104993104994104995104996104997104998104999105000105001105002105003105004105005105006105007105008105009105010105011105012105013105014105015105016105017105018105019105020105021105022105023105024105025105026105027105028105029105030105031105032105033105034105035105036105037105038105039105040105041105042105043105044105045105046105047105048105049105050105051105052105053105054105055105056105057105058105059105060105061105062105063105064105065105066105067105068105069105070105071105072105073105074105075105076105077105078105079105080105081105082105083105084105085105086105087105088105089105090105091105092105093105094105095105096105097105098105099105100105101105102105103105104105105105106105107105108105109105110105111105112105113105114105115105116105117105118105119105120105121105122105123105124105125105126105127105128105129105130105131105132105133105134105135105136105137105138105139105140105141105142105143105144105145105146105147105148105149105150105151105152105153105154105155105156105157105158105159105160105161105162105163105164105165105166105167105168105169105170105171105172105173105174105175105176105177105178105179105180105181105182105183105184105185105186105187105188105189105190105191105192105193105194105195105196105197105198105199105200105201105202105203105204105205105206105207105208105209105210105211105212105213105214105215105216105217105218105219105220105221105222105223105224105225105226105227105228105229105230105231105232105233105234105235105236105237105238105239105240105241105242105243105244105245105246105247105248105249105250105251105252105253105254105255105256105257105258105259105260105261105262105263105264105265105266105267105268105269105270105271105272105273105274105275105276105277105278105279105280105281105282105283105284105285105286105287105288105289105290105291105292105293105294105295105296105297105298105299105300105301105302105303105304105305105306105307105308105309105310105311105312105313105314105315105316105317105318105319105320105321105322105323105324105325105326105327105328105329105330105331105332105333105334105335105336105337105338105339105340105341105342105343105344105345105346105347105348105349105350105351105352105353105354105355105356105357105358105359105360105361105362105363105364105365105366105367105368105369105370105371105372105373105374105375105376105377105378105379105380105381105382105383105384105385105386105387105388105389105390105391105392105393105394105395105396105397105398105399105400105401105402105403105404105405105406105407105408105409105410105411105412105413105414105415105416105417105418105419105420105421105422105423105424105425105426105427105428105429105430105431105432105433105434105435105436105437105438105439105440105441105442105443105444105445105446105447105448105449105450105451105452105453105454105455105456105457105458105459105460105461105462105463105464105465105466105467105468105469105470105471105472105473105474105475105476105477105478105479105480105481105482105483105484105485105486105487105488105489105490105491105492105493105494105495105496105497105498105499105500105501105502105503105504105505105506105507105508105509105510105511105512105513105514105515105516105517105518105519105520105521105522105523105524105525105526105527105528105529105530105531105532105533105534105535105536105537105538105539105540105541105542105543105544105545105546105547105548105549105550105551105552105553105554105555105556105557105558105559105560105561105562105563105564105565105566105567105568105569105570105571105572105573105574105575105576105577105578105579105580105581105582105583105584105585105586105587105588105589105590105591105592105593105594105595105596105597105598105599105600105601105602105603105604105605105606105607105608105609105610105611105612105613105614105615105616105617105618105619105620105621105622105623105624105625105626105627105628105629105630105631105632105633105634105635105636105637105638105639105640105641105642105643105644105645105646105647105648105649105650105651105652105653105654105655105656105657105658105659105660105661105662105663105664105665105666105667105668105669105670105671105672105673105674105675105676105677105678105679105680105681105682105683105684105685105686105687105688105689105690105691105692105693105694105695105696105697105698105699105700105701105702105703105704105705105706105707105708105709105710105711105712105713105714105715105716105717105718105719105720105721105722105723105724105725105726105727105728105729105730105731105732105733105734105735105736105737105738105739105740105741105742105743105744105745105746105747105748105749105750105751105752105753105754105755105756105757105758105759105760105761105762105763105764105765105766105767105768105769105770105771105772105773105774105775105776105777105778105779105780105781105782105783105784105785105786105787105788105789105790105791105792105793105794105795105796105797105798105799105800105801105802105803105804105805105806105807105808105809105810105811105812105813105814105815105816105817105818105819105820105821105822105823105824105825105826105827105828105829105830105831105832105833105834105835105836105837105838105839105840105841105842105843105844105845105846105847105848105849105850105851105852105853105854105855105856105857105858105859105860105861105862105863105864105865105866105867105868105869105870105871105872105873105874105875105876105877105878105879105880105881105882105883105884105885105886105887105888105889105890105891105892105893105894105895105896105897105898105899105900105901105902105903105904105905105906105907105908105909105910105911105912105913105914105915105916105917105918105919105920105921105922105923105924105925105926105927105928105929105930105931105932105933105934105935105936105937105938105939105940105941105942105943105944105945105946105947105948105949105950105951105952105953105954105955105956105957105958105959105960105961105962105963105964105965105966105967105968105969105970105971105972105973105974105975105976105977105978105979105980105981105982105983105984105985105986105987105988105989105990105991105992105993105994105995105996105997105998105999106000106001106002106003106004106005106006106007106008106009106010106011106012106013106014106015106016106017106018106019106020106021106022106023106024106025106026106027106028106029106030106031106032106033106034106035106036106037106038106039106040106041106042106043106044106045106046106047106048106049106050106051106052106053106054106055106056106057106058106059106060106061106062106063106064106065106066106067106068106069106070106071106072106073106074106075106076106077106078106079106080106081106082106083106084106085106086106087106088106089106090106091106092106093106094106095106096106097106098106099106100106101106102106103106104106105106106106107106108106109106110106111106112106113106114106115106116106117106118106119106120106121106122106123106124106125106126106127106128106129106130106131106132106133106134106135106136106137106138106139106140106141106142106143106144106145106146106147106148106149106150106151106152106153106154106155106156106157106158106159106160106161106162106163106164106165106166106167106168106169106170106171106172106173106174106175106176106177106178106179106180106181106182106183106184106185106186106187106188106189106190106191106192106193106194106195106196106197106198106199106200106201106202106203106204106205106206106207106208106209106210106211106212106213106214106215106216106217106218106219106220106221106222106223106224106225106226106227106228106229106230106231106232106233106234106235106236106237106238106239106240106241106242106243106244106245106246106247106248106249106250106251106252106253106254106255106256106257106258106259106260106261106262106263106264106265106266106267106268106269106270106271106272106273106274106275106276106277106278106279106280106281106282106283106284106285106286106287106288106289106290106291106292106293106294106295106296106297106298106299106300106301106302106303106304106305106306106307106308106309106310106311106312106313106314106315106316106317106318106319106320106321106322106323106324106325106326106327106328106329106330106331106332106333106334106335106336106337106338106339106340106341106342106343106344106345106346106347106348106349106350106351106352106353106354106355106356106357106358106359106360106361106362106363106364106365106366106367106368106369106370106371106372106373106374106375106376106377106378106379106380106381106382106383106384106385106386106387106388106389106390106391106392106393106394106395106396106397106398106399106400106401106402106403106404106405106406106407106408106409106410106411106412106413106414106415106416106417106418106419106420106421106422106423106424106425106426106427106428106429106430106431106432106433106434106435106436106437106438106439106440106441106442106443106444106445106446106447106448106449106450106451106452106453106454106455106456106457106458106459106460106461106462106463106464106465106466106467106468106469106470106471106472106473106474106475106476106477106478106479106480106481106482106483106484106485106486106487106488106489106490106491106492106493106494106495106496106497106498106499106500106501106502106503106504106505106506106507106508106509106510106511106512106513106514106515106516106517106518106519106520106521106522106523106524106525106526106527106528106529106530106531106532106533106534106535106536106537106538106539106540106541106542106543106544106545106546106547106548106549106550106551106552106553106554106555106556106557106558106559106560106561106562106563106564106565106566106567106568106569106570106571106572106573106574106575106576106577106578106579106580106581106582106583106584106585106586106587106588106589106590106591106592106593106594106595106596106597106598106599106600106601106602106603106604106605106606106607106608106609106610106611106612106613106614106615106616106617106618106619106620106621106622106623106624106625106626106627106628106629106630106631106632106633106634106635106636106637106638106639106640106641106642106643106644106645106646106647106648106649106650106651106652106653106654106655106656106657106658106659106660106661106662106663106664106665106666106667106668106669106670106671106672106673106674106675106676106677106678106679106680106681106682106683106684106685106686106687106688106689106690106691106692106693106694106695106696106697106698106699106700106701106702106703106704106705106706106707106708106709106710106711106712106713106714106715106716106717106718106719106720106721106722106723106724106725106726106727106728106729106730106731106732106733106734106735106736106737106738106739106740106741106742106743106744106745106746106747106748106749106750106751106752106753106754106755106756106757106758106759106760106761106762106763106764106765106766106767106768106769106770106771106772106773106774106775106776106777106778106779106780106781106782106783106784106785106786106787106788106789106790106791106792106793106794106795106796106797106798106799106800106801106802106803106804106805106806106807106808106809106810106811106812106813106814106815106816106817106818106819106820106821106822106823106824106825106826106827106828106829106830106831106832106833106834106835106836106837106838106839106840106841106842106843106844106845106846106847106848106849106850106851106852106853106854106855106856106857106858106859106860106861106862106863106864106865106866106867106868106869106870106871106872106873106874106875106876106877106878106879106880106881106882106883106884106885106886106887106888106889106890106891106892106893106894106895106896106897106898106899106900106901106902106903106904106905106906106907106908106909106910106911106912106913106914106915106916106917106918106919106920106921106922106923106924106925106926106927106928106929106930106931106932106933106934106935106936106937106938106939106940106941106942106943106944106945106946106947106948106949106950106951106952106953106954106955106956106957106958106959106960106961106962106963106964106965106966106967106968106969106970106971106972106973106974106975106976106977106978106979106980106981106982106983106984106985106986106987106988106989106990106991106992106993106994106995106996106997106998106999107000107001107002107003107004107005107006107007107008107009107010107011107012107013107014107015107016107017107018107019107020107021107022107023107024107025107026107027107028107029107030107031107032107033107034107035107036107037107038107039107040107041107042107043107044107045107046107047107048107049107050107051107052107053107054107055107056107057107058107059107060107061107062107063107064107065107066107067107068107069107070107071107072107073107074107075107076107077107078107079107080107081107082107083107084107085107086107087107088107089107090107091107092107093107094107095107096107097107098107099107100107101107102107103107104107105107106107107107108107109107110107111107112107113107114107115107116107117107118107119107120107121107122107123107124107125107126107127107128107129107130107131107132107133107134107135107136107137107138107139107140107141107142107143107144107145107146107147107148107149107150107151107152107153107154107155107156107157107158107159107160107161107162107163107164107165107166107167107168107169107170107171107172107173107174107175107176107177107178107179107180107181107182107183107184107185107186107187107188107189107190107191107192107193107194107195107196107197107198107199107200107201107202107203107204107205107206107207107208107209107210107211107212107213107214107215107216107217107218107219107220107221107222107223107224107225107226107227107228107229107230107231107232107233107234107235107236107237107238107239107240107241107242107243107244107245107246107247107248107249107250107251107252107253107254107255107256107257107258107259107260107261107262107263107264107265107266107267107268107269107270107271107272107273107274107275107276107277107278107279107280107281107282107283107284107285107286107287107288107289107290107291107292107293107294107295107296107297107298107299107300107301107302107303107304107305107306107307107308107309107310107311107312107313107314107315107316107317107318107319107320107321107322107323107324107325107326107327107328107329107330107331107332107333107334107335107336107337107338107339107340107341107342107343107344107345107346107347107348107349107350107351107352107353107354107355107356107357107358107359107360107361107362107363107364107365107366107367107368107369107370107371107372107373107374107375107376107377107378107379107380107381107382107383107384107385107386107387107388107389107390107391107392107393107394107395107396107397107398107399107400107401107402107403107404107405107406107407107408107409107410107411107412107413107414107415107416107417107418107419107420107421107422107423107424107425107426107427107428107429107430107431107432107433107434107435107436107437107438107439107440107441107442107443107444107445107446107447107448107449107450107451107452107453107454107455107456107457107458107459107460107461107462107463107464107465107466107467107468107469107470107471107472107473107474107475107476107477107478107479107480107481107482107483107484107485107486107487107488107489107490107491107492107493107494107495107496107497107498107499107500107501107502107503107504107505107506107507107508107509107510107511107512107513107514107515107516107517107518107519107520107521107522107523107524107525107526107527107528107529107530107531107532107533107534107535107536107537107538107539107540107541107542107543107544107545107546107547107548107549107550107551107552107553107554107555107556107557107558107559107560107561107562107563107564107565107566107567107568107569107570107571107572107573107574107575107576107577107578107579107580107581107582107583107584107585107586107587107588107589107590107591107592107593107594107595107596107597107598107599107600107601107602107603107604107605107606107607107608107609107610107611107612107613107614107615107616107617107618107619107620107621107622107623107624107625107626107627107628107629107630107631107632107633107634107635107636107637107638107639107640107641107642107643107644107645107646107647107648107649107650107651107652107653107654107655107656107657107658107659107660107661107662107663107664107665107666107667107668107669107670107671107672107673107674107675107676107677107678107679107680107681107682107683107684107685107686107687107688107689107690107691107692107693107694107695107696107697107698107699107700107701107702107703107704107705107706107707107708107709107710107711107712107713107714107715107716107717107718107719107720107721107722107723107724107725107726107727107728107729107730107731107732107733107734107735107736107737107738107739107740107741107742107743107744107745107746107747107748107749107750107751107752107753107754107755107756107757107758107759107760107761107762107763107764107765107766107767107768107769107770107771107772107773107774107775107776107777107778107779107780107781107782107783107784107785107786107787107788107789107790107791107792107793107794107795107796107797107798107799107800107801107802107803107804107805107806107807107808107809107810107811107812107813107814107815107816107817107818107819107820107821107822107823107824107825107826107827107828107829107830107831107832107833107834107835107836107837107838107839107840107841107842107843107844107845107846107847107848107849107850107851107852107853107854107855107856107857107858107859107860107861107862107863107864107865107866107867107868107869107870107871107872107873107874107875107876107877107878107879107880107881107882107883107884107885107886107887107888107889107890107891107892107893107894107895107896107897107898107899107900107901107902107903107904107905107906107907107908107909107910107911107912107913107914107915107916107917107918107919107920107921107922107923107924107925107926107927107928107929107930107931107932107933107934107935107936107937107938107939107940107941107942107943107944107945107946107947107948107949107950107951107952107953107954107955107956107957107958107959107960107961107962107963107964107965107966107967107968107969107970107971107972107973107974107975107976107977107978107979107980107981107982107983107984107985107986107987107988107989107990107991107992107993107994107995107996107997107998107999108000108001108002108003108004108005108006108007108008108009108010108011108012108013108014108015108016108017108018108019108020108021108022108023108024108025108026108027108028108029108030108031108032108033108034108035108036108037108038108039108040108041108042108043108044108045108046108047108048108049108050108051108052108053108054108055108056108057108058108059108060108061108062108063108064108065108066108067108068108069108070108071108072108073108074108075108076108077108078108079108080108081108082108083108084108085108086108087108088108089108090108091108092108093108094108095108096108097108098108099108100108101108102108103108104108105108106108107108108108109108110108111108112108113108114108115108116108117108118108119108120108121108122108123108124108125108126108127108128108129108130108131108132108133108134108135108136108137108138108139108140108141108142108143108144108145108146108147108148108149108150108151108152108153108154108155108156108157108158108159108160108161108162108163108164108165108166108167108168108169108170108171108172108173108174108175108176108177108178108179108180108181108182108183108184108185108186108187108188108189108190108191108192108193108194108195108196108197108198108199108200108201108202108203108204108205108206108207108208108209108210108211108212108213108214108215108216108217108218108219108220108221108222108223108224108225108226108227108228108229108230108231108232108233108234108235108236108237108238108239108240108241108242108243108244108245108246108247108248108249108250108251108252108253108254108255108256108257108258108259108260108261108262108263108264108265108266108267108268108269108270108271108272108273108274108275108276108277108278108279108280108281108282108283108284108285108286108287108288108289108290108291108292108293108294108295108296108297108298108299108300108301108302108303108304108305108306108307108308108309108310108311108312108313108314108315108316108317108318108319108320108321108322108323108324108325108326108327108328108329108330108331108332108333108334108335108336108337108338108339108340108341108342108343108344108345108346108347108348108349108350108351108352108353108354108355108356108357108358108359108360108361108362108363108364108365108366108367108368108369108370108371108372108373108374108375108376108377108378108379108380108381108382108383108384108385108386108387108388108389108390108391108392108393108394108395108396108397108398108399108400108401108402108403108404108405108406108407108408108409108410108411108412108413108414108415108416108417108418108419108420108421108422108423108424108425108426108427108428108429108430108431108432108433108434108435108436108437108438108439108440108441108442108443108444108445108446108447108448108449108450108451108452108453108454108455108456108457108458108459108460108461108462108463108464108465108466108467108468108469108470108471108472108473108474108475108476108477108478108479108480108481108482108483108484108485108486108487108488108489108490108491108492108493108494108495108496108497108498108499108500108501108502108503108504108505108506108507108508108509108510108511108512108513108514108515108516108517108518108519108520108521108522108523108524108525108526108527108528108529108530108531108532108533108534108535108536108537108538108539108540108541108542108543108544108545108546108547108548108549108550108551108552108553108554108555108556108557108558108559108560108561108562108563108564108565108566108567108568108569108570108571108572108573108574108575108576108577108578108579108580108581108582108583108584108585108586108587108588108589108590108591108592108593108594108595108596108597108598108599108600108601108602108603108604108605108606108607108608108609108610108611108612108613108614108615108616108617108618108619108620108621108622108623108624108625108626108627108628108629108630108631108632108633108634108635108636108637108638108639108640108641108642108643108644108645108646108647108648108649108650108651108652108653108654108655108656108657108658108659108660108661108662108663108664108665108666108667108668108669108670108671108672108673108674108675108676108677108678108679108680108681108682108683108684108685108686108687108688108689108690108691108692108693108694108695108696108697108698108699108700108701108702108703108704108705108706108707108708108709108710108711108712108713108714108715108716108717108718108719108720108721108722108723108724108725108726108727108728108729108730108731108732108733108734108735108736108737108738108739108740108741108742108743108744108745108746108747108748108749108750108751108752108753108754108755108756108757108758108759108760108761108762108763108764108765108766108767108768108769108770108771108772108773108774108775108776108777108778108779108780108781108782108783108784108785108786108787108788108789108790108791108792108793108794108795108796108797108798108799108800108801108802108803108804108805108806108807108808108809108810108811108812108813108814108815108816108817108818108819108820108821108822108823108824108825108826108827108828108829108830108831108832108833108834108835108836108837108838108839108840108841108842108843108844108845108846108847108848108849108850108851108852108853108854108855108856108857108858108859108860108861108862108863108864108865108866108867108868108869108870108871108872108873108874108875108876108877108878108879108880108881108882108883108884108885108886108887108888108889108890108891108892108893108894108895108896108897108898108899108900108901108902108903108904108905108906108907108908108909108910108911108912108913108914108915108916108917108918108919108920108921108922108923108924108925108926108927108928108929108930108931108932108933108934108935108936108937108938108939108940108941108942108943108944108945108946108947108948108949108950108951108952108953108954108955108956108957108958108959108960108961108962108963108964108965108966108967108968108969108970108971108972108973108974108975108976108977108978108979108980108981108982108983108984108985108986108987108988108989108990108991108992108993108994108995108996108997108998108999109000109001109002109003109004109005109006109007109008109009109010109011109012109013109014109015109016109017109018109019109020109021109022109023109024109025109026109027109028109029109030109031109032109033109034109035109036109037109038109039109040109041109042109043109044109045109046109047109048109049109050109051109052109053109054109055109056109057109058109059109060109061109062109063109064109065109066109067109068109069109070109071109072109073109074109075109076109077109078109079109080109081109082109083109084109085109086109087109088109089109090109091109092109093109094109095109096109097109098109099109100109101109102109103109104109105109106109107109108109109109110109111109112109113109114109115109116109117109118109119109120109121109122109123109124109125109126109127109128109129109130109131109132109133109134109135109136109137109138109139109140109141109142109143109144109145109146109147109148109149109150109151109152109153109154109155109156109157109158109159109160109161109162109163109164109165109166109167109168109169109170109171109172109173109174109175109176109177109178109179109180109181109182109183109184109185109186109187109188109189109190109191109192109193109194109195109196109197109198109199109200109201109202109203109204109205109206109207109208109209109210109211109212109213109214109215109216109217109218109219109220109221109222109223109224109225109226109227109228109229109230109231109232109233109234109235109236109237109238109239109240109241109242109243109244109245109246109247109248109249109250109251109252109253109254109255109256109257109258109259109260109261109262109263109264109265109266109267109268109269109270109271109272109273109274109275109276109277109278109279109280109281109282109283109284109285109286109287109288109289109290109291109292109293109294109295109296109297109298109299109300109301109302109303109304109305109306109307109308109309109310109311109312109313109314109315109316109317109318109319109320109321109322109323109324109325109326109327109328109329109330109331109332109333109334109335109336109337109338109339109340109341109342109343109344109345109346109347109348109349109350109351109352109353109354109355109356109357109358109359109360109361109362109363109364109365109366109367109368109369109370109371109372109373109374109375109376109377109378109379109380109381109382109383109384109385109386109387109388109389109390109391109392109393109394109395109396109397109398109399109400109401109402109403109404109405109406109407109408109409109410109411109412109413109414109415109416109417109418109419109420109421109422109423109424109425109426109427109428109429109430109431109432109433109434109435109436109437109438109439109440109441109442109443109444109445109446109447109448109449109450109451109452109453109454109455109456109457109458109459109460109461109462109463109464109465109466109467109468109469109470109471109472109473109474109475109476109477109478109479109480109481109482109483109484109485109486109487109488109489109490109491109492109493109494109495109496109497109498109499109500109501109502109503109504109505109506109507109508109509109510109511109512109513109514109515109516109517109518109519109520109521109522109523109524109525109526109527109528109529109530109531109532109533109534109535109536109537109538109539109540109541109542109543109544109545109546109547109548109549109550109551109552109553109554109555109556109557109558109559109560109561109562109563109564109565109566109567109568109569109570109571109572109573109574109575109576109577109578109579109580109581109582109583109584109585109586109587109588109589109590109591109592109593109594109595109596109597109598109599109600109601109602109603109604109605109606109607109608109609109610109611109612109613109614109615109616109617109618109619109620109621109622109623109624109625109626109627109628109629109630109631109632109633109634109635109636109637109638109639109640109641109642109643109644109645109646109647109648109649109650109651109652109653109654109655109656109657109658109659109660109661109662109663109664109665109666109667109668109669109670109671109672109673109674109675109676109677109678109679109680109681109682109683109684109685109686109687109688109689109690109691109692109693109694109695109696109697109698109699109700109701109702109703109704109705109706109707109708109709109710109711109712109713109714109715109716109717109718109719109720109721109722109723109724109725109726109727109728109729109730109731109732109733109734109735109736109737109738109739109740109741109742109743109744109745109746109747109748109749109750109751109752109753109754109755109756109757109758109759109760109761109762109763109764109765109766109767109768109769109770109771109772109773109774109775109776109777109778109779109780109781109782109783109784109785109786109787109788109789109790109791109792109793109794109795109796109797109798109799109800109801109802109803109804109805109806109807109808109809109810109811109812109813109814109815109816109817109818109819109820109821109822109823109824109825109826109827109828109829109830109831109832109833109834109835109836109837109838109839109840109841109842109843109844109845109846109847109848109849109850109851109852109853109854109855109856109857109858109859109860109861109862109863109864109865109866109867109868109869109870109871109872109873109874109875109876109877109878109879109880109881109882109883109884109885109886109887109888109889109890109891109892109893109894109895109896109897109898109899109900109901109902109903109904109905109906109907109908109909109910109911109912109913109914109915109916109917109918109919109920109921109922109923109924109925109926109927109928109929109930109931109932109933109934109935109936109937109938109939109940109941109942109943109944109945109946109947109948109949109950109951109952109953109954109955109956109957109958109959109960109961109962109963109964109965109966109967109968109969109970109971109972109973109974109975109976109977109978109979109980109981109982109983109984109985109986109987109988109989109990109991109992109993109994109995109996109997109998109999110000110001110002110003110004110005110006110007110008110009110010110011110012110013110014110015110016110017110018110019110020110021110022110023110024110025110026110027110028110029110030110031110032110033110034110035110036110037110038110039110040110041110042110043110044110045110046110047110048110049110050110051110052110053110054110055110056110057110058110059110060110061110062110063110064110065110066110067110068110069110070110071110072110073110074110075110076110077110078110079110080110081110082110083110084110085110086110087110088110089110090110091110092110093110094110095110096110097110098110099110100110101110102110103110104110105110106110107110108110109110110110111110112110113110114110115110116110117110118110119110120110121110122110123110124110125110126110127110128110129110130110131110132110133110134110135110136110137110138110139110140110141110142110143110144110145110146110147110148110149110150110151110152110153110154110155110156110157110158110159110160110161110162110163110164110165110166110167110168110169110170110171110172110173110174110175110176110177110178110179110180110181110182110183110184110185110186110187110188110189110190110191110192110193110194110195110196110197110198110199110200110201110202110203110204110205110206110207110208110209110210110211110212110213110214110215110216110217110218110219110220110221110222110223110224110225110226110227110228110229110230110231110232110233110234110235110236110237110238110239110240110241110242110243110244110245110246110247110248110249110250110251110252110253110254110255110256110257110258110259110260110261110262110263110264110265110266110267110268110269110270110271110272110273110274110275110276110277110278110279110280110281110282110283110284110285110286110287110288110289110290110291110292110293110294110295110296110297110298110299110300110301110302110303110304110305110306110307110308110309110310110311110312110313110314110315110316110317110318110319110320110321110322110323110324110325110326110327110328110329110330110331110332110333110334110335110336110337110338110339110340110341110342110343110344110345110346110347110348110349110350110351110352110353110354110355110356110357110358110359110360110361110362110363110364110365110366110367110368110369110370110371110372110373110374110375110376110377110378110379110380110381110382110383110384110385110386110387110388110389110390110391110392110393110394110395110396110397110398110399110400110401110402110403110404110405110406110407110408110409110410110411110412110413110414110415110416110417110418110419110420110421110422110423110424110425110426110427110428110429110430110431110432110433110434110435110436110437110438110439110440110441110442110443110444110445110446110447110448110449110450110451110452110453110454110455110456110457110458110459110460110461110462110463110464110465110466110467110468110469110470110471110472110473110474110475110476110477110478110479110480110481110482110483110484110485110486110487110488110489110490110491110492110493110494110495110496110497110498110499110500110501110502110503110504110505110506110507110508110509110510110511110512110513110514110515110516110517110518110519110520110521110522110523110524110525110526110527110528110529110530110531110532110533110534110535110536110537110538110539110540110541110542110543110544110545110546110547110548110549110550110551110552110553110554110555110556110557110558110559110560110561110562110563110564110565110566110567110568110569110570110571110572110573110574110575110576110577110578110579110580110581110582110583110584110585110586110587110588110589110590110591110592110593110594110595110596110597110598110599110600110601110602110603110604110605110606110607110608110609110610110611110612110613110614110615110616110617110618110619110620110621110622110623110624110625110626110627110628110629110630110631110632110633110634110635110636110637110638110639110640110641110642110643110644110645110646110647110648110649110650110651110652110653110654110655110656110657110658110659110660110661110662110663110664110665110666110667110668110669110670110671110672110673110674110675110676110677110678110679110680110681110682110683110684110685110686110687110688110689110690110691110692110693110694110695110696110697110698110699110700110701110702110703110704110705110706110707110708110709110710110711110712110713110714110715110716110717110718110719110720110721110722110723110724110725110726110727110728110729110730110731110732110733110734110735110736110737110738110739110740110741110742110743110744110745110746110747110748110749110750110751110752110753110754110755110756110757110758110759110760110761110762110763110764110765110766110767110768110769110770110771110772110773110774110775110776110777110778110779110780110781110782110783110784110785110786110787110788110789110790110791110792110793110794110795110796110797110798110799110800110801110802110803110804110805110806110807110808110809110810110811110812110813110814110815110816110817110818110819110820110821110822110823110824110825110826110827110828110829110830110831110832110833110834110835110836110837110838110839110840110841110842110843110844110845110846110847110848110849110850110851110852110853110854110855110856110857110858110859110860110861110862110863110864110865110866110867110868110869110870110871110872110873110874110875110876110877110878110879110880110881110882110883110884110885110886110887110888110889110890110891110892110893110894110895110896110897110898110899110900110901110902110903110904110905110906110907110908110909110910110911110912110913110914110915110916110917110918110919110920110921110922110923110924110925110926110927110928110929110930110931110932110933110934110935110936110937110938110939110940110941110942110943110944110945110946110947110948110949110950110951110952110953110954110955110956110957110958110959110960110961110962110963110964110965110966110967110968110969110970110971110972110973110974110975110976110977110978110979110980110981110982110983110984110985110986110987110988110989110990110991110992110993110994110995110996110997110998110999111000111001111002111003111004111005111006111007111008111009111010111011111012111013111014111015111016111017111018111019111020111021111022111023111024111025111026111027111028111029111030111031111032111033111034111035111036111037111038111039111040111041111042111043111044111045111046111047111048111049111050111051111052111053111054111055111056111057111058111059111060111061111062111063111064111065111066111067111068111069111070111071111072111073111074111075111076111077111078111079111080111081111082111083111084111085111086111087111088111089111090111091111092111093111094111095111096111097111098111099111100111101111102111103111104111105111106111107111108111109111110111111111112111113111114111115111116111117111118111119111120111121111122111123111124111125111126111127111128111129111130111131111132111133111134111135111136111137111138111139111140111141111142111143111144111145111146111147111148111149111150111151111152111153111154111155111156111157111158111159111160111161111162111163111164111165111166111167111168111169111170111171111172111173111174111175111176111177111178111179111180111181111182111183111184111185111186111187111188111189111190111191111192111193111194111195111196111197111198111199111200111201111202111203111204111205111206111207111208111209111210111211111212111213111214111215111216111217111218111219111220111221111222111223111224111225111226111227111228111229111230111231111232111233111234111235111236111237111238111239111240111241111242111243111244111245111246111247111248111249111250111251111252111253111254111255111256111257111258111259111260111261111262111263111264111265111266111267111268111269111270111271111272111273111274111275111276111277111278111279111280111281111282111283111284111285111286111287111288111289111290111291111292111293111294111295111296111297111298111299111300111301111302111303111304111305111306111307111308111309111310111311111312111313111314111315111316111317111318111319111320111321111322111323111324111325111326111327111328111329111330111331111332111333111334111335111336111337111338111339111340111341111342111343111344111345111346111347111348111349111350111351111352111353111354111355111356111357111358111359111360111361111362111363111364111365111366111367111368111369111370111371111372111373111374111375111376111377111378111379111380111381111382111383111384111385111386111387111388111389111390111391111392111393111394111395111396111397111398111399111400111401111402111403111404111405111406111407111408111409111410111411111412111413111414111415111416111417111418111419111420111421111422111423111424111425111426111427111428111429111430111431111432111433111434111435111436111437111438111439111440111441111442111443111444111445111446111447111448111449111450111451111452111453111454111455111456111457111458111459111460111461111462111463111464111465111466111467111468111469111470111471111472111473111474111475111476111477111478111479111480111481111482111483111484111485111486111487111488111489111490111491111492111493111494111495111496111497111498111499111500111501111502111503111504111505111506111507111508111509111510111511111512111513111514111515111516111517111518111519111520111521111522111523111524111525111526111527111528111529111530111531111532111533111534111535111536111537111538111539111540111541111542111543111544111545111546111547111548111549111550111551111552111553111554111555111556111557111558111559111560111561111562111563111564111565111566111567111568111569111570111571111572111573111574111575111576111577111578111579111580111581111582111583111584111585111586111587111588111589111590111591111592111593111594111595111596111597111598111599111600111601111602111603111604111605111606111607111608111609111610111611111612111613111614111615111616111617111618111619111620111621111622111623111624111625111626111627111628111629111630111631111632111633111634111635111636111637111638111639111640111641111642111643111644111645111646111647111648111649111650111651111652111653111654111655111656111657111658111659111660111661111662111663111664111665111666111667111668111669111670111671111672111673111674111675111676111677111678111679111680111681111682111683111684111685111686111687111688111689111690111691111692111693111694111695111696111697111698111699111700111701111702111703111704111705111706111707111708111709111710111711111712111713111714111715111716111717111718111719111720111721111722111723111724111725111726111727111728111729111730111731111732111733111734111735111736111737111738111739111740111741111742111743111744111745111746111747111748111749111750111751111752111753111754111755111756111757111758111759111760111761111762111763111764111765111766111767111768111769111770111771111772111773111774111775111776111777111778111779111780111781111782111783111784111785111786111787111788111789111790111791111792111793111794111795111796111797111798111799111800111801111802111803111804111805111806111807111808111809111810111811111812111813111814111815111816111817111818111819111820111821111822111823111824111825111826111827111828111829111830111831111832111833111834111835111836111837111838111839111840111841111842111843111844111845111846111847111848111849111850111851111852111853111854111855111856111857111858111859111860111861111862111863111864111865111866111867111868111869111870111871111872111873111874111875111876111877111878111879111880111881111882111883111884111885111886111887111888111889111890111891111892111893111894111895111896111897111898111899111900111901111902111903111904111905111906111907111908111909111910111911111912111913111914111915111916111917111918111919111920111921111922111923111924111925111926111927111928111929111930111931111932111933111934111935111936111937111938111939111940111941111942111943111944111945111946111947111948111949111950111951111952111953111954111955111956111957111958111959111960111961111962111963111964111965111966111967111968111969111970111971111972111973111974111975111976111977111978111979111980111981111982111983111984111985111986111987111988111989111990111991111992111993111994111995111996111997111998111999112000112001112002112003112004112005112006112007112008112009112010112011112012112013112014112015112016112017112018112019112020112021112022112023112024112025112026112027112028112029112030112031112032112033112034112035112036112037112038112039112040112041112042112043112044112045112046112047112048112049112050112051112052112053112054112055112056112057112058112059112060112061112062112063112064112065112066112067112068112069112070112071112072112073112074112075112076112077112078112079112080112081112082112083112084112085112086112087112088112089112090112091112092112093112094112095112096112097112098112099112100112101112102112103112104112105112106112107112108112109112110112111112112112113112114112115112116112117112118112119112120112121112122112123112124112125112126112127112128112129112130112131112132112133112134112135112136112137112138112139112140112141112142112143112144112145112146112147112148112149112150112151112152112153112154112155112156112157112158112159112160112161112162112163112164112165112166112167112168112169112170112171112172112173112174112175112176112177112178112179112180112181112182112183112184112185112186112187112188112189112190112191112192112193112194112195112196112197112198112199112200112201112202112203112204112205112206112207112208112209112210112211112212112213112214112215112216112217112218112219112220112221112222112223112224112225112226112227112228112229112230112231112232112233112234112235112236112237112238112239112240112241112242112243112244112245112246112247112248112249112250112251112252112253112254112255112256112257112258112259112260112261112262112263112264112265112266112267112268112269112270112271112272112273112274112275112276112277112278112279112280112281112282112283112284112285112286112287112288112289112290112291112292112293112294112295112296112297112298112299112300112301112302112303112304112305112306112307112308112309112310112311112312112313112314112315112316112317112318112319112320112321112322112323112324112325112326112327112328112329112330112331112332112333112334112335112336112337112338112339112340112341112342112343112344112345112346112347112348112349112350112351112352112353112354112355112356112357112358112359112360112361112362112363112364112365112366112367112368112369112370112371112372112373112374112375112376112377112378112379112380112381112382112383112384112385112386112387112388112389112390112391112392112393112394112395112396112397112398112399112400112401112402112403112404112405112406112407112408112409112410112411112412112413112414112415112416112417112418112419112420112421112422112423112424112425112426112427112428112429112430112431112432112433112434112435112436112437112438112439112440112441112442112443112444112445112446112447112448112449112450112451112452112453112454112455112456112457112458112459112460112461112462112463112464112465112466112467112468112469112470112471112472112473112474112475112476112477112478112479112480112481112482112483112484112485112486112487112488112489112490112491112492112493112494112495112496112497112498112499112500112501112502112503112504112505112506112507112508112509112510112511112512112513112514112515112516112517112518112519112520112521112522112523112524112525112526112527112528112529112530112531112532112533112534112535112536112537112538112539112540112541112542112543112544112545112546112547112548112549112550112551112552112553112554112555112556112557112558112559112560112561112562112563112564112565112566112567112568112569112570112571112572112573112574112575112576112577112578112579112580112581112582112583112584112585112586112587112588112589112590112591112592112593112594112595112596112597112598112599112600112601112602112603112604112605112606112607112608112609112610112611112612112613112614112615112616112617112618112619112620112621112622112623112624112625112626112627112628112629112630112631112632112633112634112635112636112637112638112639112640112641112642112643112644112645112646112647112648112649112650112651112652112653112654112655112656112657112658112659112660112661112662112663112664112665112666112667112668112669112670112671112672112673112674112675112676112677112678112679112680112681112682112683112684112685112686112687112688112689112690112691112692112693112694112695112696112697112698112699112700112701112702112703112704112705112706112707112708112709112710112711112712112713112714112715112716112717112718112719112720112721112722112723112724112725112726112727112728112729112730112731112732112733112734112735112736112737112738112739112740112741112742112743112744112745112746112747112748112749112750112751112752112753112754112755112756112757112758112759112760112761112762112763112764112765112766112767112768112769112770112771112772112773112774112775112776112777112778112779112780112781112782112783112784112785112786112787112788112789112790112791112792112793112794112795112796112797112798112799112800112801112802112803112804112805112806112807112808112809112810112811112812112813112814112815112816112817112818112819112820112821112822112823112824112825112826112827112828112829112830112831112832112833112834112835112836112837112838112839112840112841112842112843112844112845112846112847112848112849112850112851112852112853112854112855112856112857112858112859112860112861112862112863112864112865112866112867112868112869112870112871112872112873112874112875112876112877112878112879112880112881112882112883112884112885112886112887112888112889112890112891112892112893112894112895112896112897112898112899112900112901112902112903112904112905112906112907112908112909112910112911112912112913112914112915112916112917112918112919112920112921112922112923112924112925112926112927112928112929112930112931112932112933112934112935112936112937112938112939112940112941112942112943112944112945112946112947112948112949112950112951112952112953112954112955112956112957112958112959112960112961112962112963112964112965112966112967112968112969112970112971112972112973112974112975112976112977112978112979112980112981112982112983112984112985112986112987112988112989112990112991112992112993112994112995112996112997112998112999113000113001113002113003113004113005113006113007113008113009113010113011113012113013113014113015113016113017113018113019113020113021113022113023113024113025113026113027113028113029113030113031113032113033113034113035113036113037113038113039113040113041113042113043113044113045113046113047113048113049113050113051113052113053113054113055113056113057113058113059113060113061113062113063113064113065113066113067113068113069113070113071113072113073113074113075113076113077113078113079113080113081113082113083113084113085113086113087113088113089113090113091113092113093113094113095113096113097113098113099113100113101113102113103113104113105113106113107113108113109113110113111113112113113113114113115113116113117113118113119113120113121113122113123113124113125113126113127113128113129113130113131113132113133113134113135113136113137113138113139113140113141113142113143113144113145113146113147113148113149113150113151113152113153113154113155113156113157113158113159113160113161113162113163113164113165113166113167113168113169113170113171113172113173113174113175113176113177113178113179113180113181113182113183113184113185113186113187113188113189113190113191113192113193113194113195113196113197113198113199113200113201113202113203113204113205113206113207113208113209113210113211113212113213113214113215113216113217113218113219113220113221113222113223113224113225113226113227113228113229113230113231113232113233113234113235113236113237113238113239113240113241113242113243113244113245113246113247113248113249113250113251113252113253113254113255113256113257113258113259113260113261113262113263113264113265113266113267113268113269113270113271113272113273113274113275113276113277113278113279113280113281113282113283113284113285113286113287113288113289113290113291113292113293113294113295113296113297113298113299113300113301113302113303113304113305113306113307113308113309113310113311113312113313113314113315113316113317113318113319113320113321113322113323113324113325113326113327113328113329113330113331113332113333113334113335113336113337113338113339113340113341113342113343113344113345113346113347113348113349113350113351113352113353113354113355113356113357113358113359113360113361113362113363113364113365113366113367113368113369113370113371113372113373113374113375113376113377113378113379113380113381113382113383113384113385113386113387113388113389113390113391113392113393113394113395113396113397113398113399113400113401113402113403113404113405113406113407113408113409113410113411113412113413113414113415113416113417113418113419113420113421113422113423113424113425113426113427113428113429113430113431113432113433113434113435113436113437113438113439113440113441113442113443113444113445113446113447113448113449113450113451113452113453113454113455113456113457113458113459113460113461113462113463113464113465113466113467113468113469113470113471113472113473113474113475113476113477113478113479113480113481113482113483113484113485113486113487113488113489113490113491113492113493113494113495113496113497113498113499113500113501113502113503113504113505113506113507113508113509113510113511113512113513113514113515113516113517113518113519113520113521113522113523113524113525113526113527113528113529113530113531113532113533113534113535113536113537113538113539113540113541113542113543113544113545113546113547113548113549113550113551113552113553113554113555113556113557113558113559113560113561113562113563113564113565113566113567113568113569113570113571113572113573113574113575113576113577113578113579113580113581113582113583113584113585113586113587113588113589113590113591113592113593113594113595113596113597113598113599113600113601113602113603113604113605113606113607113608113609113610113611113612113613113614113615113616113617113618113619113620113621113622113623113624113625113626113627113628113629113630113631113632113633113634113635113636113637113638113639113640113641113642113643113644113645113646113647113648113649113650113651113652113653113654113655113656113657113658113659113660113661113662113663113664113665113666113667113668113669113670113671113672113673113674113675113676113677113678113679113680113681113682113683113684113685113686113687113688113689113690113691113692113693113694113695113696113697113698113699113700113701113702113703113704113705113706113707113708113709113710113711113712113713113714113715113716113717113718113719113720113721113722113723113724113725113726113727113728113729113730113731113732113733113734113735113736113737113738113739113740113741113742113743113744113745113746113747113748113749113750113751113752113753113754113755113756113757113758113759113760113761113762113763113764113765113766113767113768113769113770113771113772113773113774113775113776113777113778113779113780113781113782113783113784113785113786113787113788113789113790113791113792113793113794113795113796113797113798113799113800113801113802113803113804113805113806113807113808113809113810113811113812113813113814113815113816113817113818113819113820113821113822113823113824113825113826113827113828113829113830113831113832113833113834113835113836113837113838113839113840113841113842113843113844113845113846113847113848113849113850113851113852113853113854113855113856113857113858113859113860113861113862113863113864113865113866113867113868113869113870113871113872113873113874113875113876113877113878113879113880113881113882113883113884113885113886113887113888113889113890113891113892113893113894113895113896113897113898113899113900113901113902113903113904113905113906113907113908113909113910113911113912113913113914113915113916113917113918113919113920113921113922113923113924113925113926113927113928113929113930113931113932113933113934113935113936113937113938113939113940113941113942113943113944113945113946113947113948113949113950113951113952113953113954113955113956113957113958113959113960113961113962113963113964113965113966113967113968113969113970113971113972113973113974113975113976113977113978113979113980113981113982113983113984113985113986113987113988113989113990113991113992113993113994113995113996113997113998113999114000114001114002114003114004114005114006114007114008114009114010114011114012114013114014114015114016114017114018114019114020114021114022114023114024114025114026114027114028114029114030114031114032114033114034114035114036114037114038114039114040114041114042114043114044114045114046114047114048114049114050114051114052114053114054114055114056114057114058114059114060114061114062114063114064114065114066114067114068114069114070114071114072114073114074114075114076114077114078114079114080114081114082114083114084114085114086114087114088114089114090114091114092114093114094114095114096114097114098114099114100114101114102114103114104114105114106114107114108114109114110114111114112114113114114114115114116114117114118114119114120114121114122114123114124114125114126114127114128114129114130114131114132114133114134114135114136114137114138114139114140114141114142114143114144114145114146114147114148114149114150114151114152114153114154114155114156114157114158114159114160114161114162114163114164114165114166114167114168114169114170114171114172114173114174114175114176114177114178114179114180114181114182114183114184114185114186114187114188114189114190114191114192114193114194114195114196114197114198114199114200114201114202114203114204114205114206114207114208114209114210114211114212114213114214114215114216114217114218114219114220114221114222114223114224114225114226114227114228114229114230114231114232114233114234114235114236114237114238114239114240114241114242114243114244114245114246114247114248114249114250114251114252114253114254114255114256114257114258114259114260114261114262114263114264114265114266114267114268114269114270114271114272114273114274114275114276114277114278114279114280114281114282114283114284114285114286114287114288114289114290114291114292114293114294114295114296114297114298114299114300114301114302114303114304114305114306114307114308114309114310114311114312114313114314114315114316114317114318114319114320114321114322114323114324114325114326114327114328114329114330114331114332114333114334114335114336114337114338114339114340114341114342114343114344114345114346114347114348114349114350114351114352114353114354114355114356114357114358114359114360114361114362114363114364114365114366114367114368114369114370114371114372114373114374114375114376114377114378114379114380114381114382114383114384114385114386114387114388114389114390114391114392114393114394114395114396114397114398114399114400114401114402114403114404114405114406114407114408114409114410114411114412114413114414114415114416114417114418114419114420114421114422114423114424114425114426114427114428114429114430114431114432114433114434114435114436114437114438114439114440114441114442114443114444114445114446114447114448114449114450114451114452114453114454114455114456114457114458114459114460114461114462114463114464114465114466114467114468114469114470114471114472114473114474114475114476114477114478114479114480114481114482114483114484114485114486114487114488114489114490114491114492114493114494114495114496114497114498114499114500114501114502114503114504114505114506114507114508114509114510114511114512114513114514114515114516114517114518114519114520114521114522114523114524114525114526114527114528114529114530114531114532114533114534114535114536114537114538114539114540114541114542114543114544114545114546114547114548114549114550114551114552114553114554114555114556114557114558114559114560114561114562114563114564114565114566114567114568114569114570114571114572114573114574114575114576114577114578114579114580114581114582114583114584114585114586114587114588114589114590114591114592114593114594114595114596114597114598114599114600114601114602114603114604114605114606114607114608114609114610114611114612114613114614114615114616114617114618114619114620114621114622114623114624114625114626114627114628114629114630114631114632114633114634114635114636114637114638114639114640114641114642114643114644114645114646114647114648114649114650114651114652114653114654114655114656114657114658114659114660114661114662114663114664114665114666114667114668114669114670114671114672114673114674114675114676114677114678114679114680114681114682114683114684114685114686114687114688114689114690114691114692114693114694114695114696114697114698114699114700114701114702114703114704114705114706114707114708114709114710114711114712114713114714114715114716114717114718114719114720114721114722114723114724114725114726114727114728114729114730114731114732114733114734114735114736114737114738114739114740114741114742114743114744114745114746114747114748114749114750114751114752114753114754114755114756114757114758114759114760114761114762114763114764114765114766114767114768114769114770114771114772114773114774114775114776114777114778114779114780114781114782114783114784114785114786114787114788114789114790114791114792114793114794114795114796114797114798114799114800114801114802114803114804114805114806114807114808114809114810114811114812114813114814114815114816114817114818114819114820114821114822114823114824114825114826114827114828114829114830114831114832114833114834114835114836114837114838114839114840114841114842114843114844114845114846114847114848114849114850114851114852114853114854114855114856114857114858114859114860114861114862114863114864114865114866114867114868114869114870114871114872114873114874114875114876114877114878114879114880114881114882114883114884114885114886114887114888114889114890114891114892114893114894114895114896114897114898114899114900114901114902114903114904114905114906114907114908114909114910114911114912114913114914114915114916114917114918114919114920114921114922114923114924114925114926114927114928114929114930114931114932114933114934114935114936114937114938114939114940114941114942114943114944114945114946114947114948114949114950114951114952114953114954114955114956114957114958114959114960114961114962114963114964114965114966114967114968114969114970114971114972114973114974114975114976114977114978114979114980114981114982114983114984114985114986114987114988114989114990114991114992114993114994114995114996114997114998114999115000115001115002115003115004115005115006115007115008115009115010115011115012115013115014115015115016115017115018115019115020115021115022115023115024115025115026115027115028115029115030115031115032115033115034115035115036115037115038115039115040115041115042115043115044115045115046115047115048115049115050115051115052115053115054115055115056115057115058115059115060115061115062115063115064115065115066115067115068115069115070115071115072115073115074115075115076115077115078115079115080115081115082115083115084115085115086115087115088115089115090115091115092115093115094115095115096115097115098115099115100115101115102115103115104115105115106115107115108115109115110115111115112115113115114115115115116115117115118115119115120115121115122115123115124115125115126115127115128115129115130115131115132115133115134115135115136115137115138115139115140115141115142115143115144115145115146115147115148115149115150115151115152115153115154115155115156115157115158115159115160115161115162115163115164115165115166115167115168115169115170115171115172115173115174115175115176115177115178115179115180115181115182115183115184115185115186115187115188115189115190115191115192115193115194115195115196115197115198115199115200115201115202115203115204115205115206115207115208115209115210115211115212115213115214115215115216115217115218115219115220115221115222115223115224115225115226115227115228115229115230115231115232115233115234115235115236115237115238115239115240115241115242115243115244115245115246115247115248115249115250115251115252115253115254115255115256115257115258115259115260115261115262115263115264115265115266115267115268115269115270115271115272115273115274115275115276115277115278115279115280115281115282115283115284115285115286115287115288115289115290115291115292115293115294115295115296115297115298115299115300115301115302115303115304115305115306115307115308115309115310115311115312115313115314115315115316115317115318115319115320115321115322115323115324115325115326115327115328115329115330115331115332115333115334115335115336115337115338115339115340115341115342115343115344115345115346115347115348115349115350115351115352115353115354115355115356115357115358115359115360115361115362115363115364115365115366115367115368115369115370115371115372115373115374115375115376115377115378115379115380115381115382115383115384115385115386115387115388115389115390115391115392115393115394115395115396115397115398115399115400115401115402115403115404115405115406115407115408115409115410115411115412115413115414115415115416115417115418115419115420115421115422115423115424115425115426115427115428115429115430115431115432115433115434115435115436115437115438115439115440115441115442115443115444115445115446115447115448115449115450115451115452115453115454115455115456115457115458115459115460115461115462115463115464115465115466115467115468115469115470115471115472115473115474115475115476115477115478115479115480115481115482115483115484115485115486115487115488115489115490115491115492115493115494115495115496115497115498115499115500115501115502115503115504115505115506115507115508115509115510115511115512115513115514115515115516115517115518115519115520115521115522115523115524115525115526115527115528115529115530115531115532115533115534115535115536115537115538115539115540115541115542115543115544115545115546115547115548115549115550115551115552115553115554115555115556115557115558115559115560115561115562115563115564115565115566115567115568115569115570115571115572115573115574115575115576115577115578115579115580115581115582115583115584115585115586115587115588115589115590115591115592115593115594115595115596115597115598115599115600115601115602115603115604115605115606115607115608115609115610115611115612115613115614115615115616115617115618115619115620115621115622115623115624115625115626115627115628115629115630115631115632115633115634115635115636115637115638115639115640115641115642115643115644115645115646115647115648115649115650115651115652115653115654115655115656115657115658115659115660115661115662115663115664115665115666115667115668115669115670115671115672115673115674115675115676115677115678115679115680115681115682115683115684115685115686115687115688115689115690115691115692115693115694115695115696115697115698115699115700115701115702115703115704115705115706115707115708115709115710115711115712115713115714115715115716115717115718115719115720115721115722115723115724115725115726115727115728115729115730115731115732115733115734115735115736115737115738115739115740115741115742115743115744115745115746115747115748115749115750115751115752115753115754115755115756115757115758115759115760115761115762115763115764115765115766115767115768115769115770115771115772115773115774115775115776115777115778115779115780115781115782115783115784115785115786115787115788115789115790115791115792115793115794115795115796115797115798115799115800115801115802115803115804115805115806115807115808115809115810115811115812115813115814115815115816115817115818115819115820115821115822115823115824115825115826115827115828115829115830115831115832115833115834115835115836115837115838115839115840115841115842115843115844115845115846115847115848115849115850115851115852115853115854115855115856115857115858115859115860115861115862115863115864115865115866115867115868115869115870115871115872115873115874115875115876115877115878115879115880115881115882115883115884115885115886115887115888115889115890115891115892115893115894115895115896115897115898115899115900115901115902115903115904115905115906115907115908115909115910115911115912115913115914115915115916115917115918115919115920115921115922115923115924115925115926115927115928115929115930115931115932115933115934115935115936115937115938115939115940115941115942115943115944115945115946115947115948115949115950115951115952115953115954115955115956115957115958115959115960115961115962115963115964115965115966115967115968115969115970115971115972115973115974115975115976115977115978115979115980115981115982115983115984115985115986115987115988115989115990115991115992115993115994115995115996115997115998115999116000116001116002116003116004116005116006116007116008116009116010116011116012116013116014116015116016116017116018116019116020116021116022116023116024116025116026116027116028116029116030116031116032116033116034116035116036116037116038116039116040116041116042116043116044116045116046116047116048116049116050116051116052116053116054116055116056116057116058116059116060116061116062116063116064116065116066116067116068116069116070116071116072116073116074116075116076116077116078116079116080116081116082116083116084116085116086116087116088116089116090116091116092116093116094116095116096116097116098116099116100116101116102116103116104116105116106116107116108116109116110116111116112116113116114116115116116116117116118116119116120116121116122116123116124116125116126116127116128116129116130116131116132116133116134116135116136116137116138116139116140116141116142116143116144116145116146116147116148116149116150116151116152116153116154116155116156116157116158116159116160116161116162116163116164116165116166116167116168116169116170116171116172116173116174116175116176116177116178116179116180116181116182116183116184116185116186116187116188116189116190116191116192116193116194116195116196116197116198116199116200116201116202116203116204116205116206116207116208116209116210116211116212116213116214116215116216116217116218116219116220116221116222116223116224116225116226116227116228116229116230116231116232116233116234116235116236116237116238116239116240116241116242116243116244116245116246116247116248116249116250116251116252116253116254116255116256116257116258116259116260116261116262116263116264116265116266116267116268116269116270116271116272116273116274116275116276116277116278116279116280116281116282116283116284116285116286116287116288116289116290116291116292116293116294116295116296116297116298116299116300116301116302116303116304116305116306116307116308116309116310116311116312116313116314116315116316116317116318116319116320116321116322116323116324116325116326116327116328116329116330116331116332116333116334116335116336116337116338116339116340116341116342116343116344116345116346116347116348116349116350116351116352116353116354116355116356116357116358116359116360116361116362116363116364116365116366116367116368116369116370116371116372116373116374116375116376116377116378116379116380116381116382116383116384116385116386116387116388116389116390116391116392116393116394116395116396116397116398116399116400116401116402116403116404116405116406116407116408116409116410116411116412116413116414116415116416116417116418116419116420116421116422116423116424116425116426116427116428116429116430116431116432116433116434116435116436116437116438116439116440116441116442116443116444116445116446116447116448116449116450116451116452116453116454116455116456116457116458116459116460116461116462116463116464116465116466116467116468116469116470116471116472116473116474116475116476116477116478116479116480116481116482116483116484116485116486116487116488116489116490116491116492116493116494116495116496116497116498116499116500116501116502116503116504116505116506116507116508116509116510116511116512116513116514116515116516116517116518116519116520116521116522116523116524116525116526116527116528116529116530116531116532116533116534116535116536116537116538116539116540116541116542116543116544116545116546116547116548116549116550116551116552116553116554116555116556116557116558116559116560116561116562116563116564116565116566116567116568116569116570116571116572116573116574116575116576116577116578116579116580116581116582116583116584116585116586116587116588116589116590116591116592116593116594116595116596116597116598116599116600116601116602116603116604116605116606116607116608116609116610116611116612116613116614116615116616116617116618116619116620116621116622116623116624116625116626116627116628116629116630116631116632116633116634116635116636116637116638116639116640116641116642116643116644116645116646116647116648116649116650116651116652116653116654116655116656116657116658116659116660116661116662116663116664116665116666116667116668116669116670116671116672116673116674116675116676116677116678116679116680116681116682116683116684116685116686116687116688116689116690116691116692116693116694116695116696116697116698116699116700116701116702116703116704116705116706116707116708116709116710116711116712116713116714116715116716116717116718116719116720116721116722116723116724116725116726116727116728116729116730116731116732116733116734116735116736116737116738116739116740116741116742116743116744116745116746116747116748116749116750116751116752116753116754116755116756116757116758116759116760116761116762116763116764116765116766116767116768116769116770116771116772116773116774116775116776116777116778116779116780116781116782116783116784116785116786116787116788116789116790116791116792116793116794116795116796116797116798116799116800116801116802116803116804116805116806116807116808116809116810116811116812116813116814116815116816116817116818116819116820116821116822116823116824116825116826116827116828116829116830116831116832116833116834116835116836116837116838116839116840116841116842116843116844116845116846116847116848116849116850116851116852116853116854116855116856116857116858116859116860116861116862116863116864116865116866116867116868116869116870116871116872116873116874116875116876116877116878116879116880116881116882116883116884116885116886116887116888116889116890116891116892116893116894116895116896116897116898116899116900116901116902116903116904116905116906116907116908116909116910116911116912116913116914116915116916116917116918116919116920116921116922116923116924116925116926116927116928116929116930116931116932116933116934116935116936116937116938116939116940116941116942116943116944116945116946116947116948116949116950116951116952116953116954116955116956116957116958116959116960116961116962116963116964116965116966116967116968116969116970116971116972116973116974116975116976116977116978116979116980116981116982116983116984116985116986116987116988116989116990116991116992116993116994116995116996116997116998116999117000117001117002117003117004117005117006117007117008117009117010117011117012117013117014117015117016117017117018117019117020117021117022117023117024117025117026117027117028117029117030117031117032117033117034117035117036117037117038117039117040117041117042117043117044117045117046117047117048117049117050117051117052117053117054117055117056117057117058117059117060117061117062117063117064117065117066117067117068117069117070117071117072117073117074117075117076117077117078117079117080117081117082117083117084117085117086117087117088117089117090117091117092117093117094117095117096117097117098117099117100117101117102117103117104117105117106117107117108117109117110117111117112117113117114117115117116117117117118117119117120117121117122117123117124117125117126117127117128117129117130117131117132117133117134117135117136117137117138117139117140117141117142117143117144117145117146117147117148117149117150117151117152117153117154117155117156117157117158117159117160117161117162117163117164117165117166117167117168117169117170117171117172117173117174117175117176117177117178117179117180117181117182117183117184117185117186117187117188117189117190117191117192117193117194117195117196117197117198117199117200117201117202117203117204117205117206117207117208117209117210117211117212117213117214117215117216117217117218117219117220117221117222117223117224117225117226117227117228117229117230117231117232117233117234117235117236117237117238117239117240117241117242117243117244117245117246117247117248117249117250117251117252117253117254117255117256117257117258117259117260117261117262117263117264117265117266117267117268117269117270117271117272117273117274117275117276117277117278117279117280117281117282117283117284117285117286117287117288117289117290117291117292117293117294117295117296117297117298117299117300117301117302117303117304117305117306117307117308117309117310117311117312117313117314117315117316117317117318117319117320117321117322117323117324117325117326117327117328117329117330117331117332117333117334117335117336117337117338117339117340117341117342117343117344117345117346117347117348117349117350117351117352117353117354117355117356117357117358117359117360117361117362117363117364117365117366117367117368117369117370117371117372117373117374117375117376117377117378117379117380117381117382117383117384117385117386117387117388117389117390117391117392117393117394117395117396117397117398117399117400117401117402117403117404117405117406117407117408117409117410117411117412117413117414117415117416117417117418117419117420117421117422117423117424117425117426117427117428117429117430117431117432117433117434117435117436117437117438117439117440117441117442117443117444117445117446117447117448117449117450117451117452117453117454117455117456117457117458117459117460117461117462117463117464117465117466117467117468117469117470117471117472117473117474117475117476117477117478117479117480117481117482117483117484117485117486117487117488117489117490117491117492117493117494117495117496117497117498117499117500117501117502117503117504117505117506117507117508117509117510117511117512117513117514117515117516117517117518117519117520117521117522117523117524117525117526117527117528117529117530117531117532117533117534117535117536117537117538117539117540117541117542117543117544117545117546117547117548117549117550117551117552117553117554117555117556117557117558117559117560117561117562117563117564117565117566117567117568117569117570117571117572117573117574117575117576117577117578117579117580117581117582117583117584117585117586117587117588117589117590117591117592117593117594117595117596117597117598117599117600117601117602117603117604117605117606117607117608117609117610117611117612117613117614117615117616117617117618117619117620117621117622117623117624117625117626117627117628117629117630117631117632117633117634117635117636117637117638117639117640117641117642117643117644117645117646117647117648117649117650117651117652117653117654117655117656117657117658117659117660117661117662117663117664117665117666117667117668117669117670117671117672117673117674117675117676117677117678117679117680117681117682117683117684117685117686117687117688117689117690117691117692117693117694117695117696117697117698117699117700117701117702117703117704117705117706117707117708117709117710117711117712117713117714117715117716117717117718117719117720117721117722117723117724117725117726117727117728117729117730117731117732117733117734117735117736117737117738117739117740117741117742117743117744117745117746117747117748117749117750117751117752117753117754117755117756117757117758117759117760117761117762117763117764117765117766117767117768117769117770117771117772117773117774117775117776117777117778117779117780117781117782117783117784117785117786117787117788117789117790117791117792117793117794117795117796117797117798117799117800117801117802117803117804117805117806117807117808117809117810117811117812117813117814117815117816117817117818117819117820117821117822117823117824117825117826117827117828117829117830117831117832117833117834117835117836117837117838117839117840117841117842117843117844117845117846117847117848117849117850117851117852117853117854117855117856117857117858117859117860117861117862117863117864117865117866117867117868117869117870117871117872117873117874117875117876117877117878117879117880117881117882117883117884117885117886117887117888117889117890117891117892117893117894117895117896117897117898117899117900117901117902117903117904117905117906117907117908117909117910117911117912117913117914117915117916117917117918117919117920117921117922117923117924117925117926117927117928117929117930117931117932117933117934117935117936117937117938117939117940117941117942117943117944117945117946117947117948117949117950117951117952117953117954117955117956117957117958117959117960117961117962117963117964117965117966117967117968117969117970117971117972117973117974117975117976117977117978117979117980117981117982117983117984117985117986117987117988117989117990117991117992117993117994117995117996117997117998117999118000118001118002118003118004118005118006118007118008118009118010118011118012118013118014118015118016118017118018118019118020118021118022118023118024118025118026118027118028118029118030118031118032118033118034118035118036118037118038118039118040118041118042118043118044118045118046118047118048118049118050118051118052118053118054118055118056118057118058118059118060118061118062118063118064118065118066118067118068118069118070118071118072118073118074118075118076118077118078118079118080118081118082118083118084118085118086118087118088118089118090118091118092118093118094118095118096118097118098118099118100118101118102118103118104118105118106118107118108118109118110118111118112118113118114118115118116118117118118118119118120118121118122118123118124118125118126118127118128118129118130118131118132118133118134118135118136118137118138118139118140118141118142118143118144118145118146118147118148118149118150118151118152118153118154118155118156118157118158118159118160118161118162118163118164118165118166118167118168118169118170118171118172118173118174118175118176118177118178118179118180118181118182118183118184118185118186118187118188118189118190118191118192118193118194118195118196118197118198118199118200118201118202118203118204118205118206118207118208118209118210118211118212118213118214118215118216118217118218118219118220118221118222118223118224118225118226118227118228118229118230118231118232118233118234118235118236118237118238118239118240118241118242118243118244118245118246118247118248118249118250118251118252118253118254118255118256118257118258118259118260118261118262118263118264118265118266118267118268118269118270118271118272118273118274118275118276118277118278118279118280118281118282118283118284118285118286118287118288118289118290118291118292118293118294118295118296118297118298118299118300118301118302118303118304118305118306118307118308118309118310118311118312118313118314118315118316118317118318118319118320118321118322118323118324118325118326118327118328118329118330118331118332118333118334118335118336118337118338118339118340118341118342118343118344118345118346118347118348118349118350118351118352118353118354118355118356118357118358118359118360118361118362118363118364118365118366118367118368118369118370118371118372118373118374118375118376118377118378118379118380118381118382118383118384118385118386118387118388118389118390118391118392118393118394118395118396118397118398118399118400118401118402118403118404118405118406118407118408118409118410118411118412118413118414118415118416118417118418118419118420118421118422118423118424118425118426118427118428118429118430118431118432118433118434118435118436118437118438118439118440118441118442118443118444118445118446118447118448118449118450118451118452118453118454118455118456118457118458118459118460118461118462118463118464118465118466118467118468118469118470118471118472118473118474118475118476118477118478118479118480118481118482118483118484118485118486118487118488118489118490118491118492118493118494118495118496118497118498118499118500118501118502118503118504118505118506118507118508118509118510118511118512118513118514118515118516118517118518118519118520118521118522118523118524118525118526118527118528118529118530118531118532118533118534118535118536118537118538118539118540118541118542118543118544118545118546118547118548118549118550118551118552118553118554118555118556118557118558118559118560118561118562118563118564118565118566118567118568118569118570118571118572118573118574118575118576118577118578118579118580118581118582118583118584118585118586118587118588118589118590118591118592118593118594118595118596118597118598118599118600118601118602118603118604118605118606118607118608118609118610118611118612118613118614118615118616118617118618118619118620118621118622118623118624118625118626118627118628118629118630118631118632118633118634118635118636118637118638118639118640118641118642118643118644118645118646118647118648118649118650118651118652118653118654118655118656118657118658118659118660118661118662118663118664118665118666118667118668118669118670118671118672118673118674118675118676118677118678118679118680118681118682118683118684118685118686118687118688118689118690118691118692118693118694118695118696118697118698118699118700118701118702118703118704118705118706118707118708118709118710118711118712118713118714118715118716118717118718118719118720118721118722118723118724118725118726118727118728118729118730118731118732118733118734118735118736118737118738118739118740118741118742118743118744118745118746118747118748118749118750118751118752118753118754118755118756118757118758118759118760118761118762118763118764118765118766118767118768118769118770118771118772118773118774118775118776118777118778118779118780118781118782118783118784118785118786118787118788118789118790118791118792118793118794118795118796118797118798118799118800118801118802118803118804118805118806118807118808118809118810118811118812118813118814118815118816118817118818118819118820118821118822118823118824118825118826118827118828118829118830118831118832118833118834118835118836118837118838118839118840118841118842118843118844118845118846118847118848118849118850118851118852118853118854118855118856118857118858118859118860118861118862118863118864118865118866118867118868118869118870118871118872118873118874118875118876118877118878118879118880118881118882118883118884118885118886118887118888118889118890118891118892118893118894118895118896118897118898118899118900118901118902118903118904118905118906118907118908118909118910118911118912118913118914118915118916118917118918118919118920118921118922118923118924118925118926118927118928118929118930118931118932118933118934118935118936118937118938118939118940118941118942118943118944118945118946118947118948118949118950118951118952118953118954118955118956118957118958118959118960118961118962118963118964118965118966118967118968118969118970118971118972118973118974118975118976118977118978118979118980118981118982118983118984118985118986118987118988118989118990118991118992118993118994118995118996118997118998118999119000119001119002119003119004119005119006119007119008119009119010119011119012119013119014119015119016119017119018119019119020119021119022119023119024119025119026119027119028119029119030119031119032119033119034119035119036119037119038119039119040119041119042119043119044119045119046119047119048119049119050119051119052119053119054119055119056119057119058119059119060119061119062119063119064119065119066119067119068119069119070119071119072119073119074119075119076119077119078119079119080119081119082119083119084119085119086119087119088119089119090119091119092119093119094119095119096119097119098119099119100119101119102119103119104119105119106119107119108119109119110119111119112119113119114119115119116119117119118119119119120119121119122119123119124119125119126119127119128119129119130119131119132119133119134119135119136119137119138119139119140119141119142119143119144119145119146119147119148119149119150119151119152119153119154119155119156119157119158119159119160119161119162119163119164119165119166119167119168119169119170119171119172119173119174119175119176119177119178119179119180119181119182119183119184119185119186119187119188119189119190119191119192119193119194119195119196119197119198119199119200119201119202119203119204119205119206119207119208119209119210119211119212119213119214119215119216119217119218119219119220119221119222119223119224119225119226119227119228119229119230119231119232119233119234119235119236119237119238119239119240119241119242119243119244119245119246119247119248119249119250119251119252119253119254119255119256119257119258119259119260119261119262119263119264119265119266119267119268119269119270119271119272119273119274119275119276119277119278119279119280119281119282119283119284119285119286119287119288119289119290119291119292119293119294119295119296119297119298119299119300119301119302119303119304119305119306119307119308119309119310119311119312119313119314119315119316119317119318119319119320119321119322119323119324119325119326119327119328119329119330119331119332119333119334119335119336119337119338119339119340119341119342119343119344119345119346119347119348119349119350119351119352119353119354119355119356119357119358119359119360119361119362119363119364119365119366119367119368119369119370119371119372119373119374119375119376119377119378119379119380119381119382119383119384119385119386119387119388119389119390119391119392119393119394119395119396119397119398119399119400119401119402119403119404119405119406119407119408119409119410119411119412119413119414119415119416119417119418119419119420119421119422119423119424119425119426119427119428119429119430119431119432119433119434119435119436119437119438119439119440119441119442119443119444119445119446119447119448119449119450119451119452119453119454119455119456119457119458119459119460119461119462119463119464119465119466119467119468119469119470119471119472119473119474119475119476119477119478119479119480119481119482119483119484119485119486119487119488119489119490119491119492119493119494119495119496119497119498119499119500119501119502119503119504119505119506119507119508119509119510119511119512119513119514119515119516119517119518119519119520119521119522119523119524119525119526119527119528119529119530119531119532119533119534119535119536119537119538119539119540119541119542119543119544119545119546119547119548119549119550119551119552119553119554119555119556119557119558119559119560119561119562119563119564119565119566119567119568119569119570119571119572119573119574119575119576119577119578119579119580119581119582119583119584119585119586119587119588119589119590119591119592119593119594119595119596119597119598119599119600119601119602119603119604119605119606119607119608119609119610119611119612119613119614119615119616119617119618119619119620119621119622119623119624119625119626119627119628119629119630119631119632119633119634119635119636119637119638119639119640119641119642119643119644119645119646119647119648119649119650119651119652119653119654119655119656119657119658119659119660119661119662119663119664119665119666119667119668119669119670119671119672119673119674119675119676119677119678119679119680119681119682119683119684119685119686119687119688119689119690119691119692119693119694119695119696119697119698119699119700119701119702119703119704119705119706119707119708119709119710119711119712119713119714119715119716119717119718119719119720119721119722119723119724119725119726119727119728119729119730119731119732119733119734119735119736119737119738119739119740119741119742119743119744119745119746119747119748119749119750119751119752119753119754119755119756119757119758119759119760119761119762119763119764119765119766119767119768119769119770119771119772119773119774119775119776119777119778119779119780119781119782119783119784119785119786119787119788119789119790119791119792119793119794119795119796119797119798119799119800119801119802119803119804119805119806119807119808119809119810119811119812119813119814119815119816119817119818119819119820119821119822119823119824119825119826119827119828119829119830119831119832119833119834119835119836119837119838119839119840119841119842119843119844119845119846119847119848119849119850119851119852119853119854119855119856119857119858119859119860119861119862119863119864119865119866119867119868119869119870119871119872119873119874119875119876119877119878119879119880119881119882119883119884119885119886119887119888119889119890119891119892119893119894119895119896119897119898119899119900119901119902119903119904119905119906119907119908119909119910119911119912119913119914119915119916119917119918119919119920119921119922119923119924119925119926119927119928119929119930119931119932119933119934119935119936119937119938119939119940119941119942119943119944119945119946119947119948119949119950119951119952119953119954119955119956119957119958119959119960119961119962119963119964119965119966119967119968119969119970119971119972119973119974119975119976119977119978119979119980119981119982119983119984119985119986119987119988119989119990119991119992119993119994119995119996119997119998119999120000120001120002120003120004120005120006120007120008120009120010120011120012120013120014120015120016120017120018120019120020120021120022120023120024120025120026120027120028120029120030120031120032120033120034120035120036120037120038120039120040120041120042120043120044120045120046120047120048120049120050120051120052120053120054120055120056120057120058120059120060120061120062120063120064120065120066120067120068120069120070120071120072120073120074120075120076120077120078120079120080120081120082120083120084120085120086120087120088120089120090120091120092120093120094120095120096120097120098120099120100120101120102120103120104120105120106120107120108120109120110120111120112120113120114120115120116120117120118120119120120120121120122120123120124120125120126120127120128120129120130120131120132120133120134120135120136120137120138120139120140120141120142120143120144120145120146120147120148120149120150120151120152120153120154120155120156120157120158120159120160120161120162120163120164120165120166120167120168120169120170120171120172120173120174120175120176120177120178120179120180120181120182120183120184120185120186120187120188120189120190120191120192120193120194120195120196120197120198120199120200120201120202120203120204120205120206120207120208120209120210120211120212120213120214120215120216120217120218120219120220120221120222120223120224120225120226120227120228120229120230120231120232120233120234120235120236120237120238120239120240120241120242120243120244120245120246120247120248120249120250120251120252120253120254120255120256120257120258120259120260120261120262120263120264120265120266120267120268120269120270120271120272120273120274120275120276120277120278120279120280120281120282120283120284120285120286120287120288120289120290120291120292120293120294120295120296120297120298120299120300120301120302120303120304120305120306120307120308120309120310120311120312120313120314120315120316120317120318120319120320120321120322120323120324120325120326120327120328120329120330120331120332120333120334120335120336120337120338120339120340120341120342120343120344120345120346120347120348120349120350120351120352120353120354120355120356120357120358120359120360120361120362120363120364120365120366120367120368120369120370120371120372120373120374120375120376120377120378120379120380120381120382120383120384120385120386120387120388120389120390120391120392120393120394120395120396120397120398120399120400120401120402120403120404120405120406120407120408120409120410120411120412120413120414120415120416120417120418120419120420120421120422120423120424120425120426120427120428120429120430120431120432120433120434120435120436120437120438120439120440120441120442120443120444120445120446120447120448120449120450120451120452120453120454120455120456120457120458120459120460120461120462120463120464120465120466120467120468120469120470120471120472120473120474120475120476120477120478120479120480120481120482120483120484120485120486120487120488120489120490120491120492120493120494120495120496120497120498120499120500120501120502120503120504120505120506120507120508120509120510120511120512120513120514120515120516120517120518120519120520120521120522120523120524120525120526120527120528120529120530120531120532120533120534120535120536120537120538120539120540120541120542120543120544120545120546120547120548120549120550120551120552120553120554120555120556120557120558120559120560120561120562120563120564120565120566120567120568120569120570120571120572120573120574120575120576120577120578120579120580120581120582120583120584120585120586120587120588120589120590120591120592120593120594120595120596120597120598120599120600120601120602120603120604120605120606120607120608120609120610120611120612120613120614120615120616120617120618120619120620120621120622120623120624120625120626120627120628120629120630120631120632120633120634120635120636120637120638120639120640120641120642120643120644120645120646120647120648120649120650120651120652120653120654120655120656120657120658120659120660120661120662120663120664120665120666120667120668120669120670120671120672120673120674120675120676120677120678120679120680120681120682120683120684120685120686120687120688120689120690120691120692120693120694120695120696120697120698120699120700120701120702120703120704120705120706120707120708120709120710120711120712120713120714120715120716120717120718120719120720120721120722120723120724120725120726120727120728120729120730120731120732120733120734120735120736120737120738120739120740120741120742120743120744120745120746120747120748120749120750120751120752120753120754120755120756120757120758120759120760120761120762120763120764120765120766120767120768120769120770120771120772120773120774120775120776120777120778120779120780120781120782120783120784120785120786120787120788120789120790120791120792120793120794120795120796120797120798120799120800120801120802120803120804120805120806120807120808120809120810120811120812120813120814120815120816120817120818120819120820120821120822120823120824120825120826120827120828120829120830120831120832120833120834120835120836120837120838120839120840120841120842120843120844120845120846120847120848120849120850120851120852120853120854120855120856120857120858120859120860120861120862120863120864120865120866120867120868120869120870120871120872120873120874120875120876120877120878120879120880120881120882120883120884120885120886120887120888120889120890120891120892120893120894120895120896120897120898120899120900120901120902120903120904120905120906120907120908120909120910120911120912120913120914120915120916120917120918120919120920120921120922120923120924120925120926120927120928120929120930120931120932120933120934120935120936120937120938120939120940120941120942120943120944120945120946120947120948120949120950120951120952120953120954120955120956120957120958120959120960120961120962120963120964120965120966120967120968120969120970120971120972120973120974120975120976120977120978120979120980120981120982120983120984120985120986120987120988120989120990120991120992120993120994120995120996120997120998120999121000121001121002121003121004121005121006121007121008121009121010121011121012121013121014121015121016121017121018121019121020121021121022121023121024121025121026121027121028121029121030121031121032121033121034121035121036121037121038121039121040121041121042121043121044121045121046121047121048121049121050121051121052121053121054121055121056121057121058121059121060121061121062121063121064121065121066121067121068121069121070121071121072121073121074121075121076121077121078121079121080121081121082121083121084121085121086121087121088121089121090121091121092121093121094121095121096121097121098121099121100121101121102121103121104121105121106121107121108121109121110121111121112121113121114121115121116121117121118121119121120121121121122121123121124121125121126121127121128121129121130121131121132121133121134121135121136121137121138121139121140121141121142121143121144121145121146121147121148121149121150121151121152121153121154121155121156121157121158121159121160121161121162121163121164121165121166121167121168121169121170121171121172121173121174121175121176121177121178121179121180121181121182121183121184121185121186121187121188121189121190121191121192121193121194121195121196121197121198121199121200121201121202121203121204121205121206121207121208121209121210121211121212121213121214121215121216121217121218121219121220121221121222121223121224121225121226121227121228121229121230121231121232121233121234121235121236121237121238121239121240121241121242121243121244121245121246121247121248121249121250121251121252121253121254121255121256121257121258121259121260121261121262121263121264121265121266121267121268121269121270121271121272121273121274121275121276121277121278121279121280121281121282121283121284121285121286121287121288121289121290121291121292121293121294121295121296121297121298121299121300121301121302121303121304121305121306121307121308121309121310121311121312121313121314121315121316121317121318121319121320121321121322121323121324121325121326121327121328121329121330121331121332121333121334121335121336121337121338121339121340121341121342121343121344121345121346121347121348121349121350121351121352121353121354121355121356121357121358121359121360121361121362121363121364121365121366121367121368121369121370121371121372121373121374121375121376121377121378121379121380121381121382121383121384121385121386121387121388121389121390121391121392121393121394121395121396121397121398121399121400121401121402121403121404121405121406121407121408121409121410121411121412121413121414121415121416121417121418121419121420121421121422121423121424121425121426121427121428121429121430121431121432121433121434121435121436121437121438121439121440121441121442121443121444121445121446121447121448121449121450121451121452121453121454121455121456121457121458121459121460121461121462121463121464121465121466121467121468121469121470121471121472121473121474121475121476121477121478121479121480121481121482121483121484121485121486121487121488121489121490121491121492121493121494121495121496121497121498121499121500121501121502121503121504121505121506121507121508121509121510121511121512121513121514121515121516121517121518121519121520121521121522121523121524121525121526121527121528121529121530121531121532121533121534121535121536121537121538121539121540121541121542121543121544121545121546121547121548121549121550121551121552121553121554121555121556121557121558121559121560121561121562121563121564121565121566121567121568121569121570121571121572121573121574121575121576121577121578121579121580121581121582121583121584121585121586121587121588121589121590121591121592121593121594121595121596121597121598121599121600121601121602121603121604121605121606121607121608121609121610121611121612121613121614121615121616121617121618121619121620121621121622121623121624121625121626121627121628121629121630121631121632121633121634121635121636121637121638121639121640121641121642121643121644121645121646121647121648121649121650121651121652121653121654121655121656121657121658121659121660121661121662121663121664121665121666121667121668121669121670121671121672121673121674121675121676121677121678121679121680121681121682121683121684121685121686121687121688121689121690121691121692121693121694121695121696121697121698121699121700121701121702121703121704121705121706121707121708121709121710121711121712121713121714121715121716121717121718121719121720121721121722121723121724121725121726121727121728121729121730121731121732121733121734121735121736121737121738121739121740121741121742121743121744121745121746121747121748121749121750121751121752121753121754121755121756121757121758121759121760121761121762121763121764121765121766121767121768121769121770121771121772121773121774121775121776121777121778121779121780121781121782121783121784121785121786121787121788121789121790121791121792121793121794121795121796121797121798121799121800121801121802121803121804121805121806121807121808121809121810121811121812121813121814121815121816121817121818121819121820121821121822121823121824121825121826121827121828121829121830121831121832121833121834121835121836121837121838121839121840121841121842121843121844121845121846121847121848121849121850121851121852121853121854121855121856121857121858121859121860121861121862121863121864121865121866121867121868121869121870121871121872121873121874121875121876121877121878121879121880121881121882121883121884121885121886121887121888121889121890121891121892121893121894121895121896121897121898121899121900121901121902121903121904121905121906121907121908121909121910121911121912121913121914121915121916121917121918121919121920121921121922121923121924121925121926121927121928121929121930121931121932121933121934121935121936121937121938121939121940121941121942121943121944121945121946121947121948121949121950121951121952121953121954121955121956121957121958121959121960121961121962121963121964121965121966121967121968121969121970121971121972121973121974121975121976121977121978121979121980121981121982121983121984121985121986121987121988121989121990121991121992121993121994121995121996121997121998121999122000122001122002122003122004122005122006122007122008122009122010122011122012122013122014122015122016122017122018122019122020122021122022122023122024122025122026122027122028122029122030122031122032122033122034122035122036122037122038122039122040122041122042122043122044122045122046122047122048122049122050122051122052122053122054122055122056122057122058122059122060122061122062122063122064122065122066122067122068122069122070122071122072122073122074122075122076122077122078122079122080122081122082122083122084122085122086122087122088122089122090122091122092122093122094122095122096122097122098122099122100122101122102122103122104122105122106122107122108122109122110122111122112122113122114122115122116122117122118122119122120122121122122122123122124122125122126122127122128122129122130122131122132122133122134122135122136122137122138122139122140122141122142122143122144122145122146122147122148122149122150122151122152122153122154122155122156122157122158122159122160122161122162122163122164122165122166122167122168122169122170122171122172122173122174122175122176122177122178122179122180122181122182122183122184122185122186122187122188122189122190122191122192122193122194122195122196122197122198122199122200122201122202122203122204122205122206122207122208122209122210122211122212122213122214122215122216122217122218122219122220122221122222122223122224122225122226122227122228122229122230122231122232122233122234122235122236122237122238122239122240122241122242122243122244122245122246122247122248122249122250122251122252122253122254122255122256122257122258122259122260122261122262122263122264122265122266122267122268122269122270122271122272122273122274122275122276122277122278122279122280122281122282122283122284122285122286122287122288122289122290122291122292122293122294122295122296122297122298122299122300122301122302122303122304122305122306122307122308122309122310122311122312122313122314122315122316122317122318122319122320122321122322122323122324122325122326122327122328122329122330122331122332122333122334122335122336122337122338122339122340122341122342122343122344122345122346122347122348122349122350122351122352122353122354122355122356122357122358122359122360122361122362122363122364122365122366122367122368122369122370122371122372122373122374122375122376122377122378122379122380122381122382122383122384122385122386122387122388122389122390122391122392122393122394122395122396122397122398122399122400122401122402122403122404122405122406122407122408122409122410122411122412122413122414122415122416122417122418122419122420122421122422122423122424122425122426122427122428122429122430122431122432122433122434122435122436122437122438122439122440122441122442122443122444122445122446122447122448122449122450122451122452122453122454122455122456122457122458122459122460122461122462122463122464122465122466122467122468122469122470122471122472122473122474122475122476122477122478122479122480122481122482122483122484122485122486122487122488122489122490122491122492122493122494122495122496122497122498122499122500122501122502122503122504122505122506122507122508122509122510122511122512122513122514122515122516122517122518122519122520122521122522122523122524122525122526122527122528122529122530122531122532122533122534122535122536122537122538122539122540122541122542122543122544122545122546122547122548122549122550122551122552122553122554122555122556122557122558122559122560122561122562122563122564122565122566122567122568122569122570122571122572122573122574122575122576122577122578122579122580122581122582122583122584122585122586122587122588122589122590122591122592122593122594122595122596122597122598122599122600122601122602122603122604122605122606122607122608122609122610122611122612122613122614122615122616122617122618122619122620122621122622122623122624122625122626122627122628122629122630122631122632122633122634122635122636122637122638122639122640122641122642122643122644122645122646122647122648122649122650122651122652122653122654122655122656122657122658122659122660122661122662122663122664122665122666122667122668122669122670122671122672122673122674122675122676122677122678122679122680122681122682122683122684122685122686122687122688122689122690122691122692122693122694122695122696122697122698122699122700122701122702122703122704122705122706122707122708122709122710122711122712122713122714122715122716122717122718122719122720122721122722122723122724122725122726122727122728122729122730122731122732122733122734122735122736122737122738122739122740122741122742122743122744122745122746122747122748122749122750122751122752122753122754122755122756122757122758122759122760122761122762122763122764122765122766122767122768122769122770122771122772122773122774122775122776122777122778122779122780122781122782122783122784122785122786122787122788122789122790122791122792122793122794122795122796122797122798122799122800122801122802122803122804122805122806122807122808122809122810122811122812122813122814122815122816122817122818122819122820122821122822122823122824122825122826122827122828122829122830122831122832122833122834122835122836122837122838122839122840122841122842122843122844122845122846122847122848122849122850122851122852122853122854122855122856122857122858122859122860122861122862122863122864122865122866122867122868122869122870122871122872122873122874122875122876122877122878122879122880122881122882122883122884122885122886122887122888122889122890122891122892122893122894122895122896122897122898122899122900122901122902122903122904122905122906122907122908122909122910122911122912122913122914122915122916122917122918122919122920122921122922122923122924122925122926122927122928122929122930122931122932122933122934122935122936122937122938122939122940122941122942122943122944122945122946122947122948122949122950122951122952122953122954122955122956122957122958122959122960122961122962122963122964122965122966122967122968122969122970122971122972122973122974122975122976122977122978122979122980122981122982122983122984122985122986122987122988122989122990122991122992122993122994122995122996122997122998122999123000123001123002123003123004123005123006123007123008123009123010123011123012123013123014123015123016123017123018123019123020123021123022123023123024123025123026123027123028123029123030123031123032123033123034123035123036123037123038123039123040123041123042123043123044123045123046123047123048123049123050123051123052123053123054123055123056123057123058123059123060123061123062123063123064123065123066123067123068123069123070123071123072123073123074123075123076123077123078123079123080123081123082123083123084123085123086123087123088123089123090123091123092123093123094123095123096123097123098123099123100123101123102123103123104123105123106123107123108123109123110123111123112123113123114123115123116123117123118123119123120123121123122123123123124123125123126123127123128123129123130123131123132123133123134123135123136123137123138123139123140123141123142123143123144123145123146123147123148123149123150123151123152123153123154123155123156123157123158123159123160123161123162123163123164123165123166123167123168123169123170123171123172123173123174123175123176123177123178123179123180123181123182123183123184123185123186123187123188123189123190123191123192123193123194123195123196123197123198123199123200123201123202123203123204123205123206123207123208123209123210123211123212123213123214123215123216123217123218123219123220123221123222123223123224123225123226123227123228123229123230123231123232123233123234123235123236123237123238123239123240123241123242123243123244123245123246123247123248123249123250123251123252123253123254123255123256123257123258123259123260123261123262123263123264123265123266123267123268123269123270123271123272123273123274123275123276123277123278123279123280123281123282123283123284123285123286123287123288123289123290123291123292123293123294123295123296123297123298123299123300123301123302123303123304123305123306123307123308123309123310123311123312123313123314123315123316123317123318123319123320123321123322123323123324123325123326123327123328123329123330123331123332123333123334123335123336123337123338123339123340123341123342123343123344123345123346123347123348123349123350123351123352123353123354123355123356123357123358123359123360123361123362123363123364123365123366123367123368123369123370123371123372123373123374123375123376123377123378123379123380123381123382123383123384123385123386123387123388123389123390123391123392123393123394123395123396123397123398123399123400123401123402123403123404123405123406123407123408123409123410123411123412123413123414123415123416123417123418123419123420123421123422123423123424123425123426123427123428123429123430123431123432123433123434123435123436123437123438123439123440123441123442123443123444123445123446123447123448123449123450123451123452123453123454123455123456123457123458123459123460123461123462123463123464123465123466123467123468123469123470123471123472123473123474123475123476123477123478123479123480123481123482123483123484123485123486123487123488123489123490123491123492123493123494123495123496123497123498123499123500123501123502123503123504123505123506123507123508123509123510123511123512123513123514123515123516123517123518123519123520123521123522123523123524123525123526123527123528123529123530123531123532123533123534123535123536123537123538123539123540123541123542123543123544123545123546123547123548123549123550123551123552123553123554123555123556123557123558123559123560123561123562123563123564123565123566123567123568123569123570123571123572123573123574123575123576123577123578123579123580123581123582123583123584123585123586123587123588123589123590123591123592123593123594123595123596123597123598123599123600123601123602123603123604123605123606123607123608123609123610123611123612123613123614123615123616123617123618123619123620123621123622123623123624123625123626123627123628123629123630123631123632123633123634123635123636123637123638123639123640123641123642123643123644123645123646123647123648123649123650123651123652123653123654123655123656123657123658123659123660123661123662123663123664123665123666123667123668123669123670123671123672123673123674123675123676123677123678123679123680123681123682123683123684123685123686123687123688123689123690123691123692123693123694123695123696123697123698123699123700123701123702123703123704123705123706123707123708123709123710123711123712123713123714123715123716123717123718123719123720123721123722123723123724123725123726123727123728123729123730123731123732123733123734123735123736123737123738123739123740123741123742123743123744123745123746123747123748123749123750123751123752123753123754123755123756123757123758123759123760123761123762123763123764123765123766123767123768123769123770123771123772123773123774123775123776123777123778123779123780123781123782123783123784123785123786123787123788123789123790123791123792123793123794123795123796123797123798123799123800123801123802123803123804123805123806123807123808123809123810123811123812123813123814123815123816123817123818123819123820123821123822123823123824123825123826123827123828123829123830123831123832123833123834123835123836123837123838123839123840123841123842123843123844123845123846123847123848123849123850123851123852123853123854123855123856123857123858123859123860123861123862123863123864123865123866123867123868123869123870123871123872123873123874123875123876123877123878123879123880123881123882123883123884123885123886123887123888123889123890123891123892123893123894123895123896123897123898123899123900123901123902123903123904123905123906123907123908123909123910123911123912123913123914123915123916123917123918123919123920123921123922123923123924123925123926123927123928123929123930123931123932123933123934123935123936123937123938123939123940123941123942123943123944123945123946123947123948123949123950123951123952123953123954123955123956123957123958123959123960123961123962123963123964123965123966123967123968123969123970123971123972123973123974123975123976123977123978123979123980123981123982123983123984123985123986123987123988123989123990123991123992123993123994123995123996123997123998123999124000124001124002124003124004124005124006124007124008124009124010124011124012124013124014124015124016124017124018124019124020124021124022124023124024124025124026124027124028124029124030124031124032124033124034124035124036124037124038124039124040124041124042124043124044124045124046124047124048124049124050124051124052124053124054124055124056124057124058124059124060124061124062124063124064124065124066124067124068124069124070124071124072124073124074124075124076124077124078124079124080124081124082124083124084124085124086124087124088124089124090124091124092124093124094124095124096124097124098124099124100124101124102124103124104124105124106124107124108124109124110124111124112124113124114124115124116124117124118124119124120124121124122124123124124124125124126124127124128124129124130124131124132124133124134124135124136124137124138124139124140124141124142124143124144124145124146124147124148124149124150124151124152124153124154124155124156124157124158124159124160124161124162124163124164124165124166124167124168124169124170124171124172124173124174124175124176124177124178124179124180124181124182124183124184124185124186124187124188124189124190124191124192124193124194124195124196124197124198124199124200124201124202124203124204124205124206124207124208124209124210124211124212124213124214124215124216124217124218124219124220124221124222124223124224124225124226124227124228124229124230124231124232124233124234124235124236124237124238124239124240124241124242124243124244124245124246124247124248124249124250124251124252124253124254124255124256124257124258124259124260124261124262124263124264124265124266124267124268124269124270124271124272124273124274124275124276124277124278124279124280124281124282124283124284124285124286124287124288124289124290124291124292124293124294124295124296124297124298124299124300124301124302124303124304124305124306124307124308124309124310124311124312124313124314124315124316124317124318124319124320124321124322124323124324124325124326124327124328124329124330124331124332124333124334124335124336124337124338124339124340124341124342124343124344124345124346124347124348124349124350124351124352124353124354124355124356124357124358124359124360124361124362124363124364124365124366124367124368124369124370124371124372124373124374124375124376124377124378124379124380124381124382124383124384124385124386124387124388124389124390124391124392124393124394124395124396124397124398124399124400124401124402124403124404124405124406124407124408124409124410124411124412124413124414124415124416124417124418124419124420124421124422124423124424124425124426124427124428124429124430124431124432124433124434124435124436124437124438124439124440124441124442124443124444124445124446124447124448124449124450124451124452124453124454124455124456124457124458124459124460124461124462124463124464124465124466124467124468124469124470124471124472124473124474124475124476124477124478124479124480124481124482124483124484124485124486124487124488124489124490124491124492124493124494124495124496124497124498124499124500124501124502124503124504124505124506124507124508124509124510124511124512124513124514124515124516124517124518124519124520124521124522124523124524124525124526124527124528124529124530124531124532124533124534124535124536124537124538124539124540124541124542124543124544124545124546124547124548124549124550124551124552124553124554124555124556124557124558124559124560124561124562124563124564124565124566124567124568124569124570124571124572124573124574124575124576124577124578124579124580124581124582124583124584124585124586124587124588124589124590124591124592124593124594124595124596124597124598124599124600124601124602124603124604124605124606124607124608124609124610124611124612124613124614124615124616124617124618124619124620124621124622124623124624124625124626124627124628124629124630124631124632124633124634124635124636124637124638124639124640124641124642124643124644124645124646124647124648124649124650124651124652124653124654124655124656124657124658124659124660124661124662124663124664124665124666124667124668124669124670124671124672124673124674124675124676124677124678124679124680124681124682124683124684124685124686124687124688124689124690124691124692124693124694124695124696124697124698124699124700124701124702124703124704124705124706124707124708124709124710124711124712124713124714124715124716124717124718124719124720124721124722124723124724124725124726124727124728124729124730124731124732124733124734124735124736124737124738124739124740124741124742124743124744124745124746124747124748124749124750124751124752124753124754124755124756124757124758124759124760124761124762124763124764124765124766124767124768124769124770124771124772124773124774124775124776124777124778124779124780124781124782124783124784124785124786124787124788124789124790124791124792124793124794124795124796124797124798124799124800124801124802124803124804124805124806124807124808124809124810124811124812124813124814124815124816124817124818124819124820124821124822124823124824124825124826124827124828124829124830124831124832124833124834124835124836124837124838124839124840124841124842124843124844124845124846124847124848124849124850124851124852124853124854124855124856124857124858124859124860124861124862124863124864124865124866124867124868124869124870124871124872124873124874124875124876124877124878124879124880124881124882124883124884124885124886124887124888124889124890124891124892124893124894124895124896124897124898124899124900124901124902124903124904124905124906124907124908124909124910124911124912124913124914124915124916124917124918124919124920124921124922124923124924124925124926124927124928124929124930124931124932124933124934124935124936124937124938124939124940124941124942124943124944124945124946124947124948124949124950124951124952124953124954124955124956124957124958124959124960124961124962124963124964124965124966124967124968124969124970124971124972124973124974124975124976124977124978124979124980124981124982124983124984124985124986124987124988124989124990124991124992124993124994124995124996124997124998124999125000125001125002125003125004125005125006125007125008125009125010125011125012125013125014125015125016125017125018125019125020125021125022125023125024125025125026125027125028125029125030125031125032125033125034125035125036125037125038125039125040125041125042125043125044125045125046125047125048125049125050125051125052125053125054125055125056125057125058125059125060125061125062125063125064125065125066125067125068125069125070125071125072125073125074125075125076125077125078125079125080125081125082125083125084125085125086125087125088125089125090125091125092125093125094125095125096125097125098125099125100125101125102125103125104125105125106125107125108125109125110125111125112125113125114125115125116125117125118125119125120125121125122125123125124125125125126125127125128125129125130125131125132125133125134125135125136125137125138125139125140125141125142125143125144125145125146125147125148125149125150125151125152125153125154125155125156125157125158125159125160125161125162125163125164125165125166125167125168125169125170125171125172125173125174125175125176125177125178125179125180125181125182125183125184125185125186125187125188125189125190125191125192125193125194125195125196125197125198125199125200125201125202125203125204125205125206125207125208125209125210125211125212125213125214125215125216125217125218125219125220125221125222125223125224125225125226125227125228125229125230125231125232125233125234125235125236125237125238125239125240125241125242125243125244125245125246125247125248125249125250125251125252125253125254125255125256125257125258125259125260125261125262125263125264125265125266125267125268125269125270125271125272125273125274125275125276125277125278125279125280125281125282125283125284125285125286125287125288125289125290125291125292125293125294125295125296125297125298125299125300125301125302125303125304125305125306125307125308125309125310125311125312125313125314125315125316125317125318125319125320125321125322125323125324125325125326125327125328125329125330125331125332125333125334125335125336125337125338125339125340125341125342125343125344125345125346125347125348125349125350125351125352125353125354125355125356125357125358125359125360125361125362125363125364125365125366125367125368125369125370125371125372125373125374125375125376125377125378125379125380125381125382125383125384125385125386125387125388125389125390125391125392125393125394125395125396125397125398125399125400125401125402125403125404125405125406125407125408125409125410125411125412125413125414125415125416125417125418125419125420125421125422125423125424125425125426125427125428125429125430125431125432125433125434125435125436125437125438125439125440125441125442125443125444125445125446125447125448125449125450125451125452125453125454125455125456125457125458125459125460125461125462125463125464125465125466125467125468125469125470125471125472125473125474125475125476125477125478125479125480125481125482125483125484125485125486125487125488125489125490125491125492125493125494125495125496125497125498125499125500125501125502125503125504125505125506125507125508125509125510125511125512125513125514125515125516125517125518125519125520125521125522125523125524125525125526125527125528125529125530125531125532125533125534125535125536125537125538125539125540125541125542125543125544125545125546125547125548125549125550125551125552125553125554125555125556125557125558125559125560125561125562125563125564125565125566125567125568125569125570125571125572125573125574125575125576125577125578125579125580125581125582125583125584125585125586125587125588125589125590125591125592125593125594125595125596125597125598125599125600125601125602125603125604125605125606125607125608125609125610125611125612125613125614125615125616125617125618125619125620125621125622125623125624125625125626125627125628125629125630125631125632125633125634125635125636125637125638125639125640125641125642125643125644125645125646125647125648125649125650125651125652125653125654125655125656125657125658125659125660125661125662125663125664125665125666125667125668125669125670125671125672125673125674125675125676125677125678125679125680125681125682125683125684125685125686125687125688125689125690125691125692125693125694125695125696125697125698125699125700125701125702125703125704125705125706125707125708125709125710125711125712125713125714125715125716125717125718125719125720125721125722125723125724125725125726125727125728125729125730125731125732125733125734125735125736125737125738125739125740125741125742125743125744125745125746125747125748125749125750125751125752125753125754125755125756125757125758125759125760125761125762125763125764125765125766125767125768125769125770125771125772125773125774125775125776125777125778125779125780125781125782125783125784125785125786125787125788125789125790125791125792125793125794125795125796125797125798125799125800125801125802125803125804125805125806125807125808125809125810125811125812125813125814125815125816125817125818125819125820125821125822125823125824125825125826125827125828125829125830125831125832125833125834125835125836125837125838125839125840125841125842125843125844125845125846125847125848125849125850125851125852125853125854125855125856125857125858125859125860125861125862125863125864125865125866125867125868125869125870125871125872125873125874125875125876125877125878125879125880125881125882125883125884125885125886125887125888125889125890125891125892125893125894125895125896125897125898125899125900125901125902125903125904125905125906125907125908125909125910125911125912125913125914125915125916125917125918125919125920125921125922125923125924125925125926125927125928125929125930125931125932125933125934125935125936125937125938125939125940125941125942125943125944125945125946125947125948125949125950125951125952125953125954125955125956125957125958125959125960125961125962125963125964125965125966125967125968125969125970125971125972125973125974125975125976125977125978125979125980125981125982125983125984125985125986125987125988125989125990125991125992125993125994125995125996125997125998125999126000126001126002126003126004126005126006126007126008126009126010126011126012126013126014126015126016126017126018126019126020126021126022126023126024126025126026126027126028126029126030126031126032126033126034126035126036126037126038126039126040126041126042126043126044126045126046126047126048126049126050126051126052126053126054126055126056126057126058126059126060126061126062126063126064126065126066126067126068126069126070126071126072126073126074126075126076126077126078126079126080126081126082126083126084126085126086126087126088126089126090126091126092126093126094126095126096126097126098126099126100126101126102126103126104126105126106126107126108126109126110126111126112126113126114126115126116126117126118126119126120126121126122126123126124126125126126126127126128126129126130126131126132126133126134126135126136126137126138126139126140126141126142126143126144126145126146126147126148126149126150126151126152126153126154126155126156126157126158126159126160126161126162126163126164126165126166126167126168126169126170126171126172126173126174126175126176126177126178126179126180126181126182126183126184126185126186126187126188126189126190126191126192126193126194126195126196126197126198126199126200126201126202126203126204126205126206126207126208126209126210126211126212126213126214126215126216126217126218126219126220126221126222126223126224126225126226126227126228126229126230126231126232126233126234126235126236126237126238126239126240126241126242126243126244126245126246126247126248126249126250126251126252126253126254126255126256126257126258126259126260126261126262126263126264126265126266126267126268126269126270126271126272126273126274126275126276126277126278126279126280126281126282126283126284126285126286126287126288126289126290126291126292126293126294126295126296126297126298126299126300126301126302126303126304126305126306126307126308126309126310126311126312126313126314126315126316126317126318126319126320126321126322126323126324126325126326126327126328126329126330126331126332126333126334126335126336126337126338126339126340126341126342126343126344126345126346126347126348126349126350126351126352126353126354126355126356126357126358126359126360126361126362126363126364126365126366126367126368126369126370126371126372126373126374126375126376126377126378126379126380126381126382126383126384126385126386126387126388126389126390126391126392126393126394126395126396126397126398126399126400126401126402126403126404126405126406126407126408126409126410126411126412126413126414126415126416126417126418126419126420126421126422126423126424126425126426126427126428126429126430126431126432126433126434126435126436126437126438126439126440126441126442126443126444126445126446126447126448126449126450126451126452126453126454126455126456126457126458126459126460126461126462126463126464126465126466126467126468126469126470126471126472126473126474126475126476126477126478126479126480126481126482126483126484126485126486126487126488126489126490126491126492126493126494126495126496126497126498126499126500126501126502126503126504126505126506126507126508126509126510126511126512126513126514126515126516126517126518126519126520126521126522126523126524126525126526126527126528126529126530126531126532126533126534126535126536126537126538126539126540126541126542126543126544126545126546126547126548126549126550126551126552126553126554126555126556126557126558126559126560126561126562126563126564126565126566126567126568126569126570126571126572126573126574126575126576126577126578126579126580126581126582126583126584126585126586126587126588126589126590126591126592126593126594126595126596126597126598126599126600126601126602126603126604126605126606126607126608126609126610126611126612126613126614126615126616126617126618126619126620126621126622126623126624126625126626126627126628126629126630126631126632126633126634126635126636126637126638126639126640126641126642126643126644126645126646126647126648126649126650126651126652126653126654126655126656126657126658126659126660126661126662126663126664126665126666126667126668126669126670126671126672126673126674126675126676126677126678126679126680126681126682126683126684126685126686126687126688126689126690126691126692126693126694126695126696126697126698126699126700126701126702126703126704126705126706126707126708126709126710126711126712126713126714126715126716126717126718126719126720126721126722126723126724126725126726126727126728126729126730126731126732126733126734126735126736126737126738126739126740126741126742126743126744126745126746126747126748126749126750126751126752126753126754126755126756126757126758126759126760126761126762126763126764126765126766126767126768126769126770126771126772126773126774126775126776126777126778126779126780126781126782126783126784126785126786126787126788126789126790126791126792126793126794126795126796126797126798126799126800126801126802126803126804126805126806126807126808126809126810126811126812126813126814126815126816126817126818126819126820126821126822126823126824126825126826126827126828126829126830126831126832126833126834126835126836126837126838126839126840126841126842126843126844126845126846126847126848126849126850126851126852126853126854126855126856126857126858126859126860126861126862126863126864126865126866126867126868126869126870126871126872126873126874126875126876126877126878126879126880126881126882126883126884126885126886126887126888126889126890126891126892126893126894126895126896126897126898126899126900126901126902126903126904126905126906126907126908126909126910126911126912126913126914126915126916126917126918126919126920126921126922126923126924126925126926126927126928126929126930126931126932126933126934126935126936126937126938126939126940126941126942126943126944126945126946126947126948126949126950126951126952126953126954126955126956126957126958126959126960126961126962126963126964126965126966126967126968126969126970126971126972126973126974126975126976126977126978126979126980126981126982126983126984126985126986126987126988126989126990126991126992126993126994126995126996126997126998126999127000127001127002127003127004127005127006127007127008127009127010127011127012127013127014127015127016127017127018127019127020127021127022127023127024127025127026127027127028127029127030127031127032127033127034127035127036127037127038127039127040127041127042127043127044127045127046127047127048127049127050127051127052127053127054127055127056127057127058127059127060127061127062127063127064127065127066127067127068127069127070127071127072127073127074127075127076127077127078127079127080127081127082127083127084127085127086127087127088127089127090127091127092127093127094127095127096127097127098127099127100127101127102127103127104127105127106127107127108127109127110127111127112127113127114127115127116127117127118127119127120127121127122127123127124127125127126127127127128127129127130127131127132127133127134127135127136127137127138127139127140127141127142127143127144127145127146127147127148127149127150127151127152127153127154127155127156127157127158127159127160127161127162127163127164127165127166127167127168127169127170127171127172127173127174127175127176127177127178127179127180127181127182127183127184127185127186127187127188127189127190127191127192127193127194127195127196127197127198127199127200127201127202127203127204127205127206127207127208127209127210127211127212127213127214127215127216127217127218127219127220127221127222127223127224127225127226127227127228127229127230127231127232127233127234127235127236127237127238127239127240127241127242127243127244127245127246127247127248127249127250127251127252127253127254127255127256127257127258127259127260127261127262127263127264127265127266127267127268127269127270127271127272127273127274127275127276127277127278127279127280127281127282127283127284127285127286127287127288127289127290127291127292127293127294127295127296127297127298127299127300127301127302127303127304127305127306127307127308127309127310127311127312127313127314127315127316127317127318127319127320127321127322127323127324127325127326127327127328127329127330127331127332127333127334127335127336127337127338127339127340127341127342127343127344127345127346127347127348127349127350127351127352127353127354127355127356127357127358127359127360127361127362127363127364127365127366127367127368127369127370127371127372127373127374127375127376127377127378127379127380127381127382127383127384127385127386127387127388127389127390127391127392127393127394127395127396127397127398127399127400127401127402127403127404127405127406127407127408127409127410127411127412127413127414127415127416127417127418127419127420127421127422127423127424127425127426127427127428127429127430127431127432127433127434127435127436127437127438127439127440127441127442127443127444127445127446127447127448127449127450127451127452127453127454127455127456127457127458127459127460127461127462127463127464127465127466127467127468127469127470127471127472127473127474127475127476127477127478127479127480127481127482127483127484127485127486127487127488127489127490127491127492127493127494127495127496127497127498127499127500127501127502127503127504127505127506127507127508127509127510127511127512127513127514127515127516127517127518127519127520127521127522127523127524127525127526127527127528127529127530127531127532127533127534127535127536127537127538127539127540127541127542127543127544127545127546127547127548127549127550127551127552127553127554127555127556127557127558127559127560127561127562127563127564127565127566127567127568127569127570127571127572127573127574127575127576127577127578127579127580127581127582127583127584127585127586127587127588127589127590127591127592127593127594127595127596127597127598127599127600127601127602127603127604127605127606127607127608127609127610127611127612127613127614127615127616127617127618127619127620127621127622127623127624127625127626127627127628127629127630127631127632127633127634127635127636127637127638127639127640127641127642127643127644127645127646127647127648127649127650127651127652127653127654127655127656127657127658127659127660127661127662127663127664127665127666127667127668127669127670127671127672127673127674127675127676127677127678127679127680127681127682127683127684127685127686127687127688127689127690127691127692127693127694127695127696127697127698127699127700127701127702127703127704127705127706127707127708127709127710127711127712127713127714127715127716127717127718127719127720127721127722127723127724127725127726127727127728127729127730127731127732127733127734127735127736127737127738127739127740127741127742127743127744127745127746127747127748127749127750127751127752127753127754127755127756127757127758127759127760127761127762127763127764127765127766127767127768127769127770127771127772127773127774127775127776127777127778127779127780127781127782127783127784127785127786127787127788127789127790127791127792127793127794127795127796127797127798127799127800127801127802127803127804127805127806127807127808127809127810127811127812127813127814127815127816127817127818127819127820127821127822127823127824127825127826127827127828127829127830127831127832127833127834127835127836127837127838127839127840127841127842127843127844127845127846127847127848127849127850127851127852127853127854127855127856127857127858127859127860127861127862127863127864127865127866127867127868127869127870127871127872127873127874127875127876127877127878127879127880127881127882127883127884127885127886127887127888127889127890127891127892127893127894127895127896127897127898127899127900127901127902127903127904127905127906127907127908127909127910127911127912127913127914127915127916127917127918127919127920127921127922127923127924127925127926127927127928127929127930127931127932127933127934127935127936127937127938127939127940127941127942127943127944127945127946127947127948127949127950127951127952127953127954127955127956127957127958127959127960127961127962127963127964127965127966127967127968127969127970127971127972127973127974127975127976127977127978127979127980127981127982127983127984127985127986127987127988127989127990127991127992127993127994127995127996127997127998127999128000128001128002128003128004128005128006128007128008128009128010128011128012128013128014128015128016128017128018128019128020128021128022128023128024128025128026128027128028128029128030128031128032128033128034128035128036128037128038128039128040128041128042128043128044128045128046128047128048128049128050128051128052128053128054128055128056128057128058128059128060128061128062128063128064128065128066128067128068128069128070128071128072128073128074128075128076128077128078128079128080128081128082128083128084128085128086128087128088128089128090128091128092128093128094128095128096128097128098128099128100128101128102128103128104128105128106128107128108128109128110128111128112128113128114128115128116128117128118128119128120128121128122128123128124128125128126128127128128128129128130128131128132128133128134128135128136128137128138128139128140128141128142128143128144128145128146128147128148128149128150128151128152128153128154128155128156128157128158128159128160128161128162128163128164128165128166128167128168128169128170128171128172128173128174128175128176128177128178128179128180128181128182128183128184128185128186128187128188128189128190128191128192128193128194128195128196128197128198128199128200128201128202128203128204128205128206128207128208128209128210128211128212128213128214128215128216128217128218128219128220128221128222128223128224128225128226128227128228128229128230128231128232128233128234128235128236128237128238128239128240128241128242128243128244128245128246128247128248128249128250128251128252128253128254128255128256128257128258128259128260128261128262128263128264128265128266128267128268128269128270128271128272128273128274128275128276128277128278128279128280128281128282128283128284128285128286128287128288128289128290128291128292128293128294128295128296128297128298128299128300128301128302128303128304128305128306128307128308128309128310128311128312128313128314128315128316128317128318128319128320128321128322128323128324128325128326128327128328128329128330128331128332128333128334128335128336128337128338128339128340128341128342128343128344128345128346128347128348128349128350128351128352128353128354128355128356128357128358128359128360128361128362128363128364128365128366128367128368128369128370128371128372128373128374128375128376128377128378128379128380128381128382128383128384128385128386128387128388128389128390128391128392128393128394128395128396128397128398128399128400128401128402128403128404128405128406128407128408128409128410128411128412128413128414128415128416128417128418128419128420128421128422128423128424128425128426128427128428128429128430128431128432128433128434128435128436128437128438128439128440128441128442128443128444128445128446128447128448128449128450128451128452128453128454128455128456128457128458128459128460128461128462128463128464128465128466128467128468128469128470128471128472128473128474128475128476128477128478128479128480128481128482128483128484128485128486128487128488128489128490128491128492128493128494128495128496128497128498128499128500128501128502128503128504128505128506128507128508128509128510128511128512128513128514128515128516128517128518128519128520128521128522128523128524128525128526128527128528128529128530128531128532128533128534128535128536128537128538128539128540128541128542128543128544128545128546128547128548128549128550128551128552128553128554128555128556128557128558128559128560128561128562128563128564128565128566128567128568128569128570128571128572128573128574128575128576128577128578128579128580128581128582128583128584128585128586128587128588128589128590128591128592128593128594128595128596128597128598128599128600128601128602128603128604128605128606128607128608128609128610128611128612128613128614128615128616128617128618128619128620128621128622128623128624128625128626128627128628128629128630128631128632128633128634128635128636128637128638128639128640128641128642128643128644128645128646128647128648128649128650128651128652128653128654128655128656128657128658128659128660128661128662128663128664128665128666128667128668128669128670128671128672128673128674128675128676128677128678128679128680128681128682128683128684128685128686128687128688128689128690128691128692128693128694128695128696128697128698128699128700128701128702128703128704128705128706128707128708128709128710128711128712128713128714128715128716128717128718128719128720128721128722128723128724128725128726128727128728128729128730128731128732128733128734128735128736128737128738128739128740128741128742128743128744128745128746128747128748128749128750128751128752128753128754128755128756128757128758128759128760128761128762128763128764128765128766128767128768128769128770128771128772128773128774128775128776128777128778128779128780128781128782128783128784128785128786128787128788128789128790128791128792128793128794128795128796128797128798128799128800128801128802128803128804128805128806128807128808128809128810128811128812128813128814128815128816128817128818128819128820128821128822128823128824128825128826128827128828128829128830128831128832128833128834128835128836128837128838128839128840128841128842128843128844128845128846128847128848128849128850128851128852128853128854128855128856128857128858128859128860128861128862128863128864128865128866128867128868128869128870128871128872128873128874128875128876128877128878128879128880128881128882128883128884128885128886128887128888128889128890128891128892128893128894128895128896128897128898128899128900128901128902128903128904128905128906128907128908128909128910128911128912128913128914128915128916128917128918128919128920128921128922128923128924128925128926128927128928128929128930128931128932128933128934128935128936128937128938128939128940128941128942128943128944128945128946128947128948128949128950128951128952128953128954128955128956128957128958128959128960128961128962128963128964128965128966128967128968128969128970128971128972128973128974128975128976128977128978128979128980128981128982128983128984128985128986128987128988128989128990128991128992128993128994128995128996128997128998128999129000129001129002129003129004129005129006129007129008129009129010129011129012129013129014129015129016129017129018129019129020129021129022129023129024129025129026129027129028129029129030129031129032129033129034129035129036129037129038129039129040129041129042129043129044129045129046129047129048129049129050129051129052129053129054129055129056129057129058129059129060129061129062129063129064129065129066129067129068129069129070129071129072129073129074129075129076129077129078129079129080129081129082129083129084129085129086129087129088129089129090129091129092129093129094129095129096129097129098129099129100129101129102129103129104129105129106129107129108129109129110129111129112129113129114129115129116129117129118129119129120129121129122129123129124129125129126129127129128129129129130129131129132129133129134129135129136129137129138129139129140129141129142129143129144129145129146129147129148129149129150129151129152129153129154129155129156129157129158129159129160129161129162129163129164129165129166129167129168129169129170129171129172129173129174129175129176129177129178129179129180129181129182129183129184129185129186129187129188129189129190129191129192129193129194129195129196129197129198129199129200129201129202129203129204129205129206129207129208129209129210129211129212129213129214129215129216129217129218129219129220129221129222129223129224129225129226129227129228129229129230129231129232129233129234129235129236129237129238129239129240129241129242129243129244129245129246129247129248129249129250129251129252129253129254129255129256129257129258129259129260129261129262129263129264129265129266129267129268129269129270129271129272129273129274129275129276129277129278129279129280129281129282129283129284129285129286129287129288129289129290129291129292129293129294129295129296129297129298129299129300129301129302129303129304129305129306129307129308129309129310129311129312129313129314129315129316129317129318129319129320129321129322129323129324129325129326129327129328129329129330129331129332129333129334129335129336129337129338129339129340129341129342129343129344129345129346129347129348129349129350129351129352129353129354129355129356129357129358129359129360129361129362129363129364129365129366129367129368129369129370129371129372129373129374129375129376129377129378129379129380129381129382129383129384129385129386129387129388129389129390129391129392129393129394129395129396129397129398129399129400129401129402129403129404129405129406129407129408129409129410129411129412129413129414129415129416129417129418129419129420129421129422129423129424129425129426129427129428129429129430129431129432129433129434129435129436129437129438129439129440129441129442129443129444129445129446129447129448129449129450129451129452129453129454129455129456129457129458129459129460129461129462129463129464129465129466129467129468129469129470129471129472129473129474129475129476129477129478129479129480129481129482129483129484129485129486129487129488129489129490129491129492129493129494129495129496129497129498129499129500129501129502129503129504129505129506129507129508129509129510129511129512129513129514129515129516129517129518129519129520129521129522129523129524129525129526129527129528129529129530129531129532129533129534129535129536129537129538129539129540129541129542129543129544129545129546129547129548129549129550129551129552129553129554129555129556129557129558129559129560129561129562129563129564129565129566129567129568129569129570129571129572129573129574129575129576129577129578129579129580129581129582129583129584129585129586129587129588129589129590129591129592129593129594129595129596129597129598129599129600129601129602129603129604129605129606129607129608129609129610129611129612129613129614129615129616129617129618129619129620129621129622129623129624129625129626129627129628129629129630129631129632129633129634129635129636129637129638129639129640129641129642129643129644129645129646129647129648129649129650129651129652129653129654129655129656129657129658129659129660129661129662129663129664129665129666129667129668129669129670129671129672129673129674129675129676129677129678129679129680129681129682129683129684129685129686129687129688129689129690129691129692129693129694129695129696129697129698129699129700129701129702129703129704129705129706129707129708129709129710129711129712129713129714129715129716129717129718129719129720129721129722129723129724129725129726129727129728129729129730129731129732129733129734129735129736129737129738129739129740129741129742129743129744129745129746129747129748129749129750129751129752129753129754129755129756129757129758129759129760129761129762129763129764129765129766129767129768129769129770129771129772129773129774129775129776129777129778129779129780129781129782129783129784129785129786129787129788129789129790129791129792129793129794129795129796129797129798129799129800129801129802129803129804129805129806129807129808129809129810129811129812129813129814129815129816129817129818129819129820129821129822129823129824129825129826129827129828129829129830129831129832129833129834129835129836129837129838129839129840129841129842129843129844129845129846129847129848129849129850129851129852129853129854129855129856129857129858129859129860129861129862129863129864129865129866129867129868129869129870129871129872129873129874129875129876129877129878129879129880129881129882129883129884129885129886129887129888129889129890129891129892129893129894129895129896129897129898129899129900129901129902129903129904129905129906129907129908129909129910129911129912129913129914129915129916129917129918129919129920129921129922129923129924129925129926129927129928129929129930129931129932129933129934129935129936129937129938129939129940129941129942129943129944129945129946129947129948129949129950129951129952129953129954129955129956129957129958129959129960129961129962129963129964129965129966129967129968129969129970129971129972129973129974129975129976129977129978129979129980129981129982129983129984129985129986129987129988129989129990129991129992129993129994129995129996129997129998129999130000130001130002130003130004130005130006130007130008130009130010130011130012130013130014130015130016130017130018130019130020130021130022130023130024130025130026130027130028130029130030130031130032130033130034130035130036130037130038130039130040130041130042130043130044130045130046130047130048130049130050130051130052130053130054130055130056130057130058130059130060130061130062130063130064130065130066130067130068130069130070130071130072130073130074130075130076130077130078130079130080130081130082130083130084130085130086130087130088130089130090130091130092130093130094130095130096130097130098130099130100130101130102130103130104130105130106130107130108130109130110130111130112130113130114130115130116130117130118130119130120130121130122130123130124130125130126130127130128130129130130130131130132130133130134130135130136130137130138130139130140130141130142130143130144130145130146130147130148130149130150130151130152130153130154130155130156130157130158130159130160130161130162130163130164130165130166130167130168130169130170130171130172130173130174130175130176130177130178130179130180130181130182130183130184130185130186130187130188130189130190130191130192130193130194130195130196130197130198130199130200130201130202130203130204130205130206130207130208130209130210130211130212130213130214130215130216130217130218130219130220130221130222130223130224130225130226130227130228130229130230130231130232130233130234130235130236130237130238130239130240130241130242130243130244130245130246130247130248130249130250130251130252130253130254130255130256130257130258130259130260130261130262130263130264130265130266130267130268130269130270130271130272130273130274130275130276130277130278130279130280130281130282130283130284130285130286130287130288130289130290130291130292130293130294130295130296130297130298130299130300130301130302130303130304130305130306130307130308130309130310130311130312130313130314130315130316130317130318130319130320130321130322130323130324130325130326130327130328130329130330130331130332130333130334130335130336130337130338130339130340130341130342130343130344130345130346130347130348130349130350130351130352130353130354130355130356130357130358130359130360130361130362130363130364130365130366130367130368130369130370130371130372130373130374130375130376130377130378130379130380130381130382130383130384130385130386130387130388130389130390130391130392130393130394130395130396130397130398130399130400130401130402130403130404130405130406130407130408130409130410130411130412130413130414130415130416130417130418130419130420130421130422130423130424130425130426130427130428130429130430130431130432130433130434130435130436130437130438130439130440130441130442130443130444130445130446130447130448130449130450130451130452130453130454130455130456130457130458130459130460130461130462130463130464130465130466130467130468130469130470130471130472130473130474130475130476130477130478130479130480130481130482130483130484130485130486130487130488130489130490130491130492130493130494130495130496130497130498130499130500130501130502130503130504130505130506130507130508130509130510130511130512130513130514130515130516130517130518130519130520130521130522130523130524130525130526130527130528130529130530130531130532130533130534130535130536130537130538130539130540130541130542130543130544130545130546130547130548130549130550130551130552130553130554130555130556130557130558130559130560130561130562130563130564130565130566130567130568130569130570130571130572130573130574130575130576130577130578130579130580130581130582130583130584130585130586130587130588130589130590130591130592130593130594130595130596130597130598130599130600130601130602130603130604130605130606130607130608130609130610130611130612130613130614130615130616130617130618130619130620130621130622130623130624130625130626130627130628130629130630130631130632130633130634130635130636130637130638130639130640130641130642130643130644130645130646130647130648130649130650130651130652130653130654130655130656130657130658130659130660130661130662130663130664130665130666130667130668130669130670130671130672130673130674130675130676130677130678130679130680130681130682130683130684130685130686130687130688130689130690130691130692130693130694130695130696130697130698130699130700130701130702130703130704130705130706130707130708130709130710130711130712130713130714130715130716130717130718130719130720130721130722130723130724130725130726130727130728130729130730130731130732130733130734130735130736130737130738130739130740130741130742130743130744130745130746130747130748130749130750130751130752130753130754130755130756130757130758130759130760130761130762130763130764130765130766130767130768130769130770130771130772130773130774130775130776130777130778130779130780130781130782130783130784130785130786130787130788130789130790130791130792130793130794130795130796130797130798130799130800130801130802130803130804130805130806130807130808130809130810130811130812130813130814130815130816130817130818130819130820130821130822130823130824130825130826130827130828130829130830130831130832130833130834130835130836130837130838130839130840130841130842130843130844130845130846130847130848130849130850130851130852130853130854130855130856130857130858130859130860130861130862130863130864130865130866130867130868130869130870130871130872130873130874130875130876130877130878130879130880130881130882130883130884130885130886130887130888130889130890130891130892130893130894130895130896130897130898130899130900130901130902130903130904130905130906130907130908130909130910130911130912130913130914130915130916130917130918130919130920130921130922130923130924130925130926130927130928130929130930130931130932130933130934130935130936130937130938130939130940130941130942130943130944130945130946130947130948130949130950130951130952130953130954130955130956130957130958130959130960130961130962130963130964130965130966130967130968130969130970130971130972130973130974130975130976130977130978130979130980130981130982130983130984130985130986130987130988130989130990130991130992130993130994130995130996130997130998130999131000131001131002131003131004131005131006131007131008131009131010131011131012131013131014131015131016131017131018131019131020131021131022131023131024131025131026131027131028131029131030131031131032131033131034131035131036131037131038131039131040131041131042131043131044131045131046131047131048131049131050131051131052131053131054131055131056131057131058131059131060131061131062131063131064131065131066131067131068131069131070131071131072131073131074131075131076131077131078131079131080131081131082131083131084131085131086131087131088131089131090131091131092131093131094131095131096131097131098131099131100131101131102131103131104131105131106131107131108131109131110131111131112131113131114131115131116131117131118131119131120131121131122131123131124131125131126131127131128131129131130131131131132131133131134131135131136131137131138131139131140131141131142131143131144131145131146131147131148131149131150131151131152131153131154131155131156131157131158131159131160131161131162131163131164131165131166131167131168131169131170131171131172131173131174131175131176131177131178131179131180131181131182131183131184131185131186131187131188131189131190131191131192131193131194131195131196131197131198131199131200131201131202131203131204131205131206131207131208131209131210131211131212131213131214131215131216131217131218131219131220131221131222131223131224131225131226131227131228131229131230131231131232131233131234131235131236131237131238131239131240131241131242131243131244131245131246131247131248131249131250131251131252131253131254131255131256131257131258131259131260131261131262131263131264131265131266131267131268131269131270131271131272131273131274131275131276131277131278131279131280131281131282131283131284131285131286131287131288131289131290131291131292131293131294131295131296131297131298131299131300131301131302131303131304131305131306131307131308131309131310131311131312131313131314131315131316131317131318131319131320131321131322131323131324131325131326131327131328131329131330131331131332131333131334131335131336131337131338131339131340131341131342131343131344131345131346131347131348131349131350131351131352131353131354131355131356131357131358131359131360131361131362131363131364131365131366131367131368131369131370131371131372131373131374131375131376131377131378131379131380131381131382131383131384131385131386131387131388131389131390131391131392131393131394131395131396131397131398131399131400131401131402131403131404131405131406131407131408131409131410131411131412131413131414131415131416131417131418131419131420131421131422131423131424131425131426131427131428131429131430131431131432131433131434131435131436131437131438131439131440131441131442131443131444131445131446131447131448131449131450131451131452131453131454131455131456131457131458131459131460131461131462131463131464131465131466131467131468131469131470131471131472131473131474131475131476131477131478131479131480131481131482131483131484131485131486131487131488131489131490131491131492131493131494131495131496131497131498131499131500131501131502131503131504131505131506131507131508131509131510131511131512131513131514131515131516131517131518131519131520131521131522131523131524131525131526131527131528131529131530131531131532131533131534131535131536131537131538131539131540131541131542131543131544131545131546131547131548131549131550131551131552131553131554131555131556131557131558131559131560131561131562131563131564131565131566131567131568131569131570131571131572131573131574131575131576131577131578131579131580131581131582131583131584131585131586131587131588131589131590131591131592131593131594131595131596131597131598131599131600131601131602131603131604131605131606131607131608131609131610131611131612131613131614131615131616131617131618131619131620131621131622131623131624131625131626131627131628131629131630131631131632131633131634131635131636131637131638131639131640131641131642131643131644131645131646131647131648131649131650131651131652131653131654131655131656131657131658131659131660131661131662131663131664131665131666131667131668131669131670131671131672131673131674131675131676131677131678131679131680131681131682131683131684131685131686131687131688131689131690131691131692131693131694131695131696131697131698131699131700131701131702131703131704131705131706131707131708131709131710131711131712131713131714131715131716131717131718131719131720131721131722131723131724131725131726131727131728131729131730131731131732131733131734131735131736131737131738131739131740131741131742131743131744131745131746131747131748131749131750131751131752131753131754131755131756131757131758131759131760131761131762131763131764131765131766131767131768131769131770131771131772131773131774131775131776131777131778131779131780131781131782131783131784131785131786131787131788131789131790131791131792131793131794131795131796131797131798131799131800131801131802131803131804131805131806131807131808131809131810131811131812131813131814131815131816131817131818131819131820131821131822131823131824131825131826131827131828131829131830131831131832131833131834131835131836131837131838131839131840131841131842131843131844131845131846131847131848131849131850131851131852131853131854131855131856131857131858131859131860131861131862131863131864131865131866131867131868131869131870131871131872131873131874131875131876131877131878131879131880131881131882131883131884131885131886131887131888131889131890131891131892131893131894131895131896131897131898131899131900131901131902131903131904131905131906131907131908131909131910131911131912131913131914131915131916131917131918131919131920131921131922131923131924131925131926131927131928131929131930131931131932131933131934131935131936131937131938131939131940131941131942131943131944131945131946131947131948131949131950131951131952131953131954131955131956131957131958131959131960131961131962131963131964131965131966131967131968131969131970131971131972131973131974131975131976131977131978131979131980131981131982131983131984131985131986131987131988131989131990131991131992131993131994131995131996131997131998131999132000132001132002132003132004132005132006132007132008132009132010132011132012132013132014132015132016132017132018132019132020132021132022132023132024132025132026132027132028132029132030132031132032132033132034132035132036132037132038132039132040132041132042132043132044132045132046132047132048132049132050132051132052132053132054132055132056132057132058132059132060132061132062132063132064132065132066132067132068132069132070132071132072132073132074132075132076132077132078132079132080132081132082132083132084132085132086132087132088132089132090132091132092132093132094132095132096132097132098132099132100132101132102132103132104132105132106132107132108132109132110132111132112132113132114132115132116132117132118132119132120132121132122132123132124132125132126132127132128132129132130132131132132132133132134132135132136132137132138132139132140132141132142132143132144132145132146132147132148132149132150132151132152132153132154132155132156132157132158132159132160132161132162132163132164132165132166132167132168132169132170132171132172132173132174132175132176132177132178132179132180132181132182132183132184132185132186132187132188132189132190132191132192132193132194132195132196132197132198132199132200132201132202132203132204132205132206132207132208132209132210132211132212132213132214132215132216132217132218132219132220132221132222132223132224132225132226132227132228132229132230132231132232132233132234132235132236132237132238132239132240132241132242132243132244132245132246132247132248132249132250132251132252132253132254132255132256132257132258132259132260132261132262132263132264132265132266132267132268132269132270132271132272132273132274132275132276132277132278132279132280132281132282132283132284132285132286132287132288132289132290132291132292132293132294132295132296132297132298132299132300132301132302132303132304132305132306132307132308132309132310132311132312132313132314132315132316132317132318132319132320132321132322132323132324132325132326132327132328132329132330132331132332132333132334132335132336132337132338132339132340132341132342132343132344132345132346132347132348132349132350132351132352132353132354132355132356132357132358132359132360132361132362132363132364132365132366132367132368132369132370132371132372132373132374132375132376132377132378132379132380132381132382132383132384132385132386132387132388132389132390132391132392132393132394132395132396132397132398132399132400132401132402132403132404132405132406132407132408132409132410132411132412132413132414132415132416132417132418132419132420132421132422132423132424132425132426132427132428132429132430132431132432132433132434132435132436132437132438132439132440132441132442132443132444132445132446132447132448132449132450132451132452132453132454132455132456132457132458132459132460132461132462132463132464132465132466132467132468132469132470132471132472132473132474132475132476132477132478132479132480132481132482132483132484132485132486132487132488132489132490132491132492132493132494132495132496132497132498132499132500132501132502132503132504132505132506132507132508132509132510132511132512132513132514132515132516132517132518132519132520132521132522132523132524132525132526132527132528132529132530132531132532132533132534132535132536132537132538132539132540132541132542132543132544132545132546132547132548132549132550132551132552132553132554132555132556132557132558132559132560132561132562132563132564132565132566132567132568132569132570132571132572132573132574132575132576132577132578132579132580132581132582132583132584132585132586132587132588132589132590132591132592132593132594132595132596132597132598132599132600132601132602132603132604132605132606132607132608132609132610132611132612132613132614132615132616132617132618132619132620132621132622132623132624132625132626132627132628132629132630132631132632132633132634132635132636132637132638132639132640132641132642132643132644132645132646132647132648132649132650132651132652132653132654132655132656132657132658132659132660132661132662132663132664132665132666132667132668132669132670132671132672132673132674132675132676132677132678132679132680132681132682132683132684132685132686132687132688132689132690132691132692132693132694132695132696132697132698132699132700132701132702132703132704132705132706132707132708132709132710132711132712132713132714132715132716132717132718132719132720132721132722132723132724132725132726132727132728132729132730132731132732132733132734132735132736132737132738132739132740132741132742132743132744132745132746132747132748132749132750132751132752132753132754132755132756132757132758132759132760132761132762132763132764132765132766132767132768132769132770132771132772132773132774132775132776132777132778132779132780132781132782132783132784132785132786132787132788132789132790132791132792132793132794132795132796132797132798132799132800132801132802132803132804132805132806132807132808132809132810132811132812132813132814132815132816132817132818132819132820132821132822132823132824132825132826132827132828132829132830132831132832132833132834132835132836132837132838132839132840132841132842132843132844132845132846132847132848132849132850132851132852132853132854132855132856132857132858132859132860132861132862132863132864132865132866132867132868132869132870132871132872132873132874132875132876132877132878132879132880132881132882132883132884132885132886132887132888132889132890132891132892132893132894132895132896132897132898132899132900132901132902132903132904132905132906132907132908132909132910132911132912132913132914132915132916132917132918132919132920132921132922132923132924132925132926132927132928132929132930132931132932132933132934132935132936132937132938132939132940132941132942132943132944132945132946132947132948132949132950132951132952132953132954132955132956132957132958132959132960132961132962132963132964132965132966132967132968132969132970132971132972132973132974132975132976132977132978132979132980132981132982132983132984132985132986132987132988132989132990132991132992132993132994132995132996132997132998132999133000133001133002133003133004133005133006133007133008133009133010133011133012133013133014133015133016133017133018133019133020133021133022133023133024133025133026133027133028133029133030133031133032133033133034133035133036133037133038133039133040133041133042133043133044133045133046133047133048133049133050133051133052133053133054133055133056133057133058133059133060133061133062133063133064133065133066133067133068133069133070133071133072133073133074133075133076133077133078133079133080133081133082133083133084133085133086133087133088133089133090133091133092133093133094133095133096133097133098133099133100133101133102133103133104133105133106133107133108133109133110133111133112133113133114133115133116133117133118133119133120133121133122133123133124133125133126133127133128133129133130133131133132133133133134133135133136133137133138133139133140133141133142133143133144133145133146133147133148133149133150133151133152133153133154133155133156133157133158133159133160133161133162133163133164133165133166133167133168133169133170133171133172133173133174133175133176133177133178133179133180133181133182133183133184133185133186133187133188133189133190133191133192133193133194133195133196133197133198133199133200133201133202133203133204133205133206133207133208133209133210133211133212133213133214133215133216133217133218133219133220133221133222133223133224133225133226133227133228133229133230133231133232133233133234133235133236133237133238133239133240133241133242133243133244133245133246133247133248133249133250133251133252133253133254133255133256133257133258133259133260133261133262133263133264133265133266133267133268133269133270133271133272133273133274133275133276133277133278133279133280133281133282133283133284133285133286133287133288133289133290133291133292133293133294133295133296133297133298133299133300133301133302133303133304133305133306133307133308133309133310133311133312133313133314133315133316133317133318133319133320133321133322133323133324133325133326133327133328133329133330133331133332133333133334133335133336133337133338133339133340133341133342133343133344133345133346133347133348133349133350133351133352133353133354133355133356133357133358133359133360133361133362133363133364133365133366133367133368133369133370133371133372133373133374133375133376133377133378133379133380133381133382133383133384133385133386133387133388133389133390133391133392133393133394133395133396133397133398133399133400133401133402133403133404133405133406133407133408133409133410133411133412133413133414133415133416133417133418133419133420133421133422133423133424133425133426133427133428133429133430133431133432133433133434133435133436133437133438133439133440133441133442133443133444133445133446133447133448133449133450133451133452133453133454133455133456133457133458133459133460133461133462133463133464133465133466133467133468133469133470133471133472133473133474133475133476133477133478133479133480133481133482133483133484133485133486133487133488133489133490133491133492133493133494133495133496133497133498133499133500133501133502133503133504133505133506133507133508133509133510133511133512133513133514133515133516133517133518133519133520133521133522133523133524133525133526133527133528133529133530133531133532133533133534133535133536133537133538133539133540133541133542133543133544133545133546133547133548133549133550133551133552133553133554133555133556133557133558133559133560133561133562133563133564133565133566133567133568133569133570133571133572133573133574133575133576133577133578133579133580133581133582133583133584133585133586133587133588133589133590133591133592133593133594133595133596133597133598133599133600133601133602133603133604133605133606133607133608133609133610133611133612133613133614133615133616133617133618133619133620133621133622133623133624133625133626133627133628133629133630133631133632133633133634133635133636133637133638133639133640133641133642133643133644133645133646133647133648133649133650133651133652133653133654133655133656133657133658133659133660133661133662133663133664133665133666133667133668133669133670133671133672133673133674133675133676133677133678133679133680133681133682133683133684133685133686133687133688133689133690133691133692133693133694133695133696133697133698133699133700133701133702133703133704133705133706133707133708133709133710133711133712133713133714133715133716133717133718133719133720133721133722133723133724133725133726133727133728133729133730133731133732133733133734133735133736133737133738133739133740133741133742133743133744133745133746133747133748133749133750133751133752133753133754133755133756133757133758133759133760133761133762133763133764133765133766133767133768133769133770133771133772133773133774133775133776133777133778133779133780133781133782133783133784133785133786133787133788133789133790133791133792133793133794133795133796133797133798133799133800133801133802133803133804133805133806133807133808133809133810133811133812133813133814133815133816133817133818133819133820133821133822133823133824133825133826133827133828133829133830133831133832133833133834133835133836133837133838133839133840133841133842133843133844133845133846133847133848133849133850133851133852133853133854133855133856133857133858133859133860133861133862133863133864133865133866133867133868133869133870133871133872133873133874133875133876133877133878133879133880133881133882133883133884133885133886133887133888133889133890133891133892133893133894133895133896133897133898133899133900133901133902133903133904133905133906133907133908133909133910133911133912133913133914133915133916133917133918133919133920133921133922133923133924133925133926133927133928133929133930133931133932133933133934133935133936133937133938133939133940133941133942133943133944133945133946133947133948133949133950133951133952133953133954133955133956133957133958133959133960133961133962133963133964133965133966133967133968133969133970133971133972133973133974133975133976133977133978133979133980133981133982133983133984133985133986133987133988133989133990133991133992133993133994133995133996133997133998133999134000134001134002134003134004134005134006134007134008134009134010134011134012134013134014134015134016134017134018134019134020134021134022134023134024134025134026134027134028134029134030134031134032134033134034134035134036134037134038134039134040134041134042134043134044134045134046134047134048134049134050134051134052134053134054134055134056134057134058134059134060134061134062134063134064134065134066134067134068134069134070134071134072134073134074134075134076134077134078134079134080134081134082134083134084134085134086134087134088134089134090134091134092134093134094134095134096134097134098134099134100134101134102134103134104134105134106134107134108134109134110134111134112134113134114134115134116134117134118134119134120134121134122134123134124134125134126134127134128134129134130134131134132134133134134134135134136134137134138134139134140134141134142134143134144134145134146134147134148134149134150134151134152134153134154134155134156134157134158134159134160134161134162134163134164134165134166134167134168134169134170134171134172134173134174134175134176134177134178134179134180134181134182134183134184134185134186134187134188134189134190134191134192134193134194134195134196134197134198134199134200134201134202134203134204134205134206134207134208134209134210134211134212134213134214134215134216134217134218134219134220134221134222134223134224134225134226134227134228134229134230134231134232134233134234134235134236134237134238134239134240134241134242134243134244134245134246134247134248134249134250134251134252134253134254134255134256134257134258134259134260134261134262134263134264134265134266134267134268134269134270134271134272134273134274134275134276134277134278134279134280134281134282134283134284134285134286134287134288134289134290134291134292134293134294134295134296134297134298134299134300134301134302134303134304134305134306134307134308134309134310134311134312134313134314134315134316134317134318134319134320134321134322134323134324134325134326134327134328134329134330134331134332134333134334134335134336134337134338134339134340134341134342134343134344134345134346134347134348134349134350134351134352134353134354134355134356134357134358134359134360134361134362134363134364134365134366134367134368134369134370134371134372134373134374134375134376134377134378134379134380134381134382134383134384134385134386134387134388134389134390134391134392134393134394134395134396134397134398134399134400134401134402134403134404134405134406134407134408134409134410134411134412134413134414134415134416134417134418134419134420134421134422134423134424134425134426134427134428134429134430134431134432134433134434134435134436134437134438134439134440134441134442134443134444134445134446134447134448134449134450134451134452134453134454134455134456134457134458134459134460134461134462134463134464134465134466134467134468134469134470134471134472134473134474134475134476134477134478134479134480134481134482134483134484134485134486134487134488134489134490134491134492134493134494134495134496134497134498134499134500134501134502134503134504134505134506134507134508134509134510134511134512134513134514134515134516134517134518134519134520134521134522134523134524134525134526134527134528134529134530134531134532134533134534134535134536134537134538134539134540134541134542134543134544134545134546134547134548134549134550134551134552134553134554134555134556134557134558134559134560134561134562134563134564134565134566134567134568134569134570134571134572134573134574134575134576134577134578134579134580134581134582134583134584134585134586134587134588134589134590134591134592134593134594134595134596134597134598134599134600134601134602134603134604134605134606134607134608134609134610134611134612134613134614134615134616134617134618134619134620134621134622134623134624134625134626134627134628134629134630134631134632134633134634134635134636134637134638134639134640134641134642134643134644134645134646134647134648134649134650134651134652134653134654134655134656134657134658134659134660134661134662134663134664134665134666134667134668134669134670134671134672134673134674134675134676134677134678134679134680134681134682134683134684134685134686134687134688134689134690134691134692134693134694134695134696134697134698134699134700134701134702134703134704134705134706134707134708134709134710134711134712134713134714134715134716134717134718134719134720134721134722134723134724134725134726134727134728134729134730134731134732134733134734134735134736134737134738134739134740134741134742134743134744134745134746134747134748134749134750134751134752134753134754134755134756134757134758134759134760134761134762134763134764134765134766134767134768134769134770134771134772134773134774134775134776134777134778134779134780134781134782134783134784134785134786134787134788134789134790134791134792134793134794134795134796134797134798134799134800134801134802134803134804134805134806134807134808134809134810134811134812134813134814134815134816134817134818134819134820134821134822134823134824134825134826134827134828134829134830134831134832134833134834134835134836134837134838134839134840134841134842134843134844134845134846134847134848134849134850134851134852134853134854134855134856134857134858134859134860134861134862134863134864134865134866134867134868134869134870134871134872134873134874134875134876134877134878134879134880134881134882134883134884134885134886134887134888134889134890134891134892134893134894134895134896134897134898134899134900134901134902134903134904134905134906134907134908134909134910134911134912134913134914134915134916134917134918134919134920134921134922134923134924134925134926134927134928134929134930134931134932134933134934134935134936134937134938134939134940134941134942134943134944134945134946134947134948134949134950134951134952134953134954134955134956134957134958134959134960134961134962134963134964134965134966134967134968134969134970134971134972134973134974134975134976134977134978134979134980134981134982134983134984134985134986134987134988134989134990134991134992134993134994134995134996134997134998134999135000135001135002135003135004135005135006135007135008135009135010135011135012135013135014135015135016135017135018135019135020135021135022135023135024135025135026135027135028135029135030135031135032135033135034135035135036135037135038135039135040135041135042135043135044135045135046135047135048135049135050135051135052135053135054135055135056135057135058135059135060135061135062135063135064135065135066135067135068135069135070135071135072135073135074135075135076135077135078135079135080135081135082135083135084135085135086135087135088135089135090135091135092135093135094135095135096135097135098135099135100135101135102135103135104135105135106135107135108135109135110135111135112135113135114135115135116135117135118135119135120135121135122135123135124135125135126135127135128135129135130135131135132135133135134135135135136135137135138135139135140135141135142135143135144135145135146135147135148135149135150135151135152135153135154135155135156135157135158135159135160135161135162135163135164135165135166135167135168135169135170135171135172135173135174135175135176135177135178135179135180135181135182135183135184135185135186135187135188135189135190135191135192135193135194135195135196135197135198135199135200135201135202135203135204135205135206135207135208135209135210135211135212135213135214135215135216135217135218135219135220135221135222135223135224135225135226135227135228135229135230135231135232135233135234135235135236135237135238135239135240135241135242135243135244135245135246135247135248135249135250135251135252135253135254135255135256135257135258135259135260135261135262135263135264135265135266135267135268135269135270135271135272135273135274135275135276135277135278135279135280135281135282135283135284135285135286135287135288135289135290135291135292135293135294135295135296135297135298135299135300135301135302135303135304135305135306135307135308135309135310135311135312135313135314135315135316135317135318135319135320135321135322135323135324135325135326135327135328135329135330135331135332135333135334135335135336135337135338135339135340135341135342135343135344135345135346135347135348135349135350135351135352135353135354135355135356135357135358135359135360135361135362135363135364135365135366135367135368135369135370135371135372135373135374135375135376135377135378135379135380135381135382135383135384135385135386135387135388135389135390135391135392135393135394135395135396135397135398135399135400135401135402135403135404135405135406135407135408135409135410135411135412135413135414135415135416135417135418135419135420135421135422135423135424135425135426135427135428135429135430135431135432135433135434135435135436135437135438135439135440135441135442135443135444135445135446135447135448135449135450135451135452135453135454135455135456135457135458135459135460135461135462135463135464135465135466135467135468135469135470135471135472135473135474135475135476135477135478135479135480135481135482135483135484135485135486135487135488135489135490135491135492135493135494135495135496135497135498135499135500135501135502135503135504135505135506135507135508135509135510135511135512135513135514135515135516135517135518135519135520135521135522135523135524135525135526135527135528135529135530135531135532135533135534135535135536135537135538135539135540135541135542135543135544135545135546135547135548135549135550135551135552135553135554135555135556135557135558135559135560135561135562135563135564135565135566135567135568135569135570135571135572135573135574135575135576135577135578135579135580135581135582135583135584135585135586135587135588135589135590135591135592135593135594135595135596135597135598135599135600135601135602135603135604135605135606135607135608135609135610135611135612135613135614135615135616135617135618135619135620135621135622135623135624135625135626135627135628135629135630135631135632135633135634135635135636135637135638135639135640135641135642135643135644135645135646135647135648135649135650135651135652135653135654135655135656135657135658135659135660135661135662135663135664135665135666135667135668135669135670135671135672135673135674135675135676135677135678135679135680135681135682135683135684135685135686135687135688135689135690135691135692135693135694135695135696135697135698135699135700135701135702135703135704135705135706135707135708135709135710135711135712135713135714135715135716135717135718135719135720135721135722135723135724135725135726135727135728135729135730135731135732135733135734135735135736135737135738135739135740135741135742135743135744135745135746135747135748135749135750135751135752135753135754135755135756135757135758135759135760135761135762135763135764135765135766135767135768135769135770135771135772135773135774135775135776135777135778135779135780135781135782135783135784135785135786135787135788135789135790135791135792135793135794135795135796135797135798135799135800135801135802135803135804135805135806135807135808135809135810135811135812135813135814135815135816135817135818135819135820135821135822135823135824135825135826135827135828135829135830135831135832135833135834135835135836135837135838135839135840135841135842135843135844135845135846135847135848135849135850135851135852135853135854135855135856135857135858135859135860135861135862135863135864135865135866135867135868135869135870135871135872135873135874135875135876135877135878135879135880135881135882135883135884135885135886135887135888135889135890135891135892135893135894135895135896135897135898135899135900135901135902135903135904135905135906135907135908135909135910135911135912135913135914135915135916135917135918135919135920135921135922135923135924135925135926135927135928135929135930135931135932135933135934135935135936135937135938135939135940135941135942135943135944135945135946135947135948135949135950135951135952135953135954135955135956135957135958135959135960135961135962135963135964135965135966135967135968135969135970135971135972135973135974135975135976135977135978135979135980135981135982135983135984135985135986135987135988135989135990135991135992135993135994135995135996135997135998135999136000136001136002136003136004136005136006136007136008136009136010136011136012136013136014136015136016136017136018136019136020136021136022136023136024136025136026136027136028136029136030136031136032136033136034136035136036136037136038136039136040136041136042136043136044136045136046136047136048136049136050136051136052136053136054136055136056136057136058136059136060136061136062136063136064136065136066136067136068136069136070136071136072136073136074136075136076136077136078136079136080136081136082136083136084136085136086136087136088136089136090136091136092136093136094136095136096136097136098136099136100136101136102136103136104136105136106136107136108136109136110136111136112136113136114136115136116136117136118136119136120136121136122136123136124136125136126136127136128136129136130136131136132136133136134136135136136136137136138136139136140136141136142136143136144136145136146136147136148136149136150136151136152136153136154136155136156136157136158136159136160136161136162136163136164136165136166136167136168136169136170136171136172136173136174136175136176136177136178136179136180136181136182136183136184136185136186136187136188136189136190136191136192136193136194136195136196136197136198136199136200136201136202136203136204136205136206136207136208136209136210136211136212136213136214136215136216136217136218136219136220136221136222136223136224136225136226136227136228136229136230136231136232136233136234136235136236136237136238136239136240136241136242136243136244136245136246136247136248136249136250136251136252136253136254136255136256136257136258136259136260136261136262136263136264136265136266136267136268136269136270136271136272136273136274136275136276136277136278136279136280136281136282136283136284136285136286136287136288136289136290136291136292136293136294136295136296136297136298136299136300136301136302136303136304136305136306136307136308136309136310136311136312136313136314136315136316136317136318136319136320136321136322136323136324136325136326136327136328136329136330136331136332136333136334136335136336136337136338136339136340136341136342136343136344136345136346136347136348136349136350136351136352136353136354136355136356136357136358136359136360136361136362136363136364136365136366136367136368136369136370136371136372136373136374136375136376136377136378136379136380136381136382136383136384136385136386136387136388136389136390136391136392136393136394136395136396136397136398136399136400136401136402136403136404136405136406136407136408136409136410136411136412136413136414136415136416136417136418136419136420136421136422136423136424136425136426136427136428136429136430136431136432136433136434136435136436136437136438136439136440136441136442136443136444136445136446136447136448136449136450136451136452136453136454136455136456136457136458136459136460136461136462136463136464136465136466136467136468136469136470136471136472136473136474136475136476136477136478136479136480136481136482136483136484136485136486136487136488136489136490136491136492136493136494136495136496136497136498136499136500136501136502136503136504136505136506136507136508136509136510136511136512136513136514136515136516136517136518136519136520136521136522136523136524136525136526136527136528136529136530136531136532136533136534136535136536136537136538136539136540136541136542136543136544136545136546136547136548136549136550136551136552136553136554136555136556136557136558136559136560136561136562136563136564136565136566136567136568136569136570136571136572136573136574136575136576136577136578136579136580136581136582136583136584136585136586136587136588136589136590136591136592136593136594136595136596136597136598136599136600136601136602136603136604136605136606136607136608136609136610136611136612136613136614136615136616136617136618136619136620136621136622136623136624136625136626136627136628136629136630136631136632136633136634136635136636136637136638136639136640136641136642136643136644136645136646136647136648136649136650136651136652136653136654136655136656136657136658136659136660136661136662136663136664136665136666136667136668136669136670136671136672136673136674136675136676136677136678136679136680136681136682136683136684136685136686136687136688136689136690136691136692136693136694136695136696136697136698136699136700136701136702136703136704136705136706136707136708136709136710136711136712136713136714136715136716136717136718136719136720136721136722136723136724136725136726136727136728136729136730136731136732136733136734136735136736136737136738136739136740136741136742136743136744136745136746136747136748136749136750136751136752136753136754136755136756136757136758136759136760136761136762136763136764136765136766136767136768136769136770136771136772136773136774136775136776136777136778136779136780136781136782136783136784136785136786136787136788136789136790136791136792136793136794136795136796136797136798136799136800136801136802136803136804136805136806136807136808136809136810136811136812136813136814136815136816136817136818136819136820136821136822136823136824136825136826136827136828136829136830136831136832136833136834136835136836136837136838136839136840136841136842136843136844136845136846136847136848136849136850136851136852136853136854136855136856136857136858136859136860136861136862136863136864136865136866136867136868136869136870136871136872136873136874136875136876136877136878136879136880136881136882136883136884136885136886136887136888136889136890136891136892136893136894136895136896136897136898136899136900136901136902136903136904136905136906136907136908136909136910136911136912136913136914136915136916136917136918136919136920136921136922136923136924136925136926136927136928136929136930136931136932136933136934136935136936136937136938136939136940136941136942136943136944136945136946136947136948136949136950136951136952136953136954136955136956136957136958136959136960136961136962136963136964136965136966136967136968136969136970136971136972136973136974136975136976136977136978136979136980136981136982136983136984136985136986136987136988136989136990136991136992136993136994136995136996136997136998136999137000137001137002137003137004137005137006137007137008137009137010137011137012137013137014137015137016137017137018137019137020137021137022137023137024137025137026137027137028137029137030137031137032137033137034137035137036137037137038137039137040137041137042137043137044137045137046137047137048137049137050137051137052137053137054137055137056137057137058137059137060137061137062137063137064137065137066137067137068137069137070137071137072137073137074137075137076137077137078137079137080137081137082137083137084137085137086137087137088137089137090137091137092137093137094137095137096137097137098137099137100137101137102137103137104137105137106137107137108137109137110137111137112137113137114137115137116137117137118137119137120137121137122137123137124137125137126137127137128137129137130137131137132137133137134137135137136137137137138137139137140137141137142137143137144137145137146137147137148137149137150137151137152137153137154137155137156137157137158137159137160137161137162137163137164137165137166137167137168137169137170137171137172137173137174137175137176137177137178137179137180137181137182137183137184137185137186137187137188137189137190137191137192137193137194137195137196137197137198137199137200137201137202137203137204137205137206137207137208137209137210137211137212137213137214137215137216137217137218137219137220137221137222137223137224137225137226137227137228137229137230137231137232137233137234137235137236137237137238137239137240137241137242137243137244137245137246137247137248137249137250137251137252137253137254137255137256137257137258137259137260137261137262137263137264137265137266137267137268137269137270137271137272137273137274137275137276137277137278137279137280137281137282137283137284137285137286137287137288137289137290137291137292137293137294137295137296137297137298137299137300137301137302137303137304137305137306137307137308137309137310137311137312137313137314137315137316137317137318137319137320137321137322137323137324137325137326137327137328137329137330137331137332137333137334137335137336137337137338137339137340137341137342137343137344137345137346137347137348137349137350137351137352137353137354137355137356137357137358137359137360137361137362137363137364137365137366137367137368137369137370137371137372137373137374137375137376137377137378137379137380137381137382137383137384137385137386137387137388137389137390137391137392137393137394137395137396137397137398137399137400137401137402137403137404137405137406137407137408137409137410137411137412137413137414137415137416137417137418137419137420137421137422137423137424137425137426137427137428137429137430137431137432137433137434137435137436137437137438137439137440137441137442137443137444137445137446137447137448137449137450137451137452137453137454137455137456137457137458137459137460137461137462137463137464137465137466137467137468137469137470137471137472137473137474137475137476137477137478137479137480137481137482137483137484137485137486137487137488137489137490137491137492137493137494137495137496137497137498137499137500137501137502137503137504137505137506137507137508137509137510137511137512137513137514137515137516137517137518137519137520137521137522137523137524137525137526137527137528137529137530137531137532137533137534137535137536137537137538137539137540137541137542137543137544137545137546137547137548137549137550137551137552137553137554137555137556137557137558137559137560137561137562137563137564137565137566137567137568137569137570137571137572137573137574137575137576137577137578137579137580137581137582137583137584137585137586137587137588137589137590137591137592137593137594137595137596137597137598137599137600137601137602137603137604137605137606137607137608137609137610137611137612137613137614137615137616137617137618137619137620137621137622137623137624137625137626137627137628137629137630137631137632137633137634137635137636137637137638137639137640137641137642137643137644137645137646137647137648137649137650137651137652137653137654137655137656137657137658137659137660137661137662137663137664137665137666137667137668137669137670137671137672137673137674137675137676137677137678137679137680137681137682137683137684137685137686137687137688137689137690137691137692137693137694137695137696137697137698137699137700137701137702137703137704137705137706137707137708137709137710137711137712137713137714137715137716137717137718137719137720137721137722137723137724137725137726137727137728137729137730137731137732137733137734137735137736137737137738137739137740137741137742137743137744137745137746137747137748137749137750137751137752137753137754137755137756137757137758137759137760137761137762137763137764137765137766137767137768137769137770137771137772137773137774137775137776137777137778137779137780137781137782137783137784137785137786137787137788137789137790137791137792137793137794137795137796137797137798137799137800137801137802137803137804137805137806137807137808137809137810137811137812137813137814137815137816137817137818137819137820137821137822137823137824137825137826137827137828137829137830137831137832137833137834137835137836137837137838137839137840137841137842137843137844137845137846137847137848137849137850137851137852137853137854137855137856137857137858137859137860137861137862137863137864137865137866137867137868137869137870137871137872137873137874137875137876137877137878137879137880137881137882137883137884137885137886137887137888137889137890137891137892137893137894137895137896137897137898137899137900137901137902137903137904137905137906137907137908137909137910137911137912137913137914137915137916137917137918137919137920137921137922137923137924137925137926137927137928137929137930137931137932137933137934137935137936137937137938137939137940137941137942137943137944137945137946137947137948137949137950137951137952137953137954137955137956137957137958137959137960137961137962137963137964137965137966137967137968137969137970137971137972137973137974137975137976137977137978137979137980137981137982137983137984137985137986137987137988137989137990137991137992137993137994137995137996137997137998137999138000138001138002138003138004138005138006138007138008138009138010138011138012138013138014138015138016138017138018138019138020138021138022138023138024138025138026138027138028138029138030138031138032138033138034138035138036138037138038138039138040138041138042138043138044138045138046138047138048138049138050138051138052138053138054138055138056138057138058138059138060138061138062138063138064138065138066138067138068138069138070138071138072138073138074138075138076138077138078138079138080138081138082138083138084138085138086138087138088138089138090138091138092138093138094138095138096138097138098138099138100138101138102138103138104138105138106138107138108138109138110138111138112138113138114138115138116138117138118138119138120138121138122138123138124138125138126138127138128138129138130138131138132138133138134138135138136138137138138138139138140138141138142138143138144138145138146138147138148138149138150138151138152138153138154138155138156138157138158138159138160138161138162138163138164138165138166138167138168138169138170138171138172138173138174138175138176138177138178138179138180138181138182138183138184138185138186138187138188138189138190138191138192138193138194138195138196138197138198138199138200138201138202138203138204138205138206138207138208138209138210138211138212138213138214138215138216138217138218138219138220138221138222138223138224138225138226138227138228138229138230138231138232138233138234138235138236138237138238138239138240138241138242138243138244138245138246138247138248138249138250138251138252138253138254138255138256138257138258138259138260138261138262138263138264138265138266138267138268138269138270138271138272138273138274138275138276138277138278138279138280138281138282138283138284138285138286138287138288138289138290138291138292138293138294138295138296138297138298138299138300138301138302138303138304138305138306138307138308138309138310138311138312138313138314138315138316138317138318138319138320138321138322138323138324138325138326138327138328138329138330138331138332138333138334138335138336138337138338138339138340138341138342138343138344138345138346138347138348138349138350138351138352138353138354138355138356138357138358138359138360138361138362138363138364138365138366138367138368138369138370138371138372138373138374138375138376138377138378138379138380138381138382138383138384138385138386138387138388138389138390138391138392138393138394138395138396138397138398138399138400138401138402138403138404138405138406138407138408138409138410138411138412138413138414138415138416138417138418138419138420138421138422138423138424138425138426138427138428138429138430138431138432138433138434138435138436138437138438138439138440138441138442138443138444138445138446138447138448138449138450138451138452138453138454138455138456138457138458138459138460138461138462138463138464138465138466138467138468138469138470138471138472138473138474138475138476138477138478138479138480138481138482138483138484138485138486138487138488138489138490138491138492138493138494138495138496138497138498138499138500138501138502138503138504138505138506138507138508138509138510138511138512138513138514138515138516138517138518138519138520138521138522138523138524138525138526138527138528138529138530138531138532138533138534138535138536138537138538138539138540138541138542138543138544138545138546138547138548138549138550138551138552138553138554138555138556138557138558138559138560138561138562138563138564138565138566138567138568138569138570138571138572138573138574138575138576138577138578138579138580138581138582138583138584138585138586138587138588138589138590138591138592138593138594138595138596138597138598138599138600138601138602138603138604138605138606138607138608138609138610138611138612138613138614138615138616138617138618138619138620138621138622138623138624138625138626138627138628138629138630138631138632138633138634138635138636138637138638138639138640138641138642138643138644138645138646138647138648138649138650138651138652138653138654138655138656138657138658138659138660138661138662138663138664138665138666138667138668138669138670138671138672138673138674138675138676138677138678138679138680138681138682138683138684138685138686138687138688138689138690138691138692138693138694138695138696138697138698138699138700138701138702138703138704138705138706138707138708138709138710138711138712138713138714138715138716138717138718138719138720138721138722138723138724138725138726138727138728138729138730138731138732138733138734138735138736138737138738138739138740138741138742138743138744138745138746138747138748138749138750138751138752138753138754138755138756138757138758138759138760138761138762138763138764138765138766138767138768138769138770138771138772138773138774138775138776138777138778138779138780138781138782138783138784138785138786138787138788138789138790138791138792138793138794138795138796138797138798138799138800138801138802138803138804138805138806138807138808138809138810138811138812138813138814138815138816138817138818138819138820138821138822138823138824138825138826138827138828138829138830138831138832138833138834138835138836138837138838138839138840138841138842138843138844138845138846138847138848138849138850138851138852138853138854138855138856138857138858138859138860138861138862138863138864138865138866138867138868138869138870138871138872138873138874138875138876138877138878138879138880138881138882138883138884138885138886138887138888138889138890138891138892138893138894138895138896138897138898138899138900138901138902138903138904138905138906138907138908138909138910138911138912138913138914138915138916138917138918138919138920138921138922138923138924138925138926138927138928138929138930138931138932138933138934138935138936138937138938138939138940138941138942138943138944138945138946138947138948138949138950138951138952138953138954138955138956138957138958138959138960138961138962138963138964138965138966138967138968138969138970138971138972138973138974138975138976138977138978138979138980138981138982138983138984138985138986138987138988138989138990138991138992138993138994138995138996138997138998138999139000139001139002139003139004139005139006139007139008139009139010139011139012139013139014139015139016139017139018139019139020139021139022139023139024139025139026139027139028139029139030139031139032139033139034139035139036139037139038139039139040139041139042139043139044139045139046139047139048139049139050139051139052139053139054139055139056139057139058139059139060139061139062139063139064139065139066139067139068139069139070139071139072139073139074139075139076139077139078139079139080139081139082139083139084139085139086139087139088139089139090139091139092139093139094139095139096139097139098139099139100139101139102139103139104139105139106139107139108139109139110139111139112139113139114139115139116139117139118139119139120139121139122139123139124139125139126139127139128139129139130139131139132139133139134139135139136139137139138139139139140139141139142139143139144139145139146139147139148139149139150139151139152139153139154139155139156139157139158139159139160139161139162139163139164139165139166139167139168139169139170139171139172139173139174139175139176139177139178139179139180139181139182139183139184139185139186139187139188139189139190139191139192139193139194139195139196139197139198139199139200139201139202139203139204139205139206139207139208139209139210139211139212139213139214139215139216139217139218139219139220139221139222139223139224139225139226139227139228139229139230139231139232139233139234139235139236139237139238139239139240139241139242139243139244139245139246139247139248139249139250139251139252139253139254139255139256139257139258139259139260139261139262139263139264139265139266139267139268139269139270139271139272139273139274139275139276139277139278139279139280139281139282139283139284139285139286139287139288139289139290139291139292139293139294139295139296139297139298139299139300139301139302139303139304139305139306139307139308139309139310139311139312139313139314139315139316139317139318139319139320139321139322139323139324139325139326139327139328139329139330139331139332139333139334139335139336139337139338139339139340139341139342139343139344139345139346139347139348139349139350139351139352139353139354139355139356139357139358139359139360139361139362139363139364139365139366139367139368139369139370139371139372139373139374139375139376139377139378139379139380139381139382139383139384139385139386139387139388139389139390139391139392139393139394139395139396139397139398139399139400139401139402139403139404139405139406139407139408139409139410139411139412139413139414139415139416139417139418139419139420139421139422139423139424139425139426139427139428139429139430139431139432139433139434139435139436139437139438139439139440139441139442139443139444139445139446139447139448139449139450139451139452139453139454139455139456139457139458139459139460139461139462139463139464139465139466139467139468139469139470139471139472139473139474139475139476139477139478139479139480139481139482139483139484139485139486139487139488139489139490139491139492139493139494139495139496139497139498139499139500139501139502139503139504139505139506139507139508139509139510139511139512139513139514139515139516139517139518139519139520139521139522139523139524139525139526139527139528139529139530139531139532139533139534139535139536139537139538139539139540139541139542139543139544139545139546139547139548139549139550139551139552139553139554139555139556139557139558139559139560139561139562139563139564139565139566139567139568139569139570139571139572139573139574139575139576139577139578139579139580139581139582139583139584139585139586139587139588139589139590139591139592139593139594139595139596139597139598139599139600139601139602139603139604139605139606139607139608139609139610139611139612139613139614139615139616139617139618139619139620139621139622139623139624139625139626139627139628139629139630139631139632139633139634139635139636139637139638139639139640139641139642139643139644139645139646139647139648139649139650139651139652139653139654139655139656139657139658139659139660139661139662139663139664139665139666139667139668139669139670139671139672139673139674139675139676139677139678139679139680139681139682139683139684139685139686139687139688139689139690139691139692139693139694139695139696139697139698139699139700139701139702139703139704139705139706139707139708139709139710139711139712139713139714139715139716139717139718139719139720139721139722139723139724139725139726139727139728139729139730139731139732139733139734139735139736139737139738139739139740139741139742139743139744139745139746139747139748139749139750139751139752139753139754139755139756139757139758139759139760139761139762139763139764139765139766139767139768139769139770139771139772139773139774139775139776139777139778139779139780139781139782139783139784139785139786139787139788139789139790139791139792139793139794139795139796139797139798139799139800139801139802139803139804139805139806139807139808139809139810139811139812139813139814139815139816139817139818139819139820139821139822139823139824139825139826139827139828139829139830139831139832139833139834139835139836139837139838139839139840139841139842139843139844139845139846139847139848139849139850139851139852139853139854139855139856139857139858139859139860139861139862139863139864139865139866139867139868139869139870139871139872139873139874139875139876139877139878139879139880139881139882139883139884139885139886139887139888139889139890139891139892139893139894139895139896139897139898139899139900139901139902139903139904139905139906139907139908139909139910139911139912139913139914139915139916139917139918139919139920139921139922139923139924139925139926139927139928139929139930139931139932139933139934139935139936139937139938139939139940139941139942139943139944139945139946139947139948139949139950139951139952139953139954139955139956139957139958139959139960139961139962139963139964139965139966139967139968139969139970139971139972139973139974139975139976139977139978139979139980139981139982139983139984139985139986139987139988139989139990139991139992139993139994139995139996139997139998139999140000140001140002140003140004140005140006140007140008140009140010140011140012140013140014140015140016140017140018140019140020140021140022140023140024140025140026140027140028140029140030140031140032140033140034140035140036140037140038140039140040140041140042140043140044140045140046140047140048140049140050140051140052140053140054140055140056140057140058140059140060140061140062140063140064140065140066140067140068140069140070140071140072140073140074140075140076140077140078140079140080140081140082140083140084140085140086140087140088140089140090140091140092140093140094140095140096140097140098140099140100140101140102140103140104140105140106140107140108140109140110140111140112140113140114140115140116140117140118140119140120140121140122140123140124140125140126140127140128140129140130140131140132140133140134140135140136140137140138140139140140140141140142140143140144140145140146140147140148140149140150140151140152140153140154140155140156140157140158140159140160140161140162140163140164140165140166140167140168140169140170140171140172140173140174140175140176140177140178140179140180140181140182140183140184140185140186140187140188140189140190140191140192140193140194140195140196140197140198140199140200140201140202140203140204140205140206140207140208140209140210140211140212140213140214140215140216140217140218140219140220140221140222140223140224140225140226140227140228140229140230140231140232140233140234140235140236140237140238140239140240140241140242140243140244140245140246140247140248140249140250140251140252140253140254140255140256140257140258140259140260140261140262140263140264140265140266140267140268140269140270140271140272140273140274140275140276140277140278140279140280140281140282140283140284140285140286140287140288140289140290140291140292140293140294140295140296140297140298140299140300140301140302140303140304140305140306140307140308140309140310140311140312140313140314140315140316140317140318140319140320140321140322140323140324140325140326140327140328140329140330140331140332140333140334140335140336140337140338140339140340140341140342140343140344140345140346140347140348140349140350140351140352140353140354140355140356140357140358140359140360140361140362140363140364140365140366140367140368140369140370140371140372140373140374140375140376140377140378140379140380140381140382140383140384140385140386140387140388140389140390140391140392140393140394140395140396140397140398140399140400140401140402140403140404140405140406140407140408140409140410140411140412140413140414140415140416140417140418140419140420140421140422140423140424140425140426140427140428140429140430140431140432140433140434140435140436140437140438140439140440140441140442140443140444140445140446140447140448140449140450140451140452140453140454140455140456140457140458140459140460140461140462140463140464140465140466140467140468140469140470140471140472140473140474140475140476140477140478140479140480140481140482140483140484140485140486140487140488140489140490140491140492140493140494140495140496140497140498140499140500140501140502140503140504140505140506140507140508140509140510140511140512140513140514140515140516140517140518140519140520140521140522140523140524140525140526140527140528140529140530140531140532140533140534140535140536140537140538140539140540140541140542140543140544140545140546140547140548140549140550140551140552140553140554140555140556140557140558140559140560140561140562140563140564140565140566140567140568140569140570140571140572140573140574140575140576140577140578140579140580140581140582140583140584140585140586140587140588140589140590140591140592140593140594140595140596140597140598140599140600140601140602140603140604140605140606140607140608140609140610140611140612140613140614140615140616140617140618140619140620140621140622140623140624140625140626140627140628140629140630140631140632140633140634140635140636140637140638140639140640140641140642140643140644140645140646140647140648140649140650140651140652140653140654140655140656140657140658140659140660140661140662140663140664140665140666140667140668140669140670140671140672140673140674140675140676140677140678140679140680140681140682140683140684140685140686140687140688140689140690140691140692140693140694140695140696140697140698140699140700140701140702140703140704140705140706140707140708140709140710140711140712140713140714140715140716140717140718140719140720140721140722140723140724140725140726140727140728140729140730140731140732140733140734140735140736140737140738140739140740140741140742140743140744140745140746140747140748140749140750140751140752140753140754140755140756140757140758140759140760140761140762140763140764140765140766140767140768140769140770140771140772140773140774140775140776140777140778140779140780140781140782140783140784140785140786140787140788140789140790140791140792140793140794140795140796140797140798140799140800140801140802140803140804140805140806140807140808140809140810140811140812140813140814140815140816140817140818140819140820140821140822140823140824140825140826140827140828140829140830140831140832140833140834140835140836140837140838140839140840140841140842140843140844140845140846140847140848140849140850140851140852140853140854140855140856140857140858140859140860140861140862140863140864140865140866140867140868140869140870140871140872140873140874140875140876140877140878140879140880140881140882140883140884140885140886140887140888140889140890140891140892140893140894140895140896140897140898140899140900140901140902140903140904140905140906140907140908140909140910140911140912140913140914140915140916140917140918140919140920140921140922140923140924140925140926140927140928140929140930140931140932140933140934140935140936140937140938140939140940140941140942140943140944140945140946140947140948140949140950140951140952140953140954140955140956140957140958140959140960140961140962140963140964140965140966140967140968140969140970140971140972140973140974140975140976140977140978140979140980140981140982140983140984140985140986140987140988140989140990140991140992140993140994140995140996140997140998140999141000141001141002141003141004141005141006141007141008141009141010141011141012141013141014141015141016141017141018141019141020141021141022141023141024141025141026141027141028141029141030141031141032141033141034141035141036141037141038141039141040141041141042141043141044141045141046141047141048141049141050141051141052141053141054141055141056141057141058141059141060141061141062141063141064141065141066141067141068141069141070141071141072141073141074141075141076141077141078141079141080141081141082141083141084141085141086141087141088141089141090
  1. /*!
  2. * @license Copyright (c) 2003-2022, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. (function(d){ const l = d['en'] = d['en'] || {}; l.dictionary=Object.assign( l.dictionary||{}, {"%0 of %1":"%0 of %1","Align center":"Align center","Align left":"Align left","Align right":"Align right",Aquamarine:"Aquamarine",Black:"Black","Block quote":"Block quote",Blue:"Blue",Bold:"Bold","Bulleted List":"Bulleted List",Cancel:"Cancel","Cannot upload file:":"Cannot upload file:","Centered image":"Centered image","Change image text alternative":"Change image text alternative","Choose heading":"Choose heading",Column:"Column","Could not insert image at the current position.":"Could not insert image at the current position.","Could not obtain resized image URL.":"Could not obtain resized image URL.","Decrease indent":"Decrease indent","Delete column":"Delete column","Delete row":"Delete row","Dim grey":"Dim grey","Document colors":"Document colors",Downloadable:"Downloadable","Dropdown toolbar":"Dropdown toolbar","Edit link":"Edit link","Editor toolbar":"Editor toolbar","Enter image caption":"Enter image caption","Font Background Color":"Font Background Color","Font Color":"Font Color","Full size image":"Full size image",Green:"Green",Grey:"Grey","Header column":"Header column","Header row":"Header row",Heading:"Heading","Heading 1":"Heading 1","Heading 2":"Heading 2","Heading 3":"Heading 3","Heading 4":"Heading 4","Heading 5":"Heading 5","Heading 6":"Heading 6","Image resize list":"Image resize list","Image toolbar":"Image toolbar","image widget":"image widget","Increase indent":"Increase indent","Insert column left":"Insert column left","Insert column right":"Insert column right","Insert image":"Insert image","Insert image or file":"Insert image or file","Insert paragraph after block":"Insert paragraph after block","Insert paragraph before block":"Insert paragraph before block","Insert row above":"Insert row above","Insert row below":"Insert row below","Insert table":"Insert table","Inserting image failed":"Inserting image failed",Italic:"Italic",Justify:"Justify","Left aligned image":"Left aligned image","Light blue":"Light blue","Light green":"Light green","Light grey":"Light grey",Link:"Link","Link image":"Link image","Link URL":"Link URL","Merge cell down":"Merge cell down","Merge cell left":"Merge cell left","Merge cell right":"Merge cell right","Merge cell up":"Merge cell up","Merge cells":"Merge cells",Next:"Next","Numbered List":"Numbered List","Open in a new tab":"Open in a new tab","Open link in new tab":"Open link in new tab",Orange:"Orange",Original:"Original",Paragraph:"Paragraph",Previous:"Previous",Purple:"Purple",Red:"Red",Redo:"Redo","Remove color":"Remove color","Resize image":"Resize image","Resize image to %0":"Resize image to %0","Resize image to the original size":"Resize image to the original size","Rich Text Editor":"Rich Text Editor","Rich Text Editor, %0":"Rich Text Editor, %0","Right aligned image":"Right aligned image",Row:"Row",Save:"Save","Select all":"Select all","Select column":"Select column","Select row":"Select row","Selecting resized image failed":"Selecting resized image failed","Show more items":"Show more items","Side image":"Side image","Split cell horizontally":"Split cell horizontally","Split cell vertically":"Split cell vertically",Strikethrough:"Strikethrough",Subscript:"Subscript",Superscript:"Superscript","Table toolbar":"Table toolbar","Text alignment":"Text alignment","Text alignment toolbar":"Text alignment toolbar","Text alternative":"Text alternative","This link has no URL":"This link has no URL",Turquoise:"Turquoise",Underline:"Underline",Undo:"Undo",Unlink:"Unlink","Upload failed":"Upload failed","Upload in progress":"Upload in progress",White:"White","Widget toolbar":"Widget toolbar",Yellow:"Yellow"} );})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
  6. (function webpackUniversalModuleDefinition(root, factory) {
  7. if(typeof exports === 'object' && typeof module === 'object')
  8. module.exports = factory();
  9. else if(typeof define === 'function' && define.amd)
  10. define([], factory);
  11. else if(typeof exports === 'object')
  12. exports["ClassicEditor"] = factory();
  13. else
  14. root["ClassicEditor"] = factory();
  15. })(window, function() {
  16. return /******/ (function(modules) { // webpackBootstrap
  17. /******/ // The module cache
  18. /******/ var installedModules = {};
  19. /******/
  20. /******/ // The require function
  21. /******/ function __webpack_require__(moduleId) {
  22. /******/
  23. /******/ // Check if module is in cache
  24. /******/ if(installedModules[moduleId]) {
  25. /******/ return installedModules[moduleId].exports;
  26. /******/ }
  27. /******/ // Create a new module (and put it into the cache)
  28. /******/ var module = installedModules[moduleId] = {
  29. /******/ i: moduleId,
  30. /******/ l: false,
  31. /******/ exports: {}
  32. /******/ };
  33. /******/
  34. /******/ // Execute the module function
  35. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  36. /******/
  37. /******/ // Flag the module as loaded
  38. /******/ module.l = true;
  39. /******/
  40. /******/ // Return the exports of the module
  41. /******/ return module.exports;
  42. /******/ }
  43. /******/
  44. /******/
  45. /******/ // expose the modules object (__webpack_modules__)
  46. /******/ __webpack_require__.m = modules;
  47. /******/
  48. /******/ // expose the module cache
  49. /******/ __webpack_require__.c = installedModules;
  50. /******/
  51. /******/ // define getter function for harmony exports
  52. /******/ __webpack_require__.d = function(exports, name, getter) {
  53. /******/ if(!__webpack_require__.o(exports, name)) {
  54. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  55. /******/ }
  56. /******/ };
  57. /******/
  58. /******/ // define __esModule on exports
  59. /******/ __webpack_require__.r = function(exports) {
  60. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  61. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  62. /******/ }
  63. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  64. /******/ };
  65. /******/
  66. /******/ // create a fake namespace object
  67. /******/ // mode & 1: value is a module id, require it
  68. /******/ // mode & 2: merge all properties of value into the ns
  69. /******/ // mode & 4: return value when already ns object
  70. /******/ // mode & 8|1: behave like require
  71. /******/ __webpack_require__.t = function(value, mode) {
  72. /******/ if(mode & 1) value = __webpack_require__(value);
  73. /******/ if(mode & 8) return value;
  74. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  75. /******/ var ns = Object.create(null);
  76. /******/ __webpack_require__.r(ns);
  77. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  78. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  79. /******/ return ns;
  80. /******/ };
  81. /******/
  82. /******/ // getDefaultExport function for compatibility with non-harmony modules
  83. /******/ __webpack_require__.n = function(module) {
  84. /******/ var getter = module && module.__esModule ?
  85. /******/ function getDefault() { return module['default']; } :
  86. /******/ function getModuleExports() { return module; };
  87. /******/ __webpack_require__.d(getter, 'a', getter);
  88. /******/ return getter;
  89. /******/ };
  90. /******/
  91. /******/ // Object.prototype.hasOwnProperty.call
  92. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  93. /******/
  94. /******/ // __webpack_public_path__
  95. /******/ __webpack_require__.p = "";
  96. /******/
  97. /******/
  98. /******/ // Load entry module and return exports
  99. /******/ return __webpack_require__(__webpack_require__.s = "./src/ckeditor.js");
  100. /******/ })
  101. /************************************************************************/
  102. /******/ ({
  103. /***/ "./node_modules/@ckeditor/ckeditor-cloud-services-core/src/token/token.js":
  104. /*!********************************************************************************!*\
  105. !*** ./node_modules/@ckeditor/ckeditor-cloud-services-core/src/token/token.js ***!
  106. \********************************************************************************/
  107. /*! exports provided: default */
  108. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109. "use strict";
  110. __webpack_require__.r(__webpack_exports__);
  111. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  112. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  113. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  114. /**
  115. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  116. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  117. */
  118. /**
  119. * @module cloud-services-core/token
  120. */
  121. /* globals XMLHttpRequest, setTimeout, clearTimeout, atob */
  122. const DEFAULT_OPTIONS = { autoRefresh: true };
  123. const DEFAULT_TOKEN_REFRESH_TIMEOUT_TIME = 3600000;
  124. /**
  125. * Class representing the token used for communication with CKEditor Cloud Services.
  126. * Value of the token is retrieving from the specified URL and is refreshed every 1 hour by default.
  127. *
  128. * @mixes ObservableMixin
  129. */
  130. class Token {
  131. /**
  132. * Creates `Token` instance.
  133. * Method `init` should be called after using the constructor or use `create` method instead.
  134. *
  135. * @param {String|Function} tokenUrlOrRefreshToken Endpoint address to download the token or a callback that provides the token. If the
  136. * value is a function it has to match the {@link module:cloud-services-core/token~refreshToken} interface.
  137. * @param {Object} options
  138. * @param {String} [options.initValue] Initial value of the token.
  139. * @param {Boolean} [options.autoRefresh=true] Specifies whether to start the refresh automatically.
  140. */
  141. constructor( tokenUrlOrRefreshToken, options = DEFAULT_OPTIONS ) {
  142. if ( !tokenUrlOrRefreshToken ) {
  143. /**
  144. * A `tokenUrl` must be provided as the first constructor argument.
  145. *
  146. * @error token-missing-token-url
  147. */
  148. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
  149. 'token-missing-token-url',
  150. this
  151. );
  152. }
  153. if ( options.initValue ) {
  154. this._validateTokenValue( options.initValue );
  155. }
  156. /**
  157. * Value of the token.
  158. * The value of the token is null if `initValue` is not provided or `init` method was not called.
  159. * `create` method creates token with initialized value from url.
  160. *
  161. * @name value
  162. * @member {String} #value
  163. * @observable
  164. * @readonly
  165. */
  166. this.set( 'value', options.initValue );
  167. /**
  168. * Base refreshing function.
  169. *
  170. * @private
  171. * @member {String|Function} #_refresh
  172. */
  173. if ( typeof tokenUrlOrRefreshToken === 'function' ) {
  174. this._refresh = tokenUrlOrRefreshToken;
  175. } else {
  176. this._refresh = () => defaultRefreshToken( tokenUrlOrRefreshToken );
  177. }
  178. /**
  179. * @type {Object}
  180. * @private
  181. */
  182. this._options = Object.assign( {}, DEFAULT_OPTIONS, options );
  183. }
  184. /**
  185. * Initializes the token.
  186. *
  187. * @returns {Promise.<module:cloud-services-core/token~Token>}
  188. */
  189. init() {
  190. return new Promise( ( resolve, reject ) => {
  191. if ( !this.value ) {
  192. this.refreshToken()
  193. .then( resolve )
  194. .catch( reject );
  195. return;
  196. }
  197. if ( this._options.autoRefresh ) {
  198. this._registerRefreshTokenTimeout();
  199. }
  200. resolve( this );
  201. } );
  202. }
  203. /**
  204. * Refresh token method. Useful in a method form as it can be override in tests.
  205. * @returns {Promise.<String>}
  206. */
  207. refreshToken() {
  208. return this._refresh()
  209. .then( value => {
  210. this._validateTokenValue( value );
  211. this.set( 'value', value );
  212. if ( this._options.autoRefresh ) {
  213. this._registerRefreshTokenTimeout();
  214. }
  215. } )
  216. .then( () => this );
  217. }
  218. /**
  219. * Destroys token instance. Stops refreshing.
  220. */
  221. destroy() {
  222. clearTimeout( this._tokenRefreshTimeout );
  223. }
  224. /**
  225. * Checks whether the provided token follows the JSON Web Tokens (JWT) format.
  226. *
  227. * @protected
  228. * @param {String} tokenValue The token to validate.
  229. */
  230. _validateTokenValue( tokenValue ) {
  231. // The token must be a string.
  232. const isString = typeof tokenValue === 'string';
  233. // The token must be a plain string without quotes ("").
  234. const isPlainString = !/^".*"$/.test( tokenValue );
  235. // JWT token contains 3 parts: header, payload, and signature.
  236. // Each part is separated by a dot.
  237. const isJWTFormat = isString && tokenValue.split( '.' ).length === 3;
  238. if ( !( isPlainString && isJWTFormat ) ) {
  239. /**
  240. * The provided token must follow the [JSON Web Tokens](https://jwt.io/introduction/) format.
  241. *
  242. * @error token-not-in-jwt-format
  243. */
  244. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'token-not-in-jwt-format', this );
  245. }
  246. }
  247. /**
  248. * Registers a refresh token timeout for the time taken from token.
  249. *
  250. * @protected
  251. */
  252. _registerRefreshTokenTimeout() {
  253. const tokenRefreshTimeoutTime = this._getTokenRefreshTimeoutTime();
  254. clearTimeout( this._tokenRefreshTimeout );
  255. this._tokenRefreshTimeout = setTimeout( () => {
  256. this.refreshToken();
  257. }, tokenRefreshTimeoutTime );
  258. }
  259. /**
  260. * Returns token refresh timeout time calculated from expire time in the token payload.
  261. *
  262. * If the token parse fails or the token payload doesn't contain, the default DEFAULT_TOKEN_REFRESH_TIMEOUT_TIME is returned.
  263. *
  264. * @protected
  265. * @returns {Number}
  266. */
  267. _getTokenRefreshTimeoutTime() {
  268. try {
  269. const [ , binaryTokenPayload ] = this.value.split( '.' );
  270. const { exp: tokenExpireTime } = JSON.parse( atob( binaryTokenPayload ) );
  271. if ( !tokenExpireTime ) {
  272. return DEFAULT_TOKEN_REFRESH_TIMEOUT_TIME;
  273. }
  274. const tokenRefreshTimeoutTime = Math.floor( ( ( tokenExpireTime * 1000 ) - Date.now() ) / 2 );
  275. return tokenRefreshTimeoutTime;
  276. } catch ( err ) {
  277. return DEFAULT_TOKEN_REFRESH_TIMEOUT_TIME;
  278. }
  279. }
  280. /**
  281. * Creates a initialized {@link module:cloud-services-core/token~Token} instance.
  282. *
  283. * @param {String|Function} tokenUrlOrRefreshToken Endpoint address to download the token or a callback that provides the token. If the
  284. * value is a function it has to match the {@link module:cloud-services-core/token~refreshToken} interface.
  285. * @param {Object} options
  286. * @param {String} [options.initValue] Initial value of the token.
  287. * @param {Boolean} [options.autoRefresh=true] Specifies whether to start the refresh automatically.
  288. * @returns {Promise.<module:cloud-services-core/token~Token>}
  289. */
  290. static create( tokenUrlOrRefreshToken, options = DEFAULT_OPTIONS ) {
  291. const token = new Token( tokenUrlOrRefreshToken, options );
  292. return token.init();
  293. }
  294. }
  295. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_0__["default"])( Token, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  296. /**
  297. * This function is called in a defined interval by the {@link ~Token} class. It also can be invoked manually.
  298. * It should return a promise, which resolves with the new token value.
  299. * If any error occurs it should return a rejected promise with an error message.
  300. *
  301. * @function refreshToken
  302. * @returns {Promise.<String>}
  303. */
  304. /**
  305. * @private
  306. * @param {String} tokenUrl
  307. */
  308. function defaultRefreshToken( tokenUrl ) {
  309. return new Promise( ( resolve, reject ) => {
  310. const xhr = new XMLHttpRequest();
  311. xhr.open( 'GET', tokenUrl );
  312. xhr.addEventListener( 'load', () => {
  313. const statusCode = xhr.status;
  314. const xhrResponse = xhr.response;
  315. if ( statusCode < 200 || statusCode > 299 ) {
  316. /**
  317. * Cannot download new token from the provided url.
  318. *
  319. * @error token-cannot-download-new-token
  320. */
  321. return reject(
  322. new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'token-cannot-download-new-token', null )
  323. );
  324. }
  325. return resolve( xhrResponse );
  326. } );
  327. xhr.addEventListener( 'error', () => reject( new Error( 'Network Error' ) ) );
  328. xhr.addEventListener( 'abort', () => reject( new Error( 'Abort' ) ) );
  329. xhr.send();
  330. } );
  331. }
  332. /* harmony default export */ __webpack_exports__["default"] = (Token);
  333. /***/ }),
  334. /***/ "./node_modules/@ckeditor/ckeditor-cloud-services-core/src/uploadgateway/fileuploader.js":
  335. /*!***********************************************************************************************!*\
  336. !*** ./node_modules/@ckeditor/ckeditor-cloud-services-core/src/uploadgateway/fileuploader.js ***!
  337. \***********************************************************************************************/
  338. /*! exports provided: default */
  339. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  340. "use strict";
  341. __webpack_require__.r(__webpack_exports__);
  342. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FileUploader; });
  343. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  344. /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  345. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  346. /**
  347. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  348. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  349. */
  350. /**
  351. * @module cloud-services-core/uploadgateway/fileuploader
  352. */
  353. /* globals XMLHttpRequest, FormData, Blob, atob */
  354. const BASE64_HEADER_REG_EXP = /^data:(\S*?);base64,/;
  355. /**
  356. * FileUploader class used to upload single file.
  357. */
  358. class FileUploader {
  359. /**
  360. * Creates `FileUploader` instance.
  361. *
  362. * @param {Blob|String} fileOrData A blob object or a data string encoded with Base64.
  363. * @param {module:cloud-services-core/token~Token} token Token used for authentication.
  364. * @param {String} apiAddress API address.
  365. */
  366. constructor( fileOrData, token, apiAddress ) {
  367. if ( !fileOrData ) {
  368. /**
  369. * File must be provided as the first argument.
  370. *
  371. * @error fileuploader-missing-file
  372. */
  373. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'fileuploader-missing-file', null );
  374. }
  375. if ( !token ) {
  376. /**
  377. * Token must be provided as the second argument.
  378. *
  379. * @error fileuploader-missing-token
  380. */
  381. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'fileuploader-missing-token', null );
  382. }
  383. if ( !apiAddress ) {
  384. /**
  385. * Api address must be provided as the third argument.
  386. *
  387. * @error fileuploader-missing-api-address
  388. */
  389. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'fileuploader-missing-api-address', null );
  390. }
  391. /**
  392. * A file that is being uploaded.
  393. *
  394. * @type {Blob}
  395. */
  396. this.file = _isBase64( fileOrData ) ? _base64ToBlob( fileOrData ) : fileOrData;
  397. /**
  398. * CKEditor Cloud Services access token.
  399. *
  400. * @type {module:cloud-services-core/token~Token}
  401. * @private
  402. */
  403. this._token = token;
  404. /**
  405. * CKEditor Cloud Services API address.
  406. *
  407. * @type {String}
  408. * @private
  409. */
  410. this._apiAddress = apiAddress;
  411. }
  412. /**
  413. * Registers callback on `progress` event.
  414. *
  415. * @chainable
  416. * @param {Function} callback
  417. * @returns {module:cloud-services-core/uploadgateway/fileuploader~FileUploader}
  418. */
  419. onProgress( callback ) {
  420. this.on( 'progress', ( event, data ) => callback( data ) );
  421. return this;
  422. }
  423. /**
  424. * Registers callback on `error` event. Event is called once when error occurs.
  425. *
  426. * @chainable
  427. * @param {Function} callback
  428. * @returns {module:cloud-services-core/uploadgateway/fileuploader~FileUploader}
  429. */
  430. onError( callback ) {
  431. this.once( 'error', ( event, data ) => callback( data ) );
  432. return this;
  433. }
  434. /**
  435. * Aborts upload process.
  436. */
  437. abort() {
  438. this.xhr.abort();
  439. }
  440. /**
  441. * Sends XHR request to API.
  442. *
  443. * @chainable
  444. * @returns {Promise.<Object>}
  445. */
  446. send() {
  447. this._prepareRequest();
  448. this._attachXHRListeners();
  449. return this._sendRequest();
  450. }
  451. /**
  452. * Prepares XHR request.
  453. *
  454. * @private
  455. */
  456. _prepareRequest() {
  457. const xhr = new XMLHttpRequest();
  458. xhr.open( 'POST', this._apiAddress );
  459. xhr.setRequestHeader( 'Authorization', this._token.value );
  460. xhr.responseType = 'json';
  461. this.xhr = xhr;
  462. }
  463. /**
  464. * Attaches listeners to the XHR.
  465. *
  466. * @private
  467. */
  468. _attachXHRListeners() {
  469. const that = this;
  470. const xhr = this.xhr;
  471. xhr.addEventListener( 'error', onError( 'Network Error' ) );
  472. xhr.addEventListener( 'abort', onError( 'Abort' ) );
  473. /* istanbul ignore else */
  474. if ( xhr.upload ) {
  475. xhr.upload.addEventListener( 'progress', event => {
  476. if ( event.lengthComputable ) {
  477. this.fire( 'progress', {
  478. total: event.total,
  479. uploaded: event.loaded
  480. } );
  481. }
  482. } );
  483. }
  484. xhr.addEventListener( 'load', () => {
  485. const statusCode = xhr.status;
  486. const xhrResponse = xhr.response;
  487. if ( statusCode < 200 || statusCode > 299 ) {
  488. return this.fire( 'error', xhrResponse.message || xhrResponse.error );
  489. }
  490. } );
  491. function onError( message ) {
  492. return () => that.fire( 'error', message );
  493. }
  494. }
  495. /**
  496. * Sends XHR request.
  497. *
  498. * @private
  499. */
  500. _sendRequest() {
  501. const formData = new FormData();
  502. const xhr = this.xhr;
  503. formData.append( 'file', this.file );
  504. return new Promise( ( resolve, reject ) => {
  505. xhr.addEventListener( 'load', () => {
  506. const statusCode = xhr.status;
  507. const xhrResponse = xhr.response;
  508. if ( statusCode < 200 || statusCode > 299 ) {
  509. if ( xhrResponse.message ) {
  510. /**
  511. * Uploading file failed.
  512. *
  513. * @error fileuploader-uploading-data-failed
  514. */
  515. return reject( new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
  516. 'fileuploader-uploading-data-failed',
  517. this,
  518. { message: xhrResponse.message }
  519. ) );
  520. }
  521. return reject( xhrResponse.error );
  522. }
  523. return resolve( xhrResponse );
  524. } );
  525. xhr.addEventListener( 'error', () => reject( new Error( 'Network Error' ) ) );
  526. xhr.addEventListener( 'abort', () => reject( new Error( 'Abort' ) ) );
  527. xhr.send( formData );
  528. } );
  529. }
  530. /**
  531. * Fired when error occurs.
  532. *
  533. * @event error
  534. * @param {String} error Error message
  535. */
  536. /**
  537. * Fired on upload progress.
  538. *
  539. * @event progress
  540. * @param {Object} status Total and uploaded status
  541. */
  542. }
  543. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_0__["default"])( FileUploader, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  544. /**
  545. * Transforms Base64 string data into file.
  546. *
  547. * @param {String} base64 String data.
  548. * @param {Number} [sliceSize=512]
  549. * @returns {Blob}
  550. * @private
  551. */
  552. function _base64ToBlob( base64, sliceSize = 512 ) {
  553. try {
  554. const contentType = base64.match( BASE64_HEADER_REG_EXP )[ 1 ];
  555. const base64Data = atob( base64.replace( BASE64_HEADER_REG_EXP, '' ) );
  556. const byteArrays = [];
  557. for ( let offset = 0; offset < base64Data.length; offset += sliceSize ) {
  558. const slice = base64Data.slice( offset, offset + sliceSize );
  559. const byteNumbers = new Array( slice.length );
  560. for ( let i = 0; i < slice.length; i++ ) {
  561. byteNumbers[ i ] = slice.charCodeAt( i );
  562. }
  563. byteArrays.push( new Uint8Array( byteNumbers ) );
  564. }
  565. return new Blob( byteArrays, { type: contentType } );
  566. } catch ( error ) {
  567. /**
  568. * Problem with decoding Base64 image data.
  569. *
  570. * @error fileuploader-decoding-image-data-error
  571. */
  572. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'fileuploader-decoding-image-data-error', null );
  573. }
  574. }
  575. /**
  576. * Checks that string is Base64.
  577. *
  578. * @param {String} string
  579. * @returns {Boolean}
  580. * @private
  581. */
  582. function _isBase64( string ) {
  583. if ( typeof string !== 'string' ) {
  584. return false;
  585. }
  586. const match = string.match( BASE64_HEADER_REG_EXP );
  587. return !!( match && match.length );
  588. }
  589. /***/ }),
  590. /***/ "./node_modules/@ckeditor/ckeditor-cloud-services-core/src/uploadgateway/uploadgateway.js":
  591. /*!************************************************************************************************!*\
  592. !*** ./node_modules/@ckeditor/ckeditor-cloud-services-core/src/uploadgateway/uploadgateway.js ***!
  593. \************************************************************************************************/
  594. /*! exports provided: default */
  595. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  596. "use strict";
  597. __webpack_require__.r(__webpack_exports__);
  598. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UploadGateway; });
  599. /* harmony import */ var _fileuploader__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./fileuploader */ "./node_modules/@ckeditor/ckeditor-cloud-services-core/src/uploadgateway/fileuploader.js");
  600. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  601. /**
  602. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  603. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  604. */
  605. /**
  606. * @module cloud-services-core/uploadgateway/uploadgateway
  607. */
  608. /**
  609. * UploadGateway abstracts file uploads to CKEditor Cloud Services.
  610. */
  611. class UploadGateway {
  612. /**
  613. * Creates `UploadGateway` instance.
  614. *
  615. * @param {module:cloud-services-core/token~Token} token Token used for authentication.
  616. * @param {String} apiAddress API address.
  617. */
  618. constructor( token, apiAddress ) {
  619. if ( !token ) {
  620. /**
  621. * Token must be provided.
  622. *
  623. * @error uploadgateway-missing-token
  624. */
  625. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'uploadgateway-missing-token', null );
  626. }
  627. if ( !apiAddress ) {
  628. /**
  629. * Api address must be provided.
  630. *
  631. * @error uploadgateway-missing-api-address
  632. */
  633. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'uploadgateway-missing-api-address', null );
  634. }
  635. /**
  636. * CKEditor Cloud Services access token.
  637. *
  638. * @type {module:cloud-services-core/token~Token}
  639. * @private
  640. */
  641. this._token = token;
  642. /**
  643. * CKEditor Cloud Services API address.
  644. *
  645. * @type {String}
  646. * @private
  647. */
  648. this._apiAddress = apiAddress;
  649. }
  650. /**
  651. * Creates a {@link module:cloud-services-core/uploadgateway/fileuploader~FileUploader} instance that wraps
  652. * file upload process. The file is being sent at a time when the
  653. * {@link module:cloud-services-core/uploadgateway/fileuploader~FileUploader#send} method is called.
  654. *
  655. * const token = await Token.create( 'https://token-endpoint' );
  656. * new UploadGateway( token, 'https://example.org' )
  657. * .upload( 'FILE' )
  658. * .onProgress( ( data ) => console.log( data ) )
  659. * .send()
  660. * .then( ( response ) => console.log( response ) );
  661. *
  662. * @param {Blob|String} fileOrData A blob object or a data string encoded with Base64.
  663. * @returns {module:cloud-services-core/uploadgateway/fileuploader~FileUploader} Returns `FileUploader` instance.
  664. */
  665. upload( fileOrData ) {
  666. return new _fileuploader__WEBPACK_IMPORTED_MODULE_0__["default"]( fileOrData, this._token, this._apiAddress );
  667. }
  668. }
  669. /***/ }),
  670. /***/ "./node_modules/@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter.js":
  671. /*!********************************************************************************!*\
  672. !*** ./node_modules/@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter.js ***!
  673. \********************************************************************************/
  674. /*! exports provided: default */
  675. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  676. "use strict";
  677. __webpack_require__.r(__webpack_exports__);
  678. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CKFinderUploadAdapter; });
  679. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  680. /* harmony import */ var _ckeditor_ckeditor5_upload_src_filerepository__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-upload/src/filerepository */ "./node_modules/@ckeditor/ckeditor5-upload/src/filerepository.js");
  681. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-adapter-ckfinder/src/utils.js");
  682. /**
  683. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  684. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  685. */
  686. /* globals XMLHttpRequest, FormData */
  687. /**
  688. * @module adapter-ckfinder/uploadadapter
  689. */
  690. /**
  691. * A plugin that enables file uploads in CKEditor 5 using the CKFinder server–side connector.
  692. *
  693. * See the {@glink features/image-upload/ckfinder "CKFinder file manager integration" guide} to learn how to configure
  694. * and use this feature as well as find out more about the full integration with the file manager
  695. * provided by the {@link module:ckfinder/ckfinder~CKFinder} plugin.
  696. *
  697. * Check out the {@glink features/image-upload/image-upload comprehensive "Image upload overview"} to learn about
  698. * other ways to upload images into CKEditor 5.
  699. *
  700. * @extends module:core/plugin~Plugin
  701. */
  702. class CKFinderUploadAdapter extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  703. /**
  704. * @inheritDoc
  705. */
  706. static get requires() {
  707. return [ _ckeditor_ckeditor5_upload_src_filerepository__WEBPACK_IMPORTED_MODULE_1__["default"] ];
  708. }
  709. /**
  710. * @inheritDoc
  711. */
  712. static get pluginName() {
  713. return 'CKFinderUploadAdapter';
  714. }
  715. /**
  716. * @inheritDoc
  717. */
  718. init() {
  719. const url = this.editor.config.get( 'ckfinder.uploadUrl' );
  720. if ( !url ) {
  721. return;
  722. }
  723. // Register CKFinderAdapter
  724. this.editor.plugins.get( _ckeditor_ckeditor5_upload_src_filerepository__WEBPACK_IMPORTED_MODULE_1__["default"] ).createUploadAdapter = loader => new UploadAdapter( loader, url, this.editor.t );
  725. }
  726. }
  727. /**
  728. * Upload adapter for CKFinder.
  729. *
  730. * @private
  731. * @implements module:upload/filerepository~UploadAdapter
  732. */
  733. class UploadAdapter {
  734. /**
  735. * Creates a new adapter instance.
  736. *
  737. * @param {module:upload/filerepository~FileLoader} loader
  738. * @param {String} url
  739. * @param {module:utils/locale~Locale#t} t
  740. */
  741. constructor( loader, url, t ) {
  742. /**
  743. * FileLoader instance to use during the upload.
  744. *
  745. * @member {module:upload/filerepository~FileLoader} #loader
  746. */
  747. this.loader = loader;
  748. /**
  749. * Upload URL.
  750. *
  751. * @member {String} #url
  752. */
  753. this.url = url;
  754. /**
  755. * Locale translation method.
  756. *
  757. * @member {module:utils/locale~Locale#t} #t
  758. */
  759. this.t = t;
  760. }
  761. /**
  762. * Starts the upload process.
  763. *
  764. * @see module:upload/filerepository~UploadAdapter#upload
  765. * @returns {Promise.<Object>}
  766. */
  767. upload() {
  768. return this.loader.file.then( file => {
  769. return new Promise( ( resolve, reject ) => {
  770. this._initRequest();
  771. this._initListeners( resolve, reject, file );
  772. this._sendRequest( file );
  773. } );
  774. } );
  775. }
  776. /**
  777. * Aborts the upload process.
  778. *
  779. * @see module:upload/filerepository~UploadAdapter#abort
  780. */
  781. abort() {
  782. if ( this.xhr ) {
  783. this.xhr.abort();
  784. }
  785. }
  786. /**
  787. * Initializes the XMLHttpRequest object.
  788. *
  789. * @private
  790. */
  791. _initRequest() {
  792. const xhr = this.xhr = new XMLHttpRequest();
  793. xhr.open( 'POST', this.url, true );
  794. xhr.responseType = 'json';
  795. }
  796. /**
  797. * Initializes XMLHttpRequest listeners.
  798. *
  799. * @private
  800. * @param {Function} resolve Callback function to be called when the request is successful.
  801. * @param {Function} reject Callback function to be called when the request cannot be completed.
  802. * @param {File} file File instance to be uploaded.
  803. */
  804. _initListeners( resolve, reject, file ) {
  805. const xhr = this.xhr;
  806. const loader = this.loader;
  807. const t = this.t;
  808. const genericError = t( 'Cannot upload file:' ) + ` ${ file.name }.`;
  809. xhr.addEventListener( 'error', () => reject( genericError ) );
  810. xhr.addEventListener( 'abort', () => reject() );
  811. xhr.addEventListener( 'load', () => {
  812. const response = xhr.response;
  813. if ( !response || !response.uploaded ) {
  814. return reject( response && response.error && response.error.message ? response.error.message : genericError );
  815. }
  816. resolve( {
  817. default: response.url
  818. } );
  819. } );
  820. // Upload progress when it's supported.
  821. /* istanbul ignore else */
  822. if ( xhr.upload ) {
  823. xhr.upload.addEventListener( 'progress', evt => {
  824. if ( evt.lengthComputable ) {
  825. loader.uploadTotal = evt.total;
  826. loader.uploaded = evt.loaded;
  827. }
  828. } );
  829. }
  830. }
  831. /**
  832. * Prepares the data and sends the request.
  833. *
  834. * @private
  835. * @param {File} file File instance to be uploaded.
  836. */
  837. _sendRequest( file ) {
  838. // Prepare form data.
  839. const data = new FormData();
  840. data.append( 'upload', file );
  841. data.append( 'ckCsrfToken', Object(_utils__WEBPACK_IMPORTED_MODULE_2__["getCsrfToken"])() );
  842. // Send request.
  843. this.xhr.send( data );
  844. }
  845. }
  846. /***/ }),
  847. /***/ "./node_modules/@ckeditor/ckeditor5-adapter-ckfinder/src/utils.js":
  848. /*!************************************************************************!*\
  849. !*** ./node_modules/@ckeditor/ckeditor5-adapter-ckfinder/src/utils.js ***!
  850. \************************************************************************/
  851. /*! exports provided: getCsrfToken, getCookie, setCookie */
  852. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  853. "use strict";
  854. __webpack_require__.r(__webpack_exports__);
  855. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCsrfToken", function() { return getCsrfToken; });
  856. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCookie", function() { return getCookie; });
  857. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setCookie", function() { return setCookie; });
  858. /**
  859. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  860. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  861. */
  862. /* globals window, document */
  863. /**
  864. * @module adapter-ckfinder/utils
  865. */
  866. const TOKEN_COOKIE_NAME = 'ckCsrfToken';
  867. const TOKEN_LENGTH = 40;
  868. const tokenCharset = 'abcdefghijklmnopqrstuvwxyz0123456789';
  869. /**
  870. * Returns the CSRF token value. The value is a hash stored in `document.cookie`
  871. * under the `ckCsrfToken` key. The CSRF token can be used to secure the communication
  872. * between the web browser and the CKFinder server.
  873. *
  874. * @returns {String}
  875. */
  876. function getCsrfToken() {
  877. let token = getCookie( TOKEN_COOKIE_NAME );
  878. if ( !token || token.length != TOKEN_LENGTH ) {
  879. token = generateToken( TOKEN_LENGTH );
  880. setCookie( TOKEN_COOKIE_NAME, token );
  881. }
  882. return token;
  883. }
  884. /**
  885. * Returns the value of the cookie with a given name or `null` if the cookie is not found.
  886. *
  887. * @param {String} name
  888. * @returns {String|null}
  889. */
  890. function getCookie( name ) {
  891. name = name.toLowerCase();
  892. const parts = document.cookie.split( ';' );
  893. for ( const part of parts ) {
  894. const pair = part.split( '=' );
  895. const key = decodeURIComponent( pair[ 0 ].trim().toLowerCase() );
  896. if ( key === name ) {
  897. return decodeURIComponent( pair[ 1 ] );
  898. }
  899. }
  900. return null;
  901. }
  902. /**
  903. * Sets the value of the cookie with a given name.
  904. *
  905. * @param {String} name
  906. * @param {String} value
  907. */
  908. function setCookie( name, value ) {
  909. document.cookie = encodeURIComponent( name ) + '=' + encodeURIComponent( value ) + ';path=/';
  910. }
  911. // Generates the CSRF token with the given length.
  912. //
  913. // @private
  914. // @param {Number} length
  915. // @returns {string}
  916. function generateToken( length ) {
  917. let result = '';
  918. const randValues = new Uint8Array( length );
  919. window.crypto.getRandomValues( randValues );
  920. for ( let j = 0; j < randValues.length; j++ ) {
  921. const character = tokenCharset.charAt( randValues[ j ] % tokenCharset.length );
  922. result += Math.random() > 0.5 ? character.toUpperCase() : character;
  923. }
  924. return result;
  925. }
  926. /***/ }),
  927. /***/ "./node_modules/@ckeditor/ckeditor5-alignment/src/alignment.js":
  928. /*!*********************************************************************!*\
  929. !*** ./node_modules/@ckeditor/ckeditor5-alignment/src/alignment.js ***!
  930. \*********************************************************************/
  931. /*! exports provided: default */
  932. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  933. "use strict";
  934. __webpack_require__.r(__webpack_exports__);
  935. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Alignment; });
  936. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  937. /* harmony import */ var _alignmentediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./alignmentediting */ "./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentediting.js");
  938. /* harmony import */ var _alignmentui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./alignmentui */ "./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentui.js");
  939. /**
  940. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  941. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  942. */
  943. /**
  944. * @module alignment/alignment
  945. */
  946. /**
  947. * The text alignment plugin.
  948. *
  949. * For a detailed overview, check the {@glink features/text-alignment Text alignment feature documentation}
  950. * and the {@glink api/alignment package page}.
  951. *
  952. * This is a "glue" plugin which loads the {@link module:alignment/alignmentediting~AlignmentEditing} and
  953. * {@link module:alignment/alignmentui~AlignmentUI} plugins.
  954. *
  955. * @extends module:core/plugin~Plugin
  956. */
  957. class Alignment extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  958. /**
  959. * @inheritDoc
  960. */
  961. static get requires() {
  962. return [ _alignmentediting__WEBPACK_IMPORTED_MODULE_1__["default"], _alignmentui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  963. }
  964. /**
  965. * @inheritDoc
  966. */
  967. static get pluginName() {
  968. return 'Alignment';
  969. }
  970. }
  971. /**
  972. * The configuration of the {@link module:alignment/alignment~Alignment alignment feature}.
  973. *
  974. * Read more in {@link module:alignment/alignment~AlignmentConfig}.
  975. *
  976. * @member {module:alignment/alignment~AlignmentConfig} module:core/editor/editorconfig~EditorConfig#alignment
  977. */
  978. /**
  979. * The configuration of the {@link module:alignment/alignment~Alignment alignment feature}.
  980. *
  981. * ClassicEditor
  982. * .create( editorElement, {
  983. * alignment: {
  984. * options: [ 'left', 'right' ]
  985. * }
  986. * } )
  987. * .then( ... )
  988. * .catch( ... );
  989. *
  990. * See {@link module:core/editor/editorconfig~EditorConfig all editor configuration options}.
  991. *
  992. * @interface AlignmentConfig
  993. */
  994. /**
  995. * Available alignment options.
  996. *
  997. * The available options are: `'left'`, `'right'`, `'center'` and `'justify'`. Other values are ignored.
  998. *
  999. * **Note:** It is recommended to always use `'left'` or `'right'` as these are default values which the user should
  1000. * normally be able to choose depending on the
  1001. * {@glink features/ui-language#setting-the-language-of-the-content language of the editor content}.
  1002. *
  1003. * ClassicEditor
  1004. * .create( editorElement, {
  1005. * alignment: {
  1006. * options: [ 'left', 'right' ]
  1007. * }
  1008. * } )
  1009. * .then( ... )
  1010. * .catch( ... );
  1011. *
  1012. * See the demo of {@glink features/text-alignment#configuring-alignment-options custom alignment options}.
  1013. *
  1014. * @member {Array.<String>} module:alignment/alignment~AlignmentConfig#options
  1015. */
  1016. /***/ }),
  1017. /***/ "./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentcommand.js":
  1018. /*!****************************************************************************!*\
  1019. !*** ./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentcommand.js ***!
  1020. \****************************************************************************/
  1021. /*! exports provided: default */
  1022. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1023. "use strict";
  1024. __webpack_require__.r(__webpack_exports__);
  1025. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AlignmentCommand; });
  1026. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  1027. /* harmony import */ var _ckeditor_ckeditor5_utils_src_first__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/first */ "./node_modules/@ckeditor/ckeditor5-utils/src/first.js");
  1028. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-alignment/src/utils.js");
  1029. /**
  1030. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  1031. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  1032. */
  1033. /**
  1034. * @module alignment/alignmentcommand
  1035. */
  1036. const ALIGNMENT = 'alignment';
  1037. /**
  1038. * The alignment command plugin.
  1039. *
  1040. * @extends module:core/command~Command
  1041. */
  1042. class AlignmentCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  1043. /**
  1044. * @inheritDoc
  1045. */
  1046. refresh() {
  1047. const editor = this.editor;
  1048. const locale = editor.locale;
  1049. const firstBlock = Object(_ckeditor_ckeditor5_utils_src_first__WEBPACK_IMPORTED_MODULE_1__["default"])( this.editor.model.document.selection.getSelectedBlocks() );
  1050. // As first check whether to enable or disable the command as the value will always be false if the command cannot be enabled.
  1051. this.isEnabled = !!firstBlock && this._canBeAligned( firstBlock );
  1052. /**
  1053. * A value of the current block's alignment.
  1054. *
  1055. * @observable
  1056. * @readonly
  1057. * @member {String} #value
  1058. */
  1059. if ( this.isEnabled && firstBlock.hasAttribute( 'alignment' ) ) {
  1060. this.value = firstBlock.getAttribute( 'alignment' );
  1061. } else {
  1062. this.value = locale.contentLanguageDirection === 'rtl' ? 'right' : 'left';
  1063. }
  1064. }
  1065. /**
  1066. * Executes the command. Applies the alignment `value` to the selected blocks.
  1067. * If no `value` is passed, the `value` is the default one or it is equal to the currently selected block's alignment attribute,
  1068. * the command will remove the attribute from the selected blocks.
  1069. *
  1070. * @param {Object} [options] Options for the executed command.
  1071. * @param {String} [options.value] The value to apply.
  1072. * @fires execute
  1073. */
  1074. execute( options = {} ) {
  1075. const editor = this.editor;
  1076. const locale = editor.locale;
  1077. const model = editor.model;
  1078. const doc = model.document;
  1079. const value = options.value;
  1080. model.change( writer => {
  1081. // Get only those blocks from selected that can have alignment set
  1082. const blocks = Array.from( doc.selection.getSelectedBlocks() ).filter( block => this._canBeAligned( block ) );
  1083. const currentAlignment = blocks[ 0 ].getAttribute( 'alignment' );
  1084. // Remove alignment attribute if current alignment is:
  1085. // - default (should not be stored in model as it will bloat model data)
  1086. // - equal to currently set
  1087. // - or no value is passed - denotes default alignment.
  1088. const removeAlignment = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["isDefault"])( value, locale ) || currentAlignment === value || !value;
  1089. if ( removeAlignment ) {
  1090. removeAlignmentFromSelection( blocks, writer );
  1091. } else {
  1092. setAlignmentOnSelection( blocks, writer, value );
  1093. }
  1094. } );
  1095. }
  1096. /**
  1097. * Checks whether a block can have alignment set.
  1098. *
  1099. * @private
  1100. * @param {module:engine/model/element~Element} block The block to be checked.
  1101. * @returns {Boolean}
  1102. */
  1103. _canBeAligned( block ) {
  1104. return this.editor.model.schema.checkAttribute( block, ALIGNMENT );
  1105. }
  1106. }
  1107. // Removes the alignment attribute from blocks.
  1108. // @private
  1109. function removeAlignmentFromSelection( blocks, writer ) {
  1110. for ( const block of blocks ) {
  1111. writer.removeAttribute( ALIGNMENT, block );
  1112. }
  1113. }
  1114. // Sets the alignment attribute on blocks.
  1115. // @private
  1116. function setAlignmentOnSelection( blocks, writer, alignment ) {
  1117. for ( const block of blocks ) {
  1118. writer.setAttribute( ALIGNMENT, alignment, block );
  1119. }
  1120. }
  1121. /***/ }),
  1122. /***/ "./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentediting.js":
  1123. /*!****************************************************************************!*\
  1124. !*** ./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentediting.js ***!
  1125. \****************************************************************************/
  1126. /*! exports provided: default */
  1127. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1128. "use strict";
  1129. __webpack_require__.r(__webpack_exports__);
  1130. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AlignmentEditing; });
  1131. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  1132. /* harmony import */ var _alignmentcommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./alignmentcommand */ "./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentcommand.js");
  1133. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-alignment/src/utils.js");
  1134. /**
  1135. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  1136. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  1137. */
  1138. /**
  1139. * @module alignment/alignmentediting
  1140. */
  1141. /**
  1142. * The alignment editing feature. It introduces the {@link module:alignment/alignmentcommand~AlignmentCommand command} and adds
  1143. * the `alignment` attribute for block elements in the {@link module:engine/model/model~Model model}.
  1144. * @extends module:core/plugin~Plugin
  1145. */
  1146. class AlignmentEditing extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  1147. /**
  1148. * @inheritDoc
  1149. */
  1150. static get pluginName() {
  1151. return 'AlignmentEditing';
  1152. }
  1153. /**
  1154. * @inheritDoc
  1155. */
  1156. constructor( editor ) {
  1157. super( editor );
  1158. editor.config.define( 'alignment', {
  1159. options: [ ..._utils__WEBPACK_IMPORTED_MODULE_2__["supportedOptions"] ]
  1160. } );
  1161. }
  1162. /**
  1163. * @inheritDoc
  1164. */
  1165. init() {
  1166. const editor = this.editor;
  1167. const locale = editor.locale;
  1168. const schema = editor.model.schema;
  1169. // Filter out unsupported options.
  1170. const enabledOptions = editor.config.get( 'alignment.options' ).filter( _utils__WEBPACK_IMPORTED_MODULE_2__["isSupported"] );
  1171. // Allow alignment attribute on all blocks.
  1172. schema.extend( '$block', { allowAttributes: 'alignment' } );
  1173. editor.model.schema.setAttributeProperties( 'alignment', { isFormatting: true } );
  1174. const definition = _buildDefinition( enabledOptions.filter( option => !Object(_utils__WEBPACK_IMPORTED_MODULE_2__["isDefault"])( option, locale ) ) );
  1175. editor.conversion.attributeToAttribute( definition );
  1176. editor.commands.add( 'alignment', new _alignmentcommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor ) );
  1177. }
  1178. }
  1179. // Utility function responsible for building converter definition.
  1180. // @private
  1181. function _buildDefinition( options ) {
  1182. const definition = {
  1183. model: {
  1184. key: 'alignment',
  1185. values: options.slice()
  1186. },
  1187. view: {}
  1188. };
  1189. for ( const option of options ) {
  1190. definition.view[ option ] = {
  1191. key: 'style',
  1192. value: {
  1193. 'text-align': option
  1194. }
  1195. };
  1196. }
  1197. return definition;
  1198. }
  1199. /***/ }),
  1200. /***/ "./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentui.js":
  1201. /*!***********************************************************************!*\
  1202. !*** ./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentui.js ***!
  1203. \***********************************************************************/
  1204. /*! exports provided: default */
  1205. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1206. "use strict";
  1207. __webpack_require__.r(__webpack_exports__);
  1208. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AlignmentUI; });
  1209. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  1210. /* harmony import */ var _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  1211. /* harmony import */ var _ckeditor_ckeditor5_ui_src_dropdown_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/dropdown/utils */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/utils.js");
  1212. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-alignment/src/utils.js");
  1213. /* harmony import */ var _ckeditor_ckeditor5_core_theme_icons_align_left_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/theme/icons/align-left.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-left.svg");
  1214. /* harmony import */ var _ckeditor_ckeditor5_core_theme_icons_align_right_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/theme/icons/align-right.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-right.svg");
  1215. /* harmony import */ var _ckeditor_ckeditor5_core_theme_icons_align_center_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/theme/icons/align-center.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-center.svg");
  1216. /* harmony import */ var _ckeditor_ckeditor5_core_theme_icons_align_justify_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/theme/icons/align-justify.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-justify.svg");
  1217. /**
  1218. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  1219. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  1220. */
  1221. /**
  1222. * @module alignment/alignmentui
  1223. */
  1224. const icons = new Map( [
  1225. [ 'left', _ckeditor_ckeditor5_core_theme_icons_align_left_svg__WEBPACK_IMPORTED_MODULE_4__["default"] ],
  1226. [ 'right', _ckeditor_ckeditor5_core_theme_icons_align_right_svg__WEBPACK_IMPORTED_MODULE_5__["default"] ],
  1227. [ 'center', _ckeditor_ckeditor5_core_theme_icons_align_center_svg__WEBPACK_IMPORTED_MODULE_6__["default"] ],
  1228. [ 'justify', _ckeditor_ckeditor5_core_theme_icons_align_justify_svg__WEBPACK_IMPORTED_MODULE_7__["default"] ]
  1229. ] );
  1230. /**
  1231. * The default alignment UI plugin.
  1232. *
  1233. * It introduces the `'alignment:left'`, `'alignment:right'`, `'alignment:center'` and `'alignment:justify'` buttons
  1234. * and the `'alignment'` dropdown.
  1235. *
  1236. * @extends module:core/plugin~Plugin
  1237. */
  1238. class AlignmentUI extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  1239. /**
  1240. * Returns the localized option titles provided by the plugin.
  1241. *
  1242. * The following localized titles corresponding with
  1243. * {@link module:alignment/alignment~AlignmentConfig#options} are available:
  1244. *
  1245. * * `'left'`,
  1246. * * `'right'`,
  1247. * * `'center'`,
  1248. * * `'justify'`.
  1249. *
  1250. * @readonly
  1251. * @type {Object.<String,String>}
  1252. */
  1253. get localizedOptionTitles() {
  1254. const t = this.editor.t;
  1255. return {
  1256. 'left': t( 'Align left' ),
  1257. 'right': t( 'Align right' ),
  1258. 'center': t( 'Align center' ),
  1259. 'justify': t( 'Justify' )
  1260. };
  1261. }
  1262. /**
  1263. * @inheritDoc
  1264. */
  1265. static get pluginName() {
  1266. return 'AlignmentUI';
  1267. }
  1268. /**
  1269. * @inheritDoc
  1270. */
  1271. init() {
  1272. const editor = this.editor;
  1273. const componentFactory = editor.ui.componentFactory;
  1274. const t = editor.t;
  1275. const options = editor.config.get( 'alignment.options' );
  1276. options
  1277. .filter( _utils__WEBPACK_IMPORTED_MODULE_3__["isSupported"] )
  1278. .forEach( option => this._addButton( option ) );
  1279. componentFactory.add( 'alignment', locale => {
  1280. const dropdownView = Object(_ckeditor_ckeditor5_ui_src_dropdown_utils__WEBPACK_IMPORTED_MODULE_2__["createDropdown"])( locale );
  1281. // Add existing alignment buttons to dropdown's toolbar.
  1282. const buttons = options.map( option => componentFactory.create( `alignment:${ option }` ) );
  1283. Object(_ckeditor_ckeditor5_ui_src_dropdown_utils__WEBPACK_IMPORTED_MODULE_2__["addToolbarToDropdown"])( dropdownView, buttons );
  1284. // Configure dropdown properties an behavior.
  1285. dropdownView.buttonView.set( {
  1286. label: t( 'Text alignment' ),
  1287. tooltip: true
  1288. } );
  1289. dropdownView.toolbarView.isVertical = true;
  1290. dropdownView.toolbarView.ariaLabel = t( 'Text alignment toolbar' );
  1291. dropdownView.extendTemplate( {
  1292. attributes: {
  1293. class: 'ck-alignment-dropdown'
  1294. }
  1295. } );
  1296. // The default icon depends on the direction of the content.
  1297. const defaultIcon = locale.contentLanguageDirection === 'rtl' ? _ckeditor_ckeditor5_core_theme_icons_align_right_svg__WEBPACK_IMPORTED_MODULE_5__["default"] : _ckeditor_ckeditor5_core_theme_icons_align_left_svg__WEBPACK_IMPORTED_MODULE_4__["default"];
  1298. // Change icon to reflect current selection's alignment.
  1299. dropdownView.buttonView.bind( 'icon' ).toMany( buttons, 'isOn', ( ...areActive ) => {
  1300. // Get the index of an active button.
  1301. const index = areActive.findIndex( value => value );
  1302. // If none of the commands is active, display either defaultIcon or the first button's icon.
  1303. if ( index < 0 ) {
  1304. return defaultIcon;
  1305. }
  1306. // Return active button's icon.
  1307. return buttons[ index ].icon;
  1308. } );
  1309. // Enable button if any of the buttons is enabled.
  1310. dropdownView.bind( 'isEnabled' ).toMany( buttons, 'isEnabled', ( ...areEnabled ) => areEnabled.some( isEnabled => isEnabled ) );
  1311. return dropdownView;
  1312. } );
  1313. }
  1314. /**
  1315. * Helper method for initializing the button and linking it with an appropriate command.
  1316. *
  1317. * @private
  1318. * @param {String} option The name of the alignment option for which the button is added.
  1319. */
  1320. _addButton( option ) {
  1321. const editor = this.editor;
  1322. editor.ui.componentFactory.add( `alignment:${ option }`, locale => {
  1323. const command = editor.commands.get( 'alignment' );
  1324. const buttonView = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__["default"]( locale );
  1325. buttonView.set( {
  1326. label: this.localizedOptionTitles[ option ],
  1327. icon: icons.get( option ),
  1328. tooltip: true,
  1329. isToggleable: true
  1330. } );
  1331. // Bind button model to command.
  1332. buttonView.bind( 'isEnabled' ).to( command );
  1333. buttonView.bind( 'isOn' ).to( command, 'value', value => value === option );
  1334. // Execute command.
  1335. this.listenTo( buttonView, 'execute', () => {
  1336. editor.execute( 'alignment', { value: option } );
  1337. editor.editing.view.focus();
  1338. } );
  1339. return buttonView;
  1340. } );
  1341. }
  1342. }
  1343. /***/ }),
  1344. /***/ "./node_modules/@ckeditor/ckeditor5-alignment/src/utils.js":
  1345. /*!*****************************************************************!*\
  1346. !*** ./node_modules/@ckeditor/ckeditor5-alignment/src/utils.js ***!
  1347. \*****************************************************************/
  1348. /*! exports provided: supportedOptions, isSupported, isDefault */
  1349. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1350. "use strict";
  1351. __webpack_require__.r(__webpack_exports__);
  1352. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportedOptions", function() { return supportedOptions; });
  1353. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSupported", function() { return isSupported; });
  1354. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDefault", function() { return isDefault; });
  1355. /**
  1356. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  1357. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  1358. */
  1359. /**
  1360. * @module alignment/utils
  1361. */
  1362. /**
  1363. * The list of supported alignment options:
  1364. *
  1365. * * `'left'`,
  1366. * * `'right'`,
  1367. * * `'center'`,
  1368. * * `'justify'`
  1369. */
  1370. const supportedOptions = [ 'left', 'right', 'center', 'justify' ];
  1371. /**
  1372. * Checks whether the passed option is supported by {@link module:alignment/alignmentediting~AlignmentEditing}.
  1373. *
  1374. * @param {String} option The option value to check.
  1375. * @returns {Boolean}
  1376. */
  1377. function isSupported( option ) {
  1378. return supportedOptions.includes( option );
  1379. }
  1380. /**
  1381. * Checks whether alignment is the default one considering the direction
  1382. * of the editor content.
  1383. *
  1384. * @param {String} alignment The name of the alignment to check.
  1385. * @param {module:utils/locale~Locale} locale The {@link module:core/editor/editor~Editor#locale} instance.
  1386. * @returns {Boolean}
  1387. */
  1388. function isDefault( alignment, locale ) {
  1389. // Right now only LTR is supported so the 'left' value is always the default one.
  1390. if ( locale.contentLanguageDirection == 'rtl' ) {
  1391. return alignment === 'right';
  1392. } else {
  1393. return alignment === 'left';
  1394. }
  1395. }
  1396. /***/ }),
  1397. /***/ "./node_modules/@ckeditor/ckeditor5-autoformat/src/autoformat.js":
  1398. /*!***********************************************************************!*\
  1399. !*** ./node_modules/@ckeditor/ckeditor5-autoformat/src/autoformat.js ***!
  1400. \***********************************************************************/
  1401. /*! exports provided: default */
  1402. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1403. "use strict";
  1404. __webpack_require__.r(__webpack_exports__);
  1405. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Autoformat; });
  1406. /* harmony import */ var _blockautoformatediting__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./blockautoformatediting */ "./node_modules/@ckeditor/ckeditor5-autoformat/src/blockautoformatediting.js");
  1407. /* harmony import */ var _inlineautoformatediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./inlineautoformatediting */ "./node_modules/@ckeditor/ckeditor5-autoformat/src/inlineautoformatediting.js");
  1408. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  1409. /**
  1410. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  1411. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  1412. */
  1413. /**
  1414. * @module autoformat/autoformat
  1415. */
  1416. /**
  1417. * Enables a set of predefined autoformatting actions.
  1418. *
  1419. * For a detailed overview, check the {@glink features/autoformat Autoformatting feature documentation}
  1420. * and the {@glink api/autoformat package page}.
  1421. *
  1422. * @extends module:core/plugin~Plugin
  1423. */
  1424. class Autoformat extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_2__["default"] {
  1425. /**
  1426. * @inheritDoc
  1427. */
  1428. static get pluginName() {
  1429. return 'Autoformat';
  1430. }
  1431. /**
  1432. * @inheritDoc
  1433. */
  1434. afterInit() {
  1435. this._addListAutoformats();
  1436. this._addBasicStylesAutoformats();
  1437. this._addHeadingAutoformats();
  1438. this._addBlockQuoteAutoformats();
  1439. this._addCodeBlockAutoformats();
  1440. }
  1441. /**
  1442. * Adds autoformatting related to the {@link module:list/list~List}.
  1443. *
  1444. * When typed:
  1445. * - `* ` or `- ` &ndash; A paragraph will be changed to a bulleted list.
  1446. * - `1. ` or `1) ` &ndash; A paragraph will be changed to a numbered list ("1" can be any digit or a list of digits).
  1447. *
  1448. * @private
  1449. */
  1450. _addListAutoformats() {
  1451. const commands = this.editor.commands;
  1452. if ( commands.get( 'bulletedList' ) ) {
  1453. Object(_blockautoformatediting__WEBPACK_IMPORTED_MODULE_0__["default"])( this.editor, this, /^[*-]\s$/, 'bulletedList' );
  1454. }
  1455. if ( commands.get( 'numberedList' ) ) {
  1456. Object(_blockautoformatediting__WEBPACK_IMPORTED_MODULE_0__["default"])( this.editor, this, /^1[.|)]\s$/, 'numberedList' );
  1457. }
  1458. }
  1459. /**
  1460. * Adds autoformatting related to the {@link module:basic-styles/bold~Bold},
  1461. * {@link module:basic-styles/italic~Italic}, {@link module:basic-styles/code~Code}
  1462. * and {@link module:basic-styles/strikethrough~Strikethrough}
  1463. *
  1464. * When typed:
  1465. * - `**foobar**` &ndash; `**` characters are removed and `foobar` is set to bold,
  1466. * - `__foobar__` &ndash; `__` characters are removed and `foobar` is set to bold,
  1467. * - `*foobar*` &ndash; `*` characters are removed and `foobar` is set to italic,
  1468. * - `_foobar_` &ndash; `_` characters are removed and `foobar` is set to italic,
  1469. * - ``` `foobar` &ndash; ``` ` ``` characters are removed and `foobar` is set to code,
  1470. * - `~~foobar~~` &ndash; `~~` characters are removed and `foobar` is set to strikethrough.
  1471. *
  1472. * @private
  1473. */
  1474. _addBasicStylesAutoformats() {
  1475. const commands = this.editor.commands;
  1476. if ( commands.get( 'bold' ) ) {
  1477. const boldCallback = getCallbackFunctionForInlineAutoformat( this.editor, 'bold' );
  1478. Object(_inlineautoformatediting__WEBPACK_IMPORTED_MODULE_1__["default"])( this.editor, this, /(\*\*)([^*]+)(\*\*)$/g, boldCallback );
  1479. Object(_inlineautoformatediting__WEBPACK_IMPORTED_MODULE_1__["default"])( this.editor, this, /(__)([^_]+)(__)$/g, boldCallback );
  1480. }
  1481. if ( commands.get( 'italic' ) ) {
  1482. const italicCallback = getCallbackFunctionForInlineAutoformat( this.editor, 'italic' );
  1483. // The italic autoformatter cannot be triggered by the bold markers, so we need to check the
  1484. // text before the pattern (e.g. `(?:^|[^\*])`).
  1485. Object(_inlineautoformatediting__WEBPACK_IMPORTED_MODULE_1__["default"])( this.editor, this, /(?:^|[^*])(\*)([^*_]+)(\*)$/g, italicCallback );
  1486. Object(_inlineautoformatediting__WEBPACK_IMPORTED_MODULE_1__["default"])( this.editor, this, /(?:^|[^_])(_)([^_]+)(_)$/g, italicCallback );
  1487. }
  1488. if ( commands.get( 'code' ) ) {
  1489. const codeCallback = getCallbackFunctionForInlineAutoformat( this.editor, 'code' );
  1490. Object(_inlineautoformatediting__WEBPACK_IMPORTED_MODULE_1__["default"])( this.editor, this, /(`)([^`]+)(`)$/g, codeCallback );
  1491. }
  1492. if ( commands.get( 'strikethrough' ) ) {
  1493. const strikethroughCallback = getCallbackFunctionForInlineAutoformat( this.editor, 'strikethrough' );
  1494. Object(_inlineautoformatediting__WEBPACK_IMPORTED_MODULE_1__["default"])( this.editor, this, /(~~)([^~]+)(~~)$/g, strikethroughCallback );
  1495. }
  1496. }
  1497. /**
  1498. * Adds autoformatting related to {@link module:heading/heading~Heading}.
  1499. *
  1500. * It is using a number at the end of the command name to associate it with the proper trigger:
  1501. *
  1502. * * `heading` with value `heading1` will be executed when typing `#`,
  1503. * * `heading` with value `heading2` will be executed when typing `##`,
  1504. * * ... up to `heading6` and `######`.
  1505. *
  1506. * @private
  1507. */
  1508. _addHeadingAutoformats() {
  1509. const command = this.editor.commands.get( 'heading' );
  1510. if ( command ) {
  1511. command.modelElements
  1512. .filter( name => name.match( /^heading[1-6]$/ ) )
  1513. .forEach( modelName => {
  1514. const level = modelName[ 7 ];
  1515. const pattern = new RegExp( `^(#{${ level }})\\s$` );
  1516. Object(_blockautoformatediting__WEBPACK_IMPORTED_MODULE_0__["default"])( this.editor, this, pattern, () => {
  1517. // Should only be active if command is enabled and heading style associated with pattern is inactive.
  1518. if ( !command.isEnabled || command.value === modelName ) {
  1519. return false;
  1520. }
  1521. this.editor.execute( 'heading', { value: modelName } );
  1522. } );
  1523. } );
  1524. }
  1525. }
  1526. /**
  1527. * Adds autoformatting related to {@link module:block-quote/blockquote~BlockQuote}.
  1528. *
  1529. * When typed:
  1530. * * `> ` &ndash; A paragraph will be changed to a block quote.
  1531. *
  1532. * @private
  1533. */
  1534. _addBlockQuoteAutoformats() {
  1535. if ( this.editor.commands.get( 'blockQuote' ) ) {
  1536. Object(_blockautoformatediting__WEBPACK_IMPORTED_MODULE_0__["default"])( this.editor, this, /^>\s$/, 'blockQuote' );
  1537. }
  1538. }
  1539. /**
  1540. * Adds autoformatting related to {@link module:code-block/codeblock~CodeBlock}.
  1541. *
  1542. * When typed:
  1543. * - `` ``` `` &ndash; A paragraph will be changed to a code block.
  1544. *
  1545. * @private
  1546. */
  1547. _addCodeBlockAutoformats() {
  1548. if ( this.editor.commands.get( 'codeBlock' ) ) {
  1549. Object(_blockautoformatediting__WEBPACK_IMPORTED_MODULE_0__["default"])( this.editor, this, /^```$/, 'codeBlock' );
  1550. }
  1551. }
  1552. }
  1553. // Helper function for getting `inlineAutoformatEditing` callbacks that checks if command is enabled.
  1554. //
  1555. // @param {module:core/editor/editor~Editor} editor
  1556. // @param {String} attributeKey
  1557. // @returns {Function}
  1558. function getCallbackFunctionForInlineAutoformat( editor, attributeKey ) {
  1559. return ( writer, rangesToFormat ) => {
  1560. const command = editor.commands.get( attributeKey );
  1561. if ( !command.isEnabled ) {
  1562. return false;
  1563. }
  1564. const validRanges = editor.model.schema.getValidRanges( rangesToFormat, attributeKey );
  1565. for ( const range of validRanges ) {
  1566. writer.setAttribute( attributeKey, true, range );
  1567. }
  1568. // After applying attribute to the text, remove given attribute from the selection.
  1569. // This way user is able to type a text without attribute used by auto formatter.
  1570. writer.removeSelectionAttribute( attributeKey );
  1571. };
  1572. }
  1573. /***/ }),
  1574. /***/ "./node_modules/@ckeditor/ckeditor5-autoformat/src/blockautoformatediting.js":
  1575. /*!***********************************************************************************!*\
  1576. !*** ./node_modules/@ckeditor/ckeditor5-autoformat/src/blockautoformatediting.js ***!
  1577. \***********************************************************************************/
  1578. /*! exports provided: default */
  1579. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1580. "use strict";
  1581. __webpack_require__.r(__webpack_exports__);
  1582. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return blockAutoformatEditing; });
  1583. /* harmony import */ var _ckeditor_ckeditor5_engine_src_model_liverange__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/model/liverange */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/liverange.js");
  1584. /* harmony import */ var _ckeditor_ckeditor5_utils_src_first__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/first */ "./node_modules/@ckeditor/ckeditor5-utils/src/first.js");
  1585. /**
  1586. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  1587. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  1588. */
  1589. /**
  1590. * The block autoformatting engine. It allows to format various block patterns. For example,
  1591. * it can be configured to turn a paragraph starting with `*` and followed by a space into a list item.
  1592. *
  1593. * The autoformatting operation is integrated with the undo manager,
  1594. * so the autoformatting step can be undone if the user's intention was not to format the text.
  1595. *
  1596. * See the {@link module:autoformat/blockautoformatediting~blockAutoformatEditing `blockAutoformatEditing`} documentation
  1597. * to learn how to create custom block autoformatters. You can also use
  1598. * the {@link module:autoformat/autoformat~Autoformat} feature which enables a set of default autoformatters
  1599. * (lists, headings, bold and italic).
  1600. *
  1601. * @module autoformat/blockautoformatediting
  1602. */
  1603. /**
  1604. * Creates a listener triggered on {@link module:engine/model/document~Document#event:change:data `change:data`} event in the document.
  1605. * Calls the callback when inserted text matches the regular expression or the command name
  1606. * if provided instead of the callback.
  1607. *
  1608. * Examples of usage:
  1609. *
  1610. * To convert a paragraph to heading 1 when `- ` is typed, using just the command name:
  1611. *
  1612. * blockAutoformatEditing( editor, plugin, /^\- $/, 'heading1' );
  1613. *
  1614. * To convert a paragraph to heading 1 when `- ` is typed, using just the callback:
  1615. *
  1616. * blockAutoformatEditing( editor, plugin, /^\- $/, ( context ) => {
  1617. * const { match } = context;
  1618. * const headingLevel = match[ 1 ].length;
  1619. *
  1620. * editor.execute( 'heading', {
  1621. * formatId: `heading${ headingLevel }`
  1622. * } );
  1623. * } );
  1624. *
  1625. * @param {module:core/editor/editor~Editor} editor The editor instance.
  1626. * @param {module:autoformat/autoformat~Autoformat} plugin The autoformat plugin instance.
  1627. * @param {RegExp} pattern The regular expression to execute on just inserted text. The regular expression is tested against the text
  1628. * from the beginning until the caret position.
  1629. * @param {Function|String} callbackOrCommand The callback to execute or the command to run when the text is matched.
  1630. * In case of providing the callback, it receives the following parameter:
  1631. * * {Object} match RegExp.exec() result of matching the pattern to inserted text.
  1632. */
  1633. function blockAutoformatEditing( editor, plugin, pattern, callbackOrCommand ) {
  1634. let callback;
  1635. let command = null;
  1636. if ( typeof callbackOrCommand == 'function' ) {
  1637. callback = callbackOrCommand;
  1638. } else {
  1639. // We assume that the actual command name was provided.
  1640. command = editor.commands.get( callbackOrCommand );
  1641. callback = () => {
  1642. editor.execute( callbackOrCommand );
  1643. };
  1644. }
  1645. editor.model.document.on( 'change:data', ( evt, batch ) => {
  1646. if ( command && !command.isEnabled || !plugin.isEnabled ) {
  1647. return;
  1648. }
  1649. const range = Object(_ckeditor_ckeditor5_utils_src_first__WEBPACK_IMPORTED_MODULE_1__["default"])( editor.model.document.selection.getRanges() );
  1650. if ( !range.isCollapsed ) {
  1651. return;
  1652. }
  1653. if ( batch.type == 'transparent' ) {
  1654. return;
  1655. }
  1656. const changes = Array.from( editor.model.document.differ.getChanges() );
  1657. const entry = changes[ 0 ];
  1658. // Typing is represented by only a single change.
  1659. if ( changes.length != 1 || entry.type !== 'insert' || entry.name != '$text' || entry.length != 1 ) {
  1660. return;
  1661. }
  1662. const blockToFormat = entry.position.parent;
  1663. // Block formatting should be disabled in codeBlocks (#5800).
  1664. if ( blockToFormat.is( 'element', 'codeBlock' ) ) {
  1665. return;
  1666. }
  1667. // In case a command is bound, do not re-execute it over an existing block style which would result with a style removal.
  1668. // Instead just drop processing so that autoformat trigger text is not lost. E.g. writing "# " in a level 1 heading.
  1669. if ( command && command.value === true ) {
  1670. return;
  1671. }
  1672. const firstNode = blockToFormat.getChild( 0 );
  1673. const firstNodeRange = editor.model.createRangeOn( firstNode );
  1674. // Range is only expected to be within or at the very end of the first text node.
  1675. if ( !firstNodeRange.containsRange( range ) && !range.end.isEqual( firstNodeRange.end ) ) {
  1676. return;
  1677. }
  1678. const match = pattern.exec( firstNode.data.substr( 0, range.end.offset ) );
  1679. // ...and this text node's data match the pattern.
  1680. if ( !match ) {
  1681. return;
  1682. }
  1683. // Use enqueueChange to create new batch to separate typing batch from the auto-format changes.
  1684. editor.model.enqueueChange( writer => {
  1685. // Matched range.
  1686. const start = writer.createPositionAt( blockToFormat, 0 );
  1687. const end = writer.createPositionAt( blockToFormat, match[ 0 ].length );
  1688. const range = new _ckeditor_ckeditor5_engine_src_model_liverange__WEBPACK_IMPORTED_MODULE_0__["default"]( start, end );
  1689. const wasChanged = callback( { match } );
  1690. // Remove matched text.
  1691. if ( wasChanged !== false ) {
  1692. writer.remove( range );
  1693. }
  1694. range.detach();
  1695. } );
  1696. } );
  1697. }
  1698. /***/ }),
  1699. /***/ "./node_modules/@ckeditor/ckeditor5-autoformat/src/inlineautoformatediting.js":
  1700. /*!************************************************************************************!*\
  1701. !*** ./node_modules/@ckeditor/ckeditor5-autoformat/src/inlineautoformatediting.js ***!
  1702. \************************************************************************************/
  1703. /*! exports provided: default */
  1704. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1705. "use strict";
  1706. __webpack_require__.r(__webpack_exports__);
  1707. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return inlineAutoformatEditing; });
  1708. /**
  1709. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  1710. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  1711. */
  1712. /**
  1713. * The inline autoformatting engine. It allows to format various inline patterns. For example,
  1714. * it can be configured to make "foo" bold when typed `**foo**` (the `**` markers will be removed).
  1715. *
  1716. * The autoformatting operation is integrated with the undo manager,
  1717. * so the autoformatting step can be undone if the user's intention was not to format the text.
  1718. *
  1719. * See the {@link module:autoformat/inlineautoformatediting~inlineAutoformatEditing `inlineAutoformatEditing`} documentation
  1720. * to learn how to create custom inline autoformatters. You can also use
  1721. * the {@link module:autoformat/autoformat~Autoformat} feature which enables a set of default autoformatters
  1722. * (lists, headings, bold and italic).
  1723. *
  1724. * @module autoformat/inlineautoformatediting
  1725. */
  1726. /**
  1727. * Enables autoformatting mechanism for a given {@link module:core/editor/editor~Editor}.
  1728. *
  1729. * It formats the matched text by applying the given model attribute or by running the provided formatting callback.
  1730. * On every {@link module:engine/model/document~Document#event:change:data data change} in the model document
  1731. * the autoformatting engine checks the text on the left of the selection
  1732. * and executes the provided action if the text matches given criteria (regular expression or callback).
  1733. *
  1734. * @param {module:core/editor/editor~Editor} editor The editor instance.
  1735. * @param {module:autoformat/autoformat~Autoformat} plugin The autoformat plugin instance.
  1736. * @param {Function|RegExp} testRegexpOrCallback The regular expression or callback to execute on text.
  1737. * Provided regular expression *must* have three capture groups. The first and the third capture group
  1738. * should match opening and closing delimiters. The second capture group should match the text to format.
  1739. *
  1740. * // Matches the `**bold text**` pattern.
  1741. * // There are three capturing groups:
  1742. * // - The first to match the starting `**` delimiter.
  1743. * // - The second to match the text to format.
  1744. * // - The third to match the ending `**` delimiter.
  1745. * inlineAutoformatEditing( editor, plugin, /(\*\*)([^\*]+?)(\*\*)$/g, formatCallback );
  1746. *
  1747. * When a function is provided instead of the regular expression, it will be executed with the text to match as a parameter.
  1748. * The function should return proper "ranges" to delete and format.
  1749. *
  1750. * {
  1751. * remove: [
  1752. * [ 0, 1 ], // Remove the first letter from the given text.
  1753. * [ 5, 6 ] // Remove the 6th letter from the given text.
  1754. * ],
  1755. * format: [
  1756. * [ 1, 5 ] // Format all letters from 2nd to 5th.
  1757. * ]
  1758. * }
  1759. *
  1760. * @param {Function} formatCallback A callback to apply actual formatting.
  1761. * It should return `false` if changes should not be applied (e.g. if a command is disabled).
  1762. *
  1763. * inlineAutoformatEditing( editor, plugin, /(\*\*)([^\*]+?)(\*\*)$/g, ( writer, rangesToFormat ) => {
  1764. * const command = editor.commands.get( 'bold' );
  1765. *
  1766. * if ( !command.isEnabled ) {
  1767. * return false;
  1768. * }
  1769. *
  1770. * const validRanges = editor.model.schema.getValidRanges( rangesToFormat, 'bold' );
  1771. *
  1772. * for ( let range of validRanges ) {
  1773. * writer.setAttribute( 'bold', true, range );
  1774. * }
  1775. * } );
  1776. */
  1777. function inlineAutoformatEditing( editor, plugin, testRegexpOrCallback, formatCallback ) {
  1778. let regExp;
  1779. let testCallback;
  1780. if ( testRegexpOrCallback instanceof RegExp ) {
  1781. regExp = testRegexpOrCallback;
  1782. } else {
  1783. testCallback = testRegexpOrCallback;
  1784. }
  1785. // A test callback run on changed text.
  1786. testCallback = testCallback || ( text => {
  1787. let result;
  1788. const remove = [];
  1789. const format = [];
  1790. while ( ( result = regExp.exec( text ) ) !== null ) {
  1791. // There should be full match and 3 capture groups.
  1792. if ( result && result.length < 4 ) {
  1793. break;
  1794. }
  1795. let {
  1796. index,
  1797. '1': leftDel,
  1798. '2': content,
  1799. '3': rightDel
  1800. } = result;
  1801. // Real matched string - there might be some non-capturing groups so we need to recalculate starting index.
  1802. const found = leftDel + content + rightDel;
  1803. index += result[ 0 ].length - found.length;
  1804. // Start and End offsets of delimiters to remove.
  1805. const delStart = [
  1806. index,
  1807. index + leftDel.length
  1808. ];
  1809. const delEnd = [
  1810. index + leftDel.length + content.length,
  1811. index + leftDel.length + content.length + rightDel.length
  1812. ];
  1813. remove.push( delStart );
  1814. remove.push( delEnd );
  1815. format.push( [ index + leftDel.length, index + leftDel.length + content.length ] );
  1816. }
  1817. return {
  1818. remove,
  1819. format
  1820. };
  1821. } );
  1822. editor.model.document.on( 'change:data', ( evt, batch ) => {
  1823. if ( batch.type == 'transparent' || !plugin.isEnabled ) {
  1824. return;
  1825. }
  1826. const model = editor.model;
  1827. const selection = model.document.selection;
  1828. // Do nothing if selection is not collapsed.
  1829. if ( !selection.isCollapsed ) {
  1830. return;
  1831. }
  1832. const changes = Array.from( model.document.differ.getChanges() );
  1833. const entry = changes[ 0 ];
  1834. // Typing is represented by only a single change.
  1835. if ( changes.length != 1 || entry.type !== 'insert' || entry.name != '$text' || entry.length != 1 ) {
  1836. return;
  1837. }
  1838. const focus = selection.focus;
  1839. const block = focus.parent;
  1840. const { text, range } = getTextAfterCode( model.createRange( model.createPositionAt( block, 0 ), focus ), model );
  1841. const testOutput = testCallback( text );
  1842. const rangesToFormat = testOutputToRanges( range.start, testOutput.format, model );
  1843. const rangesToRemove = testOutputToRanges( range.start, testOutput.remove, model );
  1844. if ( !( rangesToFormat.length && rangesToRemove.length ) ) {
  1845. return;
  1846. }
  1847. // Use enqueueChange to create new batch to separate typing batch from the auto-format changes.
  1848. model.enqueueChange( writer => {
  1849. // Apply format.
  1850. const hasChanged = formatCallback( writer, rangesToFormat );
  1851. // Strict check on `false` to have backward compatibility (when callbacks were returning `undefined`).
  1852. if ( hasChanged === false ) {
  1853. return;
  1854. }
  1855. // Remove delimiters - use reversed order to not mix the offsets while removing.
  1856. for ( const range of rangesToRemove.reverse() ) {
  1857. writer.remove( range );
  1858. }
  1859. } );
  1860. } );
  1861. }
  1862. // Converts output of the test function provided to the inlineAutoformatEditing and converts it to the model ranges
  1863. // inside provided block.
  1864. //
  1865. // @private
  1866. // @param {module:engine/model/position~Position} start
  1867. // @param {Array.<Array>} arrays
  1868. // @param {module:engine/model/model~Model} model
  1869. function testOutputToRanges( start, arrays, model ) {
  1870. return arrays
  1871. .filter( array => ( array[ 0 ] !== undefined && array[ 1 ] !== undefined ) )
  1872. .map( array => {
  1873. return model.createRange( start.getShiftedBy( array[ 0 ] ), start.getShiftedBy( array[ 1 ] ) );
  1874. } );
  1875. }
  1876. // Returns the last text line after the last code element from the given range.
  1877. // It is similar to {@link module:typing/utils/getlasttextline.getLastTextLine `getLastTextLine()`},
  1878. // but it ignores any text before the last `code`.
  1879. //
  1880. // @param {module:engine/model/range~Range} range
  1881. // @param {module:engine/model/model~Model} model
  1882. // @returns {module:typing/utils/getlasttextline~LastTextLineData}
  1883. function getTextAfterCode( range, model ) {
  1884. let start = range.start;
  1885. const text = Array.from( range.getItems() ).reduce( ( rangeText, node ) => {
  1886. // Trim text to a last occurrence of an inline element and update range start.
  1887. if ( !( node.is( '$text' ) || node.is( '$textProxy' ) ) || node.getAttribute( 'code' ) ) {
  1888. start = model.createPositionAfter( node );
  1889. return '';
  1890. }
  1891. return rangeText + node.data;
  1892. }, '' );
  1893. return { text, range: model.createRange( start, range.end ) };
  1894. }
  1895. /***/ }),
  1896. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js":
  1897. /*!*******************************************************************************!*\
  1898. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js ***!
  1899. \*******************************************************************************/
  1900. /*! exports provided: default */
  1901. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1902. "use strict";
  1903. __webpack_require__.r(__webpack_exports__);
  1904. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AttributeCommand; });
  1905. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  1906. /**
  1907. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  1908. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  1909. */
  1910. /**
  1911. * @module basic-styles/attributecommand
  1912. */
  1913. /**
  1914. * An extension of the base {@link module:core/command~Command} class, which provides utilities for a command
  1915. * that toggles a single attribute on a text or an element.
  1916. *
  1917. * `AttributeCommand` uses {@link module:engine/model/document~Document#selection}
  1918. * to decide which nodes (if any) should be changed, and applies or removes the attribute from them.
  1919. *
  1920. * The command checks the {@link module:engine/model/model~Model#schema} to decide if it can be enabled
  1921. * for the current selection and to which nodes the attribute can be applied.
  1922. *
  1923. * @extends module:core/command~Command
  1924. */
  1925. class AttributeCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  1926. /**
  1927. * @param {module:core/editor/editor~Editor} editor
  1928. * @param {String} attributeKey Attribute that will be set by the command.
  1929. */
  1930. constructor( editor, attributeKey ) {
  1931. super( editor );
  1932. /**
  1933. * The attribute that will be set by the command.
  1934. *
  1935. * @readonly
  1936. * @member {String}
  1937. */
  1938. this.attributeKey = attributeKey;
  1939. /**
  1940. * Flag indicating whether the command is active. The command is active when the
  1941. * {@link module:engine/model/selection~Selection#hasAttribute selection has the attribute} which means that:
  1942. *
  1943. * * If the selection is not empty &ndash; That the attribute is set on the first node in the selection that allows this attribute.
  1944. * * If the selection is empty &ndash; That the selection has the attribute itself (which means that newly typed
  1945. * text will have this attribute, too).
  1946. *
  1947. * @observable
  1948. * @readonly
  1949. * @member {Boolean} #value
  1950. */
  1951. }
  1952. /**
  1953. * Updates the command's {@link #value} and {@link #isEnabled} based on the current selection.
  1954. */
  1955. refresh() {
  1956. const model = this.editor.model;
  1957. const doc = model.document;
  1958. this.value = this._getValueFromFirstAllowedNode();
  1959. this.isEnabled = model.schema.checkAttributeInSelection( doc.selection, this.attributeKey );
  1960. }
  1961. /**
  1962. * Executes the command &mdash; applies the attribute to the selection or removes it from the selection.
  1963. *
  1964. * If the command is active (`value == true`), it will remove attributes. Otherwise, it will set attributes.
  1965. *
  1966. * The execution result differs, depending on the {@link module:engine/model/document~Document#selection}:
  1967. *
  1968. * * If the selection is on a range, the command applies the attribute to all nodes in that range
  1969. * (if they are allowed to have this attribute by the {@link module:engine/model/schema~Schema schema}).
  1970. * * If the selection is collapsed in a non-empty node, the command applies the attribute to the
  1971. * {@link module:engine/model/document~Document#selection} itself (note that typed characters copy attributes from the selection).
  1972. * * If the selection is collapsed in an empty node, the command applies the attribute to the parent node of the selection (note
  1973. * that the selection inherits all attributes from a node if it is in an empty node).
  1974. *
  1975. * @fires execute
  1976. * @param {Object} [options] Command options.
  1977. * @param {Boolean} [options.forceValue] If set, it will force the command behavior. If `true`, the command will apply the attribute,
  1978. * otherwise the command will remove the attribute.
  1979. * If not set, the command will look for its current value to decide what it should do.
  1980. */
  1981. execute( options = {} ) {
  1982. const model = this.editor.model;
  1983. const doc = model.document;
  1984. const selection = doc.selection;
  1985. const value = ( options.forceValue === undefined ) ? !this.value : options.forceValue;
  1986. model.change( writer => {
  1987. if ( selection.isCollapsed ) {
  1988. if ( value ) {
  1989. writer.setSelectionAttribute( this.attributeKey, true );
  1990. } else {
  1991. writer.removeSelectionAttribute( this.attributeKey );
  1992. }
  1993. } else {
  1994. const ranges = model.schema.getValidRanges( selection.getRanges(), this.attributeKey );
  1995. for ( const range of ranges ) {
  1996. if ( value ) {
  1997. writer.setAttribute( this.attributeKey, value, range );
  1998. } else {
  1999. writer.removeAttribute( this.attributeKey, range );
  2000. }
  2001. }
  2002. }
  2003. } );
  2004. }
  2005. /**
  2006. * Checks the attribute value of the first node in the selection that allows the attribute.
  2007. * For the collapsed selection returns the selection attribute.
  2008. *
  2009. * @private
  2010. * @returns {Boolean} The attribute value.
  2011. */
  2012. _getValueFromFirstAllowedNode() {
  2013. const model = this.editor.model;
  2014. const schema = model.schema;
  2015. const selection = model.document.selection;
  2016. if ( selection.isCollapsed ) {
  2017. return selection.hasAttribute( this.attributeKey );
  2018. }
  2019. for ( const range of selection.getRanges() ) {
  2020. for ( const item of range.getItems() ) {
  2021. if ( schema.checkAttribute( item, this.attributeKey ) ) {
  2022. return item.hasAttribute( this.attributeKey );
  2023. }
  2024. }
  2025. }
  2026. return false;
  2027. }
  2028. }
  2029. /***/ }),
  2030. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold.js":
  2031. /*!*******************************************************************!*\
  2032. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold.js ***!
  2033. \*******************************************************************/
  2034. /*! exports provided: default */
  2035. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2036. "use strict";
  2037. __webpack_require__.r(__webpack_exports__);
  2038. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Bold; });
  2039. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  2040. /* harmony import */ var _bold_boldediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bold/boldediting */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldediting.js");
  2041. /* harmony import */ var _bold_boldui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./bold/boldui */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldui.js");
  2042. /**
  2043. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  2044. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2045. */
  2046. /**
  2047. * @module basic-styles/bold
  2048. */
  2049. /**
  2050. * The bold feature.
  2051. *
  2052. * For a detailed overview check the {@glink features/basic-styles Basic styles feature documentation}
  2053. * and the {@glink api/basic-styles package page}.
  2054. *
  2055. * This is a "glue" plugin which loads the {@link module:basic-styles/bold/boldediting~BoldEditing bold editing feature}
  2056. * and {@link module:basic-styles/bold/boldui~BoldUI bold UI feature}.
  2057. *
  2058. * @extends module:core/plugin~Plugin
  2059. */
  2060. class Bold extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  2061. /**
  2062. * @inheritDoc
  2063. */
  2064. static get requires() {
  2065. return [ _bold_boldediting__WEBPACK_IMPORTED_MODULE_1__["default"], _bold_boldui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  2066. }
  2067. /**
  2068. * @inheritDoc
  2069. */
  2070. static get pluginName() {
  2071. return 'Bold';
  2072. }
  2073. }
  2074. /***/ }),
  2075. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldediting.js":
  2076. /*!*******************************************************************************!*\
  2077. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldediting.js ***!
  2078. \*******************************************************************************/
  2079. /*! exports provided: default */
  2080. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2081. "use strict";
  2082. __webpack_require__.r(__webpack_exports__);
  2083. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BoldEditing; });
  2084. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  2085. /* harmony import */ var _attributecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../attributecommand */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js");
  2086. /**
  2087. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  2088. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2089. */
  2090. /**
  2091. * @module basic-styles/bold/boldediting
  2092. */
  2093. const BOLD = 'bold';
  2094. /**
  2095. * The bold editing feature.
  2096. *
  2097. * It registers the `'bold'` command and introduces the `bold` attribute in the model which renders to the view
  2098. * as a `<strong>` element.
  2099. *
  2100. * @extends module:core/plugin~Plugin
  2101. */
  2102. class BoldEditing extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  2103. /**
  2104. * @inheritDoc
  2105. */
  2106. static get pluginName() {
  2107. return 'BoldEditing';
  2108. }
  2109. /**
  2110. * @inheritDoc
  2111. */
  2112. init() {
  2113. const editor = this.editor;
  2114. // Allow bold attribute on text nodes.
  2115. editor.model.schema.extend( '$text', { allowAttributes: BOLD } );
  2116. editor.model.schema.setAttributeProperties( BOLD, {
  2117. isFormatting: true,
  2118. copyOnEnter: true
  2119. } );
  2120. // Build converter from model to view for data and editing pipelines.
  2121. editor.conversion.attributeToElement( {
  2122. model: BOLD,
  2123. view: 'strong',
  2124. upcastAlso: [
  2125. 'b',
  2126. viewElement => {
  2127. const fontWeight = viewElement.getStyle( 'font-weight' );
  2128. if ( !fontWeight ) {
  2129. return null;
  2130. }
  2131. // Value of the `font-weight` attribute can be defined as a string or a number.
  2132. if ( fontWeight == 'bold' || Number( fontWeight ) >= 600 ) {
  2133. return {
  2134. name: true,
  2135. styles: [ 'font-weight' ]
  2136. };
  2137. }
  2138. }
  2139. ]
  2140. } );
  2141. // Create bold command.
  2142. editor.commands.add( BOLD, new _attributecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, BOLD ) );
  2143. // Set the Ctrl+B keystroke.
  2144. editor.keystrokes.set( 'CTRL+B', BOLD );
  2145. }
  2146. }
  2147. /***/ }),
  2148. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldui.js":
  2149. /*!**************************************************************************!*\
  2150. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldui.js ***!
  2151. \**************************************************************************/
  2152. /*! exports provided: default */
  2153. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2154. "use strict";
  2155. __webpack_require__.r(__webpack_exports__);
  2156. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BoldUI; });
  2157. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  2158. /* harmony import */ var _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  2159. /* harmony import */ var _theme_icons_bold_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/icons/bold.svg */ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/bold.svg");
  2160. /**
  2161. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  2162. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2163. */
  2164. /**
  2165. * @module basic-styles/bold/boldui
  2166. */
  2167. const BOLD = 'bold';
  2168. /**
  2169. * The bold UI feature. It introduces the Bold button.
  2170. *
  2171. * @extends module:core/plugin~Plugin
  2172. */
  2173. class BoldUI extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  2174. /**
  2175. * @inheritDoc
  2176. */
  2177. init() {
  2178. const editor = this.editor;
  2179. const t = editor.t;
  2180. // Add bold button to feature components.
  2181. editor.ui.componentFactory.add( BOLD, locale => {
  2182. const command = editor.commands.get( BOLD );
  2183. const view = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__["default"]( locale );
  2184. view.set( {
  2185. label: t( 'Bold' ),
  2186. icon: _theme_icons_bold_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  2187. keystroke: 'CTRL+B',
  2188. tooltip: true,
  2189. isToggleable: true
  2190. } );
  2191. view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
  2192. // Execute command.
  2193. this.listenTo( view, 'execute', () => {
  2194. editor.execute( BOLD );
  2195. editor.editing.view.focus();
  2196. } );
  2197. return view;
  2198. } );
  2199. }
  2200. }
  2201. /***/ }),
  2202. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic.js":
  2203. /*!*********************************************************************!*\
  2204. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic.js ***!
  2205. \*********************************************************************/
  2206. /*! exports provided: default */
  2207. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2208. "use strict";
  2209. __webpack_require__.r(__webpack_exports__);
  2210. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Italic; });
  2211. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  2212. /* harmony import */ var _italic_italicediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./italic/italicediting */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicediting.js");
  2213. /* harmony import */ var _italic_italicui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./italic/italicui */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicui.js");
  2214. /**
  2215. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  2216. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2217. */
  2218. /**
  2219. * @module basic-styles/italic
  2220. */
  2221. /**
  2222. * The italic feature.
  2223. *
  2224. * For a detailed overview check the {@glink features/basic-styles Basic styles feature documentation}
  2225. * and the {@glink api/basic-styles package page}.
  2226. *
  2227. * This is a "glue" plugin which loads the {@link module:basic-styles/italic/italicediting~ItalicEditing} and
  2228. * {@link module:basic-styles/italic/italicui~ItalicUI} plugins.
  2229. *
  2230. * @extends module:core/plugin~Plugin
  2231. */
  2232. class Italic extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  2233. /**
  2234. * @inheritDoc
  2235. */
  2236. static get requires() {
  2237. return [ _italic_italicediting__WEBPACK_IMPORTED_MODULE_1__["default"], _italic_italicui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  2238. }
  2239. /**
  2240. * @inheritDoc
  2241. */
  2242. static get pluginName() {
  2243. return 'Italic';
  2244. }
  2245. }
  2246. /***/ }),
  2247. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicediting.js":
  2248. /*!***********************************************************************************!*\
  2249. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicediting.js ***!
  2250. \***********************************************************************************/
  2251. /*! exports provided: default */
  2252. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2253. "use strict";
  2254. __webpack_require__.r(__webpack_exports__);
  2255. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ItalicEditing; });
  2256. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  2257. /* harmony import */ var _attributecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../attributecommand */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js");
  2258. /**
  2259. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  2260. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2261. */
  2262. /**
  2263. * @module basic-styles/italic/italicediting
  2264. */
  2265. const ITALIC = 'italic';
  2266. /**
  2267. * The italic editing feature.
  2268. *
  2269. * It registers the `'italic'` command, the <kbd>Ctrl+I</kbd> keystroke and introduces the `italic` attribute in the model
  2270. * which renders to the view as an `<i>` element.
  2271. *
  2272. * @extends module:core/plugin~Plugin
  2273. */
  2274. class ItalicEditing extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  2275. /**
  2276. * @inheritDoc
  2277. */
  2278. static get pluginName() {
  2279. return 'ItalicEditing';
  2280. }
  2281. /**
  2282. * @inheritDoc
  2283. */
  2284. init() {
  2285. const editor = this.editor;
  2286. // Allow italic attribute on text nodes.
  2287. editor.model.schema.extend( '$text', { allowAttributes: ITALIC } );
  2288. editor.model.schema.setAttributeProperties( ITALIC, {
  2289. isFormatting: true,
  2290. copyOnEnter: true
  2291. } );
  2292. editor.conversion.attributeToElement( {
  2293. model: ITALIC,
  2294. view: 'i',
  2295. upcastAlso: [
  2296. 'em',
  2297. {
  2298. styles: {
  2299. 'font-style': 'italic'
  2300. }
  2301. }
  2302. ]
  2303. } );
  2304. // Create italic command.
  2305. editor.commands.add( ITALIC, new _attributecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, ITALIC ) );
  2306. // Set the Ctrl+I keystroke.
  2307. editor.keystrokes.set( 'CTRL+I', ITALIC );
  2308. }
  2309. }
  2310. /***/ }),
  2311. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicui.js":
  2312. /*!******************************************************************************!*\
  2313. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicui.js ***!
  2314. \******************************************************************************/
  2315. /*! exports provided: default */
  2316. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2317. "use strict";
  2318. __webpack_require__.r(__webpack_exports__);
  2319. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ItalicUI; });
  2320. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  2321. /* harmony import */ var _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  2322. /* harmony import */ var _theme_icons_italic_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/icons/italic.svg */ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/italic.svg");
  2323. /**
  2324. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  2325. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2326. */
  2327. /**
  2328. * @module basic-styles/italic/italicui
  2329. */
  2330. const ITALIC = 'italic';
  2331. /**
  2332. * The italic UI feature. It introduces the Italic button.
  2333. *
  2334. * @extends module:core/plugin~Plugin
  2335. */
  2336. class ItalicUI extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  2337. /**
  2338. * @inheritDoc
  2339. */
  2340. init() {
  2341. const editor = this.editor;
  2342. const t = editor.t;
  2343. // Add bold button to feature components.
  2344. editor.ui.componentFactory.add( ITALIC, locale => {
  2345. const command = editor.commands.get( ITALIC );
  2346. const view = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__["default"]( locale );
  2347. view.set( {
  2348. label: t( 'Italic' ),
  2349. icon: _theme_icons_italic_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  2350. keystroke: 'CTRL+I',
  2351. tooltip: true,
  2352. isToggleable: true
  2353. } );
  2354. view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
  2355. // Execute command.
  2356. this.listenTo( view, 'execute', () => {
  2357. editor.execute( ITALIC );
  2358. editor.editing.view.focus();
  2359. } );
  2360. return view;
  2361. } );
  2362. }
  2363. }
  2364. /***/ }),
  2365. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough.js":
  2366. /*!****************************************************************************!*\
  2367. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough.js ***!
  2368. \****************************************************************************/
  2369. /*! exports provided: default */
  2370. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2371. "use strict";
  2372. __webpack_require__.r(__webpack_exports__);
  2373. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Strikethrough; });
  2374. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  2375. /* harmony import */ var _strikethrough_strikethroughediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./strikethrough/strikethroughediting */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughediting.js");
  2376. /* harmony import */ var _strikethrough_strikethroughui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./strikethrough/strikethroughui */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughui.js");
  2377. /**
  2378. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  2379. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2380. */
  2381. /**
  2382. * @module basic-styles/strikethrough
  2383. */
  2384. /**
  2385. * The strikethrough feature.
  2386. *
  2387. * For a detailed overview check the {@glink features/basic-styles Basic styles feature documentation}
  2388. * and the {@glink api/basic-styles package page}.
  2389. *
  2390. * This is a "glue" plugin which loads the {@link module:basic-styles/strikethrough/strikethroughediting~StrikethroughEditing} and
  2391. * {@link module:basic-styles/strikethrough/strikethroughui~StrikethroughUI} plugins.
  2392. *
  2393. * @extends module:core/plugin~Plugin
  2394. */
  2395. class Strikethrough extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  2396. /**
  2397. * @inheritDoc
  2398. */
  2399. static get requires() {
  2400. return [ _strikethrough_strikethroughediting__WEBPACK_IMPORTED_MODULE_1__["default"], _strikethrough_strikethroughui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  2401. }
  2402. /**
  2403. * @inheritDoc
  2404. */
  2405. static get pluginName() {
  2406. return 'Strikethrough';
  2407. }
  2408. }
  2409. /***/ }),
  2410. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughediting.js":
  2411. /*!*************************************************************************************************!*\
  2412. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughediting.js ***!
  2413. \*************************************************************************************************/
  2414. /*! exports provided: default */
  2415. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2416. "use strict";
  2417. __webpack_require__.r(__webpack_exports__);
  2418. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return StrikethroughEditing; });
  2419. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  2420. /* harmony import */ var _attributecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../attributecommand */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js");
  2421. /**
  2422. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  2423. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2424. */
  2425. /**
  2426. * @module basic-styles/strikethrough/strikethroughediting
  2427. */
  2428. const STRIKETHROUGH = 'strikethrough';
  2429. /**
  2430. * The strikethrough editing feature.
  2431. *
  2432. * It registers the `'strikethrough'` command, the <kbd>Ctrl+Shift+X</kbd> keystroke and introduces the
  2433. * `strikethroughsthrough` attribute in the model which renders to the view
  2434. * as a `<s>` element.
  2435. *
  2436. * @extends module:core/plugin~Plugin
  2437. */
  2438. class StrikethroughEditing extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  2439. /**
  2440. * @inheritDoc
  2441. */
  2442. static get pluginName() {
  2443. return 'StrikethroughEditing';
  2444. }
  2445. /**
  2446. * @inheritDoc
  2447. */
  2448. init() {
  2449. const editor = this.editor;
  2450. // Allow strikethrough attribute on text nodes.
  2451. editor.model.schema.extend( '$text', { allowAttributes: STRIKETHROUGH } );
  2452. editor.model.schema.setAttributeProperties( STRIKETHROUGH, {
  2453. isFormatting: true,
  2454. copyOnEnter: true
  2455. } );
  2456. editor.conversion.attributeToElement( {
  2457. model: STRIKETHROUGH,
  2458. view: 's',
  2459. upcastAlso: [
  2460. 'del',
  2461. 'strike',
  2462. {
  2463. styles: {
  2464. 'text-decoration': 'line-through'
  2465. }
  2466. }
  2467. ]
  2468. } );
  2469. // Create strikethrough command.
  2470. editor.commands.add( STRIKETHROUGH, new _attributecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, STRIKETHROUGH ) );
  2471. // Set the Ctrl+Shift+X keystroke.
  2472. editor.keystrokes.set( 'CTRL+SHIFT+X', 'strikethrough' );
  2473. }
  2474. }
  2475. /***/ }),
  2476. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughui.js":
  2477. /*!********************************************************************************************!*\
  2478. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughui.js ***!
  2479. \********************************************************************************************/
  2480. /*! exports provided: default */
  2481. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2482. "use strict";
  2483. __webpack_require__.r(__webpack_exports__);
  2484. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return StrikethroughUI; });
  2485. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  2486. /* harmony import */ var _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  2487. /* harmony import */ var _theme_icons_strikethrough_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/icons/strikethrough.svg */ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/strikethrough.svg");
  2488. /**
  2489. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  2490. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2491. */
  2492. /**
  2493. * @module basic-styles/strikethrough/strikethroughui
  2494. */
  2495. const STRIKETHROUGH = 'strikethrough';
  2496. /**
  2497. * The strikethrough UI feature. It introduces the Strikethrough button.
  2498. *
  2499. * @extends module:core/plugin~Plugin
  2500. */
  2501. class StrikethroughUI extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  2502. /**
  2503. * @inheritDoc
  2504. */
  2505. init() {
  2506. const editor = this.editor;
  2507. const t = editor.t;
  2508. // Add strikethrough button to feature components.
  2509. editor.ui.componentFactory.add( STRIKETHROUGH, locale => {
  2510. const command = editor.commands.get( STRIKETHROUGH );
  2511. const view = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__["default"]( locale );
  2512. view.set( {
  2513. label: t( 'Strikethrough' ),
  2514. icon: _theme_icons_strikethrough_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  2515. keystroke: 'CTRL+SHIFT+X',
  2516. tooltip: true,
  2517. isToggleable: true
  2518. } );
  2519. view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
  2520. // Execute command.
  2521. this.listenTo( view, 'execute', () => {
  2522. editor.execute( STRIKETHROUGH );
  2523. editor.editing.view.focus();
  2524. } );
  2525. return view;
  2526. } );
  2527. }
  2528. }
  2529. /***/ }),
  2530. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript.js":
  2531. /*!************************************************************************!*\
  2532. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript.js ***!
  2533. \************************************************************************/
  2534. /*! exports provided: default */
  2535. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2536. "use strict";
  2537. __webpack_require__.r(__webpack_exports__);
  2538. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Subscript; });
  2539. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  2540. /* harmony import */ var _subscript_subscriptediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./subscript/subscriptediting */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptediting.js");
  2541. /* harmony import */ var _subscript_subscriptui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./subscript/subscriptui */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptui.js");
  2542. /**
  2543. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  2544. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2545. */
  2546. /**
  2547. * @module basic-styles/subscript
  2548. */
  2549. /**
  2550. * The subscript feature.
  2551. *
  2552. * It loads the {@link module:basic-styles/subscript/subscriptediting~SubscriptEditing} and
  2553. * {@link module:basic-styles/subscript/subscriptui~SubscriptUI} plugins.
  2554. *
  2555. * @extends module:core/plugin~Plugin
  2556. */
  2557. class Subscript extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  2558. /**
  2559. * @inheritDoc
  2560. */
  2561. static get requires() {
  2562. return [ _subscript_subscriptediting__WEBPACK_IMPORTED_MODULE_1__["default"], _subscript_subscriptui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  2563. }
  2564. /**
  2565. * @inheritDoc
  2566. */
  2567. static get pluginName() {
  2568. return 'Subscript';
  2569. }
  2570. }
  2571. /***/ }),
  2572. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptediting.js":
  2573. /*!*****************************************************************************************!*\
  2574. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptediting.js ***!
  2575. \*****************************************************************************************/
  2576. /*! exports provided: default */
  2577. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2578. "use strict";
  2579. __webpack_require__.r(__webpack_exports__);
  2580. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SubscriptEditing; });
  2581. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  2582. /* harmony import */ var _attributecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../attributecommand */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js");
  2583. /**
  2584. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  2585. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2586. */
  2587. /**
  2588. * @module basic-styles/subscript/subscriptediting
  2589. */
  2590. const SUBSCRIPT = 'subscript';
  2591. /**
  2592. * The subscript editing feature.
  2593. *
  2594. * It registers the `sub` command and introduces the `sub` attribute in the model which renders to the view
  2595. * as a `<sub>` element.
  2596. *
  2597. * @extends module:core/plugin~Plugin
  2598. */
  2599. class SubscriptEditing extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  2600. /**
  2601. * @inheritDoc
  2602. */
  2603. static get pluginName() {
  2604. return 'SubscriptEditing';
  2605. }
  2606. /**
  2607. * @inheritDoc
  2608. */
  2609. init() {
  2610. const editor = this.editor;
  2611. // Allow sub attribute on text nodes.
  2612. editor.model.schema.extend( '$text', { allowAttributes: SUBSCRIPT } );
  2613. editor.model.schema.setAttributeProperties( SUBSCRIPT, {
  2614. isFormatting: true,
  2615. copyOnEnter: true
  2616. } );
  2617. // Build converter from model to view for data and editing pipelines.
  2618. editor.conversion.attributeToElement( {
  2619. model: SUBSCRIPT,
  2620. view: 'sub',
  2621. upcastAlso: [
  2622. {
  2623. styles: {
  2624. 'vertical-align': 'sub'
  2625. }
  2626. }
  2627. ]
  2628. } );
  2629. // Create sub command.
  2630. editor.commands.add( SUBSCRIPT, new _attributecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, SUBSCRIPT ) );
  2631. }
  2632. }
  2633. /***/ }),
  2634. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptui.js":
  2635. /*!************************************************************************************!*\
  2636. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptui.js ***!
  2637. \************************************************************************************/
  2638. /*! exports provided: default */
  2639. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2640. "use strict";
  2641. __webpack_require__.r(__webpack_exports__);
  2642. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SubscriptUI; });
  2643. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  2644. /* harmony import */ var _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  2645. /* harmony import */ var _theme_icons_subscript_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/icons/subscript.svg */ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/subscript.svg");
  2646. /**
  2647. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  2648. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2649. */
  2650. /**
  2651. * @module basic-styles/subscript/subscriptui
  2652. */
  2653. const SUBSCRIPT = 'subscript';
  2654. /**
  2655. * The subscript UI feature. It introduces the Subscript button.
  2656. *
  2657. * @extends module:core/plugin~Plugin
  2658. */
  2659. class SubscriptUI extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  2660. /**
  2661. * @inheritDoc
  2662. */
  2663. init() {
  2664. const editor = this.editor;
  2665. const t = editor.t;
  2666. // Add subscript button to feature components.
  2667. editor.ui.componentFactory.add( SUBSCRIPT, locale => {
  2668. const command = editor.commands.get( SUBSCRIPT );
  2669. const view = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__["default"]( locale );
  2670. view.set( {
  2671. label: t( 'Subscript' ),
  2672. icon: _theme_icons_subscript_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  2673. tooltip: true,
  2674. isToggleable: true
  2675. } );
  2676. view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
  2677. // Execute command.
  2678. this.listenTo( view, 'execute', () => {
  2679. editor.execute( SUBSCRIPT );
  2680. editor.editing.view.focus();
  2681. } );
  2682. return view;
  2683. } );
  2684. }
  2685. }
  2686. /***/ }),
  2687. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript.js":
  2688. /*!**************************************************************************!*\
  2689. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript.js ***!
  2690. \**************************************************************************/
  2691. /*! exports provided: default */
  2692. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2693. "use strict";
  2694. __webpack_require__.r(__webpack_exports__);
  2695. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Superscript; });
  2696. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  2697. /* harmony import */ var _superscript_superscriptediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./superscript/superscriptediting */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptediting.js");
  2698. /* harmony import */ var _superscript_superscriptui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./superscript/superscriptui */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptui.js");
  2699. /**
  2700. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  2701. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2702. */
  2703. /**
  2704. * @module basic-styles/superscript
  2705. */
  2706. /**
  2707. * The superscript feature.
  2708. *
  2709. * It loads the {@link module:basic-styles/superscript/superscriptediting~SuperscriptEditing} and
  2710. * {@link module:basic-styles/superscript/superscriptui~SuperscriptUI} plugins.
  2711. *
  2712. * @extends module:core/plugin~Plugin
  2713. */
  2714. class Superscript extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  2715. /**
  2716. * @inheritDoc
  2717. */
  2718. static get requires() {
  2719. return [ _superscript_superscriptediting__WEBPACK_IMPORTED_MODULE_1__["default"], _superscript_superscriptui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  2720. }
  2721. /**
  2722. * @inheritDoc
  2723. */
  2724. static get pluginName() {
  2725. return 'Superscript';
  2726. }
  2727. }
  2728. /***/ }),
  2729. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptediting.js":
  2730. /*!*********************************************************************************************!*\
  2731. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptediting.js ***!
  2732. \*********************************************************************************************/
  2733. /*! exports provided: default */
  2734. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2735. "use strict";
  2736. __webpack_require__.r(__webpack_exports__);
  2737. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SuperscriptEditing; });
  2738. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  2739. /* harmony import */ var _attributecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../attributecommand */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js");
  2740. /**
  2741. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  2742. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2743. */
  2744. /**
  2745. * @module basic-styles/superscript/superscriptediting
  2746. */
  2747. const SUPERSCRIPT = 'superscript';
  2748. /**
  2749. * The superscript editing feature.
  2750. *
  2751. * It registers the `super` command and introduces the `super` attribute in the model which renders to the view
  2752. * as a `<super>` element.
  2753. *
  2754. * @extends module:core/plugin~Plugin
  2755. */
  2756. class SuperscriptEditing extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  2757. /**
  2758. * @inheritDoc
  2759. */
  2760. static get pluginName() {
  2761. return 'SuperscriptEditing';
  2762. }
  2763. /**
  2764. * @inheritDoc
  2765. */
  2766. init() {
  2767. const editor = this.editor;
  2768. // Allow super attribute on text nodes.
  2769. editor.model.schema.extend( '$text', { allowAttributes: SUPERSCRIPT } );
  2770. editor.model.schema.setAttributeProperties( SUPERSCRIPT, {
  2771. isFormatting: true,
  2772. copyOnEnter: true
  2773. } );
  2774. // Build converter from model to view for data and editing pipelines.
  2775. editor.conversion.attributeToElement( {
  2776. model: SUPERSCRIPT,
  2777. view: 'sup',
  2778. upcastAlso: [
  2779. {
  2780. styles: {
  2781. 'vertical-align': 'super'
  2782. }
  2783. }
  2784. ]
  2785. } );
  2786. // Create super command.
  2787. editor.commands.add( SUPERSCRIPT, new _attributecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, SUPERSCRIPT ) );
  2788. }
  2789. }
  2790. /***/ }),
  2791. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptui.js":
  2792. /*!****************************************************************************************!*\
  2793. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptui.js ***!
  2794. \****************************************************************************************/
  2795. /*! exports provided: default */
  2796. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2797. "use strict";
  2798. __webpack_require__.r(__webpack_exports__);
  2799. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SuperscriptUI; });
  2800. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  2801. /* harmony import */ var _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  2802. /* harmony import */ var _theme_icons_superscript_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/icons/superscript.svg */ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/superscript.svg");
  2803. /**
  2804. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  2805. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2806. */
  2807. /**
  2808. * @module basic-styles/superscript/superscriptui
  2809. */
  2810. const SUPERSCRIPT = 'superscript';
  2811. /**
  2812. * The superscript UI feature. It introduces the Superscript button.
  2813. *
  2814. * @extends module:core/plugin~Plugin
  2815. */
  2816. class SuperscriptUI extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  2817. /**
  2818. * @inheritDoc
  2819. */
  2820. init() {
  2821. const editor = this.editor;
  2822. const t = editor.t;
  2823. // Add superscript button to feature components.
  2824. editor.ui.componentFactory.add( SUPERSCRIPT, locale => {
  2825. const command = editor.commands.get( SUPERSCRIPT );
  2826. const view = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__["default"]( locale );
  2827. view.set( {
  2828. label: t( 'Superscript' ),
  2829. icon: _theme_icons_superscript_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  2830. tooltip: true,
  2831. isToggleable: true
  2832. } );
  2833. view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
  2834. // Execute command.
  2835. this.listenTo( view, 'execute', () => {
  2836. editor.execute( SUPERSCRIPT );
  2837. editor.editing.view.focus();
  2838. } );
  2839. return view;
  2840. } );
  2841. }
  2842. }
  2843. /***/ }),
  2844. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline.js":
  2845. /*!************************************************************************!*\
  2846. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline.js ***!
  2847. \************************************************************************/
  2848. /*! exports provided: default */
  2849. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2850. "use strict";
  2851. __webpack_require__.r(__webpack_exports__);
  2852. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Underline; });
  2853. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  2854. /* harmony import */ var _underline_underlineediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./underline/underlineediting */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineediting.js");
  2855. /* harmony import */ var _underline_underlineui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./underline/underlineui */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineui.js");
  2856. /**
  2857. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  2858. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2859. */
  2860. /**
  2861. * @module basic-styles/underline
  2862. */
  2863. /**
  2864. * The underline feature.
  2865. *
  2866. * For a detailed overview check the {@glink features/basic-styles Basic styles feature documentation}
  2867. * and the {@glink api/basic-styles package page}.
  2868. *
  2869. * This is a "glue" plugin which loads the {@link module:basic-styles/underline/underlineediting~UnderlineEditing} and
  2870. * {@link module:basic-styles/underline/underlineui~UnderlineUI} plugins.
  2871. *
  2872. * @extends module:core/plugin~Plugin
  2873. */
  2874. class Underline extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  2875. /**
  2876. * @inheritDoc
  2877. */
  2878. static get requires() {
  2879. return [ _underline_underlineediting__WEBPACK_IMPORTED_MODULE_1__["default"], _underline_underlineui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  2880. }
  2881. /**
  2882. * @inheritDoc
  2883. */
  2884. static get pluginName() {
  2885. return 'Underline';
  2886. }
  2887. }
  2888. /***/ }),
  2889. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineediting.js":
  2890. /*!*****************************************************************************************!*\
  2891. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineediting.js ***!
  2892. \*****************************************************************************************/
  2893. /*! exports provided: default */
  2894. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2895. "use strict";
  2896. __webpack_require__.r(__webpack_exports__);
  2897. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UnderlineEditing; });
  2898. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  2899. /* harmony import */ var _attributecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../attributecommand */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js");
  2900. /**
  2901. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  2902. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2903. */
  2904. /**
  2905. * @module basic-styles/underline/underlineediting
  2906. */
  2907. const UNDERLINE = 'underline';
  2908. /**
  2909. * The underline editing feature.
  2910. *
  2911. * It registers the `'underline'` command, the <kbd>Ctrl+U</kbd> keystroke
  2912. * and introduces the `underline` attribute in the model which renders to the view as an `<u>` element.
  2913. *
  2914. * @extends module:core/plugin~Plugin
  2915. */
  2916. class UnderlineEditing extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  2917. /**
  2918. * @inheritDoc
  2919. */
  2920. static get pluginName() {
  2921. return 'UnderlineEditing';
  2922. }
  2923. /**
  2924. * @inheritDoc
  2925. */
  2926. init() {
  2927. const editor = this.editor;
  2928. // Allow strikethrough attribute on text nodes.
  2929. editor.model.schema.extend( '$text', { allowAttributes: UNDERLINE } );
  2930. editor.model.schema.setAttributeProperties( UNDERLINE, {
  2931. isFormatting: true,
  2932. copyOnEnter: true
  2933. } );
  2934. editor.conversion.attributeToElement( {
  2935. model: UNDERLINE,
  2936. view: 'u',
  2937. upcastAlso: {
  2938. styles: {
  2939. 'text-decoration': 'underline'
  2940. }
  2941. }
  2942. } );
  2943. // Create underline command.
  2944. editor.commands.add( UNDERLINE, new _attributecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, UNDERLINE ) );
  2945. // Set the Ctrl+U keystroke.
  2946. editor.keystrokes.set( 'CTRL+U', 'underline' );
  2947. }
  2948. }
  2949. /***/ }),
  2950. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineui.js":
  2951. /*!************************************************************************************!*\
  2952. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineui.js ***!
  2953. \************************************************************************************/
  2954. /*! exports provided: default */
  2955. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2956. "use strict";
  2957. __webpack_require__.r(__webpack_exports__);
  2958. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UnderlineUI; });
  2959. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  2960. /* harmony import */ var _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  2961. /* harmony import */ var _theme_icons_underline_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/icons/underline.svg */ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/underline.svg");
  2962. /**
  2963. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  2964. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  2965. */
  2966. /**
  2967. * @module basic-styles/underline/underlineui
  2968. */
  2969. const UNDERLINE = 'underline';
  2970. /**
  2971. * The underline UI feature. It introduces the Underline button.
  2972. *
  2973. * @extends module:core/plugin~Plugin
  2974. */
  2975. class UnderlineUI extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  2976. /**
  2977. * @inheritDoc
  2978. */
  2979. init() {
  2980. const editor = this.editor;
  2981. const t = editor.t;
  2982. // Add bold button to feature components.
  2983. editor.ui.componentFactory.add( UNDERLINE, locale => {
  2984. const command = editor.commands.get( UNDERLINE );
  2985. const view = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__["default"]( locale );
  2986. view.set( {
  2987. label: t( 'Underline' ),
  2988. icon: _theme_icons_underline_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  2989. keystroke: 'CTRL+U',
  2990. tooltip: true,
  2991. isToggleable: true
  2992. } );
  2993. view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
  2994. // Execute command.
  2995. this.listenTo( view, 'execute', () => {
  2996. editor.execute( UNDERLINE );
  2997. editor.editing.view.focus();
  2998. } );
  2999. return view;
  3000. } );
  3001. }
  3002. }
  3003. /***/ }),
  3004. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/bold.svg":
  3005. /*!****************************************************************************!*\
  3006. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/bold.svg ***!
  3007. \****************************************************************************/
  3008. /*! exports provided: default */
  3009. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3010. "use strict";
  3011. __webpack_require__.r(__webpack_exports__);
  3012. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10.187 17H5.773c-.637 0-1.092-.138-1.364-.415-.273-.277-.409-.718-.409-1.323V4.738c0-.617.14-1.062.419-1.332.279-.27.73-.406 1.354-.406h4.68c.69 0 1.288.041 1.793.124.506.083.96.242 1.36.478.341.197.644.447.906.75a3.262 3.262 0 0 1 .808 2.162c0 1.401-.722 2.426-2.167 3.075C15.05 10.175 16 11.315 16 13.01a3.756 3.756 0 0 1-2.296 3.504 6.1 6.1 0 0 1-1.517.377c-.571.073-1.238.11-2 .11zm-.217-6.217H7v4.087h3.069c1.977 0 2.965-.69 2.965-2.072 0-.707-.256-1.22-.768-1.537-.512-.319-1.277-.478-2.296-.478zM7 5.13v3.619h2.606c.729 0 1.292-.067 1.69-.2a1.6 1.6 0 0 0 .91-.765c.165-.267.247-.566.247-.897 0-.707-.26-1.176-.778-1.409-.519-.232-1.31-.348-2.375-.348H7z\"/></svg>");
  3013. /***/ }),
  3014. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/italic.svg":
  3015. /*!******************************************************************************!*\
  3016. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/italic.svg ***!
  3017. \******************************************************************************/
  3018. /*! exports provided: default */
  3019. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3020. "use strict";
  3021. __webpack_require__.r(__webpack_exports__);
  3022. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M9.586 14.633l.021.004c-.036.335.095.655.393.962.082.083.173.15.274.201h1.474a.6.6 0 1 1 0 1.2H5.304a.6.6 0 0 1 0-1.2h1.15c.474-.07.809-.182 1.005-.334.157-.122.291-.32.404-.597l2.416-9.55a1.053 1.053 0 0 0-.281-.823 1.12 1.12 0 0 0-.442-.296H8.15a.6.6 0 0 1 0-1.2h6.443a.6.6 0 1 1 0 1.2h-1.195c-.376.056-.65.155-.823.296-.215.175-.423.439-.623.79l-2.366 9.347z\"/></svg>");
  3023. /***/ }),
  3024. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/strikethrough.svg":
  3025. /*!*************************************************************************************!*\
  3026. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/strikethrough.svg ***!
  3027. \*************************************************************************************/
  3028. /*! exports provided: default */
  3029. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3030. "use strict";
  3031. __webpack_require__.r(__webpack_exports__);
  3032. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M7 16.4c-.8-.4-1.5-.9-2.2-1.5a.6.6 0 0 1-.2-.5l.3-.6h1c1 1.2 2.1 1.7 3.7 1.7 1 0 1.8-.3 2.3-.6.6-.4.6-1.2.6-1.3.2-1.2-.9-2.1-.9-2.1h2.1c.3.7.4 1.2.4 1.7v.8l-.6 1.2c-.6.8-1.1 1-1.6 1.2a6 6 0 0 1-2.4.6c-1 0-1.8-.3-2.5-.6zM6.8 9L6 8.3c-.4-.5-.5-.8-.5-1.6 0-.7.1-1.3.5-1.8.4-.6 1-1 1.6-1.3a6.3 6.3 0 0 1 4.7 0 4 4 0 0 1 1.7 1l.3.7c0 .1.2.4-.2.7-.4.2-.9.1-1 0a3 3 0 0 0-1.2-1c-.4-.2-1-.3-2-.4-.7 0-1.4.2-2 .6-.8.6-1 .8-1 1.5 0 .8.5 1 1.2 1.5.6.4 1.1.7 1.9 1H6.8z\"/><path d=\"M3 10.5V9h14v1.5z\"/></svg>");
  3033. /***/ }),
  3034. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/subscript.svg":
  3035. /*!*********************************************************************************!*\
  3036. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/subscript.svg ***!
  3037. \*********************************************************************************/
  3038. /*! exports provided: default */
  3039. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3040. "use strict";
  3041. __webpack_require__.r(__webpack_exports__);
  3042. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M7.03 10.349l3.818-3.819a.8.8 0 1 1 1.132 1.132L8.16 11.48l3.819 3.818a.8.8 0 1 1-1.132 1.132L7.03 12.61l-3.818 3.82a.8.8 0 1 1-1.132-1.132L5.9 11.48 2.08 7.662A.8.8 0 1 1 3.212 6.53l3.818 3.82zm8.147 7.829h2.549c.254 0 .447.05.58.152a.49.49 0 0 1 .201.413.54.54 0 0 1-.159.393c-.105.108-.266.162-.48.162h-3.594c-.245 0-.435-.066-.572-.197a.621.621 0 0 1-.205-.463c0-.114.044-.265.132-.453a1.62 1.62 0 0 1 .288-.444c.433-.436.824-.81 1.172-1.122.348-.312.597-.517.747-.615.267-.183.49-.368.667-.553.177-.185.312-.375.405-.57.093-.194.139-.384.139-.57a1.008 1.008 0 0 0-.554-.917 1.197 1.197 0 0 0-.56-.133c-.426 0-.761.182-1.005.546a2.332 2.332 0 0 0-.164.39 1.609 1.609 0 0 1-.258.488c-.096.114-.237.17-.423.17a.558.558 0 0 1-.405-.156.568.568 0 0 1-.161-.427c0-.218.05-.446.151-.683.101-.238.252-.453.452-.646s.454-.349.762-.467a2.998 2.998 0 0 1 1.081-.178c.498 0 .923.076 1.274.228a1.916 1.916 0 0 1 1.004 1.032 1.984 1.984 0 0 1-.156 1.794c-.2.32-.405.572-.613.754-.208.182-.558.468-1.048.857-.49.39-.826.691-1.008.906a2.703 2.703 0 0 0-.24.309z\"/></svg>");
  3043. /***/ }),
  3044. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/superscript.svg":
  3045. /*!***********************************************************************************!*\
  3046. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/superscript.svg ***!
  3047. \***********************************************************************************/
  3048. /*! exports provided: default */
  3049. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3050. "use strict";
  3051. __webpack_require__.r(__webpack_exports__);
  3052. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M15.677 8.678h2.549c.254 0 .447.05.58.152a.49.49 0 0 1 .201.413.54.54 0 0 1-.159.393c-.105.108-.266.162-.48.162h-3.594c-.245 0-.435-.066-.572-.197a.621.621 0 0 1-.205-.463c0-.114.044-.265.132-.453a1.62 1.62 0 0 1 .288-.444c.433-.436.824-.81 1.172-1.122.348-.312.597-.517.747-.615.267-.183.49-.368.667-.553.177-.185.312-.375.405-.57.093-.194.139-.384.139-.57a1.008 1.008 0 0 0-.554-.917 1.197 1.197 0 0 0-.56-.133c-.426 0-.761.182-1.005.546a2.332 2.332 0 0 0-.164.39 1.609 1.609 0 0 1-.258.488c-.096.114-.237.17-.423.17a.558.558 0 0 1-.405-.156.568.568 0 0 1-.161-.427c0-.218.05-.446.151-.683.101-.238.252-.453.452-.646s.454-.349.762-.467a2.998 2.998 0 0 1 1.081-.178c.498 0 .923.076 1.274.228a1.916 1.916 0 0 1 1.004 1.032 1.984 1.984 0 0 1-.156 1.794c-.2.32-.405.572-.613.754-.208.182-.558.468-1.048.857-.49.39-.826.691-1.008.906a2.703 2.703 0 0 0-.24.309zM7.03 10.349l3.818-3.819a.8.8 0 1 1 1.132 1.132L8.16 11.48l3.819 3.818a.8.8 0 1 1-1.132 1.132L7.03 12.61l-3.818 3.82a.8.8 0 1 1-1.132-1.132L5.9 11.48 2.08 7.662A.8.8 0 1 1 3.212 6.53l3.818 3.82z\"/></svg>");
  3053. /***/ }),
  3054. /***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/underline.svg":
  3055. /*!*********************************************************************************!*\
  3056. !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/underline.svg ***!
  3057. \*********************************************************************************/
  3058. /*! exports provided: default */
  3059. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3060. "use strict";
  3061. __webpack_require__.r(__webpack_exports__);
  3062. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M3 18v-1.5h14V18zm2.2-8V3.6c0-.4.4-.6.8-.6.3 0 .7.2.7.6v6.2c0 2 1.3 2.8 3.2 2.8 1.9 0 3.4-.9 3.4-2.9V3.6c0-.3.4-.5.8-.5.3 0 .7.2.7.5V10c0 2.7-2.2 4-4.9 4-2.6 0-4.7-1.2-4.7-4z\"/></svg>");
  3063. /***/ }),
  3064. /***/ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquote.js":
  3065. /*!************************************************************************!*\
  3066. !*** ./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquote.js ***!
  3067. \************************************************************************/
  3068. /*! exports provided: default */
  3069. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3070. "use strict";
  3071. __webpack_require__.r(__webpack_exports__);
  3072. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlockQuote; });
  3073. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  3074. /* harmony import */ var _blockquoteediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./blockquoteediting */ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteediting.js");
  3075. /* harmony import */ var _blockquoteui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./blockquoteui */ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteui.js");
  3076. /**
  3077. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  3078. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  3079. */
  3080. /**
  3081. * @module block-quote/blockquote
  3082. */
  3083. /**
  3084. * The block quote plugin.
  3085. *
  3086. * For more information about this feature check the {@glink api/block-quote package page}.
  3087. *
  3088. * This is a "glue" plugin which loads the {@link module:block-quote/blockquoteediting~BlockQuoteEditing block quote editing feature}
  3089. * and {@link module:block-quote/blockquoteui~BlockQuoteUI block quote UI feature}.
  3090. *
  3091. * @extends module:core/plugin~Plugin
  3092. */
  3093. class BlockQuote extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  3094. /**
  3095. * @inheritDoc
  3096. */
  3097. static get requires() {
  3098. return [ _blockquoteediting__WEBPACK_IMPORTED_MODULE_1__["default"], _blockquoteui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  3099. }
  3100. /**
  3101. * @inheritDoc
  3102. */
  3103. static get pluginName() {
  3104. return 'BlockQuote';
  3105. }
  3106. }
  3107. /***/ }),
  3108. /***/ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquotecommand.js":
  3109. /*!*******************************************************************************!*\
  3110. !*** ./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquotecommand.js ***!
  3111. \*******************************************************************************/
  3112. /*! exports provided: default */
  3113. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3114. "use strict";
  3115. __webpack_require__.r(__webpack_exports__);
  3116. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlockQuoteCommand; });
  3117. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  3118. /* harmony import */ var _ckeditor_ckeditor5_utils_src_first__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/first */ "./node_modules/@ckeditor/ckeditor5-utils/src/first.js");
  3119. /**
  3120. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  3121. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  3122. */
  3123. /**
  3124. * @module block-quote/blockquotecommand
  3125. */
  3126. /**
  3127. * The block quote command plugin.
  3128. *
  3129. * @extends module:core/command~Command
  3130. */
  3131. class BlockQuoteCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  3132. /**
  3133. * Whether the selection starts in a block quote.
  3134. *
  3135. * @observable
  3136. * @readonly
  3137. * @member {Boolean} #value
  3138. */
  3139. /**
  3140. * @inheritDoc
  3141. */
  3142. refresh() {
  3143. this.value = this._getValue();
  3144. this.isEnabled = this._checkEnabled();
  3145. }
  3146. /**
  3147. * Executes the command. When the command {@link #value is on}, all top-most block quotes within
  3148. * the selection will be removed. If it is off, all selected blocks will be wrapped with
  3149. * a block quote.
  3150. *
  3151. * @fires execute
  3152. * @param {Object} [options] Command options.
  3153. * @param {Boolean} [options.forceValue] If set, it will force the command behavior. If `true`, the command will apply a block quote,
  3154. * otherwise the command will remove the block quote. If not set, the command will act basing on its current value.
  3155. */
  3156. execute( options = {} ) {
  3157. const model = this.editor.model;
  3158. const schema = model.schema;
  3159. const selection = model.document.selection;
  3160. const blocks = Array.from( selection.getSelectedBlocks() );
  3161. const value = ( options.forceValue === undefined ) ? !this.value : options.forceValue;
  3162. model.change( writer => {
  3163. if ( !value ) {
  3164. this._removeQuote( writer, blocks.filter( findQuote ) );
  3165. } else {
  3166. const blocksToQuote = blocks.filter( block => {
  3167. // Already quoted blocks needs to be considered while quoting too
  3168. // in order to reuse their <bQ> elements.
  3169. return findQuote( block ) || checkCanBeQuoted( schema, block );
  3170. } );
  3171. this._applyQuote( writer, blocksToQuote );
  3172. }
  3173. } );
  3174. }
  3175. /**
  3176. * Checks the command's {@link #value}.
  3177. *
  3178. * @private
  3179. * @returns {Boolean} The current value.
  3180. */
  3181. _getValue() {
  3182. const selection = this.editor.model.document.selection;
  3183. const firstBlock = Object(_ckeditor_ckeditor5_utils_src_first__WEBPACK_IMPORTED_MODULE_1__["default"])( selection.getSelectedBlocks() );
  3184. // In the current implementation, the block quote must be an immediate parent of a block element.
  3185. return !!( firstBlock && findQuote( firstBlock ) );
  3186. }
  3187. /**
  3188. * Checks whether the command can be enabled in the current context.
  3189. *
  3190. * @private
  3191. * @returns {Boolean} Whether the command should be enabled.
  3192. */
  3193. _checkEnabled() {
  3194. if ( this.value ) {
  3195. return true;
  3196. }
  3197. const selection = this.editor.model.document.selection;
  3198. const schema = this.editor.model.schema;
  3199. const firstBlock = Object(_ckeditor_ckeditor5_utils_src_first__WEBPACK_IMPORTED_MODULE_1__["default"])( selection.getSelectedBlocks() );
  3200. if ( !firstBlock ) {
  3201. return false;
  3202. }
  3203. return checkCanBeQuoted( schema, firstBlock );
  3204. }
  3205. /**
  3206. * Removes the quote from given blocks.
  3207. *
  3208. * If blocks which are supposed to be "unquoted" are in the middle of a quote,
  3209. * start it or end it, then the quote will be split (if needed) and the blocks
  3210. * will be moved out of it, so other quoted blocks remained quoted.
  3211. *
  3212. * @private
  3213. * @param {module:engine/model/writer~Writer} writer
  3214. * @param {Array.<module:engine/model/element~Element>} blocks
  3215. */
  3216. _removeQuote( writer, blocks ) {
  3217. // Unquote all groups of block. Iterate in the reverse order to not break following ranges.
  3218. getRangesOfBlockGroups( writer, blocks ).reverse().forEach( groupRange => {
  3219. if ( groupRange.start.isAtStart && groupRange.end.isAtEnd ) {
  3220. writer.unwrap( groupRange.start.parent );
  3221. return;
  3222. }
  3223. // The group of blocks are at the beginning of an <bQ> so let's move them left (out of the <bQ>).
  3224. if ( groupRange.start.isAtStart ) {
  3225. const positionBefore = writer.createPositionBefore( groupRange.start.parent );
  3226. writer.move( groupRange, positionBefore );
  3227. return;
  3228. }
  3229. // The blocks are in the middle of an <bQ> so we need to split the <bQ> after the last block
  3230. // so we move the items there.
  3231. if ( !groupRange.end.isAtEnd ) {
  3232. writer.split( groupRange.end );
  3233. }
  3234. // Now we are sure that groupRange.end.isAtEnd is true, so let's move the blocks right.
  3235. const positionAfter = writer.createPositionAfter( groupRange.end.parent );
  3236. writer.move( groupRange, positionAfter );
  3237. } );
  3238. }
  3239. /**
  3240. * Applies the quote to given blocks.
  3241. *
  3242. * @private
  3243. * @param {module:engine/model/writer~Writer} writer
  3244. * @param {Array.<module:engine/model/element~Element>} blocks
  3245. */
  3246. _applyQuote( writer, blocks ) {
  3247. const quotesToMerge = [];
  3248. // Quote all groups of block. Iterate in the reverse order to not break following ranges.
  3249. getRangesOfBlockGroups( writer, blocks ).reverse().forEach( groupRange => {
  3250. let quote = findQuote( groupRange.start );
  3251. if ( !quote ) {
  3252. quote = writer.createElement( 'blockQuote' );
  3253. writer.wrap( groupRange, quote );
  3254. }
  3255. quotesToMerge.push( quote );
  3256. } );
  3257. // Merge subsequent <bQ> elements. Reverse the order again because this time we want to go through
  3258. // the <bQ> elements in the source order (due to how merge works – it moves the right element's content
  3259. // to the first element and removes the right one. Since we may need to merge a couple of subsequent `<bQ>` elements
  3260. // we want to keep the reference to the first (furthest left) one.
  3261. quotesToMerge.reverse().reduce( ( currentQuote, nextQuote ) => {
  3262. if ( currentQuote.nextSibling == nextQuote ) {
  3263. writer.merge( writer.createPositionAfter( currentQuote ) );
  3264. return currentQuote;
  3265. }
  3266. return nextQuote;
  3267. } );
  3268. }
  3269. }
  3270. function findQuote( elementOrPosition ) {
  3271. return elementOrPosition.parent.name == 'blockQuote' ? elementOrPosition.parent : null;
  3272. }
  3273. // Returns a minimal array of ranges containing groups of subsequent blocks.
  3274. //
  3275. // content: abcdefgh
  3276. // blocks: [ a, b, d, f, g, h ]
  3277. // output ranges: [ab]c[d]e[fgh]
  3278. //
  3279. // @param {Array.<module:engine/model/element~Element>} blocks
  3280. // @returns {Array.<module:engine/model/range~Range>}
  3281. function getRangesOfBlockGroups( writer, blocks ) {
  3282. let startPosition;
  3283. let i = 0;
  3284. const ranges = [];
  3285. while ( i < blocks.length ) {
  3286. const block = blocks[ i ];
  3287. const nextBlock = blocks[ i + 1 ];
  3288. if ( !startPosition ) {
  3289. startPosition = writer.createPositionBefore( block );
  3290. }
  3291. if ( !nextBlock || block.nextSibling != nextBlock ) {
  3292. ranges.push( writer.createRange( startPosition, writer.createPositionAfter( block ) ) );
  3293. startPosition = null;
  3294. }
  3295. i++;
  3296. }
  3297. return ranges;
  3298. }
  3299. // Checks whether <bQ> can wrap the block.
  3300. function checkCanBeQuoted( schema, block ) {
  3301. // TMP will be replaced with schema.checkWrap().
  3302. const isBQAllowed = schema.checkChild( block.parent, 'blockQuote' );
  3303. const isBlockAllowedInBQ = schema.checkChild( [ '$root', 'blockQuote' ], block );
  3304. return isBQAllowed && isBlockAllowedInBQ;
  3305. }
  3306. /***/ }),
  3307. /***/ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteediting.js":
  3308. /*!*******************************************************************************!*\
  3309. !*** ./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteediting.js ***!
  3310. \*******************************************************************************/
  3311. /*! exports provided: default */
  3312. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3313. "use strict";
  3314. __webpack_require__.r(__webpack_exports__);
  3315. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlockQuoteEditing; });
  3316. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  3317. /* harmony import */ var _blockquotecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./blockquotecommand */ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquotecommand.js");
  3318. /**
  3319. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  3320. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  3321. */
  3322. /**
  3323. * @module block-quote/blockquoteediting
  3324. */
  3325. /**
  3326. * The block quote editing.
  3327. *
  3328. * Introduces the `'blockQuote'` command and the `'blockQuote'` model element.
  3329. *
  3330. * @extends module:core/plugin~Plugin
  3331. */
  3332. class BlockQuoteEditing extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  3333. /**
  3334. * @inheritDoc
  3335. */
  3336. static get pluginName() {
  3337. return 'BlockQuoteEditing';
  3338. }
  3339. /**
  3340. * @inheritDoc
  3341. */
  3342. init() {
  3343. const editor = this.editor;
  3344. const schema = editor.model.schema;
  3345. editor.commands.add( 'blockQuote', new _blockquotecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor ) );
  3346. schema.register( 'blockQuote', {
  3347. allowWhere: '$block',
  3348. allowContentOf: '$root'
  3349. } );
  3350. // Disallow blockQuote in blockQuote.
  3351. schema.addChildCheck( ( ctx, childDef ) => {
  3352. if ( ctx.endsWith( 'blockQuote' ) && childDef.name == 'blockQuote' ) {
  3353. return false;
  3354. }
  3355. } );
  3356. editor.conversion.elementToElement( { model: 'blockQuote', view: 'blockquote' } );
  3357. // Postfixer which cleans incorrect model states connected with block quotes.
  3358. editor.model.document.registerPostFixer( writer => {
  3359. const changes = editor.model.document.differ.getChanges();
  3360. for ( const entry of changes ) {
  3361. if ( entry.type == 'insert' ) {
  3362. const element = entry.position.nodeAfter;
  3363. if ( !element ) {
  3364. // We are inside a text node.
  3365. continue;
  3366. }
  3367. if ( element.is( 'element', 'blockQuote' ) && element.isEmpty ) {
  3368. // Added an empty blockQuote - remove it.
  3369. writer.remove( element );
  3370. return true;
  3371. } else if ( element.is( 'element', 'blockQuote' ) && !schema.checkChild( entry.position, element ) ) {
  3372. // Added a blockQuote in incorrect place - most likely inside another blockQuote. Unwrap it
  3373. // so the content inside is not lost.
  3374. writer.unwrap( element );
  3375. return true;
  3376. } else if ( element.is( 'element' ) ) {
  3377. // Just added an element. Check its children to see if there are no nested blockQuotes somewhere inside.
  3378. const range = writer.createRangeIn( element );
  3379. for ( const child of range.getItems() ) {
  3380. if (
  3381. child.is( 'element', 'blockQuote' ) &&
  3382. !schema.checkChild( writer.createPositionBefore( child ), child )
  3383. ) {
  3384. writer.unwrap( child );
  3385. return true;
  3386. }
  3387. }
  3388. }
  3389. } else if ( entry.type == 'remove' ) {
  3390. const parent = entry.position.parent;
  3391. if ( parent.is( 'element', 'blockQuote' ) && parent.isEmpty ) {
  3392. // Something got removed and now blockQuote is empty. Remove the blockQuote as well.
  3393. writer.remove( parent );
  3394. return true;
  3395. }
  3396. }
  3397. }
  3398. return false;
  3399. } );
  3400. }
  3401. /**
  3402. * @inheritDoc
  3403. */
  3404. afterInit() {
  3405. const editor = this.editor;
  3406. const command = editor.commands.get( 'blockQuote' );
  3407. // Overwrite default Enter key behavior.
  3408. // If Enter key is pressed with selection collapsed in empty block inside a quote, break the quote.
  3409. // This listener is added in afterInit in order to register it after list's feature listener.
  3410. // We can't use a priority for this, because 'low' is already used by the enter feature, unless
  3411. // we'd use numeric priority in this case.
  3412. this.listenTo( this.editor.editing.view.document, 'enter', ( evt, data ) => {
  3413. const doc = this.editor.model.document;
  3414. const positionParent = doc.selection.getLastPosition().parent;
  3415. if ( doc.selection.isCollapsed && positionParent.isEmpty && command.value ) {
  3416. this.editor.execute( 'blockQuote' );
  3417. this.editor.editing.view.scrollToTheSelection();
  3418. data.preventDefault();
  3419. evt.stop();
  3420. }
  3421. } );
  3422. }
  3423. }
  3424. /***/ }),
  3425. /***/ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteui.js":
  3426. /*!**************************************************************************!*\
  3427. !*** ./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteui.js ***!
  3428. \**************************************************************************/
  3429. /*! exports provided: default */
  3430. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3431. "use strict";
  3432. __webpack_require__.r(__webpack_exports__);
  3433. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BlockQuoteUI; });
  3434. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  3435. /* harmony import */ var _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  3436. /* harmony import */ var _ckeditor_ckeditor5_core_theme_icons_quote_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/theme/icons/quote.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/quote.svg");
  3437. /* harmony import */ var _theme_blockquote_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../theme/blockquote.css */ "./node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css");
  3438. /* harmony import */ var _theme_blockquote_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_theme_blockquote_css__WEBPACK_IMPORTED_MODULE_3__);
  3439. /**
  3440. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  3441. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  3442. */
  3443. /**
  3444. * @module block-quote/blockquoteui
  3445. */
  3446. /**
  3447. * The block quote UI plugin.
  3448. *
  3449. * It introduces the `'blockQuote'` button.
  3450. *
  3451. * @extends module:core/plugin~Plugin
  3452. */
  3453. class BlockQuoteUI extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  3454. /**
  3455. * @inheritDoc
  3456. */
  3457. init() {
  3458. const editor = this.editor;
  3459. const t = editor.t;
  3460. editor.ui.componentFactory.add( 'blockQuote', locale => {
  3461. const command = editor.commands.get( 'blockQuote' );
  3462. const buttonView = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__["default"]( locale );
  3463. buttonView.set( {
  3464. label: t( 'Block quote' ),
  3465. icon: _ckeditor_ckeditor5_core_theme_icons_quote_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  3466. tooltip: true,
  3467. isToggleable: true
  3468. } );
  3469. // Bind button model to command.
  3470. buttonView.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
  3471. // Execute command.
  3472. this.listenTo( buttonView, 'execute', () => {
  3473. editor.execute( 'blockQuote' );
  3474. editor.editing.view.focus();
  3475. } );
  3476. return buttonView;
  3477. } );
  3478. }
  3479. }
  3480. /***/ }),
  3481. /***/ "./node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css":
  3482. /*!***************************************************************************!*\
  3483. !*** ./node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css ***!
  3484. \***************************************************************************/
  3485. /*! no static exports found */
  3486. /***/ (function(module, exports, __webpack_require__) {
  3487. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  3488. var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./blockquote.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css");
  3489. content = content.__esModule ? content.default : content;
  3490. if (typeof content === 'string') {
  3491. content = [[module.i, content, '']];
  3492. }
  3493. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  3494. options.insert = "head";
  3495. options.singleton = true;
  3496. var update = api(content, options);
  3497. module.exports = content.locals || {};
  3498. /***/ }),
  3499. /***/ "./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfinder.js":
  3500. /*!*******************************************************************!*\
  3501. !*** ./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfinder.js ***!
  3502. \*******************************************************************/
  3503. /*! exports provided: default */
  3504. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3505. "use strict";
  3506. __webpack_require__.r(__webpack_exports__);
  3507. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CKFinder; });
  3508. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  3509. /* harmony import */ var _ckfinderui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ckfinderui */ "./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfinderui.js");
  3510. /* harmony import */ var _ckfinderediting__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ckfinderediting */ "./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfinderediting.js");
  3511. /* harmony import */ var _ckeditor_ckeditor5_adapter_ckfinder_src_uploadadapter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter */ "./node_modules/@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter.js");
  3512. /**
  3513. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  3514. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  3515. */
  3516. /**
  3517. * @module ckfinder/ckfinder
  3518. */
  3519. /**
  3520. * The CKFinder feature, a bridge between the CKEditor 5 WYSIWYG editor and the
  3521. * [CKFinder](https://ckeditor.com/ckfinder) file manager and uploader.
  3522. *
  3523. * This is a "glue" plugin which enables:
  3524. *
  3525. * * {@link module:ckfinder/ckfinderediting~CKFinderEditing},
  3526. * * {@link module:ckfinder/ckfinderui~CKFinderUI},
  3527. * * {@link module:adapter-ckfinder/uploadadapter~CKFinderUploadAdapter}.
  3528. *
  3529. * See the {@glink features/image-upload/ckfinder "CKFinder integration" guide} to learn how to configure
  3530. * and use this feature.
  3531. *
  3532. * Check out the {@glink features/image-upload/image-upload comprehensive "Image upload" guide} to learn about
  3533. * other ways to upload images into CKEditor 5.
  3534. *
  3535. * @extends module:core/plugin~Plugin
  3536. */
  3537. class CKFinder extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  3538. /**
  3539. * @inheritDoc
  3540. */
  3541. static get pluginName() {
  3542. return 'CKFinder';
  3543. }
  3544. /**
  3545. * @inheritDoc
  3546. */
  3547. static get requires() {
  3548. return [ _ckfinderediting__WEBPACK_IMPORTED_MODULE_2__["default"], _ckfinderui__WEBPACK_IMPORTED_MODULE_1__["default"], _ckeditor_ckeditor5_adapter_ckfinder_src_uploadadapter__WEBPACK_IMPORTED_MODULE_3__["default"] ];
  3549. }
  3550. }
  3551. /**
  3552. * The configuration of the {@link module:ckfinder/ckfinder~CKFinder CKFinder feature}.
  3553. *
  3554. * Read more in {@link module:ckfinder/ckfinder~CKFinderConfig}.
  3555. *
  3556. * @member {module:ckfinder/ckfinder~CKFinderConfig} module:core/editor/editorconfig~EditorConfig#ckfinder
  3557. */
  3558. /**
  3559. * The configuration of the {@link module:ckfinder/ckfinder~CKFinder CKFinder feature}
  3560. * and its {@link module:adapter-ckfinder/uploadadapter~CKFinderUploadAdapter upload adapter}.
  3561. *
  3562. * ClassicEditor
  3563. * .create( editorElement, {
  3564. * ckfinder: {
  3565. * options: {
  3566. * resourceType: 'Images'
  3567. * }
  3568. * }
  3569. * } )
  3570. * .then( ... )
  3571. * .catch( ... );
  3572. *
  3573. * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
  3574. *
  3575. * @interface CKFinderConfig
  3576. */
  3577. /**
  3578. * The configuration options passed to the CKFinder file manager instance.
  3579. *
  3580. * Check the file manager [documentation](https://ckeditor.com/docs/ckfinder/ckfinder3/#!/api/CKFinder.Config-cfg-language)
  3581. * for the complete list of options.
  3582. *
  3583. * @member {Object} module:ckfinder/ckfinder~CKFinderConfig#options
  3584. */
  3585. /**
  3586. * The type of the CKFinder opener method.
  3587. *
  3588. * Supported types are:
  3589. *
  3590. * * `'modal'` &ndash; Opens CKFinder in a modal,
  3591. * * `'popup'` &ndash; Opens CKFinder in a new "pop-up" window.
  3592. *
  3593. * Defaults to `'modal'`.
  3594. *
  3595. * @member {String} module:ckfinder/ckfinder~CKFinderConfig#openerMethod
  3596. */
  3597. /**
  3598. * The path (URL) to the connector which handles the file upload in CKFinder file manager.
  3599. * When specified, it enables the automatic upload of resources such as images inserted into the content.
  3600. *
  3601. * For instance, to use CKFinder's
  3602. * [quick upload](https://ckeditor.com/docs/ckfinder/ckfinder3-php/commands.html#command_quick_upload)
  3603. * command, your can use the following (or similar) path:
  3604. *
  3605. * ClassicEditor
  3606. * .create( editorElement, {
  3607. * ckfinder: {
  3608. * uploadUrl: '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files&responseType=json'
  3609. * }
  3610. * } )
  3611. * .then( ... )
  3612. * .catch( ... );
  3613. *
  3614. * Used by the {@link module:adapter-ckfinder/uploadadapter~CKFinderUploadAdapter upload adapter}.
  3615. *
  3616. * @member {String} module:ckfinder/ckfinder~CKFinderConfig#uploadUrl
  3617. */
  3618. /***/ }),
  3619. /***/ "./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfindercommand.js":
  3620. /*!**************************************************************************!*\
  3621. !*** ./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfindercommand.js ***!
  3622. \**************************************************************************/
  3623. /*! exports provided: default */
  3624. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3625. "use strict";
  3626. __webpack_require__.r(__webpack_exports__);
  3627. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CKFinderCommand; });
  3628. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  3629. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  3630. /**
  3631. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  3632. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  3633. */
  3634. /* global window */
  3635. /**
  3636. * @module ckfinder/ckfindercommand
  3637. */
  3638. /**
  3639. * The CKFinder command. It is used by the {@link module:ckfinder/ckfinderediting~CKFinderEditing CKFinder editing feature}
  3640. * to open the CKFinder file manager to insert an image or a link to a file into the editor content.
  3641. *
  3642. * editor.execute( 'ckfinder' );
  3643. *
  3644. * **Note:** This command uses other features to perform tasks:
  3645. * - To insert images the {@link module:image/image/imageinsertcommand~ImageInsertCommand 'imageInsert'} command
  3646. * from the {@link module:image/image~Image Image feature}.
  3647. * - To insert links to files the {@link module:link/linkcommand~LinkCommand 'link'} command
  3648. * from the {@link module:link/link~Link Link feature}.
  3649. *
  3650. * @extends module:core/command~Command
  3651. */
  3652. class CKFinderCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  3653. /**
  3654. * @inheritDoc
  3655. */
  3656. constructor( editor ) {
  3657. super( editor );
  3658. // Remove default document listener to lower its priority.
  3659. this.stopListening( this.editor.model.document, 'change' );
  3660. // Lower this command listener priority to be sure that refresh() will be called after link & image refresh.
  3661. this.listenTo( this.editor.model.document, 'change', () => this.refresh(), { priority: 'low' } );
  3662. }
  3663. /**
  3664. * @inheritDoc
  3665. */
  3666. refresh() {
  3667. const imageCommand = this.editor.commands.get( 'imageInsert' );
  3668. const linkCommand = this.editor.commands.get( 'link' );
  3669. // The CKFinder command is enabled when one of image or link command is enabled.
  3670. this.isEnabled = imageCommand.isEnabled || linkCommand.isEnabled;
  3671. }
  3672. /**
  3673. * @inheritDoc
  3674. */
  3675. execute() {
  3676. const editor = this.editor;
  3677. const openerMethod = this.editor.config.get( 'ckfinder.openerMethod' ) || 'modal';
  3678. if ( openerMethod != 'popup' && openerMethod != 'modal' ) {
  3679. /**
  3680. * The `ckfinder.openerMethod` must be one of: "popup" or "modal".
  3681. *
  3682. * @error ckfinder-unknown-openermethod
  3683. */
  3684. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'ckfinder-unknown-openermethod', editor );
  3685. }
  3686. const options = this.editor.config.get( 'ckfinder.options' ) || {};
  3687. options.chooseFiles = true;
  3688. // Cache the user-defined onInit method
  3689. const originalOnInit = options.onInit;
  3690. // Pass the lang code to the CKFinder if not defined by user.
  3691. if ( !options.language ) {
  3692. options.language = editor.locale.uiLanguage;
  3693. }
  3694. // The onInit method allows to extend CKFinder's behavior. It is used to attach event listeners to file choosing related events.
  3695. options.onInit = finder => {
  3696. // Call original options.onInit if it was defined by user.
  3697. if ( originalOnInit ) {
  3698. originalOnInit( finder );
  3699. }
  3700. finder.on( 'files:choose', evt => {
  3701. const files = evt.data.files.toArray();
  3702. // Insert links
  3703. const links = files.filter( file => !file.isImage() );
  3704. const images = files.filter( file => file.isImage() );
  3705. for ( const linkFile of links ) {
  3706. editor.execute( 'link', linkFile.getUrl() );
  3707. }
  3708. const imagesUrls = [];
  3709. for ( const image of images ) {
  3710. const url = image.getUrl();
  3711. imagesUrls.push( url ? url : finder.request( 'file:getProxyUrl', { file: image } ) );
  3712. }
  3713. if ( imagesUrls.length ) {
  3714. insertImages( editor, imagesUrls );
  3715. }
  3716. } );
  3717. finder.on( 'file:choose:resizedImage', evt => {
  3718. const resizedUrl = evt.data.resizedUrl;
  3719. if ( !resizedUrl ) {
  3720. const notification = editor.plugins.get( 'Notification' );
  3721. const t = editor.locale.t;
  3722. notification.showWarning( t( 'Could not obtain resized image URL.' ), {
  3723. title: t( 'Selecting resized image failed' ),
  3724. namespace: 'ckfinder'
  3725. } );
  3726. return;
  3727. }
  3728. insertImages( editor, [ resizedUrl ] );
  3729. } );
  3730. };
  3731. window.CKFinder[ openerMethod ]( options );
  3732. }
  3733. }
  3734. function insertImages( editor, urls ) {
  3735. const imageCommand = editor.commands.get( 'imageInsert' );
  3736. // Check if inserting an image is actually possible - it might be possible to only insert a link.
  3737. if ( !imageCommand.isEnabled ) {
  3738. const notification = editor.plugins.get( 'Notification' );
  3739. const t = editor.locale.t;
  3740. notification.showWarning( t( 'Could not insert image at the current position.' ), {
  3741. title: t( 'Inserting image failed' ),
  3742. namespace: 'ckfinder'
  3743. } );
  3744. return;
  3745. }
  3746. editor.execute( 'imageInsert', { source: urls } );
  3747. }
  3748. /***/ }),
  3749. /***/ "./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfinderediting.js":
  3750. /*!**************************************************************************!*\
  3751. !*** ./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfinderediting.js ***!
  3752. \**************************************************************************/
  3753. /*! exports provided: default */
  3754. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3755. "use strict";
  3756. __webpack_require__.r(__webpack_exports__);
  3757. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CKFinderEditing; });
  3758. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  3759. /* harmony import */ var _ckeditor_ckeditor5_image_src_image_imageediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-image/src/image/imageediting */ "./node_modules/@ckeditor/ckeditor5-image/src/image/imageediting.js");
  3760. /* harmony import */ var _ckeditor_ckeditor5_link_src_linkediting__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-link/src/linkediting */ "./node_modules/@ckeditor/ckeditor5-link/src/linkediting.js");
  3761. /* harmony import */ var _ckeditor_ckeditor5_ui_src_notification_notification__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/notification/notification */ "./node_modules/@ckeditor/ckeditor5-ui/src/notification/notification.js");
  3762. /* harmony import */ var _ckfindercommand__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ckfindercommand */ "./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfindercommand.js");
  3763. /**
  3764. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  3765. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  3766. */
  3767. /**
  3768. * @module ckfinder/ckfinderediting
  3769. */
  3770. /**
  3771. * The CKFinder editing feature. It introduces the {@link module:ckfinder/ckfindercommand~CKFinderCommand CKFinder command}.
  3772. *
  3773. * @extends module:core/plugin~Plugin
  3774. */
  3775. class CKFinderEditing extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  3776. /**
  3777. * @inheritDoc
  3778. */
  3779. static get pluginName() {
  3780. return 'CKFinderEditing';
  3781. }
  3782. /**
  3783. * @inheritDoc
  3784. */
  3785. static get requires() {
  3786. return [ _ckeditor_ckeditor5_ui_src_notification_notification__WEBPACK_IMPORTED_MODULE_3__["default"], _ckeditor_ckeditor5_image_src_image_imageediting__WEBPACK_IMPORTED_MODULE_1__["default"], _ckeditor_ckeditor5_link_src_linkediting__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  3787. }
  3788. /**
  3789. * @inheritDoc
  3790. */
  3791. init() {
  3792. const editor = this.editor;
  3793. editor.commands.add( 'ckfinder', new _ckfindercommand__WEBPACK_IMPORTED_MODULE_4__["default"]( editor ) );
  3794. }
  3795. }
  3796. /***/ }),
  3797. /***/ "./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfinderui.js":
  3798. /*!*********************************************************************!*\
  3799. !*** ./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfinderui.js ***!
  3800. \*********************************************************************/
  3801. /*! exports provided: default */
  3802. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3803. "use strict";
  3804. __webpack_require__.r(__webpack_exports__);
  3805. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CKFinderUI; });
  3806. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  3807. /* harmony import */ var _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  3808. /* harmony import */ var _theme_icons_browse_files_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../theme/icons/browse-files.svg */ "./node_modules/@ckeditor/ckeditor5-ckfinder/theme/icons/browse-files.svg");
  3809. /**
  3810. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  3811. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  3812. */
  3813. /**
  3814. * @module ckfinder/ckfinderui
  3815. */
  3816. /**
  3817. * The CKFinder UI plugin. It introduces the `'ckfinder'` toolbar button.
  3818. *
  3819. * @extends module:core/plugin~Plugin
  3820. */
  3821. class CKFinderUI extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  3822. /**
  3823. * @inheritDoc
  3824. */
  3825. static get pluginName() {
  3826. return 'CKFinderUI';
  3827. }
  3828. /**
  3829. * @inheritDoc
  3830. */
  3831. init() {
  3832. const editor = this.editor;
  3833. const componentFactory = editor.ui.componentFactory;
  3834. const t = editor.t;
  3835. componentFactory.add( 'ckfinder', locale => {
  3836. const command = editor.commands.get( 'ckfinder' );
  3837. const button = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__["default"]( locale );
  3838. button.set( {
  3839. label: t( 'Insert image or file' ),
  3840. icon: _theme_icons_browse_files_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  3841. tooltip: true
  3842. } );
  3843. button.bind( 'isEnabled' ).to( command );
  3844. button.on( 'execute', () => {
  3845. editor.execute( 'ckfinder' );
  3846. editor.editing.view.focus();
  3847. } );
  3848. return button;
  3849. } );
  3850. }
  3851. }
  3852. /***/ }),
  3853. /***/ "./node_modules/@ckeditor/ckeditor5-ckfinder/theme/icons/browse-files.svg":
  3854. /*!********************************************************************************!*\
  3855. !*** ./node_modules/@ckeditor/ckeditor5-ckfinder/theme/icons/browse-files.svg ***!
  3856. \********************************************************************************/
  3857. /*! exports provided: default */
  3858. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3859. "use strict";
  3860. __webpack_require__.r(__webpack_exports__);
  3861. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M11.627 16.5zm5.873-.196zm0-7.001V8h-13v8.5h4.341c.191.54.457 1.044.785 1.5H2a1.5 1.5 0 0 1-1.5-1.5v-13A1.5 1.5 0 0 1 2 2h4.5a1.5 1.5 0 0 1 1.06.44L9.122 4H16a1.5 1.5 0 0 1 1.5 1.5v1A1.5 1.5 0 0 1 19 8v2.531a6.027 6.027 0 0 0-1.5-1.228zM16 6.5v-1H8.5l-2-2H2v13h1V8a1.5 1.5 0 0 1 1.5-1.5H16z\"/><path d=\"M14.5 19.5a5 5 0 1 1 0-10 5 5 0 0 1 0 10zM15 14v-2h-1v2h-2v1h2v2h1v-2h2v-1h-2z\"/></svg>");
  3862. /***/ }),
  3863. /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboard.js":
  3864. /*!*********************************************************************!*\
  3865. !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboard.js ***!
  3866. \*********************************************************************/
  3867. /*! exports provided: default */
  3868. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3869. "use strict";
  3870. __webpack_require__.r(__webpack_exports__);
  3871. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Clipboard; });
  3872. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  3873. /* harmony import */ var _pasteplaintext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pasteplaintext */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/pasteplaintext.js");
  3874. /* harmony import */ var _clipboardobserver__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./clipboardobserver */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js");
  3875. /* harmony import */ var _utils_plaintexttohtml__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/plaintexttohtml */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/plaintexttohtml.js");
  3876. /* harmony import */ var _utils_normalizeclipboarddata__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/normalizeclipboarddata */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/normalizeclipboarddata.js");
  3877. /* harmony import */ var _utils_viewtoplaintext_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/viewtoplaintext.js */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/viewtoplaintext.js");
  3878. /* harmony import */ var _ckeditor_ckeditor5_engine_src_dataprocessor_htmldataprocessor__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor */ "./node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor.js");
  3879. /* harmony import */ var _ckeditor_ckeditor5_utils_src_eventinfo__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/eventinfo */ "./node_modules/@ckeditor/ckeditor5-utils/src/eventinfo.js");
  3880. /**
  3881. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  3882. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  3883. */
  3884. /**
  3885. * @module clipboard/clipboard
  3886. */
  3887. /**
  3888. * The clipboard feature. It is responsible for intercepting the `paste` and `drop` events and
  3889. * passing the pasted content through the clipboard pipeline in order to insert it into the editor's content.
  3890. * It also handles the `cut` and `copy` events to fill the native clipboard with serialized editor's data.
  3891. *
  3892. * Read more about the clipboard integration in {@glink framework/guides/deep-dive/clipboard "Clipboard" deep dive} guide.
  3893. *
  3894. * @extends module:core/plugin~Plugin
  3895. */
  3896. class Clipboard extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  3897. /**
  3898. * @inheritDoc
  3899. */
  3900. static get pluginName() {
  3901. return 'Clipboard';
  3902. }
  3903. /**
  3904. * @inheritDoc
  3905. */
  3906. static get requires() {
  3907. return [ _pasteplaintext__WEBPACK_IMPORTED_MODULE_1__["default"] ];
  3908. }
  3909. /**
  3910. * @inheritDoc
  3911. */
  3912. init() {
  3913. const editor = this.editor;
  3914. const modelDocument = editor.model.document;
  3915. const view = editor.editing.view;
  3916. const viewDocument = view.document;
  3917. /**
  3918. * Data processor used to convert pasted HTML to a view structure.
  3919. *
  3920. * @private
  3921. * @member {module:engine/dataprocessor/htmldataprocessor~HtmlDataProcessor} #_htmlDataProcessor
  3922. */
  3923. this._htmlDataProcessor = new _ckeditor_ckeditor5_engine_src_dataprocessor_htmldataprocessor__WEBPACK_IMPORTED_MODULE_6__["default"]( viewDocument );
  3924. view.addObserver( _clipboardobserver__WEBPACK_IMPORTED_MODULE_2__["default"] );
  3925. // The clipboard paste pipeline.
  3926. // Pasting and dropping is disabled when editor is read-only.
  3927. // See: https://github.com/ckeditor/ckeditor5-clipboard/issues/26.
  3928. this.listenTo( viewDocument, 'clipboardInput', evt => {
  3929. if ( editor.isReadOnly ) {
  3930. evt.stop();
  3931. }
  3932. }, { priority: 'highest' } );
  3933. this.listenTo( viewDocument, 'clipboardInput', ( evt, data ) => {
  3934. const dataTransfer = data.dataTransfer;
  3935. let content = '';
  3936. if ( dataTransfer.getData( 'text/html' ) ) {
  3937. content = Object(_utils_normalizeclipboarddata__WEBPACK_IMPORTED_MODULE_4__["default"])( dataTransfer.getData( 'text/html' ) );
  3938. } else if ( dataTransfer.getData( 'text/plain' ) ) {
  3939. content = Object(_utils_plaintexttohtml__WEBPACK_IMPORTED_MODULE_3__["default"])( dataTransfer.getData( 'text/plain' ) );
  3940. }
  3941. content = this._htmlDataProcessor.toView( content );
  3942. const eventInfo = new _ckeditor_ckeditor5_utils_src_eventinfo__WEBPACK_IMPORTED_MODULE_7__["default"]( this, 'inputTransformation' );
  3943. this.fire( eventInfo, {
  3944. content,
  3945. dataTransfer,
  3946. asPlainText: data.asPlainText
  3947. } );
  3948. // If CKEditor handled the input, do not bubble the original event any further.
  3949. // This helps external integrations recognize that fact and act accordingly.
  3950. // https://github.com/ckeditor/ckeditor5-upload/issues/92
  3951. if ( eventInfo.stop.called ) {
  3952. evt.stop();
  3953. }
  3954. view.scrollToTheSelection();
  3955. }, { priority: 'low' } );
  3956. this.listenTo( this, 'inputTransformation', ( evt, data ) => {
  3957. if ( !data.content.isEmpty ) {
  3958. const dataController = this.editor.data;
  3959. const model = this.editor.model;
  3960. // Convert the pasted content to a model document fragment.
  3961. // Conversion is contextual, but in this case we need an "all allowed" context and for that
  3962. // we use the $clipboardHolder item.
  3963. const modelFragment = dataController.toModel( data.content, '$clipboardHolder' );
  3964. if ( modelFragment.childCount == 0 ) {
  3965. return;
  3966. }
  3967. // Plain text can be determined based on event flag (#7799) or auto detection (#1006). If detected
  3968. // preserve selection attributes on pasted items.
  3969. if ( data.asPlainText || isPlainTextFragment( modelFragment ) ) {
  3970. // Consider only formatting attributes.
  3971. const textAttributes = new Map( Array.from( modelDocument.selection.getAttributes() ).filter(
  3972. keyValuePair => editor.model.schema.getAttributeProperties( keyValuePair[ 0 ] ).isFormatting
  3973. ) );
  3974. model.change( writer => {
  3975. const range = writer.createRangeIn( modelFragment );
  3976. for ( const item of range.getItems() ) {
  3977. if ( item.is( '$text' ) || item.is( '$textProxy' ) ) {
  3978. writer.setAttributes( textAttributes, item );
  3979. }
  3980. }
  3981. } );
  3982. }
  3983. model.insertContent( modelFragment );
  3984. evt.stop();
  3985. }
  3986. }, { priority: 'low' } );
  3987. // The clipboard copy/cut pipeline.
  3988. function onCopyCut( evt, data ) {
  3989. const dataTransfer = data.dataTransfer;
  3990. data.preventDefault();
  3991. const content = editor.data.toView( editor.model.getSelectedContent( modelDocument.selection ) );
  3992. viewDocument.fire( 'clipboardOutput', { dataTransfer, content, method: evt.name } );
  3993. }
  3994. this.listenTo( viewDocument, 'copy', onCopyCut, { priority: 'low' } );
  3995. this.listenTo( viewDocument, 'cut', ( evt, data ) => {
  3996. // Cutting is disabled when editor is read-only.
  3997. // See: https://github.com/ckeditor/ckeditor5-clipboard/issues/26.
  3998. if ( editor.isReadOnly ) {
  3999. data.preventDefault();
  4000. } else {
  4001. onCopyCut( evt, data );
  4002. }
  4003. }, { priority: 'low' } );
  4004. this.listenTo( viewDocument, 'clipboardOutput', ( evt, data ) => {
  4005. if ( !data.content.isEmpty ) {
  4006. data.dataTransfer.setData( 'text/html', this._htmlDataProcessor.toData( data.content ) );
  4007. data.dataTransfer.setData( 'text/plain', Object(_utils_viewtoplaintext_js__WEBPACK_IMPORTED_MODULE_5__["default"])( data.content ) );
  4008. }
  4009. if ( data.method == 'cut' ) {
  4010. editor.model.deleteContent( modelDocument.selection );
  4011. }
  4012. }, { priority: 'low' } );
  4013. }
  4014. }
  4015. /**
  4016. * Fired with a `content` and `dataTransfer` objects. The `content` which comes from the clipboard (was pasted or dropped)
  4017. * should be processed in order to be inserted into the editor. The `dataTransfer` object is available
  4018. * in case the transformation functions needs access to a raw clipboard data.
  4019. *
  4020. * It is a part of the {@glink framework/guides/deep-dive/clipboard#input-pipeline "clipboard input pipeline"}.
  4021. *
  4022. * @see module:clipboard/clipboardobserver~ClipboardObserver
  4023. * @see module:clipboard/clipboard~Clipboard
  4024. * @event module:clipboard/clipboard~Clipboard#event:inputTransformation
  4025. * @param {Object} data Event data.
  4026. * @param {module:engine/view/documentfragment~DocumentFragment} data.content Event data. Content to be inserted into the editor.
  4027. * It can be modified by the event listeners. Read more about the clipboard pipelines in
  4028. * {@glink framework/guides/deep-dive/clipboard "Clipboard" deep dive}.
  4029. * @param {module:clipboard/datatransfer~DataTransfer} data.dataTransfer Data transfer instance.
  4030. * @param {Boolean} data.asPlainText If set to `true` content is pasted as plain text.
  4031. */
  4032. /**
  4033. * Fired on {@link module:engine/view/document~Document#event:copy} and {@link module:engine/view/document~Document#event:cut}
  4034. * with a copy of selected content. The content can be processed before it ends up in the clipboard.
  4035. *
  4036. * It is a part of the {@glink framework/guides/deep-dive/clipboard#output-pipeline "clipboard output pipeline"}.
  4037. *
  4038. * @see module:clipboard/clipboardobserver~ClipboardObserver
  4039. * @see module:clipboard/clipboard~Clipboard
  4040. * @event module:engine/view/document~Document#event:clipboardOutput
  4041. * @param {module:clipboard/clipboard~ClipboardOutputEventData} data Event data.
  4042. */
  4043. /**
  4044. * The value of the {@link module:engine/view/document~Document#event:clipboardOutput} event.
  4045. *
  4046. * @class module:clipboard/clipboard~ClipboardOutputEventData
  4047. */
  4048. /**
  4049. * Data transfer instance.
  4050. *
  4051. * @readonly
  4052. * @member {module:clipboard/datatransfer~DataTransfer} module:clipboard/clipboard~ClipboardOutputEventData#dataTransfer
  4053. */
  4054. /**
  4055. * Content to be put into the clipboard. It can be modified by the event listeners.
  4056. * Read more about the clipboard pipelines in {@glink framework/guides/deep-dive/clipboard "Clipboard" deep dive}.
  4057. *
  4058. * @member {module:engine/view/documentfragment~DocumentFragment} module:clipboard/clipboard~ClipboardOutputEventData#content
  4059. */
  4060. /**
  4061. * Whether the event was triggered by copy or cut operation.
  4062. *
  4063. * @member {'copy'|'cut'} module:clipboard/clipboard~ClipboardOutputEventData#method
  4064. */
  4065. // Returns true if specified `documentFragment` represents a plain text.
  4066. //
  4067. // @param {module:engine/view/documentfragment~DocumentFragment} documentFragment
  4068. // @returns {Boolean}
  4069. function isPlainTextFragment( documentFragment ) {
  4070. if ( documentFragment.childCount > 1 ) {
  4071. return false;
  4072. }
  4073. const child = documentFragment.getChild( 0 );
  4074. return [ ...child.getAttributeKeys() ].length == 0;
  4075. }
  4076. /***/ }),
  4077. /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js":
  4078. /*!*****************************************************************************!*\
  4079. !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js ***!
  4080. \*****************************************************************************/
  4081. /*! exports provided: default */
  4082. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4083. "use strict";
  4084. __webpack_require__.r(__webpack_exports__);
  4085. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ClipboardObserver; });
  4086. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_observer_domeventobserver__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/observer/domeventobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js");
  4087. /* harmony import */ var _ckeditor_ckeditor5_utils_src_eventinfo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/eventinfo */ "./node_modules/@ckeditor/ckeditor5-utils/src/eventinfo.js");
  4088. /* harmony import */ var _datatransfer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./datatransfer */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/datatransfer.js");
  4089. /**
  4090. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  4091. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4092. */
  4093. /**
  4094. * @module clipboard/clipboardobserver
  4095. */
  4096. /**
  4097. * Clipboard events observer.
  4098. *
  4099. * Fires the following events:
  4100. *
  4101. * * {@link module:engine/view/document~Document#event:clipboardInput}
  4102. * * {@link module:engine/view/document~Document#event:dragover}
  4103. * * {@link module:engine/view/document~Document#event:drop}
  4104. * * {@link module:engine/view/document~Document#event:paste}
  4105. * * {@link module:engine/view/document~Document#event:copy}
  4106. * * {@link module:engine/view/document~Document#event:cut}
  4107. *
  4108. * Note that this observer is not available by default (it is not added by the engine).
  4109. * To make it available it needs to be added to {@link module:engine/view/document~Document} by
  4110. * the {@link module:engine/view/view~View#addObserver `View#addObserver()`} method. You can also load the
  4111. * {@link module:clipboard/clipboard~Clipboard} plugin which adds this observer automatically (because it uses it).
  4112. *
  4113. * @extends module:engine/view/observer/domeventobserver~DomEventObserver
  4114. */
  4115. class ClipboardObserver extends _ckeditor_ckeditor5_engine_src_view_observer_domeventobserver__WEBPACK_IMPORTED_MODULE_0__["default"] {
  4116. constructor( view ) {
  4117. super( view );
  4118. const viewDocument = this.document;
  4119. this.domEventType = [ 'paste', 'copy', 'cut', 'drop', 'dragover' ];
  4120. this.listenTo( viewDocument, 'paste', handleInput, { priority: 'low' } );
  4121. this.listenTo( viewDocument, 'drop', handleInput, { priority: 'low' } );
  4122. function handleInput( evt, data ) {
  4123. data.preventDefault();
  4124. const targetRanges = data.dropRange ? [ data.dropRange ] : Array.from( viewDocument.selection.getRanges() );
  4125. const eventInfo = new _ckeditor_ckeditor5_utils_src_eventinfo__WEBPACK_IMPORTED_MODULE_1__["default"]( viewDocument, 'clipboardInput' );
  4126. viewDocument.fire( eventInfo, {
  4127. dataTransfer: data.dataTransfer,
  4128. targetRanges
  4129. } );
  4130. // If CKEditor handled the input, do not bubble the original event any further.
  4131. // This helps external integrations recognize that fact and act accordingly.
  4132. // https://github.com/ckeditor/ckeditor5-upload/issues/92
  4133. if ( eventInfo.stop.called ) {
  4134. data.stopPropagation();
  4135. }
  4136. }
  4137. }
  4138. onDomEvent( domEvent ) {
  4139. const evtData = {
  4140. dataTransfer: new _datatransfer__WEBPACK_IMPORTED_MODULE_2__["default"]( domEvent.clipboardData ? domEvent.clipboardData : domEvent.dataTransfer )
  4141. };
  4142. if ( domEvent.type == 'drop' ) {
  4143. evtData.dropRange = getDropViewRange( this.view, domEvent );
  4144. }
  4145. this.fire( domEvent.type, domEvent, evtData );
  4146. }
  4147. }
  4148. function getDropViewRange( view, domEvent ) {
  4149. const domDoc = domEvent.target.ownerDocument;
  4150. const x = domEvent.clientX;
  4151. const y = domEvent.clientY;
  4152. let domRange;
  4153. // Webkit & Blink.
  4154. if ( domDoc.caretRangeFromPoint && domDoc.caretRangeFromPoint( x, y ) ) {
  4155. domRange = domDoc.caretRangeFromPoint( x, y );
  4156. }
  4157. // FF.
  4158. else if ( domEvent.rangeParent ) {
  4159. domRange = domDoc.createRange();
  4160. domRange.setStart( domEvent.rangeParent, domEvent.rangeOffset );
  4161. domRange.collapse( true );
  4162. }
  4163. if ( domRange ) {
  4164. return view.domConverter.domRangeToView( domRange );
  4165. } else {
  4166. return view.document.selection.getFirstRange();
  4167. }
  4168. }
  4169. /**
  4170. * Fired as a continuation of {@link #event:paste} and {@link #event:drop} events.
  4171. *
  4172. * It is a part of the {@glink framework/guides/deep-dive/clipboard#input-pipeline "clipboard input pipeline"}.
  4173. *
  4174. * Fired with a `dataTransfer` which comes from the clipboard and which content should be processed
  4175. * and inserted into the editor.
  4176. *
  4177. * Note that this event is not available by default. To make it available {@link module:clipboard/clipboardobserver~ClipboardObserver}
  4178. * needs to be added to {@link module:engine/view/document~Document} by the {@link module:engine/view/view~View#addObserver} method.
  4179. * It's done by the {@link module:clipboard/clipboard~Clipboard} feature. If it's not loaded, it must be done manually.
  4180. *
  4181. * @see module:clipboard/clipboardobserver~ClipboardObserver
  4182. * @see module:clipboard/clipboard~Clipboard
  4183. * @event module:engine/view/document~Document#event:clipboardInput
  4184. * @param {Object} data Event data.
  4185. * @param {module:clipboard/datatransfer~DataTransfer} data.dataTransfer Data transfer instance.
  4186. * @param {Array.<module:engine/view/range~Range>} data.targetRanges Ranges which are the target of the operation
  4187. * (usually – into which the content should be inserted).
  4188. * If clipboard input was triggered by a paste operation, then these are the selection ranges. If by a drop operation,
  4189. * then it's the drop position (which can be different than the selection at the moment of drop).
  4190. */
  4191. /**
  4192. * Fired when user drags content over one of the editables.
  4193. *
  4194. * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
  4195. *
  4196. * Note that this event is not available by default. To make it available {@link module:clipboard/clipboardobserver~ClipboardObserver}
  4197. * needs to be added to {@link module:engine/view/document~Document} by the {@link module:engine/view/view~View#addObserver} method.
  4198. * It's done by the {@link module:clipboard/clipboard~Clipboard} feature. If it's not loaded, it must be done manually.
  4199. *
  4200. * @see module:engine/view/document~Document#event:clipboardInput
  4201. * @event module:engine/view/document~Document#event:dragover
  4202. * @param {module:clipboard/clipboardobserver~ClipboardEventData} data Event data.
  4203. */
  4204. /**
  4205. * Fired when user dropped content into one of the editables.
  4206. *
  4207. * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
  4208. *
  4209. * Note that this event is not available by default. To make it available {@link module:clipboard/clipboardobserver~ClipboardObserver}
  4210. * needs to be added to {@link module:engine/view/document~Document} by the {@link module:engine/view/view~View#addObserver} method.
  4211. * It's done by the {@link module:clipboard/clipboard~Clipboard} feature. If it's not loaded, it must be done manually.
  4212. *
  4213. * @see module:engine/view/document~Document#event:clipboardInput
  4214. * @event module:engine/view/document~Document#event:drop
  4215. * @param {module:clipboard/clipboardobserver~ClipboardEventData} data Event data.
  4216. * @param {module:engine/view/range~Range} dropRange The position into which the content is dropped.
  4217. */
  4218. /**
  4219. * Fired when user pasted content into one of the editables.
  4220. *
  4221. * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
  4222. *
  4223. * Note that this event is not available by default. To make it available {@link module:clipboard/clipboardobserver~ClipboardObserver}
  4224. * needs to be added to {@link module:engine/view/document~Document} by the {@link module:engine/view/view~View#addObserver} method.
  4225. * It's done by the {@link module:clipboard/clipboard~Clipboard} feature. If it's not loaded, it must be done manually.
  4226. *
  4227. * @see module:engine/view/document~Document#event:clipboardInput
  4228. * @event module:engine/view/document~Document#event:paste
  4229. * @param {module:clipboard/clipboardobserver~ClipboardEventData} data Event data.
  4230. */
  4231. /**
  4232. * Fired when user copied content from one of the editables.
  4233. *
  4234. * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
  4235. *
  4236. * Note that this event is not available by default. To make it available {@link module:clipboard/clipboardobserver~ClipboardObserver}
  4237. * needs to be added to {@link module:engine/view/document~Document} by the {@link module:engine/view/view~View#addObserver} method.
  4238. * It's done by the {@link module:clipboard/clipboard~Clipboard} feature. If it's not loaded, it must be done manually.
  4239. *
  4240. * @see module:clipboard/clipboardobserver~ClipboardObserver
  4241. * @event module:engine/view/document~Document#event:copy
  4242. * @param {module:clipboard/clipboardobserver~ClipboardEventData} data Event data.
  4243. */
  4244. /**
  4245. * Fired when user cut content from one of the editables.
  4246. *
  4247. * Introduced by {@link module:clipboard/clipboardobserver~ClipboardObserver}.
  4248. *
  4249. * Note that this event is not available by default. To make it available {@link module:clipboard/clipboardobserver~ClipboardObserver}
  4250. * needs to be added to {@link module:engine/view/document~Document} by the {@link module:engine/view/view~View#addObserver} method.
  4251. * It's done by the {@link module:clipboard/clipboard~Clipboard} feature. If it's not loaded, it must be done manually.
  4252. *
  4253. * @see module:clipboard/clipboardobserver~ClipboardObserver
  4254. * @event module:engine/view/document~Document#event:cut
  4255. * @param {module:clipboard/clipboardobserver~ClipboardEventData} data Event data.
  4256. */
  4257. /**
  4258. * The value of the {@link module:engine/view/document~Document#event:paste},
  4259. * {@link module:engine/view/document~Document#event:copy} and {@link module:engine/view/document~Document#event:cut} events.
  4260. *
  4261. * In order to access clipboard data use `dataTransfer` property.
  4262. *
  4263. * @class module:clipboard/clipboardobserver~ClipboardEventData
  4264. * @extends module:engine/view/observer/domeventdata~DomEventData
  4265. */
  4266. /**
  4267. * Data transfer instance.
  4268. *
  4269. * @readonly
  4270. * @member {module:clipboard/datatransfer~DataTransfer} module:clipboard/clipboardobserver~ClipboardEventData#dataTransfer
  4271. */
  4272. /***/ }),
  4273. /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/datatransfer.js":
  4274. /*!************************************************************************!*\
  4275. !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/datatransfer.js ***!
  4276. \************************************************************************/
  4277. /*! exports provided: default */
  4278. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4279. "use strict";
  4280. __webpack_require__.r(__webpack_exports__);
  4281. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DataTransfer; });
  4282. /**
  4283. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  4284. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4285. */
  4286. /**
  4287. * @module clipboard/datatransfer
  4288. */
  4289. /**
  4290. * Facade over the native [`DataTransfer`](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer) object.
  4291. */
  4292. class DataTransfer {
  4293. constructor( nativeDataTransfer ) {
  4294. /**
  4295. * The array of files created from the native `DataTransfer#files` or `DataTransfer#items`.
  4296. *
  4297. * @readonly
  4298. * @member {Array.<File>} #files
  4299. */
  4300. this.files = getFiles( nativeDataTransfer );
  4301. /**
  4302. * The native DataTransfer object.
  4303. *
  4304. * @private
  4305. * @member {DataTransfer} #_native
  4306. */
  4307. this._native = nativeDataTransfer;
  4308. }
  4309. /**
  4310. * Returns an array of available native content types.
  4311. *
  4312. * @returns {Array.<String>}
  4313. */
  4314. get types() {
  4315. return this._native.types;
  4316. }
  4317. /**
  4318. * Gets data from the data transfer by its mime type.
  4319. *
  4320. * dataTransfer.getData( 'text/plain' );
  4321. *
  4322. * @param {String} type The mime type. E.g. `text/html` or `text/plain`.
  4323. * @returns {String}
  4324. */
  4325. getData( type ) {
  4326. return this._native.getData( type );
  4327. }
  4328. /**
  4329. * Sets data in the data transfer.
  4330. *
  4331. * @param {String} type The mime type. E.g. `text/html` or `text/plain`.
  4332. * @param {String} data
  4333. */
  4334. setData( type, data ) {
  4335. this._native.setData( type, data );
  4336. }
  4337. }
  4338. function getFiles( nativeDataTransfer ) {
  4339. // DataTransfer.files and items are Array-like and might not have an iterable interface.
  4340. const files = nativeDataTransfer.files ? Array.from( nativeDataTransfer.files ) : [];
  4341. const items = nativeDataTransfer.items ? Array.from( nativeDataTransfer.items ) : [];
  4342. if ( files.length ) {
  4343. return files;
  4344. }
  4345. // Chrome have empty DataTransfer.files, but let get files through the items interface.
  4346. return items
  4347. .filter( item => item.kind === 'file' )
  4348. .map( item => item.getAsFile() );
  4349. }
  4350. /***/ }),
  4351. /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/pasteplaintext.js":
  4352. /*!**************************************************************************!*\
  4353. !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/pasteplaintext.js ***!
  4354. \**************************************************************************/
  4355. /*! exports provided: default */
  4356. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4357. "use strict";
  4358. __webpack_require__.r(__webpack_exports__);
  4359. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return PastePlainText; });
  4360. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  4361. /* harmony import */ var _clipboardobserver__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./clipboardobserver */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js");
  4362. /**
  4363. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  4364. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4365. */
  4366. /**
  4367. * @module clipboard/clipboard
  4368. */
  4369. /**
  4370. * The plugin detects user intentions for pasting plain text.
  4371. *
  4372. * For example, it detects <kbd>ctrl/cmd</kbd> + <kbd>shift</kbd> + <kbd>ctrl/v</kbd> keystroke.
  4373. *
  4374. * @extends module:core/plugin~Plugin
  4375. */
  4376. class PastePlainText extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  4377. /**
  4378. * @inheritDoc
  4379. */
  4380. static get pluginName() {
  4381. return 'PastePlainText';
  4382. }
  4383. /**
  4384. * @inheritDoc
  4385. */
  4386. init() {
  4387. const view = this.editor.editing.view;
  4388. const viewDocument = view.document;
  4389. let shiftPressed = false;
  4390. view.addObserver( _clipboardobserver__WEBPACK_IMPORTED_MODULE_1__["default"] );
  4391. this.listenTo( viewDocument, 'keydown', ( evt, data ) => {
  4392. shiftPressed = data.shiftKey;
  4393. } );
  4394. this.listenTo( viewDocument, 'clipboardInput', ( evt, data ) => {
  4395. if ( shiftPressed ) {
  4396. data.asPlainText = true;
  4397. }
  4398. }, { priority: 'high' } );
  4399. }
  4400. }
  4401. /***/ }),
  4402. /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/normalizeclipboarddata.js":
  4403. /*!****************************************************************************************!*\
  4404. !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/normalizeclipboarddata.js ***!
  4405. \****************************************************************************************/
  4406. /*! exports provided: default */
  4407. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4408. "use strict";
  4409. __webpack_require__.r(__webpack_exports__);
  4410. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeClipboardData; });
  4411. /**
  4412. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  4413. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4414. */
  4415. /**
  4416. * @module clipboard/utils/normalizeclipboarddata
  4417. */
  4418. /**
  4419. * Removes some popular browser quirks out of the clipboard data (HTML).
  4420. *
  4421. * @param {String} data The HTML data to normalize.
  4422. * @returns {String} Normalized HTML.
  4423. */
  4424. function normalizeClipboardData( data ) {
  4425. return data
  4426. .replace( /<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g, ( fullMatch, spaces ) => {
  4427. // Handle the most popular and problematic case when even a single space becomes an nbsp;.
  4428. // Decode those to normal spaces. Read more in https://github.com/ckeditor/ckeditor5-clipboard/issues/2.
  4429. if ( spaces.length == 1 ) {
  4430. return ' ';
  4431. }
  4432. return spaces;
  4433. } );
  4434. }
  4435. /***/ }),
  4436. /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/plaintexttohtml.js":
  4437. /*!*********************************************************************************!*\
  4438. !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/plaintexttohtml.js ***!
  4439. \*********************************************************************************/
  4440. /*! exports provided: default */
  4441. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4442. "use strict";
  4443. __webpack_require__.r(__webpack_exports__);
  4444. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return plainTextToHtml; });
  4445. /**
  4446. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  4447. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4448. */
  4449. /**
  4450. * @module clipboard/utils/plaintexttohtml
  4451. */
  4452. /**
  4453. * Converts plain text to its HTML-ized version.
  4454. *
  4455. * @param {String} text The plain text to convert.
  4456. * @returns {String} HTML generated from the plain text.
  4457. */
  4458. function plainTextToHtml( text ) {
  4459. text = text
  4460. // Encode <>.
  4461. .replace( /</g, '&lt;' )
  4462. .replace( />/g, '&gt;' )
  4463. // Creates a paragraph for each double line break.
  4464. .replace( /\r?\n\r?\n/g, '</p><p>' )
  4465. // Creates a line break for each single line break.
  4466. .replace( /\r?\n/g, '<br>' )
  4467. // Preserve trailing spaces (only the first and last one – the rest is handled below).
  4468. .replace( /^\s/, '&nbsp;' )
  4469. .replace( /\s$/, '&nbsp;' )
  4470. // Preserve other subsequent spaces now.
  4471. .replace( /\s\s/g, ' &nbsp;' );
  4472. if ( text.includes( '</p><p>' ) || text.includes( '<br>' ) ) {
  4473. // If we created paragraphs above, add the trailing ones.
  4474. text = `<p>${ text }</p>`;
  4475. }
  4476. // TODO:
  4477. // * What about '\nfoo' vs ' foo'?
  4478. return text;
  4479. }
  4480. /***/ }),
  4481. /***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/viewtoplaintext.js":
  4482. /*!*********************************************************************************!*\
  4483. !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/viewtoplaintext.js ***!
  4484. \*********************************************************************************/
  4485. /*! exports provided: default */
  4486. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4487. "use strict";
  4488. __webpack_require__.r(__webpack_exports__);
  4489. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return viewToPlainText; });
  4490. /**
  4491. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  4492. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4493. */
  4494. /**
  4495. * @module clipboard/utils/viewtoplaintext
  4496. */
  4497. // Elements which should not have empty-line padding.
  4498. // Most `view.ContainerElement` want to be separate by new-line, but some are creating one structure
  4499. // together (like `<li>`) so it is better to separate them by only one "\n".
  4500. const smallPaddingElements = [ 'figcaption', 'li' ];
  4501. /**
  4502. * Converts {@link module:engine/view/item~Item view item} and all of its children to plain text.
  4503. *
  4504. * @param {module:engine/view/item~Item} viewItem View item to convert.
  4505. * @returns {String} Plain text representation of `viewItem`.
  4506. */
  4507. function viewToPlainText( viewItem ) {
  4508. let text = '';
  4509. if ( viewItem.is( '$text' ) || viewItem.is( '$textProxy' ) ) {
  4510. // If item is `Text` or `TextProxy` simple take its text data.
  4511. text = viewItem.data;
  4512. } else if ( viewItem.is( 'element', 'img' ) && viewItem.hasAttribute( 'alt' ) ) {
  4513. // Special case for images - use alt attribute if it is provided.
  4514. text = viewItem.getAttribute( 'alt' );
  4515. } else if ( viewItem.is( 'element', 'br' ) ) {
  4516. // A soft break should be converted into a single line break (#8045).
  4517. text = '\n';
  4518. } else {
  4519. // Other elements are document fragments, attribute elements or container elements.
  4520. // They don't have their own text value, so convert their children.
  4521. let prev = null;
  4522. for ( const child of viewItem.getChildren() ) {
  4523. const childText = viewToPlainText( child );
  4524. // Separate container element children with one or more new-line characters.
  4525. if ( prev && ( prev.is( 'containerElement' ) || child.is( 'containerElement' ) ) ) {
  4526. if ( smallPaddingElements.includes( prev.name ) || smallPaddingElements.includes( child.name ) ) {
  4527. text += '\n';
  4528. } else {
  4529. text += '\n\n';
  4530. }
  4531. }
  4532. text += childText;
  4533. prev = child;
  4534. }
  4535. }
  4536. return text;
  4537. }
  4538. /***/ }),
  4539. /***/ "./node_modules/@ckeditor/ckeditor5-cloud-services/src/cloudservices.js":
  4540. /*!******************************************************************************!*\
  4541. !*** ./node_modules/@ckeditor/ckeditor5-cloud-services/src/cloudservices.js ***!
  4542. \******************************************************************************/
  4543. /*! exports provided: default */
  4544. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4545. "use strict";
  4546. __webpack_require__.r(__webpack_exports__);
  4547. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CloudServices; });
  4548. /* harmony import */ var _ckeditor_ckeditor5_core_src_contextplugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/contextplugin */ "./node_modules/@ckeditor/ckeditor5-core/src/contextplugin.js");
  4549. /* harmony import */ var _ckeditor_ckeditor_cloud_services_core_src_token_token__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor-cloud-services-core/src/token/token */ "./node_modules/@ckeditor/ckeditor-cloud-services-core/src/token/token.js");
  4550. /**
  4551. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  4552. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4553. */
  4554. /**
  4555. * @module cloud-services/cloudservices
  4556. */
  4557. /**
  4558. * Plugin introducing integration between CKEditor 5 and CKEditor Cloud Services .
  4559. *
  4560. * It initializes the token provider based on
  4561. * the {@link module:cloud-services/cloudservices~CloudServicesConfig `config.cloudService`}.
  4562. *
  4563. * @extends module:core/plugin~Plugin
  4564. */
  4565. class CloudServices extends _ckeditor_ckeditor5_core_src_contextplugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  4566. /**
  4567. * @inheritdoc
  4568. */
  4569. static get pluginName() {
  4570. return 'CloudServices';
  4571. }
  4572. /**
  4573. * @inheritDoc
  4574. */
  4575. init() {
  4576. const config = this.context.config;
  4577. const options = config.get( 'cloudServices' ) || {};
  4578. for ( const optionName in options ) {
  4579. this[ optionName ] = options[ optionName ];
  4580. }
  4581. /**
  4582. * The authentication token URL for CKEditor Cloud Services or a callback to the token value promise. See the
  4583. * {@link module:cloud-services/cloudservices~CloudServicesConfig#tokenUrl} for more details.
  4584. *
  4585. * @readonly
  4586. * @member {String|Function|undefined} #tokenUrl
  4587. */
  4588. /**
  4589. * The URL to which the files should be uploaded.
  4590. *
  4591. * @readonly
  4592. * @member {String} #uploadUrl
  4593. */
  4594. /**
  4595. * Other plugins use this token for the authorization process. It handles token requesting and refreshing.
  4596. * Its value is `null` when {@link module:cloud-services/cloudservices~CloudServicesConfig#tokenUrl} is not provided.
  4597. *
  4598. * @readonly
  4599. * @member {Object|null} #token
  4600. */
  4601. if ( !this.tokenUrl ) {
  4602. this.token = null;
  4603. return;
  4604. }
  4605. this.token = new CloudServices.Token( this.tokenUrl );
  4606. return this.token.init();
  4607. }
  4608. /**
  4609. * @inheritDoc
  4610. */
  4611. destroy() {
  4612. super.destroy();
  4613. if ( this.token ) {
  4614. this.token.destroy();
  4615. }
  4616. }
  4617. }
  4618. CloudServices.Token = _ckeditor_ckeditor_cloud_services_core_src_token_token__WEBPACK_IMPORTED_MODULE_1__["default"];
  4619. /**
  4620. * The configuration of CKEditor Cloud Services. Introduced by the {@link module:cloud-services/cloudservices~CloudServices} plugin.
  4621. *
  4622. * Read more in {@link module:cloud-services/cloudservices~CloudServicesConfig}.
  4623. *
  4624. * @member {module:cloud-services/cloudservices~CloudServicesConfig} module:core/editor/editorconfig~EditorConfig#cloudServices
  4625. */
  4626. /**
  4627. * The configuration for all plugins using CKEditor Cloud Services.
  4628. *
  4629. * ClassicEditor
  4630. * .create( document.querySelector( '#editor' ), {
  4631. * cloudServices: {
  4632. * tokenUrl: 'https://example.com/cs-token-endpoint',
  4633. * uploadUrl: 'https://your-organization-id.cke-cs.com/easyimage/upload/'
  4634. * }
  4635. * } )
  4636. * .then( ... )
  4637. * .catch( ... );
  4638. *
  4639. * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
  4640. *
  4641. * @interface CloudServicesConfig
  4642. */
  4643. /**
  4644. * A token URL or a token request function.
  4645. *
  4646. * As a string, it should be a URL to the security token endpoint in your application. The role of this endpoint is to securely authorize
  4647. * the end users of your application to use [CKEditor Cloud Services](https://ckeditor.com/ckeditor-cloud-services) only
  4648. * if they should have access e.g. to upload files with {@glink @cs guides/easy-image/quick-start Easy Image} or to use the
  4649. * {@glink @cs guides/collaboration/quick-start Collaboration} service.
  4650. *
  4651. * ClassicEditor
  4652. * .create( document.querySelector( '#editor' ), {
  4653. * cloudServices: {
  4654. * tokenUrl: 'https://example.com/cs-token-endpoint',
  4655. * ...
  4656. * }
  4657. * } )
  4658. * .then( ... )
  4659. * .catch( ... );
  4660. *
  4661. * As a function, it should provide a promise to the token value, so you can highly customize the token and provide your token URL endpoint.
  4662. * By using this approach you can set your own headers for the request.
  4663. *
  4664. * ClassicEditor
  4665. * .create( document.querySelector( '#editor' ), {
  4666. * cloudServices: {
  4667. * tokenUrl: () => new Promise( ( resolve, reject ) => {
  4668. * const xhr = new XMLHttpRequest();
  4669. *
  4670. * xhr.open( 'GET', 'https://example.com/cs-token-endpoint' );
  4671. *
  4672. * xhr.addEventListener( 'load', () => {
  4673. * const statusCode = xhr.status;
  4674. * const xhrResponse = xhr.response;
  4675. *
  4676. * if ( statusCode < 200 || statusCode > 299 ) {
  4677. * return reject( new Error( 'Cannot download new token!' ) );
  4678. * }
  4679. *
  4680. * return resolve( xhrResponse );
  4681. * } );
  4682. *
  4683. * xhr.addEventListener( 'error', () => reject( new Error( 'Network Error' ) ) );
  4684. * xhr.addEventListener( 'abort', () => reject( new Error( 'Abort' ) ) );
  4685. *
  4686. * xhr.setRequestHeader( customHeader, customValue );
  4687. *
  4688. * xhr.send();
  4689. * } ),
  4690. * ...
  4691. * }
  4692. * } )
  4693. *
  4694. * You can find more information about token endpoints in the
  4695. * {@glink @cs guides/easy-image/quick-start#create-token-endpoint Cloud Services - Quick start}
  4696. * and {@glink @cs guides/security/token-endpoint Cloud Services - Token endpoint} documentation.
  4697. *
  4698. * Without a properly working token endpoint (token URL) CKEditor plugins will not be able to connect to CKEditor Cloud Services.
  4699. *
  4700. * @member {String|Function} module:cloud-services/cloudservices~CloudServicesConfig#tokenUrl
  4701. */
  4702. /**
  4703. * The endpoint URL for [CKEditor Cloud Services](https://ckeditor.com/ckeditor-cloud-services) uploads.
  4704. * This option must be set for Easy Image to work correctly.
  4705. *
  4706. * The upload URL is unique for each customer and can be found in the
  4707. * [CKEditor Ecosystem customer dashboard](https://dashboard.ckeditor.com) after subscribing to the Easy Image service.
  4708. * To learn how to start using Easy Image, check the {@glink @cs guides/easy-image/quick-start Easy Image - Quick start} documentation.
  4709. *
  4710. * Note: Make sure to also set the {@link module:cloud-services/cloudservices~CloudServicesConfig#tokenUrl} configuration option.
  4711. *
  4712. * @member {String} module:cloud-services/cloudservices~CloudServicesConfig#uploadUrl
  4713. */
  4714. /**
  4715. * The URL for web socket communication, used by the `RealTimeCollaborativeEditing` plugin. Every customer (organization in the CKEditor
  4716. * Ecosystem dashboard) has their own, unique URLs to communicate with CKEditor Cloud Services. The URL can be found in the
  4717. * CKEditor Ecosystem customer dashboard.
  4718. *
  4719. * Note: Unlike most plugins, `RealTimeCollaborativeEditing` is not included in any CKEditor 5 build and needs to be installed manually.
  4720. * Check [Collaboration overview](https://ckeditor.com/docs/ckeditor5/latest/features/collaboration/overview.html) for more details.
  4721. *
  4722. * @member {String} module:cloud-services/cloudservices~CloudServicesConfig#webSocketUrl
  4723. */
  4724. /**
  4725. * An optional parameter used for integration with CKEditor Cloud Services when uploading the editor build to cloud services.
  4726. *
  4727. * Whenever the editor build or the configuration changes, this parameter should be set to a new, unique value to differentiate
  4728. * the new bundle (build + configuration) from the old ones.
  4729. *
  4730. * @member {String} module:cloud-services/cloudservices~CloudServicesConfig#bundleVersion
  4731. */
  4732. /***/ }),
  4733. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/command.js":
  4734. /*!**************************************************************!*\
  4735. !*** ./node_modules/@ckeditor/ckeditor5-core/src/command.js ***!
  4736. \**************************************************************/
  4737. /*! exports provided: default */
  4738. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4739. "use strict";
  4740. __webpack_require__.r(__webpack_exports__);
  4741. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Command; });
  4742. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  4743. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  4744. /**
  4745. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  4746. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4747. */
  4748. /**
  4749. * @module core/command
  4750. */
  4751. /**
  4752. * The base class for CKEditor commands.
  4753. *
  4754. * Commands are the main way to manipulate editor contents and state. They are mostly used by UI elements (or by other
  4755. * commands) to make changes in the model. Commands are available in every part of code that has access to
  4756. * the {@link module:core/editor/editor~Editor editor} instance.
  4757. *
  4758. * Instances of registered commands can be retrieved from {@link module:core/editor/editor~Editor#commands `editor.commands`}.
  4759. * The easiest way to execute a command is through {@link module:core/editor/editor~Editor#execute `editor.execute()`}.
  4760. *
  4761. * By default commands are disabled when the editor is in {@link module:core/editor/editor~Editor#isReadOnly read-only} mode.
  4762. *
  4763. * @mixes module:utils/observablemixin~ObservableMixin
  4764. */
  4765. class Command {
  4766. /**
  4767. * Creates a new `Command` instance.
  4768. *
  4769. * @param {module:core/editor/editor~Editor} editor Editor on which this command will be used.
  4770. */
  4771. constructor( editor ) {
  4772. /**
  4773. * The editor on which this command will be used.
  4774. *
  4775. * @readonly
  4776. * @member {module:core/editor/editor~Editor}
  4777. */
  4778. this.editor = editor;
  4779. /**
  4780. * The value of the command. A concrete command class should define what it represents for it.
  4781. *
  4782. * For example, the `'bold'` command's value indicates whether the selection starts in a bolded text.
  4783. * And the value of the `'link'` command may be an object with links details.
  4784. *
  4785. * It is possible for a command to have no value (e.g. for stateless actions such as `'imageUpload'`).
  4786. *
  4787. * A concrete command class should control this value by overriding the {@link #refresh `refresh()`} method.
  4788. *
  4789. * @observable
  4790. * @readonly
  4791. * @member #value
  4792. */
  4793. this.set( 'value', undefined );
  4794. /**
  4795. * Flag indicating whether a command is enabled or disabled.
  4796. * A disabled command will do nothing when executed.
  4797. *
  4798. * A concrete command class should control this value by overriding the {@link #refresh `refresh()`} method.
  4799. *
  4800. * It is possible to disable a command from "outside". For instance, in your integration you may want to disable
  4801. * a certain set of commands for the time being. To do that, you can use the fact that `isEnabled` is observable
  4802. * and it fires the `set:isEnabled` event every time anyone tries to modify its value:
  4803. *
  4804. * function disableCommand( cmd ) {
  4805. * cmd.on( 'set:isEnabled', forceDisable, { priority: 'highest' } );
  4806. *
  4807. * cmd.isEnabled = false;
  4808. *
  4809. * // Make it possible to enable the command again.
  4810. * return () => {
  4811. * cmd.off( 'set:isEnabled', forceDisable );
  4812. * cmd.refresh();
  4813. * };
  4814. *
  4815. * function forceDisable( evt ) {
  4816. * evt.return = false;
  4817. * evt.stop();
  4818. * }
  4819. * }
  4820. *
  4821. * // Usage:
  4822. *
  4823. * // Disabling the command.
  4824. * const enableBold = disableCommand( editor.commands.get( 'bold' ) );
  4825. *
  4826. * // Enabling the command again.
  4827. * enableBold();
  4828. *
  4829. * @observable
  4830. * @readonly
  4831. * @member {Boolean} #isEnabled
  4832. */
  4833. this.set( 'isEnabled', false );
  4834. /**
  4835. * Holds identifiers for {@link #forceDisabled} mechanism.
  4836. *
  4837. * @type {Set.<String>}
  4838. * @private
  4839. */
  4840. this._disableStack = new Set();
  4841. this.decorate( 'execute' );
  4842. // By default every command is refreshed when changes are applied to the model.
  4843. this.listenTo( this.editor.model.document, 'change', () => {
  4844. this.refresh();
  4845. } );
  4846. this.on( 'execute', evt => {
  4847. if ( !this.isEnabled ) {
  4848. evt.stop();
  4849. }
  4850. }, { priority: 'high' } );
  4851. // By default commands are disabled when the editor is in read-only mode.
  4852. this.listenTo( editor, 'change:isReadOnly', ( evt, name, value ) => {
  4853. if ( value ) {
  4854. this.forceDisabled( 'readOnlyMode' );
  4855. } else {
  4856. this.clearForceDisabled( 'readOnlyMode' );
  4857. }
  4858. } );
  4859. }
  4860. /**
  4861. * Refreshes the command. The command should update its {@link #isEnabled} and {@link #value} properties
  4862. * in this method.
  4863. *
  4864. * This method is automatically called when
  4865. * {@link module:engine/model/document~Document#event:change any changes are applied to the document}.
  4866. */
  4867. refresh() {
  4868. this.isEnabled = true;
  4869. }
  4870. /**
  4871. * Disables the command.
  4872. *
  4873. * Command may be disabled by multiple features or algorithms (at once). When disabling a command, unique id should be passed
  4874. * (e.g. feature name). The same identifier should be used when {@link #clearForceDisabled enabling back} the command.
  4875. * The command becomes enabled only after all features {@link #clearForceDisabled enabled it back}.
  4876. *
  4877. * Disabling and enabling a command:
  4878. *
  4879. * command.isEnabled; // -> true
  4880. * command.forceDisabled( 'MyFeature' );
  4881. * command.isEnabled; // -> false
  4882. * command.clearForceDisabled( 'MyFeature' );
  4883. * command.isEnabled; // -> true
  4884. *
  4885. * Command disabled by multiple features:
  4886. *
  4887. * command.forceDisabled( 'MyFeature' );
  4888. * command.forceDisabled( 'OtherFeature' );
  4889. * command.clearForceDisabled( 'MyFeature' );
  4890. * command.isEnabled; // -> false
  4891. * command.clearForceDisabled( 'OtherFeature' );
  4892. * command.isEnabled; // -> true
  4893. *
  4894. * Multiple disabling with the same identifier is redundant:
  4895. *
  4896. * command.forceDisabled( 'MyFeature' );
  4897. * command.forceDisabled( 'MyFeature' );
  4898. * command.clearForceDisabled( 'MyFeature' );
  4899. * command.isEnabled; // -> true
  4900. *
  4901. * **Note:** some commands or algorithms may have more complex logic when it comes to enabling or disabling certain commands,
  4902. * so the command might be still disabled after {@link #clearForceDisabled} was used.
  4903. *
  4904. * @param {String} id Unique identifier for disabling. Use the same id when {@link #clearForceDisabled enabling back} the command.
  4905. */
  4906. forceDisabled( id ) {
  4907. this._disableStack.add( id );
  4908. if ( this._disableStack.size == 1 ) {
  4909. this.on( 'set:isEnabled', forceDisable, { priority: 'highest' } );
  4910. this.isEnabled = false;
  4911. }
  4912. }
  4913. /**
  4914. * Clears forced disable previously set through {@link #forceDisabled}. See {@link #forceDisabled}.
  4915. *
  4916. * @param {String} id Unique identifier, equal to the one passed in {@link #forceDisabled} call.
  4917. */
  4918. clearForceDisabled( id ) {
  4919. this._disableStack.delete( id );
  4920. if ( this._disableStack.size == 0 ) {
  4921. this.off( 'set:isEnabled', forceDisable );
  4922. this.refresh();
  4923. }
  4924. }
  4925. /**
  4926. * Executes the command.
  4927. *
  4928. * A command may accept parameters. They will be passed from {@link module:core/editor/editor~Editor#execute `editor.execute()`}
  4929. * to the command.
  4930. *
  4931. * The `execute()` method will automatically abort when the command is disabled ({@link #isEnabled} is `false`).
  4932. * This behavior is implemented by a high priority listener to the {@link #event:execute} event.
  4933. *
  4934. * In order to see how to disable a command from "outside" see the {@link #isEnabled} documentation.
  4935. *
  4936. * This method may return a value, which would be forwarded all the way down to the
  4937. * {@link module:core/editor/editor~Editor#execute `editor.execute()`}.
  4938. *
  4939. * @fires execute
  4940. */
  4941. execute() {}
  4942. /**
  4943. * Destroys the command.
  4944. */
  4945. destroy() {
  4946. this.stopListening();
  4947. }
  4948. /**
  4949. * Event fired by the {@link #execute} method. The command action is a listener to this event so it's
  4950. * possible to change/cancel the behavior of the command by listening to this event.
  4951. *
  4952. * See {@link module:utils/observablemixin~ObservableMixin#decorate} for more information and samples.
  4953. *
  4954. * **Note:** This event is fired even if command is disabled. However, it is automatically blocked
  4955. * by a high priority listener in order to prevent command execution.
  4956. *
  4957. * @event execute
  4958. */
  4959. }
  4960. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( Command, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
  4961. // Helper function that forces command to be disabled.
  4962. function forceDisable( evt ) {
  4963. evt.return = false;
  4964. evt.stop();
  4965. }
  4966. /***/ }),
  4967. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/commandcollection.js":
  4968. /*!************************************************************************!*\
  4969. !*** ./node_modules/@ckeditor/ckeditor5-core/src/commandcollection.js ***!
  4970. \************************************************************************/
  4971. /*! exports provided: default */
  4972. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4973. "use strict";
  4974. __webpack_require__.r(__webpack_exports__);
  4975. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CommandCollection; });
  4976. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  4977. /**
  4978. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  4979. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4980. */
  4981. /**
  4982. * @module core/commandcollection
  4983. */
  4984. /**
  4985. * Collection of commands. Its instance is available in {@link module:core/editor/editor~Editor#commands `editor.commands`}.
  4986. */
  4987. class CommandCollection {
  4988. /**
  4989. * Creates collection instance.
  4990. */
  4991. constructor() {
  4992. /**
  4993. * Command map.
  4994. *
  4995. * @private
  4996. * @member {Map}
  4997. */
  4998. this._commands = new Map();
  4999. }
  5000. /**
  5001. * Registers a new command.
  5002. *
  5003. * @param {String} commandName The name of the command.
  5004. * @param {module:core/command~Command} command
  5005. */
  5006. add( commandName, command ) {
  5007. this._commands.set( commandName, command );
  5008. }
  5009. /**
  5010. * Retrieves a command from the collection.
  5011. *
  5012. * @param {String} commandName The name of the command.
  5013. * @returns {module:core/command~Command}
  5014. */
  5015. get( commandName ) {
  5016. return this._commands.get( commandName );
  5017. }
  5018. /**
  5019. * Executes a command.
  5020. *
  5021. * @param {String} commandName The name of the command.
  5022. * @param {*} [...commandParams] Command parameters.
  5023. * @returns {*} The value returned by the {@link module:core/command~Command#execute `command.execute()`}.
  5024. */
  5025. execute( commandName, ...args ) {
  5026. const command = this.get( commandName );
  5027. if ( !command ) {
  5028. /**
  5029. * Command does not exist.
  5030. *
  5031. * @error commandcollection-command-not-found
  5032. * @param {String} commandName Name of the command.
  5033. */
  5034. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'commandcollection-command-not-found', this, { commandName } );
  5035. }
  5036. return command.execute( ...args );
  5037. }
  5038. /**
  5039. * Returns iterator of command names.
  5040. *
  5041. * @returns {Iterable.<String>}
  5042. */
  5043. * names() {
  5044. yield* this._commands.keys();
  5045. }
  5046. /**
  5047. * Returns iterator of command instances.
  5048. *
  5049. * @returns {Iterable.<module:core/command~Command>}
  5050. */
  5051. * commands() {
  5052. yield* this._commands.values();
  5053. }
  5054. /**
  5055. * Iterable interface.
  5056. *
  5057. * Returns `[ commandName, commandInstance ]` pairs.
  5058. *
  5059. * @returns {Iterable.<Array>}
  5060. */
  5061. [ Symbol.iterator ]() {
  5062. return this._commands[ Symbol.iterator ]();
  5063. }
  5064. /**
  5065. * Destroys all collection commands.
  5066. */
  5067. destroy() {
  5068. for ( const command of this.commands() ) {
  5069. command.destroy();
  5070. }
  5071. }
  5072. }
  5073. /***/ }),
  5074. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/context.js":
  5075. /*!**************************************************************!*\
  5076. !*** ./node_modules/@ckeditor/ckeditor5-core/src/context.js ***!
  5077. \**************************************************************/
  5078. /*! exports provided: default */
  5079. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5080. "use strict";
  5081. __webpack_require__.r(__webpack_exports__);
  5082. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Context; });
  5083. /* harmony import */ var _ckeditor_ckeditor5_utils_src_config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/config */ "./node_modules/@ckeditor/ckeditor5-utils/src/config.js");
  5084. /* harmony import */ var _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/collection */ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js");
  5085. /* harmony import */ var _plugincollection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./plugincollection */ "./node_modules/@ckeditor/ckeditor5-core/src/plugincollection.js");
  5086. /* harmony import */ var _ckeditor_ckeditor5_utils_src_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/locale */ "./node_modules/@ckeditor/ckeditor5-utils/src/locale.js");
  5087. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  5088. /**
  5089. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  5090. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  5091. */
  5092. /**
  5093. * @module core/context
  5094. */
  5095. /**
  5096. * Provides a common, higher-level environment for solutions that use multiple {@link module:core/editor/editor~Editor editors}
  5097. * or plugins that work outside the editor. Use it instead of {@link module:core/editor/editor~Editor.create `Editor.create()`}
  5098. * in advanced application integrations.
  5099. *
  5100. * All configuration options passed to a context will be used as default options for editor instances initialized in that context.
  5101. *
  5102. * {@link module:core/contextplugin~ContextPlugin Context plugins} passed to a context instance will be shared among all
  5103. * editor instances initialized in this context. These will be the same plugin instances for all the editors.
  5104. *
  5105. * **Note:** The context can only be initialized with {@link module:core/contextplugin~ContextPlugin context plugins}
  5106. * (e.g. [comments](https://ckeditor.com/collaboration/comments/)). Regular {@link module:core/plugin~Plugin plugins} require an
  5107. * editor instance to work and cannot be added to a context.
  5108. *
  5109. * **Note:** You can add a context plugin to an editor instance, though.
  5110. *
  5111. * If you are using multiple editor instances on one page and use any context plugins, create a context to share the configuration and
  5112. * plugins among these editors. Some plugins will use the information about all existing editors to better integrate between them.
  5113. *
  5114. * If you are using plugins that do not require an editor to work (e.g. [comments](https://ckeditor.com/collaboration/comments/)),
  5115. * enable and configure them using the context.
  5116. *
  5117. * If you are using only a single editor on each page, use {@link module:core/editor/editor~Editor.create `Editor.create()`} instead.
  5118. * In such case, a context instance will be created by the editor instance in a transparent way.
  5119. *
  5120. * See {@link module:core/context~Context.create `Context.create()`} for usage examples.
  5121. */
  5122. class Context {
  5123. /**
  5124. * Creates a context instance with a given configuration.
  5125. *
  5126. * Usually not to be used directly. See the static {@link module:core/context~Context.create `create()`} method.
  5127. *
  5128. * @param {Object} [config={}] The context configuration.
  5129. */
  5130. constructor( config ) {
  5131. /**
  5132. * Stores all the configurations specific to this context instance.
  5133. *
  5134. * @readonly
  5135. * @type {module:utils/config~Config}
  5136. */
  5137. this.config = new _ckeditor_ckeditor5_utils_src_config__WEBPACK_IMPORTED_MODULE_0__["default"]( config, this.constructor.defaultConfig );
  5138. const availablePlugins = this.constructor.builtinPlugins;
  5139. this.config.define( 'plugins', availablePlugins );
  5140. /**
  5141. * The plugins loaded and in use by this context instance.
  5142. *
  5143. * @readonly
  5144. * @type {module:core/plugincollection~PluginCollection}
  5145. */
  5146. this.plugins = new _plugincollection__WEBPACK_IMPORTED_MODULE_2__["default"]( this, availablePlugins );
  5147. const languageConfig = this.config.get( 'language' ) || {};
  5148. /**
  5149. * @readonly
  5150. * @type {module:utils/locale~Locale}
  5151. */
  5152. this.locale = new _ckeditor_ckeditor5_utils_src_locale__WEBPACK_IMPORTED_MODULE_3__["default"]( {
  5153. uiLanguage: typeof languageConfig === 'string' ? languageConfig : languageConfig.ui,
  5154. contentLanguage: this.config.get( 'language.content' )
  5155. } );
  5156. /**
  5157. * Shorthand for {@link module:utils/locale~Locale#t}.
  5158. *
  5159. * @see module:utils/locale~Locale#t
  5160. * @method #t
  5161. */
  5162. this.t = this.locale.t;
  5163. /**
  5164. * A list of editors that this context instance is injected to.
  5165. *
  5166. * @readonly
  5167. * @type {module:utils/collection~Collection}
  5168. */
  5169. this.editors = new _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_1__["default"]();
  5170. /**
  5171. * Reference to the editor which created the context.
  5172. * Null when the context was created outside of the editor.
  5173. *
  5174. * It is used to destroy the context when removing the editor that has created the context.
  5175. *
  5176. * @private
  5177. * @type {module:core/editor/editor~Editor|null}
  5178. */
  5179. this._contextOwner = null;
  5180. }
  5181. /**
  5182. * Loads and initializes plugins specified in the configuration.
  5183. *
  5184. * @returns {Promise.<module:core/plugin~LoadedPlugins>} A promise which resolves
  5185. * once the initialization is completed, providing an array of loaded plugins.
  5186. */
  5187. initPlugins() {
  5188. const plugins = this.config.get( 'plugins' ) || [];
  5189. for ( const Plugin of plugins ) {
  5190. if ( typeof Plugin != 'function' ) {
  5191. /**
  5192. * Only a constructor function is allowed as a {@link module:core/contextplugin~ContextPlugin context plugin}.
  5193. *
  5194. * @error context-initplugins-constructor-only
  5195. */
  5196. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
  5197. 'context-initplugins-constructor-only',
  5198. null,
  5199. { Plugin }
  5200. );
  5201. }
  5202. if ( Plugin.isContextPlugin !== true ) {
  5203. /**
  5204. * Only a plugin marked as a {@link module:core/contextplugin~ContextPlugin.isContextPlugin context plugin}
  5205. * is allowed to be used with a context.
  5206. *
  5207. * @error context-initplugins-invalid-plugin
  5208. */
  5209. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
  5210. 'context-initplugins-invalid-plugin',
  5211. null,
  5212. { Plugin }
  5213. );
  5214. }
  5215. }
  5216. return this.plugins.init( plugins );
  5217. }
  5218. /**
  5219. * Destroys the context instance and all editors used with the context,
  5220. * releasing all resources used by the context.
  5221. *
  5222. * @returns {Promise} A promise that resolves once the context instance is fully destroyed.
  5223. */
  5224. destroy() {
  5225. return Promise.all( Array.from( this.editors, editor => editor.destroy() ) )
  5226. .then( () => this.plugins.destroy() );
  5227. }
  5228. /**
  5229. * Adds a reference to the editor which is used with this context.
  5230. *
  5231. * When the given editor has created the context, the reference to this editor will be stored
  5232. * as a {@link ~Context#_contextOwner}.
  5233. *
  5234. * This method should only be used by the editor.
  5235. *
  5236. * @protected
  5237. * @param {module:core/editor/editor~Editor} editor
  5238. * @param {Boolean} isContextOwner Stores the given editor as a context owner.
  5239. */
  5240. _addEditor( editor, isContextOwner ) {
  5241. if ( this._contextOwner ) {
  5242. /**
  5243. * Cannot add multiple editors to the context which is created by the editor.
  5244. *
  5245. * @error context-addeditor-private-context
  5246. */
  5247. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"]( 'context-addeditor-private-context' );
  5248. }
  5249. this.editors.add( editor );
  5250. if ( isContextOwner ) {
  5251. this._contextOwner = editor;
  5252. }
  5253. }
  5254. /**
  5255. * Removes a reference to the editor which was used with this context.
  5256. * When the context was created by the given editor, the context will be destroyed.
  5257. *
  5258. * This method should only be used by the editor.
  5259. *
  5260. * @protected
  5261. * @param {module:core/editor/editor~Editor} editor
  5262. * @return {Promise} A promise that resolves once the editor is removed from the context or when the context was destroyed.
  5263. */
  5264. _removeEditor( editor ) {
  5265. if ( this.editors.has( editor ) ) {
  5266. this.editors.remove( editor );
  5267. }
  5268. if ( this._contextOwner === editor ) {
  5269. return this.destroy();
  5270. }
  5271. return Promise.resolve();
  5272. }
  5273. /**
  5274. * Returns the context configuration which will be copied to the editors created using this context.
  5275. *
  5276. * The configuration returned by this method has the plugins configuration removed &mdash; plugins are shared with all editors
  5277. * through another mechanism.
  5278. *
  5279. * This method should only be used by the editor.
  5280. *
  5281. * @protected
  5282. * @returns {Object} Configuration as a plain object.
  5283. */
  5284. _getEditorConfig() {
  5285. const result = {};
  5286. for ( const name of this.config.names() ) {
  5287. if ( ![ 'plugins', 'removePlugins', 'extraPlugins' ].includes( name ) ) {
  5288. result[ name ] = this.config.get( name );
  5289. }
  5290. }
  5291. return result;
  5292. }
  5293. /**
  5294. * Creates and initializes a new context instance.
  5295. *
  5296. * const commonConfig = { ... }; // Configuration for all the plugins and editors.
  5297. * const editorPlugins = [ ... ]; // Regular plugins here.
  5298. *
  5299. * Context
  5300. * .create( {
  5301. * // Only context plugins here.
  5302. * plugins: [ ... ],
  5303. *
  5304. * // Configure the language for all the editors (it cannot be overwritten).
  5305. * language: { ... },
  5306. *
  5307. * // Configuration for context plugins.
  5308. * comments: { ... },
  5309. * ...
  5310. *
  5311. * // Default configuration for editor plugins.
  5312. * toolbar: { ... },
  5313. * image: { ... },
  5314. * ...
  5315. * } )
  5316. * .then( context => {
  5317. * const promises = [];
  5318. *
  5319. * promises.push( ClassicEditor.create(
  5320. * document.getElementById( 'editor1' ),
  5321. * {
  5322. * editorPlugins,
  5323. * context
  5324. * }
  5325. * ) );
  5326. *
  5327. * promises.push( ClassicEditor.create(
  5328. * document.getElementById( 'editor2' ),
  5329. * {
  5330. * editorPlugins,
  5331. * context,
  5332. * toolbar: { ... } // You can overwrite the configuration of the context.
  5333. * }
  5334. * ) );
  5335. *
  5336. * return Promise.all( promises );
  5337. * } );
  5338. *
  5339. * @param {Object} [config] The context configuration.
  5340. * @returns {Promise} A promise resolved once the context is ready. The promise resolves with the created context instance.
  5341. */
  5342. static create( config ) {
  5343. return new Promise( resolve => {
  5344. const context = new this( config );
  5345. resolve( context.initPlugins().then( () => context ) );
  5346. } );
  5347. }
  5348. }
  5349. /**
  5350. * An array of plugins built into the `Context` class.
  5351. *
  5352. * It is used in CKEditor 5 builds featuring `Context` to provide a list of context plugins which are later automatically initialized
  5353. * during the context initialization.
  5354. *
  5355. * They will be automatically initialized by `Context` unless `config.plugins` is passed.
  5356. *
  5357. * // Build some context plugins into the Context class first.
  5358. * Context.builtinPlugins = [ FooPlugin, BarPlugin ];
  5359. *
  5360. * // Normally, you need to define config.plugins, but since Context.builtinPlugins was
  5361. * // defined, now you can call create() without any configuration.
  5362. * Context
  5363. * .create()
  5364. * .then( context => {
  5365. * context.plugins.get( FooPlugin ); // -> An instance of the Foo plugin.
  5366. * context.plugins.get( BarPlugin ); // -> An instance of the Bar plugin.
  5367. * } );
  5368. *
  5369. * See also {@link module:core/context~Context.defaultConfig `Context.defaultConfig`}
  5370. * and {@link module:core/editor/editor~Editor.builtinPlugins `Editor.builtinPlugins`}.
  5371. *
  5372. * @static
  5373. * @member {Array.<Function>} module:core/context~Context.builtinPlugins
  5374. */
  5375. /**
  5376. * The default configuration which is built into the `Context` class.
  5377. *
  5378. * It is used in CKEditor 5 builds featuring `Context` to provide the default configuration options which are later used during the
  5379. * context initialization.
  5380. *
  5381. * Context.defaultConfig = {
  5382. * foo: 1,
  5383. * bar: 2
  5384. * };
  5385. *
  5386. * Context
  5387. * .create()
  5388. * .then( context => {
  5389. * context.config.get( 'foo' ); // -> 1
  5390. * context.config.get( 'bar' ); // -> 2
  5391. * } );
  5392. *
  5393. * // The default options can be overridden by the configuration passed to create().
  5394. * Context
  5395. * .create( { bar: 3 } )
  5396. * .then( context => {
  5397. * context.config.get( 'foo' ); // -> 1
  5398. * context.config.get( 'bar' ); // -> 3
  5399. * } );
  5400. *
  5401. * See also {@link module:core/context~Context.builtinPlugins `Context.builtinPlugins`}
  5402. * and {@link module:core/editor/editor~Editor.defaultConfig `Editor.defaultConfig`}.
  5403. *
  5404. * @static
  5405. * @member {Object} module:core/context~Context.defaultConfig
  5406. */
  5407. /***/ }),
  5408. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/contextplugin.js":
  5409. /*!********************************************************************!*\
  5410. !*** ./node_modules/@ckeditor/ckeditor5-core/src/contextplugin.js ***!
  5411. \********************************************************************/
  5412. /*! exports provided: default */
  5413. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5414. "use strict";
  5415. __webpack_require__.r(__webpack_exports__);
  5416. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ContextPlugin; });
  5417. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  5418. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  5419. /**
  5420. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  5421. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  5422. */
  5423. /**
  5424. * @module core/contextplugin
  5425. */
  5426. /**
  5427. * The base class for {@link module:core/context~Context} plugin classes.
  5428. *
  5429. * A context plugin can either be initialized for an {@link module:core/editor/editor~Editor editor} or for
  5430. * a {@link module:core/context~Context context}. In other words, it can either
  5431. * work within one editor instance or with one or more editor instances that use a single context.
  5432. * It is the context plugin's role to implement handling for both modes.
  5433. *
  5434. * There are a few rules for interaction between the editor plugins and context plugins:
  5435. *
  5436. * * A context plugin can require another context plugin.
  5437. * * An {@link module:core/plugin~Plugin editor plugin} can require a context plugin.
  5438. * * A context plugin MUST NOT require an {@link module:core/plugin~Plugin editor plugin}.
  5439. *
  5440. * @implements module:core/plugin~PluginInterface
  5441. * @mixes module:utils/observablemixin~ObservableMixin
  5442. */
  5443. class ContextPlugin {
  5444. /**
  5445. * Creates a new plugin instance.
  5446. *
  5447. * @param {module:core/context~Context|module:core/editor/editor~Editor} context
  5448. */
  5449. constructor( context ) {
  5450. /**
  5451. * The context instance.
  5452. *
  5453. * @readonly
  5454. * @type {module:core/context~Context|module:core/editor/editor~Editor}
  5455. */
  5456. this.context = context;
  5457. }
  5458. /**
  5459. * @inheritDoc
  5460. */
  5461. destroy() {
  5462. this.stopListening();
  5463. }
  5464. /**
  5465. * @inheritDoc
  5466. */
  5467. static get isContextPlugin() {
  5468. return true;
  5469. }
  5470. }
  5471. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( ContextPlugin, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
  5472. /***/ }),
  5473. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/editingkeystrokehandler.js":
  5474. /*!******************************************************************************!*\
  5475. !*** ./node_modules/@ckeditor/ckeditor5-core/src/editingkeystrokehandler.js ***!
  5476. \******************************************************************************/
  5477. /*! exports provided: default */
  5478. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5479. "use strict";
  5480. __webpack_require__.r(__webpack_exports__);
  5481. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EditingKeystrokeHandler; });
  5482. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keystrokehandler */ "./node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js");
  5483. /**
  5484. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  5485. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  5486. */
  5487. /**
  5488. * @module core/editingkeystrokehandler
  5489. */
  5490. /**
  5491. * A keystroke handler for editor editing. Its instance is available
  5492. * in {@link module:core/editor/editor~Editor#keystrokes} so plugins
  5493. * can register their keystrokes.
  5494. *
  5495. * E.g. an undo plugin would do this:
  5496. *
  5497. * editor.keystrokes.set( 'Ctrl+Z', 'undo' );
  5498. * editor.keystrokes.set( 'Ctrl+Shift+Z', 'redo' );
  5499. * editor.keystrokes.set( 'Ctrl+Y', 'redo' );
  5500. *
  5501. * @extends module:utils/keystrokehandler~KeystrokeHandler
  5502. */
  5503. class EditingKeystrokeHandler extends _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_0__["default"] {
  5504. /**
  5505. * Creates an instance of the keystroke handler.
  5506. *
  5507. * @param {module:core/editor/editor~Editor} editor
  5508. */
  5509. constructor( editor ) {
  5510. super();
  5511. /**
  5512. * The editor instance.
  5513. *
  5514. * @readonly
  5515. * @member {module:core/editor/editor~Editor}
  5516. */
  5517. this.editor = editor;
  5518. }
  5519. /**
  5520. * Registers a handler for the specified keystroke.
  5521. *
  5522. * The handler can be specified as a command name or a callback.
  5523. *
  5524. * @param {String|Array.<String|Number>} keystroke Keystroke defined in a format accepted by
  5525. * the {@link module:utils/keyboard~parseKeystroke} function.
  5526. * @param {Function|String} callback If a string is passed, then the keystroke will
  5527. * {@link module:core/editor/editor~Editor#execute execute a command}.
  5528. * If a function, then it will be called with the
  5529. * {@link module:engine/view/observer/keyobserver~KeyEventData key event data} object and
  5530. * a `cancel()` helper to both `preventDefault()` and `stopPropagation()` of the event.
  5531. * @param {Object} [options={}] Additional options.
  5532. * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of the keystroke
  5533. * callback. The higher the priority value the sooner the callback will be executed. Keystrokes having the same priority
  5534. * are called in the order they were added.
  5535. */
  5536. set( keystroke, callback, options = {} ) {
  5537. if ( typeof callback == 'string' ) {
  5538. const commandName = callback;
  5539. callback = ( evtData, cancel ) => {
  5540. this.editor.execute( commandName );
  5541. cancel();
  5542. };
  5543. }
  5544. super.set( keystroke, callback, options );
  5545. }
  5546. }
  5547. /***/ }),
  5548. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/editor/editor.js":
  5549. /*!********************************************************************!*\
  5550. !*** ./node_modules/@ckeditor/ckeditor5-core/src/editor/editor.js ***!
  5551. \********************************************************************/
  5552. /*! exports provided: default */
  5553. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5554. "use strict";
  5555. __webpack_require__.r(__webpack_exports__);
  5556. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Editor; });
  5557. /* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../context */ "./node_modules/@ckeditor/ckeditor5-core/src/context.js");
  5558. /* harmony import */ var _ckeditor_ckeditor5_utils_src_config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/config */ "./node_modules/@ckeditor/ckeditor5-utils/src/config.js");
  5559. /* harmony import */ var _ckeditor_ckeditor5_engine_src_controller_editingcontroller__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/controller/editingcontroller */ "./node_modules/@ckeditor/ckeditor5-engine/src/controller/editingcontroller.js");
  5560. /* harmony import */ var _plugincollection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../plugincollection */ "./node_modules/@ckeditor/ckeditor5-core/src/plugincollection.js");
  5561. /* harmony import */ var _commandcollection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../commandcollection */ "./node_modules/@ckeditor/ckeditor5-core/src/commandcollection.js");
  5562. /* harmony import */ var _ckeditor_ckeditor5_engine_src_controller_datacontroller__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/controller/datacontroller */ "./node_modules/@ckeditor/ckeditor5-engine/src/controller/datacontroller.js");
  5563. /* harmony import */ var _ckeditor_ckeditor5_engine_src_conversion_conversion__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/conversion/conversion */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversion.js");
  5564. /* harmony import */ var _ckeditor_ckeditor5_engine_src_model_model__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/model/model */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/model.js");
  5565. /* harmony import */ var _editingkeystrokehandler__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../editingkeystrokehandler */ "./node_modules/@ckeditor/ckeditor5-core/src/editingkeystrokehandler.js");
  5566. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  5567. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  5568. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  5569. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_stylesmap__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/stylesmap */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/stylesmap.js");
  5570. /**
  5571. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  5572. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  5573. */
  5574. /**
  5575. * @module core/editor/editor
  5576. */
  5577. /**
  5578. * The class representing a basic, generic editor.
  5579. *
  5580. * Check out the list of its subclasses to learn about specific editor implementations.
  5581. *
  5582. * All editor implementations (like {@link module:editor-classic/classiceditor~ClassicEditor} or
  5583. * {@link module:editor-inline/inlineeditor~InlineEditor}) should extend this class. They can add their
  5584. * own methods and properties.
  5585. *
  5586. * When you are implementing a plugin, this editor represents the API
  5587. * which your plugin can expect to get when using its {@link module:core/plugin~Plugin#editor} property.
  5588. *
  5589. * This API should be sufficient in order to implement the "editing" part of your feature
  5590. * (schema definition, conversion, commands, keystrokes, etc.).
  5591. * It does not define the editor UI, which is available only if
  5592. * the specific editor implements also the {@link module:core/editor/editorwithui~EditorWithUI} interface
  5593. * (as most editor implementations do).
  5594. *
  5595. * @abstract
  5596. * @mixes module:utils/observablemixin~ObservableMixin
  5597. */
  5598. class Editor {
  5599. /**
  5600. * Creates a new instance of the editor class.
  5601. *
  5602. * Usually, not to be used directly. See the static {@link module:core/editor/editor~Editor.create `create()`} method.
  5603. *
  5604. * @param {Object} [config={}] The editor configuration.
  5605. */
  5606. constructor( config = {} ) {
  5607. /**
  5608. * The editor context.
  5609. * When it is not provided through the configuration, the editor creates it.
  5610. *
  5611. * @protected
  5612. * @type {module:core/context~Context}
  5613. */
  5614. this._context = config.context || new _context__WEBPACK_IMPORTED_MODULE_0__["default"]( { language: config.language } );
  5615. this._context._addEditor( this, !config.context );
  5616. // Clone the plugins to make sure that the plugin array will not be shared
  5617. // between editors and make the watchdog feature work correctly.
  5618. const availablePlugins = Array.from( this.constructor.builtinPlugins || [] );
  5619. /**
  5620. * Stores all configurations specific to this editor instance.
  5621. *
  5622. * editor.config.get( 'image.toolbar' );
  5623. * // -> [ 'imageStyle:full', 'imageStyle:side', '|', 'imageTextAlternative' ]
  5624. *
  5625. * @readonly
  5626. * @member {module:utils/config~Config}
  5627. */
  5628. this.config = new _ckeditor_ckeditor5_utils_src_config__WEBPACK_IMPORTED_MODULE_1__["default"]( config, this.constructor.defaultConfig );
  5629. this.config.define( 'plugins', availablePlugins );
  5630. this.config.define( this._context._getEditorConfig() );
  5631. /**
  5632. * The plugins loaded and in use by this editor instance.
  5633. *
  5634. * editor.plugins.get( 'Clipboard' ); // -> An instance of the clipboard plugin.
  5635. *
  5636. * @readonly
  5637. * @member {module:core/plugincollection~PluginCollection}
  5638. */
  5639. this.plugins = new _plugincollection__WEBPACK_IMPORTED_MODULE_3__["default"]( this, availablePlugins, this._context.plugins );
  5640. /**
  5641. * The locale instance.
  5642. *
  5643. * @readonly
  5644. * @type {module:utils/locale~Locale}
  5645. */
  5646. this.locale = this._context.locale;
  5647. /**
  5648. * Shorthand for {@link module:utils/locale~Locale#t}.
  5649. *
  5650. * @see module:utils/locale~Locale#t
  5651. * @method #t
  5652. */
  5653. this.t = this.locale.t;
  5654. /**
  5655. * Commands registered to the editor.
  5656. *
  5657. * Use the shorthand {@link #execute `editor.execute()`} method to execute commands:
  5658. *
  5659. * // Execute the bold command:
  5660. * editor.execute( 'bold' );
  5661. *
  5662. * // Check the state of the bold command:
  5663. * editor.commands.get( 'bold' ).value;
  5664. *
  5665. * @readonly
  5666. * @member {module:core/commandcollection~CommandCollection}
  5667. */
  5668. this.commands = new _commandcollection__WEBPACK_IMPORTED_MODULE_4__["default"]();
  5669. /**
  5670. * Indicates the editor life-cycle state.
  5671. *
  5672. * The editor is in one of the following states:
  5673. *
  5674. * * `initializing` &ndash; During the editor initialization (before
  5675. * {@link module:core/editor/editor~Editor.create `Editor.create()`}) finished its job.
  5676. * * `ready` &ndash; After the promise returned by the {@link module:core/editor/editor~Editor.create `Editor.create()`}
  5677. * method is resolved.
  5678. * * `destroyed` &ndash; Once the {@link #destroy `editor.destroy()`} method was called.
  5679. *
  5680. * @observable
  5681. * @member {'initializing'|'ready'|'destroyed'} #state
  5682. */
  5683. this.set( 'state', 'initializing' );
  5684. this.once( 'ready', () => ( this.state = 'ready' ), { priority: 'high' } );
  5685. this.once( 'destroy', () => ( this.state = 'destroyed' ), { priority: 'high' } );
  5686. /**
  5687. * Defines whether this editor is in read-only mode.
  5688. *
  5689. * In read-only mode the editor {@link #commands commands} are disabled so it is not possible
  5690. * to modify the document by using them. Also, the editable element(s) become non-editable.
  5691. *
  5692. * In order to make the editor read-only, you can set this value directly:
  5693. *
  5694. * editor.isReadOnly = true;
  5695. *
  5696. * @observable
  5697. * @member {Boolean} #isReadOnly
  5698. */
  5699. this.set( 'isReadOnly', false );
  5700. /**
  5701. * The editor's model.
  5702. *
  5703. * The central point of the editor's abstract data model.
  5704. *
  5705. * @readonly
  5706. * @member {module:engine/model/model~Model}
  5707. */
  5708. this.model = new _ckeditor_ckeditor5_engine_src_model_model__WEBPACK_IMPORTED_MODULE_7__["default"]();
  5709. const stylesProcessor = new _ckeditor_ckeditor5_engine_src_view_stylesmap__WEBPACK_IMPORTED_MODULE_12__["StylesProcessor"]();
  5710. /**
  5711. * The {@link module:engine/controller/datacontroller~DataController data controller}.
  5712. * Used e.g. for setting and retrieving the editor data.
  5713. *
  5714. * @readonly
  5715. * @member {module:engine/controller/datacontroller~DataController}
  5716. */
  5717. this.data = new _ckeditor_ckeditor5_engine_src_controller_datacontroller__WEBPACK_IMPORTED_MODULE_5__["default"]( this.model, stylesProcessor );
  5718. /**
  5719. * The {@link module:engine/controller/editingcontroller~EditingController editing controller}.
  5720. * Controls user input and rendering the content for editing.
  5721. *
  5722. * @readonly
  5723. * @member {module:engine/controller/editingcontroller~EditingController}
  5724. */
  5725. this.editing = new _ckeditor_ckeditor5_engine_src_controller_editingcontroller__WEBPACK_IMPORTED_MODULE_2__["default"]( this.model, stylesProcessor );
  5726. this.editing.view.document.bind( 'isReadOnly' ).to( this );
  5727. /**
  5728. * Conversion manager through which you can register model-to-view and view-to-model converters.
  5729. *
  5730. * See the {@link module:engine/conversion/conversion~Conversion} documentation to learn how to add converters.
  5731. *
  5732. * @readonly
  5733. * @member {module:engine/conversion/conversion~Conversion}
  5734. */
  5735. this.conversion = new _ckeditor_ckeditor5_engine_src_conversion_conversion__WEBPACK_IMPORTED_MODULE_6__["default"]( [ this.editing.downcastDispatcher, this.data.downcastDispatcher ], this.data.upcastDispatcher );
  5736. this.conversion.addAlias( 'dataDowncast', this.data.downcastDispatcher );
  5737. this.conversion.addAlias( 'editingDowncast', this.editing.downcastDispatcher );
  5738. /**
  5739. * An instance of the {@link module:core/editingkeystrokehandler~EditingKeystrokeHandler}.
  5740. *
  5741. * It allows setting simple keystrokes:
  5742. *
  5743. * // Execute the bold command on Ctrl+E:
  5744. * editor.keystrokes.set( 'Ctrl+E', 'bold' );
  5745. *
  5746. * // Execute your own callback:
  5747. * editor.keystrokes.set( 'Ctrl+E', ( data, cancel ) => {
  5748. * console.log( data.keyCode );
  5749. *
  5750. * // Prevent the default (native) action and stop the underlying keydown event
  5751. * // so no other editor feature will interfere.
  5752. * cancel();
  5753. * } );
  5754. *
  5755. * Note: Certain typing-oriented keystrokes (like <kbd>Backspace</kbd> or <kbd>Enter</kbd>) are handled
  5756. * by a low-level mechanism and trying to listen to them via the keystroke handler will not work reliably.
  5757. * To handle these specific keystrokes, see the events fired by the
  5758. * {@link module:engine/view/document~Document editing view document} (`editor.editing.view.document`).
  5759. *
  5760. * @readonly
  5761. * @member {module:core/editingkeystrokehandler~EditingKeystrokeHandler}
  5762. */
  5763. this.keystrokes = new _editingkeystrokehandler__WEBPACK_IMPORTED_MODULE_8__["default"]( this );
  5764. this.keystrokes.listenTo( this.editing.view.document );
  5765. }
  5766. /**
  5767. * Loads and initializes plugins specified in the configuration.
  5768. *
  5769. * @returns {Promise.<module:core/plugin~LoadedPlugins>} A promise which resolves
  5770. * once the initialization is completed, providing an array of loaded plugins.
  5771. */
  5772. initPlugins() {
  5773. const config = this.config;
  5774. const plugins = config.get( 'plugins' );
  5775. const removePlugins = config.get( 'removePlugins' ) || [];
  5776. const extraPlugins = config.get( 'extraPlugins' ) || [];
  5777. return this.plugins.init( plugins.concat( extraPlugins ), removePlugins );
  5778. }
  5779. /**
  5780. * Destroys the editor instance, releasing all resources used by it.
  5781. *
  5782. * **Note** The editor cannot be destroyed during the initialization phase so if it is called
  5783. * while the editor {@link #state is being initialized}, it will wait for the editor initialization before destroying it.
  5784. *
  5785. * @fires destroy
  5786. * @returns {Promise} A promise that resolves once the editor instance is fully destroyed.
  5787. */
  5788. destroy() {
  5789. let readyPromise = Promise.resolve();
  5790. if ( this.state == 'initializing' ) {
  5791. readyPromise = new Promise( resolve => this.once( 'ready', resolve ) );
  5792. }
  5793. return readyPromise
  5794. .then( () => {
  5795. this.fire( 'destroy' );
  5796. this.stopListening();
  5797. this.commands.destroy();
  5798. } )
  5799. .then( () => this.plugins.destroy() )
  5800. .then( () => {
  5801. this.model.destroy();
  5802. this.data.destroy();
  5803. this.editing.destroy();
  5804. this.keystrokes.destroy();
  5805. } )
  5806. // Remove the editor from the context.
  5807. // When the context was created by this editor, the context will be destroyed.
  5808. .then( () => this._context._removeEditor( this ) );
  5809. }
  5810. /**
  5811. * Executes the specified command with given parameters.
  5812. *
  5813. * Shorthand for:
  5814. *
  5815. * editor.commands.get( commandName ).execute( ... );
  5816. *
  5817. * @param {String} commandName The name of the command to execute.
  5818. * @param {*} [...commandParams] Command parameters.
  5819. * @returns {*} The value returned by the {@link module:core/commandcollection~CommandCollection#execute `commands.execute()`}.
  5820. */
  5821. execute( ...args ) {
  5822. try {
  5823. return this.commands.execute( ...args );
  5824. } catch ( err ) {
  5825. // @if CK_DEBUG // throw err;
  5826. /* istanbul ignore next */
  5827. _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_11__["default"].rethrowUnexpectedError( err, this );
  5828. }
  5829. }
  5830. /**
  5831. * Creates and initializes a new editor instance.
  5832. *
  5833. * This is an abstract method. Every editor type needs to implement its own initialization logic.
  5834. *
  5835. * See the `create()` methods of the existing editor types to learn how to use them:
  5836. *
  5837. * * {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`}
  5838. * * {@link module:editor-balloon/ballooneditor~BalloonEditor.create `BalloonEditor.create()`}
  5839. * * {@link module:editor-decoupled/decouplededitor~DecoupledEditor.create `DecoupledEditor.create()`}
  5840. * * {@link module:editor-inline/inlineeditor~InlineEditor.create `InlineEditor.create()`}
  5841. *
  5842. * @abstract
  5843. * @method module:core/editor/editor~Editor.create
  5844. */
  5845. }
  5846. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_10__["default"])( Editor, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_9__["default"] );
  5847. /**
  5848. * Fired when the {@link module:engine/controller/datacontroller~DataController#event:ready data} and all additional
  5849. * editor components are ready.
  5850. *
  5851. * Note: This event is most useful for plugin developers. When integrating the editor with your website or
  5852. * application, you do not have to listen to `editor#ready` because when the promise returned by the static
  5853. * {@link module:core/editor/editor~Editor.create `Editor.create()`} event is resolved, the editor is already ready.
  5854. * In fact, since the first moment when the editor instance is available to you is inside `then()`'s callback,
  5855. * you cannot even add a listener to the `editor#ready` event.
  5856. *
  5857. * See also the {@link #state `editor.state`} property.
  5858. *
  5859. * @event ready
  5860. */
  5861. /**
  5862. * Fired when this editor instance is destroyed. The editor at this point is not usable and this event should be used to
  5863. * perform the clean-up in any plugin.
  5864. *
  5865. *
  5866. * See also the {@link #state `editor.state`} property.
  5867. *
  5868. * @event destroy
  5869. */
  5870. /**
  5871. * This error is thrown when trying to pass a `<textarea>` element to a `create()` function of an editor class.
  5872. *
  5873. * The only editor type which can be initialized on `<textarea>` elements is {@glink builds/guides/overview#classic-editor classic editor}.
  5874. * This editor hides the passed element and inserts its own UI next to it. Other types of editors reuse the passed element as their root
  5875. * editable element and therefore `<textarea>` is not appropriate for them. Use a `<div>` or another text container instead:
  5876. *
  5877. * <div id="editor">
  5878. * <p>Initial content.</p>
  5879. * </div>
  5880. *
  5881. * @error editor-wrong-element
  5882. */
  5883. /**
  5884. * An array of plugins built into this editor class.
  5885. *
  5886. * It is used in CKEditor 5 builds to provide a list of plugins which are later automatically initialized
  5887. * during the editor initialization.
  5888. *
  5889. * They will be automatically initialized by the editor, unless listed in `config.removePlugins` and
  5890. * unless `config.plugins` is passed.
  5891. *
  5892. * // Build some plugins into the editor class first.
  5893. * ClassicEditor.builtinPlugins = [ FooPlugin, BarPlugin ];
  5894. *
  5895. * // Normally, you need to define config.plugins, but since ClassicEditor.builtinPlugins was
  5896. * // defined, now you can call create() without any configuration.
  5897. * ClassicEditor
  5898. * .create( sourceElement )
  5899. * .then( editor => {
  5900. * editor.plugins.get( FooPlugin ); // -> An instance of the Foo plugin.
  5901. * editor.plugins.get( BarPlugin ); // -> An instance of the Bar plugin.
  5902. * } );
  5903. *
  5904. * ClassicEditor
  5905. * .create( sourceElement, {
  5906. * // Do not initialize these plugins (note: it is defined by a string):
  5907. * removePlugins: [ 'Foo' ]
  5908. * } )
  5909. * .then( editor => {
  5910. * editor.plugins.get( FooPlugin ); // -> Undefined.
  5911. * editor.config.get( BarPlugin ); // -> An instance of the Bar plugin.
  5912. * } );
  5913. *
  5914. * ClassicEditor
  5915. * .create( sourceElement, {
  5916. * // Load only this plugin. It can also be defined by a string if
  5917. * // this plugin was built into the editor class.
  5918. * plugins: [ FooPlugin ]
  5919. * } )
  5920. * .then( editor => {
  5921. * editor.plugins.get( FooPlugin ); // -> An instance of the Foo plugin.
  5922. * editor.config.get( BarPlugin ); // -> Undefined.
  5923. * } );
  5924. *
  5925. * See also {@link module:core/editor/editor~Editor.defaultConfig}.
  5926. *
  5927. * @static
  5928. * @member {Array.<Function>} module:core/editor/editor~Editor.builtinPlugins
  5929. */
  5930. /**
  5931. * The default configuration which is built into the editor class.
  5932. *
  5933. * It is used in CKEditor 5 builds to provide the default configuration options which are later used during the editor initialization.
  5934. *
  5935. * ClassicEditor.defaultConfig = {
  5936. * foo: 1,
  5937. * bar: 2
  5938. * };
  5939. *
  5940. * ClassicEditor
  5941. * .create( sourceElement )
  5942. * .then( editor => {
  5943. * editor.config.get( 'foo' ); // -> 1
  5944. * editor.config.get( 'bar' ); // -> 2
  5945. * } );
  5946. *
  5947. * // The default options can be overridden by the configuration passed to create().
  5948. * ClassicEditor
  5949. * .create( sourceElement, { bar: 3 } )
  5950. * .then( editor => {
  5951. * editor.config.get( 'foo' ); // -> 1
  5952. * editor.config.get( 'bar' ); // -> 3
  5953. * } );
  5954. *
  5955. * See also {@link module:core/editor/editor~Editor.builtinPlugins}.
  5956. *
  5957. * @static
  5958. * @member {Object} module:core/editor/editor~Editor.defaultConfig
  5959. */
  5960. /***/ }),
  5961. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/editor/editorui.js":
  5962. /*!**********************************************************************!*\
  5963. !*** ./node_modules/@ckeditor/ckeditor5-core/src/editor/editorui.js ***!
  5964. \**********************************************************************/
  5965. /*! exports provided: default */
  5966. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5967. "use strict";
  5968. __webpack_require__.r(__webpack_exports__);
  5969. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EditorUI; });
  5970. /* harmony import */ var _ckeditor_ckeditor5_ui_src_componentfactory__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/componentfactory */ "./node_modules/@ckeditor/ckeditor5-ui/src/componentfactory.js");
  5971. /* harmony import */ var _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/focustracker */ "./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js");
  5972. /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  5973. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  5974. /**
  5975. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  5976. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  5977. */
  5978. /**
  5979. * @module core/editor/editorui
  5980. */
  5981. /* globals console */
  5982. /**
  5983. * A class providing the minimal interface that is required to successfully bootstrap any editor UI.
  5984. *
  5985. * @mixes module:utils/emittermixin~EmitterMixin
  5986. */
  5987. class EditorUI {
  5988. /**
  5989. * Creates an instance of the editor UI class.
  5990. *
  5991. * @param {module:core/editor/editor~Editor} editor The editor instance.
  5992. */
  5993. constructor( editor ) {
  5994. /**
  5995. * The editor that the UI belongs to.
  5996. *
  5997. * @readonly
  5998. * @member {module:core/editor/editor~Editor} #editor
  5999. */
  6000. this.editor = editor;
  6001. /**
  6002. * An instance of the {@link module:ui/componentfactory~ComponentFactory}, a registry used by plugins
  6003. * to register factories of specific UI components.
  6004. *
  6005. * @readonly
  6006. * @member {module:ui/componentfactory~ComponentFactory} #componentFactory
  6007. */
  6008. this.componentFactory = new _ckeditor_ckeditor5_ui_src_componentfactory__WEBPACK_IMPORTED_MODULE_0__["default"]( editor );
  6009. /**
  6010. * Stores the information about the editor UI focus and propagates it so various plugins and components
  6011. * are unified as a focus group.
  6012. *
  6013. * @readonly
  6014. * @member {module:utils/focustracker~FocusTracker} #focusTracker
  6015. */
  6016. this.focusTracker = new _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_1__["default"]();
  6017. /**
  6018. * Stores all editable elements used by the editor instance.
  6019. *
  6020. * @private
  6021. * @member {Map.<String,HTMLElement>}
  6022. */
  6023. this._editableElementsMap = new Map();
  6024. // Informs UI components that should be refreshed after layout change.
  6025. this.listenTo( editor.editing.view.document, 'layoutChanged', () => this.update() );
  6026. }
  6027. /**
  6028. * The main (outermost) DOM element of the editor UI.
  6029. *
  6030. * For example, in {@link module:editor-classic/classiceditor~ClassicEditor} it is a `<div>` which
  6031. * wraps the editable element and the toolbar. In {@link module:editor-inline/inlineeditor~InlineEditor}
  6032. * it is the editable element itself (as there is no other wrapper). However, in
  6033. * {@link module:editor-decoupled/decouplededitor~DecoupledEditor} it is set to `null` because this editor does not
  6034. * come with a single "main" HTML element (its editable element and toolbar are separate).
  6035. *
  6036. * This property can be understood as a shorthand for retrieving the element that a specific editor integration
  6037. * considers to be its main DOM element.
  6038. *
  6039. * @readonly
  6040. * @member {HTMLElement|null} #element
  6041. */
  6042. get element() {
  6043. return null;
  6044. }
  6045. /**
  6046. * Fires the {@link module:core/editor/editorui~EditorUI#event:update `update`} event.
  6047. *
  6048. * This method should be called when the editor UI (e.g. positions of its balloons) needs to be updated due to
  6049. * some environmental change which CKEditor 5 is not aware of (e.g. resize of a container in which it is used).
  6050. */
  6051. update() {
  6052. this.fire( 'update' );
  6053. }
  6054. /**
  6055. * Destroys the UI.
  6056. */
  6057. destroy() {
  6058. this.stopListening();
  6059. this.focusTracker.destroy();
  6060. // Clean–up the references to the CKEditor instance stored in the native editable DOM elements.
  6061. for ( const domElement of this._editableElementsMap.values() ) {
  6062. domElement.ckeditorInstance = null;
  6063. }
  6064. this._editableElementsMap = new Map();
  6065. }
  6066. /**
  6067. * Store the native DOM editable element used by the editor under
  6068. * a unique name.
  6069. *
  6070. * @param {String} rootName The unique name of the editable element.
  6071. * @param {HTMLElement} domElement The native DOM editable element.
  6072. */
  6073. setEditableElement( rootName, domElement ) {
  6074. this._editableElementsMap.set( rootName, domElement );
  6075. // Put a reference to the CKEditor instance in the editable native DOM element.
  6076. // It helps 3rd–party software (browser extensions, other libraries) access and recognize
  6077. // CKEditor 5 instances (editing roots) and use their API (there is no global editor
  6078. // instance registry).
  6079. if ( !domElement.ckeditorInstance ) {
  6080. domElement.ckeditorInstance = this.editor;
  6081. }
  6082. }
  6083. /**
  6084. * Returns the editable editor element with the given name or null if editable does not exist.
  6085. *
  6086. * @param {String} [rootName=main] The editable name.
  6087. * @returns {HTMLElement|undefined}
  6088. */
  6089. getEditableElement( rootName = 'main' ) {
  6090. return this._editableElementsMap.get( rootName );
  6091. }
  6092. /**
  6093. * Returns array of names of all editor editable elements.
  6094. *
  6095. * @returns {Iterable.<String>}
  6096. */
  6097. getEditableElementsNames() {
  6098. return this._editableElementsMap.keys();
  6099. }
  6100. /**
  6101. * Stores all editable elements used by the editor instance.
  6102. *
  6103. * @protected
  6104. * @deprecated
  6105. * @member {Map.<String,HTMLElement>}
  6106. */
  6107. get _editableElements() {
  6108. /**
  6109. * The {@link module:core/editor/editorui~EditorUI#_editableElements `EditorUI#_editableElements`} property has been
  6110. * deprecated and will be removed in the near future. Please use {@link #setEditableElement `setEditableElement()`} and
  6111. * {@link #getEditableElement `getEditableElement()`} methods instead.
  6112. *
  6113. * @error editor-ui-deprecated-editable-elements
  6114. * @param {module:core/editor/editorui~EditorUI} editorUI Editor UI instance the deprecated property belongs to.
  6115. */
  6116. console.warn(
  6117. 'editor-ui-deprecated-editable-elements: ' +
  6118. 'The EditorUI#_editableElements property has been deprecated and will be removed in the near future.',
  6119. { editorUI: this } );
  6120. return this._editableElementsMap;
  6121. }
  6122. /**
  6123. * Fired when the editor UI is ready.
  6124. *
  6125. * Fired before {@link module:engine/controller/datacontroller~DataController#event:ready}.
  6126. *
  6127. * @event ready
  6128. */
  6129. /**
  6130. * Fired whenever the UI (all related components) should be refreshed.
  6131. *
  6132. * **Note:**: The event is fired after each {@link module:engine/view/document~Document#event:layoutChanged}.
  6133. * It can also be fired manually via the {@link module:core/editor/editorui~EditorUI#update} method.
  6134. *
  6135. * @event update
  6136. */
  6137. }
  6138. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_3__["default"])( EditorUI, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_2__["default"] );
  6139. /***/ }),
  6140. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/attachtoform.js":
  6141. /*!********************************************************************************!*\
  6142. !*** ./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/attachtoform.js ***!
  6143. \********************************************************************************/
  6144. /*! exports provided: default */
  6145. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6146. "use strict";
  6147. __webpack_require__.r(__webpack_exports__);
  6148. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return attachToForm; });
  6149. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  6150. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  6151. /**
  6152. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  6153. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  6154. */
  6155. /**
  6156. * @module core/editor/utils/attachtoform
  6157. */
  6158. /**
  6159. * Checks if the editor is initialized on a `<textarea>` element that belongs to a form. If yes, it updates the editor's element
  6160. * content before submitting the form.
  6161. *
  6162. * This helper requires the {@link module:core/editor/utils/elementapimixin~ElementApi ElementApi interface}.
  6163. *
  6164. * @param {module:core/editor/editor~Editor} editor Editor instance.
  6165. */
  6166. function attachToForm( editor ) {
  6167. if ( !Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isFunction"])( editor.updateSourceElement ) ) {
  6168. /**
  6169. * The editor passed to `attachToForm()` must implement the
  6170. * {@link module:core/editor/utils/elementapimixin~ElementApi} interface.
  6171. *
  6172. * @error attachtoform-missing-elementapi-interface
  6173. */
  6174. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
  6175. 'attachtoform-missing-elementapi-interface',
  6176. editor
  6177. );
  6178. }
  6179. const sourceElement = editor.sourceElement;
  6180. // Only when replacing a textarea which is inside of a form element.
  6181. if ( sourceElement && sourceElement.tagName.toLowerCase() === 'textarea' && sourceElement.form ) {
  6182. let originalSubmit;
  6183. const form = sourceElement.form;
  6184. const onSubmit = () => editor.updateSourceElement();
  6185. // Replace the original form#submit() to call a custom submit function first.
  6186. // Check if #submit is a function because the form might have an input named "submit".
  6187. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isFunction"])( form.submit ) ) {
  6188. originalSubmit = form.submit;
  6189. form.submit = () => {
  6190. onSubmit();
  6191. originalSubmit.apply( form );
  6192. };
  6193. }
  6194. // Update the replaced textarea with data before each form#submit event.
  6195. form.addEventListener( 'submit', onSubmit );
  6196. // Remove the submit listener and revert the original submit method on
  6197. // editor#destroy.
  6198. editor.on( 'destroy', () => {
  6199. form.removeEventListener( 'submit', onSubmit );
  6200. if ( originalSubmit ) {
  6201. form.submit = originalSubmit;
  6202. }
  6203. } );
  6204. }
  6205. }
  6206. /***/ }),
  6207. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/dataapimixin.js":
  6208. /*!********************************************************************************!*\
  6209. !*** ./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/dataapimixin.js ***!
  6210. \********************************************************************************/
  6211. /*! exports provided: default */
  6212. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6213. "use strict";
  6214. __webpack_require__.r(__webpack_exports__);
  6215. /**
  6216. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  6217. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  6218. */
  6219. /**
  6220. * @module core/editor/utils/dataapimixin
  6221. */
  6222. /**
  6223. * Implementation of the {@link module:core/editor/utils/dataapimixin~DataApi}.
  6224. *
  6225. * @mixin DataApiMixin
  6226. * @implements module:core/editor/utils/dataapimixin~DataApi
  6227. */
  6228. const DataApiMixin = {
  6229. /**
  6230. * @inheritDoc
  6231. */
  6232. setData( data ) {
  6233. this.data.set( data );
  6234. },
  6235. /**
  6236. * @inheritDoc
  6237. */
  6238. getData( options ) {
  6239. return this.data.get( options );
  6240. }
  6241. };
  6242. /* harmony default export */ __webpack_exports__["default"] = (DataApiMixin);
  6243. /**
  6244. * Interface defining editor methods for setting and getting data to and from the editor's main root element
  6245. * using the {@link module:core/editor/editor~Editor#data data pipeline}.
  6246. *
  6247. * This interface is not a part of the {@link module:core/editor/editor~Editor} class because one may want to implement
  6248. * an editor with multiple root elements, in which case the methods for setting and getting data will need to be implemented
  6249. * differently.
  6250. *
  6251. * @interface DataApi
  6252. */
  6253. /**
  6254. * Sets the data in the editor.
  6255. *
  6256. * editor.setData( '<p>This is editor!</p>' );
  6257. *
  6258. * By default the editor accepts HTML. This can be controlled by injecting a different data processor.
  6259. * See the {@glink features/markdown Markdown output} guide for more details.
  6260. *
  6261. * Note: Not only is the format of the data configurable, but the type of the `setData()`'s parameter does not
  6262. * have to be a string either. You can e.g. accept an object or a DOM `DocumentFragment` if you consider this
  6263. * the right format for you.
  6264. *
  6265. * @method #setData
  6266. * @param {String} data Input data.
  6267. */
  6268. /**
  6269. * Gets the data from the editor.
  6270. *
  6271. * editor.getData(); // -> '<p>This is editor!</p>'
  6272. *
  6273. * By default the editor outputs HTML. This can be controlled by injecting a different data processor.
  6274. * See the {@glink features/markdown Markdown output} guide for more details.
  6275. *
  6276. * Note: Not only is the format of the data configurable, but the type of the `getData()`'s return value does not
  6277. * have to be a string either. You can e.g. return an object or a DOM `DocumentFragment` if you consider this
  6278. * the right format for you.
  6279. *
  6280. * @method #getData
  6281. * @param {Object} [options] Additional configuration for the retrieved data.
  6282. * Editor features may introduce more configuration options that can be set through this parameter.
  6283. * @param {String} [options.rootName='main'] Root name.
  6284. * @param {String} [options.trim='empty'] Whether returned data should be trimmed. This option is set to `'empty'` by default,
  6285. * which means that whenever editor content is considered empty, an empty string is returned. To turn off trimming
  6286. * use `'none'`. In such cases exact content will be returned (for example `'<p>&nbsp;</p>'` for an empty editor).
  6287. * @returns {String} Output data.
  6288. */
  6289. /***/ }),
  6290. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/elementapimixin.js":
  6291. /*!***********************************************************************************!*\
  6292. !*** ./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/elementapimixin.js ***!
  6293. \***********************************************************************************/
  6294. /*! exports provided: default */
  6295. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6296. "use strict";
  6297. __webpack_require__.r(__webpack_exports__);
  6298. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  6299. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_setdatainelement__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/setdatainelement */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/setdatainelement.js");
  6300. /**
  6301. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  6302. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  6303. */
  6304. /**
  6305. * @module core/editor/utils/elementapimixin
  6306. */
  6307. /**
  6308. * Implementation of the {@link module:core/editor/utils/elementapimixin~ElementApi}.
  6309. *
  6310. * @mixin ElementApiMixin
  6311. * @implements module:core/editor/utils/elementapimixin~ElementApi
  6312. */
  6313. const ElementApiMixin = {
  6314. /**
  6315. * @inheritDoc
  6316. */
  6317. updateSourceElement() {
  6318. if ( !this.sourceElement ) {
  6319. /**
  6320. * Cannot update the source element of a detached editor.
  6321. *
  6322. * The {@link ~ElementApi#updateSourceElement `updateSourceElement()`} method cannot be called if you did not
  6323. * pass an element to `Editor.create()`.
  6324. *
  6325. * @error editor-missing-sourceelement
  6326. */
  6327. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  6328. 'editor-missing-sourceelement',
  6329. this
  6330. );
  6331. }
  6332. Object(_ckeditor_ckeditor5_utils_src_dom_setdatainelement__WEBPACK_IMPORTED_MODULE_1__["default"])( this.sourceElement, this.data.get() );
  6333. }
  6334. };
  6335. /* harmony default export */ __webpack_exports__["default"] = (ElementApiMixin);
  6336. /**
  6337. * Interface describing an editor that replaced a DOM element (was "initialized on an element").
  6338. *
  6339. * Such an editor should provide a method to
  6340. * {@link module:core/editor/utils/elementapimixin~ElementApi#updateSourceElement update the replaced element with the current data}.
  6341. *
  6342. * @interface ElementApi
  6343. */
  6344. /**
  6345. * The element on which the editor has been initialized.
  6346. *
  6347. * @readonly
  6348. * @member {HTMLElement} #sourceElement
  6349. */
  6350. /**
  6351. * Updates the {@link #sourceElement editor source element}'s content with the data.
  6352. *
  6353. * @method #updateSourceElement
  6354. */
  6355. /***/ }),
  6356. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/multicommand.js":
  6357. /*!*******************************************************************!*\
  6358. !*** ./node_modules/@ckeditor/ckeditor5-core/src/multicommand.js ***!
  6359. \*******************************************************************/
  6360. /*! exports provided: default */
  6361. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6362. "use strict";
  6363. __webpack_require__.r(__webpack_exports__);
  6364. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MultiCommand; });
  6365. /* harmony import */ var _command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  6366. /**
  6367. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  6368. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  6369. */
  6370. /**
  6371. * @module core/multicommand
  6372. */
  6373. /**
  6374. * A CKEditor command that aggregates other commands.
  6375. *
  6376. * This command is used to proxy multiple commands. The multi-command is enabled when
  6377. * at least one of its registered child commands is enabled.
  6378. * When executing a multi-command the first command that is enabled will be executed.
  6379. *
  6380. * const multiCommand = new MultiCommand( editor );
  6381. *
  6382. * const commandFoo = new Command( editor );
  6383. * const commandBar = new Command( editor );
  6384. *
  6385. * // Register child commands.
  6386. * multiCommand.registerChildCommand( commandFoo );
  6387. * multiCommand.registerChildCommand( commandBar );
  6388. *
  6389. * // Enable one of the commands.
  6390. * commandBar.isEnabled = true;
  6391. *
  6392. * multiCommand.execute(); // Will execute commandBar.
  6393. *
  6394. * @extends module:core/command~Command
  6395. */
  6396. class MultiCommand extends _command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  6397. /**
  6398. * @inheritDoc
  6399. */
  6400. constructor( editor ) {
  6401. super( editor );
  6402. /**
  6403. * Registered child commands.
  6404. *
  6405. * @type {Array.<module:core/command~Command>}
  6406. * @private
  6407. */
  6408. this._childCommands = [];
  6409. }
  6410. /**
  6411. * @inheritDoc
  6412. */
  6413. refresh() {
  6414. // Override base command refresh(): the command's state is changed when one of child commands changes states.
  6415. }
  6416. /**
  6417. * Executes the first of it registered child commands.
  6418. *
  6419. * @returns {*} The value returned by the {@link module:core/command~Command#execute `command.execute()`}.
  6420. */
  6421. execute( ...args ) {
  6422. const command = this._getFirstEnabledCommand();
  6423. return command.execute( args );
  6424. }
  6425. /**
  6426. * Registers a child command.
  6427. *
  6428. * @param {module:core/command~Command} command
  6429. */
  6430. registerChildCommand( command ) {
  6431. this._childCommands.push( command );
  6432. // Change multi command enabled state when one of registered commands changes state.
  6433. command.on( 'change:isEnabled', () => this._checkEnabled() );
  6434. this._checkEnabled();
  6435. }
  6436. /**
  6437. * Checks if any of child commands is enabled.
  6438. *
  6439. * @private
  6440. */
  6441. _checkEnabled() {
  6442. this.isEnabled = !!this._getFirstEnabledCommand();
  6443. }
  6444. /**
  6445. * Returns a first enabled command or undefined if none of them is enabled.
  6446. *
  6447. * @returns {module:core/command~Command|undefined}
  6448. * @private
  6449. */
  6450. _getFirstEnabledCommand() {
  6451. return this._childCommands.find( command => command.isEnabled );
  6452. }
  6453. }
  6454. /***/ }),
  6455. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/pendingactions.js":
  6456. /*!*********************************************************************!*\
  6457. !*** ./node_modules/@ckeditor/ckeditor5-core/src/pendingactions.js ***!
  6458. \*********************************************************************/
  6459. /*! exports provided: default */
  6460. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6461. "use strict";
  6462. __webpack_require__.r(__webpack_exports__);
  6463. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return PendingActions; });
  6464. /* harmony import */ var _contextplugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./contextplugin */ "./node_modules/@ckeditor/ckeditor5-core/src/contextplugin.js");
  6465. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  6466. /* harmony import */ var _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/collection */ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js");
  6467. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  6468. /**
  6469. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  6470. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  6471. */
  6472. /**
  6473. * @module core/pendingactions
  6474. */
  6475. /**
  6476. * The list of pending editor actions.
  6477. *
  6478. * This plugin should be used to synchronise plugins that execute long-lasting actions
  6479. * (e.g. file upload) with the editor integration. It gives the developer who integrates the editor
  6480. * an easy way to check if there are any actions pending whenever such information is needed.
  6481. * All plugins that register a pending action also provide a message about the action that is ongoing
  6482. * which can be displayed to the user. This lets them decide if they want to interrupt the action or wait.
  6483. *
  6484. * Adding and updating a pending action:
  6485. *
  6486. * const pendingActions = editor.plugins.get( 'PendingActions' );
  6487. * const action = pendingActions.add( 'Upload in progress: 0%.' );
  6488. *
  6489. * // You can update the message:
  6490. * action.message = 'Upload in progress: 10%.';
  6491. *
  6492. * Removing a pending action:
  6493. *
  6494. * const pendingActions = editor.plugins.get( 'PendingActions' );
  6495. * const action = pendingActions.add( 'Unsaved changes.' );
  6496. *
  6497. * pendingActions.remove( action );
  6498. *
  6499. * Getting pending actions:
  6500. *
  6501. * const pendingActions = editor.plugins.get( 'PendingActions' );
  6502. *
  6503. * const action1 = pendingActions.add( 'Action 1' );
  6504. * const action2 = pendingActions.add( 'Action 2' );
  6505. *
  6506. * pendingActions.first; // Returns action1
  6507. * Array.from( pendingActions ); // Returns [ action1, action2 ]
  6508. *
  6509. * This plugin is used by features like {@link module:upload/filerepository~FileRepository} to register their ongoing actions
  6510. * and by features like {@link module:autosave/autosave~Autosave} to detect whether there are any ongoing actions.
  6511. * Read more about saving the data in the {@glink builds/guides/integration/saving-data Saving and getting data} guide.
  6512. *
  6513. * @extends module:core/contextplugin~ContextPlugin
  6514. */
  6515. class PendingActions extends _contextplugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  6516. /**
  6517. * @inheritDoc
  6518. */
  6519. static get pluginName() {
  6520. return 'PendingActions';
  6521. }
  6522. /**
  6523. * @inheritDoc
  6524. */
  6525. init() {
  6526. /**
  6527. * Defines whether there is any registered pending action.
  6528. *
  6529. * @readonly
  6530. * @observable
  6531. * @member {Boolean} #hasAny
  6532. */
  6533. this.set( 'hasAny', false );
  6534. /**
  6535. * A list of pending actions.
  6536. *
  6537. * @private
  6538. * @type {module:utils/collection~Collection}
  6539. */
  6540. this._actions = new _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_2__["default"]( { idProperty: '_id' } );
  6541. this._actions.delegate( 'add', 'remove' ).to( this );
  6542. }
  6543. /**
  6544. * Adds an action to the list of pending actions.
  6545. *
  6546. * This method returns an action object with an observable message property.
  6547. * The action object can be later used in the {@link #remove} method. It also allows you to change the message.
  6548. *
  6549. * @param {String} message The action message.
  6550. * @returns {Object} An observable object that represents a pending action.
  6551. */
  6552. add( message ) {
  6553. if ( typeof message !== 'string' ) {
  6554. /**
  6555. * The message must be a string.
  6556. *
  6557. * @error pendingactions-add-invalid-message
  6558. */
  6559. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__["default"]( 'pendingactions-add-invalid-message', this );
  6560. }
  6561. const action = Object.create( _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  6562. action.set( 'message', message );
  6563. this._actions.add( action );
  6564. this.hasAny = true;
  6565. return action;
  6566. }
  6567. /**
  6568. * Removes an action from the list of pending actions.
  6569. *
  6570. * @param {Object} action An action object.
  6571. */
  6572. remove( action ) {
  6573. this._actions.remove( action );
  6574. this.hasAny = !!this._actions.length;
  6575. }
  6576. /**
  6577. * Returns the first action from the list or null when list is empty
  6578. *
  6579. * returns {Object|null} The pending action object.
  6580. */
  6581. get first() {
  6582. return this._actions.get( 0 );
  6583. }
  6584. /**
  6585. * Iterable interface.
  6586. *
  6587. * @returns {Iterable.<*>}
  6588. */
  6589. [ Symbol.iterator ]() {
  6590. return this._actions[ Symbol.iterator ]();
  6591. }
  6592. /**
  6593. * Fired when an action is added to the list.
  6594. *
  6595. * @event add
  6596. * @param {Object} action The added action.
  6597. */
  6598. /**
  6599. * Fired when an action is removed from the list.
  6600. *
  6601. * @event remove
  6602. * @param {Object} action The removed action.
  6603. */
  6604. }
  6605. /***/ }),
  6606. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js":
  6607. /*!*************************************************************!*\
  6608. !*** ./node_modules/@ckeditor/ckeditor5-core/src/plugin.js ***!
  6609. \*************************************************************/
  6610. /*! exports provided: default */
  6611. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6612. "use strict";
  6613. __webpack_require__.r(__webpack_exports__);
  6614. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Plugin; });
  6615. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  6616. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  6617. /**
  6618. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  6619. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  6620. */
  6621. /**
  6622. * @module core/plugin
  6623. */
  6624. /**
  6625. * The base class for CKEditor plugin classes.
  6626. *
  6627. * @implements module:core/plugin~PluginInterface
  6628. * @mixes module:utils/observablemixin~ObservableMixin
  6629. */
  6630. class Plugin {
  6631. /**
  6632. * @inheritDoc
  6633. */
  6634. constructor( editor ) {
  6635. /**
  6636. * The editor instance.
  6637. *
  6638. * Note that most editors implement the {@link module:core/editor/editorwithui~EditorWithUI} interface in addition
  6639. * to the base {@link module:core/editor/editor~Editor} interface. However, editors with an external UI
  6640. * (i.e. Bootstrap-based) or a headless editor may not implement the {@link module:core/editor/editorwithui~EditorWithUI}
  6641. * interface.
  6642. *
  6643. * Because of above, to make plugins more universal, it is recommended to split features into:
  6644. * - The "editing" part that only uses the {@link module:core/editor/editor~Editor} interface.
  6645. * - The "UI" part that uses both the {@link module:core/editor/editor~Editor} interface and
  6646. * the {@link module:core/editor/editorwithui~EditorWithUI} interface.
  6647. *
  6648. * @readonly
  6649. * @member {module:core/editor/editor~Editor} #editor
  6650. */
  6651. this.editor = editor;
  6652. /**
  6653. * Flag indicating whether a plugin is enabled or disabled.
  6654. * A disabled plugin will not transform text.
  6655. *
  6656. * Plugin can be simply disabled like that:
  6657. *
  6658. * // Disable the plugin so that no toolbars are visible.
  6659. * editor.plugins.get( 'TextTransformation' ).isEnabled = false;
  6660. *
  6661. * You can also use {@link #forceDisabled} method.
  6662. *
  6663. * @observable
  6664. * @readonly
  6665. * @member {Boolean} #isEnabled
  6666. */
  6667. this.set( 'isEnabled', true );
  6668. /**
  6669. * Holds identifiers for {@link #forceDisabled} mechanism.
  6670. *
  6671. * @type {Set.<String>}
  6672. * @private
  6673. */
  6674. this._disableStack = new Set();
  6675. }
  6676. /**
  6677. * Disables the plugin.
  6678. *
  6679. * Plugin may be disabled by multiple features or algorithms (at once). When disabling a plugin, unique id should be passed
  6680. * (e.g. feature name). The same identifier should be used when {@link #clearForceDisabled enabling back} the plugin.
  6681. * The plugin becomes enabled only after all features {@link #clearForceDisabled enabled it back}.
  6682. *
  6683. * Disabling and enabling a plugin:
  6684. *
  6685. * plugin.isEnabled; // -> true
  6686. * plugin.forceDisabled( 'MyFeature' );
  6687. * plugin.isEnabled; // -> false
  6688. * plugin.clearForceDisabled( 'MyFeature' );
  6689. * plugin.isEnabled; // -> true
  6690. *
  6691. * Plugin disabled by multiple features:
  6692. *
  6693. * plugin.forceDisabled( 'MyFeature' );
  6694. * plugin.forceDisabled( 'OtherFeature' );
  6695. * plugin.clearForceDisabled( 'MyFeature' );
  6696. * plugin.isEnabled; // -> false
  6697. * plugin.clearForceDisabled( 'OtherFeature' );
  6698. * plugin.isEnabled; // -> true
  6699. *
  6700. * Multiple disabling with the same identifier is redundant:
  6701. *
  6702. * plugin.forceDisabled( 'MyFeature' );
  6703. * plugin.forceDisabled( 'MyFeature' );
  6704. * plugin.clearForceDisabled( 'MyFeature' );
  6705. * plugin.isEnabled; // -> true
  6706. *
  6707. * **Note:** some plugins or algorithms may have more complex logic when it comes to enabling or disabling certain plugins,
  6708. * so the plugin might be still disabled after {@link #clearForceDisabled} was used.
  6709. *
  6710. * @param {String} id Unique identifier for disabling. Use the same id when {@link #clearForceDisabled enabling back} the plugin.
  6711. */
  6712. forceDisabled( id ) {
  6713. this._disableStack.add( id );
  6714. if ( this._disableStack.size == 1 ) {
  6715. this.on( 'set:isEnabled', forceDisable, { priority: 'highest' } );
  6716. this.isEnabled = false;
  6717. }
  6718. }
  6719. /**
  6720. * Clears forced disable previously set through {@link #forceDisabled}. See {@link #forceDisabled}.
  6721. *
  6722. * @param {String} id Unique identifier, equal to the one passed in {@link #forceDisabled} call.
  6723. */
  6724. clearForceDisabled( id ) {
  6725. this._disableStack.delete( id );
  6726. if ( this._disableStack.size == 0 ) {
  6727. this.off( 'set:isEnabled', forceDisable );
  6728. this.isEnabled = true;
  6729. }
  6730. }
  6731. /**
  6732. * @inheritDoc
  6733. */
  6734. destroy() {
  6735. this.stopListening();
  6736. }
  6737. /**
  6738. * @inheritDoc
  6739. */
  6740. static get isContextPlugin() {
  6741. return false;
  6742. }
  6743. }
  6744. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( Plugin, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
  6745. /**
  6746. * The base interface for CKEditor plugins.
  6747. *
  6748. * In its minimal form a plugin can be a simple function that accepts {@link module:core/editor/editor~Editor the editor}
  6749. * as a parameter:
  6750. *
  6751. * // A simple plugin that enables a data processor.
  6752. * function MyPlugin( editor ) {
  6753. * editor.data.processor = new MyDataProcessor();
  6754. * }
  6755. *
  6756. * In most cases however, you will want to inherit from the {@link module:core/plugin~Plugin} class which implements the
  6757. * {@link module:utils/observablemixin~ObservableMixin} and is, therefore, more convenient:
  6758. *
  6759. * class MyPlugin extends Plugin {
  6760. * init() {
  6761. * // `listenTo()` and `editor` are available thanks to `Plugin`.
  6762. * // By using `listenTo()` you will ensure that the listener is removed when
  6763. * // the plugin is destroyed.
  6764. * this.listenTo( this.editor.data, 'ready', () => {
  6765. * // Do something when the data is ready.
  6766. * } );
  6767. * }
  6768. * }
  6769. *
  6770. * The plugin can also implement methods (e.g. {@link module:core/plugin~PluginInterface#init `init()`} or
  6771. * {@link module:core/plugin~PluginInterface#destroy `destroy()`}) which, when present, will be used to properly
  6772. * initialize and destroy the plugin.
  6773. *
  6774. * **Note:** When defined as a plain function, the plugin acts as a constructor and will be
  6775. * called in parallel with other plugins' {@link module:core/plugin~PluginInterface#constructor constructors}.
  6776. * This means the code of that plugin will be executed **before** {@link module:core/plugin~PluginInterface#init `init()`} and
  6777. * {@link module:core/plugin~PluginInterface#afterInit `afterInit()`} methods of other plugins and, for instance,
  6778. * you cannot use it to extend other plugins' {@glink framework/guides/architecture/editing-engine#schema schema}
  6779. * rules as they are defined later on during the `init()` stage.
  6780. *
  6781. * @interface PluginInterface
  6782. */
  6783. /**
  6784. * Creates a new plugin instance. This is the first step of the plugin initialization.
  6785. * See also {@link #init} and {@link #afterInit}.
  6786. *
  6787. * A plugin is always instantiated after its {@link module:core/plugin~PluginInterface.requires dependencies} and the
  6788. * {@link #init} and {@link #afterInit} methods are called in the same order.
  6789. *
  6790. * Usually, you will want to put your plugin's initialization code in the {@link #init} method.
  6791. * The constructor can be understood as "before init" and used in special cases, just like
  6792. * {@link #afterInit} serves the special "after init" scenarios (e.g.the code which depends on other
  6793. * plugins, but which does not {@link module:core/plugin~PluginInterface.requires explicitly require} them).
  6794. *
  6795. * @method #constructor
  6796. * @param {module:core/editor/editor~Editor} editor
  6797. */
  6798. /**
  6799. * An array of plugins required by this plugin.
  6800. *
  6801. * To keep the plugin class definition tight it is recommended to define this property as a static getter:
  6802. *
  6803. * import Image from './image.js';
  6804. *
  6805. * export default class ImageCaption {
  6806. * static get requires() {
  6807. * return [ Image ];
  6808. * }
  6809. * }
  6810. *
  6811. * @static
  6812. * @readonly
  6813. * @member {Array.<Function>|undefined} module:core/plugin~PluginInterface.requires
  6814. */
  6815. /**
  6816. * An optional name of the plugin. If set, the plugin will be available in
  6817. * {@link module:core/plugincollection~PluginCollection#get} by its
  6818. * name and its constructor. If not, then only by its constructor.
  6819. *
  6820. * The name should reflect the constructor name.
  6821. *
  6822. * To keep the plugin class definition tight, it is recommended to define this property as a static getter:
  6823. *
  6824. * export default class ImageCaption {
  6825. * static get pluginName() {
  6826. * return 'ImageCaption';
  6827. * }
  6828. * }
  6829. *
  6830. * Note: The native `Function.name` property could not be used to keep the plugin name because
  6831. * it will be mangled during code minification.
  6832. *
  6833. * Naming a plugin is necessary to enable removing it through the
  6834. * {@link module:core/editor/editorconfig~EditorConfig#removePlugins `config.removePlugins`} option.
  6835. *
  6836. * @static
  6837. * @readonly
  6838. * @member {String|undefined} module:core/plugin~PluginInterface.pluginName
  6839. */
  6840. /**
  6841. * The second stage (after plugin {@link #constructor}) of the plugin initialization.
  6842. * Unlike the plugin constructor this method can be asynchronous.
  6843. *
  6844. * A plugin's `init()` method is called after its {@link module:core/plugin~PluginInterface.requires dependencies} are initialized,
  6845. * so in the same order as the constructors of these plugins.
  6846. *
  6847. * **Note:** This method is optional. A plugin instance does not need to have it defined.
  6848. *
  6849. * @method #init
  6850. * @returns {null|Promise}
  6851. */
  6852. /**
  6853. * The third (and last) stage of the plugin initialization. See also {@link #constructor} and {@link #init}.
  6854. *
  6855. * **Note:** This method is optional. A plugin instance does not need to have it defined.
  6856. *
  6857. * @method #afterInit
  6858. * @returns {null|Promise}
  6859. */
  6860. /**
  6861. * Destroys the plugin.
  6862. *
  6863. * **Note:** This method is optional. A plugin instance does not need to have it defined.
  6864. *
  6865. * @method #destroy
  6866. * @returns {null|Promise}
  6867. */
  6868. /**
  6869. * A flag which defines if a plugin is allowed or not allowed to be used directly by a {@link module:core/context~Context}.
  6870. *
  6871. * @static
  6872. * @readonly
  6873. * @member {Boolean} module:core/plugin~PluginInterface.isContextPlugin
  6874. */
  6875. /**
  6876. * An array of loaded plugins.
  6877. *
  6878. * @typedef {Array.<module:core/plugin~PluginInterface>} module:core/plugin~LoadedPlugins
  6879. */
  6880. // Helper function that forces plugin to be disabled.
  6881. function forceDisable( evt ) {
  6882. evt.return = false;
  6883. evt.stop();
  6884. }
  6885. /***/ }),
  6886. /***/ "./node_modules/@ckeditor/ckeditor5-core/src/plugincollection.js":
  6887. /*!***********************************************************************!*\
  6888. !*** ./node_modules/@ckeditor/ckeditor5-core/src/plugincollection.js ***!
  6889. \***********************************************************************/
  6890. /*! exports provided: default */
  6891. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6892. "use strict";
  6893. __webpack_require__.r(__webpack_exports__);
  6894. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return PluginCollection; });
  6895. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  6896. /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  6897. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  6898. /**
  6899. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  6900. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  6901. */
  6902. /**
  6903. * @module core/plugincollection
  6904. */
  6905. /**
  6906. * Manages a list of CKEditor plugins, including loading, resolving dependencies and initialization.
  6907. *
  6908. * @mixes module:utils/emittermixin~EmitterMixin
  6909. */
  6910. class PluginCollection {
  6911. /**
  6912. * Creates an instance of the plugin collection class.
  6913. * Allows loading and initializing plugins and their dependencies.
  6914. * Allows to provide a list of already loaded plugins. These plugins will not be destroyed along with this collection.
  6915. *
  6916. * @param {module:core/editor/editor~Editor|module:core/context~Context} context
  6917. * @param {Array.<Function>} [availablePlugins] Plugins (constructors) which the collection will be able to use
  6918. * when {@link module:core/plugincollection~PluginCollection#init} is used with plugin names (strings, instead of constructors).
  6919. * Usually, the editor will pass its built-in plugins to the collection so they can later be
  6920. * used in `config.plugins` or `config.removePlugins` by names.
  6921. * @param {Iterable.<Array>} contextPlugins A list of already initialized plugins represented by a
  6922. * `[ PluginConstructor, pluginInstance ]` pair.
  6923. */
  6924. constructor( context, availablePlugins = [], contextPlugins = [] ) {
  6925. /**
  6926. * @protected
  6927. * @type {module:core/editor/editor~Editor|module:core/context~Context}
  6928. */
  6929. this._context = context;
  6930. /**
  6931. * @protected
  6932. * @type {Map}
  6933. */
  6934. this._plugins = new Map();
  6935. /**
  6936. * A map of plugin constructors that can be retrieved by their names.
  6937. *
  6938. * @protected
  6939. * @type {Map.<String|Function,Function>}
  6940. */
  6941. this._availablePlugins = new Map();
  6942. for ( const PluginConstructor of availablePlugins ) {
  6943. if ( PluginConstructor.pluginName ) {
  6944. this._availablePlugins.set( PluginConstructor.pluginName, PluginConstructor );
  6945. }
  6946. }
  6947. /**
  6948. * Map of {@link module:core/contextplugin~ContextPlugin context plugins} which can be retrieved by their constructors or instances.
  6949. *
  6950. * @protected
  6951. * @type {Map<Function,Function>}
  6952. */
  6953. this._contextPlugins = new Map();
  6954. for ( const [ PluginConstructor, pluginInstance ] of contextPlugins ) {
  6955. this._contextPlugins.set( PluginConstructor, pluginInstance );
  6956. this._contextPlugins.set( pluginInstance, PluginConstructor );
  6957. // To make it possible to require a plugin by its name.
  6958. if ( PluginConstructor.pluginName ) {
  6959. this._availablePlugins.set( PluginConstructor.pluginName, PluginConstructor );
  6960. }
  6961. }
  6962. }
  6963. /**
  6964. * Iterable interface.
  6965. *
  6966. * Returns `[ PluginConstructor, pluginInstance ]` pairs.
  6967. *
  6968. * @returns {Iterable.<Array>}
  6969. */
  6970. * [ Symbol.iterator ]() {
  6971. for ( const entry of this._plugins ) {
  6972. if ( typeof entry[ 0 ] == 'function' ) {
  6973. yield entry;
  6974. }
  6975. }
  6976. }
  6977. /**
  6978. * Gets the plugin instance by its constructor or name.
  6979. *
  6980. * // Check if 'Clipboard' plugin was loaded.
  6981. * if ( editor.plugins.has( 'Clipboard' ) ) {
  6982. * // Get clipboard plugin instance
  6983. * const clipboard = editor.plugins.get( 'Clipboard' );
  6984. *
  6985. * this.listenTo( clipboard, 'inputTransformation', ( evt, data ) => {
  6986. * // Do something on clipboard input.
  6987. * } );
  6988. * }
  6989. *
  6990. * **Note**: This method will throw error if plugin is not loaded. Use `{@link #has editor.plugins.has()}`
  6991. * to check if plugin is available.
  6992. *
  6993. * @param {Function|String} key The plugin constructor or {@link module:core/plugin~PluginInterface.pluginName name}.
  6994. * @returns {module:core/plugin~PluginInterface}
  6995. */
  6996. get( key ) {
  6997. const plugin = this._plugins.get( key );
  6998. if ( !plugin ) {
  6999. let pluginName = key;
  7000. if ( typeof key == 'function' ) {
  7001. pluginName = key.pluginName || key.name;
  7002. }
  7003. /**
  7004. * The plugin is not loaded and could not be obtained.
  7005. *
  7006. * Plugin classes (constructors) need to be provided to the editor and must be loaded before they can be obtained from
  7007. * the plugin collection.
  7008. * This is usually done in CKEditor 5 builds by setting the {@link module:core/editor/editor~Editor.builtinPlugins}
  7009. * property.
  7010. *
  7011. * **Note**: You can use `{@link module:core/plugincollection~PluginCollection#has editor.plugins.has()}`
  7012. * to check if plugin was loaded.
  7013. *
  7014. * @error plugincollection-plugin-not-loaded
  7015. * @param {String} plugin The name of the plugin which is not loaded.
  7016. */
  7017. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'plugincollection-plugin-not-loaded', this._context, { plugin: pluginName } );
  7018. }
  7019. return plugin;
  7020. }
  7021. /**
  7022. * Checks if a plugin is loaded.
  7023. *
  7024. * // Check if the 'Clipboard' plugin was loaded.
  7025. * if ( editor.plugins.has( 'Clipboard' ) ) {
  7026. * // Now use the clipboard plugin instance:
  7027. * const clipboard = editor.plugins.get( 'Clipboard' );
  7028. *
  7029. * // ...
  7030. * }
  7031. *
  7032. * @param {Function|String} key The plugin constructor or {@link module:core/plugin~PluginInterface.pluginName name}.
  7033. * @returns {Boolean}
  7034. */
  7035. has( key ) {
  7036. return this._plugins.has( key );
  7037. }
  7038. /**
  7039. * Initializes a set of plugins and adds them to the collection.
  7040. *
  7041. * @param {Array.<Function|String>} plugins An array of {@link module:core/plugin~PluginInterface plugin constructors}
  7042. * or {@link module:core/plugin~PluginInterface.pluginName plugin names}. The second option (names) works only if
  7043. * `availablePlugins` were passed to the {@link #constructor}.
  7044. * @param {Array.<String|Function>} [removePlugins] Names of plugins or plugin constructors
  7045. * that should not be loaded (despite being specified in the `plugins` array).
  7046. * @returns {Promise.<module:core/plugin~LoadedPlugins>} A promise which gets resolved once all plugins are loaded
  7047. * and available in the collection.
  7048. */
  7049. init( plugins, removePlugins = [] ) {
  7050. const that = this;
  7051. const context = this._context;
  7052. const loading = new Set();
  7053. const loaded = [];
  7054. const pluginConstructors = mapToAvailableConstructors( plugins );
  7055. const removePluginConstructors = mapToAvailableConstructors( removePlugins );
  7056. const missingPlugins = getMissingPluginNames( plugins );
  7057. if ( missingPlugins ) {
  7058. /**
  7059. * Some plugins are not available and could not be loaded.
  7060. *
  7061. * Plugin classes (constructors) need to be provided to the editor before they can be loaded by name.
  7062. * This is usually done in CKEditor 5 builds by setting the {@link module:core/editor/editor~Editor.builtinPlugins}
  7063. * property.
  7064. *
  7065. * **If you see this warning when using one of the {@glink builds/index CKEditor 5 Builds}**, it means
  7066. * that you try to enable a plugin which was not included in that build. This may be due to a typo
  7067. * in the plugin name or simply because that plugin is not a part of this build. In the latter scenario,
  7068. * read more about {@glink builds/guides/development/custom-builds custom builds}.
  7069. *
  7070. * **If you see this warning when using one of the editor creators directly** (not a build), then it means
  7071. * that you tried loading plugins by name. However, unlike CKEditor 4, CKEditor 5 does not implement a "plugin loader".
  7072. * This means that CKEditor 5 does not know where to load the plugin modules from. Therefore, you need to
  7073. * provide each plugin through reference (as a constructor function). Check out the examples in
  7074. * {@glink builds/guides/integration/advanced-setup#scenario-2-building-from-source "Building from source"}.
  7075. *
  7076. * @error plugincollection-plugin-not-found
  7077. * @param {Array.<String>} plugins The name of the plugins which could not be loaded.
  7078. */
  7079. const errorId = 'plugincollection-plugin-not-found';
  7080. // Log the error, so it's more visible on the console. Hopefully, for better DX.
  7081. Object(_ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["logError"])( errorId, { plugins: missingPlugins } );
  7082. return Promise.reject( new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( errorId, context, { plugins: missingPlugins } ) );
  7083. }
  7084. return Promise.all( pluginConstructors.map( loadPlugin ) )
  7085. .then( () => initPlugins( loaded, 'init' ) )
  7086. .then( () => initPlugins( loaded, 'afterInit' ) )
  7087. .then( () => loaded );
  7088. function loadPlugin( PluginConstructor ) {
  7089. if ( removePluginConstructors.includes( PluginConstructor ) ) {
  7090. return;
  7091. }
  7092. // The plugin is already loaded or being loaded - do nothing.
  7093. if ( that._plugins.has( PluginConstructor ) || loading.has( PluginConstructor ) ) {
  7094. return;
  7095. }
  7096. return instantiatePlugin( PluginConstructor )
  7097. .catch( err => {
  7098. /**
  7099. * It was not possible to load the plugin.
  7100. *
  7101. * This is a generic error logged to the console when a JavaSript error is thrown during the initialization
  7102. * of one of the plugins.
  7103. *
  7104. * If you correctly handled the promise returned by the editor's `create()` method (like shown below),
  7105. * you will find the original error logged to the console, too:
  7106. *
  7107. * ClassicEditor.create( document.getElementById( 'editor' ) )
  7108. * .then( editor => {
  7109. * // ...
  7110. * } )
  7111. * .catch( error => {
  7112. * console.error( error );
  7113. * } );
  7114. *
  7115. * @error plugincollection-load
  7116. * @param {String} plugin The name of the plugin that could not be loaded.
  7117. */
  7118. Object(_ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["logError"])( 'plugincollection-load', { plugin: PluginConstructor } );
  7119. throw err;
  7120. } );
  7121. }
  7122. function initPlugins( loadedPlugins, method ) {
  7123. return loadedPlugins.reduce( ( promise, plugin ) => {
  7124. if ( !plugin[ method ] ) {
  7125. return promise;
  7126. }
  7127. if ( that._contextPlugins.has( plugin ) ) {
  7128. return promise;
  7129. }
  7130. return promise.then( plugin[ method ].bind( plugin ) );
  7131. }, Promise.resolve() );
  7132. }
  7133. function instantiatePlugin( PluginConstructor ) {
  7134. return new Promise( resolve => {
  7135. loading.add( PluginConstructor );
  7136. if ( PluginConstructor.requires ) {
  7137. PluginConstructor.requires.forEach( RequiredPluginConstructorOrName => {
  7138. const RequiredPluginConstructor = getPluginConstructor( RequiredPluginConstructorOrName );
  7139. if ( PluginConstructor.isContextPlugin && !RequiredPluginConstructor.isContextPlugin ) {
  7140. /**
  7141. * If a plugin is a context plugin, all plugins it requires should also be context plugins
  7142. * instead of plugins. In other words, if one plugin can be used in the context,
  7143. * all its requirements should also be ready to be used in the context. Note that the context
  7144. * provides only a part of the API provided by the editor. If one plugin needs a full
  7145. * editor API, all plugins which require it are considered as plugins that need a full
  7146. * editor API.
  7147. *
  7148. * @error plugincollection-context-required
  7149. * @param {String} plugin The name of the required plugin.
  7150. * @param {String} requiredBy The name of the parent plugin.
  7151. */
  7152. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  7153. 'plugincollection-context-required',
  7154. null,
  7155. { plugin: RequiredPluginConstructor.name, requiredBy: PluginConstructor.name }
  7156. );
  7157. }
  7158. if ( removePlugins.includes( RequiredPluginConstructor ) ) {
  7159. /**
  7160. * Cannot load a plugin because one of its dependencies is listed in the `removePlugins` option.
  7161. *
  7162. * @error plugincollection-required
  7163. * @param {String} plugin The name of the required plugin.
  7164. * @param {String} requiredBy The name of the parent plugin.
  7165. */
  7166. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  7167. 'plugincollection-required',
  7168. context,
  7169. { plugin: RequiredPluginConstructor.name, requiredBy: PluginConstructor.name }
  7170. );
  7171. }
  7172. loadPlugin( RequiredPluginConstructor );
  7173. } );
  7174. }
  7175. const plugin = that._contextPlugins.get( PluginConstructor ) || new PluginConstructor( context );
  7176. that._add( PluginConstructor, plugin );
  7177. loaded.push( plugin );
  7178. resolve();
  7179. } );
  7180. }
  7181. function getPluginConstructor( PluginConstructorOrName ) {
  7182. if ( typeof PluginConstructorOrName == 'function' ) {
  7183. return PluginConstructorOrName;
  7184. }
  7185. return that._availablePlugins.get( PluginConstructorOrName );
  7186. }
  7187. function getMissingPluginNames( plugins ) {
  7188. const missingPlugins = [];
  7189. for ( const pluginNameOrConstructor of plugins ) {
  7190. if ( !getPluginConstructor( pluginNameOrConstructor ) ) {
  7191. missingPlugins.push( pluginNameOrConstructor );
  7192. }
  7193. }
  7194. return missingPlugins.length ? missingPlugins : null;
  7195. }
  7196. function mapToAvailableConstructors( plugins ) {
  7197. return plugins
  7198. .map( pluginNameOrConstructor => getPluginConstructor( pluginNameOrConstructor ) )
  7199. .filter( PluginConstructor => !!PluginConstructor );
  7200. }
  7201. }
  7202. /**
  7203. * Destroys all loaded plugins.
  7204. *
  7205. * @returns {Promise}
  7206. */
  7207. destroy() {
  7208. const promises = [];
  7209. for ( const [ , pluginInstance ] of this ) {
  7210. if ( typeof pluginInstance.destroy == 'function' && !this._contextPlugins.has( pluginInstance ) ) {
  7211. promises.push( pluginInstance.destroy() );
  7212. }
  7213. }
  7214. return Promise.all( promises );
  7215. }
  7216. /**
  7217. * Adds the plugin to the collection. Exposed mainly for testing purposes.
  7218. *
  7219. * @protected
  7220. * @param {Function} PluginConstructor The plugin constructor.
  7221. * @param {module:core/plugin~PluginInterface} plugin The instance of the plugin.
  7222. */
  7223. _add( PluginConstructor, plugin ) {
  7224. this._plugins.set( PluginConstructor, plugin );
  7225. const pluginName = PluginConstructor.pluginName;
  7226. if ( !pluginName ) {
  7227. return;
  7228. }
  7229. if ( this._plugins.has( pluginName ) ) {
  7230. /**
  7231. * Two plugins with the same {@link module:core/plugin~PluginInterface.pluginName} were loaded.
  7232. * This will lead to runtime conflicts between these plugins.
  7233. *
  7234. * In practice, this warning usually means that new plugins were added to an existing CKEditor 5 build.
  7235. * Plugins should always be added to a source version of the editor (`@ckeditor/ckeditor5-editor-*`),
  7236. * not to an editor imported from one of the `@ckeditor/ckeditor5-build-*` packages.
  7237. *
  7238. * Check your import paths and the list of plugins passed to
  7239. * {@link module:core/editor/editor~Editor.create `Editor.create()`}
  7240. * or specified in {@link module:core/editor/editor~Editor.builtinPlugins `Editor.builtinPlugins`}.
  7241. *
  7242. * The second option is that your `node_modules/` directory contains duplicated versions of the same
  7243. * CKEditor 5 packages. Normally, on clean installations, npm deduplicates packages in `node_modules/`, so
  7244. * it may be enough to call `rm -rf node_modules && npm i`. However, if you installed conflicting versions
  7245. * of packages, their dependencies may need to be installed in more than one version which may lead to this
  7246. * warning.
  7247. *
  7248. * Technically speaking, this error occurs because after adding a plugin to an existing editor build
  7249. * dependencies of this plugin are being duplicated.
  7250. * They are already built into that editor build and now get added for the second time as dependencies
  7251. * of the plugin you are installing.
  7252. *
  7253. * Read more about {@glink builds/guides/integration/installing-plugins installing plugins}.
  7254. *
  7255. * @error plugincollection-plugin-name-conflict
  7256. * @param {String} pluginName The duplicated plugin name.
  7257. * @param {Function} plugin1 The first plugin constructor.
  7258. * @param {Function} plugin2 The second plugin constructor.
  7259. */
  7260. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  7261. 'plugincollection-plugin-name-conflict',
  7262. null,
  7263. { pluginName, plugin1: this._plugins.get( pluginName ).constructor, plugin2: PluginConstructor }
  7264. );
  7265. }
  7266. this._plugins.set( pluginName, plugin );
  7267. }
  7268. }
  7269. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( PluginCollection, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  7270. /***/ }),
  7271. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-center.svg":
  7272. /*!****************************************************************************!*\
  7273. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-center.svg ***!
  7274. \****************************************************************************/
  7275. /*! exports provided: default */
  7276. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7277. "use strict";
  7278. __webpack_require__.r(__webpack_exports__);
  7279. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm2.286 4c0 .414.336.75.75.75h9.928a.75.75 0 1 0 0-1.5H5.036a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h9.928a.75.75 0 1 0 0-1.5H5.036a.75.75 0 0 0-.75.75z\"/></svg>");
  7280. /***/ }),
  7281. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-justify.svg":
  7282. /*!*****************************************************************************!*\
  7283. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-justify.svg ***!
  7284. \*****************************************************************************/
  7285. /*! exports provided: default */
  7286. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7287. "use strict";
  7288. __webpack_require__.r(__webpack_exports__);
  7289. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 4c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75z\"/></svg>");
  7290. /***/ }),
  7291. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-left.svg":
  7292. /*!**************************************************************************!*\
  7293. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-left.svg ***!
  7294. \**************************************************************************/
  7295. /*! exports provided: default */
  7296. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7297. "use strict";
  7298. __webpack_require__.r(__webpack_exports__);
  7299. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 4c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75z\"/></svg>");
  7300. /***/ }),
  7301. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-right.svg":
  7302. /*!***************************************************************************!*\
  7303. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-right.svg ***!
  7304. \***************************************************************************/
  7305. /*! exports provided: default */
  7306. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7307. "use strict";
  7308. __webpack_require__.r(__webpack_exports__);
  7309. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M18 3.75a.75.75 0 0 1-.75.75H2.75a.75.75 0 1 1 0-1.5h14.5a.75.75 0 0 1 .75.75zm0 8a.75.75 0 0 1-.75.75H2.75a.75.75 0 1 1 0-1.5h14.5a.75.75 0 0 1 .75.75zm0 4a.75.75 0 0 1-.75.75H7.321a.75.75 0 1 1 0-1.5h9.929a.75.75 0 0 1 .75.75zm0-8a.75.75 0 0 1-.75.75H7.321a.75.75 0 1 1 0-1.5h9.929a.75.75 0 0 1 .75.75z\"/></svg>");
  7310. /***/ }),
  7311. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/cancel.svg":
  7312. /*!**********************************************************************!*\
  7313. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/cancel.svg ***!
  7314. \**********************************************************************/
  7315. /*! exports provided: default */
  7316. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7317. "use strict";
  7318. __webpack_require__.r(__webpack_exports__);
  7319. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M11.591 10.177l4.243 4.242a1 1 0 0 1-1.415 1.415l-4.242-4.243-4.243 4.243a1 1 0 0 1-1.414-1.415l4.243-4.242L4.52 5.934A1 1 0 0 1 5.934 4.52l4.243 4.243 4.242-4.243a1 1 0 1 1 1.415 1.414l-4.243 4.243z\"/></svg>");
  7320. /***/ }),
  7321. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/check.svg":
  7322. /*!*********************************************************************!*\
  7323. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/check.svg ***!
  7324. \*********************************************************************/
  7325. /*! exports provided: default */
  7326. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7327. "use strict";
  7328. __webpack_require__.r(__webpack_exports__);
  7329. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6.972 16.615a.997.997 0 0 1-.744-.292l-4.596-4.596a1 1 0 1 1 1.414-1.414l3.926 3.926 9.937-9.937a1 1 0 0 1 1.414 1.415L7.717 16.323a.997.997 0 0 1-.745.292z\"/></svg>");
  7330. /***/ }),
  7331. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/eraser.svg":
  7332. /*!**********************************************************************!*\
  7333. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/eraser.svg ***!
  7334. \**********************************************************************/
  7335. /*! exports provided: default */
  7336. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7337. "use strict";
  7338. __webpack_require__.r(__webpack_exports__);
  7339. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M8.636 9.531l-2.758 3.94a.5.5 0 0 0 .122.696l3.224 2.284h1.314l2.636-3.736L8.636 9.53zm.288 8.451L5.14 15.396a2 2 0 0 1-.491-2.786l6.673-9.53a2 2 0 0 1 2.785-.49l3.742 2.62a2 2 0 0 1 .491 2.785l-7.269 10.053-2.147-.066z\"/><path d=\"M4 18h5.523v-1H4zm-2 0h1v-1H2z\"/></svg>");
  7340. /***/ }),
  7341. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/image.svg":
  7342. /*!*********************************************************************!*\
  7343. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/image.svg ***!
  7344. \*********************************************************************/
  7345. /*! exports provided: default */
  7346. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7347. "use strict";
  7348. __webpack_require__.r(__webpack_exports__);
  7349. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6.91 10.54c.26-.23.64-.21.88.03l3.36 3.14 2.23-2.06a.64.64 0 0 1 .87 0l2.52 2.97V4.5H3.2v10.12l3.71-4.08zm10.27-7.51c.6 0 1.09.47 1.09 1.05v11.84c0 .59-.49 1.06-1.09 1.06H2.79c-.6 0-1.09-.47-1.09-1.06V4.08c0-.58.49-1.05 1.1-1.05h14.38zm-5.22 5.56a1.96 1.96 0 1 1 3.4-1.96 1.96 1.96 0 0 1-3.4 1.96z\"/></svg>");
  7350. /***/ }),
  7351. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/low-vision.svg":
  7352. /*!**************************************************************************!*\
  7353. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/low-vision.svg ***!
  7354. \**************************************************************************/
  7355. /*! exports provided: default */
  7356. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7357. "use strict";
  7358. __webpack_require__.r(__webpack_exports__);
  7359. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M5.085 6.22L2.943 4.078a.75.75 0 1 1 1.06-1.06l2.592 2.59A11.094 11.094 0 0 1 10 5.068c4.738 0 8.578 3.101 8.578 5.083 0 1.197-1.401 2.803-3.555 3.887l1.714 1.713a.75.75 0 0 1-.09 1.138.488.488 0 0 1-.15.084.75.75 0 0 1-.821-.16L6.17 7.304c-.258.11-.51.233-.757.365l6.239 6.24-.006.005.78.78c-.388.094-.78.166-1.174.215l-1.11-1.11h.011L4.55 8.197a7.2 7.2 0 0 0-.665.514l-.112.098 4.897 4.897-.005.006 1.276 1.276a10.164 10.164 0 0 1-1.477-.117l-.479-.479-.009.009-4.863-4.863-.022.031a2.563 2.563 0 0 0-.124.2c-.043.077-.08.158-.108.241a.534.534 0 0 0-.028.133.29.29 0 0 0 .008.072.927.927 0 0 0 .082.226c.067.133.145.26.234.379l3.242 3.365.025.01.59.623c-3.265-.918-5.59-3.155-5.59-4.668 0-1.194 1.448-2.838 3.663-3.93zm7.07.531a4.632 4.632 0 0 1 1.108 5.992l.345.344.046-.018a9.313 9.313 0 0 0 2-1.112c.256-.187.5-.392.727-.613.137-.134.27-.277.392-.431.072-.091.141-.185.203-.286.057-.093.107-.19.148-.292a.72.72 0 0 0 .036-.12.29.29 0 0 0 .008-.072.492.492 0 0 0-.028-.133.999.999 0 0 0-.036-.096 2.165 2.165 0 0 0-.071-.145 2.917 2.917 0 0 0-.125-.2 3.592 3.592 0 0 0-.263-.335 5.444 5.444 0 0 0-.53-.523 7.955 7.955 0 0 0-1.054-.768 9.766 9.766 0 0 0-1.879-.891c-.337-.118-.68-.219-1.027-.301zm-2.85.21l-.069.002a.508.508 0 0 0-.254.097.496.496 0 0 0-.104.679.498.498 0 0 0 .326.199l.045.005c.091.003.181.003.272.012a2.45 2.45 0 0 1 2.017 1.513c.024.061.043.125.069.185a.494.494 0 0 0 .45.287h.008a.496.496 0 0 0 .35-.158.482.482 0 0 0 .13-.335.638.638 0 0 0-.048-.219 3.379 3.379 0 0 0-.36-.723 3.438 3.438 0 0 0-2.791-1.543l-.028-.001h-.013z\"/></svg>");
  7360. /***/ }),
  7361. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-center.svg":
  7362. /*!*****************************************************************************!*\
  7363. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-center.svg ***!
  7364. \*****************************************************************************/
  7365. /*! exports provided: default */
  7366. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7367. "use strict";
  7368. __webpack_require__.r(__webpack_exports__);
  7369. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2 4.5V3h16v1.5zm4.5 3V12h7V7.5h-7zM5.758 6h8.484c.419 0 .758.407.758.91v5.681c0 .502-.34.909-.758.909H5.758c-.419 0-.758-.407-.758-.91V6.91c0-.503.34-.91.758-.91zM2 16.5V15h16v1.5z\"/></svg>");
  7370. /***/ }),
  7371. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-full-width.svg":
  7372. /*!*********************************************************************************!*\
  7373. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-full-width.svg ***!
  7374. \*********************************************************************************/
  7375. /*! exports provided: default */
  7376. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7377. "use strict";
  7378. __webpack_require__.r(__webpack_exports__);
  7379. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2 4.5V3h16v1.5zm2.5 3V12h11V7.5h-11zM4.061 6H15.94c.586 0 1.061.407 1.061.91v5.68c0 .503-.475.91-1.061.91H4.06c-.585 0-1.06-.407-1.06-.91V6.91C3 6.406 3.475 6 4.061 6zM2 16.5V15h16v1.5z\"/></svg>");
  7380. /***/ }),
  7381. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-left.svg":
  7382. /*!***************************************************************************!*\
  7383. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-left.svg ***!
  7384. \***************************************************************************/
  7385. /*! exports provided: default */
  7386. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7387. "use strict";
  7388. __webpack_require__.r(__webpack_exports__);
  7389. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\" clip-rule=\"evenodd\" stroke-linejoin=\"round\" stroke-miterlimit=\"1.414\"><path d=\"M18 4.5V3H2v1.5h16zm0 3V6h-5.674v1.5H18zm0 3V9h-5.674v1.5H18zm0 3V12h-5.674v1.5H18zm-8.5-6V12h-6V7.5h6zm.818-1.5H2.682C2.305 6 2 6.407 2 6.91v5.68c0 .503.305.91.682.91h7.636c.377 0 .682-.407.682-.91V6.91c0-.503-.305-.91-.682-.91zM18 16.5V15H2v1.5h16z\"/></svg>");
  7390. /***/ }),
  7391. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-right.svg":
  7392. /*!****************************************************************************!*\
  7393. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-right.svg ***!
  7394. \****************************************************************************/
  7395. /*! exports provided: default */
  7396. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7397. "use strict";
  7398. __webpack_require__.r(__webpack_exports__);
  7399. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2 4.5V3h16v1.5zm0 3V6h5.674v1.5zm0 3V9h5.674v1.5zm0 3V12h5.674v1.5zm8.5-6V12h6V7.5h-6zM9.682 6h7.636c.377 0 .682.407.682.91v5.68c0 .503-.305.91-.682.91H9.682c-.377 0-.682-.407-.682-.91V6.91c0-.503.305-.91.682-.91zM2 16.5V15h16v1.5z\"/></svg>");
  7400. /***/ }),
  7401. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-full.svg":
  7402. /*!********************************************************************************!*\
  7403. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-full.svg ***!
  7404. \********************************************************************************/
  7405. /*! exports provided: default */
  7406. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7407. "use strict";
  7408. __webpack_require__.r(__webpack_exports__);
  7409. /* harmony default export */ __webpack_exports__["default"] = ("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path d=\"M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z\"/><path d=\"M18.095 2H1.905C.853 2 0 2.895 0 4v12c0 1.105.853 2 1.905 2h16.19C19.147 18 20 17.105 20 16V4c0-1.105-.853-2-1.905-2zm0 1.5c.263 0 .476.224.476.5v12c0 .276-.213.5-.476.5H1.905a.489.489 0 0 1-.476-.5V4c0-.276.213-.5.476-.5h16.19z\"/></svg>");
  7410. /***/ }),
  7411. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-large.svg":
  7412. /*!*********************************************************************************!*\
  7413. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-large.svg ***!
  7414. \*********************************************************************************/
  7415. /*! exports provided: default */
  7416. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7417. "use strict";
  7418. __webpack_require__.r(__webpack_exports__);
  7419. /* harmony default export */ __webpack_exports__["default"] = ("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path d=\"M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z\"/><path d=\"M13 6H2a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2zm0 1.5a.5.5 0 0 1 .5.5v8a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5V8a.5.5 0 0 1 .5-.5h11z\"/></svg>");
  7420. /***/ }),
  7421. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-medium.svg":
  7422. /*!**********************************************************************************!*\
  7423. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-medium.svg ***!
  7424. \**********************************************************************************/
  7425. /*! exports provided: default */
  7426. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7427. "use strict";
  7428. __webpack_require__.r(__webpack_exports__);
  7429. /* harmony default export */ __webpack_exports__["default"] = ("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path d=\"M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z\"/><path d=\"M10 8H2a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2v-6a2 2 0 0 0-2-2zm0 1.5a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5v-6a.5.5 0 0 1 .5-.5h8z\"/></svg>");
  7430. /***/ }),
  7431. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-small.svg":
  7432. /*!*********************************************************************************!*\
  7433. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-small.svg ***!
  7434. \*********************************************************************************/
  7435. /*! exports provided: default */
  7436. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7437. "use strict";
  7438. __webpack_require__.r(__webpack_exports__);
  7439. /* harmony default export */ __webpack_exports__["default"] = ("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path d=\"M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z\"/><path d=\"M7 10H2a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h5a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2zm0 1.5a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 .5-.5h5z\"/></svg>");
  7440. /***/ }),
  7441. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/pencil.svg":
  7442. /*!**********************************************************************!*\
  7443. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/pencil.svg ***!
  7444. \**********************************************************************/
  7445. /*! exports provided: default */
  7446. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7447. "use strict";
  7448. __webpack_require__.r(__webpack_exports__);
  7449. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M7.3 17.37l-.061.088a1.518 1.518 0 0 1-.934.535l-4.178.663-.806-4.153a1.495 1.495 0 0 1 .187-1.058l.056-.086L8.77 2.639c.958-1.351 2.803-1.076 4.296-.03 1.497 1.047 2.387 2.693 1.433 4.055L7.3 17.37zM9.14 4.728l-5.545 8.346 3.277 2.294 5.544-8.346L9.14 4.728zM6.07 16.512l-3.276-2.295.53 2.73 2.746-.435zM9.994 3.506L13.271 5.8c.316-.452-.16-1.333-1.065-1.966-.905-.634-1.895-.78-2.212-.328zM8 18.5L9.375 17H19v1.5H8z\"/></svg>");
  7450. /***/ }),
  7451. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/quote.svg":
  7452. /*!*********************************************************************!*\
  7453. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/quote.svg ***!
  7454. \*********************************************************************/
  7455. /*! exports provided: default */
  7456. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7457. "use strict";
  7458. __webpack_require__.r(__webpack_exports__);
  7459. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M3 10.423a6.5 6.5 0 0 1 6.056-6.408l.038.67C6.448 5.423 5.354 7.663 5.22 10H9c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003v-4.574zm8 0a6.5 6.5 0 0 1 6.056-6.408l.038.67c-2.646.739-3.74 2.979-3.873 5.315H17c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003v-4.574z\"/></svg>");
  7460. /***/ }),
  7461. /***/ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/three-vertical-dots.svg":
  7462. /*!***********************************************************************************!*\
  7463. !*** ./node_modules/@ckeditor/ckeditor5-core/theme/icons/three-vertical-dots.svg ***!
  7464. \***********************************************************************************/
  7465. /*! exports provided: default */
  7466. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7467. "use strict";
  7468. __webpack_require__.r(__webpack_exports__);
  7469. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><circle cx=\"9.5\" cy=\"4.5\" r=\"1.5\"/><circle cx=\"9.5\" cy=\"10.5\" r=\"1.5\"/><circle cx=\"9.5\" cy=\"16.5\" r=\"1.5\"/></svg>");
  7470. /***/ }),
  7471. /***/ "./node_modules/@ckeditor/ckeditor5-easy-image/src/cloudservicesuploadadapter.js":
  7472. /*!***************************************************************************************!*\
  7473. !*** ./node_modules/@ckeditor/ckeditor5-easy-image/src/cloudservicesuploadadapter.js ***!
  7474. \***************************************************************************************/
  7475. /*! exports provided: default */
  7476. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7477. "use strict";
  7478. __webpack_require__.r(__webpack_exports__);
  7479. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CloudServicesUploadAdapter; });
  7480. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  7481. /* harmony import */ var _ckeditor_ckeditor5_upload_src_filerepository__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-upload/src/filerepository */ "./node_modules/@ckeditor/ckeditor5-upload/src/filerepository.js");
  7482. /* harmony import */ var _ckeditor_ckeditor_cloud_services_core_src_uploadgateway_uploadgateway__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor-cloud-services-core/src/uploadgateway/uploadgateway */ "./node_modules/@ckeditor/ckeditor-cloud-services-core/src/uploadgateway/uploadgateway.js");
  7483. /* harmony import */ var _ckeditor_ckeditor5_cloud_services_src_cloudservices__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-cloud-services/src/cloudservices */ "./node_modules/@ckeditor/ckeditor5-cloud-services/src/cloudservices.js");
  7484. /**
  7485. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  7486. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  7487. */
  7488. /**
  7489. * @module easy-image/cloudservicesuploadadapter
  7490. */
  7491. /**
  7492. * A plugin that enables upload to [CKEditor Cloud Services](https://ckeditor.com/ckeditor-cloud-services/).
  7493. *
  7494. * It is mainly used by the {@link module:easy-image/easyimage~EasyImage} feature.
  7495. *
  7496. * After enabling this adapter you need to configure the CKEditor Cloud Services integration through
  7497. * {@link module:cloud-services/cloudservices~CloudServicesConfig `config.cloudServices`}.
  7498. *
  7499. * @extends module:core/plugin~Plugin
  7500. */
  7501. class CloudServicesUploadAdapter extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  7502. /**
  7503. * @inheritDoc
  7504. */
  7505. static get requires() {
  7506. return [ _ckeditor_ckeditor5_upload_src_filerepository__WEBPACK_IMPORTED_MODULE_1__["default"], _ckeditor_ckeditor5_cloud_services_src_cloudservices__WEBPACK_IMPORTED_MODULE_3__["default"] ];
  7507. }
  7508. /**
  7509. * @inheritDoc
  7510. */
  7511. init() {
  7512. const editor = this.editor;
  7513. const cloudServices = editor.plugins.get( _ckeditor_ckeditor5_cloud_services_src_cloudservices__WEBPACK_IMPORTED_MODULE_3__["default"] );
  7514. const token = cloudServices.token;
  7515. const uploadUrl = cloudServices.uploadUrl;
  7516. if ( !token ) {
  7517. return;
  7518. }
  7519. this._uploadGateway = new CloudServicesUploadAdapter._UploadGateway( token, uploadUrl );
  7520. editor.plugins.get( _ckeditor_ckeditor5_upload_src_filerepository__WEBPACK_IMPORTED_MODULE_1__["default"] ).createUploadAdapter = loader => {
  7521. return new Adapter( this._uploadGateway, loader );
  7522. };
  7523. }
  7524. }
  7525. /**
  7526. * @private
  7527. */
  7528. class Adapter {
  7529. constructor( uploadGateway, loader ) {
  7530. this.uploadGateway = uploadGateway;
  7531. this.loader = loader;
  7532. }
  7533. upload() {
  7534. return this.loader.file.then( file => {
  7535. this.fileUploader = this.uploadGateway.upload( file );
  7536. this.fileUploader.on( 'progress', ( evt, data ) => {
  7537. this.loader.uploadTotal = data.total;
  7538. this.loader.uploaded = data.uploaded;
  7539. } );
  7540. return this.fileUploader.send();
  7541. } );
  7542. }
  7543. abort() {
  7544. this.fileUploader.abort();
  7545. }
  7546. }
  7547. // Store the API in static property to easily overwrite it in tests.
  7548. // Too bad dependency injection does not work in Webpack + ES 6 (const) + Babel.
  7549. CloudServicesUploadAdapter._UploadGateway = _ckeditor_ckeditor_cloud_services_core_src_uploadgateway_uploadgateway__WEBPACK_IMPORTED_MODULE_2__["default"];
  7550. /***/ }),
  7551. /***/ "./node_modules/@ckeditor/ckeditor5-easy-image/src/easyimage.js":
  7552. /*!**********************************************************************!*\
  7553. !*** ./node_modules/@ckeditor/ckeditor5-easy-image/src/easyimage.js ***!
  7554. \**********************************************************************/
  7555. /*! exports provided: default */
  7556. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7557. "use strict";
  7558. __webpack_require__.r(__webpack_exports__);
  7559. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EasyImage; });
  7560. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  7561. /* harmony import */ var _cloudservicesuploadadapter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./cloudservicesuploadadapter */ "./node_modules/@ckeditor/ckeditor5-easy-image/src/cloudservicesuploadadapter.js");
  7562. /* harmony import */ var _ckeditor_ckeditor5_image_src_image__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-image/src/image */ "./node_modules/@ckeditor/ckeditor5-image/src/image.js");
  7563. /* harmony import */ var _ckeditor_ckeditor5_image_src_imageupload__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-image/src/imageupload */ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload.js");
  7564. /**
  7565. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  7566. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  7567. */
  7568. /**
  7569. * @module easy-image/easyimage
  7570. */
  7571. /**
  7572. * The Easy Image feature, which makes the image upload in CKEditor 5 possible with virtually zero
  7573. * server setup. A part of the [CKEditor Cloud Services](https://ckeditor.com/ckeditor-cloud-services/)
  7574. * family.
  7575. *
  7576. * This is a "glue" plugin which enables:
  7577. *
  7578. * * {@link module:image/image~Image},
  7579. * * {@link module:image/imageupload~ImageUpload},
  7580. * * {@link module:easy-image/cloudservicesuploadadapter~CloudServicesUploadAdapter}.
  7581. *
  7582. * See the {@glink features/image-upload/easy-image "Easy Image integration" guide} to learn how to configure
  7583. * and use this feature.
  7584. *
  7585. * Check out the {@glink features/image-upload/image-upload comprehensive "Image upload" guide} to learn about
  7586. * other ways to upload images into CKEditor 5.
  7587. *
  7588. * **Note**: After enabling the Easy Image plugin you need to configure the
  7589. * [CKEditor Cloud Services](https://ckeditor.com/ckeditor-cloud-services/)
  7590. * integration through {@link module:cloud-services/cloudservices~CloudServicesConfig `config.cloudServices`}.
  7591. *
  7592. * @extends module:core/plugin~Plugin
  7593. */
  7594. class EasyImage extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  7595. /**
  7596. * @inheritDoc
  7597. */
  7598. static get requires() {
  7599. return [
  7600. _cloudservicesuploadadapter__WEBPACK_IMPORTED_MODULE_1__["default"],
  7601. _ckeditor_ckeditor5_image_src_image__WEBPACK_IMPORTED_MODULE_2__["default"],
  7602. _ckeditor_ckeditor5_image_src_imageupload__WEBPACK_IMPORTED_MODULE_3__["default"]
  7603. ];
  7604. }
  7605. /**
  7606. * @inheritDoc
  7607. */
  7608. static get pluginName() {
  7609. return 'EasyImage';
  7610. }
  7611. }
  7612. /***/ }),
  7613. /***/ "./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditor.js":
  7614. /*!******************************************************************************!*\
  7615. !*** ./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditor.js ***!
  7616. \******************************************************************************/
  7617. /*! exports provided: default */
  7618. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7619. "use strict";
  7620. __webpack_require__.r(__webpack_exports__);
  7621. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ClassicEditor; });
  7622. /* harmony import */ var _ckeditor_ckeditor5_core_src_editor_editor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/editor/editor */ "./node_modules/@ckeditor/ckeditor5-core/src/editor/editor.js");
  7623. /* harmony import */ var _ckeditor_ckeditor5_core_src_editor_utils_dataapimixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/editor/utils/dataapimixin */ "./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/dataapimixin.js");
  7624. /* harmony import */ var _ckeditor_ckeditor5_core_src_editor_utils_elementapimixin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/editor/utils/elementapimixin */ "./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/elementapimixin.js");
  7625. /* harmony import */ var _ckeditor_ckeditor5_core_src_editor_utils_attachtoform__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/editor/utils/attachtoform */ "./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/attachtoform.js");
  7626. /* harmony import */ var _ckeditor_ckeditor5_engine_src_dataprocessor_htmldataprocessor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor */ "./node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor.js");
  7627. /* harmony import */ var _classiceditorui__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./classiceditorui */ "./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditorui.js");
  7628. /* harmony import */ var _classiceditoruiview__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./classiceditoruiview */ "./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditoruiview.js");
  7629. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_getdatafromelement__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/getdatafromelement */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getdatafromelement.js");
  7630. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  7631. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  7632. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  7633. /**
  7634. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  7635. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  7636. */
  7637. /**
  7638. * @module editor-classic/classiceditor
  7639. */
  7640. /**
  7641. * The {@glink builds/guides/overview#classic-editor classic editor} implementation.
  7642. * It uses an inline editable and a sticky toolbar, all enclosed in a boxed UI.
  7643. * See the {@glink examples/builds/classic-editor demo}.
  7644. *
  7645. * In order to create a classic editor instance, use the static
  7646. * {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`} method.
  7647. *
  7648. * # Classic editor and classic build
  7649. *
  7650. * The classic editor can be used directly from source (if you installed the
  7651. * [`@ckeditor/ckeditor5-editor-classic`](https://www.npmjs.com/package/@ckeditor/ckeditor5-editor-classic) package)
  7652. * but it is also available in the {@glink builds/guides/overview#classic-editor classic build}.
  7653. *
  7654. * {@glink builds/guides/overview Builds} are ready-to-use editors with plugins bundled in. When using the editor from
  7655. * source you need to take care of loading all plugins by yourself
  7656. * (through the {@link module:core/editor/editorconfig~EditorConfig#plugins `config.plugins`} option).
  7657. * Using the editor from source gives much better flexibility and allows easier customization.
  7658. *
  7659. * Read more about initializing the editor from source or as a build in
  7660. * {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`}.
  7661. *
  7662. * @mixes module:core/editor/utils/dataapimixin~DataApiMixin
  7663. * @mixes module:core/editor/utils/elementapimixin~ElementApiMixin
  7664. * @implements module:core/editor/editorwithui~EditorWithUI
  7665. * @extends module:core/editor/editor~Editor
  7666. */
  7667. class ClassicEditor extends _ckeditor_ckeditor5_core_src_editor_editor__WEBPACK_IMPORTED_MODULE_0__["default"] {
  7668. /**
  7669. * Creates an instance of the classic editor.
  7670. *
  7671. * **Note:** do not use the constructor to create editor instances. Use the static
  7672. * {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`} method instead.
  7673. *
  7674. * @protected
  7675. * @param {HTMLElement|String} sourceElementOrData The DOM element that will be the source for the created editor
  7676. * or the editor's initial data. For more information see
  7677. * {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`}.
  7678. * @param {module:core/editor/editorconfig~EditorConfig} config The editor configuration.
  7679. */
  7680. constructor( sourceElementOrData, config ) {
  7681. super( config );
  7682. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_9__["isElement"])( sourceElementOrData ) ) {
  7683. this.sourceElement = sourceElementOrData;
  7684. }
  7685. this.data.processor = new _ckeditor_ckeditor5_engine_src_dataprocessor_htmldataprocessor__WEBPACK_IMPORTED_MODULE_4__["default"]( this.data.viewDocument );
  7686. this.model.document.createRoot();
  7687. const shouldToolbarGroupWhenFull = !this.config.get( 'toolbar.shouldNotGroupWhenFull' );
  7688. const view = new _classiceditoruiview__WEBPACK_IMPORTED_MODULE_6__["default"]( this.locale, this.editing.view, {
  7689. shouldToolbarGroupWhenFull
  7690. } );
  7691. this.ui = new _classiceditorui__WEBPACK_IMPORTED_MODULE_5__["default"]( this, view );
  7692. Object(_ckeditor_ckeditor5_core_src_editor_utils_attachtoform__WEBPACK_IMPORTED_MODULE_3__["default"])( this );
  7693. }
  7694. /**
  7695. * Destroys the editor instance, releasing all resources used by it.
  7696. *
  7697. * Updates the editor's source element with the data.
  7698. *
  7699. * @returns {Promise}
  7700. */
  7701. destroy() {
  7702. if ( this.sourceElement ) {
  7703. this.updateSourceElement();
  7704. }
  7705. this.ui.destroy();
  7706. return super.destroy();
  7707. }
  7708. /**
  7709. * Creates a new classic editor instance.
  7710. *
  7711. * There are three ways how the editor can be initialized.
  7712. *
  7713. * # Replacing a DOM element (and loading data from it)
  7714. *
  7715. * You can initialize the editor using an existing DOM element:
  7716. *
  7717. * ClassicEditor
  7718. * .create( document.querySelector( '#editor' ) )
  7719. * .then( editor => {
  7720. * console.log( 'Editor was initialized', editor );
  7721. * } )
  7722. * .catch( err => {
  7723. * console.error( err.stack );
  7724. * } );
  7725. *
  7726. * The element's content will be used as the editor data and the element will be replaced by the editor UI.
  7727. *
  7728. * # Creating a detached editor
  7729. *
  7730. * Alternatively, you can initialize the editor by passing the initial data directly as a string.
  7731. * In this case, the editor will render an element that must be inserted into the DOM:
  7732. *
  7733. * ClassicEditor
  7734. * .create( '<p>Hello world!</p>' )
  7735. * .then( editor => {
  7736. * console.log( 'Editor was initialized', editor );
  7737. *
  7738. * // Initial data was provided so the editor UI element needs to be added manually to the DOM.
  7739. * document.body.appendChild( editor.ui.element );
  7740. * } )
  7741. * .catch( err => {
  7742. * console.error( err.stack );
  7743. * } );
  7744. *
  7745. * This lets you dynamically append the editor to your web page whenever it is convenient for you. You may use this method if your
  7746. * web page content is generated on the client side and the DOM structure is not ready at the moment when you initialize the editor.
  7747. *
  7748. * # Replacing a DOM element (and data provided in `config.initialData`)
  7749. *
  7750. * You can also mix these two ways by providing a DOM element to be used and passing the initial data through the configuration:
  7751. *
  7752. * ClassicEditor
  7753. * .create( document.querySelector( '#editor' ), {
  7754. * initialData: '<h2>Initial data</h2><p>Foo bar.</p>'
  7755. * } )
  7756. * .then( editor => {
  7757. * console.log( 'Editor was initialized', editor );
  7758. * } )
  7759. * .catch( err => {
  7760. * console.error( err.stack );
  7761. * } );
  7762. *
  7763. * This method can be used to initialize the editor on an existing element with the specified content in case if your integration
  7764. * makes it difficult to set the content of the source element.
  7765. *
  7766. * Note that an error will be thrown if you pass the initial data both as the first parameter and also in the configuration.
  7767. *
  7768. * # Configuring the editor
  7769. *
  7770. * See the {@link module:core/editor/editorconfig~EditorConfig editor configuration documentation} to learn more about
  7771. * customizing plugins, toolbar and more.
  7772. *
  7773. * # Using the editor from source
  7774. *
  7775. * The code samples listed in the previous sections of this documentation assume that you are using an
  7776. * {@glink builds/guides/overview editor build} (for example – `@ckeditor/ckeditor5-build-classic`).
  7777. *
  7778. * If you want to use the classic editor from source (`@ckeditor/ckeditor5-editor-classic/src/classiceditor`),
  7779. * you need to define the list of
  7780. * {@link module:core/editor/editorconfig~EditorConfig#plugins plugins to be initialized} and
  7781. * {@link module:core/editor/editorconfig~EditorConfig#toolbar toolbar items}. Read more about using the editor from
  7782. * source in the {@glink builds/guides/integration/advanced-setup "Advanced setup" guide}.
  7783. *
  7784. * @param {HTMLElement|String} sourceElementOrData The DOM element that will be the source for the created editor
  7785. * or the editor's initial data.
  7786. *
  7787. * If a DOM element is passed, its content will be automatically loaded to the editor upon initialization
  7788. * and the {@link module:editor-classic/classiceditorui~ClassicEditorUI#element editor element} will replace the passed element
  7789. * in the DOM (the original one will be hidden and the editor will be injected next to it).
  7790. *
  7791. * Moreover, the editor data will be set back to the original element once the editor is destroyed and when a form, in which
  7792. * this element is contained, is submitted (if the original element is a `<textarea>`). This ensures seamless integration with native
  7793. * web forms.
  7794. *
  7795. * If the initial data is passed, a detached editor will be created. In this case you need to insert it into the DOM manually.
  7796. * It is available under the {@link module:editor-classic/classiceditorui~ClassicEditorUI#element `editor.ui.element`} property.
  7797. *
  7798. * @param {module:core/editor/editorconfig~EditorConfig} [config] The editor configuration.
  7799. * @returns {Promise} A promise resolved once the editor is ready. The promise resolves with the created editor instance.
  7800. */
  7801. static create( sourceElementOrData, config = {} ) {
  7802. return new Promise( resolve => {
  7803. const editor = new this( sourceElementOrData, config );
  7804. resolve(
  7805. editor.initPlugins()
  7806. .then( () => editor.ui.init( Object(lodash_es__WEBPACK_IMPORTED_MODULE_9__["isElement"])( sourceElementOrData ) ? sourceElementOrData : null ) )
  7807. .then( () => {
  7808. if ( !Object(lodash_es__WEBPACK_IMPORTED_MODULE_9__["isElement"])( sourceElementOrData ) && config.initialData ) {
  7809. // Documented in core/editor/editorconfig.jdoc.
  7810. // eslint-disable-next-line ckeditor5-rules/ckeditor-error-message
  7811. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_10__["default"]( 'editor-create-initial-data', null );
  7812. }
  7813. const initialData = config.initialData || getInitialData( sourceElementOrData );
  7814. return editor.data.init( initialData );
  7815. } )
  7816. .then( () => editor.fire( 'ready' ) )
  7817. .then( () => editor )
  7818. );
  7819. } );
  7820. }
  7821. }
  7822. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_8__["default"])( ClassicEditor, _ckeditor_ckeditor5_core_src_editor_utils_dataapimixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  7823. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_8__["default"])( ClassicEditor, _ckeditor_ckeditor5_core_src_editor_utils_elementapimixin__WEBPACK_IMPORTED_MODULE_2__["default"] );
  7824. function getInitialData( sourceElementOrData ) {
  7825. return Object(lodash_es__WEBPACK_IMPORTED_MODULE_9__["isElement"])( sourceElementOrData ) ? Object(_ckeditor_ckeditor5_utils_src_dom_getdatafromelement__WEBPACK_IMPORTED_MODULE_7__["default"])( sourceElementOrData ) : sourceElementOrData;
  7826. }
  7827. /***/ }),
  7828. /***/ "./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditorui.js":
  7829. /*!********************************************************************************!*\
  7830. !*** ./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditorui.js ***!
  7831. \********************************************************************************/
  7832. /*! exports provided: default */
  7833. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7834. "use strict";
  7835. __webpack_require__.r(__webpack_exports__);
  7836. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ClassicEditorUI; });
  7837. /* harmony import */ var _ckeditor_ckeditor5_core_src_editor_editorui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/editor/editorui */ "./node_modules/@ckeditor/ckeditor5-core/src/editor/editorui.js");
  7838. /* harmony import */ var _ckeditor_ckeditor5_ui_src_toolbar_enabletoolbarkeyboardfocus__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/toolbar/enabletoolbarkeyboardfocus */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/enabletoolbarkeyboardfocus.js");
  7839. /* harmony import */ var _ckeditor_ckeditor5_ui_src_toolbar_normalizetoolbarconfig__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/toolbar/normalizetoolbarconfig */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/normalizetoolbarconfig.js");
  7840. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_placeholder__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/placeholder */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/placeholder.js");
  7841. /* harmony import */ var _ckeditor_ckeditor5_utils_src_elementreplacer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/elementreplacer */ "./node_modules/@ckeditor/ckeditor5-utils/src/elementreplacer.js");
  7842. /**
  7843. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  7844. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  7845. */
  7846. /**
  7847. * @module editor-classic/classiceditorui
  7848. */
  7849. /**
  7850. * The classic editor UI class.
  7851. *
  7852. * @extends module:core/editor/editorui~EditorUI
  7853. */
  7854. class ClassicEditorUI extends _ckeditor_ckeditor5_core_src_editor_editorui__WEBPACK_IMPORTED_MODULE_0__["default"] {
  7855. /**
  7856. * Creates an instance of the classic editor UI class.
  7857. *
  7858. * @param {module:core/editor/editor~Editor} editor The editor instance.
  7859. * @param {module:ui/editorui/editoruiview~EditorUIView} view The view of the UI.
  7860. */
  7861. constructor( editor, view ) {
  7862. super( editor );
  7863. /**
  7864. * The main (top–most) view of the editor UI.
  7865. *
  7866. * @readonly
  7867. * @member {module:ui/editorui/editoruiview~EditorUIView} #view
  7868. */
  7869. this.view = view;
  7870. /**
  7871. * A normalized `config.toolbar` object.
  7872. *
  7873. * @private
  7874. * @member {Object}
  7875. */
  7876. this._toolbarConfig = Object(_ckeditor_ckeditor5_ui_src_toolbar_normalizetoolbarconfig__WEBPACK_IMPORTED_MODULE_2__["default"])( editor.config.get( 'toolbar' ) );
  7877. /**
  7878. * The element replacer instance used to hide the editor's source element.
  7879. *
  7880. * @protected
  7881. * @member {module:utils/elementreplacer~ElementReplacer}
  7882. */
  7883. this._elementReplacer = new _ckeditor_ckeditor5_utils_src_elementreplacer__WEBPACK_IMPORTED_MODULE_4__["default"]();
  7884. }
  7885. /**
  7886. * @inheritDoc
  7887. */
  7888. get element() {
  7889. return this.view.element;
  7890. }
  7891. /**
  7892. * Initializes the UI.
  7893. *
  7894. * @param {HTMLElement|null} replacementElement The DOM element that will be the source for the created editor.
  7895. */
  7896. init( replacementElement ) {
  7897. const editor = this.editor;
  7898. const view = this.view;
  7899. const editingView = editor.editing.view;
  7900. const editable = view.editable;
  7901. const editingRoot = editingView.document.getRoot();
  7902. // The editable UI and editing root should share the same name. Then name is used
  7903. // to recognize the particular editable, for instance in ARIA attributes.
  7904. editable.name = editingRoot.rootName;
  7905. view.render();
  7906. // The editable UI element in DOM is available for sure only after the editor UI view has been rendered.
  7907. // But it can be available earlier if a DOM element has been passed to BalloonEditor.create().
  7908. const editableElement = editable.element;
  7909. // Register the editable UI view in the editor. A single editor instance can aggregate multiple
  7910. // editable areas (roots) but the classic editor has only one.
  7911. this.setEditableElement( editable.name, editableElement );
  7912. // Let the global focus tracker know that the editable UI element is focusable and
  7913. // belongs to the editor. From now on, the focus tracker will sustain the editor focus
  7914. // as long as the editable is focused (e.g. the user is typing).
  7915. this.focusTracker.add( editableElement );
  7916. // Let the editable UI element respond to the changes in the global editor focus
  7917. // tracker. It has been added to the same tracker a few lines above but, in reality, there are
  7918. // many focusable areas in the editor, like balloons, toolbars or dropdowns and as long
  7919. // as they have focus, the editable should act like it is focused too (although technically
  7920. // it isn't), e.g. by setting the proper CSS class, visually announcing focus to the user.
  7921. // Doing otherwise will result in editable focus styles disappearing, once e.g. the
  7922. // toolbar gets focused.
  7923. view.editable.bind( 'isFocused' ).to( this.focusTracker );
  7924. // Bind the editable UI element to the editing view, making it an end– and entry–point
  7925. // of the editor's engine. This is where the engine meets the UI.
  7926. editingView.attachDomRoot( editableElement );
  7927. // If an element containing the initial data of the editor was provided, replace it with
  7928. // an editor instance's UI in DOM until the editor is destroyed. For instance, a <textarea>
  7929. // can be such element.
  7930. if ( replacementElement ) {
  7931. this._elementReplacer.replace( replacementElement, this.element );
  7932. }
  7933. this._initPlaceholder();
  7934. this._initToolbar();
  7935. this.fire( 'ready' );
  7936. }
  7937. /**
  7938. * @inheritDoc
  7939. */
  7940. destroy() {
  7941. const view = this.view;
  7942. const editingView = this.editor.editing.view;
  7943. this._elementReplacer.restore();
  7944. editingView.detachDomRoot( view.editable.name );
  7945. view.destroy();
  7946. super.destroy();
  7947. }
  7948. /**
  7949. * Initializes the editor toolbar.
  7950. *
  7951. * @private
  7952. */
  7953. _initToolbar() {
  7954. const editor = this.editor;
  7955. const view = this.view;
  7956. const editingView = editor.editing.view;
  7957. // Set–up the sticky panel with toolbar.
  7958. view.stickyPanel.bind( 'isActive' ).to( this.focusTracker, 'isFocused' );
  7959. view.stickyPanel.limiterElement = view.element;
  7960. if ( this._toolbarConfig.viewportTopOffset ) {
  7961. view.stickyPanel.viewportTopOffset = this._toolbarConfig.viewportTopOffset;
  7962. }
  7963. view.toolbar.fillFromConfig( this._toolbarConfig.items, this.componentFactory );
  7964. Object(_ckeditor_ckeditor5_ui_src_toolbar_enabletoolbarkeyboardfocus__WEBPACK_IMPORTED_MODULE_1__["default"])( {
  7965. origin: editingView,
  7966. originFocusTracker: this.focusTracker,
  7967. originKeystrokeHandler: editor.keystrokes,
  7968. toolbar: view.toolbar
  7969. } );
  7970. }
  7971. /**
  7972. * Enable the placeholder text on the editing root, if any was configured.
  7973. *
  7974. * @private
  7975. */
  7976. _initPlaceholder() {
  7977. const editor = this.editor;
  7978. const editingView = editor.editing.view;
  7979. const editingRoot = editingView.document.getRoot();
  7980. const sourceElement = editor.sourceElement;
  7981. const placeholderText = editor.config.get( 'placeholder' ) ||
  7982. sourceElement && sourceElement.tagName.toLowerCase() === 'textarea' && sourceElement.getAttribute( 'placeholder' );
  7983. if ( placeholderText ) {
  7984. Object(_ckeditor_ckeditor5_engine_src_view_placeholder__WEBPACK_IMPORTED_MODULE_3__["enablePlaceholder"])( {
  7985. view: editingView,
  7986. element: editingRoot,
  7987. text: placeholderText,
  7988. isDirectHost: false
  7989. } );
  7990. }
  7991. }
  7992. }
  7993. /***/ }),
  7994. /***/ "./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditoruiview.js":
  7995. /*!************************************************************************************!*\
  7996. !*** ./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditoruiview.js ***!
  7997. \************************************************************************************/
  7998. /*! exports provided: default */
  7999. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8000. "use strict";
  8001. __webpack_require__.r(__webpack_exports__);
  8002. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ClassicEditorUIView; });
  8003. /* harmony import */ var _ckeditor_ckeditor5_ui_src_editorui_boxed_boxededitoruiview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/editorui/boxed/boxededitoruiview */ "./node_modules/@ckeditor/ckeditor5-ui/src/editorui/boxed/boxededitoruiview.js");
  8004. /* harmony import */ var _ckeditor_ckeditor5_ui_src_editableui_inline_inlineeditableuiview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/editableui/inline/inlineeditableuiview */ "./node_modules/@ckeditor/ckeditor5-ui/src/editableui/inline/inlineeditableuiview.js");
  8005. /* harmony import */ var _ckeditor_ckeditor5_ui_src_panel_sticky_stickypanelview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/panel/sticky/stickypanelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/sticky/stickypanelview.js");
  8006. /* harmony import */ var _ckeditor_ckeditor5_ui_src_toolbar_toolbarview__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/toolbar/toolbarview */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarview.js");
  8007. /* harmony import */ var _theme_classiceditor_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../theme/classiceditor.css */ "./node_modules/@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css");
  8008. /* harmony import */ var _theme_classiceditor_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_theme_classiceditor_css__WEBPACK_IMPORTED_MODULE_4__);
  8009. /**
  8010. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  8011. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  8012. */
  8013. /**
  8014. * @module editor-classic/classiceditoruiview
  8015. */
  8016. /**
  8017. * Classic editor UI view. Uses an inline editable and a sticky toolbar, all
  8018. * enclosed in a boxed UI view.
  8019. *
  8020. * @extends module:ui/editorui/boxed/boxededitoruiview~BoxedEditorUIView
  8021. */
  8022. class ClassicEditorUIView extends _ckeditor_ckeditor5_ui_src_editorui_boxed_boxededitoruiview__WEBPACK_IMPORTED_MODULE_0__["default"] {
  8023. /**
  8024. * Creates an instance of the classic editor UI view.
  8025. *
  8026. * @param {module:utils/locale~Locale} locale The {@link module:core/editor/editor~Editor#locale} instance.
  8027. * @param {module:engine/view/view~View} editingView The editing view instance this view is related to.
  8028. * @param {Object} [options={}] Configuration options fo the view instance.
  8029. * @param {Boolean} [options.shouldToolbarGroupWhenFull] When set `true` enables automatic items grouping
  8030. * in the main {@link module:editor-classic/classiceditoruiview~ClassicEditorUIView#toolbar toolbar}.
  8031. * See {@link module:ui/toolbar/toolbarview~ToolbarOptions#shouldGroupWhenFull} to learn more.
  8032. */
  8033. constructor( locale, editingView, options = {} ) {
  8034. super( locale );
  8035. /**
  8036. * Sticky panel view instance. This is a parent view of a {@link #toolbar}
  8037. * that makes toolbar sticky.
  8038. *
  8039. * @readonly
  8040. * @member {module:ui/panel/sticky/stickypanelview~StickyPanelView}
  8041. */
  8042. this.stickyPanel = new _ckeditor_ckeditor5_ui_src_panel_sticky_stickypanelview__WEBPACK_IMPORTED_MODULE_2__["default"]( locale );
  8043. /**
  8044. * Toolbar view instance.
  8045. *
  8046. * @readonly
  8047. * @member {module:ui/toolbar/toolbarview~ToolbarView}
  8048. */
  8049. this.toolbar = new _ckeditor_ckeditor5_ui_src_toolbar_toolbarview__WEBPACK_IMPORTED_MODULE_3__["default"]( locale, {
  8050. shouldGroupWhenFull: options.shouldToolbarGroupWhenFull
  8051. } );
  8052. /**
  8053. * Editable UI view.
  8054. *
  8055. * @readonly
  8056. * @member {module:ui/editableui/inline/inlineeditableuiview~InlineEditableUIView}
  8057. */
  8058. this.editable = new _ckeditor_ckeditor5_ui_src_editableui_inline_inlineeditableuiview__WEBPACK_IMPORTED_MODULE_1__["default"]( locale, editingView );
  8059. }
  8060. /**
  8061. * @inheritDoc
  8062. */
  8063. render() {
  8064. super.render();
  8065. // Set toolbar as a child of a stickyPanel and makes toolbar sticky.
  8066. this.stickyPanel.content.add( this.toolbar );
  8067. this.top.add( this.stickyPanel );
  8068. this.main.add( this.editable );
  8069. }
  8070. }
  8071. /***/ }),
  8072. /***/ "./node_modules/@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css":
  8073. /*!*********************************************************************************!*\
  8074. !*** ./node_modules/@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css ***!
  8075. \*********************************************************************************/
  8076. /*! no static exports found */
  8077. /***/ (function(module, exports, __webpack_require__) {
  8078. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  8079. var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./classiceditor.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css");
  8080. content = content.__esModule ? content.default : content;
  8081. if (typeof content === 'string') {
  8082. content = [[module.i, content, '']];
  8083. }
  8084. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  8085. options.insert = "head";
  8086. options.singleton = true;
  8087. var update = api(content, options);
  8088. module.exports = content.locals || {};
  8089. /***/ }),
  8090. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/controller/datacontroller.js":
  8091. /*!**********************************************************************************!*\
  8092. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/controller/datacontroller.js ***!
  8093. \**********************************************************************************/
  8094. /*! exports provided: default */
  8095. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8096. "use strict";
  8097. __webpack_require__.r(__webpack_exports__);
  8098. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DataController; });
  8099. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  8100. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  8101. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  8102. /* harmony import */ var _conversion_mapper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../conversion/mapper */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/mapper.js");
  8103. /* harmony import */ var _conversion_downcastdispatcher__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../conversion/downcastdispatcher */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcastdispatcher.js");
  8104. /* harmony import */ var _conversion_downcasthelpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../conversion/downcasthelpers */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcasthelpers.js");
  8105. /* harmony import */ var _conversion_upcastdispatcher__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../conversion/upcastdispatcher */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcastdispatcher.js");
  8106. /* harmony import */ var _conversion_upcasthelpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../conversion/upcasthelpers */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcasthelpers.js");
  8107. /* harmony import */ var _view_documentfragment__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../view/documentfragment */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/documentfragment.js");
  8108. /* harmony import */ var _view_document__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../view/document */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/document.js");
  8109. /* harmony import */ var _view_downcastwriter__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../view/downcastwriter */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/downcastwriter.js");
  8110. /* harmony import */ var _model_range__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../model/range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  8111. /* harmony import */ var _model_utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../model/utils/autoparagraphing */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/autoparagraphing.js");
  8112. /**
  8113. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  8114. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  8115. */
  8116. /**
  8117. * @module engine/controller/datacontroller
  8118. */
  8119. /**
  8120. * Controller for the data pipeline. The data pipeline controls how data is retrieved from the document
  8121. * and set inside it. Hence, the controller features two methods which allow to {@link ~DataController#get get}
  8122. * and {@link ~DataController#set set} data of the {@link ~DataController#model model}
  8123. * using given:
  8124. *
  8125. * * {@link module:engine/dataprocessor/dataprocessor~DataProcessor data processor},
  8126. * * downcast converters,
  8127. * * upcast converters.
  8128. *
  8129. * An instance of the data controller is always available in the {@link module:core/editor/editor~Editor#data `editor.data`}
  8130. * property:
  8131. *
  8132. * editor.data.get( { rootName: 'customRoot' } ); // -> '<p>Hello!</p>'
  8133. *
  8134. * @mixes module:utils/observablemixin~ObservableMixin
  8135. */
  8136. class DataController {
  8137. /**
  8138. * Creates a data controller instance.
  8139. *
  8140. * @param {module:engine/model/model~Model} model Data model.
  8141. * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor The styles processor instance.
  8142. */
  8143. constructor( model, stylesProcessor ) {
  8144. /**
  8145. * Data model.
  8146. *
  8147. * @readonly
  8148. * @member {module:engine/model/model~Model}
  8149. */
  8150. this.model = model;
  8151. /**
  8152. * Styles processor used during the conversion.
  8153. *
  8154. * @readonly
  8155. * @member {module:engine/view/stylesmap~StylesProcessor}
  8156. */
  8157. this.stylesProcessor = stylesProcessor;
  8158. /**
  8159. * Data processor used during the conversion.
  8160. *
  8161. * @member {module:engine/dataprocessor/dataprocessor~DataProcessor} #processor
  8162. */
  8163. this.processor = undefined;
  8164. /**
  8165. * Mapper used for the conversion. It has no permanent bindings, because they are created when getting data and
  8166. * cleared directly after the data are converted. However, the mapper is defined as a class property, because
  8167. * it needs to be passed to the `DowncastDispatcher` as a conversion API.
  8168. *
  8169. * @readonly
  8170. * @member {module:engine/conversion/mapper~Mapper}
  8171. */
  8172. this.mapper = new _conversion_mapper__WEBPACK_IMPORTED_MODULE_3__["default"]();
  8173. /**
  8174. * Downcast dispatcher used by the {@link #get get method}. Downcast converters should be attached to it.
  8175. *
  8176. * @readonly
  8177. * @member {module:engine/conversion/downcastdispatcher~DowncastDispatcher}
  8178. */
  8179. this.downcastDispatcher = new _conversion_downcastdispatcher__WEBPACK_IMPORTED_MODULE_4__["default"]( {
  8180. mapper: this.mapper,
  8181. schema: model.schema
  8182. } );
  8183. this.downcastDispatcher.on( 'insert:$text', Object(_conversion_downcasthelpers__WEBPACK_IMPORTED_MODULE_5__["insertText"])(), { priority: 'lowest' } );
  8184. /**
  8185. * Upcast dispatcher used by the {@link #set set method}. Upcast converters should be attached to it.
  8186. *
  8187. * @readonly
  8188. * @member {module:engine/conversion/upcastdispatcher~UpcastDispatcher}
  8189. */
  8190. this.upcastDispatcher = new _conversion_upcastdispatcher__WEBPACK_IMPORTED_MODULE_6__["default"]( {
  8191. schema: model.schema
  8192. } );
  8193. /**
  8194. * The view document used by the data controller.
  8195. *
  8196. * @readonly
  8197. * @member {module:engine/view/document~Document}
  8198. */
  8199. this.viewDocument = new _view_document__WEBPACK_IMPORTED_MODULE_9__["default"]( stylesProcessor );
  8200. /**
  8201. * The view downcast writer just for data conversion purposes, i.e. to modify
  8202. * the {@link #viewDocument}.
  8203. *
  8204. * @private
  8205. * @readonly
  8206. * @member {module:engine/view/downcastwriter~DowncastWriter}
  8207. */
  8208. this._viewWriter = new _view_downcastwriter__WEBPACK_IMPORTED_MODULE_10__["default"]( this.viewDocument );
  8209. // Define default converters for text and elements.
  8210. //
  8211. // Note that if there is no default converter for the element it will be skipped, for instance `<b>foo</b>` will be
  8212. // converted to nothing. We therefore add `convertToModelFragment` as a last converter so it converts children of that
  8213. // element to the document fragment and so `<b>foo</b>` will be converted to `foo` if there is no converter for `<b>`.
  8214. this.upcastDispatcher.on( 'text', Object(_conversion_upcasthelpers__WEBPACK_IMPORTED_MODULE_7__["convertText"])(), { priority: 'lowest' } );
  8215. this.upcastDispatcher.on( 'element', Object(_conversion_upcasthelpers__WEBPACK_IMPORTED_MODULE_7__["convertToModelFragment"])(), { priority: 'lowest' } );
  8216. this.upcastDispatcher.on( 'documentFragment', Object(_conversion_upcasthelpers__WEBPACK_IMPORTED_MODULE_7__["convertToModelFragment"])(), { priority: 'lowest' } );
  8217. this.decorate( 'init' );
  8218. this.decorate( 'set' );
  8219. // Fire the `ready` event when the initialization has completed. Such low-level listener gives possibility
  8220. // to plug into the initialization pipeline without interrupting the initialization flow.
  8221. this.on( 'init', () => {
  8222. this.fire( 'ready' );
  8223. }, { priority: 'lowest' } );
  8224. // Fix empty roots after DataController is 'ready' (note that init method could be decorated and stopped).
  8225. // We need to handle this event because initial data could be empty and post-fixer would not get triggered.
  8226. this.on( 'ready', () => {
  8227. this.model.enqueueChange( 'transparent', _model_utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_12__["autoParagraphEmptyRoots"] );
  8228. }, { priority: 'lowest' } );
  8229. }
  8230. /**
  8231. * Returns the model's data converted by downcast dispatchers attached to {@link #downcastDispatcher} and
  8232. * formatted by the {@link #processor data processor}.
  8233. *
  8234. * @param {Object} [options] Additional configuration for the retrieved data. `DataController` provides two optional
  8235. * properties: `rootName` and `trim`. Other properties of this object are specified by various editor features.
  8236. * @param {String} [options.rootName='main'] Root name.
  8237. * @param {String} [options.trim='empty'] Whether returned data should be trimmed. This option is set to `empty` by default,
  8238. * which means whenever editor content is considered empty, an empty string will be returned. To turn off trimming completely
  8239. * use `'none'`. In such cases exact content will be returned (for example `<p>&nbsp;</p>` for an empty editor).
  8240. * @returns {String} Output data.
  8241. */
  8242. get( options = {} ) {
  8243. const { rootName = 'main', trim = 'empty' } = options;
  8244. if ( !this._checkIfRootsExists( [ rootName ] ) ) {
  8245. /**
  8246. * Cannot get data from a non-existing root. This error is thrown when {@link #get DataController#get() method}
  8247. * is called with non-existent root name. For example, if there is an editor instance with only `main` root,
  8248. * calling {@link #get} like:
  8249. *
  8250. * data.get( { rootName: 'root2' } );
  8251. *
  8252. * will throw this error.
  8253. *
  8254. * @error datacontroller-get-non-existent-root
  8255. */
  8256. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'datacontroller-get-non-existent-root', this );
  8257. }
  8258. const root = this.model.document.getRoot( rootName );
  8259. if ( trim === 'empty' && !this.model.hasContent( root, { ignoreWhitespaces: true } ) ) {
  8260. return '';
  8261. }
  8262. return this.stringify( root, options );
  8263. }
  8264. /**
  8265. * Returns the content of the given {@link module:engine/model/element~Element model's element} or
  8266. * {@link module:engine/model/documentfragment~DocumentFragment model document fragment} converted by the downcast converters
  8267. * attached to {@link #downcastDispatcher} and formatted by the {@link #processor data processor}.
  8268. *
  8269. * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} modelElementOrFragment
  8270. * Element whose content will be stringified.
  8271. * @param {Object} [options] Additional configuration passed to the conversion process.
  8272. * @returns {String} Output data.
  8273. */
  8274. stringify( modelElementOrFragment, options ) {
  8275. // Model -> view.
  8276. const viewDocumentFragment = this.toView( modelElementOrFragment, options );
  8277. // View -> data.
  8278. return this.processor.toData( viewDocumentFragment );
  8279. }
  8280. /**
  8281. * Returns the content of the given {@link module:engine/model/element~Element model element} or
  8282. * {@link module:engine/model/documentfragment~DocumentFragment model document fragment} converted by the downcast
  8283. * converters attached to {@link #downcastDispatcher} to a
  8284. * {@link module:engine/view/documentfragment~DocumentFragment view document fragment}.
  8285. *
  8286. * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} modelElementOrFragment
  8287. * Element or document fragment whose content will be converted.
  8288. * @param {Object} [options] Additional configuration that will be available through
  8289. * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi#options} during the conversion process.
  8290. * @returns {module:engine/view/documentfragment~DocumentFragment} Output view DocumentFragment.
  8291. */
  8292. toView( modelElementOrFragment, options ) {
  8293. const viewDocument = this.viewDocument;
  8294. const viewWriter = this._viewWriter;
  8295. // Clear bindings so the call to this method gives correct results.
  8296. this.mapper.clearBindings();
  8297. // First, convert elements.
  8298. const modelRange = _model_range__WEBPACK_IMPORTED_MODULE_11__["default"]._createIn( modelElementOrFragment );
  8299. const viewDocumentFragment = new _view_documentfragment__WEBPACK_IMPORTED_MODULE_8__["default"]( viewDocument );
  8300. this.mapper.bindElements( modelElementOrFragment, viewDocumentFragment );
  8301. // Make additional options available during conversion process through `conversionApi`.
  8302. this.downcastDispatcher.conversionApi.options = options;
  8303. // We have no view controller and rendering to DOM in DataController so view.change() block is not used here.
  8304. this.downcastDispatcher.convertInsert( modelRange, viewWriter );
  8305. if ( !modelElementOrFragment.is( 'documentFragment' ) ) {
  8306. // Then, if a document element is converted, convert markers.
  8307. // From all document markers, get those, which "intersect" with the converter element.
  8308. const markers = _getMarkersRelativeToElement( modelElementOrFragment );
  8309. for ( const [ name, range ] of markers ) {
  8310. this.downcastDispatcher.convertMarkerAdd( name, range, viewWriter );
  8311. }
  8312. }
  8313. // Clean `conversionApi`.
  8314. delete this.downcastDispatcher.conversionApi.options;
  8315. return viewDocumentFragment;
  8316. }
  8317. /**
  8318. * Sets initial input data parsed by the {@link #processor data processor} and
  8319. * converted by the {@link #upcastDispatcher view-to-model converters}.
  8320. * Initial data can be set only to document that {@link module:engine/model/document~Document#version} is equal 0.
  8321. *
  8322. * **Note** This method is {@link module:utils/observablemixin~ObservableMixin#decorate decorated} which is
  8323. * used by e.g. collaborative editing plugin that syncs remote data on init.
  8324. *
  8325. * When data is passed as a string it is initialized on a default `main` root:
  8326. *
  8327. * dataController.init( '<p>Foo</p>' ); // Initializes data on the `main` root.
  8328. *
  8329. * To initialize data on a different root or multiple roots at once, object containing `rootName` - `data` pairs should be passed:
  8330. *
  8331. * dataController.init( { main: '<p>Foo</p>', title: '<h1>Bar</h1>' } ); // Initializes data on the `main` and `title` roots.
  8332. *
  8333. * @fires init
  8334. * @param {String|Object.<String,String>} data Input data as a string or an object containing `rootName` - `data`
  8335. * pairs to initialize data on multiple roots at once.
  8336. * @returns {Promise} Promise that is resolved after the data is set on the editor.
  8337. */
  8338. init( data ) {
  8339. if ( this.model.document.version ) {
  8340. /**
  8341. * Cannot set initial data to not empty {@link module:engine/model/document~Document}.
  8342. * Initial data should be set once, during {@link module:core/editor/editor~Editor} initialization,
  8343. * when the {@link module:engine/model/document~Document#version} is equal 0.
  8344. *
  8345. * @error datacontroller-init-document-not-empty
  8346. */
  8347. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'datacontroller-init-document-not-empty', this );
  8348. }
  8349. let initialData = {};
  8350. if ( typeof data === 'string' ) {
  8351. initialData.main = data; // Default root is 'main'. To initiate data on a different root, object should be passed.
  8352. } else {
  8353. initialData = data;
  8354. }
  8355. if ( !this._checkIfRootsExists( Object.keys( initialData ) ) ) {
  8356. /**
  8357. * Cannot init data on a non-existing root. This error is thrown when {@link #init DataController#init() method}
  8358. * is called with non-existent root name. For example, if there is an editor instance with only `main` root,
  8359. * calling {@link #init} like:
  8360. *
  8361. * data.init( { main: '<p>Foo</p>', root2: '<p>Bar</p>' } );
  8362. *
  8363. * will throw this error.
  8364. *
  8365. * @error datacontroller-init-non-existent-root
  8366. */
  8367. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'datacontroller-init-non-existent-root', this );
  8368. }
  8369. this.model.enqueueChange( 'transparent', writer => {
  8370. for ( const rootName of Object.keys( initialData ) ) {
  8371. const modelRoot = this.model.document.getRoot( rootName );
  8372. writer.insert( this.parse( initialData[ rootName ], modelRoot ), modelRoot, 0 );
  8373. }
  8374. } );
  8375. return Promise.resolve();
  8376. }
  8377. /**
  8378. * Sets input data parsed by the {@link #processor data processor} and
  8379. * converted by the {@link #upcastDispatcher view-to-model converters}.
  8380. * This method can be used any time to replace existing editor data by the new one without clearing the
  8381. * {@link module:engine/model/document~Document#history document history}.
  8382. *
  8383. * This method also creates a batch with all the changes applied. If all you need is to parse data, use
  8384. * the {@link #parse} method.
  8385. *
  8386. * When data is passed as a string it is set on a default `main` root:
  8387. *
  8388. * dataController.set( '<p>Foo</p>' ); // Sets data on the `main` root.
  8389. *
  8390. * To set data on a different root or multiple roots at once, object containing `rootName` - `data` pairs should be passed:
  8391. *
  8392. * dataController.set( { main: '<p>Foo</p>', title: '<h1>Bar</h1>' } ); // Sets data on the `main` and `title` roots.
  8393. *
  8394. * @fires set
  8395. * @param {String|Object.<String,String>} data Input data as a string or an object containing `rootName` - `data`
  8396. * pairs to set data on multiple roots at once.
  8397. */
  8398. set( data ) {
  8399. let newData = {};
  8400. if ( typeof data === 'string' ) {
  8401. newData.main = data; // Default root is 'main'. To set data on a different root, object should be passed.
  8402. } else {
  8403. newData = data;
  8404. }
  8405. if ( !this._checkIfRootsExists( Object.keys( newData ) ) ) {
  8406. /**
  8407. * Cannot set data on a non-existing root. This error is thrown when {@link #set DataController#set() method}
  8408. * is called with non-existent root name. For example, if there is an editor instance with only `main` root,
  8409. * calling {@link #set} like:
  8410. *
  8411. * data.set( { main: '<p>Foo</p>', root2: '<p>Bar</p>' } );
  8412. *
  8413. * will throw this error.
  8414. *
  8415. * @error datacontroller-set-non-existent-root
  8416. */
  8417. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'datacontroller-set-non-existent-root', this );
  8418. }
  8419. this.model.enqueueChange( 'transparent', writer => {
  8420. writer.setSelection( null );
  8421. writer.removeSelectionAttribute( this.model.document.selection.getAttributeKeys() );
  8422. for ( const rootName of Object.keys( newData ) ) {
  8423. // Save to model.
  8424. const modelRoot = this.model.document.getRoot( rootName );
  8425. writer.remove( writer.createRangeIn( modelRoot ) );
  8426. writer.insert( this.parse( newData[ rootName ], modelRoot ), modelRoot, 0 );
  8427. }
  8428. } );
  8429. }
  8430. /**
  8431. * Returns the data parsed by the {@link #processor data processor} and then converted by upcast converters
  8432. * attached to the {@link #upcastDispatcher}.
  8433. *
  8434. * @see #set
  8435. * @param {String} data Data to parse.
  8436. * @param {module:engine/model/schema~SchemaContextDefinition} [context='$root'] Base context in which the view will
  8437. * be converted to the model. See: {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher#convert}.
  8438. * @returns {module:engine/model/documentfragment~DocumentFragment} Parsed data.
  8439. */
  8440. parse( data, context = '$root' ) {
  8441. // data -> view
  8442. const viewDocumentFragment = this.processor.toView( data );
  8443. // view -> model
  8444. return this.toModel( viewDocumentFragment, context );
  8445. }
  8446. /**
  8447. * Returns the result of the given {@link module:engine/view/element~Element view element} or
  8448. * {@link module:engine/view/documentfragment~DocumentFragment view document fragment} converted by the
  8449. * {@link #upcastDispatcher view-to-model converters}, wrapped by {@link module:engine/model/documentfragment~DocumentFragment}.
  8450. *
  8451. * When marker elements were converted during the conversion process, it will be set as a document fragment's
  8452. * {@link module:engine/model/documentfragment~DocumentFragment#markers static markers map}.
  8453. *
  8454. * @param {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment} viewElementOrFragment
  8455. * Element or document fragment whose content will be converted.
  8456. * @param {module:engine/model/schema~SchemaContextDefinition} [context='$root'] Base context in which the view will
  8457. * be converted to the model. See: {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher#convert}.
  8458. * @returns {module:engine/model/documentfragment~DocumentFragment} Output document fragment.
  8459. */
  8460. toModel( viewElementOrFragment, context = '$root' ) {
  8461. return this.model.change( writer => {
  8462. return this.upcastDispatcher.convert( viewElementOrFragment, writer, context );
  8463. } );
  8464. }
  8465. /**
  8466. * Adds a style processor normalization rules.
  8467. *
  8468. * You can implement your own rules as well as use one of the available processor rules:
  8469. *
  8470. * * background: {@link module:engine/view/styles/background~addBackgroundRules}
  8471. * * border: {@link module:engine/view/styles/border~addBorderRules}
  8472. * * margin: {@link module:engine/view/styles/margin~addMarginRules}
  8473. * * padding: {@link module:engine/view/styles/padding~addPaddingRules}
  8474. *
  8475. * @param {Function} callback
  8476. */
  8477. addStyleProcessorRules( callback ) {
  8478. callback( this.stylesProcessor );
  8479. }
  8480. /**
  8481. * Removes all event listeners set by the DataController.
  8482. */
  8483. destroy() {
  8484. this.stopListening();
  8485. }
  8486. /**
  8487. * Checks if all provided root names are existing editor roots.
  8488. *
  8489. * @private
  8490. * @param {Array.<String>} rootNames Root names to check.
  8491. * @returns {Boolean} Whether all provided root names are existing editor roots.
  8492. */
  8493. _checkIfRootsExists( rootNames ) {
  8494. for ( const rootName of rootNames ) {
  8495. if ( !this.model.document.getRootNames().includes( rootName ) ) {
  8496. return false;
  8497. }
  8498. }
  8499. return true;
  8500. }
  8501. /**
  8502. * Event fired once the data initialization has finished.
  8503. *
  8504. * @event ready
  8505. */
  8506. /**
  8507. * Event fired after the {@link #init `init()` method} was run. It can be {@link #listenTo listened to} in order to adjust or modify
  8508. * the initialization flow. However, if the `init` event is stopped or prevented, the {@link #event:ready `ready` event}
  8509. * should be fired manually.
  8510. *
  8511. * The `init` event is fired by the decorated {@link #init} method.
  8512. * See {@link module:utils/observablemixin~ObservableMixin#decorate} for more information and samples.
  8513. *
  8514. * @event init
  8515. */
  8516. /**
  8517. * Event fired after {@link #set set() method} has been run.
  8518. *
  8519. * The `set` event is fired by decorated {@link #set} method.
  8520. * See {@link module:utils/observablemixin~ObservableMixin#decorate} for more information and samples.
  8521. *
  8522. * @event set
  8523. */
  8524. }
  8525. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_0__["default"])( DataController, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  8526. // Helper function for downcast conversion.
  8527. //
  8528. // Takes a document element (element that is added to a model document) and checks which markers are inside it
  8529. // and which markers are containing it. If the marker is intersecting with element, the intersection is returned.
  8530. function _getMarkersRelativeToElement( element ) {
  8531. const result = [];
  8532. const doc = element.root.document;
  8533. if ( !doc ) {
  8534. return [];
  8535. }
  8536. const elementRange = _model_range__WEBPACK_IMPORTED_MODULE_11__["default"]._createIn( element );
  8537. for ( const marker of doc.model.markers ) {
  8538. const intersection = elementRange.getIntersection( marker.getRange() );
  8539. if ( intersection ) {
  8540. result.push( [ marker.name, intersection ] );
  8541. }
  8542. }
  8543. return result;
  8544. }
  8545. /***/ }),
  8546. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/controller/editingcontroller.js":
  8547. /*!*************************************************************************************!*\
  8548. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/controller/editingcontroller.js ***!
  8549. \*************************************************************************************/
  8550. /*! exports provided: default */
  8551. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8552. "use strict";
  8553. __webpack_require__.r(__webpack_exports__);
  8554. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EditingController; });
  8555. /* harmony import */ var _view_rooteditableelement__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view/rooteditableelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/rooteditableelement.js");
  8556. /* harmony import */ var _view_view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../view/view */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/view.js");
  8557. /* harmony import */ var _conversion_mapper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../conversion/mapper */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/mapper.js");
  8558. /* harmony import */ var _conversion_downcastdispatcher__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../conversion/downcastdispatcher */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcastdispatcher.js");
  8559. /* harmony import */ var _conversion_downcasthelpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../conversion/downcasthelpers */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcasthelpers.js");
  8560. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  8561. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  8562. /* harmony import */ var _conversion_upcasthelpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../conversion/upcasthelpers */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcasthelpers.js");
  8563. /**
  8564. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  8565. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  8566. */
  8567. /**
  8568. * @module engine/controller/editingcontroller
  8569. */
  8570. // @if CK_DEBUG_ENGINE // const { dumpTrees, initDocumentDumping } = require( '../dev-utils/utils' );
  8571. /**
  8572. * Controller for the editing pipeline. The editing pipeline controls {@link ~EditingController#model model} rendering,
  8573. * including selection handling. It also creates the {@link ~EditingController#view view} which builds a
  8574. * browser-independent virtualization over the DOM elements. The editing controller also attaches default converters.
  8575. *
  8576. * @mixes module:utils/observablemixin~ObservableMixin
  8577. */
  8578. class EditingController {
  8579. /**
  8580. * Creates an editing controller instance.
  8581. *
  8582. * @param {module:engine/model/model~Model} model Editing model.
  8583. * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor The styles processor instance.
  8584. */
  8585. constructor( model, stylesProcessor ) {
  8586. /**
  8587. * Editor model.
  8588. *
  8589. * @readonly
  8590. * @member {module:engine/model/model~Model}
  8591. */
  8592. this.model = model;
  8593. /**
  8594. * Editing view controller.
  8595. *
  8596. * @readonly
  8597. * @member {module:engine/view/view~View}
  8598. */
  8599. this.view = new _view_view__WEBPACK_IMPORTED_MODULE_1__["default"]( stylesProcessor );
  8600. /**
  8601. * Mapper which describes the model-view binding.
  8602. *
  8603. * @readonly
  8604. * @member {module:engine/conversion/mapper~Mapper}
  8605. */
  8606. this.mapper = new _conversion_mapper__WEBPACK_IMPORTED_MODULE_2__["default"]();
  8607. /**
  8608. * Downcast dispatcher that converts changes from the model to {@link #view the editing view}.
  8609. *
  8610. * @readonly
  8611. * @member {module:engine/conversion/downcastdispatcher~DowncastDispatcher} #downcastDispatcher
  8612. */
  8613. this.downcastDispatcher = new _conversion_downcastdispatcher__WEBPACK_IMPORTED_MODULE_3__["default"]( {
  8614. mapper: this.mapper,
  8615. schema: model.schema
  8616. } );
  8617. const doc = this.model.document;
  8618. const selection = doc.selection;
  8619. const markers = this.model.markers;
  8620. // When plugins listen on model changes (on selection change, post fixers, etc.) and change the view as a result of
  8621. // model's change, they might trigger view rendering before the conversion is completed (e.g. before the selection
  8622. // is converted). We disable rendering for the length of the outermost model change() block to prevent that.
  8623. //
  8624. // See https://github.com/ckeditor/ckeditor5-engine/issues/1528
  8625. this.listenTo( this.model, '_beforeChanges', () => {
  8626. this.view._disableRendering( true );
  8627. }, { priority: 'highest' } );
  8628. this.listenTo( this.model, '_afterChanges', () => {
  8629. this.view._disableRendering( false );
  8630. }, { priority: 'lowest' } );
  8631. // Whenever model document is changed, convert those changes to the view (using model.Document#differ).
  8632. // Do it on 'low' priority, so changes are converted after other listeners did their job.
  8633. // Also convert model selection.
  8634. this.listenTo( doc, 'change', () => {
  8635. this.view.change( writer => {
  8636. this.downcastDispatcher.convertChanges( doc.differ, markers, writer );
  8637. this.downcastDispatcher.convertSelection( selection, markers, writer );
  8638. } );
  8639. }, { priority: 'low' } );
  8640. // Convert selection from the view to the model when it changes in the view.
  8641. this.listenTo( this.view.document, 'selectionChange', Object(_conversion_upcasthelpers__WEBPACK_IMPORTED_MODULE_7__["convertSelectionChange"])( this.model, this.mapper ) );
  8642. // Attach default model converters.
  8643. this.downcastDispatcher.on( 'insert:$text', Object(_conversion_downcasthelpers__WEBPACK_IMPORTED_MODULE_4__["insertText"])(), { priority: 'lowest' } );
  8644. this.downcastDispatcher.on( 'remove', Object(_conversion_downcasthelpers__WEBPACK_IMPORTED_MODULE_4__["remove"])(), { priority: 'low' } );
  8645. // Attach default model selection converters.
  8646. this.downcastDispatcher.on( 'selection', Object(_conversion_downcasthelpers__WEBPACK_IMPORTED_MODULE_4__["clearAttributes"])(), { priority: 'low' } );
  8647. this.downcastDispatcher.on( 'selection', Object(_conversion_downcasthelpers__WEBPACK_IMPORTED_MODULE_4__["convertRangeSelection"])(), { priority: 'low' } );
  8648. this.downcastDispatcher.on( 'selection', Object(_conversion_downcasthelpers__WEBPACK_IMPORTED_MODULE_4__["convertCollapsedSelection"])(), { priority: 'low' } );
  8649. // Binds {@link module:engine/view/document~Document#roots view roots collection} to
  8650. // {@link module:engine/model/document~Document#roots model roots collection} so creating
  8651. // model root automatically creates corresponding view root.
  8652. this.view.document.roots.bindTo( this.model.document.roots ).using( root => {
  8653. // $graveyard is a special root that has no reflection in the view.
  8654. if ( root.rootName == '$graveyard' ) {
  8655. return null;
  8656. }
  8657. const viewRoot = new _view_rooteditableelement__WEBPACK_IMPORTED_MODULE_0__["default"]( this.view.document, root.name );
  8658. viewRoot.rootName = root.rootName;
  8659. this.mapper.bindElements( root, viewRoot );
  8660. return viewRoot;
  8661. } );
  8662. // @if CK_DEBUG_ENGINE // initDocumentDumping( this.model.document );
  8663. // @if CK_DEBUG_ENGINE // initDocumentDumping( this.view.document );
  8664. // @if CK_DEBUG_ENGINE // dumpTrees( this.model.document, this.model.document.version );
  8665. // @if CK_DEBUG_ENGINE // dumpTrees( this.view.document, this.model.document.version );
  8666. // @if CK_DEBUG_ENGINE // this.model.document.on( 'change', () => {
  8667. // @if CK_DEBUG_ENGINE // dumpTrees( this.view.document, this.model.document.version );
  8668. // @if CK_DEBUG_ENGINE // }, { priority: 'lowest' } );
  8669. }
  8670. /**
  8671. * Removes all event listeners attached to the `EditingController`. Destroys all objects created
  8672. * by `EditingController` that need to be destroyed.
  8673. */
  8674. destroy() {
  8675. this.view.destroy();
  8676. this.stopListening();
  8677. }
  8678. }
  8679. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__["default"])( EditingController, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_5__["default"] );
  8680. /***/ }),
  8681. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversion.js":
  8682. /*!******************************************************************************!*\
  8683. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversion.js ***!
  8684. \******************************************************************************/
  8685. /*! exports provided: default */
  8686. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8687. "use strict";
  8688. __webpack_require__.r(__webpack_exports__);
  8689. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Conversion; });
  8690. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  8691. /* harmony import */ var _upcasthelpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./upcasthelpers */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcasthelpers.js");
  8692. /* harmony import */ var _downcasthelpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./downcasthelpers */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcasthelpers.js");
  8693. /**
  8694. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  8695. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  8696. */
  8697. /**
  8698. * @module engine/conversion/conversion
  8699. */
  8700. /**
  8701. * A utility class that helps add converters to upcast and downcast dispatchers.
  8702. *
  8703. * We recommend reading the {@glink framework/guides/architecture/editing-engine Editing engine architecture} guide first to
  8704. * understand the core concepts of the conversion mechanisms.
  8705. *
  8706. * An instance of the conversion manager is available in the
  8707. * {@link module:core/editor/editor~Editor#conversion `editor.conversion`} property
  8708. * and by default has the following groups of dispatchers (i.e. directions of conversion):
  8709. *
  8710. * * `downcast` (editing and data downcasts)
  8711. * * `editingDowncast`
  8712. * * `dataDowncast`
  8713. * * `upcast`
  8714. *
  8715. * # One-way converters
  8716. *
  8717. * To add a converter to a specific group, use the {@link module:engine/conversion/conversion~Conversion#for `for()`}
  8718. * method:
  8719. *
  8720. * // Add a converter to editing downcast and data downcast.
  8721. * editor.conversion.for( 'downcast' ).elementToElement( config ) );
  8722. *
  8723. * // Add a converter to the data pipepline only:
  8724. * editor.conversion.for( 'dataDowncast' ).elementToElement( dataConversionConfig ) );
  8725. *
  8726. * // And a slightly different one for the editing pipeline:
  8727. * editor.conversion.for( 'editingDowncast' ).elementToElement( editingConversionConfig ) );
  8728. *
  8729. * See {@link module:engine/conversion/conversion~Conversion#for `for()`} method documentation to learn more about
  8730. * available conversion helpers and how to use your custom ones.
  8731. *
  8732. * # Two-way converters
  8733. *
  8734. * Besides using one-way converters via the `for()` method, you can also use other methods available in this
  8735. * class to add two-way converters (upcast and downcast):
  8736. *
  8737. * * {@link module:engine/conversion/conversion~Conversion#elementToElement `elementToElement()`} &ndash;
  8738. * Model element to view element and vice versa.
  8739. * * {@link module:engine/conversion/conversion~Conversion#attributeToElement `attributeToElement()`} &ndash;
  8740. * Model attribute to view element and vice versa.
  8741. * * {@link module:engine/conversion/conversion~Conversion#attributeToAttribute `attributeToAttribute()`} &ndash;
  8742. * Model attribute to view element and vice versa.
  8743. */
  8744. class Conversion {
  8745. /**
  8746. * Creates a new conversion instance.
  8747. *
  8748. * @param {module:engine/conversion/downcastdispatcher~DowncastDispatcher|
  8749. * Array.<module:engine/conversion/downcastdispatcher~DowncastDispatcher>} downcastDispatchers
  8750. * @param {module:engine/conversion/upcastdispatcher~UpcastDispatcher|
  8751. * Array.<module:engine/conversion/upcastdispatcher~UpcastDispatcher>} upcastDispatchers
  8752. */
  8753. constructor( downcastDispatchers, upcastDispatchers ) {
  8754. /**
  8755. * Maps dispatchers group name to ConversionHelpers instances.
  8756. *
  8757. * @private
  8758. * @member {Map.<String,module:engine/conversion/conversionhelpers~ConversionHelpers>}
  8759. */
  8760. this._helpers = new Map();
  8761. // Define default 'downcast' & 'upcast' dispatchers groups. Those groups are always available as two-way converters needs them.
  8762. this._downcast = Array.isArray( downcastDispatchers ) ? downcastDispatchers : [ downcastDispatchers ];
  8763. this._createConversionHelpers( { name: 'downcast', dispatchers: this._downcast, isDowncast: true } );
  8764. this._upcast = Array.isArray( upcastDispatchers ) ? upcastDispatchers : [ upcastDispatchers ];
  8765. this._createConversionHelpers( { name: 'upcast', dispatchers: this._upcast, isDowncast: false } );
  8766. }
  8767. /**
  8768. * Define an alias for registered dispatcher.
  8769. *
  8770. * const conversion = new Conversion(
  8771. * [ dataDowncastDispatcher, editingDowncastDispatcher ],
  8772. * upcastDispatcher
  8773. * );
  8774. *
  8775. * conversion.addAlias( 'dataDowncast', dataDowncastDispatcher );
  8776. *
  8777. * @param {String} alias An alias of a dispatcher.
  8778. * @param {module:engine/conversion/downcastdispatcher~DowncastDispatcher|
  8779. * module:engine/conversion/upcastdispatcher~UpcastDispatcher} dispatcher Dispatcher which should have an alias.
  8780. */
  8781. addAlias( alias, dispatcher ) {
  8782. const isDowncast = this._downcast.includes( dispatcher );
  8783. const isUpcast = this._upcast.includes( dispatcher );
  8784. if ( !isUpcast && !isDowncast ) {
  8785. /**
  8786. * Trying to register and alias for a dispatcher that nas not been registered.
  8787. *
  8788. * @error conversion-add-alias-dispatcher-not-registered
  8789. */
  8790. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  8791. 'conversion-add-alias-dispatcher-not-registered',
  8792. this
  8793. );
  8794. }
  8795. this._createConversionHelpers( { name: alias, dispatchers: [ dispatcher ], isDowncast } );
  8796. }
  8797. /**
  8798. * Provides a chainable API to assign converters to conversion dispatchers group.
  8799. *
  8800. * If the given group name has not been registered, the
  8801. * {@link module:utils/ckeditorerror~CKEditorError `conversion-for-unknown-group` error} is thrown.
  8802. *
  8803. * You can use conversion helpers available directly in the `for()` chain or your custom ones via
  8804. * the {@link module:engine/conversion/conversionhelpers~ConversionHelpers#add `add()`} method.
  8805. *
  8806. * # Using bulit-in conversion helpers
  8807. *
  8808. * The `for()` chain comes with a set of conversion helpers which you can use like this:
  8809. *
  8810. * editor.conversion.for( 'downcast' )
  8811. * .elementToElement( config1 ) // Adds an element-to-element downcast converter.
  8812. * .attributeToElement( config2 ); // Adds an attribute-to-element downcast converter.
  8813. *
  8814. * editor.conversion.for( 'upcast' )
  8815. * .elementToAttribute( config3 ); // Adds an element-to-attribute upcast converter.
  8816. *
  8817. * Refer to the documentation of built-in conversion helpers to learn about their configuration options.
  8818. *
  8819. * * downcast (model-to-view) conversion helpers:
  8820. *
  8821. * * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`},
  8822. * * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToElement `attributeToElement()`},
  8823. * * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToAttribute `attributeToAttribute()`}.
  8824. * * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#markerToElement `markerToElement()`}.
  8825. * * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#markerToHighlight `markerToHighlight()`}.
  8826. *
  8827. * * upcast (view-to-model) conversion helpers:
  8828. *
  8829. * * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#elementToElement `elementToElement()`},
  8830. * * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#elementToAttribute `elementToAttribute()`},
  8831. * * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#attributeToAttribute `attributeToAttribute()`}.
  8832. * * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#elementToMarker `elementToMarker()`}.
  8833. *
  8834. * # Using custom conversion helpers
  8835. *
  8836. * If you need to implement a nontypical converter, you can do so by calling:
  8837. *
  8838. * editor.conversion.for( direction ).add( customHelper );
  8839. *
  8840. * The `.add()` method takes exactly one parameter, which is a function. This function should accept one parameter that
  8841. * is a dispatcher instance. The function should add an actual converter to the passed dispatcher instance.
  8842. *
  8843. * Example:
  8844. *
  8845. * editor.conversion.for( 'upcast' ).add( dispatcher => {
  8846. * dispatcher.on( 'element:a', ( evt, data, conversionApi ) => {
  8847. * // Do something with a view <a> element.
  8848. * } );
  8849. * } );
  8850. *
  8851. * Refer to the documentation of {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher}
  8852. * and {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher} to learn how to write
  8853. * custom converters.
  8854. *
  8855. * @param {String} groupName The name of dispatchers group to add the converters to.
  8856. * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers|module:engine/conversion/upcasthelpers~UpcastHelpers}
  8857. */
  8858. for( groupName ) {
  8859. if ( !this._helpers.has( groupName ) ) {
  8860. /**
  8861. * Trying to add a converter to an unknown dispatchers group.
  8862. *
  8863. * @error conversion-for-unknown-group
  8864. */
  8865. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'conversion-for-unknown-group', this );
  8866. }
  8867. return this._helpers.get( groupName );
  8868. }
  8869. /**
  8870. * Sets up converters between the model and the view that convert a model element to a view element (and vice versa).
  8871. * For example, the model `<paragraph>Foo</paragraph>` is `<p>Foo</p>` in the view.
  8872. *
  8873. * // A simple conversion from the `paragraph` model element to the `<p>` view element (and vice versa).
  8874. * editor.conversion.elementToElement( { model: 'paragraph', view: 'p' } );
  8875. *
  8876. * // Override other converters by specifying a converter definition with a higher priority.
  8877. * editor.conversion.elementToElement( { model: 'paragraph', view: 'div', converterPriority: 'high' } );
  8878. *
  8879. * // View specified as an object instead of a string.
  8880. * editor.conversion.elementToElement( {
  8881. * model: 'fancyParagraph',
  8882. * view: {
  8883. * name: 'p',
  8884. * classes: 'fancy'
  8885. * }
  8886. * } );
  8887. *
  8888. * // Use `upcastAlso` to define other view elements that should also be converted to a `paragraph` element.
  8889. * editor.conversion.elementToElement( {
  8890. * model: 'paragraph',
  8891. * view: 'p',
  8892. * upcastAlso: [
  8893. * 'div',
  8894. * {
  8895. * // Any element with the `display: block` style.
  8896. * styles: {
  8897. * display: 'block'
  8898. * }
  8899. * }
  8900. * ]
  8901. * } );
  8902. *
  8903. * // `upcastAlso` set as callback enables a conversion of a wide range of different view elements.
  8904. * editor.conversion.elementToElement( {
  8905. * model: 'heading',
  8906. * view: 'h2',
  8907. * // Convert "headling-like" paragraphs to headings.
  8908. * upcastAlso: viewElement => {
  8909. * const fontSize = viewElement.getStyle( 'font-size' );
  8910. *
  8911. * if ( !fontSize ) {
  8912. * return null;
  8913. * }
  8914. *
  8915. * const match = fontSize.match( /(\d+)\s*px/ );
  8916. *
  8917. * if ( !match ) {
  8918. * return null;
  8919. * }
  8920. *
  8921. * const size = Number( match[ 1 ] );
  8922. *
  8923. * if ( size > 26 ) {
  8924. * // Returned value can be an object with the matched properties.
  8925. * // These properties will be "consumed" during the conversion.
  8926. * // See `engine.view.Matcher~MatcherPattern` and `engine.view.Matcher#match` for more details.
  8927. *
  8928. * return { name: true, styles: [ 'font-size' ] };
  8929. * }
  8930. *
  8931. * return null;
  8932. * }
  8933. * } );
  8934. *
  8935. * `definition.model` is a `String` with a model element name to convert from or to.
  8936. * See {@link module:engine/conversion/conversion~ConverterDefinition} to learn about other parameters.
  8937. *
  8938. * @param {module:engine/conversion/conversion~ConverterDefinition} definition The converter definition.
  8939. */
  8940. elementToElement( definition ) {
  8941. // Set up downcast converter.
  8942. this.for( 'downcast' ).elementToElement( definition );
  8943. // Set up upcast converter.
  8944. for ( const { model, view } of _getAllUpcastDefinitions( definition ) ) {
  8945. this.for( 'upcast' )
  8946. .elementToElement( {
  8947. model,
  8948. view,
  8949. converterPriority: definition.converterPriority
  8950. } );
  8951. }
  8952. }
  8953. /**
  8954. * Sets up converters between the model and the view that convert a model attribute to a view element (and vice versa).
  8955. * For example, a model text node with `"Foo"` as data and the `bold` attribute is `<strong>Foo</strong>` in the view.
  8956. *
  8957. * // A simple conversion from the `bold=true` attribute to the `<strong>` view element (and vice versa).
  8958. * editor.conversion.attributeToElement( { model: 'bold', view: 'strong' } );
  8959. *
  8960. * // Override other converters by specifying a converter definition with a higher priority.
  8961. * editor.conversion.attributeToElement( { model: 'bold', view: 'b', converterPriority: 'high' } );
  8962. *
  8963. * // View specified as an object instead of a string.
  8964. * editor.conversion.attributeToElement( {
  8965. * model: 'bold',
  8966. * view: {
  8967. * name: 'span',
  8968. * classes: 'bold'
  8969. * }
  8970. * } );
  8971. *
  8972. * // Use `config.model.name` to define the conversion only from a given node type, `$text` in this case.
  8973. * // The same attribute on different elements may then be handled by a different converter.
  8974. * editor.conversion.attributeToElement( {
  8975. * model: {
  8976. * key: 'textDecoration',
  8977. * values: [ 'underline', 'lineThrough' ],
  8978. * name: '$text'
  8979. * },
  8980. * view: {
  8981. * underline: {
  8982. * name: 'span',
  8983. * styles: {
  8984. * 'text-decoration': 'underline'
  8985. * }
  8986. * },
  8987. * lineThrough: {
  8988. * name: 'span',
  8989. * styles: {
  8990. * 'text-decoration': 'line-through'
  8991. * }
  8992. * }
  8993. * }
  8994. * } );
  8995. *
  8996. * // Use `upcastAlso` to define other view elements that should also be converted to the `bold` attribute.
  8997. * editor.conversion.attributeToElement( {
  8998. * model: 'bold',
  8999. * view: 'strong',
  9000. * upcastAlso: [
  9001. * 'b',
  9002. * {
  9003. * name: 'span',
  9004. * classes: 'bold'
  9005. * },
  9006. * {
  9007. * name: 'span',
  9008. * styles: {
  9009. * 'font-weight': 'bold'
  9010. * }
  9011. * },
  9012. * viewElement => {
  9013. * const fontWeight = viewElement.getStyle( 'font-weight' );
  9014. *
  9015. * if ( viewElement.is( 'element', 'span' ) && fontWeight && /\d+/.test() && Number( fontWeight ) > 500 ) {
  9016. * // Returned value can be an object with the matched properties.
  9017. * // These properties will be "consumed" during the conversion.
  9018. * // See `engine.view.Matcher~MatcherPattern` and `engine.view.Matcher#match` for more details.
  9019. *
  9020. * return {
  9021. * name: true,
  9022. * styles: [ 'font-weight' ]
  9023. * };
  9024. * }
  9025. * }
  9026. * ]
  9027. * } );
  9028. *
  9029. * // Conversion from and to a model attribute key whose value is an enum (`fontSize=big|small`).
  9030. * // `upcastAlso` set as callback enables a conversion of a wide range of different view elements.
  9031. * editor.conversion.attributeToElement( {
  9032. * model: {
  9033. * key: 'fontSize',
  9034. * values: [ 'big', 'small' ]
  9035. * },
  9036. * view: {
  9037. * big: {
  9038. * name: 'span',
  9039. * styles: {
  9040. * 'font-size': '1.2em'
  9041. * }
  9042. * },
  9043. * small: {
  9044. * name: 'span',
  9045. * styles: {
  9046. * 'font-size': '0.8em'
  9047. * }
  9048. * }
  9049. * },
  9050. * upcastAlso: {
  9051. * big: viewElement => {
  9052. * const fontSize = viewElement.getStyle( 'font-size' );
  9053. *
  9054. * if ( !fontSize ) {
  9055. * return null;
  9056. * }
  9057. *
  9058. * const match = fontSize.match( /(\d+)\s*px/ );
  9059. *
  9060. * if ( !match ) {
  9061. * return null;
  9062. * }
  9063. *
  9064. * const size = Number( match[ 1 ] );
  9065. *
  9066. * if ( viewElement.is( 'element', 'span' ) && size > 10 ) {
  9067. * // Returned value can be an object with the matched properties.
  9068. * // These properties will be "consumed" during the conversion.
  9069. * // See `engine.view.Matcher~MatcherPattern` and `engine.view.Matcher#match` for more details.
  9070. *
  9071. * return { name: true, styles: [ 'font-size' ] };
  9072. * }
  9073. *
  9074. * return null;
  9075. * },
  9076. * small: viewElement => {
  9077. * const fontSize = viewElement.getStyle( 'font-size' );
  9078. *
  9079. * if ( !fontSize ) {
  9080. * return null;
  9081. * }
  9082. *
  9083. * const match = fontSize.match( /(\d+)\s*px/ );
  9084. *
  9085. * if ( !match ) {
  9086. * return null;
  9087. * }
  9088. *
  9089. * const size = Number( match[ 1 ] );
  9090. *
  9091. * if ( viewElement.is( 'element', 'span' ) && size < 10 ) {
  9092. * // Returned value can be an object with the matched properties.
  9093. * // These properties will be "consumed" during the conversion.
  9094. * // See `engine.view.Matcher~MatcherPattern` and `engine.view.Matcher#match` for more details.
  9095. *
  9096. * return { name: true, styles: [ 'font-size' ] };
  9097. * }
  9098. *
  9099. * return null;
  9100. * }
  9101. * }
  9102. * } );
  9103. *
  9104. * The `definition.model` parameter specifies which model attribute should be converted from or to. It can be a `{ key, value }` object
  9105. * describing the attribute key and value to convert or a `String` specifying just the attribute key (then `value` is set to `true`).
  9106. * See {@link module:engine/conversion/conversion~ConverterDefinition} to learn about other parameters.
  9107. *
  9108. * @param {module:engine/conversion/conversion~ConverterDefinition} definition The converter definition.
  9109. */
  9110. attributeToElement( definition ) {
  9111. // Set up downcast converter.
  9112. this.for( 'downcast' ).attributeToElement( definition );
  9113. // Set up upcast converter.
  9114. for ( const { model, view } of _getAllUpcastDefinitions( definition ) ) {
  9115. this.for( 'upcast' )
  9116. .elementToAttribute( {
  9117. view,
  9118. model,
  9119. converterPriority: definition.converterPriority
  9120. } );
  9121. }
  9122. }
  9123. /**
  9124. * Sets up converters between the model and the view that convert a model attribute to a view attribute (and vice versa).
  9125. * For example, `<image src='foo.jpg'></image>` is converted to `<img src='foo.jpg'></img>` (the same attribute key and value).
  9126. * This type of converters is intended to be used with {@link module:engine/model/element~Element model element} nodes.
  9127. * To convert text attributes {@link module:engine/conversion/conversion~Conversion#attributeToElement `attributeToElement converter`}
  9128. * should be set up.
  9129. *
  9130. * // A simple conversion from the `source` model attribute to the `src` view attribute (and vice versa).
  9131. * editor.conversion.attributeToAttribute( { model: 'source', view: 'src' } );
  9132. *
  9133. * // Attribute values are strictly specified.
  9134. * editor.conversion.attributeToAttribute( {
  9135. * model: {
  9136. * name: 'image',
  9137. * key: 'aside',
  9138. * values: [ 'aside' ]
  9139. * },
  9140. * view: {
  9141. * aside: {
  9142. * name: 'img',
  9143. * key: 'class',
  9144. * value: [ 'aside', 'half-size' ]
  9145. * }
  9146. * }
  9147. * } );
  9148. *
  9149. * // Set the style attribute.
  9150. * editor.conversion.attributeToAttribute( {
  9151. * model: {
  9152. * name: 'image',
  9153. * key: 'aside',
  9154. * values: [ 'aside' ]
  9155. * },
  9156. * view: {
  9157. * aside: {
  9158. * name: 'img',
  9159. * key: 'style',
  9160. * value: {
  9161. * float: 'right',
  9162. * width: '50%',
  9163. * margin: '5px'
  9164. * }
  9165. * }
  9166. * }
  9167. * } );
  9168. *
  9169. * // Conversion from and to a model attribute key whose value is an enum (`align=right|center`).
  9170. * // Use `upcastAlso` to define other view elements that should also be converted to the `align=right` attribute.
  9171. * editor.conversion.attributeToAttribute( {
  9172. * model: {
  9173. * key: 'align',
  9174. * values: [ 'right', 'center' ]
  9175. * },
  9176. * view: {
  9177. * right: {
  9178. * key: 'class',
  9179. * value: 'align-right'
  9180. * },
  9181. * center: {
  9182. * key: 'class',
  9183. * value: 'align-center'
  9184. * }
  9185. * },
  9186. * upcastAlso: {
  9187. * right: {
  9188. * styles: {
  9189. * 'text-align': 'right'
  9190. * }
  9191. * },
  9192. * center: {
  9193. * styles: {
  9194. * 'text-align': 'center'
  9195. * }
  9196. * }
  9197. * }
  9198. * } );
  9199. *
  9200. * The `definition.model` parameter specifies which model attribute should be converted from and to.
  9201. * It can be a `{ key, [ values ], [ name ] }` object or a `String`, which will be treated like `{ key: definition.model }`.
  9202. * The `key` property is the model attribute key to convert from and to.
  9203. * The `values` are the possible model attribute values. If `values` is not set, the model attribute value will be the same as the
  9204. * view attribute value.
  9205. * If `name` is set, the conversion will be set up only for model elements with the given name.
  9206. *
  9207. * The `definition.view` parameter specifies which view attribute should be converted from and to.
  9208. * It can be a `{ key, value, [ name ] }` object or a `String`, which will be treated like `{ key: definition.view }`.
  9209. * The `key` property is the view attribute key to convert from and to.
  9210. * The `value` is the view attribute value to convert from and to. If `definition.value` is not set, the view attribute value will be
  9211. * the same as the model attribute value.
  9212. * If `key` is `'class'`, `value` can be a `String` or an array of `String`s.
  9213. * If `key` is `'style'`, `value` is an object with key-value pairs.
  9214. * In other cases, `value` is a `String`.
  9215. * If `name` is set, the conversion will be set up only for model elements with the given name.
  9216. * If `definition.model.values` is set, `definition.view` is an object that assigns values from `definition.model.values`
  9217. * to `{ key, value, [ name ] }` objects.
  9218. *
  9219. * `definition.upcastAlso` specifies which other matching view elements should also be upcast to the given model configuration.
  9220. * If `definition.model.values` is set, `definition.upcastAlso` should be an object assigning values from `definition.model.values`
  9221. * to {@link module:engine/view/matcher~MatcherPattern}s or arrays of {@link module:engine/view/matcher~MatcherPattern}s.
  9222. *
  9223. * **Note:** `definition.model` and `definition.view` form should be mirrored, so the same types of parameters should
  9224. * be given in both parameters.
  9225. *
  9226. * @param {Object} definition The converter definition.
  9227. * @param {String|Object} definition.model The model attribute to convert from and to.
  9228. * @param {String|Object} definition.view The view attribute to convert from and to.
  9229. * @param {module:engine/view/matcher~MatcherPattern|Array.<module:engine/view/matcher~MatcherPattern>} [definition.upcastAlso]
  9230. * Any view element matching `definition.upcastAlso` will also be converted to the given model attribute. `definition.upcastAlso`
  9231. * is used only if `config.model.values` is specified.
  9232. */
  9233. attributeToAttribute( definition ) {
  9234. // Set up downcast converter.
  9235. this.for( 'downcast' ).attributeToAttribute( definition );
  9236. // Set up upcast converter.
  9237. for ( const { model, view } of _getAllUpcastDefinitions( definition ) ) {
  9238. this.for( 'upcast' )
  9239. .attributeToAttribute( {
  9240. view,
  9241. model
  9242. } );
  9243. }
  9244. }
  9245. /**
  9246. * Creates and caches conversion helpers for given dispatchers group.
  9247. *
  9248. * @private
  9249. * @param {Object} options
  9250. * @param {String} options.name Group name.
  9251. * @param {Array.<module:engine/conversion/downcastdispatcher~DowncastDispatcher|
  9252. * module:engine/conversion/upcastdispatcher~UpcastDispatcher>} options.dispatchers
  9253. * @param {Boolean} options.isDowncast
  9254. */
  9255. _createConversionHelpers( { name, dispatchers, isDowncast } ) {
  9256. if ( this._helpers.has( name ) ) {
  9257. /**
  9258. * Trying to register a group name that has already been registered.
  9259. *
  9260. * @error conversion-group-exists
  9261. */
  9262. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'conversion-group-exists', this );
  9263. }
  9264. const helpers = isDowncast ? new _downcasthelpers__WEBPACK_IMPORTED_MODULE_2__["default"]( dispatchers ) : new _upcasthelpers__WEBPACK_IMPORTED_MODULE_1__["default"]( dispatchers );
  9265. this._helpers.set( name, helpers );
  9266. }
  9267. }
  9268. /**
  9269. * Defines how the model should be converted from and to the view.
  9270. *
  9271. * @typedef {Object} module:engine/conversion/conversion~ConverterDefinition
  9272. *
  9273. * @property {*} [model] The model conversion definition. Describes the model element or model attribute to convert. This parameter differs
  9274. * for different functions that accept `ConverterDefinition`. See the description of the function to learn how to set it.
  9275. * @property {module:engine/view/elementdefinition~ElementDefinition|Object} view The definition of the view element to convert from and
  9276. * to. If `model` describes multiple values, `view` is an object that assigns these values (`view` object keys) to view element definitions
  9277. * (`view` object values).
  9278. * @property {module:engine/view/matcher~MatcherPattern|Array.<module:engine/view/matcher~MatcherPattern>} [upcastAlso]
  9279. * Any view element matching `upcastAlso` will also be converted to the model. If `model` describes multiple values, `upcastAlso`
  9280. * is an object that assigns these values (`upcastAlso` object keys) to {@link module:engine/view/matcher~MatcherPattern}s
  9281. * (`upcastAlso` object values).
  9282. * @property {module:utils/priorities~PriorityString} [converterPriority] The converter priority.
  9283. */
  9284. // Helper function that creates a joint array out of an item passed in `definition.view` and items passed in
  9285. // `definition.upcastAlso`.
  9286. //
  9287. // @param {module:engine/conversion/conversion~ConverterDefinition} definition
  9288. // @returns {Array} Array containing view definitions.
  9289. function* _getAllUpcastDefinitions( definition ) {
  9290. if ( definition.model.values ) {
  9291. for ( const value of definition.model.values ) {
  9292. const model = { key: definition.model.key, value };
  9293. const view = definition.view[ value ];
  9294. const upcastAlso = definition.upcastAlso ? definition.upcastAlso[ value ] : undefined;
  9295. yield* _getUpcastDefinition( model, view, upcastAlso );
  9296. }
  9297. } else {
  9298. yield* _getUpcastDefinition( definition.model, definition.view, definition.upcastAlso );
  9299. }
  9300. }
  9301. function* _getUpcastDefinition( model, view, upcastAlso ) {
  9302. yield { model, view };
  9303. if ( upcastAlso ) {
  9304. upcastAlso = Array.isArray( upcastAlso ) ? upcastAlso : [ upcastAlso ];
  9305. for ( const upcastAlsoItem of upcastAlso ) {
  9306. yield { model, view: upcastAlsoItem };
  9307. }
  9308. }
  9309. }
  9310. /***/ }),
  9311. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversionhelpers.js":
  9312. /*!*************************************************************************************!*\
  9313. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversionhelpers.js ***!
  9314. \*************************************************************************************/
  9315. /*! exports provided: default */
  9316. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9317. "use strict";
  9318. __webpack_require__.r(__webpack_exports__);
  9319. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ConversionHelpers; });
  9320. /**
  9321. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  9322. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  9323. */
  9324. /**
  9325. * @module engine/conversion/conversionhelpers
  9326. */
  9327. /**
  9328. * Base class for conversion helpers.
  9329. */
  9330. class ConversionHelpers {
  9331. /**
  9332. * Creates a conversion helpers instance.
  9333. *
  9334. * @param {Array.<module:engine/conversion/downcastdispatcher~DowncastDispatcher|
  9335. * module:engine/conversion/upcastdispatcher~UpcastDispatcher>} dispatchers
  9336. */
  9337. constructor( dispatchers ) {
  9338. this._dispatchers = dispatchers;
  9339. }
  9340. /**
  9341. * Registers a conversion helper.
  9342. *
  9343. * **Note**: See full usage example in the `{@link module:engine/conversion/conversion~Conversion#for conversion.for()}`
  9344. * method description.
  9345. *
  9346. * @param {Function} conversionHelper The function to be called on event.
  9347. * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers|module:engine/conversion/upcasthelpers~UpcastHelpers}
  9348. */
  9349. add( conversionHelper ) {
  9350. for ( const dispatcher of this._dispatchers ) {
  9351. conversionHelper( dispatcher );
  9352. }
  9353. return this;
  9354. }
  9355. }
  9356. /***/ }),
  9357. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcastdispatcher.js":
  9358. /*!**************************************************************************************!*\
  9359. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcastdispatcher.js ***!
  9360. \**************************************************************************************/
  9361. /*! exports provided: default */
  9362. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9363. "use strict";
  9364. __webpack_require__.r(__webpack_exports__);
  9365. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DowncastDispatcher; });
  9366. /* harmony import */ var _modelconsumable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./modelconsumable */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/modelconsumable.js");
  9367. /* harmony import */ var _model_range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../model/range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  9368. /* harmony import */ var _model_position__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../model/position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  9369. /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  9370. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  9371. /**
  9372. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  9373. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  9374. */
  9375. /**
  9376. * @module engine/conversion/downcastdispatcher
  9377. */
  9378. /**
  9379. * Downcast dispatcher is a central point of downcasting (conversion from the model to the view), which is a process of reacting to changes
  9380. * in the model and firing a set of events. Callbacks listening to these events are called converters. The
  9381. * converters' role is to convert the model changes to changes in view (for example, adding view nodes or
  9382. * changing attributes on view elements).
  9383. *
  9384. * During the conversion process, downcast dispatcher fires events basing on the state of the model and prepares
  9385. * data for these events. It is important to understand that the events are connected with the changes done on the model,
  9386. * for example: "a node has been inserted" or "an attribute has changed". This is in contrary to upcasting (a view-to-model conversion)
  9387. * where you convert the view state (view nodes) to a model tree.
  9388. *
  9389. * The events are prepared basing on a diff created by {@link module:engine/model/differ~Differ Differ}, which buffers them
  9390. * and then passes to the downcast dispatcher as a diff between the old model state and the new model state.
  9391. *
  9392. * Note that because the changes are converted, there is a need to have a mapping between the model structure and the view structure.
  9393. * To map positions and elements during the downcast (a model-to-view conversion), use {@link module:engine/conversion/mapper~Mapper}.
  9394. *
  9395. * Downcast dispatcher fires the following events for model tree changes:
  9396. *
  9397. * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert `insert`} &ndash;
  9398. * If a range of nodes was inserted to the model tree.
  9399. * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:remove `remove`} &ndash;
  9400. * If a range of nodes was removed from the model tree.
  9401. * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute `attribute`} &ndash;
  9402. * If an attribute was added, changed or removed from a model node.
  9403. *
  9404. * For {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert `insert`}
  9405. * and {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute `attribute`},
  9406. * downcast dispatcher generates {@link module:engine/conversion/modelconsumable~ModelConsumable consumables}.
  9407. * These are used to have control over which changes have already been consumed. It is useful when some converters
  9408. * overwrite others or convert multiple changes (for example, it converts an insertion of an element and also converts that
  9409. * element's attributes during the insertion).
  9410. *
  9411. * Additionally, downcast dispatcher fires events for {@link module:engine/model/markercollection~Marker marker} changes:
  9412. *
  9413. * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker} &ndash; If a marker was added.
  9414. * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:removeMarker} &ndash; If a marker was removed.
  9415. *
  9416. * Note that changing a marker is done through removing the marker from the old range and adding it on the new range,
  9417. * so both events are fired.
  9418. *
  9419. * Finally, downcast dispatcher also handles firing events for the {@link module:engine/model/selection model selection}
  9420. * conversion:
  9421. *
  9422. * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:selection}
  9423. * &ndash; Converts the selection from the model to the view.
  9424. * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute}
  9425. * &ndash; Fired for every selection attribute.
  9426. * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker}
  9427. * &ndash; Fired for every marker that contains a selection.
  9428. *
  9429. * Unlike model tree and markers, events for selection are not fired for changes but for selection state.
  9430. *
  9431. * When providing custom listeners for downcast dispatcher, remember to check whether a given change has not been
  9432. * {@link module:engine/conversion/modelconsumable~ModelConsumable#consume consumed} yet.
  9433. *
  9434. * When providing custom listeners for downcast dispatcher, keep in mind that any callback that has
  9435. * {@link module:engine/conversion/modelconsumable~ModelConsumable#consume consumed} a value from a consumable and
  9436. * converted the change should also stop the event (for efficiency purposes).
  9437. *
  9438. * When providing custom listeners for downcast dispatcher, remember to use the provided
  9439. * {@link module:engine/view/downcastwriter~DowncastWriter view downcast writer} to apply changes to the view document.
  9440. *
  9441. * You can read more about conversion in the following guides:
  9442. *
  9443. * * {@glink framework/guides/deep-dive/conversion/conversion-introduction Advanced conversion concepts &mdash; attributes}
  9444. * * {@glink framework/guides/deep-dive/conversion/conversion-extending-output Extending the editor output }
  9445. * * {@glink framework/guides/deep-dive/conversion/custom-element-conversion Custom element conversion}
  9446. *
  9447. * An example of a custom converter for the downcast dispatcher:
  9448. *
  9449. * // You will convert inserting a "paragraph" model element into the model.
  9450. * downcastDispatcher.on( 'insert:paragraph', ( evt, data, conversionApi ) => {
  9451. * // Remember to check whether the change has not been consumed yet and consume it.
  9452. * if ( conversionApi.consumable.consume( data.item, 'insert' ) ) {
  9453. * return;
  9454. * }
  9455. *
  9456. * // Translate the position in the model to a position in the view.
  9457. * const viewPosition = conversionApi.mapper.toViewPosition( data.range.start );
  9458. *
  9459. * // Create a <p> element that will be inserted into the view at the `viewPosition`.
  9460. * const viewElement = conversionApi.writer.createContainerElement( 'p' );
  9461. *
  9462. * // Bind the newly created view element to the model element so positions will map accordingly in the future.
  9463. * conversionApi.mapper.bindElements( data.item, viewElement );
  9464. *
  9465. * // Add the newly created view element to the view.
  9466. * conversionApi.writer.insert( viewPosition, viewElement );
  9467. *
  9468. * // Remember to stop the event propagation.
  9469. * evt.stop();
  9470. * } );
  9471. */
  9472. class DowncastDispatcher {
  9473. /**
  9474. * Creates a downcast dispatcher instance.
  9475. *
  9476. * @see module:engine/conversion/downcastdispatcher~DowncastConversionApi
  9477. * @param {Object} conversionApi Additional properties for an interface that will be passed to events fired
  9478. * by the downcast dispatcher.
  9479. */
  9480. constructor( conversionApi ) {
  9481. /**
  9482. * An interface passed by the dispatcher to the event callbacks.
  9483. *
  9484. * @member {module:engine/conversion/downcastdispatcher~DowncastConversionApi}
  9485. */
  9486. this.conversionApi = Object.assign( { dispatcher: this }, conversionApi );
  9487. /**
  9488. * Maps conversion event names that will trigger element reconversion for given element name.
  9489. *
  9490. * @type {Map<String, String>}
  9491. * @private
  9492. */
  9493. this._reconversionEventsMapping = new Map();
  9494. }
  9495. /**
  9496. * Takes a {@link module:engine/model/differ~Differ model differ} object with buffered changes and fires conversion basing on it.
  9497. *
  9498. * @param {module:engine/model/differ~Differ} differ The differ object with buffered changes.
  9499. * @param {module:engine/model/markercollection~MarkerCollection} markers Markers connected with the converted model.
  9500. * @param {module:engine/view/downcastwriter~DowncastWriter} writer The view writer that should be used to modify the view document.
  9501. */
  9502. convertChanges( differ, markers, writer ) {
  9503. // Before the view is updated, remove markers which have changed.
  9504. for ( const change of differ.getMarkersToRemove() ) {
  9505. this.convertMarkerRemove( change.name, change.range, writer );
  9506. }
  9507. const changes = this._mapChangesWithAutomaticReconversion( differ );
  9508. // Convert changes that happened on model tree.
  9509. for ( const entry of changes ) {
  9510. if ( entry.type === 'insert' ) {
  9511. this.convertInsert( _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]._createFromPositionAndShift( entry.position, entry.length ), writer );
  9512. } else if ( entry.type === 'remove' ) {
  9513. this.convertRemove( entry.position, entry.length, entry.name, writer );
  9514. } else if ( entry.type === 'reconvert' ) {
  9515. this.reconvertElement( entry.element, writer );
  9516. } else {
  9517. // Defaults to 'attribute' change.
  9518. this.convertAttribute( entry.range, entry.attributeKey, entry.attributeOldValue, entry.attributeNewValue, writer );
  9519. }
  9520. }
  9521. for ( const markerName of this.conversionApi.mapper.flushUnboundMarkerNames() ) {
  9522. const markerRange = markers.get( markerName ).getRange();
  9523. this.convertMarkerRemove( markerName, markerRange, writer );
  9524. this.convertMarkerAdd( markerName, markerRange, writer );
  9525. }
  9526. // After the view is updated, convert markers which have changed.
  9527. for ( const change of differ.getMarkersToAdd() ) {
  9528. this.convertMarkerAdd( change.name, change.range, writer );
  9529. }
  9530. }
  9531. /**
  9532. * Starts a conversion of a range insertion.
  9533. *
  9534. * For each node in the range, {@link #event:insert `insert` event is fired}. For each attribute on each node,
  9535. * {@link #event:attribute `attribute` event is fired}.
  9536. *
  9537. * @fires insert
  9538. * @fires attribute
  9539. * @param {module:engine/model/range~Range} range The inserted range.
  9540. * @param {module:engine/view/downcastwriter~DowncastWriter} writer The view writer that should be used to modify the view document.
  9541. */
  9542. convertInsert( range, writer ) {
  9543. this.conversionApi.writer = writer;
  9544. // Create a list of things that can be consumed, consisting of nodes and their attributes.
  9545. this.conversionApi.consumable = this._createInsertConsumable( range );
  9546. // Fire a separate insert event for each node and text fragment contained in the range.
  9547. for ( const data of Array.from( range ).map( walkerValueToEventData ) ) {
  9548. this._convertInsertWithAttributes( data );
  9549. }
  9550. this._clearConversionApi();
  9551. }
  9552. /**
  9553. * Fires conversion of a single node removal. Fires {@link #event:remove remove event} with provided data.
  9554. *
  9555. * @param {module:engine/model/position~Position} position Position from which node was removed.
  9556. * @param {Number} length Offset size of removed node.
  9557. * @param {String} name Name of removed node.
  9558. * @param {module:engine/view/downcastwriter~DowncastWriter} writer View writer that should be used to modify view document.
  9559. */
  9560. convertRemove( position, length, name, writer ) {
  9561. this.conversionApi.writer = writer;
  9562. this.fire( 'remove:' + name, { position, length }, this.conversionApi );
  9563. this._clearConversionApi();
  9564. }
  9565. /**
  9566. * Starts conversion of attribute change on given `range`.
  9567. *
  9568. * For each node in the given `range`, {@link #event:attribute attribute event} is fired with the passed data.
  9569. *
  9570. * @fires attribute
  9571. * @param {module:engine/model/range~Range} range Changed range.
  9572. * @param {String} key Key of the attribute that has changed.
  9573. * @param {*} oldValue Attribute value before the change or `null` if the attribute has not been set before.
  9574. * @param {*} newValue New attribute value or `null` if the attribute has been removed.
  9575. * @param {module:engine/view/downcastwriter~DowncastWriter} writer View writer that should be used to modify view document.
  9576. */
  9577. convertAttribute( range, key, oldValue, newValue, writer ) {
  9578. this.conversionApi.writer = writer;
  9579. // Create a list with attributes to consume.
  9580. this.conversionApi.consumable = this._createConsumableForRange( range, `attribute:${ key }` );
  9581. // Create a separate attribute event for each node in the range.
  9582. for ( const value of range ) {
  9583. const item = value.item;
  9584. const itemRange = _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]._createFromPositionAndShift( value.previousPosition, value.length );
  9585. const data = {
  9586. item,
  9587. range: itemRange,
  9588. attributeKey: key,
  9589. attributeOldValue: oldValue,
  9590. attributeNewValue: newValue
  9591. };
  9592. this._testAndFire( `attribute:${ key }`, data );
  9593. }
  9594. this._clearConversionApi();
  9595. }
  9596. /**
  9597. * Starts a reconversion of an element. It will:
  9598. *
  9599. * * Fire a {@link #event:insert `insert` event} for the element to reconvert.
  9600. * * Fire an {@link #event:attribute `attribute` event} for element attributes.
  9601. *
  9602. * This will not reconvert children of the element if they have existing (already converted) views. For newly inserted child elements
  9603. * it will behave the same as {@link #convertInsert}.
  9604. *
  9605. * Element reconversion is defined by a `triggerBy` configuration for
  9606. * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`} conversion helper.
  9607. *
  9608. * @fires insert
  9609. * @fires attribute
  9610. * @param {module:engine/model/element~Element} element The element to be reconverted.
  9611. * @param {module:engine/view/downcastwriter~DowncastWriter} writer The view writer that should be used to modify the view document.
  9612. */
  9613. reconvertElement( element, writer ) {
  9614. const elementRange = _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( element );
  9615. this.conversionApi.writer = writer;
  9616. // Create a list of things that can be consumed, consisting of nodes and their attributes.
  9617. this.conversionApi.consumable = this._createInsertConsumable( elementRange );
  9618. const mapper = this.conversionApi.mapper;
  9619. const currentView = mapper.toViewElement( element );
  9620. // Remove the old view but do not remove mapper mappings - those will be used to revive existing elements.
  9621. writer.remove( currentView );
  9622. // Convert the element - without converting children.
  9623. this._convertInsertWithAttributes( {
  9624. item: element,
  9625. range: elementRange
  9626. } );
  9627. const convertedViewElement = mapper.toViewElement( element );
  9628. // Iterate over children of reconverted element in order to...
  9629. for ( const value of _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]._createIn( element ) ) {
  9630. const { item } = value;
  9631. const view = elementOrTextProxyToView( item, mapper );
  9632. // ...either bring back previously converted view...
  9633. if ( view ) {
  9634. // Do not move views that are already in converted element - those might be created by the main element converter in case
  9635. // when main element converts also its direct children.
  9636. if ( view.root !== convertedViewElement.root ) {
  9637. writer.move(
  9638. writer.createRangeOn( view ),
  9639. mapper.toViewPosition( _model_position__WEBPACK_IMPORTED_MODULE_2__["default"]._createBefore( item ) )
  9640. );
  9641. }
  9642. }
  9643. // ... or by converting newly inserted elements.
  9644. else {
  9645. this._convertInsertWithAttributes( walkerValueToEventData( value ) );
  9646. }
  9647. }
  9648. // After reconversion is done we can unbind the old view.
  9649. mapper.unbindViewElement( currentView );
  9650. this._clearConversionApi();
  9651. }
  9652. /**
  9653. * Starts model selection conversion.
  9654. *
  9655. * Fires events for given {@link module:engine/model/selection~Selection selection} to start selection conversion.
  9656. *
  9657. * @fires selection
  9658. * @fires addMarker
  9659. * @fires attribute
  9660. * @param {module:engine/model/selection~Selection} selection Selection to convert.
  9661. * @param {module:engine/model/markercollection~MarkerCollection} markers Markers connected with converted model.
  9662. * @param {module:engine/view/downcastwriter~DowncastWriter} writer View writer that should be used to modify view document.
  9663. */
  9664. convertSelection( selection, markers, writer ) {
  9665. const markersAtSelection = Array.from( markers.getMarkersAtPosition( selection.getFirstPosition() ) );
  9666. this.conversionApi.writer = writer;
  9667. this.conversionApi.consumable = this._createSelectionConsumable( selection, markersAtSelection );
  9668. this.fire( 'selection', { selection }, this.conversionApi );
  9669. if ( !selection.isCollapsed ) {
  9670. return;
  9671. }
  9672. for ( const marker of markersAtSelection ) {
  9673. const markerRange = marker.getRange();
  9674. if ( !shouldMarkerChangeBeConverted( selection.getFirstPosition(), marker, this.conversionApi.mapper ) ) {
  9675. continue;
  9676. }
  9677. const data = {
  9678. item: selection,
  9679. markerName: marker.name,
  9680. markerRange
  9681. };
  9682. if ( this.conversionApi.consumable.test( selection, 'addMarker:' + marker.name ) ) {
  9683. this.fire( 'addMarker:' + marker.name, data, this.conversionApi );
  9684. }
  9685. }
  9686. for ( const key of selection.getAttributeKeys() ) {
  9687. const data = {
  9688. item: selection,
  9689. range: selection.getFirstRange(),
  9690. attributeKey: key,
  9691. attributeOldValue: null,
  9692. attributeNewValue: selection.getAttribute( key )
  9693. };
  9694. // Do not fire event if the attribute has been consumed.
  9695. if ( this.conversionApi.consumable.test( selection, 'attribute:' + data.attributeKey ) ) {
  9696. this.fire( 'attribute:' + data.attributeKey + ':$text', data, this.conversionApi );
  9697. }
  9698. }
  9699. this._clearConversionApi();
  9700. }
  9701. /**
  9702. * Converts added marker. Fires {@link #event:addMarker addMarker} event for each item
  9703. * in marker's range. If range is collapsed single event is dispatched. See event description for more details.
  9704. *
  9705. * @fires addMarker
  9706. * @param {String} markerName Marker name.
  9707. * @param {module:engine/model/range~Range} markerRange Marker range.
  9708. * @param {module:engine/view/downcastwriter~DowncastWriter} writer View writer that should be used to modify view document.
  9709. */
  9710. convertMarkerAdd( markerName, markerRange, writer ) {
  9711. // Do not convert if range is in graveyard or not in the document (e.g. in DocumentFragment).
  9712. if ( !markerRange.root.document || markerRange.root.rootName == '$graveyard' ) {
  9713. return;
  9714. }
  9715. this.conversionApi.writer = writer;
  9716. // In markers' case, event name == consumable name.
  9717. const eventName = 'addMarker:' + markerName;
  9718. //
  9719. // First, fire an event for the whole marker.
  9720. //
  9721. const consumable = new _modelconsumable__WEBPACK_IMPORTED_MODULE_0__["default"]();
  9722. consumable.add( markerRange, eventName );
  9723. this.conversionApi.consumable = consumable;
  9724. this.fire( eventName, { markerName, markerRange }, this.conversionApi );
  9725. //
  9726. // Do not fire events for each item inside the range if the range got consumed.
  9727. //
  9728. if ( !consumable.test( markerRange, eventName ) ) {
  9729. return;
  9730. }
  9731. //
  9732. // Then, fire an event for each item inside the marker range.
  9733. //
  9734. this.conversionApi.consumable = this._createConsumableForRange( markerRange, eventName );
  9735. for ( const item of markerRange.getItems() ) {
  9736. // Do not fire event for already consumed items.
  9737. if ( !this.conversionApi.consumable.test( item, eventName ) ) {
  9738. continue;
  9739. }
  9740. const data = { item, range: _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( item ), markerName, markerRange };
  9741. this.fire( eventName, data, this.conversionApi );
  9742. }
  9743. this._clearConversionApi();
  9744. }
  9745. /**
  9746. * Fires conversion of marker removal. Fires {@link #event:removeMarker removeMarker} event with provided data.
  9747. *
  9748. * @fires removeMarker
  9749. * @param {String} markerName Marker name.
  9750. * @param {module:engine/model/range~Range} markerRange Marker range.
  9751. * @param {module:engine/view/downcastwriter~DowncastWriter} writer View writer that should be used to modify view document.
  9752. */
  9753. convertMarkerRemove( markerName, markerRange, writer ) {
  9754. // Do not convert if range is in graveyard or not in the document (e.g. in DocumentFragment).
  9755. if ( !markerRange.root.document || markerRange.root.rootName == '$graveyard' ) {
  9756. return;
  9757. }
  9758. this.conversionApi.writer = writer;
  9759. this.fire( 'removeMarker:' + markerName, { markerName, markerRange }, this.conversionApi );
  9760. this._clearConversionApi();
  9761. }
  9762. /**
  9763. * Maps model element "insert" reconversion for given event names. The event names must be fully specified:
  9764. *
  9765. * * For "attribute" change event it should include main element name, ie: `'attribute:attributeName:elementName'`.
  9766. * * For child nodes change events, those should use child event name as well, ie:
  9767. * * For adding a node: `'insert:childElementName'`.
  9768. * * For removing a node: `'remove:childElementName'`.
  9769. *
  9770. * **Note**: This method should not be used directly. A reconversion is defined by `triggerBy` configuration of the `elementToElement()`
  9771. * conversion helper.
  9772. *
  9773. * @protected
  9774. * @param {String} modelName Main model element name for which events will trigger reconversion.
  9775. * @param {String} eventName Name of an event that would trigger conversion for given model element.
  9776. */
  9777. _mapReconversionTriggerEvent( modelName, eventName ) {
  9778. this._reconversionEventsMapping.set( eventName, modelName );
  9779. }
  9780. /**
  9781. * Creates {@link module:engine/conversion/modelconsumable~ModelConsumable} with values to consume from given range,
  9782. * assuming that the range has just been inserted to the model.
  9783. *
  9784. * @private
  9785. * @param {module:engine/model/range~Range} range Inserted range.
  9786. * @returns {module:engine/conversion/modelconsumable~ModelConsumable} Values to consume.
  9787. */
  9788. _createInsertConsumable( range ) {
  9789. const consumable = new _modelconsumable__WEBPACK_IMPORTED_MODULE_0__["default"]();
  9790. for ( const value of range ) {
  9791. const item = value.item;
  9792. consumable.add( item, 'insert' );
  9793. for ( const key of item.getAttributeKeys() ) {
  9794. consumable.add( item, 'attribute:' + key );
  9795. }
  9796. }
  9797. return consumable;
  9798. }
  9799. /**
  9800. * Creates {@link module:engine/conversion/modelconsumable~ModelConsumable} with values to consume for given range.
  9801. *
  9802. * @private
  9803. * @param {module:engine/model/range~Range} range Affected range.
  9804. * @param {String} type Consumable type.
  9805. * @returns {module:engine/conversion/modelconsumable~ModelConsumable} Values to consume.
  9806. */
  9807. _createConsumableForRange( range, type ) {
  9808. const consumable = new _modelconsumable__WEBPACK_IMPORTED_MODULE_0__["default"]();
  9809. for ( const item of range.getItems() ) {
  9810. consumable.add( item, type );
  9811. }
  9812. return consumable;
  9813. }
  9814. /**
  9815. * Creates {@link module:engine/conversion/modelconsumable~ModelConsumable} with selection consumable values.
  9816. *
  9817. * @private
  9818. * @param {module:engine/model/selection~Selection} selection Selection to create consumable from.
  9819. * @param {Iterable.<module:engine/model/markercollection~Marker>} markers Markers which contains selection.
  9820. * @returns {module:engine/conversion/modelconsumable~ModelConsumable} Values to consume.
  9821. */
  9822. _createSelectionConsumable( selection, markers ) {
  9823. const consumable = new _modelconsumable__WEBPACK_IMPORTED_MODULE_0__["default"]();
  9824. consumable.add( selection, 'selection' );
  9825. for ( const marker of markers ) {
  9826. consumable.add( selection, 'addMarker:' + marker.name );
  9827. }
  9828. for ( const key of selection.getAttributeKeys() ) {
  9829. consumable.add( selection, 'attribute:' + key );
  9830. }
  9831. return consumable;
  9832. }
  9833. /**
  9834. * Tests passed `consumable` to check whether given event can be fired and if so, fires it.
  9835. *
  9836. * @private
  9837. * @fires insert
  9838. * @fires attribute
  9839. * @param {String} type Event type.
  9840. * @param {Object} data Event data.
  9841. */
  9842. _testAndFire( type, data ) {
  9843. if ( !this.conversionApi.consumable.test( data.item, type ) ) {
  9844. // Do not fire event if the item was consumed.
  9845. return;
  9846. }
  9847. this.fire( getEventName( type, data ), data, this.conversionApi );
  9848. }
  9849. /**
  9850. * Clears conversion API object.
  9851. *
  9852. * @private
  9853. */
  9854. _clearConversionApi() {
  9855. delete this.conversionApi.writer;
  9856. delete this.conversionApi.consumable;
  9857. }
  9858. /**
  9859. * Internal method for converting element insert. It will fire events for the inserted element and events for its attributes.
  9860. *
  9861. * @private
  9862. * @fires insert
  9863. * @fires attribute
  9864. * @param {Object} data Event data.
  9865. */
  9866. _convertInsertWithAttributes( data ) {
  9867. this._testAndFire( 'insert', data );
  9868. // Fire a separate addAttribute event for each attribute that was set on inserted items.
  9869. // This is important because most attributes converters will listen only to add/change/removeAttribute events.
  9870. // If we would not add this part, attributes on inserted nodes would not be converted.
  9871. for ( const key of data.item.getAttributeKeys() ) {
  9872. data.attributeKey = key;
  9873. data.attributeOldValue = null;
  9874. data.attributeNewValue = data.item.getAttribute( key );
  9875. this._testAndFire( `attribute:${ key }`, data );
  9876. }
  9877. }
  9878. /**
  9879. * Returns differ changes together with added "reconvert" type changes for {@link #reconvertElement}. Those are defined by
  9880. * a `triggerBy` configuration for
  9881. * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`} conversion helper.
  9882. *
  9883. * This method will remove every mapped insert or remove change with a single "reconvert" changes.
  9884. *
  9885. * For instance: Having a `triggerBy` configuration defined for `<complex>` element that issues this element reconversion on
  9886. * `foo` and `bar` attributes change, and a set of changes for this element:
  9887. *
  9888. * const differChanges = [
  9889. * { type: 'attribute', attributeKey: 'foo', ... },
  9890. * { type: 'attribute', attributeKey: 'bar', ... },
  9891. * { type: 'attribute', attributeKey: 'baz', ... }
  9892. * ];
  9893. *
  9894. * This method will return:
  9895. *
  9896. * const updatedChanges = [
  9897. * { type: 'reconvert', element: complexElementInstance },
  9898. * { type: 'attribute', attributeKey: 'baz', ... }
  9899. * ];
  9900. *
  9901. * In the example above the `'baz'` attribute change will fire an {@link #event:attribute attribute event}
  9902. *
  9903. * @param {module:engine/model/differ~Differ} differ The differ object with buffered changes.
  9904. * @returns {Array.<Object>} Updated set of changes.
  9905. * @private
  9906. */
  9907. _mapChangesWithAutomaticReconversion( differ ) {
  9908. const itemsToReconvert = new Set();
  9909. const updated = [];
  9910. for ( const entry of differ.getChanges() ) {
  9911. const position = entry.position || entry.range.start;
  9912. // Cached parent - just in case. See https://github.com/ckeditor/ckeditor5/issues/6579.
  9913. const positionParent = position.parent;
  9914. const textNode = Object(_model_position__WEBPACK_IMPORTED_MODULE_2__["getTextNodeAtPosition"])( position, positionParent );
  9915. // Reconversion is done only on elements so skip text changes.
  9916. if ( textNode ) {
  9917. updated.push( entry );
  9918. continue;
  9919. }
  9920. const element = entry.type === 'attribute' ? Object(_model_position__WEBPACK_IMPORTED_MODULE_2__["getNodeAfterPosition"])( position, positionParent, null ) : positionParent;
  9921. // Case of text node set directly in root. For now used only in tests but can be possible when enabled in paragraph-like roots.
  9922. // See: https://github.com/ckeditor/ckeditor5/issues/762.
  9923. if ( element.is( '$text' ) ) {
  9924. updated.push( entry );
  9925. continue;
  9926. }
  9927. let eventName;
  9928. if ( entry.type === 'attribute' ) {
  9929. eventName = `attribute:${ entry.attributeKey }:${ element.name }`;
  9930. } else {
  9931. eventName = `${ entry.type }:${ entry.name }`;
  9932. }
  9933. if ( this._isReconvertTriggerEvent( eventName, element.name ) ) {
  9934. if ( itemsToReconvert.has( element ) ) {
  9935. // Element is already reconverted, so skip this change.
  9936. continue;
  9937. }
  9938. itemsToReconvert.add( element );
  9939. // Add special "reconvert" change.
  9940. updated.push( { type: 'reconvert', element } );
  9941. } else {
  9942. updated.push( entry );
  9943. }
  9944. }
  9945. return updated;
  9946. }
  9947. /**
  9948. * Checks if resulting change should trigger element reconversion.
  9949. *
  9950. * Those are defined by a `triggerBy` configuration for
  9951. * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`} conversion helper.
  9952. *
  9953. * @private
  9954. * @param {String} eventName Event name to check.
  9955. * @param {String} elementName Element name to check.
  9956. * @returns {Boolean}
  9957. */
  9958. _isReconvertTriggerEvent( eventName, elementName ) {
  9959. return this._reconversionEventsMapping.get( eventName ) === elementName;
  9960. }
  9961. /**
  9962. * Fired for inserted nodes.
  9963. *
  9964. * `insert` is a namespace for a class of events. Names of actually called events follow this pattern:
  9965. * `insert:name`. `name` is either `'$text'`, when {@link module:engine/model/text~Text a text node} has been inserted,
  9966. * or {@link module:engine/model/element~Element#name name} of inserted element.
  9967. *
  9968. * This way listeners can either listen to a general `insert` event or specific event (for example `insert:paragraph`).
  9969. *
  9970. * @event insert
  9971. * @param {Object} data Additional information about the change.
  9972. * @param {module:engine/model/item~Item} data.item Inserted item.
  9973. * @param {module:engine/model/range~Range} data.range Range spanning over inserted item.
  9974. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface
  9975. * to be used by callback, passed in `DowncastDispatcher` constructor.
  9976. */
  9977. /**
  9978. * Fired for removed nodes.
  9979. *
  9980. * `remove` is a namespace for a class of events. Names of actually called events follow this pattern:
  9981. * `remove:name`. `name` is either `'$text'`, when {@link module:engine/model/text~Text a text node} has been removed,
  9982. * or the {@link module:engine/model/element~Element#name name} of removed element.
  9983. *
  9984. * This way listeners can either listen to a general `remove` event or specific event (for example `remove:paragraph`).
  9985. *
  9986. * @event remove
  9987. * @param {Object} data Additional information about the change.
  9988. * @param {module:engine/model/position~Position} data.position Position from which the node has been removed.
  9989. * @param {Number} data.length Offset size of the removed node.
  9990. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface
  9991. * to be used by callback, passed in `DowncastDispatcher` constructor.
  9992. */
  9993. /**
  9994. * Fired in the following cases:
  9995. *
  9996. * * when an attribute has been added, changed, or removed from a node,
  9997. * * when a node with an attribute is inserted,
  9998. * * when collapsed model selection attribute is converted.
  9999. *
  10000. * `attribute` is a namespace for a class of events. Names of actually called events follow this pattern:
  10001. * `attribute:attributeKey:name`. `attributeKey` is the key of added/changed/removed attribute.
  10002. * `name` is either `'$text'` if change was on {@link module:engine/model/text~Text a text node},
  10003. * or the {@link module:engine/model/element~Element#name name} of element which attribute has changed.
  10004. *
  10005. * This way listeners can either listen to a general `attribute:bold` event or specific event (for example `attribute:src:image`).
  10006. *
  10007. * @event attribute
  10008. * @param {Object} data Additional information about the change.
  10009. * @param {module:engine/model/item~Item|module:engine/model/documentselection~DocumentSelection} data.item Changed item
  10010. * or converted selection.
  10011. * @param {module:engine/model/range~Range} data.range Range spanning over changed item or selection range.
  10012. * @param {String} data.attributeKey Attribute key.
  10013. * @param {*} data.attributeOldValue Attribute value before the change. This is `null` when selection attribute is converted.
  10014. * @param {*} data.attributeNewValue New attribute value.
  10015. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface
  10016. * to be used by callback, passed in `DowncastDispatcher` constructor.
  10017. */
  10018. /**
  10019. * Fired for {@link module:engine/model/selection~Selection selection} changes.
  10020. *
  10021. * @event selection
  10022. * @param {module:engine/model/selection~Selection} selection Selection that is converted.
  10023. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface
  10024. * to be used by callback, passed in `DowncastDispatcher` constructor.
  10025. */
  10026. /**
  10027. * Fired when a new marker is added to the model. Also fired when collapsed model selection that is inside a marker is converted.
  10028. *
  10029. * `addMarker` is a namespace for a class of events. Names of actually called events follow this pattern:
  10030. * `addMarker:markerName`. By specifying certain marker names, you can make the events even more gradual. For example,
  10031. * if markers are named `foo:abc`, `foo:bar`, then it is possible to listen to `addMarker:foo` or `addMarker:foo:abc` and
  10032. * `addMarker:foo:bar` events.
  10033. *
  10034. * If the marker range is not collapsed:
  10035. *
  10036. * * the event is fired for each item in the marker range one by one,
  10037. * * `conversionApi.consumable` includes each item of the marker range and the consumable value is same as event name.
  10038. *
  10039. * If the marker range is collapsed:
  10040. *
  10041. * * there is only one event,
  10042. * * `conversionApi.consumable` includes marker range with event name.
  10043. *
  10044. * If selection inside a marker is converted:
  10045. *
  10046. * * there is only one event,
  10047. * * `conversionApi.consumable` includes selection instance with event name.
  10048. *
  10049. * @event addMarker
  10050. * @param {Object} data Additional information about the change.
  10051. * @param {module:engine/model/item~Item|module:engine/model/selection~Selection} data.item Item inside the new marker or
  10052. * the selection that is being converted.
  10053. * @param {module:engine/model/range~Range} [data.range] Range spanning over converted item. Available only in marker conversion, if
  10054. * the marker range was not collapsed.
  10055. * @param {module:engine/model/range~Range} data.markerRange Marker range.
  10056. * @param {String} data.markerName Marker name.
  10057. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface
  10058. * to be used by callback, passed in `DowncastDispatcher` constructor.
  10059. */
  10060. /**
  10061. * Fired when marker is removed from the model.
  10062. *
  10063. * `removeMarker` is a namespace for a class of events. Names of actually called events follow this pattern:
  10064. * `removeMarker:markerName`. By specifying certain marker names, you can make the events even more gradual. For example,
  10065. * if markers are named `foo:abc`, `foo:bar`, then it is possible to listen to `removeMarker:foo` or `removeMarker:foo:abc` and
  10066. * `removeMarker:foo:bar` events.
  10067. *
  10068. * @event removeMarker
  10069. * @param {Object} data Additional information about the change.
  10070. * @param {module:engine/model/range~Range} data.markerRange Marker range.
  10071. * @param {String} data.markerName Marker name.
  10072. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface
  10073. * to be used by callback, passed in `DowncastDispatcher` constructor.
  10074. */
  10075. }
  10076. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_4__["default"])( DowncastDispatcher, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_3__["default"] );
  10077. // Helper function, checks whether change of `marker` at `modelPosition` should be converted. Marker changes are not
  10078. // converted if they happen inside an element with custom conversion method.
  10079. //
  10080. // @param {module:engine/model/position~Position} modelPosition
  10081. // @param {module:engine/model/markercollection~Marker} marker
  10082. // @param {module:engine/conversion/mapper~Mapper} mapper
  10083. // @returns {Boolean}
  10084. function shouldMarkerChangeBeConverted( modelPosition, marker, mapper ) {
  10085. const range = marker.getRange();
  10086. const ancestors = Array.from( modelPosition.getAncestors() );
  10087. ancestors.shift(); // Remove root element. It cannot be passed to `model.Range#containsItem`.
  10088. ancestors.reverse();
  10089. const hasCustomHandling = ancestors.some( element => {
  10090. if ( range.containsItem( element ) ) {
  10091. const viewElement = mapper.toViewElement( element );
  10092. return !!viewElement.getCustomProperty( 'addHighlight' );
  10093. }
  10094. } );
  10095. return !hasCustomHandling;
  10096. }
  10097. function getEventName( type, data ) {
  10098. const name = data.item.name || '$text';
  10099. return `${ type }:${ name }`;
  10100. }
  10101. function walkerValueToEventData( value ) {
  10102. const item = value.item;
  10103. const itemRange = _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]._createFromPositionAndShift( value.previousPosition, value.length );
  10104. return {
  10105. item,
  10106. range: itemRange
  10107. };
  10108. }
  10109. function elementOrTextProxyToView( item, mapper ) {
  10110. if ( item.is( 'textProxy' ) ) {
  10111. const mappedPosition = mapper.toViewPosition( _model_position__WEBPACK_IMPORTED_MODULE_2__["default"]._createBefore( item ) );
  10112. const positionParent = mappedPosition.parent;
  10113. return positionParent.is( '$text' ) ? positionParent : null;
  10114. }
  10115. return mapper.toViewElement( item );
  10116. }
  10117. /**
  10118. * Conversion interface that is registered for given {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}
  10119. * and is passed as one of parameters when {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher dispatcher}
  10120. * fires its events.
  10121. *
  10122. * @interface module:engine/conversion/downcastdispatcher~DowncastConversionApi
  10123. */
  10124. /**
  10125. * The {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher} instance.
  10126. *
  10127. * @member {module:engine/conversion/downcastdispatcher~DowncastDispatcher} #dispatcher
  10128. */
  10129. /**
  10130. * Stores information about what parts of processed model item are still waiting to be handled. After a piece of model item
  10131. * was converted, appropriate consumable value should be {@link module:engine/conversion/modelconsumable~ModelConsumable#consume consumed}.
  10132. *
  10133. * @member {module:engine/conversion/modelconsumable~ModelConsumable} #consumable
  10134. */
  10135. /**
  10136. * The {@link module:engine/conversion/mapper~Mapper} instance.
  10137. *
  10138. * @member {module:engine/conversion/mapper~Mapper} #mapper
  10139. */
  10140. /**
  10141. * The {@link module:engine/model/schema~Schema} instance set for the model that is downcast.
  10142. *
  10143. * @member {module:engine/model/schema~Schema} #schema
  10144. */
  10145. /**
  10146. * The {@link module:engine/view/downcastwriter~DowncastWriter} instance used to manipulate data during conversion.
  10147. *
  10148. * @member {module:engine/view/downcastwriter~DowncastWriter} #writer
  10149. */
  10150. /**
  10151. * An object with an additional configuration which can be used during conversion process. Available only for data downcast conversion.
  10152. *
  10153. * @member {Object} #options
  10154. */
  10155. /***/ }),
  10156. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcasthelpers.js":
  10157. /*!***********************************************************************************!*\
  10158. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcasthelpers.js ***!
  10159. \***********************************************************************************/
  10160. /*! exports provided: default, insertText, remove, createViewElementFromHighlightDescriptor, convertRangeSelection, convertCollapsedSelection, clearAttributes, wrap, insertElement, insertUIElement */
  10161. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10162. "use strict";
  10163. __webpack_require__.r(__webpack_exports__);
  10164. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DowncastHelpers; });
  10165. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertText", function() { return insertText; });
  10166. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "remove", function() { return remove; });
  10167. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createViewElementFromHighlightDescriptor", function() { return createViewElementFromHighlightDescriptor; });
  10168. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertRangeSelection", function() { return convertRangeSelection; });
  10169. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertCollapsedSelection", function() { return convertCollapsedSelection; });
  10170. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clearAttributes", function() { return clearAttributes; });
  10171. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return wrap; });
  10172. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertElement", function() { return insertElement; });
  10173. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertUIElement", function() { return insertUIElement; });
  10174. /* harmony import */ var _model_range__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../model/range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  10175. /* harmony import */ var _model_selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../model/selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/selection.js");
  10176. /* harmony import */ var _model_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../model/element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
  10177. /* harmony import */ var _view_attributeelement__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../view/attributeelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/attributeelement.js");
  10178. /* harmony import */ var _model_documentselection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../model/documentselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js");
  10179. /* harmony import */ var _conversionhelpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./conversionhelpers */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversionhelpers.js");
  10180. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  10181. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  10182. /**
  10183. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  10184. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  10185. */
  10186. /**
  10187. * Contains downcast (model-to-view) converters for {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}.
  10188. *
  10189. * @module engine/conversion/downcasthelpers
  10190. */
  10191. /**
  10192. * Downcast conversion helper functions.
  10193. *
  10194. * @extends module:engine/conversion/conversionhelpers~ConversionHelpers
  10195. */
  10196. class DowncastHelpers extends _conversionhelpers__WEBPACK_IMPORTED_MODULE_5__["default"] {
  10197. /**
  10198. * Model element to view element conversion helper.
  10199. *
  10200. * This conversion results in creating a view element. For example, model `<paragraph>Foo</paragraph>` becomes `<p>Foo</p>` in the view.
  10201. *
  10202. * editor.conversion.for( 'downcast' ).elementToElement( {
  10203. * model: 'paragraph',
  10204. * view: 'p'
  10205. * } );
  10206. *
  10207. * editor.conversion.for( 'downcast' ).elementToElement( {
  10208. * model: 'paragraph',
  10209. * view: 'div',
  10210. * converterPriority: 'high'
  10211. * } );
  10212. *
  10213. * editor.conversion.for( 'downcast' ).elementToElement( {
  10214. * model: 'fancyParagraph',
  10215. * view: {
  10216. * name: 'p',
  10217. * classes: 'fancy'
  10218. * }
  10219. * } );
  10220. *
  10221. * editor.conversion.for( 'downcast' ).elementToElement( {
  10222. * model: 'heading',
  10223. * view: ( modelElement, conversionApi ) => {
  10224. * const { writer } = conversionApi;
  10225. *
  10226. * return writer.createContainerElement( 'h' + modelElement.getAttribute( 'level' ) );
  10227. * }
  10228. * } );
  10229. *
  10230. * The element-to-element conversion supports a reconversion mechanism. This is helpful in conversion to complex view structures where
  10231. * multiple atomic element-to-element and attribute-to-attribute or attribute-to-element could be used. By specifying `triggerBy`
  10232. * events you can trigger reconverting model to a full view tree structures at once.
  10233. *
  10234. * editor.conversion.for( 'downcast' ).elementToElement( {
  10235. * model: 'complex',
  10236. * view: ( modelElement, conversionApi ) => createComplexViewFromModel( modelElement, conversionApi ),
  10237. * triggerBy: {
  10238. * attributes: [ 'foo', 'bar' ],
  10239. * children: [ 'slot' ]
  10240. * }
  10241. * } );
  10242. *
  10243. * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
  10244. * to the conversion process.
  10245. *
  10246. * You can read more about element-to-element conversion in the
  10247. * {@glink framework/guides/deep-dive/conversion/custom-element-conversion Custom element conversion} guide.
  10248. *
  10249. * @method #elementToElement
  10250. * @param {Object} config Conversion configuration.
  10251. * @param {String} config.model The name of the model element to convert.
  10252. * @param {module:engine/view/elementdefinition~ElementDefinition|Function} config.view A view element definition or a function
  10253. * that takes the model element and {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API}
  10254. * as parameters and returns a view container element.
  10255. * @param {Object} [config.triggerBy] Re-conversion triggers. At least one trigger must be defined.
  10256. * @param {Array.<String>} config.triggerBy.attributes Name of element's attributes which change will trigger element reconversion.
  10257. * @param {Array.<String>} config.triggerBy.children Name of direct children that adding or removing will trigger element reconversion.
  10258. * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers}
  10259. */
  10260. elementToElement( config ) {
  10261. return this.add( downcastElementToElement( config ) );
  10262. }
  10263. /**
  10264. * Model attribute to view element conversion helper.
  10265. *
  10266. * This conversion results in wrapping view nodes with a view attribute element. For example, a model text node with
  10267. * `"Foo"` as data and the `bold` attribute becomes `<strong>Foo</strong>` in the view.
  10268. *
  10269. * editor.conversion.for( 'downcast' ).attributeToElement( {
  10270. * model: 'bold',
  10271. * view: 'strong'
  10272. * } );
  10273. *
  10274. * editor.conversion.for( 'downcast' ).attributeToElement( {
  10275. * model: 'bold',
  10276. * view: 'b',
  10277. * converterPriority: 'high'
  10278. * } );
  10279. *
  10280. * editor.conversion.for( 'downcast' ).attributeToElement( {
  10281. * model: 'invert',
  10282. * view: {
  10283. * name: 'span',
  10284. * classes: [ 'font-light', 'bg-dark' ]
  10285. * }
  10286. * } );
  10287. *
  10288. * editor.conversion.for( 'downcast' ).attributeToElement( {
  10289. * model: {
  10290. * key: 'fontSize',
  10291. * values: [ 'big', 'small' ]
  10292. * },
  10293. * view: {
  10294. * big: {
  10295. * name: 'span',
  10296. * styles: {
  10297. * 'font-size': '1.2em'
  10298. * }
  10299. * },
  10300. * small: {
  10301. * name: 'span',
  10302. * styles: {
  10303. * 'font-size': '0.8em'
  10304. * }
  10305. * }
  10306. * }
  10307. * } );
  10308. *
  10309. * editor.conversion.for( 'downcast' ).attributeToElement( {
  10310. * model: 'bold',
  10311. * view: ( modelAttributeValue, conversionApi ) => {
  10312. * const { writer } = conversionApi;
  10313. *
  10314. * return writer.createAttributeElement( 'span', {
  10315. * style: 'font-weight:' + modelAttributeValue
  10316. * } );
  10317. * }
  10318. * } );
  10319. *
  10320. * editor.conversion.for( 'downcast' ).attributeToElement( {
  10321. * model: {
  10322. * key: 'color',
  10323. * name: '$text'
  10324. * },
  10325. * view: ( modelAttributeValue, conversionApi ) => {
  10326. * const { writer } = conversionApi;
  10327. *
  10328. * return writer.createAttributeElement( 'span', {
  10329. * style: 'color:' + modelAttributeValue
  10330. * } );
  10331. * }
  10332. * } );
  10333. *
  10334. * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
  10335. * to the conversion process.
  10336. *
  10337. * @method #attributeToElement
  10338. * @param {Object} config Conversion configuration.
  10339. * @param {String|Object} config.model The key of the attribute to convert from or a `{ key, values }` object. `values` is an array
  10340. * of `String`s with possible values if the model attribute is an enumerable.
  10341. * @param {module:engine/view/elementdefinition~ElementDefinition|Function|Object} config.view A view element definition or a function
  10342. * that takes the model attribute value and
  10343. * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API} as parameters and returns a view
  10344. * attribute element. If `config.model.values` is given, `config.view` should be an object assigning values from `config.model.values`
  10345. * to view element definitions or functions.
  10346. * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  10347. * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers}
  10348. */
  10349. attributeToElement( config ) {
  10350. return this.add( downcastAttributeToElement( config ) );
  10351. }
  10352. /**
  10353. * Model attribute to view attribute conversion helper.
  10354. *
  10355. * This conversion results in adding an attribute to a view node, basing on an attribute from a model node. For example,
  10356. * `<image src='foo.jpg'></image>` is converted to `<img src='foo.jpg'></img>`.
  10357. *
  10358. * editor.conversion.for( 'downcast' ).attributeToAttribute( {
  10359. * model: 'source',
  10360. * view: 'src'
  10361. * } );
  10362. *
  10363. * editor.conversion.for( 'downcast' ).attributeToAttribute( {
  10364. * model: 'source',
  10365. * view: 'href',
  10366. * converterPriority: 'high'
  10367. * } );
  10368. *
  10369. * editor.conversion.for( 'downcast' ).attributeToAttribute( {
  10370. * model: {
  10371. * name: 'image',
  10372. * key: 'source'
  10373. * },
  10374. * view: 'src'
  10375. * } );
  10376. *
  10377. * editor.conversion.for( 'downcast' ).attributeToAttribute( {
  10378. * model: {
  10379. * name: 'styled',
  10380. * values: [ 'dark', 'light' ]
  10381. * },
  10382. * view: {
  10383. * dark: {
  10384. * key: 'class',
  10385. * value: [ 'styled', 'styled-dark' ]
  10386. * },
  10387. * light: {
  10388. * key: 'class',
  10389. * value: [ 'styled', 'styled-light' ]
  10390. * }
  10391. * }
  10392. * } );
  10393. *
  10394. * editor.conversion.for( 'downcast' ).attributeToAttribute( {
  10395. * model: 'styled',
  10396. * view: modelAttributeValue => ( {
  10397. * key: 'class',
  10398. * value: 'styled-' + modelAttributeValue
  10399. * } )
  10400. * } );
  10401. *
  10402. * **Note**: Downcasting to a style property requires providing `value` as an object:
  10403. *
  10404. * editor.conversion.for( 'downcast' ).attributeToAttribute( {
  10405. * model: 'lineHeight',
  10406. * view: modelAttributeValue => ( {
  10407. * key: 'style',
  10408. * value: {
  10409. * 'line-height': modelAttributeValue,
  10410. * 'border-bottom': '1px dotted #ba2'
  10411. * }
  10412. * } )
  10413. * } );
  10414. *
  10415. * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
  10416. * to the conversion process.
  10417. *
  10418. * @method #attributeToAttribute
  10419. * @param {Object} config Conversion configuration.
  10420. * @param {String|Object} config.model The key of the attribute to convert from or a `{ key, values, [ name ] }` object describing
  10421. * the attribute key, possible values and, optionally, an element name to convert from.
  10422. * @param {String|Object|Function} config.view A view attribute key, or a `{ key, value }` object or a function that takes
  10423. * the model attribute value and {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API}
  10424. * as parameters and returns a `{ key, value }` object. If `key` is `'class'`, `value` can be a `String` or an
  10425. * array of `String`s. If `key` is `'style'`, `value` is an object with key-value pairs. In other cases, `value` is a `String`.
  10426. * If `config.model.values` is set, `config.view` should be an object assigning values from `config.model.values` to
  10427. * `{ key, value }` objects or a functions.
  10428. * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  10429. * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers}
  10430. */
  10431. attributeToAttribute( config ) {
  10432. return this.add( downcastAttributeToAttribute( config ) );
  10433. }
  10434. /**
  10435. * Model marker to view element conversion helper.
  10436. *
  10437. * **Note**: This method should be used only for editing downcast. For data downcast, use
  10438. * {@link #markerToData `#markerToData()`} that produces valid HTML data.
  10439. *
  10440. * This conversion results in creating a view element on the boundaries of the converted marker. If the converted marker
  10441. * is collapsed, only one element is created. For example, model marker set like this: `<paragraph>F[oo b]ar</paragraph>`
  10442. * becomes `<p>F<span data-marker="search"></span>oo b<span data-marker="search"></span>ar</p>` in the view.
  10443. *
  10444. * editor.conversion.for( 'editingDowncast' ).markerToElement( {
  10445. * model: 'search',
  10446. * view: 'marker-search'
  10447. * } );
  10448. *
  10449. * editor.conversion.for( 'editingDowncast' ).markerToElement( {
  10450. * model: 'search',
  10451. * view: 'search-result',
  10452. * converterPriority: 'high'
  10453. * } );
  10454. *
  10455. * editor.conversion.for( 'editingDowncast' ).markerToElement( {
  10456. * model: 'search',
  10457. * view: {
  10458. * name: 'span',
  10459. * attributes: {
  10460. * 'data-marker': 'search'
  10461. * }
  10462. * }
  10463. * } );
  10464. *
  10465. * editor.conversion.for( 'editingDowncast' ).markerToElement( {
  10466. * model: 'search',
  10467. * view: ( markerData, conversionApi ) => {
  10468. * const { writer } = conversionApi;
  10469. *
  10470. * return writer.createUIElement( 'span', {
  10471. * 'data-marker': 'search',
  10472. * 'data-start': markerData.isOpening
  10473. * } );
  10474. * }
  10475. * } );
  10476. *
  10477. * If a function is passed as the `config.view` parameter, it will be used to generate both boundary elements. The function
  10478. * receives the `data` object and {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API}
  10479. * as a parameters and should return an instance of the
  10480. * {@link module:engine/view/uielement~UIElement view UI element}. The `data` object and
  10481. * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi `conversionApi`} are passed from
  10482. * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker}. Additionally,
  10483. * the `data.isOpening` parameter is passed, which is set to `true` for the marker start boundary element, and `false` to
  10484. * the marker end boundary element.
  10485. *
  10486. * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
  10487. * to the conversion process.
  10488. *
  10489. * @method #markerToElement
  10490. * @param {Object} config Conversion configuration.
  10491. * @param {String} config.model The name of the model marker (or model marker group) to convert.
  10492. * @param {module:engine/view/elementdefinition~ElementDefinition|Function} config.view A view element definition or a function that
  10493. * takes the model marker data and {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API}
  10494. * as a parameters and returns a view UI element.
  10495. * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  10496. * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers}
  10497. */
  10498. markerToElement( config ) {
  10499. return this.add( downcastMarkerToElement( config ) );
  10500. }
  10501. /**
  10502. * Model marker to highlight conversion helper.
  10503. *
  10504. * This conversion results in creating a highlight on view nodes. For this kind of conversion,
  10505. * {@link module:engine/conversion/downcasthelpers~HighlightDescriptor} should be provided.
  10506. *
  10507. * For text nodes, a `<span>` {@link module:engine/view/attributeelement~AttributeElement} is created and it wraps all text nodes
  10508. * in the converted marker range. For example, a model marker set like this: `<paragraph>F[oo b]ar</paragraph>` becomes
  10509. * `<p>F<span class="comment">oo b</span>ar</p>` in the view.
  10510. *
  10511. * {@link module:engine/view/containerelement~ContainerElement} may provide a custom way of handling highlight. Most often,
  10512. * the element itself is given classes and attributes described in the highlight descriptor (instead of being wrapped in `<span>`).
  10513. * For example, a model marker set like this: `[<image src="foo.jpg"></image>]` becomes `<img src="foo.jpg" class="comment"></img>`
  10514. * in the view.
  10515. *
  10516. * For container elements, the conversion is two-step. While the converter processes the highlight descriptor and passes it
  10517. * to a container element, it is the container element instance itself that applies values from the highlight descriptor.
  10518. * So, in a sense, the converter takes care of stating what should be applied on what, while the element decides how to apply that.
  10519. *
  10520. * editor.conversion.for( 'downcast' ).markerToHighlight( { model: 'comment', view: { classes: 'comment' } } );
  10521. *
  10522. * editor.conversion.for( 'downcast' ).markerToHighlight( {
  10523. * model: 'comment',
  10524. * view: { classes: 'new-comment' },
  10525. * converterPriority: 'high'
  10526. * } );
  10527. *
  10528. * editor.conversion.for( 'downcast' ).markerToHighlight( {
  10529. * model: 'comment',
  10530. * view: ( data, converstionApi ) => {
  10531. * // Assuming that the marker name is in a form of comment:commentType.
  10532. * const commentType = data.markerName.split( ':' )[ 1 ];
  10533. *
  10534. * return {
  10535. * classes: [ 'comment', 'comment-' + commentType ]
  10536. * };
  10537. * }
  10538. * } );
  10539. *
  10540. * If a function is passed as the `config.view` parameter, it will be used to generate the highlight descriptor. The function
  10541. * receives the `data` object and {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API}
  10542. * as a parameters and should return a
  10543. * {@link module:engine/conversion/downcasthelpers~HighlightDescriptor highlight descriptor}.
  10544. * The `data` object properties are passed from {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker}.
  10545. *
  10546. * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
  10547. * to the conversion process.
  10548. *
  10549. * @method #markerToHighlight
  10550. * @param {Object} config Conversion configuration.
  10551. * @param {String} config.model The name of the model marker (or model marker group) to convert.
  10552. * @param {module:engine/conversion/downcasthelpers~HighlightDescriptor|Function} config.view A highlight descriptor
  10553. * that will be used for highlighting or a function that takes the model marker data and
  10554. * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API} as a parameters
  10555. * and returns a highlight descriptor.
  10556. * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  10557. * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers}
  10558. */
  10559. markerToHighlight( config ) {
  10560. return this.add( downcastMarkerToHighlight( config ) );
  10561. }
  10562. /**
  10563. * Model marker converter for data downcast.
  10564. *
  10565. * This conversion creates a representation for model marker boundaries in the view:
  10566. *
  10567. * * If the marker boundary is at a position where text nodes are allowed, then a view element with the specified tag name
  10568. * and `name` attribute is added at this position.
  10569. * * In other cases, a specified attribute is set on a view element that is before or after the marker boundary.
  10570. *
  10571. * Typically, marker names use the `group:uniqueId:otherData` convention. For example: `comment:e34zfk9k2n459df53sjl34:zx32c`.
  10572. * The default configuration for this conversion is that the first part is the `group` part and the rest of
  10573. * the marker name becomes the `name` part.
  10574. *
  10575. * Tag and attribute names and values are generated from the marker name:
  10576. *
  10577. * * Templates for attributes are `data-[group]-start-before="[name]"`, `data-[group]-start-after="[name]"`,
  10578. * `data-[group]-end-before="[name]"` and `data-[group]-end-after="[name]"`.
  10579. * * Templates for view elements are `<[group]-start name="[name]">` and `<[group]-end name="[name]">`.
  10580. *
  10581. * Attributes mark whether the given marker's start or end boundary is before or after the given element.
  10582. * Attributes `data-[group]-start-before` and `data-[group]-end-after` are favored.
  10583. * The other two are used when the former two cannot be used.
  10584. *
  10585. * The conversion configuration can take a function that will generate different group and name parts.
  10586. * If such function is set as the `config.view` parameter, it is passed a marker name and it is expected to return an object with two
  10587. * properties: `group` and `name`. If the function returns a falsy value, the conversion will not take place.
  10588. *
  10589. * Basic usage:
  10590. *
  10591. * // Using the default conversion.
  10592. * // In this case, all markers whose name starts with 'comment:' will be converted.
  10593. * // The `group` parameter will be set to `comment`.
  10594. * // The `name` parameter will be the rest of the marker name (without `:`).
  10595. * editor.conversion.for( 'dataDowncast' ).markerToData( {
  10596. * model: 'comment'
  10597. * } );
  10598. *
  10599. * An example of a view that may be generated by this conversion (assuming a marker with the name `comment:commentId:uid` marked
  10600. * by `[]`):
  10601. *
  10602. * // Model:
  10603. * <paragraph>Foo[bar</paragraph>
  10604. * <image src="abc.jpg"></image>]
  10605. *
  10606. * // View:
  10607. * <p>Foo<comment-start name="commentId:uid"></comment-start>bar</p>
  10608. * <figure data-comment-end-after="commentId:uid" class="image"><img src="abc.jpg" /></figure>
  10609. *
  10610. * In the example above, the comment starts before "bar" and ends after the image.
  10611. *
  10612. * If the `name` part is empty, the following view may be generated:
  10613. *
  10614. * <p>Foo <myMarker-start></myMarker-start>bar</p>
  10615. * <figure data-myMarker-end-after="" class="image"><img src="abc.jpg" /></figure>
  10616. *
  10617. * **Note:** A situation where some markers have the `name` part and some do not have it is incorrect and should be avoided.
  10618. *
  10619. * Examples where `data-group-start-after` and `data-group-end-before` are used:
  10620. *
  10621. * // Model:
  10622. * <blockQuote>[]<paragraph>Foo</paragraph></blockQuote>
  10623. *
  10624. * // View:
  10625. * <blockquote><p data-group-end-before="name" data-group-start-before="name">Foo</p></blockquote>
  10626. *
  10627. * Similarly, when a marker is collapsed after the last element:
  10628. *
  10629. * // Model:
  10630. * <blockQuote><paragraph>Foo</paragraph>[]</blockQuote>
  10631. *
  10632. * // View:
  10633. * <blockquote><p data-group-end-after="name" data-group-start-after="name">Foo</p></blockquote>
  10634. *
  10635. * When there are multiple markers from the same group stored in the same attribute of the same element, their
  10636. * name parts are put together in the attribute value, for example: `data-group-start-before="name1,name2,name3"`.
  10637. *
  10638. * Other examples of usage:
  10639. *
  10640. * // Using a custom function which is the same as the default conversion:
  10641. * editor.conversion.for( 'dataDowncast' ).markerToData( {
  10642. * model: 'comment'
  10643. * view: markerName => ( {
  10644. * group: 'comment',
  10645. * name: markerName.substr( 8 ) // Removes 'comment:' part.
  10646. * } )
  10647. * } );
  10648. *
  10649. * // Using the converter priority:
  10650. * editor.conversion.for( 'dataDowncast' ).markerToData( {
  10651. * model: 'comment'
  10652. * view: markerName => ( {
  10653. * group: 'comment',
  10654. * name: markerName.substr( 8 ) // Removes 'comment:' part.
  10655. * } ),
  10656. * converterPriority: 'high'
  10657. * } );
  10658. *
  10659. * This kind of conversion is useful for saving data into the database, so it should be used in the data conversion pipeline.
  10660. *
  10661. * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
  10662. * to the conversion process.
  10663. *
  10664. * @method #markerToData
  10665. * @param {Object} config Conversion configuration.
  10666. * @param {String} config.model The name of the model marker (or model marker group) to convert.
  10667. * @param {Function} [config.view] A function that takes the model marker name and
  10668. * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API} as a parameters
  10669. * and returns an object with the `group` and `name` properties.
  10670. * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  10671. * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers}
  10672. */
  10673. markerToData( config ) {
  10674. return this.add( downcastMarkerToData( config ) );
  10675. }
  10676. }
  10677. /**
  10678. * Function factory that creates a default downcast converter for text insertion changes.
  10679. *
  10680. * The converter automatically consumes the corresponding value from the consumables list and stops the event (see
  10681. * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}).
  10682. *
  10683. * modelDispatcher.on( 'insert:$text', insertText() );
  10684. *
  10685. * @returns {Function} Insert text event converter.
  10686. */
  10687. function insertText() {
  10688. return ( evt, data, conversionApi ) => {
  10689. if ( !conversionApi.consumable.consume( data.item, 'insert' ) ) {
  10690. return;
  10691. }
  10692. const viewWriter = conversionApi.writer;
  10693. const viewPosition = conversionApi.mapper.toViewPosition( data.range.start );
  10694. const viewText = viewWriter.createText( data.item.data );
  10695. viewWriter.insert( viewPosition, viewText );
  10696. };
  10697. }
  10698. /**
  10699. * Function factory that creates a default downcast converter for node remove changes.
  10700. *
  10701. * modelDispatcher.on( 'remove', remove() );
  10702. *
  10703. * @returns {Function} Remove event converter.
  10704. */
  10705. function remove() {
  10706. return ( evt, data, conversionApi ) => {
  10707. // Find view range start position by mapping model position at which the remove happened.
  10708. const viewStart = conversionApi.mapper.toViewPosition( data.position );
  10709. const modelEnd = data.position.getShiftedBy( data.length );
  10710. const viewEnd = conversionApi.mapper.toViewPosition( modelEnd, { isPhantom: true } );
  10711. const viewRange = conversionApi.writer.createRange( viewStart, viewEnd );
  10712. // Trim the range to remove in case some UI elements are on the view range boundaries.
  10713. const removed = conversionApi.writer.remove( viewRange.getTrimmed() );
  10714. // After the range is removed, unbind all view elements from the model.
  10715. // Range inside view document fragment is used to unbind deeply.
  10716. for ( const child of conversionApi.writer.createRangeIn( removed ).getItems() ) {
  10717. conversionApi.mapper.unbindViewElement( child );
  10718. }
  10719. };
  10720. }
  10721. /**
  10722. * Creates a `<span>` {@link module:engine/view/attributeelement~AttributeElement view attribute element} from the information
  10723. * provided by the {@link module:engine/conversion/downcasthelpers~HighlightDescriptor highlight descriptor} object. If a priority
  10724. * is not provided in the descriptor, the default priority will be used.
  10725. *
  10726. * @param {module:engine/view/downcastwriter~DowncastWriter} writer
  10727. * @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} descriptor
  10728. * @returns {module:engine/view/attributeelement~AttributeElement}
  10729. */
  10730. function createViewElementFromHighlightDescriptor( writer, descriptor ) {
  10731. const viewElement = writer.createAttributeElement( 'span', descriptor.attributes );
  10732. if ( descriptor.classes ) {
  10733. viewElement._addClass( descriptor.classes );
  10734. }
  10735. if ( descriptor.priority ) {
  10736. viewElement._priority = descriptor.priority;
  10737. }
  10738. viewElement._id = descriptor.id;
  10739. return viewElement;
  10740. }
  10741. /**
  10742. * Function factory that creates a converter which converts a non-collapsed {@link module:engine/model/selection~Selection model selection}
  10743. * to a {@link module:engine/view/documentselection~DocumentSelection view selection}. The converter consumes appropriate
  10744. * value from the `consumable` object and maps model positions from the selection to view positions.
  10745. *
  10746. * modelDispatcher.on( 'selection', convertRangeSelection() );
  10747. *
  10748. * @returns {Function} Selection converter.
  10749. */
  10750. function convertRangeSelection() {
  10751. return ( evt, data, conversionApi ) => {
  10752. const selection = data.selection;
  10753. if ( selection.isCollapsed ) {
  10754. return;
  10755. }
  10756. if ( !conversionApi.consumable.consume( selection, 'selection' ) ) {
  10757. return;
  10758. }
  10759. const viewRanges = [];
  10760. for ( const range of selection.getRanges() ) {
  10761. const viewRange = conversionApi.mapper.toViewRange( range );
  10762. viewRanges.push( viewRange );
  10763. }
  10764. conversionApi.writer.setSelection( viewRanges, { backward: selection.isBackward } );
  10765. };
  10766. }
  10767. /**
  10768. * Function factory that creates a converter which converts a collapsed {@link module:engine/model/selection~Selection model selection} to
  10769. * a {@link module:engine/view/documentselection~DocumentSelection view selection}. The converter consumes appropriate
  10770. * value from the `consumable` object, maps the model selection position to the view position and breaks
  10771. * {@link module:engine/view/attributeelement~AttributeElement attribute elements} at the selection position.
  10772. *
  10773. * modelDispatcher.on( 'selection', convertCollapsedSelection() );
  10774. *
  10775. * An example of the view state before and after converting the collapsed selection:
  10776. *
  10777. * <p><strong>f^oo<strong>bar</p>
  10778. * -> <p><strong>f</strong>^<strong>oo</strong>bar</p>
  10779. *
  10780. * By breaking attribute elements like `<strong>`, the selection is in a correct element. Then, when the selection attribute is
  10781. * converted, broken attributes might be merged again, or the position where the selection is may be wrapped
  10782. * with different, appropriate attribute elements.
  10783. *
  10784. * See also {@link module:engine/conversion/downcasthelpers~clearAttributes} which does a clean-up
  10785. * by merging attributes.
  10786. *
  10787. * @returns {Function} Selection converter.
  10788. */
  10789. function convertCollapsedSelection() {
  10790. return ( evt, data, conversionApi ) => {
  10791. const selection = data.selection;
  10792. if ( !selection.isCollapsed ) {
  10793. return;
  10794. }
  10795. if ( !conversionApi.consumable.consume( selection, 'selection' ) ) {
  10796. return;
  10797. }
  10798. const viewWriter = conversionApi.writer;
  10799. const modelPosition = selection.getFirstPosition();
  10800. const viewPosition = conversionApi.mapper.toViewPosition( modelPosition );
  10801. const brokenPosition = viewWriter.breakAttributes( viewPosition );
  10802. viewWriter.setSelection( brokenPosition );
  10803. };
  10804. }
  10805. /**
  10806. * Function factory that creates a converter which clears artifacts after the previous
  10807. * {@link module:engine/model/selection~Selection model selection} conversion. It removes all empty
  10808. * {@link module:engine/view/attributeelement~AttributeElement view attribute elements} and merges sibling attributes at all start and end
  10809. * positions of all ranges.
  10810. *
  10811. * <p><strong>^</strong></p>
  10812. * -> <p>^</p>
  10813. *
  10814. * <p><strong>foo</strong>^<strong>bar</strong>bar</p>
  10815. * -> <p><strong>foo^bar<strong>bar</p>
  10816. *
  10817. * <p><strong>foo</strong><em>^</em><strong>bar</strong>bar</p>
  10818. * -> <p><strong>foo^bar<strong>bar</p>
  10819. *
  10820. * This listener should be assigned before any converter for the new selection:
  10821. *
  10822. * modelDispatcher.on( 'selection', clearAttributes() );
  10823. *
  10824. * See {@link module:engine/conversion/downcasthelpers~convertCollapsedSelection}
  10825. * which does the opposite by breaking attributes in the selection position.
  10826. *
  10827. * @returns {Function} Selection converter.
  10828. */
  10829. function clearAttributes() {
  10830. return ( evt, data, conversionApi ) => {
  10831. const viewWriter = conversionApi.writer;
  10832. const viewSelection = viewWriter.document.selection;
  10833. for ( const range of viewSelection.getRanges() ) {
  10834. // Not collapsed selection should not have artifacts.
  10835. if ( range.isCollapsed ) {
  10836. // Position might be in the node removed by the view writer.
  10837. if ( range.end.parent.isAttached() ) {
  10838. conversionApi.writer.mergeAttributes( range.start );
  10839. }
  10840. }
  10841. }
  10842. viewWriter.setSelection( null );
  10843. };
  10844. }
  10845. /**
  10846. * Function factory that creates a converter which converts set/change/remove attribute changes from the model to the view.
  10847. * It can also be used to convert selection attributes. In that case, an empty attribute element will be created and the
  10848. * selection will be put inside it.
  10849. *
  10850. * Attributes from the model are converted to a view element that will be wrapping these view nodes that are bound to
  10851. * model elements having the given attribute. This is useful for attributes like `bold` that may be set on text nodes in the model
  10852. * but are represented as an element in the view:
  10853. *
  10854. * [paragraph] MODEL ====> VIEW <p>
  10855. * |- a {bold: true} |- <b>
  10856. * |- b {bold: true} | |- ab
  10857. * |- c |- c
  10858. *
  10859. * Passed `Function` will be provided with the attribute value and then all the parameters of the
  10860. * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute `attribute` event}.
  10861. * It is expected that the function returns an {@link module:engine/view/element~Element}.
  10862. * The result of the function will be the wrapping element.
  10863. * When the provided `Function` does not return any element, no conversion will take place.
  10864. *
  10865. * The converter automatically consumes the corresponding value from the consumables list and stops the event (see
  10866. * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}).
  10867. *
  10868. * modelDispatcher.on( 'attribute:bold', wrap( ( modelAttributeValue, { writer } ) => {
  10869. * return writer.createAttributeElement( 'strong' );
  10870. * } );
  10871. *
  10872. * @protected
  10873. * @param {Function} elementCreator Function returning a view element that will be used for wrapping.
  10874. * @returns {Function} Set/change attribute converter.
  10875. */
  10876. function wrap( elementCreator ) {
  10877. return ( evt, data, conversionApi ) => {
  10878. // Recreate current wrapping node. It will be used to unwrap view range if the attribute value has changed
  10879. // or the attribute was removed.
  10880. const oldViewElement = elementCreator( data.attributeOldValue, conversionApi );
  10881. // Create node to wrap with.
  10882. const newViewElement = elementCreator( data.attributeNewValue, conversionApi );
  10883. if ( !oldViewElement && !newViewElement ) {
  10884. return;
  10885. }
  10886. if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
  10887. return;
  10888. }
  10889. const viewWriter = conversionApi.writer;
  10890. const viewSelection = viewWriter.document.selection;
  10891. if ( data.item instanceof _model_selection__WEBPACK_IMPORTED_MODULE_1__["default"] || data.item instanceof _model_documentselection__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
  10892. // Selection attribute conversion.
  10893. viewWriter.wrap( viewSelection.getFirstRange(), newViewElement );
  10894. } else {
  10895. // Node attribute conversion.
  10896. let viewRange = conversionApi.mapper.toViewRange( data.range );
  10897. // First, unwrap the range from current wrapper.
  10898. if ( data.attributeOldValue !== null && oldViewElement ) {
  10899. viewRange = viewWriter.unwrap( viewRange, oldViewElement );
  10900. }
  10901. if ( data.attributeNewValue !== null && newViewElement ) {
  10902. viewWriter.wrap( viewRange, newViewElement );
  10903. }
  10904. }
  10905. };
  10906. }
  10907. /**
  10908. * Function factory that creates a converter which converts node insertion changes from the model to the view.
  10909. * The function passed will be provided with all the parameters of the dispatcher's
  10910. * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert `insert` event}.
  10911. * It is expected that the function returns an {@link module:engine/view/element~Element}.
  10912. * The result of the function will be inserted into the view.
  10913. *
  10914. * The converter automatically consumes the corresponding value from the consumables list, stops the event (see
  10915. * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}) and binds the model and view elements.
  10916. *
  10917. * downcastDispatcher.on(
  10918. * 'insert:myElem',
  10919. * insertElement( ( modelItem, { writer } ) => {
  10920. * const text = writer.createText( 'myText' );
  10921. * const myElem = writer.createElement( 'myElem', { myAttr: 'my-' + modelItem.getAttribute( 'myAttr' ) }, text );
  10922. *
  10923. * // Do something fancy with `myElem` using `modelItem` or other parameters.
  10924. *
  10925. * return myElem;
  10926. * }
  10927. * ) );
  10928. *
  10929. * @protected
  10930. * @param {Function} elementCreator Function returning a view element, which will be inserted.
  10931. * @returns {Function} Insert element event converter.
  10932. */
  10933. function insertElement( elementCreator ) {
  10934. return ( evt, data, conversionApi ) => {
  10935. const viewElement = elementCreator( data.item, conversionApi );
  10936. if ( !viewElement ) {
  10937. return;
  10938. }
  10939. if ( !conversionApi.consumable.consume( data.item, 'insert' ) ) {
  10940. return;
  10941. }
  10942. const viewPosition = conversionApi.mapper.toViewPosition( data.range.start );
  10943. conversionApi.mapper.bindElements( data.item, viewElement );
  10944. conversionApi.writer.insert( viewPosition, viewElement );
  10945. };
  10946. }
  10947. /**
  10948. * Function factory that creates a converter which converts marker adding change to the
  10949. * {@link module:engine/view/uielement~UIElement view UI element}.
  10950. *
  10951. * The view UI element that will be added to the view depends on the passed parameter. See {@link ~insertElement}.
  10952. * In case of a non-collapsed range, the UI element will not wrap nodes but separate elements will be placed at the beginning
  10953. * and at the end of the range.
  10954. *
  10955. * This converter binds created UI elements with the marker name using {@link module:engine/conversion/mapper~Mapper#bindElementToMarker}.
  10956. *
  10957. * @protected
  10958. * @param {module:engine/view/uielement~UIElement|Function} elementCreator A view UI element or a function returning the view element
  10959. * that will be inserted.
  10960. * @returns {Function} Insert element event converter.
  10961. */
  10962. function insertUIElement( elementCreator ) {
  10963. return ( evt, data, conversionApi ) => {
  10964. // Create two view elements. One will be inserted at the beginning of marker, one at the end.
  10965. // If marker is collapsed, only "opening" element will be inserted.
  10966. data.isOpening = true;
  10967. const viewStartElement = elementCreator( data, conversionApi );
  10968. data.isOpening = false;
  10969. const viewEndElement = elementCreator( data, conversionApi );
  10970. if ( !viewStartElement || !viewEndElement ) {
  10971. return;
  10972. }
  10973. const markerRange = data.markerRange;
  10974. // Marker that is collapsed has consumable build differently that non-collapsed one.
  10975. // For more information see `addMarker` event description.
  10976. // If marker's range is collapsed - check if it can be consumed.
  10977. if ( markerRange.isCollapsed && !conversionApi.consumable.consume( markerRange, evt.name ) ) {
  10978. return;
  10979. }
  10980. // If marker's range is not collapsed - consume all items inside.
  10981. for ( const value of markerRange ) {
  10982. if ( !conversionApi.consumable.consume( value.item, evt.name ) ) {
  10983. return;
  10984. }
  10985. }
  10986. const mapper = conversionApi.mapper;
  10987. const viewWriter = conversionApi.writer;
  10988. // Add "opening" element.
  10989. viewWriter.insert( mapper.toViewPosition( markerRange.start ), viewStartElement );
  10990. conversionApi.mapper.bindElementToMarker( viewStartElement, data.markerName );
  10991. // Add "closing" element only if range is not collapsed.
  10992. if ( !markerRange.isCollapsed ) {
  10993. viewWriter.insert( mapper.toViewPosition( markerRange.end ), viewEndElement );
  10994. conversionApi.mapper.bindElementToMarker( viewEndElement, data.markerName );
  10995. }
  10996. evt.stop();
  10997. };
  10998. }
  10999. // Function factory that returns a default downcast converter for removing a {@link module:engine/view/uielement~UIElement UI element}
  11000. // based on marker remove change.
  11001. //
  11002. // This converter unbinds elements from the marker name.
  11003. //
  11004. // @returns {Function} Removed UI element converter.
  11005. function removeUIElement() {
  11006. return ( evt, data, conversionApi ) => {
  11007. const elements = conversionApi.mapper.markerNameToElements( data.markerName );
  11008. if ( !elements ) {
  11009. return;
  11010. }
  11011. for ( const element of elements ) {
  11012. conversionApi.mapper.unbindElementFromMarkerName( element, data.markerName );
  11013. conversionApi.writer.clear( conversionApi.writer.createRangeOn( element ), element );
  11014. }
  11015. conversionApi.writer.clearClonedElementsGroup( data.markerName );
  11016. evt.stop();
  11017. };
  11018. }
  11019. // Function factory that creates a default converter for model markers.
  11020. //
  11021. // See {@link DowncastHelpers#markerToData} for more information what type of view is generated.
  11022. //
  11023. // This converter binds created UI elements and affected view elements with the marker name
  11024. // using {@link module:engine/conversion/mapper~Mapper#bindElementToMarker}.
  11025. //
  11026. // @returns {Function} Add marker converter.
  11027. function insertMarkerData( viewCreator ) {
  11028. return ( evt, data, conversionApi ) => {
  11029. const viewMarkerData = viewCreator( data.markerName, conversionApi );
  11030. if ( !viewMarkerData ) {
  11031. return;
  11032. }
  11033. const markerRange = data.markerRange;
  11034. if ( !conversionApi.consumable.consume( markerRange, evt.name ) ) {
  11035. return;
  11036. }
  11037. // Adding closing data first to keep the proper order in the view.
  11038. handleMarkerBoundary( markerRange, false, conversionApi, data, viewMarkerData );
  11039. handleMarkerBoundary( markerRange, true, conversionApi, data, viewMarkerData );
  11040. evt.stop();
  11041. };
  11042. }
  11043. // Helper function for `insertMarkerData()` that marks a marker boundary at the beginning or end of given `range`.
  11044. function handleMarkerBoundary( range, isStart, conversionApi, data, viewMarkerData ) {
  11045. const modelPosition = isStart ? range.start : range.end;
  11046. const canInsertElement = conversionApi.schema.checkChild( modelPosition, '$text' );
  11047. if ( canInsertElement ) {
  11048. const viewPosition = conversionApi.mapper.toViewPosition( modelPosition );
  11049. insertMarkerAsElement( viewPosition, isStart, conversionApi, data, viewMarkerData );
  11050. } else {
  11051. let modelElement;
  11052. let isBefore;
  11053. // If possible, we want to add `data-group-start-before` and `data-group-end-after` attributes.
  11054. // Below `if` is constructed in a way that will favor adding these attributes.
  11055. //
  11056. // Also, I assume that there will be always an element either after or before the position.
  11057. // If not, then it is a case when we are not in a position where text is allowed and also there are no elements around...
  11058. if ( isStart && modelPosition.nodeAfter || !isStart && !modelPosition.nodeBefore ) {
  11059. modelElement = modelPosition.nodeAfter;
  11060. isBefore = true;
  11061. } else {
  11062. modelElement = modelPosition.nodeBefore;
  11063. isBefore = false;
  11064. }
  11065. const viewElement = conversionApi.mapper.toViewElement( modelElement );
  11066. insertMarkerAsAttribute( viewElement, isStart, isBefore, conversionApi, data, viewMarkerData );
  11067. }
  11068. }
  11069. // Helper function for `insertMarkerData()` that marks a marker boundary in the view as an attribute on a view element.
  11070. function insertMarkerAsAttribute( viewElement, isStart, isBefore, conversionApi, data, viewMarkerData ) {
  11071. const attributeName = `data-${ viewMarkerData.group }-${ isStart ? 'start' : 'end' }-${ isBefore ? 'before' : 'after' }`;
  11072. const markerNames = viewElement.hasAttribute( attributeName ) ? viewElement.getAttribute( attributeName ).split( ',' ) : [];
  11073. // Adding marker name at the beginning to have the same order in the attribute as there is with marker elements.
  11074. markerNames.unshift( viewMarkerData.name );
  11075. conversionApi.writer.setAttribute( attributeName, markerNames.join( ',' ), viewElement );
  11076. conversionApi.mapper.bindElementToMarker( viewElement, data.markerName );
  11077. }
  11078. // Helper function for `insertMarkerData()` that marks a marker boundary in the view as a separate view ui element.
  11079. function insertMarkerAsElement( position, isStart, conversionApi, data, viewMarkerData ) {
  11080. const viewElementName = `${ viewMarkerData.group }-${ isStart ? 'start' : 'end' }`;
  11081. const attrs = viewMarkerData.name ? { 'name': viewMarkerData.name } : null;
  11082. const viewElement = conversionApi.writer.createUIElement( viewElementName, attrs );
  11083. conversionApi.writer.insert( position, viewElement );
  11084. conversionApi.mapper.bindElementToMarker( viewElement, data.markerName );
  11085. }
  11086. // Function factory that creates a converter for removing a model marker data added by the {@link #insertMarkerData} converter.
  11087. //
  11088. // @returns {Function} Remove marker converter.
  11089. function removeMarkerData( viewCreator ) {
  11090. return ( evt, data, conversionApi ) => {
  11091. const viewData = viewCreator( data.markerName, conversionApi );
  11092. if ( !viewData ) {
  11093. return;
  11094. }
  11095. const elements = conversionApi.mapper.markerNameToElements( data.markerName );
  11096. if ( !elements ) {
  11097. return;
  11098. }
  11099. for ( const element of elements ) {
  11100. conversionApi.mapper.unbindElementFromMarkerName( element, data.markerName );
  11101. if ( element.is( 'containerElement' ) ) {
  11102. removeMarkerFromAttribute( `data-${ viewData.group }-start-before`, element );
  11103. removeMarkerFromAttribute( `data-${ viewData.group }-start-after`, element );
  11104. removeMarkerFromAttribute( `data-${ viewData.group }-end-before`, element );
  11105. removeMarkerFromAttribute( `data-${ viewData.group }-end-after`, element );
  11106. } else {
  11107. conversionApi.writer.clear( conversionApi.writer.createRangeOn( element ), element );
  11108. }
  11109. }
  11110. conversionApi.writer.clearClonedElementsGroup( data.markerName );
  11111. evt.stop();
  11112. function removeMarkerFromAttribute( attributeName, element ) {
  11113. if ( element.hasAttribute( attributeName ) ) {
  11114. const markerNames = new Set( element.getAttribute( attributeName ).split( ',' ) );
  11115. markerNames.delete( viewData.name );
  11116. if ( markerNames.size == 0 ) {
  11117. conversionApi.writer.removeAttribute( attributeName, element );
  11118. } else {
  11119. conversionApi.writer.setAttribute( attributeName, Array.from( markerNames ).join( ',' ), element );
  11120. }
  11121. }
  11122. }
  11123. };
  11124. }
  11125. // Function factory that creates a converter which converts set/change/remove attribute changes from the model to the view.
  11126. //
  11127. // Attributes from the model are converted to the view element attributes in the view. You may provide a custom function to generate
  11128. // a key-value attribute pair to add/change/remove. If not provided, model attributes will be converted to view element
  11129. // attributes on a one-to-one basis.
  11130. //
  11131. // *Note:** The provided attribute creator should always return the same `key` for a given attribute from the model.
  11132. //
  11133. // The converter automatically consumes the corresponding value from the consumables list and stops the event (see
  11134. // {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}).
  11135. //
  11136. // modelDispatcher.on( 'attribute:customAttr:myElem', changeAttribute( ( value, data ) => {
  11137. // // Change attribute key from `customAttr` to `class` in the view.
  11138. // const key = 'class';
  11139. // let value = data.attributeNewValue;
  11140. //
  11141. // // Force attribute value to 'empty' if the model element is empty.
  11142. // if ( data.item.childCount === 0 ) {
  11143. // value = 'empty';
  11144. // }
  11145. //
  11146. // // Return the key-value pair.
  11147. // return { key, value };
  11148. // } ) );
  11149. //
  11150. // @param {Function} [attributeCreator] Function returning an object with two properties: `key` and `value`, which
  11151. // represent the attribute key and attribute value to be set on a {@link module:engine/view/element~Element view element}.
  11152. // The function is passed the model attribute value as the first parameter and additional data about the change as the second parameter.
  11153. // @returns {Function} Set/change attribute converter.
  11154. function changeAttribute( attributeCreator ) {
  11155. return ( evt, data, conversionApi ) => {
  11156. const oldAttribute = attributeCreator( data.attributeOldValue, conversionApi );
  11157. const newAttribute = attributeCreator( data.attributeNewValue, conversionApi );
  11158. if ( !oldAttribute && !newAttribute ) {
  11159. return;
  11160. }
  11161. if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
  11162. return;
  11163. }
  11164. const viewElement = conversionApi.mapper.toViewElement( data.item );
  11165. const viewWriter = conversionApi.writer;
  11166. // If model item cannot be mapped to a view element, it means item is not an `Element` instance but a `TextProxy` node.
  11167. // Only elements can have attributes in a view so do not proceed for anything else (#1587).
  11168. if ( !viewElement ) {
  11169. /**
  11170. * This error occurs when a {@link module:engine/model/textproxy~TextProxy text node's} attribute is to be downcasted
  11171. * by {@link module:engine/conversion/conversion~Conversion#attributeToAttribute `Attribute to Attribute converter`}.
  11172. * In most cases it is caused by converters misconfiguration when only "generic" converter is defined:
  11173. *
  11174. * editor.conversion.for( 'downcast' ).attributeToAttribute( {
  11175. * model: 'attribute-name',
  11176. * view: 'attribute-name'
  11177. * } ) );
  11178. *
  11179. * and given attribute is used on text node, for example:
  11180. *
  11181. * model.change( writer => {
  11182. * writer.insertText( 'Foo', { 'attribute-name': 'bar' }, parent, 0 );
  11183. * } );
  11184. *
  11185. * In such cases, to convert the same attribute for both {@link module:engine/model/element~Element}
  11186. * and {@link module:engine/model/textproxy~TextProxy `Text`} nodes, text specific
  11187. * {@link module:engine/conversion/conversion~Conversion#attributeToElement `Attribute to Element converter`}
  11188. * with higher {@link module:utils/priorities~PriorityString priority} must also be defined:
  11189. *
  11190. * editor.conversion.for( 'downcast' ).attributeToElement( {
  11191. * model: {
  11192. * key: 'attribute-name',
  11193. * name: '$text'
  11194. * },
  11195. * view: ( value, { writer } ) => {
  11196. * return writer.createAttributeElement( 'span', { 'attribute-name': value } );
  11197. * },
  11198. * converterPriority: 'high'
  11199. * } ) );
  11200. *
  11201. * @error conversion-attribute-to-attribute-on-text
  11202. */
  11203. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_7__["default"](
  11204. 'conversion-attribute-to-attribute-on-text',
  11205. [ data, conversionApi ]
  11206. );
  11207. }
  11208. // First remove the old attribute if there was one.
  11209. if ( data.attributeOldValue !== null && oldAttribute ) {
  11210. if ( oldAttribute.key == 'class' ) {
  11211. const classes = Array.isArray( oldAttribute.value ) ? oldAttribute.value : [ oldAttribute.value ];
  11212. for ( const className of classes ) {
  11213. viewWriter.removeClass( className, viewElement );
  11214. }
  11215. } else if ( oldAttribute.key == 'style' ) {
  11216. const keys = Object.keys( oldAttribute.value );
  11217. for ( const key of keys ) {
  11218. viewWriter.removeStyle( key, viewElement );
  11219. }
  11220. } else {
  11221. viewWriter.removeAttribute( oldAttribute.key, viewElement );
  11222. }
  11223. }
  11224. // Then set the new attribute.
  11225. if ( data.attributeNewValue !== null && newAttribute ) {
  11226. if ( newAttribute.key == 'class' ) {
  11227. const classes = Array.isArray( newAttribute.value ) ? newAttribute.value : [ newAttribute.value ];
  11228. for ( const className of classes ) {
  11229. viewWriter.addClass( className, viewElement );
  11230. }
  11231. } else if ( newAttribute.key == 'style' ) {
  11232. const keys = Object.keys( newAttribute.value );
  11233. for ( const key of keys ) {
  11234. viewWriter.setStyle( key, newAttribute.value[ key ], viewElement );
  11235. }
  11236. } else {
  11237. viewWriter.setAttribute( newAttribute.key, newAttribute.value, viewElement );
  11238. }
  11239. }
  11240. };
  11241. }
  11242. // Function factory that creates a converter which converts the text inside marker's range. The converter wraps the text with
  11243. // {@link module:engine/view/attributeelement~AttributeElement} created from the provided descriptor.
  11244. // See {link module:engine/conversion/downcasthelpers~createViewElementFromHighlightDescriptor}.
  11245. //
  11246. // It can also be used to convert the selection that is inside a marker. In that case, an empty attribute element will be
  11247. // created and the selection will be put inside it.
  11248. //
  11249. // If the highlight descriptor does not provide the `priority` property, `10` will be used.
  11250. //
  11251. // If the highlight descriptor does not provide the `id` property, the name of the marker will be used.
  11252. //
  11253. // This converter binds the created {@link module:engine/view/attributeelement~AttributeElement attribute elemens} with the marker name
  11254. // using the {@link module:engine/conversion/mapper~Mapper#bindElementToMarker} method.
  11255. //
  11256. // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor|Function} highlightDescriptor
  11257. // @returns {Function}
  11258. function highlightText( highlightDescriptor ) {
  11259. return ( evt, data, conversionApi ) => {
  11260. if ( !data.item ) {
  11261. return;
  11262. }
  11263. if ( !( data.item instanceof _model_selection__WEBPACK_IMPORTED_MODULE_1__["default"] || data.item instanceof _model_documentselection__WEBPACK_IMPORTED_MODULE_4__["default"] ) && !data.item.is( '$textProxy' ) ) {
  11264. return;
  11265. }
  11266. const descriptor = prepareDescriptor( highlightDescriptor, data, conversionApi );
  11267. if ( !descriptor ) {
  11268. return;
  11269. }
  11270. if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
  11271. return;
  11272. }
  11273. const viewWriter = conversionApi.writer;
  11274. const viewElement = createViewElementFromHighlightDescriptor( viewWriter, descriptor );
  11275. const viewSelection = viewWriter.document.selection;
  11276. if ( data.item instanceof _model_selection__WEBPACK_IMPORTED_MODULE_1__["default"] || data.item instanceof _model_documentselection__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
  11277. viewWriter.wrap( viewSelection.getFirstRange(), viewElement, viewSelection );
  11278. } else {
  11279. const viewRange = conversionApi.mapper.toViewRange( data.range );
  11280. const rangeAfterWrap = viewWriter.wrap( viewRange, viewElement );
  11281. for ( const element of rangeAfterWrap.getItems() ) {
  11282. if ( element.is( 'attributeElement' ) && element.isSimilar( viewElement ) ) {
  11283. conversionApi.mapper.bindElementToMarker( element, data.markerName );
  11284. // One attribute element is enough, because all of them are bound together by the view writer.
  11285. // Mapper uses this binding to get all the elements no matter how many of them are registered in the mapper.
  11286. break;
  11287. }
  11288. }
  11289. }
  11290. };
  11291. }
  11292. // Converter function factory. It creates a function which applies the marker's highlight to an element inside the marker's range.
  11293. //
  11294. // The converter checks if an element has the `addHighlight` function stored as a
  11295. // {@link module:engine/view/element~Element#_setCustomProperty custom property} and, if so, uses it to apply the highlight.
  11296. // In such case the converter will consume all element's children, assuming that they were handled by the element itself.
  11297. //
  11298. // When the `addHighlight` custom property is not present, the element is not converted in any special way.
  11299. // This means that converters will proceed to convert the element's child nodes.
  11300. //
  11301. // If the highlight descriptor does not provide the `priority` property, `10` will be used.
  11302. //
  11303. // If the highlight descriptor does not provide the `id` property, the name of the marker will be used.
  11304. //
  11305. // This converter binds altered {@link module:engine/view/containerelement~ContainerElement container elements} with the marker name using
  11306. // the {@link module:engine/conversion/mapper~Mapper#bindElementToMarker} method.
  11307. //
  11308. // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor|Function} highlightDescriptor
  11309. // @returns {Function}
  11310. function highlightElement( highlightDescriptor ) {
  11311. return ( evt, data, conversionApi ) => {
  11312. if ( !data.item ) {
  11313. return;
  11314. }
  11315. if ( !( data.item instanceof _model_element__WEBPACK_IMPORTED_MODULE_2__["default"] ) ) {
  11316. return;
  11317. }
  11318. const descriptor = prepareDescriptor( highlightDescriptor, data, conversionApi );
  11319. if ( !descriptor ) {
  11320. return;
  11321. }
  11322. if ( !conversionApi.consumable.test( data.item, evt.name ) ) {
  11323. return;
  11324. }
  11325. const viewElement = conversionApi.mapper.toViewElement( data.item );
  11326. if ( viewElement && viewElement.getCustomProperty( 'addHighlight' ) ) {
  11327. // Consume element itself.
  11328. conversionApi.consumable.consume( data.item, evt.name );
  11329. // Consume all children nodes.
  11330. for ( const value of _model_range__WEBPACK_IMPORTED_MODULE_0__["default"]._createIn( data.item ) ) {
  11331. conversionApi.consumable.consume( value.item, evt.name );
  11332. }
  11333. viewElement.getCustomProperty( 'addHighlight' )( viewElement, descriptor, conversionApi.writer );
  11334. conversionApi.mapper.bindElementToMarker( viewElement, data.markerName );
  11335. }
  11336. };
  11337. }
  11338. // Function factory that creates a converter which converts the removing model marker to the view.
  11339. //
  11340. // Both text nodes and elements are handled by this converter but they are handled a bit differently.
  11341. //
  11342. // Text nodes are unwrapped using the {@link module:engine/view/attributeelement~AttributeElement attribute element} created from the
  11343. // provided highlight descriptor. See {link module:engine/conversion/downcasthelpers~HighlightDescriptor}.
  11344. //
  11345. // For elements, the converter checks if an element has the `removeHighlight` function stored as a
  11346. // {@link module:engine/view/element~Element#_setCustomProperty custom property}. If so, it uses it to remove the highlight.
  11347. // In such case, the children of that element will not be converted.
  11348. //
  11349. // When `removeHighlight` is not present, the element is not converted in any special way.
  11350. // The converter will proceed to convert the element's child nodes instead.
  11351. //
  11352. // If the highlight descriptor does not provide the `priority` property, `10` will be used.
  11353. //
  11354. // If the highlight descriptor does not provide the `id` property, the name of the marker will be used.
  11355. //
  11356. // This converter unbinds elements from the marker name.
  11357. //
  11358. // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor|Function} highlightDescriptor
  11359. // @returns {Function}
  11360. function removeHighlight( highlightDescriptor ) {
  11361. return ( evt, data, conversionApi ) => {
  11362. // This conversion makes sense only for non-collapsed range.
  11363. if ( data.markerRange.isCollapsed ) {
  11364. return;
  11365. }
  11366. const descriptor = prepareDescriptor( highlightDescriptor, data, conversionApi );
  11367. if ( !descriptor ) {
  11368. return;
  11369. }
  11370. // View element that will be used to unwrap `AttributeElement`s.
  11371. const viewHighlightElement = createViewElementFromHighlightDescriptor( conversionApi.writer, descriptor );
  11372. // Get all elements bound with given marker name.
  11373. const elements = conversionApi.mapper.markerNameToElements( data.markerName );
  11374. if ( !elements ) {
  11375. return;
  11376. }
  11377. for ( const element of elements ) {
  11378. conversionApi.mapper.unbindElementFromMarkerName( element, data.markerName );
  11379. if ( element.is( 'attributeElement' ) ) {
  11380. conversionApi.writer.unwrap( conversionApi.writer.createRangeOn( element ), viewHighlightElement );
  11381. } else {
  11382. // if element.is( 'containerElement' ).
  11383. element.getCustomProperty( 'removeHighlight' )( element, descriptor.id, conversionApi.writer );
  11384. }
  11385. }
  11386. conversionApi.writer.clearClonedElementsGroup( data.markerName );
  11387. evt.stop();
  11388. };
  11389. }
  11390. // Model element to view element conversion helper.
  11391. //
  11392. // See {@link ~DowncastHelpers#elementToElement `.elementToElement()` downcast helper} for examples and config params description.
  11393. //
  11394. // @param {Object} config Conversion configuration.
  11395. // @param {String} config.model
  11396. // @param {module:engine/view/elementdefinition~ElementDefinition|Function} config.view
  11397. // @param {Object} [config.triggerBy]
  11398. // @param {Array.<String>} [config.triggerBy.attributes]
  11399. // @param {Array.<String>} [config.triggerBy.children]
  11400. // @returns {Function} Conversion helper.
  11401. function downcastElementToElement( config ) {
  11402. config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_6__["cloneDeep"])( config );
  11403. config.view = normalizeToElementConfig( config.view, 'container' );
  11404. return dispatcher => {
  11405. dispatcher.on( 'insert:' + config.model, insertElement( config.view ), { priority: config.converterPriority || 'normal' } );
  11406. if ( config.triggerBy ) {
  11407. if ( config.triggerBy.attributes ) {
  11408. for ( const attributeKey of config.triggerBy.attributes ) {
  11409. dispatcher._mapReconversionTriggerEvent( config.model, `attribute:${ attributeKey }:${ config.model }` );
  11410. }
  11411. }
  11412. if ( config.triggerBy.children ) {
  11413. for ( const childName of config.triggerBy.children ) {
  11414. dispatcher._mapReconversionTriggerEvent( config.model, `insert:${ childName }` );
  11415. dispatcher._mapReconversionTriggerEvent( config.model, `remove:${ childName }` );
  11416. }
  11417. }
  11418. }
  11419. };
  11420. }
  11421. // Model attribute to view element conversion helper.
  11422. //
  11423. // See {@link ~DowncastHelpers#attributeToElement `.attributeToElement()` downcast helper} for examples.
  11424. //
  11425. // @param {Object} config Conversion configuration.
  11426. // @param {String|Object} config.model The key of the attribute to convert from or a `{ key, values }` object. `values` is an array
  11427. // of `String`s with possible values if the model attribute is an enumerable.
  11428. // @param {module:engine/view/elementdefinition~ElementDefinition|Function|Object} config.view A view element definition or a function
  11429. // that takes the model attribute value and {@link module:engine/view/downcastwriter~DowncastWriter view downcast writer}
  11430. // as parameters and returns a view attribute element. If `config.model.values` is
  11431. // given, `config.view` should be an object assigning values from `config.model.values` to view element definitions or functions.
  11432. // @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  11433. // @returns {Function} Conversion helper.
  11434. function downcastAttributeToElement( config ) {
  11435. config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_6__["cloneDeep"])( config );
  11436. const modelKey = config.model.key ? config.model.key : config.model;
  11437. let eventName = 'attribute:' + modelKey;
  11438. if ( config.model.name ) {
  11439. eventName += ':' + config.model.name;
  11440. }
  11441. if ( config.model.values ) {
  11442. for ( const modelValue of config.model.values ) {
  11443. config.view[ modelValue ] = normalizeToElementConfig( config.view[ modelValue ], 'attribute' );
  11444. }
  11445. } else {
  11446. config.view = normalizeToElementConfig( config.view, 'attribute' );
  11447. }
  11448. const elementCreator = getFromAttributeCreator( config );
  11449. return dispatcher => {
  11450. dispatcher.on( eventName, wrap( elementCreator ), { priority: config.converterPriority || 'normal' } );
  11451. };
  11452. }
  11453. // Model attribute to view attribute conversion helper.
  11454. //
  11455. // See {@link ~DowncastHelpers#attributeToAttribute `.attributeToAttribute()` downcast helper} for examples.
  11456. //
  11457. // @param {Object} config Conversion configuration.
  11458. // @param {String|Object} config.model The key of the attribute to convert from or a `{ key, values, [ name ] }` object describing
  11459. // the attribute key, possible values and, optionally, an element name to convert from.
  11460. // @param {String|Object|Function} config.view A view attribute key, or a `{ key, value }` object or a function that takes
  11461. // the model attribute value and returns a `{ key, value }` object. If `key` is `'class'`, `value` can be a `String` or an
  11462. // array of `String`s. If `key` is `'style'`, `value` is an object with key-value pairs. In other cases, `value` is a `String`.
  11463. // If `config.model.values` is set, `config.view` should be an object assigning values from `config.model.values` to
  11464. // `{ key, value }` objects or a functions.
  11465. // @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  11466. // @returns {Function} Conversion helper.
  11467. function downcastAttributeToAttribute( config ) {
  11468. config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_6__["cloneDeep"])( config );
  11469. const modelKey = config.model.key ? config.model.key : config.model;
  11470. let eventName = 'attribute:' + modelKey;
  11471. if ( config.model.name ) {
  11472. eventName += ':' + config.model.name;
  11473. }
  11474. if ( config.model.values ) {
  11475. for ( const modelValue of config.model.values ) {
  11476. config.view[ modelValue ] = normalizeToAttributeConfig( config.view[ modelValue ] );
  11477. }
  11478. } else {
  11479. config.view = normalizeToAttributeConfig( config.view );
  11480. }
  11481. const elementCreator = getFromAttributeCreator( config );
  11482. return dispatcher => {
  11483. dispatcher.on( eventName, changeAttribute( elementCreator ), { priority: config.converterPriority || 'normal' } );
  11484. };
  11485. }
  11486. // Model marker to view element conversion helper.
  11487. //
  11488. // See {@link ~DowncastHelpers#markerToElement `.markerToElement()` downcast helper} for examples.
  11489. //
  11490. // @param {Object} config Conversion configuration.
  11491. // @param {String} config.model The name of the model marker (or model marker group) to convert.
  11492. // @param {module:engine/view/elementdefinition~ElementDefinition|Function} config.view A view element definition or a function
  11493. // that takes the model marker data as a parameter and returns a view UI element.
  11494. // @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  11495. // @returns {Function} Conversion helper.
  11496. function downcastMarkerToElement( config ) {
  11497. config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_6__["cloneDeep"])( config );
  11498. config.view = normalizeToElementConfig( config.view, 'ui' );
  11499. return dispatcher => {
  11500. dispatcher.on( 'addMarker:' + config.model, insertUIElement( config.view ), { priority: config.converterPriority || 'normal' } );
  11501. dispatcher.on( 'removeMarker:' + config.model, removeUIElement( config.view ), { priority: config.converterPriority || 'normal' } );
  11502. };
  11503. }
  11504. // Model marker to view data conversion helper.
  11505. //
  11506. // See {@link ~DowncastHelpers#markerToData `markerToData()` downcast helper} to learn more.
  11507. //
  11508. // @param {Object} config
  11509. // @param {String} config.model
  11510. // @param {Function} [config.view]
  11511. // @param {module:utils/priorities~PriorityString} [config.converterPriority='normal']
  11512. // @returns {Function} Conversion helper.
  11513. function downcastMarkerToData( config ) {
  11514. config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_6__["cloneDeep"])( config );
  11515. const group = config.model;
  11516. // Default conversion.
  11517. if ( !config.view ) {
  11518. config.view = markerName => ( {
  11519. group,
  11520. name: markerName.substr( config.model.length + 1 )
  11521. } );
  11522. }
  11523. return dispatcher => {
  11524. dispatcher.on( 'addMarker:' + group, insertMarkerData( config.view ), { priority: config.converterPriority || 'normal' } );
  11525. dispatcher.on( 'removeMarker:' + group, removeMarkerData( config.view ), { priority: config.converterPriority || 'normal' } );
  11526. };
  11527. }
  11528. // Model marker to highlight conversion helper.
  11529. //
  11530. // See {@link ~DowncastHelpers#markerToElement `.markerToElement()` downcast helper} for examples.
  11531. //
  11532. // @param {Object} config Conversion configuration.
  11533. // @param {String} config.model The name of the model marker (or model marker group) to convert.
  11534. // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor|Function} config.view A highlight descriptor
  11535. // that will be used for highlighting or a function that takes the model marker data as a parameter and returns a highlight descriptor.
  11536. // @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  11537. // @returns {Function} Conversion helper.
  11538. function downcastMarkerToHighlight( config ) {
  11539. return dispatcher => {
  11540. dispatcher.on( 'addMarker:' + config.model, highlightText( config.view ), { priority: config.converterPriority || 'normal' } );
  11541. dispatcher.on( 'addMarker:' + config.model, highlightElement( config.view ), { priority: config.converterPriority || 'normal' } );
  11542. dispatcher.on( 'removeMarker:' + config.model, removeHighlight( config.view ), { priority: config.converterPriority || 'normal' } );
  11543. };
  11544. }
  11545. // Takes `config.view`, and if it is an {@link module:engine/view/elementdefinition~ElementDefinition}, converts it
  11546. // to a function (because lower level converters accept only element creator functions).
  11547. //
  11548. // @param {module:engine/view/elementdefinition~ElementDefinition|Function} view View configuration.
  11549. // @param {'container'|'attribute'|'ui'} viewElementType View element type to create.
  11550. // @returns {Function} Element creator function to use in lower level converters.
  11551. function normalizeToElementConfig( view, viewElementType ) {
  11552. if ( typeof view == 'function' ) {
  11553. // If `view` is already a function, don't do anything.
  11554. return view;
  11555. }
  11556. return ( modelData, conversionApi ) => createViewElementFromDefinition( view, conversionApi, viewElementType );
  11557. }
  11558. // Creates a view element instance from the provided {@link module:engine/view/elementdefinition~ElementDefinition} and class.
  11559. //
  11560. // @param {module:engine/view/elementdefinition~ElementDefinition} viewElementDefinition
  11561. // @param {module:engine/view/downcastwriter~DowncastWriter} viewWriter
  11562. // @param {'container'|'attribute'|'ui'} viewElementType
  11563. // @returns {module:engine/view/element~Element}
  11564. function createViewElementFromDefinition( viewElementDefinition, conversionApi, viewElementType ) {
  11565. if ( typeof viewElementDefinition == 'string' ) {
  11566. // If `viewElementDefinition` is given as a `String`, normalize it to an object with `name` property.
  11567. viewElementDefinition = { name: viewElementDefinition };
  11568. }
  11569. let element;
  11570. const viewWriter = conversionApi.writer;
  11571. const attributes = Object.assign( {}, viewElementDefinition.attributes );
  11572. if ( viewElementType == 'container' ) {
  11573. element = viewWriter.createContainerElement( viewElementDefinition.name, attributes );
  11574. } else if ( viewElementType == 'attribute' ) {
  11575. const options = {
  11576. priority: viewElementDefinition.priority || _view_attributeelement__WEBPACK_IMPORTED_MODULE_3__["default"].DEFAULT_PRIORITY
  11577. };
  11578. element = viewWriter.createAttributeElement( viewElementDefinition.name, attributes, options );
  11579. } else {
  11580. // 'ui'.
  11581. element = viewWriter.createUIElement( viewElementDefinition.name, attributes );
  11582. }
  11583. if ( viewElementDefinition.styles ) {
  11584. const keys = Object.keys( viewElementDefinition.styles );
  11585. for ( const key of keys ) {
  11586. viewWriter.setStyle( key, viewElementDefinition.styles[ key ], element );
  11587. }
  11588. }
  11589. if ( viewElementDefinition.classes ) {
  11590. const classes = viewElementDefinition.classes;
  11591. if ( typeof classes == 'string' ) {
  11592. viewWriter.addClass( classes, element );
  11593. } else {
  11594. for ( const className of classes ) {
  11595. viewWriter.addClass( className, element );
  11596. }
  11597. }
  11598. }
  11599. return element;
  11600. }
  11601. function getFromAttributeCreator( config ) {
  11602. if ( config.model.values ) {
  11603. return ( modelAttributeValue, conversionApi ) => {
  11604. const view = config.view[ modelAttributeValue ];
  11605. if ( view ) {
  11606. return view( modelAttributeValue, conversionApi );
  11607. }
  11608. return null;
  11609. };
  11610. } else {
  11611. return config.view;
  11612. }
  11613. }
  11614. // Takes the configuration, adds default parameters if they do not exist and normalizes other parameters to be used in downcast converters
  11615. // for generating a view attribute.
  11616. //
  11617. // @param {Object} view View configuration.
  11618. function normalizeToAttributeConfig( view ) {
  11619. if ( typeof view == 'string' ) {
  11620. return modelAttributeValue => ( { key: view, value: modelAttributeValue } );
  11621. } else if ( typeof view == 'object' ) {
  11622. // { key, value, ... }
  11623. if ( view.value ) {
  11624. return () => view;
  11625. }
  11626. // { key, ... }
  11627. else {
  11628. return modelAttributeValue => ( { key: view.key, value: modelAttributeValue } );
  11629. }
  11630. } else {
  11631. // function.
  11632. return view;
  11633. }
  11634. }
  11635. // Helper function for `highlight`. Prepares the actual descriptor object using value passed to the converter.
  11636. function prepareDescriptor( highlightDescriptor, data, conversionApi ) {
  11637. // If passed descriptor is a creator function, call it. If not, just use passed value.
  11638. const descriptor = typeof highlightDescriptor == 'function' ?
  11639. highlightDescriptor( data, conversionApi ) :
  11640. highlightDescriptor;
  11641. if ( !descriptor ) {
  11642. return null;
  11643. }
  11644. // Apply default descriptor priority.
  11645. if ( !descriptor.priority ) {
  11646. descriptor.priority = 10;
  11647. }
  11648. // Default descriptor id is marker name.
  11649. if ( !descriptor.id ) {
  11650. descriptor.id = data.markerName;
  11651. }
  11652. return descriptor;
  11653. }
  11654. /**
  11655. * An object describing how the marker highlight should be represented in the view.
  11656. *
  11657. * Each text node contained in a highlighted range will be wrapped in a `<span>`
  11658. * {@link module:engine/view/attributeelement~AttributeElement view attribute element} with CSS class(es), attributes and a priority
  11659. * described by this object.
  11660. *
  11661. * Additionally, each {@link module:engine/view/containerelement~ContainerElement container element} can handle displaying the highlight
  11662. * separately by providing the `addHighlight` and `removeHighlight` custom properties. In this case:
  11663. *
  11664. * * The `HighlightDescriptor` object is passed to the `addHighlight` function upon conversion and should be used to apply the highlight to
  11665. * the element.
  11666. * * The descriptor `id` is passed to the `removeHighlight` function upon conversion and should be used to remove the highlight with the
  11667. * given ID from the element.
  11668. *
  11669. * @typedef {Object} module:engine/conversion/downcasthelpers~HighlightDescriptor
  11670. *
  11671. * @property {String|Array.<String>} classes A CSS class or an array of classes to set. If the descriptor is used to
  11672. * create an {@link module:engine/view/attributeelement~AttributeElement attribute element} over text nodes, these classes will be set
  11673. * on that attribute element. If the descriptor is applied to an element, usually these classes will be set on that element, however,
  11674. * this depends on how the element converts the descriptor.
  11675. *
  11676. * @property {String} [id] Descriptor identifier. If not provided, it defaults to the converted marker's name.
  11677. *
  11678. * @property {Number} [priority] Descriptor priority. If not provided, it defaults to `10`. If the descriptor is used to create
  11679. * an {@link module:engine/view/attributeelement~AttributeElement attribute element}, it will be that element's
  11680. * {@link module:engine/view/attributeelement~AttributeElement#priority priority}. If the descriptor is applied to an element,
  11681. * the priority will be used to determine which descriptor is more important.
  11682. *
  11683. * @property {Object} [attributes] Attributes to set. If the descriptor is used to create
  11684. * an {@link module:engine/view/attributeelement~AttributeElement attribute element} over text nodes, these attributes will be set on that
  11685. * attribute element. If the descriptor is applied to an element, usually these attributes will be set on that element, however,
  11686. * this depends on how the element converts the descriptor.
  11687. */
  11688. /***/ }),
  11689. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/mapper.js":
  11690. /*!**************************************************************************!*\
  11691. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/mapper.js ***!
  11692. \**************************************************************************/
  11693. /*! exports provided: default */
  11694. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11695. "use strict";
  11696. __webpack_require__.r(__webpack_exports__);
  11697. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Mapper; });
  11698. /* harmony import */ var _model_position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../model/position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  11699. /* harmony import */ var _model_range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../model/range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  11700. /* harmony import */ var _view_position__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../view/position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
  11701. /* harmony import */ var _view_range__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../view/range */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/range.js");
  11702. /* harmony import */ var _view_text__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../view/text */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js");
  11703. /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  11704. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  11705. /**
  11706. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  11707. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  11708. */
  11709. /**
  11710. * @module engine/conversion/mapper
  11711. */
  11712. /**
  11713. * Maps elements, positions and markers between {@link module:engine/view/document~Document the view} and
  11714. * {@link module:engine/model/model the model}.
  11715. *
  11716. * The instance of the Mapper used for the editing pipeline is available in
  11717. * {@link module:engine/controller/editingcontroller~EditingController#mapper `editor.editing.mapper`}.
  11718. *
  11719. * Mapper uses bound elements to find corresponding elements and positions, so, to get proper results,
  11720. * all model elements should be {@link module:engine/conversion/mapper~Mapper#bindElements bound}.
  11721. *
  11722. * To map complex model to/from view relations, you may provide custom callbacks for
  11723. * {@link module:engine/conversion/mapper~Mapper#event:modelToViewPosition modelToViewPosition event} and
  11724. * {@link module:engine/conversion/mapper~Mapper#event:viewToModelPosition viewToModelPosition event} that are fired whenever
  11725. * a position mapping request occurs.
  11726. * Those events are fired by {@link module:engine/conversion/mapper~Mapper#toViewPosition toViewPosition}
  11727. * and {@link module:engine/conversion/mapper~Mapper#toModelPosition toModelPosition} methods. `Mapper` adds it's own default callbacks
  11728. * with `'lowest'` priority. To override default `Mapper` mapping, add custom callback with higher priority and
  11729. * stop the event.
  11730. */
  11731. class Mapper {
  11732. /**
  11733. * Creates an instance of the mapper.
  11734. */
  11735. constructor() {
  11736. /**
  11737. * Model element to view element mapping.
  11738. *
  11739. * @private
  11740. * @member {WeakMap}
  11741. */
  11742. this._modelToViewMapping = new WeakMap();
  11743. /**
  11744. * View element to model element mapping.
  11745. *
  11746. * @private
  11747. * @member {WeakMap}
  11748. */
  11749. this._viewToModelMapping = new WeakMap();
  11750. /**
  11751. * A map containing callbacks between view element names and functions evaluating length of view elements
  11752. * in model.
  11753. *
  11754. * @private
  11755. * @member {Map}
  11756. */
  11757. this._viewToModelLengthCallbacks = new Map();
  11758. /**
  11759. * Model marker name to view elements mapping.
  11760. *
  11761. * Keys are `String`s while values are `Set`s with {@link module:engine/view/element~Element view elements}.
  11762. * One marker (name) can be mapped to multiple elements.
  11763. *
  11764. * @private
  11765. * @member {Map}
  11766. */
  11767. this._markerNameToElements = new Map();
  11768. /**
  11769. * View element to model marker names mapping.
  11770. *
  11771. * This is reverse to {@link ~Mapper#_markerNameToElements} map.
  11772. *
  11773. * @private
  11774. * @member {Map}
  11775. */
  11776. this._elementToMarkerNames = new Map();
  11777. /**
  11778. * Stores marker names of markers which has changed due to unbinding a view element (so it is assumed that the view element
  11779. * has been removed, moved or renamed).
  11780. *
  11781. * @private
  11782. * @member {Set.<module:engine/model/markercollection~Marker>}
  11783. */
  11784. this._unboundMarkerNames = new Set();
  11785. // Default mapper algorithm for mapping model position to view position.
  11786. this.on( 'modelToViewPosition', ( evt, data ) => {
  11787. if ( data.viewPosition ) {
  11788. return;
  11789. }
  11790. const viewContainer = this._modelToViewMapping.get( data.modelPosition.parent );
  11791. data.viewPosition = this.findPositionIn( viewContainer, data.modelPosition.offset );
  11792. }, { priority: 'low' } );
  11793. // Default mapper algorithm for mapping view position to model position.
  11794. this.on( 'viewToModelPosition', ( evt, data ) => {
  11795. if ( data.modelPosition ) {
  11796. return;
  11797. }
  11798. const viewBlock = this.findMappedViewAncestor( data.viewPosition );
  11799. const modelParent = this._viewToModelMapping.get( viewBlock );
  11800. const modelOffset = this._toModelOffset( data.viewPosition.parent, data.viewPosition.offset, viewBlock );
  11801. data.modelPosition = _model_position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( modelParent, modelOffset );
  11802. }, { priority: 'low' } );
  11803. }
  11804. /**
  11805. * Marks model and view elements as corresponding. Corresponding elements can be retrieved by using
  11806. * the {@link module:engine/conversion/mapper~Mapper#toModelElement toModelElement} and
  11807. * {@link module:engine/conversion/mapper~Mapper#toViewElement toViewElement} methods.
  11808. * The information that elements are bound is also used to translate positions.
  11809. *
  11810. * @param {module:engine/model/element~Element} modelElement Model element.
  11811. * @param {module:engine/view/element~Element} viewElement View element.
  11812. */
  11813. bindElements( modelElement, viewElement ) {
  11814. this._modelToViewMapping.set( modelElement, viewElement );
  11815. this._viewToModelMapping.set( viewElement, modelElement );
  11816. }
  11817. /**
  11818. * Unbinds given {@link module:engine/view/element~Element view element} from the map.
  11819. *
  11820. * **Note:** view-to-model binding will be removed, if it existed. However, corresponding model-to-view binding
  11821. * will be removed only if model element is still bound to passed `viewElement`.
  11822. *
  11823. * This behavior lets for re-binding model element to another view element without fear of losing the new binding
  11824. * when the previously bound view element is unbound.
  11825. *
  11826. * @param {module:engine/view/element~Element} viewElement View element to unbind.
  11827. */
  11828. unbindViewElement( viewElement ) {
  11829. const modelElement = this.toModelElement( viewElement );
  11830. this._viewToModelMapping.delete( viewElement );
  11831. if ( this._elementToMarkerNames.has( viewElement ) ) {
  11832. for ( const markerName of this._elementToMarkerNames.get( viewElement ) ) {
  11833. this._unboundMarkerNames.add( markerName );
  11834. }
  11835. }
  11836. if ( this._modelToViewMapping.get( modelElement ) == viewElement ) {
  11837. this._modelToViewMapping.delete( modelElement );
  11838. }
  11839. }
  11840. /**
  11841. * Unbinds given {@link module:engine/model/element~Element model element} from the map.
  11842. *
  11843. * **Note:** model-to-view binding will be removed, if it existed. However, corresponding view-to-model binding
  11844. * will be removed only if view element is still bound to passed `modelElement`.
  11845. *
  11846. * This behavior lets for re-binding view element to another model element without fear of losing the new binding
  11847. * when the previously bound model element is unbound.
  11848. *
  11849. * @param {module:engine/model/element~Element} modelElement Model element to unbind.
  11850. */
  11851. unbindModelElement( modelElement ) {
  11852. const viewElement = this.toViewElement( modelElement );
  11853. this._modelToViewMapping.delete( modelElement );
  11854. if ( this._viewToModelMapping.get( viewElement ) == modelElement ) {
  11855. this._viewToModelMapping.delete( viewElement );
  11856. }
  11857. }
  11858. /**
  11859. * Binds given marker name with given {@link module:engine/view/element~Element view element}. The element
  11860. * will be added to the current set of elements bound with given marker name.
  11861. *
  11862. * @param {module:engine/view/element~Element} element Element to bind.
  11863. * @param {String} name Marker name.
  11864. */
  11865. bindElementToMarker( element, name ) {
  11866. const elements = this._markerNameToElements.get( name ) || new Set();
  11867. elements.add( element );
  11868. const names = this._elementToMarkerNames.get( element ) || new Set();
  11869. names.add( name );
  11870. this._markerNameToElements.set( name, elements );
  11871. this._elementToMarkerNames.set( element, names );
  11872. }
  11873. /**
  11874. * Unbinds an element from given marker name.
  11875. *
  11876. * @param {module:engine/view/element~Element} element Element to unbind.
  11877. * @param {String} name Marker name.
  11878. */
  11879. unbindElementFromMarkerName( element, name ) {
  11880. const nameToElements = this._markerNameToElements.get( name );
  11881. if ( nameToElements ) {
  11882. nameToElements.delete( element );
  11883. if ( nameToElements.size == 0 ) {
  11884. this._markerNameToElements.delete( name );
  11885. }
  11886. }
  11887. const elementToNames = this._elementToMarkerNames.get( element );
  11888. if ( elementToNames ) {
  11889. elementToNames.delete( name );
  11890. if ( elementToNames.size == 0 ) {
  11891. this._elementToMarkerNames.delete( element );
  11892. }
  11893. }
  11894. }
  11895. /**
  11896. * Returns all marker names of markers which has changed due to unbinding a view element (so it is assumed that the view element
  11897. * has been removed, moved or renamed) since the last flush. After returning, the marker names list is cleared.
  11898. *
  11899. * @returns {Array.<String>}
  11900. */
  11901. flushUnboundMarkerNames() {
  11902. const markerNames = Array.from( this._unboundMarkerNames );
  11903. this._unboundMarkerNames.clear();
  11904. return markerNames;
  11905. }
  11906. /**
  11907. * Removes all model to view and view to model bindings.
  11908. */
  11909. clearBindings() {
  11910. this._modelToViewMapping = new WeakMap();
  11911. this._viewToModelMapping = new WeakMap();
  11912. this._markerNameToElements = new Map();
  11913. this._elementToMarkerNames = new Map();
  11914. this._unboundMarkerNames = new Set();
  11915. }
  11916. /**
  11917. * Gets the corresponding model element.
  11918. *
  11919. * **Note:** {@link module:engine/view/uielement~UIElement} does not have corresponding element in model.
  11920. *
  11921. * @param {module:engine/view/element~Element} viewElement View element.
  11922. * @returns {module:engine/model/element~Element|undefined} Corresponding model element or `undefined` if not found.
  11923. */
  11924. toModelElement( viewElement ) {
  11925. return this._viewToModelMapping.get( viewElement );
  11926. }
  11927. /**
  11928. * Gets the corresponding view element.
  11929. *
  11930. * @param {module:engine/model/element~Element} modelElement Model element.
  11931. * @returns {module:engine/view/element~Element|undefined} Corresponding view element or `undefined` if not found.
  11932. */
  11933. toViewElement( modelElement ) {
  11934. return this._modelToViewMapping.get( modelElement );
  11935. }
  11936. /**
  11937. * Gets the corresponding model range.
  11938. *
  11939. * @param {module:engine/view/range~Range} viewRange View range.
  11940. * @returns {module:engine/model/range~Range} Corresponding model range.
  11941. */
  11942. toModelRange( viewRange ) {
  11943. return new _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]( this.toModelPosition( viewRange.start ), this.toModelPosition( viewRange.end ) );
  11944. }
  11945. /**
  11946. * Gets the corresponding view range.
  11947. *
  11948. * @param {module:engine/model/range~Range} modelRange Model range.
  11949. * @returns {module:engine/view/range~Range} Corresponding view range.
  11950. */
  11951. toViewRange( modelRange ) {
  11952. return new _view_range__WEBPACK_IMPORTED_MODULE_3__["default"]( this.toViewPosition( modelRange.start ), this.toViewPosition( modelRange.end ) );
  11953. }
  11954. /**
  11955. * Gets the corresponding model position.
  11956. *
  11957. * @fires viewToModelPosition
  11958. * @param {module:engine/view/position~Position} viewPosition View position.
  11959. * @returns {module:engine/model/position~Position} Corresponding model position.
  11960. */
  11961. toModelPosition( viewPosition ) {
  11962. const data = {
  11963. viewPosition,
  11964. mapper: this
  11965. };
  11966. this.fire( 'viewToModelPosition', data );
  11967. return data.modelPosition;
  11968. }
  11969. /**
  11970. * Gets the corresponding view position.
  11971. *
  11972. * @fires modelToViewPosition
  11973. * @param {module:engine/model/position~Position} modelPosition Model position.
  11974. * @param {Object} [options] Additional options for position mapping process.
  11975. * @param {Boolean} [options.isPhantom=false] Should be set to `true` if the model position to map is pointing to a place
  11976. * in model tree which no longer exists. For example, it could be an end of a removed model range.
  11977. * @returns {module:engine/view/position~Position} Corresponding view position.
  11978. */
  11979. toViewPosition( modelPosition, options = { isPhantom: false } ) {
  11980. const data = {
  11981. modelPosition,
  11982. mapper: this,
  11983. isPhantom: options.isPhantom
  11984. };
  11985. this.fire( 'modelToViewPosition', data );
  11986. return data.viewPosition;
  11987. }
  11988. /**
  11989. * Gets all view elements bound to the given marker name.
  11990. *
  11991. * @param {String} name Marker name.
  11992. * @returns {Set.<module:engine/view/element~Element>|null} View elements bound with given marker name or `null`
  11993. * if no elements are bound to given marker name.
  11994. */
  11995. markerNameToElements( name ) {
  11996. const boundElements = this._markerNameToElements.get( name );
  11997. if ( !boundElements ) {
  11998. return null;
  11999. }
  12000. const elements = new Set();
  12001. for ( const element of boundElements ) {
  12002. if ( element.is( 'attributeElement' ) ) {
  12003. for ( const clone of element.getElementsWithSameId() ) {
  12004. elements.add( clone );
  12005. }
  12006. } else {
  12007. elements.add( element );
  12008. }
  12009. }
  12010. return elements;
  12011. }
  12012. /**
  12013. * Registers a callback that evaluates the length in the model of a view element with given name.
  12014. *
  12015. * The callback is fired with one argument, which is a view element instance. The callback is expected to return
  12016. * a number representing the length of view element in model.
  12017. *
  12018. * // List item in view may contain nested list, which have other list items. In model though,
  12019. * // the lists are represented by flat structure. Because of those differences, length of list view element
  12020. * // may be greater than one. In the callback it's checked how many nested list items are in evaluated list item.
  12021. *
  12022. * function getViewListItemLength( element ) {
  12023. * let length = 1;
  12024. *
  12025. * for ( let child of element.getChildren() ) {
  12026. * if ( child.name == 'ul' || child.name == 'ol' ) {
  12027. * for ( let item of child.getChildren() ) {
  12028. * length += getViewListItemLength( item );
  12029. * }
  12030. * }
  12031. * }
  12032. *
  12033. * return length;
  12034. * }
  12035. *
  12036. * mapper.registerViewToModelLength( 'li', getViewListItemLength );
  12037. *
  12038. * @param {String} viewElementName Name of view element for which callback is registered.
  12039. * @param {Function} lengthCallback Function return a length of view element instance in model.
  12040. */
  12041. registerViewToModelLength( viewElementName, lengthCallback ) {
  12042. this._viewToModelLengthCallbacks.set( viewElementName, lengthCallback );
  12043. }
  12044. /**
  12045. * For given `viewPosition`, finds and returns the closest ancestor of this position that has a mapping to
  12046. * the model.
  12047. *
  12048. * @param {module:engine/view/position~Position} viewPosition Position for which mapped ancestor should be found.
  12049. * @returns {module:engine/view/element~Element}
  12050. */
  12051. findMappedViewAncestor( viewPosition ) {
  12052. let parent = viewPosition.parent;
  12053. while ( !this._viewToModelMapping.has( parent ) ) {
  12054. parent = parent.parent;
  12055. }
  12056. return parent;
  12057. }
  12058. /**
  12059. * Calculates model offset based on the view position and the block element.
  12060. *
  12061. * Example:
  12062. *
  12063. * <p>foo<b>ba|r</b></p> // _toModelOffset( b, 2, p ) -> 5
  12064. *
  12065. * Is a sum of:
  12066. *
  12067. * <p>foo|<b>bar</b></p> // _toModelOffset( p, 3, p ) -> 3
  12068. * <p>foo<b>ba|r</b></p> // _toModelOffset( b, 2, b ) -> 2
  12069. *
  12070. * @private
  12071. * @param {module:engine/view/element~Element} viewParent Position parent.
  12072. * @param {Number} viewOffset Position offset.
  12073. * @param {module:engine/view/element~Element} viewBlock Block used as a base to calculate offset.
  12074. * @returns {Number} Offset in the model.
  12075. */
  12076. _toModelOffset( viewParent, viewOffset, viewBlock ) {
  12077. if ( viewBlock != viewParent ) {
  12078. // See example.
  12079. const offsetToParentStart = this._toModelOffset( viewParent.parent, viewParent.index, viewBlock );
  12080. const offsetInParent = this._toModelOffset( viewParent, viewOffset, viewParent );
  12081. return offsetToParentStart + offsetInParent;
  12082. }
  12083. // viewBlock == viewParent, so we need to calculate the offset in the parent element.
  12084. // If the position is a text it is simple ("ba|r" -> 2).
  12085. if ( viewParent.is( '$text' ) ) {
  12086. return viewOffset;
  12087. }
  12088. // If the position is in an element we need to sum lengths of siblings ( <b> bar </b> foo | -> 3 + 3 = 6 ).
  12089. let modelOffset = 0;
  12090. for ( let i = 0; i < viewOffset; i++ ) {
  12091. modelOffset += this.getModelLength( viewParent.getChild( i ) );
  12092. }
  12093. return modelOffset;
  12094. }
  12095. /**
  12096. * Gets the length of the view element in the model.
  12097. *
  12098. * The length is calculated as follows:
  12099. * * if {@link #registerViewToModelLength length mapping callback} is provided for given `viewNode` it is used to
  12100. * evaluate model length (`viewNode` is used as first and only parameter passed to the callback),
  12101. * * length of a {@link module:engine/view/text~Text text node} is equal to the length of it's
  12102. * {@link module:engine/view/text~Text#data data},
  12103. * * length of a {@link module:engine/view/uielement~UIElement ui element} is equal to 0,
  12104. * * length of a mapped {@link module:engine/view/element~Element element} is equal to 1,
  12105. * * length of a not-mapped {@link module:engine/view/element~Element element} is equal to the length of it's children.
  12106. *
  12107. * Examples:
  12108. *
  12109. * foo -> 3 // Text length is equal to it's data length.
  12110. * <p>foo</p> -> 1 // Length of an element which is mapped is by default equal to 1.
  12111. * <b>foo</b> -> 3 // Length of an element which is not mapped is a length of its children.
  12112. * <div><p>x</p><p>y</p></div> -> 2 // Assuming that <div> is not mapped and <p> are mapped.
  12113. *
  12114. * @param {module:engine/view/element~Element} viewNode View node.
  12115. * @returns {Number} Length of the node in the tree model.
  12116. */
  12117. getModelLength( viewNode ) {
  12118. if ( this._viewToModelLengthCallbacks.get( viewNode.name ) ) {
  12119. const callback = this._viewToModelLengthCallbacks.get( viewNode.name );
  12120. return callback( viewNode );
  12121. } else if ( this._viewToModelMapping.has( viewNode ) ) {
  12122. return 1;
  12123. } else if ( viewNode.is( '$text' ) ) {
  12124. return viewNode.data.length;
  12125. } else if ( viewNode.is( 'uiElement' ) ) {
  12126. return 0;
  12127. } else {
  12128. let len = 0;
  12129. for ( const child of viewNode.getChildren() ) {
  12130. len += this.getModelLength( child );
  12131. }
  12132. return len;
  12133. }
  12134. }
  12135. /**
  12136. * Finds the position in the view node (or its children) with the expected model offset.
  12137. *
  12138. * Example:
  12139. *
  12140. * <p>fo<b>bar</b>bom</p> -> expected offset: 4
  12141. *
  12142. * findPositionIn( p, 4 ):
  12143. * <p>|fo<b>bar</b>bom</p> -> expected offset: 4, actual offset: 0
  12144. * <p>fo|<b>bar</b>bom</p> -> expected offset: 4, actual offset: 2
  12145. * <p>fo<b>bar</b>|bom</p> -> expected offset: 4, actual offset: 5 -> we are too far
  12146. *
  12147. * findPositionIn( b, 4 - ( 5 - 3 ) ):
  12148. * <p>fo<b>|bar</b>bom</p> -> expected offset: 2, actual offset: 0
  12149. * <p>fo<b>bar|</b>bom</p> -> expected offset: 2, actual offset: 3 -> we are too far
  12150. *
  12151. * findPositionIn( bar, 2 - ( 3 - 3 ) ):
  12152. * We are in the text node so we can simple find the offset.
  12153. * <p>fo<b>ba|r</b>bom</p> -> expected offset: 2, actual offset: 2 -> position found
  12154. *
  12155. * @param {module:engine/view/element~Element} viewParent Tree view element in which we are looking for the position.
  12156. * @param {Number} expectedOffset Expected offset.
  12157. * @returns {module:engine/view/position~Position} Found position.
  12158. */
  12159. findPositionIn( viewParent, expectedOffset ) {
  12160. // Last scanned view node.
  12161. let viewNode;
  12162. // Length of the last scanned view node.
  12163. let lastLength = 0;
  12164. let modelOffset = 0;
  12165. let viewOffset = 0;
  12166. // In the text node it is simple: offset in the model equals offset in the text.
  12167. if ( viewParent.is( '$text' ) ) {
  12168. return new _view_position__WEBPACK_IMPORTED_MODULE_2__["default"]( viewParent, expectedOffset );
  12169. }
  12170. // In other cases we add lengths of child nodes to find the proper offset.
  12171. // If it is smaller we add the length.
  12172. while ( modelOffset < expectedOffset ) {
  12173. viewNode = viewParent.getChild( viewOffset );
  12174. lastLength = this.getModelLength( viewNode );
  12175. modelOffset += lastLength;
  12176. viewOffset++;
  12177. }
  12178. // If it equals we found the position.
  12179. if ( modelOffset == expectedOffset ) {
  12180. return this._moveViewPositionToTextNode( new _view_position__WEBPACK_IMPORTED_MODULE_2__["default"]( viewParent, viewOffset ) );
  12181. }
  12182. // If it is higher we need to enter last child.
  12183. else {
  12184. // ( modelOffset - lastLength ) is the offset to the child we enter,
  12185. // so we subtract it from the expected offset to fine the offset in the child.
  12186. return this.findPositionIn( viewNode, expectedOffset - ( modelOffset - lastLength ) );
  12187. }
  12188. }
  12189. /**
  12190. * Because we prefer positions in text nodes over positions next to text node moves view position to the text node
  12191. * if it was next to it.
  12192. *
  12193. * <p>[]<b>foo</b></p> -> <p>[]<b>foo</b></p> // do not touch if position is not directly next to text
  12194. * <p>foo[]<b>foo</b></p> -> <p>foo{}<b>foo</b></p> // move to text node
  12195. * <p><b>[]foo</b></p> -> <p><b>{}foo</b></p> // move to text node
  12196. *
  12197. * @private
  12198. * @param {module:engine/view/position~Position} viewPosition Position potentially next to text node.
  12199. * @returns {module:engine/view/position~Position} Position in text node if possible.
  12200. */
  12201. _moveViewPositionToTextNode( viewPosition ) {
  12202. // If the position is just after text node, put it at the end of that text node.
  12203. // If the position is just before text node, put it at the beginning of that text node.
  12204. const nodeBefore = viewPosition.nodeBefore;
  12205. const nodeAfter = viewPosition.nodeAfter;
  12206. if ( nodeBefore instanceof _view_text__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
  12207. return new _view_position__WEBPACK_IMPORTED_MODULE_2__["default"]( nodeBefore, nodeBefore.data.length );
  12208. } else if ( nodeAfter instanceof _view_text__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
  12209. return new _view_position__WEBPACK_IMPORTED_MODULE_2__["default"]( nodeAfter, 0 );
  12210. }
  12211. // Otherwise, just return the given position.
  12212. return viewPosition;
  12213. }
  12214. /**
  12215. * Fired for each model-to-view position mapping request. The purpose of this event is to enable custom model-to-view position
  12216. * mapping. Callbacks added to this event take {@link module:engine/model/position~Position model position} and are expected to
  12217. * calculate {@link module:engine/view/position~Position view position}. Calculated view position should be added as `viewPosition`
  12218. * value in `data` object that is passed as one of parameters to the event callback.
  12219. *
  12220. * // Assume that "captionedImage" model element is converted to <img> and following <span> elements in view,
  12221. * // and the model element is bound to <img> element. Force mapping model positions inside "captionedImage" to that
  12222. * // <span> element.
  12223. * mapper.on( 'modelToViewPosition', ( evt, data ) => {
  12224. * const positionParent = modelPosition.parent;
  12225. *
  12226. * if ( positionParent.name == 'captionedImage' ) {
  12227. * const viewImg = data.mapper.toViewElement( positionParent );
  12228. * const viewCaption = viewImg.nextSibling; // The <span> element.
  12229. *
  12230. * data.viewPosition = new ViewPosition( viewCaption, modelPosition.offset );
  12231. *
  12232. * // Stop the event if other callbacks should not modify calculated value.
  12233. * evt.stop();
  12234. * }
  12235. * } );
  12236. *
  12237. * **Note:** keep in mind that sometimes a "phantom" model position is being converted. "Phantom" model position is
  12238. * a position that points to a non-existing place in model. Such position might still be valid for conversion, though
  12239. * (it would point to a correct place in view when converted). One example of such situation is when a range is
  12240. * removed from model, there may be a need to map the range's end (which is no longer valid model position). To
  12241. * handle such situation, check `data.isPhantom` flag:
  12242. *
  12243. * // Assume that there is "customElement" model element and whenever position is before it, we want to move it
  12244. * // to the inside of the view element bound to "customElement".
  12245. * mapper.on( 'modelToViewPosition', ( evt, data ) => {
  12246. * if ( data.isPhantom ) {
  12247. * return;
  12248. * }
  12249. *
  12250. * // Below line might crash for phantom position that does not exist in model.
  12251. * const sibling = data.modelPosition.nodeBefore;
  12252. *
  12253. * // Check if this is the element we are interested in.
  12254. * if ( !sibling.is( 'element', 'customElement' ) ) {
  12255. * return;
  12256. * }
  12257. *
  12258. * const viewElement = data.mapper.toViewElement( sibling );
  12259. *
  12260. * data.viewPosition = new ViewPosition( sibling, 0 );
  12261. *
  12262. * evt.stop();
  12263. * } );
  12264. *
  12265. * **Note:** default mapping callback is provided with `low` priority setting and does not cancel the event, so it is possible to
  12266. * attach a custom callback after default callback and also use `data.viewPosition` calculated by default callback
  12267. * (for example to fix it).
  12268. *
  12269. * **Note:** default mapping callback will not fire if `data.viewPosition` is already set.
  12270. *
  12271. * **Note:** these callbacks are called **very often**. For efficiency reasons, it is advised to use them only when position
  12272. * mapping between given model and view elements is unsolvable using just elements mapping and default algorithm. Also,
  12273. * the condition that checks if special case scenario happened should be as simple as possible.
  12274. *
  12275. * @event modelToViewPosition
  12276. * @param {Object} data Data pipeline object that can store and pass data between callbacks. The callback should add
  12277. * `viewPosition` value to that object with calculated {@link module:engine/view/position~Position view position}.
  12278. * @param {module:engine/conversion/mapper~Mapper} data.mapper Mapper instance that fired the event.
  12279. */
  12280. /**
  12281. * Fired for each view-to-model position mapping request. See {@link module:engine/conversion/mapper~Mapper#event:modelToViewPosition}.
  12282. *
  12283. * // See example in `modelToViewPosition` event description.
  12284. * // This custom mapping will map positions from <span> element next to <img> to the "captionedImage" element.
  12285. * mapper.on( 'viewToModelPosition', ( evt, data ) => {
  12286. * const positionParent = viewPosition.parent;
  12287. *
  12288. * if ( positionParent.hasClass( 'image-caption' ) ) {
  12289. * const viewImg = positionParent.previousSibling;
  12290. * const modelImg = data.mapper.toModelElement( viewImg );
  12291. *
  12292. * data.modelPosition = new ModelPosition( modelImg, viewPosition.offset );
  12293. * evt.stop();
  12294. * }
  12295. * } );
  12296. *
  12297. * **Note:** default mapping callback is provided with `low` priority setting and does not cancel the event, so it is possible to
  12298. * attach a custom callback after default callback and also use `data.modelPosition` calculated by default callback
  12299. * (for example to fix it).
  12300. *
  12301. * **Note:** default mapping callback will not fire if `data.modelPosition` is already set.
  12302. *
  12303. * **Note:** these callbacks are called **very often**. For efficiency reasons, it is advised to use them only when position
  12304. * mapping between given model and view elements is unsolvable using just elements mapping and default algorithm. Also,
  12305. * the condition that checks if special case scenario happened should be as simple as possible.
  12306. *
  12307. * @event viewToModelPosition
  12308. * @param {Object} data Data pipeline object that can store and pass data between callbacks. The callback should add
  12309. * `modelPosition` value to that object with calculated {@link module:engine/model/position~Position model position}.
  12310. * @param {module:engine/conversion/mapper~Mapper} data.mapper Mapper instance that fired the event.
  12311. */
  12312. }
  12313. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__["default"])( Mapper, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_5__["default"] );
  12314. /***/ }),
  12315. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/modelconsumable.js":
  12316. /*!***********************************************************************************!*\
  12317. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/modelconsumable.js ***!
  12318. \***********************************************************************************/
  12319. /*! exports provided: default */
  12320. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12321. "use strict";
  12322. __webpack_require__.r(__webpack_exports__);
  12323. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ModelConsumable; });
  12324. /* harmony import */ var _model_textproxy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../model/textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.js");
  12325. /**
  12326. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  12327. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  12328. */
  12329. /**
  12330. * @module engine/conversion/modelconsumable
  12331. */
  12332. /**
  12333. * Manages a list of consumable values for {@link module:engine/model/item~Item model items}.
  12334. *
  12335. * Consumables are various aspects of the model. A model item can be broken down into singular properties that might be
  12336. * taken into consideration when converting that item.
  12337. *
  12338. * `ModelConsumable` is used by {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher} while analyzing changed
  12339. * parts of {@link module:engine/model/document~Document the document}. The added / changed / removed model items are broken down
  12340. * into singular properties (the item itself and it's attributes). All those parts are saved in `ModelConsumable`. Then,
  12341. * during conversion, when given part of model item is converted (i.e. the view element has been inserted into the view,
  12342. * but without attributes), consumable value is removed from `ModelConsumable`.
  12343. *
  12344. * For model items, `ModelConsumable` stores consumable values of one of following types: `insert`, `addattribute:<attributeKey>`,
  12345. * `changeattributes:<attributeKey>`, `removeattributes:<attributeKey>`.
  12346. *
  12347. * In most cases, it is enough to let {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}
  12348. * gather consumable values, so there is no need to use
  12349. * {@link module:engine/conversion/modelconsumable~ModelConsumable#add add method} directly.
  12350. * However, it is important to understand how consumable values can be
  12351. * {@link module:engine/conversion/modelconsumable~ModelConsumable#consume consumed}.
  12352. * See {@link module:engine/conversion/downcasthelpers default downcast converters} for more information.
  12353. *
  12354. * Keep in mind, that one conversion event may have multiple callbacks (converters) attached to it. Each of those is
  12355. * able to convert one or more parts of the model. However, when one of those callbacks actually converts
  12356. * something, other should not, because they would duplicate the results. Using `ModelConsumable` helps avoiding
  12357. * this situation, because callbacks should only convert those values, which were not yet consumed from `ModelConsumable`.
  12358. *
  12359. * Consuming multiple values in a single callback:
  12360. *
  12361. * // Converter for custom `image` element that might have a `caption` element inside which changes
  12362. * // how the image is displayed in the view:
  12363. * //
  12364. * // Model:
  12365. * //
  12366. * // [image]
  12367. * // └─ [caption]
  12368. * // └─ foo
  12369. * //
  12370. * // View:
  12371. * //
  12372. * // <figure>
  12373. * // ├─ <img />
  12374. * // └─ <caption>
  12375. * // └─ foo
  12376. * modelConversionDispatcher.on( 'insert:image', ( evt, data, conversionApi ) => {
  12377. * // First, consume the `image` element.
  12378. * conversionApi.consumable.consume( data.item, 'insert' );
  12379. *
  12380. * // Just create normal image element for the view.
  12381. * // Maybe it will be "decorated" later.
  12382. * const viewImage = new ViewElement( 'img' );
  12383. * const insertPosition = conversionApi.mapper.toViewPosition( data.range.start );
  12384. * const viewWriter = conversionApi.writer;
  12385. *
  12386. * // Check if the `image` element has children.
  12387. * if ( data.item.childCount > 0 ) {
  12388. * const modelCaption = data.item.getChild( 0 );
  12389. *
  12390. * // `modelCaption` insertion change is consumed from consumable values.
  12391. * // It will not be converted by other converters, but it's children (probably some text) will be.
  12392. * // Through mapping, converters for text will know where to insert contents of `modelCaption`.
  12393. * if ( conversionApi.consumable.consume( modelCaption, 'insert' ) ) {
  12394. * const viewCaption = new ViewElement( 'figcaption' );
  12395. *
  12396. * const viewImageHolder = new ViewElement( 'figure', null, [ viewImage, viewCaption ] );
  12397. *
  12398. * conversionApi.mapper.bindElements( modelCaption, viewCaption );
  12399. * conversionApi.mapper.bindElements( data.item, viewImageHolder );
  12400. * viewWriter.insert( insertPosition, viewImageHolder );
  12401. * }
  12402. * } else {
  12403. * conversionApi.mapper.bindElements( data.item, viewImage );
  12404. * viewWriter.insert( insertPosition, viewImage );
  12405. * }
  12406. *
  12407. * evt.stop();
  12408. * } );
  12409. */
  12410. class ModelConsumable {
  12411. /**
  12412. * Creates an empty consumables list.
  12413. */
  12414. constructor() {
  12415. /**
  12416. * Contains list of consumable values.
  12417. *
  12418. * @private
  12419. * @member {Map} module:engine/conversion/modelconsumable~ModelConsumable#_consumable
  12420. */
  12421. this._consumable = new Map();
  12422. /**
  12423. * For each {@link module:engine/model/textproxy~TextProxy} added to `ModelConsumable`, this registry holds parent
  12424. * of that `TextProxy` and start and end indices of that `TextProxy`. This allows identification of `TextProxy`
  12425. * instances that points to the same part of the model but are different instances. Each distinct `TextProxy`
  12426. * is given unique `Symbol` which is then registered as consumable. This process is transparent for `ModelConsumable`
  12427. * API user because whenever `TextProxy` is added, tested, consumed or reverted, internal mechanisms of
  12428. * `ModelConsumable` translates `TextProxy` to that unique `Symbol`.
  12429. *
  12430. * @private
  12431. * @member {Map} module:engine/conversion/modelconsumable~ModelConsumable#_textProxyRegistry
  12432. */
  12433. this._textProxyRegistry = new Map();
  12434. }
  12435. /**
  12436. * Adds a consumable value to the consumables list and links it with given model item.
  12437. *
  12438. * modelConsumable.add( modelElement, 'insert' ); // Add `modelElement` insertion change to consumable values.
  12439. * modelConsumable.add( modelElement, 'addAttribute:bold' ); // Add `bold` attribute insertion on `modelElement` change.
  12440. * modelConsumable.add( modelElement, 'removeAttribute:bold' ); // Add `bold` attribute removal on `modelElement` change.
  12441. * modelConsumable.add( modelSelection, 'selection' ); // Add `modelSelection` to consumable values.
  12442. * modelConsumable.add( modelRange, 'range' ); // Add `modelRange` to consumable values.
  12443. *
  12444. * @param {module:engine/model/item~Item|module:engine/model/selection~Selection|module:engine/model/range~Range} item
  12445. * Model item, range or selection that has the consumable.
  12446. * @param {String} type Consumable type. Will be normalized to a proper form, that is either `<word>` or `<part>:<part>`.
  12447. * Second colon and everything after will be cut. Passing event name is a safe and good practice.
  12448. */
  12449. add( item, type ) {
  12450. type = _normalizeConsumableType( type );
  12451. if ( item instanceof _model_textproxy__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  12452. item = this._getSymbolForTextProxy( item );
  12453. }
  12454. if ( !this._consumable.has( item ) ) {
  12455. this._consumable.set( item, new Map() );
  12456. }
  12457. this._consumable.get( item ).set( type, true );
  12458. }
  12459. /**
  12460. * Removes given consumable value from given model item.
  12461. *
  12462. * modelConsumable.consume( modelElement, 'insert' ); // Remove `modelElement` insertion change from consumable values.
  12463. * modelConsumable.consume( modelElement, 'addAttribute:bold' ); // Remove `bold` attribute insertion on `modelElement` change.
  12464. * modelConsumable.consume( modelElement, 'removeAttribute:bold' ); // Remove `bold` attribute removal on `modelElement` change.
  12465. * modelConsumable.consume( modelSelection, 'selection' ); // Remove `modelSelection` from consumable values.
  12466. * modelConsumable.consume( modelRange, 'range' ); // Remove 'modelRange' from consumable values.
  12467. *
  12468. * @param {module:engine/model/item~Item|module:engine/model/selection~Selection|module:engine/model/range~Range} item
  12469. * Model item, range or selection from which consumable will be consumed.
  12470. * @param {String} type Consumable type. Will be normalized to a proper form, that is either `<word>` or `<part>:<part>`.
  12471. * Second colon and everything after will be cut. Passing event name is a safe and good practice.
  12472. * @returns {Boolean} `true` if consumable value was available and was consumed, `false` otherwise.
  12473. */
  12474. consume( item, type ) {
  12475. type = _normalizeConsumableType( type );
  12476. if ( item instanceof _model_textproxy__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  12477. item = this._getSymbolForTextProxy( item );
  12478. }
  12479. if ( this.test( item, type ) ) {
  12480. this._consumable.get( item ).set( type, false );
  12481. return true;
  12482. } else {
  12483. return false;
  12484. }
  12485. }
  12486. /**
  12487. * Tests whether there is a consumable value of given type connected with given model item.
  12488. *
  12489. * modelConsumable.test( modelElement, 'insert' ); // Check for `modelElement` insertion change.
  12490. * modelConsumable.test( modelElement, 'addAttribute:bold' ); // Check for `bold` attribute insertion on `modelElement` change.
  12491. * modelConsumable.test( modelElement, 'removeAttribute:bold' ); // Check for `bold` attribute removal on `modelElement` change.
  12492. * modelConsumable.test( modelSelection, 'selection' ); // Check if `modelSelection` is consumable.
  12493. * modelConsumable.test( modelRange, 'range' ); // Check if `modelRange` is consumable.
  12494. *
  12495. * @param {module:engine/model/item~Item|module:engine/model/selection~Selection|module:engine/model/range~Range} item
  12496. * Model item, range or selection to be tested.
  12497. * @param {String} type Consumable type. Will be normalized to a proper form, that is either `<word>` or `<part>:<part>`.
  12498. * Second colon and everything after will be cut. Passing event name is a safe and good practice.
  12499. * @returns {null|Boolean} `null` if such consumable was never added, `false` if the consumable values was
  12500. * already consumed or `true` if it was added and not consumed yet.
  12501. */
  12502. test( item, type ) {
  12503. type = _normalizeConsumableType( type );
  12504. if ( item instanceof _model_textproxy__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  12505. item = this._getSymbolForTextProxy( item );
  12506. }
  12507. const itemConsumables = this._consumable.get( item );
  12508. if ( itemConsumables === undefined ) {
  12509. return null;
  12510. }
  12511. const value = itemConsumables.get( type );
  12512. if ( value === undefined ) {
  12513. return null;
  12514. }
  12515. return value;
  12516. }
  12517. /**
  12518. * Reverts consuming of consumable value.
  12519. *
  12520. * modelConsumable.revert( modelElement, 'insert' ); // Revert consuming `modelElement` insertion change.
  12521. * modelConsumable.revert( modelElement, 'addAttribute:bold' ); // Revert consuming `bold` attribute insert from `modelElement`.
  12522. * modelConsumable.revert( modelElement, 'removeAttribute:bold' ); // Revert consuming `bold` attribute remove from `modelElement`.
  12523. * modelConsumable.revert( modelSelection, 'selection' ); // Revert consuming `modelSelection`.
  12524. * modelConsumable.revert( modelRange, 'range' ); // Revert consuming `modelRange`.
  12525. *
  12526. * @param {module:engine/model/item~Item|module:engine/model/selection~Selection|module:engine/model/range~Range} item
  12527. * Model item, range or selection to be reverted.
  12528. * @param {String} type Consumable type.
  12529. * @returns {null|Boolean} `true` if consumable has been reversed, `false` otherwise. `null` if the consumable has
  12530. * never been added.
  12531. */
  12532. revert( item, type ) {
  12533. type = _normalizeConsumableType( type );
  12534. if ( item instanceof _model_textproxy__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  12535. item = this._getSymbolForTextProxy( item );
  12536. }
  12537. const test = this.test( item, type );
  12538. if ( test === false ) {
  12539. this._consumable.get( item ).set( type, true );
  12540. return true;
  12541. } else if ( test === true ) {
  12542. return false;
  12543. }
  12544. return null;
  12545. }
  12546. /**
  12547. * Gets a unique symbol for passed {@link module:engine/model/textproxy~TextProxy} instance. All `TextProxy` instances that
  12548. * have same parent, same start index and same end index will get the same symbol.
  12549. *
  12550. * Used internally to correctly consume `TextProxy` instances.
  12551. *
  12552. * @private
  12553. * @param {module:engine/model/textproxy~TextProxy} textProxy `TextProxy` instance to get a symbol for.
  12554. * @returns {Symbol} Symbol representing all equal instances of `TextProxy`.
  12555. */
  12556. _getSymbolForTextProxy( textProxy ) {
  12557. let symbol = null;
  12558. const startMap = this._textProxyRegistry.get( textProxy.startOffset );
  12559. if ( startMap ) {
  12560. const endMap = startMap.get( textProxy.endOffset );
  12561. if ( endMap ) {
  12562. symbol = endMap.get( textProxy.parent );
  12563. }
  12564. }
  12565. if ( !symbol ) {
  12566. symbol = this._addSymbolForTextProxy( textProxy.startOffset, textProxy.endOffset, textProxy.parent );
  12567. }
  12568. return symbol;
  12569. }
  12570. /**
  12571. * Adds a symbol for given properties that characterizes a {@link module:engine/model/textproxy~TextProxy} instance.
  12572. *
  12573. * Used internally to correctly consume `TextProxy` instances.
  12574. *
  12575. * @private
  12576. * @param {Number} startIndex Text proxy start index in it's parent.
  12577. * @param {Number} endIndex Text proxy end index in it's parent.
  12578. * @param {module:engine/model/element~Element} parent Text proxy parent.
  12579. * @returns {Symbol} Symbol generated for given properties.
  12580. */
  12581. _addSymbolForTextProxy( start, end, parent ) {
  12582. const symbol = Symbol( 'textProxySymbol' );
  12583. let startMap, endMap;
  12584. startMap = this._textProxyRegistry.get( start );
  12585. if ( !startMap ) {
  12586. startMap = new Map();
  12587. this._textProxyRegistry.set( start, startMap );
  12588. }
  12589. endMap = startMap.get( end );
  12590. if ( !endMap ) {
  12591. endMap = new Map();
  12592. startMap.set( end, endMap );
  12593. }
  12594. endMap.set( parent, symbol );
  12595. return symbol;
  12596. }
  12597. }
  12598. // Returns a normalized consumable type name from given string. A normalized consumable type name is a string that has
  12599. // at most one colon, for example: `insert` or `addMarker:highlight`. If string to normalize has more "parts" (more colons),
  12600. // the other parts are dropped, for example: `addattribute:bold:$text` -> `addattributes:bold`.
  12601. //
  12602. // @param {String} type Consumable type.
  12603. // @returns {String} Normalized consumable type.
  12604. function _normalizeConsumableType( type ) {
  12605. const parts = type.split( ':' );
  12606. return parts.length > 1 ? parts[ 0 ] + ':' + parts[ 1 ] : parts[ 0 ];
  12607. }
  12608. /***/ }),
  12609. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcastdispatcher.js":
  12610. /*!************************************************************************************!*\
  12611. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcastdispatcher.js ***!
  12612. \************************************************************************************/
  12613. /*! exports provided: default */
  12614. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12615. "use strict";
  12616. __webpack_require__.r(__webpack_exports__);
  12617. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UpcastDispatcher; });
  12618. /* harmony import */ var _viewconsumable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./viewconsumable */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/viewconsumable.js");
  12619. /* harmony import */ var _model_range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../model/range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  12620. /* harmony import */ var _model_position__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../model/position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  12621. /* harmony import */ var _model_schema__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../model/schema */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/schema.js");
  12622. /* harmony import */ var _model_utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../model/utils/autoparagraphing */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/autoparagraphing.js");
  12623. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  12624. /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  12625. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  12626. /**
  12627. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  12628. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  12629. */
  12630. /**
  12631. * @module engine/conversion/upcastdispatcher
  12632. */
  12633. /**
  12634. * Upcast dispatcher is a central point of the view-to-model conversion, which is a process of
  12635. * converting a given {@link module:engine/view/documentfragment~DocumentFragment view document fragment} or
  12636. * {@link module:engine/view/element~Element view element} into a correct model structure.
  12637. *
  12638. * During the conversion process, the dispatcher fires events for all {@link module:engine/view/node~Node view nodes}
  12639. * from the converted view document fragment.
  12640. * Special callbacks called "converters" should listen to these events in order to convert the view nodes.
  12641. *
  12642. * The second parameter of the callback is the `data` object with the following properties:
  12643. *
  12644. * * `data.viewItem` contains a {@link module:engine/view/node~Node view node} or a
  12645. * {@link module:engine/view/documentfragment~DocumentFragment view document fragment}
  12646. * that is converted at the moment and might be handled by the callback.
  12647. * * `data.modelRange` is used to point to the result
  12648. * of the current conversion (e.g. the element that is being inserted)
  12649. * and is always a {@link module:engine/model/range~Range} when the conversion succeeds.
  12650. * * `data.modelCursor` is a {@link module:engine/model/position~Position position} on which the converter should insert
  12651. * the newly created items.
  12652. *
  12653. * The third parameter of the callback is an instance of {@link module:engine/conversion/upcastdispatcher~UpcastConversionApi}
  12654. * which provides additional tools for converters.
  12655. *
  12656. * You can read more about conversion in the following guides:
  12657. *
  12658. * * {@glink framework/guides/deep-dive/conversion/conversion-introduction Advanced conversion concepts &mdash; attributes}
  12659. * * {@glink framework/guides/deep-dive/conversion/custom-element-conversion Custom element conversion}
  12660. *
  12661. * Examples of event-based converters:
  12662. *
  12663. * // A converter for links (<a>).
  12664. * editor.data.upcastDispatcher.on( 'element:a', ( evt, data, conversionApi ) => {
  12665. * if ( conversionApi.consumable.consume( data.viewItem, { name: true, attributes: [ 'href' ] } ) ) {
  12666. * // The <a> element is inline and is represented by an attribute in the model.
  12667. * // This is why you need to convert only children.
  12668. * const { modelRange } = conversionApi.convertChildren( data.viewItem, data.modelCursor );
  12669. *
  12670. * for ( let item of modelRange.getItems() ) {
  12671. * if ( conversionApi.schema.checkAttribute( item, 'linkHref' ) ) {
  12672. * conversionApi.writer.setAttribute( 'linkHref', data.viewItem.getAttribute( 'href' ), item );
  12673. * }
  12674. * }
  12675. * }
  12676. * } );
  12677. *
  12678. * // Convert <p> element's font-size style.
  12679. * // Note: You should use a low-priority observer in order to ensure that
  12680. * // it is executed after the element-to-element converter.
  12681. * editor.data.upcastDispatcher.on( 'element:p', ( evt, data, conversionApi ) => {
  12682. * const { consumable, schema, writer } = conversionApi;
  12683. *
  12684. * if ( !consumable.consume( data.viewItem, { style: 'font-size' } ) ) {
  12685. * return;
  12686. * }
  12687. *
  12688. * const fontSize = data.viewItem.getStyle( 'font-size' );
  12689. *
  12690. * // Do not go for the model element after data.modelCursor because it might happen
  12691. * // that a single view element was converted to multiple model elements. Get all of them.
  12692. * for ( const item of data.modelRange.getItems( { shallow: true } ) ) {
  12693. * if ( schema.checkAttribute( item, 'fontSize' ) ) {
  12694. * writer.setAttribute( 'fontSize', fontSize, item );
  12695. * }
  12696. * }
  12697. * }, { priority: 'low' } );
  12698. *
  12699. * // Convert all elements which have no custom converter into a paragraph (autoparagraphing).
  12700. * editor.data.upcastDispatcher.on( 'element', ( evt, data, conversionApi ) => {
  12701. * // Check if an element can be converted.
  12702. * if ( !conversionApi.consumable.test( data.viewItem, { name: data.viewItem.name } ) ) {
  12703. * // When an element is already consumed by higher priority converters, do nothing.
  12704. * return;
  12705. * }
  12706. *
  12707. * const paragraph = conversionApi.writer.createElement( 'paragraph' );
  12708. *
  12709. * // Try to safely insert a paragraph at the model cursor - it will find an allowed parent for the current element.
  12710. * if ( !conversionApi.safeInsert( paragraph, data.modelCursor ) ) {
  12711. * // When an element was not inserted, it means that you cannot insert a paragraph at this position.
  12712. * return;
  12713. * }
  12714. *
  12715. * // Consume the inserted element.
  12716. * conversionApi.consumable.consume( data.viewItem, { name: data.viewItem.name } ) );
  12717. *
  12718. * // Convert the children to a paragraph.
  12719. * const { modelRange } = conversionApi.convertChildren( data.viewItem, paragraph ) );
  12720. *
  12721. * // Update `modelRange` and `modelCursor` in the `data` as a conversion result.
  12722. * conversionApi.updateConversionResult( paragraph, data );
  12723. * }, { priority: 'low' } );
  12724. *
  12725. * @mixes module:utils/emittermixin~EmitterMixin
  12726. * @fires viewCleanup
  12727. * @fires element
  12728. * @fires text
  12729. * @fires documentFragment
  12730. */
  12731. class UpcastDispatcher {
  12732. /**
  12733. * Creates an upcast dispatcher that operates using the passed API.
  12734. *
  12735. * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi
  12736. * @param {Object} [conversionApi] Additional properties for an interface that will be passed to events fired
  12737. * by the upcast dispatcher.
  12738. */
  12739. constructor( conversionApi = {} ) {
  12740. /**
  12741. * The list of elements that were created during splitting.
  12742. *
  12743. * After the conversion process the list is cleared.
  12744. *
  12745. * @private
  12746. * @type {Map.<module:engine/model/element~Element,Array.<module:engine/model/element~Element>>}
  12747. */
  12748. this._splitParts = new Map();
  12749. /**
  12750. * The list of cursor parent elements that were created during splitting.
  12751. *
  12752. * After the conversion process the list is cleared.
  12753. *
  12754. * @private
  12755. * @type {Map.<module:engine/model/element~Element,Array.<module:engine/model/element~Element>>}
  12756. */
  12757. this._cursorParents = new Map();
  12758. /**
  12759. * The position in the temporary structure where the converted content is inserted. The structure reflects the context of
  12760. * the target position where the content will be inserted. This property is built based on the context parameter of the
  12761. * convert method.
  12762. *
  12763. * @private
  12764. * @type {module:engine/model/position~Position|null}
  12765. */
  12766. this._modelCursor = null;
  12767. /**
  12768. * An interface passed by the dispatcher to the event callbacks.
  12769. *
  12770. * @member {module:engine/conversion/upcastdispatcher~UpcastConversionApi}
  12771. */
  12772. this.conversionApi = Object.assign( {}, conversionApi );
  12773. // The below methods are bound to this `UpcastDispatcher` instance and set on `conversionApi`.
  12774. // This way only a part of `UpcastDispatcher` API is exposed.
  12775. this.conversionApi.convertItem = this._convertItem.bind( this );
  12776. this.conversionApi.convertChildren = this._convertChildren.bind( this );
  12777. this.conversionApi.safeInsert = this._safeInsert.bind( this );
  12778. this.conversionApi.updateConversionResult = this._updateConversionResult.bind( this );
  12779. // Advanced API - use only if custom position handling is needed.
  12780. this.conversionApi.splitToAllowedParent = this._splitToAllowedParent.bind( this );
  12781. this.conversionApi.getSplitParts = this._getSplitParts.bind( this );
  12782. }
  12783. /**
  12784. * Starts the conversion process. The entry point for the conversion.
  12785. *
  12786. * @fires element
  12787. * @fires text
  12788. * @fires documentFragment
  12789. * @param {module:engine/view/documentfragment~DocumentFragment|module:engine/view/element~Element} viewItem
  12790. * The part of the view to be converted.
  12791. * @param {module:engine/model/writer~Writer} writer An instance of the model writer.
  12792. * @param {module:engine/model/schema~SchemaContextDefinition} [context=['$root']] Elements will be converted according to this context.
  12793. * @returns {module:engine/model/documentfragment~DocumentFragment} Model data that is the result of the conversion process
  12794. * wrapped in `DocumentFragment`. Converted marker elements will be set as the document fragment's
  12795. * {@link module:engine/model/documentfragment~DocumentFragment#markers static markers map}.
  12796. */
  12797. convert( viewItem, writer, context = [ '$root' ] ) {
  12798. this.fire( 'viewCleanup', viewItem );
  12799. // Create context tree and set position in the top element.
  12800. // Items will be converted according to this position.
  12801. this._modelCursor = createContextTree( context, writer );
  12802. // Store writer in conversion as a conversion API
  12803. // to be sure that conversion process will use the same batch.
  12804. this.conversionApi.writer = writer;
  12805. // Create consumable values list for conversion process.
  12806. this.conversionApi.consumable = _viewconsumable__WEBPACK_IMPORTED_MODULE_0__["default"].createFrom( viewItem );
  12807. // Custom data stored by converter for conversion process.
  12808. this.conversionApi.store = {};
  12809. // Do the conversion.
  12810. const { modelRange } = this._convertItem( viewItem, this._modelCursor );
  12811. // Conversion result is always a document fragment so let's create it.
  12812. const documentFragment = writer.createDocumentFragment();
  12813. // When there is a conversion result.
  12814. if ( modelRange ) {
  12815. // Remove all empty elements that were create while splitting.
  12816. this._removeEmptyElements();
  12817. // Move all items that were converted in context tree to the document fragment.
  12818. for ( const item of Array.from( this._modelCursor.parent.getChildren() ) ) {
  12819. writer.append( item, documentFragment );
  12820. }
  12821. // Extract temporary markers elements from model and set as static markers collection.
  12822. documentFragment.markers = extractMarkersFromModelFragment( documentFragment, writer );
  12823. }
  12824. // Clear context position.
  12825. this._modelCursor = null;
  12826. // Clear split elements & parents lists.
  12827. this._splitParts.clear();
  12828. this._cursorParents.clear();
  12829. // Clear conversion API.
  12830. this.conversionApi.writer = null;
  12831. this.conversionApi.store = null;
  12832. // Return fragment as conversion result.
  12833. return documentFragment;
  12834. }
  12835. /**
  12836. * @private
  12837. * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#convertItem
  12838. */
  12839. _convertItem( viewItem, modelCursor ) {
  12840. const data = Object.assign( { viewItem, modelCursor, modelRange: null } );
  12841. if ( viewItem.is( 'element' ) ) {
  12842. this.fire( 'element:' + viewItem.name, data, this.conversionApi );
  12843. } else if ( viewItem.is( '$text' ) ) {
  12844. this.fire( 'text', data, this.conversionApi );
  12845. } else {
  12846. this.fire( 'documentFragment', data, this.conversionApi );
  12847. }
  12848. // Handle incorrect conversion result.
  12849. if ( data.modelRange && !( data.modelRange instanceof _model_range__WEBPACK_IMPORTED_MODULE_1__["default"] ) ) {
  12850. /**
  12851. * Incorrect conversion result was dropped.
  12852. *
  12853. * {@link module:engine/model/range~Range Model range} should be a conversion result.
  12854. *
  12855. * @error view-conversion-dispatcher-incorrect-result
  12856. */
  12857. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'view-conversion-dispatcher-incorrect-result', this );
  12858. }
  12859. return { modelRange: data.modelRange, modelCursor: data.modelCursor };
  12860. }
  12861. /**
  12862. * @private
  12863. * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#convertChildren
  12864. */
  12865. _convertChildren( viewItem, elementOrModelCursor ) {
  12866. let nextModelCursor = elementOrModelCursor.is( 'position' ) ?
  12867. elementOrModelCursor : _model_position__WEBPACK_IMPORTED_MODULE_2__["default"]._createAt( elementOrModelCursor, 0 );
  12868. const modelRange = new _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]( nextModelCursor );
  12869. for ( const viewChild of Array.from( viewItem.getChildren() ) ) {
  12870. const result = this._convertItem( viewChild, nextModelCursor );
  12871. if ( result.modelRange instanceof _model_range__WEBPACK_IMPORTED_MODULE_1__["default"] ) {
  12872. modelRange.end = result.modelRange.end;
  12873. nextModelCursor = result.modelCursor;
  12874. }
  12875. }
  12876. return { modelRange, modelCursor: nextModelCursor };
  12877. }
  12878. /**
  12879. * @private
  12880. * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#safeInsert
  12881. */
  12882. _safeInsert( modelElement, position ) {
  12883. // Find allowed parent for element that we are going to insert.
  12884. // If current parent does not allow to insert element but one of the ancestors does
  12885. // then split nodes to allowed parent.
  12886. const splitResult = this._splitToAllowedParent( modelElement, position );
  12887. // When there is no split result it means that we can't insert element to model tree, so let's skip it.
  12888. if ( !splitResult ) {
  12889. return false;
  12890. }
  12891. // Insert element on allowed position.
  12892. this.conversionApi.writer.insert( modelElement, splitResult.position );
  12893. return true;
  12894. }
  12895. /**
  12896. * @private
  12897. * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#updateConversionResult
  12898. */
  12899. _updateConversionResult( modelElement, data ) {
  12900. const parts = this._getSplitParts( modelElement );
  12901. const writer = this.conversionApi.writer;
  12902. // Set conversion result range - only if not set already.
  12903. if ( !data.modelRange ) {
  12904. data.modelRange = writer.createRange(
  12905. writer.createPositionBefore( modelElement ),
  12906. writer.createPositionAfter( parts[ parts.length - 1 ] )
  12907. );
  12908. }
  12909. const savedCursorParent = this._cursorParents.get( modelElement );
  12910. // Now we need to check where the `modelCursor` should be.
  12911. if ( savedCursorParent ) {
  12912. // If we split parent to insert our element then we want to continue conversion in the new part of the split parent.
  12913. //
  12914. // before: <allowed><notAllowed>foo[]</notAllowed></allowed>
  12915. // after: <allowed><notAllowed>foo</notAllowed> <converted></converted> <notAllowed>[]</notAllowed></allowed>
  12916. data.modelCursor = writer.createPositionAt( savedCursorParent, 0 );
  12917. } else {
  12918. // Otherwise just continue after inserted element.
  12919. data.modelCursor = data.modelRange.end;
  12920. }
  12921. }
  12922. /**
  12923. * @private
  12924. * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#splitToAllowedParent
  12925. */
  12926. _splitToAllowedParent( node, modelCursor ) {
  12927. const { schema, writer } = this.conversionApi;
  12928. // Try to find allowed parent.
  12929. let allowedParent = schema.findAllowedParent( modelCursor, node );
  12930. if ( allowedParent ) {
  12931. // When current position parent allows to insert node then return this position.
  12932. if ( allowedParent === modelCursor.parent ) {
  12933. return { position: modelCursor };
  12934. }
  12935. // When allowed parent is in context tree (it's outside the converted tree).
  12936. if ( this._modelCursor.parent.getAncestors().includes( allowedParent ) ) {
  12937. allowedParent = null;
  12938. }
  12939. }
  12940. if ( !allowedParent ) {
  12941. // Check if the node wrapped with a paragraph would be accepted by the schema.
  12942. if ( !Object(_model_utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_4__["isParagraphable"])( modelCursor, node, schema ) ) {
  12943. return null;
  12944. }
  12945. return {
  12946. position: Object(_model_utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_4__["wrapInParagraph"])( modelCursor, writer )
  12947. };
  12948. }
  12949. // Split element to allowed parent.
  12950. const splitResult = this.conversionApi.writer.split( modelCursor, allowedParent );
  12951. // Using the range returned by `model.Writer#split`, we will pair original elements with their split parts.
  12952. //
  12953. // The range returned from the writer spans "over the split" or, precisely saying, from the end of the original element (the one
  12954. // that got split) to the beginning of the other part of that element:
  12955. //
  12956. // <limit><a><b><c>X[]Y</c></b><a></limit> ->
  12957. // <limit><a><b><c>X[</c></b></a><a><b><c>]Y</c></b></a>
  12958. //
  12959. // After the split there cannot be any full node between the positions in `splitRange`. The positions are touching.
  12960. // Also, because of how splitting works, it is easy to notice, that "closing tags" are in the reverse order than "opening tags".
  12961. // Also, since we split all those elements, each of them has to have the other part.
  12962. //
  12963. // With those observations in mind, we will pair the original elements with their split parts by saving "closing tags" and matching
  12964. // them with "opening tags" in the reverse order. For that we can use a stack.
  12965. const stack = [];
  12966. for ( const treeWalkerValue of splitResult.range.getWalker() ) {
  12967. if ( treeWalkerValue.type == 'elementEnd' ) {
  12968. stack.push( treeWalkerValue.item );
  12969. } else {
  12970. // There should not be any text nodes after the element is split, so the only other value is `elementStart`.
  12971. const originalPart = stack.pop();
  12972. const splitPart = treeWalkerValue.item;
  12973. this._registerSplitPair( originalPart, splitPart );
  12974. }
  12975. }
  12976. const cursorParent = splitResult.range.end.parent;
  12977. this._cursorParents.set( node, cursorParent );
  12978. return {
  12979. position: splitResult.position,
  12980. cursorParent
  12981. };
  12982. }
  12983. /**
  12984. * Registers that a `splitPart` element is a split part of the `originalPart` element.
  12985. *
  12986. * The data set by this method is used by {@link #_getSplitParts} and {@link #_removeEmptyElements}.
  12987. *
  12988. * @private
  12989. * @param {module:engine/model/element~Element} originalPart
  12990. * @param {module:engine/model/element~Element} splitPart
  12991. */
  12992. _registerSplitPair( originalPart, splitPart ) {
  12993. if ( !this._splitParts.has( originalPart ) ) {
  12994. this._splitParts.set( originalPart, [ originalPart ] );
  12995. }
  12996. const list = this._splitParts.get( originalPart );
  12997. this._splitParts.set( splitPart, list );
  12998. list.push( splitPart );
  12999. }
  13000. /**
  13001. * @private
  13002. * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#getSplitParts
  13003. */
  13004. _getSplitParts( element ) {
  13005. let parts;
  13006. if ( !this._splitParts.has( element ) ) {
  13007. parts = [ element ];
  13008. } else {
  13009. parts = this._splitParts.get( element );
  13010. }
  13011. return parts;
  13012. }
  13013. /**
  13014. * Checks if there are any empty elements created while splitting and removes them.
  13015. *
  13016. * This method works recursively to re-check empty elements again after at least one element was removed in the initial call,
  13017. * as some elements might have become empty after other empty elements were removed from them.
  13018. *
  13019. * @private
  13020. */
  13021. _removeEmptyElements() {
  13022. let anyRemoved = false;
  13023. for ( const element of this._splitParts.keys() ) {
  13024. if ( element.isEmpty ) {
  13025. this.conversionApi.writer.remove( element );
  13026. this._splitParts.delete( element );
  13027. anyRemoved = true;
  13028. }
  13029. }
  13030. if ( anyRemoved ) {
  13031. this._removeEmptyElements();
  13032. }
  13033. }
  13034. /**
  13035. * Fired before the first conversion event, at the beginning of the upcast (view-to-model conversion) process.
  13036. *
  13037. * @event viewCleanup
  13038. * @param {module:engine/view/documentfragment~DocumentFragment|module:engine/view/element~Element}
  13039. * viewItem A part of the view to be converted.
  13040. */
  13041. /**
  13042. * Fired when an {@link module:engine/view/element~Element} is converted.
  13043. *
  13044. * `element` is a namespace event for a class of events. Names of actually called events follow the pattern of
  13045. * `element:<elementName>` where `elementName` is the name of the converted element. This way listeners may listen to
  13046. * a conversion of all or just specific elements.
  13047. *
  13048. * @event element
  13049. * @param {module:engine/conversion/upcastdispatcher~UpcastConversionData} data The conversion data. Keep in mind that this object is
  13050. * shared by reference between all callbacks that will be called. This means that callbacks can override values if needed, and these
  13051. * values will be available in other callbacks.
  13052. * @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion utilities to be used by the
  13053. * callback.
  13054. */
  13055. /**
  13056. * Fired when a {@link module:engine/view/text~Text} is converted.
  13057. *
  13058. * @event text
  13059. * @see #event:element
  13060. */
  13061. /**
  13062. * Fired when a {@link module:engine/view/documentfragment~DocumentFragment} is converted.
  13063. *
  13064. * @event documentFragment
  13065. * @see #event:element
  13066. */
  13067. }
  13068. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_7__["default"])( UpcastDispatcher, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_6__["default"] );
  13069. // Traverses given model item and searches elements which marks marker range. Found element is removed from
  13070. // DocumentFragment but path of this element is stored in a Map which is then returned.
  13071. //
  13072. // @param {module:engine/view/documentfragment~DocumentFragment|module:engine/view/node~Node} modelItem Fragment of model.
  13073. // @returns {Map<String, module:engine/model/range~Range>} List of static markers.
  13074. function extractMarkersFromModelFragment( modelItem, writer ) {
  13075. const markerElements = new Set();
  13076. const markers = new Map();
  13077. // Create ModelTreeWalker.
  13078. const range = _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]._createIn( modelItem ).getItems();
  13079. // Walk through DocumentFragment and collect marker elements.
  13080. for ( const item of range ) {
  13081. // Check if current element is a marker.
  13082. if ( item.name == '$marker' ) {
  13083. markerElements.add( item );
  13084. }
  13085. }
  13086. // Walk through collected marker elements store its path and remove its from the DocumentFragment.
  13087. for ( const markerElement of markerElements ) {
  13088. const markerName = markerElement.getAttribute( 'data-name' );
  13089. const currentPosition = writer.createPositionBefore( markerElement );
  13090. // When marker of given name is not stored it means that we have found the beginning of the range.
  13091. if ( !markers.has( markerName ) ) {
  13092. markers.set( markerName, new _model_range__WEBPACK_IMPORTED_MODULE_1__["default"]( currentPosition.clone() ) );
  13093. // Otherwise is means that we have found end of the marker range.
  13094. } else {
  13095. markers.get( markerName ).end = currentPosition.clone();
  13096. }
  13097. // Remove marker element from DocumentFragment.
  13098. writer.remove( markerElement );
  13099. }
  13100. return markers;
  13101. }
  13102. // Creates model fragment according to given context and returns position in the bottom (the deepest) element.
  13103. function createContextTree( contextDefinition, writer ) {
  13104. let position;
  13105. for ( const item of new _model_schema__WEBPACK_IMPORTED_MODULE_3__["SchemaContext"]( contextDefinition ) ) {
  13106. const attributes = {};
  13107. for ( const key of item.getAttributeKeys() ) {
  13108. attributes[ key ] = item.getAttribute( key );
  13109. }
  13110. const current = writer.createElement( item.name, attributes );
  13111. if ( position ) {
  13112. writer.append( current, position );
  13113. }
  13114. position = _model_position__WEBPACK_IMPORTED_MODULE_2__["default"]._createAt( current, 0 );
  13115. }
  13116. return position;
  13117. }
  13118. /**
  13119. * A set of conversion utilities available as the third parameter of the
  13120. * {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher upcast dispatcher}'s events.
  13121. *
  13122. * @interface module:engine/conversion/upcastdispatcher~UpcastConversionApi
  13123. */
  13124. /**
  13125. * Starts the conversion of a given item by firing an appropriate event.
  13126. *
  13127. * Every fired event is passed (as the first parameter) an object with the `modelRange` property. Every event may set and/or
  13128. * modify that property. When all callbacks are done, the final value of the `modelRange` property is returned by this method.
  13129. * The `modelRange` must be a {@link module:engine/model/range~Range model range} or `null` (as set by default).
  13130. *
  13131. * @method #convertItem
  13132. * @fires module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element
  13133. * @fires module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:text
  13134. * @fires module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:documentFragment
  13135. * @param {module:engine/view/item~Item} viewItem Item to convert.
  13136. * @param {module:engine/model/position~Position} modelCursor The conversion position.
  13137. * @returns {Object} result The conversion result.
  13138. * @returns {module:engine/model/range~Range|null} result.modelRange The model range containing the result of the item conversion,
  13139. * created and modified by callbacks attached to the fired event, or `null` if the conversion result was incorrect.
  13140. * @returns {module:engine/model/position~Position} result.modelCursor The position where the conversion should be continued.
  13141. */
  13142. /**
  13143. * Starts the conversion of all children of a given item by firing appropriate events for all the children.
  13144. *
  13145. * @method #convertChildren
  13146. * @fires module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element
  13147. * @fires module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:text
  13148. * @fires module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:documentFragment
  13149. * @param {module:engine/view/item~Item} viewItem An element whose children should be converted.
  13150. * @param {module:engine/model/position~Position|module:engine/model/element~Element} positionOrElement A position or an element of
  13151. * the conversion.
  13152. * @returns {Object} result The conversion result.
  13153. * @returns {module:engine/model/range~Range} result.modelRange The model range containing the results of the conversion of all children
  13154. * of the given item. When no child was converted, the range is collapsed.
  13155. * @returns {module:engine/model/position~Position} result.modelCursor The position where the conversion should be continued.
  13156. */
  13157. /**
  13158. * Safely inserts an element to the document, checking the {@link module:engine/model/schema~Schema schema} to find an allowed parent for
  13159. * an element that you are going to insert, starting from the given position. If the current parent does not allow to insert the element
  13160. * but one of the ancestors does, then splits the nodes to allowed parent.
  13161. *
  13162. * If the schema allows to insert the node in a given position, nothing is split.
  13163. *
  13164. * If it was not possible to find an allowed parent, `false` is returned and nothing is split.
  13165. *
  13166. * Otherwise, ancestors are split.
  13167. *
  13168. * For instance, if `<image>` is not allowed in `<paragraph>` but is allowed in `$root`:
  13169. *
  13170. * <paragraph>foo[]bar</paragraph>
  13171. *
  13172. * -> safe insert for `<image>` will split ->
  13173. *
  13174. * <paragraph>foo</paragraph>[]<paragraph>bar</paragraph>
  13175. *
  13176. * Example usage:
  13177. *
  13178. * const myElement = conversionApi.writer.createElement( 'myElement' );
  13179. *
  13180. * if ( !conversionApi.safeInsert( myElement, data.modelCursor ) ) {
  13181. * return;
  13182. * }
  13183. *
  13184. * The split result is saved and {@link #updateConversionResult} should be used to update the
  13185. * {@link module:engine/conversion/upcastdispatcher~UpcastConversionData conversion data}.
  13186. *
  13187. * @method #safeInsert
  13188. * @param {module:engine/model/node~Node} node The node to insert.
  13189. * @param {module:engine/model/position~Position} position The position where an element is going to be inserted.
  13190. * @returns {Boolean} The split result. If it was not possible to find an allowed position, `false` is returned.
  13191. */
  13192. /**
  13193. * Updates the conversion result and sets a proper {@link module:engine/conversion/upcastdispatcher~UpcastConversionData#modelRange} and
  13194. * the next {@link module:engine/conversion/upcastdispatcher~UpcastConversionData#modelCursor} after the conversion.
  13195. * Used together with {@link #safeInsert}, it enables you to easily convert elements without worrying if the node was split
  13196. * during the conversion of its children.
  13197. *
  13198. * A usage example in converter code:
  13199. *
  13200. * const myElement = conversionApi.writer.createElement( 'myElement' );
  13201. *
  13202. * if ( !conversionApi.safeInsert( myElement, data.modelCursor ) ) {
  13203. * return;
  13204. * }
  13205. *
  13206. * // Children conversion may split `myElement`.
  13207. * conversionApi.convertChildren( data.viewItem, myElement );
  13208. *
  13209. * conversionApi.updateConversionResult( myElement, data );
  13210. *
  13211. * @method #updateConversionResult
  13212. * @param {module:engine/model/element~Element} element
  13213. * @param {module:engine/conversion/upcastdispatcher~UpcastConversionData} data Conversion data.
  13214. * @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion utilities to be used by the callback.
  13215. */
  13216. /**
  13217. * Checks the {@link module:engine/model/schema~Schema schema} to find an allowed parent for an element that is going to be inserted
  13218. * starting from the given position. If the current parent does not allow inserting an element but one of the ancestors does, the method
  13219. * splits nodes to allowed parent.
  13220. *
  13221. * If the schema allows inserting the node in the given position, nothing is split and an object with that position is returned.
  13222. *
  13223. * If it was not possible to find an allowed parent, `null` is returned and nothing is split.
  13224. *
  13225. * Otherwise, ancestors are split and an object with a position and the copy of the split element is returned.
  13226. *
  13227. * For instance, if `<image>` is not allowed in `<paragraph>` but is allowed in `$root`:
  13228. *
  13229. * <paragraph>foo[]bar</paragraph>
  13230. *
  13231. * -> split for `<image>` ->
  13232. *
  13233. * <paragraph>foo</paragraph>[]<paragraph>bar</paragraph>
  13234. *
  13235. * In the example above, the position between `<paragraph>` elements will be returned as `position` and the second `paragraph`
  13236. * as `cursorParent`.
  13237. *
  13238. * **Note:** This is an advanced method. For most cases {@link #safeInsert} and {@link #updateConversionResult} should be used.
  13239. *
  13240. * @method #splitToAllowedParent
  13241. * @param {module:engine/model/position~Position} position The position where the element is going to be inserted.
  13242. * @param {module:engine/model/node~Node} node The node to insert.
  13243. * @returns {Object|null} The split result. If it was not possible to find an allowed position, `null` is returned.
  13244. * @returns {module:engine/model/position~Position} The position between split elements.
  13245. * @returns {module:engine/model/element~Element} [cursorParent] The element inside which the cursor should be placed to
  13246. * continue the conversion. When the element is not defined it means that there was no split.
  13247. */
  13248. /**
  13249. * Returns all the split parts of the given `element` that were created during upcasting through using {@link #splitToAllowedParent}.
  13250. * It enables you to easily track these elements and continue processing them after they are split during the conversion of their children.
  13251. *
  13252. * <paragraph>Foo<image />bar<image />baz</paragraph> ->
  13253. * <paragraph>Foo</paragraph><image /><paragraph>bar</paragraph><image /><paragraph>baz</paragraph>
  13254. *
  13255. * For a reference to any of above paragraphs, the function will return all three paragraphs (the original element included),
  13256. * sorted in the order of their creation (the original element is the first one).
  13257. *
  13258. * If the given `element` was not split, an array with a single element is returned.
  13259. *
  13260. * A usage example in the converter code:
  13261. *
  13262. * const myElement = conversionApi.writer.createElement( 'myElement' );
  13263. *
  13264. * // Children conversion may split `myElement`.
  13265. * conversionApi.convertChildren( data.viewItem, data.modelCursor );
  13266. *
  13267. * const splitParts = conversionApi.getSplitParts( myElement );
  13268. * const lastSplitPart = splitParts[ splitParts.length - 1 ];
  13269. *
  13270. * // Setting `data.modelRange` basing on split parts:
  13271. * data.modelRange = conversionApi.writer.createRange(
  13272. * conversionApi.writer.createPositionBefore( myElement ),
  13273. * conversionApi.writer.createPositionAfter( lastSplitPart )
  13274. * );
  13275. *
  13276. * // Setting `data.modelCursor` to continue after the last split element:
  13277. * data.modelCursor = conversionApi.writer.createPositionAfter( lastSplitPart );
  13278. *
  13279. * **Tip:** If you are unable to get a reference to the original element (for example because the code is split into multiple converters
  13280. * or even classes) but it has already been converted, you may want to check the first element in `data.modelRange`. This is a common
  13281. * situation if an attribute converter is separated from an element converter.
  13282. *
  13283. * **Note:** This is an advanced method. For most cases {@link #safeInsert} and {@link #updateConversionResult} should be used.
  13284. *
  13285. * @method #getSplitParts
  13286. * @param {module:engine/model/element~Element} element
  13287. * @returns {Array.<module:engine/model/element~Element>}
  13288. */
  13289. /**
  13290. * Stores information about what parts of the processed view item are still waiting to be handled. After a piece of view item
  13291. * was converted, an appropriate consumable value should be
  13292. * {@link module:engine/conversion/viewconsumable~ViewConsumable#consume consumed}.
  13293. *
  13294. * @member {module:engine/conversion/viewconsumable~ViewConsumable} #consumable
  13295. */
  13296. /**
  13297. * Custom data stored by converters for the conversion process. Custom properties of this object can be defined and use to
  13298. * pass parameters between converters.
  13299. *
  13300. * The difference between this property and the `data` parameter of
  13301. * {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element} is that the `data` parameters allow you
  13302. * to pass parameters within a single event and `store` within the whole conversion.
  13303. *
  13304. * @member {Object} #store
  13305. */
  13306. /**
  13307. * The model's schema instance.
  13308. *
  13309. * @member {module:engine/model/schema~Schema} #schema
  13310. */
  13311. /**
  13312. * The {@link module:engine/model/writer~Writer} instance used to manipulate the data during conversion.
  13313. *
  13314. * @member {module:engine/model/writer~Writer} #writer
  13315. */
  13316. /**
  13317. * Conversion data.
  13318. *
  13319. * **Note:** Keep in mind that this object is shared by reference between all conversion callbacks that will be called.
  13320. * This means that callbacks can override values if needed, and these values will be available in other callbacks.
  13321. *
  13322. * @typedef {Object} module:engine/conversion/upcastdispatcher~UpcastConversionData
  13323. *
  13324. * @property {module:engine/view/item~Item} viewItem The converted item.
  13325. * @property {module:engine/model/position~Position} modelCursor The position where the converter should start changes.
  13326. * Change this value for the next converter to tell where the conversion should continue.
  13327. * @property {module:engine/model/range~Range} [modelRange] The current state of conversion result. Every change to
  13328. * the converted element should be reflected by setting or modifying this property.
  13329. */
  13330. /***/ }),
  13331. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcasthelpers.js":
  13332. /*!*********************************************************************************!*\
  13333. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcasthelpers.js ***!
  13334. \*********************************************************************************/
  13335. /*! exports provided: default, convertToModelFragment, convertText, convertSelectionChange */
  13336. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13337. "use strict";
  13338. __webpack_require__.r(__webpack_exports__);
  13339. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UpcastHelpers; });
  13340. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertToModelFragment", function() { return convertToModelFragment; });
  13341. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertText", function() { return convertText; });
  13342. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertSelectionChange", function() { return convertSelectionChange; });
  13343. /* harmony import */ var _view_matcher__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view/matcher */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/matcher.js");
  13344. /* harmony import */ var _conversionhelpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./conversionhelpers */ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversionhelpers.js");
  13345. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  13346. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  13347. /* harmony import */ var _ckeditor_ckeditor5_utils_src_priorities__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/priorities */ "./node_modules/@ckeditor/ckeditor5-utils/src/priorities.js");
  13348. /* harmony import */ var _model_utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../model/utils/autoparagraphing */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/autoparagraphing.js");
  13349. /**
  13350. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  13351. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  13352. */
  13353. /**
  13354. * Contains {@link module:engine/view/view view} to {@link module:engine/model/model model} converters for
  13355. * {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher}.
  13356. *
  13357. * @module engine/conversion/upcasthelpers
  13358. */
  13359. /**
  13360. * Upcast conversion helper functions.
  13361. *
  13362. * @extends module:engine/conversion/conversionhelpers~ConversionHelpers
  13363. */
  13364. class UpcastHelpers extends _conversionhelpers__WEBPACK_IMPORTED_MODULE_1__["default"] {
  13365. /**
  13366. * View element to model element conversion helper.
  13367. *
  13368. * This conversion results in creating a model element. For example,
  13369. * view `<p>Foo</p>` becomes `<paragraph>Foo</paragraph>` in the model.
  13370. *
  13371. * Keep in mind that the element will be inserted only if it is allowed
  13372. * by {@link module:engine/model/schema~Schema schema} configuration.
  13373. *
  13374. * editor.conversion.for( 'upcast' ).elementToElement( {
  13375. * view: 'p',
  13376. * model: 'paragraph'
  13377. * } );
  13378. *
  13379. * editor.conversion.for( 'upcast' ).elementToElement( {
  13380. * view: 'p',
  13381. * model: 'paragraph',
  13382. * converterPriority: 'high'
  13383. * } );
  13384. *
  13385. * editor.conversion.for( 'upcast' ).elementToElement( {
  13386. * view: {
  13387. * name: 'p',
  13388. * classes: 'fancy'
  13389. * },
  13390. * model: 'fancyParagraph'
  13391. * } );
  13392. *
  13393. * editor.conversion.for( 'upcast' ).elementToElement( {
  13394. * view: {
  13395. * name: 'p',
  13396. * classes: 'heading'
  13397. * },
  13398. * model: ( viewElement, conversionApi ) => {
  13399. * const modelWriter = conversionApi.writer;
  13400. *
  13401. * return modelWriter.createElement( 'heading', { level: viewElement.getAttribute( 'data-level' ) } );
  13402. * }
  13403. * } );
  13404. *
  13405. * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
  13406. * to the conversion process.
  13407. *
  13408. * @method #elementToElement
  13409. * @param {Object} config Conversion configuration.
  13410. * @param {module:engine/view/matcher~MatcherPattern} [config.view] Pattern matching all view elements which should be converted. If not
  13411. * set, the converter will fire for every view element.
  13412. * @param {String|module:engine/model/element~Element|Function} config.model Name of the model element, a model element instance or a
  13413. * function that takes a view element and {@link module:engine/conversion/upcastdispatcher~UpcastConversionApi upcast conversion API}
  13414. * and returns a model element. The model element will be inserted in the model.
  13415. * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  13416. * @returns {module:engine/conversion/upcasthelpers~UpcastHelpers}
  13417. */
  13418. elementToElement( config ) {
  13419. return this.add( upcastElementToElement( config ) );
  13420. }
  13421. /**
  13422. * View element to model attribute conversion helper.
  13423. *
  13424. * This conversion results in setting an attribute on a model node. For example, view `<strong>Foo</strong>` becomes
  13425. * `Foo` {@link module:engine/model/text~Text model text node} with `bold` attribute set to `true`.
  13426. *
  13427. * This helper is meant to set a model attribute on all the elements that are inside the converted element:
  13428. *
  13429. * <strong>Foo</strong> --> <strong><p>Foo</p></strong> --> <paragraph><$text bold="true">Foo</$text></paragraph>
  13430. *
  13431. * Above is a sample of HTML code, that goes through autoparagraphing (first step) and then is converted (second step).
  13432. * Even though `<strong>` is over `<p>` element, `bold="true"` was added to the text. See
  13433. * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#attributeToAttribute} for comparison.
  13434. *
  13435. * Keep in mind that the attribute will be set only if it is allowed by {@link module:engine/model/schema~Schema schema} configuration.
  13436. *
  13437. * editor.conversion.for( 'upcast' ).elementToAttribute( {
  13438. * view: 'strong',
  13439. * model: 'bold'
  13440. * } );
  13441. *
  13442. * editor.conversion.for( 'upcast' ).elementToAttribute( {
  13443. * view: 'strong',
  13444. * model: 'bold',
  13445. * converterPriority: 'high'
  13446. * } );
  13447. *
  13448. * editor.conversion.for( 'upcast' ).elementToAttribute( {
  13449. * view: {
  13450. * name: 'span',
  13451. * classes: 'bold'
  13452. * },
  13453. * model: 'bold'
  13454. * } );
  13455. *
  13456. * editor.conversion.for( 'upcast' ).elementToAttribute( {
  13457. * view: {
  13458. * name: 'span',
  13459. * classes: [ 'styled', 'styled-dark' ]
  13460. * },
  13461. * model: {
  13462. * key: 'styled',
  13463. * value: 'dark'
  13464. * }
  13465. * } );
  13466. *
  13467. * editor.conversion.for( 'upcast' ).elementToAttribute( {
  13468. * view: {
  13469. * name: 'span',
  13470. * styles: {
  13471. * 'font-size': /[\s\S]+/
  13472. * }
  13473. * },
  13474. * model: {
  13475. * key: 'fontSize',
  13476. * value: ( viewElement, conversionApi ) => {
  13477. * const fontSize = viewElement.getStyle( 'font-size' );
  13478. * const value = fontSize.substr( 0, fontSize.length - 2 );
  13479. *
  13480. * if ( value <= 10 ) {
  13481. * return 'small';
  13482. * } else if ( value > 12 ) {
  13483. * return 'big';
  13484. * }
  13485. *
  13486. * return null;
  13487. * }
  13488. * }
  13489. * } );
  13490. *
  13491. * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
  13492. * to the conversion process.
  13493. *
  13494. * @method #elementToAttribute
  13495. * @param {Object} config Conversion configuration.
  13496. * @param {module:engine/view/matcher~MatcherPattern} config.view Pattern matching all view elements which should be converted.
  13497. * @param {String|Object} config.model Model attribute key or an object with `key` and `value` properties, describing
  13498. * the model attribute. `value` property may be set as a function that takes a view element and
  13499. * {@link module:engine/conversion/upcastdispatcher~UpcastConversionApi upcast conversion API} and returns the value.
  13500. * If `String` is given, the model attribute value will be set to `true`.
  13501. * @param {module:utils/priorities~PriorityString} [config.converterPriority='low'] Converter priority.
  13502. * @returns {module:engine/conversion/upcasthelpers~UpcastHelpers}
  13503. */
  13504. elementToAttribute( config ) {
  13505. return this.add( upcastElementToAttribute( config ) );
  13506. }
  13507. /**
  13508. * View attribute to model attribute conversion helper.
  13509. *
  13510. * This conversion results in setting an attribute on a model node. For example, view `<img src="foo.jpg"></img>` becomes
  13511. * `<image source="foo.jpg"></image>` in the model.
  13512. *
  13513. * This helper is meant to convert view attributes from view elements which got converted to the model, so the view attribute
  13514. * is set only on the corresponding model node:
  13515. *
  13516. * <div class="dark"><div>foo</div></div> --> <div dark="true"><div>foo</div></div>
  13517. *
  13518. * Above, `class="dark"` attribute is added only to the `<div>` elements that has it. This is in contrary to
  13519. * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#elementToAttribute} which sets attributes for
  13520. * all the children in the model:
  13521. *
  13522. * <strong>Foo</strong> --> <strong><p>Foo</p></strong> --> <paragraph><$text bold="true">Foo</$text></paragraph>
  13523. *
  13524. * Above is a sample of HTML code, that goes through autoparagraphing (first step) and then is converted (second step).
  13525. * Even though `<strong>` is over `<p>` element, `bold="true"` was added to the text.
  13526. *
  13527. * Keep in mind that the attribute will be set only if it is allowed by {@link module:engine/model/schema~Schema schema} configuration.
  13528. *
  13529. * editor.conversion.for( 'upcast' ).attributeToAttribute( {
  13530. * view: 'src',
  13531. * model: 'source'
  13532. * } );
  13533. *
  13534. * editor.conversion.for( 'upcast' ).attributeToAttribute( {
  13535. * view: { key: 'src' },
  13536. * model: 'source'
  13537. * } );
  13538. *
  13539. * editor.conversion.for( 'upcast' ).attributeToAttribute( {
  13540. * view: { key: 'src' },
  13541. * model: 'source',
  13542. * converterPriority: 'normal'
  13543. * } );
  13544. *
  13545. * editor.conversion.for( 'upcast' ).attributeToAttribute( {
  13546. * view: {
  13547. * key: 'data-style',
  13548. * value: /[\s\S]+/
  13549. * },
  13550. * model: 'styled'
  13551. * } );
  13552. *
  13553. * editor.conversion.for( 'upcast' ).attributeToAttribute( {
  13554. * view: {
  13555. * name: 'img',
  13556. * key: 'class',
  13557. * value: 'styled-dark'
  13558. * },
  13559. * model: {
  13560. * key: 'styled',
  13561. * value: 'dark'
  13562. * }
  13563. * } );
  13564. *
  13565. * editor.conversion.for( 'upcast' ).attributeToAttribute( {
  13566. * view: {
  13567. * key: 'class',
  13568. * value: /styled-[\S]+/
  13569. * },
  13570. * model: {
  13571. * key: 'styled'
  13572. * value: ( viewElement, conversionApi ) => {
  13573. * const regexp = /styled-([\S]+)/;
  13574. * const match = viewElement.getAttribute( 'class' ).match( regexp );
  13575. *
  13576. * return match[ 1 ];
  13577. * }
  13578. * }
  13579. * } );
  13580. *
  13581. * Converting styles works a bit differently as it requires `view.styles` to be an object and by default
  13582. * a model attribute will be set to `true` by such a converter. You can set the model attribute to any value by providing the `value`
  13583. * callback that returns the desired value.
  13584. *
  13585. * // Default conversion of font-weight style will result in setting bold attribute to true.
  13586. * editor.conversion.for( 'upcast' ).attributeToAttribute( {
  13587. * view: {
  13588. * styles: {
  13589. * 'font-weight': 'bold'
  13590. * }
  13591. * },
  13592. * model: 'bold'
  13593. * } );
  13594. *
  13595. * // This converter will pass any style value to the `lineHeight` model attribute.
  13596. * editor.conversion.for( 'upcast' ).attributeToAttribute( {
  13597. * view: {
  13598. * styles: {
  13599. * 'line-height': /[\s\S]+/
  13600. * }
  13601. * },
  13602. * model: {
  13603. * key: 'lineHeight',
  13604. * value: ( viewElement, conversionApi ) => viewElement.getStyle( 'line-height' )
  13605. * }
  13606. * } );
  13607. *
  13608. * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
  13609. * to the conversion process.
  13610. *
  13611. * @method #attributeToAttribute
  13612. * @param {Object} config Conversion configuration.
  13613. * @param {String|Object} config.view Specifies which view attribute will be converted. If a `String` is passed,
  13614. * attributes with given key will be converted. If an `Object` is passed, it must have a required `key` property,
  13615. * specifying view attribute key, and may have an optional `value` property, specifying view attribute value and optional `name`
  13616. * property specifying a view element name from/on which the attribute should be converted. `value` can be given as a `String`,
  13617. * a `RegExp` or a function callback, that takes view attribute value as the only parameter and returns `Boolean`.
  13618. * @param {String|Object} config.model Model attribute key or an object with `key` and `value` properties, describing
  13619. * the model attribute. `value` property may be set as a function that takes a view element and
  13620. * {@link module:engine/conversion/upcastdispatcher~UpcastConversionApi upcast conversion API} and returns the value.
  13621. * If `String` is given, the model attribute value will be same as view attribute value.
  13622. * @param {module:utils/priorities~PriorityString} [config.converterPriority='low'] Converter priority.
  13623. * @returns {module:engine/conversion/upcasthelpers~UpcastHelpers}
  13624. */
  13625. attributeToAttribute( config ) {
  13626. return this.add( upcastAttributeToAttribute( config ) );
  13627. }
  13628. /**
  13629. * View element to model marker conversion helper.
  13630. *
  13631. * **Note**: This method was deprecated. Please use {@link #dataToMarker} instead.
  13632. *
  13633. * This conversion results in creating a model marker. For example, if the marker was stored in a view as an element:
  13634. * `<p>Fo<span data-marker="comment" data-comment-id="7"></span>o</p><p>B<span data-marker="comment" data-comment-id="7"></span>ar</p>`,
  13635. * after the conversion is done, the marker will be available in
  13636. * {@link module:engine/model/model~Model#markers model document markers}.
  13637. *
  13638. * editor.conversion.for( 'upcast' ).elementToMarker( {
  13639. * view: 'marker-search',
  13640. * model: 'search'
  13641. * } );
  13642. *
  13643. * editor.conversion.for( 'upcast' ).elementToMarker( {
  13644. * view: 'marker-search',
  13645. * model: 'search',
  13646. * converterPriority: 'high'
  13647. * } );
  13648. *
  13649. * editor.conversion.for( 'upcast' ).elementToMarker( {
  13650. * view: 'marker-search',
  13651. * model: ( viewElement, conversionApi ) => 'comment:' + viewElement.getAttribute( 'data-comment-id' )
  13652. * } );
  13653. *
  13654. * editor.conversion.for( 'upcast' ).elementToMarker( {
  13655. * view: {
  13656. * name: 'span',
  13657. * attributes: {
  13658. * 'data-marker': 'search'
  13659. * }
  13660. * },
  13661. * model: 'search'
  13662. * } );
  13663. *
  13664. * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
  13665. * to the conversion process.
  13666. *
  13667. * @deprecated
  13668. * @method #elementToMarker
  13669. * @param {Object} config Conversion configuration.
  13670. * @param {module:engine/view/matcher~MatcherPattern} config.view Pattern matching all view elements which should be converted.
  13671. * @param {String|Function} config.model Name of the model marker, or a function that takes a view element and returns
  13672. * a model marker name.
  13673. * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  13674. * @returns {module:engine/conversion/upcasthelpers~UpcastHelpers}
  13675. */
  13676. elementToMarker( config ) {
  13677. /**
  13678. * The {@link module:engine/conversion/upcasthelpers~UpcastHelpers#elementToMarker `UpcastHelpers#elementToMarker()`}
  13679. * method was deprecated and will be removed in the near future.
  13680. * Please use {@link module:engine/conversion/upcasthelpers~UpcastHelpers#dataToMarker `UpcastHelpers#dataToMarker()`} instead.
  13681. *
  13682. * @error upcast-helpers-element-to-marker-deprecated
  13683. */
  13684. Object(_ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__["logWarning"])( 'upcast-helpers-element-to-marker-deprecated' );
  13685. return this.add( upcastElementToMarker( config ) );
  13686. }
  13687. /**
  13688. * View-to-model marker conversion helper.
  13689. *
  13690. * Converts view data created by {@link module:engine/conversion/downcasthelpers~DowncastHelpers#markerToData `#markerToData()`}
  13691. * back to a model marker.
  13692. *
  13693. * This converter looks for specific view elements and view attributes that mark marker boundaries. See
  13694. * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#markerToData `#markerToData()`} to learn what view data
  13695. * is expected by this converter.
  13696. *
  13697. * The `config.view` property is equal to the marker group name to convert.
  13698. *
  13699. * By default, this converter creates markers with the `group:name` name convention (to match the default `markerToData` conversion).
  13700. *
  13701. * The conversion configuration can take a function that will generate a marker name.
  13702. * If such function is set as the `config.model` parameter, it is passed the `name` part from the view element or attribute and it is
  13703. * expected to return a string with the marker name.
  13704. *
  13705. * Basic usage:
  13706. *
  13707. * // Using the default conversion.
  13708. * // In this case, all markers from the `comment` group will be converted.
  13709. * // The conversion will look for `<comment-start>` and `<comment-end>` tags and
  13710. * // `data-comment-start-before`, `data-comment-start-after`,
  13711. * // `data-comment-end-before` and `data-comment-end-after` attributes.
  13712. * editor.conversion.for( 'upcast' ).dataToMarker( {
  13713. * view: 'comment'
  13714. * } );
  13715. *
  13716. * An example of a model that may be generated by this conversion:
  13717. *
  13718. * // View:
  13719. * <p>Foo<comment-start name="commentId:uid"></comment-start>bar</p>
  13720. * <figure data-comment-end-after="commentId:uid" class="image"><img src="abc.jpg" /></figure>
  13721. *
  13722. * // Model:
  13723. * <paragraph>Foo[bar</paragraph>
  13724. * <image src="abc.jpg"></image>]
  13725. *
  13726. * Where `[]` are boundaries of a marker that will receive the `comment:commentId:uid` name.
  13727. *
  13728. * Other examples of usage:
  13729. *
  13730. * // Using a custom function which is the same as the default conversion:
  13731. * editor.conversion.for( 'upcast' ).dataToMarker( {
  13732. * view: 'comment',
  13733. * model: ( name, conversionApi ) => 'comment:' + name,
  13734. * } );
  13735. *
  13736. * // Using the converter priority:
  13737. * editor.conversion.for( 'upcast' ).dataToMarker( {
  13738. * view: 'comment',
  13739. * model: ( name, conversionApi ) => 'comment:' + name,
  13740. * converterPriority: 'high'
  13741. * } );
  13742. *
  13743. * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
  13744. * to the conversion process.
  13745. *
  13746. * @method #dataToMarker
  13747. * @param {Object} config Conversion configuration.
  13748. * @param {String} config.view The marker group name to convert.
  13749. * @param {Function} [config.model] A function that takes the `name` part from the view element or attribute and
  13750. * {@link module:engine/conversion/upcastdispatcher~UpcastConversionApi upcast conversion API} and returns the marker name.
  13751. * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  13752. * @returns {module:engine/conversion/upcasthelpers~UpcastHelpers}
  13753. */
  13754. dataToMarker( config ) {
  13755. return this.add( upcastDataToMarker( config ) );
  13756. }
  13757. }
  13758. /**
  13759. * Function factory, creates a converter that converts {@link module:engine/view/documentfragment~DocumentFragment view document fragment}
  13760. * or all children of {@link module:engine/view/element~Element} into
  13761. * {@link module:engine/model/documentfragment~DocumentFragment model document fragment}.
  13762. * This is the "entry-point" converter for upcast (view to model conversion). This converter starts the conversion of all children
  13763. * of passed view document fragment. Those children {@link module:engine/view/node~Node view nodes} are then handled by other converters.
  13764. *
  13765. * This also a "default", last resort converter for all view elements that has not been converted by other converters.
  13766. * When a view element is being converted to the model but it does not have converter specified, that view element
  13767. * will be converted to {@link module:engine/model/documentfragment~DocumentFragment model document fragment} and returned.
  13768. *
  13769. * @returns {Function} Universal converter for view {@link module:engine/view/documentfragment~DocumentFragment fragments} and
  13770. * {@link module:engine/view/element~Element elements} that returns
  13771. * {@link module:engine/model/documentfragment~DocumentFragment model fragment} with children of converted view item.
  13772. */
  13773. function convertToModelFragment() {
  13774. return ( evt, data, conversionApi ) => {
  13775. // Second argument in `consumable.consume` is discarded for ViewDocumentFragment but is needed for ViewElement.
  13776. if ( !data.modelRange && conversionApi.consumable.consume( data.viewItem, { name: true } ) ) {
  13777. const { modelRange, modelCursor } = conversionApi.convertChildren( data.viewItem, data.modelCursor );
  13778. data.modelRange = modelRange;
  13779. data.modelCursor = modelCursor;
  13780. }
  13781. };
  13782. }
  13783. /**
  13784. * Function factory, creates a converter that converts {@link module:engine/view/text~Text} to {@link module:engine/model/text~Text}.
  13785. *
  13786. * @returns {Function} {@link module:engine/view/text~Text View text} converter.
  13787. */
  13788. function convertText() {
  13789. return ( evt, data, { schema, consumable, writer } ) => {
  13790. let position = data.modelCursor;
  13791. // When node is already converted then do nothing.
  13792. if ( !consumable.test( data.viewItem ) ) {
  13793. return;
  13794. }
  13795. if ( !schema.checkChild( position, '$text' ) ) {
  13796. if ( !Object(_model_utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_5__["isParagraphable"])( position, '$text', schema ) ) {
  13797. return;
  13798. }
  13799. position = Object(_model_utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_5__["wrapInParagraph"])( position, writer );
  13800. }
  13801. consumable.consume( data.viewItem );
  13802. const text = writer.createText( data.viewItem.data );
  13803. writer.insert( text, position );
  13804. data.modelRange = writer.createRange(
  13805. position,
  13806. position.getShiftedBy( text.offsetSize )
  13807. );
  13808. data.modelCursor = data.modelRange.end;
  13809. };
  13810. }
  13811. /**
  13812. * Function factory, creates a callback function which converts a {@link module:engine/view/selection~Selection
  13813. * view selection} taken from the {@link module:engine/view/document~Document#event:selectionChange} event
  13814. * and sets in on the {@link module:engine/model/document~Document#selection model}.
  13815. *
  13816. * **Note**: because there is no view selection change dispatcher nor any other advanced view selection to model
  13817. * conversion mechanism, the callback should be set directly on view document.
  13818. *
  13819. * view.document.on( 'selectionChange', convertSelectionChange( modelDocument, mapper ) );
  13820. *
  13821. * @param {module:engine/model/model~Model} model Data model.
  13822. * @param {module:engine/conversion/mapper~Mapper} mapper Conversion mapper.
  13823. * @returns {Function} {@link module:engine/view/document~Document#event:selectionChange} callback function.
  13824. */
  13825. function convertSelectionChange( model, mapper ) {
  13826. return ( evt, data ) => {
  13827. const viewSelection = data.newSelection;
  13828. const ranges = [];
  13829. for ( const viewRange of viewSelection.getRanges() ) {
  13830. ranges.push( mapper.toModelRange( viewRange ) );
  13831. }
  13832. const modelSelection = model.createSelection( ranges, { backward: viewSelection.isBackward } );
  13833. if ( !modelSelection.isEqual( model.document.selection ) ) {
  13834. model.change( writer => {
  13835. writer.setSelection( modelSelection );
  13836. } );
  13837. }
  13838. };
  13839. }
  13840. // View element to model element conversion helper.
  13841. //
  13842. // See {@link ~UpcastHelpers#elementToElement `.elementToElement()` upcast helper} for examples.
  13843. //
  13844. // @param {Object} config Conversion configuration.
  13845. // @param {module:engine/view/matcher~MatcherPattern} [config.view] Pattern matching all view elements which should be converted. If not
  13846. // set, the converter will fire for every view element.
  13847. // @param {String|module:engine/model/element~Element|Function} config.model Name of the model element, a model element
  13848. // instance or a function that takes a view element and returns a model element. The model element will be inserted in the model.
  13849. // @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  13850. // @returns {Function} Conversion helper.
  13851. function upcastElementToElement( config ) {
  13852. config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["cloneDeep"])( config );
  13853. const converter = prepareToElementConverter( config );
  13854. const elementName = getViewElementNameFromConfig( config.view );
  13855. const eventName = elementName ? 'element:' + elementName : 'element';
  13856. return dispatcher => {
  13857. dispatcher.on( eventName, converter, { priority: config.converterPriority || 'normal' } );
  13858. };
  13859. }
  13860. // View element to model attribute conversion helper.
  13861. //
  13862. // See {@link ~UpcastHelpers#elementToAttribute `.elementToAttribute()` upcast helper} for examples.
  13863. //
  13864. // @param {Object} config Conversion configuration.
  13865. // @param {module:engine/view/matcher~MatcherPattern} config.view Pattern matching all view elements which should be converted.
  13866. // @param {String|Object} config.model Model attribute key or an object with `key` and `value` properties, describing
  13867. // the model attribute. `value` property may be set as a function that takes a view element and returns the value.
  13868. // If `String` is given, the model attribute value will be set to `true`.
  13869. // @param {module:utils/priorities~PriorityString} [config.converterPriority='low'] Converter priority.
  13870. // @returns {Function} Conversion helper.
  13871. function upcastElementToAttribute( config ) {
  13872. config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["cloneDeep"])( config );
  13873. normalizeModelAttributeConfig( config );
  13874. const converter = prepareToAttributeConverter( config, false );
  13875. const elementName = getViewElementNameFromConfig( config.view );
  13876. const eventName = elementName ? 'element:' + elementName : 'element';
  13877. return dispatcher => {
  13878. dispatcher.on( eventName, converter, { priority: config.converterPriority || 'low' } );
  13879. };
  13880. }
  13881. // View attribute to model attribute conversion helper.
  13882. //
  13883. // See {@link ~UpcastHelpers#attributeToAttribute `.attributeToAttribute()` upcast helper} for examples.
  13884. //
  13885. // @param {Object} config Conversion configuration.
  13886. // @param {String|Object} config.view Specifies which view attribute will be converted. If a `String` is passed,
  13887. // attributes with given key will be converted. If an `Object` is passed, it must have a required `key` property,
  13888. // specifying view attribute key, and may have an optional `value` property, specifying view attribute value and optional `name`
  13889. // property specifying a view element name from/on which the attribute should be converted. `value` can be given as a `String`,
  13890. // a `RegExp` or a function callback, that takes view attribute value as the only parameter and returns `Boolean`.
  13891. // @param {String|Object} config.model Model attribute key or an object with `key` and `value` properties, describing
  13892. // the model attribute. `value` property may be set as a function that takes a view element and returns the value.
  13893. // If `String` is given, the model attribute value will be same as view attribute value.
  13894. // @param {module:utils/priorities~PriorityString} [config.converterPriority='low'] Converter priority.
  13895. // @returns {Function} Conversion helper.
  13896. function upcastAttributeToAttribute( config ) {
  13897. config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["cloneDeep"])( config );
  13898. let viewKey = null;
  13899. if ( typeof config.view == 'string' || config.view.key ) {
  13900. viewKey = normalizeViewAttributeKeyValueConfig( config );
  13901. }
  13902. normalizeModelAttributeConfig( config, viewKey );
  13903. const converter = prepareToAttributeConverter( config, true );
  13904. return dispatcher => {
  13905. dispatcher.on( 'element', converter, { priority: config.converterPriority || 'low' } );
  13906. };
  13907. }
  13908. // View element to model marker conversion helper.
  13909. //
  13910. // See {@link ~UpcastHelpers#elementToMarker `.elementToMarker()` upcast helper} for examples.
  13911. //
  13912. // @param {Object} config Conversion configuration.
  13913. // @param {module:engine/view/matcher~MatcherPattern} config.view Pattern matching all view elements which should be converted.
  13914. // @param {String|Function} config.model Name of the model marker, or a function that takes a view element and returns
  13915. // a model marker name.
  13916. // @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
  13917. // @returns {Function} Conversion helper.
  13918. function upcastElementToMarker( config ) {
  13919. config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["cloneDeep"])( config );
  13920. normalizeElementToMarkerConfig( config );
  13921. return upcastElementToElement( config );
  13922. }
  13923. // View data to model marker conversion helper.
  13924. //
  13925. // See {@link ~UpcastHelpers#dataToMarker} to learn more.
  13926. //
  13927. // @param {Object} config
  13928. // @param {String} config.view
  13929. // @param {Function} [config.model]
  13930. // @param {module:utils/priorities~PriorityString} [config.converterPriority='normal']
  13931. // @returns {Function} Conversion helper.
  13932. function upcastDataToMarker( config ) {
  13933. config = Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["cloneDeep"])( config );
  13934. // Default conversion.
  13935. if ( !config.model ) {
  13936. config.model = name => {
  13937. return name ? config.view + ':' + name : config.view;
  13938. };
  13939. }
  13940. const converterStart = prepareToElementConverter( normalizeDataToMarkerConfig( config, 'start' ) );
  13941. const converterEnd = prepareToElementConverter( normalizeDataToMarkerConfig( config, 'end' ) );
  13942. return dispatcher => {
  13943. dispatcher.on( 'element:' + config.view + '-start', converterStart, { priority: config.converterPriority || 'normal' } );
  13944. dispatcher.on( 'element:' + config.view + '-end', converterEnd, { priority: config.converterPriority || 'normal' } );
  13945. // Below is a hack that is needed to properly handle `converterPriority` for both elements and attributes.
  13946. // Attribute conversion needs to be performed *after* element conversion.
  13947. // This converter handles both element conversion and attribute conversion, which means that if a single
  13948. // `config.converterPriority` is used, it will lead to problems. For example, if `'high'` priority is used,
  13949. // then attribute conversion will be performed before a lot of element upcast converters.
  13950. // On the other hand we want to support `config.converterPriority` and overwriting conveters.
  13951. //
  13952. // To have it work, we need to do some extra processing for priority for attribute converter.
  13953. // Priority `'low'` value should be the base value and then we will change it depending on `config.converterPriority` value.
  13954. //
  13955. // This hack probably would not be needed if attributes are upcasted separately.
  13956. //
  13957. const basePriority = _ckeditor_ckeditor5_utils_src_priorities__WEBPACK_IMPORTED_MODULE_4__["default"].get( 'low' );
  13958. const maxPriority = _ckeditor_ckeditor5_utils_src_priorities__WEBPACK_IMPORTED_MODULE_4__["default"].get( 'highest' );
  13959. const priorityFactor = _ckeditor_ckeditor5_utils_src_priorities__WEBPACK_IMPORTED_MODULE_4__["default"].get( config.converterPriority ) / maxPriority; // Number in range [ -1, 1 ].
  13960. dispatcher.on( 'element', upcastAttributeToMarker( config ), { priority: basePriority + priorityFactor } );
  13961. };
  13962. }
  13963. // Function factory, returns a callback function which converts view attributes to a model marker.
  13964. //
  13965. // The converter looks for elements with `data-group-start-before`, `data-group-start-after`, `data-group-end-before`
  13966. // and `data-group-end-after` attributes and inserts `$marker` model elements before/after those elements.
  13967. // `group` part is specified in `config.view`.
  13968. //
  13969. // @param {Object} config
  13970. // @param {String} config.view
  13971. // @param {Function} [config.model]
  13972. // @returns {Function} Marker converter.
  13973. function upcastAttributeToMarker( config ) {
  13974. return ( evt, data, conversionApi ) => {
  13975. const attrName = `data-${ config.view }`;
  13976. // This converter wants to add a model element, marking a marker, before/after an element (or maybe even group of elements).
  13977. // To do that, we can use `data.modelRange` which is set on an element (or a group of elements) that has been upcasted.
  13978. // But, if the processed view element has not been upcasted yet (it does not have been converted), we need to
  13979. // fire conversion for its children first, then we will have `data.modelRange` available.
  13980. if ( !data.modelRange ) {
  13981. data = Object.assign( data, conversionApi.convertChildren( data.viewItem, data.modelCursor ) );
  13982. }
  13983. if ( conversionApi.consumable.consume( data.viewItem, { attributes: attrName + '-end-after' } ) ) {
  13984. addMarkerElements( data.modelRange.end, data.viewItem.getAttribute( attrName + '-end-after' ).split( ',' ) );
  13985. }
  13986. if ( conversionApi.consumable.consume( data.viewItem, { attributes: attrName + '-start-after' } ) ) {
  13987. addMarkerElements( data.modelRange.end, data.viewItem.getAttribute( attrName + '-start-after' ).split( ',' ) );
  13988. }
  13989. if ( conversionApi.consumable.consume( data.viewItem, { attributes: attrName + '-end-before' } ) ) {
  13990. addMarkerElements( data.modelRange.start, data.viewItem.getAttribute( attrName + '-end-before' ).split( ',' ) );
  13991. }
  13992. if ( conversionApi.consumable.consume( data.viewItem, { attributes: attrName + '-start-before' } ) ) {
  13993. addMarkerElements( data.modelRange.start, data.viewItem.getAttribute( attrName + '-start-before' ).split( ',' ) );
  13994. }
  13995. function addMarkerElements( position, markerViewNames ) {
  13996. for ( const markerViewName of markerViewNames ) {
  13997. const markerName = config.model( markerViewName, conversionApi );
  13998. const element = conversionApi.writer.createElement( '$marker', { 'data-name': markerName } );
  13999. conversionApi.writer.insert( element, position );
  14000. if ( data.modelCursor.isEqual( position ) ) {
  14001. data.modelCursor = data.modelCursor.getShiftedBy( 1 );
  14002. } else {
  14003. data.modelCursor = data.modelCursor._getTransformedByInsertion( position, 1 );
  14004. }
  14005. data.modelRange = data.modelRange._getTransformedByInsertion( position, 1 )[ 0 ];
  14006. }
  14007. }
  14008. };
  14009. }
  14010. // Helper function for from-view-element conversion. Checks if `config.view` directly specifies converted view element's name
  14011. // and if so, returns it.
  14012. //
  14013. // @param {Object} config Conversion view config.
  14014. // @returns {String|null} View element name or `null` if name is not directly set.
  14015. function getViewElementNameFromConfig( viewConfig ) {
  14016. if ( typeof viewConfig == 'string' ) {
  14017. return viewConfig;
  14018. }
  14019. if ( typeof viewConfig == 'object' && typeof viewConfig.name == 'string' ) {
  14020. return viewConfig.name;
  14021. }
  14022. return null;
  14023. }
  14024. // Helper for to-model-element conversion. Takes a config object and returns a proper converter function.
  14025. //
  14026. // @param {Object} config Conversion configuration.
  14027. // @returns {Function} View to model converter.
  14028. function prepareToElementConverter( config ) {
  14029. const matcher = new _view_matcher__WEBPACK_IMPORTED_MODULE_0__["default"]( config.view );
  14030. return ( evt, data, conversionApi ) => {
  14031. const matcherResult = matcher.match( data.viewItem );
  14032. if ( !matcherResult ) {
  14033. return;
  14034. }
  14035. const match = matcherResult.match;
  14036. // Force consuming element's name.
  14037. match.name = true;
  14038. if ( !conversionApi.consumable.test( data.viewItem, match ) ) {
  14039. return;
  14040. }
  14041. const modelElement = getModelElement( config.model, data.viewItem, conversionApi );
  14042. if ( !modelElement ) {
  14043. return;
  14044. }
  14045. if ( !conversionApi.safeInsert( modelElement, data.modelCursor ) ) {
  14046. return;
  14047. }
  14048. conversionApi.consumable.consume( data.viewItem, match );
  14049. conversionApi.convertChildren( data.viewItem, modelElement );
  14050. conversionApi.updateConversionResult( modelElement, data );
  14051. };
  14052. }
  14053. // Helper function for upcasting-to-element converter. Takes the model configuration, the converted view element
  14054. // and a writer instance and returns a model element instance to be inserted in the model.
  14055. //
  14056. // @param {String|Function|module:engine/model/element~Element} model Model conversion configuration.
  14057. // @param {module:engine/view/node~Node} input The converted view node.
  14058. // @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi The upcast conversion API.
  14059. function getModelElement( model, input, conversionApi ) {
  14060. if ( model instanceof Function ) {
  14061. return model( input, conversionApi );
  14062. } else {
  14063. return conversionApi.writer.createElement( model );
  14064. }
  14065. }
  14066. // Helper function view-attribute-to-model-attribute helper. Normalizes `config.view` which was set as `String` or
  14067. // as an `Object` with `key`, `value` and `name` properties. Normalized `config.view` has is compatible with
  14068. // {@link module:engine/view/matcher~MatcherPattern}.
  14069. //
  14070. // @param {Object} config Conversion config.
  14071. // @returns {String} Key of the converted view attribute.
  14072. function normalizeViewAttributeKeyValueConfig( config ) {
  14073. if ( typeof config.view == 'string' ) {
  14074. config.view = { key: config.view };
  14075. }
  14076. const key = config.view.key;
  14077. let normalized;
  14078. if ( key == 'class' || key == 'style' ) {
  14079. const keyName = key == 'class' ? 'classes' : 'styles';
  14080. normalized = {
  14081. [ keyName ]: config.view.value
  14082. };
  14083. } else {
  14084. const value = typeof config.view.value == 'undefined' ? /[\s\S]*/ : config.view.value;
  14085. normalized = {
  14086. attributes: {
  14087. [ key ]: value
  14088. }
  14089. };
  14090. }
  14091. if ( config.view.name ) {
  14092. normalized.name = config.view.name;
  14093. }
  14094. config.view = normalized;
  14095. return key;
  14096. }
  14097. // Helper function that normalizes `config.model` in from-model-attribute conversion. `config.model` can be set
  14098. // as a `String`, an `Object` with only `key` property or an `Object` with `key` and `value` properties. Normalized
  14099. // `config.model` is an `Object` with `key` and `value` properties.
  14100. //
  14101. // @param {Object} config Conversion config.
  14102. // @param {String} viewAttributeKeyToCopy Key of the converted view attribute. If it is set, model attribute value
  14103. // will be equal to view attribute value.
  14104. function normalizeModelAttributeConfig( config, viewAttributeKeyToCopy = null ) {
  14105. const defaultModelValue = viewAttributeKeyToCopy === null ? true : viewElement => viewElement.getAttribute( viewAttributeKeyToCopy );
  14106. const key = typeof config.model != 'object' ? config.model : config.model.key;
  14107. const value = typeof config.model != 'object' || typeof config.model.value == 'undefined' ? defaultModelValue : config.model.value;
  14108. config.model = { key, value };
  14109. }
  14110. // Helper for to-model-attribute conversion. Takes the model attribute name and conversion configuration and returns
  14111. // a proper converter function.
  14112. //
  14113. // @param {String} modelAttributeKey The key of the model attribute to set on a model node.
  14114. // @param {Object|Array.<Object>} config Conversion configuration. It is possible to provide multiple configurations in an array.
  14115. // @param {Boolean} shallow If set to `true` the attribute will be set only on top-level nodes. Otherwise, it will be set
  14116. // on all elements in the range.
  14117. function prepareToAttributeConverter( config, shallow ) {
  14118. const matcher = new _view_matcher__WEBPACK_IMPORTED_MODULE_0__["default"]( config.view );
  14119. return ( evt, data, conversionApi ) => {
  14120. const match = matcher.match( data.viewItem );
  14121. // If there is no match, this callback should not do anything.
  14122. if ( !match ) {
  14123. return;
  14124. }
  14125. const modelKey = config.model.key;
  14126. const modelValue = typeof config.model.value == 'function' ?
  14127. config.model.value( data.viewItem, conversionApi ) : config.model.value;
  14128. // Do not convert if attribute building function returned falsy value.
  14129. if ( modelValue === null ) {
  14130. return;
  14131. }
  14132. if ( onlyViewNameIsDefined( config.view, data.viewItem ) ) {
  14133. match.match.name = true;
  14134. } else {
  14135. // Do not test or consume `name` consumable.
  14136. delete match.match.name;
  14137. }
  14138. // Try to consume appropriate values from consumable values list.
  14139. if ( !conversionApi.consumable.test( data.viewItem, match.match ) ) {
  14140. return;
  14141. }
  14142. // Since we are converting to attribute we need an range on which we will set the attribute.
  14143. // If the range is not created yet, we will create it.
  14144. if ( !data.modelRange ) {
  14145. // Convert children and set conversion result as a current data.
  14146. data = Object.assign( data, conversionApi.convertChildren( data.viewItem, data.modelCursor ) );
  14147. }
  14148. // Set attribute on current `output`. `Schema` is checked inside this helper function.
  14149. const attributeWasSet = setAttributeOn( data.modelRange, { key: modelKey, value: modelValue }, shallow, conversionApi );
  14150. if ( attributeWasSet ) {
  14151. conversionApi.consumable.consume( data.viewItem, match.match );
  14152. }
  14153. };
  14154. }
  14155. // Helper function that checks if element name should be consumed in attribute converters.
  14156. //
  14157. // @param {Object} config Conversion view config.
  14158. // @returns {Boolean}
  14159. function onlyViewNameIsDefined( viewConfig, viewItem ) {
  14160. // https://github.com/ckeditor/ckeditor5-engine/issues/1786
  14161. const configToTest = typeof viewConfig == 'function' ? viewConfig( viewItem ) : viewConfig;
  14162. if ( typeof configToTest == 'object' && !getViewElementNameFromConfig( configToTest ) ) {
  14163. return false;
  14164. }
  14165. return !configToTest.classes && !configToTest.attributes && !configToTest.styles;
  14166. }
  14167. // Helper function for to-model-attribute converter. Sets model attribute on given range. Checks {@link module:engine/model/schema~Schema}
  14168. // to ensure proper model structure.
  14169. //
  14170. // @param {module:engine/model/range~Range} modelRange Model range on which attribute should be set.
  14171. // @param {Object} modelAttribute Model attribute to set.
  14172. // @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion API.
  14173. // @param {Boolean} shallow If set to `true` the attribute will be set only on top-level nodes. Otherwise, it will be set
  14174. // on all elements in the range.
  14175. // @returns {Boolean} `true` if attribute was set on at least one node from given `modelRange`.
  14176. function setAttributeOn( modelRange, modelAttribute, shallow, conversionApi ) {
  14177. let result = false;
  14178. // Set attribute on each item in range according to Schema.
  14179. for ( const node of Array.from( modelRange.getItems( { shallow } ) ) ) {
  14180. if ( conversionApi.schema.checkAttribute( node, modelAttribute.key ) ) {
  14181. conversionApi.writer.setAttribute( modelAttribute.key, modelAttribute.value, node );
  14182. result = true;
  14183. }
  14184. }
  14185. return result;
  14186. }
  14187. // Helper function for upcasting-to-marker conversion. Takes the config in a format requested by `upcastElementToMarker()`
  14188. // function and converts it to a format that is supported by `upcastElementToElement()` function.
  14189. //
  14190. // @param {Object} config Conversion configuration.
  14191. function normalizeElementToMarkerConfig( config ) {
  14192. const oldModel = config.model;
  14193. config.model = ( viewElement, conversionApi ) => {
  14194. const markerName = typeof oldModel == 'string' ? oldModel : oldModel( viewElement, conversionApi );
  14195. return conversionApi.writer.createElement( '$marker', { 'data-name': markerName } );
  14196. };
  14197. }
  14198. // Helper function for upcasting-to-marker conversion. Takes the config in a format requested by `upcastDataToMarker()`
  14199. // function and converts it to a format that is supported by `upcastElementToElement()` function.
  14200. //
  14201. // @param {Object} config Conversion configuration.
  14202. function normalizeDataToMarkerConfig( config, type ) {
  14203. const configForElements = {};
  14204. // Upcast <markerGroup-start> and <markerGroup-end> elements.
  14205. configForElements.view = config.view + '-' + type;
  14206. configForElements.model = ( viewElement, conversionApi ) => {
  14207. const viewName = viewElement.getAttribute( 'name' );
  14208. const markerName = config.model( viewName, conversionApi );
  14209. return conversionApi.writer.createElement( '$marker', { 'data-name': markerName } );
  14210. };
  14211. return configForElements;
  14212. }
  14213. /***/ }),
  14214. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/conversion/viewconsumable.js":
  14215. /*!**********************************************************************************!*\
  14216. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/conversion/viewconsumable.js ***!
  14217. \**********************************************************************************/
  14218. /*! exports provided: default */
  14219. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14220. "use strict";
  14221. __webpack_require__.r(__webpack_exports__);
  14222. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ViewConsumable; });
  14223. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  14224. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  14225. /**
  14226. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  14227. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  14228. */
  14229. /**
  14230. * @module engine/conversion/viewconsumable
  14231. */
  14232. /**
  14233. * Class used for handling consumption of view {@link module:engine/view/element~Element elements},
  14234. * {@link module:engine/view/text~Text text nodes} and {@link module:engine/view/documentfragment~DocumentFragment document fragments}.
  14235. * Element's name and its parts (attributes, classes and styles) can be consumed separately. Consuming an element's name
  14236. * does not consume its attributes, classes and styles.
  14237. * To add items for consumption use {@link module:engine/conversion/viewconsumable~ViewConsumable#add add method}.
  14238. * To test items use {@link module:engine/conversion/viewconsumable~ViewConsumable#test test method}.
  14239. * To consume items use {@link module:engine/conversion/viewconsumable~ViewConsumable#consume consume method}.
  14240. * To revert already consumed items use {@link module:engine/conversion/viewconsumable~ViewConsumable#revert revert method}.
  14241. *
  14242. * viewConsumable.add( element, { name: true } ); // Adds element's name as ready to be consumed.
  14243. * viewConsumable.add( textNode ); // Adds text node for consumption.
  14244. * viewConsumable.add( docFragment ); // Adds document fragment for consumption.
  14245. * viewConsumable.test( element, { name: true } ); // Tests if element's name can be consumed.
  14246. * viewConsumable.test( textNode ); // Tests if text node can be consumed.
  14247. * viewConsumable.test( docFragment ); // Tests if document fragment can be consumed.
  14248. * viewConsumable.consume( element, { name: true } ); // Consume element's name.
  14249. * viewConsumable.consume( textNode ); // Consume text node.
  14250. * viewConsumable.consume( docFragment ); // Consume document fragment.
  14251. * viewConsumable.revert( element, { name: true } ); // Revert already consumed element's name.
  14252. * viewConsumable.revert( textNode ); // Revert already consumed text node.
  14253. * viewConsumable.revert( docFragment ); // Revert already consumed document fragment.
  14254. */
  14255. class ViewConsumable {
  14256. /**
  14257. * Creates new ViewConsumable.
  14258. */
  14259. constructor() {
  14260. /**
  14261. * Map of consumable elements. If {@link module:engine/view/element~Element element} is used as a key,
  14262. * {@link module:engine/conversion/viewconsumable~ViewElementConsumables ViewElementConsumables} instance is stored as value.
  14263. * For {@link module:engine/view/text~Text text nodes} and
  14264. * {@link module:engine/view/documentfragment~DocumentFragment document fragments} boolean value is stored as value.
  14265. *
  14266. * @protected
  14267. * @member {Map.<module:engine/conversion/viewconsumable~ViewElementConsumables|Boolean>}
  14268. */
  14269. this._consumables = new Map();
  14270. }
  14271. /**
  14272. * Adds {@link module:engine/view/element~Element view element}, {@link module:engine/view/text~Text text node} or
  14273. * {@link module:engine/view/documentfragment~DocumentFragment document fragment} as ready to be consumed.
  14274. *
  14275. * viewConsumable.add( p, { name: true } ); // Adds element's name to consume.
  14276. * viewConsumable.add( p, { attributes: 'name' } ); // Adds element's attribute.
  14277. * viewConsumable.add( p, { classes: 'foobar' } ); // Adds element's class.
  14278. * viewConsumable.add( p, { styles: 'color' } ); // Adds element's style
  14279. * viewConsumable.add( p, { attributes: 'name', styles: 'color' } ); // Adds attribute and style.
  14280. * viewConsumable.add( p, { classes: [ 'baz', 'bar' ] } ); // Multiple consumables can be provided.
  14281. * viewConsumable.add( textNode ); // Adds text node to consume.
  14282. * viewConsumable.add( docFragment ); // Adds document fragment to consume.
  14283. *
  14284. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `viewconsumable-invalid-attribute` when `class` or `style`
  14285. * attribute is provided - it should be handled separately by providing actual style/class.
  14286. *
  14287. * viewConsumable.add( p, { attributes: 'style' } ); // This call will throw an exception.
  14288. * viewConsumable.add( p, { styles: 'color' } ); // This is properly handled style.
  14289. *
  14290. * @param {module:engine/view/element~Element|module:engine/view/text~Text|module:engine/view/documentfragment~DocumentFragment} element
  14291. * @param {Object} [consumables] Used only if first parameter is {@link module:engine/view/element~Element view element} instance.
  14292. * @param {Boolean} consumables.name If set to true element's name will be included.
  14293. * @param {String|Array.<String>} consumables.attributes Attribute name or array of attribute names.
  14294. * @param {String|Array.<String>} consumables.classes Class name or array of class names.
  14295. * @param {String|Array.<String>} consumables.styles Style name or array of style names.
  14296. */
  14297. add( element, consumables ) {
  14298. let elementConsumables;
  14299. // For text nodes and document fragments just mark them as consumable.
  14300. if ( element.is( '$text' ) || element.is( 'documentFragment' ) ) {
  14301. this._consumables.set( element, true );
  14302. return;
  14303. }
  14304. // For elements create new ViewElementConsumables or update already existing one.
  14305. if ( !this._consumables.has( element ) ) {
  14306. elementConsumables = new ViewElementConsumables( element );
  14307. this._consumables.set( element, elementConsumables );
  14308. } else {
  14309. elementConsumables = this._consumables.get( element );
  14310. }
  14311. elementConsumables.add( consumables );
  14312. }
  14313. /**
  14314. * Tests if {@link module:engine/view/element~Element view element}, {@link module:engine/view/text~Text text node} or
  14315. * {@link module:engine/view/documentfragment~DocumentFragment document fragment} can be consumed.
  14316. * It returns `true` when all items included in method's call can be consumed. Returns `false` when
  14317. * first already consumed item is found and `null` when first non-consumable item is found.
  14318. *
  14319. * viewConsumable.test( p, { name: true } ); // Tests element's name.
  14320. * viewConsumable.test( p, { attributes: 'name' } ); // Tests attribute.
  14321. * viewConsumable.test( p, { classes: 'foobar' } ); // Tests class.
  14322. * viewConsumable.test( p, { styles: 'color' } ); // Tests style.
  14323. * viewConsumable.test( p, { attributes: 'name', styles: 'color' } ); // Tests attribute and style.
  14324. * viewConsumable.test( p, { classes: [ 'baz', 'bar' ] } ); // Multiple consumables can be tested.
  14325. * viewConsumable.test( textNode ); // Tests text node.
  14326. * viewConsumable.test( docFragment ); // Tests document fragment.
  14327. *
  14328. * Testing classes and styles as attribute will test if all added classes/styles can be consumed.
  14329. *
  14330. * viewConsumable.test( p, { attributes: 'class' } ); // Tests if all added classes can be consumed.
  14331. * viewConsumable.test( p, { attributes: 'style' } ); // Tests if all added styles can be consumed.
  14332. *
  14333. * @param {module:engine/view/element~Element|module:engine/view/text~Text|module:engine/view/documentfragment~DocumentFragment} element
  14334. * @param {Object} [consumables] Used only if first parameter is {@link module:engine/view/element~Element view element} instance.
  14335. * @param {Boolean} consumables.name If set to true element's name will be included.
  14336. * @param {String|Array.<String>} consumables.attributes Attribute name or array of attribute names.
  14337. * @param {String|Array.<String>} consumables.classes Class name or array of class names.
  14338. * @param {String|Array.<String>} consumables.styles Style name or array of style names.
  14339. * @returns {Boolean|null} Returns `true` when all items included in method's call can be consumed. Returns `false`
  14340. * when first already consumed item is found and `null` when first non-consumable item is found.
  14341. */
  14342. test( element, consumables ) {
  14343. const elementConsumables = this._consumables.get( element );
  14344. if ( elementConsumables === undefined ) {
  14345. return null;
  14346. }
  14347. // For text nodes and document fragments return stored boolean value.
  14348. if ( element.is( '$text' ) || element.is( 'documentFragment' ) ) {
  14349. return elementConsumables;
  14350. }
  14351. // For elements test consumables object.
  14352. return elementConsumables.test( consumables );
  14353. }
  14354. /**
  14355. * Consumes {@link module:engine/view/element~Element view element}, {@link module:engine/view/text~Text text node} or
  14356. * {@link module:engine/view/documentfragment~DocumentFragment document fragment}.
  14357. * It returns `true` when all items included in method's call can be consumed, otherwise returns `false`.
  14358. *
  14359. * viewConsumable.consume( p, { name: true } ); // Consumes element's name.
  14360. * viewConsumable.consume( p, { attributes: 'name' } ); // Consumes element's attribute.
  14361. * viewConsumable.consume( p, { classes: 'foobar' } ); // Consumes element's class.
  14362. * viewConsumable.consume( p, { styles: 'color' } ); // Consumes element's style.
  14363. * viewConsumable.consume( p, { attributes: 'name', styles: 'color' } ); // Consumes attribute and style.
  14364. * viewConsumable.consume( p, { classes: [ 'baz', 'bar' ] } ); // Multiple consumables can be consumed.
  14365. * viewConsumable.consume( textNode ); // Consumes text node.
  14366. * viewConsumable.consume( docFragment ); // Consumes document fragment.
  14367. *
  14368. * Consuming classes and styles as attribute will test if all added classes/styles can be consumed.
  14369. *
  14370. * viewConsumable.consume( p, { attributes: 'class' } ); // Consume only if all added classes can be consumed.
  14371. * viewConsumable.consume( p, { attributes: 'style' } ); // Consume only if all added styles can be consumed.
  14372. *
  14373. * @param {module:engine/view/element~Element|module:engine/view/text~Text|module:engine/view/documentfragment~DocumentFragment} element
  14374. * @param {Object} [consumables] Used only if first parameter is {@link module:engine/view/element~Element view element} instance.
  14375. * @param {Boolean} consumables.name If set to true element's name will be included.
  14376. * @param {String|Array.<String>} consumables.attributes Attribute name or array of attribute names.
  14377. * @param {String|Array.<String>} consumables.classes Class name or array of class names.
  14378. * @param {String|Array.<String>} consumables.styles Style name or array of style names.
  14379. * @returns {Boolean} Returns `true` when all items included in method's call can be consumed,
  14380. * otherwise returns `false`.
  14381. */
  14382. consume( element, consumables ) {
  14383. if ( this.test( element, consumables ) ) {
  14384. if ( element.is( '$text' ) || element.is( 'documentFragment' ) ) {
  14385. // For text nodes and document fragments set value to false.
  14386. this._consumables.set( element, false );
  14387. } else {
  14388. // For elements - consume consumables object.
  14389. this._consumables.get( element ).consume( consumables );
  14390. }
  14391. return true;
  14392. }
  14393. return false;
  14394. }
  14395. /**
  14396. * Reverts {@link module:engine/view/element~Element view element}, {@link module:engine/view/text~Text text node} or
  14397. * {@link module:engine/view/documentfragment~DocumentFragment document fragment} so they can be consumed once again.
  14398. * Method does not revert items that were never previously added for consumption, even if they are included in
  14399. * method's call.
  14400. *
  14401. * viewConsumable.revert( p, { name: true } ); // Reverts element's name.
  14402. * viewConsumable.revert( p, { attributes: 'name' } ); // Reverts element's attribute.
  14403. * viewConsumable.revert( p, { classes: 'foobar' } ); // Reverts element's class.
  14404. * viewConsumable.revert( p, { styles: 'color' } ); // Reverts element's style.
  14405. * viewConsumable.revert( p, { attributes: 'name', styles: 'color' } ); // Reverts attribute and style.
  14406. * viewConsumable.revert( p, { classes: [ 'baz', 'bar' ] } ); // Multiple names can be reverted.
  14407. * viewConsumable.revert( textNode ); // Reverts text node.
  14408. * viewConsumable.revert( docFragment ); // Reverts document fragment.
  14409. *
  14410. * Reverting classes and styles as attribute will revert all classes/styles that were previously added for
  14411. * consumption.
  14412. *
  14413. * viewConsumable.revert( p, { attributes: 'class' } ); // Reverts all classes added for consumption.
  14414. * viewConsumable.revert( p, { attributes: 'style' } ); // Reverts all styles added for consumption.
  14415. *
  14416. * @param {module:engine/view/element~Element|module:engine/view/text~Text|module:engine/view/documentfragment~DocumentFragment} element
  14417. * @param {Object} [consumables] Used only if first parameter is {@link module:engine/view/element~Element view element} instance.
  14418. * @param {Boolean} consumables.name If set to true element's name will be included.
  14419. * @param {String|Array.<String>} consumables.attributes Attribute name or array of attribute names.
  14420. * @param {String|Array.<String>} consumables.classes Class name or array of class names.
  14421. * @param {String|Array.<String>} consumables.styles Style name or array of style names.
  14422. */
  14423. revert( element, consumables ) {
  14424. const elementConsumables = this._consumables.get( element );
  14425. if ( elementConsumables !== undefined ) {
  14426. if ( element.is( '$text' ) || element.is( 'documentFragment' ) ) {
  14427. // For text nodes and document fragments - set consumable to true.
  14428. this._consumables.set( element, true );
  14429. } else {
  14430. // For elements - revert items from consumables object.
  14431. elementConsumables.revert( consumables );
  14432. }
  14433. }
  14434. }
  14435. /**
  14436. * Creates consumable object from {@link module:engine/view/element~Element view element}. Consumable object will include
  14437. * element's name and all its attributes, classes and styles.
  14438. *
  14439. * @static
  14440. * @param {module:engine/view/element~Element} element
  14441. * @returns {Object} consumables
  14442. */
  14443. static consumablesFromElement( element ) {
  14444. const consumables = {
  14445. element,
  14446. name: true,
  14447. attributes: [],
  14448. classes: [],
  14449. styles: []
  14450. };
  14451. const attributes = element.getAttributeKeys();
  14452. for ( const attribute of attributes ) {
  14453. // Skip classes and styles - will be added separately.
  14454. if ( attribute == 'style' || attribute == 'class' ) {
  14455. continue;
  14456. }
  14457. consumables.attributes.push( attribute );
  14458. }
  14459. const classes = element.getClassNames();
  14460. for ( const className of classes ) {
  14461. consumables.classes.push( className );
  14462. }
  14463. const styles = element.getStyleNames();
  14464. for ( const style of styles ) {
  14465. consumables.styles.push( style );
  14466. }
  14467. return consumables;
  14468. }
  14469. /**
  14470. * Creates {@link module:engine/conversion/viewconsumable~ViewConsumable ViewConsumable} instance from
  14471. * {@link module:engine/view/node~Node node} or {@link module:engine/view/documentfragment~DocumentFragment document fragment}.
  14472. * Instance will contain all elements, child nodes, attributes, styles and classes added for consumption.
  14473. *
  14474. * @static
  14475. * @param {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment} from View node or document fragment
  14476. * from which `ViewConsumable` will be created.
  14477. * @param {module:engine/conversion/viewconsumable~ViewConsumable} [instance] If provided, given `ViewConsumable` instance will be used
  14478. * to add all consumables. It will be returned instead of a new instance.
  14479. */
  14480. static createFrom( from, instance ) {
  14481. if ( !instance ) {
  14482. instance = new ViewConsumable( from );
  14483. }
  14484. if ( from.is( '$text' ) ) {
  14485. instance.add( from );
  14486. return instance;
  14487. }
  14488. // Add `from` itself, if it is an element.
  14489. if ( from.is( 'element' ) ) {
  14490. instance.add( from, ViewConsumable.consumablesFromElement( from ) );
  14491. }
  14492. if ( from.is( 'documentFragment' ) ) {
  14493. instance.add( from );
  14494. }
  14495. for ( const child of from.getChildren() ) {
  14496. instance = ViewConsumable.createFrom( child, instance );
  14497. }
  14498. return instance;
  14499. }
  14500. }
  14501. /**
  14502. * This is a private helper-class for {@link module:engine/conversion/viewconsumable~ViewConsumable}.
  14503. * It represents and manipulates consumable parts of a single {@link module:engine/view/element~Element}.
  14504. *
  14505. * @private
  14506. */
  14507. class ViewElementConsumables {
  14508. /**
  14509. * Creates ViewElementConsumables instance.
  14510. *
  14511. * @param {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment} from View node or document fragment
  14512. * from which `ViewElementConsumables` is being created.
  14513. */
  14514. constructor( from ) {
  14515. /**
  14516. * @readonly
  14517. * @member {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment}
  14518. */
  14519. this.element = from;
  14520. /**
  14521. * Flag indicating if name of the element can be consumed.
  14522. *
  14523. * @private
  14524. * @member {Boolean}
  14525. */
  14526. this._canConsumeName = null;
  14527. /**
  14528. * Contains maps of element's consumables: attributes, classes and styles.
  14529. *
  14530. * @private
  14531. * @member {Object}
  14532. */
  14533. this._consumables = {
  14534. attributes: new Map(),
  14535. styles: new Map(),
  14536. classes: new Map()
  14537. };
  14538. }
  14539. /**
  14540. * Adds consumable parts of the {@link module:engine/view/element~Element view element}.
  14541. * Element's name itself can be marked to be consumed (when element's name is consumed its attributes, classes and
  14542. * styles still could be consumed):
  14543. *
  14544. * consumables.add( { name: true } );
  14545. *
  14546. * Attributes classes and styles:
  14547. *
  14548. * consumables.add( { attributes: 'title', classes: 'foo', styles: 'color' } );
  14549. * consumables.add( { attributes: [ 'title', 'name' ], classes: [ 'foo', 'bar' ] );
  14550. *
  14551. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `viewconsumable-invalid-attribute` when `class` or `style`
  14552. * attribute is provided - it should be handled separately by providing `style` and `class` in consumables object.
  14553. *
  14554. * @param {Object} consumables Object describing which parts of the element can be consumed.
  14555. * @param {Boolean} consumables.name If set to `true` element's name will be added as consumable.
  14556. * @param {String|Array.<String>} consumables.attributes Attribute name or array of attribute names to add as consumable.
  14557. * @param {String|Array.<String>} consumables.classes Class name or array of class names to add as consumable.
  14558. * @param {String|Array.<String>} consumables.styles Style name or array of style names to add as consumable.
  14559. */
  14560. add( consumables ) {
  14561. if ( consumables.name ) {
  14562. this._canConsumeName = true;
  14563. }
  14564. for ( const type in this._consumables ) {
  14565. if ( type in consumables ) {
  14566. this._add( type, consumables[ type ] );
  14567. }
  14568. }
  14569. }
  14570. /**
  14571. * Tests if parts of the {@link module:engine/view/node~Node view node} can be consumed.
  14572. *
  14573. * Element's name can be tested:
  14574. *
  14575. * consumables.test( { name: true } );
  14576. *
  14577. * Attributes classes and styles:
  14578. *
  14579. * consumables.test( { attributes: 'title', classes: 'foo', styles: 'color' } );
  14580. * consumables.test( { attributes: [ 'title', 'name' ], classes: [ 'foo', 'bar' ] );
  14581. *
  14582. * @param {Object} consumables Object describing which parts of the element should be tested.
  14583. * @param {Boolean} consumables.name If set to `true` element's name will be tested.
  14584. * @param {String|Array.<String>} consumables.attributes Attribute name or array of attribute names to test.
  14585. * @param {String|Array.<String>} consumables.classes Class name or array of class names to test.
  14586. * @param {String|Array.<String>} consumables.styles Style name or array of style names to test.
  14587. * @returns {Boolean|null} `true` when all tested items can be consumed, `null` when even one of the items
  14588. * was never marked for consumption and `false` when even one of the items was already consumed.
  14589. */
  14590. test( consumables ) {
  14591. // Check if name can be consumed.
  14592. if ( consumables.name && !this._canConsumeName ) {
  14593. return this._canConsumeName;
  14594. }
  14595. for ( const type in this._consumables ) {
  14596. if ( type in consumables ) {
  14597. const value = this._test( type, consumables[ type ] );
  14598. if ( value !== true ) {
  14599. return value;
  14600. }
  14601. }
  14602. }
  14603. // Return true only if all can be consumed.
  14604. return true;
  14605. }
  14606. /**
  14607. * Consumes parts of {@link module:engine/view/element~Element view element}. This function does not check if consumable item
  14608. * is already consumed - it consumes all consumable items provided.
  14609. * Element's name can be consumed:
  14610. *
  14611. * consumables.consume( { name: true } );
  14612. *
  14613. * Attributes classes and styles:
  14614. *
  14615. * consumables.consume( { attributes: 'title', classes: 'foo', styles: 'color' } );
  14616. * consumables.consume( { attributes: [ 'title', 'name' ], classes: [ 'foo', 'bar' ] );
  14617. *
  14618. * @param {Object} consumables Object describing which parts of the element should be consumed.
  14619. * @param {Boolean} consumables.name If set to `true` element's name will be consumed.
  14620. * @param {String|Array.<String>} consumables.attributes Attribute name or array of attribute names to consume.
  14621. * @param {String|Array.<String>} consumables.classes Class name or array of class names to consume.
  14622. * @param {String|Array.<String>} consumables.styles Style name or array of style names to consume.
  14623. */
  14624. consume( consumables ) {
  14625. if ( consumables.name ) {
  14626. this._canConsumeName = false;
  14627. }
  14628. for ( const type in this._consumables ) {
  14629. if ( type in consumables ) {
  14630. this._consume( type, consumables[ type ] );
  14631. }
  14632. }
  14633. }
  14634. /**
  14635. * Revert already consumed parts of {@link module:engine/view/element~Element view Element}, so they can be consumed once again.
  14636. * Element's name can be reverted:
  14637. *
  14638. * consumables.revert( { name: true } );
  14639. *
  14640. * Attributes classes and styles:
  14641. *
  14642. * consumables.revert( { attributes: 'title', classes: 'foo', styles: 'color' } );
  14643. * consumables.revert( { attributes: [ 'title', 'name' ], classes: [ 'foo', 'bar' ] );
  14644. *
  14645. * @param {Object} consumables Object describing which parts of the element should be reverted.
  14646. * @param {Boolean} consumables.name If set to `true` element's name will be reverted.
  14647. * @param {String|Array.<String>} consumables.attributes Attribute name or array of attribute names to revert.
  14648. * @param {String|Array.<String>} consumables.classes Class name or array of class names to revert.
  14649. * @param {String|Array.<String>} consumables.styles Style name or array of style names to revert.
  14650. */
  14651. revert( consumables ) {
  14652. if ( consumables.name ) {
  14653. this._canConsumeName = true;
  14654. }
  14655. for ( const type in this._consumables ) {
  14656. if ( type in consumables ) {
  14657. this._revert( type, consumables[ type ] );
  14658. }
  14659. }
  14660. }
  14661. /**
  14662. * Helper method that adds consumables of a given type: attribute, class or style.
  14663. *
  14664. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `viewconsumable-invalid-attribute` when `class` or `style`
  14665. * type is provided - it should be handled separately by providing actual style/class type.
  14666. *
  14667. * @private
  14668. * @param {String} type Type of the consumable item: `attributes`, `classes` or `styles`.
  14669. * @param {String|Array.<String>} item Consumable item or array of items.
  14670. */
  14671. _add( type, item ) {
  14672. const items = Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isArray"])( item ) ? item : [ item ];
  14673. const consumables = this._consumables[ type ];
  14674. for ( const name of items ) {
  14675. if ( type === 'attributes' && ( name === 'class' || name === 'style' ) ) {
  14676. /**
  14677. * Class and style attributes should be handled separately in
  14678. * {@link module:engine/conversion/viewconsumable~ViewConsumable#add `ViewConsumable#add()`}.
  14679. *
  14680. * What you have done is trying to use:
  14681. *
  14682. * consumables.add( { attributes: [ 'class', 'style' ] } );
  14683. *
  14684. * While each class and style should be registered separately:
  14685. *
  14686. * consumables.add( { classes: 'some-class', styles: 'font-weight' } );
  14687. *
  14688. * @error viewconsumable-invalid-attribute
  14689. */
  14690. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'viewconsumable-invalid-attribute', this );
  14691. }
  14692. consumables.set( name, true );
  14693. if ( type === 'styles' ) {
  14694. for ( const alsoName of this.element.document.stylesProcessor.getRelatedStyles( name ) ) {
  14695. consumables.set( alsoName, true );
  14696. }
  14697. }
  14698. }
  14699. }
  14700. /**
  14701. * Helper method that tests consumables of a given type: attribute, class or style.
  14702. *
  14703. * @private
  14704. * @param {String} type Type of the consumable item: `attributes`, `classes` or `styles`.
  14705. * @param {String|Array.<String>} item Consumable item or array of items.
  14706. * @returns {Boolean|null} Returns `true` if all items can be consumed, `null` when one of the items cannot be
  14707. * consumed and `false` when one of the items is already consumed.
  14708. */
  14709. _test( type, item ) {
  14710. const items = Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isArray"])( item ) ? item : [ item ];
  14711. const consumables = this._consumables[ type ];
  14712. for ( const name of items ) {
  14713. if ( type === 'attributes' && ( name === 'class' || name === 'style' ) ) {
  14714. const consumableName = name == 'class' ? 'classes' : 'styles';
  14715. // Check all classes/styles if class/style attribute is tested.
  14716. const value = this._test( consumableName, [ ...this._consumables[ consumableName ].keys() ] );
  14717. if ( value !== true ) {
  14718. return value;
  14719. }
  14720. } else {
  14721. const value = consumables.get( name );
  14722. // Return null if attribute is not found.
  14723. if ( value === undefined ) {
  14724. return null;
  14725. }
  14726. if ( !value ) {
  14727. return false;
  14728. }
  14729. }
  14730. }
  14731. return true;
  14732. }
  14733. /**
  14734. * Helper method that consumes items of a given type: attribute, class or style.
  14735. *
  14736. * @private
  14737. * @param {String} type Type of the consumable item: `attributes`, `classes` or `styles`.
  14738. * @param {String|Array.<String>} item Consumable item or array of items.
  14739. */
  14740. _consume( type, item ) {
  14741. const items = Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isArray"])( item ) ? item : [ item ];
  14742. const consumables = this._consumables[ type ];
  14743. for ( const name of items ) {
  14744. if ( type === 'attributes' && ( name === 'class' || name === 'style' ) ) {
  14745. const consumableName = name == 'class' ? 'classes' : 'styles';
  14746. // If class or style is provided for consumption - consume them all.
  14747. this._consume( consumableName, [ ...this._consumables[ consumableName ].keys() ] );
  14748. } else {
  14749. consumables.set( name, false );
  14750. if ( type == 'styles' ) {
  14751. for ( const toConsume of this.element.document.stylesProcessor.getRelatedStyles( name ) ) {
  14752. consumables.set( toConsume, false );
  14753. }
  14754. }
  14755. }
  14756. }
  14757. }
  14758. /**
  14759. * Helper method that reverts items of a given type: attribute, class or style.
  14760. *
  14761. * @private
  14762. * @param {String} type Type of the consumable item: `attributes`, `classes` or , `styles`.
  14763. * @param {String|Array.<String>} item Consumable item or array of items.
  14764. */
  14765. _revert( type, item ) {
  14766. const items = Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isArray"])( item ) ? item : [ item ];
  14767. const consumables = this._consumables[ type ];
  14768. for ( const name of items ) {
  14769. if ( type === 'attributes' && ( name === 'class' || name === 'style' ) ) {
  14770. const consumableName = name == 'class' ? 'classes' : 'styles';
  14771. // If class or style is provided for reverting - revert them all.
  14772. this._revert( consumableName, [ ...this._consumables[ consumableName ].keys() ] );
  14773. } else {
  14774. const value = consumables.get( name );
  14775. if ( value === false ) {
  14776. consumables.set( name, true );
  14777. }
  14778. }
  14779. }
  14780. }
  14781. }
  14782. /***/ }),
  14783. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/basichtmlwriter.js":
  14784. /*!**************************************************************************************!*\
  14785. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/basichtmlwriter.js ***!
  14786. \**************************************************************************************/
  14787. /*! exports provided: default */
  14788. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14789. "use strict";
  14790. __webpack_require__.r(__webpack_exports__);
  14791. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BasicHtmlWriter; });
  14792. /**
  14793. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  14794. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  14795. */
  14796. /**
  14797. * @module engine/dataprocessor/basichtmlwriter
  14798. */
  14799. /* globals document */
  14800. /**
  14801. * Basic HTML writer. It uses the native `innerHTML` property for basic conversion
  14802. * from a document fragment to an HTML string.
  14803. *
  14804. * @implements module:engine/dataprocessor/htmlwriter~HtmlWriter
  14805. */
  14806. class BasicHtmlWriter {
  14807. /**
  14808. * Returns an HTML string created from the document fragment.
  14809. *
  14810. * @param {DocumentFragment} fragment
  14811. * @returns {String}
  14812. */
  14813. getHtml( fragment ) {
  14814. const doc = document.implementation.createHTMLDocument( '' );
  14815. const container = doc.createElement( 'div' );
  14816. container.appendChild( fragment );
  14817. return container.innerHTML;
  14818. }
  14819. }
  14820. /***/ }),
  14821. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor.js":
  14822. /*!****************************************************************************************!*\
  14823. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor.js ***!
  14824. \****************************************************************************************/
  14825. /*! exports provided: default */
  14826. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14827. "use strict";
  14828. __webpack_require__.r(__webpack_exports__);
  14829. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return HtmlDataProcessor; });
  14830. /* harmony import */ var _basichtmlwriter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./basichtmlwriter */ "./node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/basichtmlwriter.js");
  14831. /* harmony import */ var _view_domconverter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../view/domconverter */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/domconverter.js");
  14832. /**
  14833. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  14834. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  14835. */
  14836. /**
  14837. * @module engine/dataprocessor/htmldataprocessor
  14838. */
  14839. /* globals document, DOMParser */
  14840. /**
  14841. * The HTML data processor class.
  14842. * This data processor implementation uses HTML as input and output data.
  14843. *
  14844. * @implements module:engine/dataprocessor/dataprocessor~DataProcessor
  14845. */
  14846. class HtmlDataProcessor {
  14847. /**
  14848. * Creates a new instance of the HTML data processor class.
  14849. *
  14850. * @param {module:engine/view/document~Document} document The view document instance.
  14851. */
  14852. constructor( document ) {
  14853. /**
  14854. * A DOM parser instance used to parse an HTML string to an HTML document.
  14855. *
  14856. * @private
  14857. * @member {DOMParser}
  14858. */
  14859. this._domParser = new DOMParser();
  14860. /**
  14861. * A DOM converter used to convert DOM elements to view elements.
  14862. *
  14863. * @private
  14864. * @member {module:engine/view/domconverter~DomConverter}
  14865. */
  14866. this._domConverter = new _view_domconverter__WEBPACK_IMPORTED_MODULE_1__["default"]( document, { blockFillerMode: 'nbsp' } );
  14867. /**
  14868. * A basic HTML writer instance used to convert DOM elements to an HTML string.
  14869. *
  14870. * @private
  14871. * @member {module:engine/dataprocessor/basichtmlwriter~BasicHtmlWriter}
  14872. */
  14873. this._htmlWriter = new _basichtmlwriter__WEBPACK_IMPORTED_MODULE_0__["default"]();
  14874. }
  14875. /**
  14876. * Converts a provided {@link module:engine/view/documentfragment~DocumentFragment document fragment}
  14877. * to data format &mdash; in this case to an HTML string.
  14878. *
  14879. * @param {module:engine/view/documentfragment~DocumentFragment} viewFragment
  14880. * @returns {String} HTML string.
  14881. */
  14882. toData( viewFragment ) {
  14883. // Convert view DocumentFragment to DOM DocumentFragment.
  14884. const domFragment = this._domConverter.viewToDom( viewFragment, document );
  14885. // Convert DOM DocumentFragment to HTML output.
  14886. return this._htmlWriter.getHtml( domFragment );
  14887. }
  14888. /**
  14889. * Converts the provided HTML string to a view tree.
  14890. *
  14891. * @param {String} data An HTML string.
  14892. * @returns {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment|null} A converted view element.
  14893. */
  14894. toView( data ) {
  14895. // Convert input HTML data to DOM DocumentFragment.
  14896. const domFragment = this._toDom( data );
  14897. // Convert DOM DocumentFragment to view DocumentFragment.
  14898. return this._domConverter.domToView( domFragment );
  14899. }
  14900. /**
  14901. * Converts an HTML string to its DOM representation. Returns a document fragment containing nodes parsed from
  14902. * the provided data.
  14903. *
  14904. * @private
  14905. * @param {String} data
  14906. * @returns {DocumentFragment}
  14907. */
  14908. _toDom( data ) {
  14909. const document = this._domParser.parseFromString( data, 'text/html' );
  14910. const fragment = document.createDocumentFragment();
  14911. const nodes = document.body.childNodes;
  14912. while ( nodes.length > 0 ) {
  14913. fragment.appendChild( nodes[ 0 ] );
  14914. }
  14915. return fragment;
  14916. }
  14917. }
  14918. /***/ }),
  14919. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/batch.js":
  14920. /*!********************************************************************!*\
  14921. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/batch.js ***!
  14922. \********************************************************************/
  14923. /*! exports provided: default */
  14924. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14925. "use strict";
  14926. __webpack_require__.r(__webpack_exports__);
  14927. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Batch; });
  14928. /**
  14929. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  14930. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  14931. */
  14932. /**
  14933. * @module engine/model/batch
  14934. */
  14935. /**
  14936. * A batch instance groups model changes ({@link module:engine/model/operation/operation~Operation operations}). All operations
  14937. * grouped in a single batch can be reverted together, so you can also think about a batch as of a single undo step. If you want
  14938. * to extend a given undo step, you can add more changes to the batch using {@link module:engine/model/model~Model#enqueueChange}:
  14939. *
  14940. * model.enqueueChange( batch, writer => {
  14941. * writer.insertText( 'foo', paragraph, 'end' );
  14942. * } );
  14943. *
  14944. * @see module:engine/model/model~Model#enqueueChange
  14945. * @see module:engine/model/model~Model#change
  14946. */
  14947. class Batch {
  14948. /**
  14949. * Creates a batch instance.
  14950. *
  14951. * @see module:engine/model/model~Model#enqueueChange
  14952. * @see module:engine/model/model~Model#change
  14953. * @param {'transparent'|'default'} [type='default'] The type of the batch.
  14954. */
  14955. constructor( type = 'default' ) {
  14956. /**
  14957. * An array of operations that compose this batch.
  14958. *
  14959. * @readonly
  14960. * @type {Array.<module:engine/model/operation/operation~Operation>}
  14961. */
  14962. this.operations = [];
  14963. /**
  14964. * The type of the batch.
  14965. *
  14966. * It can be one of the following values:
  14967. * * `'default'` &ndash; All "normal" batches. This is the most commonly used type.
  14968. * * `'transparent'` &ndash; A batch that should be ignored by other features, i.e. an initial batch or collaborative editing
  14969. * changes.
  14970. *
  14971. * @readonly
  14972. * @type {'transparent'|'default'}
  14973. */
  14974. this.type = type;
  14975. }
  14976. /**
  14977. * Returns the base version of this batch, which is equal to the base version of the first operation in the batch.
  14978. * If there are no operations in the batch or neither operation has the base version set, it returns `null`.
  14979. *
  14980. * @readonly
  14981. * @type {Number|null}
  14982. */
  14983. get baseVersion() {
  14984. for ( const op of this.operations ) {
  14985. if ( op.baseVersion !== null ) {
  14986. return op.baseVersion;
  14987. }
  14988. }
  14989. return null;
  14990. }
  14991. /**
  14992. * Adds an operation to the batch instance.
  14993. *
  14994. * @param {module:engine/model/operation/operation~Operation} operation An operation to add.
  14995. * @returns {module:engine/model/operation/operation~Operation} The added operation.
  14996. */
  14997. addOperation( operation ) {
  14998. operation.batch = this;
  14999. this.operations.push( operation );
  15000. return operation;
  15001. }
  15002. }
  15003. /***/ }),
  15004. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/differ.js":
  15005. /*!*********************************************************************!*\
  15006. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/differ.js ***!
  15007. \*********************************************************************/
  15008. /*! exports provided: default */
  15009. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15010. "use strict";
  15011. __webpack_require__.r(__webpack_exports__);
  15012. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Differ; });
  15013. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  15014. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  15015. /**
  15016. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  15017. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  15018. */
  15019. /**
  15020. * @module engine/model/differ
  15021. */
  15022. /**
  15023. * Calculates the difference between two model states.
  15024. *
  15025. * Receives operations that are to be applied on the model document. Marks parts of the model document tree which
  15026. * are changed and saves the state of these elements before the change. Then, it compares saved elements with the
  15027. * changed elements, after all changes are applied on the model document. Calculates the diff between saved
  15028. * elements and new ones and returns a change set.
  15029. */
  15030. class Differ {
  15031. /**
  15032. * Creates a `Differ` instance.
  15033. *
  15034. * @param {module:engine/model/markercollection~MarkerCollection} markerCollection Model's marker collection.
  15035. */
  15036. constructor( markerCollection ) {
  15037. /**
  15038. * Reference to the model's marker collection.
  15039. *
  15040. * @private
  15041. * @type {module:engine/model/markercollection~MarkerCollection}
  15042. */
  15043. this._markerCollection = markerCollection;
  15044. /**
  15045. * A map that stores changes that happened in a given element.
  15046. *
  15047. * The keys of the map are references to the model elements.
  15048. * The values of the map are arrays with changes that were done on this element.
  15049. *
  15050. * @private
  15051. * @type {Map}
  15052. */
  15053. this._changesInElement = new Map();
  15054. /**
  15055. * A map that stores "element's children snapshots". A snapshot is representing children of a given element before
  15056. * the first change was applied on that element. Snapshot items are objects with two properties: `name`,
  15057. * containing the element name (or `'$text'` for a text node) and `attributes` which is a map of the node's attributes.
  15058. *
  15059. * @private
  15060. * @type {Map}
  15061. */
  15062. this._elementSnapshots = new Map();
  15063. /**
  15064. * A map that stores all changed markers.
  15065. *
  15066. * The keys of the map are marker names.
  15067. * The values of the map are objects with the `oldRange` and `newRange` properties. They store the marker range
  15068. * state before and after the change.
  15069. *
  15070. * @private
  15071. * @type {Map}
  15072. */
  15073. this._changedMarkers = new Map();
  15074. /**
  15075. * Stores the number of changes that were processed. Used to order the changes chronologically. It is important
  15076. * when changes are sorted.
  15077. *
  15078. * @private
  15079. * @type {Number}
  15080. */
  15081. this._changeCount = 0;
  15082. /**
  15083. * For efficiency purposes, `Differ` stores the change set returned by the differ after {@link #getChanges} call.
  15084. * Cache is reset each time a new operation is buffered. If the cache has not been reset, {@link #getChanges} will
  15085. * return the cached value instead of calculating it again.
  15086. *
  15087. * This property stores those changes that did not take place in graveyard root.
  15088. *
  15089. * @private
  15090. * @type {Array.<Object>|null}
  15091. */
  15092. this._cachedChanges = null;
  15093. /**
  15094. * For efficiency purposes, `Differ` stores the change set returned by the differ after the {@link #getChanges} call.
  15095. * The cache is reset each time a new operation is buffered. If the cache has not been reset, {@link #getChanges} will
  15096. * return the cached value instead of calculating it again.
  15097. *
  15098. * This property stores all changes evaluated by `Differ`, including those that took place in the graveyard.
  15099. *
  15100. * @private
  15101. * @type {Array.<Object>|null}
  15102. */
  15103. this._cachedChangesWithGraveyard = null;
  15104. }
  15105. /**
  15106. * Informs whether there are any changes buffered in `Differ`.
  15107. *
  15108. * @readonly
  15109. * @type {Boolean}
  15110. */
  15111. get isEmpty() {
  15112. return this._changesInElement.size == 0 && this._changedMarkers.size == 0;
  15113. }
  15114. /**
  15115. * Marks given `item` in differ to be "refreshed". It means that the item will be marked as removed and inserted in the differ changes
  15116. * set, so it will be effectively re-converted when differ changes will be handled by a dispatcher.
  15117. *
  15118. * @param {module:engine/model/item~Item} item Item to refresh.
  15119. */
  15120. refreshItem( item ) {
  15121. if ( this._isInInsertedElement( item.parent ) ) {
  15122. return;
  15123. }
  15124. this._markRemove( item.parent, item.startOffset, item.offsetSize );
  15125. this._markInsert( item.parent, item.startOffset, item.offsetSize );
  15126. const range = _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( item );
  15127. for ( const marker of this._markerCollection.getMarkersIntersectingRange( range ) ) {
  15128. const markerRange = marker.getRange();
  15129. this.bufferMarkerChange( marker.name, markerRange, markerRange, marker.affectsData );
  15130. }
  15131. // Clear cache after each buffered operation as it is no longer valid.
  15132. this._cachedChanges = null;
  15133. }
  15134. /**
  15135. * Buffers the given operation. An operation has to be buffered before it is executed.
  15136. *
  15137. * Operation type is checked and it is checked which nodes it will affect. These nodes are then stored in `Differ`
  15138. * in the state before the operation is executed.
  15139. *
  15140. * @param {module:engine/model/operation/operation~Operation} operation An operation to buffer.
  15141. */
  15142. bufferOperation( operation ) {
  15143. // Below we take an operation, check its type, then use its parameters in marking (private) methods.
  15144. // The general rule is to not mark elements inside inserted element. All inserted elements are re-rendered.
  15145. // Marking changes in them would cause a "double" changing then.
  15146. //
  15147. switch ( operation.type ) {
  15148. case 'insert': {
  15149. if ( this._isInInsertedElement( operation.position.parent ) ) {
  15150. return;
  15151. }
  15152. this._markInsert( operation.position.parent, operation.position.offset, operation.nodes.maxOffset );
  15153. break;
  15154. }
  15155. case 'addAttribute':
  15156. case 'removeAttribute':
  15157. case 'changeAttribute': {
  15158. for ( const item of operation.range.getItems( { shallow: true } ) ) {
  15159. if ( this._isInInsertedElement( item.parent ) ) {
  15160. continue;
  15161. }
  15162. this._markAttribute( item );
  15163. }
  15164. break;
  15165. }
  15166. case 'remove':
  15167. case 'move':
  15168. case 'reinsert': {
  15169. // When range is moved to the same position then not mark it as a change.
  15170. // See: https://github.com/ckeditor/ckeditor5-engine/issues/1664.
  15171. if (
  15172. operation.sourcePosition.isEqual( operation.targetPosition ) ||
  15173. operation.sourcePosition.getShiftedBy( operation.howMany ).isEqual( operation.targetPosition )
  15174. ) {
  15175. return;
  15176. }
  15177. const sourceParentInserted = this._isInInsertedElement( operation.sourcePosition.parent );
  15178. const targetParentInserted = this._isInInsertedElement( operation.targetPosition.parent );
  15179. if ( !sourceParentInserted ) {
  15180. this._markRemove( operation.sourcePosition.parent, operation.sourcePosition.offset, operation.howMany );
  15181. }
  15182. if ( !targetParentInserted ) {
  15183. this._markInsert( operation.targetPosition.parent, operation.getMovedRangeStart().offset, operation.howMany );
  15184. }
  15185. break;
  15186. }
  15187. case 'rename': {
  15188. if ( this._isInInsertedElement( operation.position.parent ) ) {
  15189. return;
  15190. }
  15191. this._markRemove( operation.position.parent, operation.position.offset, 1 );
  15192. this._markInsert( operation.position.parent, operation.position.offset, 1 );
  15193. const range = _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createFromPositionAndShift( operation.position, 1 );
  15194. for ( const marker of this._markerCollection.getMarkersIntersectingRange( range ) ) {
  15195. const markerRange = marker.getRange();
  15196. this.bufferMarkerChange( marker.name, markerRange, markerRange, marker.affectsData );
  15197. }
  15198. break;
  15199. }
  15200. case 'split': {
  15201. const splitElement = operation.splitPosition.parent;
  15202. // Mark that children of the split element were removed.
  15203. if ( !this._isInInsertedElement( splitElement ) ) {
  15204. this._markRemove( splitElement, operation.splitPosition.offset, operation.howMany );
  15205. }
  15206. // Mark that the new element (split copy) was inserted.
  15207. if ( !this._isInInsertedElement( operation.insertionPosition.parent ) ) {
  15208. this._markInsert( operation.insertionPosition.parent, operation.insertionPosition.offset, 1 );
  15209. }
  15210. // If the split took the element from the graveyard, mark that the element from the graveyard was removed.
  15211. if ( operation.graveyardPosition ) {
  15212. this._markRemove( operation.graveyardPosition.parent, operation.graveyardPosition.offset, 1 );
  15213. }
  15214. break;
  15215. }
  15216. case 'merge': {
  15217. // Mark that the merged element was removed.
  15218. const mergedElement = operation.sourcePosition.parent;
  15219. if ( !this._isInInsertedElement( mergedElement.parent ) ) {
  15220. this._markRemove( mergedElement.parent, mergedElement.startOffset, 1 );
  15221. }
  15222. // Mark that the merged element was inserted into graveyard.
  15223. const graveyardParent = operation.graveyardPosition.parent;
  15224. this._markInsert( graveyardParent, operation.graveyardPosition.offset, 1 );
  15225. // Mark that children of merged element were inserted at new parent.
  15226. const mergedIntoElement = operation.targetPosition.parent;
  15227. if ( !this._isInInsertedElement( mergedIntoElement ) ) {
  15228. this._markInsert( mergedIntoElement, operation.targetPosition.offset, mergedElement.maxOffset );
  15229. }
  15230. break;
  15231. }
  15232. }
  15233. // Clear cache after each buffered operation as it is no longer valid.
  15234. this._cachedChanges = null;
  15235. }
  15236. /**
  15237. * Buffers a marker change.
  15238. *
  15239. * @param {String} markerName The name of the marker that changed.
  15240. * @param {module:engine/model/range~Range|null} oldRange Marker range before the change or `null` if the marker has just
  15241. * been created.
  15242. * @param {module:engine/model/range~Range|null} newRange Marker range after the change or `null` if the marker was removed.
  15243. * @param {Boolean} affectsData Flag indicating whether marker affects the editor data.
  15244. */
  15245. bufferMarkerChange( markerName, oldRange, newRange, affectsData ) {
  15246. const buffered = this._changedMarkers.get( markerName );
  15247. if ( !buffered ) {
  15248. this._changedMarkers.set( markerName, {
  15249. oldRange,
  15250. newRange,
  15251. affectsData
  15252. } );
  15253. } else {
  15254. buffered.newRange = newRange;
  15255. buffered.affectsData = affectsData;
  15256. if ( buffered.oldRange == null && buffered.newRange == null ) {
  15257. // The marker is going to be removed (`newRange == null`) but it did not exist before the first buffered change
  15258. // (`buffered.oldRange == null`). In this case, do not keep the marker in buffer at all.
  15259. this._changedMarkers.delete( markerName );
  15260. }
  15261. }
  15262. }
  15263. /**
  15264. * Returns all markers that should be removed as a result of buffered changes.
  15265. *
  15266. * @returns {Array.<Object>} Markers to remove. Each array item is an object containing the `name` and `range` properties.
  15267. */
  15268. getMarkersToRemove() {
  15269. const result = [];
  15270. for ( const [ name, change ] of this._changedMarkers ) {
  15271. if ( change.oldRange != null ) {
  15272. result.push( { name, range: change.oldRange } );
  15273. }
  15274. }
  15275. return result;
  15276. }
  15277. /**
  15278. * Returns all markers which should be added as a result of buffered changes.
  15279. *
  15280. * @returns {Array.<Object>} Markers to add. Each array item is an object containing the `name` and `range` properties.
  15281. */
  15282. getMarkersToAdd() {
  15283. const result = [];
  15284. for ( const [ name, change ] of this._changedMarkers ) {
  15285. if ( change.newRange != null ) {
  15286. result.push( { name, range: change.newRange } );
  15287. }
  15288. }
  15289. return result;
  15290. }
  15291. /**
  15292. * Returns all markers which changed.
  15293. *
  15294. * @returns {Array.<Object>}
  15295. */
  15296. getChangedMarkers() {
  15297. return Array.from( this._changedMarkers ).map( item => (
  15298. {
  15299. name: item[ 0 ],
  15300. data: {
  15301. oldRange: item[ 1 ].oldRange,
  15302. newRange: item[ 1 ].newRange
  15303. }
  15304. }
  15305. ) );
  15306. }
  15307. /**
  15308. * Checks whether some of the buffered changes affect the editor data.
  15309. *
  15310. * Types of changes which affect the editor data:
  15311. *
  15312. * * model structure changes,
  15313. * * attribute changes,
  15314. * * changes of markers which were defined as `affectingData`.
  15315. *
  15316. * @returns {Boolean}
  15317. */
  15318. hasDataChanges() {
  15319. for ( const [ , change ] of this._changedMarkers ) {
  15320. if ( change.affectsData ) {
  15321. return true;
  15322. }
  15323. }
  15324. // If markers do not affect the data, check whether there are some changes in elements.
  15325. return this._changesInElement.size > 0;
  15326. }
  15327. /**
  15328. * Calculates the diff between the old model tree state (the state before the first buffered operations since the last {@link #reset}
  15329. * call) and the new model tree state (actual one). It should be called after all buffered operations are executed.
  15330. *
  15331. * The diff set is returned as an array of diff items, each describing a change done on the model. The items are sorted by
  15332. * the position on which the change happened. If a position {@link module:engine/model/position~Position#isBefore is before}
  15333. * another one, it will be on an earlier index in the diff set.
  15334. *
  15335. * Because calculating the diff is a costly operation, the result is cached. If no new operation was buffered since the
  15336. * previous {@link #getChanges} call, the next call will return the cached value.
  15337. *
  15338. * @param {Object} options Additional options.
  15339. * @param {Boolean} [options.includeChangesInGraveyard=false] If set to `true`, also changes that happened
  15340. * in the graveyard root will be returned. By default, changes in the graveyard root are not returned.
  15341. * @returns {Array.<Object>} Diff between the old and the new model tree state.
  15342. */
  15343. getChanges( options = { includeChangesInGraveyard: false } ) {
  15344. // If there are cached changes, just return them instead of calculating changes again.
  15345. if ( this._cachedChanges ) {
  15346. if ( options.includeChangesInGraveyard ) {
  15347. return this._cachedChangesWithGraveyard.slice();
  15348. } else {
  15349. return this._cachedChanges.slice();
  15350. }
  15351. }
  15352. // Will contain returned results.
  15353. const diffSet = [];
  15354. // Check all changed elements.
  15355. for ( const element of this._changesInElement.keys() ) {
  15356. // Get changes for this element and sort them.
  15357. const changes = this._changesInElement.get( element ).sort( ( a, b ) => {
  15358. if ( a.offset === b.offset ) {
  15359. if ( a.type != b.type ) {
  15360. // If there are multiple changes at the same position, "remove" change should be first.
  15361. // If the order is different, for example, we would first add some nodes and then removed them
  15362. // (instead of the nodes that we should remove).
  15363. return a.type == 'remove' ? -1 : 1;
  15364. }
  15365. return 0;
  15366. }
  15367. return a.offset < b.offset ? -1 : 1;
  15368. } );
  15369. // Get children of this element before any change was applied on it.
  15370. const snapshotChildren = this._elementSnapshots.get( element );
  15371. // Get snapshot of current element's children.
  15372. const elementChildren = _getChildrenSnapshot( element.getChildren() );
  15373. // Generate actions basing on changes done on element.
  15374. const actions = _generateActionsFromChanges( snapshotChildren.length, changes );
  15375. let i = 0; // Iterator in `elementChildren` array -- iterates through current children of element.
  15376. let j = 0; // Iterator in `snapshotChildren` array -- iterates through old children of element.
  15377. // Process every action.
  15378. for ( const action of actions ) {
  15379. if ( action === 'i' ) {
  15380. // Generate diff item for this element and insert it into the diff set.
  15381. diffSet.push( this._getInsertDiff( element, i, elementChildren[ i ].name ) );
  15382. i++;
  15383. } else if ( action === 'r' ) {
  15384. // Generate diff item for this element and insert it into the diff set.
  15385. diffSet.push( this._getRemoveDiff( element, i, snapshotChildren[ j ].name ) );
  15386. j++;
  15387. } else if ( action === 'a' ) {
  15388. // Take attributes from saved and current children.
  15389. const elementAttributes = elementChildren[ i ].attributes;
  15390. const snapshotAttributes = snapshotChildren[ j ].attributes;
  15391. let range;
  15392. if ( elementChildren[ i ].name == '$text' ) {
  15393. range = new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( element, i ), _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( element, i + 1 ) );
  15394. } else {
  15395. const index = element.offsetToIndex( i );
  15396. range = new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( element, i ), _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( element.getChild( index ), 0 ) );
  15397. }
  15398. // Generate diff items for this change (there might be multiple attributes changed and
  15399. // there is a single diff for each of them) and insert them into the diff set.
  15400. diffSet.push( ...this._getAttributesDiff( range, snapshotAttributes, elementAttributes ) );
  15401. i++;
  15402. j++;
  15403. } else {
  15404. // `action` is 'equal'. Child not changed.
  15405. i++;
  15406. j++;
  15407. }
  15408. }
  15409. }
  15410. // Then, sort the changes by the position (change at position before other changes is first).
  15411. diffSet.sort( ( a, b ) => {
  15412. // If the change is in different root, we don't care much, but we'd like to have all changes in given
  15413. // root "together" in the array. So let's just sort them by the root name. It does not matter which root
  15414. // will be processed first.
  15415. if ( a.position.root != b.position.root ) {
  15416. return a.position.root.rootName < b.position.root.rootName ? -1 : 1;
  15417. }
  15418. // If change happens at the same position...
  15419. if ( a.position.isEqual( b.position ) ) {
  15420. // Keep chronological order of operations.
  15421. return a.changeCount - b.changeCount;
  15422. }
  15423. // If positions differ, position "on the left" should be earlier in the result.
  15424. return a.position.isBefore( b.position ) ? -1 : 1;
  15425. } );
  15426. // Glue together multiple changes (mostly on text nodes).
  15427. for ( let i = 1; i < diffSet.length; i++ ) {
  15428. const prevDiff = diffSet[ i - 1 ];
  15429. const thisDiff = diffSet[ i ];
  15430. // Glue remove changes if they happen on text on same position.
  15431. const isConsecutiveTextRemove =
  15432. prevDiff.type == 'remove' && thisDiff.type == 'remove' &&
  15433. prevDiff.name == '$text' && thisDiff.name == '$text' &&
  15434. prevDiff.position.isEqual( thisDiff.position );
  15435. // Glue insert changes if they happen on text on consecutive fragments.
  15436. const isConsecutiveTextAdd =
  15437. prevDiff.type == 'insert' && thisDiff.type == 'insert' &&
  15438. prevDiff.name == '$text' && thisDiff.name == '$text' &&
  15439. prevDiff.position.parent == thisDiff.position.parent &&
  15440. prevDiff.position.offset + prevDiff.length == thisDiff.position.offset;
  15441. // Glue attribute changes if they happen on consecutive fragments and have same key, old value and new value.
  15442. const isConsecutiveAttributeChange =
  15443. prevDiff.type == 'attribute' && thisDiff.type == 'attribute' &&
  15444. prevDiff.position.parent == thisDiff.position.parent &&
  15445. prevDiff.range.isFlat && thisDiff.range.isFlat &&
  15446. prevDiff.position.offset + prevDiff.length == thisDiff.position.offset &&
  15447. prevDiff.attributeKey == thisDiff.attributeKey &&
  15448. prevDiff.attributeOldValue == thisDiff.attributeOldValue &&
  15449. prevDiff.attributeNewValue == thisDiff.attributeNewValue;
  15450. if ( isConsecutiveTextRemove || isConsecutiveTextAdd || isConsecutiveAttributeChange ) {
  15451. diffSet[ i - 1 ].length++;
  15452. if ( isConsecutiveAttributeChange ) {
  15453. diffSet[ i - 1 ].range.end = diffSet[ i - 1 ].range.end.getShiftedBy( 1 );
  15454. }
  15455. diffSet.splice( i, 1 );
  15456. i--;
  15457. }
  15458. }
  15459. // Remove `changeCount` property from diff items. It is used only for sorting and is internal thing.
  15460. for ( const item of diffSet ) {
  15461. delete item.changeCount;
  15462. if ( item.type == 'attribute' ) {
  15463. delete item.position;
  15464. delete item.length;
  15465. }
  15466. }
  15467. this._changeCount = 0;
  15468. // Cache changes.
  15469. this._cachedChangesWithGraveyard = diffSet.slice();
  15470. this._cachedChanges = diffSet.slice().filter( _changesInGraveyardFilter );
  15471. if ( options.includeChangesInGraveyard ) {
  15472. return this._cachedChangesWithGraveyard;
  15473. } else {
  15474. return this._cachedChanges;
  15475. }
  15476. }
  15477. /**
  15478. * Resets `Differ`. Removes all buffered changes.
  15479. */
  15480. reset() {
  15481. this._changesInElement.clear();
  15482. this._elementSnapshots.clear();
  15483. this._changedMarkers.clear();
  15484. this._cachedChanges = null;
  15485. }
  15486. /**
  15487. * Saves and handles an insert change.
  15488. *
  15489. * @private
  15490. * @param {module:engine/model/element~Element} parent
  15491. * @param {Number} offset
  15492. * @param {Number} howMany
  15493. */
  15494. _markInsert( parent, offset, howMany ) {
  15495. const changeItem = { type: 'insert', offset, howMany, count: this._changeCount++ };
  15496. this._markChange( parent, changeItem );
  15497. }
  15498. /**
  15499. * Saves and handles a remove change.
  15500. *
  15501. * @private
  15502. * @param {module:engine/model/element~Element} parent
  15503. * @param {Number} offset
  15504. * @param {Number} howMany
  15505. */
  15506. _markRemove( parent, offset, howMany ) {
  15507. const changeItem = { type: 'remove', offset, howMany, count: this._changeCount++ };
  15508. this._markChange( parent, changeItem );
  15509. this._removeAllNestedChanges( parent, offset, howMany );
  15510. }
  15511. /**
  15512. * Saves and handles an attribute change.
  15513. *
  15514. * @private
  15515. * @param {module:engine/model/item~Item} item
  15516. */
  15517. _markAttribute( item ) {
  15518. const changeItem = { type: 'attribute', offset: item.startOffset, howMany: item.offsetSize, count: this._changeCount++ };
  15519. this._markChange( item.parent, changeItem );
  15520. }
  15521. /**
  15522. * Saves and handles a model change.
  15523. *
  15524. * @private
  15525. * @param {module:engine/model/element~Element} parent
  15526. * @param {Object} changeItem
  15527. */
  15528. _markChange( parent, changeItem ) {
  15529. // First, make a snapshot of this parent's children (it will be made only if it was not made before).
  15530. this._makeSnapshot( parent );
  15531. // Then, get all changes that already were done on the element (empty array if this is the first change).
  15532. const changes = this._getChangesForElement( parent );
  15533. // Then, look through all the changes, and transform them or the new change.
  15534. this._handleChange( changeItem, changes );
  15535. // Add the new change.
  15536. changes.push( changeItem );
  15537. // Remove incorrect changes. During transformation some change might be, for example, included in another.
  15538. // In that case, the change will have `howMany` property set to `0` or less. We need to remove those changes.
  15539. for ( let i = 0; i < changes.length; i++ ) {
  15540. if ( changes[ i ].howMany < 1 ) {
  15541. changes.splice( i, 1 );
  15542. i--;
  15543. }
  15544. }
  15545. }
  15546. /**
  15547. * Gets an array of changes that have already been saved for a given element.
  15548. *
  15549. * @private
  15550. * @param {module:engine/model/element~Element} element
  15551. * @returns {Array.<Object>}
  15552. */
  15553. _getChangesForElement( element ) {
  15554. let changes;
  15555. if ( this._changesInElement.has( element ) ) {
  15556. changes = this._changesInElement.get( element );
  15557. } else {
  15558. changes = [];
  15559. this._changesInElement.set( element, changes );
  15560. }
  15561. return changes;
  15562. }
  15563. /**
  15564. * Saves a children snapshot for a given element.
  15565. *
  15566. * @private
  15567. * @param {module:engine/model/element~Element} element
  15568. */
  15569. _makeSnapshot( element ) {
  15570. if ( !this._elementSnapshots.has( element ) ) {
  15571. this._elementSnapshots.set( element, _getChildrenSnapshot( element.getChildren() ) );
  15572. }
  15573. }
  15574. /**
  15575. * For a given newly saved change, compares it with a change already done on the element and modifies the incoming
  15576. * change and/or the old change.
  15577. *
  15578. * @private
  15579. * @param {Object} inc Incoming (new) change.
  15580. * @param {Array.<Object>} changes An array containing all the changes done on that element.
  15581. */
  15582. _handleChange( inc, changes ) {
  15583. // We need a helper variable that will store how many nodes are to be still handled for this change item.
  15584. // `nodesToHandle` (how many nodes still need to be handled) and `howMany` (how many nodes were affected)
  15585. // needs to be differentiated.
  15586. //
  15587. // This comes up when there are multiple changes that are affected by `inc` change item.
  15588. //
  15589. // For example: assume two insert changes: `{ offset: 2, howMany: 1 }` and `{ offset: 5, howMany: 1 }`.
  15590. // Assume that `inc` change is remove `{ offset: 2, howMany: 2, nodesToHandle: 2 }`.
  15591. //
  15592. // Then, we:
  15593. // - "forget" about first insert change (it is "eaten" by remove),
  15594. // - because of that, at the end we will want to remove only one node (`nodesToHandle = 1`),
  15595. // - but still we have to change offset of the second insert change from `5` to `3`!
  15596. //
  15597. // So, `howMany` does not change throughout items transformation and keeps information about how many nodes were affected,
  15598. // while `nodesToHandle` means how many nodes need to be handled after the change item is transformed by other changes.
  15599. inc.nodesToHandle = inc.howMany;
  15600. for ( const old of changes ) {
  15601. const incEnd = inc.offset + inc.howMany;
  15602. const oldEnd = old.offset + old.howMany;
  15603. if ( inc.type == 'insert' ) {
  15604. if ( old.type == 'insert' ) {
  15605. if ( inc.offset <= old.offset ) {
  15606. old.offset += inc.howMany;
  15607. } else if ( inc.offset < oldEnd ) {
  15608. old.howMany += inc.nodesToHandle;
  15609. inc.nodesToHandle = 0;
  15610. }
  15611. }
  15612. if ( old.type == 'remove' ) {
  15613. if ( inc.offset < old.offset ) {
  15614. old.offset += inc.howMany;
  15615. }
  15616. }
  15617. if ( old.type == 'attribute' ) {
  15618. if ( inc.offset <= old.offset ) {
  15619. old.offset += inc.howMany;
  15620. } else if ( inc.offset < oldEnd ) {
  15621. // This case is more complicated, because attribute change has to be split into two.
  15622. // Example (assume that uppercase and lowercase letters mean different attributes):
  15623. //
  15624. // initial state: abcxyz
  15625. // attribute change: aBCXYz
  15626. // incoming insert: aBCfooXYz
  15627. //
  15628. // Change ranges cannot intersect because each item has to be described exactly (it was either
  15629. // not changed, inserted, removed, or its attribute was changed). That's why old attribute
  15630. // change has to be split and both parts has to be handled separately from now on.
  15631. const howMany = old.howMany;
  15632. old.howMany = inc.offset - old.offset;
  15633. // Add the second part of attribute change to the beginning of processed array so it won't
  15634. // be processed again in this loop.
  15635. changes.unshift( {
  15636. type: 'attribute',
  15637. offset: incEnd,
  15638. howMany: howMany - old.howMany,
  15639. count: this._changeCount++
  15640. } );
  15641. }
  15642. }
  15643. }
  15644. if ( inc.type == 'remove' ) {
  15645. if ( old.type == 'insert' ) {
  15646. if ( incEnd <= old.offset ) {
  15647. old.offset -= inc.howMany;
  15648. } else if ( incEnd <= oldEnd ) {
  15649. if ( inc.offset < old.offset ) {
  15650. const intersectionLength = incEnd - old.offset;
  15651. old.offset = inc.offset;
  15652. old.howMany -= intersectionLength;
  15653. inc.nodesToHandle -= intersectionLength;
  15654. } else {
  15655. old.howMany -= inc.nodesToHandle;
  15656. inc.nodesToHandle = 0;
  15657. }
  15658. } else {
  15659. if ( inc.offset <= old.offset ) {
  15660. inc.nodesToHandle -= old.howMany;
  15661. old.howMany = 0;
  15662. } else if ( inc.offset < oldEnd ) {
  15663. const intersectionLength = oldEnd - inc.offset;
  15664. old.howMany -= intersectionLength;
  15665. inc.nodesToHandle -= intersectionLength;
  15666. }
  15667. }
  15668. }
  15669. if ( old.type == 'remove' ) {
  15670. if ( incEnd <= old.offset ) {
  15671. old.offset -= inc.howMany;
  15672. } else if ( inc.offset < old.offset ) {
  15673. inc.nodesToHandle += old.howMany;
  15674. old.howMany = 0;
  15675. }
  15676. }
  15677. if ( old.type == 'attribute' ) {
  15678. if ( incEnd <= old.offset ) {
  15679. old.offset -= inc.howMany;
  15680. } else if ( inc.offset < old.offset ) {
  15681. const intersectionLength = incEnd - old.offset;
  15682. old.offset = inc.offset;
  15683. old.howMany -= intersectionLength;
  15684. } else if ( inc.offset < oldEnd ) {
  15685. if ( incEnd <= oldEnd ) {
  15686. // On first sight in this case we don't need to split attribute operation into two.
  15687. // However the changes set is later converted to actions (see `_generateActionsFromChanges`).
  15688. // For that reason, no two changes may intersect.
  15689. // So we cannot have an attribute change that "contains" remove change.
  15690. // Attribute change needs to be split.
  15691. const howMany = old.howMany;
  15692. old.howMany = inc.offset - old.offset;
  15693. const howManyAfter = howMany - old.howMany - inc.nodesToHandle;
  15694. // Add the second part of attribute change to the beginning of processed array so it won't
  15695. // be processed again in this loop.
  15696. changes.unshift( {
  15697. type: 'attribute',
  15698. offset: inc.offset,
  15699. howMany: howManyAfter,
  15700. count: this._changeCount++
  15701. } );
  15702. } else {
  15703. old.howMany -= oldEnd - inc.offset;
  15704. }
  15705. }
  15706. }
  15707. }
  15708. if ( inc.type == 'attribute' ) {
  15709. // In case of attribute change, `howMany` should be kept same as `nodesToHandle`. It's not an error.
  15710. if ( old.type == 'insert' ) {
  15711. if ( inc.offset < old.offset && incEnd > old.offset ) {
  15712. if ( incEnd > oldEnd ) {
  15713. // This case is similar to a case described when incoming change was insert and old change was attribute.
  15714. // See comment above.
  15715. //
  15716. // This time incoming change is attribute. We need to split incoming change in this case too.
  15717. // However this time, the second part of the attribute change needs to be processed further
  15718. // because there might be other changes that it collides with.
  15719. const attributePart = {
  15720. type: 'attribute',
  15721. offset: oldEnd,
  15722. howMany: incEnd - oldEnd,
  15723. count: this._changeCount++
  15724. };
  15725. this._handleChange( attributePart, changes );
  15726. changes.push( attributePart );
  15727. }
  15728. inc.nodesToHandle = old.offset - inc.offset;
  15729. inc.howMany = inc.nodesToHandle;
  15730. } else if ( inc.offset >= old.offset && inc.offset < oldEnd ) {
  15731. if ( incEnd > oldEnd ) {
  15732. inc.nodesToHandle = incEnd - oldEnd;
  15733. inc.offset = oldEnd;
  15734. } else {
  15735. inc.nodesToHandle = 0;
  15736. }
  15737. }
  15738. }
  15739. if ( old.type == 'remove' ) {
  15740. // This is a case when attribute change "contains" remove change.
  15741. // The attribute change needs to be split into two because changes cannot intersect.
  15742. if ( inc.offset < old.offset && incEnd > old.offset ) {
  15743. const attributePart = {
  15744. type: 'attribute',
  15745. offset: old.offset,
  15746. howMany: incEnd - old.offset,
  15747. count: this._changeCount++
  15748. };
  15749. this._handleChange( attributePart, changes );
  15750. changes.push( attributePart );
  15751. inc.nodesToHandle = old.offset - inc.offset;
  15752. inc.howMany = inc.nodesToHandle;
  15753. }
  15754. }
  15755. if ( old.type == 'attribute' ) {
  15756. // There are only two conflicting scenarios possible here:
  15757. if ( inc.offset >= old.offset && incEnd <= oldEnd ) {
  15758. // `old` change includes `inc` change, or they are the same.
  15759. inc.nodesToHandle = 0;
  15760. inc.howMany = 0;
  15761. inc.offset = 0;
  15762. } else if ( inc.offset <= old.offset && incEnd >= oldEnd ) {
  15763. // `inc` change includes `old` change.
  15764. old.howMany = 0;
  15765. }
  15766. }
  15767. }
  15768. }
  15769. inc.howMany = inc.nodesToHandle;
  15770. delete inc.nodesToHandle;
  15771. }
  15772. /**
  15773. * Returns an object with a single insert change description.
  15774. *
  15775. * @private
  15776. * @param {module:engine/model/element~Element} parent The element in which the change happened.
  15777. * @param {Number} offset The offset at which change happened.
  15778. * @param {String} name The name of the removed element or `'$text'` for a character.
  15779. * @returns {Object} The diff item.
  15780. */
  15781. _getInsertDiff( parent, offset, name ) {
  15782. return {
  15783. type: 'insert',
  15784. position: _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( parent, offset ),
  15785. name,
  15786. length: 1,
  15787. changeCount: this._changeCount++
  15788. };
  15789. }
  15790. /**
  15791. * Returns an object with a single remove change description.
  15792. *
  15793. * @private
  15794. * @param {module:engine/model/element~Element} parent The element in which change happened.
  15795. * @param {Number} offset The offset at which change happened.
  15796. * @param {String} name The name of the removed element or `'$text'` for a character.
  15797. * @returns {Object} The diff item.
  15798. */
  15799. _getRemoveDiff( parent, offset, name ) {
  15800. return {
  15801. type: 'remove',
  15802. position: _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( parent, offset ),
  15803. name,
  15804. length: 1,
  15805. changeCount: this._changeCount++
  15806. };
  15807. }
  15808. /**
  15809. * Returns an array of objects where each one is a single attribute change description.
  15810. *
  15811. * @private
  15812. * @param {module:engine/model/range~Range} range The range where the change happened.
  15813. * @param {Map} oldAttributes A map, map iterator or compatible object that contains attributes before the change.
  15814. * @param {Map} newAttributes A map, map iterator or compatible object that contains attributes after the change.
  15815. * @returns {Array.<Object>} An array containing one or more diff items.
  15816. */
  15817. _getAttributesDiff( range, oldAttributes, newAttributes ) {
  15818. // Results holder.
  15819. const diffs = [];
  15820. // Clone new attributes as we will be performing changes on this object.
  15821. newAttributes = new Map( newAttributes );
  15822. // Look through old attributes.
  15823. for ( const [ key, oldValue ] of oldAttributes ) {
  15824. // Check what is the new value of the attribute (or if it was removed).
  15825. const newValue = newAttributes.has( key ) ? newAttributes.get( key ) : null;
  15826. // If values are different (or attribute was removed)...
  15827. if ( newValue !== oldValue ) {
  15828. // Add diff item.
  15829. diffs.push( {
  15830. type: 'attribute',
  15831. position: range.start,
  15832. range: range.clone(),
  15833. length: 1,
  15834. attributeKey: key,
  15835. attributeOldValue: oldValue,
  15836. attributeNewValue: newValue,
  15837. changeCount: this._changeCount++
  15838. } );
  15839. }
  15840. // Prevent returning two diff items for the same change.
  15841. newAttributes.delete( key );
  15842. }
  15843. // Look through new attributes that weren't handled above.
  15844. for ( const [ key, newValue ] of newAttributes ) {
  15845. // Each of them is a new attribute. Add diff item.
  15846. diffs.push( {
  15847. type: 'attribute',
  15848. position: range.start,
  15849. range: range.clone(),
  15850. length: 1,
  15851. attributeKey: key,
  15852. attributeOldValue: null,
  15853. attributeNewValue: newValue,
  15854. changeCount: this._changeCount++
  15855. } );
  15856. }
  15857. return diffs;
  15858. }
  15859. /**
  15860. * Checks whether given element or any of its parents is an element that is buffered as an inserted element.
  15861. *
  15862. * @private
  15863. * @param {module:engine/model/element~Element} element Element to check.
  15864. * @returns {Boolean}
  15865. */
  15866. _isInInsertedElement( element ) {
  15867. const parent = element.parent;
  15868. if ( !parent ) {
  15869. return false;
  15870. }
  15871. const changes = this._changesInElement.get( parent );
  15872. const offset = element.startOffset;
  15873. if ( changes ) {
  15874. for ( const change of changes ) {
  15875. if ( change.type == 'insert' && offset >= change.offset && offset < change.offset + change.howMany ) {
  15876. return true;
  15877. }
  15878. }
  15879. }
  15880. return this._isInInsertedElement( parent );
  15881. }
  15882. /**
  15883. * Removes deeply all buffered changes that are registered in elements from range specified by `parent`, `offset`
  15884. * and `howMany`.
  15885. *
  15886. * @private
  15887. * @param {module:engine/model/element~Element} parent
  15888. * @param {Number} offset
  15889. * @param {Number} howMany
  15890. */
  15891. _removeAllNestedChanges( parent, offset, howMany ) {
  15892. const range = new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( parent, offset ), _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( parent, offset + howMany ) );
  15893. for ( const item of range.getItems( { shallow: true } ) ) {
  15894. if ( item.is( 'element' ) ) {
  15895. this._elementSnapshots.delete( item );
  15896. this._changesInElement.delete( item );
  15897. this._removeAllNestedChanges( item, 0, item.maxOffset );
  15898. }
  15899. }
  15900. }
  15901. }
  15902. // Returns an array that is a copy of passed child list with the exception that text nodes are split to one or more
  15903. // objects, each representing one character and attributes set on that character.
  15904. function _getChildrenSnapshot( children ) {
  15905. const snapshot = [];
  15906. for ( const child of children ) {
  15907. if ( child.is( '$text' ) ) {
  15908. for ( let i = 0; i < child.data.length; i++ ) {
  15909. snapshot.push( {
  15910. name: '$text',
  15911. attributes: new Map( child.getAttributes() )
  15912. } );
  15913. }
  15914. } else {
  15915. snapshot.push( {
  15916. name: child.name,
  15917. attributes: new Map( child.getAttributes() )
  15918. } );
  15919. }
  15920. }
  15921. return snapshot;
  15922. }
  15923. // Generates array of actions for given changes set.
  15924. // It simulates what `diff` function does.
  15925. // Generated actions are:
  15926. // - 'e' for 'equal' - when item at that position did not change,
  15927. // - 'i' for 'insert' - when item at that position was inserted,
  15928. // - 'r' for 'remove' - when item at that position was removed,
  15929. // - 'a' for 'attribute' - when item at that position has it attributes changed.
  15930. //
  15931. // Example (assume that uppercase letters have bold attribute, compare with function code):
  15932. //
  15933. // children before: fooBAR
  15934. // children after: foxybAR
  15935. //
  15936. // changes: type: remove, offset: 1, howMany: 1
  15937. // type: insert, offset: 2, howMany: 2
  15938. // type: attribute, offset: 4, howMany: 1
  15939. //
  15940. // expected actions: equal (f), remove (o), equal (o), insert (x), insert (y), attribute (b), equal (A), equal (R)
  15941. //
  15942. // steps taken by th script:
  15943. //
  15944. // 1. change = "type: remove, offset: 1, howMany: 1"; offset = 0; oldChildrenHandled = 0
  15945. // 1.1 between this change and the beginning is one not-changed node, fill with one equal action, one old child has been handled
  15946. // 1.2 this change removes one node, add one remove action
  15947. // 1.3 change last visited `offset` to 1
  15948. // 1.4 since an old child has been removed, one more old child has been handled
  15949. // 1.5 actions at this point are: equal, remove
  15950. //
  15951. // 2. change = "type: insert, offset: 2, howMany: 2"; offset = 1; oldChildrenHandled = 2
  15952. // 2.1 between this change and previous change is one not-changed node, add equal action, another one old children has been handled
  15953. // 2.2 this change inserts two nodes, add two insert actions
  15954. // 2.3 change last visited offset to the end of the inserted range, that is 4
  15955. // 2.4 actions at this point are: equal, remove, equal, insert, insert
  15956. //
  15957. // 3. change = "type: attribute, offset: 4, howMany: 1"; offset = 4, oldChildrenHandled = 3
  15958. // 3.1 between this change and previous change are no not-changed nodes
  15959. // 3.2 this change changes one node, add one attribute action
  15960. // 3.3 change last visited `offset` to the end of change range, that is 5
  15961. // 3.4 since an old child has been changed, one more old child has been handled
  15962. // 3.5 actions at this point are: equal, remove, equal, insert, insert, attribute
  15963. //
  15964. // 4. after loop oldChildrenHandled = 4, oldChildrenLength = 6 (fooBAR is 6 characters)
  15965. // 4.1 fill up with two equal actions
  15966. //
  15967. // The result actions are: equal, remove, equal, insert, insert, attribute, equal, equal.
  15968. function _generateActionsFromChanges( oldChildrenLength, changes ) {
  15969. const actions = [];
  15970. let offset = 0;
  15971. let oldChildrenHandled = 0;
  15972. // Go through all buffered changes.
  15973. for ( const change of changes ) {
  15974. // First, fill "holes" between changes with "equal" actions.
  15975. if ( change.offset > offset ) {
  15976. for ( let i = 0; i < change.offset - offset; i++ ) {
  15977. actions.push( 'e' );
  15978. }
  15979. oldChildrenHandled += change.offset - offset;
  15980. }
  15981. // Then, fill up actions accordingly to change type.
  15982. if ( change.type == 'insert' ) {
  15983. for ( let i = 0; i < change.howMany; i++ ) {
  15984. actions.push( 'i' );
  15985. }
  15986. // The last handled offset is after inserted range.
  15987. offset = change.offset + change.howMany;
  15988. } else if ( change.type == 'remove' ) {
  15989. for ( let i = 0; i < change.howMany; i++ ) {
  15990. actions.push( 'r' );
  15991. }
  15992. // The last handled offset is at the position where the nodes were removed.
  15993. offset = change.offset;
  15994. // We removed `howMany` old nodes, update `oldChildrenHandled`.
  15995. oldChildrenHandled += change.howMany;
  15996. } else {
  15997. actions.push( ...'a'.repeat( change.howMany ).split( '' ) );
  15998. // The last handled offset is at the position after the changed range.
  15999. offset = change.offset + change.howMany;
  16000. // We changed `howMany` old nodes, update `oldChildrenHandled`.
  16001. oldChildrenHandled += change.howMany;
  16002. }
  16003. }
  16004. // Fill "equal" actions at the end of actions set. Use `oldChildrenHandled` to see how many children
  16005. // has not been changed / removed at the end of their parent.
  16006. if ( oldChildrenHandled < oldChildrenLength ) {
  16007. for ( let i = 0; i < oldChildrenLength - oldChildrenHandled - offset; i++ ) {
  16008. actions.push( 'e' );
  16009. }
  16010. }
  16011. return actions;
  16012. }
  16013. // Filter callback for Array.filter that filters out change entries that are in graveyard.
  16014. function _changesInGraveyardFilter( entry ) {
  16015. const posInGy = entry.position && entry.position.root.rootName == '$graveyard';
  16016. const rangeInGy = entry.range && entry.range.root.rootName == '$graveyard';
  16017. return !posInGy && !rangeInGy;
  16018. }
  16019. /***/ }),
  16020. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/document.js":
  16021. /*!***********************************************************************!*\
  16022. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/document.js ***!
  16023. \***********************************************************************/
  16024. /*! exports provided: default */
  16025. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16026. "use strict";
  16027. __webpack_require__.r(__webpack_exports__);
  16028. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Document; });
  16029. /* harmony import */ var _differ__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./differ */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/differ.js");
  16030. /* harmony import */ var _rootelement__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rootelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/rootelement.js");
  16031. /* harmony import */ var _history__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./history */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/history.js");
  16032. /* harmony import */ var _documentselection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./documentselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js");
  16033. /* harmony import */ var _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/collection */ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js");
  16034. /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  16035. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  16036. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  16037. /* harmony import */ var _ckeditor_ckeditor5_utils_src_unicode__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/unicode */ "./node_modules/@ckeditor/ckeditor5-utils/src/unicode.js");
  16038. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  16039. /**
  16040. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  16041. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  16042. */
  16043. /**
  16044. * @module engine/model/document
  16045. */
  16046. // @if CK_DEBUG_ENGINE // const { logDocument } = require( '../dev-utils/utils' );
  16047. const graveyardName = '$graveyard';
  16048. /**
  16049. * Data model's document. It contains the model's structure, its selection and the history of changes.
  16050. *
  16051. * Read more about working with the model in
  16052. * {@glink framework/guides/architecture/editing-engine#model introduction to the the editing engine's architecture}.
  16053. *
  16054. * Usually, the document contains just one {@link module:engine/model/document~Document#roots root element}, so
  16055. * you can retrieve it by just calling {@link module:engine/model/document~Document#getRoot} without specifying its name:
  16056. *
  16057. * model.document.getRoot(); // -> returns the main root
  16058. *
  16059. * However, the document may contain multiple roots – e.g. when the editor has multiple editable areas
  16060. * (e.g. a title and a body of a message).
  16061. *
  16062. * @mixes module:utils/emittermixin~EmitterMixin
  16063. */
  16064. class Document {
  16065. /**
  16066. * Creates an empty document instance with no {@link #roots} (other than
  16067. * the {@link #graveyard graveyard root}).
  16068. */
  16069. constructor( model ) {
  16070. /**
  16071. * The {@link module:engine/model/model~Model model} that the document is a part of.
  16072. *
  16073. * @readonly
  16074. * @type {module:engine/model/model~Model}
  16075. */
  16076. this.model = model;
  16077. /**
  16078. * The document version. It starts from `0` and every operation increases the version number. It is used to ensure that
  16079. * operations are applied on a proper document version.
  16080. *
  16081. * If the {@link module:engine/model/operation/operation~Operation#baseVersion base version} does not match the document version,
  16082. * a {@link module:utils/ckeditorerror~CKEditorError model-document-applyoperation-wrong-version} error is thrown.
  16083. *
  16084. * @type {Number}
  16085. */
  16086. this.version = 0;
  16087. /**
  16088. * The document's history.
  16089. *
  16090. * @readonly
  16091. * @type {module:engine/model/history~History}
  16092. */
  16093. this.history = new _history__WEBPACK_IMPORTED_MODULE_2__["default"]( this );
  16094. /**
  16095. * The selection in this document.
  16096. *
  16097. * @readonly
  16098. * @type {module:engine/model/documentselection~DocumentSelection}
  16099. */
  16100. this.selection = new _documentselection__WEBPACK_IMPORTED_MODULE_3__["default"]( this );
  16101. /**
  16102. * A list of roots that are owned and managed by this document. Use {@link #createRoot} and
  16103. * {@link #getRoot} to manipulate it.
  16104. *
  16105. * @readonly
  16106. * @type {module:utils/collection~Collection}
  16107. */
  16108. this.roots = new _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_4__["default"]( { idProperty: 'rootName' } );
  16109. /**
  16110. * The model differ object. Its role is to buffer changes done on the model document and then calculate a diff of those changes.
  16111. *
  16112. * @readonly
  16113. * @type {module:engine/model/differ~Differ}
  16114. */
  16115. this.differ = new _differ__WEBPACK_IMPORTED_MODULE_0__["default"]( model.markers );
  16116. /**
  16117. * Post-fixer callbacks registered to the model document.
  16118. *
  16119. * @private
  16120. * @type {Set.<Function>}
  16121. */
  16122. this._postFixers = new Set();
  16123. /**
  16124. * A boolean indicates whether the selection has changed until
  16125. *
  16126. * @private
  16127. * @type {Boolean}
  16128. */
  16129. this._hasSelectionChangedFromTheLastChangeBlock = false;
  16130. // Graveyard tree root. Document always have a graveyard root, which stores removed nodes.
  16131. this.createRoot( '$root', graveyardName );
  16132. // First, if the operation is a document operation check if it's base version is correct.
  16133. this.listenTo( model, 'applyOperation', ( evt, args ) => {
  16134. const operation = args[ 0 ];
  16135. if ( operation.isDocumentOperation && operation.baseVersion !== this.version ) {
  16136. /**
  16137. * Only operations with matching versions can be applied.
  16138. *
  16139. * @error model-document-applyoperation-wrong-version
  16140. * @param {module:engine/model/operation/operation~Operation} operation
  16141. */
  16142. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__["default"]( 'model-document-applyoperation-wrong-version', this, { operation } );
  16143. }
  16144. }, { priority: 'highest' } );
  16145. // Then, still before an operation is applied on model, buffer the change in differ.
  16146. this.listenTo( model, 'applyOperation', ( evt, args ) => {
  16147. const operation = args[ 0 ];
  16148. if ( operation.isDocumentOperation ) {
  16149. this.differ.bufferOperation( operation );
  16150. }
  16151. }, { priority: 'high' } );
  16152. // After the operation is applied, bump document's version and add the operation to the history.
  16153. this.listenTo( model, 'applyOperation', ( evt, args ) => {
  16154. const operation = args[ 0 ];
  16155. if ( operation.isDocumentOperation ) {
  16156. this.version++;
  16157. this.history.addOperation( operation );
  16158. }
  16159. }, { priority: 'low' } );
  16160. // Listen to selection changes. If selection changed, mark it.
  16161. this.listenTo( this.selection, 'change', () => {
  16162. this._hasSelectionChangedFromTheLastChangeBlock = true;
  16163. } );
  16164. // Buffer marker changes.
  16165. // This is not covered in buffering operations because markers may change outside of them (when they
  16166. // are modified using `model.markers` collection, not through `MarkerOperation`).
  16167. this.listenTo( model.markers, 'update', ( evt, marker, oldRange, newRange ) => {
  16168. // Whenever marker is updated, buffer that change.
  16169. this.differ.bufferMarkerChange( marker.name, oldRange, newRange, marker.affectsData );
  16170. if ( oldRange === null ) {
  16171. // If this is a new marker, add a listener that will buffer change whenever marker changes.
  16172. marker.on( 'change', ( evt, oldRange ) => {
  16173. this.differ.bufferMarkerChange( marker.name, oldRange, marker.getRange(), marker.affectsData );
  16174. } );
  16175. }
  16176. } );
  16177. }
  16178. /**
  16179. * The graveyard tree root. A document always has a graveyard root that stores removed nodes.
  16180. *
  16181. * @readonly
  16182. * @member {module:engine/model/rootelement~RootElement}
  16183. */
  16184. get graveyard() {
  16185. return this.getRoot( graveyardName );
  16186. }
  16187. /**
  16188. * Creates a new root.
  16189. *
  16190. * @param {String} [elementName='$root'] The element name. Defaults to `'$root'` which also has some basic schema defined
  16191. * (`$block`s are allowed inside the `$root`). Make sure to define a proper schema if you use a different name.
  16192. * @param {String} [rootName='main'] A unique root name.
  16193. * @returns {module:engine/model/rootelement~RootElement} The created root.
  16194. */
  16195. createRoot( elementName = '$root', rootName = 'main' ) {
  16196. if ( this.roots.get( rootName ) ) {
  16197. /**
  16198. * A root with the specified name already exists.
  16199. *
  16200. * @error model-document-createroot-name-exists
  16201. * @param {module:engine/model/document~Document} doc
  16202. * @param {String} name
  16203. */
  16204. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__["default"]( 'model-document-createroot-name-exists', this, { name: rootName } );
  16205. }
  16206. const root = new _rootelement__WEBPACK_IMPORTED_MODULE_1__["default"]( this, elementName, rootName );
  16207. this.roots.add( root );
  16208. return root;
  16209. }
  16210. /**
  16211. * Removes all event listeners set by the document instance.
  16212. */
  16213. destroy() {
  16214. this.selection.destroy();
  16215. this.stopListening();
  16216. }
  16217. /**
  16218. * Returns a root by its name.
  16219. *
  16220. * @param {String} [name='main'] A unique root name.
  16221. * @returns {module:engine/model/rootelement~RootElement|null} The root registered under a given name or `null` when
  16222. * there is no root with the given name.
  16223. */
  16224. getRoot( name = 'main' ) {
  16225. return this.roots.get( name );
  16226. }
  16227. /**
  16228. * Returns an array with names of all roots (without the {@link #graveyard}) added to the document.
  16229. *
  16230. * @returns {Array.<String>} Roots names.
  16231. */
  16232. getRootNames() {
  16233. return Array.from( this.roots, root => root.rootName ).filter( name => name != graveyardName );
  16234. }
  16235. /**
  16236. * Used to register a post-fixer callback. A post-fixer mechanism guarantees that the features
  16237. * will operate on a correct model state.
  16238. *
  16239. * An execution of a feature may lead to an incorrect document tree state. The callbacks are used to fix the document tree after
  16240. * it has changed. Post-fixers are fired just after all changes from the outermost change block were applied but
  16241. * before the {@link module:engine/model/document~Document#event:change change event} is fired. If a post-fixer callback made
  16242. * a change, it should return `true`. When this happens, all post-fixers are fired again to check if something else should
  16243. * not be fixed in the new document tree state.
  16244. *
  16245. * As a parameter, a post-fixer callback receives a {@link module:engine/model/writer~Writer writer} instance connected with the
  16246. * executed changes block. Thanks to that, all changes done by the callback will be added to the same
  16247. * {@link module:engine/model/batch~Batch batch} (and undo step) as the original changes. This makes post-fixer changes transparent
  16248. * for the user.
  16249. *
  16250. * An example of a post-fixer is a callback that checks if all the data were removed from the editor. If so, the
  16251. * callback should add an empty paragraph so that the editor is never empty:
  16252. *
  16253. * document.registerPostFixer( writer => {
  16254. * const changes = document.differ.getChanges();
  16255. *
  16256. * // Check if the changes lead to an empty root in the editor.
  16257. * for ( const entry of changes ) {
  16258. * if ( entry.type == 'remove' && entry.position.root.isEmpty ) {
  16259. * writer.insertElement( 'paragraph', entry.position.root, 0 );
  16260. *
  16261. * // It is fine to return early, even if multiple roots would need to be fixed.
  16262. * // All post-fixers will be fired again, so if there are more empty roots, those will be fixed, too.
  16263. * return true;
  16264. * }
  16265. * }
  16266. * } );
  16267. *
  16268. * @param {Function} postFixer
  16269. */
  16270. registerPostFixer( postFixer ) {
  16271. this._postFixers.add( postFixer );
  16272. }
  16273. /**
  16274. * A custom `toJSON()` method to solve child-parent circular dependencies.
  16275. *
  16276. * @returns {Object} A clone of this object with the document property changed to a string.
  16277. */
  16278. toJSON() {
  16279. const json = Object(lodash_es__WEBPACK_IMPORTED_MODULE_9__["clone"])( this );
  16280. // Due to circular references we need to remove parent reference.
  16281. json.selection = '[engine.model.DocumentSelection]';
  16282. json.model = '[engine.model.Model]';
  16283. return json;
  16284. }
  16285. /**
  16286. * Check if there were any changes done on document, and if so, call post-fixers,
  16287. * fire `change` event for features and conversion and then reset the differ.
  16288. * Fire `change:data` event when at least one operation or buffered marker changes the data.
  16289. *
  16290. * @protected
  16291. * @fires change
  16292. * @fires change:data
  16293. * @param {module:engine/model/writer~Writer} writer The writer on which post-fixers will be called.
  16294. */
  16295. _handleChangeBlock( writer ) {
  16296. if ( this._hasDocumentChangedFromTheLastChangeBlock() ) {
  16297. this._callPostFixers( writer );
  16298. // Refresh selection attributes according to the final position in the model after the change.
  16299. this.selection.refresh();
  16300. if ( this.differ.hasDataChanges() ) {
  16301. this.fire( 'change:data', writer.batch );
  16302. } else {
  16303. this.fire( 'change', writer.batch );
  16304. }
  16305. // Theoretically, it is not necessary to refresh selection after change event because
  16306. // post-fixers are the last who should change the model, but just in case...
  16307. this.selection.refresh();
  16308. this.differ.reset();
  16309. }
  16310. this._hasSelectionChangedFromTheLastChangeBlock = false;
  16311. }
  16312. /**
  16313. * Returns whether there is a buffered change or if the selection has changed from the last
  16314. * {@link module:engine/model/model~Model#enqueueChange `enqueueChange()` block}
  16315. * or {@link module:engine/model/model~Model#change `change()` block}.
  16316. *
  16317. * @protected
  16318. * @returns {Boolean} Returns `true` if document has changed from the last `change()` or `enqueueChange()` block.
  16319. */
  16320. _hasDocumentChangedFromTheLastChangeBlock() {
  16321. return !this.differ.isEmpty || this._hasSelectionChangedFromTheLastChangeBlock;
  16322. }
  16323. /**
  16324. * Returns the default root for this document which is either the first root that was added to the document using
  16325. * {@link #createRoot} or the {@link #graveyard graveyard root} if no other roots were created.
  16326. *
  16327. * @protected
  16328. * @returns {module:engine/model/rootelement~RootElement} The default root for this document.
  16329. */
  16330. _getDefaultRoot() {
  16331. for ( const root of this.roots ) {
  16332. if ( root !== this.graveyard ) {
  16333. return root;
  16334. }
  16335. }
  16336. return this.graveyard;
  16337. }
  16338. /**
  16339. * Returns the default range for this selection. The default range is a collapsed range that starts and ends
  16340. * at the beginning of this selection's document {@link #_getDefaultRoot default root}.
  16341. *
  16342. * @protected
  16343. * @returns {module:engine/model/range~Range}
  16344. */
  16345. _getDefaultRange() {
  16346. const defaultRoot = this._getDefaultRoot();
  16347. const model = this.model;
  16348. const schema = model.schema;
  16349. // Find the first position where the selection can be put.
  16350. const position = model.createPositionFromPath( defaultRoot, [ 0 ] );
  16351. const nearestRange = schema.getNearestSelectionRange( position );
  16352. // If valid selection range is not found - return range collapsed at the beginning of the root.
  16353. return nearestRange || model.createRange( position );
  16354. }
  16355. /**
  16356. * Checks whether a given {@link module:engine/model/range~Range range} is a valid range for
  16357. * the {@link #selection document's selection}.
  16358. *
  16359. * @private
  16360. * @param {module:engine/model/range~Range} range A range to check.
  16361. * @returns {Boolean} `true` if `range` is valid, `false` otherwise.
  16362. */
  16363. _validateSelectionRange( range ) {
  16364. return validateTextNodePosition( range.start ) && validateTextNodePosition( range.end );
  16365. }
  16366. /**
  16367. * Performs post-fixer loops. Executes post-fixer callbacks as long as none of them has done any changes to the model.
  16368. *
  16369. * @private
  16370. * @param {module:engine/model/writer~Writer} writer The writer on which post-fixer callbacks will be called.
  16371. */
  16372. _callPostFixers( writer ) {
  16373. let wasFixed = false;
  16374. do {
  16375. for ( const callback of this._postFixers ) {
  16376. // Ensure selection attributes are up to date before each post-fixer.
  16377. // https://github.com/ckeditor/ckeditor5-engine/issues/1673.
  16378. //
  16379. // It might be good to refresh the selection after each operation but at the moment it leads
  16380. // to losing attributes for composition or and spell checking
  16381. // https://github.com/ckeditor/ckeditor5-typing/issues/188
  16382. this.selection.refresh();
  16383. wasFixed = callback( writer );
  16384. if ( wasFixed ) {
  16385. break;
  16386. }
  16387. }
  16388. } while ( wasFixed );
  16389. }
  16390. /**
  16391. * Fired after each {@link module:engine/model/model~Model#enqueueChange `enqueueChange()` block} or the outermost
  16392. * {@link module:engine/model/model~Model#change `change()` block} was executed and the document was changed
  16393. * during that block's execution.
  16394. *
  16395. * The changes which this event will cover include:
  16396. *
  16397. * * document structure changes,
  16398. * * selection changes,
  16399. * * marker changes.
  16400. *
  16401. * If you want to be notified about all these changes, then simply listen to this event like this:
  16402. *
  16403. * model.document.on( 'change', () => {
  16404. * console.log( 'The document has changed!' );
  16405. * } );
  16406. *
  16407. * If, however, you only want to be notified about the data changes, then use the
  16408. * {@link module:engine/model/document~Document#event:change:data change:data} event,
  16409. * which is fired for document structure changes and marker changes (which affects the data).
  16410. *
  16411. * model.document.on( 'change:data', () => {
  16412. * console.log( 'The data has changed!' );
  16413. * } );
  16414. *
  16415. * @event change
  16416. * @param {module:engine/model/batch~Batch} batch The batch that was used in the executed changes block.
  16417. */
  16418. /**
  16419. * It is a narrower version of the {@link #event:change} event. It is fired for changes which
  16420. * affect the editor data. This is:
  16421. *
  16422. * * document structure changes,
  16423. * * marker changes (which affects the data).
  16424. *
  16425. * If you want to be notified about the data changes, then listen to this event:
  16426. *
  16427. * model.document.on( 'change:data', () => {
  16428. * console.log( 'The data has changed!' );
  16429. * } );
  16430. *
  16431. * If you would like to listen to all document changes, then check out the
  16432. * {@link module:engine/model/document~Document#event:change change} event.
  16433. *
  16434. * @event change:data
  16435. * @param {module:engine/model/batch~Batch} batch The batch that was used in the executed changes block.
  16436. */
  16437. // @if CK_DEBUG_ENGINE // log( version = null ) {
  16438. // @if CK_DEBUG_ENGINE // version = version === null ? this.version : version;
  16439. // @if CK_DEBUG_ENGINE // logDocument( this, version );
  16440. // @if CK_DEBUG_ENGINE // }
  16441. }
  16442. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_7__["default"])( Document, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_5__["default"] );
  16443. // Checks whether given range boundary position is valid for document selection, meaning that is not between
  16444. // unicode surrogate pairs or base character and combining marks.
  16445. function validateTextNodePosition( rangeBoundary ) {
  16446. const textNode = rangeBoundary.textNode;
  16447. if ( textNode ) {
  16448. const data = textNode.data;
  16449. const offset = rangeBoundary.offset - textNode.startOffset;
  16450. return !Object(_ckeditor_ckeditor5_utils_src_unicode__WEBPACK_IMPORTED_MODULE_8__["isInsideSurrogatePair"])( data, offset ) && !Object(_ckeditor_ckeditor5_utils_src_unicode__WEBPACK_IMPORTED_MODULE_8__["isInsideCombinedSymbol"])( data, offset );
  16451. }
  16452. return true;
  16453. }
  16454. /***/ }),
  16455. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentfragment.js":
  16456. /*!*******************************************************************************!*\
  16457. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/documentfragment.js ***!
  16458. \*******************************************************************************/
  16459. /*! exports provided: default */
  16460. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16461. "use strict";
  16462. __webpack_require__.r(__webpack_exports__);
  16463. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DocumentFragment; });
  16464. /* harmony import */ var _nodelist__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./nodelist */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/nodelist.js");
  16465. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
  16466. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js");
  16467. /* harmony import */ var _textproxy__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.js");
  16468. /* harmony import */ var _ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
  16469. /**
  16470. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  16471. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  16472. */
  16473. /**
  16474. * @module module:engine/model/documentfragment
  16475. */
  16476. // @if CK_DEBUG_ENGINE // const { stringifyMap } = require( '../dev-utils/utils' );
  16477. /**
  16478. * DocumentFragment represents a part of model which does not have a common root but it's top-level nodes
  16479. * can be seen as siblings. In other words, it is a detached part of model tree, without a root.
  16480. *
  16481. * DocumentFragment has own {@link module:engine/model/markercollection~MarkerCollection}. Markers from this collection
  16482. * will be set to the {@link module:engine/model/model~Model#markers model markers} by a
  16483. * {@link module:engine/model/writer~Writer#insert} function.
  16484. */
  16485. class DocumentFragment {
  16486. /**
  16487. * Creates an empty `DocumentFragment`.
  16488. *
  16489. * **Note:** Constructor of this class shouldn't be used directly in the code.
  16490. * Use the {@link module:engine/model/writer~Writer#createDocumentFragment} method instead.
  16491. *
  16492. * @protected
  16493. * @param {module:engine/model/node~Node|Iterable.<module:engine/model/node~Node>} [children]
  16494. * Nodes to be contained inside the `DocumentFragment`.
  16495. */
  16496. constructor( children ) {
  16497. /**
  16498. * DocumentFragment static markers map. This is a list of names and {@link module:engine/model/range~Range ranges}
  16499. * which will be set as Markers to {@link module:engine/model/model~Model#markers model markers collection}
  16500. * when DocumentFragment will be inserted to the document.
  16501. *
  16502. * @readonly
  16503. * @member {Map<String,module:engine/model/range~Range>} module:engine/model/documentfragment~DocumentFragment#markers
  16504. */
  16505. this.markers = new Map();
  16506. /**
  16507. * List of nodes contained inside the document fragment.
  16508. *
  16509. * @private
  16510. * @member {module:engine/model/nodelist~NodeList} module:engine/model/documentfragment~DocumentFragment#_children
  16511. */
  16512. this._children = new _nodelist__WEBPACK_IMPORTED_MODULE_0__["default"]();
  16513. if ( children ) {
  16514. this._insertChild( 0, children );
  16515. }
  16516. }
  16517. /**
  16518. * Returns an iterator that iterates over all nodes contained inside this document fragment.
  16519. *
  16520. * @returns {Iterable.<module:engine/model/node~Node>}
  16521. */
  16522. [ Symbol.iterator ]() {
  16523. return this.getChildren();
  16524. }
  16525. /**
  16526. * Number of this document fragment's children.
  16527. *
  16528. * @readonly
  16529. * @type {Number}
  16530. */
  16531. get childCount() {
  16532. return this._children.length;
  16533. }
  16534. /**
  16535. * Sum of {@link module:engine/model/node~Node#offsetSize offset sizes} of all of this document fragment's children.
  16536. *
  16537. * @readonly
  16538. * @type {Number}
  16539. */
  16540. get maxOffset() {
  16541. return this._children.maxOffset;
  16542. }
  16543. /**
  16544. * Is `true` if there are no nodes inside this document fragment, `false` otherwise.
  16545. *
  16546. * @readonly
  16547. * @type {Boolean}
  16548. */
  16549. get isEmpty() {
  16550. return this.childCount === 0;
  16551. }
  16552. /**
  16553. * Artificial root of `DocumentFragment`. Returns itself. Added for compatibility reasons.
  16554. *
  16555. * @readonly
  16556. * @type {module:engine/model/documentfragment~DocumentFragment}
  16557. */
  16558. get root() {
  16559. return this;
  16560. }
  16561. /**
  16562. * Artificial parent of `DocumentFragment`. Returns `null`. Added for compatibility reasons.
  16563. *
  16564. * @readonly
  16565. * @type {null}
  16566. */
  16567. get parent() {
  16568. return null;
  16569. }
  16570. /**
  16571. * Checks whether this object is of the given type.
  16572. *
  16573. * docFrag.is( 'documentFragment' ); // -> true
  16574. * docFrag.is( 'model:documentFragment' ); // -> true
  16575. *
  16576. * docFrag.is( 'view:documentFragment' ); // -> false
  16577. * docFrag.is( 'element' ); // -> false
  16578. * docFrag.is( 'node' ); // -> false
  16579. *
  16580. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  16581. *
  16582. * @param {String} type
  16583. * @returns {Boolean}
  16584. */
  16585. is( type ) {
  16586. return type === 'documentFragment' || type === 'model:documentFragment';
  16587. }
  16588. /**
  16589. * Gets the child at the given index. Returns `null` if incorrect index was passed.
  16590. *
  16591. * @param {Number} index Index of child.
  16592. * @returns {module:engine/model/node~Node|null} Child node.
  16593. */
  16594. getChild( index ) {
  16595. return this._children.getNode( index );
  16596. }
  16597. /**
  16598. * Returns an iterator that iterates over all of this document fragment's children.
  16599. *
  16600. * @returns {Iterable.<module:engine/model/node~Node>}
  16601. */
  16602. getChildren() {
  16603. return this._children[ Symbol.iterator ]();
  16604. }
  16605. /**
  16606. * Returns an index of the given child node. Returns `null` if given node is not a child of this document fragment.
  16607. *
  16608. * @param {module:engine/model/node~Node} node Child node to look for.
  16609. * @returns {Number|null} Child node's index.
  16610. */
  16611. getChildIndex( node ) {
  16612. return this._children.getNodeIndex( node );
  16613. }
  16614. /**
  16615. * Returns the starting offset of given child. Starting offset is equal to the sum of
  16616. * {@link module:engine/model/node~Node#offsetSize offset sizes} of all node's siblings that are before it. Returns `null` if
  16617. * given node is not a child of this document fragment.
  16618. *
  16619. * @param {module:engine/model/node~Node} node Child node to look for.
  16620. * @returns {Number|null} Child node's starting offset.
  16621. */
  16622. getChildStartOffset( node ) {
  16623. return this._children.getNodeStartOffset( node );
  16624. }
  16625. /**
  16626. * Returns path to a `DocumentFragment`, which is an empty array. Added for compatibility reasons.
  16627. *
  16628. * @returns {Array}
  16629. */
  16630. getPath() {
  16631. return [];
  16632. }
  16633. /**
  16634. * Returns a descendant node by its path relative to this element.
  16635. *
  16636. * // <this>a<b>c</b></this>
  16637. * this.getNodeByPath( [ 0 ] ); // -> "a"
  16638. * this.getNodeByPath( [ 1 ] ); // -> <b>
  16639. * this.getNodeByPath( [ 1, 0 ] ); // -> "c"
  16640. *
  16641. * @param {Array.<Number>} relativePath Path of the node to find, relative to this element.
  16642. * @returns {module:engine/model/node~Node|module:engine/model/documentfragment~DocumentFragment}
  16643. */
  16644. getNodeByPath( relativePath ) {
  16645. let node = this; // eslint-disable-line consistent-this
  16646. for ( const index of relativePath ) {
  16647. node = node.getChild( node.offsetToIndex( index ) );
  16648. }
  16649. return node;
  16650. }
  16651. /**
  16652. * Converts offset "position" to index "position".
  16653. *
  16654. * Returns index of a node that occupies given offset. If given offset is too low, returns `0`. If given offset is
  16655. * too high, returns index after last child}.
  16656. *
  16657. * const textNode = new Text( 'foo' );
  16658. * const pElement = new Element( 'p' );
  16659. * const docFrag = new DocumentFragment( [ textNode, pElement ] );
  16660. * docFrag.offsetToIndex( -1 ); // Returns 0, because offset is too low.
  16661. * docFrag.offsetToIndex( 0 ); // Returns 0, because offset 0 is taken by `textNode` which is at index 0.
  16662. * docFrag.offsetToIndex( 1 ); // Returns 0, because `textNode` has `offsetSize` equal to 3, so it occupies offset 1 too.
  16663. * docFrag.offsetToIndex( 2 ); // Returns 0.
  16664. * docFrag.offsetToIndex( 3 ); // Returns 1.
  16665. * docFrag.offsetToIndex( 4 ); // Returns 2. There are no nodes at offset 4, so last available index is returned.
  16666. *
  16667. * @param {Number} offset Offset to look for.
  16668. * @returns {Number} Index of a node that occupies given offset.
  16669. */
  16670. offsetToIndex( offset ) {
  16671. return this._children.offsetToIndex( offset );
  16672. }
  16673. /**
  16674. * Converts `DocumentFragment` instance to plain object and returns it.
  16675. * Takes care of converting all of this document fragment's children.
  16676. *
  16677. * @returns {Object} `DocumentFragment` instance converted to plain object.
  16678. */
  16679. toJSON() {
  16680. const json = [];
  16681. for ( const node of this._children ) {
  16682. json.push( node.toJSON() );
  16683. }
  16684. return json;
  16685. }
  16686. /**
  16687. * Creates a `DocumentFragment` instance from given plain object (i.e. parsed JSON string).
  16688. * Converts `DocumentFragment` children to proper nodes.
  16689. *
  16690. * @param {Object} json Plain object to be converted to `DocumentFragment`.
  16691. * @returns {module:engine/model/documentfragment~DocumentFragment} `DocumentFragment` instance created using given plain object.
  16692. */
  16693. static fromJSON( json ) {
  16694. const children = [];
  16695. for ( const child of json ) {
  16696. if ( child.name ) {
  16697. // If child has name property, it is an Element.
  16698. children.push( _element__WEBPACK_IMPORTED_MODULE_1__["default"].fromJSON( child ) );
  16699. } else {
  16700. // Otherwise, it is a Text node.
  16701. children.push( _text__WEBPACK_IMPORTED_MODULE_2__["default"].fromJSON( child ) );
  16702. }
  16703. }
  16704. return new DocumentFragment( children );
  16705. }
  16706. /**
  16707. * {@link #_insertChild Inserts} one or more nodes at the end of this document fragment.
  16708. *
  16709. * @protected
  16710. * @param {module:engine/model/item~Item|Iterable.<module:engine/model/item~Item>} items Items to be inserted.
  16711. */
  16712. _appendChild( items ) {
  16713. this._insertChild( this.childCount, items );
  16714. }
  16715. /**
  16716. * Inserts one or more nodes at the given index and sets {@link module:engine/model/node~Node#parent parent} of these nodes
  16717. * to this document fragment.
  16718. *
  16719. * @protected
  16720. * @param {Number} index Index at which nodes should be inserted.
  16721. * @param {module:engine/model/item~Item|Iterable.<module:engine/model/item~Item>} items Items to be inserted.
  16722. */
  16723. _insertChild( index, items ) {
  16724. const nodes = normalize( items );
  16725. for ( const node of nodes ) {
  16726. // If node that is being added to this element is already inside another element, first remove it from the old parent.
  16727. if ( node.parent !== null ) {
  16728. node._remove();
  16729. }
  16730. node.parent = this;
  16731. }
  16732. this._children._insertNodes( index, nodes );
  16733. }
  16734. /**
  16735. * Removes one or more nodes starting at the given index
  16736. * and sets {@link module:engine/model/node~Node#parent parent} of these nodes to `null`.
  16737. *
  16738. * @protected
  16739. * @param {Number} index Index of the first node to remove.
  16740. * @param {Number} [howMany=1] Number of nodes to remove.
  16741. * @returns {Array.<module:engine/model/node~Node>} Array containing removed nodes.
  16742. */
  16743. _removeChildren( index, howMany = 1 ) {
  16744. const nodes = this._children._removeNodes( index, howMany );
  16745. for ( const node of nodes ) {
  16746. node.parent = null;
  16747. }
  16748. return nodes;
  16749. }
  16750. // @if CK_DEBUG_ENGINE // toString() {
  16751. // @if CK_DEBUG_ENGINE // return 'documentFragment';
  16752. // @if CK_DEBUG_ENGINE // }
  16753. // @if CK_DEBUG_ENGINE // log() {
  16754. // @if CK_DEBUG_ENGINE // console.log( 'ModelDocumentFragment: ' + this );
  16755. // @if CK_DEBUG_ENGINE // }
  16756. // @if CK_DEBUG_ENGINE // printTree() {
  16757. // @if CK_DEBUG_ENGINE // let string = 'ModelDocumentFragment: [';
  16758. // @if CK_DEBUG_ENGINE // for ( const child of this.getChildren() ) {
  16759. // @if CK_DEBUG_ENGINE // string += '\n';
  16760. // @if CK_DEBUG_ENGINE // if ( child.is( '$text' ) ) {
  16761. // @if CK_DEBUG_ENGINE // const textAttrs = stringifyMap( child._attrs );
  16762. // @if CK_DEBUG_ENGINE // string += '\t'.repeat( 1 );
  16763. // @if CK_DEBUG_ENGINE // if ( textAttrs !== '' ) {
  16764. // @if CK_DEBUG_ENGINE // string += `<$text${ textAttrs }>` + child.data + '</$text>';
  16765. // @if CK_DEBUG_ENGINE // } else {
  16766. // @if CK_DEBUG_ENGINE // string += child.data;
  16767. // @if CK_DEBUG_ENGINE // }
  16768. // @if CK_DEBUG_ENGINE // } else {
  16769. // @if CK_DEBUG_ENGINE // string += child.printTree( 1 );
  16770. // @if CK_DEBUG_ENGINE // }
  16771. // @if CK_DEBUG_ENGINE // }
  16772. // @if CK_DEBUG_ENGINE // string += '\n]';
  16773. // @if CK_DEBUG_ENGINE // return string;
  16774. // @if CK_DEBUG_ENGINE // }
  16775. // @if CK_DEBUG_ENGINE // logTree() {
  16776. // @if CK_DEBUG_ENGINE // console.log( this.printTree() );
  16777. // @if CK_DEBUG_ENGINE // }
  16778. }
  16779. // Converts strings to Text and non-iterables to arrays.
  16780. //
  16781. // @param {String|module:engine/model/item~Item|Iterable.<module:engine/model/item~Item>}
  16782. // @returns {Iterable.<module:engine/model/node~Node>}
  16783. function normalize( nodes ) {
  16784. // Separate condition because string is iterable.
  16785. if ( typeof nodes == 'string' ) {
  16786. return [ new _text__WEBPACK_IMPORTED_MODULE_2__["default"]( nodes ) ];
  16787. }
  16788. if ( !Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_4__["default"])( nodes ) ) {
  16789. nodes = [ nodes ];
  16790. }
  16791. // Array.from to enable .map() on non-arrays.
  16792. return Array.from( nodes )
  16793. .map( node => {
  16794. if ( typeof node == 'string' ) {
  16795. return new _text__WEBPACK_IMPORTED_MODULE_2__["default"]( node );
  16796. }
  16797. if ( node instanceof _textproxy__WEBPACK_IMPORTED_MODULE_3__["default"] ) {
  16798. return new _text__WEBPACK_IMPORTED_MODULE_2__["default"]( node.data, node.getAttributes() );
  16799. }
  16800. return node;
  16801. } );
  16802. }
  16803. /***/ }),
  16804. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js":
  16805. /*!********************************************************************************!*\
  16806. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js ***!
  16807. \********************************************************************************/
  16808. /*! exports provided: default */
  16809. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16810. "use strict";
  16811. __webpack_require__.r(__webpack_exports__);
  16812. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DocumentSelection; });
  16813. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  16814. /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  16815. /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/selection.js");
  16816. /* harmony import */ var _liverange__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./liverange */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/liverange.js");
  16817. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js");
  16818. /* harmony import */ var _textproxy__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.js");
  16819. /* harmony import */ var _ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/tomap */ "./node_modules/@ckeditor/ckeditor5-utils/src/tomap.js");
  16820. /* harmony import */ var _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/collection */ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js");
  16821. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  16822. /* harmony import */ var _ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/uid */ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js");
  16823. /**
  16824. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  16825. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  16826. */
  16827. /**
  16828. * @module engine/model/documentselection
  16829. */
  16830. const storePrefix = 'selection:';
  16831. /**
  16832. * `DocumentSelection` is a special selection which is used as the
  16833. * {@link module:engine/model/document~Document#selection document's selection}.
  16834. * There can be only one instance of `DocumentSelection` per document.
  16835. *
  16836. * Document selection can only be changed by using the {@link module:engine/model/writer~Writer} instance
  16837. * inside the {@link module:engine/model/model~Model#change `change()`} block, as it provides a secure way to modify model.
  16838. *
  16839. * `DocumentSelection` is automatically updated upon changes in the {@link module:engine/model/document~Document document}
  16840. * to always contain valid ranges. Its attributes are inherited from the text unless set explicitly.
  16841. *
  16842. * Differences between {@link module:engine/model/selection~Selection} and `DocumentSelection` are:
  16843. * * there is always a range in `DocumentSelection` - even if no ranges were added there is a "default range"
  16844. * present in the selection,
  16845. * * ranges added to this selection updates automatically when the document changes,
  16846. * * attributes of `DocumentSelection` are updated automatically according to selection ranges.
  16847. *
  16848. * Since `DocumentSelection` uses {@link module:engine/model/liverange~LiveRange live ranges}
  16849. * and is updated when {@link module:engine/model/document~Document document}
  16850. * changes, it cannot be set on {@link module:engine/model/node~Node nodes}
  16851. * that are inside {@link module:engine/model/documentfragment~DocumentFragment document fragment}.
  16852. * If you need to represent a selection in document fragment,
  16853. * use {@link module:engine/model/selection~Selection Selection class} instead.
  16854. *
  16855. * @mixes module:utils/emittermixin~EmitterMixin
  16856. */
  16857. class DocumentSelection {
  16858. /**
  16859. * Creates an empty live selection for given {@link module:engine/model/document~Document}.
  16860. *
  16861. * @param {module:engine/model/document~Document} doc Document which owns this selection.
  16862. */
  16863. constructor( doc ) {
  16864. /**
  16865. * Selection used internally by that class (`DocumentSelection` is a proxy to that selection).
  16866. *
  16867. * @protected
  16868. */
  16869. this._selection = new LiveSelection( doc );
  16870. this._selection.delegate( 'change:range' ).to( this );
  16871. this._selection.delegate( 'change:attribute' ).to( this );
  16872. this._selection.delegate( 'change:marker' ).to( this );
  16873. }
  16874. /**
  16875. * Returns whether the selection is collapsed. Selection is collapsed when there is exactly one range which is
  16876. * collapsed.
  16877. *
  16878. * @readonly
  16879. * @type {Boolean}
  16880. */
  16881. get isCollapsed() {
  16882. return this._selection.isCollapsed;
  16883. }
  16884. /**
  16885. * Selection anchor. Anchor may be described as a position where the most recent part of the selection starts.
  16886. * Together with {@link #focus} they define the direction of selection, which is important
  16887. * when expanding/shrinking selection. Anchor is always {@link module:engine/model/range~Range#start start} or
  16888. * {@link module:engine/model/range~Range#end end} position of the most recently added range.
  16889. *
  16890. * Is set to `null` if there are no ranges in selection.
  16891. *
  16892. * @see #focus
  16893. * @readonly
  16894. * @type {module:engine/model/position~Position|null}
  16895. */
  16896. get anchor() {
  16897. return this._selection.anchor;
  16898. }
  16899. /**
  16900. * Selection focus. Focus is a position where the selection ends.
  16901. *
  16902. * Is set to `null` if there are no ranges in selection.
  16903. *
  16904. * @see #anchor
  16905. * @readonly
  16906. * @type {module:engine/model/position~Position|null}
  16907. */
  16908. get focus() {
  16909. return this._selection.focus;
  16910. }
  16911. /**
  16912. * Returns number of ranges in selection.
  16913. *
  16914. * @readonly
  16915. * @type {Number}
  16916. */
  16917. get rangeCount() {
  16918. return this._selection.rangeCount;
  16919. }
  16920. /**
  16921. * Describes whether `Documentselection` has own range(s) set, or if it is defaulted to
  16922. * {@link module:engine/model/document~Document#_getDefaultRange document's default range}.
  16923. *
  16924. * @readonly
  16925. * @type {Boolean}
  16926. */
  16927. get hasOwnRange() {
  16928. return this._selection.hasOwnRange;
  16929. }
  16930. /**
  16931. * Specifies whether the {@link #focus}
  16932. * precedes {@link #anchor}.
  16933. *
  16934. * @readonly
  16935. * @type {Boolean}
  16936. */
  16937. get isBackward() {
  16938. return this._selection.isBackward;
  16939. }
  16940. /**
  16941. * Describes whether the gravity is overridden (using {@link module:engine/model/writer~Writer#overrideSelectionGravity}) or not.
  16942. *
  16943. * Note that the gravity remains overridden as long as will not be restored the same number of times as it was overridden.
  16944. *
  16945. * @readonly
  16946. * @returns {Boolean}
  16947. */
  16948. get isGravityOverridden() {
  16949. return this._selection.isGravityOverridden;
  16950. }
  16951. /**
  16952. * A collection of selection markers.
  16953. * Marker is a selection marker when selection range is inside the marker range.
  16954. *
  16955. * @readonly
  16956. * @type {module:utils/collection~Collection.<module:engine/model/markercollection~Marker>}
  16957. */
  16958. get markers() {
  16959. return this._selection.markers;
  16960. }
  16961. /**
  16962. * Used for the compatibility with the {@link module:engine/model/selection~Selection#isEqual} method.
  16963. *
  16964. * @protected
  16965. */
  16966. get _ranges() {
  16967. return this._selection._ranges;
  16968. }
  16969. /**
  16970. * Returns an iterable that iterates over copies of selection ranges.
  16971. *
  16972. * @returns {Iterable.<module:engine/model/range~Range>}
  16973. */
  16974. getRanges() {
  16975. return this._selection.getRanges();
  16976. }
  16977. /**
  16978. * Returns the first position in the selection.
  16979. * First position is the position that {@link module:engine/model/position~Position#isBefore is before}
  16980. * any other position in the selection.
  16981. *
  16982. * Returns `null` if there are no ranges in selection.
  16983. *
  16984. * @returns {module:engine/model/position~Position|null}
  16985. */
  16986. getFirstPosition() {
  16987. return this._selection.getFirstPosition();
  16988. }
  16989. /**
  16990. * Returns the last position in the selection.
  16991. * Last position is the position that {@link module:engine/model/position~Position#isAfter is after}
  16992. * any other position in the selection.
  16993. *
  16994. * Returns `null` if there are no ranges in selection.
  16995. *
  16996. * @returns {module:engine/model/position~Position|null}
  16997. */
  16998. getLastPosition() {
  16999. return this._selection.getLastPosition();
  17000. }
  17001. /**
  17002. * Returns a copy of the first range in the selection.
  17003. * First range is the one which {@link module:engine/model/range~Range#start start} position
  17004. * {@link module:engine/model/position~Position#isBefore is before} start position of all other ranges
  17005. * (not to confuse with the first range added to the selection).
  17006. *
  17007. * Returns `null` if there are no ranges in selection.
  17008. *
  17009. * @returns {module:engine/model/range~Range|null}
  17010. */
  17011. getFirstRange() {
  17012. return this._selection.getFirstRange();
  17013. }
  17014. /**
  17015. * Returns a copy of the last range in the selection.
  17016. * Last range is the one which {@link module:engine/model/range~Range#end end} position
  17017. * {@link module:engine/model/position~Position#isAfter is after} end position of all other ranges (not to confuse with the range most
  17018. * recently added to the selection).
  17019. *
  17020. * Returns `null` if there are no ranges in selection.
  17021. *
  17022. * @returns {module:engine/model/range~Range|null}
  17023. */
  17024. getLastRange() {
  17025. return this._selection.getLastRange();
  17026. }
  17027. /**
  17028. * Gets elements of type {@link module:engine/model/schema~Schema#isBlock "block"} touched by the selection.
  17029. *
  17030. * This method's result can be used for example to apply block styling to all blocks covered by this selection.
  17031. *
  17032. * **Note:** `getSelectedBlocks()` returns blocks that are nested in other non-block elements
  17033. * but will not return blocks nested in other blocks.
  17034. *
  17035. * In this case the function will return exactly all 3 paragraphs (note: `<blockQuote>` is not a block itself):
  17036. *
  17037. * <paragraph>[a</paragraph>
  17038. * <blockQuote>
  17039. * <paragraph>b</paragraph>
  17040. * </blockQuote>
  17041. * <paragraph>c]d</paragraph>
  17042. *
  17043. * In this case the paragraph will also be returned, despite the collapsed selection:
  17044. *
  17045. * <paragraph>[]a</paragraph>
  17046. *
  17047. * In such a scenario, however, only blocks A, B & E will be returned as blocks C & D are nested in block B:
  17048. *
  17049. * [<blockA></blockA>
  17050. * <blockB>
  17051. * <blockC></blockC>
  17052. * <blockD></blockD>
  17053. * </blockB>
  17054. * <blockE></blockE>]
  17055. *
  17056. * If the selection is inside a block all the inner blocks (A & B) are returned:
  17057. *
  17058. * <block>
  17059. * <blockA>[a</blockA>
  17060. * <blockB>b]</blockB>
  17061. * </block>
  17062. *
  17063. * **Special case**: If a selection ends at the beginning of a block, that block is not returned as from user perspective
  17064. * this block wasn't selected. See [#984](https://github.com/ckeditor/ckeditor5-engine/issues/984) for more details.
  17065. *
  17066. * <paragraph>[a</paragraph>
  17067. * <paragraph>b</paragraph>
  17068. * <paragraph>]c</paragraph> // this block will not be returned
  17069. *
  17070. * @returns {Iterable.<module:engine/model/element~Element>}
  17071. */
  17072. getSelectedBlocks() {
  17073. return this._selection.getSelectedBlocks();
  17074. }
  17075. /**
  17076. * Returns the selected element. {@link module:engine/model/element~Element Element} is considered as selected if there is only
  17077. * one range in the selection, and that range contains exactly one element.
  17078. * Returns `null` if there is no selected element.
  17079. *
  17080. * @returns {module:engine/model/element~Element|null}
  17081. */
  17082. getSelectedElement() {
  17083. return this._selection.getSelectedElement();
  17084. }
  17085. /**
  17086. * Checks whether the selection contains the entire content of the given element. This means that selection must start
  17087. * at a position {@link module:engine/model/position~Position#isTouching touching} the element's start and ends at position
  17088. * touching the element's end.
  17089. *
  17090. * By default, this method will check whether the entire content of the selection's current root is selected.
  17091. * Useful to check if e.g. the user has just pressed <kbd>Ctrl</kbd> + <kbd>A</kbd>.
  17092. *
  17093. * @param {module:engine/model/element~Element} [element=this.anchor.root]
  17094. * @returns {Boolean}
  17095. */
  17096. containsEntireContent( element ) {
  17097. return this._selection.containsEntireContent( element );
  17098. }
  17099. /**
  17100. * Unbinds all events previously bound by document selection.
  17101. */
  17102. destroy() {
  17103. this._selection.destroy();
  17104. }
  17105. /**
  17106. * Returns iterable that iterates over this selection's attribute keys.
  17107. *
  17108. * @returns {Iterable.<String>}
  17109. */
  17110. getAttributeKeys() {
  17111. return this._selection.getAttributeKeys();
  17112. }
  17113. /**
  17114. * Returns iterable that iterates over this selection's attributes.
  17115. *
  17116. * Attributes are returned as arrays containing two items. First one is attribute key and second is attribute value.
  17117. * This format is accepted by native `Map` object and also can be passed in `Node` constructor.
  17118. *
  17119. * @returns {Iterable.<*>}
  17120. */
  17121. getAttributes() {
  17122. return this._selection.getAttributes();
  17123. }
  17124. /**
  17125. * Gets an attribute value for given key or `undefined` if that attribute is not set on the selection.
  17126. *
  17127. * @param {String} key Key of attribute to look for.
  17128. * @returns {*} Attribute value or `undefined`.
  17129. */
  17130. getAttribute( key ) {
  17131. return this._selection.getAttribute( key );
  17132. }
  17133. /**
  17134. * Checks if the selection has an attribute for given key.
  17135. *
  17136. * @param {String} key Key of attribute to check.
  17137. * @returns {Boolean} `true` if attribute with given key is set on selection, `false` otherwise.
  17138. */
  17139. hasAttribute( key ) {
  17140. return this._selection.hasAttribute( key );
  17141. }
  17142. /**
  17143. * Refreshes selection attributes and markers according to the current position in the model.
  17144. */
  17145. refresh() {
  17146. this._selection._updateMarkers();
  17147. this._selection._updateAttributes( false );
  17148. }
  17149. /**
  17150. * Checks whether this object is of the given type.
  17151. *
  17152. * selection.is( 'selection' ); // -> true
  17153. * selection.is( 'documentSelection' ); // -> true
  17154. * selection.is( 'model:selection' ); // -> true
  17155. * selection.is( 'model:documentSelection' ); // -> true
  17156. *
  17157. * selection.is( 'view:selection' ); // -> false
  17158. * selection.is( 'element' ); // -> false
  17159. * selection.is( 'node' ); // -> false
  17160. *
  17161. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  17162. *
  17163. * @param {String} type
  17164. * @returns {Boolean}
  17165. */
  17166. is( type ) {
  17167. return type === 'selection' ||
  17168. type == 'model:selection' ||
  17169. type == 'documentSelection' ||
  17170. type == 'model:documentSelection';
  17171. }
  17172. /**
  17173. * Moves {@link module:engine/model/documentselection~DocumentSelection#focus} to the specified location.
  17174. * Should be used only within the {@link module:engine/model/writer~Writer#setSelectionFocus} method.
  17175. *
  17176. * The location can be specified in the same form as
  17177. * {@link module:engine/model/writer~Writer#createPositionAt writer.createPositionAt()} parameters.
  17178. *
  17179. * @see module:engine/model/writer~Writer#setSelectionFocus
  17180. * @protected
  17181. * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
  17182. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  17183. * first parameter is a {@link module:engine/model/item~Item model item}.
  17184. */
  17185. _setFocus( itemOrPosition, offset ) {
  17186. this._selection.setFocus( itemOrPosition, offset );
  17187. }
  17188. /**
  17189. * Sets this selection's ranges and direction to the specified location based on the given
  17190. * {@link module:engine/model/selection~Selectable selectable}.
  17191. * Should be used only within the {@link module:engine/model/writer~Writer#setSelection} method.
  17192. *
  17193. * @see module:engine/model/writer~Writer#setSelection
  17194. * @protected
  17195. * @param {module:engine/model/selection~Selectable} selectable
  17196. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
  17197. * @param {Object} [options]
  17198. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  17199. */
  17200. _setTo( selectable, placeOrOffset, options ) {
  17201. this._selection.setTo( selectable, placeOrOffset, options );
  17202. }
  17203. /**
  17204. * Sets attribute on the selection. If attribute with the same key already is set, it's value is overwritten.
  17205. * Should be used only within the {@link module:engine/model/writer~Writer#setSelectionAttribute} method.
  17206. *
  17207. * @see module:engine/model/writer~Writer#setSelectionAttribute
  17208. * @protected
  17209. * @param {String} key Key of the attribute to set.
  17210. * @param {*} value Attribute value.
  17211. */
  17212. _setAttribute( key, value ) {
  17213. this._selection.setAttribute( key, value );
  17214. }
  17215. /**
  17216. * Removes an attribute with given key from the selection.
  17217. * If the given attribute was set on the selection, fires the {@link module:engine/model/selection~Selection#event:change:range}
  17218. * event with removed attribute key.
  17219. * Should be used only within the {@link module:engine/model/writer~Writer#removeSelectionAttribute} method.
  17220. *
  17221. * @see module:engine/model/writer~Writer#removeSelectionAttribute
  17222. * @protected
  17223. * @param {String} key Key of the attribute to remove.
  17224. */
  17225. _removeAttribute( key ) {
  17226. this._selection.removeAttribute( key );
  17227. }
  17228. /**
  17229. * Returns an iterable that iterates through all selection attributes stored in current selection's parent.
  17230. *
  17231. * @protected
  17232. * @returns {Iterable.<*>}
  17233. */
  17234. _getStoredAttributes() {
  17235. return this._selection._getStoredAttributes();
  17236. }
  17237. /**
  17238. * Temporarily changes the gravity of the selection from the left to the right.
  17239. *
  17240. * The gravity defines from which direction the selection inherits its attributes. If it's the default left
  17241. * gravity, the selection (after being moved by the the user) inherits attributes from its left hand side.
  17242. * This method allows to temporarily override this behavior by forcing the gravity to the right.
  17243. *
  17244. * It returns an unique identifier which is required to restore the gravity. It guarantees the symmetry
  17245. * of the process.
  17246. *
  17247. * @see module:engine/model/writer~Writer#overrideSelectionGravity
  17248. * @protected
  17249. * @returns {String} The unique id which allows restoring the gravity.
  17250. */
  17251. _overrideGravity() {
  17252. return this._selection.overrideGravity();
  17253. }
  17254. /**
  17255. * Restores the {@link ~DocumentSelection#_overrideGravity overridden gravity}.
  17256. *
  17257. * Restoring the gravity is only possible using the unique identifier returned by
  17258. * {@link ~DocumentSelection#_overrideGravity}. Note that the gravity remains overridden as long as won't be restored
  17259. * the same number of times it was overridden.
  17260. *
  17261. * @see module:engine/model/writer~Writer#restoreSelectionGravity
  17262. * @protected
  17263. * @param {String} uid The unique id returned by {@link #_overrideGravity}.
  17264. */
  17265. _restoreGravity( uid ) {
  17266. this._selection.restoreGravity( uid );
  17267. }
  17268. /**
  17269. * Generates and returns an attribute key for selection attributes store, basing on original attribute key.
  17270. *
  17271. * @protected
  17272. * @param {String} key Attribute key to convert.
  17273. * @returns {String} Converted attribute key, applicable for selection store.
  17274. */
  17275. static _getStoreAttributeKey( key ) {
  17276. return storePrefix + key;
  17277. }
  17278. /**
  17279. * Checks whether the given attribute key is an attribute stored on an element.
  17280. *
  17281. * @protected
  17282. * @param {String} key
  17283. * @returns {Boolean}
  17284. */
  17285. static _isStoreAttributeKey( key ) {
  17286. return key.startsWith( storePrefix );
  17287. }
  17288. }
  17289. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_0__["default"])( DocumentSelection, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  17290. /**
  17291. * Fired when selection range(s) changed.
  17292. *
  17293. * @event change:range
  17294. * @param {Boolean} directChange In case of {@link module:engine/model/selection~Selection} class it is always set
  17295. * to `true` which indicates that the selection change was caused by a direct use of selection's API.
  17296. * The {@link module:engine/model/documentselection~DocumentSelection}, however, may change because its position
  17297. * was directly changed through the {@link module:engine/model/writer~Writer writer} or because its position was
  17298. * changed because the structure of the model has been changed (which means an indirect change).
  17299. * The indirect change does not occur in case of normal (detached) selections because they are "static" (as "not live")
  17300. * which mean that they are not updated once the document changes.
  17301. */
  17302. /**
  17303. * Fired when selection attribute changed.
  17304. *
  17305. * @event change:attribute
  17306. * @param {Boolean} directChange In case of {@link module:engine/model/selection~Selection} class it is always set
  17307. * to `true` which indicates that the selection change was caused by a direct use of selection's API.
  17308. * The {@link module:engine/model/documentselection~DocumentSelection}, however, may change because its attributes
  17309. * were directly changed through the {@link module:engine/model/writer~Writer writer} or because its position was
  17310. * changed in the model and its attributes were refreshed (which means an indirect change).
  17311. * The indirect change does not occur in case of normal (detached) selections because they are "static" (as "not live")
  17312. * which mean that they are not updated once the document changes.
  17313. * @param {Array.<String>} attributeKeys Array containing keys of attributes that changed.
  17314. */
  17315. /**
  17316. * Fired when selection marker(s) changed.
  17317. *
  17318. * @event change:marker
  17319. * @param {Boolean} directChange This is always set to `false` in case of `change:marker` event as there is no possibility
  17320. * to change markers directly through {@link module:engine/model/documentselection~DocumentSelection} API.
  17321. * See also {@link module:engine/model/documentselection~DocumentSelection#event:change:range} and
  17322. * {@link module:engine/model/documentselection~DocumentSelection#event:change:attribute}.
  17323. * @param {Array.<module:engine/model/markercollection~Marker>} oldMarkers Markers in which the selection was before the change.
  17324. */
  17325. // `LiveSelection` is used internally by {@link module:engine/model/documentselection~DocumentSelection} and shouldn't be used directly.
  17326. //
  17327. // LiveSelection` is automatically updated upon changes in the {@link module:engine/model/document~Document document}
  17328. // to always contain valid ranges. Its attributes are inherited from the text unless set explicitly.
  17329. //
  17330. // Differences between {@link module:engine/model/selection~Selection} and `LiveSelection` are:
  17331. // * there is always a range in `LiveSelection` - even if no ranges were added there is a "default range"
  17332. // present in the selection,
  17333. // * ranges added to this selection updates automatically when the document changes,
  17334. // * attributes of `LiveSelection` are updated automatically according to selection ranges.
  17335. //
  17336. // @extends module:engine/model/selection~Selection
  17337. //
  17338. class LiveSelection extends _selection__WEBPACK_IMPORTED_MODULE_2__["default"] {
  17339. // Creates an empty live selection for given {@link module:engine/model/document~Document}.
  17340. // @param {module:engine/model/document~Document} doc Document which owns this selection.
  17341. constructor( doc ) {
  17342. super();
  17343. // List of selection markers.
  17344. // Marker is a selection marker when selection range is inside the marker range.
  17345. //
  17346. // @type {module:utils/collection~Collection}
  17347. this.markers = new _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_7__["default"]( { idProperty: 'name' } );
  17348. // Document which owns this selection.
  17349. //
  17350. // @protected
  17351. // @member {module:engine/model/model~Model}
  17352. this._model = doc.model;
  17353. // Document which owns this selection.
  17354. //
  17355. // @protected
  17356. // @member {module:engine/model/document~Document}
  17357. this._document = doc;
  17358. // Keeps mapping of attribute name to priority with which the attribute got modified (added/changed/removed)
  17359. // last time. Possible values of priority are: `'low'` and `'normal'`.
  17360. //
  17361. // Priorities are used by internal `LiveSelection` mechanisms. All attributes set using `LiveSelection`
  17362. // attributes API are set with `'normal'` priority.
  17363. //
  17364. // @private
  17365. // @member {Map} module:engine/model/liveselection~LiveSelection#_attributePriority
  17366. this._attributePriority = new Map();
  17367. // Position to which the selection should be set if the last selection range was moved to the graveyard.
  17368. // @private
  17369. // @member {module:engine/model/position~Position} module:engine/model/liveselection~LiveSelection#_selectionRestorePosition
  17370. this._selectionRestorePosition = null;
  17371. // Flag that informs whether the selection ranges have changed. It is changed on true when `LiveRange#change:range` event is fired.
  17372. // @private
  17373. // @member {Array} module:engine/model/liveselection~LiveSelection#_hasChangedRange
  17374. this._hasChangedRange = false;
  17375. // Each overriding gravity adds an UID to the set and each removal removes it.
  17376. // Gravity is overridden when there's at least one UID in the set.
  17377. // Gravity is restored when the set is empty.
  17378. // This is to prevent conflicts when gravity is overridden by more than one feature at the same time.
  17379. // @private
  17380. // @type {Set}
  17381. this._overriddenGravityRegister = new Set();
  17382. // Ensure selection is correct after each operation.
  17383. this.listenTo( this._model, 'applyOperation', ( evt, args ) => {
  17384. const operation = args[ 0 ];
  17385. if ( !operation.isDocumentOperation || operation.type == 'marker' || operation.type == 'rename' || operation.type == 'noop' ) {
  17386. return;
  17387. }
  17388. // Fix selection if the last range was removed from it and we have a position to which we can restore the selection.
  17389. if ( this._ranges.length == 0 && this._selectionRestorePosition ) {
  17390. this._fixGraveyardSelection( this._selectionRestorePosition );
  17391. }
  17392. // "Forget" the restore position even if it was not "used".
  17393. this._selectionRestorePosition = null;
  17394. if ( this._hasChangedRange ) {
  17395. this._hasChangedRange = false;
  17396. this.fire( 'change:range', { directChange: false } );
  17397. }
  17398. }, { priority: 'lowest' } );
  17399. // Ensure selection is correct and up to date after each range change.
  17400. this.on( 'change:range', () => {
  17401. for ( const range of this.getRanges() ) {
  17402. if ( !this._document._validateSelectionRange( range ) ) {
  17403. /**
  17404. * Range from {@link module:engine/model/documentselection~DocumentSelection document selection}
  17405. * starts or ends at incorrect position.
  17406. *
  17407. * @error document-selection-wrong-position
  17408. * @param {module:engine/model/range~Range} range
  17409. */
  17410. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"](
  17411. 'document-selection-wrong-position',
  17412. this,
  17413. { range }
  17414. );
  17415. }
  17416. }
  17417. } );
  17418. // Update markers data stored by the selection after each marker change.
  17419. this.listenTo( this._model.markers, 'update', () => this._updateMarkers() );
  17420. // Ensure selection is up to date after each change block.
  17421. this.listenTo( this._document, 'change', ( evt, batch ) => {
  17422. clearAttributesStoredInElement( this._model, batch );
  17423. } );
  17424. }
  17425. get isCollapsed() {
  17426. const length = this._ranges.length;
  17427. return length === 0 ? this._document._getDefaultRange().isCollapsed : super.isCollapsed;
  17428. }
  17429. get anchor() {
  17430. return super.anchor || this._document._getDefaultRange().start;
  17431. }
  17432. get focus() {
  17433. return super.focus || this._document._getDefaultRange().end;
  17434. }
  17435. get rangeCount() {
  17436. return this._ranges.length ? this._ranges.length : 1;
  17437. }
  17438. // Describes whether `LiveSelection` has own range(s) set, or if it is defaulted to
  17439. // {@link module:engine/model/document~Document#_getDefaultRange document's default range}.
  17440. //
  17441. // @readonly
  17442. // @type {Boolean}
  17443. get hasOwnRange() {
  17444. return this._ranges.length > 0;
  17445. }
  17446. // When set to `true` then selection attributes on node before the caret won't be taken
  17447. // into consideration while updating selection attributes.
  17448. //
  17449. // @protected
  17450. // @type {Boolean}
  17451. get isGravityOverridden() {
  17452. return !!this._overriddenGravityRegister.size;
  17453. }
  17454. // Unbinds all events previously bound by live selection.
  17455. destroy() {
  17456. for ( let i = 0; i < this._ranges.length; i++ ) {
  17457. this._ranges[ i ].detach();
  17458. }
  17459. this.stopListening();
  17460. }
  17461. * getRanges() {
  17462. if ( this._ranges.length ) {
  17463. yield* super.getRanges();
  17464. } else {
  17465. yield this._document._getDefaultRange();
  17466. }
  17467. }
  17468. getFirstRange() {
  17469. return super.getFirstRange() || this._document._getDefaultRange();
  17470. }
  17471. getLastRange() {
  17472. return super.getLastRange() || this._document._getDefaultRange();
  17473. }
  17474. setTo( selectable, optionsOrPlaceOrOffset, options ) {
  17475. super.setTo( selectable, optionsOrPlaceOrOffset, options );
  17476. this._updateAttributes( true );
  17477. this._updateMarkers();
  17478. }
  17479. setFocus( itemOrPosition, offset ) {
  17480. super.setFocus( itemOrPosition, offset );
  17481. this._updateAttributes( true );
  17482. this._updateMarkers();
  17483. }
  17484. setAttribute( key, value ) {
  17485. if ( this._setAttribute( key, value ) ) {
  17486. // Fire event with exact data.
  17487. const attributeKeys = [ key ];
  17488. this.fire( 'change:attribute', { attributeKeys, directChange: true } );
  17489. }
  17490. }
  17491. removeAttribute( key ) {
  17492. if ( this._removeAttribute( key ) ) {
  17493. // Fire event with exact data.
  17494. const attributeKeys = [ key ];
  17495. this.fire( 'change:attribute', { attributeKeys, directChange: true } );
  17496. }
  17497. }
  17498. overrideGravity() {
  17499. const overrideUid = Object(_ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_9__["default"])();
  17500. // Remember that another overriding has been requested. It will need to be removed
  17501. // before the gravity is to be restored.
  17502. this._overriddenGravityRegister.add( overrideUid );
  17503. if ( this._overriddenGravityRegister.size === 1 ) {
  17504. this._updateAttributes( true );
  17505. }
  17506. return overrideUid;
  17507. }
  17508. restoreGravity( uid ) {
  17509. if ( !this._overriddenGravityRegister.has( uid ) ) {
  17510. /**
  17511. * Restoring gravity for an unknown UID is not possible. Make sure you are using a correct
  17512. * UID obtained from the {@link module:engine/model/writer~Writer#overrideSelectionGravity} to restore.
  17513. *
  17514. * @error document-selection-gravity-wrong-restore
  17515. * @param {String} uid The unique identifier returned by
  17516. * {@link module:engine/model/documentselection~DocumentSelection#_overrideGravity}.
  17517. */
  17518. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"](
  17519. 'document-selection-gravity-wrong-restore',
  17520. this,
  17521. { uid }
  17522. );
  17523. }
  17524. this._overriddenGravityRegister.delete( uid );
  17525. // Restore gravity only when all overriding have been restored.
  17526. if ( !this.isGravityOverridden ) {
  17527. this._updateAttributes( true );
  17528. }
  17529. }
  17530. _popRange() {
  17531. this._ranges.pop().detach();
  17532. }
  17533. _pushRange( range ) {
  17534. const liveRange = this._prepareRange( range );
  17535. // `undefined` is returned when given `range` is in graveyard root.
  17536. if ( liveRange ) {
  17537. this._ranges.push( liveRange );
  17538. }
  17539. }
  17540. // Prepares given range to be added to selection. Checks if it is correct,
  17541. // converts it to {@link module:engine/model/liverange~LiveRange LiveRange}
  17542. // and sets listeners listening to the range's change event.
  17543. //
  17544. // @private
  17545. // @param {module:engine/model/range~Range} range
  17546. _prepareRange( range ) {
  17547. this._checkRange( range );
  17548. if ( range.root == this._document.graveyard ) {
  17549. // @if CK_DEBUG // console.warn( 'Trying to add a Range that is in the graveyard root. Range rejected.' );
  17550. return;
  17551. }
  17552. const liveRange = _liverange__WEBPACK_IMPORTED_MODULE_3__["default"].fromRange( range );
  17553. // If selection range is moved to the graveyard remove it from the selection object.
  17554. // Also, save some data that can be used to restore selection later, on `Model#applyOperation` event.
  17555. liveRange.on( 'change:range', ( evt, oldRange, data ) => {
  17556. this._hasChangedRange = true;
  17557. if ( liveRange.root == this._document.graveyard ) {
  17558. this._selectionRestorePosition = data.deletionPosition;
  17559. const index = this._ranges.indexOf( liveRange );
  17560. this._ranges.splice( index, 1 );
  17561. liveRange.detach();
  17562. }
  17563. } );
  17564. return liveRange;
  17565. }
  17566. _updateMarkers() {
  17567. const markers = [];
  17568. let changed = false;
  17569. for ( const marker of this._model.markers ) {
  17570. const markerRange = marker.getRange();
  17571. for ( const selectionRange of this.getRanges() ) {
  17572. if ( markerRange.containsRange( selectionRange, !selectionRange.isCollapsed ) ) {
  17573. markers.push( marker );
  17574. }
  17575. }
  17576. }
  17577. const oldMarkers = Array.from( this.markers );
  17578. for ( const marker of markers ) {
  17579. if ( !this.markers.has( marker ) ) {
  17580. this.markers.add( marker );
  17581. changed = true;
  17582. }
  17583. }
  17584. for ( const marker of Array.from( this.markers ) ) {
  17585. if ( !markers.includes( marker ) ) {
  17586. this.markers.remove( marker );
  17587. changed = true;
  17588. }
  17589. }
  17590. if ( changed ) {
  17591. this.fire( 'change:marker', { oldMarkers, directChange: false } );
  17592. }
  17593. }
  17594. // Updates this selection attributes according to its ranges and the {@link module:engine/model/document~Document model document}.
  17595. //
  17596. // @protected
  17597. // @param {Boolean} clearAll
  17598. // @fires change:attribute
  17599. _updateAttributes( clearAll ) {
  17600. const newAttributes = Object(_ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_6__["default"])( this._getSurroundingAttributes() );
  17601. const oldAttributes = Object(_ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_6__["default"])( this.getAttributes() );
  17602. if ( clearAll ) {
  17603. // If `clearAll` remove all attributes and reset priorities.
  17604. this._attributePriority = new Map();
  17605. this._attrs = new Map();
  17606. } else {
  17607. // If not, remove only attributes added with `low` priority.
  17608. for ( const [ key, priority ] of this._attributePriority ) {
  17609. if ( priority == 'low' ) {
  17610. this._attrs.delete( key );
  17611. this._attributePriority.delete( key );
  17612. }
  17613. }
  17614. }
  17615. this._setAttributesTo( newAttributes );
  17616. // Let's evaluate which attributes really changed.
  17617. const changed = [];
  17618. // First, loop through all attributes that are set on selection right now.
  17619. // Check which of them are different than old attributes.
  17620. for ( const [ newKey, newValue ] of this.getAttributes() ) {
  17621. if ( !oldAttributes.has( newKey ) || oldAttributes.get( newKey ) !== newValue ) {
  17622. changed.push( newKey );
  17623. }
  17624. }
  17625. // Then, check which of old attributes got removed.
  17626. for ( const [ oldKey ] of oldAttributes ) {
  17627. if ( !this.hasAttribute( oldKey ) ) {
  17628. changed.push( oldKey );
  17629. }
  17630. }
  17631. // Fire event with exact data (fire only if anything changed).
  17632. if ( changed.length > 0 ) {
  17633. this.fire( 'change:attribute', { attributeKeys: changed, directChange: false } );
  17634. }
  17635. }
  17636. // Internal method for setting `LiveSelection` attribute. Supports attribute priorities (through `directChange`
  17637. // parameter).
  17638. //
  17639. // @private
  17640. // @param {String} key Attribute key.
  17641. // @param {*} value Attribute value.
  17642. // @param {Boolean} [directChange=true] `true` if the change is caused by `Selection` API, `false` if change
  17643. // is caused by `Batch` API.
  17644. // @returns {Boolean} Whether value has changed.
  17645. _setAttribute( key, value, directChange = true ) {
  17646. const priority = directChange ? 'normal' : 'low';
  17647. if ( priority == 'low' && this._attributePriority.get( key ) == 'normal' ) {
  17648. // Priority too low.
  17649. return false;
  17650. }
  17651. const oldValue = super.getAttribute( key );
  17652. // Don't do anything if value has not changed.
  17653. if ( oldValue === value ) {
  17654. return false;
  17655. }
  17656. this._attrs.set( key, value );
  17657. // Update priorities map.
  17658. this._attributePriority.set( key, priority );
  17659. return true;
  17660. }
  17661. // Internal method for removing `LiveSelection` attribute. Supports attribute priorities (through `directChange`
  17662. // parameter).
  17663. //
  17664. // NOTE: Even if attribute is not present in the selection but is provided to this method, it's priority will
  17665. // be changed according to `directChange` parameter.
  17666. //
  17667. // @private
  17668. // @param {String} key Attribute key.
  17669. // @param {Boolean} [directChange=true] `true` if the change is caused by `Selection` API, `false` if change
  17670. // is caused by `Batch` API.
  17671. // @returns {Boolean} Whether attribute was removed. May not be true if such attributes didn't exist or the
  17672. // existing attribute had higher priority.
  17673. _removeAttribute( key, directChange = true ) {
  17674. const priority = directChange ? 'normal' : 'low';
  17675. if ( priority == 'low' && this._attributePriority.get( key ) == 'normal' ) {
  17676. // Priority too low.
  17677. return false;
  17678. }
  17679. // Update priorities map.
  17680. this._attributePriority.set( key, priority );
  17681. // Don't do anything if value has not changed.
  17682. if ( !super.hasAttribute( key ) ) {
  17683. return false;
  17684. }
  17685. this._attrs.delete( key );
  17686. return true;
  17687. }
  17688. // Internal method for setting multiple `LiveSelection` attributes. Supports attribute priorities (through
  17689. // `directChange` parameter).
  17690. //
  17691. // @private
  17692. // @param {Map.<String,*>} attrs Iterable object containing attributes to be set.
  17693. // @returns {Set.<String>} Changed attribute keys.
  17694. _setAttributesTo( attrs ) {
  17695. const changed = new Set();
  17696. for ( const [ oldKey, oldValue ] of this.getAttributes() ) {
  17697. // Do not remove attribute if attribute with same key and value is about to be set.
  17698. if ( attrs.get( oldKey ) === oldValue ) {
  17699. continue;
  17700. }
  17701. // All rest attributes will be removed so changed attributes won't change .
  17702. this._removeAttribute( oldKey, false );
  17703. }
  17704. for ( const [ key, value ] of attrs ) {
  17705. // Attribute may not be set because of attributes or because same key/value is already added.
  17706. const gotAdded = this._setAttribute( key, value, false );
  17707. if ( gotAdded ) {
  17708. changed.add( key );
  17709. }
  17710. }
  17711. return changed;
  17712. }
  17713. // Returns an iterable that iterates through all selection attributes stored in current selection's parent.
  17714. //
  17715. // @protected
  17716. // @returns {Iterable.<*>}
  17717. * _getStoredAttributes() {
  17718. const selectionParent = this.getFirstPosition().parent;
  17719. if ( this.isCollapsed && selectionParent.isEmpty ) {
  17720. for ( const key of selectionParent.getAttributeKeys() ) {
  17721. if ( key.startsWith( storePrefix ) ) {
  17722. const realKey = key.substr( storePrefix.length );
  17723. yield [ realKey, selectionParent.getAttribute( key ) ];
  17724. }
  17725. }
  17726. }
  17727. }
  17728. // Checks model text nodes that are closest to the selection's first position and returns attributes of first
  17729. // found element. If there are no text nodes in selection's first position parent, it returns selection
  17730. // attributes stored in that parent.
  17731. //
  17732. // @private
  17733. // @returns {Iterable.<*>} Collection of attributes.
  17734. _getSurroundingAttributes() {
  17735. const position = this.getFirstPosition();
  17736. const schema = this._model.schema;
  17737. let attrs = null;
  17738. if ( !this.isCollapsed ) {
  17739. // 1. If selection is a range...
  17740. const range = this.getFirstRange();
  17741. // ...look for a first character node in that range and take attributes from it.
  17742. for ( const value of range ) {
  17743. // If the item is an object, we don't want to get attributes from its children.
  17744. if ( value.item.is( 'element' ) && schema.isObject( value.item ) ) {
  17745. break;
  17746. }
  17747. if ( value.type == 'text' ) {
  17748. attrs = value.item.getAttributes();
  17749. break;
  17750. }
  17751. }
  17752. } else {
  17753. // 2. If the selection is a caret or the range does not contain a character node...
  17754. const nodeBefore = position.textNode ? position.textNode : position.nodeBefore;
  17755. const nodeAfter = position.textNode ? position.textNode : position.nodeAfter;
  17756. // When gravity is overridden then don't take node before into consideration.
  17757. if ( !this.isGravityOverridden ) {
  17758. // ...look at the node before caret and take attributes from it if it is a character node.
  17759. attrs = getAttrsIfCharacter( nodeBefore );
  17760. }
  17761. // 3. If not, look at the node after caret...
  17762. if ( !attrs ) {
  17763. attrs = getAttrsIfCharacter( nodeAfter );
  17764. }
  17765. // 4. If not, try to find the first character on the left, that is in the same node.
  17766. // When gravity is overridden then don't take node before into consideration.
  17767. if ( !this.isGravityOverridden && !attrs ) {
  17768. let node = nodeBefore;
  17769. while ( node && !schema.isInline( node ) && !attrs ) {
  17770. node = node.previousSibling;
  17771. attrs = getAttrsIfCharacter( node );
  17772. }
  17773. }
  17774. // 5. If not found, try to find the first character on the right, that is in the same node.
  17775. if ( !attrs ) {
  17776. let node = nodeAfter;
  17777. while ( node && !schema.isInline( node ) && !attrs ) {
  17778. node = node.nextSibling;
  17779. attrs = getAttrsIfCharacter( node );
  17780. }
  17781. }
  17782. // 6. If not found, selection should retrieve attributes from parent.
  17783. if ( !attrs ) {
  17784. attrs = this._getStoredAttributes();
  17785. }
  17786. }
  17787. return attrs;
  17788. }
  17789. // Fixes the selection after all its ranges got removed.
  17790. //
  17791. // @private
  17792. // @param {module:engine/model/position~Position} deletionPosition Position where the deletion happened.
  17793. _fixGraveyardSelection( deletionPosition ) {
  17794. // Find a range that is a correct selection range and is closest to the position where the deletion happened.
  17795. const selectionRange = this._model.schema.getNearestSelectionRange( deletionPosition );
  17796. // If nearest valid selection range has been found - add it in the place of old range.
  17797. if ( selectionRange ) {
  17798. // Check the range, convert it to live range, bind events, etc.
  17799. this._pushRange( selectionRange );
  17800. }
  17801. // If nearest valid selection range cannot be found don't add any range. Selection will be set to the default range.
  17802. }
  17803. }
  17804. // Helper function for {@link module:engine/model/liveselection~LiveSelection#_updateAttributes}.
  17805. //
  17806. // It takes model item, checks whether it is a text node (or text proxy) and, if so, returns it's attributes. If not, returns `null`.
  17807. //
  17808. // @param {module:engine/model/item~Item|null} node
  17809. // @returns {Boolean}
  17810. function getAttrsIfCharacter( node ) {
  17811. if ( node instanceof _textproxy__WEBPACK_IMPORTED_MODULE_5__["default"] || node instanceof _text__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
  17812. return node.getAttributes();
  17813. }
  17814. return null;
  17815. }
  17816. // Removes selection attributes from element which is not empty anymore.
  17817. //
  17818. // @param {module:engine/model/model~Model} model
  17819. // @param {module:engine/model/batch~Batch} batch
  17820. function clearAttributesStoredInElement( model, batch ) {
  17821. const differ = model.document.differ;
  17822. for ( const entry of differ.getChanges() ) {
  17823. if ( entry.type != 'insert' ) {
  17824. continue;
  17825. }
  17826. const changeParent = entry.position.parent;
  17827. const isNoLongerEmpty = entry.length === changeParent.maxOffset;
  17828. if ( isNoLongerEmpty ) {
  17829. model.enqueueChange( batch, writer => {
  17830. const storedAttributes = Array.from( changeParent.getAttributeKeys() )
  17831. .filter( key => key.startsWith( storePrefix ) );
  17832. for ( const key of storedAttributes ) {
  17833. writer.removeAttribute( key, changeParent );
  17834. }
  17835. } );
  17836. }
  17837. }
  17838. }
  17839. /***/ }),
  17840. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js":
  17841. /*!**********************************************************************!*\
  17842. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js ***!
  17843. \**********************************************************************/
  17844. /*! exports provided: default */
  17845. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17846. "use strict";
  17847. __webpack_require__.r(__webpack_exports__);
  17848. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Element; });
  17849. /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/node.js");
  17850. /* harmony import */ var _nodelist__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./nodelist */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/nodelist.js");
  17851. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js");
  17852. /* harmony import */ var _textproxy__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.js");
  17853. /* harmony import */ var _ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
  17854. /**
  17855. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  17856. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  17857. */
  17858. /**
  17859. * @module engine/model/element
  17860. */
  17861. // @if CK_DEBUG_ENGINE // const { stringifyMap, convertMapToStringifiedObject, convertMapToTags } = require( '../dev-utils/utils' );
  17862. /**
  17863. * Model element. Type of {@link module:engine/model/node~Node node} that has a {@link module:engine/model/element~Element#name name} and
  17864. * {@link module:engine/model/element~Element#getChildren child nodes}.
  17865. *
  17866. * **Important**: see {@link module:engine/model/node~Node} to read about restrictions using `Element` and `Node` API.
  17867. *
  17868. * @extends module:engine/model/node~Node
  17869. */
  17870. class Element extends _node__WEBPACK_IMPORTED_MODULE_0__["default"] {
  17871. /**
  17872. * Creates a model element.
  17873. *
  17874. * **Note:** Constructor of this class shouldn't be used directly in the code.
  17875. * Use the {@link module:engine/model/writer~Writer#createElement} method instead.
  17876. *
  17877. * @protected
  17878. * @param {String} name Element's name.
  17879. * @param {Object} [attrs] Element's attributes. See {@link module:utils/tomap~toMap} for a list of accepted values.
  17880. * @param {module:engine/model/node~Node|Iterable.<module:engine/model/node~Node>} [children]
  17881. * One or more nodes to be inserted as children of created element.
  17882. */
  17883. constructor( name, attrs, children ) {
  17884. super( attrs );
  17885. /**
  17886. * Element name.
  17887. *
  17888. * @readonly
  17889. * @member {String} module:engine/model/element~Element#name
  17890. */
  17891. this.name = name;
  17892. /**
  17893. * List of children nodes.
  17894. *
  17895. * @private
  17896. * @member {module:engine/model/nodelist~NodeList} module:engine/model/element~Element#_children
  17897. */
  17898. this._children = new _nodelist__WEBPACK_IMPORTED_MODULE_1__["default"]();
  17899. if ( children ) {
  17900. this._insertChild( 0, children );
  17901. }
  17902. }
  17903. /**
  17904. * Number of this element's children.
  17905. *
  17906. * @readonly
  17907. * @type {Number}
  17908. */
  17909. get childCount() {
  17910. return this._children.length;
  17911. }
  17912. /**
  17913. * Sum of {@link module:engine/model/node~Node#offsetSize offset sizes} of all of this element's children.
  17914. *
  17915. * @readonly
  17916. * @type {Number}
  17917. */
  17918. get maxOffset() {
  17919. return this._children.maxOffset;
  17920. }
  17921. /**
  17922. * Is `true` if there are no nodes inside this element, `false` otherwise.
  17923. *
  17924. * @readonly
  17925. * @type {Boolean}
  17926. */
  17927. get isEmpty() {
  17928. return this.childCount === 0;
  17929. }
  17930. /**
  17931. * Checks whether this object is of the given.
  17932. *
  17933. * element.is( 'element' ); // -> true
  17934. * element.is( 'node' ); // -> true
  17935. * element.is( 'model:element' ); // -> true
  17936. * element.is( 'model:node' ); // -> true
  17937. *
  17938. * element.is( 'view:element' ); // -> false
  17939. * element.is( 'documentSelection' ); // -> false
  17940. *
  17941. * Assuming that the object being checked is an element, you can also check its
  17942. * {@link module:engine/model/element~Element#name name}:
  17943. *
  17944. * element.is( 'element', 'image' ); // -> true if this is an <image> element
  17945. * element.is( 'element', 'image' ); // -> same as above
  17946. * text.is( 'element', 'image' ); -> false
  17947. *
  17948. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  17949. *
  17950. * @param {String} type Type to check.
  17951. * @param {String} [name] Element name.
  17952. * @returns {Boolean}
  17953. */
  17954. is( type, name = null ) {
  17955. if ( !name ) {
  17956. return type === 'element' || type === 'model:element' ||
  17957. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  17958. type === 'node' || type === 'model:node';
  17959. }
  17960. return name === this.name && ( type === 'element' || type === 'model:element' );
  17961. }
  17962. /**
  17963. * Gets the child at the given index.
  17964. *
  17965. * @param {Number} index Index of child.
  17966. * @returns {module:engine/model/node~Node} Child node.
  17967. */
  17968. getChild( index ) {
  17969. return this._children.getNode( index );
  17970. }
  17971. /**
  17972. * Returns an iterator that iterates over all of this element's children.
  17973. *
  17974. * @returns {Iterable.<module:engine/model/node~Node>}
  17975. */
  17976. getChildren() {
  17977. return this._children[ Symbol.iterator ]();
  17978. }
  17979. /**
  17980. * Returns an index of the given child node. Returns `null` if given node is not a child of this element.
  17981. *
  17982. * @param {module:engine/model/node~Node} node Child node to look for.
  17983. * @returns {Number} Child node's index in this element.
  17984. */
  17985. getChildIndex( node ) {
  17986. return this._children.getNodeIndex( node );
  17987. }
  17988. /**
  17989. * Returns the starting offset of given child. Starting offset is equal to the sum of
  17990. * {@link module:engine/model/node~Node#offsetSize offset sizes} of all node's siblings that are before it. Returns `null` if
  17991. * given node is not a child of this element.
  17992. *
  17993. * @param {module:engine/model/node~Node} node Child node to look for.
  17994. * @returns {Number} Child node's starting offset.
  17995. */
  17996. getChildStartOffset( node ) {
  17997. return this._children.getNodeStartOffset( node );
  17998. }
  17999. /**
  18000. * Returns index of a node that occupies given offset. If given offset is too low, returns `0`. If given offset is
  18001. * too high, returns {@link module:engine/model/element~Element#getChildIndex index after last child}.
  18002. *
  18003. * const textNode = new Text( 'foo' );
  18004. * const pElement = new Element( 'p' );
  18005. * const divElement = new Element( [ textNode, pElement ] );
  18006. * divElement.offsetToIndex( -1 ); // Returns 0, because offset is too low.
  18007. * divElement.offsetToIndex( 0 ); // Returns 0, because offset 0 is taken by `textNode` which is at index 0.
  18008. * divElement.offsetToIndex( 1 ); // Returns 0, because `textNode` has `offsetSize` equal to 3, so it occupies offset 1 too.
  18009. * divElement.offsetToIndex( 2 ); // Returns 0.
  18010. * divElement.offsetToIndex( 3 ); // Returns 1.
  18011. * divElement.offsetToIndex( 4 ); // Returns 2. There are no nodes at offset 4, so last available index is returned.
  18012. *
  18013. * @param {Number} offset Offset to look for.
  18014. * @returns {Number}
  18015. */
  18016. offsetToIndex( offset ) {
  18017. return this._children.offsetToIndex( offset );
  18018. }
  18019. /**
  18020. * Returns a descendant node by its path relative to this element.
  18021. *
  18022. * // <this>a<b>c</b></this>
  18023. * this.getNodeByPath( [ 0 ] ); // -> "a"
  18024. * this.getNodeByPath( [ 1 ] ); // -> <b>
  18025. * this.getNodeByPath( [ 1, 0 ] ); // -> "c"
  18026. *
  18027. * @param {Array.<Number>} relativePath Path of the node to find, relative to this element.
  18028. * @returns {module:engine/model/node~Node}
  18029. */
  18030. getNodeByPath( relativePath ) {
  18031. let node = this; // eslint-disable-line consistent-this
  18032. for ( const index of relativePath ) {
  18033. node = node.getChild( node.offsetToIndex( index ) );
  18034. }
  18035. return node;
  18036. }
  18037. /**
  18038. * Returns the parent element of the given name. Returns null if the element is not inside the desired parent.
  18039. *
  18040. * @param {String} parentName The name of the parent element to find.
  18041. * @param {Object} [options] Options object.
  18042. * @param {Boolean} [options.includeSelf=false] When set to `true` this node will be also included while searching.
  18043. * @returns {module:engine/model/element~Element|null}
  18044. */
  18045. findAncestor( parentName, options = { includeSelf: false } ) {
  18046. let parent = options.includeSelf ? this : this.parent;
  18047. while ( parent ) {
  18048. if ( parent.name === parentName ) {
  18049. return parent;
  18050. }
  18051. parent = parent.parent;
  18052. }
  18053. return null;
  18054. }
  18055. /**
  18056. * Converts `Element` instance to plain object and returns it. Takes care of converting all of this element's children.
  18057. *
  18058. * @returns {Object} `Element` instance converted to plain object.
  18059. */
  18060. toJSON() {
  18061. const json = super.toJSON();
  18062. json.name = this.name;
  18063. if ( this._children.length > 0 ) {
  18064. json.children = [];
  18065. for ( const node of this._children ) {
  18066. json.children.push( node.toJSON() );
  18067. }
  18068. }
  18069. return json;
  18070. }
  18071. /**
  18072. * Creates a copy of this element and returns it. Created element has the same name and attributes as the original element.
  18073. * If clone is deep, the original element's children are also cloned. If not, then empty element is returned.
  18074. *
  18075. * @protected
  18076. * @param {Boolean} [deep=false] If set to `true` clones element and all its children recursively. When set to `false`,
  18077. * element will be cloned without any child.
  18078. */
  18079. _clone( deep = false ) {
  18080. const children = deep ? Array.from( this._children ).map( node => node._clone( true ) ) : null;
  18081. return new Element( this.name, this.getAttributes(), children );
  18082. }
  18083. /**
  18084. * {@link module:engine/model/element~Element#_insertChild Inserts} one or more nodes at the end of this element.
  18085. *
  18086. * @see module:engine/model/writer~Writer#append
  18087. * @protected
  18088. * @param {module:engine/model/item~Item|Iterable.<module:engine/model/item~Item>} nodes Nodes to be inserted.
  18089. */
  18090. _appendChild( nodes ) {
  18091. this._insertChild( this.childCount, nodes );
  18092. }
  18093. /**
  18094. * Inserts one or more nodes at the given index and sets {@link module:engine/model/node~Node#parent parent} of these nodes
  18095. * to this element.
  18096. *
  18097. * @see module:engine/model/writer~Writer#insert
  18098. * @protected
  18099. * @param {Number} index Index at which nodes should be inserted.
  18100. * @param {module:engine/model/item~Item|Iterable.<module:engine/model/item~Item>} items Items to be inserted.
  18101. */
  18102. _insertChild( index, items ) {
  18103. const nodes = normalize( items );
  18104. for ( const node of nodes ) {
  18105. // If node that is being added to this element is already inside another element, first remove it from the old parent.
  18106. if ( node.parent !== null ) {
  18107. node._remove();
  18108. }
  18109. node.parent = this;
  18110. }
  18111. this._children._insertNodes( index, nodes );
  18112. }
  18113. /**
  18114. * Removes one or more nodes starting at the given index and sets
  18115. * {@link module:engine/model/node~Node#parent parent} of these nodes to `null`.
  18116. *
  18117. * @see module:engine/model/writer~Writer#remove
  18118. * @protected
  18119. * @param {Number} index Index of the first node to remove.
  18120. * @param {Number} [howMany=1] Number of nodes to remove.
  18121. * @returns {Array.<module:engine/model/node~Node>} Array containing removed nodes.
  18122. */
  18123. _removeChildren( index, howMany = 1 ) {
  18124. const nodes = this._children._removeNodes( index, howMany );
  18125. for ( const node of nodes ) {
  18126. node.parent = null;
  18127. }
  18128. return nodes;
  18129. }
  18130. /**
  18131. * Creates an `Element` instance from given plain object (i.e. parsed JSON string).
  18132. * Converts `Element` children to proper nodes.
  18133. *
  18134. * @param {Object} json Plain object to be converted to `Element`.
  18135. * @returns {module:engine/model/element~Element} `Element` instance created using given plain object.
  18136. */
  18137. static fromJSON( json ) {
  18138. let children = null;
  18139. if ( json.children ) {
  18140. children = [];
  18141. for ( const child of json.children ) {
  18142. if ( child.name ) {
  18143. // If child has name property, it is an Element.
  18144. children.push( Element.fromJSON( child ) );
  18145. } else {
  18146. // Otherwise, it is a Text node.
  18147. children.push( _text__WEBPACK_IMPORTED_MODULE_2__["default"].fromJSON( child ) );
  18148. }
  18149. }
  18150. }
  18151. return new Element( json.name, json.attributes, children );
  18152. }
  18153. // @if CK_DEBUG_ENGINE // toString() {
  18154. // @if CK_DEBUG_ENGINE // return `<${ this.rootName || this.name }>`;
  18155. // @if CK_DEBUG_ENGINE // }
  18156. // @if CK_DEBUG_ENGINE // log() {
  18157. // @if CK_DEBUG_ENGINE // console.log( 'ModelElement: ' + this );
  18158. // @if CK_DEBUG_ENGINE // }
  18159. // @if CK_DEBUG_ENGINE // logExtended() {
  18160. // @if CK_DEBUG_ENGINE // console.log( `ModelElement: ${ this }, ${ this.childCount } children,
  18161. // @if CK_DEBUG_ENGINE // attrs: ${ convertMapToStringifiedObject( this.getAttributes() ) }` );
  18162. // @if CK_DEBUG_ENGINE // }
  18163. // @if CK_DEBUG_ENGINE // logAll() {
  18164. // @if CK_DEBUG_ENGINE // console.log( '--------------------' );
  18165. // @if CK_DEBUG_ENGINE //
  18166. // @if CK_DEBUG_ENGINE // this.logExtended();
  18167. // @if CK_DEBUG_ENGINE // console.log( 'List of children:' );
  18168. // @if CK_DEBUG_ENGINE //
  18169. // @if CK_DEBUG_ENGINE // for ( const child of this.getChildren() ) {
  18170. // @if CK_DEBUG_ENGINE // child.log();
  18171. // @if CK_DEBUG_ENGINE // }
  18172. // @if CK_DEBUG_ENGINE // }
  18173. // @if CK_DEBUG_ENGINE // printTree( level = 0) {
  18174. // @if CK_DEBUG_ENGINE // let string = '';
  18175. // @if CK_DEBUG_ENGINE // string += '\t'.repeat( level );
  18176. // @if CK_DEBUG_ENGINE // string += `<${ this.rootName || this.name }${ convertMapToTags( this.getAttributes() ) }>`;
  18177. // @if CK_DEBUG_ENGINE // for ( const child of this.getChildren() ) {
  18178. // @if CK_DEBUG_ENGINE // string += '\n';
  18179. // @if CK_DEBUG_ENGINE // if ( child.is( '$text' ) ) {
  18180. // @if CK_DEBUG_ENGINE // const textAttrs = convertMapToTags( child._attrs );
  18181. // @if CK_DEBUG_ENGINE // string += '\t'.repeat( level + 1 );
  18182. // @if CK_DEBUG_ENGINE // if ( textAttrs !== '' ) {
  18183. // @if CK_DEBUG_ENGINE // string += `<$text${ textAttrs }>` + child.data + '</$text>';
  18184. // @if CK_DEBUG_ENGINE // } else {
  18185. // @if CK_DEBUG_ENGINE // string += child.data;
  18186. // @if CK_DEBUG_ENGINE // }
  18187. // @if CK_DEBUG_ENGINE // } else {
  18188. // @if CK_DEBUG_ENGINE // string += child.printTree( level + 1 );
  18189. // @if CK_DEBUG_ENGINE // }
  18190. // @if CK_DEBUG_ENGINE // }
  18191. // @if CK_DEBUG_ENGINE // if ( this.childCount ) {
  18192. // @if CK_DEBUG_ENGINE // string += '\n' + '\t'.repeat( level );
  18193. // @if CK_DEBUG_ENGINE // }
  18194. // @if CK_DEBUG_ENGINE // string += `</${ this.rootName || this.name }>`;
  18195. // @if CK_DEBUG_ENGINE // return string;
  18196. // @if CK_DEBUG_ENGINE // }
  18197. // @if CK_DEBUG_ENGINE // logTree() {
  18198. // @if CK_DEBUG_ENGINE // console.log( this.printTree() );
  18199. // @if CK_DEBUG_ENGINE // }
  18200. }
  18201. // Converts strings to Text and non-iterables to arrays.
  18202. //
  18203. // @param {String|module:engine/model/item~Item|Iterable.<String|module:engine/model/item~Item>}
  18204. // @returns {Iterable.<module:engine/model/node~Node>}
  18205. function normalize( nodes ) {
  18206. // Separate condition because string is iterable.
  18207. if ( typeof nodes == 'string' ) {
  18208. return [ new _text__WEBPACK_IMPORTED_MODULE_2__["default"]( nodes ) ];
  18209. }
  18210. if ( !Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_4__["default"])( nodes ) ) {
  18211. nodes = [ nodes ];
  18212. }
  18213. // Array.from to enable .map() on non-arrays.
  18214. return Array.from( nodes )
  18215. .map( node => {
  18216. if ( typeof node == 'string' ) {
  18217. return new _text__WEBPACK_IMPORTED_MODULE_2__["default"]( node );
  18218. }
  18219. if ( node instanceof _textproxy__WEBPACK_IMPORTED_MODULE_3__["default"] ) {
  18220. return new _text__WEBPACK_IMPORTED_MODULE_2__["default"]( node.data, node.getAttributes() );
  18221. }
  18222. return node;
  18223. } );
  18224. }
  18225. /***/ }),
  18226. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/history.js":
  18227. /*!**********************************************************************!*\
  18228. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/history.js ***!
  18229. \**********************************************************************/
  18230. /*! exports provided: default */
  18231. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18232. "use strict";
  18233. __webpack_require__.r(__webpack_exports__);
  18234. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return History; });
  18235. /**
  18236. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  18237. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  18238. */
  18239. /**
  18240. * @module engine/model/history
  18241. */
  18242. /**
  18243. * `History` keeps the track of all the operations applied to the {@link module:engine/model/document~Document document}.
  18244. */
  18245. class History {
  18246. /**
  18247. * Creates an empty History instance.
  18248. */
  18249. constructor() {
  18250. /**
  18251. * Operations added to the history.
  18252. *
  18253. * @protected
  18254. * @member {Array.<module:engine/model/operation/operation~Operation>} module:engine/model/history~History#_operations
  18255. */
  18256. this._operations = [];
  18257. /**
  18258. * Holds an information which {@link module:engine/model/operation/operation~Operation operation} undoes which
  18259. * {@link module:engine/model/operation/operation~Operation operation}.
  18260. *
  18261. * Keys of the map are "undoing operations", that is operations that undone some other operations. For each key, the
  18262. * value is an operation that has been undone by the "undoing operation".
  18263. *
  18264. * @private
  18265. * @member {Map} module:engine/model/history~History#_undoPairs
  18266. */
  18267. this._undoPairs = new Map();
  18268. /**
  18269. * Holds all undone operations.
  18270. *
  18271. * @private
  18272. * @member {Set.<module:engine/model/operation/operation~Operation>} module:engine/model/history~History#_undoneOperations
  18273. */
  18274. this._undoneOperations = new Set();
  18275. }
  18276. /**
  18277. * Adds an operation to the history.
  18278. *
  18279. * @param {module:engine/model/operation/operation~Operation} operation Operation to add.
  18280. */
  18281. addOperation( operation ) {
  18282. if ( this._operations.includes( operation ) ) {
  18283. return;
  18284. }
  18285. this._operations.push( operation );
  18286. }
  18287. /**
  18288. * Returns operations added to the history.
  18289. *
  18290. * @param {Number} [from=Number.NEGATIVE_INFINITY] Base version from which operations should be returned (inclusive).
  18291. * Defaults to `Number.NEGATIVE_INFINITY`, which means that operations from the first one will be returned.
  18292. * @param {Number} [to=Number.POSITIVE_INFINITY] Base version up to which operations should be returned (exclusive).
  18293. * Defaults to `Number.POSITIVE_INFINITY` which means that operations up to the last one will be returned.
  18294. * @returns {Array.<module:engine/model/operation/operation~Operation>} Operations added to the history.
  18295. */
  18296. getOperations( from = Number.NEGATIVE_INFINITY, to = Number.POSITIVE_INFINITY ) {
  18297. const operations = [];
  18298. for ( const operation of this._operations ) {
  18299. if ( operation.baseVersion >= from && operation.baseVersion < to ) {
  18300. operations.push( operation );
  18301. }
  18302. }
  18303. return operations;
  18304. }
  18305. /**
  18306. * Returns operation from the history that bases on given `baseVersion`.
  18307. *
  18308. * @param {Number} baseVersion Base version of the operation to get.
  18309. * @returns {module:engine/model/operation/operation~Operation|undefined} Operation with given base version or `undefined` if
  18310. * there is no such operation in history.
  18311. */
  18312. getOperation( baseVersion ) {
  18313. for ( const operation of this._operations ) {
  18314. if ( operation.baseVersion == baseVersion ) {
  18315. return operation;
  18316. }
  18317. }
  18318. }
  18319. /**
  18320. * Marks in history that one operation is an operation that is undoing the other operation. By marking operation this way,
  18321. * history is keeping more context information about operations, which helps in operational transformation.
  18322. *
  18323. * @param {module:engine/model/operation/operation~Operation} undoneOperation Operation which is undone by `undoingOperation`.
  18324. * @param {module:engine/model/operation/operation~Operation} undoingOperation Operation which undoes `undoneOperation`.
  18325. */
  18326. setOperationAsUndone( undoneOperation, undoingOperation ) {
  18327. this._undoPairs.set( undoingOperation, undoneOperation );
  18328. this._undoneOperations.add( undoneOperation );
  18329. }
  18330. /**
  18331. * Checks whether given `operation` is undoing any other operation.
  18332. *
  18333. * @param {module:engine/model/operation/operation~Operation} operation Operation to check.
  18334. * @returns {Boolean} `true` if given `operation` is undoing any other operation, `false` otherwise.
  18335. */
  18336. isUndoingOperation( operation ) {
  18337. return this._undoPairs.has( operation );
  18338. }
  18339. /**
  18340. * Checks whether given `operation` has been undone by any other operation.
  18341. *
  18342. * @param {module:engine/model/operation/operation~Operation} operation Operation to check.
  18343. * @returns {Boolean} `true` if given `operation` has been undone any other operation, `false` otherwise.
  18344. */
  18345. isUndoneOperation( operation ) {
  18346. return this._undoneOperations.has( operation );
  18347. }
  18348. /**
  18349. * For given `undoingOperation`, returns the operation which has been undone by it.
  18350. *
  18351. * @param {module:engine/model/operation/operation~Operation} undoingOperation
  18352. * @returns {module:engine/model/operation/operation~Operation|undefined} Operation that has been undone by given
  18353. * `undoingOperation` or `undefined` if given `undoingOperation` is not undoing any other operation.
  18354. */
  18355. getUndoneOperation( undoingOperation ) {
  18356. return this._undoPairs.get( undoingOperation );
  18357. }
  18358. }
  18359. /***/ }),
  18360. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/liveposition.js":
  18361. /*!***************************************************************************!*\
  18362. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/liveposition.js ***!
  18363. \***************************************************************************/
  18364. /*! exports provided: default */
  18365. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18366. "use strict";
  18367. __webpack_require__.r(__webpack_exports__);
  18368. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LivePosition; });
  18369. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  18370. /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  18371. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  18372. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  18373. /**
  18374. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  18375. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  18376. */
  18377. /**
  18378. * @module engine/model/liveposition
  18379. */
  18380. /**
  18381. * `LivePosition` is a type of {@link module:engine/model/position~Position Position}
  18382. * that updates itself as {@link module:engine/model/document~Document document}
  18383. * is changed through operations. It may be used as a bookmark.
  18384. *
  18385. * **Note:** Contrary to {@link module:engine/model/position~Position}, `LivePosition` works only in roots that are
  18386. * {@link module:engine/model/rootelement~RootElement}.
  18387. * If {@link module:engine/model/documentfragment~DocumentFragment} is passed, error will be thrown.
  18388. *
  18389. * **Note:** Be very careful when dealing with `LivePosition`. Each `LivePosition` instance bind events that might
  18390. * have to be unbound.
  18391. * Use {@link module:engine/model/liveposition~LivePosition#detach} whenever you don't need `LivePosition` anymore.
  18392. *
  18393. * @extends module:engine/model/position~Position
  18394. */
  18395. class LivePosition extends _position__WEBPACK_IMPORTED_MODULE_0__["default"] {
  18396. /**
  18397. * Creates a live position.
  18398. *
  18399. * @see module:engine/model/position~Position
  18400. * @param {module:engine/model/rootelement~RootElement} root
  18401. * @param {Array.<Number>} path
  18402. * @param {module:engine/model/position~PositionStickiness} [stickiness]
  18403. */
  18404. constructor( root, path, stickiness = 'toNone' ) {
  18405. super( root, path, stickiness );
  18406. if ( !this.root.is( 'rootElement' ) ) {
  18407. /**
  18408. * LivePosition's root has to be an instance of RootElement.
  18409. *
  18410. * @error model-liveposition-root-not-rootelement
  18411. */
  18412. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__["default"]( 'model-liveposition-root-not-rootelement', root );
  18413. }
  18414. bindWithDocument.call( this );
  18415. }
  18416. /**
  18417. * Unbinds all events previously bound by `LivePosition`. Use it whenever you don't need `LivePosition` instance
  18418. * anymore (i.e. when leaving scope in which it was declared or before re-assigning variable that was
  18419. * referring to it).
  18420. */
  18421. detach() {
  18422. this.stopListening();
  18423. }
  18424. /**
  18425. * Checks whether this object is of the given.
  18426. *
  18427. * livePosition.is( 'position' ); // -> true
  18428. * livePosition.is( 'model:position' ); // -> true
  18429. * livePosition.is( 'liveposition' ); // -> true
  18430. * livePosition.is( 'model:livePosition' ); // -> true
  18431. *
  18432. * livePosition.is( 'view:position' ); // -> false
  18433. * livePosition.is( 'documentSelection' ); // -> false
  18434. *
  18435. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  18436. *
  18437. * @param {String} type
  18438. * @returns {Boolean}
  18439. */
  18440. is( type ) {
  18441. return type === 'livePosition' || type === 'model:livePosition' ||
  18442. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  18443. type == 'position' || type === 'model:position';
  18444. }
  18445. /**
  18446. * Creates a {@link module:engine/model/position~Position position instance}, which is equal to this live position.
  18447. *
  18448. * @returns {module:engine/model/position~Position}
  18449. */
  18450. toPosition() {
  18451. return new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( this.root, this.path.slice(), this.stickiness );
  18452. }
  18453. /**
  18454. * Creates a `LivePosition` instance that is equal to position.
  18455. *
  18456. * @param {module:engine/model/position~Position} position
  18457. * @param {module:engine/model/position~PositionStickiness} [stickiness]
  18458. * @returns {module:engine/model/position~Position}
  18459. */
  18460. static fromPosition( position, stickiness ) {
  18461. return new this( position.root, position.path.slice(), stickiness ? stickiness : position.stickiness );
  18462. }
  18463. /**
  18464. * @static
  18465. * @protected
  18466. * @method module:engine/model/liveposition~LivePosition._createAfter
  18467. * @see module:engine/model/position~Position._createAfter
  18468. * @param {module:engine/model/node~Node} node
  18469. * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone']
  18470. * @returns {module:engine/model/liveposition~LivePosition}
  18471. */
  18472. /**
  18473. * @static
  18474. * @protected
  18475. * @method module:engine/model/liveposition~LivePosition._createBefore
  18476. * @see module:engine/model/position~Position._createBefore
  18477. * @param {module:engine/model/node~Node} node
  18478. * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone']
  18479. * @returns {module:engine/model/liveposition~LivePosition}
  18480. */
  18481. /**
  18482. * @static
  18483. * @protected
  18484. * @method module:engine/model/liveposition~LivePosition._createAt
  18485. * @see module:engine/model/position~Position._createAt
  18486. * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
  18487. * @param {Number|'end'|'before'|'after'} [offset]
  18488. * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone']
  18489. * @returns {module:engine/model/liveposition~LivePosition}
  18490. */
  18491. /**
  18492. * Fired when `LivePosition` instance is changed due to changes on {@link module:engine/model/document~Document}.
  18493. *
  18494. * @event module:engine/model/liveposition~LivePosition#change
  18495. * @param {module:engine/model/position~Position} oldPosition Position equal to this live position before it got changed.
  18496. */
  18497. }
  18498. // Binds this `LivePosition` to the {@link module:engine/model/document~Document document} that owns
  18499. // this position's {@link module:engine/model/position~Position#root root}.
  18500. //
  18501. // @private
  18502. function bindWithDocument() {
  18503. this.listenTo(
  18504. this.root.document.model,
  18505. 'applyOperation',
  18506. ( event, args ) => {
  18507. const operation = args[ 0 ];
  18508. if ( !operation.isDocumentOperation ) {
  18509. return;
  18510. }
  18511. transform.call( this, operation );
  18512. },
  18513. { priority: 'low' }
  18514. );
  18515. }
  18516. // Updates this position accordingly to the updates applied to the model. Bases on change events.
  18517. //
  18518. // @private
  18519. // @param {module:engine/model/operation/operation~Operation} operation Executed operation.
  18520. function transform( operation ) {
  18521. const result = this.getTransformedByOperation( operation );
  18522. if ( !this.isEqual( result ) ) {
  18523. const oldPosition = this.toPosition();
  18524. this.path = result.path;
  18525. this.root = result.root;
  18526. this.fire( 'change', oldPosition );
  18527. }
  18528. }
  18529. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( LivePosition, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  18530. /***/ }),
  18531. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/liverange.js":
  18532. /*!************************************************************************!*\
  18533. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/liverange.js ***!
  18534. \************************************************************************/
  18535. /*! exports provided: default */
  18536. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18537. "use strict";
  18538. __webpack_require__.r(__webpack_exports__);
  18539. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LiveRange; });
  18540. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  18541. /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  18542. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  18543. /**
  18544. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  18545. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  18546. */
  18547. /**
  18548. * @module engine/model/liverange
  18549. */
  18550. /**
  18551. * `LiveRange` is a type of {@link module:engine/model/range~Range Range}
  18552. * that updates itself as {@link module:engine/model/document~Document document}
  18553. * is changed through operations. It may be used as a bookmark.
  18554. *
  18555. * **Note:** Be very careful when dealing with `LiveRange`. Each `LiveRange` instance bind events that might
  18556. * have to be unbound. Use {@link module:engine/model/liverange~LiveRange#detach detach} whenever you don't need `LiveRange` anymore.
  18557. */
  18558. class LiveRange extends _range__WEBPACK_IMPORTED_MODULE_0__["default"] {
  18559. /**
  18560. * Creates a live range.
  18561. *
  18562. * @see module:engine/model/range~Range
  18563. */
  18564. constructor( start, end ) {
  18565. super( start, end );
  18566. bindWithDocument.call( this );
  18567. }
  18568. /**
  18569. * Unbinds all events previously bound by `LiveRange`. Use it whenever you don't need `LiveRange` instance
  18570. * anymore (i.e. when leaving scope in which it was declared or before re-assigning variable that was
  18571. * referring to it).
  18572. */
  18573. detach() {
  18574. this.stopListening();
  18575. }
  18576. /**
  18577. * Checks whether this object is of the given.
  18578. *
  18579. * liveRange.is( 'range' ); // -> true
  18580. * liveRange.is( 'model:range' ); // -> true
  18581. * liveRange.is( 'liveRange' ); // -> true
  18582. * liveRange.is( 'model:liveRange' ); // -> true
  18583. *
  18584. * liveRange.is( 'view:range' ); // -> false
  18585. * liveRange.is( 'documentSelection' ); // -> false
  18586. *
  18587. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  18588. *
  18589. * @param {String} type
  18590. * @returns {Boolean}
  18591. */
  18592. is( type ) {
  18593. return type === 'liveRange' || type === 'model:liveRange' ||
  18594. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  18595. type == 'range' || type === 'model:range';
  18596. }
  18597. /**
  18598. * Creates a {@link module:engine/model/range~Range range instance} that is equal to this live range.
  18599. *
  18600. * @returns {module:engine/model/range~Range}
  18601. */
  18602. toRange() {
  18603. return new _range__WEBPACK_IMPORTED_MODULE_0__["default"]( this.start, this.end );
  18604. }
  18605. /**
  18606. * Creates a `LiveRange` instance that is equal to the given range.
  18607. *
  18608. * @param {module:engine/model/range~Range} range
  18609. * @returns {module:engine/model/liverange~LiveRange}
  18610. */
  18611. static fromRange( range ) {
  18612. return new LiveRange( range.start, range.end );
  18613. }
  18614. /**
  18615. * @see module:engine/model/range~Range._createIn
  18616. * @static
  18617. * @protected
  18618. * @method module:engine/model/liverange~LiveRange._createIn
  18619. * @param {module:engine/model/element~Element} element
  18620. * @returns {module:engine/model/liverange~LiveRange}
  18621. */
  18622. /**
  18623. * @see module:engine/model/range~Range._createOn
  18624. * @static
  18625. * @protected
  18626. * @method module:engine/model/liverange~LiveRange._createOn
  18627. * @param {module:engine/model/element~Element} element
  18628. * @returns {module:engine/model/liverange~LiveRange}
  18629. */
  18630. /**
  18631. * @see module:engine/model/range~Range._createFromPositionAndShift
  18632. * @static
  18633. * @protected
  18634. * @method module:engine/model/liverange~LiveRange._createFromPositionAndShift
  18635. * @param {module:engine/model/position~Position} position
  18636. * @param {Number} shift
  18637. * @returns {module:engine/model/liverange~LiveRange}
  18638. */
  18639. /**
  18640. * Fired when `LiveRange` instance boundaries have changed due to changes in the
  18641. * {@link module:engine/model/document~Document document}.
  18642. *
  18643. * @event change:range
  18644. * @param {module:engine/model/range~Range} oldRange Range with start and end position equal to start and end position of this live
  18645. * range before it got changed.
  18646. * @param {Object} data Object with additional information about the change.
  18647. * @param {module:engine/model/position~Position|null} data.deletionPosition Source position for remove and merge changes.
  18648. * Available if the range was moved to the graveyard root, `null` otherwise.
  18649. */
  18650. /**
  18651. * Fired when `LiveRange` instance boundaries have not changed after a change in {@link module:engine/model/document~Document document}
  18652. * but the change took place inside the range, effectively changing its content.
  18653. *
  18654. * @event change:content
  18655. * @param {module:engine/model/range~Range} range Range with start and end position equal to start and end position of
  18656. * change range.
  18657. * @param {Object} data Object with additional information about the change.
  18658. * @param {null} data.deletionPosition Due to the nature of this event, this property is always set to `null`. It is passed
  18659. * for compatibility with the {@link module:engine/model/liverange~LiveRange#event:change:range} event.
  18660. */
  18661. }
  18662. // Binds this `LiveRange` to the {@link module:engine/model/document~Document document}
  18663. // that owns this range's {@link module:engine/model/range~Range#root root}.
  18664. //
  18665. // @private
  18666. function bindWithDocument() {
  18667. this.listenTo(
  18668. this.root.document.model,
  18669. 'applyOperation',
  18670. ( event, args ) => {
  18671. const operation = args[ 0 ];
  18672. if ( !operation.isDocumentOperation ) {
  18673. return;
  18674. }
  18675. transform.call( this, operation );
  18676. },
  18677. { priority: 'low' }
  18678. );
  18679. }
  18680. // Updates this range accordingly to the updates applied to the model. Bases on change events.
  18681. //
  18682. // @private
  18683. // @param {module:engine/model/operation/operation~Operation} operation Executed operation.
  18684. function transform( operation ) {
  18685. // Transform the range by the operation. Join the result ranges if needed.
  18686. const ranges = this.getTransformedByOperation( operation );
  18687. const result = _range__WEBPACK_IMPORTED_MODULE_0__["default"]._createFromRanges( ranges );
  18688. const boundariesChanged = !result.isEqual( this );
  18689. const contentChanged = doesOperationChangeRangeContent( this, operation );
  18690. let deletionPosition = null;
  18691. if ( boundariesChanged ) {
  18692. // If range boundaries have changed, fire `change:range` event.
  18693. //
  18694. if ( result.root.rootName == '$graveyard' ) {
  18695. // If the range was moved to the graveyard root, set `deletionPosition`.
  18696. if ( operation.type == 'remove' ) {
  18697. deletionPosition = operation.sourcePosition;
  18698. } else {
  18699. // Merge operation.
  18700. deletionPosition = operation.deletionPosition;
  18701. }
  18702. }
  18703. const oldRange = this.toRange();
  18704. this.start = result.start;
  18705. this.end = result.end;
  18706. this.fire( 'change:range', oldRange, { deletionPosition } );
  18707. } else if ( contentChanged ) {
  18708. // If range boundaries have not changed, but there was change inside the range, fire `change:content` event.
  18709. this.fire( 'change:content', this.toRange(), { deletionPosition } );
  18710. }
  18711. }
  18712. // Checks whether given operation changes something inside the range (even if it does not change boundaries).
  18713. //
  18714. // @private
  18715. // @param {module:engine/model/range~Range} range Range to check.
  18716. // @param {module:engine/model/operation/operation~Operation} operation Executed operation.
  18717. // @returns {Boolean}
  18718. function doesOperationChangeRangeContent( range, operation ) {
  18719. switch ( operation.type ) {
  18720. case 'insert':
  18721. return range.containsPosition( operation.position );
  18722. case 'move':
  18723. case 'remove':
  18724. case 'reinsert':
  18725. case 'merge':
  18726. return range.containsPosition( operation.sourcePosition ) ||
  18727. range.start.isEqual( operation.sourcePosition ) ||
  18728. range.containsPosition( operation.targetPosition );
  18729. case 'split':
  18730. return range.containsPosition( operation.splitPosition ) || range.containsPosition( operation.insertionPosition );
  18731. }
  18732. return false;
  18733. }
  18734. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( LiveRange, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  18735. /***/ }),
  18736. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/markercollection.js":
  18737. /*!*******************************************************************************!*\
  18738. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/markercollection.js ***!
  18739. \*******************************************************************************/
  18740. /*! exports provided: default */
  18741. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18742. "use strict";
  18743. __webpack_require__.r(__webpack_exports__);
  18744. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MarkerCollection; });
  18745. /* harmony import */ var _liverange__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./liverange */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/liverange.js");
  18746. /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  18747. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  18748. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  18749. /**
  18750. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  18751. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  18752. */
  18753. /**
  18754. * @module engine/model/markercollection
  18755. */
  18756. /**
  18757. * The collection of all {@link module:engine/model/markercollection~Marker markers} attached to the document.
  18758. * It lets you {@link module:engine/model/markercollection~MarkerCollection#get get} markers or track them using
  18759. * {@link module:engine/model/markercollection~MarkerCollection#event:update} event.
  18760. *
  18761. * To create, change or remove makers use {@link module:engine/model/writer~Writer model writers'} methods:
  18762. * {@link module:engine/model/writer~Writer#addMarker} or {@link module:engine/model/writer~Writer#removeMarker}. Since
  18763. * the writer is the only proper way to change the data model it is not possible to change markers directly using this
  18764. * collection. All markers created by the writer will be automatically added to this collection.
  18765. *
  18766. * By default there is one marker collection available as {@link module:engine/model/model~Model#markers model property}.
  18767. *
  18768. * @see module:engine/model/markercollection~Marker
  18769. */
  18770. class MarkerCollection {
  18771. /**
  18772. * Creates a markers collection.
  18773. */
  18774. constructor() {
  18775. /**
  18776. * Stores {@link ~Marker markers} added to the collection.
  18777. *
  18778. * @private
  18779. * @member {Map} #_markers
  18780. */
  18781. this._markers = new Map();
  18782. }
  18783. /**
  18784. * Iterable interface.
  18785. *
  18786. * Iterates over all {@link ~Marker markers} added to the collection.
  18787. *
  18788. * @returns {Iterable}
  18789. */
  18790. [ Symbol.iterator ]() {
  18791. return this._markers.values();
  18792. }
  18793. /**
  18794. * Checks if marker with given `markerName` is in the collection.
  18795. *
  18796. * @param {String} markerName Marker name.
  18797. * @returns {Boolean} `true` if marker with given `markerName` is in the collection, `false` otherwise.
  18798. */
  18799. has( markerName ) {
  18800. return this._markers.has( markerName );
  18801. }
  18802. /**
  18803. * Returns {@link ~Marker marker} with given `markerName`.
  18804. *
  18805. * @param {String} markerName Name of marker to get.
  18806. * @returns {module:engine/model/markercollection~Marker|null} Marker with given name or `null` if such marker was
  18807. * not added to the collection.
  18808. */
  18809. get( markerName ) {
  18810. return this._markers.get( markerName ) || null;
  18811. }
  18812. /**
  18813. * Creates and adds a {@link ~Marker marker} to the `MarkerCollection` with given name on given
  18814. * {@link module:engine/model/range~Range range}.
  18815. *
  18816. * If `MarkerCollection` already had a marker with given name (or {@link ~Marker marker} was passed), the marker in
  18817. * collection is updated and {@link module:engine/model/markercollection~MarkerCollection#event:update} event is fired
  18818. * but only if there was a change (marker range or {@link module:engine/model/markercollection~Marker#managedUsingOperations}
  18819. * flag has changed.
  18820. *
  18821. * @protected
  18822. * @fires module:engine/model/markercollection~MarkerCollection#event:update
  18823. * @param {String|module:engine/model/markercollection~Marker} markerOrName Name of marker to set or marker instance to update.
  18824. * @param {module:engine/model/range~Range} range Marker range.
  18825. * @param {Boolean} [managedUsingOperations=false] Specifies whether the marker is managed using operations.
  18826. * @param {Boolean} [affectsData=false] Specifies whether the marker affects the data produced by the data pipeline
  18827. * (is persisted in the editor's data).
  18828. * @returns {module:engine/model/markercollection~Marker} `Marker` instance which was added or updated.
  18829. */
  18830. _set( markerOrName, range, managedUsingOperations = false, affectsData = false ) {
  18831. const markerName = markerOrName instanceof Marker ? markerOrName.name : markerOrName;
  18832. if ( markerName.includes( ',' ) ) {
  18833. /**
  18834. * Marker name cannot contain the "," character.
  18835. *
  18836. * @error markercollection-incorrect-marker-name
  18837. */
  18838. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'markercollection-incorrect-marker-name', this );
  18839. }
  18840. const oldMarker = this._markers.get( markerName );
  18841. if ( oldMarker ) {
  18842. const oldRange = oldMarker.getRange();
  18843. let hasChanged = false;
  18844. if ( !oldRange.isEqual( range ) ) {
  18845. oldMarker._attachLiveRange( _liverange__WEBPACK_IMPORTED_MODULE_0__["default"].fromRange( range ) );
  18846. hasChanged = true;
  18847. }
  18848. if ( managedUsingOperations != oldMarker.managedUsingOperations ) {
  18849. oldMarker._managedUsingOperations = managedUsingOperations;
  18850. hasChanged = true;
  18851. }
  18852. if ( typeof affectsData === 'boolean' && affectsData != oldMarker.affectsData ) {
  18853. oldMarker._affectsData = affectsData;
  18854. hasChanged = true;
  18855. }
  18856. if ( hasChanged ) {
  18857. this.fire( 'update:' + markerName, oldMarker, oldRange, range );
  18858. }
  18859. return oldMarker;
  18860. }
  18861. const liveRange = _liverange__WEBPACK_IMPORTED_MODULE_0__["default"].fromRange( range );
  18862. const marker = new Marker( markerName, liveRange, managedUsingOperations, affectsData );
  18863. this._markers.set( markerName, marker );
  18864. this.fire( 'update:' + markerName, marker, null, range );
  18865. return marker;
  18866. }
  18867. /**
  18868. * Removes given {@link ~Marker marker} or a marker with given name from the `MarkerCollection`.
  18869. *
  18870. * @protected
  18871. * @fires module:engine/model/markercollection~MarkerCollection#event:update
  18872. * @param {String} markerOrName Marker or name of a marker to remove.
  18873. * @returns {Boolean} `true` if marker was found and removed, `false` otherwise.
  18874. */
  18875. _remove( markerOrName ) {
  18876. const markerName = markerOrName instanceof Marker ? markerOrName.name : markerOrName;
  18877. const oldMarker = this._markers.get( markerName );
  18878. if ( oldMarker ) {
  18879. this._markers.delete( markerName );
  18880. this.fire( 'update:' + markerName, oldMarker, oldMarker.getRange(), null );
  18881. this._destroyMarker( oldMarker );
  18882. return true;
  18883. }
  18884. return false;
  18885. }
  18886. /**
  18887. * Fires an {@link module:engine/model/markercollection~MarkerCollection#event:update} event for the given {@link ~Marker marker}
  18888. * but does not change the marker. Useful to force {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher downcast
  18889. * conversion} for the marker.
  18890. *
  18891. * @protected
  18892. * @fires module:engine/model/markercollection~MarkerCollection#event:update
  18893. * @param {String} markerOrName Marker or name of a marker to refresh.
  18894. */
  18895. _refresh( markerOrName ) {
  18896. const markerName = markerOrName instanceof Marker ? markerOrName.name : markerOrName;
  18897. const marker = this._markers.get( markerName );
  18898. if ( !marker ) {
  18899. /**
  18900. * Marker with provided name does not exists.
  18901. *
  18902. * @error markercollection-refresh-marker-not-exists
  18903. */
  18904. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'markercollection-refresh-marker-not-exists', this );
  18905. }
  18906. const range = marker.getRange();
  18907. this.fire( 'update:' + markerName, marker, range, range, marker.managedUsingOperations, marker.affectsData );
  18908. }
  18909. /**
  18910. * Returns iterator that iterates over all markers, which ranges contain given {@link module:engine/model/position~Position position}.
  18911. *
  18912. * @param {module:engine/model/position~Position} position
  18913. * @returns {Iterable.<module:engine/model/markercollection~Marker>}
  18914. */
  18915. * getMarkersAtPosition( position ) {
  18916. for ( const marker of this ) {
  18917. if ( marker.getRange().containsPosition( position ) ) {
  18918. yield marker;
  18919. }
  18920. }
  18921. }
  18922. /**
  18923. * Returns iterator that iterates over all markers, which intersects with given {@link module:engine/model/range~Range range}.
  18924. *
  18925. * @param {module:engine/model/range~Range} range
  18926. * @returns {Iterable.<module:engine/model/markercollection~Marker>}
  18927. */
  18928. * getMarkersIntersectingRange( range ) {
  18929. for ( const marker of this ) {
  18930. if ( marker.getRange().getIntersection( range ) !== null ) {
  18931. yield marker;
  18932. }
  18933. }
  18934. }
  18935. /**
  18936. * Destroys marker collection and all markers inside it.
  18937. */
  18938. destroy() {
  18939. for ( const marker of this._markers.values() ) {
  18940. this._destroyMarker( marker );
  18941. }
  18942. this._markers = null;
  18943. this.stopListening();
  18944. }
  18945. /**
  18946. * Iterates over all markers that starts with given `prefix`.
  18947. *
  18948. * const markerFooA = markersCollection.set( 'foo:a', rangeFooA );
  18949. * const markerFooB = markersCollection.set( 'foo:b', rangeFooB );
  18950. * const markerBarA = markersCollection.set( 'bar:a', rangeBarA );
  18951. * const markerFooBarA = markersCollection.set( 'foobar:a', rangeFooBarA );
  18952. * Array.from( markersCollection.getMarkersGroup( 'foo' ) ); // [ markerFooA, markerFooB ]
  18953. * Array.from( markersCollection.getMarkersGroup( 'a' ) ); // []
  18954. *
  18955. * @param prefix
  18956. * @returns {Iterable.<module:engine/model/markercollection~Marker>}
  18957. */
  18958. * getMarkersGroup( prefix ) {
  18959. for ( const marker of this._markers.values() ) {
  18960. if ( marker.name.startsWith( prefix + ':' ) ) {
  18961. yield marker;
  18962. }
  18963. }
  18964. }
  18965. /**
  18966. * Destroys the marker.
  18967. *
  18968. * @private
  18969. * @param {module:engine/model/markercollection~Marker} marker Marker to destroy.
  18970. */
  18971. _destroyMarker( marker ) {
  18972. marker.stopListening();
  18973. marker._detachLiveRange();
  18974. }
  18975. /**
  18976. * Fired whenever marker is added, updated or removed from `MarkerCollection`.
  18977. *
  18978. * @event update
  18979. * @param {module:engine/model/markercollection~Marker} marker Updated Marker.
  18980. * @param {module:engine/model/range~Range|null} oldRange Marker range before the update. When is not defined it
  18981. * means that marker is just added.
  18982. * @param {module:engine/model/range~Range|null} newRange Marker range after update. When is not defined it
  18983. * means that marker is just removed.
  18984. */
  18985. }
  18986. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_3__["default"])( MarkerCollection, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  18987. /**
  18988. * `Marker` is a continuous parts of model (like a range), is named and represent some kind of information about marked
  18989. * part of model document. In contrary to {@link module:engine/model/node~Node nodes}, which are building blocks of
  18990. * model document tree, markers are not stored directly in document tree but in
  18991. * {@link module:engine/model/model~Model#markers model markers' collection}. Still, they are document data, by giving
  18992. * additional meaning to the part of a model document between marker start and marker end.
  18993. *
  18994. * In this sense, markers are similar to adding and converting attributes on nodes. The difference is that attribute is
  18995. * connected with a given node (e.g. a character is bold no matter if it gets moved or content around it changes).
  18996. * Markers on the other hand are continuous ranges and are characterized by their start and end position. This means that
  18997. * any character in the marker is marked by the marker. For example, if a character is moved outside of marker it stops being
  18998. * "special" and the marker is shrunk. Similarly, when a character is moved into the marker from other place in document
  18999. * model, it starts being "special" and the marker is enlarged.
  19000. *
  19001. * Another upside of markers is that finding marked part of document is fast and easy. Using attributes to mark some nodes
  19002. * and then trying to find that part of document would require traversing whole document tree. Marker gives instant access
  19003. * to the range which it is marking at the moment.
  19004. *
  19005. * Markers are built from a name and a range.
  19006. *
  19007. * Range of the marker is updated automatically when document changes, using
  19008. * {@link module:engine/model/liverange~LiveRange live range} mechanism.
  19009. *
  19010. * Name is used to group and identify markers. Names have to be unique, but markers can be grouped by
  19011. * using common prefixes, separated with `:`, for example: `user:john` or `search:3`. That's useful in term of creating
  19012. * namespaces for custom elements (e.g. comments, highlights). You can use this prefixes in
  19013. * {@link module:engine/model/markercollection~MarkerCollection#event:update} listeners to listen on changes in a group of markers.
  19014. * For instance: `model.markers.on( 'update:user', callback );` will be called whenever any `user:*` markers changes.
  19015. *
  19016. * There are two types of markers.
  19017. *
  19018. * 1. Markers managed directly, without using operations. They are added directly by {@link module:engine/model/writer~Writer}
  19019. * to the {@link module:engine/model/markercollection~MarkerCollection} without any additional mechanism. They can be used
  19020. * as bookmarks or visual markers. They are great for showing results of the find, or select link when the focus is in the input.
  19021. *
  19022. * 1. Markers managed using operations. These markers are also stored in {@link module:engine/model/markercollection~MarkerCollection}
  19023. * but changes in these markers is managed the same way all other changes in the model structure - using operations.
  19024. * Therefore, they are handled in the undo stack and synchronized between clients if the collaboration plugin is enabled.
  19025. * This type of markers is useful for solutions like spell checking or comments.
  19026. *
  19027. * Both type of them should be added / updated by {@link module:engine/model/writer~Writer#addMarker}
  19028. * and removed by {@link module:engine/model/writer~Writer#removeMarker} methods.
  19029. *
  19030. * model.change( ( writer ) => {
  19031. * const marker = writer.addMarker( name, { range, usingOperation: true } );
  19032. *
  19033. * // ...
  19034. *
  19035. * writer.removeMarker( marker );
  19036. * } );
  19037. *
  19038. * See {@link module:engine/model/writer~Writer} to find more examples.
  19039. *
  19040. * Since markers need to track change in the document, for efficiency reasons, it is best to create and keep as little
  19041. * markers as possible and remove them as soon as they are not needed anymore.
  19042. *
  19043. * Markers can be downcasted and upcasted.
  19044. *
  19045. * Markers downcast happens on {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker} and
  19046. * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:removeMarker} events.
  19047. * Use {@link module:engine/conversion/downcasthelpers downcast converters} or attach a custom converter to mentioned events.
  19048. * For {@link module:engine/controller/datacontroller~DataController data pipeline}, marker should be downcasted to an element.
  19049. * Then, it can be upcasted back to a marker. Again, use {@link module:engine/conversion/upcasthelpers upcast converters} or
  19050. * attach a custom converter to {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element}.
  19051. *
  19052. * `Marker` instances are created and destroyed only by {@link ~MarkerCollection MarkerCollection}.
  19053. */
  19054. class Marker {
  19055. /**
  19056. * Creates a marker instance.
  19057. *
  19058. * @param {String} name Marker name.
  19059. * @param {module:engine/model/liverange~LiveRange} liveRange Range marked by the marker.
  19060. * @param {Boolean} managedUsingOperations Specifies whether the marker is managed using operations.
  19061. * @param {Boolean} affectsData Specifies whether the marker affects the data produced by the data pipeline
  19062. * (is persisted in the editor's data).
  19063. */
  19064. constructor( name, liveRange, managedUsingOperations, affectsData ) {
  19065. /**
  19066. * Marker's name.
  19067. *
  19068. * @readonly
  19069. * @type {String}
  19070. */
  19071. this.name = name;
  19072. /**
  19073. * Range marked by the marker.
  19074. *
  19075. * @protected
  19076. * @member {module:engine/model/liverange~LiveRange}
  19077. */
  19078. this._liveRange = this._attachLiveRange( liveRange );
  19079. /**
  19080. * Flag indicates if the marker is managed using operations or not.
  19081. *
  19082. * @private
  19083. * @member {Boolean}
  19084. */
  19085. this._managedUsingOperations = managedUsingOperations;
  19086. /**
  19087. * Specifies whether the marker affects the data produced by the data pipeline
  19088. * (is persisted in the editor's data).
  19089. *
  19090. * @private
  19091. * @member {Boolean}
  19092. */
  19093. this._affectsData = affectsData;
  19094. }
  19095. /**
  19096. * A value indicating if the marker is managed using operations.
  19097. * See {@link ~Marker marker class description} to learn more about marker types.
  19098. * See {@link module:engine/model/writer~Writer#addMarker}.
  19099. *
  19100. * @returns {Boolean}
  19101. */
  19102. get managedUsingOperations() {
  19103. if ( !this._liveRange ) {
  19104. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'marker-destroyed', this );
  19105. }
  19106. return this._managedUsingOperations;
  19107. }
  19108. /**
  19109. * A value indicating if the marker changes the data.
  19110. *
  19111. * @returns {Boolean}
  19112. */
  19113. get affectsData() {
  19114. if ( !this._liveRange ) {
  19115. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'marker-destroyed', this );
  19116. }
  19117. return this._affectsData;
  19118. }
  19119. /**
  19120. * Returns current marker start position.
  19121. *
  19122. * @returns {module:engine/model/position~Position}
  19123. */
  19124. getStart() {
  19125. if ( !this._liveRange ) {
  19126. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'marker-destroyed', this );
  19127. }
  19128. return this._liveRange.start.clone();
  19129. }
  19130. /**
  19131. * Returns current marker end position.
  19132. *
  19133. * @returns {module:engine/model/position~Position}
  19134. */
  19135. getEnd() {
  19136. if ( !this._liveRange ) {
  19137. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'marker-destroyed', this );
  19138. }
  19139. return this._liveRange.end.clone();
  19140. }
  19141. /**
  19142. * Returns a range that represents the current state of the marker.
  19143. *
  19144. * Keep in mind that returned value is a {@link module:engine/model/range~Range Range}, not a
  19145. * {@link module:engine/model/liverange~LiveRange LiveRange}. This means that it is up-to-date and relevant only
  19146. * until next model document change. Do not store values returned by this method. Instead, store {@link ~Marker#name}
  19147. * and get `Marker` instance from {@link module:engine/model/markercollection~MarkerCollection MarkerCollection} every
  19148. * time there is a need to read marker properties. This will guarantee that the marker has not been removed and
  19149. * that it's data is up-to-date.
  19150. *
  19151. * @returns {module:engine/model/range~Range}
  19152. */
  19153. getRange() {
  19154. if ( !this._liveRange ) {
  19155. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'marker-destroyed', this );
  19156. }
  19157. return this._liveRange.toRange();
  19158. }
  19159. /**
  19160. * Checks whether this object is of the given.
  19161. *
  19162. * marker.is( 'marker' ); // -> true
  19163. * marker.is( 'model:marker' ); // -> true
  19164. *
  19165. * marker.is( 'view:element' ); // -> false
  19166. * marker.is( 'documentSelection' ); // -> false
  19167. *
  19168. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  19169. *
  19170. * @param {String} type
  19171. * @returns {Boolean}
  19172. */
  19173. is( type ) {
  19174. return type === 'marker' || type === 'model:marker';
  19175. }
  19176. /**
  19177. * Binds new live range to the marker and detach the old one if is attached.
  19178. *
  19179. * @protected
  19180. * @param {module:engine/model/liverange~LiveRange} liveRange Live range to attach
  19181. * @returns {module:engine/model/liverange~LiveRange} Attached live range.
  19182. */
  19183. _attachLiveRange( liveRange ) {
  19184. if ( this._liveRange ) {
  19185. this._detachLiveRange();
  19186. }
  19187. // Delegating does not work with namespaces. Alternatively, we could delegate all events (using `*`).
  19188. liveRange.delegate( 'change:range' ).to( this );
  19189. liveRange.delegate( 'change:content' ).to( this );
  19190. this._liveRange = liveRange;
  19191. return liveRange;
  19192. }
  19193. /**
  19194. * Unbinds and destroys currently attached live range.
  19195. *
  19196. * @protected
  19197. */
  19198. _detachLiveRange() {
  19199. this._liveRange.stopDelegating( 'change:range', this );
  19200. this._liveRange.stopDelegating( 'change:content', this );
  19201. this._liveRange.detach();
  19202. this._liveRange = null;
  19203. }
  19204. /**
  19205. * Fired whenever {@link ~Marker#_liveRange marker range} is changed due to changes on {@link module:engine/model/document~Document}.
  19206. * This is a delegated {@link module:engine/model/liverange~LiveRange#event:change:range LiveRange change:range event}.
  19207. *
  19208. * When marker is removed from {@link module:engine/model/markercollection~MarkerCollection MarkerCollection},
  19209. * all event listeners listening to it should be removed. It is best to do it on
  19210. * {@link module:engine/model/markercollection~MarkerCollection#event:update MarkerCollection update event}.
  19211. *
  19212. * @see module:engine/model/liverange~LiveRange#event:change:range
  19213. * @event change:range
  19214. * @param {module:engine/model/range~Range} oldRange
  19215. * @param {Object} data
  19216. */
  19217. /**
  19218. * Fired whenever change on {@link module:engine/model/document~Document} is done inside {@link ~Marker#_liveRange marker range}.
  19219. * This is a delegated {@link module:engine/model/liverange~LiveRange#event:change:content LiveRange change:content event}.
  19220. *
  19221. * When marker is removed from {@link module:engine/model/markercollection~MarkerCollection MarkerCollection},
  19222. * all event listeners listening to it should be removed. It is best to do it on
  19223. * {@link module:engine/model/markercollection~MarkerCollection#event:update MarkerCollection update event}.
  19224. *
  19225. * @see module:engine/model/liverange~LiveRange#event:change:content
  19226. * @event change:content
  19227. * @param {module:engine/model/range~Range} oldRange
  19228. * @param {Object} data
  19229. */
  19230. }
  19231. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_3__["default"])( Marker, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  19232. /**
  19233. * Cannot use a {@link module:engine/model/markercollection~MarkerCollection#destroy destroyed marker} instance.
  19234. *
  19235. * @error marker-destroyed
  19236. */
  19237. /***/ }),
  19238. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/model.js":
  19239. /*!********************************************************************!*\
  19240. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/model.js ***!
  19241. \********************************************************************/
  19242. /*! exports provided: default */
  19243. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19244. "use strict";
  19245. __webpack_require__.r(__webpack_exports__);
  19246. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Model; });
  19247. /* harmony import */ var _batch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./batch */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/batch.js");
  19248. /* harmony import */ var _writer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./writer */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/writer.js");
  19249. /* harmony import */ var _schema__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./schema */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/schema.js");
  19250. /* harmony import */ var _document__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./document */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/document.js");
  19251. /* harmony import */ var _markercollection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./markercollection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/markercollection.js");
  19252. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  19253. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  19254. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
  19255. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  19256. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  19257. /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/selection.js");
  19258. /* harmony import */ var _operation_operationfactory__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./operation/operationfactory */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operationfactory.js");
  19259. /* harmony import */ var _utils_insertcontent__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./utils/insertcontent */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/insertcontent.js");
  19260. /* harmony import */ var _utils_deletecontent__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./utils/deletecontent */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/deletecontent.js");
  19261. /* harmony import */ var _utils_modifyselection__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./utils/modifyselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/modifyselection.js");
  19262. /* harmony import */ var _utils_getselectedcontent__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./utils/getselectedcontent */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/getselectedcontent.js");
  19263. /* harmony import */ var _utils_selection_post_fixer__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./utils/selection-post-fixer */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/selection-post-fixer.js");
  19264. /* harmony import */ var _utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./utils/autoparagraphing */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/autoparagraphing.js");
  19265. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  19266. /**
  19267. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  19268. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  19269. */
  19270. /**
  19271. * @module engine/model/model
  19272. */
  19273. // @if CK_DEBUG_ENGINE // const { dumpTrees } = require( '../dev-utils/utils' );
  19274. // @if CK_DEBUG_ENGINE // const { OperationReplayer } = require( '../dev-utils/operationreplayer' ).default;
  19275. /**
  19276. * Editor's data model. Read about the model in the
  19277. * {@glink framework/guides/architecture/editing-engine engine architecture guide}.
  19278. *
  19279. * @mixes module:utils/observablemixin~ObservableMixin
  19280. */
  19281. class Model {
  19282. constructor() {
  19283. /**
  19284. * Model's marker collection.
  19285. *
  19286. * @readonly
  19287. * @member {module:engine/model/markercollection~MarkerCollection}
  19288. */
  19289. this.markers = new _markercollection__WEBPACK_IMPORTED_MODULE_4__["default"]();
  19290. /**
  19291. * Model's document.
  19292. *
  19293. * @readonly
  19294. * @member {module:engine/model/document~Document}
  19295. */
  19296. this.document = new _document__WEBPACK_IMPORTED_MODULE_3__["default"]( this );
  19297. /**
  19298. * Model's schema.
  19299. *
  19300. * @readonly
  19301. * @member {module:engine/model/schema~Schema}
  19302. */
  19303. this.schema = new _schema__WEBPACK_IMPORTED_MODULE_2__["default"]();
  19304. /**
  19305. * All callbacks added by {@link module:engine/model/model~Model#change} or
  19306. * {@link module:engine/model/model~Model#enqueueChange} methods waiting to be executed.
  19307. *
  19308. * @private
  19309. * @type {Array.<Function>}
  19310. */
  19311. this._pendingChanges = [];
  19312. /**
  19313. * The last created and currently used writer instance.
  19314. *
  19315. * @private
  19316. * @member {module:engine/model/writer~Writer}
  19317. */
  19318. this._currentWriter = null;
  19319. [ 'insertContent', 'deleteContent', 'modifySelection', 'getSelectedContent', 'applyOperation' ]
  19320. .forEach( methodName => this.decorate( methodName ) );
  19321. // Adding operation validation with `highest` priority, so it is called before any other feature would like
  19322. // to do anything with the operation. If the operation has incorrect parameters it should throw on the earliest occasion.
  19323. this.on( 'applyOperation', ( evt, args ) => {
  19324. const operation = args[ 0 ];
  19325. operation._validate();
  19326. }, { priority: 'highest' } );
  19327. // Register some default abstract entities.
  19328. this.schema.register( '$root', {
  19329. isLimit: true
  19330. } );
  19331. this.schema.register( '$block', {
  19332. allowIn: '$root',
  19333. isBlock: true
  19334. } );
  19335. this.schema.register( '$text', {
  19336. allowIn: '$block',
  19337. isInline: true,
  19338. isContent: true
  19339. } );
  19340. this.schema.register( '$clipboardHolder', {
  19341. allowContentOf: '$root',
  19342. isLimit: true
  19343. } );
  19344. this.schema.extend( '$text', { allowIn: '$clipboardHolder' } );
  19345. // An element needed by the `upcastElementToMarker` converter.
  19346. // This element temporarily represents a marker boundary during the conversion process and is removed
  19347. // at the end of the conversion. `UpcastDispatcher` or at least `Conversion` class looks like a
  19348. // better place for this registration but both know nothing about `Schema`.
  19349. this.schema.register( '$marker' );
  19350. this.schema.addChildCheck( ( context, childDefinition ) => {
  19351. if ( childDefinition.name === '$marker' ) {
  19352. return true;
  19353. }
  19354. } );
  19355. Object(_utils_selection_post_fixer__WEBPACK_IMPORTED_MODULE_16__["injectSelectionPostFixer"])( this );
  19356. // Post-fixer which takes care of adding empty paragraph elements to the empty roots.
  19357. this.document.registerPostFixer( _utils_autoparagraphing__WEBPACK_IMPORTED_MODULE_17__["autoParagraphEmptyRoots"] );
  19358. // @if CK_DEBUG_ENGINE // this.on( 'applyOperation', () => {
  19359. // @if CK_DEBUG_ENGINE // dumpTrees( this.document, this.document.version );
  19360. // @if CK_DEBUG_ENGINE // }, { priority: 'lowest' } );
  19361. }
  19362. /**
  19363. * The `change()` method is the primary way of changing the model. You should use it to modify all document nodes
  19364. * (including detached nodes – i.e. nodes not added to the {@link module:engine/model/model~Model#document model document}),
  19365. * the {@link module:engine/model/document~Document#selection document's selection}, and
  19366. * {@link module:engine/model/model~Model#markers model markers}.
  19367. *
  19368. * model.change( writer => {
  19369. * writer.insertText( 'foo', paragraph, 'end' );
  19370. * } );
  19371. *
  19372. * All changes inside the change block use the same {@link module:engine/model/batch~Batch} so they are combined
  19373. * into a single undo step.
  19374. *
  19375. * model.change( writer => {
  19376. * writer.insertText( 'foo', paragraph, 'end' ); // foo.
  19377. *
  19378. * model.change( writer => {
  19379. * writer.insertText( 'bar', paragraph, 'end' ); // foobar.
  19380. * } );
  19381. *
  19382. * writer.insertText( 'bom', paragraph, 'end' ); // foobarbom.
  19383. * } );
  19384. *
  19385. * The callback of the `change()` block is executed synchronously.
  19386. *
  19387. * You can also return a value from the change block.
  19388. *
  19389. * const img = model.change( writer => {
  19390. * return writer.createElement( 'img' );
  19391. * } );
  19392. *
  19393. * @see #enqueueChange
  19394. * @param {Function} callback Callback function which may modify the model.
  19395. * @returns {*} Value returned by the callback.
  19396. */
  19397. change( callback ) {
  19398. try {
  19399. if ( this._pendingChanges.length === 0 ) {
  19400. // If this is the outermost block, create a new batch and start `_runPendingChanges` execution flow.
  19401. this._pendingChanges.push( { batch: new _batch__WEBPACK_IMPORTED_MODULE_0__["default"](), callback } );
  19402. return this._runPendingChanges()[ 0 ];
  19403. } else {
  19404. // If this is not the outermost block, just execute the callback.
  19405. return callback( this._currentWriter );
  19406. }
  19407. } catch ( err ) {
  19408. // @if CK_DEBUG // throw err;
  19409. /* istanbul ignore next */
  19410. _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_18__["default"].rethrowUnexpectedError( err, this );
  19411. }
  19412. }
  19413. /**
  19414. * The `enqueueChange()` method performs similar task as the {@link #change `change()` method}, with two major differences.
  19415. *
  19416. * First, the callback of `enqueueChange()` is executed when all other enqueued changes are done. It might be executed
  19417. * immediately if it is not nested in any other change block, but if it is nested in another (enqueue)change block,
  19418. * it will be delayed and executed after the outermost block.
  19419. *
  19420. * model.change( writer => {
  19421. * console.log( 1 );
  19422. *
  19423. * model.enqueueChange( writer => {
  19424. * console.log( 2 );
  19425. * } );
  19426. *
  19427. * console.log( 3 );
  19428. * } ); // Will log: 1, 3, 2.
  19429. *
  19430. * In addition to that, the changes enqueued with `enqueueChange()` will be converted separately from the changes
  19431. * done in the outer `change()` block.
  19432. *
  19433. * Second, it lets you define the {@link module:engine/model/batch~Batch} into which you want to add your changes.
  19434. * By default, a new batch is created. In the sample above, `change` and `enqueueChange` blocks use a different
  19435. * batch (and different {@link module:engine/model/writer~Writer} since each of them operates on the separate batch).
  19436. *
  19437. * When using the `enqueueChange()` block you can also add some changes to the batch you used before.
  19438. *
  19439. * model.enqueueChange( batch, writer => {
  19440. * writer.insertText( 'foo', paragraph, 'end' );
  19441. * } );
  19442. *
  19443. * In order to make a nested `enqueueChange()` create a single undo step together with the changes done in the outer `change()`
  19444. * block, you can obtain the batch instance from the {@link module:engine/model/writer~Writer#batch writer} of the outer block.
  19445. *
  19446. * @param {module:engine/model/batch~Batch|'transparent'|'default'} batchOrType Batch or batch type should be used in the callback.
  19447. * If not defined, a new batch will be created.
  19448. * @param {Function} callback Callback function which may modify the model.
  19449. */
  19450. enqueueChange( batchOrType, callback ) {
  19451. try {
  19452. if ( typeof batchOrType === 'string' ) {
  19453. batchOrType = new _batch__WEBPACK_IMPORTED_MODULE_0__["default"]( batchOrType );
  19454. } else if ( typeof batchOrType == 'function' ) {
  19455. callback = batchOrType;
  19456. batchOrType = new _batch__WEBPACK_IMPORTED_MODULE_0__["default"]();
  19457. }
  19458. this._pendingChanges.push( { batch: batchOrType, callback } );
  19459. if ( this._pendingChanges.length == 1 ) {
  19460. this._runPendingChanges();
  19461. }
  19462. } catch ( err ) {
  19463. // @if CK_DEBUG // throw err;
  19464. /* istanbul ignore next */
  19465. _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_18__["default"].rethrowUnexpectedError( err, this );
  19466. }
  19467. }
  19468. /**
  19469. * {@link module:utils/observablemixin~ObservableMixin#decorate Decorated} function for applying
  19470. * {@link module:engine/model/operation/operation~Operation operations} to the model.
  19471. *
  19472. * This is a low-level way of changing the model. It is exposed for very specific use cases (like the undo feature).
  19473. * Normally, to modify the model, you will want to use {@link module:engine/model/writer~Writer `Writer`}.
  19474. * See also {@glink framework/guides/architecture/editing-engine#changing-the-model Changing the model} section
  19475. * of the {@glink framework/guides/architecture/editing-engine Editing architecture} guide.
  19476. *
  19477. * @param {module:engine/model/operation/operation~Operation} operation The operation to apply.
  19478. */
  19479. applyOperation( operation ) {
  19480. // @if CK_DEBUG_ENGINE // console.log( 'Applying ' + operation );
  19481. // @if CK_DEBUG_ENGINE // if ( !this._operationLogs ) {
  19482. // @if CK_DEBUG_ENGINE // this._operationLogs = [];
  19483. // @if CK_DEBUG_ENGINE // }
  19484. // @if CK_DEBUG_ENGINE // this._operationLogs.push( JSON.stringify( operation ) );
  19485. // @if CK_DEBUG_ENGINE //if ( !this._appliedOperations ) {
  19486. // @if CK_DEBUG_ENGINE // this._appliedOperations = [];
  19487. // @if CK_DEBUG_ENGINE //}
  19488. // @if CK_DEBUG_ENGINE //this._appliedOperations.push( operation );
  19489. operation._execute();
  19490. }
  19491. // @if CK_DEBUG_ENGINE // getAppliedOperation() {
  19492. // @if CK_DEBUG_ENGINE // if ( !this._appliedOperations ) {
  19493. // @if CK_DEBUG_ENGINE // return '';
  19494. // @if CK_DEBUG_ENGINE // }
  19495. // @if CK_DEBUG_ENGINE // return this._appliedOperations.map( JSON.stringify ).join( '-------' );
  19496. // @if CK_DEBUG_ENGINE // }
  19497. // @if CK_DEBUG_ENGINE // createReplayer( stringifiedOperations ) {
  19498. // @if CK_DEBUG_ENGINE // return new OperationReplayer( this, '-------', stringifiedOperations );
  19499. // @if CK_DEBUG_ENGINE // }
  19500. /**
  19501. * Inserts content at the position in the editor specified by the selection, as one would expect the paste
  19502. * functionality to work.
  19503. *
  19504. * This is a high-level method. It takes the {@link #schema schema} into consideration when inserting
  19505. * the content, clears the given selection's content before inserting nodes and moves the selection
  19506. * to its target position at the end of the process.
  19507. * It can split elements, merge them, wrap bare text nodes with paragraphs, etc. &mdash; just like the
  19508. * pasting feature should do.
  19509. *
  19510. * For lower-level methods see {@link module:engine/model/writer~Writer `Writer`}.
  19511. *
  19512. * This method, unlike {@link module:engine/model/writer~Writer `Writer`}'s methods, does not have to be used
  19513. * inside a {@link #change `change()` block}.
  19514. *
  19515. * # Conversion and schema
  19516. *
  19517. * Inserting elements and text nodes into the model is not enough to make CKEditor 5 render that content
  19518. * to the user. CKEditor 5 implements a model-view-controller architecture and what `model.insertContent()` does
  19519. * is only adding nodes to the model. Additionally, you need to define
  19520. * {@glink framework/guides/architecture/editing-engine#conversion converters} between the model and view
  19521. * and define those nodes in the {@glink framework/guides/architecture/editing-engine#schema schema}.
  19522. *
  19523. * So, while this method may seem similar to CKEditor 4 `editor.insertHtml()` (in fact, both methods
  19524. * are used for paste-like content insertion), the CKEditor 5 method cannot be use to insert arbitrary HTML
  19525. * unless converters are defined for all elements and attributes in that HTML.
  19526. *
  19527. * # Examples
  19528. *
  19529. * Using `insertContent()` with a manually created model structure:
  19530. *
  19531. * // Let's create a document fragment containing such content as:
  19532. * //
  19533. * // <paragraph>foo</paragraph>
  19534. * // <blockQuote>
  19535. * // <paragraph>bar</paragraph>
  19536. * // </blockQuote>
  19537. * const docFrag = editor.model.change( writer => {
  19538. * const p1 = writer.createElement( 'paragraph' );
  19539. * const p2 = writer.createElement( 'paragraph' );
  19540. * const blockQuote = writer.createElement( 'blockQuote' );
  19541. * const docFrag = writer.createDocumentFragment();
  19542. *
  19543. * writer.append( p1, docFrag );
  19544. * writer.append( blockQuote, docFrag );
  19545. * writer.append( p2, blockQuote );
  19546. * writer.insertText( 'foo', p1 );
  19547. * writer.insertText( 'bar', p2 );
  19548. *
  19549. * return docFrag;
  19550. * } );
  19551. *
  19552. * // insertContent() does not have to be used in a change() block. It can, though,
  19553. * // so this code could be moved to the callback defined above.
  19554. * editor.model.insertContent( docFrag );
  19555. *
  19556. * Using `insertContent()` with an HTML string converted to a model document fragment (similar to the pasting mechanism):
  19557. *
  19558. * // You can create your own HtmlDataProcessor instance or use editor.data.processor
  19559. * // if you have not overridden the default one (which is the HtmlDataProcessor instance).
  19560. * const htmlDP = new HtmlDataProcessor( viewDocument );
  19561. *
  19562. * // Convert an HTML string to a view document fragment:
  19563. * const viewFragment = htmlDP.toView( htmlString );
  19564. *
  19565. * // Convert the view document fragment to a model document fragment
  19566. * // in the context of $root. This conversion takes the schema into
  19567. * // account so if, for example, the view document fragment contained a bare text node,
  19568. * // this text node cannot be a child of $root, so it will be automatically
  19569. * // wrapped with a <paragraph>. You can define the context yourself (in the second parameter),
  19570. * // and e.g. convert the content like it would happen in a <paragraph>.
  19571. * // Note: The clipboard feature uses a custom context called $clipboardHolder
  19572. * // which has a loosened schema.
  19573. * const modelFragment = editor.data.toModel( viewFragment );
  19574. *
  19575. * editor.model.insertContent( modelFragment );
  19576. *
  19577. * By default this method will use the document selection but it can also be used with a position, range or selection instance.
  19578. *
  19579. * // Insert text at the current document selection position.
  19580. * editor.model.change( writer => {
  19581. * editor.model.insertContent( writer.createText( 'x' ) );
  19582. * } );
  19583. *
  19584. * // Insert text at a given position - the document selection will not be modified.
  19585. * editor.model.change( writer => {
  19586. * editor.model.insertContent( writer.createText( 'x' ), doc.getRoot(), 2 );
  19587. *
  19588. * // Which is a shorthand for:
  19589. * editor.model.insertContent( writer.createText( 'x' ), writer.createPositionAt( doc.getRoot(), 2 ) );
  19590. * } );
  19591. *
  19592. * If you want the document selection to be moved to the inserted content, use the
  19593. * {@link module:engine/model/writer~Writer#setSelection `setSelection()`} method of the writer after inserting
  19594. * the content:
  19595. *
  19596. * editor.model.change( writer => {
  19597. * const paragraph = writer.createElement( 'paragraph' );
  19598. *
  19599. * // Insert an empty paragraph at the beginning of the root.
  19600. * editor.model.insertContent( paragraph, writer.createPositionAt( editor.model.document.getRoot(), 0 ) );
  19601. *
  19602. * // Move the document selection to the inserted paragraph.
  19603. * writer.setSelection( paragraph, 'in' );
  19604. * } );
  19605. *
  19606. * If an instance of the {@link module:engine/model/selection~Selection model selection} is passed as `selectable`,
  19607. * the new content will be inserted at the passed selection (instead of document selection):
  19608. *
  19609. * editor.model.change( writer => {
  19610. * // Create a selection in a paragraph that will be used as a place of insertion.
  19611. * const selection = writer.createSelection( paragraph, 'in' );
  19612. *
  19613. * // Insert the new text at the created selection.
  19614. * editor.model.insertContent( writer.createText( 'x' ), selection );
  19615. *
  19616. * // insertContent() modifies the passed selection instance so it can be used to set the document selection.
  19617. * // Note: This is not necessary when you passed the document selection to insertContent().
  19618. * writer.setSelection( selection );
  19619. * } );
  19620. *
  19621. * @fires insertContent
  19622. * @param {module:engine/model/documentfragment~DocumentFragment|module:engine/model/item~Item} content The content to insert.
  19623. * @param {module:engine/model/selection~Selectable} [selectable=model.document.selection]
  19624. * The selection into which the content should be inserted. If not provided the current model document selection will be used.
  19625. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] To be used when a model item was passed as `selectable`.
  19626. * This param defines a position in relation to that item.
  19627. * @returns {module:engine/model/range~Range} Range which contains all the performed changes. This is a range that, if removed,
  19628. * would return the model to the state before the insertion. If no changes were preformed by `insertContent`, returns a range collapsed
  19629. * at the insertion position.
  19630. */
  19631. insertContent( content, selectable, placeOrOffset ) {
  19632. return Object(_utils_insertcontent__WEBPACK_IMPORTED_MODULE_12__["default"])( this, content, selectable, placeOrOffset );
  19633. }
  19634. /**
  19635. * Deletes content of the selection and merge siblings. The resulting selection is always collapsed.
  19636. *
  19637. * **Note:** For the sake of predictability, the resulting selection should always be collapsed.
  19638. * In cases where a feature wants to modify deleting behavior so selection isn't collapsed
  19639. * (e.g. a table feature may want to keep row selection after pressing <kbd>Backspace</kbd>),
  19640. * then that behavior should be implemented in the view's listener. At the same time, the table feature
  19641. * will need to modify this method's behavior too, e.g. to "delete contents and then collapse
  19642. * the selection inside the last selected cell" or "delete the row and collapse selection somewhere near".
  19643. * That needs to be done in order to ensure that other features which use `deleteContent()` will work well with tables.
  19644. *
  19645. * @fires deleteContent
  19646. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  19647. * Selection of which the content should be deleted.
  19648. * @param {Object} [options]
  19649. * @param {Boolean} [options.leaveUnmerged=false] Whether to merge elements after removing the content of the selection.
  19650. *
  19651. * For example `<heading1>x[x</heading1><paragraph>y]y</paragraph>` will become:
  19652. *
  19653. * * `<heading1>x^y</heading1>` with the option disabled (`leaveUnmerged == false`)
  19654. * * `<heading1>x^</heading1><paragraph>y</paragraph>` with enabled (`leaveUnmerged == true`).
  19655. *
  19656. * Note: {@link module:engine/model/schema~Schema#isObject object} and {@link module:engine/model/schema~Schema#isLimit limit}
  19657. * elements will not be merged.
  19658. *
  19659. * @param {Boolean} [options.doNotResetEntireContent=false] Whether to skip replacing the entire content with a
  19660. * paragraph when the entire content was selected.
  19661. *
  19662. * For example `<heading1>[x</heading1><paragraph>y]</paragraph>` will become:
  19663. *
  19664. * * `<paragraph>^</paragraph>` with the option disabled (`doNotResetEntireContent == false`)
  19665. * * `<heading1>^</heading1>` with enabled (`doNotResetEntireContent == true`)
  19666. *
  19667. * @param {Boolean} [options.doNotAutoparagraph=false] Whether to create a paragraph if after content deletion selection is moved
  19668. * to a place where text cannot be inserted.
  19669. *
  19670. * For example `<paragraph>x</paragraph>[<image src="foo.jpg"></image>]` will become:
  19671. *
  19672. * * `<paragraph>x</paragraph><paragraph>[]</paragraph>` with the option disabled (`doNotAutoparagraph == false`)
  19673. * * `<paragraph>x[]</paragraph>` with the option enabled (`doNotAutoparagraph == true`).
  19674. *
  19675. * **Note:** if there is no valid position for the selection, the paragraph will always be created:
  19676. *
  19677. * `[<image src="foo.jpg"></image>]` -> `<paragraph>[]</paragraph>`.
  19678. *
  19679. * @param {'forward'|'backward'} [options.direction='backward'] The direction in which the content is being consumed.
  19680. * Deleting backward corresponds to using the <kbd>Backspace</kbd> key, while deleting content forward corresponds to
  19681. * the <kbd>Shift</kbd>+<kbd>Backspace</kbd> keystroke.
  19682. */
  19683. deleteContent( selection, options ) {
  19684. Object(_utils_deletecontent__WEBPACK_IMPORTED_MODULE_13__["default"])( this, selection, options );
  19685. }
  19686. /**
  19687. * Modifies the selection. Currently, the supported modifications are:
  19688. *
  19689. * * Extending. The selection focus is moved in the specified `options.direction` with a step specified in `options.unit`.
  19690. * Possible values for `unit` are:
  19691. * * `'character'` (default) - moves selection by one user-perceived character. In most cases this means moving by one
  19692. * character in `String` sense. However, unicode also defines "combing marks". These are special symbols, that combines
  19693. * with a symbol before it ("base character") to create one user-perceived character. For example, `q̣̇` is a normal
  19694. * letter `q` with two "combining marks": upper dot (`Ux0307`) and lower dot (`Ux0323`). For most actions, i.e. extending
  19695. * selection by one position, it is correct to include both "base character" and all of it's "combining marks". That is
  19696. * why `'character'` value is most natural and common method of modifying selection.
  19697. * * `'codePoint'` - moves selection by one unicode code point. In contrary to, `'character'` unit, this will insert
  19698. * selection between "base character" and "combining mark", because "combining marks" have their own unicode code points.
  19699. * However, for technical reasons, unicode code points with values above `UxFFFF` are represented in native `String` by
  19700. * two characters, called "surrogate pairs". Halves of "surrogate pairs" have a meaning only when placed next to each other.
  19701. * For example `𨭎` is represented in `String` by `\uD862\uDF4E`. Both `\uD862` and `\uDF4E` do not have any meaning
  19702. * outside the pair (are rendered as ? when alone). Position between them would be incorrect. In this case, selection
  19703. * extension will include whole "surrogate pair".
  19704. * * `'word'` - moves selection by a whole word.
  19705. *
  19706. * **Note:** if you extend a forward selection in a backward direction you will in fact shrink it.
  19707. *
  19708. * @fires modifySelection
  19709. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  19710. * The selection to modify.
  19711. * @param {Object} [options]
  19712. * @param {'forward'|'backward'} [options.direction='forward'] The direction in which the selection should be modified.
  19713. * @param {'character'|'codePoint'|'word'} [options.unit='character'] The unit by which selection should be modified.
  19714. */
  19715. modifySelection( selection, options ) {
  19716. Object(_utils_modifyselection__WEBPACK_IMPORTED_MODULE_14__["default"])( this, selection, options );
  19717. }
  19718. /**
  19719. * Gets a clone of the selected content.
  19720. *
  19721. * For example, for the following selection:
  19722. *
  19723. * ```html
  19724. * <paragraph>x</paragraph>
  19725. * <blockQuote>
  19726. * <paragraph>y</paragraph>
  19727. * <heading1>fir[st</heading1>
  19728. * </blockQuote>
  19729. * <paragraph>se]cond</paragraph>
  19730. * <paragraph>z</paragraph>
  19731. * ```
  19732. *
  19733. * It will return a document fragment with such a content:
  19734. *
  19735. * ```html
  19736. * <blockQuote>
  19737. * <heading1>st</heading1>
  19738. * </blockQuote>
  19739. * <paragraph>se</paragraph>
  19740. * ```
  19741. *
  19742. * @fires getSelectedContent
  19743. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  19744. * The selection of which content will be returned.
  19745. * @returns {module:engine/model/documentfragment~DocumentFragment}
  19746. */
  19747. getSelectedContent( selection ) {
  19748. return Object(_utils_getselectedcontent__WEBPACK_IMPORTED_MODULE_15__["default"])( this, selection );
  19749. }
  19750. /**
  19751. * Checks whether the given {@link module:engine/model/range~Range range} or
  19752. * {@link module:engine/model/element~Element element} has any meaningful content.
  19753. *
  19754. * Meaningful content is:
  19755. *
  19756. * * any text node (`options.ignoreWhitespaces` allows controlling whether this text node must also contain
  19757. * any non-whitespace characters),
  19758. * * or any {@link module:engine/model/schema~Schema#isContent content element},
  19759. * * or any {@link module:engine/model/markercollection~Marker marker} which
  19760. * {@link module:engine/model/markercollection~Marker#_affectsData affects data}.
  19761. *
  19762. * This means that a range containing an empty `<paragraph></paragraph>` is not considered to have a meaningful content.
  19763. * However, a range containing an `<image></image>` (which would normally be marked in the schema as an object element)
  19764. * is considered non-empty.
  19765. *
  19766. * @param {module:engine/model/range~Range|module:engine/model/element~Element} rangeOrElement Range or element to check.
  19767. * @param {Object} [options]
  19768. * @param {Boolean} [options.ignoreWhitespaces] Whether text node with whitespaces only should be considered empty.
  19769. * @param {Boolean} [options.ignoreMarkers] Whether markers should be ignored.
  19770. * @returns {Boolean}
  19771. */
  19772. hasContent( rangeOrElement, options = {} ) {
  19773. const range = rangeOrElement instanceof _element__WEBPACK_IMPORTED_MODULE_7__["default"] ? _range__WEBPACK_IMPORTED_MODULE_8__["default"]._createIn( rangeOrElement ) : rangeOrElement;
  19774. if ( range.isCollapsed ) {
  19775. return false;
  19776. }
  19777. const { ignoreWhitespaces = false, ignoreMarkers = false } = options;
  19778. // Check if there are any markers which affects data in this given range.
  19779. if ( !ignoreMarkers ) {
  19780. for ( const intersectingMarker of this.markers.getMarkersIntersectingRange( range ) ) {
  19781. if ( intersectingMarker.affectsData ) {
  19782. return true;
  19783. }
  19784. }
  19785. }
  19786. for ( const item of range.getItems() ) {
  19787. if ( this.schema.isContent( item ) ) {
  19788. if ( item.is( '$textProxy' ) ) {
  19789. if ( !ignoreWhitespaces ) {
  19790. return true;
  19791. } else if ( item.data.search( /\S/ ) !== -1 ) {
  19792. return true;
  19793. }
  19794. } else {
  19795. return true;
  19796. }
  19797. }
  19798. }
  19799. return false;
  19800. }
  19801. /**
  19802. * Creates a position from the given root and path in that root.
  19803. *
  19804. * Note: This method is also available as
  19805. * {@link module:engine/model/writer~Writer#createPositionFromPath `Writer#createPositionFromPath()`}.
  19806. *
  19807. * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} root Root of the position.
  19808. * @param {Array.<Number>} path Position path. See {@link module:engine/model/position~Position#path}.
  19809. * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone'] Position stickiness.
  19810. * See {@link module:engine/model/position~PositionStickiness}.
  19811. * @returns {module:engine/model/position~Position}
  19812. */
  19813. createPositionFromPath( root, path, stickiness ) {
  19814. return new _position__WEBPACK_IMPORTED_MODULE_9__["default"]( root, path, stickiness );
  19815. }
  19816. /**
  19817. * Creates position at the given location. The location can be specified as:
  19818. *
  19819. * * a {@link module:engine/model/position~Position position},
  19820. * * a parent element and offset in that element,
  19821. * * a parent element and `'end'` (the position will be set at the end of that element),
  19822. * * a {@link module:engine/model/item~Item model item} and `'before'` or `'after'`
  19823. * (the position will be set before or after the given model item).
  19824. *
  19825. * This method is a shortcut to other factory methods such as:
  19826. *
  19827. * * {@link module:engine/model/model~Model#createPositionBefore `createPositionBefore()`},
  19828. * * {@link module:engine/model/model~Model#createPositionAfter `createPositionAfter()`}.
  19829. *
  19830. * Note: This method is also available as
  19831. * {@link module:engine/model/writer~Writer#createPositionAt `Writer#createPositionAt()`},
  19832. *
  19833. * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
  19834. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  19835. * first parameter is a {@link module:engine/model/item~Item model item}.
  19836. */
  19837. createPositionAt( itemOrPosition, offset ) {
  19838. return _position__WEBPACK_IMPORTED_MODULE_9__["default"]._createAt( itemOrPosition, offset );
  19839. }
  19840. /**
  19841. * Creates a new position after the given {@link module:engine/model/item~Item model item}.
  19842. *
  19843. * Note: This method is also available as
  19844. * {@link module:engine/model/writer~Writer#createPositionAfter `Writer#createPositionAfter()`}.
  19845. *
  19846. * @param {module:engine/model/item~Item} item Item after which the position should be placed.
  19847. * @returns {module:engine/model/position~Position}
  19848. */
  19849. createPositionAfter( item ) {
  19850. return _position__WEBPACK_IMPORTED_MODULE_9__["default"]._createAfter( item );
  19851. }
  19852. /**
  19853. * Creates a new position before the given {@link module:engine/model/item~Item model item}.
  19854. *
  19855. * Note: This method is also available as
  19856. * {@link module:engine/model/writer~Writer#createPositionBefore `Writer#createPositionBefore()`}.
  19857. *
  19858. * @param {module:engine/model/item~Item} item Item before which the position should be placed.
  19859. * @returns {module:engine/model/position~Position}
  19860. */
  19861. createPositionBefore( item ) {
  19862. return _position__WEBPACK_IMPORTED_MODULE_9__["default"]._createBefore( item );
  19863. }
  19864. /**
  19865. * Creates a range spanning from the `start` position to the `end` position.
  19866. *
  19867. * Note: This method is also available as
  19868. * {@link module:engine/model/writer~Writer#createRange `Writer#createRange()`}:
  19869. *
  19870. * model.change( writer => {
  19871. * const range = writer.createRange( start, end );
  19872. * } );
  19873. *
  19874. * @param {module:engine/model/position~Position} start Start position.
  19875. * @param {module:engine/model/position~Position} [end] End position. If not set, the range will be collapsed
  19876. * to the `start` position.
  19877. * @returns {module:engine/model/range~Range}
  19878. */
  19879. createRange( start, end ) {
  19880. return new _range__WEBPACK_IMPORTED_MODULE_8__["default"]( start, end );
  19881. }
  19882. /**
  19883. * Creates a range inside the given element which starts before the first child of
  19884. * that element and ends after the last child of that element.
  19885. *
  19886. * Note: This method is also available as
  19887. * {@link module:engine/model/writer~Writer#createRangeIn `Writer#createRangeIn()`}:
  19888. *
  19889. * model.change( writer => {
  19890. * const range = writer.createRangeIn( paragraph );
  19891. * } );
  19892. *
  19893. * @param {module:engine/model/element~Element} element Element which is a parent for the range.
  19894. * @returns {module:engine/model/range~Range}
  19895. */
  19896. createRangeIn( element ) {
  19897. return _range__WEBPACK_IMPORTED_MODULE_8__["default"]._createIn( element );
  19898. }
  19899. /**
  19900. * Creates a range that starts before the given {@link module:engine/model/item~Item model item} and ends after it.
  19901. *
  19902. * Note: This method is also available on `writer` instance as
  19903. * {@link module:engine/model/writer~Writer#createRangeOn `Writer.createRangeOn()`}:
  19904. *
  19905. * model.change( writer => {
  19906. * const range = writer.createRangeOn( paragraph );
  19907. * } );
  19908. *
  19909. * @param {module:engine/model/item~Item} item
  19910. * @returns {module:engine/model/range~Range}
  19911. */
  19912. createRangeOn( item ) {
  19913. return _range__WEBPACK_IMPORTED_MODULE_8__["default"]._createOn( item );
  19914. }
  19915. /**
  19916. * Creates a new selection instance based on the given {@link module:engine/model/selection~Selectable selectable}
  19917. * or creates an empty selection if no arguments were passed.
  19918. *
  19919. * Note: This method is also available as
  19920. * {@link module:engine/model/writer~Writer#createSelection `Writer#createSelection()`}.
  19921. *
  19922. * // Creates empty selection without ranges.
  19923. * const selection = writer.createSelection();
  19924. *
  19925. * // Creates selection at the given range.
  19926. * const range = writer.createRange( start, end );
  19927. * const selection = writer.createSelection( range );
  19928. *
  19929. * // Creates selection at the given ranges
  19930. * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];
  19931. * const selection = writer.createSelection( ranges );
  19932. *
  19933. * // Creates selection from the other selection.
  19934. * // Note: It doesn't copies selection attributes.
  19935. * const otherSelection = writer.createSelection();
  19936. * const selection = writer.createSelection( otherSelection );
  19937. *
  19938. * // Creates selection from the given document selection.
  19939. * // Note: It doesn't copies selection attributes.
  19940. * const documentSelection = model.document.selection;
  19941. * const selection = writer.createSelection( documentSelection );
  19942. *
  19943. * // Creates selection at the given position.
  19944. * const position = writer.createPositionFromPath( root, path );
  19945. * const selection = writer.createSelection( position );
  19946. *
  19947. * // Creates selection at the given offset in the given element.
  19948. * const paragraph = writer.createElement( 'paragraph' );
  19949. * const selection = writer.createSelection( paragraph, offset );
  19950. *
  19951. * // Creates a range inside an {@link module:engine/model/element~Element element} which starts before the
  19952. * // first child of that element and ends after the last child of that element.
  19953. * const selection = writer.createSelection( paragraph, 'in' );
  19954. *
  19955. * // Creates a range on an {@link module:engine/model/item~Item item} which starts before the item and ends
  19956. * // just after the item.
  19957. * const selection = writer.createSelection( paragraph, 'on' );
  19958. *
  19959. * // Additional options (`'backward'`) can be specified as the last argument.
  19960. *
  19961. * // Creates backward selection.
  19962. * const selection = writer.createSelection( range, { backward: true } );
  19963. *
  19964. * @param {module:engine/model/selection~Selectable} selectable
  19965. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
  19966. * @param {Object} [options]
  19967. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  19968. * @returns {module:engine/model/selection~Selection}
  19969. */
  19970. createSelection( selectable, placeOrOffset, options ) {
  19971. return new _selection__WEBPACK_IMPORTED_MODULE_10__["default"]( selectable, placeOrOffset, options );
  19972. }
  19973. /**
  19974. * Creates a {@link module:engine/model/batch~Batch} instance.
  19975. *
  19976. * **Note:** In most cases creating a batch instance is not necessary as they are created when using:
  19977. *
  19978. * * {@link #change `change()`},
  19979. * * {@link #enqueueChange `enqueueChange()`}.
  19980. *
  19981. * @param {'transparent'|'default'} [type='default'] The type of the batch.
  19982. * @returns {module:engine/model/batch~Batch}
  19983. */
  19984. createBatch( type ) {
  19985. return new _batch__WEBPACK_IMPORTED_MODULE_0__["default"]( type );
  19986. }
  19987. /**
  19988. * Creates an operation instance from a JSON object (parsed JSON string).
  19989. *
  19990. * This is an alias for {@link module:engine/model/operation/operationfactory~OperationFactory.fromJSON `OperationFactory.fromJSON()`}.
  19991. *
  19992. * @param {Object} json Deserialized JSON object.
  19993. * @returns {module:engine/model/operation/operation~Operation}
  19994. */
  19995. createOperationFromJSON( json ) {
  19996. return _operation_operationfactory__WEBPACK_IMPORTED_MODULE_11__["default"].fromJSON( json, this.document );
  19997. }
  19998. /**
  19999. * Removes all events listeners set by model instance and destroys {@link module:engine/model/document~Document}.
  20000. */
  20001. destroy() {
  20002. this.document.destroy();
  20003. this.stopListening();
  20004. }
  20005. /**
  20006. * Common part of {@link module:engine/model/model~Model#change} and {@link module:engine/model/model~Model#enqueueChange}
  20007. * which calls callbacks and returns array of values returned by these callbacks.
  20008. *
  20009. * @private
  20010. * @returns {Array.<*>} Array of values returned by callbacks.
  20011. */
  20012. _runPendingChanges() {
  20013. const ret = [];
  20014. this.fire( '_beforeChanges' );
  20015. while ( this._pendingChanges.length ) {
  20016. // Create a new writer using batch instance created for this chain of changes.
  20017. const currentBatch = this._pendingChanges[ 0 ].batch;
  20018. this._currentWriter = new _writer__WEBPACK_IMPORTED_MODULE_1__["default"]( this, currentBatch );
  20019. // Execute changes callback and gather the returned value.
  20020. const callbackReturnValue = this._pendingChanges[ 0 ].callback( this._currentWriter );
  20021. ret.push( callbackReturnValue );
  20022. this.document._handleChangeBlock( this._currentWriter );
  20023. this._pendingChanges.shift();
  20024. this._currentWriter = null;
  20025. }
  20026. this.fire( '_afterChanges' );
  20027. return ret;
  20028. }
  20029. /**
  20030. * Fired when entering the outermost {@link module:engine/model/model~Model#enqueueChange} or
  20031. * {@link module:engine/model/model~Model#change} block.
  20032. *
  20033. * @protected
  20034. * @event _beforeChanges
  20035. */
  20036. /**
  20037. * Fired when leaving the outermost {@link module:engine/model/model~Model#enqueueChange} or
  20038. * {@link module:engine/model/model~Model#change} block.
  20039. *
  20040. * @protected
  20041. * @event _afterChanges
  20042. */
  20043. /**
  20044. * Fired every time any {@link module:engine/model/operation/operation~Operation operation} is applied on the model
  20045. * using {@link #applyOperation}.
  20046. *
  20047. * Note that this event is suitable only for very specific use-cases. Use it if you need to listen to every single operation
  20048. * applied on the document. However, in most cases {@link module:engine/model/document~Document#event:change} should
  20049. * be used.
  20050. *
  20051. * A few callbacks are already added to this event by engine internal classes:
  20052. *
  20053. * * with `highest` priority operation is validated,
  20054. * * with `normal` priority operation is executed,
  20055. * * with `low` priority the {@link module:engine/model/document~Document} updates its version,
  20056. * * with `low` priority {@link module:engine/model/liveposition~LivePosition} and {@link module:engine/model/liverange~LiveRange}
  20057. * update themselves.
  20058. *
  20059. * @event applyOperation
  20060. * @param {Array} args Arguments of the `applyOperation` which is an array with a single element - applied
  20061. * {@link module:engine/model/operation/operation~Operation operation}.
  20062. */
  20063. /**
  20064. * Event fired when {@link #insertContent} method is called.
  20065. *
  20066. * The {@link #insertContent default action of that method} is implemented as a
  20067. * listener to this event so it can be fully customized by the features.
  20068. *
  20069. * **Note** The `selectable` parameter for the {@link #insertContent} is optional. When `undefined` value is passed the method uses
  20070. * `model.document.selection`.
  20071. *
  20072. * @event insertContent
  20073. * @param {Array} args The arguments passed to the original method.
  20074. */
  20075. /**
  20076. * Event fired when {@link #deleteContent} method is called.
  20077. *
  20078. * The {@link #deleteContent default action of that method} is implemented as a
  20079. * listener to this event so it can be fully customized by the features.
  20080. *
  20081. * @event deleteContent
  20082. * @param {Array} args The arguments passed to the original method.
  20083. */
  20084. /**
  20085. * Event fired when {@link #modifySelection} method is called.
  20086. *
  20087. * The {@link #modifySelection default action of that method} is implemented as a
  20088. * listener to this event so it can be fully customized by the features.
  20089. *
  20090. * @event modifySelection
  20091. * @param {Array} args The arguments passed to the original method.
  20092. */
  20093. /**
  20094. * Event fired when {@link #getSelectedContent} method is called.
  20095. *
  20096. * The {@link #getSelectedContent default action of that method} is implemented as a
  20097. * listener to this event so it can be fully customized by the features.
  20098. *
  20099. * @event getSelectedContent
  20100. * @param {Array} args The arguments passed to the original method.
  20101. */
  20102. }
  20103. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__["default"])( Model, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_5__["default"] );
  20104. /***/ }),
  20105. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/node.js":
  20106. /*!*******************************************************************!*\
  20107. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/node.js ***!
  20108. \*******************************************************************/
  20109. /*! exports provided: default */
  20110. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20111. "use strict";
  20112. __webpack_require__.r(__webpack_exports__);
  20113. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Node; });
  20114. /* harmony import */ var _ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/tomap */ "./node_modules/@ckeditor/ckeditor5-utils/src/tomap.js");
  20115. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  20116. /* harmony import */ var _ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/comparearrays */ "./node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.js");
  20117. /* harmony import */ var _ckeditor_ckeditor5_utils_src_version__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/version */ "./node_modules/@ckeditor/ckeditor5-utils/src/version.js");
  20118. /**
  20119. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  20120. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  20121. */
  20122. /**
  20123. * @module engine/model/node
  20124. */
  20125. // To check if component is loaded more than once.
  20126. /**
  20127. * Model node. Most basic structure of model tree.
  20128. *
  20129. * This is an abstract class that is a base for other classes representing different nodes in model.
  20130. *
  20131. * **Note:** If a node is detached from the model tree, you can manipulate it using it's API.
  20132. * However, it is **very important** that nodes already attached to model tree should be only changed through
  20133. * {@link module:engine/model/writer~Writer Writer API}.
  20134. *
  20135. * Changes done by `Node` methods, like {@link module:engine/model/element~Element#_insertChild _insertChild} or
  20136. * {@link module:engine/model/node~Node#_setAttribute _setAttribute}
  20137. * do not generate {@link module:engine/model/operation/operation~Operation operations}
  20138. * which are essential for correct editor work if you modify nodes in {@link module:engine/model/document~Document document} root.
  20139. *
  20140. * The flow of working on `Node` (and classes that inherits from it) is as such:
  20141. * 1. You can create a `Node` instance, modify it using it's API.
  20142. * 2. Add `Node` to the model using `Batch` API.
  20143. * 3. Change `Node` that was already added to the model using `Batch` API.
  20144. *
  20145. * Similarly, you cannot use `Batch` API on a node that has not been added to the model tree, with the exception
  20146. * of {@link module:engine/model/writer~Writer#insert inserting} that node to the model tree.
  20147. *
  20148. * Be aware that using {@link module:engine/model/writer~Writer#remove remove from Batch API} does not allow to use `Node` API because
  20149. * the information about `Node` is still kept in model document.
  20150. *
  20151. * In case of {@link module:engine/model/element~Element element node}, adding and removing children also counts as changing a node and
  20152. * follows same rules.
  20153. */
  20154. class Node {
  20155. /**
  20156. * Creates a model node.
  20157. *
  20158. * This is an abstract class, so this constructor should not be used directly.
  20159. *
  20160. * @abstract
  20161. * @param {Object} [attrs] Node's attributes. See {@link module:utils/tomap~toMap} for a list of accepted values.
  20162. */
  20163. constructor( attrs ) {
  20164. /**
  20165. * Parent of this node. It could be {@link module:engine/model/element~Element}
  20166. * or {@link module:engine/model/documentfragment~DocumentFragment}.
  20167. * Equals to `null` if the node has no parent.
  20168. *
  20169. * @readonly
  20170. * @member {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment|null}
  20171. */
  20172. this.parent = null;
  20173. /**
  20174. * Attributes set on this node.
  20175. *
  20176. * @private
  20177. * @member {Map} module:engine/model/node~Node#_attrs
  20178. */
  20179. this._attrs = Object(_ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_0__["default"])( attrs );
  20180. }
  20181. /**
  20182. * Index of this node in it's parent or `null` if the node has no parent.
  20183. *
  20184. * Accessing this property throws an error if this node's parent element does not contain it.
  20185. * This means that model tree got broken.
  20186. *
  20187. * @readonly
  20188. * @type {Number|null}
  20189. */
  20190. get index() {
  20191. let pos;
  20192. if ( !this.parent ) {
  20193. return null;
  20194. }
  20195. if ( ( pos = this.parent.getChildIndex( this ) ) === null ) {
  20196. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'model-node-not-found-in-parent', this );
  20197. }
  20198. return pos;
  20199. }
  20200. /**
  20201. * Offset at which this node starts in it's parent. It is equal to the sum of {@link #offsetSize offsetSize}
  20202. * of all it's previous siblings. Equals to `null` if node has no parent.
  20203. *
  20204. * Accessing this property throws an error if this node's parent element does not contain it.
  20205. * This means that model tree got broken.
  20206. *
  20207. * @readonly
  20208. * @type {Number|null}
  20209. */
  20210. get startOffset() {
  20211. let pos;
  20212. if ( !this.parent ) {
  20213. return null;
  20214. }
  20215. if ( ( pos = this.parent.getChildStartOffset( this ) ) === null ) {
  20216. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'model-node-not-found-in-parent', this );
  20217. }
  20218. return pos;
  20219. }
  20220. /**
  20221. * Offset size of this node. Represents how much "offset space" is occupied by the node in it's parent.
  20222. * It is important for {@link module:engine/model/position~Position position}. When node has `offsetSize` greater than `1`, position
  20223. * can be placed between that node start and end. `offsetSize` greater than `1` is for nodes that represents more
  20224. * than one entity, i.e. {@link module:engine/model/text~Text text node}.
  20225. *
  20226. * @readonly
  20227. * @type {Number}
  20228. */
  20229. get offsetSize() {
  20230. return 1;
  20231. }
  20232. /**
  20233. * Offset at which this node ends in it's parent. It is equal to the sum of this node's
  20234. * {@link module:engine/model/node~Node#startOffset start offset} and {@link #offsetSize offset size}.
  20235. * Equals to `null` if the node has no parent.
  20236. *
  20237. * @readonly
  20238. * @type {Number|null}
  20239. */
  20240. get endOffset() {
  20241. if ( !this.parent ) {
  20242. return null;
  20243. }
  20244. return this.startOffset + this.offsetSize;
  20245. }
  20246. /**
  20247. * Node's next sibling or `null` if the node is a last child of it's parent or if the node has no parent.
  20248. *
  20249. * @readonly
  20250. * @type {module:engine/model/node~Node|null}
  20251. */
  20252. get nextSibling() {
  20253. const index = this.index;
  20254. return ( index !== null && this.parent.getChild( index + 1 ) ) || null;
  20255. }
  20256. /**
  20257. * Node's previous sibling or `null` if the node is a first child of it's parent or if the node has no parent.
  20258. *
  20259. * @readonly
  20260. * @type {module:engine/model/node~Node|null}
  20261. */
  20262. get previousSibling() {
  20263. const index = this.index;
  20264. return ( index !== null && this.parent.getChild( index - 1 ) ) || null;
  20265. }
  20266. /**
  20267. * The top-most ancestor of the node. If node has no parent it is the root itself. If the node is a part
  20268. * of {@link module:engine/model/documentfragment~DocumentFragment}, it's `root` is equal to that `DocumentFragment`.
  20269. *
  20270. * @readonly
  20271. * @type {module:engine/model/node~Node|module:engine/model/documentfragment~DocumentFragment}
  20272. */
  20273. get root() {
  20274. let root = this; // eslint-disable-line consistent-this
  20275. while ( root.parent ) {
  20276. root = root.parent;
  20277. }
  20278. return root;
  20279. }
  20280. /**
  20281. * Returns true if the node is in a tree rooted in the document (is a descendant of one of its roots).
  20282. *
  20283. * @returns {Boolean}
  20284. */
  20285. isAttached() {
  20286. return this.root.is( 'rootElement' );
  20287. }
  20288. /**
  20289. * Gets path to the node. The path is an array containing starting offsets of consecutive ancestors of this node,
  20290. * beginning from {@link module:engine/model/node~Node#root root}, down to this node's starting offset. The path can be used to
  20291. * create {@link module:engine/model/position~Position Position} instance.
  20292. *
  20293. * const abc = new Text( 'abc' );
  20294. * const foo = new Text( 'foo' );
  20295. * const h1 = new Element( 'h1', null, new Text( 'header' ) );
  20296. * const p = new Element( 'p', null, [ abc, foo ] );
  20297. * const div = new Element( 'div', null, [ h1, p ] );
  20298. * foo.getPath(); // Returns [ 1, 3 ]. `foo` is in `p` which is in `div`. `p` starts at offset 1, while `foo` at 3.
  20299. * h1.getPath(); // Returns [ 0 ].
  20300. * div.getPath(); // Returns [].
  20301. *
  20302. * @returns {Array.<Number>} The path.
  20303. */
  20304. getPath() {
  20305. const path = [];
  20306. let node = this; // eslint-disable-line consistent-this
  20307. while ( node.parent ) {
  20308. path.unshift( node.startOffset );
  20309. node = node.parent;
  20310. }
  20311. return path;
  20312. }
  20313. /**
  20314. * Returns ancestors array of this node.
  20315. *
  20316. * @param {Object} options Options object.
  20317. * @param {Boolean} [options.includeSelf=false] When set to `true` this node will be also included in parent's array.
  20318. * @param {Boolean} [options.parentFirst=false] When set to `true`, array will be sorted from node's parent to root element,
  20319. * otherwise root element will be the first item in the array.
  20320. * @returns {Array} Array with ancestors.
  20321. */
  20322. getAncestors( options = { includeSelf: false, parentFirst: false } ) {
  20323. const ancestors = [];
  20324. let parent = options.includeSelf ? this : this.parent;
  20325. while ( parent ) {
  20326. ancestors[ options.parentFirst ? 'push' : 'unshift' ]( parent );
  20327. parent = parent.parent;
  20328. }
  20329. return ancestors;
  20330. }
  20331. /**
  20332. * Returns a {@link module:engine/model/element~Element} or {@link module:engine/model/documentfragment~DocumentFragment}
  20333. * which is a common ancestor of both nodes.
  20334. *
  20335. * @param {module:engine/model/node~Node} node The second node.
  20336. * @param {Object} options Options object.
  20337. * @param {Boolean} [options.includeSelf=false] When set to `true` both nodes will be considered "ancestors" too.
  20338. * Which means that if e.g. node A is inside B, then their common ancestor will be B.
  20339. * @returns {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment|null}
  20340. */
  20341. getCommonAncestor( node, options = {} ) {
  20342. const ancestorsA = this.getAncestors( options );
  20343. const ancestorsB = node.getAncestors( options );
  20344. let i = 0;
  20345. while ( ancestorsA[ i ] == ancestorsB[ i ] && ancestorsA[ i ] ) {
  20346. i++;
  20347. }
  20348. return i === 0 ? null : ancestorsA[ i - 1 ];
  20349. }
  20350. /**
  20351. * Returns whether this node is before given node. `false` is returned if nodes are in different trees (for example,
  20352. * in different {@link module:engine/model/documentfragment~DocumentFragment}s).
  20353. *
  20354. * @param {module:engine/model/node~Node} node Node to compare with.
  20355. * @returns {Boolean}
  20356. */
  20357. isBefore( node ) {
  20358. // Given node is not before this node if they are same.
  20359. if ( this == node ) {
  20360. return false;
  20361. }
  20362. // Return `false` if it is impossible to compare nodes.
  20363. if ( this.root !== node.root ) {
  20364. return false;
  20365. }
  20366. const thisPath = this.getPath();
  20367. const nodePath = node.getPath();
  20368. const result = Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_2__["default"])( thisPath, nodePath );
  20369. switch ( result ) {
  20370. case 'prefix':
  20371. return true;
  20372. case 'extension':
  20373. return false;
  20374. default:
  20375. return thisPath[ result ] < nodePath[ result ];
  20376. }
  20377. }
  20378. /**
  20379. * Returns whether this node is after given node. `false` is returned if nodes are in different trees (for example,
  20380. * in different {@link module:engine/model/documentfragment~DocumentFragment}s).
  20381. *
  20382. * @param {module:engine/model/node~Node} node Node to compare with.
  20383. * @returns {Boolean}
  20384. */
  20385. isAfter( node ) {
  20386. // Given node is not before this node if they are same.
  20387. if ( this == node ) {
  20388. return false;
  20389. }
  20390. // Return `false` if it is impossible to compare nodes.
  20391. if ( this.root !== node.root ) {
  20392. return false;
  20393. }
  20394. // In other cases, just check if the `node` is before, and return the opposite.
  20395. return !this.isBefore( node );
  20396. }
  20397. /**
  20398. * Checks if the node has an attribute with given key.
  20399. *
  20400. * @param {String} key Key of attribute to check.
  20401. * @returns {Boolean} `true` if attribute with given key is set on node, `false` otherwise.
  20402. */
  20403. hasAttribute( key ) {
  20404. return this._attrs.has( key );
  20405. }
  20406. /**
  20407. * Gets an attribute value for given key or `undefined` if that attribute is not set on node.
  20408. *
  20409. * @param {String} key Key of attribute to look for.
  20410. * @returns {*} Attribute value or `undefined`.
  20411. */
  20412. getAttribute( key ) {
  20413. return this._attrs.get( key );
  20414. }
  20415. /**
  20416. * Returns iterator that iterates over this node's attributes.
  20417. *
  20418. * Attributes are returned as arrays containing two items. First one is attribute key and second is attribute value.
  20419. * This format is accepted by native `Map` object and also can be passed in `Node` constructor.
  20420. *
  20421. * @returns {Iterable.<*>}
  20422. */
  20423. getAttributes() {
  20424. return this._attrs.entries();
  20425. }
  20426. /**
  20427. * Returns iterator that iterates over this node's attribute keys.
  20428. *
  20429. * @returns {Iterable.<String>}
  20430. */
  20431. getAttributeKeys() {
  20432. return this._attrs.keys();
  20433. }
  20434. /**
  20435. * Converts `Node` to plain object and returns it.
  20436. *
  20437. * @returns {Object} `Node` converted to plain object.
  20438. */
  20439. toJSON() {
  20440. const json = {};
  20441. // Serializes attributes to the object.
  20442. // attributes = { a: 'foo', b: 1, c: true }.
  20443. if ( this._attrs.size ) {
  20444. json.attributes = Array.from( this._attrs ).reduce( ( result, attr ) => {
  20445. result[ attr[ 0 ] ] = attr[ 1 ];
  20446. return result;
  20447. }, {} );
  20448. }
  20449. return json;
  20450. }
  20451. /**
  20452. * Checks whether this object is of the given type.
  20453. *
  20454. * This method is useful when processing model objects that are of unknown type. For example, a function
  20455. * may return a {@link module:engine/model/documentfragment~DocumentFragment} or a {@link module:engine/model/node~Node}
  20456. * that can be either a text node or an element. This method can be used to check what kind of object is returned.
  20457. *
  20458. * someObject.is( 'element' ); // -> true if this is an element
  20459. * someObject.is( 'node' ); // -> true if this is a node (a text node or an element)
  20460. * someObject.is( 'documentFragment' ); // -> true if this is a document fragment
  20461. *
  20462. * Since this method is also available on a range of view objects, you can prefix the type of the object with
  20463. * `model:` or `view:` to check, for example, if this is the model's or view's element:
  20464. *
  20465. * modelElement.is( 'model:element' ); // -> true
  20466. * modelElement.is( 'view:element' ); // -> false
  20467. *
  20468. * By using this method it is also possible to check a name of an element:
  20469. *
  20470. * imageElement.is( 'element', 'image' ); // -> true
  20471. * imageElement.is( 'element', 'image' ); // -> same as above
  20472. * imageElement.is( 'model:element', 'image' ); // -> same as above, but more precise
  20473. *
  20474. * The list of model objects which implement the `is()` method:
  20475. *
  20476. * * {@link module:engine/model/node~Node#is `Node#is()`}
  20477. * * {@link module:engine/model/text~Text#is `Text#is()`}
  20478. * * {@link module:engine/model/element~Element#is `Element#is()`}
  20479. * * {@link module:engine/model/rootelement~RootElement#is `RootElement#is()`}
  20480. * * {@link module:engine/model/position~Position#is `Position#is()`}
  20481. * * {@link module:engine/model/liveposition~LivePosition#is `LivePosition#is()`}
  20482. * * {@link module:engine/model/range~Range#is `Range#is()`}
  20483. * * {@link module:engine/model/liverange~LiveRange#is `LiveRange#is()`}
  20484. * * {@link module:engine/model/documentfragment~DocumentFragment#is `DocumentFragment#is()`}
  20485. * * {@link module:engine/model/selection~Selection#is `Selection#is()`}
  20486. * * {@link module:engine/model/documentselection~DocumentSelection#is `DocumentSelection#is()`}
  20487. * * {@link module:engine/model/markercollection~Marker#is `Marker#is()`}
  20488. * * {@link module:engine/model/textproxy~TextProxy#is `TextProxy#is()`}
  20489. *
  20490. * @method #is
  20491. * @param {String} type Type to check.
  20492. * @returns {Boolean}
  20493. */
  20494. is( type ) {
  20495. return type === 'node' || type === 'model:node';
  20496. }
  20497. /**
  20498. * Creates a copy of this node, that is a node with exactly same attributes, and returns it.
  20499. *
  20500. * @protected
  20501. * @returns {module:engine/model/node~Node} Node with same attributes as this node.
  20502. */
  20503. _clone() {
  20504. return new Node( this._attrs );
  20505. }
  20506. /**
  20507. * Removes this node from it's parent.
  20508. *
  20509. * @see module:engine/model/writer~Writer#remove
  20510. * @protected
  20511. */
  20512. _remove() {
  20513. this.parent._removeChildren( this.index );
  20514. }
  20515. /**
  20516. * Sets attribute on the node. If attribute with the same key already is set, it's value is overwritten.
  20517. *
  20518. * @see module:engine/model/writer~Writer#setAttribute
  20519. * @protected
  20520. * @param {String} key Key of attribute to set.
  20521. * @param {*} value Attribute value.
  20522. */
  20523. _setAttribute( key, value ) {
  20524. this._attrs.set( key, value );
  20525. }
  20526. /**
  20527. * Removes all attributes from the node and sets given attributes.
  20528. *
  20529. * @see module:engine/model/writer~Writer#setAttributes
  20530. * @protected
  20531. * @param {Object} [attrs] Attributes to set. See {@link module:utils/tomap~toMap} for a list of accepted values.
  20532. */
  20533. _setAttributesTo( attrs ) {
  20534. this._attrs = Object(_ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_0__["default"])( attrs );
  20535. }
  20536. /**
  20537. * Removes an attribute with given key from the node.
  20538. *
  20539. * @see module:engine/model/writer~Writer#removeAttribute
  20540. * @protected
  20541. * @param {String} key Key of attribute to remove.
  20542. * @returns {Boolean} `true` if the attribute was set on the element, `false` otherwise.
  20543. */
  20544. _removeAttribute( key ) {
  20545. return this._attrs.delete( key );
  20546. }
  20547. /**
  20548. * Removes all attributes from the node.
  20549. *
  20550. * @see module:engine/model/writer~Writer#clearAttributes
  20551. * @protected
  20552. */
  20553. _clearAttributes() {
  20554. this._attrs.clear();
  20555. }
  20556. }
  20557. /**
  20558. * The node's parent does not contain this node.
  20559. *
  20560. * @error model-node-not-found-in-parent
  20561. */
  20562. /***/ }),
  20563. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/nodelist.js":
  20564. /*!***********************************************************************!*\
  20565. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/nodelist.js ***!
  20566. \***********************************************************************/
  20567. /*! exports provided: default */
  20568. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20569. "use strict";
  20570. __webpack_require__.r(__webpack_exports__);
  20571. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return NodeList; });
  20572. /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/node.js");
  20573. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  20574. /**
  20575. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  20576. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  20577. */
  20578. /**
  20579. * @module engine/model/nodelist
  20580. */
  20581. /**
  20582. * Provides an interface to operate on a list of {@link module:engine/model/node~Node nodes}. `NodeList` is used internally
  20583. * in classes like {@link module:engine/model/element~Element Element}
  20584. * or {@link module:engine/model/documentfragment~DocumentFragment DocumentFragment}.
  20585. */
  20586. class NodeList {
  20587. /**
  20588. * Creates an empty node list.
  20589. *
  20590. * @protected
  20591. * @param {Iterable.<module:engine/model/node~Node>} nodes Nodes contained in this node list.
  20592. */
  20593. constructor( nodes ) {
  20594. /**
  20595. * Nodes contained in this node list.
  20596. *
  20597. * @private
  20598. * @member {Array.<module:engine/model/node~Node>}
  20599. */
  20600. this._nodes = [];
  20601. if ( nodes ) {
  20602. this._insertNodes( 0, nodes );
  20603. }
  20604. }
  20605. /**
  20606. * Iterable interface.
  20607. *
  20608. * Iterates over all nodes contained inside this node list.
  20609. *
  20610. * @returns {Iterable.<module:engine/model/node~Node>}
  20611. */
  20612. [ Symbol.iterator ]() {
  20613. return this._nodes[ Symbol.iterator ]();
  20614. }
  20615. /**
  20616. * Number of nodes contained inside this node list.
  20617. *
  20618. * @readonly
  20619. * @type {Number}
  20620. */
  20621. get length() {
  20622. return this._nodes.length;
  20623. }
  20624. /**
  20625. * Sum of {@link module:engine/model/node~Node#offsetSize offset sizes} of all nodes contained inside this node list.
  20626. *
  20627. * @readonly
  20628. * @type {Number}
  20629. */
  20630. get maxOffset() {
  20631. return this._nodes.reduce( ( sum, node ) => sum + node.offsetSize, 0 );
  20632. }
  20633. /**
  20634. * Gets the node at the given index. Returns `null` if incorrect index was passed.
  20635. *
  20636. * @param {Number} index Index of node.
  20637. * @returns {module:engine/model/node~Node|null} Node at given index.
  20638. */
  20639. getNode( index ) {
  20640. return this._nodes[ index ] || null;
  20641. }
  20642. /**
  20643. * Returns an index of the given node. Returns `null` if given node is not inside this node list.
  20644. *
  20645. * @param {module:engine/model/node~Node} node Child node to look for.
  20646. * @returns {Number|null} Child node's index.
  20647. */
  20648. getNodeIndex( node ) {
  20649. const index = this._nodes.indexOf( node );
  20650. return index == -1 ? null : index;
  20651. }
  20652. /**
  20653. * Returns the starting offset of given node. Starting offset is equal to the sum of
  20654. * {@link module:engine/model/node~Node#offsetSize offset sizes} of all nodes that are before this node in this node list.
  20655. *
  20656. * @param {module:engine/model/node~Node} node Node to look for.
  20657. * @returns {Number|null} Node's starting offset.
  20658. */
  20659. getNodeStartOffset( node ) {
  20660. const index = this.getNodeIndex( node );
  20661. return index === null ? null : this._nodes.slice( 0, index ).reduce( ( sum, node ) => sum + node.offsetSize, 0 );
  20662. }
  20663. /**
  20664. * Converts index to offset in node list.
  20665. *
  20666. * Returns starting offset of a node that is at given index. Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError}
  20667. * `model-nodelist-index-out-of-bounds` if given index is less than `0` or more than {@link #length}.
  20668. *
  20669. * @param {Number} index Node's index.
  20670. * @returns {Number} Node's starting offset.
  20671. */
  20672. indexToOffset( index ) {
  20673. if ( index == this._nodes.length ) {
  20674. return this.maxOffset;
  20675. }
  20676. const node = this._nodes[ index ];
  20677. if ( !node ) {
  20678. /**
  20679. * Given index cannot be found in the node list.
  20680. *
  20681. * @error model-nodelist-index-out-of-bounds
  20682. */
  20683. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'model-nodelist-index-out-of-bounds', this );
  20684. }
  20685. return this.getNodeStartOffset( node );
  20686. }
  20687. /**
  20688. * Converts offset in node list to index.
  20689. *
  20690. * Returns index of a node that occupies given offset. Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError}
  20691. * `model-nodelist-offset-out-of-bounds` if given offset is less than `0` or more than {@link #maxOffset}.
  20692. *
  20693. * @param {Number} offset Offset to look for.
  20694. * @returns {Number} Index of a node that occupies given offset.
  20695. */
  20696. offsetToIndex( offset ) {
  20697. let totalOffset = 0;
  20698. for ( const node of this._nodes ) {
  20699. if ( offset >= totalOffset && offset < totalOffset + node.offsetSize ) {
  20700. return this.getNodeIndex( node );
  20701. }
  20702. totalOffset += node.offsetSize;
  20703. }
  20704. if ( totalOffset != offset ) {
  20705. /**
  20706. * Given offset cannot be found in the node list.
  20707. *
  20708. * @error model-nodelist-offset-out-of-bounds
  20709. * @param {Number} offset
  20710. * @param {module:engine/model/nodelist~NodeList} nodeList Stringified node list.
  20711. */
  20712. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'model-nodelist-offset-out-of-bounds',
  20713. this,
  20714. {
  20715. offset,
  20716. nodeList: this
  20717. }
  20718. );
  20719. }
  20720. return this.length;
  20721. }
  20722. /**
  20723. * Inserts given nodes at given index.
  20724. *
  20725. * @protected
  20726. * @param {Number} index Index at which nodes should be inserted.
  20727. * @param {Iterable.<module:engine/model/node~Node>} nodes Nodes to be inserted.
  20728. */
  20729. _insertNodes( index, nodes ) {
  20730. // Validation.
  20731. for ( const node of nodes ) {
  20732. if ( !( node instanceof _node__WEBPACK_IMPORTED_MODULE_0__["default"] ) ) {
  20733. /**
  20734. * Trying to insert an object which is not a Node instance.
  20735. *
  20736. * @error model-nodelist-insertnodes-not-node
  20737. */
  20738. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'model-nodelist-insertnodes-not-node', this );
  20739. }
  20740. }
  20741. this._nodes.splice( index, 0, ...nodes );
  20742. }
  20743. /**
  20744. * Removes one or more nodes starting at the given index.
  20745. *
  20746. * @protected
  20747. * @param {Number} indexStart Index of the first node to remove.
  20748. * @param {Number} [howMany=1] Number of nodes to remove.
  20749. * @returns {Array.<module:engine/model/node~Node>} Array containing removed nodes.
  20750. */
  20751. _removeNodes( indexStart, howMany = 1 ) {
  20752. return this._nodes.splice( indexStart, howMany );
  20753. }
  20754. /**
  20755. * Converts `NodeList` instance to an array containing nodes that were inserted in the node list. Nodes
  20756. * are also converted to their plain object representation.
  20757. *
  20758. * @returns {Array.<module:engine/model/node~Node>} `NodeList` instance converted to `Array`.
  20759. */
  20760. toJSON() {
  20761. return this._nodes.map( node => node.toJSON() );
  20762. }
  20763. }
  20764. /***/ }),
  20765. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/attributeoperation.js":
  20766. /*!*******************************************************************************************!*\
  20767. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/attributeoperation.js ***!
  20768. \*******************************************************************************************/
  20769. /*! exports provided: default */
  20770. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20771. "use strict";
  20772. __webpack_require__.r(__webpack_exports__);
  20773. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AttributeOperation; });
  20774. /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
  20775. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  20776. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  20777. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.js");
  20778. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  20779. /**
  20780. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  20781. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  20782. */
  20783. /**
  20784. * @module engine/model/operation/attributeoperation
  20785. */
  20786. /**
  20787. * Operation to change nodes' attribute.
  20788. *
  20789. * Using this class you can add, remove or change value of the attribute.
  20790. *
  20791. * @extends module:engine/model/operation/operation~Operation
  20792. */
  20793. class AttributeOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
  20794. /**
  20795. * Creates an operation that changes, removes or adds attributes.
  20796. *
  20797. * If only `newValue` is set, attribute will be added on a node. Note that all nodes in operation's range must not
  20798. * have an attribute with the same key as the added attribute.
  20799. *
  20800. * If only `oldValue` is set, then attribute with given key will be removed. Note that all nodes in operation's range
  20801. * must have an attribute with that key added.
  20802. *
  20803. * If both `newValue` and `oldValue` are set, then the operation will change the attribute value. Note that all nodes in
  20804. * operation's ranges must already have an attribute with given key and `oldValue` as value
  20805. *
  20806. * @param {module:engine/model/range~Range} range Range on which the operation should be applied. Must be a flat range.
  20807. * @param {String} key Key of an attribute to change or remove.
  20808. * @param {*} oldValue Old value of the attribute with given key or `null`, if attribute was not set before.
  20809. * @param {*} newValue New value of the attribute with given key or `null`, if operation should remove attribute.
  20810. * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
  20811. * can be applied or `null` if the operation operates on detached (non-document) tree.
  20812. */
  20813. constructor( range, key, oldValue, newValue, baseVersion ) {
  20814. super( baseVersion );
  20815. /**
  20816. * Range on which operation should be applied.
  20817. *
  20818. * @readonly
  20819. * @member {module:engine/model/range~Range}
  20820. */
  20821. this.range = range.clone();
  20822. /**
  20823. * Key of an attribute to change or remove.
  20824. *
  20825. * @readonly
  20826. * @member {String}
  20827. */
  20828. this.key = key;
  20829. /**
  20830. * Old value of the attribute with given key or `null`, if attribute was not set before.
  20831. *
  20832. * @readonly
  20833. * @member {*}
  20834. */
  20835. this.oldValue = oldValue === undefined ? null : oldValue;
  20836. /**
  20837. * New value of the attribute with given key or `null`, if operation should remove attribute.
  20838. *
  20839. * @readonly
  20840. * @member {*}
  20841. */
  20842. this.newValue = newValue === undefined ? null : newValue;
  20843. }
  20844. /**
  20845. * @inheritDoc
  20846. */
  20847. get type() {
  20848. if ( this.oldValue === null ) {
  20849. return 'addAttribute';
  20850. } else if ( this.newValue === null ) {
  20851. return 'removeAttribute';
  20852. } else {
  20853. return 'changeAttribute';
  20854. }
  20855. }
  20856. /**
  20857. * Creates and returns an operation that has the same parameters as this operation.
  20858. *
  20859. * @returns {module:engine/model/operation/attributeoperation~AttributeOperation} Clone of this operation.
  20860. */
  20861. clone() {
  20862. return new AttributeOperation( this.range, this.key, this.oldValue, this.newValue, this.baseVersion );
  20863. }
  20864. /**
  20865. * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
  20866. *
  20867. * @returns {module:engine/model/operation/attributeoperation~AttributeOperation}
  20868. */
  20869. getReversed() {
  20870. return new AttributeOperation( this.range, this.key, this.newValue, this.oldValue, this.baseVersion + 1 );
  20871. }
  20872. /**
  20873. * @inheritDoc
  20874. */
  20875. toJSON() {
  20876. const json = super.toJSON();
  20877. json.range = this.range.toJSON();
  20878. return json;
  20879. }
  20880. /**
  20881. * @inheritDoc
  20882. */
  20883. _validate() {
  20884. if ( !this.range.isFlat ) {
  20885. /**
  20886. * The range to change is not flat.
  20887. *
  20888. * @error attribute-operation-range-not-flat
  20889. */
  20890. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'attribute-operation-range-not-flat', this );
  20891. }
  20892. for ( const item of this.range.getItems( { shallow: true } ) ) {
  20893. if ( this.oldValue !== null && !Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["isEqual"])( item.getAttribute( this.key ), this.oldValue ) ) {
  20894. /**
  20895. * Changed node has different attribute value than operation's old attribute value.
  20896. *
  20897. * @error attribute-operation-wrong-old-value
  20898. * @param {module:engine/model/item~Item} item
  20899. * @param {String} key
  20900. * @param {*} value
  20901. */
  20902. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
  20903. 'attribute-operation-wrong-old-value',
  20904. this,
  20905. { item, key: this.key, value: this.oldValue }
  20906. );
  20907. }
  20908. if ( this.oldValue === null && this.newValue !== null && item.hasAttribute( this.key ) ) {
  20909. /**
  20910. * The attribute with given key already exists for the given node.
  20911. *
  20912. * @error attribute-operation-attribute-exists
  20913. * @param {module:engine/model/node~Node} node
  20914. * @param {String} key
  20915. */
  20916. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
  20917. 'attribute-operation-attribute-exists',
  20918. this,
  20919. { node: item, key: this.key }
  20920. );
  20921. }
  20922. }
  20923. }
  20924. /**
  20925. * @inheritDoc
  20926. */
  20927. _execute() {
  20928. // If value to set is same as old value, don't do anything.
  20929. if ( !Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["isEqual"])( this.oldValue, this.newValue ) ) {
  20930. // Execution.
  20931. Object(_utils__WEBPACK_IMPORTED_MODULE_3__["_setAttribute"])( this.range, this.key, this.newValue );
  20932. }
  20933. }
  20934. /**
  20935. * @inheritDoc
  20936. */
  20937. static get className() {
  20938. return 'AttributeOperation';
  20939. }
  20940. /**
  20941. * Creates `AttributeOperation` object from deserilized object, i.e. from parsed JSON string.
  20942. *
  20943. * @param {Object} json Deserialized JSON object.
  20944. * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
  20945. * @returns {module:engine/model/operation/attributeoperation~AttributeOperation}
  20946. */
  20947. static fromJSON( json, document ) {
  20948. return new AttributeOperation( _range__WEBPACK_IMPORTED_MODULE_1__["default"].fromJSON( json.range, document ), json.key, json.oldValue, json.newValue, json.baseVersion );
  20949. }
  20950. // @if CK_DEBUG_ENGINE // toString() {
  20951. // @if CK_DEBUG_ENGINE // return `AttributeOperation( ${ this.baseVersion } ): ` +
  20952. // @if CK_DEBUG_ENGINE // `"${ this.key }": ${ JSON.stringify( this.oldValue ) }` +
  20953. // @if CK_DEBUG_ENGINE // ` -> ${ JSON.stringify( this.newValue ) }, ${ this.range }`;
  20954. // @if CK_DEBUG_ENGINE // }
  20955. }
  20956. /***/ }),
  20957. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/detachoperation.js":
  20958. /*!****************************************************************************************!*\
  20959. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/detachoperation.js ***!
  20960. \****************************************************************************************/
  20961. /*! exports provided: default */
  20962. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20963. "use strict";
  20964. __webpack_require__.r(__webpack_exports__);
  20965. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DetachOperation; });
  20966. /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
  20967. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  20968. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.js");
  20969. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  20970. /**
  20971. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  20972. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  20973. */
  20974. /**
  20975. * @module engine/model/operation/detachoperation
  20976. */
  20977. // @if CK_DEBUG_ENGINE // const ModelRange = require( '../range' ).default;
  20978. /**
  20979. * Operation to permanently remove node from detached root.
  20980. * Note this operation is only a local operation and won't be send to the other clients.
  20981. *
  20982. * @extends module:engine/model/operation/operation~Operation
  20983. */
  20984. class DetachOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
  20985. /**
  20986. * Creates an insert operation.
  20987. *
  20988. * @param {module:engine/model/position~Position} sourcePosition
  20989. * Position before the first {@link module:engine/model/item~Item model item} to move.
  20990. * @param {Number} howMany Offset size of moved range. Moved range will start from `sourcePosition` and end at
  20991. * `sourcePosition` with offset shifted by `howMany`.
  20992. */
  20993. constructor( sourcePosition, howMany ) {
  20994. super( null );
  20995. /**
  20996. * Position before the first {@link module:engine/model/item~Item model item} to detach.
  20997. *
  20998. * @member {module:engine/model/position~Position} #sourcePosition
  20999. */
  21000. this.sourcePosition = sourcePosition.clone();
  21001. /**
  21002. * Offset size of moved range.
  21003. *
  21004. * @member {Number} #howMany
  21005. */
  21006. this.howMany = howMany;
  21007. }
  21008. /**
  21009. * @inheritDoc
  21010. */
  21011. get type() {
  21012. return 'detach';
  21013. }
  21014. /**
  21015. * @inheritDoc
  21016. */
  21017. toJSON() {
  21018. const json = super.toJSON();
  21019. json.sourcePosition = this.sourcePosition.toJSON();
  21020. return json;
  21021. }
  21022. /**
  21023. * @inheritDoc
  21024. */
  21025. _validate() {
  21026. if ( this.sourcePosition.root.document ) {
  21027. /**
  21028. * Cannot detach document node.
  21029. *
  21030. * @error detach-operation-on-document-node
  21031. */
  21032. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__["default"]( 'detach-operation-on-document-node', this );
  21033. }
  21034. }
  21035. /**
  21036. * @inheritDoc
  21037. */
  21038. _execute() {
  21039. Object(_utils__WEBPACK_IMPORTED_MODULE_2__["_remove"])( _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createFromPositionAndShift( this.sourcePosition, this.howMany ) );
  21040. }
  21041. /**
  21042. * @inheritDoc
  21043. */
  21044. static get className() {
  21045. return 'DetachOperation';
  21046. }
  21047. // @if CK_DEBUG_ENGINE // toString() {
  21048. // @if CK_DEBUG_ENGINE // const range = ModelRange._createFromPositionAndShift( this.sourcePosition, this.howMany );
  21049. // @if CK_DEBUG_ENGINE // const nodes = Array.from( range.getItems() );
  21050. // @if CK_DEBUG_ENGINE // const nodeString = nodes.length > 1 ? `[ ${ nodes.length } ]` : nodes[ 0 ];
  21051. // @if CK_DEBUG_ENGINE // return `DetachOperation( ${ this.baseVersion } ): ${ nodeString } -> ${ range }`;
  21052. // @if CK_DEBUG_ENGINE // }
  21053. }
  21054. /***/ }),
  21055. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/insertoperation.js":
  21056. /*!****************************************************************************************!*\
  21057. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/insertoperation.js ***!
  21058. \****************************************************************************************/
  21059. /*! exports provided: default */
  21060. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21061. "use strict";
  21062. __webpack_require__.r(__webpack_exports__);
  21063. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InsertOperation; });
  21064. /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
  21065. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  21066. /* harmony import */ var _nodelist__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../nodelist */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/nodelist.js");
  21067. /* harmony import */ var _moveoperation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./moveoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/moveoperation.js");
  21068. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.js");
  21069. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../text */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js");
  21070. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
  21071. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  21072. /**
  21073. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  21074. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  21075. */
  21076. /**
  21077. * @module engine/model/operation/insertoperation
  21078. */
  21079. /**
  21080. * Operation to insert one or more nodes at given position in the model.
  21081. *
  21082. * @extends module:engine/model/operation/operation~Operation
  21083. */
  21084. class InsertOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
  21085. /**
  21086. * Creates an insert operation.
  21087. *
  21088. * @param {module:engine/model/position~Position} position Position of insertion.
  21089. * @param {module:engine/model/node~NodeSet} nodes The list of nodes to be inserted.
  21090. * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
  21091. * can be applied or `null` if the operation operates on detached (non-document) tree.
  21092. */
  21093. constructor( position, nodes, baseVersion ) {
  21094. super( baseVersion );
  21095. /**
  21096. * Position of insertion.
  21097. *
  21098. * @readonly
  21099. * @member {module:engine/model/position~Position} module:engine/model/operation/insertoperation~InsertOperation#position
  21100. */
  21101. this.position = position.clone();
  21102. this.position.stickiness = 'toNone';
  21103. /**
  21104. * List of nodes to insert.
  21105. *
  21106. * @readonly
  21107. * @member {module:engine/model/nodelist~NodeList} module:engine/model/operation/insertoperation~InsertOperation#nodeList
  21108. */
  21109. this.nodes = new _nodelist__WEBPACK_IMPORTED_MODULE_2__["default"]( Object(_utils__WEBPACK_IMPORTED_MODULE_4__["_normalizeNodes"])( nodes ) );
  21110. /**
  21111. * Flag deciding how the operation should be transformed. If set to `true`, nodes might get additional attributes
  21112. * during operational transformation. This happens when the operation insertion position is inside of a range
  21113. * where attributes have changed.
  21114. *
  21115. * @member {Boolean} module:engine/model/operation/insertoperation~InsertOperation#shouldReceiveAttributes
  21116. */
  21117. this.shouldReceiveAttributes = false;
  21118. }
  21119. /**
  21120. * @inheritDoc
  21121. */
  21122. get type() {
  21123. return 'insert';
  21124. }
  21125. /**
  21126. * Total offset size of inserted nodes.
  21127. *
  21128. * @returns {Number}
  21129. */
  21130. get howMany() {
  21131. return this.nodes.maxOffset;
  21132. }
  21133. /**
  21134. * Creates and returns an operation that has the same parameters as this operation.
  21135. *
  21136. * @returns {module:engine/model/operation/insertoperation~InsertOperation} Clone of this operation.
  21137. */
  21138. clone() {
  21139. const nodes = new _nodelist__WEBPACK_IMPORTED_MODULE_2__["default"]( [ ...this.nodes ].map( node => node._clone( true ) ) );
  21140. const insert = new InsertOperation( this.position, nodes, this.baseVersion );
  21141. insert.shouldReceiveAttributes = this.shouldReceiveAttributes;
  21142. return insert;
  21143. }
  21144. /**
  21145. * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
  21146. *
  21147. * @returns {module:engine/model/operation/moveoperation~MoveOperation}
  21148. */
  21149. getReversed() {
  21150. const graveyard = this.position.root.document.graveyard;
  21151. const gyPosition = new _position__WEBPACK_IMPORTED_MODULE_1__["default"]( graveyard, [ 0 ] );
  21152. return new _moveoperation__WEBPACK_IMPORTED_MODULE_3__["default"]( this.position, this.nodes.maxOffset, gyPosition, this.baseVersion + 1 );
  21153. }
  21154. /**
  21155. * @inheritDoc
  21156. */
  21157. _validate() {
  21158. const targetElement = this.position.parent;
  21159. if ( !targetElement || targetElement.maxOffset < this.position.offset ) {
  21160. /**
  21161. * Insertion position is invalid.
  21162. *
  21163. * @error insert-operation-position-invalid
  21164. */
  21165. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_7__["default"](
  21166. 'insert-operation-position-invalid',
  21167. this
  21168. );
  21169. }
  21170. }
  21171. /**
  21172. * @inheritDoc
  21173. */
  21174. _execute() {
  21175. // What happens here is that we want original nodes be passed to writer because we want original nodes
  21176. // to be inserted to the model. But in InsertOperation, we want to keep those nodes as they were added
  21177. // to the operation, not modified. For example, text nodes can get merged or cropped while Elements can
  21178. // get children. It is important that InsertOperation has the copy of original nodes in intact state.
  21179. const originalNodes = this.nodes;
  21180. this.nodes = new _nodelist__WEBPACK_IMPORTED_MODULE_2__["default"]( [ ...originalNodes ].map( node => node._clone( true ) ) );
  21181. Object(_utils__WEBPACK_IMPORTED_MODULE_4__["_insert"])( this.position, originalNodes );
  21182. }
  21183. /**
  21184. * @inheritDoc
  21185. */
  21186. toJSON() {
  21187. const json = super.toJSON();
  21188. json.position = this.position.toJSON();
  21189. json.nodes = this.nodes.toJSON();
  21190. return json;
  21191. }
  21192. /**
  21193. * @inheritDoc
  21194. */
  21195. static get className() {
  21196. return 'InsertOperation';
  21197. }
  21198. /**
  21199. * Creates `InsertOperation` object from deserilized object, i.e. from parsed JSON string.
  21200. *
  21201. * @param {Object} json Deserialized JSON object.
  21202. * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
  21203. * @returns {module:engine/model/operation/insertoperation~InsertOperation}
  21204. */
  21205. static fromJSON( json, document ) {
  21206. const children = [];
  21207. for ( const child of json.nodes ) {
  21208. if ( child.name ) {
  21209. // If child has name property, it is an Element.
  21210. children.push( _element__WEBPACK_IMPORTED_MODULE_6__["default"].fromJSON( child ) );
  21211. } else {
  21212. // Otherwise, it is a Text node.
  21213. children.push( _text__WEBPACK_IMPORTED_MODULE_5__["default"].fromJSON( child ) );
  21214. }
  21215. }
  21216. const insert = new InsertOperation( _position__WEBPACK_IMPORTED_MODULE_1__["default"].fromJSON( json.position, document ), children, json.baseVersion );
  21217. insert.shouldReceiveAttributes = json.shouldReceiveAttributes;
  21218. return insert;
  21219. }
  21220. // @if CK_DEBUG_ENGINE // toString() {
  21221. // @if CK_DEBUG_ENGINE // const nodeString = this.nodes.length > 1 ? `[ ${ this.nodes.length } ]` : this.nodes.getNode( 0 );
  21222. // @if CK_DEBUG_ENGINE // return `InsertOperation( ${ this.baseVersion } ): ${ nodeString } -> ${ this.position }`;
  21223. // @if CK_DEBUG_ENGINE // }
  21224. }
  21225. /***/ }),
  21226. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/markeroperation.js":
  21227. /*!****************************************************************************************!*\
  21228. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/markeroperation.js ***!
  21229. \****************************************************************************************/
  21230. /*! exports provided: default */
  21231. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21232. "use strict";
  21233. __webpack_require__.r(__webpack_exports__);
  21234. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MarkerOperation; });
  21235. /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
  21236. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  21237. /**
  21238. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  21239. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  21240. */
  21241. /**
  21242. * @module engine/model/operation/markeroperation
  21243. */
  21244. /**
  21245. * @extends module:engine/model/operation/operation~Operation
  21246. */
  21247. class MarkerOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
  21248. /**
  21249. * @param {String} name Marker name.
  21250. * @param {module:engine/model/range~Range} oldRange Marker range before the change.
  21251. * @param {module:engine/model/range~Range} newRange Marker range after the change.
  21252. * @param {module:engine/model/markercollection~MarkerCollection} markers Marker collection on which change should be executed.
  21253. * @param {Boolean} affectsData Specifies whether the marker operation affects the data produced by the data pipeline
  21254. * (is persisted in the editor's data).
  21255. * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
  21256. * can be applied or `null` if the operation operates on detached (non-document) tree.
  21257. */
  21258. constructor( name, oldRange, newRange, markers, affectsData, baseVersion ) {
  21259. super( baseVersion );
  21260. /**
  21261. * Marker name.
  21262. *
  21263. * @readonly
  21264. * @member {String}
  21265. */
  21266. this.name = name;
  21267. /**
  21268. * Marker range before the change.
  21269. *
  21270. * @readonly
  21271. * @member {module:engine/model/range~Range}
  21272. */
  21273. this.oldRange = oldRange ? oldRange.clone() : null;
  21274. /**
  21275. * Marker range after the change.
  21276. *
  21277. * @readonly
  21278. * @member {module:engine/model/range~Range}
  21279. */
  21280. this.newRange = newRange ? newRange.clone() : null;
  21281. /**
  21282. * Specifies whether the marker operation affects the data produced by the data pipeline
  21283. * (is persisted in the editor's data).
  21284. *
  21285. * @readonly
  21286. * @member {Boolean}
  21287. */
  21288. this.affectsData = affectsData;
  21289. /**
  21290. * Marker collection on which change should be executed.
  21291. *
  21292. * @private
  21293. * @member {module:engine/model/markercollection~MarkerCollection}
  21294. */
  21295. this._markers = markers;
  21296. }
  21297. /**
  21298. * @inheritDoc
  21299. */
  21300. get type() {
  21301. return 'marker';
  21302. }
  21303. /**
  21304. * Creates and returns an operation that has the same parameters as this operation.
  21305. *
  21306. * @returns {module:engine/model/operation/markeroperation~MarkerOperation} Clone of this operation.
  21307. */
  21308. clone() {
  21309. return new MarkerOperation( this.name, this.oldRange, this.newRange, this._markers, this.affectsData, this.baseVersion );
  21310. }
  21311. /**
  21312. * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
  21313. *
  21314. * @returns {module:engine/model/operation/markeroperation~MarkerOperation}
  21315. */
  21316. getReversed() {
  21317. return new MarkerOperation( this.name, this.newRange, this.oldRange, this._markers, this.affectsData, this.baseVersion + 1 );
  21318. }
  21319. /**
  21320. * @inheritDoc
  21321. */
  21322. _execute() {
  21323. const type = this.newRange ? '_set' : '_remove';
  21324. this._markers[ type ]( this.name, this.newRange, true, this.affectsData );
  21325. }
  21326. /**
  21327. * @inheritDoc
  21328. */
  21329. toJSON() {
  21330. const json = super.toJSON();
  21331. if ( this.oldRange ) {
  21332. json.oldRange = this.oldRange.toJSON();
  21333. }
  21334. if ( this.newRange ) {
  21335. json.newRange = this.newRange.toJSON();
  21336. }
  21337. delete json._markers;
  21338. return json;
  21339. }
  21340. /**
  21341. * @inheritDoc
  21342. */
  21343. static get className() {
  21344. return 'MarkerOperation';
  21345. }
  21346. /**
  21347. * Creates `MarkerOperation` object from deserialized object, i.e. from parsed JSON string.
  21348. *
  21349. * @param {Object} json Deserialized JSON object.
  21350. * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
  21351. * @returns {module:engine/model/operation/markeroperation~MarkerOperation}
  21352. */
  21353. static fromJSON( json, document ) {
  21354. return new MarkerOperation(
  21355. json.name,
  21356. json.oldRange ? _range__WEBPACK_IMPORTED_MODULE_1__["default"].fromJSON( json.oldRange, document ) : null,
  21357. json.newRange ? _range__WEBPACK_IMPORTED_MODULE_1__["default"].fromJSON( json.newRange, document ) : null,
  21358. document.model.markers,
  21359. json.affectsData,
  21360. json.baseVersion
  21361. );
  21362. }
  21363. // @if CK_DEBUG_ENGINE // toString() {
  21364. // @if CK_DEBUG_ENGINE // return `MarkerOperation( ${ this.baseVersion } ): ` +
  21365. // @if CK_DEBUG_ENGINE // `"${ this.name }": ${ this.oldRange } -> ${ this.newRange }`;
  21366. // @if CK_DEBUG_ENGINE // }
  21367. }
  21368. /***/ }),
  21369. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/mergeoperation.js":
  21370. /*!***************************************************************************************!*\
  21371. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/mergeoperation.js ***!
  21372. \***************************************************************************************/
  21373. /*! exports provided: default */
  21374. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21375. "use strict";
  21376. __webpack_require__.r(__webpack_exports__);
  21377. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MergeOperation; });
  21378. /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
  21379. /* harmony import */ var _splitoperation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./splitoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/splitoperation.js");
  21380. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  21381. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  21382. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.js");
  21383. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  21384. /**
  21385. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  21386. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  21387. */
  21388. /**
  21389. * @module engine/model/operation/mergeoperation
  21390. */
  21391. /**
  21392. * Operation to merge two {@link module:engine/model/element~Element elements}.
  21393. *
  21394. * The merged element is the parent of {@link ~MergeOperation#sourcePosition} and it is merged into the parent of
  21395. * {@link ~MergeOperation#targetPosition}. All nodes from the merged element are moved to {@link ~MergeOperation#targetPosition}.
  21396. *
  21397. * The merged element is moved to the graveyard at {@link ~MergeOperation#graveyardPosition}.
  21398. *
  21399. * @extends module:engine/model/operation/operation~Operation
  21400. */
  21401. class MergeOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
  21402. /**
  21403. * Creates a merge operation.
  21404. *
  21405. * @param {module:engine/model/position~Position} sourcePosition Position inside the merged element. All nodes from that
  21406. * element after that position will be moved to {@link ~#targetPosition}.
  21407. * @param {Number} howMany Summary offset size of nodes which will be moved from the merged element to the new parent.
  21408. * @param {module:engine/model/position~Position} targetPosition Position which the nodes from the merged elements will be moved to.
  21409. * @param {module:engine/model/position~Position} graveyardPosition Position in graveyard to which the merged element will be moved.
  21410. * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
  21411. * can be applied or `null` if the operation operates on detached (non-document) tree.
  21412. */
  21413. constructor( sourcePosition, howMany, targetPosition, graveyardPosition, baseVersion ) {
  21414. super( baseVersion );
  21415. /**
  21416. * Position inside the merged element. All nodes from that element after that position will be moved to {@link ~#targetPosition}.
  21417. *
  21418. * @member {module:engine/model/position~Position} module:engine/model/operation/mergeoperation~MergeOperation#sourcePosition
  21419. */
  21420. this.sourcePosition = sourcePosition.clone();
  21421. // This is, and should always remain, the first position in its parent.
  21422. this.sourcePosition.stickiness = 'toPrevious';
  21423. /**
  21424. * Summary offset size of nodes which will be moved from the merged element to the new parent.
  21425. *
  21426. * @member {Number} module:engine/model/operation/mergeoperation~MergeOperation#howMany
  21427. */
  21428. this.howMany = howMany;
  21429. /**
  21430. * Position which the nodes from the merged elements will be moved to.
  21431. *
  21432. * @member {module:engine/model/position~Position} module:engine/model/operation/mergeoperation~MergeOperation#targetPosition
  21433. */
  21434. this.targetPosition = targetPosition.clone();
  21435. // Except of a rare scenario in `MergeOperation` x `MergeOperation` transformation,
  21436. // this is, and should always remain, the last position in its parent.
  21437. this.targetPosition.stickiness = 'toNext';
  21438. /**
  21439. * Position in graveyard to which the merged element will be moved.
  21440. *
  21441. * @member {module:engine/model/position~Position} module:engine/model/operation/mergeoperation~MergeOperation#graveyardPosition
  21442. */
  21443. this.graveyardPosition = graveyardPosition.clone();
  21444. }
  21445. /**
  21446. * @inheritDoc
  21447. */
  21448. get type() {
  21449. return 'merge';
  21450. }
  21451. /**
  21452. * Position before the merged element (which will be deleted).
  21453. *
  21454. * @readonly
  21455. * @type {module:engine/model/position~Position}
  21456. */
  21457. get deletionPosition() {
  21458. return new _position__WEBPACK_IMPORTED_MODULE_2__["default"]( this.sourcePosition.root, this.sourcePosition.path.slice( 0, -1 ) );
  21459. }
  21460. /**
  21461. * Artificial range that contains all the nodes from the merged element that will be moved to {@link ~MergeOperation#sourcePosition}.
  21462. * The range starts at {@link ~MergeOperation#sourcePosition} and ends in the same parent, at `POSITIVE_INFINITY` offset.
  21463. *
  21464. * @readonly
  21465. * @type {module:engine/model/range~Range}
  21466. */
  21467. get movedRange() {
  21468. const end = this.sourcePosition.getShiftedBy( Number.POSITIVE_INFINITY );
  21469. return new _range__WEBPACK_IMPORTED_MODULE_3__["default"]( this.sourcePosition, end );
  21470. }
  21471. /**
  21472. * Creates and returns an operation that has the same parameters as this operation.
  21473. *
  21474. * @returns {module:engine/model/operation/mergeoperation~MergeOperation} Clone of this operation.
  21475. */
  21476. clone() {
  21477. return new this.constructor( this.sourcePosition, this.howMany, this.targetPosition, this.graveyardPosition, this.baseVersion );
  21478. }
  21479. /**
  21480. * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
  21481. *
  21482. * @returns {module:engine/model/operation/splitoperation~SplitOperation}
  21483. */
  21484. getReversed() {
  21485. // Positions in this method are transformed by this merge operation because the split operation bases on
  21486. // the context after this merge operation happened (because split operation reverses it).
  21487. // So we need to acknowledge that the merge operation happened and those positions changed a little.
  21488. const targetPosition = this.targetPosition._getTransformedByMergeOperation( this );
  21489. const path = this.sourcePosition.path.slice( 0, -1 );
  21490. const insertionPosition = new _position__WEBPACK_IMPORTED_MODULE_2__["default"]( this.sourcePosition.root, path )._getTransformedByMergeOperation( this );
  21491. const split = new _splitoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( targetPosition, this.howMany, this.graveyardPosition, this.baseVersion + 1 );
  21492. split.insertionPosition = insertionPosition;
  21493. return split;
  21494. }
  21495. /**
  21496. * @inheritDoc
  21497. */
  21498. _validate() {
  21499. const sourceElement = this.sourcePosition.parent;
  21500. const targetElement = this.targetPosition.parent;
  21501. // Validate whether merge operation has correct parameters.
  21502. if ( !sourceElement.parent ) {
  21503. /**
  21504. * Merge source position is invalid. The element to be merged must have a parent node.
  21505. *
  21506. * @error merge-operation-source-position-invalid
  21507. */
  21508. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'merge-operation-source-position-invalid', this );
  21509. } else if ( !targetElement.parent ) {
  21510. /**
  21511. * Merge target position is invalid. The element to be merged must have a parent node.
  21512. *
  21513. * @error merge-operation-target-position-invalid
  21514. */
  21515. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'merge-operation-target-position-invalid', this );
  21516. } else if ( this.howMany != sourceElement.maxOffset ) {
  21517. /**
  21518. * Merge operation specifies wrong number of nodes to move.
  21519. *
  21520. * @error merge-operation-how-many-invalid
  21521. */
  21522. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'merge-operation-how-many-invalid', this );
  21523. }
  21524. }
  21525. /**
  21526. * @inheritDoc
  21527. */
  21528. _execute() {
  21529. const mergedElement = this.sourcePosition.parent;
  21530. const sourceRange = _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createIn( mergedElement );
  21531. Object(_utils__WEBPACK_IMPORTED_MODULE_4__["_move"])( sourceRange, this.targetPosition );
  21532. Object(_utils__WEBPACK_IMPORTED_MODULE_4__["_move"])( _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createOn( mergedElement ), this.graveyardPosition );
  21533. }
  21534. /**
  21535. * @inheritDoc
  21536. */
  21537. toJSON() {
  21538. const json = super.toJSON();
  21539. json.sourcePosition = json.sourcePosition.toJSON();
  21540. json.targetPosition = json.targetPosition.toJSON();
  21541. json.graveyardPosition = json.graveyardPosition.toJSON();
  21542. return json;
  21543. }
  21544. /**
  21545. * @inheritDoc
  21546. */
  21547. static get className() {
  21548. return 'MergeOperation';
  21549. }
  21550. /**
  21551. * Creates `MergeOperation` object from deserilized object, i.e. from parsed JSON string.
  21552. *
  21553. * @param {Object} json Deserialized JSON object.
  21554. * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
  21555. * @returns {module:engine/model/operation/mergeoperation~MergeOperation}
  21556. */
  21557. static fromJSON( json, document ) {
  21558. const sourcePosition = _position__WEBPACK_IMPORTED_MODULE_2__["default"].fromJSON( json.sourcePosition, document );
  21559. const targetPosition = _position__WEBPACK_IMPORTED_MODULE_2__["default"].fromJSON( json.targetPosition, document );
  21560. const graveyardPosition = _position__WEBPACK_IMPORTED_MODULE_2__["default"].fromJSON( json.graveyardPosition, document );
  21561. return new this( sourcePosition, json.howMany, targetPosition, graveyardPosition, json.baseVersion );
  21562. }
  21563. // @if CK_DEBUG_ENGINE // toString() {
  21564. // @if CK_DEBUG_ENGINE // return `MergeOperation( ${ this.baseVersion } ): ` +
  21565. // @if CK_DEBUG_ENGINE // `${ this.sourcePosition } -> ${ this.targetPosition }` +
  21566. // @if CK_DEBUG_ENGINE // ` ( ${ this.howMany } ), ${ this.graveyardPosition }`;
  21567. // @if CK_DEBUG_ENGINE // }
  21568. }
  21569. /***/ }),
  21570. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/moveoperation.js":
  21571. /*!**************************************************************************************!*\
  21572. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/moveoperation.js ***!
  21573. \**************************************************************************************/
  21574. /*! exports provided: default */
  21575. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21576. "use strict";
  21577. __webpack_require__.r(__webpack_exports__);
  21578. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MoveOperation; });
  21579. /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
  21580. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  21581. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  21582. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  21583. /* harmony import */ var _ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/comparearrays */ "./node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.js");
  21584. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.js");
  21585. /**
  21586. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  21587. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  21588. */
  21589. /**
  21590. * @module engine/model/operation/moveoperation
  21591. */
  21592. // @if CK_DEBUG_ENGINE // const ModelRange = require( '../range' ).default;
  21593. /**
  21594. * Operation to move a range of {@link module:engine/model/item~Item model items}
  21595. * to given {@link module:engine/model/position~Position target position}.
  21596. *
  21597. * @extends module:engine/model/operation/operation~Operation
  21598. */
  21599. class MoveOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
  21600. /**
  21601. * Creates a move operation.
  21602. *
  21603. * @param {module:engine/model/position~Position} sourcePosition
  21604. * Position before the first {@link module:engine/model/item~Item model item} to move.
  21605. * @param {Number} howMany Offset size of moved range. Moved range will start from `sourcePosition` and end at
  21606. * `sourcePosition` with offset shifted by `howMany`.
  21607. * @param {module:engine/model/position~Position} targetPosition Position at which moved nodes will be inserted.
  21608. * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
  21609. * can be applied or `null` if the operation operates on detached (non-document) tree.
  21610. */
  21611. constructor( sourcePosition, howMany, targetPosition, baseVersion ) {
  21612. super( baseVersion );
  21613. /**
  21614. * Position before the first {@link module:engine/model/item~Item model item} to move.
  21615. *
  21616. * @member {module:engine/model/position~Position} module:engine/model/operation/moveoperation~MoveOperation#sourcePosition
  21617. */
  21618. this.sourcePosition = sourcePosition.clone();
  21619. // `'toNext'` because `sourcePosition` is a bit like a start of the moved range.
  21620. this.sourcePosition.stickiness = 'toNext';
  21621. /**
  21622. * Offset size of moved range.
  21623. *
  21624. * @member {Number} module:engine/model/operation/moveoperation~MoveOperation#howMany
  21625. */
  21626. this.howMany = howMany;
  21627. /**
  21628. * Position at which moved nodes will be inserted.
  21629. *
  21630. * @member {module:engine/model/position~Position} module:engine/model/operation/moveoperation~MoveOperation#targetPosition
  21631. */
  21632. this.targetPosition = targetPosition.clone();
  21633. this.targetPosition.stickiness = 'toNone';
  21634. }
  21635. /**
  21636. * @inheritDoc
  21637. */
  21638. get type() {
  21639. if ( this.targetPosition.root.rootName == '$graveyard' ) {
  21640. return 'remove';
  21641. } else if ( this.sourcePosition.root.rootName == '$graveyard' ) {
  21642. return 'reinsert';
  21643. }
  21644. return 'move';
  21645. }
  21646. /**
  21647. * Creates and returns an operation that has the same parameters as this operation.
  21648. *
  21649. * @returns {module:engine/model/operation/moveoperation~MoveOperation} Clone of this operation.
  21650. */
  21651. clone() {
  21652. return new this.constructor( this.sourcePosition, this.howMany, this.targetPosition, this.baseVersion );
  21653. }
  21654. /**
  21655. * Returns the start position of the moved range after it got moved. This may be different than
  21656. * {@link module:engine/model/operation/moveoperation~MoveOperation#targetPosition} in some cases, i.e. when a range is moved
  21657. * inside the same parent but {@link module:engine/model/operation/moveoperation~MoveOperation#targetPosition targetPosition}
  21658. * is after {@link module:engine/model/operation/moveoperation~MoveOperation#sourcePosition sourcePosition}.
  21659. *
  21660. * vv vv
  21661. * abcdefg ===> adefbcg
  21662. * ^ ^
  21663. * targetPos movedRangeStart
  21664. * offset 6 offset 4
  21665. *
  21666. * @returns {module:engine/model/position~Position}
  21667. */
  21668. getMovedRangeStart() {
  21669. return this.targetPosition._getTransformedByDeletion( this.sourcePosition, this.howMany );
  21670. }
  21671. /**
  21672. * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
  21673. *
  21674. * @returns {module:engine/model/operation/moveoperation~MoveOperation}
  21675. */
  21676. getReversed() {
  21677. const newTargetPosition = this.sourcePosition._getTransformedByInsertion( this.targetPosition, this.howMany );
  21678. return new this.constructor( this.getMovedRangeStart(), this.howMany, newTargetPosition, this.baseVersion + 1 );
  21679. }
  21680. /**
  21681. * @inheritDoc
  21682. */
  21683. _validate() {
  21684. const sourceElement = this.sourcePosition.parent;
  21685. const targetElement = this.targetPosition.parent;
  21686. const sourceOffset = this.sourcePosition.offset;
  21687. const targetOffset = this.targetPosition.offset;
  21688. // Validate whether move operation has correct parameters.
  21689. // Validation is pretty complex but move operation is one of the core ways to manipulate the document state.
  21690. // We expect that many errors might be connected with one of scenarios described below.
  21691. if ( sourceOffset + this.howMany > sourceElement.maxOffset ) {
  21692. /**
  21693. * The nodes which should be moved do not exist.
  21694. *
  21695. * @error move-operation-nodes-do-not-exist
  21696. */
  21697. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__["default"](
  21698. 'move-operation-nodes-do-not-exist', this
  21699. );
  21700. } else if ( sourceElement === targetElement && sourceOffset < targetOffset && targetOffset < sourceOffset + this.howMany ) {
  21701. /**
  21702. * Trying to move a range of nodes into the middle of that range.
  21703. *
  21704. * @error move-operation-range-into-itself
  21705. */
  21706. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__["default"](
  21707. 'move-operation-range-into-itself', this
  21708. );
  21709. } else if ( this.sourcePosition.root == this.targetPosition.root ) {
  21710. if ( Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_4__["default"])( this.sourcePosition.getParentPath(), this.targetPosition.getParentPath() ) == 'prefix' ) {
  21711. const i = this.sourcePosition.path.length - 1;
  21712. if ( this.targetPosition.path[ i ] >= sourceOffset && this.targetPosition.path[ i ] < sourceOffset + this.howMany ) {
  21713. /**
  21714. * Trying to move a range of nodes into one of nodes from that range.
  21715. *
  21716. * @error move-operation-node-into-itself
  21717. */
  21718. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_3__["default"](
  21719. 'move-operation-node-into-itself', this
  21720. );
  21721. }
  21722. }
  21723. }
  21724. }
  21725. /**
  21726. * @inheritDoc
  21727. */
  21728. _execute() {
  21729. Object(_utils__WEBPACK_IMPORTED_MODULE_5__["_move"])( _range__WEBPACK_IMPORTED_MODULE_2__["default"]._createFromPositionAndShift( this.sourcePosition, this.howMany ), this.targetPosition );
  21730. }
  21731. /**
  21732. * @inheritDoc
  21733. */
  21734. toJSON() {
  21735. const json = super.toJSON();
  21736. json.sourcePosition = this.sourcePosition.toJSON();
  21737. json.targetPosition = this.targetPosition.toJSON();
  21738. return json;
  21739. }
  21740. /**
  21741. * @inheritDoc
  21742. */
  21743. static get className() {
  21744. return 'MoveOperation';
  21745. }
  21746. /**
  21747. * Creates `MoveOperation` object from deserilized object, i.e. from parsed JSON string.
  21748. *
  21749. * @param {Object} json Deserialized JSON object.
  21750. * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
  21751. * @returns {module:engine/model/operation/moveoperation~MoveOperation}
  21752. */
  21753. static fromJSON( json, document ) {
  21754. const sourcePosition = _position__WEBPACK_IMPORTED_MODULE_1__["default"].fromJSON( json.sourcePosition, document );
  21755. const targetPosition = _position__WEBPACK_IMPORTED_MODULE_1__["default"].fromJSON( json.targetPosition, document );
  21756. return new this( sourcePosition, json.howMany, targetPosition, json.baseVersion );
  21757. }
  21758. // @if CK_DEBUG_ENGINE // toString() {
  21759. // @if CK_DEBUG_ENGINE // const range = ModelRange._createFromPositionAndShift( this.sourcePosition, this.howMany );
  21760. // @if CK_DEBUG_ENGINE // return `MoveOperation( ${ this.baseVersion } ): ${ range } -> ${ this.targetPosition }`;
  21761. // @if CK_DEBUG_ENGINE // }
  21762. }
  21763. /***/ }),
  21764. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/nooperation.js":
  21765. /*!************************************************************************************!*\
  21766. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/nooperation.js ***!
  21767. \************************************************************************************/
  21768. /*! exports provided: default */
  21769. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21770. "use strict";
  21771. __webpack_require__.r(__webpack_exports__);
  21772. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return NoOperation; });
  21773. /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
  21774. /**
  21775. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  21776. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  21777. */
  21778. /**
  21779. * @module engine/model/operation/nooperation
  21780. */
  21781. /**
  21782. * Operation which is doing nothing ("empty operation", "do-nothing operation", "noop"). This is an operation,
  21783. * which when executed does not change the tree model. It still has some parameters defined for transformation purposes.
  21784. *
  21785. * In most cases this operation is a result of transforming operations. When transformation returns
  21786. * {@link module:engine/model/operation/nooperation~NoOperation} it means that changes done by the transformed operation
  21787. * have already been applied.
  21788. *
  21789. * @extends module:engine/model/operation/operation~Operation
  21790. */
  21791. class NoOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
  21792. get type() {
  21793. return 'noop';
  21794. }
  21795. /**
  21796. * Creates and returns an operation that has the same parameters as this operation.
  21797. *
  21798. * @returns {module:engine/model/operation/nooperation~NoOperation} Clone of this operation.
  21799. */
  21800. clone() {
  21801. return new NoOperation( this.baseVersion );
  21802. }
  21803. /**
  21804. * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
  21805. *
  21806. * @returns {module:engine/model/operation/nooperation~NoOperation}
  21807. */
  21808. getReversed() {
  21809. return new NoOperation( this.baseVersion + 1 );
  21810. }
  21811. _execute() {
  21812. }
  21813. /**
  21814. * @inheritDoc
  21815. */
  21816. static get className() {
  21817. return 'NoOperation';
  21818. }
  21819. // @if CK_DEBUG_ENGINE // toString() {
  21820. // @if CK_DEBUG_ENGINE // return `NoOperation( ${ this.baseVersion } )`;
  21821. // @if CK_DEBUG_ENGINE // }
  21822. }
  21823. /***/ }),
  21824. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js":
  21825. /*!**********************************************************************************!*\
  21826. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js ***!
  21827. \**********************************************************************************/
  21828. /*! exports provided: default */
  21829. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21830. "use strict";
  21831. __webpack_require__.r(__webpack_exports__);
  21832. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Operation; });
  21833. /**
  21834. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  21835. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  21836. */
  21837. /**
  21838. * @module engine/model/operation/operation
  21839. */
  21840. /**
  21841. * Abstract base operation class.
  21842. *
  21843. * @abstract
  21844. */
  21845. class Operation {
  21846. /**
  21847. * Base operation constructor.
  21848. *
  21849. * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
  21850. * can be applied or `null` if the operation operates on detached (non-document) tree.
  21851. */
  21852. constructor( baseVersion ) {
  21853. /**
  21854. * {@link module:engine/model/document~Document#version} on which operation can be applied. If you try to
  21855. * {@link module:engine/model/model~Model#applyOperation apply} operation with different base version than the
  21856. * {@link module:engine/model/document~Document#version document version} the
  21857. * {@link module:utils/ckeditorerror~CKEditorError model-document-applyOperation-wrong-version} error is thrown.
  21858. *
  21859. * @member {Number}
  21860. */
  21861. this.baseVersion = baseVersion;
  21862. /**
  21863. * Defines whether operation is executed on attached or detached {@link module:engine/model/item~Item items}.
  21864. *
  21865. * @readonly
  21866. * @member {Boolean} #isDocumentOperation
  21867. */
  21868. this.isDocumentOperation = this.baseVersion !== null;
  21869. /**
  21870. * {@link module:engine/model/batch~Batch Batch} to which the operation is added or `null` if the operation is not
  21871. * added to any batch yet.
  21872. *
  21873. * @member {module:engine/model/batch~Batch|null} #batch
  21874. */
  21875. this.batch = null;
  21876. /**
  21877. * Operation type.
  21878. *
  21879. * @readonly
  21880. * @member {String} #type
  21881. */
  21882. /**
  21883. * Creates and returns an operation that has the same parameters as this operation.
  21884. *
  21885. * @method #clone
  21886. * @returns {module:engine/model/operation/operation~Operation} Clone of this operation.
  21887. */
  21888. /**
  21889. * Creates and returns a reverse operation. Reverse operation when executed right after
  21890. * the original operation will bring back tree model state to the point before the original
  21891. * operation execution. In other words, it reverses changes done by the original operation.
  21892. *
  21893. * Keep in mind that tree model state may change since executing the original operation,
  21894. * so reverse operation will be "outdated". In that case you will need to transform it by
  21895. * all operations that were executed after the original operation.
  21896. *
  21897. * @method #getReversed
  21898. * @returns {module:engine/model/operation/operation~Operation} Reversed operation.
  21899. */
  21900. /**
  21901. * Executes the operation - modifications described by the operation properties will be applied to the model tree.
  21902. *
  21903. * @protected
  21904. * @method #_execute
  21905. */
  21906. }
  21907. /**
  21908. * Checks whether the operation's parameters are correct and the operation can be correctly executed. Throws
  21909. * an error if operation is not valid.
  21910. *
  21911. * @protected
  21912. * @method #_validate
  21913. */
  21914. _validate() {
  21915. }
  21916. /**
  21917. * Custom toJSON method to solve child-parent circular dependencies.
  21918. *
  21919. * @method #toJSON
  21920. * @returns {Object} Clone of this object with the operation property replaced with string.
  21921. */
  21922. toJSON() {
  21923. // This method creates only a shallow copy, all nested objects should be defined separately.
  21924. // See https://github.com/ckeditor/ckeditor5-engine/issues/1477.
  21925. const json = Object.assign( {}, this );
  21926. json.__className = this.constructor.className;
  21927. // Remove reference to the parent `Batch` to avoid circular dependencies.
  21928. delete json.batch;
  21929. // Only document operations are shared with other clients so it is not necessary to keep this information.
  21930. delete json.isDocumentOperation;
  21931. return json;
  21932. }
  21933. /**
  21934. * Name of the operation class used for serialization.
  21935. *
  21936. * @type {String}
  21937. */
  21938. static get className() {
  21939. return 'Operation';
  21940. }
  21941. /**
  21942. * Creates Operation object from deserilized object, i.e. from parsed JSON string.
  21943. *
  21944. * @param {Object} json Deserialized JSON object.
  21945. * @param {module:engine/model/document~Document} doc Document on which this operation will be applied.
  21946. * @returns {module:engine/model/operation/operation~Operation}
  21947. */
  21948. static fromJSON( json ) {
  21949. return new this( json.baseVersion );
  21950. }
  21951. // @if CK_DEBUG_ENGINE // log() {
  21952. // @if CK_DEBUG_ENGINE // console.log( this.toString() );
  21953. // @if CK_DEBUG_ENGINE // }
  21954. }
  21955. /***/ }),
  21956. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operationfactory.js":
  21957. /*!*****************************************************************************************!*\
  21958. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operationfactory.js ***!
  21959. \*****************************************************************************************/
  21960. /*! exports provided: default */
  21961. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21962. "use strict";
  21963. __webpack_require__.r(__webpack_exports__);
  21964. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return OperationFactory; });
  21965. /* harmony import */ var _operation_attributeoperation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../operation/attributeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/attributeoperation.js");
  21966. /* harmony import */ var _operation_insertoperation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../operation/insertoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/insertoperation.js");
  21967. /* harmony import */ var _operation_markeroperation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../operation/markeroperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/markeroperation.js");
  21968. /* harmony import */ var _operation_moveoperation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../operation/moveoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/moveoperation.js");
  21969. /* harmony import */ var _operation_nooperation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../operation/nooperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/nooperation.js");
  21970. /* harmony import */ var _operation_operation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../operation/operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
  21971. /* harmony import */ var _operation_renameoperation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../operation/renameoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/renameoperation.js");
  21972. /* harmony import */ var _operation_rootattributeoperation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../operation/rootattributeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/rootattributeoperation.js");
  21973. /* harmony import */ var _operation_splitoperation__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../operation/splitoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/splitoperation.js");
  21974. /* harmony import */ var _operation_mergeoperation__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../operation/mergeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/mergeoperation.js");
  21975. /**
  21976. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  21977. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  21978. */
  21979. /**
  21980. * @module engine/model/operation/operationfactory
  21981. */
  21982. const operations = {};
  21983. operations[ _operation_attributeoperation__WEBPACK_IMPORTED_MODULE_0__["default"].className ] = _operation_attributeoperation__WEBPACK_IMPORTED_MODULE_0__["default"];
  21984. operations[ _operation_insertoperation__WEBPACK_IMPORTED_MODULE_1__["default"].className ] = _operation_insertoperation__WEBPACK_IMPORTED_MODULE_1__["default"];
  21985. operations[ _operation_markeroperation__WEBPACK_IMPORTED_MODULE_2__["default"].className ] = _operation_markeroperation__WEBPACK_IMPORTED_MODULE_2__["default"];
  21986. operations[ _operation_moveoperation__WEBPACK_IMPORTED_MODULE_3__["default"].className ] = _operation_moveoperation__WEBPACK_IMPORTED_MODULE_3__["default"];
  21987. operations[ _operation_nooperation__WEBPACK_IMPORTED_MODULE_4__["default"].className ] = _operation_nooperation__WEBPACK_IMPORTED_MODULE_4__["default"];
  21988. operations[ _operation_operation__WEBPACK_IMPORTED_MODULE_5__["default"].className ] = _operation_operation__WEBPACK_IMPORTED_MODULE_5__["default"];
  21989. operations[ _operation_renameoperation__WEBPACK_IMPORTED_MODULE_6__["default"].className ] = _operation_renameoperation__WEBPACK_IMPORTED_MODULE_6__["default"];
  21990. operations[ _operation_rootattributeoperation__WEBPACK_IMPORTED_MODULE_7__["default"].className ] = _operation_rootattributeoperation__WEBPACK_IMPORTED_MODULE_7__["default"];
  21991. operations[ _operation_splitoperation__WEBPACK_IMPORTED_MODULE_8__["default"].className ] = _operation_splitoperation__WEBPACK_IMPORTED_MODULE_8__["default"];
  21992. operations[ _operation_mergeoperation__WEBPACK_IMPORTED_MODULE_9__["default"].className ] = _operation_mergeoperation__WEBPACK_IMPORTED_MODULE_9__["default"];
  21993. /**
  21994. * A factory class for creating operations.
  21995. *
  21996. * @abstract
  21997. */
  21998. class OperationFactory {
  21999. /**
  22000. * Creates an operation instance from a JSON object (parsed JSON string).
  22001. *
  22002. * @param {Object} json Deserialized JSON object.
  22003. * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
  22004. * @returns {module:engine/model/operation/operation~Operation}
  22005. */
  22006. static fromJSON( json, document ) {
  22007. return operations[ json.__className ].fromJSON( json, document );
  22008. }
  22009. }
  22010. /***/ }),
  22011. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/renameoperation.js":
  22012. /*!****************************************************************************************!*\
  22013. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/renameoperation.js ***!
  22014. \****************************************************************************************/
  22015. /*! exports provided: default */
  22016. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22017. "use strict";
  22018. __webpack_require__.r(__webpack_exports__);
  22019. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RenameOperation; });
  22020. /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
  22021. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
  22022. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  22023. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  22024. /**
  22025. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  22026. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  22027. */
  22028. /**
  22029. * @module engine/model/operation/renameoperation
  22030. */
  22031. /**
  22032. * Operation to change element's name.
  22033. *
  22034. * Using this class you can change element's name.
  22035. *
  22036. * @extends module:engine/model/operation/operation~Operation
  22037. */
  22038. class RenameOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
  22039. /**
  22040. * Creates an operation that changes element's name.
  22041. *
  22042. * @param {module:engine/model/position~Position} position Position before an element to change.
  22043. * @param {String} oldName Current name of the element.
  22044. * @param {String} newName New name for the element.
  22045. * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
  22046. * can be applied or `null` if the operation operates on detached (non-document) tree.
  22047. */
  22048. constructor( position, oldName, newName, baseVersion ) {
  22049. super( baseVersion );
  22050. /**
  22051. * Position before an element to change.
  22052. *
  22053. * @member {module:engine/model/position~Position} module:engine/model/operation/renameoperation~RenameOperation#position
  22054. */
  22055. this.position = position;
  22056. // This position sticks to the next node because it is a position before the node that we want to change.
  22057. this.position.stickiness = 'toNext';
  22058. /**
  22059. * Current name of the element.
  22060. *
  22061. * @member {String} module:engine/model/operation/renameoperation~RenameOperation#oldName
  22062. */
  22063. this.oldName = oldName;
  22064. /**
  22065. * New name for the element.
  22066. *
  22067. * @member {String} module:engine/model/operation/renameoperation~RenameOperation#newName
  22068. */
  22069. this.newName = newName;
  22070. }
  22071. /**
  22072. * @inheritDoc
  22073. */
  22074. get type() {
  22075. return 'rename';
  22076. }
  22077. /**
  22078. * Creates and returns an operation that has the same parameters as this operation.
  22079. *
  22080. * @returns {module:engine/model/operation/renameoperation~RenameOperation} Clone of this operation.
  22081. */
  22082. clone() {
  22083. return new RenameOperation( this.position.clone(), this.oldName, this.newName, this.baseVersion );
  22084. }
  22085. /**
  22086. * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
  22087. *
  22088. * @returns {module:engine/model/operation/renameoperation~RenameOperation}
  22089. */
  22090. getReversed() {
  22091. return new RenameOperation( this.position.clone(), this.newName, this.oldName, this.baseVersion + 1 );
  22092. }
  22093. /**
  22094. * @inheritDoc
  22095. */
  22096. _validate() {
  22097. const element = this.position.nodeAfter;
  22098. if ( !( element instanceof _element__WEBPACK_IMPORTED_MODULE_1__["default"] ) ) {
  22099. /**
  22100. * Given position is invalid or node after it is not instance of Element.
  22101. *
  22102. * @error rename-operation-wrong-position
  22103. */
  22104. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
  22105. 'rename-operation-wrong-position',
  22106. this
  22107. );
  22108. } else if ( element.name !== this.oldName ) {
  22109. /**
  22110. * Element to change has different name than operation's old name.
  22111. *
  22112. * @error rename-operation-wrong-name
  22113. */
  22114. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
  22115. 'rename-operation-wrong-name',
  22116. this
  22117. );
  22118. }
  22119. }
  22120. /**
  22121. * @inheritDoc
  22122. */
  22123. _execute() {
  22124. const element = this.position.nodeAfter;
  22125. element.name = this.newName;
  22126. }
  22127. /**
  22128. * @inheritDoc
  22129. */
  22130. toJSON() {
  22131. const json = super.toJSON();
  22132. json.position = this.position.toJSON();
  22133. return json;
  22134. }
  22135. /**
  22136. * @inheritDoc
  22137. */
  22138. static get className() {
  22139. return 'RenameOperation';
  22140. }
  22141. /**
  22142. * Creates `RenameOperation` object from deserialized object, i.e. from parsed JSON string.
  22143. *
  22144. * @param {Object} json Deserialized JSON object.
  22145. * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
  22146. * @returns {module:engine/model/operation/attributeoperation~AttributeOperation}
  22147. */
  22148. static fromJSON( json, document ) {
  22149. return new RenameOperation( _position__WEBPACK_IMPORTED_MODULE_3__["default"].fromJSON( json.position, document ), json.oldName, json.newName, json.baseVersion );
  22150. }
  22151. // @if CK_DEBUG_ENGINE // toString() {
  22152. // @if CK_DEBUG_ENGINE // return `RenameOperation( ${ this.baseVersion } ): ` +
  22153. // @if CK_DEBUG_ENGINE // `${ this.position }: "${ this.oldName }" -> "${ this.newName }"`;
  22154. // @if CK_DEBUG_ENGINE // }
  22155. }
  22156. /***/ }),
  22157. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/rootattributeoperation.js":
  22158. /*!***********************************************************************************************!*\
  22159. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/rootattributeoperation.js ***!
  22160. \***********************************************************************************************/
  22161. /*! exports provided: default */
  22162. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22163. "use strict";
  22164. __webpack_require__.r(__webpack_exports__);
  22165. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RootAttributeOperation; });
  22166. /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
  22167. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  22168. /**
  22169. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  22170. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  22171. */
  22172. /**
  22173. * @module engine/model/operation/rootattributeoperation
  22174. */
  22175. /**
  22176. * Operation to change root element's attribute. Using this class you can add, remove or change value of the attribute.
  22177. *
  22178. * This operation is needed, because root elements can't be changed through
  22179. * @link module:engine/model/operation/attributeoperation~AttributeOperation}.
  22180. * It is because {@link module:engine/model/operation/attributeoperation~AttributeOperation}
  22181. * requires a range to change and root element can't
  22182. * be a part of range because every {@link module:engine/model/position~Position} has to be inside a root.
  22183. * {@link module:engine/model/position~Position} can't be created before a root element.
  22184. *
  22185. * @extends module:engine/model/operation/operation~Operation
  22186. */
  22187. class RootAttributeOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
  22188. /**
  22189. * Creates an operation that changes, removes or adds attributes on root element.
  22190. *
  22191. * @see module:engine/model/operation/attributeoperation~AttributeOperation
  22192. * @param {module:engine/model/rootelement~RootElement} root Root element to change.
  22193. * @param {String} key Key of an attribute to change or remove.
  22194. * @param {*} oldValue Old value of the attribute with given key or `null` if adding a new attribute.
  22195. * @param {*} newValue New value to set for the attribute. If `null`, then the operation just removes the attribute.
  22196. * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
  22197. * can be applied or `null` if the operation operates on detached (non-document) tree.
  22198. */
  22199. constructor( root, key, oldValue, newValue, baseVersion ) {
  22200. super( baseVersion );
  22201. /**
  22202. * Root element to change.
  22203. *
  22204. * @readonly
  22205. * @member {module:engine/model/rootelement~RootElement}
  22206. */
  22207. this.root = root;
  22208. /**
  22209. * Key of an attribute to change or remove.
  22210. *
  22211. * @readonly
  22212. * @member {String}
  22213. */
  22214. this.key = key;
  22215. /**
  22216. * Old value of the attribute with given key or `null` if adding a new attribute.
  22217. *
  22218. * @readonly
  22219. * @member {*}
  22220. */
  22221. this.oldValue = oldValue;
  22222. /**
  22223. * New value to set for the attribute. If `null`, then the operation just removes the attribute.
  22224. *
  22225. * @readonly
  22226. * @member {*}
  22227. */
  22228. this.newValue = newValue;
  22229. }
  22230. /**
  22231. * @inheritDoc
  22232. */
  22233. get type() {
  22234. if ( this.oldValue === null ) {
  22235. return 'addRootAttribute';
  22236. } else if ( this.newValue === null ) {
  22237. return 'removeRootAttribute';
  22238. } else {
  22239. return 'changeRootAttribute';
  22240. }
  22241. }
  22242. /**
  22243. * Creates and returns an operation that has the same parameters as this operation.
  22244. *
  22245. * @returns {module:engine/model/operation/rootattributeoperation~RootAttributeOperation} Clone of this operation.
  22246. */
  22247. clone() {
  22248. return new RootAttributeOperation( this.root, this.key, this.oldValue, this.newValue, this.baseVersion );
  22249. }
  22250. /**
  22251. * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
  22252. *
  22253. * @returns {module:engine/model/operation/rootattributeoperation~RootAttributeOperation}
  22254. */
  22255. getReversed() {
  22256. return new RootAttributeOperation( this.root, this.key, this.newValue, this.oldValue, this.baseVersion + 1 );
  22257. }
  22258. /**
  22259. * @inheritDoc
  22260. */
  22261. _validate() {
  22262. if ( this.root != this.root.root || this.root.is( 'documentFragment' ) ) {
  22263. /**
  22264. * The element to change is not a root element.
  22265. *
  22266. * @error rootattribute-operation-not-a-root
  22267. * @param {module:engine/model/rootelement~RootElement} root
  22268. * @param {String} key
  22269. * @param {*} value
  22270. */
  22271. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
  22272. 'rootattribute-operation-not-a-root',
  22273. this,
  22274. { root: this.root, key: this.key }
  22275. );
  22276. }
  22277. if ( this.oldValue !== null && this.root.getAttribute( this.key ) !== this.oldValue ) {
  22278. /**
  22279. * The attribute which should be removed does not exists for the given node.
  22280. *
  22281. * @error rootattribute-operation-wrong-old-value
  22282. * @param {module:engine/model/rootelement~RootElement} root
  22283. * @param {String} key
  22284. * @param {*} value
  22285. */
  22286. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
  22287. 'rootattribute-operation-wrong-old-value',
  22288. this,
  22289. { root: this.root, key: this.key }
  22290. );
  22291. }
  22292. if ( this.oldValue === null && this.newValue !== null && this.root.hasAttribute( this.key ) ) {
  22293. /**
  22294. * The attribute with given key already exists for the given node.
  22295. *
  22296. * @error rootattribute-operation-attribute-exists
  22297. * @param {module:engine/model/rootelement~RootElement} root
  22298. * @param {String} key
  22299. */
  22300. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
  22301. 'rootattribute-operation-attribute-exists',
  22302. this,
  22303. { root: this.root, key: this.key }
  22304. );
  22305. }
  22306. }
  22307. /**
  22308. * @inheritDoc
  22309. */
  22310. _execute() {
  22311. if ( this.newValue !== null ) {
  22312. this.root._setAttribute( this.key, this.newValue );
  22313. } else {
  22314. this.root._removeAttribute( this.key );
  22315. }
  22316. }
  22317. /**
  22318. * @inheritDoc
  22319. */
  22320. toJSON() {
  22321. const json = super.toJSON();
  22322. json.root = this.root.toJSON();
  22323. return json;
  22324. }
  22325. /**
  22326. * @inheritDoc
  22327. */
  22328. static get className() {
  22329. return 'RootAttributeOperation';
  22330. }
  22331. /**
  22332. * Creates RootAttributeOperation object from deserilized object, i.e. from parsed JSON string.
  22333. *
  22334. * @param {Object} json Deserialized JSON object.
  22335. * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
  22336. * @returns {module:engine/model/operation/rootattributeoperation~RootAttributeOperation}
  22337. */
  22338. static fromJSON( json, document ) {
  22339. if ( !document.getRoot( json.root ) ) {
  22340. /**
  22341. * Cannot create RootAttributeOperation for document. Root with specified name does not exist.
  22342. *
  22343. * @error rootattribute-operation-fromjson-no-root
  22344. * @param {String} rootName
  22345. */
  22346. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'rootattribute-operation-fromjson-no-root', this, { rootName: json.root } );
  22347. }
  22348. return new RootAttributeOperation( document.getRoot( json.root ), json.key, json.oldValue, json.newValue, json.baseVersion );
  22349. }
  22350. // @if CK_DEBUG_ENGINE // toString() {
  22351. // @if CK_DEBUG_ENGINE // return `RootAttributeOperation( ${ this.baseVersion } ): ` +
  22352. // @if CK_DEBUG_ENGINE // `"${ this.key }": ${ JSON.stringify( this.oldValue ) }` +
  22353. // @if CK_DEBUG_ENGINE // ` -> ${ JSON.stringify( this.newValue ) }, ${ this.root.rootName }`;
  22354. // @if CK_DEBUG_ENGINE // }
  22355. }
  22356. /***/ }),
  22357. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/splitoperation.js":
  22358. /*!***************************************************************************************!*\
  22359. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/splitoperation.js ***!
  22360. \***************************************************************************************/
  22361. /*! exports provided: default */
  22362. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22363. "use strict";
  22364. __webpack_require__.r(__webpack_exports__);
  22365. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SplitOperation; });
  22366. /* harmony import */ var _operation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js");
  22367. /* harmony import */ var _mergeoperation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mergeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/mergeoperation.js");
  22368. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  22369. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  22370. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.js");
  22371. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  22372. /**
  22373. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  22374. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  22375. */
  22376. /**
  22377. * @module engine/model/operation/splitoperation
  22378. */
  22379. /**
  22380. * Operation to split {@link module:engine/model/element~Element an element} at given
  22381. * {@link module:engine/model/operation/splitoperation~SplitOperation#splitPosition split position} into two elements,
  22382. * both containing a part of the element's original content.
  22383. *
  22384. * @extends module:engine/model/operation/operation~Operation
  22385. */
  22386. class SplitOperation extends _operation__WEBPACK_IMPORTED_MODULE_0__["default"] {
  22387. /**
  22388. * Creates a split operation.
  22389. *
  22390. * @param {module:engine/model/position~Position} splitPosition Position at which an element should be split.
  22391. * @param {Number} howMany Total offset size of elements that are in the split element after `position`.
  22392. * @param {module:engine/model/position~Position|null} graveyardPosition Position in the graveyard root before the element which
  22393. * should be used as a parent of the nodes after `position`. If it is not set, a copy of the the `position` parent will be used.
  22394. * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
  22395. * can be applied or `null` if the operation operates on detached (non-document) tree.
  22396. */
  22397. constructor( splitPosition, howMany, graveyardPosition, baseVersion ) {
  22398. super( baseVersion );
  22399. /**
  22400. * Position at which an element should be split.
  22401. *
  22402. * @member {module:engine/model/position~Position} module:engine/model/operation/splitoperation~SplitOperation#splitPosition
  22403. */
  22404. this.splitPosition = splitPosition.clone();
  22405. // Keep position sticking to the next node. This way any new content added at the place where the element is split
  22406. // will be left in the original element.
  22407. this.splitPosition.stickiness = 'toNext';
  22408. /**
  22409. * Total offset size of elements that are in the split element after `position`.
  22410. *
  22411. * @member {Number} module:engine/model/operation/splitoperation~SplitOperation#howMany
  22412. */
  22413. this.howMany = howMany;
  22414. /**
  22415. * Position at which the clone of split element (or element from graveyard) will be inserted.
  22416. *
  22417. * @member {module:engine/model/position~Position} module:engine/model/operation/splitoperation~SplitOperation#insertionPosition
  22418. */
  22419. this.insertionPosition = SplitOperation.getInsertionPosition( splitPosition );
  22420. this.insertionPosition.stickiness = 'toNone';
  22421. /**
  22422. * Position in the graveyard root before the element which should be used as a parent of the nodes after `position`.
  22423. * If it is not set, a copy of the the `position` parent will be used.
  22424. *
  22425. * The default behavior is to clone the split element. Element from graveyard is used during undo.
  22426. *
  22427. * @member {module:engine/model/position~Position|null} #graveyardPosition
  22428. */
  22429. this.graveyardPosition = graveyardPosition ? graveyardPosition.clone() : null;
  22430. if ( this.graveyardPosition ) {
  22431. this.graveyardPosition.stickiness = 'toNext';
  22432. }
  22433. }
  22434. /**
  22435. * @inheritDoc
  22436. */
  22437. get type() {
  22438. return 'split';
  22439. }
  22440. /**
  22441. * Position inside the new clone of a split element.
  22442. *
  22443. * This is a position where nodes that are after the split position will be moved to.
  22444. *
  22445. * @readonly
  22446. * @type {module:engine/model/position~Position}
  22447. */
  22448. get moveTargetPosition() {
  22449. const path = this.insertionPosition.path.slice();
  22450. path.push( 0 );
  22451. return new _position__WEBPACK_IMPORTED_MODULE_2__["default"]( this.insertionPosition.root, path );
  22452. }
  22453. /**
  22454. * Artificial range that contains all the nodes from the split element that will be moved to the new element.
  22455. * The range starts at {@link ~#splitPosition} and ends in the same parent, at `POSITIVE_INFINITY` offset.
  22456. *
  22457. * @readonly
  22458. * @type {module:engine/model/range~Range}
  22459. */
  22460. get movedRange() {
  22461. const end = this.splitPosition.getShiftedBy( Number.POSITIVE_INFINITY );
  22462. return new _range__WEBPACK_IMPORTED_MODULE_3__["default"]( this.splitPosition, end );
  22463. }
  22464. /**
  22465. * Creates and returns an operation that has the same parameters as this operation.
  22466. *
  22467. * @returns {module:engine/model/operation/splitoperation~SplitOperation} Clone of this operation.
  22468. */
  22469. clone() {
  22470. const split = new this.constructor( this.splitPosition, this.howMany, this.graveyardPosition, this.baseVersion );
  22471. split.insertionPosition = this.insertionPosition;
  22472. return split;
  22473. }
  22474. /**
  22475. * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
  22476. *
  22477. * @returns {module:engine/model/operation/mergeoperation~MergeOperation}
  22478. */
  22479. getReversed() {
  22480. const graveyard = this.splitPosition.root.document.graveyard;
  22481. const graveyardPosition = new _position__WEBPACK_IMPORTED_MODULE_2__["default"]( graveyard, [ 0 ] );
  22482. return new _mergeoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( this.moveTargetPosition, this.howMany, this.splitPosition, graveyardPosition, this.baseVersion + 1 );
  22483. }
  22484. /**
  22485. * @inheritDoc
  22486. */
  22487. _validate() {
  22488. const element = this.splitPosition.parent;
  22489. const offset = this.splitPosition.offset;
  22490. // Validate whether split operation has correct parameters.
  22491. if ( !element || element.maxOffset < offset ) {
  22492. /**
  22493. * Split position is invalid.
  22494. *
  22495. * @error split-operation-position-invalid
  22496. */
  22497. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'split-operation-position-invalid', this );
  22498. } else if ( !element.parent ) {
  22499. /**
  22500. * Cannot split root element.
  22501. *
  22502. * @error split-operation-split-in-root
  22503. */
  22504. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'split-operation-split-in-root', this );
  22505. } else if ( this.howMany != element.maxOffset - this.splitPosition.offset ) {
  22506. /**
  22507. * Split operation specifies wrong number of nodes to move.
  22508. *
  22509. * @error split-operation-how-many-invalid
  22510. */
  22511. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'split-operation-how-many-invalid', this );
  22512. } else if ( this.graveyardPosition && !this.graveyardPosition.nodeAfter ) {
  22513. /**
  22514. * Graveyard position invalid.
  22515. *
  22516. * @error split-operation-graveyard-position-invalid
  22517. */
  22518. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'split-operation-graveyard-position-invalid', this );
  22519. }
  22520. }
  22521. /**
  22522. * @inheritDoc
  22523. */
  22524. _execute() {
  22525. const splitElement = this.splitPosition.parent;
  22526. if ( this.graveyardPosition ) {
  22527. Object(_utils__WEBPACK_IMPORTED_MODULE_4__["_move"])( _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createFromPositionAndShift( this.graveyardPosition, 1 ), this.insertionPosition );
  22528. } else {
  22529. const newElement = splitElement._clone();
  22530. Object(_utils__WEBPACK_IMPORTED_MODULE_4__["_insert"])( this.insertionPosition, newElement );
  22531. }
  22532. const sourceRange = new _range__WEBPACK_IMPORTED_MODULE_3__["default"](
  22533. _position__WEBPACK_IMPORTED_MODULE_2__["default"]._createAt( splitElement, this.splitPosition.offset ),
  22534. _position__WEBPACK_IMPORTED_MODULE_2__["default"]._createAt( splitElement, splitElement.maxOffset )
  22535. );
  22536. Object(_utils__WEBPACK_IMPORTED_MODULE_4__["_move"])( sourceRange, this.moveTargetPosition );
  22537. }
  22538. /**
  22539. * @inheritDoc
  22540. */
  22541. toJSON() {
  22542. const json = super.toJSON();
  22543. json.splitPosition = this.splitPosition.toJSON();
  22544. json.insertionPosition = this.insertionPosition.toJSON();
  22545. if ( this.graveyardPosition ) {
  22546. json.graveyardPosition = this.graveyardPosition.toJSON();
  22547. }
  22548. return json;
  22549. }
  22550. /**
  22551. * @inheritDoc
  22552. */
  22553. static get className() {
  22554. return 'SplitOperation';
  22555. }
  22556. /**
  22557. * Helper function that returns a default insertion position basing on given `splitPosition`. The default insertion
  22558. * position is after the split element.
  22559. *
  22560. * @param {module:engine/model/position~Position} splitPosition
  22561. * @returns {module:engine/model/position~Position}
  22562. */
  22563. static getInsertionPosition( splitPosition ) {
  22564. const path = splitPosition.path.slice( 0, -1 );
  22565. path[ path.length - 1 ]++;
  22566. return new _position__WEBPACK_IMPORTED_MODULE_2__["default"]( splitPosition.root, path );
  22567. }
  22568. /**
  22569. * Creates `SplitOperation` object from deserilized object, i.e. from parsed JSON string.
  22570. *
  22571. * @param {Object} json Deserialized JSON object.
  22572. * @param {module:engine/model/document~Document} document Document on which this operation will be applied.
  22573. * @returns {module:engine/model/operation/splitoperation~SplitOperation}
  22574. */
  22575. static fromJSON( json, document ) {
  22576. const splitPosition = _position__WEBPACK_IMPORTED_MODULE_2__["default"].fromJSON( json.splitPosition, document );
  22577. const insertionPosition = _position__WEBPACK_IMPORTED_MODULE_2__["default"].fromJSON( json.insertionPosition, document );
  22578. const graveyardPosition = json.graveyardPosition ? _position__WEBPACK_IMPORTED_MODULE_2__["default"].fromJSON( json.graveyardPosition, document ) : null;
  22579. const split = new this( splitPosition, json.howMany, graveyardPosition, json.baseVersion );
  22580. split.insertionPosition = insertionPosition;
  22581. return split;
  22582. }
  22583. // @if CK_DEBUG_ENGINE // toString() {
  22584. // @if CK_DEBUG_ENGINE // return `SplitOperation( ${ this.baseVersion } ): ${ this.splitPosition } ` +
  22585. // @if CK_DEBUG_ENGINE // `( ${ this.howMany } ) -> ${ this.insertionPosition }` +
  22586. // @if CK_DEBUG_ENGINE // `${ this.graveyardPosition ? ' with ' + this.graveyardPosition : '' }`;
  22587. // @if CK_DEBUG_ENGINE // }
  22588. }
  22589. /***/ }),
  22590. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/transform.js":
  22591. /*!**********************************************************************************!*\
  22592. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/transform.js ***!
  22593. \**********************************************************************************/
  22594. /*! exports provided: transform, transformSets */
  22595. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22596. "use strict";
  22597. __webpack_require__.r(__webpack_exports__);
  22598. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transform", function() { return transform; });
  22599. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformSets", function() { return transformSets; });
  22600. /* harmony import */ var _insertoperation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./insertoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/insertoperation.js");
  22601. /* harmony import */ var _attributeoperation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./attributeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/attributeoperation.js");
  22602. /* harmony import */ var _renameoperation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./renameoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/renameoperation.js");
  22603. /* harmony import */ var _markeroperation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./markeroperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/markeroperation.js");
  22604. /* harmony import */ var _moveoperation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./moveoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/moveoperation.js");
  22605. /* harmony import */ var _rootattributeoperation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./rootattributeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/rootattributeoperation.js");
  22606. /* harmony import */ var _mergeoperation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./mergeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/mergeoperation.js");
  22607. /* harmony import */ var _splitoperation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./splitoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/splitoperation.js");
  22608. /* harmony import */ var _nooperation__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./nooperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/nooperation.js");
  22609. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  22610. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  22611. /* harmony import */ var _ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/comparearrays */ "./node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.js");
  22612. /**
  22613. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  22614. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  22615. */
  22616. const transformations = new Map();
  22617. /**
  22618. * @module engine/model/operation/transform
  22619. */
  22620. /**
  22621. * Sets a transformation function to be be used to transform instances of class `OperationA` by instances of class `OperationB`.
  22622. *
  22623. * The `transformationFunction` is passed three parameters:
  22624. *
  22625. * * `a` - operation to be transformed, an instance of `OperationA`,
  22626. * * `b` - operation to be transformed by, an instance of `OperationB`,
  22627. * * {@link module:engine/model/operation/transform~TransformationContext `context`} - object with additional information about
  22628. * transformation context.
  22629. *
  22630. * The `transformationFunction` should return transformation result, which is an array with one or multiple
  22631. * {@link module:engine/model/operation/operation~Operation operation} instances.
  22632. *
  22633. * @protected
  22634. * @param {Function} OperationA
  22635. * @param {Function} OperationB
  22636. * @param {Function} transformationFunction Function to use for transforming.
  22637. */
  22638. function setTransformation( OperationA, OperationB, transformationFunction ) {
  22639. let aGroup = transformations.get( OperationA );
  22640. if ( !aGroup ) {
  22641. aGroup = new Map();
  22642. transformations.set( OperationA, aGroup );
  22643. }
  22644. aGroup.set( OperationB, transformationFunction );
  22645. }
  22646. /**
  22647. * Returns a previously set transformation function for transforming an instance of `OperationA` by an instance of `OperationB`.
  22648. *
  22649. * If no transformation was set for given pair of operations, {@link module:engine/model/operation/transform~noUpdateTransformation}
  22650. * is returned. This means that if no transformation was set, the `OperationA` instance will not change when transformed
  22651. * by the `OperationB` instance.
  22652. *
  22653. * @private
  22654. * @param {Function} OperationA
  22655. * @param {Function} OperationB
  22656. * @returns {Function} Function set to transform an instance of `OperationA` by an instance of `OperationB`.
  22657. */
  22658. function getTransformation( OperationA, OperationB ) {
  22659. const aGroup = transformations.get( OperationA );
  22660. if ( aGroup && aGroup.has( OperationB ) ) {
  22661. return aGroup.get( OperationB );
  22662. }
  22663. return noUpdateTransformation;
  22664. }
  22665. /**
  22666. * A transformation function that only clones operation to transform, without changing it.
  22667. *
  22668. * @private
  22669. * @param {module:engine/model/operation/operation~Operation} a Operation to transform.
  22670. * @returns {Array.<module:engine/model/operation/operation~Operation>}
  22671. */
  22672. function noUpdateTransformation( a ) {
  22673. return [ a ];
  22674. }
  22675. /**
  22676. * Transforms operation `a` by operation `b`.
  22677. *
  22678. * @param {module:engine/model/operation/operation~Operation} a Operation to be transformed.
  22679. * @param {module:engine/model/operation/operation~Operation} b Operation to transform by.
  22680. * @param {module:engine/model/operation/transform~TransformationContext} context Transformation context for this transformation.
  22681. * @returns {Array.<module:engine/model/operation/operation~Operation>} Transformation result.
  22682. */
  22683. function transform( a, b, context = {} ) {
  22684. const transformationFunction = getTransformation( a.constructor, b.constructor );
  22685. /* eslint-disable no-useless-catch */
  22686. try {
  22687. a = a.clone();
  22688. return transformationFunction( a, b, context );
  22689. } catch ( e ) {
  22690. // @if CK_DEBUG // console.warn( 'Error during operation transformation!', e.message );
  22691. // @if CK_DEBUG // console.warn( 'Transformed operation', a );
  22692. // @if CK_DEBUG // console.warn( 'Operation transformed by', b );
  22693. // @if CK_DEBUG // console.warn( 'context.aIsStrong', context.aIsStrong );
  22694. // @if CK_DEBUG // console.warn( 'context.aWasUndone', context.aWasUndone );
  22695. // @if CK_DEBUG // console.warn( 'context.bWasUndone', context.bWasUndone );
  22696. // @if CK_DEBUG // console.warn( 'context.abRelation', context.abRelation );
  22697. // @if CK_DEBUG // console.warn( 'context.baRelation', context.baRelation );
  22698. throw e;
  22699. }
  22700. /* eslint-enable no-useless-catch */
  22701. }
  22702. /**
  22703. * Performs a transformation of two sets of operations - `operationsA` and `operationsB`. The transformation is two-way -
  22704. * both transformed `operationsA` and transformed `operationsB` are returned.
  22705. *
  22706. * Note, that the first operation in each set should base on the same document state (
  22707. * {@link module:engine/model/document~Document#version document version}).
  22708. *
  22709. * It is assumed that `operationsA` are "more important" during conflict resolution between two operations.
  22710. *
  22711. * New copies of both passed arrays and operations inside them are returned. Passed arguments are not altered.
  22712. *
  22713. * Base versions of the transformed operations sets are updated accordingly. For example, assume that base versions are `4`
  22714. * and there are `3` operations in `operationsA` and `5` operations in `operationsB`. Then:
  22715. *
  22716. * * transformed `operationsA` will start from base version `9` (`4` base version + `5` operations B),
  22717. * * transformed `operationsB` will start from base version `7` (`4` base version + `3` operations A).
  22718. *
  22719. * If no operation was broken into two during transformation, then both sets will end up with an operation that bases on version `11`:
  22720. *
  22721. * * transformed `operationsA` start from `9` and there are `3` of them, so the last will have `baseVersion` equal to `11`,
  22722. * * transformed `operationsB` start from `7` and there are `5` of them, so the last will have `baseVersion` equal to `11`.
  22723. *
  22724. * @param {Array.<module:engine/model/operation/operation~Operation>} operationsA
  22725. * @param {Array.<module:engine/model/operation/operation~Operation>} operationsB
  22726. * @param {Object} options Additional transformation options.
  22727. * @param {module:engine/model/document~Document|null} options.document Document which the operations change.
  22728. * @param {Boolean} [options.useRelations=false] Whether during transformation relations should be used (used during undo for
  22729. * better conflict resolution).
  22730. * @param {Boolean} [options.padWithNoOps=false] Whether additional {@link module:engine/model/operation/nooperation~NoOperation}s
  22731. * should be added to the transformation results to force the same last base version for both transformed sets (in case
  22732. * if some operations got broken into multiple operations during transformation).
  22733. * @returns {Object} Transformation result.
  22734. * @returns {Array.<module:engine/model/operation/operation~Operation>} return.operationsA Transformed `operationsA`.
  22735. * @returns {Array.<module:engine/model/operation/operation~Operation>} return.operationsB Transformed `operationsB`.
  22736. * @returns {Map} return.originalOperations A map that links transformed operations to original operations. The keys are the transformed
  22737. * operations and the values are the original operations from the input (`operationsA` and `operationsB`).
  22738. */
  22739. function transformSets( operationsA, operationsB, options ) {
  22740. // Create new arrays so the originally passed arguments are not changed.
  22741. // No need to clone operations, they are cloned as they are transformed.
  22742. operationsA = operationsA.slice();
  22743. operationsB = operationsB.slice();
  22744. const contextFactory = new ContextFactory( options.document, options.useRelations, options.forceWeakRemove );
  22745. contextFactory.setOriginalOperations( operationsA );
  22746. contextFactory.setOriginalOperations( operationsB );
  22747. const originalOperations = contextFactory.originalOperations;
  22748. // If one of sets is empty there is simply nothing to transform, so return sets as they are.
  22749. if ( operationsA.length == 0 || operationsB.length == 0 ) {
  22750. return { operationsA, operationsB, originalOperations };
  22751. }
  22752. //
  22753. // Following is a description of transformation process:
  22754. //
  22755. // There are `operationsA` and `operationsB` to be transformed, both by both.
  22756. //
  22757. // So, suppose we have sets of two operations each: `operationsA` = `[ a1, a2 ]`, `operationsB` = `[ b1, b2 ]`.
  22758. //
  22759. // Remember, that we can only transform operations that base on the same context. We assert that `a1` and `b1` base on
  22760. // the same context and we transform them. Then, we get `a1'` and `b1'`. `a2` bases on a context with `a1` -- `a2`
  22761. // is an operation that followed `a1`. Similarly, `b2` bases on a context with `b1`.
  22762. //
  22763. // However, since `a1'` is a result of transformation by `b1`, `a1'` now also has a context with `b1`. This means that
  22764. // we can safely transform `a1'` by `b2`. As we finish transforming `a1`, we also transformed all `operationsB`.
  22765. // All `operationsB` also have context including `a1`. Now, we can properly transform `a2` by those operations.
  22766. //
  22767. // The transformation process can be visualized on a transformation diagram ("diamond diagram"):
  22768. //
  22769. // [the initial state]
  22770. // [common for a1 and b1]
  22771. //
  22772. // *
  22773. // / \
  22774. // / \
  22775. // b1 a1
  22776. // / \
  22777. // / \
  22778. // * *
  22779. // / \ / \
  22780. // / \ / \
  22781. // b2 a1' b1' a2
  22782. // / \ / \
  22783. // / \ / \
  22784. // * * *
  22785. // \ / \ /
  22786. // \ / \ /
  22787. // a1'' b2' a2' b1''
  22788. // \ / \ /
  22789. // \ / \ /
  22790. // * *
  22791. // \ /
  22792. // \ /
  22793. // a2'' b2''
  22794. // \ /
  22795. // \ /
  22796. // *
  22797. //
  22798. // [the final state]
  22799. //
  22800. // The final state can be reached from the initial state by applying `a1`, `a2`, `b1''` and `b2''`, as well as by
  22801. // applying `b1`, `b2`, `a1''`, `a2''`. Note how the operations get to a proper common state before each pair is
  22802. // transformed.
  22803. //
  22804. // Another thing to consider is that an operation during transformation can be broken into multiple operations.
  22805. // Suppose that `a1` * `b1` = `[ a11', a12' ]` (instead of `a1'` that we considered previously).
  22806. //
  22807. // In that case, we leave `a12'` for later and we continue transforming `a11'` until it is transformed by all `operationsB`
  22808. // (in our case it is just `b2`). At this point, `b1` is transformed by "whole" `a1`, while `b2` is only transformed
  22809. // by `a11'`. Similarly, `a12'` is only transformed by `b1`. This leads to a conclusion that we need to start transforming `a12'`
  22810. // from the moment just after it was broken. So, `a12'` is transformed by `b2`. Now, "the whole" `a1` is transformed
  22811. // by `operationsB`, while all `operationsB` are transformed by "the whole" `a1`. This means that we can continue with
  22812. // following `operationsA` (in our case it is just `a2`).
  22813. //
  22814. // Of course, also `operationsB` can be broken. However, since we focus on transforming operation `a` to the end,
  22815. // the only thing to do is to store both pieces of operation `b`, so that the next transformed operation `a` will
  22816. // be transformed by both of them.
  22817. //
  22818. // *
  22819. // / \
  22820. // / \
  22821. // / \
  22822. // b1 a1
  22823. // / \
  22824. // / \
  22825. // / \
  22826. // * *
  22827. // / \ / \
  22828. // / a11' / \
  22829. // / \ / \
  22830. // b2 * b1' a2
  22831. // / / \ / \
  22832. // / / a12' / \
  22833. // / / \ / \
  22834. // * b2' * *
  22835. // \ / / \ /
  22836. // a11'' / b21'' \ /
  22837. // \ / / \ /
  22838. // * * a2' b1''
  22839. // \ / \ \ /
  22840. // a12'' b22''\ \ /
  22841. // \ / \ \ /
  22842. // * a2'' *
  22843. // \ \ /
  22844. // \ \ b21'''
  22845. // \ \ /
  22846. // a2''' *
  22847. // \ /
  22848. // \ b22'''
  22849. // \ /
  22850. // *
  22851. //
  22852. // Note, how `a1` is broken and transformed into `a11'` and `a12'`, while `b2'` got broken and transformed into `b21''` and `b22''`.
  22853. //
  22854. // Having all that on mind, here is an outline for the transformation process algorithm:
  22855. //
  22856. // 1. We have `operationsA` and `operationsB` array, which we dynamically update as the transformation process goes.
  22857. //
  22858. // 2. We take next (or first) operation from `operationsA` and check from which operation `b` we need to start transforming it.
  22859. // All original `operationsA` are set to be transformed starting from the first operation `b`.
  22860. //
  22861. // 3. We take operations from `operationsB`, one by one, starting from the correct one, and transform operation `a`
  22862. // by operation `b` (and vice versa). We update `operationsA` and `operationsB` by replacing the original operations
  22863. // with the transformation results.
  22864. //
  22865. // 4. If operation is broken into multiple operations, we save all the new operations in the place of the
  22866. // original operation.
  22867. //
  22868. // 5. Additionally, if operation `a` was broken, for the "new" operation, we remember from which operation `b` it should
  22869. // be transformed by.
  22870. //
  22871. // 6. We continue transforming "current" operation `a` until it is transformed by all `operationsB`. Then, go to 2.
  22872. // unless the last operation `a` was transformed.
  22873. //
  22874. // The actual implementation of the above algorithm is slightly different, as only one loop (while) is used.
  22875. // The difference is that we have "current" `a` operation to transform and we store the index of the next `b` operation
  22876. // to transform by. Each loop operates on two indexes then: index pointing to currently processed `a` operation and
  22877. // index pointing to next `b` operation. Each loop is just one `a * b` + `b * a` transformation. After each loop
  22878. // operation `b` index is updated. If all `b` operations were visited for the current `a` operation, we change
  22879. // current `a` operation index to the next one.
  22880. //
  22881. // For each operation `a`, keeps information what is the index in `operationsB` from which the transformation should start.
  22882. const nextTransformIndex = new WeakMap();
  22883. // For all the original `operationsA`, set that they should be transformed starting from the first of `operationsB`.
  22884. for ( const op of operationsA ) {
  22885. nextTransformIndex.set( op, 0 );
  22886. }
  22887. // Additional data that is used for some postprocessing after the main transformation process is done.
  22888. const data = {
  22889. nextBaseVersionA: operationsA[ operationsA.length - 1 ].baseVersion + 1,
  22890. nextBaseVersionB: operationsB[ operationsB.length - 1 ].baseVersion + 1,
  22891. originalOperationsACount: operationsA.length,
  22892. originalOperationsBCount: operationsB.length
  22893. };
  22894. // Index of currently transformed operation `a`.
  22895. let i = 0;
  22896. // While not all `operationsA` are transformed...
  22897. while ( i < operationsA.length ) {
  22898. // Get "current" operation `a`.
  22899. const opA = operationsA[ i ];
  22900. // For the "current" operation `a`, get the index of the next operation `b` to transform by.
  22901. const indexB = nextTransformIndex.get( opA );
  22902. // If operation `a` was already transformed by every operation `b`, change "current" operation `a` to the next one.
  22903. if ( indexB == operationsB.length ) {
  22904. i++;
  22905. continue;
  22906. }
  22907. const opB = operationsB[ indexB ];
  22908. // Transform `a` by `b` and `b` by `a`.
  22909. const newOpsA = transform( opA, opB, contextFactory.getContext( opA, opB, true ) );
  22910. const newOpsB = transform( opB, opA, contextFactory.getContext( opB, opA, false ) );
  22911. // As a result we get one or more `newOpsA` and one or more `newOpsB` operations.
  22912. // Update contextual information about operations.
  22913. contextFactory.updateRelation( opA, opB );
  22914. contextFactory.setOriginalOperations( newOpsA, opA );
  22915. contextFactory.setOriginalOperations( newOpsB, opB );
  22916. // For new `a` operations, update their index of the next operation `b` to transform them by.
  22917. //
  22918. // This is needed even if there was only one result (`a` was not broken) because that information is used
  22919. // at the beginning of this loop every time.
  22920. for ( const newOpA of newOpsA ) {
  22921. // Acknowledge, that operation `b` also might be broken into multiple operations.
  22922. //
  22923. // This is why we raise `indexB` not just by 1. If `newOpsB` are multiple operations, they will be
  22924. // spliced in the place of `opB`. So we need to change `transformBy` accordingly, so that an operation won't
  22925. // be transformed by the same operation (part of it) again.
  22926. nextTransformIndex.set( newOpA, indexB + newOpsB.length );
  22927. }
  22928. // Update `operationsA` and `operationsB` with the transformed versions.
  22929. operationsA.splice( i, 1, ...newOpsA );
  22930. operationsB.splice( indexB, 1, ...newOpsB );
  22931. }
  22932. if ( options.padWithNoOps ) {
  22933. // If no-operations padding is enabled, count how many extra `a` and `b` operations were generated.
  22934. const brokenOperationsACount = operationsA.length - data.originalOperationsACount;
  22935. const brokenOperationsBCount = operationsB.length - data.originalOperationsBCount;
  22936. // Then, if that number is not the same, pad `operationsA` or `operationsB` with correct number of no-ops so
  22937. // that the base versions are equalled.
  22938. //
  22939. // Note that only one array will be updated, as only one of those subtractions can be greater than zero.
  22940. padWithNoOps( operationsA, brokenOperationsBCount - brokenOperationsACount );
  22941. padWithNoOps( operationsB, brokenOperationsACount - brokenOperationsBCount );
  22942. }
  22943. // Finally, update base versions of transformed operations.
  22944. updateBaseVersions( operationsA, data.nextBaseVersionB );
  22945. updateBaseVersions( operationsB, data.nextBaseVersionA );
  22946. return { operationsA, operationsB, originalOperations };
  22947. }
  22948. // Gathers additional data about operations processed during transformation. Can be used to obtain contextual information
  22949. // about two operations that are about to be transformed. This contextual information can be used for better conflict resolution.
  22950. class ContextFactory {
  22951. // Creates `ContextFactory` instance.
  22952. //
  22953. // @param {module:engine/model/document~Document} document Document which the operations change.
  22954. // @param {Boolean} useRelations Whether during transformation relations should be used (used during undo for
  22955. // better conflict resolution).
  22956. // @param {Boolean} [forceWeakRemove=false] If set to `false`, remove operation will be always stronger than move operation,
  22957. // so the removed nodes won't end up back in the document root. When set to `true`, context data will be used.
  22958. constructor( document, useRelations, forceWeakRemove = false ) {
  22959. // For each operation that is created during transformation process, we keep a reference to the original operation
  22960. // which it comes from. The original operation works as a kind of "identifier". Every contextual information
  22961. // gathered during transformation that we want to save for given operation, is actually saved for the original operation.
  22962. // This way no matter if operation `a` is cloned, then transformed, even breaks, we still have access to the previously
  22963. // gathered data through original operation reference.
  22964. this.originalOperations = new Map();
  22965. // `model.History` instance which information about undone operations will be taken from.
  22966. this._history = document.history;
  22967. // Whether additional context should be used.
  22968. this._useRelations = useRelations;
  22969. this._forceWeakRemove = !!forceWeakRemove;
  22970. // Relations is a double-map structure (maps in map) where for two operations we store how those operations were related
  22971. // to each other. Those relations are evaluated during transformation process. For every transformated pair of operations
  22972. // we keep relations between them.
  22973. this._relations = new Map();
  22974. }
  22975. // Sets "original operation" for given operations.
  22976. //
  22977. // During transformation process, operations are cloned, then changed, then processed again, sometimes broken into two
  22978. // or multiple operations. When gathering additional data it is important that all operations can be somehow linked
  22979. // so a cloned and transformed "version" still kept track of the data assigned earlier to it.
  22980. //
  22981. // The original operation object will be used as such an universal linking id. Throughout the transformation process
  22982. // all cloned operations will refer to "the original operation" when storing and reading additional data.
  22983. //
  22984. // If `takeFrom` is not set, each operation from `operations` array will be assigned itself as "the original operation".
  22985. // This should be used as an initialization step.
  22986. //
  22987. // If `takeFrom` is set, each operation from `operations` will be assigned the same original operation as assigned
  22988. // for `takeFrom` operation. This should be used to update original operations. It should be used in a way that
  22989. // `operations` are the result of `takeFrom` transformation to ensure proper "original operation propagation".
  22990. //
  22991. // @param {Array.<module:engine/model/operation/operation~Operation>} operations
  22992. // @param {module:engine/model/operation/operation~Operation|null} [takeFrom=null]
  22993. setOriginalOperations( operations, takeFrom = null ) {
  22994. const originalOperation = takeFrom ? this.originalOperations.get( takeFrom ) : null;
  22995. for ( const operation of operations ) {
  22996. this.originalOperations.set( operation, originalOperation || operation );
  22997. }
  22998. }
  22999. // Saves a relation between operations `opA` and `opB`.
  23000. //
  23001. // Relations are then later used to help solve conflicts when operations are transformed.
  23002. //
  23003. // @param {module:engine/model/operation/operation~Operation} opA
  23004. // @param {module:engine/model/operation/operation~Operation} opB
  23005. updateRelation( opA, opB ) {
  23006. // The use of relations is described in a bigger detail in transformation functions.
  23007. //
  23008. // In brief, this function, for specified pairs of operation types, checks how positions defined in those operations relate.
  23009. // Then those relations are saved. For example, for two move operations, it is saved if one of those operations target
  23010. // position is before the other operation source position. This kind of information gives contextual information when
  23011. // transformation is used during undo. Similar checks are done for other pairs of operations.
  23012. //
  23013. switch ( opA.constructor ) {
  23014. case _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]: {
  23015. switch ( opB.constructor ) {
  23016. case _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"]: {
  23017. if ( opA.targetPosition.isEqual( opB.sourcePosition ) || opB.movedRange.containsPosition( opA.targetPosition ) ) {
  23018. this._setRelation( opA, opB, 'insertAtSource' );
  23019. } else if ( opA.targetPosition.isEqual( opB.deletionPosition ) ) {
  23020. this._setRelation( opA, opB, 'insertBetween' );
  23021. } else if ( opA.targetPosition.isAfter( opB.sourcePosition ) ) {
  23022. this._setRelation( opA, opB, 'moveTargetAfter' );
  23023. }
  23024. break;
  23025. }
  23026. case _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]: {
  23027. if ( opA.targetPosition.isEqual( opB.sourcePosition ) || opA.targetPosition.isBefore( opB.sourcePosition ) ) {
  23028. this._setRelation( opA, opB, 'insertBefore' );
  23029. } else {
  23030. this._setRelation( opA, opB, 'insertAfter' );
  23031. }
  23032. break;
  23033. }
  23034. }
  23035. break;
  23036. }
  23037. case _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"]: {
  23038. switch ( opB.constructor ) {
  23039. case _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"]: {
  23040. if ( opA.splitPosition.isBefore( opB.sourcePosition ) ) {
  23041. this._setRelation( opA, opB, 'splitBefore' );
  23042. }
  23043. break;
  23044. }
  23045. case _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]: {
  23046. if ( opA.splitPosition.isEqual( opB.sourcePosition ) || opA.splitPosition.isBefore( opB.sourcePosition ) ) {
  23047. this._setRelation( opA, opB, 'splitBefore' );
  23048. }
  23049. break;
  23050. }
  23051. }
  23052. break;
  23053. }
  23054. case _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"]: {
  23055. switch ( opB.constructor ) {
  23056. case _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"]: {
  23057. if ( !opA.targetPosition.isEqual( opB.sourcePosition ) ) {
  23058. this._setRelation( opA, opB, 'mergeTargetNotMoved' );
  23059. }
  23060. if ( opA.sourcePosition.isEqual( opB.targetPosition ) ) {
  23061. this._setRelation( opA, opB, 'mergeSourceNotMoved' );
  23062. }
  23063. if ( opA.sourcePosition.isEqual( opB.sourcePosition ) ) {
  23064. this._setRelation( opA, opB, 'mergeSameElement' );
  23065. }
  23066. break;
  23067. }
  23068. case _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"]: {
  23069. if ( opA.sourcePosition.isEqual( opB.splitPosition ) ) {
  23070. this._setRelation( opA, opB, 'splitAtSource' );
  23071. }
  23072. }
  23073. }
  23074. break;
  23075. }
  23076. case _markeroperation__WEBPACK_IMPORTED_MODULE_3__["default"]: {
  23077. const markerRange = opA.newRange;
  23078. if ( !markerRange ) {
  23079. return;
  23080. }
  23081. switch ( opB.constructor ) {
  23082. case _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]: {
  23083. const movedRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( opB.sourcePosition, opB.howMany );
  23084. const affectedLeft = movedRange.containsPosition( markerRange.start ) ||
  23085. movedRange.start.isEqual( markerRange.start );
  23086. const affectedRight = movedRange.containsPosition( markerRange.end ) ||
  23087. movedRange.end.isEqual( markerRange.end );
  23088. if ( ( affectedLeft || affectedRight ) && !movedRange.containsRange( markerRange ) ) {
  23089. this._setRelation( opA, opB, {
  23090. side: affectedLeft ? 'left' : 'right',
  23091. path: affectedLeft ? markerRange.start.path.slice() : markerRange.end.path.slice()
  23092. } );
  23093. }
  23094. break;
  23095. }
  23096. case _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"]: {
  23097. const wasInLeftElement = markerRange.start.isEqual( opB.targetPosition );
  23098. const wasStartBeforeMergedElement = markerRange.start.isEqual( opB.deletionPosition );
  23099. const wasEndBeforeMergedElement = markerRange.end.isEqual( opB.deletionPosition );
  23100. const wasInRightElement = markerRange.end.isEqual( opB.sourcePosition );
  23101. if ( wasInLeftElement || wasStartBeforeMergedElement || wasEndBeforeMergedElement || wasInRightElement ) {
  23102. this._setRelation( opA, opB, {
  23103. wasInLeftElement,
  23104. wasStartBeforeMergedElement,
  23105. wasEndBeforeMergedElement,
  23106. wasInRightElement
  23107. } );
  23108. }
  23109. break;
  23110. }
  23111. }
  23112. break;
  23113. }
  23114. }
  23115. }
  23116. // Evaluates and returns contextual information about two given operations `opA` and `opB` which are about to be transformed.
  23117. //
  23118. // @param {module:engine/model/operation/operation~Operation} opA
  23119. // @param {module:engine/model/operation/operation~Operation} opB
  23120. // @returns {module:engine/model/operation/transform~TransformationContext}
  23121. getContext( opA, opB, aIsStrong ) {
  23122. return {
  23123. aIsStrong,
  23124. aWasUndone: this._wasUndone( opA ),
  23125. bWasUndone: this._wasUndone( opB ),
  23126. abRelation: this._useRelations ? this._getRelation( opA, opB ) : null,
  23127. baRelation: this._useRelations ? this._getRelation( opB, opA ) : null,
  23128. forceWeakRemove: this._forceWeakRemove
  23129. };
  23130. }
  23131. // Returns whether given operation `op` has already been undone.
  23132. //
  23133. // Information whether an operation was undone gives more context when making a decision when two operations are in conflict.
  23134. //
  23135. // @param {module:engine/model/operation/operation~Operation} op
  23136. // @returns {Boolean}
  23137. _wasUndone( op ) {
  23138. // For `op`, get its original operation. After all, if `op` is a clone (or even transformed clone) of another
  23139. // operation, literally `op` couldn't be undone. It was just generated. If anything, it was the operation it origins
  23140. // from which was undone. So get that original operation.
  23141. const originalOp = this.originalOperations.get( op );
  23142. // And check with the document if the original operation was undone.
  23143. return originalOp.wasUndone || this._history.isUndoneOperation( originalOp );
  23144. }
  23145. // Returns a relation between `opA` and an operation which is undone by `opB`. This can be `String` value if a relation
  23146. // was set earlier or `null` if there was no relation between those operations.
  23147. //
  23148. // This is a little tricky to understand, so let's compare it to `ContextFactory#_wasUndone`.
  23149. //
  23150. // When `wasUndone( opB )` is used, we check if the `opB` has already been undone. It is obvious, that the
  23151. // undoing operation must happen after the undone operation. So, essentially, we have `opB`, we take document history,
  23152. // we look forward in the future and ask if in that future `opB` was undone.
  23153. //
  23154. // Relations is a backward process to `wasUndone()`.
  23155. //
  23156. // Long story short - using relations is asking what happened in the past. Looking back. This time we have an undoing
  23157. // operation `opB` which has undone some other operation. When there is a transformation `opA` x `opB` and there is
  23158. // a conflict to solve and `opB` is an undoing operation, we can look back in the history and see what was a relation
  23159. // between `opA` and the operation which `opB` undone. Basing on that relation from the past, we can now make
  23160. // a better decision when resolving a conflict between two operations, because we know more about the context of
  23161. // those two operations.
  23162. //
  23163. // This is why this function does not return a relation directly between `opA` and `opB` because we need to look
  23164. // back to search for a meaningful contextual information.
  23165. //
  23166. // @param {module:engine/model/operation/operation~Operation} opA
  23167. // @param {module:engine/model/operation/operation~Operation} opB
  23168. // @returns {String|null}
  23169. _getRelation( opA, opB ) {
  23170. // Get the original operation. Similarly as in `wasUndone()` it is used as an universal identifier for stored data.
  23171. const origB = this.originalOperations.get( opB );
  23172. const undoneB = this._history.getUndoneOperation( origB );
  23173. // If `opB` is not undoing any operation, there is no relation.
  23174. if ( !undoneB ) {
  23175. return null;
  23176. }
  23177. const origA = this.originalOperations.get( opA );
  23178. const relationsA = this._relations.get( origA );
  23179. // Get all relations for `opA`, and check if there is a relation with `opB`-undone-counterpart. If so, return it.
  23180. if ( relationsA ) {
  23181. return relationsA.get( undoneB ) || null;
  23182. }
  23183. return null;
  23184. }
  23185. // Helper function for `ContextFactory#updateRelations`.
  23186. //
  23187. // @private
  23188. // @param {module:engine/model/operation/operation~Operation} opA
  23189. // @param {module:engine/model/operation/operation~Operation} opB
  23190. // @param {String} relation
  23191. _setRelation( opA, opB, relation ) {
  23192. // As always, setting is for original operations, not the clones/transformed operations.
  23193. const origA = this.originalOperations.get( opA );
  23194. const origB = this.originalOperations.get( opB );
  23195. let relationsA = this._relations.get( origA );
  23196. if ( !relationsA ) {
  23197. relationsA = new Map();
  23198. this._relations.set( origA, relationsA );
  23199. }
  23200. relationsA.set( origB, relation );
  23201. }
  23202. }
  23203. /**
  23204. * Holds additional contextual information about a transformed pair of operations (`a` and `b`). Those information
  23205. * can be used for better conflict resolving.
  23206. *
  23207. * @typedef {Object} module:engine/model/operation/transform~TransformationContext
  23208. *
  23209. * @property {Boolean} aIsStrong Whether `a` is strong operation in this transformation, or weak.
  23210. * @property {Boolean} aWasUndone Whether `a` operation was undone.
  23211. * @property {Boolean} bWasUndone Whether `b` operation was undone.
  23212. * @property {String|null} abRelation The relation between `a` operation and an operation undone by `b` operation.
  23213. * @property {String|null} baRelation The relation between `b` operation and an operation undone by `a` operation.
  23214. */
  23215. /**
  23216. * An utility function that updates {@link module:engine/model/operation/operation~Operation#baseVersion base versions}
  23217. * of passed operations.
  23218. *
  23219. * The function simply sets `baseVersion` as a base version of the first passed operation and then increments it for
  23220. * each following operation in `operations`.
  23221. *
  23222. * @private
  23223. * @param {Array.<module:engine/model/operation/operation~Operation>} operations Operations to update.
  23224. * @param {Number} baseVersion Base version to set for the first operation in `operations`.
  23225. */
  23226. function updateBaseVersions( operations, baseVersion ) {
  23227. for ( const operation of operations ) {
  23228. operation.baseVersion = baseVersion++;
  23229. }
  23230. }
  23231. /**
  23232. * Adds `howMany` instances of {@link module:engine/model/operation/nooperation~NoOperation} to `operations` set.
  23233. *
  23234. * @private
  23235. * @param {Array.<module:engine/model/operation/operation~Operation>} operations
  23236. * @param {Number} howMany
  23237. */
  23238. function padWithNoOps( operations, howMany ) {
  23239. for ( let i = 0; i < howMany; i++ ) {
  23240. operations.push( new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) );
  23241. }
  23242. }
  23243. // -----------------------
  23244. setTransformation( _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"], _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"], ( a, b, context ) => {
  23245. // If operations in conflict, check if their ranges intersect and manage them properly.
  23246. //
  23247. // Operations can be in conflict only if:
  23248. //
  23249. // * their key is the same (they change the same attribute), and
  23250. // * they are in the same parent (operations for ranges [ 1 ] - [ 3 ] and [ 2, 0 ] - [ 2, 5 ] change different
  23251. // elements and can't be in conflict).
  23252. if ( a.key === b.key && a.range.start.hasSameParentAs( b.range.start ) ) {
  23253. // First, we want to apply change to the part of a range that has not been changed by the other operation.
  23254. const operations = a.range.getDifference( b.range ).map( range => {
  23255. return new _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( range, a.key, a.oldValue, a.newValue, 0 );
  23256. } );
  23257. // Then we take care of the common part of ranges.
  23258. const common = a.range.getIntersection( b.range );
  23259. if ( common ) {
  23260. // If this operation is more important, we also want to apply change to the part of the
  23261. // original range that has already been changed by the other operation. Since that range
  23262. // got changed we also have to update `oldValue`.
  23263. if ( context.aIsStrong ) {
  23264. operations.push( new _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( common, b.key, b.newValue, a.newValue, 0 ) );
  23265. }
  23266. }
  23267. if ( operations.length == 0 ) {
  23268. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
  23269. }
  23270. return operations;
  23271. } else {
  23272. // If operations don't conflict, simply return an array containing just a clone of this operation.
  23273. return [ a ];
  23274. }
  23275. } );
  23276. setTransformation( _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"], _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], ( a, b ) => {
  23277. // Case 1:
  23278. //
  23279. // The attribute operation range includes the position where nodes were inserted.
  23280. // There are two possible scenarios: the inserted nodes were text and they should receive attributes or
  23281. // the inserted nodes were elements and they should not receive attributes.
  23282. //
  23283. if ( a.range.start.hasSameParentAs( b.position ) && a.range.containsPosition( b.position ) ) {
  23284. // If new nodes should not receive attributes, two separated ranges will be returned.
  23285. // Otherwise, one expanded range will be returned.
  23286. const range = a.range._getTransformedByInsertion( b.position, b.howMany, !b.shouldReceiveAttributes );
  23287. const result = range.map( r => {
  23288. return new _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( r, a.key, a.oldValue, a.newValue, a.baseVersion );
  23289. } );
  23290. if ( b.shouldReceiveAttributes ) {
  23291. // `AttributeOperation#range` includes some newly inserted text.
  23292. // The operation should also change the attribute of that text. An example:
  23293. //
  23294. // Bold should be applied on the following range:
  23295. // <p>Fo[zb]ar</p>
  23296. //
  23297. // In meantime, new text is typed:
  23298. // <p>Fozxxbar</p>
  23299. //
  23300. // Bold should be applied also on the new text:
  23301. // <p>Fo[zxxb]ar</p>
  23302. // <p>Fo<$text bold="true">zxxb</$text>ar</p>
  23303. //
  23304. // There is a special case to consider here to consider.
  23305. //
  23306. // Consider setting an attribute with multiple possible values, for example `highlight`. The inserted text might
  23307. // have already an attribute value applied and the `oldValue` property of the attribute operation might be wrong:
  23308. //
  23309. // Attribute `highlight="yellow"` should be applied on the following range:
  23310. // <p>Fo[zb]ar<p>
  23311. //
  23312. // In meantime, character `x` with `highlight="red"` is typed:
  23313. // <p>Fo[z<$text highlight="red">x</$text>b]ar</p>
  23314. //
  23315. // In this case we cannot simply apply operation changing the attribute value from `null` to `"yellow"` for the whole range
  23316. // because that would lead to an exception (`oldValue` is incorrect for `x`).
  23317. //
  23318. // We also cannot break the original range as this would mess up a scenario when there are multiple following
  23319. // insert operations, because then only the first inserted character is included in those ranges:
  23320. // <p>Fo[z][x][b]ar</p> --> <p>Fo[z][x]x[b]ar</p> --> <p>Fo[z][x]xx[b]ar</p>
  23321. //
  23322. // So, the attribute range needs be expanded, no matter what attributes are set on the inserted nodes:
  23323. //
  23324. // <p>Fo[z<$text highlight="red">x</$text>b]ar</p> <--- Change from `null` to `yellow`, throwing an exception.
  23325. //
  23326. // But before that operation would be applied, we will add an additional attribute operation that will change
  23327. // attributes on the inserted nodes in a way which would make the original operation correct:
  23328. //
  23329. // <p>Fo[z{<$text highlight="red">}x</$text>b]ar</p> <--- Change range `{}` from `red` to `null`.
  23330. // <p>Fo[zxb]ar</p> <--- Now change from `null` to `yellow` is completely fine.
  23331. //
  23332. // Generate complementary attribute operation. Be sure to add it before the original operation.
  23333. const op = _getComplementaryAttributeOperations( b, a.key, a.oldValue );
  23334. if ( op ) {
  23335. result.unshift( op );
  23336. }
  23337. }
  23338. // If nodes should not receive new attribute, we are done here.
  23339. return result;
  23340. }
  23341. // If insert operation is not expanding the attribute operation range, simply transform the range.
  23342. a.range = a.range._getTransformedByInsertion( b.position, b.howMany, false )[ 0 ];
  23343. return [ a ];
  23344. } );
  23345. /**
  23346. * Helper function for `AttributeOperation` x `InsertOperation` (and reverse) transformation.
  23347. *
  23348. * For given `insertOperation` it checks the inserted node if it has an attribute `key` set to a value different
  23349. * than `newValue`. If so, it generates an `AttributeOperation` which changes the value of `key` attribute to `newValue`.
  23350. *
  23351. * @private
  23352. * @param {module:engine/model/operation/insertoperation~InsertOperation} insertOperation
  23353. * @param {String} key
  23354. * @param {*} newValue
  23355. * @returns {module:engine/model/operation/attributeoperation~AttributeOperation|null}
  23356. */
  23357. function _getComplementaryAttributeOperations( insertOperation, key, newValue ) {
  23358. const nodes = insertOperation.nodes;
  23359. // At the beginning we store the attribute value from the first node.
  23360. const insertValue = nodes.getNode( 0 ).getAttribute( key );
  23361. if ( insertValue == newValue ) {
  23362. return null;
  23363. }
  23364. const range = new _range__WEBPACK_IMPORTED_MODULE_9__["default"]( insertOperation.position, insertOperation.position.getShiftedBy( insertOperation.howMany ) );
  23365. return new _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( range, key, insertValue, newValue, 0 );
  23366. }
  23367. setTransformation( _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"], _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], ( a, b ) => {
  23368. const ranges = [];
  23369. // Case 1:
  23370. //
  23371. // Attribute change on the merged element. In this case, the merged element was moved to the graveyard.
  23372. // An additional attribute operation that will change the (re)moved element needs to be generated.
  23373. //
  23374. if ( a.range.start.hasSameParentAs( b.deletionPosition ) ) {
  23375. if ( a.range.containsPosition( b.deletionPosition ) || a.range.start.isEqual( b.deletionPosition ) ) {
  23376. ranges.push( _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( b.graveyardPosition, 1 ) );
  23377. }
  23378. }
  23379. const range = a.range._getTransformedByMergeOperation( b );
  23380. // Do not add empty (collapsed) ranges to the result. `range` may be collapsed if it contained only the merged element.
  23381. if ( !range.isCollapsed ) {
  23382. ranges.push( range );
  23383. }
  23384. // Create `AttributeOperation`s out of the ranges.
  23385. return ranges.map( range => {
  23386. return new _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( range, a.key, a.oldValue, a.newValue, a.baseVersion );
  23387. } );
  23388. } );
  23389. setTransformation( _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"], _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], ( a, b ) => {
  23390. const ranges = _breakRangeByMoveOperation( a.range, b );
  23391. // Create `AttributeOperation`s out of the ranges.
  23392. return ranges.map( range => new _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( range, a.key, a.oldValue, a.newValue, a.baseVersion ) );
  23393. } );
  23394. // Helper function for `AttributeOperation` x `MoveOperation` transformation.
  23395. //
  23396. // Takes the passed `range` and transforms it by move operation `moveOp` in a specific way. Only top-level nodes of `range`
  23397. // are considered to be in the range. If move operation moves nodes deep from inside of the range, those nodes won't
  23398. // be included in the result. In other words, top-level nodes of the ranges from the result are exactly the same as
  23399. // top-level nodes of the original `range`.
  23400. //
  23401. // This is important for `AttributeOperation` because, for its range, it changes only the top-level nodes. So we need to
  23402. // track only how those nodes have been affected by `MoveOperation`.
  23403. //
  23404. // @private
  23405. // @param {module:engine/model/range~Range} range
  23406. // @param {module:engine/model/operation/moveoperation~MoveOperation} moveOp
  23407. // @returns {Array.<module:engine/model/range~Range>}
  23408. function _breakRangeByMoveOperation( range, moveOp ) {
  23409. const moveRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( moveOp.sourcePosition, moveOp.howMany );
  23410. // We are transforming `range` (original range) by `moveRange` (range moved by move operation). As usual when it comes to
  23411. // transforming a ranges, we may have a common part of the ranges and we may have a difference part (zero to two ranges).
  23412. let common = null;
  23413. let difference = [];
  23414. // Let's compare the ranges.
  23415. if ( moveRange.containsRange( range, true ) ) {
  23416. // If the whole original range is moved, treat it whole as a common part. There's also no difference part.
  23417. common = range;
  23418. } else if ( range.start.hasSameParentAs( moveRange.start ) ) {
  23419. // If the ranges are "on the same level" (in the same parent) then move operation may move exactly those nodes
  23420. // that are changed by the attribute operation. In this case we get common part and difference part in the usual way.
  23421. difference = range.getDifference( moveRange );
  23422. common = range.getIntersection( moveRange );
  23423. } else {
  23424. // In any other situation we assume that original range is different than move range, that is that move operation
  23425. // moves other nodes that attribute operation change. Even if the moved range is deep inside in the original range.
  23426. //
  23427. // Note that this is different than in `.getIntersection` (we would get a common part in that case) and different
  23428. // than `.getDifference` (we would get two ranges).
  23429. difference = [ range ];
  23430. }
  23431. const result = [];
  23432. // The default behaviour of `_getTransformedByMove` might get wrong results for difference part, though, so
  23433. // we do it by hand.
  23434. for ( let diff of difference ) {
  23435. // First, transform the range by removing moved nodes. Since this is a difference, this is safe, `null` won't be returned
  23436. // as the range is different than the moved range.
  23437. diff = diff._getTransformedByDeletion( moveOp.sourcePosition, moveOp.howMany );
  23438. // Transform also `targetPosition`.
  23439. const targetPosition = moveOp.getMovedRangeStart();
  23440. // Spread the range only if moved nodes are inserted only between the top-level nodes of the `diff` range.
  23441. const spread = diff.start.hasSameParentAs( targetPosition );
  23442. // Transform by insertion of moved nodes.
  23443. diff = diff._getTransformedByInsertion( targetPosition, moveOp.howMany, spread );
  23444. result.push( ...diff );
  23445. }
  23446. // Common part can be simply transformed by the move operation. This is because move operation will not target to
  23447. // that common part (the operation would have to target inside its own moved range).
  23448. if ( common ) {
  23449. result.push(
  23450. common._getTransformedByMove( moveOp.sourcePosition, moveOp.targetPosition, moveOp.howMany, false )[ 0 ]
  23451. );
  23452. }
  23453. return result;
  23454. }
  23455. setTransformation( _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"], _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], ( a, b ) => {
  23456. // Case 1:
  23457. //
  23458. // Split node is the last node in `AttributeOperation#range`.
  23459. // `AttributeOperation#range` needs to be expanded to include the new (split) node.
  23460. //
  23461. // Attribute `type` to be changed to `numbered` but the `listItem` is split.
  23462. // <listItem type="bulleted">foobar</listItem>
  23463. //
  23464. // After split:
  23465. // <listItem type="bulleted">foo</listItem><listItem type="bulleted">bar</listItem>
  23466. //
  23467. // After attribute change:
  23468. // <listItem type="numbered">foo</listItem><listItem type="numbered">foo</listItem>
  23469. //
  23470. if ( a.range.end.isEqual( b.insertionPosition ) ) {
  23471. if ( !b.graveyardPosition ) {
  23472. a.range.end.offset++;
  23473. }
  23474. return [ a ];
  23475. }
  23476. // Case 2:
  23477. //
  23478. // Split position is inside `AttributeOperation#range`, at the same level, so the nodes to change are
  23479. // not going to make a flat range.
  23480. //
  23481. // Content with range-to-change and split position:
  23482. // <p>Fo[zb^a]r</p>
  23483. //
  23484. // After split:
  23485. // <p>Fozb</p><p>ar</p>
  23486. //
  23487. // Make two separate ranges containing all nodes to change:
  23488. // <p>Fo[zb]</p><p>[a]r</p>
  23489. //
  23490. if ( a.range.start.hasSameParentAs( b.splitPosition ) && a.range.containsPosition( b.splitPosition ) ) {
  23491. const secondPart = a.clone();
  23492. secondPart.range = new _range__WEBPACK_IMPORTED_MODULE_9__["default"](
  23493. b.moveTargetPosition.clone(),
  23494. a.range.end._getCombined( b.splitPosition, b.moveTargetPosition )
  23495. );
  23496. a.range.end = b.splitPosition.clone();
  23497. a.range.end.stickiness = 'toPrevious';
  23498. return [ a, secondPart ];
  23499. }
  23500. // The default case.
  23501. //
  23502. a.range = a.range._getTransformedBySplitOperation( b );
  23503. return [ a ];
  23504. } );
  23505. setTransformation( _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], _attributeoperation__WEBPACK_IMPORTED_MODULE_1__["default"], ( a, b ) => {
  23506. const result = [ a ];
  23507. // Case 1:
  23508. //
  23509. // The attribute operation range includes the position where nodes were inserted.
  23510. // There are two possible scenarios: the inserted nodes were text and they should receive attributes or
  23511. // the inserted nodes were elements and they should not receive attributes.
  23512. //
  23513. // This is a mirror scenario to the one described in `AttributeOperation` x `InsertOperation` transformation,
  23514. // although this case is a little less complicated. In this case we simply need to change attributes of the
  23515. // inserted nodes and that's it.
  23516. //
  23517. if ( a.shouldReceiveAttributes && a.position.hasSameParentAs( b.range.start ) && b.range.containsPosition( a.position ) ) {
  23518. const op = _getComplementaryAttributeOperations( a, b.key, b.newValue );
  23519. if ( op ) {
  23520. result.push( op );
  23521. }
  23522. }
  23523. // The default case is: do nothing.
  23524. // `AttributeOperation` does not change the model tree structure so `InsertOperation` does not need to be changed.
  23525. //
  23526. return result;
  23527. } );
  23528. setTransformation( _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], ( a, b, context ) => {
  23529. // Case 1:
  23530. //
  23531. // Two insert operations insert nodes at the same position. Since they are the same, it needs to be decided
  23532. // what will be the order of inserted nodes. However, there is no additional information to help in that
  23533. // decision. Also, when `b` will be transformed by `a`, the same order must be maintained.
  23534. //
  23535. // To achieve that, we will check if the operation is strong.
  23536. // If it is, it won't get transformed. If it is not, it will be moved.
  23537. //
  23538. if ( a.position.isEqual( b.position ) && context.aIsStrong ) {
  23539. return [ a ];
  23540. }
  23541. // The default case.
  23542. //
  23543. a.position = a.position._getTransformedByInsertOperation( b );
  23544. return [ a ];
  23545. } );
  23546. setTransformation( _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], ( a, b ) => {
  23547. // The default case.
  23548. //
  23549. a.position = a.position._getTransformedByMoveOperation( b );
  23550. return [ a ];
  23551. } );
  23552. setTransformation( _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], ( a, b ) => {
  23553. // The default case.
  23554. //
  23555. a.position = a.position._getTransformedBySplitOperation( b );
  23556. return [ a ];
  23557. } );
  23558. setTransformation( _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], ( a, b ) => {
  23559. a.position = a.position._getTransformedByMergeOperation( b );
  23560. return [ a ];
  23561. } );
  23562. // -----------------------
  23563. setTransformation( _markeroperation__WEBPACK_IMPORTED_MODULE_3__["default"], _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], ( a, b ) => {
  23564. if ( a.oldRange ) {
  23565. a.oldRange = a.oldRange._getTransformedByInsertOperation( b )[ 0 ];
  23566. }
  23567. if ( a.newRange ) {
  23568. a.newRange = a.newRange._getTransformedByInsertOperation( b )[ 0 ];
  23569. }
  23570. return [ a ];
  23571. } );
  23572. setTransformation( _markeroperation__WEBPACK_IMPORTED_MODULE_3__["default"], _markeroperation__WEBPACK_IMPORTED_MODULE_3__["default"], ( a, b, context ) => {
  23573. if ( a.name == b.name ) {
  23574. if ( context.aIsStrong ) {
  23575. a.oldRange = b.newRange ? b.newRange.clone() : null;
  23576. } else {
  23577. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
  23578. }
  23579. }
  23580. return [ a ];
  23581. } );
  23582. setTransformation( _markeroperation__WEBPACK_IMPORTED_MODULE_3__["default"], _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], ( a, b ) => {
  23583. if ( a.oldRange ) {
  23584. a.oldRange = a.oldRange._getTransformedByMergeOperation( b );
  23585. }
  23586. if ( a.newRange ) {
  23587. a.newRange = a.newRange._getTransformedByMergeOperation( b );
  23588. }
  23589. return [ a ];
  23590. } );
  23591. setTransformation( _markeroperation__WEBPACK_IMPORTED_MODULE_3__["default"], _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], ( a, b, context ) => {
  23592. if ( a.oldRange ) {
  23593. a.oldRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromRanges( a.oldRange._getTransformedByMoveOperation( b ) );
  23594. }
  23595. if ( a.newRange ) {
  23596. if ( context.abRelation ) {
  23597. const aNewRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromRanges( a.newRange._getTransformedByMoveOperation( b ) );
  23598. if ( context.abRelation.side == 'left' && b.targetPosition.isEqual( a.newRange.start ) ) {
  23599. a.newRange.start.path = context.abRelation.path;
  23600. a.newRange.end = aNewRange.end;
  23601. return [ a ];
  23602. } else if ( context.abRelation.side == 'right' && b.targetPosition.isEqual( a.newRange.end ) ) {
  23603. a.newRange.start = aNewRange.start;
  23604. a.newRange.end.path = context.abRelation.path;
  23605. return [ a ];
  23606. }
  23607. }
  23608. a.newRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromRanges( a.newRange._getTransformedByMoveOperation( b ) );
  23609. }
  23610. return [ a ];
  23611. } );
  23612. setTransformation( _markeroperation__WEBPACK_IMPORTED_MODULE_3__["default"], _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], ( a, b, context ) => {
  23613. if ( a.oldRange ) {
  23614. a.oldRange = a.oldRange._getTransformedBySplitOperation( b );
  23615. }
  23616. if ( a.newRange ) {
  23617. if ( context.abRelation ) {
  23618. const aNewRange = a.newRange._getTransformedBySplitOperation( b );
  23619. if ( a.newRange.start.isEqual( b.splitPosition ) && context.abRelation.wasStartBeforeMergedElement ) {
  23620. a.newRange.start = _position__WEBPACK_IMPORTED_MODULE_10__["default"]._createAt( b.insertionPosition );
  23621. } else if ( a.newRange.start.isEqual( b.splitPosition ) && !context.abRelation.wasInLeftElement ) {
  23622. a.newRange.start = _position__WEBPACK_IMPORTED_MODULE_10__["default"]._createAt( b.moveTargetPosition );
  23623. }
  23624. if ( a.newRange.end.isEqual( b.splitPosition ) && context.abRelation.wasInRightElement ) {
  23625. a.newRange.end = _position__WEBPACK_IMPORTED_MODULE_10__["default"]._createAt( b.moveTargetPosition );
  23626. } else if ( a.newRange.end.isEqual( b.splitPosition ) && context.abRelation.wasEndBeforeMergedElement ) {
  23627. a.newRange.end = _position__WEBPACK_IMPORTED_MODULE_10__["default"]._createAt( b.insertionPosition );
  23628. } else {
  23629. a.newRange.end = aNewRange.end;
  23630. }
  23631. return [ a ];
  23632. }
  23633. a.newRange = a.newRange._getTransformedBySplitOperation( b );
  23634. }
  23635. return [ a ];
  23636. } );
  23637. // -----------------------
  23638. setTransformation( _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], ( a, b ) => {
  23639. if ( a.sourcePosition.hasSameParentAs( b.position ) ) {
  23640. a.howMany += b.howMany;
  23641. }
  23642. a.sourcePosition = a.sourcePosition._getTransformedByInsertOperation( b );
  23643. a.targetPosition = a.targetPosition._getTransformedByInsertOperation( b );
  23644. return [ a ];
  23645. } );
  23646. setTransformation( _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], ( a, b, context ) => {
  23647. // Case 1:
  23648. //
  23649. // Same merge operations.
  23650. //
  23651. // Both operations have same source and target positions. So the element already got merged and there is
  23652. // theoretically nothing to do.
  23653. //
  23654. if ( a.sourcePosition.isEqual( b.sourcePosition ) && a.targetPosition.isEqual( b.targetPosition ) ) {
  23655. // There are two ways that we can provide a do-nothing operation.
  23656. //
  23657. // First is simply a NoOperation instance. We will use it if `b` operation was not undone.
  23658. //
  23659. // Second is a merge operation that has the source operation in the merged element - in the graveyard -
  23660. // same target position and `howMany` equal to `0`. So it is basically merging an empty element from graveyard
  23661. // which is almost the same as NoOperation.
  23662. //
  23663. // This way the merge operation can be later transformed by split operation
  23664. // to provide correct undo. This will be used if `b` operation was undone (only then it is correct).
  23665. //
  23666. if ( !context.bWasUndone ) {
  23667. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
  23668. } else {
  23669. const path = b.graveyardPosition.path.slice();
  23670. path.push( 0 );
  23671. a.sourcePosition = new _position__WEBPACK_IMPORTED_MODULE_10__["default"]( b.graveyardPosition.root, path );
  23672. a.howMany = 0;
  23673. return [ a ];
  23674. }
  23675. }
  23676. // Case 2:
  23677. //
  23678. // Same merge source position but different target position.
  23679. //
  23680. // This can happen during collaboration. For example, if one client merged a paragraph to the previous paragraph
  23681. // and the other person removed that paragraph and merged the same paragraph to something before:
  23682. //
  23683. // Client A:
  23684. // <p>Foo</p><p>Bar</p><p>[]Xyz</p>
  23685. // <p>Foo</p><p>BarXyz</p>
  23686. //
  23687. // Client B:
  23688. // <p>Foo</p>[<p>Bar</p>]<p>Xyz</p>
  23689. // <p>Foo</p><p>[]Xyz</p>
  23690. // <p>FooXyz</p>
  23691. //
  23692. // In this case we need to decide where finally "Xyz" will land:
  23693. //
  23694. // <p>FooXyz</p> graveyard: <p>Bar</p>
  23695. // <p>Foo</p> graveyard: <p>BarXyz</p>
  23696. //
  23697. // Let's move it in a way so that a merge operation that does not target to graveyard is more important so that
  23698. // nodes does not end up in the graveyard. It makes sense. Both for Client A and for Client B "Xyz" finally did not
  23699. // end up in the graveyard (see above).
  23700. //
  23701. // If neither or both operations point to graveyard, then let `aIsStrong` decide.
  23702. //
  23703. if (
  23704. a.sourcePosition.isEqual( b.sourcePosition ) && !a.targetPosition.isEqual( b.targetPosition ) &&
  23705. !context.bWasUndone && context.abRelation != 'splitAtSource'
  23706. ) {
  23707. const aToGraveyard = a.targetPosition.root.rootName == '$graveyard';
  23708. const bToGraveyard = b.targetPosition.root.rootName == '$graveyard';
  23709. // If `aIsWeak` it means that `a` points to graveyard while `b` doesn't. Don't move nodes then.
  23710. const aIsWeak = aToGraveyard && !bToGraveyard;
  23711. // If `bIsWeak` it means that `b` points to graveyard while `a` doesn't. Force moving nodes then.
  23712. const bIsWeak = bToGraveyard && !aToGraveyard;
  23713. // Force move if `b` is weak or neither operation is weak but `a` is stronger through `context.aIsStrong`.
  23714. const forceMove = bIsWeak || ( !aIsWeak && context.aIsStrong );
  23715. if ( forceMove ) {
  23716. const sourcePosition = b.targetPosition._getTransformedByMergeOperation( b );
  23717. const targetPosition = a.targetPosition._getTransformedByMergeOperation( b );
  23718. return [ new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( sourcePosition, a.howMany, targetPosition, 0 ) ];
  23719. } else {
  23720. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
  23721. }
  23722. }
  23723. // The default case.
  23724. //
  23725. if ( a.sourcePosition.hasSameParentAs( b.targetPosition ) ) {
  23726. a.howMany += b.howMany;
  23727. }
  23728. a.sourcePosition = a.sourcePosition._getTransformedByMergeOperation( b );
  23729. a.targetPosition = a.targetPosition._getTransformedByMergeOperation( b );
  23730. // Handle positions in graveyard.
  23731. // If graveyard positions are same and `a` operation is strong - do not transform.
  23732. if ( !a.graveyardPosition.isEqual( b.graveyardPosition ) || !context.aIsStrong ) {
  23733. a.graveyardPosition = a.graveyardPosition._getTransformedByMergeOperation( b );
  23734. }
  23735. return [ a ];
  23736. } );
  23737. setTransformation( _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], ( a, b, context ) => {
  23738. // Case 1:
  23739. //
  23740. // The element to merge got removed.
  23741. //
  23742. // Merge operation does support merging elements which are not siblings. So it would not be a problem
  23743. // from technical point of view. However, if the element was removed, the intention of the user deleting it
  23744. // was to have it all deleted, together with its children. From user experience point of view, moving back the
  23745. // removed nodes might be unexpected. This means that in this scenario we will block the merging.
  23746. //
  23747. // The exception of this rule would be if the remove operation was later undone.
  23748. //
  23749. const removedRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( b.sourcePosition, b.howMany );
  23750. if ( b.type == 'remove' && !context.bWasUndone && !context.forceWeakRemove ) {
  23751. if ( a.deletionPosition.hasSameParentAs( b.sourcePosition ) && removedRange.containsPosition( a.sourcePosition ) ) {
  23752. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
  23753. }
  23754. }
  23755. // The default case.
  23756. //
  23757. if ( a.sourcePosition.hasSameParentAs( b.targetPosition ) ) {
  23758. a.howMany += b.howMany;
  23759. }
  23760. if ( a.sourcePosition.hasSameParentAs( b.sourcePosition ) ) {
  23761. a.howMany -= b.howMany;
  23762. }
  23763. a.sourcePosition = a.sourcePosition._getTransformedByMoveOperation( b );
  23764. a.targetPosition = a.targetPosition._getTransformedByMoveOperation( b );
  23765. // `MergeOperation` graveyard position is like `MoveOperation` target position. It is a position where element(s) will
  23766. // be moved. Like in other similar cases, we need to consider the scenario when those positions are same.
  23767. // Here, we will treat `MergeOperation` like it is always strong (see `InsertOperation` x `InsertOperation` for comparison).
  23768. // This means that we won't transform graveyard position if it is equal to move operation target position.
  23769. if ( !a.graveyardPosition.isEqual( b.targetPosition ) ) {
  23770. a.graveyardPosition = a.graveyardPosition._getTransformedByMoveOperation( b );
  23771. }
  23772. return [ a ];
  23773. } );
  23774. setTransformation( _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], ( a, b, context ) => {
  23775. if ( b.graveyardPosition ) {
  23776. // If `b` operation defines graveyard position, a node from graveyard will be moved. This means that we need to
  23777. // transform `a.graveyardPosition` accordingly.
  23778. a.graveyardPosition = a.graveyardPosition._getTransformedByDeletion( b.graveyardPosition, 1 );
  23779. // This is a scenario foreseen in `MergeOperation` x `MergeOperation`, with two identical merge operations.
  23780. //
  23781. // So, there was `MergeOperation` x `MergeOperation` transformation earlier. Now, `a` is a merge operation which
  23782. // source position is in graveyard. Interestingly, split operation wants to use the node to be merged by `a`. This
  23783. // means that `b` is undoing that merge operation from earlier, which caused `a` to be in graveyard.
  23784. //
  23785. // If that's the case, at this point, we will only "fix" `a.howMany`. It was earlier set to `0` in
  23786. // `MergeOperation` x `MergeOperation` transformation. Later transformations in this function will change other
  23787. // properties.
  23788. //
  23789. if ( a.deletionPosition.isEqual( b.graveyardPosition ) ) {
  23790. a.howMany = b.howMany;
  23791. }
  23792. }
  23793. // Case 1:
  23794. //
  23795. // Merge operation moves nodes to the place where split happens.
  23796. // This is a classic situation when there are two paragraphs, and there is a split (enter) after the first
  23797. // paragraph and there is a merge (delete) at the beginning of the second paragraph:
  23798. //
  23799. // <p>Foo{}</p><p>[]Bar</p>.
  23800. //
  23801. // Split is after `Foo`, while merge is from `Bar` to the end of `Foo`.
  23802. //
  23803. // State after split:
  23804. // <p>Foo</p><p></p><p>Bar</p>
  23805. //
  23806. // Now, `Bar` should be merged to the new paragraph:
  23807. // <p>Foo</p><p>Bar</p>
  23808. //
  23809. // Instead of merging it to the original paragraph:
  23810. // <p>FooBar</p><p></p>
  23811. //
  23812. // This means that `targetPosition` needs to be transformed. This is the default case though.
  23813. // For example, if the split would be after `F`, `targetPosition` should also be transformed.
  23814. //
  23815. // There are three exceptions, though, when we want to keep `targetPosition` as it was.
  23816. //
  23817. // First exception is when the merge target position is inside an element (not at the end, as usual). This
  23818. // happens when the merge operation earlier was transformed by "the same" merge operation. If merge operation
  23819. // targets inside the element we want to keep the original target position (and not transform it) because
  23820. // we have additional context telling us that we want to merge to the original element. We can check if the
  23821. // merge operation points inside element by checking what is `SplitOperation#howMany`. Since merge target position
  23822. // is same as split position, if `howMany` is non-zero, it means that the merge target position is inside an element.
  23823. //
  23824. // Second exception is when the element to merge is in the graveyard and split operation uses it. In that case
  23825. // if target position would be transformed, the merge operation would target at the source position:
  23826. //
  23827. // root: <p>Foo</p> graveyard: <p></p>
  23828. //
  23829. // SplitOperation: root [ 0, 3 ] using graveyard [ 0 ] (howMany = 0)
  23830. // MergeOperation: graveyard [ 0, 0 ] -> root [ 0, 3 ] (howMany = 0)
  23831. //
  23832. // Since split operation moves the graveyard node back to the root, the merge operation source position changes.
  23833. // We would like to merge from the empty <p> to the "Foo" <p>:
  23834. //
  23835. // root: <p>Foo</p><p></p> graveyard:
  23836. //
  23837. // MergeOperation#sourcePosition = root [ 1, 0 ]
  23838. //
  23839. // If `targetPosition` is transformed, it would become root [ 1, 0 ] as well. It has to be kept as it was.
  23840. //
  23841. // Third exception is connected with relations. If this happens during undo and we have explicit information
  23842. // that target position has not been affected by the operation which is undone by this split then this split should
  23843. // not move the target position either.
  23844. //
  23845. if ( a.targetPosition.isEqual( b.splitPosition ) ) {
  23846. const mergeInside = b.howMany != 0;
  23847. const mergeSplittingElement = b.graveyardPosition && a.deletionPosition.isEqual( b.graveyardPosition );
  23848. if ( mergeInside || mergeSplittingElement || context.abRelation == 'mergeTargetNotMoved' ) {
  23849. a.sourcePosition = a.sourcePosition._getTransformedBySplitOperation( b );
  23850. return [ a ];
  23851. }
  23852. }
  23853. // Case 2:
  23854. //
  23855. // Merge source is at the same position as split position. This sometimes happen, mostly during undo.
  23856. // The decision here is mostly to choose whether merge source position should stay where it is (so it will be at the end of the
  23857. // split element) or should be move to the beginning of the new element.
  23858. //
  23859. if ( a.sourcePosition.isEqual( b.splitPosition ) ) {
  23860. // Use context to check if `SplitOperation` is not undoing a merge operation, that didn't change the `a` operation.
  23861. // This scenario happens the undone merge operation moved nodes at the source position of `a` operation.
  23862. // In that case `a` operation source position should stay where it is.
  23863. if ( context.abRelation == 'mergeSourceNotMoved' ) {
  23864. a.howMany = 0;
  23865. a.targetPosition = a.targetPosition._getTransformedBySplitOperation( b );
  23866. return [ a ];
  23867. }
  23868. // This merge operation might have been earlier transformed by a merge operation which both merged the same element.
  23869. // See that case in `MergeOperation` x `MergeOperation` transformation. In that scenario, if the merge operation has been undone,
  23870. // the special case is not applied.
  23871. //
  23872. // Now, the merge operation is transformed by the split which has undone that previous merge operation.
  23873. // So now we are fixing situation which was skipped in `MergeOperation` x `MergeOperation` case.
  23874. //
  23875. if ( context.abRelation == 'mergeSameElement' || a.sourcePosition.offset > 0 ) {
  23876. a.sourcePosition = b.moveTargetPosition.clone();
  23877. a.targetPosition = a.targetPosition._getTransformedBySplitOperation( b );
  23878. return [ a ];
  23879. }
  23880. }
  23881. // The default case.
  23882. //
  23883. if ( a.sourcePosition.hasSameParentAs( b.splitPosition ) ) {
  23884. a.howMany = b.splitPosition.offset;
  23885. }
  23886. a.sourcePosition = a.sourcePosition._getTransformedBySplitOperation( b );
  23887. a.targetPosition = a.targetPosition._getTransformedBySplitOperation( b );
  23888. return [ a ];
  23889. } );
  23890. // -----------------------
  23891. setTransformation( _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], ( a, b ) => {
  23892. const moveRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( a.sourcePosition, a.howMany );
  23893. const transformed = moveRange._getTransformedByInsertOperation( b, false )[ 0 ];
  23894. a.sourcePosition = transformed.start;
  23895. a.howMany = transformed.end.offset - transformed.start.offset;
  23896. // See `InsertOperation` x `MoveOperation` transformation for details on this case.
  23897. //
  23898. // In summary, both operations point to the same place, so the order of nodes needs to be decided.
  23899. // `MoveOperation` is considered weaker, so it is always transformed, unless there was a certain relation
  23900. // between operations.
  23901. //
  23902. if ( !a.targetPosition.isEqual( b.position ) ) {
  23903. a.targetPosition = a.targetPosition._getTransformedByInsertOperation( b );
  23904. }
  23905. return [ a ];
  23906. } );
  23907. setTransformation( _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], ( a, b, context ) => {
  23908. //
  23909. // Setting and evaluating some variables that will be used in special cases and default algorithm.
  23910. //
  23911. // Create ranges from `MoveOperations` properties.
  23912. const rangeA = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( a.sourcePosition, a.howMany );
  23913. const rangeB = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( b.sourcePosition, b.howMany );
  23914. // Assign `context.aIsStrong` to a different variable, because the value may change during execution of
  23915. // this algorithm and we do not want to override original `context.aIsStrong` that will be used in later transformations.
  23916. let aIsStrong = context.aIsStrong;
  23917. // This will be used to decide the order of nodes if both operations target at the same position.
  23918. // By default, use strong/weak operation mechanism.
  23919. let insertBefore = !context.aIsStrong;
  23920. // If the relation is set, then use it to decide nodes order.
  23921. if ( context.abRelation == 'insertBefore' || context.baRelation == 'insertAfter' ) {
  23922. insertBefore = true;
  23923. } else if ( context.abRelation == 'insertAfter' || context.baRelation == 'insertBefore' ) {
  23924. insertBefore = false;
  23925. }
  23926. // `a.targetPosition` could be affected by the `b` operation. We will transform it.
  23927. let newTargetPosition;
  23928. if ( a.targetPosition.isEqual( b.targetPosition ) && insertBefore ) {
  23929. newTargetPosition = a.targetPosition._getTransformedByDeletion(
  23930. b.sourcePosition,
  23931. b.howMany
  23932. );
  23933. } else {
  23934. newTargetPosition = a.targetPosition._getTransformedByMove(
  23935. b.sourcePosition,
  23936. b.targetPosition,
  23937. b.howMany
  23938. );
  23939. }
  23940. //
  23941. // Special case #1 + mirror.
  23942. //
  23943. // Special case when both move operations' target positions are inside nodes that are
  23944. // being moved by the other move operation. So in other words, we move ranges into inside of each other.
  23945. // This case can't be solved reasonably (on the other hand, it should not happen often).
  23946. if ( _moveTargetIntoMovedRange( a, b ) && _moveTargetIntoMovedRange( b, a ) ) {
  23947. // Instead of transforming operation, we return a reverse of the operation that we transform by.
  23948. // So when the results of this "transformation" will be applied, `b` MoveOperation will get reversed.
  23949. return [ b.getReversed() ];
  23950. }
  23951. //
  23952. // End of special case #1.
  23953. //
  23954. //
  23955. // Special case #2.
  23956. //
  23957. // Check if `b` operation targets inside `rangeA`.
  23958. const bTargetsToA = rangeA.containsPosition( b.targetPosition );
  23959. // If `b` targets to `rangeA` and `rangeA` contains `rangeB`, `b` operation has no influence on `a` operation.
  23960. // You might say that operation `b` is captured inside operation `a`.
  23961. if ( bTargetsToA && rangeA.containsRange( rangeB, true ) ) {
  23962. // There is a mini-special case here, where `rangeB` is on other level than `rangeA`. That's why
  23963. // we need to transform `a` operation anyway.
  23964. rangeA.start = rangeA.start._getTransformedByMove( b.sourcePosition, b.targetPosition, b.howMany );
  23965. rangeA.end = rangeA.end._getTransformedByMove( b.sourcePosition, b.targetPosition, b.howMany );
  23966. return _makeMoveOperationsFromRanges( [ rangeA ], newTargetPosition );
  23967. }
  23968. //
  23969. // Special case #2 mirror.
  23970. //
  23971. const aTargetsToB = rangeB.containsPosition( a.targetPosition );
  23972. if ( aTargetsToB && rangeB.containsRange( rangeA, true ) ) {
  23973. // `a` operation is "moved together" with `b` operation.
  23974. // Here, just move `rangeA` "inside" `rangeB`.
  23975. rangeA.start = rangeA.start._getCombined( b.sourcePosition, b.getMovedRangeStart() );
  23976. rangeA.end = rangeA.end._getCombined( b.sourcePosition, b.getMovedRangeStart() );
  23977. return _makeMoveOperationsFromRanges( [ rangeA ], newTargetPosition );
  23978. }
  23979. //
  23980. // End of special case #2.
  23981. //
  23982. //
  23983. // Special case #3 + mirror.
  23984. //
  23985. // `rangeA` has a node which is an ancestor of `rangeB`. In other words, `rangeB` is inside `rangeA`
  23986. // but not on the same tree level. In such case ranges have common part but we have to treat it
  23987. // differently, because in such case those ranges are not really conflicting and should be treated like
  23988. // two separate ranges. Also we have to discard two difference parts.
  23989. const aCompB = Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_11__["default"])( a.sourcePosition.getParentPath(), b.sourcePosition.getParentPath() );
  23990. if ( aCompB == 'prefix' || aCompB == 'extension' ) {
  23991. // Transform `rangeA` by `b` operation and make operation out of it, and that's all.
  23992. // Note that this is a simplified version of default case, but here we treat the common part (whole `rangeA`)
  23993. // like a one difference part.
  23994. rangeA.start = rangeA.start._getTransformedByMove( b.sourcePosition, b.targetPosition, b.howMany );
  23995. rangeA.end = rangeA.end._getTransformedByMove( b.sourcePosition, b.targetPosition, b.howMany );
  23996. return _makeMoveOperationsFromRanges( [ rangeA ], newTargetPosition );
  23997. }
  23998. //
  23999. // End of special case #3.
  24000. //
  24001. //
  24002. // Default case - ranges are on the same level or are not connected with each other.
  24003. //
  24004. // Modifier for default case.
  24005. // Modifies `aIsStrong` flag in certain conditions.
  24006. //
  24007. // If only one of operations is a remove operation, we force remove operation to be the "stronger" one
  24008. // to provide more expected results.
  24009. if ( a.type == 'remove' && b.type != 'remove' && !context.aWasUndone && !context.forceWeakRemove ) {
  24010. aIsStrong = true;
  24011. } else if ( a.type != 'remove' && b.type == 'remove' && !context.bWasUndone && !context.forceWeakRemove ) {
  24012. aIsStrong = false;
  24013. }
  24014. // Handle operation's source ranges - check how `rangeA` is affected by `b` operation.
  24015. // This will aggregate transformed ranges.
  24016. const ranges = [];
  24017. // Get the "difference part" of `a` operation source range.
  24018. // This is an array with one or two ranges. Two ranges if `rangeB` is inside `rangeA`.
  24019. const difference = rangeA.getDifference( rangeB );
  24020. for ( const range of difference ) {
  24021. // Transform those ranges by `b` operation. For example if `b` moved range from before those ranges, fix those ranges.
  24022. range.start = range.start._getTransformedByDeletion( b.sourcePosition, b.howMany );
  24023. range.end = range.end._getTransformedByDeletion( b.sourcePosition, b.howMany );
  24024. // If `b` operation targets into `rangeA` on the same level, spread `rangeA` into two ranges.
  24025. const shouldSpread = Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_11__["default"])( range.start.getParentPath(), b.getMovedRangeStart().getParentPath() ) == 'same';
  24026. const newRanges = range._getTransformedByInsertion( b.getMovedRangeStart(), b.howMany, shouldSpread );
  24027. ranges.push( ...newRanges );
  24028. }
  24029. // Then, we have to manage the "common part" of both move ranges.
  24030. const common = rangeA.getIntersection( rangeB );
  24031. if ( common !== null && aIsStrong ) {
  24032. // Calculate the new position of that part of original range.
  24033. common.start = common.start._getCombined( b.sourcePosition, b.getMovedRangeStart() );
  24034. common.end = common.end._getCombined( b.sourcePosition, b.getMovedRangeStart() );
  24035. // Take care of proper range order.
  24036. //
  24037. // Put `common` at appropriate place. Keep in mind that we are interested in original order.
  24038. // Basically there are only three cases: there is zero, one or two difference ranges.
  24039. //
  24040. // If there is zero difference ranges, just push `common` in the array.
  24041. if ( ranges.length === 0 ) {
  24042. ranges.push( common );
  24043. }
  24044. // If there is one difference range, we need to check whether common part was before it or after it.
  24045. else if ( ranges.length == 1 ) {
  24046. if ( rangeB.start.isBefore( rangeA.start ) || rangeB.start.isEqual( rangeA.start ) ) {
  24047. ranges.unshift( common );
  24048. } else {
  24049. ranges.push( common );
  24050. }
  24051. }
  24052. // If there are more ranges (which means two), put common part between them. This is the only scenario
  24053. // where there could be two difference ranges so we don't have to make any comparisons.
  24054. else {
  24055. ranges.splice( 1, 0, common );
  24056. }
  24057. }
  24058. if ( ranges.length === 0 ) {
  24059. // If there are no "source ranges", nothing should be changed.
  24060. // Note that this can happen only if `aIsStrong == false` and `rangeA.isEqual( rangeB )`.
  24061. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( a.baseVersion ) ];
  24062. }
  24063. return _makeMoveOperationsFromRanges( ranges, newTargetPosition );
  24064. } );
  24065. setTransformation( _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], ( a, b, context ) => {
  24066. let newTargetPosition = a.targetPosition.clone();
  24067. // Do not transform if target position is same as split insertion position and this split comes from undo.
  24068. // This should be done on relations but it is too much work for now as it would require relations working in collaboration.
  24069. // We need to make a decision how we will resolve such conflict and this is less harmful way.
  24070. if ( !a.targetPosition.isEqual( b.insertionPosition ) || !b.graveyardPosition || context.abRelation == 'moveTargetAfter' ) {
  24071. newTargetPosition = a.targetPosition._getTransformedBySplitOperation( b );
  24072. }
  24073. // Case 1:
  24074. //
  24075. // Last element in the moved range got split.
  24076. //
  24077. // In this case the default range transformation will not work correctly as the element created by
  24078. // split operation would be outside the range. The range to move needs to be fixed manually.
  24079. //
  24080. const moveRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( a.sourcePosition, a.howMany );
  24081. if ( moveRange.end.isEqual( b.insertionPosition ) ) {
  24082. // Do it only if this is a "natural" split, not a one that comes from undo.
  24083. // If this is undo split, only `targetPosition` needs to be changed (if the move is a remove).
  24084. if ( !b.graveyardPosition ) {
  24085. a.howMany++;
  24086. }
  24087. a.targetPosition = newTargetPosition;
  24088. return [ a ];
  24089. }
  24090. // Case 2:
  24091. //
  24092. // Split happened between the moved nodes. In this case two ranges to move need to be generated.
  24093. //
  24094. // Characters `ozba` are moved to the end of paragraph `Xyz` but split happened.
  24095. // <p>F[oz|ba]r</p><p>Xyz</p>
  24096. //
  24097. // After split:
  24098. // <p>F[oz</p><p>ba]r</p><p>Xyz</p>
  24099. //
  24100. // Correct ranges:
  24101. // <p>F[oz]</p><p>[ba]r</p><p>Xyz</p>
  24102. //
  24103. // After move:
  24104. // <p>F</p><p>r</p><p>Xyzozba</p>
  24105. //
  24106. if ( moveRange.start.hasSameParentAs( b.splitPosition ) && moveRange.containsPosition( b.splitPosition ) ) {
  24107. let rightRange = new _range__WEBPACK_IMPORTED_MODULE_9__["default"]( b.splitPosition, moveRange.end );
  24108. rightRange = rightRange._getTransformedBySplitOperation( b );
  24109. const ranges = [
  24110. new _range__WEBPACK_IMPORTED_MODULE_9__["default"]( moveRange.start, b.splitPosition ),
  24111. rightRange
  24112. ];
  24113. return _makeMoveOperationsFromRanges( ranges, newTargetPosition );
  24114. }
  24115. // Case 3:
  24116. //
  24117. // Move operation targets at the split position. We need to decide if the nodes should be inserted
  24118. // at the end of the split element or at the beginning of the new element.
  24119. //
  24120. if ( a.targetPosition.isEqual( b.splitPosition ) && context.abRelation == 'insertAtSource' ) {
  24121. newTargetPosition = b.moveTargetPosition;
  24122. }
  24123. // Case 4:
  24124. //
  24125. // Move operation targets just after the split element. We need to decide if the nodes should be inserted
  24126. // between two parts of split element, or after the new element.
  24127. //
  24128. // Split at `|`, while move operation moves `<p>Xyz</p>` and targets at `^`:
  24129. // <p>Foo|bar</p>^<p>baz</p>
  24130. // <p>Foo</p>^<p>bar</p><p>baz</p> or <p>Foo</p><p>bar</p>^<p>baz</p>?
  24131. //
  24132. // If there is no contextual information between operations (for example, they come from collaborative
  24133. // editing), we don't want to put some unrelated content (move) between parts of related content (split parts).
  24134. // However, if the split is from undo, in the past, the moved content might be targeting between the
  24135. // split parts, meaning that was exactly user's intention:
  24136. //
  24137. // <p>Foo</p>^<p>bar</p> <--- original situation, in "past".
  24138. // <p>Foobar</p>^ <--- after merge target position is transformed.
  24139. // <p>Foo|bar</p>^ <--- then the merge is undone, and split happens, which leads us to current situation.
  24140. //
  24141. // In this case it is pretty clear that the intention was to put new paragraph between those nodes,
  24142. // so we need to transform accordingly. We can detect this scenario thanks to relations.
  24143. //
  24144. if ( a.targetPosition.isEqual( b.insertionPosition ) && context.abRelation == 'insertBetween' ) {
  24145. newTargetPosition = a.targetPosition;
  24146. }
  24147. // The default case.
  24148. //
  24149. const transformed = moveRange._getTransformedBySplitOperation( b );
  24150. const ranges = [ transformed ];
  24151. // Case 5:
  24152. //
  24153. // Moved range contains graveyard element used by split operation. Add extra move operation to the result.
  24154. //
  24155. if ( b.graveyardPosition ) {
  24156. const movesGraveyardElement = moveRange.start.isEqual( b.graveyardPosition ) || moveRange.containsPosition( b.graveyardPosition );
  24157. if ( a.howMany > 1 && movesGraveyardElement && !context.aWasUndone ) {
  24158. ranges.push( _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( b.insertionPosition, 1 ) );
  24159. }
  24160. }
  24161. return _makeMoveOperationsFromRanges( ranges, newTargetPosition );
  24162. } );
  24163. setTransformation( _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], ( a, b, context ) => {
  24164. const movedRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( a.sourcePosition, a.howMany );
  24165. if ( b.deletionPosition.hasSameParentAs( a.sourcePosition ) && movedRange.containsPosition( b.sourcePosition ) ) {
  24166. if ( a.type == 'remove' && !context.forceWeakRemove ) {
  24167. // Case 1:
  24168. //
  24169. // The element to remove got merged.
  24170. //
  24171. // Merge operation does support merging elements which are not siblings. So it would not be a problem
  24172. // from technical point of view. However, if the element was removed, the intention of the user
  24173. // deleting it was to have it all deleted. From user experience point of view, moving back the
  24174. // removed nodes might be unexpected. This means that in this scenario we will reverse merging and remove the element.
  24175. //
  24176. if ( !context.aWasUndone ) {
  24177. const results = [];
  24178. let gyMoveSource = b.graveyardPosition.clone();
  24179. let splitNodesMoveSource = b.targetPosition._getTransformedByMergeOperation( b );
  24180. if ( a.howMany > 1 ) {
  24181. results.push( new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( a.sourcePosition, a.howMany - 1, a.targetPosition, 0 ) );
  24182. gyMoveSource = gyMoveSource._getTransformedByMove( a.sourcePosition, a.targetPosition, a.howMany - 1 );
  24183. splitNodesMoveSource = splitNodesMoveSource._getTransformedByMove( a.sourcePosition, a.targetPosition, a.howMany - 1 );
  24184. }
  24185. const gyMoveTarget = b.deletionPosition._getCombined( a.sourcePosition, a.targetPosition );
  24186. const gyMove = new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( gyMoveSource, 1, gyMoveTarget, 0 );
  24187. const splitNodesMoveTargetPath = gyMove.getMovedRangeStart().path.slice();
  24188. splitNodesMoveTargetPath.push( 0 );
  24189. const splitNodesMoveTarget = new _position__WEBPACK_IMPORTED_MODULE_10__["default"]( gyMove.targetPosition.root, splitNodesMoveTargetPath );
  24190. splitNodesMoveSource = splitNodesMoveSource._getTransformedByMove( gyMoveSource, gyMoveTarget, 1 );
  24191. const splitNodesMove = new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( splitNodesMoveSource, b.howMany, splitNodesMoveTarget, 0 );
  24192. results.push( gyMove );
  24193. results.push( splitNodesMove );
  24194. return results;
  24195. }
  24196. } else {
  24197. // Case 2:
  24198. //
  24199. // The element to move got merged and it was the only element to move.
  24200. // In this case just don't do anything, leave the node in the graveyard. Without special case
  24201. // it would be a move operation that moves 0 nodes, so maybe it is better just to return no-op.
  24202. //
  24203. if ( a.howMany == 1 ) {
  24204. if ( !context.bWasUndone ) {
  24205. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
  24206. } else {
  24207. a.sourcePosition = b.graveyardPosition.clone();
  24208. a.targetPosition = a.targetPosition._getTransformedByMergeOperation( b );
  24209. return [ a ];
  24210. }
  24211. }
  24212. }
  24213. }
  24214. // The default case.
  24215. //
  24216. const moveRange = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( a.sourcePosition, a.howMany );
  24217. const transformed = moveRange._getTransformedByMergeOperation( b );
  24218. a.sourcePosition = transformed.start;
  24219. a.howMany = transformed.end.offset - transformed.start.offset;
  24220. a.targetPosition = a.targetPosition._getTransformedByMergeOperation( b );
  24221. return [ a ];
  24222. } );
  24223. // -----------------------
  24224. setTransformation( _renameoperation__WEBPACK_IMPORTED_MODULE_2__["default"], _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], ( a, b ) => {
  24225. a.position = a.position._getTransformedByInsertOperation( b );
  24226. return [ a ];
  24227. } );
  24228. setTransformation( _renameoperation__WEBPACK_IMPORTED_MODULE_2__["default"], _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], ( a, b ) => {
  24229. // Case 1:
  24230. //
  24231. // Element to rename got merged, so it was moved to `b.graveyardPosition`.
  24232. //
  24233. if ( a.position.isEqual( b.deletionPosition ) ) {
  24234. a.position = b.graveyardPosition.clone();
  24235. a.position.stickiness = 'toNext';
  24236. return [ a ];
  24237. }
  24238. a.position = a.position._getTransformedByMergeOperation( b );
  24239. return [ a ];
  24240. } );
  24241. setTransformation( _renameoperation__WEBPACK_IMPORTED_MODULE_2__["default"], _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], ( a, b ) => {
  24242. a.position = a.position._getTransformedByMoveOperation( b );
  24243. return [ a ];
  24244. } );
  24245. setTransformation( _renameoperation__WEBPACK_IMPORTED_MODULE_2__["default"], _renameoperation__WEBPACK_IMPORTED_MODULE_2__["default"], ( a, b, context ) => {
  24246. if ( a.position.isEqual( b.position ) ) {
  24247. if ( context.aIsStrong ) {
  24248. a.oldName = b.newName;
  24249. } else {
  24250. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
  24251. }
  24252. }
  24253. return [ a ];
  24254. } );
  24255. setTransformation( _renameoperation__WEBPACK_IMPORTED_MODULE_2__["default"], _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], ( a, b ) => {
  24256. // Case 1:
  24257. //
  24258. // The element to rename has been split. In this case, the new element should be also renamed.
  24259. //
  24260. // User decides to change the paragraph to a list item:
  24261. // <paragraph>Foobar</paragraph>
  24262. //
  24263. // However, in meantime, split happens:
  24264. // <paragraph>Foo</paragraph><paragraph>bar</paragraph>
  24265. //
  24266. // As a result, rename both elements:
  24267. // <listItem>Foo</listItem><listItem>bar</listItem>
  24268. //
  24269. const renamePath = a.position.path;
  24270. const splitPath = b.splitPosition.getParentPath();
  24271. if ( Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_11__["default"])( renamePath, splitPath ) == 'same' && !b.graveyardPosition ) {
  24272. const extraRename = new _renameoperation__WEBPACK_IMPORTED_MODULE_2__["default"]( a.position.getShiftedBy( 1 ), a.oldName, a.newName, 0 );
  24273. return [ a, extraRename ];
  24274. }
  24275. // The default case.
  24276. //
  24277. a.position = a.position._getTransformedBySplitOperation( b );
  24278. return [ a ];
  24279. } );
  24280. // -----------------------
  24281. setTransformation( _rootattributeoperation__WEBPACK_IMPORTED_MODULE_5__["default"], _rootattributeoperation__WEBPACK_IMPORTED_MODULE_5__["default"], ( a, b, context ) => {
  24282. if ( a.root === b.root && a.key === b.key ) {
  24283. if ( !context.aIsStrong || a.newValue === b.newValue ) {
  24284. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
  24285. } else {
  24286. a.oldValue = b.newValue;
  24287. }
  24288. }
  24289. return [ a ];
  24290. } );
  24291. // -----------------------
  24292. setTransformation( _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], _insertoperation__WEBPACK_IMPORTED_MODULE_0__["default"], ( a, b ) => {
  24293. // The default case.
  24294. //
  24295. if ( a.splitPosition.hasSameParentAs( b.position ) && a.splitPosition.offset < b.position.offset ) {
  24296. a.howMany += b.howMany;
  24297. }
  24298. a.splitPosition = a.splitPosition._getTransformedByInsertOperation( b );
  24299. a.insertionPosition = _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"].getInsertionPosition( a.splitPosition );
  24300. return [ a ];
  24301. } );
  24302. setTransformation( _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], _mergeoperation__WEBPACK_IMPORTED_MODULE_6__["default"], ( a, b, context ) => {
  24303. // Case 1:
  24304. //
  24305. // Split element got merged. If two different elements were merged, clients will have different content.
  24306. //
  24307. // Example. Merge at `{}`, split at `[]`:
  24308. // <heading>Foo</heading>{}<paragraph>B[]ar</paragraph>
  24309. //
  24310. // On merge side it will look like this:
  24311. // <heading>FooB[]ar</heading>
  24312. // <heading>FooB</heading><heading>ar</heading>
  24313. //
  24314. // On split side it will look like this:
  24315. // <heading>Foo</heading>{}<paragraph>B</paragraph><paragraph>ar</paragraph>
  24316. // <heading>FooB</heading><paragraph>ar</paragraph>
  24317. //
  24318. // Clearly, the second element is different for both clients.
  24319. //
  24320. // We could use the removed merge element from graveyard as a split element but then clients would have a different
  24321. // model state (in graveyard), because the split side client would still have an element in graveyard (removed by merge).
  24322. //
  24323. // To overcome this, in `SplitOperation` x `MergeOperation` transformation we will add additional `SplitOperation`
  24324. // in the graveyard, which will actually clone the merged-and-deleted element. Then, that cloned element will be
  24325. // used for splitting. Example below.
  24326. //
  24327. // Original state:
  24328. // <heading>Foo</heading>{}<paragraph>B[]ar</paragraph>
  24329. //
  24330. // Merge side client:
  24331. //
  24332. // After merge:
  24333. // <heading>FooB[]ar</heading> graveyard: <paragraph></paragraph>
  24334. //
  24335. // Extra split:
  24336. // <heading>FooB[]ar</heading> graveyard: <paragraph></paragraph><paragraph></paragraph>
  24337. //
  24338. // Use the "cloned" element from graveyard:
  24339. // <heading>FooB</heading><paragraph>ar</paragraph> graveyard: <paragraph></paragraph>
  24340. //
  24341. // Split side client:
  24342. //
  24343. // After split:
  24344. // <heading>Foo</heading>{}<paragraph>B</paragraph><paragraph>ar</paragraph>
  24345. //
  24346. // After merge:
  24347. // <heading>FooB</heading><paragraph>ar</paragraph> graveyard: <paragraph></paragraph>
  24348. //
  24349. // This special case scenario only applies if the original split operation clones the split element.
  24350. // If the original split operation has `graveyardPosition` set, it all doesn't have sense because split operation
  24351. // knows exactly which element it should use. So there would be no original problem with different contents.
  24352. //
  24353. // Additionally, the special case applies only if the merge wasn't already undone.
  24354. //
  24355. if ( !a.graveyardPosition && !context.bWasUndone && a.splitPosition.hasSameParentAs( b.sourcePosition ) ) {
  24356. const splitPath = b.graveyardPosition.path.slice();
  24357. splitPath.push( 0 );
  24358. const splitPosition = new _position__WEBPACK_IMPORTED_MODULE_10__["default"]( b.graveyardPosition.root, splitPath );
  24359. const insertionPosition = _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"].getInsertionPosition( new _position__WEBPACK_IMPORTED_MODULE_10__["default"]( b.graveyardPosition.root, splitPath ) );
  24360. const additionalSplit = new _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"]( splitPosition, 0, null, 0 );
  24361. additionalSplit.insertionPosition = insertionPosition;
  24362. a.splitPosition = a.splitPosition._getTransformedByMergeOperation( b );
  24363. a.insertionPosition = _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"].getInsertionPosition( a.splitPosition );
  24364. a.graveyardPosition = additionalSplit.insertionPosition.clone();
  24365. a.graveyardPosition.stickiness = 'toNext';
  24366. return [ additionalSplit, a ];
  24367. }
  24368. // The default case.
  24369. //
  24370. if ( a.splitPosition.hasSameParentAs( b.deletionPosition ) && !a.splitPosition.isAfter( b.deletionPosition ) ) {
  24371. a.howMany--;
  24372. }
  24373. if ( a.splitPosition.hasSameParentAs( b.targetPosition ) ) {
  24374. a.howMany += b.howMany;
  24375. }
  24376. a.splitPosition = a.splitPosition._getTransformedByMergeOperation( b );
  24377. a.insertionPosition = _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"].getInsertionPosition( a.splitPosition );
  24378. if ( a.graveyardPosition ) {
  24379. a.graveyardPosition = a.graveyardPosition._getTransformedByMergeOperation( b );
  24380. }
  24381. return [ a ];
  24382. } );
  24383. setTransformation( _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"], ( a, b, context ) => {
  24384. const rangeToMove = _range__WEBPACK_IMPORTED_MODULE_9__["default"]._createFromPositionAndShift( b.sourcePosition, b.howMany );
  24385. if ( a.graveyardPosition ) {
  24386. // Case 1:
  24387. //
  24388. // Split operation graveyard node was moved. In this case move operation is stronger. Since graveyard element
  24389. // is already moved to the correct position, we need to only move the nodes after the split position.
  24390. // This will be done by `MoveOperation` instead of `SplitOperation`.
  24391. //
  24392. const gyElementMoved = rangeToMove.start.isEqual( a.graveyardPosition ) || rangeToMove.containsPosition( a.graveyardPosition );
  24393. if ( !context.bWasUndone && gyElementMoved ) {
  24394. const sourcePosition = a.splitPosition._getTransformedByMoveOperation( b );
  24395. const newParentPosition = a.graveyardPosition._getTransformedByMoveOperation( b );
  24396. const newTargetPath = newParentPosition.path.slice();
  24397. newTargetPath.push( 0 );
  24398. const newTargetPosition = new _position__WEBPACK_IMPORTED_MODULE_10__["default"]( newParentPosition.root, newTargetPath );
  24399. const moveOp = new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( sourcePosition, a.howMany, newTargetPosition, 0 );
  24400. return [ moveOp ];
  24401. }
  24402. a.graveyardPosition = a.graveyardPosition._getTransformedByMoveOperation( b );
  24403. }
  24404. // Case 2:
  24405. //
  24406. // If the split position is inside the moved range, we need to shift the split position to a proper place.
  24407. // The position cannot be moved together with moved range because that would result in splitting of an incorrect element.
  24408. //
  24409. // Characters `bc` should be moved to the second paragraph while split position is between them:
  24410. // <paragraph>A[b|c]d</paragraph><paragraph>Xyz</paragraph>
  24411. //
  24412. // After move, new split position is incorrect:
  24413. // <paragraph>Ad</paragraph><paragraph>Xb|cyz</paragraph>
  24414. //
  24415. // Correct split position:
  24416. // <paragraph>A|d</paragraph><paragraph>Xbcyz</paragraph>
  24417. //
  24418. // After split:
  24419. // <paragraph>A</paragraph><paragraph>d</paragraph><paragraph>Xbcyz</paragraph>
  24420. //
  24421. if ( a.splitPosition.hasSameParentAs( b.sourcePosition ) && rangeToMove.containsPosition( a.splitPosition ) ) {
  24422. const howManyRemoved = b.howMany - ( a.splitPosition.offset - b.sourcePosition.offset );
  24423. a.howMany -= howManyRemoved;
  24424. if ( a.splitPosition.hasSameParentAs( b.targetPosition ) && a.splitPosition.offset < b.targetPosition.offset ) {
  24425. a.howMany += b.howMany;
  24426. }
  24427. a.splitPosition = b.sourcePosition.clone();
  24428. a.insertionPosition = _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"].getInsertionPosition( a.splitPosition );
  24429. return [ a ];
  24430. }
  24431. // Case 3:
  24432. //
  24433. // Split is at a position where nodes were moved.
  24434. //
  24435. // This is a scenario described in `MoveOperation` x `SplitOperation` transformation but from the
  24436. // "split operation point of view".
  24437. //
  24438. const splitAtTarget = a.splitPosition.isEqual( b.targetPosition );
  24439. if ( splitAtTarget && ( context.baRelation == 'insertAtSource' || context.abRelation == 'splitBefore' ) ) {
  24440. a.howMany += b.howMany;
  24441. a.splitPosition = a.splitPosition._getTransformedByDeletion( b.sourcePosition, b.howMany );
  24442. a.insertionPosition = _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"].getInsertionPosition( a.splitPosition );
  24443. return [ a ];
  24444. }
  24445. // The default case.
  24446. // Don't change `howMany` if move operation does not really move anything.
  24447. //
  24448. if ( !b.sourcePosition.isEqual( b.targetPosition ) ) {
  24449. if ( a.splitPosition.hasSameParentAs( b.sourcePosition ) && a.splitPosition.offset <= b.sourcePosition.offset ) {
  24450. a.howMany -= b.howMany;
  24451. }
  24452. if ( a.splitPosition.hasSameParentAs( b.targetPosition ) && a.splitPosition.offset < b.targetPosition.offset ) {
  24453. a.howMany += b.howMany;
  24454. }
  24455. }
  24456. // Change position stickiness to force a correct transformation.
  24457. a.splitPosition.stickiness = 'toNone';
  24458. a.splitPosition = a.splitPosition._getTransformedByMoveOperation( b );
  24459. a.splitPosition.stickiness = 'toNext';
  24460. if ( a.graveyardPosition ) {
  24461. a.insertionPosition = a.insertionPosition._getTransformedByMoveOperation( b );
  24462. } else {
  24463. a.insertionPosition = _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"].getInsertionPosition( a.splitPosition );
  24464. }
  24465. return [ a ];
  24466. } );
  24467. setTransformation( _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"], ( a, b, context ) => {
  24468. // Case 1:
  24469. //
  24470. // Split at the same position.
  24471. //
  24472. // If there already was a split at the same position as in `a` operation, it means that the intention
  24473. // conveyed by `a` operation has already been fulfilled and `a` should not do anything (to avoid double split).
  24474. //
  24475. // However, there is a difference if these are new splits or splits created by undo. These have different
  24476. // intentions. Also splits moving back different elements from graveyard have different intentions. They
  24477. // are just different operations.
  24478. //
  24479. // So we cancel split operation only if it was really identical.
  24480. //
  24481. // Also, there is additional case, where split operations aren't identical and should not be cancelled, however the
  24482. // default transformation is incorrect too.
  24483. //
  24484. if ( a.splitPosition.isEqual( b.splitPosition ) ) {
  24485. if ( !a.graveyardPosition && !b.graveyardPosition ) {
  24486. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
  24487. }
  24488. if ( a.graveyardPosition && b.graveyardPosition && a.graveyardPosition.isEqual( b.graveyardPosition ) ) {
  24489. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
  24490. }
  24491. // Use context to know that the `a.splitPosition` should stay where it is.
  24492. // This happens during undo when first a merge operation moved nodes to `a.splitPosition` and now `b` operation undoes that merge.
  24493. if ( context.abRelation == 'splitBefore' ) {
  24494. // Since split is at the same position, there are no nodes left to split.
  24495. a.howMany = 0;
  24496. // Note: there was `if ( a.graveyardPosition )` here but it was uncovered in tests and I couldn't find any scenarios for now.
  24497. // That would have to be a `SplitOperation` that didn't come from undo but is transformed by operations that were undone.
  24498. // It could happen if `context` is enabled in collaboration.
  24499. a.graveyardPosition = a.graveyardPosition._getTransformedBySplitOperation( b );
  24500. return [ a ];
  24501. }
  24502. }
  24503. // Case 2:
  24504. //
  24505. // Same node is using to split different elements. This happens in undo when previously same element was merged to
  24506. // two different elements. This is described in `MergeOperation` x `MergeOperation` transformation.
  24507. //
  24508. // In this case we will follow the same logic. We will assume that `insertionPosition` is same for both
  24509. // split operations. This might not always be true but in the real cases that were experienced it was. After all,
  24510. // if these splits are reverses of merge operations that were merging the same element, then the `insertionPosition`
  24511. // should be same for both of those splits.
  24512. //
  24513. // Again, we will decide which operation is stronger by checking if split happens in graveyard or in non-graveyard root.
  24514. //
  24515. if ( a.graveyardPosition && b.graveyardPosition && a.graveyardPosition.isEqual( b.graveyardPosition ) ) {
  24516. const aInGraveyard = a.splitPosition.root.rootName == '$graveyard';
  24517. const bInGraveyard = b.splitPosition.root.rootName == '$graveyard';
  24518. // If `aIsWeak` it means that `a` points to graveyard while `b` doesn't. Don't move nodes then.
  24519. const aIsWeak = aInGraveyard && !bInGraveyard;
  24520. // If `bIsWeak` it means that `b` points to graveyard while `a` doesn't. Force moving nodes then.
  24521. const bIsWeak = bInGraveyard && !aInGraveyard;
  24522. // Force move if `b` is weak or neither operation is weak but `a` is stronger through `context.aIsStrong`.
  24523. const forceMove = bIsWeak || ( !aIsWeak && context.aIsStrong );
  24524. if ( forceMove ) {
  24525. const result = [];
  24526. // First we need to move any nodes split by `b` back to where they were.
  24527. // Do it only if `b` actually moved something.
  24528. if ( b.howMany ) {
  24529. result.push( new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( b.moveTargetPosition, b.howMany, b.splitPosition, 0 ) );
  24530. }
  24531. // Then we need to move nodes from `a` split position to their new element.
  24532. // Do it only if `a` actually should move something.
  24533. if ( a.howMany ) {
  24534. result.push( new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( a.splitPosition, a.howMany, a.moveTargetPosition, 0 ) );
  24535. }
  24536. return result;
  24537. } else {
  24538. return [ new _nooperation__WEBPACK_IMPORTED_MODULE_8__["default"]( 0 ) ];
  24539. }
  24540. }
  24541. if ( a.graveyardPosition ) {
  24542. a.graveyardPosition = a.graveyardPosition._getTransformedBySplitOperation( b );
  24543. }
  24544. // Case 3:
  24545. //
  24546. // Position where operation `b` inserted a new node after split is the same as the operation `a` split position.
  24547. // As in similar cases, there is ambiguity if the split should be before the new node (created by `b`) or after.
  24548. //
  24549. if ( a.splitPosition.isEqual( b.insertionPosition ) && context.abRelation == 'splitBefore' ) {
  24550. a.howMany++;
  24551. return [ a ];
  24552. }
  24553. // Case 4:
  24554. //
  24555. // This is a mirror to the case 2. above.
  24556. //
  24557. if ( b.splitPosition.isEqual( a.insertionPosition ) && context.baRelation == 'splitBefore' ) {
  24558. const newPositionPath = b.insertionPosition.path.slice();
  24559. newPositionPath.push( 0 );
  24560. const newPosition = new _position__WEBPACK_IMPORTED_MODULE_10__["default"]( b.insertionPosition.root, newPositionPath );
  24561. const moveOp = new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( a.insertionPosition, 1, newPosition, 0 );
  24562. return [ a, moveOp ];
  24563. }
  24564. // The default case.
  24565. //
  24566. if ( a.splitPosition.hasSameParentAs( b.splitPosition ) && a.splitPosition.offset < b.splitPosition.offset ) {
  24567. a.howMany -= b.howMany;
  24568. }
  24569. a.splitPosition = a.splitPosition._getTransformedBySplitOperation( b );
  24570. a.insertionPosition = _splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"].getInsertionPosition( a.splitPosition );
  24571. return [ a ];
  24572. } );
  24573. // Checks whether `MoveOperation` `targetPosition` is inside a node from the moved range of the other `MoveOperation`.
  24574. //
  24575. // @private
  24576. // @param {module:engine/model/operation/moveoperation~MoveOperation} a
  24577. // @param {module:engine/model/operation/moveoperation~MoveOperation} b
  24578. // @returns {Boolean}
  24579. function _moveTargetIntoMovedRange( a, b ) {
  24580. return a.targetPosition._getTransformedByDeletion( b.sourcePosition, b.howMany ) === null;
  24581. }
  24582. // Helper function for `MoveOperation` x `MoveOperation` transformation. Converts given ranges and target position to
  24583. // move operations and returns them.
  24584. //
  24585. // Ranges and target position will be transformed on-the-fly when generating operations.
  24586. //
  24587. // Given `ranges` should be in the order of how they were in the original transformed operation.
  24588. //
  24589. // Given `targetPosition` is the target position of the first range from `ranges`.
  24590. //
  24591. // @private
  24592. // @param {Array.<module:engine/model/range~Range>} ranges
  24593. // @param {module:engine/model/position~Position} targetPosition
  24594. // @returns {Array.<module:engine/model/operation/moveoperation~MoveOperation>}
  24595. function _makeMoveOperationsFromRanges( ranges, targetPosition ) {
  24596. // At this moment we have some ranges and a target position, to which those ranges should be moved.
  24597. // Order in `ranges` array is the go-to order of after transformation.
  24598. //
  24599. // We are almost done. We have `ranges` and `targetPosition` to make operations from.
  24600. // Unfortunately, those operations may affect each other. Precisely, first operation after move
  24601. // may affect source range and target position of second and third operation. Same with second
  24602. // operation affecting third.
  24603. //
  24604. // We need to fix those source ranges and target positions once again, before converting `ranges` to operations.
  24605. const operations = [];
  24606. // Keep in mind that nothing will be transformed if there is just one range in `ranges`.
  24607. for ( let i = 0; i < ranges.length; i++ ) {
  24608. // Create new operation out of a range and target position.
  24609. const range = ranges[ i ];
  24610. const op = new _moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"](
  24611. range.start,
  24612. range.end.offset - range.start.offset,
  24613. targetPosition,
  24614. 0
  24615. );
  24616. operations.push( op );
  24617. // Transform other ranges by the generated operation.
  24618. for ( let j = i + 1; j < ranges.length; j++ ) {
  24619. // All ranges in `ranges` array should be:
  24620. //
  24621. // * non-intersecting (these are part of original operation source range), and
  24622. // * `targetPosition` does not target into them (opposite would mean that transformed operation targets "inside itself").
  24623. //
  24624. // This means that the transformation will be "clean" and always return one result.
  24625. ranges[ j ] = ranges[ j ]._getTransformedByMove( op.sourcePosition, op.targetPosition, op.howMany )[ 0 ];
  24626. }
  24627. targetPosition = targetPosition._getTransformedByMove( op.sourcePosition, op.targetPosition, op.howMany );
  24628. }
  24629. return operations;
  24630. }
  24631. /***/ }),
  24632. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.js":
  24633. /*!******************************************************************************!*\
  24634. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.js ***!
  24635. \******************************************************************************/
  24636. /*! exports provided: _insert, _remove, _move, _setAttribute, _normalizeNodes */
  24637. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  24638. "use strict";
  24639. __webpack_require__.r(__webpack_exports__);
  24640. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_insert", function() { return _insert; });
  24641. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_remove", function() { return _remove; });
  24642. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_move", function() { return _move; });
  24643. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_setAttribute", function() { return _setAttribute; });
  24644. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_normalizeNodes", function() { return _normalizeNodes; });
  24645. /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/node.js");
  24646. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../text */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js");
  24647. /* harmony import */ var _textproxy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.js");
  24648. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  24649. /* harmony import */ var _documentfragment__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../documentfragment */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentfragment.js");
  24650. /* harmony import */ var _nodelist__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../nodelist */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/nodelist.js");
  24651. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  24652. /**
  24653. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  24654. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  24655. */
  24656. /**
  24657. * @module engine/model/operation/utils
  24658. */
  24659. /**
  24660. * Contains functions used for composing model tree by {@link module:engine/model/operation/operation~Operation operations}.
  24661. * Those functions are built on top of {@link module:engine/model/node~Node node}, and it's child classes', APIs.
  24662. *
  24663. * @protected
  24664. * @namespace utils
  24665. */
  24666. /**
  24667. * Inserts given nodes at given position.
  24668. *
  24669. * @protected
  24670. * @function module:engine/model/operation/utils~utils.insert
  24671. * @param {module:engine/model/position~Position} position Position at which nodes should be inserted.
  24672. * @param {module:engine/model/node~NodeSet} nodes Nodes to insert.
  24673. * @returns {module:engine/model/range~Range} Range spanning over inserted elements.
  24674. */
  24675. function _insert( position, nodes ) {
  24676. nodes = _normalizeNodes( nodes );
  24677. // We have to count offset before inserting nodes because they can get merged and we would get wrong offsets.
  24678. const offset = nodes.reduce( ( sum, node ) => sum + node.offsetSize, 0 );
  24679. const parent = position.parent;
  24680. // Insertion might be in a text node, we should split it if that's the case.
  24681. _splitNodeAtPosition( position );
  24682. const index = position.index;
  24683. // Insert nodes at given index. After splitting we have a proper index and insertion is between nodes,
  24684. // using basic `Element` API.
  24685. parent._insertChild( index, nodes );
  24686. // Merge text nodes, if possible. Merging is needed only at points where inserted nodes "touch" "old" nodes.
  24687. _mergeNodesAtIndex( parent, index + nodes.length );
  24688. _mergeNodesAtIndex( parent, index );
  24689. return new _range__WEBPACK_IMPORTED_MODULE_3__["default"]( position, position.getShiftedBy( offset ) );
  24690. }
  24691. /**
  24692. * Removed nodes in given range. Only {@link module:engine/model/range~Range#isFlat flat} ranges are accepted.
  24693. *
  24694. * @protected
  24695. * @function module:engine/model/operation/utils~utils._remove
  24696. * @param {module:engine/model/range~Range} range Range containing nodes to remove.
  24697. * @returns {Array.<module:engine/model/node~Node>}
  24698. */
  24699. function _remove( range ) {
  24700. if ( !range.isFlat ) {
  24701. /**
  24702. * Trying to remove a range which starts and ends in different element.
  24703. *
  24704. * @error operation-utils-remove-range-not-flat
  24705. */
  24706. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__["default"](
  24707. 'operation-utils-remove-range-not-flat',
  24708. this
  24709. );
  24710. }
  24711. const parent = range.start.parent;
  24712. // Range may be inside text nodes, we have to split them if that's the case.
  24713. _splitNodeAtPosition( range.start );
  24714. _splitNodeAtPosition( range.end );
  24715. // Remove the text nodes using basic `Element` API.
  24716. const removed = parent._removeChildren( range.start.index, range.end.index - range.start.index );
  24717. // Merge text nodes, if possible. After some nodes were removed, node before and after removed range will be
  24718. // touching at the position equal to the removed range beginning. We check merging possibility there.
  24719. _mergeNodesAtIndex( parent, range.start.index );
  24720. return removed;
  24721. }
  24722. /**
  24723. * Moves nodes in given range to given target position. Only {@link module:engine/model/range~Range#isFlat flat} ranges are accepted.
  24724. *
  24725. * @protected
  24726. * @function module:engine/model/operation/utils~utils.move
  24727. * @param {module:engine/model/range~Range} sourceRange Range containing nodes to move.
  24728. * @param {module:engine/model/position~Position} targetPosition Position to which nodes should be moved.
  24729. * @returns {module:engine/model/range~Range} Range containing moved nodes.
  24730. */
  24731. function _move( sourceRange, targetPosition ) {
  24732. if ( !sourceRange.isFlat ) {
  24733. /**
  24734. * Trying to move a range which starts and ends in different element.
  24735. *
  24736. * @error operation-utils-move-range-not-flat
  24737. */
  24738. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__["default"](
  24739. 'operation-utils-move-range-not-flat',
  24740. this
  24741. );
  24742. }
  24743. const nodes = _remove( sourceRange );
  24744. // We have to fix `targetPosition` because model changed after nodes from `sourceRange` got removed and
  24745. // that change might have an impact on `targetPosition`.
  24746. targetPosition = targetPosition._getTransformedByDeletion( sourceRange.start, sourceRange.end.offset - sourceRange.start.offset );
  24747. return _insert( targetPosition, nodes );
  24748. }
  24749. /**
  24750. * Sets given attribute on nodes in given range. The attributes are only set on top-level nodes of the range, not on its children.
  24751. *
  24752. * @protected
  24753. * @function module:engine/model/operation/utils~utils._setAttribute
  24754. * @param {module:engine/model/range~Range} range Range containing nodes that should have the attribute set. Must be a flat range.
  24755. * @param {String} key Key of attribute to set.
  24756. * @param {*} value Attribute value.
  24757. */
  24758. function _setAttribute( range, key, value ) {
  24759. // Range might start or end in text nodes, so we have to split them.
  24760. _splitNodeAtPosition( range.start );
  24761. _splitNodeAtPosition( range.end );
  24762. // Iterate over all items in the range.
  24763. for ( const item of range.getItems( { shallow: true } ) ) {
  24764. // Iterator will return `TextProxy` instances but we know that those text proxies will
  24765. // always represent full text nodes (this is guaranteed thanks to splitting we did before).
  24766. // So, we can operate on those text proxies' text nodes.
  24767. const node = item.is( '$textProxy' ) ? item.textNode : item;
  24768. if ( value !== null ) {
  24769. node._setAttribute( key, value );
  24770. } else {
  24771. node._removeAttribute( key );
  24772. }
  24773. // After attributes changing it may happen that some text nodes can be merged. Try to merge with previous node.
  24774. _mergeNodesAtIndex( node.parent, node.index );
  24775. }
  24776. // Try to merge last changed node with it's previous sibling (not covered by the loop above).
  24777. _mergeNodesAtIndex( range.end.parent, range.end.index );
  24778. }
  24779. /**
  24780. * Normalizes given object or an array of objects to an array of {@link module:engine/model/node~Node nodes}. See
  24781. * {@link module:engine/model/node~NodeSet NodeSet} for details on how normalization is performed.
  24782. *
  24783. * @protected
  24784. * @function module:engine/model/operation/utils~utils.normalizeNodes
  24785. * @param {module:engine/model/node~NodeSet} nodes Objects to normalize.
  24786. * @returns {Array.<module:engine/model/node~Node>} Normalized nodes.
  24787. */
  24788. function _normalizeNodes( nodes ) {
  24789. const normalized = [];
  24790. if ( !( nodes instanceof Array ) ) {
  24791. nodes = [ nodes ];
  24792. }
  24793. // Convert instances of classes other than Node.
  24794. for ( let i = 0; i < nodes.length; i++ ) {
  24795. if ( typeof nodes[ i ] == 'string' ) {
  24796. normalized.push( new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( nodes[ i ] ) );
  24797. } else if ( nodes[ i ] instanceof _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
  24798. normalized.push( new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( nodes[ i ].data, nodes[ i ].getAttributes() ) );
  24799. } else if ( nodes[ i ] instanceof _documentfragment__WEBPACK_IMPORTED_MODULE_4__["default"] || nodes[ i ] instanceof _nodelist__WEBPACK_IMPORTED_MODULE_5__["default"] ) {
  24800. for ( const child of nodes[ i ] ) {
  24801. normalized.push( child );
  24802. }
  24803. } else if ( nodes[ i ] instanceof _node__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  24804. normalized.push( nodes[ i ] );
  24805. }
  24806. // Skip unrecognized type.
  24807. }
  24808. // Merge text nodes.
  24809. for ( let i = 1; i < normalized.length; i++ ) {
  24810. const node = normalized[ i ];
  24811. const prev = normalized[ i - 1 ];
  24812. if ( node instanceof _text__WEBPACK_IMPORTED_MODULE_1__["default"] && prev instanceof _text__WEBPACK_IMPORTED_MODULE_1__["default"] && _haveSameAttributes( node, prev ) ) {
  24813. // Doing this instead changing `prev.data` because `data` is readonly.
  24814. normalized.splice( i - 1, 2, new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( prev.data + node.data, prev.getAttributes() ) );
  24815. i--;
  24816. }
  24817. }
  24818. return normalized;
  24819. }
  24820. // Checks if nodes before and after given index in given element are {@link module:engine/model/text~Text text nodes} and
  24821. // merges them into one node if they have same attributes.
  24822. //
  24823. // Merging is done by removing two text nodes and inserting a new text node containing data from both merged text nodes.
  24824. //
  24825. // @private
  24826. // @param {module:engine/model/element~Element} element Parent element of nodes to merge.
  24827. // @param {Number} index Index between nodes to merge.
  24828. function _mergeNodesAtIndex( element, index ) {
  24829. const nodeBefore = element.getChild( index - 1 );
  24830. const nodeAfter = element.getChild( index );
  24831. // Check if both of those nodes are text objects with same attributes.
  24832. if ( nodeBefore && nodeAfter && nodeBefore.is( '$text' ) && nodeAfter.is( '$text' ) && _haveSameAttributes( nodeBefore, nodeAfter ) ) {
  24833. // Append text of text node after index to the before one.
  24834. const mergedNode = new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( nodeBefore.data + nodeAfter.data, nodeBefore.getAttributes() );
  24835. // Remove separate text nodes.
  24836. element._removeChildren( index - 1, 2 );
  24837. // Insert merged text node.
  24838. element._insertChild( index - 1, mergedNode );
  24839. }
  24840. }
  24841. // Checks if given position is in a text node, and if so, splits the text node in two text nodes, each of them
  24842. // containing a part of original text node.
  24843. //
  24844. // @private
  24845. // @param {module:engine/model/position~Position} position Position at which node should be split.
  24846. function _splitNodeAtPosition( position ) {
  24847. const textNode = position.textNode;
  24848. const element = position.parent;
  24849. if ( textNode ) {
  24850. const offsetDiff = position.offset - textNode.startOffset;
  24851. const index = textNode.index;
  24852. element._removeChildren( index, 1 );
  24853. const firstPart = new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( textNode.data.substr( 0, offsetDiff ), textNode.getAttributes() );
  24854. const secondPart = new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( textNode.data.substr( offsetDiff ), textNode.getAttributes() );
  24855. element._insertChild( index, [ firstPart, secondPart ] );
  24856. }
  24857. }
  24858. // Checks whether two given nodes have same attributes.
  24859. //
  24860. // @private
  24861. // @param {module:engine/model/node~Node} nodeA Node to check.
  24862. // @param {module:engine/model/node~Node} nodeB Node to check.
  24863. // @returns {Boolean} `true` if nodes have same attributes, `false` otherwise.
  24864. function _haveSameAttributes( nodeA, nodeB ) {
  24865. const iteratorA = nodeA.getAttributes();
  24866. const iteratorB = nodeB.getAttributes();
  24867. for ( const attr of iteratorA ) {
  24868. if ( attr[ 1 ] !== nodeB.getAttribute( attr[ 0 ] ) ) {
  24869. return false;
  24870. }
  24871. iteratorB.next();
  24872. }
  24873. return iteratorB.next().done;
  24874. }
  24875. /**
  24876. * Value that can be normalized to an array of {@link module:engine/model/node~Node nodes}.
  24877. *
  24878. * Non-arrays are normalized as follows:
  24879. * * {@link module:engine/model/node~Node Node} is left as is,
  24880. * * {@link module:engine/model/textproxy~TextProxy TextProxy} and `String` are normalized to {@link module:engine/model/text~Text Text},
  24881. * * {@link module:engine/model/nodelist~NodeList NodeList} is normalized to an array containing all nodes that are in that node list,
  24882. * * {@link module:engine/model/documentfragment~DocumentFragment DocumentFragment} is normalized to an array containing all of it's
  24883. * * children.
  24884. *
  24885. * Arrays are processed item by item like non-array values and flattened to one array. Normalization always results in
  24886. * a flat array of {@link module:engine/model/node~Node nodes}. Consecutive text nodes (or items normalized to text nodes) will be
  24887. * merged if they have same attributes.
  24888. *
  24889. * @typedef {module:engine/model/node~Node|module:engine/model/textproxy~TextProxy|String|
  24890. * module:engine/model/nodelist~NodeList|module:engine/model/documentfragment~DocumentFragment|Iterable}
  24891. * module:engine/model/node~NodeSet
  24892. */
  24893. /***/ }),
  24894. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js":
  24895. /*!***********************************************************************!*\
  24896. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js ***!
  24897. \***********************************************************************/
  24898. /*! exports provided: default, getTextNodeAtPosition, getNodeAfterPosition, getNodeBeforePosition */
  24899. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  24900. "use strict";
  24901. __webpack_require__.r(__webpack_exports__);
  24902. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Position; });
  24903. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTextNodeAtPosition", function() { return getTextNodeAtPosition; });
  24904. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNodeAfterPosition", function() { return getNodeAfterPosition; });
  24905. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNodeBeforePosition", function() { return getNodeBeforePosition; });
  24906. /* harmony import */ var _treewalker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./treewalker */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/treewalker.js");
  24907. /* harmony import */ var _ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/comparearrays */ "./node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.js");
  24908. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  24909. /* harmony import */ var _ckeditor_ckeditor5_utils_src_version__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/version */ "./node_modules/@ckeditor/ckeditor5-utils/src/version.js");
  24910. /**
  24911. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  24912. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  24913. */
  24914. /**
  24915. * @module engine/model/position
  24916. */
  24917. // To check if component is loaded more than once.
  24918. /**
  24919. * Represents a position in the model tree.
  24920. *
  24921. * A position is represented by its {@link module:engine/model/position~Position#root} and
  24922. * a {@link module:engine/model/position~Position#path} in that root.
  24923. *
  24924. * You can create position instances via its constructor or the `createPosition*()` factory methods of
  24925. * {@link module:engine/model/model~Model} and {@link module:engine/model/writer~Writer}.
  24926. *
  24927. * **Note:** Position is based on offsets, not indexes. This means that a position between two text nodes
  24928. * `foo` and `bar` has offset `3`, not `1`. See {@link module:engine/model/position~Position#path} for more information.
  24929. *
  24930. * Since a position in the model is represented by a {@link module:engine/model/position~Position#root position root} and
  24931. * {@link module:engine/model/position~Position#path position path} it is possible to create positions placed in non-existing places.
  24932. * This requirement is important for operational transformation algorithms.
  24933. *
  24934. * Also, {@link module:engine/model/operation/operation~Operation operations}
  24935. * kept in the {@link module:engine/model/document~Document#history document history}
  24936. * are storing positions (and ranges) which were correct when those operations were applied, but may not be correct
  24937. * after the document has changed.
  24938. *
  24939. * When changes are applied to the model, it may also happen that {@link module:engine/model/position~Position#parent position parent}
  24940. * will change even if position path has not changed. Keep in mind, that if a position leads to non-existing element,
  24941. * {@link module:engine/model/position~Position#parent} and some other properties and methods will throw errors.
  24942. *
  24943. * In most cases, position with wrong path is caused by an error in code, but it is sometimes needed, as described above.
  24944. */
  24945. class Position {
  24946. /**
  24947. * Creates a position.
  24948. *
  24949. * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} root Root of the position.
  24950. * @param {Array.<Number>} path Position path. See {@link module:engine/model/position~Position#path}.
  24951. * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone'] Position stickiness.
  24952. * See {@link module:engine/model/position~PositionStickiness}.
  24953. */
  24954. constructor( root, path, stickiness = 'toNone' ) {
  24955. if ( !root.is( 'element' ) && !root.is( 'documentFragment' ) ) {
  24956. /**
  24957. * Position root is invalid.
  24958. *
  24959. * Positions can only be anchored in elements or document fragments.
  24960. *
  24961. * @error model-position-root-invalid
  24962. */
  24963. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
  24964. 'model-position-root-invalid',
  24965. root
  24966. );
  24967. }
  24968. if ( !( path instanceof Array ) || path.length === 0 ) {
  24969. /**
  24970. * Position path must be an array with at least one item.
  24971. *
  24972. * @error model-position-path-incorrect-format
  24973. * @param path
  24974. */
  24975. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
  24976. 'model-position-path-incorrect-format',
  24977. root,
  24978. { path }
  24979. );
  24980. }
  24981. // Normalize the root and path when element (not root) is passed.
  24982. if ( root.is( 'rootElement' ) ) {
  24983. path = path.slice();
  24984. } else {
  24985. path = [ ...root.getPath(), ...path ];
  24986. root = root.root;
  24987. }
  24988. /**
  24989. * Root of the position path.
  24990. *
  24991. * @readonly
  24992. * @member {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment}
  24993. * module:engine/model/position~Position#root
  24994. */
  24995. this.root = root;
  24996. /**
  24997. * Position of the node in the tree. **Path contains offsets, not indexes.**
  24998. *
  24999. * Position can be placed before, after or in a {@link module:engine/model/node~Node node} if that node has
  25000. * {@link module:engine/model/node~Node#offsetSize} greater than `1`. Items in position path are
  25001. * {@link module:engine/model/node~Node#startOffset starting offsets} of position ancestors, starting from direct root children,
  25002. * down to the position offset in it's parent.
  25003. *
  25004. * ROOT
  25005. * |- P before: [ 0 ] after: [ 1 ]
  25006. * |- UL before: [ 1 ] after: [ 2 ]
  25007. * |- LI before: [ 1, 0 ] after: [ 1, 1 ]
  25008. * | |- foo before: [ 1, 0, 0 ] after: [ 1, 0, 3 ]
  25009. * |- LI before: [ 1, 1 ] after: [ 1, 2 ]
  25010. * |- bar before: [ 1, 1, 0 ] after: [ 1, 1, 3 ]
  25011. *
  25012. * `foo` and `bar` are representing {@link module:engine/model/text~Text text nodes}. Since text nodes has offset size
  25013. * greater than `1` you can place position offset between their start and end:
  25014. *
  25015. * ROOT
  25016. * |- P
  25017. * |- UL
  25018. * |- LI
  25019. * | |- f^o|o ^ has path: [ 1, 0, 1 ] | has path: [ 1, 0, 2 ]
  25020. * |- LI
  25021. * |- b^a|r ^ has path: [ 1, 1, 1 ] | has path: [ 1, 1, 2 ]
  25022. *
  25023. * @readonly
  25024. * @member {Array.<Number>} module:engine/model/position~Position#path
  25025. */
  25026. this.path = path;
  25027. /**
  25028. * Position stickiness. See {@link module:engine/model/position~PositionStickiness}.
  25029. *
  25030. * @member {module:engine/model/position~PositionStickiness} module:engine/model/position~Position#stickiness
  25031. */
  25032. this.stickiness = stickiness;
  25033. }
  25034. /**
  25035. * Offset at which this position is located in its {@link module:engine/model/position~Position#parent parent}. It is equal
  25036. * to the last item in position {@link module:engine/model/position~Position#path path}.
  25037. *
  25038. * @type {Number}
  25039. */
  25040. get offset() {
  25041. return this.path[ this.path.length - 1 ];
  25042. }
  25043. set offset( newOffset ) {
  25044. this.path[ this.path.length - 1 ] = newOffset;
  25045. }
  25046. /**
  25047. * Parent element of this position.
  25048. *
  25049. * Keep in mind that `parent` value is calculated when the property is accessed.
  25050. * If {@link module:engine/model/position~Position#path position path}
  25051. * leads to a non-existing element, `parent` property will throw error.
  25052. *
  25053. * Also it is a good idea to cache `parent` property if it is used frequently in an algorithm (i.e. in a long loop).
  25054. *
  25055. * @readonly
  25056. * @type {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment}
  25057. */
  25058. get parent() {
  25059. let parent = this.root;
  25060. for ( let i = 0; i < this.path.length - 1; i++ ) {
  25061. parent = parent.getChild( parent.offsetToIndex( this.path[ i ] ) );
  25062. if ( !parent ) {
  25063. /**
  25064. * The position's path is incorrect. This means that a position does not point to
  25065. * a correct place in the tree and hence, some of its methods and getters cannot work correctly.
  25066. *
  25067. * **Note**: Unlike DOM and view positions, in the model, the
  25068. * {@link module:engine/model/position~Position#parent position's parent} is always an element or a document fragment.
  25069. * The last offset in the {@link module:engine/model/position~Position#path position's path} is the point in this element
  25070. * where this position points.
  25071. *
  25072. * Read more about model positions and offsets in
  25073. * the {@glink framework/guides/architecture/editing-engine#indexes-and-offsets Editing engine architecture guide}.
  25074. *
  25075. * @error model-position-path-incorrect
  25076. * @param {module:engine/model/position~Position} position The incorrect position.
  25077. */
  25078. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'model-position-path-incorrect', this, { position: this } );
  25079. }
  25080. }
  25081. if ( parent.is( '$text' ) ) {
  25082. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'model-position-path-incorrect', this, { position: this } );
  25083. }
  25084. return parent;
  25085. }
  25086. /**
  25087. * Position {@link module:engine/model/position~Position#offset offset} converted to an index in position's parent node. It is
  25088. * equal to the {@link module:engine/model/node~Node#index index} of a node after this position. If position is placed
  25089. * in text node, position index is equal to the index of that text node.
  25090. *
  25091. * @readonly
  25092. * @type {Number}
  25093. */
  25094. get index() {
  25095. return this.parent.offsetToIndex( this.offset );
  25096. }
  25097. /**
  25098. * Returns {@link module:engine/model/text~Text text node} instance in which this position is placed or `null` if this
  25099. * position is not in a text node.
  25100. *
  25101. * @readonly
  25102. * @type {module:engine/model/text~Text|null}
  25103. */
  25104. get textNode() {
  25105. return getTextNodeAtPosition( this, this.parent );
  25106. }
  25107. /**
  25108. * Node directly after this position or `null` if this position is in text node.
  25109. *
  25110. * @readonly
  25111. * @type {module:engine/model/node~Node|null}
  25112. */
  25113. get nodeAfter() {
  25114. // Cache the parent and reuse for performance reasons. See #6579 and #6582.
  25115. const parent = this.parent;
  25116. return getNodeAfterPosition( this, parent, getTextNodeAtPosition( this, parent ) );
  25117. }
  25118. /**
  25119. * Node directly before this position or `null` if this position is in text node.
  25120. *
  25121. * @readonly
  25122. * @type {module:engine/model/node~Node|null}
  25123. */
  25124. get nodeBefore() {
  25125. // Cache the parent and reuse for performance reasons. See #6579 and #6582.
  25126. const parent = this.parent;
  25127. return getNodeBeforePosition( this, parent, getTextNodeAtPosition( this, parent ) );
  25128. }
  25129. /**
  25130. * Is `true` if position is at the beginning of its {@link module:engine/model/position~Position#parent parent}, `false` otherwise.
  25131. *
  25132. * @readonly
  25133. * @type {Boolean}
  25134. */
  25135. get isAtStart() {
  25136. return this.offset === 0;
  25137. }
  25138. /**
  25139. * Is `true` if position is at the end of its {@link module:engine/model/position~Position#parent parent}, `false` otherwise.
  25140. *
  25141. * @readonly
  25142. * @type {Boolean}
  25143. */
  25144. get isAtEnd() {
  25145. return this.offset == this.parent.maxOffset;
  25146. }
  25147. /**
  25148. * Checks whether this position is before or after given position.
  25149. *
  25150. * This method is safe to use it on non-existing positions (for example during operational transformation).
  25151. *
  25152. * @param {module:engine/model/position~Position} otherPosition Position to compare with.
  25153. * @returns {module:engine/model/position~PositionRelation}
  25154. */
  25155. compareWith( otherPosition ) {
  25156. if ( this.root != otherPosition.root ) {
  25157. return 'different';
  25158. }
  25159. const result = Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__["default"])( this.path, otherPosition.path );
  25160. switch ( result ) {
  25161. case 'same':
  25162. return 'same';
  25163. case 'prefix':
  25164. return 'before';
  25165. case 'extension':
  25166. return 'after';
  25167. default:
  25168. return this.path[ result ] < otherPosition.path[ result ] ? 'before' : 'after';
  25169. }
  25170. }
  25171. /**
  25172. * Gets the farthest position which matches the callback using
  25173. * {@link module:engine/model/treewalker~TreeWalker TreeWalker}.
  25174. *
  25175. * For example:
  25176. *
  25177. * getLastMatchingPosition( value => value.type == 'text' );
  25178. * // <paragraph>[]foo</paragraph> -> <paragraph>foo[]</paragraph>
  25179. *
  25180. * getLastMatchingPosition( value => value.type == 'text', { direction: 'backward' } );
  25181. * // <paragraph>foo[]</paragraph> -> <paragraph>[]foo</paragraph>
  25182. *
  25183. * getLastMatchingPosition( value => false );
  25184. * // Do not move the position.
  25185. *
  25186. * @param {Function} skip Callback function. Gets {@link module:engine/model/treewalker~TreeWalkerValue} and should
  25187. * return `true` if the value should be skipped or `false` if not.
  25188. * @param {Object} options Object with configuration options. See {@link module:engine/model/treewalker~TreeWalker}.
  25189. *
  25190. * @returns {module:engine/model/position~Position} The position after the last item which matches the `skip` callback test.
  25191. */
  25192. getLastMatchingPosition( skip, options = {} ) {
  25193. options.startPosition = this;
  25194. const treeWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( options );
  25195. treeWalker.skip( skip );
  25196. return treeWalker.position;
  25197. }
  25198. /**
  25199. * Returns a path to this position's parent. Parent path is equal to position {@link module:engine/model/position~Position#path path}
  25200. * but without the last item.
  25201. *
  25202. * This method is safe to use it on non-existing positions (for example during operational transformation).
  25203. *
  25204. * @returns {Array.<Number>} Path to the parent.
  25205. */
  25206. getParentPath() {
  25207. return this.path.slice( 0, -1 );
  25208. }
  25209. /**
  25210. * Returns ancestors array of this position, that is this position's parent and its ancestors.
  25211. *
  25212. * @returns {Array.<module:engine/model/item~Item>} Array with ancestors.
  25213. */
  25214. getAncestors() {
  25215. const parent = this.parent;
  25216. if ( parent.is( 'documentFragment' ) ) {
  25217. return [ parent ];
  25218. } else {
  25219. return parent.getAncestors( { includeSelf: true } );
  25220. }
  25221. }
  25222. /**
  25223. * Returns the parent element of the given name. Returns null if the position is not inside the desired parent.
  25224. *
  25225. * @param {String} parentName The name of the parent element to find.
  25226. * @returns {module:engine/model/element~Element|null}
  25227. */
  25228. findAncestor( parentName ) {
  25229. const parent = this.parent;
  25230. if ( parent.is( 'element' ) ) {
  25231. return parent.findAncestor( parentName, { includeSelf: true } );
  25232. }
  25233. return null;
  25234. }
  25235. /**
  25236. * Returns the slice of two position {@link #path paths} which is identical. The {@link #root roots}
  25237. * of these two paths must be identical.
  25238. *
  25239. * This method is safe to use it on non-existing positions (for example during operational transformation).
  25240. *
  25241. * @param {module:engine/model/position~Position} position The second position.
  25242. * @returns {Array.<Number>} The common path.
  25243. */
  25244. getCommonPath( position ) {
  25245. if ( this.root != position.root ) {
  25246. return [];
  25247. }
  25248. // We find on which tree-level start and end have the lowest common ancestor
  25249. const cmp = Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__["default"])( this.path, position.path );
  25250. // If comparison returned string it means that arrays are same.
  25251. const diffAt = ( typeof cmp == 'string' ) ? Math.min( this.path.length, position.path.length ) : cmp;
  25252. return this.path.slice( 0, diffAt );
  25253. }
  25254. /**
  25255. * Returns an {@link module:engine/model/element~Element} or {@link module:engine/model/documentfragment~DocumentFragment}
  25256. * which is a common ancestor of both positions. The {@link #root roots} of these two positions must be identical.
  25257. *
  25258. * @param {module:engine/model/position~Position} position The second position.
  25259. * @returns {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment|null}
  25260. */
  25261. getCommonAncestor( position ) {
  25262. const ancestorsA = this.getAncestors();
  25263. const ancestorsB = position.getAncestors();
  25264. let i = 0;
  25265. while ( ancestorsA[ i ] == ancestorsB[ i ] && ancestorsA[ i ] ) {
  25266. i++;
  25267. }
  25268. return i === 0 ? null : ancestorsA[ i - 1 ];
  25269. }
  25270. /**
  25271. * Returns a new instance of `Position`, that has same {@link #parent parent} but it's offset
  25272. * is shifted by `shift` value (can be a negative value).
  25273. *
  25274. * This method is safe to use it on non-existing positions (for example during operational transformation).
  25275. *
  25276. * @param {Number} shift Offset shift. Can be a negative value.
  25277. * @returns {module:engine/model/position~Position} Shifted position.
  25278. */
  25279. getShiftedBy( shift ) {
  25280. const shifted = this.clone();
  25281. const offset = shifted.offset + shift;
  25282. shifted.offset = offset < 0 ? 0 : offset;
  25283. return shifted;
  25284. }
  25285. /**
  25286. * Checks whether this position is after given position.
  25287. *
  25288. * This method is safe to use it on non-existing positions (for example during operational transformation).
  25289. *
  25290. * @see module:engine/model/position~Position#isBefore
  25291. * @param {module:engine/model/position~Position} otherPosition Position to compare with.
  25292. * @returns {Boolean} True if this position is after given position.
  25293. */
  25294. isAfter( otherPosition ) {
  25295. return this.compareWith( otherPosition ) == 'after';
  25296. }
  25297. /**
  25298. * Checks whether this position is before given position.
  25299. *
  25300. * **Note:** watch out when using negation of the value returned by this method, because the negation will also
  25301. * be `true` if positions are in different roots and you might not expect this. You should probably use
  25302. * `a.isAfter( b ) || a.isEqual( b )` or `!a.isBefore( p ) && a.root == b.root` in most scenarios. If your
  25303. * condition uses multiple `isAfter` and `isBefore` checks, build them so they do not use negated values, i.e.:
  25304. *
  25305. * if ( a.isBefore( b ) && c.isAfter( d ) ) {
  25306. * // do A.
  25307. * } else {
  25308. * // do B.
  25309. * }
  25310. *
  25311. * or, if you have only one if-branch:
  25312. *
  25313. * if ( !( a.isBefore( b ) && c.isAfter( d ) ) {
  25314. * // do B.
  25315. * }
  25316. *
  25317. * rather than:
  25318. *
  25319. * if ( !a.isBefore( b ) || && !c.isAfter( d ) ) {
  25320. * // do B.
  25321. * } else {
  25322. * // do A.
  25323. * }
  25324. *
  25325. * This method is safe to use it on non-existing positions (for example during operational transformation).
  25326. *
  25327. * @param {module:engine/model/position~Position} otherPosition Position to compare with.
  25328. * @returns {Boolean} True if this position is before given position.
  25329. */
  25330. isBefore( otherPosition ) {
  25331. return this.compareWith( otherPosition ) == 'before';
  25332. }
  25333. /**
  25334. * Checks whether this position is equal to given position.
  25335. *
  25336. * This method is safe to use it on non-existing positions (for example during operational transformation).
  25337. *
  25338. * @param {module:engine/model/position~Position} otherPosition Position to compare with.
  25339. * @returns {Boolean} True if positions are same.
  25340. */
  25341. isEqual( otherPosition ) {
  25342. return this.compareWith( otherPosition ) == 'same';
  25343. }
  25344. /**
  25345. * Checks whether this position is touching given position. Positions touch when there are no text nodes
  25346. * or empty nodes in a range between them. Technically, those positions are not equal but in many cases
  25347. * they are very similar or even indistinguishable.
  25348. *
  25349. * @param {module:engine/model/position~Position} otherPosition Position to compare with.
  25350. * @returns {Boolean} True if positions touch.
  25351. */
  25352. isTouching( otherPosition ) {
  25353. let left = null;
  25354. let right = null;
  25355. const compare = this.compareWith( otherPosition );
  25356. switch ( compare ) {
  25357. case 'same':
  25358. return true;
  25359. case 'before':
  25360. left = Position._createAt( this );
  25361. right = Position._createAt( otherPosition );
  25362. break;
  25363. case 'after':
  25364. left = Position._createAt( otherPosition );
  25365. right = Position._createAt( this );
  25366. break;
  25367. default:
  25368. return false;
  25369. }
  25370. // Cached for optimization purposes.
  25371. let leftParent = left.parent;
  25372. while ( left.path.length + right.path.length ) {
  25373. if ( left.isEqual( right ) ) {
  25374. return true;
  25375. }
  25376. if ( left.path.length > right.path.length ) {
  25377. if ( left.offset !== leftParent.maxOffset ) {
  25378. return false;
  25379. }
  25380. left.path = left.path.slice( 0, -1 );
  25381. leftParent = leftParent.parent;
  25382. left.offset++;
  25383. } else {
  25384. if ( right.offset !== 0 ) {
  25385. return false;
  25386. }
  25387. right.path = right.path.slice( 0, -1 );
  25388. }
  25389. }
  25390. }
  25391. /**
  25392. * Checks whether this object is of the given.
  25393. *
  25394. * position.is( 'position' ); // -> true
  25395. * position.is( 'model:position' ); // -> true
  25396. *
  25397. * position.is( 'view:position' ); // -> false
  25398. * position.is( 'documentSelection' ); // -> false
  25399. *
  25400. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  25401. *
  25402. * @param {String} type
  25403. * @returns {Boolean}
  25404. */
  25405. is( type ) {
  25406. return type === 'position' || type === 'model:position';
  25407. }
  25408. /**
  25409. * Checks if two positions are in the same parent.
  25410. *
  25411. * This method is safe to use it on non-existing positions (for example during operational transformation).
  25412. *
  25413. * @param {module:engine/model/position~Position} position Position to compare with.
  25414. * @returns {Boolean} `true` if positions have the same parent, `false` otherwise.
  25415. */
  25416. hasSameParentAs( position ) {
  25417. if ( this.root !== position.root ) {
  25418. return false;
  25419. }
  25420. const thisParentPath = this.getParentPath();
  25421. const posParentPath = position.getParentPath();
  25422. return Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__["default"])( thisParentPath, posParentPath ) == 'same';
  25423. }
  25424. /**
  25425. * Returns a copy of this position that is transformed by given `operation`.
  25426. *
  25427. * The new position's parameters are updated accordingly to the effect of the `operation`.
  25428. *
  25429. * For example, if `n` nodes are inserted before the position, the returned position {@link ~Position#offset} will be
  25430. * increased by `n`. If the position was in a merged element, it will be accordingly moved to the new element, etc.
  25431. *
  25432. * This method is safe to use it on non-existing positions (for example during operational transformation).
  25433. *
  25434. * @param {module:engine/model/operation/operation~Operation} operation Operation to transform by.
  25435. * @returns {module:engine/model/position~Position} Transformed position.
  25436. */
  25437. getTransformedByOperation( operation ) {
  25438. let result;
  25439. switch ( operation.type ) {
  25440. case 'insert':
  25441. result = this._getTransformedByInsertOperation( operation );
  25442. break;
  25443. case 'move':
  25444. case 'remove':
  25445. case 'reinsert':
  25446. result = this._getTransformedByMoveOperation( operation );
  25447. break;
  25448. case 'split':
  25449. result = this._getTransformedBySplitOperation( operation );
  25450. break;
  25451. case 'merge':
  25452. result = this._getTransformedByMergeOperation( operation );
  25453. break;
  25454. default:
  25455. result = Position._createAt( this );
  25456. break;
  25457. }
  25458. return result;
  25459. }
  25460. /**
  25461. * Returns a copy of this position transformed by an insert operation.
  25462. *
  25463. * @protected
  25464. * @param {module:engine/model/operation/insertoperation~InsertOperation} operation
  25465. * @returns {module:engine/model/position~Position}
  25466. */
  25467. _getTransformedByInsertOperation( operation ) {
  25468. return this._getTransformedByInsertion( operation.position, operation.howMany );
  25469. }
  25470. /**
  25471. * Returns a copy of this position transformed by a move operation.
  25472. *
  25473. * @protected
  25474. * @param {module:engine/model/operation/moveoperation~MoveOperation} operation
  25475. * @returns {module:engine/model/position~Position}
  25476. */
  25477. _getTransformedByMoveOperation( operation ) {
  25478. return this._getTransformedByMove( operation.sourcePosition, operation.targetPosition, operation.howMany );
  25479. }
  25480. /**
  25481. * Returns a copy of this position transformed by a split operation.
  25482. *
  25483. * @protected
  25484. * @param {module:engine/model/operation/splitoperation~SplitOperation} operation
  25485. * @returns {module:engine/model/position~Position}
  25486. */
  25487. _getTransformedBySplitOperation( operation ) {
  25488. const movedRange = operation.movedRange;
  25489. const isContained = movedRange.containsPosition( this ) ||
  25490. ( movedRange.start.isEqual( this ) && this.stickiness == 'toNext' );
  25491. if ( isContained ) {
  25492. return this._getCombined( operation.splitPosition, operation.moveTargetPosition );
  25493. } else {
  25494. if ( operation.graveyardPosition ) {
  25495. return this._getTransformedByMove( operation.graveyardPosition, operation.insertionPosition, 1 );
  25496. } else {
  25497. return this._getTransformedByInsertion( operation.insertionPosition, 1 );
  25498. }
  25499. }
  25500. }
  25501. /**
  25502. * Returns a copy of this position transformed by merge operation.
  25503. *
  25504. * @protected
  25505. * @param {module:engine/model/operation/mergeoperation~MergeOperation} operation
  25506. * @returns {module:engine/model/position~Position}
  25507. */
  25508. _getTransformedByMergeOperation( operation ) {
  25509. const movedRange = operation.movedRange;
  25510. const isContained = movedRange.containsPosition( this ) || movedRange.start.isEqual( this );
  25511. let pos;
  25512. if ( isContained ) {
  25513. pos = this._getCombined( operation.sourcePosition, operation.targetPosition );
  25514. if ( operation.sourcePosition.isBefore( operation.targetPosition ) ) {
  25515. // Above happens during OT when the merged element is moved before the merged-to element.
  25516. pos = pos._getTransformedByDeletion( operation.deletionPosition, 1 );
  25517. }
  25518. } else if ( this.isEqual( operation.deletionPosition ) ) {
  25519. pos = Position._createAt( operation.deletionPosition );
  25520. } else {
  25521. pos = this._getTransformedByMove( operation.deletionPosition, operation.graveyardPosition, 1 );
  25522. }
  25523. return pos;
  25524. }
  25525. /**
  25526. * Returns a copy of this position that is updated by removing `howMany` nodes starting from `deletePosition`.
  25527. * It may happen that this position is in a removed node. If that is the case, `null` is returned instead.
  25528. *
  25529. * @protected
  25530. * @param {module:engine/model/position~Position} deletePosition Position before the first removed node.
  25531. * @param {Number} howMany How many nodes are removed.
  25532. * @returns {module:engine/model/position~Position|null} Transformed position or `null`.
  25533. */
  25534. _getTransformedByDeletion( deletePosition, howMany ) {
  25535. const transformed = Position._createAt( this );
  25536. // This position can't be affected if deletion was in a different root.
  25537. if ( this.root != deletePosition.root ) {
  25538. return transformed;
  25539. }
  25540. if ( Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__["default"])( deletePosition.getParentPath(), this.getParentPath() ) == 'same' ) {
  25541. // If nodes are removed from the node that is pointed by this position...
  25542. if ( deletePosition.offset < this.offset ) {
  25543. // And are removed from before an offset of that position...
  25544. if ( deletePosition.offset + howMany > this.offset ) {
  25545. // Position is in removed range, it's no longer in the tree.
  25546. return null;
  25547. } else {
  25548. // Decrement the offset accordingly.
  25549. transformed.offset -= howMany;
  25550. }
  25551. }
  25552. } else if ( Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__["default"])( deletePosition.getParentPath(), this.getParentPath() ) == 'prefix' ) {
  25553. // If nodes are removed from a node that is on a path to this position...
  25554. const i = deletePosition.path.length - 1;
  25555. if ( deletePosition.offset <= this.path[ i ] ) {
  25556. // And are removed from before next node of that path...
  25557. if ( deletePosition.offset + howMany > this.path[ i ] ) {
  25558. // If the next node of that path is removed return null
  25559. // because the node containing this position got removed.
  25560. return null;
  25561. } else {
  25562. // Otherwise, decrement index on that path.
  25563. transformed.path[ i ] -= howMany;
  25564. }
  25565. }
  25566. }
  25567. return transformed;
  25568. }
  25569. /**
  25570. * Returns a copy of this position that is updated by inserting `howMany` nodes at `insertPosition`.
  25571. *
  25572. * @protected
  25573. * @param {module:engine/model/position~Position} insertPosition Position where nodes are inserted.
  25574. * @param {Number} howMany How many nodes are inserted.
  25575. * @returns {module:engine/model/position~Position} Transformed position.
  25576. */
  25577. _getTransformedByInsertion( insertPosition, howMany ) {
  25578. const transformed = Position._createAt( this );
  25579. // This position can't be affected if insertion was in a different root.
  25580. if ( this.root != insertPosition.root ) {
  25581. return transformed;
  25582. }
  25583. if ( Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__["default"])( insertPosition.getParentPath(), this.getParentPath() ) == 'same' ) {
  25584. // If nodes are inserted in the node that is pointed by this position...
  25585. if ( insertPosition.offset < this.offset || ( insertPosition.offset == this.offset && this.stickiness != 'toPrevious' ) ) {
  25586. // And are inserted before an offset of that position...
  25587. // "Push" this positions offset.
  25588. transformed.offset += howMany;
  25589. }
  25590. } else if ( Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__["default"])( insertPosition.getParentPath(), this.getParentPath() ) == 'prefix' ) {
  25591. // If nodes are inserted in a node that is on a path to this position...
  25592. const i = insertPosition.path.length - 1;
  25593. if ( insertPosition.offset <= this.path[ i ] ) {
  25594. // And are inserted before next node of that path...
  25595. // "Push" the index on that path.
  25596. transformed.path[ i ] += howMany;
  25597. }
  25598. }
  25599. return transformed;
  25600. }
  25601. /**
  25602. * Returns a copy of this position that is updated by moving `howMany` nodes from `sourcePosition` to `targetPosition`.
  25603. *
  25604. * @protected
  25605. * @param {module:engine/model/position~Position} sourcePosition Position before the first element to move.
  25606. * @param {module:engine/model/position~Position} targetPosition Position where moved elements will be inserted.
  25607. * @param {Number} howMany How many consecutive nodes to move, starting from `sourcePosition`.
  25608. * @returns {module:engine/model/position~Position} Transformed position.
  25609. */
  25610. _getTransformedByMove( sourcePosition, targetPosition, howMany ) {
  25611. // Update target position, as it could be affected by nodes removal.
  25612. targetPosition = targetPosition._getTransformedByDeletion( sourcePosition, howMany );
  25613. if ( sourcePosition.isEqual( targetPosition ) ) {
  25614. // If `targetPosition` is equal to `sourcePosition` this isn't really any move. Just return position as it is.
  25615. return Position._createAt( this );
  25616. }
  25617. // Moving a range removes nodes from their original position. We acknowledge this by proper transformation.
  25618. const transformed = this._getTransformedByDeletion( sourcePosition, howMany );
  25619. const isMoved = transformed === null ||
  25620. ( sourcePosition.isEqual( this ) && this.stickiness == 'toNext' ) ||
  25621. ( sourcePosition.getShiftedBy( howMany ).isEqual( this ) && this.stickiness == 'toPrevious' );
  25622. if ( isMoved ) {
  25623. // This position is inside moved range (or sticks to it).
  25624. // In this case, we calculate a combination of this position, move source position and target position.
  25625. return this._getCombined( sourcePosition, targetPosition );
  25626. } else {
  25627. // This position is not inside a removed range.
  25628. //
  25629. // In next step, we simply reflect inserting `howMany` nodes, which might further affect the position.
  25630. return transformed._getTransformedByInsertion( targetPosition, howMany );
  25631. }
  25632. }
  25633. /**
  25634. * Returns a new position that is a combination of this position and given positions.
  25635. *
  25636. * The combined position is a copy of this position transformed by moving a range starting at `source` position
  25637. * to the `target` position. It is expected that this position is inside the moved range.
  25638. *
  25639. * Example:
  25640. *
  25641. * let original = model.createPositionFromPath( root, [ 2, 3, 1 ] );
  25642. * let source = model.createPositionFromPath( root, [ 2, 2 ] );
  25643. * let target = model.createPositionFromPath( otherRoot, [ 1, 1, 3 ] );
  25644. * original._getCombined( source, target ); // path is [ 1, 1, 4, 1 ], root is `otherRoot`
  25645. *
  25646. * Explanation:
  25647. *
  25648. * We have a position `[ 2, 3, 1 ]` and move some nodes from `[ 2, 2 ]` to `[ 1, 1, 3 ]`. The original position
  25649. * was inside moved nodes and now should point to the new place. The moved nodes will be after
  25650. * positions `[ 1, 1, 3 ]`, `[ 1, 1, 4 ]`, `[ 1, 1, 5 ]`. Since our position was in the second moved node,
  25651. * the transformed position will be in a sub-tree of a node at `[ 1, 1, 4 ]`. Looking at original path, we
  25652. * took care of `[ 2, 3 ]` part of it. Now we have to add the rest of the original path to the transformed path.
  25653. * Finally, the transformed position will point to `[ 1, 1, 4, 1 ]`.
  25654. *
  25655. * @protected
  25656. * @param {module:engine/model/position~Position} source Beginning of the moved range.
  25657. * @param {module:engine/model/position~Position} target Position where the range is moved.
  25658. * @returns {module:engine/model/position~Position} Combined position.
  25659. */
  25660. _getCombined( source, target ) {
  25661. const i = source.path.length - 1;
  25662. // The first part of a path to combined position is a path to the place where nodes were moved.
  25663. const combined = Position._createAt( target );
  25664. combined.stickiness = this.stickiness;
  25665. // Then we have to update the rest of the path.
  25666. // Fix the offset because this position might be after `from` position and we have to reflect that.
  25667. combined.offset = combined.offset + this.path[ i ] - source.offset;
  25668. // Then, add the rest of the path.
  25669. // If this position is at the same level as `from` position nothing will get added.
  25670. combined.path = [ ...combined.path, ...this.path.slice( i + 1 ) ];
  25671. return combined;
  25672. }
  25673. /**
  25674. * @inheritDoc
  25675. */
  25676. toJSON() {
  25677. return {
  25678. root: this.root.toJSON(),
  25679. path: Array.from( this.path ),
  25680. stickiness: this.stickiness
  25681. };
  25682. }
  25683. /**
  25684. * Returns a new position that is equal to current position.
  25685. *
  25686. * @returns {module:engine/model/position~Position}
  25687. */
  25688. clone() {
  25689. return new this.constructor( this.root, this.path, this.stickiness );
  25690. }
  25691. /**
  25692. * Creates position at the given location. The location can be specified as:
  25693. *
  25694. * * a {@link module:engine/model/position~Position position},
  25695. * * parent element and offset (offset defaults to `0`),
  25696. * * parent element and `'end'` (sets position at the end of that element),
  25697. * * {@link module:engine/model/item~Item model item} and `'before'` or `'after'` (sets position before or after given model item).
  25698. *
  25699. * This method is a shortcut to other factory methods such as:
  25700. *
  25701. * * {@link module:engine/model/position~Position._createBefore},
  25702. * * {@link module:engine/model/position~Position._createAfter}.
  25703. *
  25704. * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
  25705. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when the
  25706. * first parameter is a {@link module:engine/model/item~Item model item}.
  25707. * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone'] Position stickiness. Used only when the
  25708. * first parameter is a {@link module:engine/model/item~Item model item}.
  25709. * @protected
  25710. */
  25711. static _createAt( itemOrPosition, offset, stickiness = 'toNone' ) {
  25712. if ( itemOrPosition instanceof Position ) {
  25713. return new Position( itemOrPosition.root, itemOrPosition.path, itemOrPosition.stickiness );
  25714. } else {
  25715. const node = itemOrPosition;
  25716. if ( offset == 'end' ) {
  25717. offset = node.maxOffset;
  25718. } else if ( offset == 'before' ) {
  25719. return this._createBefore( node, stickiness );
  25720. } else if ( offset == 'after' ) {
  25721. return this._createAfter( node, stickiness );
  25722. } else if ( offset !== 0 && !offset ) {
  25723. /**
  25724. * {@link module:engine/model/model~Model#createPositionAt `Model#createPositionAt()`}
  25725. * requires the offset to be specified when the first parameter is a model item.
  25726. *
  25727. * @error model-createpositionat-offset-required
  25728. */
  25729. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'model-createpositionat-offset-required', [ this, itemOrPosition ] );
  25730. }
  25731. if ( !node.is( 'element' ) && !node.is( 'documentFragment' ) ) {
  25732. /**
  25733. * Position parent have to be a model element or model document fragment.
  25734. *
  25735. * @error model-position-parent-incorrect
  25736. */
  25737. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
  25738. 'model-position-parent-incorrect',
  25739. [ this, itemOrPosition ]
  25740. );
  25741. }
  25742. const path = node.getPath();
  25743. path.push( offset );
  25744. return new this( node.root, path, stickiness );
  25745. }
  25746. }
  25747. /**
  25748. * Creates a new position, after given {@link module:engine/model/item~Item model item}.
  25749. *
  25750. * @param {module:engine/model/item~Item} item Item after which the position should be placed.
  25751. * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone'] Position stickiness.
  25752. * @returns {module:engine/model/position~Position}
  25753. * @protected
  25754. */
  25755. static _createAfter( item, stickiness ) {
  25756. if ( !item.parent ) {
  25757. /**
  25758. * You can not make a position after a root element.
  25759. *
  25760. * @error model-position-after-root
  25761. * @param {module:engine/model/item~Item} root
  25762. */
  25763. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
  25764. 'model-position-after-root',
  25765. [ this, item ],
  25766. { root: item }
  25767. );
  25768. }
  25769. return this._createAt( item.parent, item.endOffset, stickiness );
  25770. }
  25771. /**
  25772. * Creates a new position, before the given {@link module:engine/model/item~Item model item}.
  25773. *
  25774. * @param {module:engine/model/item~Item} item Item before which the position should be placed.
  25775. * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone'] Position stickiness.
  25776. * @returns {module:engine/model/position~Position}
  25777. * @protected
  25778. */
  25779. static _createBefore( item, stickiness ) {
  25780. if ( !item.parent ) {
  25781. /**
  25782. * You can not make a position before a root element.
  25783. *
  25784. * @error model-position-before-root
  25785. * @param {module:engine/model/item~Item} root
  25786. */
  25787. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
  25788. 'model-position-before-root',
  25789. item,
  25790. { root: item }
  25791. );
  25792. }
  25793. return this._createAt( item.parent, item.startOffset, stickiness );
  25794. }
  25795. /**
  25796. * Creates a `Position` instance from given plain object (i.e. parsed JSON string).
  25797. *
  25798. * @param {Object} json Plain object to be converted to `Position`.
  25799. * @param {module:engine/model/document~Document} doc Document object that will be position owner.
  25800. * @returns {module:engine/model/position~Position} `Position` instance created using given plain object.
  25801. */
  25802. static fromJSON( json, doc ) {
  25803. if ( json.root === '$graveyard' ) {
  25804. const pos = new Position( doc.graveyard, json.path );
  25805. pos.stickiness = json.stickiness;
  25806. return pos;
  25807. }
  25808. if ( !doc.getRoot( json.root ) ) {
  25809. /**
  25810. * Cannot create position for document. Root with specified name does not exist.
  25811. *
  25812. * @error model-position-fromjson-no-root
  25813. * @param {String} rootName
  25814. */
  25815. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
  25816. 'model-position-fromjson-no-root',
  25817. doc,
  25818. { rootName: json.root }
  25819. );
  25820. }
  25821. return new Position( doc.getRoot( json.root ), json.path, json.stickiness );
  25822. }
  25823. // @if CK_DEBUG_ENGINE // toString() {
  25824. // @if CK_DEBUG_ENGINE // return `${ this.root } [ ${ this.path.join( ', ' ) } ]`;
  25825. // @if CK_DEBUG_ENGINE // }
  25826. // @if CK_DEBUG_ENGINE // log() {
  25827. // @if CK_DEBUG_ENGINE // console.log( 'ModelPosition: ' + this );
  25828. // @if CK_DEBUG_ENGINE // }
  25829. }
  25830. /**
  25831. * A flag indicating whether this position is `'before'` or `'after'` or `'same'` as given position.
  25832. * If positions are in different roots `'different'` flag is returned.
  25833. *
  25834. * @typedef {String} module:engine/model/position~PositionRelation
  25835. */
  25836. /**
  25837. * Represents how position is "sticking" with neighbour nodes. Used to define how position should be transformed (moved)
  25838. * in edge cases. Possible values: `'toNone'`, `'toNext'`, `'toPrevious'`.
  25839. *
  25840. * Examples:
  25841. *
  25842. * Insert. Position is at | and nodes are inserted at the same position, marked as ^:
  25843. *
  25844. * - sticks to none: <p>f^|oo</p> -> <p>fbar|oo</p>
  25845. * - sticks to next node: <p>f^|oo</p> -> <p>fbar|oo</p>
  25846. * - sticks to previous node: <p>f|^oo</p> -> <p>f|baroo</p>
  25847. *
  25848. *
  25849. * Move. Position is at | and range [oo] is moved to position ^:
  25850. *
  25851. * - sticks to none: <p>f|[oo]</p><p>b^ar</p> -> <p>f|</p><p>booar</p>
  25852. * - sticks to none: <p>f[oo]|</p><p>b^ar</p> -> <p>f|</p><p>booar</p>
  25853. *
  25854. * - sticks to next node: <p>f|[oo]</p><p>b^ar</p> -> <p>f</p><p>b|ooar</p>
  25855. * - sticks to next node: <p>f[oo]|</p><p>b^ar</p> -> <p>f|</p><p>booar</p>
  25856. *
  25857. * - sticks to previous node: <p>f|[oo]</p><p>b^ar</p> -> <p>f|</p><p>booar</p>
  25858. * - sticks to previous node: <p>f[oo]|</p><p>b^ar</p> -> <p>f</p><p>boo|ar</p>
  25859. *
  25860. * @typedef {String} module:engine/model/position~PositionStickiness
  25861. */
  25862. /**
  25863. * Returns a text node at the given position.
  25864. *
  25865. * This is a helper function optimized to reuse the position parent instance for performance reasons.
  25866. *
  25867. * Normally, you should use {@link module:engine/model/position~Position#textNode `Position#textNode`}.
  25868. * If you start hitting performance issues with {@link module:engine/model/position~Position#parent `Position#parent`}
  25869. * check if your algorithm does not access it multiple times (which can happen directly or indirectly via other position properties).
  25870. *
  25871. * See https://github.com/ckeditor/ckeditor5/issues/6579.
  25872. *
  25873. * See also:
  25874. *
  25875. * * {@link module:engine/model/position~getNodeAfterPosition}
  25876. * * {@link module:engine/model/position~getNodeBeforePosition}
  25877. *
  25878. * @param {module:engine/model/position~Position} position
  25879. * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} positionParent The parent of the
  25880. * given position.
  25881. * @returns {module:engine/model/text~Text|null}
  25882. */
  25883. function getTextNodeAtPosition( position, positionParent ) {
  25884. const node = positionParent.getChild( positionParent.offsetToIndex( position.offset ) );
  25885. if ( node && node.is( '$text' ) && node.startOffset < position.offset ) {
  25886. return node;
  25887. }
  25888. return null;
  25889. }
  25890. /**
  25891. * Returns the node after the given position.
  25892. *
  25893. * This is a helper function optimized to reuse the position parent instance and the calculation of the text node at the
  25894. * specific position for performance reasons.
  25895. *
  25896. * Normally, you should use {@link module:engine/model/position~Position#nodeAfter `Position#nodeAfter`}.
  25897. * If you start hitting performance issues with {@link module:engine/model/position~Position#parent `Position#parent`} and/or
  25898. * {@link module:engine/model/position~Position#textNode `Position#textNode`}
  25899. * check if your algorithm does not access those properties multiple times
  25900. * (which can happen directly or indirectly via other position properties).
  25901. *
  25902. * See https://github.com/ckeditor/ckeditor5/issues/6579 and https://github.com/ckeditor/ckeditor5/issues/6582.
  25903. *
  25904. * See also:
  25905. *
  25906. * * {@link module:engine/model/position~getTextNodeAtPosition}
  25907. * * {@link module:engine/model/position~getNodeBeforePosition}
  25908. *
  25909. * @param {module:engine/model/position~Position} position
  25910. * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} positionParent The parent of the
  25911. * given position.
  25912. * @param {module:engine/model/text~Text|null} textNode Text node at the given position.
  25913. * @returns {module:engine/model/node~Node|null}
  25914. */
  25915. function getNodeAfterPosition( position, positionParent, textNode ) {
  25916. if ( textNode !== null ) {
  25917. return null;
  25918. }
  25919. return positionParent.getChild( positionParent.offsetToIndex( position.offset ) );
  25920. }
  25921. /**
  25922. * Returns the node before the given position.
  25923. *
  25924. * Refer to {@link module:engine/model/position~getNodeBeforePosition} for documentation on when to use this util method.
  25925. *
  25926. * See also:
  25927. *
  25928. * * {@link module:engine/model/position~getTextNodeAtPosition}
  25929. * * {@link module:engine/model/position~getNodeAfterPosition}
  25930. *
  25931. * @param {module:engine/model/position~Position} position
  25932. * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} positionParent The parent of the
  25933. * given position.
  25934. * @param {module:engine/model/text~Text|null} textNode Text node at the given position.
  25935. * @returns {module:engine/model/node~Node|null}
  25936. */
  25937. function getNodeBeforePosition( position, positionParent, textNode ) {
  25938. if ( textNode !== null ) {
  25939. return null;
  25940. }
  25941. return positionParent.getChild( positionParent.offsetToIndex( position.offset ) - 1 );
  25942. }
  25943. /***/ }),
  25944. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js":
  25945. /*!********************************************************************!*\
  25946. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js ***!
  25947. \********************************************************************/
  25948. /*! exports provided: default */
  25949. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  25950. "use strict";
  25951. __webpack_require__.r(__webpack_exports__);
  25952. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Range; });
  25953. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  25954. /* harmony import */ var _treewalker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./treewalker */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/treewalker.js");
  25955. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  25956. /* harmony import */ var _ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/comparearrays */ "./node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.js");
  25957. /**
  25958. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  25959. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  25960. */
  25961. /**
  25962. * @module engine/model/range
  25963. */
  25964. /**
  25965. * Represents a range in the model tree.
  25966. *
  25967. * A range is defined by its {@link module:engine/model/range~Range#start} and {@link module:engine/model/range~Range#end}
  25968. * positions.
  25969. *
  25970. * You can create range instances via its constructor or the `createRange*()` factory methods of
  25971. * {@link module:engine/model/model~Model} and {@link module:engine/model/writer~Writer}.
  25972. */
  25973. class Range {
  25974. /**
  25975. * Creates a range spanning from `start` position to `end` position.
  25976. *
  25977. * @param {module:engine/model/position~Position} start Start position.
  25978. * @param {module:engine/model/position~Position} [end] End position. If not set, range will be collapsed at `start` position.
  25979. */
  25980. constructor( start, end = null ) {
  25981. /**
  25982. * Start position.
  25983. *
  25984. * @readonly
  25985. * @member {module:engine/model/position~Position}
  25986. */
  25987. this.start = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( start );
  25988. /**
  25989. * End position.
  25990. *
  25991. * @readonly
  25992. * @member {module:engine/model/position~Position}
  25993. */
  25994. this.end = end ? _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( end ) : _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( start );
  25995. // If the range is collapsed, treat in a similar way as a position and set its boundaries stickiness to 'toNone'.
  25996. // In other case, make the boundaries stick to the "inside" of the range.
  25997. this.start.stickiness = this.isCollapsed ? 'toNone' : 'toNext';
  25998. this.end.stickiness = this.isCollapsed ? 'toNone' : 'toPrevious';
  25999. }
  26000. /**
  26001. * Iterable interface.
  26002. *
  26003. * Iterates over all {@link module:engine/model/item~Item items} that are in this range and returns
  26004. * them together with additional information like length or {@link module:engine/model/position~Position positions},
  26005. * grouped as {@link module:engine/model/treewalker~TreeWalkerValue}.
  26006. * It iterates over all {@link module:engine/model/textproxy~TextProxy text contents} that are inside the range
  26007. * and all the {@link module:engine/model/element~Element}s that are entered into when iterating over this range.
  26008. *
  26009. * This iterator uses {@link module:engine/model/treewalker~TreeWalker} with `boundaries` set to this range
  26010. * and `ignoreElementEnd` option set to `true`.
  26011. *
  26012. * @returns {Iterable.<module:engine/model/treewalker~TreeWalkerValue>}
  26013. */
  26014. * [ Symbol.iterator ]() {
  26015. yield* new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( { boundaries: this, ignoreElementEnd: true } );
  26016. }
  26017. /**
  26018. * Returns whether the range is collapsed, that is if {@link #start} and
  26019. * {@link #end} positions are equal.
  26020. *
  26021. * @type {Boolean}
  26022. */
  26023. get isCollapsed() {
  26024. return this.start.isEqual( this.end );
  26025. }
  26026. /**
  26027. * Returns whether this range is flat, that is if {@link #start} position and
  26028. * {@link #end} position are in the same {@link module:engine/model/position~Position#parent}.
  26029. *
  26030. * @type {Boolean}
  26031. */
  26032. get isFlat() {
  26033. const startParentPath = this.start.getParentPath();
  26034. const endParentPath = this.end.getParentPath();
  26035. return Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_3__["default"])( startParentPath, endParentPath ) == 'same';
  26036. }
  26037. /**
  26038. * Range root element.
  26039. *
  26040. * @type {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment}
  26041. */
  26042. get root() {
  26043. return this.start.root;
  26044. }
  26045. /**
  26046. * Checks whether this range contains given {@link module:engine/model/position~Position position}.
  26047. *
  26048. * @param {module:engine/model/position~Position} position Position to check.
  26049. * @returns {Boolean} `true` if given {@link module:engine/model/position~Position position} is contained
  26050. * in this range,`false` otherwise.
  26051. */
  26052. containsPosition( position ) {
  26053. return position.isAfter( this.start ) && position.isBefore( this.end );
  26054. }
  26055. /**
  26056. * Checks whether this range contains given {@link ~Range range}.
  26057. *
  26058. * @param {module:engine/model/range~Range} otherRange Range to check.
  26059. * @param {Boolean} [loose=false] Whether the check is loose or strict. If the check is strict (`false`), compared range cannot
  26060. * start or end at the same position as this range boundaries. If the check is loose (`true`), compared range can start, end or
  26061. * even be equal to this range. Note that collapsed ranges are always compared in strict mode.
  26062. * @returns {Boolean} `true` if given {@link ~Range range} boundaries are contained by this range, `false` otherwise.
  26063. */
  26064. containsRange( otherRange, loose = false ) {
  26065. if ( otherRange.isCollapsed ) {
  26066. loose = false;
  26067. }
  26068. const containsStart = this.containsPosition( otherRange.start ) || ( loose && this.start.isEqual( otherRange.start ) );
  26069. const containsEnd = this.containsPosition( otherRange.end ) || ( loose && this.end.isEqual( otherRange.end ) );
  26070. return containsStart && containsEnd;
  26071. }
  26072. /**
  26073. * Checks whether given {@link module:engine/model/item~Item} is inside this range.
  26074. *
  26075. * @param {module:engine/model/item~Item} item Model item to check.
  26076. */
  26077. containsItem( item ) {
  26078. const pos = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createBefore( item );
  26079. return this.containsPosition( pos ) || this.start.isEqual( pos );
  26080. }
  26081. /**
  26082. * Checks whether this object is of the given.
  26083. *
  26084. * range.is( 'range' ); // -> true
  26085. * range.is( 'model:range' ); // -> true
  26086. *
  26087. * range.is( 'view:range' ); // -> false
  26088. * range.is( 'documentSelection' ); // -> false
  26089. *
  26090. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  26091. *
  26092. * @param {String} type
  26093. * @returns {Boolean}
  26094. */
  26095. is( type ) {
  26096. return type === 'range' || type === 'model:range';
  26097. }
  26098. /**
  26099. * Two ranges are equal if their {@link #start} and {@link #end} positions are equal.
  26100. *
  26101. * @param {module:engine/model/range~Range} otherRange Range to compare with.
  26102. * @returns {Boolean} `true` if ranges are equal, `false` otherwise.
  26103. */
  26104. isEqual( otherRange ) {
  26105. return this.start.isEqual( otherRange.start ) && this.end.isEqual( otherRange.end );
  26106. }
  26107. /**
  26108. * Checks and returns whether this range intersects with given range.
  26109. *
  26110. * @param {module:engine/model/range~Range} otherRange Range to compare with.
  26111. * @returns {Boolean} `true` if ranges intersect, `false` otherwise.
  26112. */
  26113. isIntersecting( otherRange ) {
  26114. return this.start.isBefore( otherRange.end ) && this.end.isAfter( otherRange.start );
  26115. }
  26116. /**
  26117. * Computes which part(s) of this {@link ~Range range} is not a part of given {@link ~Range range}.
  26118. * Returned array contains zero, one or two {@link ~Range ranges}.
  26119. *
  26120. * Examples:
  26121. *
  26122. * let range = model.createRange(
  26123. * model.createPositionFromPath( root, [ 2, 7 ] ),
  26124. * model.createPositionFromPath( root, [ 4, 0, 1 ] )
  26125. * );
  26126. * let otherRange = model.createRange( model.createPositionFromPath( root, [ 1 ] ), model.createPositionFromPath( root, [ 5 ] ) );
  26127. * let transformed = range.getDifference( otherRange );
  26128. * // transformed array has no ranges because `otherRange` contains `range`
  26129. *
  26130. * otherRange = model.createRange( model.createPositionFromPath( root, [ 1 ] ), model.createPositionFromPath( root, [ 3 ] ) );
  26131. * transformed = range.getDifference( otherRange );
  26132. * // transformed array has one range: from [ 3 ] to [ 4, 0, 1 ]
  26133. *
  26134. * otherRange = model.createRange( model.createPositionFromPath( root, [ 3 ] ), model.createPositionFromPath( root, [ 4 ] ) );
  26135. * transformed = range.getDifference( otherRange );
  26136. * // transformed array has two ranges: from [ 2, 7 ] to [ 3 ] and from [ 4 ] to [ 4, 0, 1 ]
  26137. *
  26138. * @param {module:engine/model/range~Range} otherRange Range to differentiate against.
  26139. * @returns {Array.<module:engine/model/range~Range>} The difference between ranges.
  26140. */
  26141. getDifference( otherRange ) {
  26142. const ranges = [];
  26143. if ( this.isIntersecting( otherRange ) ) {
  26144. // Ranges intersect.
  26145. if ( this.containsPosition( otherRange.start ) ) {
  26146. // Given range start is inside this range. This means that we have to
  26147. // add shrunken range - from the start to the middle of this range.
  26148. ranges.push( new Range( this.start, otherRange.start ) );
  26149. }
  26150. if ( this.containsPosition( otherRange.end ) ) {
  26151. // Given range end is inside this range. This means that we have to
  26152. // add shrunken range - from the middle of this range to the end.
  26153. ranges.push( new Range( otherRange.end, this.end ) );
  26154. }
  26155. } else {
  26156. // Ranges do not intersect, return the original range.
  26157. ranges.push( new Range( this.start, this.end ) );
  26158. }
  26159. return ranges;
  26160. }
  26161. /**
  26162. * Returns an intersection of this {@link ~Range range} and given {@link ~Range range}.
  26163. * Intersection is a common part of both of those ranges. If ranges has no common part, returns `null`.
  26164. *
  26165. * Examples:
  26166. *
  26167. * let range = model.createRange(
  26168. * model.createPositionFromPath( root, [ 2, 7 ] ),
  26169. * model.createPositionFromPath( root, [ 4, 0, 1 ] )
  26170. * );
  26171. * let otherRange = model.createRange( model.createPositionFromPath( root, [ 1 ] ), model.createPositionFromPath( root, [ 2 ] ) );
  26172. * let transformed = range.getIntersection( otherRange ); // null - ranges have no common part
  26173. *
  26174. * otherRange = model.createRange( model.createPositionFromPath( root, [ 3 ] ), model.createPositionFromPath( root, [ 5 ] ) );
  26175. * transformed = range.getIntersection( otherRange ); // range from [ 3 ] to [ 4, 0, 1 ]
  26176. *
  26177. * @param {module:engine/model/range~Range} otherRange Range to check for intersection.
  26178. * @returns {module:engine/model/range~Range|null} A common part of given ranges or `null` if ranges have no common part.
  26179. */
  26180. getIntersection( otherRange ) {
  26181. if ( this.isIntersecting( otherRange ) ) {
  26182. // Ranges intersect, so a common range will be returned.
  26183. // At most, it will be same as this range.
  26184. let commonRangeStart = this.start;
  26185. let commonRangeEnd = this.end;
  26186. if ( this.containsPosition( otherRange.start ) ) {
  26187. // Given range start is inside this range. This means thaNt we have to
  26188. // shrink common range to the given range start.
  26189. commonRangeStart = otherRange.start;
  26190. }
  26191. if ( this.containsPosition( otherRange.end ) ) {
  26192. // Given range end is inside this range. This means that we have to
  26193. // shrink common range to the given range end.
  26194. commonRangeEnd = otherRange.end;
  26195. }
  26196. return new Range( commonRangeStart, commonRangeEnd );
  26197. }
  26198. // Ranges do not intersect, so they do not have common part.
  26199. return null;
  26200. }
  26201. /**
  26202. * Returns a range created by joining this {@link ~Range range} with the given {@link ~Range range}.
  26203. * If ranges have no common part, returns `null`.
  26204. *
  26205. * Examples:
  26206. *
  26207. * let range = model.createRange(
  26208. * model.createPositionFromPath( root, [ 2, 7 ] ),
  26209. * model.createPositionFromPath( root, [ 4, 0, 1 ] )
  26210. * );
  26211. * let otherRange = model.createRange(
  26212. * model.createPositionFromPath( root, [ 1 ] ),
  26213. * model.createPositionFromPath( root, [ 2 ] )
  26214. * );
  26215. * let transformed = range.getJoined( otherRange ); // null - ranges have no common part
  26216. *
  26217. * otherRange = model.createRange(
  26218. * model.createPositionFromPath( root, [ 3 ] ),
  26219. * model.createPositionFromPath( root, [ 5 ] )
  26220. * );
  26221. * transformed = range.getJoined( otherRange ); // range from [ 2, 7 ] to [ 5 ]
  26222. *
  26223. * @param {module:engine/model/range~Range} otherRange Range to be joined.
  26224. * @param {Boolean} [loose=false] Whether the intersection check is loose or strict. If the check is strict (`false`),
  26225. * ranges are tested for intersection or whether start/end positions are equal. If the check is loose (`true`),
  26226. * compared range is also checked if it's {@link module:engine/model/position~Position#isTouching touching} current range.
  26227. * @returns {module:engine/model/range~Range|null} A sum of given ranges or `null` if ranges have no common part.
  26228. */
  26229. getJoined( otherRange, loose = false ) {
  26230. let shouldJoin = this.isIntersecting( otherRange );
  26231. if ( !shouldJoin ) {
  26232. if ( this.start.isBefore( otherRange.start ) ) {
  26233. shouldJoin = loose ? this.end.isTouching( otherRange.start ) : this.end.isEqual( otherRange.start );
  26234. } else {
  26235. shouldJoin = loose ? otherRange.end.isTouching( this.start ) : otherRange.end.isEqual( this.start );
  26236. }
  26237. }
  26238. if ( !shouldJoin ) {
  26239. return null;
  26240. }
  26241. let startPosition = this.start;
  26242. let endPosition = this.end;
  26243. if ( otherRange.start.isBefore( startPosition ) ) {
  26244. startPosition = otherRange.start;
  26245. }
  26246. if ( otherRange.end.isAfter( endPosition ) ) {
  26247. endPosition = otherRange.end;
  26248. }
  26249. return new Range( startPosition, endPosition );
  26250. }
  26251. /**
  26252. * Computes and returns the smallest set of {@link #isFlat flat} ranges, that covers this range in whole.
  26253. *
  26254. * See an example of a model structure (`[` and `]` are range boundaries):
  26255. *
  26256. * root root
  26257. * |- element DIV DIV P2 P3 DIV
  26258. * | |- element H H P1 f o o b a r H P4
  26259. * | | |- "fir[st" fir[st lorem se]cond ipsum
  26260. * | |- element P1
  26261. * | | |- "lorem" ||
  26262. * |- element P2 ||
  26263. * | |- "foo" VV
  26264. * |- element P3
  26265. * | |- "bar" root
  26266. * |- element DIV DIV [P2 P3] DIV
  26267. * | |- element H H [P1] f o o b a r H P4
  26268. * | | |- "se]cond" fir[st] lorem [se]cond ipsum
  26269. * | |- element P4
  26270. * | | |- "ipsum"
  26271. *
  26272. * As it can be seen, letters contained in the range are: `stloremfoobarse`, spread across different parents.
  26273. * We are looking for minimal set of flat ranges that contains the same nodes.
  26274. *
  26275. * Minimal flat ranges for above range `( [ 0, 0, 3 ], [ 3, 0, 2 ] )` will be:
  26276. *
  26277. * ( [ 0, 0, 3 ], [ 0, 0, 5 ] ) = "st"
  26278. * ( [ 0, 1 ], [ 0, 2 ] ) = element P1 ("lorem")
  26279. * ( [ 1 ], [ 3 ] ) = element P2, element P3 ("foobar")
  26280. * ( [ 3, 0, 0 ], [ 3, 0, 2 ] ) = "se"
  26281. *
  26282. * **Note:** if an {@link module:engine/model/element~Element element} is not wholly contained in this range, it won't be returned
  26283. * in any of the returned flat ranges. See in the example how `H` elements at the beginning and at the end of the range
  26284. * were omitted. Only their parts that were wholly in the range were returned.
  26285. *
  26286. * **Note:** this method is not returning flat ranges that contain no nodes.
  26287. *
  26288. * @returns {Array.<module:engine/model/range~Range>} Array of flat ranges covering this range.
  26289. */
  26290. getMinimalFlatRanges() {
  26291. const ranges = [];
  26292. const diffAt = this.start.getCommonPath( this.end ).length;
  26293. const pos = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( this.start );
  26294. let posParent = pos.parent;
  26295. // Go up.
  26296. while ( pos.path.length > diffAt + 1 ) {
  26297. const howMany = posParent.maxOffset - pos.offset;
  26298. if ( howMany !== 0 ) {
  26299. ranges.push( new Range( pos, pos.getShiftedBy( howMany ) ) );
  26300. }
  26301. pos.path = pos.path.slice( 0, -1 );
  26302. pos.offset++;
  26303. posParent = posParent.parent;
  26304. }
  26305. // Go down.
  26306. while ( pos.path.length <= this.end.path.length ) {
  26307. const offset = this.end.path[ pos.path.length - 1 ];
  26308. const howMany = offset - pos.offset;
  26309. if ( howMany !== 0 ) {
  26310. ranges.push( new Range( pos, pos.getShiftedBy( howMany ) ) );
  26311. }
  26312. pos.offset = offset;
  26313. pos.path.push( 0 );
  26314. }
  26315. return ranges;
  26316. }
  26317. /**
  26318. * Creates a {@link module:engine/model/treewalker~TreeWalker TreeWalker} instance with this range as a boundary.
  26319. *
  26320. * For example, to iterate over all items in the entire document root:
  26321. *
  26322. * // Create a range spanning over the entire root content:
  26323. * const range = editor.model.createRangeIn( editor.model.document.getRoot() );
  26324. *
  26325. * // Iterate over all items in this range:
  26326. * for ( const value of range.getWalker() ) {
  26327. * console.log( value.item );
  26328. * }
  26329. *
  26330. * @param {Object} options Object with configuration options. See {@link module:engine/model/treewalker~TreeWalker}.
  26331. * @param {module:engine/model/position~Position} [options.startPosition]
  26332. * @param {Boolean} [options.singleCharacters=false]
  26333. * @param {Boolean} [options.shallow=false]
  26334. * @param {Boolean} [options.ignoreElementEnd=false]
  26335. */
  26336. getWalker( options = {} ) {
  26337. options.boundaries = this;
  26338. return new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( options );
  26339. }
  26340. /**
  26341. * Returns an iterator that iterates over all {@link module:engine/model/item~Item items} that are in this range and returns
  26342. * them.
  26343. *
  26344. * This method uses {@link module:engine/model/treewalker~TreeWalker} with `boundaries` set to this range and `ignoreElementEnd` option
  26345. * set to `true`. However it returns only {@link module:engine/model/item~Item model items},
  26346. * not {@link module:engine/model/treewalker~TreeWalkerValue}.
  26347. *
  26348. * You may specify additional options for the tree walker. See {@link module:engine/model/treewalker~TreeWalker} for
  26349. * a full list of available options.
  26350. *
  26351. * @param {Object} options Object with configuration options. See {@link module:engine/model/treewalker~TreeWalker}.
  26352. * @returns {Iterable.<module:engine/model/item~Item>}
  26353. */
  26354. * getItems( options = {} ) {
  26355. options.boundaries = this;
  26356. options.ignoreElementEnd = true;
  26357. const treeWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( options );
  26358. for ( const value of treeWalker ) {
  26359. yield value.item;
  26360. }
  26361. }
  26362. /**
  26363. * Returns an iterator that iterates over all {@link module:engine/model/position~Position positions} that are boundaries or
  26364. * contained in this range.
  26365. *
  26366. * This method uses {@link module:engine/model/treewalker~TreeWalker} with `boundaries` set to this range. However it returns only
  26367. * {@link module:engine/model/position~Position positions}, not {@link module:engine/model/treewalker~TreeWalkerValue}.
  26368. *
  26369. * You may specify additional options for the tree walker. See {@link module:engine/model/treewalker~TreeWalker} for
  26370. * a full list of available options.
  26371. *
  26372. * @param {Object} options Object with configuration options. See {@link module:engine/model/treewalker~TreeWalker}.
  26373. * @returns {Iterable.<module:engine/model/position~Position>}
  26374. */
  26375. * getPositions( options = {} ) {
  26376. options.boundaries = this;
  26377. const treeWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( options );
  26378. yield treeWalker.position;
  26379. for ( const value of treeWalker ) {
  26380. yield value.nextPosition;
  26381. }
  26382. }
  26383. /**
  26384. * Returns a range that is a result of transforming this range by given `operation`.
  26385. *
  26386. * **Note:** transformation may break one range into multiple ranges (for example, when a part of the range is
  26387. * moved to a different part of document tree). For this reason, an array is returned by this method and it
  26388. * may contain one or more `Range` instances.
  26389. *
  26390. * @param {module:engine/model/operation/operation~Operation} operation Operation to transform range by.
  26391. * @returns {Array.<module:engine/model/range~Range>} Range which is the result of transformation.
  26392. */
  26393. getTransformedByOperation( operation ) {
  26394. switch ( operation.type ) {
  26395. case 'insert':
  26396. return this._getTransformedByInsertOperation( operation );
  26397. case 'move':
  26398. case 'remove':
  26399. case 'reinsert':
  26400. return this._getTransformedByMoveOperation( operation );
  26401. case 'split':
  26402. return [ this._getTransformedBySplitOperation( operation ) ];
  26403. case 'merge':
  26404. return [ this._getTransformedByMergeOperation( operation ) ];
  26405. }
  26406. return [ new Range( this.start, this.end ) ];
  26407. }
  26408. /**
  26409. * Returns a range that is a result of transforming this range by multiple `operations`.
  26410. *
  26411. * @see ~Range#getTransformedByOperation
  26412. * @param {Iterable.<module:engine/model/operation/operation~Operation>} operations Operations to transform the range by.
  26413. * @returns {Array.<module:engine/model/range~Range>} Range which is the result of transformation.
  26414. */
  26415. getTransformedByOperations( operations ) {
  26416. const ranges = [ new Range( this.start, this.end ) ];
  26417. for ( const operation of operations ) {
  26418. for ( let i = 0; i < ranges.length; i++ ) {
  26419. const result = ranges[ i ].getTransformedByOperation( operation );
  26420. ranges.splice( i, 1, ...result );
  26421. i += result.length - 1;
  26422. }
  26423. }
  26424. // It may happen that a range is split into two, and then the part of second "piece" is moved into first
  26425. // "piece". In this case we will have incorrect third range, which should not be included in the result --
  26426. // because it is already included in the first "piece". In this loop we are looking for all such ranges that
  26427. // are inside other ranges and we simply remove them.
  26428. for ( let i = 0; i < ranges.length; i++ ) {
  26429. const range = ranges[ i ];
  26430. for ( let j = i + 1; j < ranges.length; j++ ) {
  26431. const next = ranges[ j ];
  26432. if ( range.containsRange( next ) || next.containsRange( range ) || range.isEqual( next ) ) {
  26433. ranges.splice( j, 1 );
  26434. }
  26435. }
  26436. }
  26437. return ranges;
  26438. }
  26439. /**
  26440. * Returns an {@link module:engine/model/element~Element} or {@link module:engine/model/documentfragment~DocumentFragment}
  26441. * which is a common ancestor of the range's both ends (in which the entire range is contained).
  26442. *
  26443. * @returns {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment|null}
  26444. */
  26445. getCommonAncestor() {
  26446. return this.start.getCommonAncestor( this.end );
  26447. }
  26448. /**
  26449. * Returns an {@link module:engine/model/element~Element Element} contained by the range.
  26450. * The element will be returned when it is the **only** node within the range and **fully–contained**
  26451. * at the same time.
  26452. *
  26453. * @returns {module:engine/model/element~Element|null}
  26454. */
  26455. getContainedElement() {
  26456. if ( this.isCollapsed ) {
  26457. return null;
  26458. }
  26459. const nodeAfterStart = this.start.nodeAfter;
  26460. const nodeBeforeEnd = this.end.nodeBefore;
  26461. if ( nodeAfterStart && nodeAfterStart.is( 'element' ) && nodeAfterStart === nodeBeforeEnd ) {
  26462. return nodeAfterStart;
  26463. }
  26464. return null;
  26465. }
  26466. /**
  26467. * Converts `Range` to plain object and returns it.
  26468. *
  26469. * @returns {Object} `Node` converted to plain object.
  26470. */
  26471. toJSON() {
  26472. return {
  26473. start: this.start.toJSON(),
  26474. end: this.end.toJSON()
  26475. };
  26476. }
  26477. /**
  26478. * Returns a new range that is equal to current range.
  26479. *
  26480. * @returns {module:engine/model/range~Range}
  26481. */
  26482. clone() {
  26483. return new this.constructor( this.start, this.end );
  26484. }
  26485. /**
  26486. * Returns a result of transforming a copy of this range by insert operation.
  26487. *
  26488. * One or more ranges may be returned as a result of this transformation.
  26489. *
  26490. * @protected
  26491. * @param {module:engine/model/operation/insertoperation~InsertOperation} operation
  26492. * @returns {Array.<module:engine/model/range~Range>}
  26493. */
  26494. _getTransformedByInsertOperation( operation, spread = false ) {
  26495. return this._getTransformedByInsertion( operation.position, operation.howMany, spread );
  26496. }
  26497. /**
  26498. * Returns a result of transforming a copy of this range by move operation.
  26499. *
  26500. * One or more ranges may be returned as a result of this transformation.
  26501. *
  26502. * @protected
  26503. * @param {module:engine/model/operation/moveoperation~MoveOperation} operation
  26504. * @returns {Array.<module:engine/model/range~Range>}
  26505. */
  26506. _getTransformedByMoveOperation( operation, spread = false ) {
  26507. const sourcePosition = operation.sourcePosition;
  26508. const howMany = operation.howMany;
  26509. const targetPosition = operation.targetPosition;
  26510. return this._getTransformedByMove( sourcePosition, targetPosition, howMany, spread );
  26511. }
  26512. /**
  26513. * Returns a result of transforming a copy of this range by split operation.
  26514. *
  26515. * Always one range is returned. The transformation is done in a way to not break the range.
  26516. *
  26517. * @protected
  26518. * @param {module:engine/model/operation/splitoperation~SplitOperation} operation
  26519. * @returns {module:engine/model/range~Range}
  26520. */
  26521. _getTransformedBySplitOperation( operation ) {
  26522. const start = this.start._getTransformedBySplitOperation( operation );
  26523. let end = this.end._getTransformedBySplitOperation( operation );
  26524. if ( this.end.isEqual( operation.insertionPosition ) ) {
  26525. end = this.end.getShiftedBy( 1 );
  26526. }
  26527. // Below may happen when range contains graveyard element used by split operation.
  26528. if ( start.root != end.root ) {
  26529. // End position was next to the moved graveyard element and was moved with it.
  26530. // Fix it by using old `end` which has proper `root`.
  26531. end = this.end.getShiftedBy( -1 );
  26532. }
  26533. return new Range( start, end );
  26534. }
  26535. /**
  26536. * Returns a result of transforming a copy of this range by merge operation.
  26537. *
  26538. * Always one range is returned. The transformation is done in a way to not break the range.
  26539. *
  26540. * @protected
  26541. * @param {module:engine/model/operation/mergeoperation~MergeOperation} operation
  26542. * @returns {module:engine/model/range~Range}
  26543. */
  26544. _getTransformedByMergeOperation( operation ) {
  26545. // Special case when the marker is set on "the closing tag" of an element. Marker can be set like that during
  26546. // transformations, especially when a content of a few block elements were removed. For example:
  26547. //
  26548. // {} is the transformed range, [] is the removed range.
  26549. // <p>F[o{o</p><p>B}ar</p><p>Xy]z</p>
  26550. //
  26551. // <p>Fo{o</p><p>B}ar</p><p>z</p>
  26552. // <p>F{</p><p>B}ar</p><p>z</p>
  26553. // <p>F{</p>}<p>z</p>
  26554. // <p>F{}z</p>
  26555. //
  26556. if ( this.start.isEqual( operation.targetPosition ) && this.end.isEqual( operation.deletionPosition ) ) {
  26557. return new Range( this.start );
  26558. }
  26559. let start = this.start._getTransformedByMergeOperation( operation );
  26560. let end = this.end._getTransformedByMergeOperation( operation );
  26561. if ( start.root != end.root ) {
  26562. // This happens when the end position was next to the merged (deleted) element.
  26563. // Then, the end position was moved to the graveyard root. In this case we need to fix
  26564. // the range cause its boundaries would be in different roots.
  26565. end = this.end.getShiftedBy( -1 );
  26566. }
  26567. if ( start.isAfter( end ) ) {
  26568. // This happens in three following cases:
  26569. //
  26570. // Case 1: Merge operation source position is before the target position (due to some transformations, OT, etc.)
  26571. // This means that start can be moved before the end of the range.
  26572. //
  26573. // Before: <p>a{a</p><p>b}b</p><p>cc</p>
  26574. // Merge: <p>b}b</p><p>cca{a</p>
  26575. // Fix: <p>{b}b</p><p>ccaa</p>
  26576. //
  26577. // Case 2: Range start is before merged node but not directly.
  26578. // Result should include all nodes that were in the original range.
  26579. //
  26580. // Before: <p>aa</p>{<p>cc</p><p>b}b</p>
  26581. // Merge: <p>aab}b</p>{<p>cc</p>
  26582. // Fix: <p>aa{bb</p><p>cc</p>}
  26583. //
  26584. // The range is expanded by an additional `b` letter but it is better than dropping the whole `cc` paragraph.
  26585. //
  26586. // Case 3: Range start is directly before merged node.
  26587. // Resulting range should include only nodes from the merged element:
  26588. //
  26589. // Before: <p>aa</p>{<p>b}b</p><p>cc</p>
  26590. // Merge: <p>aab}b</p>{<p>cc</p>
  26591. // Fix: <p>aa{b}b</p><p>cc</p>
  26592. //
  26593. if ( operation.sourcePosition.isBefore( operation.targetPosition ) ) {
  26594. // Case 1.
  26595. start = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( end );
  26596. start.offset = 0;
  26597. } else {
  26598. if ( !operation.deletionPosition.isEqual( start ) ) {
  26599. // Case 2.
  26600. end = operation.deletionPosition;
  26601. }
  26602. // In both case 2 and 3 start is at the end of the merge-to element.
  26603. start = operation.targetPosition;
  26604. }
  26605. return new Range( start, end );
  26606. }
  26607. return new Range( start, end );
  26608. }
  26609. /**
  26610. * Returns an array containing one or two {@link ~Range ranges} that are a result of transforming this
  26611. * {@link ~Range range} by inserting `howMany` nodes at `insertPosition`. Two {@link ~Range ranges} are
  26612. * returned if the insertion was inside this {@link ~Range range} and `spread` is set to `true`.
  26613. *
  26614. * Examples:
  26615. *
  26616. * let range = model.createRange(
  26617. * model.createPositionFromPath( root, [ 2, 7 ] ),
  26618. * model.createPositionFromPath( root, [ 4, 0, 1 ] )
  26619. * );
  26620. * let transformed = range._getTransformedByInsertion( model.createPositionFromPath( root, [ 1 ] ), 2 );
  26621. * // transformed array has one range from [ 4, 7 ] to [ 6, 0, 1 ]
  26622. *
  26623. * transformed = range._getTransformedByInsertion( model.createPositionFromPath( root, [ 4, 0, 0 ] ), 4 );
  26624. * // transformed array has one range from [ 2, 7 ] to [ 4, 0, 5 ]
  26625. *
  26626. * transformed = range._getTransformedByInsertion( model.createPositionFromPath( root, [ 3, 2 ] ), 4 );
  26627. * // transformed array has one range, which is equal to original range
  26628. *
  26629. * transformed = range._getTransformedByInsertion( model.createPositionFromPath( root, [ 3, 2 ] ), 4, true );
  26630. * // transformed array has two ranges: from [ 2, 7 ] to [ 3, 2 ] and from [ 3, 6 ] to [ 4, 0, 1 ]
  26631. *
  26632. * @protected
  26633. * @param {module:engine/model/position~Position} insertPosition Position where nodes are inserted.
  26634. * @param {Number} howMany How many nodes are inserted.
  26635. * @param {Boolean} [spread] Flag indicating whether this {~Range range} should be spread if insertion
  26636. * was inside the range. Defaults to `false`.
  26637. * @returns {Array.<module:engine/model/range~Range>} Result of the transformation.
  26638. */
  26639. _getTransformedByInsertion( insertPosition, howMany, spread = false ) {
  26640. if ( spread && this.containsPosition( insertPosition ) ) {
  26641. // Range has to be spread. The first part is from original start to the spread point.
  26642. // The other part is from spread point to the original end, but transformed by
  26643. // insertion to reflect insertion changes.
  26644. return [
  26645. new Range( this.start, insertPosition ),
  26646. new Range(
  26647. insertPosition.getShiftedBy( howMany ),
  26648. this.end._getTransformedByInsertion( insertPosition, howMany )
  26649. )
  26650. ];
  26651. } else {
  26652. const range = new Range( this.start, this.end );
  26653. range.start = range.start._getTransformedByInsertion( insertPosition, howMany );
  26654. range.end = range.end._getTransformedByInsertion( insertPosition, howMany );
  26655. return [ range ];
  26656. }
  26657. }
  26658. /**
  26659. * Returns an array containing {@link ~Range ranges} that are a result of transforming this
  26660. * {@link ~Range range} by moving `howMany` nodes from `sourcePosition` to `targetPosition`.
  26661. *
  26662. * @protected
  26663. * @param {module:engine/model/position~Position} sourcePosition Position from which nodes are moved.
  26664. * @param {module:engine/model/position~Position} targetPosition Position to where nodes are moved.
  26665. * @param {Number} howMany How many nodes are moved.
  26666. * @param {Boolean} [spread=false] Whether the range should be spread if the move points inside the range.
  26667. * @returns {Array.<module:engine/model/range~Range>} Result of the transformation.
  26668. */
  26669. _getTransformedByMove( sourcePosition, targetPosition, howMany, spread = false ) {
  26670. // Special case for transforming a collapsed range. Just transform it like a position.
  26671. if ( this.isCollapsed ) {
  26672. const newPos = this.start._getTransformedByMove( sourcePosition, targetPosition, howMany );
  26673. return [ new Range( newPos ) ];
  26674. }
  26675. // Special case for transformation when a part of the range is moved towards the range.
  26676. //
  26677. // Examples:
  26678. //
  26679. // <div><p>ab</p><p>c[d</p></div><p>e]f</p> --> <div><p>ab</p></div><p>c[d</p><p>e]f</p>
  26680. // <p>e[f</p><div><p>a]b</p><p>cd</p></div> --> <p>e[f</p><p>a]b</p><div><p>cd</p></div>
  26681. //
  26682. // Without this special condition, the default algorithm leaves an "artifact" range from one of `differenceSet` parts:
  26683. //
  26684. // <div><p>ab</p><p>c[d</p></div><p>e]f</p> --> <div><p>ab</p>{</div>}<p>c[d</p><p>e]f</p>
  26685. //
  26686. // This special case is applied only if the range is to be kept together (not spread).
  26687. const moveRange = Range._createFromPositionAndShift( sourcePosition, howMany );
  26688. const insertPosition = targetPosition._getTransformedByDeletion( sourcePosition, howMany );
  26689. if ( this.containsPosition( targetPosition ) && !spread ) {
  26690. if ( moveRange.containsPosition( this.start ) || moveRange.containsPosition( this.end ) ) {
  26691. const start = this.start._getTransformedByMove( sourcePosition, targetPosition, howMany );
  26692. const end = this.end._getTransformedByMove( sourcePosition, targetPosition, howMany );
  26693. return [ new Range( start, end ) ];
  26694. }
  26695. }
  26696. // Default algorithm.
  26697. let result;
  26698. const differenceSet = this.getDifference( moveRange );
  26699. let difference = null;
  26700. const common = this.getIntersection( moveRange );
  26701. if ( differenceSet.length == 1 ) {
  26702. // `moveRange` and this range may intersect but may be separate.
  26703. difference = new Range(
  26704. differenceSet[ 0 ].start._getTransformedByDeletion( sourcePosition, howMany ),
  26705. differenceSet[ 0 ].end._getTransformedByDeletion( sourcePosition, howMany )
  26706. );
  26707. } else if ( differenceSet.length == 2 ) {
  26708. // `moveRange` is inside this range.
  26709. difference = new Range(
  26710. this.start,
  26711. this.end._getTransformedByDeletion( sourcePosition, howMany )
  26712. );
  26713. } // else, `moveRange` contains this range.
  26714. if ( difference ) {
  26715. result = difference._getTransformedByInsertion( insertPosition, howMany, common !== null || spread );
  26716. } else {
  26717. result = [];
  26718. }
  26719. if ( common ) {
  26720. const transformedCommon = new Range(
  26721. common.start._getCombined( moveRange.start, insertPosition ),
  26722. common.end._getCombined( moveRange.start, insertPosition )
  26723. );
  26724. if ( result.length == 2 ) {
  26725. result.splice( 1, 0, transformedCommon );
  26726. } else {
  26727. result.push( transformedCommon );
  26728. }
  26729. }
  26730. return result;
  26731. }
  26732. /**
  26733. * Returns a copy of this range that is transformed by deletion of `howMany` nodes from `deletePosition`.
  26734. *
  26735. * If the deleted range is intersecting with the transformed range, the transformed range will be shrank.
  26736. *
  26737. * If the deleted range contains transformed range, `null` will be returned.
  26738. *
  26739. * @protected
  26740. * @param {module:engine/model/position~Position} deletionPosition Position from which nodes are removed.
  26741. * @param {Number} howMany How many nodes are removed.
  26742. * @returns {module:engine/model/range~Range|null} Result of the transformation.
  26743. */
  26744. _getTransformedByDeletion( deletePosition, howMany ) {
  26745. let newStart = this.start._getTransformedByDeletion( deletePosition, howMany );
  26746. let newEnd = this.end._getTransformedByDeletion( deletePosition, howMany );
  26747. if ( newStart == null && newEnd == null ) {
  26748. return null;
  26749. }
  26750. if ( newStart == null ) {
  26751. newStart = deletePosition;
  26752. }
  26753. if ( newEnd == null ) {
  26754. newEnd = deletePosition;
  26755. }
  26756. return new Range( newStart, newEnd );
  26757. }
  26758. /**
  26759. * Creates a new range, spreading from specified {@link module:engine/model/position~Position position} to a position moved by
  26760. * given `shift`. If `shift` is a negative value, shifted position is treated as the beginning of the range.
  26761. *
  26762. * @protected
  26763. * @param {module:engine/model/position~Position} position Beginning of the range.
  26764. * @param {Number} shift How long the range should be.
  26765. * @returns {module:engine/model/range~Range}
  26766. */
  26767. static _createFromPositionAndShift( position, shift ) {
  26768. const start = position;
  26769. const end = position.getShiftedBy( shift );
  26770. return shift > 0 ? new this( start, end ) : new this( end, start );
  26771. }
  26772. /**
  26773. * Creates a range inside an {@link module:engine/model/element~Element element} which starts before the first child of
  26774. * that element and ends after the last child of that element.
  26775. *
  26776. * @protected
  26777. * @param {module:engine/model/element~Element} element Element which is a parent for the range.
  26778. * @returns {module:engine/model/range~Range}
  26779. */
  26780. static _createIn( element ) {
  26781. return new this( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( element, 0 ), _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( element, element.maxOffset ) );
  26782. }
  26783. /**
  26784. * Creates a range that starts before given {@link module:engine/model/item~Item model item} and ends after it.
  26785. *
  26786. * @protected
  26787. * @param {module:engine/model/item~Item} item
  26788. * @returns {module:engine/model/range~Range}
  26789. */
  26790. static _createOn( item ) {
  26791. return this._createFromPositionAndShift( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createBefore( item ), item.offsetSize );
  26792. }
  26793. /**
  26794. * Combines all ranges from the passed array into a one range. At least one range has to be passed.
  26795. * Passed ranges must not have common parts.
  26796. *
  26797. * The first range from the array is a reference range. If other ranges start or end on the exactly same position where
  26798. * the reference range, they get combined into one range.
  26799. *
  26800. * [ ][] [ ][ ][ ][ ][] [ ] // Passed ranges, shown sorted
  26801. * [ ] // The result of the function if the first range was a reference range.
  26802. * [ ] // The result of the function if the third-to-seventh range was a reference range.
  26803. * [ ] // The result of the function if the last range was a reference range.
  26804. *
  26805. * @param {Array.<module:engine/model/range~Range>} ranges Ranges to combine.
  26806. * @returns {module:engine/model/range~Range} Combined range.
  26807. */
  26808. static _createFromRanges( ranges ) {
  26809. if ( ranges.length === 0 ) {
  26810. /**
  26811. * At least one range has to be passed to
  26812. * {@link module:engine/model/range~Range._createFromRanges `Range._createFromRanges()`}.
  26813. *
  26814. * @error range-create-from-ranges-empty-array
  26815. */
  26816. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"](
  26817. 'range-create-from-ranges-empty-array',
  26818. null
  26819. );
  26820. } else if ( ranges.length == 1 ) {
  26821. return ranges[ 0 ].clone();
  26822. }
  26823. // 1. Set the first range in `ranges` array as a reference range.
  26824. // If we are going to return just a one range, one of the ranges need to be the reference one.
  26825. // Other ranges will be stuck to that range, if possible.
  26826. const ref = ranges[ 0 ];
  26827. // 2. Sort all the ranges so it's easier to process them.
  26828. ranges.sort( ( a, b ) => {
  26829. return a.start.isAfter( b.start ) ? 1 : -1;
  26830. } );
  26831. // 3. Check at which index the reference range is now.
  26832. const refIndex = ranges.indexOf( ref );
  26833. // 4. At this moment we don't need the original range.
  26834. // We are going to modify the result and we need to return a new instance of Range.
  26835. // We have to create a copy of the reference range.
  26836. const result = new this( ref.start, ref.end );
  26837. // 5. Ranges should be checked and glued starting from the range that is closest to the reference range.
  26838. // Since ranges are sorted, start with the range with index that is closest to reference range index.
  26839. if ( refIndex > 0 ) {
  26840. for ( let i = refIndex - 1; true; i++ ) {
  26841. if ( ranges[ i ].end.isEqual( result.start ) ) {
  26842. result.start = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( ranges[ i ].start );
  26843. } else {
  26844. // If ranges are not starting/ending at the same position there is no point in looking further.
  26845. break;
  26846. }
  26847. }
  26848. }
  26849. // 6. Ranges should be checked and glued starting from the range that is closest to the reference range.
  26850. // Since ranges are sorted, start with the range with index that is closest to reference range index.
  26851. for ( let i = refIndex + 1; i < ranges.length; i++ ) {
  26852. if ( ranges[ i ].start.isEqual( result.end ) ) {
  26853. result.end = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( ranges[ i ].end );
  26854. } else {
  26855. // If ranges are not starting/ending at the same position there is no point in looking further.
  26856. break;
  26857. }
  26858. }
  26859. return result;
  26860. }
  26861. /**
  26862. * Creates a `Range` instance from given plain object (i.e. parsed JSON string).
  26863. *
  26864. * @param {Object} json Plain object to be converted to `Range`.
  26865. * @param {module:engine/model/document~Document} doc Document object that will be range owner.
  26866. * @returns {module:engine/model/element~Element} `Range` instance created using given plain object.
  26867. */
  26868. static fromJSON( json, doc ) {
  26869. return new this( _position__WEBPACK_IMPORTED_MODULE_0__["default"].fromJSON( json.start, doc ), _position__WEBPACK_IMPORTED_MODULE_0__["default"].fromJSON( json.end, doc ) );
  26870. }
  26871. // @if CK_DEBUG_ENGINE // toString() {
  26872. // @if CK_DEBUG_ENGINE // return `${ this.root } [ ${ this.start.path.join( ', ' ) } ] - [ ${ this.end.path.join( ', ' ) } ]`;
  26873. // @if CK_DEBUG_ENGINE // }
  26874. // @if CK_DEBUG_ENGINE // log() {
  26875. // @if CK_DEBUG_ENGINE // console.log( 'ModelPosition: ' + this );
  26876. // @if CK_DEBUG_ENGINE // }
  26877. }
  26878. /***/ }),
  26879. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/rootelement.js":
  26880. /*!**************************************************************************!*\
  26881. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/rootelement.js ***!
  26882. \**************************************************************************/
  26883. /*! exports provided: default */
  26884. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  26885. "use strict";
  26886. __webpack_require__.r(__webpack_exports__);
  26887. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RootElement; });
  26888. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
  26889. /**
  26890. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  26891. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  26892. */
  26893. /**
  26894. * @module engine/model/rootelement
  26895. */
  26896. /**
  26897. * Type of {@link module:engine/model/element~Element} that is a root of a model tree.
  26898. * @extends module:engine/model/element~Element
  26899. */
  26900. class RootElement extends _element__WEBPACK_IMPORTED_MODULE_0__["default"] {
  26901. /**
  26902. * Creates root element.
  26903. *
  26904. * @param {module:engine/model/document~Document} document Document that is an owner of this root.
  26905. * @param {String} name Node name.
  26906. * @param {String} [rootName='main'] Unique root name used to identify this root
  26907. * element by {@link module:engine/model/document~Document}.
  26908. */
  26909. constructor( document, name, rootName = 'main' ) {
  26910. super( name );
  26911. /**
  26912. * Document that is an owner of this root.
  26913. *
  26914. * @private
  26915. * @member {module:engine/model/document~Document}
  26916. */
  26917. this._document = document;
  26918. /**
  26919. * Unique root name used to identify this root element by {@link module:engine/model/document~Document}.
  26920. *
  26921. * @readonly
  26922. * @member {String}
  26923. */
  26924. this.rootName = rootName;
  26925. }
  26926. /**
  26927. * {@link module:engine/model/document~Document Document} that owns this root element.
  26928. *
  26929. * @readonly
  26930. * @type {module:engine/model/document~Document|null}
  26931. */
  26932. get document() {
  26933. return this._document;
  26934. }
  26935. /**
  26936. * Checks whether this object is of the given.
  26937. *
  26938. * rootElement.is( 'rootElement' ); // -> true
  26939. * rootElement.is( 'element' ); // -> true
  26940. * rootElement.is( 'node' ); // -> true
  26941. * rootElement.is( 'model:rootElement' ); // -> true
  26942. * rootElement.is( 'model:element' ); // -> true
  26943. * rootElement.is( 'model:node' ); // -> true
  26944. *
  26945. * rootElement.is( 'view:element' ); // -> false
  26946. * rootElement.is( 'documentFragment' ); // -> false
  26947. *
  26948. * Assuming that the object being checked is an element, you can also check its
  26949. * {@link module:engine/model/element~Element#name name}:
  26950. *
  26951. * rootElement.is( 'rootElement', '$root' ); // -> same as above
  26952. *
  26953. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  26954. *
  26955. * @param {String} type Type to check.
  26956. * @param {String} [name] Element name.
  26957. * @returns {Boolean}
  26958. */
  26959. is( type, name ) {
  26960. if ( !name ) {
  26961. return type === 'rootElement' || type === 'model:rootElement' ||
  26962. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  26963. type === 'element' || type === 'model:element' ||
  26964. type === 'node' || type === 'model:node';
  26965. }
  26966. return name === this.name && (
  26967. type === 'rootElement' || type === 'model:rootElement' ||
  26968. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  26969. type === 'element' || type === 'model:element'
  26970. );
  26971. }
  26972. /**
  26973. * Converts `RootElement` instance to `String` containing it's name.
  26974. *
  26975. * @returns {String} `RootElement` instance converted to `String`.
  26976. */
  26977. toJSON() {
  26978. return this.rootName;
  26979. }
  26980. // @if CK_DEBUG_ENGINE // toString() {
  26981. // @if CK_DEBUG_ENGINE // return this.rootName;
  26982. // @if CK_DEBUG_ENGINE // }
  26983. // @if CK_DEBUG_ENGINE // log() {
  26984. // @if CK_DEBUG_ENGINE // console.log( 'ModelRootElement: ' + this );
  26985. // @if CK_DEBUG_ENGINE // }
  26986. }
  26987. /***/ }),
  26988. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/schema.js":
  26989. /*!*********************************************************************!*\
  26990. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/schema.js ***!
  26991. \*********************************************************************/
  26992. /*! exports provided: default, SchemaContext */
  26993. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  26994. "use strict";
  26995. __webpack_require__.r(__webpack_exports__);
  26996. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Schema; });
  26997. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SchemaContext", function() { return SchemaContext; });
  26998. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  26999. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  27000. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  27001. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  27002. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  27003. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
  27004. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js");
  27005. /* harmony import */ var _treewalker__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./treewalker */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/treewalker.js");
  27006. /**
  27007. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  27008. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  27009. */
  27010. /**
  27011. * @module engine/model/schema
  27012. */
  27013. /**
  27014. * The model's schema. It defines allowed and disallowed structures of nodes as well as nodes' attributes.
  27015. * The schema is usually defined by features and based on them the editing framework and features
  27016. * make decisions how to change and process the model.
  27017. *
  27018. * The instance of schema is available in {@link module:engine/model/model~Model#schema `editor.model.schema`}.
  27019. *
  27020. * Read more about the schema in:
  27021. *
  27022. * * {@glink framework/guides/architecture/editing-engine#schema Schema} section of the
  27023. * {@glink framework/guides/architecture/editing-engine Introduction to the Editing engine architecture}.
  27024. * * {@glink framework/guides/deep-dive/schema Schema deep dive} guide.
  27025. *
  27026. * @mixes module:utils/observablemixin~ObservableMixin
  27027. */
  27028. class Schema {
  27029. /**
  27030. * Creates schema instance.
  27031. */
  27032. constructor() {
  27033. this._sourceDefinitions = {};
  27034. /**
  27035. * A dictionary containing attribute properties.
  27036. *
  27037. * @private
  27038. * @member {Object.<String,String>}
  27039. */
  27040. this._attributeProperties = {};
  27041. this.decorate( 'checkChild' );
  27042. this.decorate( 'checkAttribute' );
  27043. this.on( 'checkAttribute', ( evt, args ) => {
  27044. args[ 0 ] = new SchemaContext( args[ 0 ] );
  27045. }, { priority: 'highest' } );
  27046. this.on( 'checkChild', ( evt, args ) => {
  27047. args[ 0 ] = new SchemaContext( args[ 0 ] );
  27048. args[ 1 ] = this.getDefinition( args[ 1 ] );
  27049. }, { priority: 'highest' } );
  27050. }
  27051. /**
  27052. * Registers schema item. Can only be called once for every item name.
  27053. *
  27054. * schema.register( 'paragraph', {
  27055. * inheritAllFrom: '$block'
  27056. * } );
  27057. *
  27058. * @param {String} itemName
  27059. * @param {module:engine/model/schema~SchemaItemDefinition} definition
  27060. */
  27061. register( itemName, definition ) {
  27062. if ( this._sourceDefinitions[ itemName ] ) {
  27063. /**
  27064. * A single item cannot be registered twice in the schema.
  27065. *
  27066. * This situation may happen when:
  27067. *
  27068. * * Two or more plugins called {@link #register `register()`} with the same name. This will usually mean that
  27069. * there is a collision between plugins which try to use the same element in the model. Unfortunately,
  27070. * the only way to solve this is by modifying one of these plugins to use a unique model element name.
  27071. * * A single plugin was loaded twice. This happens when it is installed by npm/yarn in two versions
  27072. * and usually means one or more of the following issues:
  27073. * * a version mismatch (two of your dependencies require two different versions of this plugin),
  27074. * * incorrect imports (this plugin is somehow imported twice in a way which confuses webpack),
  27075. * * mess in `node_modules/` (`rm -rf node_modules/` may help).
  27076. *
  27077. * **Note:** Check the logged `itemName` to better understand which plugin was duplicated/conflicting.
  27078. *
  27079. * @param itemName The name of the model element that is being registered twice.
  27080. * @error schema-cannot-register-item-twice
  27081. */
  27082. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  27083. 'schema-cannot-register-item-twice',
  27084. this,
  27085. {
  27086. itemName
  27087. }
  27088. );
  27089. }
  27090. this._sourceDefinitions[ itemName ] = [
  27091. Object.assign( {}, definition )
  27092. ];
  27093. this._clearCache();
  27094. }
  27095. /**
  27096. * Extends a {@link #register registered} item's definition.
  27097. *
  27098. * Extending properties such as `allowIn` will add more items to the existing properties,
  27099. * while redefining properties such as `isBlock` will override the previously defined ones.
  27100. *
  27101. * schema.register( 'foo', {
  27102. * allowIn: '$root',
  27103. * isBlock: true;
  27104. * } );
  27105. * schema.extend( 'foo', {
  27106. * allowIn: 'blockQuote',
  27107. * isBlock: false
  27108. * } );
  27109. *
  27110. * schema.getDefinition( 'foo' );
  27111. * // {
  27112. * // allowIn: [ '$root', 'blockQuote' ],
  27113. * // isBlock: false
  27114. * // }
  27115. *
  27116. * @param {String} itemName
  27117. * @param {module:engine/model/schema~SchemaItemDefinition} definition
  27118. */
  27119. extend( itemName, definition ) {
  27120. if ( !this._sourceDefinitions[ itemName ] ) {
  27121. /**
  27122. * Cannot extend an item which was not registered yet.
  27123. *
  27124. * This error happens when a plugin tries to extend the schema definition of an item which was not
  27125. * {@link #register registered} yet.
  27126. *
  27127. * @param itemName The name of the model element which is being extended.
  27128. * @error schema-cannot-extend-missing-item
  27129. */
  27130. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'schema-cannot-extend-missing-item', this, {
  27131. itemName
  27132. } );
  27133. }
  27134. this._sourceDefinitions[ itemName ].push( Object.assign( {}, definition ) );
  27135. this._clearCache();
  27136. }
  27137. /**
  27138. * Returns data of all registered items.
  27139. *
  27140. * This method should normally be used for reflection purposes (e.g. defining a clone of a certain element,
  27141. * checking a list of all block elements, etc).
  27142. * Use specific methods (such as {@link #checkChild `checkChild()`} or {@link #isLimit `isLimit()`})
  27143. * in other cases.
  27144. *
  27145. * @returns {Object.<String,module:engine/model/schema~SchemaCompiledItemDefinition>}
  27146. */
  27147. getDefinitions() {
  27148. if ( !this._compiledDefinitions ) {
  27149. this._compile();
  27150. }
  27151. return this._compiledDefinitions;
  27152. }
  27153. /**
  27154. * Returns a definition of the given item or `undefined` if an item is not registered.
  27155. *
  27156. * This method should normally be used for reflection purposes (e.g. defining a clone of a certain element,
  27157. * checking a list of all block elements, etc).
  27158. * Use specific methods (such as {@link #checkChild `checkChild()`} or {@link #isLimit `isLimit()`})
  27159. * in other cases.
  27160. *
  27161. * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item
  27162. * @returns {module:engine/model/schema~SchemaCompiledItemDefinition}
  27163. */
  27164. getDefinition( item ) {
  27165. let itemName;
  27166. if ( typeof item == 'string' ) {
  27167. itemName = item;
  27168. } else if ( item.is && ( item.is( '$text' ) || item.is( '$textProxy' ) ) ) {
  27169. itemName = '$text';
  27170. }
  27171. // Element or module:engine/model/schema~SchemaContextItem.
  27172. else {
  27173. itemName = item.name;
  27174. }
  27175. return this.getDefinitions()[ itemName ];
  27176. }
  27177. /**
  27178. * Returns `true` if the given item is registered in the schema.
  27179. *
  27180. * schema.isRegistered( 'paragraph' ); // -> true
  27181. * schema.isRegistered( editor.model.document.getRoot() ); // -> true
  27182. * schema.isRegistered( 'foo' ); // -> false
  27183. *
  27184. * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item
  27185. */
  27186. isRegistered( item ) {
  27187. return !!this.getDefinition( item );
  27188. }
  27189. /**
  27190. * Returns `true` if the given item is defined to be
  27191. * a block by the {@link module:engine/model/schema~SchemaItemDefinition}'s `isBlock` property.
  27192. *
  27193. * schema.isBlock( 'paragraph' ); // -> true
  27194. * schema.isBlock( '$root' ); // -> false
  27195. *
  27196. * const paragraphElement = writer.createElement( 'paragraph' );
  27197. * schema.isBlock( paragraphElement ); // -> true
  27198. *
  27199. * See the {@glink framework/guides/deep-dive/schema#block-elements Block elements} section of the Schema deep dive
  27200. * guide for more details.
  27201. *
  27202. * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item
  27203. */
  27204. isBlock( item ) {
  27205. const def = this.getDefinition( item );
  27206. return !!( def && def.isBlock );
  27207. }
  27208. /**
  27209. * Returns `true` if the given item should be treated as a limit element.
  27210. *
  27211. * It considers an item to be a limit element if its
  27212. * {@link module:engine/model/schema~SchemaItemDefinition}'s
  27213. * {@link module:engine/model/schema~SchemaItemDefinition#isLimit `isLimit`} or
  27214. * {@link module:engine/model/schema~SchemaItemDefinition#isObject `isObject`} property
  27215. * was set to `true`.
  27216. *
  27217. * schema.isLimit( 'paragraph' ); // -> false
  27218. * schema.isLimit( '$root' ); // -> true
  27219. * schema.isLimit( editor.model.document.getRoot() ); // -> true
  27220. * schema.isLimit( 'image' ); // -> true
  27221. *
  27222. * See the {@glink framework/guides/deep-dive/schema#limit-elements Limit elements} section of the Schema deep dive
  27223. * guide for more details.
  27224. *
  27225. * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item
  27226. */
  27227. isLimit( item ) {
  27228. const def = this.getDefinition( item );
  27229. if ( !def ) {
  27230. return false;
  27231. }
  27232. return !!( def.isLimit || def.isObject );
  27233. }
  27234. /**
  27235. * Returns `true` if the given item should be treated as an object element.
  27236. *
  27237. * It considers an item to be an object element if its
  27238. * {@link module:engine/model/schema~SchemaItemDefinition}'s
  27239. * {@link module:engine/model/schema~SchemaItemDefinition#isObject `isObject`} property
  27240. * was set to `true`.
  27241. *
  27242. * schema.isObject( 'paragraph' ); // -> false
  27243. * schema.isObject( 'image' ); // -> true
  27244. *
  27245. * const imageElement = writer.createElement( 'image' );
  27246. * schema.isObject( imageElement ); // -> true
  27247. *
  27248. * See the {@glink framework/guides/deep-dive/schema#object-elements Object elements} section of the Schema deep dive
  27249. * guide for more details.
  27250. *
  27251. * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item
  27252. */
  27253. isObject( item ) {
  27254. const def = this.getDefinition( item );
  27255. if ( !def ) {
  27256. return false;
  27257. }
  27258. // Note: Check out the implementation of #isLimit(), #isSelectable(), and #isContent()
  27259. // to understand why these three constitute an object.
  27260. return !!( def.isObject || ( def.isLimit && def.isSelectable && def.isContent ) );
  27261. }
  27262. /**
  27263. * Returns `true` if the given item is defined to be
  27264. * an inline element by the {@link module:engine/model/schema~SchemaItemDefinition}'s `isInline` property.
  27265. *
  27266. * schema.isInline( 'paragraph' ); // -> false
  27267. * schema.isInline( 'softBreak' ); // -> true
  27268. *
  27269. * const text = writer.createText( 'foo' );
  27270. * schema.isInline( text ); // -> true
  27271. *
  27272. * See the {@glink framework/guides/deep-dive/schema#inline-elements Inline elements} section of the Schema deep dive
  27273. * guide for more details.
  27274. *
  27275. * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item
  27276. */
  27277. isInline( item ) {
  27278. const def = this.getDefinition( item );
  27279. return !!( def && def.isInline );
  27280. }
  27281. /**
  27282. * Returns `true` if the given item is defined to be
  27283. * a selectable element by the {@link module:engine/model/schema~SchemaItemDefinition}'s `isSelectable` property.
  27284. *
  27285. * schema.isSelectable( 'paragraph' ); // -> false
  27286. * schema.isSelectable( 'heading1' ); // -> false
  27287. * schema.isSelectable( 'image' ); // -> true
  27288. * schema.isSelectable( 'tableCell' ); // -> true
  27289. *
  27290. * const text = writer.createText( 'foo' );
  27291. * schema.isSelectable( text ); // -> false
  27292. *
  27293. * See the {@glink framework/guides/deep-dive/schema#selectable-elements Selectable elements} section of the Schema deep dive}
  27294. * guide for more details.
  27295. *
  27296. * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item
  27297. */
  27298. isSelectable( item ) {
  27299. const def = this.getDefinition( item );
  27300. if ( !def ) {
  27301. return false;
  27302. }
  27303. return !!( def.isSelectable || def.isObject );
  27304. }
  27305. /**
  27306. * Returns `true` if the given item is defined to be
  27307. * a content by the {@link module:engine/model/schema~SchemaItemDefinition}'s `isContent` property.
  27308. *
  27309. * schema.isContent( 'paragraph' ); // -> false
  27310. * schema.isContent( 'heading1' ); // -> false
  27311. * schema.isContent( 'image' ); // -> true
  27312. * schema.isContent( 'horizontalLine' ); // -> true
  27313. *
  27314. * const text = writer.createText( 'foo' );
  27315. * schema.isContent( text ); // -> true
  27316. *
  27317. * See the {@glink framework/guides/deep-dive/schema#content-elements Content elements} section of the Schema deep dive}
  27318. * guide for more details.
  27319. *
  27320. * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item
  27321. */
  27322. isContent( item ) {
  27323. const def = this.getDefinition( item );
  27324. if ( !def ) {
  27325. return false;
  27326. }
  27327. return !!( def.isContent || def.isObject );
  27328. }
  27329. /**
  27330. * Checks whether the given node (`child`) can be a child of the given context.
  27331. *
  27332. * schema.checkChild( model.document.getRoot(), paragraph ); // -> false
  27333. *
  27334. * schema.register( 'paragraph', {
  27335. * allowIn: '$root'
  27336. * } );
  27337. * schema.checkChild( model.document.getRoot(), paragraph ); // -> true
  27338. *
  27339. * Note: When verifying whether the given node can be a child of the given context, the
  27340. * schema also verifies the entire context &mdash; from its root to its last element. Therefore, it is possible
  27341. * for `checkChild()` to return `false` even though the context's last element can contain the checked child.
  27342. * It happens if one of the context's elements does not allow its child.
  27343. *
  27344. * @fires checkChild
  27345. * @param {module:engine/model/schema~SchemaContextDefinition} context The context in which the child will be checked.
  27346. * @param {module:engine/model/node~Node|String} def The child to check.
  27347. */
  27348. checkChild( context, def ) {
  27349. // Note: context and child are already normalized here to a SchemaContext and SchemaCompiledItemDefinition.
  27350. if ( !def ) {
  27351. return false;
  27352. }
  27353. return this._checkContextMatch( def, context );
  27354. }
  27355. /**
  27356. * Checks whether the given attribute can be applied in the given context (on the last
  27357. * item of the context).
  27358. *
  27359. * schema.checkAttribute( textNode, 'bold' ); // -> false
  27360. *
  27361. * schema.extend( '$text', {
  27362. * allowAttributes: 'bold'
  27363. * } );
  27364. * schema.checkAttribute( textNode, 'bold' ); // -> true
  27365. *
  27366. * @fires checkAttribute
  27367. * @param {module:engine/model/schema~SchemaContextDefinition} context The context in which the attribute will be checked.
  27368. * @param {String} attributeName
  27369. */
  27370. checkAttribute( context, attributeName ) {
  27371. const def = this.getDefinition( context.last );
  27372. if ( !def ) {
  27373. return false;
  27374. }
  27375. return def.allowAttributes.includes( attributeName );
  27376. }
  27377. /**
  27378. * Checks whether the given element (`elementToMerge`) can be merged with the specified base element (`positionOrBaseElement`).
  27379. *
  27380. * In other words &mdash; whether `elementToMerge`'s children {@link #checkChild are allowed} in the `positionOrBaseElement`.
  27381. *
  27382. * This check ensures that elements merged with {@link module:engine/model/writer~Writer#merge `Writer#merge()`}
  27383. * will be valid.
  27384. *
  27385. * Instead of elements, you can pass the instance of the {@link module:engine/model/position~Position} class as the
  27386. * `positionOrBaseElement`. It means that the elements before and after the position will be checked whether they can be merged.
  27387. *
  27388. * @param {module:engine/model/position~Position|module:engine/model/element~Element} positionOrBaseElement The position or base
  27389. * element to which the `elementToMerge` will be merged.
  27390. * @param {module:engine/model/element~Element} elementToMerge The element to merge. Required if `positionOrBaseElement` is an element.
  27391. * @returns {Boolean}
  27392. */
  27393. checkMerge( positionOrBaseElement, elementToMerge = null ) {
  27394. if ( positionOrBaseElement instanceof _position__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
  27395. const nodeBefore = positionOrBaseElement.nodeBefore;
  27396. const nodeAfter = positionOrBaseElement.nodeAfter;
  27397. if ( !( nodeBefore instanceof _element__WEBPACK_IMPORTED_MODULE_5__["default"] ) ) {
  27398. /**
  27399. * The node before the merge position must be an element.
  27400. *
  27401. * @error schema-check-merge-no-element-before
  27402. */
  27403. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  27404. 'schema-check-merge-no-element-before',
  27405. this
  27406. );
  27407. }
  27408. if ( !( nodeAfter instanceof _element__WEBPACK_IMPORTED_MODULE_5__["default"] ) ) {
  27409. /**
  27410. * The node after the merge position must be an element.
  27411. *
  27412. * @error schema-check-merge-no-element-after
  27413. */
  27414. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  27415. 'schema-check-merge-no-element-after',
  27416. this
  27417. );
  27418. }
  27419. return this.checkMerge( nodeBefore, nodeAfter );
  27420. }
  27421. for ( const child of elementToMerge.getChildren() ) {
  27422. if ( !this.checkChild( positionOrBaseElement, child ) ) {
  27423. return false;
  27424. }
  27425. }
  27426. return true;
  27427. }
  27428. /**
  27429. * Allows registering a callback to the {@link #checkChild} method calls.
  27430. *
  27431. * Callbacks allow you to implement rules which are not otherwise possible to achieve
  27432. * by using the declarative API of {@link module:engine/model/schema~SchemaItemDefinition}.
  27433. * For example, by using this method you can disallow elements in specific contexts.
  27434. *
  27435. * This method is a shorthand for using the {@link #event:checkChild} event. For even better control,
  27436. * you can use that event instead.
  27437. *
  27438. * Example:
  27439. *
  27440. * // Disallow heading1 directly inside a blockQuote.
  27441. * schema.addChildCheck( ( context, childDefinition ) => {
  27442. * if ( context.endsWith( 'blockQuote' ) && childDefinition.name == 'heading1' ) {
  27443. * return false;
  27444. * }
  27445. * } );
  27446. *
  27447. * Which translates to:
  27448. *
  27449. * schema.on( 'checkChild', ( evt, args ) => {
  27450. * const context = args[ 0 ];
  27451. * const childDefinition = args[ 1 ];
  27452. *
  27453. * if ( context.endsWith( 'blockQuote' ) && childDefinition && childDefinition.name == 'heading1' ) {
  27454. * // Prevent next listeners from being called.
  27455. * evt.stop();
  27456. * // Set the checkChild()'s return value.
  27457. * evt.return = false;
  27458. * }
  27459. * }, { priority: 'high' } );
  27460. *
  27461. * @param {Function} callback The callback to be called. It is called with two parameters:
  27462. * {@link module:engine/model/schema~SchemaContext} (context) instance and
  27463. * {@link module:engine/model/schema~SchemaCompiledItemDefinition} (child-to-check definition).
  27464. * The callback may return `true/false` to override `checkChild()`'s return value. If it does not return
  27465. * a boolean value, the default algorithm (or other callbacks) will define `checkChild()`'s return value.
  27466. */
  27467. addChildCheck( callback ) {
  27468. this.on( 'checkChild', ( evt, [ ctx, childDef ] ) => {
  27469. // checkChild() was called with a non-registered child.
  27470. // In 99% cases such check should return false, so not to overcomplicate all callbacks
  27471. // don't even execute them.
  27472. if ( !childDef ) {
  27473. return;
  27474. }
  27475. const retValue = callback( ctx, childDef );
  27476. if ( typeof retValue == 'boolean' ) {
  27477. evt.stop();
  27478. evt.return = retValue;
  27479. }
  27480. }, { priority: 'high' } );
  27481. }
  27482. /**
  27483. * Allows registering a callback to the {@link #checkAttribute} method calls.
  27484. *
  27485. * Callbacks allow you to implement rules which are not otherwise possible to achieve
  27486. * by using the declarative API of {@link module:engine/model/schema~SchemaItemDefinition}.
  27487. * For example, by using this method you can disallow attribute if node to which it is applied
  27488. * is contained within some other element (e.g. you want to disallow `bold` on `$text` within `heading1`).
  27489. *
  27490. * This method is a shorthand for using the {@link #event:checkAttribute} event. For even better control,
  27491. * you can use that event instead.
  27492. *
  27493. * Example:
  27494. *
  27495. * // Disallow bold on $text inside heading1.
  27496. * schema.addAttributeCheck( ( context, attributeName ) => {
  27497. * if ( context.endsWith( 'heading1 $text' ) && attributeName == 'bold' ) {
  27498. * return false;
  27499. * }
  27500. * } );
  27501. *
  27502. * Which translates to:
  27503. *
  27504. * schema.on( 'checkAttribute', ( evt, args ) => {
  27505. * const context = args[ 0 ];
  27506. * const attributeName = args[ 1 ];
  27507. *
  27508. * if ( context.endsWith( 'heading1 $text' ) && attributeName == 'bold' ) {
  27509. * // Prevent next listeners from being called.
  27510. * evt.stop();
  27511. * // Set the checkAttribute()'s return value.
  27512. * evt.return = false;
  27513. * }
  27514. * }, { priority: 'high' } );
  27515. *
  27516. * @param {Function} callback The callback to be called. It is called with two parameters:
  27517. * {@link module:engine/model/schema~SchemaContext} (context) instance and attribute name.
  27518. * The callback may return `true/false` to override `checkAttribute()`'s return value. If it does not return
  27519. * a boolean value, the default algorithm (or other callbacks) will define `checkAttribute()`'s return value.
  27520. */
  27521. addAttributeCheck( callback ) {
  27522. this.on( 'checkAttribute', ( evt, [ ctx, attributeName ] ) => {
  27523. const retValue = callback( ctx, attributeName );
  27524. if ( typeof retValue == 'boolean' ) {
  27525. evt.stop();
  27526. evt.return = retValue;
  27527. }
  27528. }, { priority: 'high' } );
  27529. }
  27530. /**
  27531. * This method allows assigning additional metadata to the model attributes. For example,
  27532. * {@link module:engine/model/schema~AttributeProperties `AttributeProperties#isFormatting` property} is
  27533. * used to mark formatting attributes (like `bold` or `italic`).
  27534. *
  27535. * // Mark bold as a formatting attribute.
  27536. * schema.setAttributeProperties( 'bold', {
  27537. * isFormatting: true
  27538. * } );
  27539. *
  27540. * // Override code not to be considered a formatting markup.
  27541. * schema.setAttributeProperties( 'code', {
  27542. * isFormatting: false
  27543. * } );
  27544. *
  27545. * Properties are not limited to members defined in the
  27546. * {@link module:engine/model/schema~AttributeProperties `AttributeProperties` type} and you can also use custom properties:
  27547. *
  27548. * schema.setAttributeProperties( 'blockQuote', {
  27549. * customProperty: 'value'
  27550. * } );
  27551. *
  27552. * Subsequent calls with the same attribute will extend its custom properties:
  27553. *
  27554. * schema.setAttributeProperties( 'blockQuote', {
  27555. * one: 1
  27556. * } );
  27557. *
  27558. * schema.setAttributeProperties( 'blockQuote', {
  27559. * two: 2
  27560. * } );
  27561. *
  27562. * console.log( schema.getAttributeProperties( 'blockQuote' ) );
  27563. * // Logs: { one: 1, two: 2 }
  27564. *
  27565. * @param {String} attributeName A name of the attribute to receive the properties.
  27566. * @param {module:engine/model/schema~AttributeProperties} properties A dictionary of properties.
  27567. */
  27568. setAttributeProperties( attributeName, properties ) {
  27569. this._attributeProperties[ attributeName ] = Object.assign( this.getAttributeProperties( attributeName ), properties );
  27570. }
  27571. /**
  27572. * Returns properties associated with a given model attribute. See {@link #setAttributeProperties `setAttributeProperties()`}.
  27573. *
  27574. * @param {String} attributeName A name of the attribute.
  27575. * @returns {module:engine/model/schema~AttributeProperties}
  27576. */
  27577. getAttributeProperties( attributeName ) {
  27578. return this._attributeProperties[ attributeName ] || {};
  27579. }
  27580. /**
  27581. * Returns the lowest {@link module:engine/model/schema~Schema#isLimit limit element} containing the entire
  27582. * selection/range/position or the root otherwise.
  27583. *
  27584. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection|
  27585. * module:engine/model/range~Range|module:engine/model/position~Position} selectionOrRangeOrPosition
  27586. * The selection/range/position to check.
  27587. * @returns {module:engine/model/element~Element} The lowest limit element containing
  27588. * the entire `selectionOrRangeOrPosition`.
  27589. */
  27590. getLimitElement( selectionOrRangeOrPosition ) {
  27591. let element;
  27592. if ( selectionOrRangeOrPosition instanceof _position__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
  27593. element = selectionOrRangeOrPosition.parent;
  27594. } else {
  27595. const ranges = selectionOrRangeOrPosition instanceof _range__WEBPACK_IMPORTED_MODULE_3__["default"] ?
  27596. [ selectionOrRangeOrPosition ] :
  27597. Array.from( selectionOrRangeOrPosition.getRanges() );
  27598. // Find the common ancestor for all selection's ranges.
  27599. element = ranges
  27600. .reduce( ( element, range ) => {
  27601. const rangeCommonAncestor = range.getCommonAncestor();
  27602. if ( !element ) {
  27603. return rangeCommonAncestor;
  27604. }
  27605. return element.getCommonAncestor( rangeCommonAncestor, { includeSelf: true } );
  27606. }, null );
  27607. }
  27608. while ( !this.isLimit( element ) ) {
  27609. if ( element.parent ) {
  27610. element = element.parent;
  27611. } else {
  27612. break;
  27613. }
  27614. }
  27615. return element;
  27616. }
  27617. /**
  27618. * Checks whether the attribute is allowed in selection:
  27619. *
  27620. * * if the selection is not collapsed, then checks if the attribute is allowed on any of nodes in that range,
  27621. * * if the selection is collapsed, then checks if on the selection position there's a text with the
  27622. * specified attribute allowed.
  27623. *
  27624. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  27625. * Selection which will be checked.
  27626. * @param {String} attribute The name of the attribute to check.
  27627. * @returns {Boolean}
  27628. */
  27629. checkAttributeInSelection( selection, attribute ) {
  27630. if ( selection.isCollapsed ) {
  27631. const firstPosition = selection.getFirstPosition();
  27632. const context = [
  27633. ...firstPosition.getAncestors(),
  27634. new _text__WEBPACK_IMPORTED_MODULE_6__["default"]( '', selection.getAttributes() )
  27635. ];
  27636. // Check whether schema allows for a text with the attribute in the selection.
  27637. return this.checkAttribute( context, attribute );
  27638. } else {
  27639. const ranges = selection.getRanges();
  27640. // For all ranges, check nodes in them until you find a node that is allowed to have the attribute.
  27641. for ( const range of ranges ) {
  27642. for ( const value of range ) {
  27643. if ( this.checkAttribute( value.item, attribute ) ) {
  27644. // If we found a node that is allowed to have the attribute, return true.
  27645. return true;
  27646. }
  27647. }
  27648. }
  27649. }
  27650. // If we haven't found such node, return false.
  27651. return false;
  27652. }
  27653. /**
  27654. * Transforms the given set of ranges into a set of ranges where the given attribute is allowed (and can be applied).
  27655. *
  27656. * @param {Array.<module:engine/model/range~Range>} ranges Ranges to be validated.
  27657. * @param {String} attribute The name of the attribute to check.
  27658. * @returns {Iterable.<module:engine/model/range~Range>} Ranges in which the attribute is allowed.
  27659. */
  27660. * getValidRanges( ranges, attribute ) {
  27661. ranges = convertToMinimalFlatRanges( ranges );
  27662. for ( const range of ranges ) {
  27663. yield* this._getValidRangesForRange( range, attribute );
  27664. }
  27665. }
  27666. /**
  27667. * Basing on given `position`, finds and returns a {@link module:engine/model/range~Range range} which is
  27668. * nearest to that `position` and is a correct range for selection.
  27669. *
  27670. * The correct selection range might be collapsed when it is located in a position where the text node can be placed.
  27671. * Non-collapsed range is returned when selection can be placed around element marked as an "object" in
  27672. * the {@link module:engine/model/schema~Schema schema}.
  27673. *
  27674. * Direction of searching for the nearest correct selection range can be specified as:
  27675. *
  27676. * * `both` - searching will be performed in both ways,
  27677. * * `forward` - searching will be performed only forward,
  27678. * * `backward` - searching will be performed only backward.
  27679. *
  27680. * When valid selection range cannot be found, `null` is returned.
  27681. *
  27682. * @param {module:engine/model/position~Position} position Reference position where new selection range should be looked for.
  27683. * @param {'both'|'forward'|'backward'} [direction='both'] Search direction.
  27684. * @returns {module:engine/model/range~Range|null} Nearest selection range or `null` if one cannot be found.
  27685. */
  27686. getNearestSelectionRange( position, direction = 'both' ) {
  27687. // Return collapsed range if provided position is valid.
  27688. if ( this.checkChild( position, '$text' ) ) {
  27689. return new _range__WEBPACK_IMPORTED_MODULE_3__["default"]( position );
  27690. }
  27691. let backwardWalker, forwardWalker;
  27692. // Never leave a limit element.
  27693. const limitElement = position.getAncestors().reverse().find( item => this.isLimit( item ) ) || position.root;
  27694. if ( direction == 'both' || direction == 'backward' ) {
  27695. backwardWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_7__["default"]( {
  27696. boundaries: _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createIn( limitElement ),
  27697. startPosition: position,
  27698. direction: 'backward'
  27699. } );
  27700. }
  27701. if ( direction == 'both' || direction == 'forward' ) {
  27702. forwardWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_7__["default"]( {
  27703. boundaries: _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createIn( limitElement ),
  27704. startPosition: position
  27705. } );
  27706. }
  27707. for ( const data of combineWalkers( backwardWalker, forwardWalker ) ) {
  27708. const type = ( data.walker == backwardWalker ? 'elementEnd' : 'elementStart' );
  27709. const value = data.value;
  27710. if ( value.type == type && this.isObject( value.item ) ) {
  27711. return _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createOn( value.item );
  27712. }
  27713. if ( this.checkChild( value.nextPosition, '$text' ) ) {
  27714. return new _range__WEBPACK_IMPORTED_MODULE_3__["default"]( value.nextPosition );
  27715. }
  27716. }
  27717. return null;
  27718. }
  27719. /**
  27720. * Tries to find position ancestors that allow to insert a given node.
  27721. * It starts searching from the given position and goes node by node to the top of the model tree
  27722. * as long as a {@link module:engine/model/schema~Schema#isLimit limit element}, an
  27723. * {@link module:engine/model/schema~Schema#isObject object element} or a topmost ancestor is not reached.
  27724. *
  27725. * @param {module:engine/model/position~Position} position The position that the search will start from.
  27726. * @param {module:engine/model/node~Node|String} node The node for which an allowed parent should be found or its name.
  27727. * @returns {module:engine/model/element~Element|null} element Allowed parent or null if nothing was found.
  27728. */
  27729. findAllowedParent( position, node ) {
  27730. let parent = position.parent;
  27731. while ( parent ) {
  27732. if ( this.checkChild( parent, node ) ) {
  27733. return parent;
  27734. }
  27735. // Do not split limit elements.
  27736. if ( this.isLimit( parent ) ) {
  27737. return null;
  27738. }
  27739. parent = parent.parent;
  27740. }
  27741. return null;
  27742. }
  27743. /**
  27744. * Removes attributes disallowed by the schema.
  27745. *
  27746. * @param {Iterable.<module:engine/model/node~Node>} nodes Nodes that will be filtered.
  27747. * @param {module:engine/model/writer~Writer} writer
  27748. */
  27749. removeDisallowedAttributes( nodes, writer ) {
  27750. for ( const node of nodes ) {
  27751. // When node is a `Text` it has no children, so just filter it out.
  27752. if ( node.is( '$text' ) ) {
  27753. removeDisallowedAttributeFromNode( this, node, writer );
  27754. }
  27755. // In a case of `Element` iterates through positions between nodes inside this element
  27756. // and filter out node before the current position, or position parent when position
  27757. // is at start of an element. Using positions prevent from omitting merged nodes
  27758. // see https://github.com/ckeditor/ckeditor5-engine/issues/1789.
  27759. else {
  27760. const rangeInNode = _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createIn( node );
  27761. const positionsInRange = rangeInNode.getPositions();
  27762. for ( const position of positionsInRange ) {
  27763. const item = position.nodeBefore || position.parent;
  27764. removeDisallowedAttributeFromNode( this, item, writer );
  27765. }
  27766. }
  27767. }
  27768. }
  27769. /**
  27770. * Creates an instance of the schema context.
  27771. *
  27772. * @param {module:engine/model/schema~SchemaContextDefinition} context
  27773. * @returns {module:engine/model/schema~SchemaContext}
  27774. */
  27775. createContext( context ) {
  27776. return new SchemaContext( context );
  27777. }
  27778. /**
  27779. * @private
  27780. */
  27781. _clearCache() {
  27782. this._compiledDefinitions = null;
  27783. }
  27784. /**
  27785. * @private
  27786. */
  27787. _compile() {
  27788. const compiledDefinitions = {};
  27789. const sourceRules = this._sourceDefinitions;
  27790. const itemNames = Object.keys( sourceRules );
  27791. for ( const itemName of itemNames ) {
  27792. compiledDefinitions[ itemName ] = compileBaseItemRule( sourceRules[ itemName ], itemName );
  27793. }
  27794. for ( const itemName of itemNames ) {
  27795. compileAllowContentOf( compiledDefinitions, itemName );
  27796. }
  27797. for ( const itemName of itemNames ) {
  27798. compileAllowWhere( compiledDefinitions, itemName );
  27799. }
  27800. for ( const itemName of itemNames ) {
  27801. compileAllowAttributesOf( compiledDefinitions, itemName );
  27802. compileInheritPropertiesFrom( compiledDefinitions, itemName );
  27803. }
  27804. for ( const itemName of itemNames ) {
  27805. cleanUpAllowIn( compiledDefinitions, itemName );
  27806. cleanUpAllowAttributes( compiledDefinitions, itemName );
  27807. }
  27808. this._compiledDefinitions = compiledDefinitions;
  27809. }
  27810. /**
  27811. * @private
  27812. * @param {module:engine/model/schema~SchemaCompiledItemDefinition} def
  27813. * @param {module:engine/model/schema~SchemaContext} context
  27814. * @param {Number} contextItemIndex
  27815. */
  27816. _checkContextMatch( def, context, contextItemIndex = context.length - 1 ) {
  27817. const contextItem = context.getItem( contextItemIndex );
  27818. if ( def.allowIn.includes( contextItem.name ) ) {
  27819. if ( contextItemIndex == 0 ) {
  27820. return true;
  27821. } else {
  27822. const parentRule = this.getDefinition( contextItem );
  27823. return this._checkContextMatch( parentRule, context, contextItemIndex - 1 );
  27824. }
  27825. } else {
  27826. return false;
  27827. }
  27828. }
  27829. /**
  27830. * Takes a flat range and an attribute name. Traverses the range recursively and deeply to find and return all ranges
  27831. * inside the given range on which the attribute can be applied.
  27832. *
  27833. * This is a helper function for {@link ~Schema#getValidRanges}.
  27834. *
  27835. * @private
  27836. * @param {module:engine/model/range~Range} range The range to process.
  27837. * @param {String} attribute The name of the attribute to check.
  27838. * @returns {Iterable.<module:engine/model/range~Range>} Ranges in which the attribute is allowed.
  27839. */
  27840. * _getValidRangesForRange( range, attribute ) {
  27841. let start = range.start;
  27842. let end = range.start;
  27843. for ( const item of range.getItems( { shallow: true } ) ) {
  27844. if ( item.is( 'element' ) ) {
  27845. yield* this._getValidRangesForRange( _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createIn( item ), attribute );
  27846. }
  27847. if ( !this.checkAttribute( item, attribute ) ) {
  27848. if ( !start.isEqual( end ) ) {
  27849. yield new _range__WEBPACK_IMPORTED_MODULE_3__["default"]( start, end );
  27850. }
  27851. start = _position__WEBPACK_IMPORTED_MODULE_4__["default"]._createAfter( item );
  27852. }
  27853. end = _position__WEBPACK_IMPORTED_MODULE_4__["default"]._createAfter( item );
  27854. }
  27855. if ( !start.isEqual( end ) ) {
  27856. yield new _range__WEBPACK_IMPORTED_MODULE_3__["default"]( start, end );
  27857. }
  27858. }
  27859. }
  27860. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( Schema, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  27861. /**
  27862. * Event fired when the {@link #checkChild} method is called. It allows plugging in
  27863. * additional behavior, for example implementing rules which cannot be defined using the declarative
  27864. * {@link module:engine/model/schema~SchemaItemDefinition} interface.
  27865. *
  27866. * **Note:** The {@link #addChildCheck} method is a more handy way to register callbacks. Internally,
  27867. * it registers a listener to this event but comes with a simpler API and it is the recommended choice
  27868. * in most of the cases.
  27869. *
  27870. * The {@link #checkChild} method fires an event because it is
  27871. * {@link module:utils/observablemixin~ObservableMixin#decorate decorated} with it. Thanks to that you can
  27872. * use this event in various ways, but the most important use case is overriding standard behavior of the
  27873. * `checkChild()` method. Let's see a typical listener template:
  27874. *
  27875. * schema.on( 'checkChild', ( evt, args ) => {
  27876. * const context = args[ 0 ];
  27877. * const childDefinition = args[ 1 ];
  27878. * }, { priority: 'high' } );
  27879. *
  27880. * The listener is added with a `high` priority to be executed before the default method is really called. The `args` callback
  27881. * parameter contains arguments passed to `checkChild( context, child )`. However, the `context` parameter is already
  27882. * normalized to a {@link module:engine/model/schema~SchemaContext} instance and `child` to a
  27883. * {@link module:engine/model/schema~SchemaCompiledItemDefinition} instance, so you do not have to worry about
  27884. * the various ways how `context` and `child` may be passed to `checkChild()`.
  27885. *
  27886. * **Note:** `childDefinition` may be `undefined` if `checkChild()` was called with a non-registered element.
  27887. *
  27888. * So, in order to implement a rule "disallow `heading1` in `blockQuote`", you can add such a listener:
  27889. *
  27890. * schema.on( 'checkChild', ( evt, args ) => {
  27891. * const context = args[ 0 ];
  27892. * const childDefinition = args[ 1 ];
  27893. *
  27894. * if ( context.endsWith( 'blockQuote' ) && childDefinition && childDefinition.name == 'heading1' ) {
  27895. * // Prevent next listeners from being called.
  27896. * evt.stop();
  27897. * // Set the checkChild()'s return value.
  27898. * evt.return = false;
  27899. * }
  27900. * }, { priority: 'high' } );
  27901. *
  27902. * Allowing elements in specific contexts will be a far less common use case, because it is normally handled by the
  27903. * `allowIn` rule from {@link module:engine/model/schema~SchemaItemDefinition}. But if you have a complex scenario
  27904. * where `listItem` should be allowed only in element `foo` which must be in element `bar`, then this would be the way:
  27905. *
  27906. * schema.on( 'checkChild', ( evt, args ) => {
  27907. * const context = args[ 0 ];
  27908. * const childDefinition = args[ 1 ];
  27909. *
  27910. * if ( context.endsWith( 'bar foo' ) && childDefinition.name == 'listItem' ) {
  27911. * // Prevent next listeners from being called.
  27912. * evt.stop();
  27913. * // Set the checkChild()'s return value.
  27914. * evt.return = true;
  27915. * }
  27916. * }, { priority: 'high' } );
  27917. *
  27918. * @event checkChild
  27919. * @param {Array} args The `checkChild()`'s arguments.
  27920. */
  27921. /**
  27922. * Event fired when the {@link #checkAttribute} method is called. It allows plugging in
  27923. * additional behavior, for example implementing rules which cannot be defined using the declarative
  27924. * {@link module:engine/model/schema~SchemaItemDefinition} interface.
  27925. *
  27926. * **Note:** The {@link #addAttributeCheck} method is a more handy way to register callbacks. Internally,
  27927. * it registers a listener to this event but comes with a simpler API and it is the recommended choice
  27928. * in most of the cases.
  27929. *
  27930. * The {@link #checkAttribute} method fires an event because it is
  27931. * {@link module:utils/observablemixin~ObservableMixin#decorate decorated} with it. Thanks to that you can
  27932. * use this event in various ways, but the most important use case is overriding the standard behavior of the
  27933. * `checkAttribute()` method. Let's see a typical listener template:
  27934. *
  27935. * schema.on( 'checkAttribute', ( evt, args ) => {
  27936. * const context = args[ 0 ];
  27937. * const attributeName = args[ 1 ];
  27938. * }, { priority: 'high' } );
  27939. *
  27940. * The listener is added with a `high` priority to be executed before the default method is really called. The `args` callback
  27941. * parameter contains arguments passed to `checkAttribute( context, attributeName )`. However, the `context` parameter is already
  27942. * normalized to a {@link module:engine/model/schema~SchemaContext} instance, so you do not have to worry about
  27943. * the various ways how `context` may be passed to `checkAttribute()`.
  27944. *
  27945. * So, in order to implement a rule "disallow `bold` in a text which is in a `heading1`, you can add such a listener:
  27946. *
  27947. * schema.on( 'checkAttribute', ( evt, args ) => {
  27948. * const context = args[ 0 ];
  27949. * const attributeName = args[ 1 ];
  27950. *
  27951. * if ( context.endsWith( 'heading1 $text' ) && attributeName == 'bold' ) {
  27952. * // Prevent next listeners from being called.
  27953. * evt.stop();
  27954. * // Set the checkAttribute()'s return value.
  27955. * evt.return = false;
  27956. * }
  27957. * }, { priority: 'high' } );
  27958. *
  27959. * Allowing attributes in specific contexts will be a far less common use case, because it is normally handled by the
  27960. * `allowAttributes` rule from {@link module:engine/model/schema~SchemaItemDefinition}. But if you have a complex scenario
  27961. * where `bold` should be allowed only in element `foo` which must be in element `bar`, then this would be the way:
  27962. *
  27963. * schema.on( 'checkAttribute', ( evt, args ) => {
  27964. * const context = args[ 0 ];
  27965. * const attributeName = args[ 1 ];
  27966. *
  27967. * if ( context.endsWith( 'bar foo $text' ) && attributeName == 'bold' ) {
  27968. * // Prevent next listeners from being called.
  27969. * evt.stop();
  27970. * // Set the checkAttribute()'s return value.
  27971. * evt.return = true;
  27972. * }
  27973. * }, { priority: 'high' } );
  27974. *
  27975. * @event checkAttribute
  27976. * @param {Array} args The `checkAttribute()`'s arguments.
  27977. */
  27978. /**
  27979. * A definition of a {@link module:engine/model/schema~Schema schema} item.
  27980. *
  27981. * You can define the following rules:
  27982. *
  27983. * * {@link ~SchemaItemDefinition#allowIn `allowIn`} &ndash; Defines in which other items this item will be allowed.
  27984. * * {@link ~SchemaItemDefinition#allowAttributes `allowAttributes`} &ndash; Defines allowed attributes of the given item.
  27985. * * {@link ~SchemaItemDefinition#allowContentOf `allowContentOf`} &ndash; Inherits "allowed children" from other items.
  27986. * * {@link ~SchemaItemDefinition#allowWhere `allowWhere`} &ndash; Inherits "allowed in" from other items.
  27987. * * {@link ~SchemaItemDefinition#allowAttributesOf `allowAttributesOf`} &ndash; Inherits attributes from other items.
  27988. * * {@link ~SchemaItemDefinition#inheritTypesFrom `inheritTypesFrom`} &ndash; Inherits `is*` properties of other items.
  27989. * * {@link ~SchemaItemDefinition#inheritAllFrom `inheritAllFrom`} &ndash;
  27990. * A shorthand for `allowContentOf`, `allowWhere`, `allowAttributesOf`, `inheritTypesFrom`.
  27991. *
  27992. * # The `is*` properties
  27993. *
  27994. * There are a couple commonly used `is*` properties. Their role is to assign additional semantics to schema items.
  27995. * You can define more properties but you will also need to implement support for them in the existing editor features.
  27996. *
  27997. * * {@link ~SchemaItemDefinition#isBlock `isBlock`} &ndash; Whether this item is paragraph-like.
  27998. * Generally speaking, content is usually made out of blocks like paragraphs, list items, images, headings, etc.
  27999. * * {@link ~SchemaItemDefinition#isInline `isInline`} &ndash; Whether an item is "text-like" and should be treated as an inline node.
  28000. * Examples of inline elements: `$text`, `softBreak` (`<br>`), etc.
  28001. * * {@link ~SchemaItemDefinition#isLimit `isLimit`} &ndash; It can be understood as whether this element
  28002. * should not be split by <kbd>Enter</kbd>. Examples of limit elements: `$root`, table cell, image caption, etc.
  28003. * In other words, all actions that happen inside a limit element are limited to its content.
  28004. * All objects are treated as limit elements, too.
  28005. * * {@link ~SchemaItemDefinition#isObject `isObject`} &ndash; Whether an item is "self-contained" and should be treated as a whole.
  28006. * Examples of object elements: `image`, `table`, `video`, etc. An object is also a limit, so
  28007. * {@link module:engine/model/schema~Schema#isLimit `isLimit()`} returns `true` for object elements automatically.
  28008. *
  28009. * Read more about the meaning of these types in the
  28010. * {@glink framework/guides/deep-dive/schema#defining-additional-semantics dedicated section of the Schema deep dive} guide.
  28011. *
  28012. * # Generic items
  28013. *
  28014. * There are three basic generic items: `$root`, `$block` and `$text`.
  28015. * They are defined as follows:
  28016. *
  28017. * this.schema.register( '$root', {
  28018. * isLimit: true
  28019. * } );
  28020. * this.schema.register( '$block', {
  28021. * allowIn: '$root',
  28022. * isBlock: true
  28023. * } );
  28024. * this.schema.register( '$text', {
  28025. * allowIn: '$block',
  28026. * isInline: true
  28027. * } );
  28028. *
  28029. * They reflect typical editor content that is contained within one root, consists of several blocks
  28030. * (paragraphs, lists items, headings, images) which, in turn, may contain text inside.
  28031. *
  28032. * By inheriting from the generic items you can define new items which will get extended by other editor features.
  28033. * Read more about generic types in the {@glink framework/guides/deep-dive/schema Schema deep dive} guide.
  28034. *
  28035. * # Example definitions
  28036. *
  28037. * Allow `paragraph` in roots and block quotes:
  28038. *
  28039. * schema.register( 'paragraph', {
  28040. * allowIn: [ '$root', 'blockQuote' ],
  28041. * isBlock: true
  28042. * } );
  28043. *
  28044. * Allow `paragraph` everywhere where `$block` is allowed (i.e. in `$root`):
  28045. *
  28046. * schema.register( 'paragraph', {
  28047. * allowWhere: '$block',
  28048. * isBlock: true
  28049. * } );
  28050. *
  28051. * Make `image` a block object, which is allowed everywhere where `$block` is.
  28052. * Also, allow `src` and `alt` attributes in it:
  28053. *
  28054. * schema.register( 'image', {
  28055. * allowWhere: '$block',
  28056. * allowAttributes: [ 'src', 'alt' ],
  28057. * isBlock: true,
  28058. * isObject: true
  28059. * } );
  28060. *
  28061. * Make `caption` allowed in `image` and make it allow all the content of `$block`s (usually, `$text`).
  28062. * Also, mark it as a limit element so it cannot be split:
  28063. *
  28064. * schema.register( 'caption', {
  28065. * allowIn: 'image',
  28066. * allowContentOf: '$block',
  28067. * isLimit: true
  28068. * } );
  28069. *
  28070. * Make `listItem` inherit all from `$block` but also allow additional attributes:
  28071. *
  28072. * schema.register( 'listItem', {
  28073. * inheritAllFrom: '$block',
  28074. * allowAttributes: [ 'listType', 'listIndent' ]
  28075. * } );
  28076. *
  28077. * Which translates to:
  28078. *
  28079. * schema.register( 'listItem', {
  28080. * allowWhere: '$block',
  28081. * allowContentOf: '$block',
  28082. * allowAttributesOf: '$block',
  28083. * inheritTypesFrom: '$block',
  28084. * allowAttributes: [ 'listType', 'listIndent' ]
  28085. * } );
  28086. *
  28087. * # Tips
  28088. *
  28089. * * Check schema definitions of existing features to see how they are defined.
  28090. * * If you want to publish your feature so other developers can use it, try to use
  28091. * generic items as much as possible.
  28092. * * Keep your model clean. Limit it to the actual data and store information in a normalized way.
  28093. * * Remember about defining the `is*` properties. They do not affect the allowed structures, but they can
  28094. * affect how the editor features treat your elements.
  28095. *
  28096. * @typedef {Object} module:engine/model/schema~SchemaItemDefinition
  28097. *
  28098. * @property {String|Array.<String>} allowIn Defines in which other items this item will be allowed.
  28099. * @property {String|Array.<String>} allowAttributes Defines allowed attributes of the given item.
  28100. * @property {String|Array.<String>} allowContentOf Inherits "allowed children" from other items.
  28101. * @property {String|Array.<String>} allowWhere Inherits "allowed in" from other items.
  28102. * @property {String|Array.<String>} allowAttributesOf Inherits attributes from other items.
  28103. * @property {String|Array.<String>} inheritTypesFrom Inherits `is*` properties of other items.
  28104. * @property {String} inheritAllFrom A shorthand for `allowContentOf`, `allowWhere`, `allowAttributesOf`, `inheritTypesFrom`.
  28105. *
  28106. * @property {Boolean} isBlock
  28107. * Whether this item is paragraph-like. Generally speaking, content is usually made out of blocks
  28108. * like paragraphs, list items, images, headings, etc. All these elements are marked as blocks. A block
  28109. * should not allow another block inside. Note: There is also the `$block` generic item which has `isBlock` set to `true`.
  28110. * Most block type items will inherit from `$block` (through `inheritAllFrom`).
  28111. *
  28112. * Read more about the block elements in the
  28113. * {@glink framework/guides/deep-dive/schema#block-elements Block elements} section of the Schema deep dive} guide.
  28114. *
  28115. * @property {Boolean} isInline
  28116. * Whether an item is "text-like" and should be treated as an inline node. Examples of inline elements:
  28117. * `$text`, `softBreak` (`<br>`), etc.
  28118. *
  28119. * Read more about the inline elements in the
  28120. * {@glink framework/guides/deep-dive/schema#inline-elements Inline elements} section of the Schema deep dive} guide.
  28121. *
  28122. * @property {Boolean} isLimit
  28123. * It can be understood as whether this element should not be split by <kbd>Enter</kbd>.
  28124. * Examples of limit elements: `$root`, table cell, image caption, etc. In other words, all actions that happen inside
  28125. * a limit element are limited to its content.
  28126. *
  28127. * Read more about the limit elements in the
  28128. * {@glink framework/guides/deep-dive/schema#limit-elements Limit elements} section of the Schema deep dive} guide.
  28129. *
  28130. * @property {Boolean} isObject
  28131. * Whether an item is "self-contained" and should be treated as a whole. Examples of object elements:
  28132. * `image`, `table`, `video`, etc.
  28133. *
  28134. * **Note:** An object is also a limit, so
  28135. * {@link module:engine/model/schema~Schema#isLimit `isLimit()`} returns `true` for object elements automatically.
  28136. *
  28137. * Read more about the object elements in the
  28138. * {@glink framework/guides/deep-dive/schema#object-elements Object elements} section of the Schema deep dive} guide.
  28139. *
  28140. * @property {Boolean} isSelectable
  28141. * `true` when an element should be selectable as a whole by the user. Examples of selectable elements: `image`, `table`, `tableCell`, etc.
  28142. *
  28143. * **Note:** An object is also a selectable element, so
  28144. * {@link module:engine/model/schema~Schema#isSelectable `isSelectable()`} returns `true` for object elements automatically.
  28145. *
  28146. * Read more about selectable elements in the
  28147. * {@glink framework/guides/deep-dive/schema#selectable-elements Selectable elements} section of the Schema deep dive} guide.
  28148. *
  28149. * @property {Boolean} isContent
  28150. * An item is a content when it always finds its way to the editor data output regardless of the number and type of its descendants.
  28151. * Examples of content elements: `$text`, `image`, `table`, etc. (but not `paragraph`, `heading1` or `tableCell`).
  28152. *
  28153. * **Note:** An object is also a content element, so
  28154. * {@link module:engine/model/schema~Schema#isContent `isContent()`} returns `true` for object elements automatically.
  28155. *
  28156. * Read more about content elements in the
  28157. * {@glink framework/guides/deep-dive/schema#content-elements Content elements} section of the Schema deep dive} guide.
  28158. */
  28159. /**
  28160. * A simplified version of {@link module:engine/model/schema~SchemaItemDefinition} after
  28161. * compilation by the {@link module:engine/model/schema~Schema schema}.
  28162. * Rules fed to the schema by {@link module:engine/model/schema~Schema#register}
  28163. * and {@link module:engine/model/schema~Schema#extend} methods are defined in the
  28164. * {@link module:engine/model/schema~SchemaItemDefinition} format.
  28165. * Later on, they are compiled to `SchemaCompiledItemDefinition` so when you use e.g.
  28166. * the {@link module:engine/model/schema~Schema#getDefinition} method you get the compiled version.
  28167. *
  28168. * The compiled version contains only the following properties:
  28169. *
  28170. * * The `name` property,
  28171. * * The `is*` properties,
  28172. * * The `allowIn` array,
  28173. * * The `allowAttributes` array.
  28174. *
  28175. * @typedef {Object} module:engine/model/schema~SchemaCompiledItemDefinition
  28176. */
  28177. /**
  28178. * A schema context &mdash; a list of ancestors of a given position in the document.
  28179. *
  28180. * Considering such position:
  28181. *
  28182. * <$root>
  28183. * <blockQuote>
  28184. * <paragraph>
  28185. * ^
  28186. * </paragraph>
  28187. * </blockQuote>
  28188. * </$root>
  28189. *
  28190. * The context of this position is its {@link module:engine/model/position~Position#getAncestors lists of ancestors}:
  28191. *
  28192. * [ rootElement, blockQuoteElement, paragraphElement ]
  28193. *
  28194. * Contexts are used in the {@link module:engine/model/schema~Schema#event:checkChild `Schema#checkChild`} and
  28195. * {@link module:engine/model/schema~Schema#event:checkAttribute `Schema#checkAttribute`} events as a definition
  28196. * of a place in the document where the check occurs. The context instances are created based on the first arguments
  28197. * of the {@link module:engine/model/schema~Schema#checkChild `Schema#checkChild()`} and
  28198. * {@link module:engine/model/schema~Schema#checkAttribute `Schema#checkAttribute()`} methods so when
  28199. * using these methods you need to use {@link module:engine/model/schema~SchemaContextDefinition}s.
  28200. */
  28201. class SchemaContext {
  28202. /**
  28203. * Creates an instance of the context.
  28204. *
  28205. * @param {module:engine/model/schema~SchemaContextDefinition} context
  28206. */
  28207. constructor( context ) {
  28208. if ( context instanceof SchemaContext ) {
  28209. return context;
  28210. }
  28211. if ( typeof context == 'string' ) {
  28212. context = [ context ];
  28213. } else if ( !Array.isArray( context ) ) {
  28214. // `context` is item or position.
  28215. // Position#getAncestors() doesn't accept any parameters but it works just fine here.
  28216. context = context.getAncestors( { includeSelf: true } );
  28217. }
  28218. if ( context[ 0 ] && typeof context[ 0 ] != 'string' && context[ 0 ].is( 'documentFragment' ) ) {
  28219. context.shift();
  28220. }
  28221. this._items = context.map( mapContextItem );
  28222. }
  28223. /**
  28224. * The number of items.
  28225. *
  28226. * @type {Number}
  28227. */
  28228. get length() {
  28229. return this._items.length;
  28230. }
  28231. /**
  28232. * The last item (the lowest node).
  28233. *
  28234. * @type {module:engine/model/schema~SchemaContextItem}
  28235. */
  28236. get last() {
  28237. return this._items[ this._items.length - 1 ];
  28238. }
  28239. /**
  28240. * Iterable interface.
  28241. *
  28242. * Iterates over all context items.
  28243. *
  28244. * @returns {Iterable.<module:engine/model/schema~SchemaContextItem>}
  28245. */
  28246. [ Symbol.iterator ]() {
  28247. return this._items[ Symbol.iterator ]();
  28248. }
  28249. /**
  28250. * Returns a new schema context instance with an additional item.
  28251. *
  28252. * Item can be added as:
  28253. *
  28254. * const context = new SchemaContext( [ '$root' ] );
  28255. *
  28256. * // An element.
  28257. * const fooElement = writer.createElement( 'fooElement' );
  28258. * const newContext = context.push( fooElement ); // [ '$root', 'fooElement' ]
  28259. *
  28260. * // A text node.
  28261. * const text = writer.createText( 'foobar' );
  28262. * const newContext = context.push( text ); // [ '$root', '$text' ]
  28263. *
  28264. * // A string (element name).
  28265. * const newContext = context.push( 'barElement' ); // [ '$root', 'barElement' ]
  28266. *
  28267. * **Note** {@link module:engine/model/node~Node} that is already in the model tree will be added as the only item
  28268. * (without ancestors).
  28269. *
  28270. * @param {String|module:engine/model/node~Node|Array<String|module:engine/model/node~Node>} item An item that will be added
  28271. * to the current context.
  28272. * @returns {module:engine/model/schema~SchemaContext} A new schema context instance with an additional item.
  28273. */
  28274. push( item ) {
  28275. const ctx = new SchemaContext( [ item ] );
  28276. ctx._items = [ ...this._items, ...ctx._items ];
  28277. return ctx;
  28278. }
  28279. /**
  28280. * Gets an item on the given index.
  28281. *
  28282. * @returns {module:engine/model/schema~SchemaContextItem}
  28283. */
  28284. getItem( index ) {
  28285. return this._items[ index ];
  28286. }
  28287. /**
  28288. * Returns the names of items.
  28289. *
  28290. * @returns {Iterable.<String>}
  28291. */
  28292. * getNames() {
  28293. yield* this._items.map( item => item.name );
  28294. }
  28295. /**
  28296. * Checks whether the context ends with the given nodes.
  28297. *
  28298. * const ctx = new SchemaContext( [ rootElement, paragraphElement, textNode ] );
  28299. *
  28300. * ctx.endsWith( '$text' ); // -> true
  28301. * ctx.endsWith( 'paragraph $text' ); // -> true
  28302. * ctx.endsWith( '$root' ); // -> false
  28303. * ctx.endsWith( 'paragraph' ); // -> false
  28304. *
  28305. * @param {String} query
  28306. * @returns {Boolean}
  28307. */
  28308. endsWith( query ) {
  28309. return Array.from( this.getNames() ).join( ' ' ).endsWith( query );
  28310. }
  28311. /**
  28312. * Checks whether the context starts with the given nodes.
  28313. *
  28314. * const ctx = new SchemaContext( [ rootElement, paragraphElement, textNode ] );
  28315. *
  28316. * ctx.endsWith( '$root' ); // -> true
  28317. * ctx.endsWith( '$root paragraph' ); // -> true
  28318. * ctx.endsWith( '$text' ); // -> false
  28319. * ctx.endsWith( 'paragraph' ); // -> false
  28320. *
  28321. * @param {String} query
  28322. * @returns {Boolean}
  28323. */
  28324. startsWith( query ) {
  28325. return Array.from( this.getNames() ).join( ' ' ).startsWith( query );
  28326. }
  28327. }
  28328. /**
  28329. * The definition of a {@link module:engine/model/schema~SchemaContext schema context}.
  28330. *
  28331. * Contexts can be created in multiple ways:
  28332. *
  28333. * * By defining a **node** – in this cases this node and all its ancestors will be used.
  28334. * * By defining a **position** in the document – in this case all its ancestors will be used.
  28335. * * By defining an **array of nodes** – in this case this array defines the entire context.
  28336. * * By defining a **name of node** - in this case node will be "mocked". It is not recommended because context
  28337. * will be unrealistic (e.g. attributes of these nodes are not specified). However, at times this may be the only
  28338. * way to define the context (e.g. when checking some hypothetical situation).
  28339. * * By defining an **array of node names** (potentially, mixed with real nodes) – The same as **name of node**
  28340. * but it is possible to create a path.
  28341. * * By defining a {@link module:engine/model/schema~SchemaContext} instance - in this case the same instance as provided
  28342. * will be return.
  28343. *
  28344. * Examples of context definitions passed to the {@link module:engine/model/schema~Schema#checkChild `Schema#checkChild()`}
  28345. * method:
  28346. *
  28347. * // Assuming that we have a $root > blockQuote > paragraph structure, the following code
  28348. * // will check node 'foo' in the following context:
  28349. * // [ rootElement, blockQuoteElement, paragraphElement ]
  28350. * const contextDefinition = paragraphElement;
  28351. * const childToCheck = 'foo';
  28352. * schema.checkChild( contextDefinition, childToCheck );
  28353. *
  28354. * // Also check in [ rootElement, blockQuoteElement, paragraphElement ].
  28355. * schema.checkChild( model.createPositionAt( paragraphElement, 0 ), 'foo' );
  28356. *
  28357. * // Check in [ rootElement, paragraphElement ].
  28358. * schema.checkChild( [ rootElement, paragraphElement ], 'foo' );
  28359. *
  28360. * // Check only fakeParagraphElement.
  28361. * schema.checkChild( 'paragraph', 'foo' );
  28362. *
  28363. * // Check in [ fakeRootElement, fakeBarElement, paragraphElement ].
  28364. * schema.checkChild( [ '$root', 'bar', paragraphElement ], 'foo' );
  28365. *
  28366. * All these `checkChild()` calls will fire {@link module:engine/model/schema~Schema#event:checkChild `Schema#checkChild`}
  28367. * events in which `args[ 0 ]` is an instance of the context. Therefore, you can write a listener like this:
  28368. *
  28369. * schema.on( 'checkChild', ( evt, args ) => {
  28370. * const ctx = args[ 0 ];
  28371. *
  28372. * console.log( Array.from( ctx.getNames() ) );
  28373. * } );
  28374. *
  28375. * Which will log the following:
  28376. *
  28377. * [ '$root', 'blockQuote', 'paragraph' ]
  28378. * [ '$root', 'paragraph' ]
  28379. * [ '$root', 'bar', 'paragraph' ]
  28380. *
  28381. * Note: When using the {@link module:engine/model/schema~Schema#checkAttribute `Schema#checkAttribute()`} method
  28382. * you may want to check whether a text node may have an attribute. A {@link module:engine/model/text~Text} is a
  28383. * correct way to define a context so you can do this:
  28384. *
  28385. * schema.checkAttribute( textNode, 'bold' );
  28386. *
  28387. * But sometimes you want to check whether a text at a given position might've had some attribute,
  28388. * in which case you can create a context by missing an array of elements with a `'$text'` string:
  28389. *
  28390. * // Check in [ rootElement, paragraphElement, textNode ].
  28391. * schema.checkChild( [ ...positionInParagraph.getAncestors(), '$text' ], 'bold' );
  28392. *
  28393. * @typedef {module:engine/model/node~Node|module:engine/model/position~Position|module:engine/model/schema~SchemaContext|
  28394. * String|Array.<String|module:engine/model/node~Node>} module:engine/model/schema~SchemaContextDefinition
  28395. */
  28396. /**
  28397. * An item of the {@link module:engine/model/schema~SchemaContext schema context}.
  28398. *
  28399. * It contains 3 properties:
  28400. *
  28401. * * `name` – the name of this item,
  28402. * * `* getAttributeKeys()` – a generator of keys of item attributes,
  28403. * * `getAttribute( keyName )` – a method to get attribute values.
  28404. *
  28405. * The context item interface is a highly simplified version of {@link module:engine/model/node~Node} and its role
  28406. * is to expose only the information which schema checks are able to provide (which is the name of the node and
  28407. * node's attributes).
  28408. *
  28409. * schema.on( 'checkChild', ( evt, args ) => {
  28410. * const ctx = args[ 0 ];
  28411. * const firstItem = ctx.getItem( 0 );
  28412. *
  28413. * console.log( firstItem.name ); // -> '$root'
  28414. * console.log( firstItem.getAttribute( 'foo' ) ); // -> 'bar'
  28415. * console.log( Array.from( firstItem.getAttributeKeys() ) ); // -> [ 'foo', 'faa' ]
  28416. * } );
  28417. *
  28418. * @typedef {Object} module:engine/model/schema~SchemaContextItem
  28419. */
  28420. /**
  28421. * A structure containing additional metadata describing the attribute.
  28422. *
  28423. * See {@link module:engine/model/schema~Schema#setAttributeProperties `Schema#setAttributeProperties()`} for usage examples.
  28424. *
  28425. * @typedef {Object} module:engine/model/schema~AttributeProperties
  28426. * @property {Boolean} [isFormatting] Indicates that the attribute should be considered as a visual formatting, like `bold`, `italic` or
  28427. * `fontSize` rather than semantic attribute (such as `src`, `listType`, etc.). For example, it is used by the "Remove format" feature.
  28428. * @property {Boolean} [copyOnEnter] Indicates that given text attribute should be copied to the next block when enter is pressed.
  28429. */
  28430. function compileBaseItemRule( sourceItemRules, itemName ) {
  28431. const itemRule = {
  28432. name: itemName,
  28433. allowIn: [],
  28434. allowContentOf: [],
  28435. allowWhere: [],
  28436. allowAttributes: [],
  28437. allowAttributesOf: [],
  28438. inheritTypesFrom: []
  28439. };
  28440. copyTypes( sourceItemRules, itemRule );
  28441. copyProperty( sourceItemRules, itemRule, 'allowIn' );
  28442. copyProperty( sourceItemRules, itemRule, 'allowContentOf' );
  28443. copyProperty( sourceItemRules, itemRule, 'allowWhere' );
  28444. copyProperty( sourceItemRules, itemRule, 'allowAttributes' );
  28445. copyProperty( sourceItemRules, itemRule, 'allowAttributesOf' );
  28446. copyProperty( sourceItemRules, itemRule, 'inheritTypesFrom' );
  28447. makeInheritAllWork( sourceItemRules, itemRule );
  28448. return itemRule;
  28449. }
  28450. function compileAllowContentOf( compiledDefinitions, itemName ) {
  28451. for ( const allowContentOfItemName of compiledDefinitions[ itemName ].allowContentOf ) {
  28452. // The allowContentOf property may point to an unregistered element.
  28453. if ( compiledDefinitions[ allowContentOfItemName ] ) {
  28454. const allowedChildren = getAllowedChildren( compiledDefinitions, allowContentOfItemName );
  28455. allowedChildren.forEach( allowedItem => {
  28456. allowedItem.allowIn.push( itemName );
  28457. } );
  28458. }
  28459. }
  28460. delete compiledDefinitions[ itemName ].allowContentOf;
  28461. }
  28462. function compileAllowWhere( compiledDefinitions, itemName ) {
  28463. for ( const allowWhereItemName of compiledDefinitions[ itemName ].allowWhere ) {
  28464. const inheritFrom = compiledDefinitions[ allowWhereItemName ];
  28465. // The allowWhere property may point to an unregistered element.
  28466. if ( inheritFrom ) {
  28467. const allowedIn = inheritFrom.allowIn;
  28468. compiledDefinitions[ itemName ].allowIn.push( ...allowedIn );
  28469. }
  28470. }
  28471. delete compiledDefinitions[ itemName ].allowWhere;
  28472. }
  28473. function compileAllowAttributesOf( compiledDefinitions, itemName ) {
  28474. for ( const allowAttributeOfItem of compiledDefinitions[ itemName ].allowAttributesOf ) {
  28475. const inheritFrom = compiledDefinitions[ allowAttributeOfItem ];
  28476. if ( inheritFrom ) {
  28477. const inheritAttributes = inheritFrom.allowAttributes;
  28478. compiledDefinitions[ itemName ].allowAttributes.push( ...inheritAttributes );
  28479. }
  28480. }
  28481. delete compiledDefinitions[ itemName ].allowAttributesOf;
  28482. }
  28483. function compileInheritPropertiesFrom( compiledDefinitions, itemName ) {
  28484. const item = compiledDefinitions[ itemName ];
  28485. for ( const inheritPropertiesOfItem of item.inheritTypesFrom ) {
  28486. const inheritFrom = compiledDefinitions[ inheritPropertiesOfItem ];
  28487. if ( inheritFrom ) {
  28488. const typeNames = Object.keys( inheritFrom ).filter( name => name.startsWith( 'is' ) );
  28489. for ( const name of typeNames ) {
  28490. if ( !( name in item ) ) {
  28491. item[ name ] = inheritFrom[ name ];
  28492. }
  28493. }
  28494. }
  28495. }
  28496. delete item.inheritTypesFrom;
  28497. }
  28498. // Remove items which weren't registered (because it may break some checks or we'd need to complicate them).
  28499. // Make sure allowIn doesn't contain repeated values.
  28500. function cleanUpAllowIn( compiledDefinitions, itemName ) {
  28501. const itemRule = compiledDefinitions[ itemName ];
  28502. const existingItems = itemRule.allowIn.filter( itemToCheck => compiledDefinitions[ itemToCheck ] );
  28503. itemRule.allowIn = Array.from( new Set( existingItems ) );
  28504. }
  28505. function cleanUpAllowAttributes( compiledDefinitions, itemName ) {
  28506. const itemRule = compiledDefinitions[ itemName ];
  28507. itemRule.allowAttributes = Array.from( new Set( itemRule.allowAttributes ) );
  28508. }
  28509. function copyTypes( sourceItemRules, itemRule ) {
  28510. for ( const sourceItemRule of sourceItemRules ) {
  28511. const typeNames = Object.keys( sourceItemRule ).filter( name => name.startsWith( 'is' ) );
  28512. for ( const name of typeNames ) {
  28513. itemRule[ name ] = sourceItemRule[ name ];
  28514. }
  28515. }
  28516. }
  28517. function copyProperty( sourceItemRules, itemRule, propertyName ) {
  28518. for ( const sourceItemRule of sourceItemRules ) {
  28519. if ( typeof sourceItemRule[ propertyName ] == 'string' ) {
  28520. itemRule[ propertyName ].push( sourceItemRule[ propertyName ] );
  28521. } else if ( Array.isArray( sourceItemRule[ propertyName ] ) ) {
  28522. itemRule[ propertyName ].push( ...sourceItemRule[ propertyName ] );
  28523. }
  28524. }
  28525. }
  28526. function makeInheritAllWork( sourceItemRules, itemRule ) {
  28527. for ( const sourceItemRule of sourceItemRules ) {
  28528. const inheritFrom = sourceItemRule.inheritAllFrom;
  28529. if ( inheritFrom ) {
  28530. itemRule.allowContentOf.push( inheritFrom );
  28531. itemRule.allowWhere.push( inheritFrom );
  28532. itemRule.allowAttributesOf.push( inheritFrom );
  28533. itemRule.inheritTypesFrom.push( inheritFrom );
  28534. }
  28535. }
  28536. }
  28537. function getAllowedChildren( compiledDefinitions, itemName ) {
  28538. const itemRule = compiledDefinitions[ itemName ];
  28539. return getValues( compiledDefinitions ).filter( def => def.allowIn.includes( itemRule.name ) );
  28540. }
  28541. function getValues( obj ) {
  28542. return Object.keys( obj ).map( key => obj[ key ] );
  28543. }
  28544. function mapContextItem( ctxItem ) {
  28545. if ( typeof ctxItem == 'string' ) {
  28546. return {
  28547. name: ctxItem,
  28548. * getAttributeKeys() {},
  28549. getAttribute() {}
  28550. };
  28551. } else {
  28552. return {
  28553. // '$text' means text nodes and text proxies.
  28554. name: ctxItem.is( 'element' ) ? ctxItem.name : '$text',
  28555. * getAttributeKeys() {
  28556. yield* ctxItem.getAttributeKeys();
  28557. },
  28558. getAttribute( key ) {
  28559. return ctxItem.getAttribute( key );
  28560. }
  28561. };
  28562. }
  28563. }
  28564. // Generator function returning values from provided walkers, switching between them at each iteration. If only one walker
  28565. // is provided it will return data only from that walker.
  28566. //
  28567. // @param {module:engine/module/treewalker~TreeWalker} [backward] Walker iterating in backward direction.
  28568. // @param {module:engine/module/treewalker~TreeWalker} [forward] Walker iterating in forward direction.
  28569. // @returns {Iterable.<Object>} Object returned at each iteration contains `value` and `walker` (informing which walker returned
  28570. // given value) fields.
  28571. function* combineWalkers( backward, forward ) {
  28572. let done = false;
  28573. while ( !done ) {
  28574. done = true;
  28575. if ( backward ) {
  28576. const step = backward.next();
  28577. if ( !step.done ) {
  28578. done = false;
  28579. yield {
  28580. walker: backward,
  28581. value: step.value
  28582. };
  28583. }
  28584. }
  28585. if ( forward ) {
  28586. const step = forward.next();
  28587. if ( !step.done ) {
  28588. done = false;
  28589. yield {
  28590. walker: forward,
  28591. value: step.value
  28592. };
  28593. }
  28594. }
  28595. }
  28596. }
  28597. // Takes an array of non-intersecting ranges. For each of them gets minimal flat ranges covering that range and returns
  28598. // all those minimal flat ranges.
  28599. //
  28600. // @param {Array.<module:engine/model/range~Range>} ranges Ranges to process.
  28601. // @returns {Iterable.<module:engine/model/range~Range>} Minimal flat ranges of given `ranges`.
  28602. function* convertToMinimalFlatRanges( ranges ) {
  28603. for ( const range of ranges ) {
  28604. yield* range.getMinimalFlatRanges();
  28605. }
  28606. }
  28607. function removeDisallowedAttributeFromNode( schema, node, writer ) {
  28608. for ( const attribute of node.getAttributeKeys() ) {
  28609. if ( !schema.checkAttribute( node, attribute ) ) {
  28610. writer.removeAttribute( attribute, node );
  28611. }
  28612. }
  28613. }
  28614. /***/ }),
  28615. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/selection.js":
  28616. /*!************************************************************************!*\
  28617. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/selection.js ***!
  28618. \************************************************************************/
  28619. /*! exports provided: default */
  28620. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  28621. "use strict";
  28622. __webpack_require__.r(__webpack_exports__);
  28623. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Selection; });
  28624. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  28625. /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/node.js");
  28626. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  28627. /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  28628. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  28629. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  28630. /* harmony import */ var _ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
  28631. /**
  28632. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  28633. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  28634. */
  28635. /**
  28636. * @module engine/model/selection
  28637. */
  28638. /**
  28639. * Selection is a set of {@link module:engine/model/range~Range ranges}. It has a direction specified by its
  28640. * {@link module:engine/model/selection~Selection#anchor anchor} and {@link module:engine/model/selection~Selection#focus focus}
  28641. * (it can be {@link module:engine/model/selection~Selection#isBackward forward or backward}).
  28642. * Additionally, selection may have its own attributes (think – whether text typed in in this selection
  28643. * should have those attributes – e.g. whether you type a bolded text).
  28644. *
  28645. * @mixes module:utils/emittermixin~EmitterMixin
  28646. */
  28647. class Selection {
  28648. /**
  28649. * Creates a new selection instance based on the given {@link module:engine/model/selection~Selectable selectable}
  28650. * or creates an empty selection if no arguments were passed.
  28651. *
  28652. * // Creates empty selection without ranges.
  28653. * const selection = writer.createSelection();
  28654. *
  28655. * // Creates selection at the given range.
  28656. * const range = writer.createRange( start, end );
  28657. * const selection = writer.createSelection( range );
  28658. *
  28659. * // Creates selection at the given ranges
  28660. * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];
  28661. * const selection = writer.createSelection( ranges );
  28662. *
  28663. * // Creates selection from the other selection.
  28664. * // Note: It doesn't copies selection attributes.
  28665. * const otherSelection = writer.createSelection();
  28666. * const selection = writer.createSelection( otherSelection );
  28667. *
  28668. * // Creates selection from the given document selection.
  28669. * // Note: It doesn't copies selection attributes.
  28670. * const documentSelection = model.document.selection;
  28671. * const selection = writer.createSelection( documentSelection );
  28672. *
  28673. * // Creates selection at the given position.
  28674. * const position = writer.createPositionFromPath( root, path );
  28675. * const selection = writer.createSelection( position );
  28676. *
  28677. * // Creates selection at the given offset in the given element.
  28678. * const paragraph = writer.createElement( 'paragraph' );
  28679. * const selection = writer.createSelection( paragraph, offset );
  28680. *
  28681. * // Creates a range inside an {@link module:engine/model/element~Element element} which starts before the
  28682. * // first child of that element and ends after the last child of that element.
  28683. * const selection = writer.createSelection( paragraph, 'in' );
  28684. *
  28685. * // Creates a range on an {@link module:engine/model/item~Item item} which starts before the item and ends
  28686. * // just after the item.
  28687. * const selection = writer.createSelection( paragraph, 'on' );
  28688. *
  28689. * Selection's constructor allow passing additional options (`'backward'`) as the last argument.
  28690. *
  28691. * // Creates backward selection.
  28692. * const selection = writer.createSelection( range, { backward: true } );
  28693. *
  28694. * @param {module:engine/model/selection~Selectable} selectable
  28695. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
  28696. * @param {Object} [options]
  28697. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  28698. */
  28699. constructor( selectable, placeOrOffset, options ) {
  28700. /**
  28701. * Specifies whether the last added range was added as a backward or forward range.
  28702. *
  28703. * @private
  28704. * @type {Boolean}
  28705. */
  28706. this._lastRangeBackward = false;
  28707. /**
  28708. * Stores selection ranges.
  28709. *
  28710. * @protected
  28711. * @type {Array.<module:engine/model/range~Range>}
  28712. */
  28713. this._ranges = [];
  28714. /**
  28715. * List of attributes set on current selection.
  28716. *
  28717. * @protected
  28718. * @type {Map.<String,*>}
  28719. */
  28720. this._attrs = new Map();
  28721. if ( selectable ) {
  28722. this.setTo( selectable, placeOrOffset, options );
  28723. }
  28724. }
  28725. /**
  28726. * Selection anchor. Anchor is the position from which the selection was started. If a user is making a selection
  28727. * by dragging the mouse, the anchor is where the user pressed the mouse button (the beginning of the selection).
  28728. *
  28729. * Anchor and {@link #focus} define the direction of the selection, which is important
  28730. * when expanding/shrinking selection. The focus moves, while the anchor should remain in the same place.
  28731. *
  28732. * Anchor is always set to the {@link module:engine/model/range~Range#start start} or
  28733. * {@link module:engine/model/range~Range#end end} position of the last of selection's ranges. Whether it is
  28734. * the `start` or `end` depends on the specified `options.backward`. See the {@link #setTo `setTo()`} method.
  28735. *
  28736. * May be set to `null` if there are no ranges in the selection.
  28737. *
  28738. * @see #focus
  28739. * @readonly
  28740. * @type {module:engine/model/position~Position|null}
  28741. */
  28742. get anchor() {
  28743. if ( this._ranges.length > 0 ) {
  28744. const range = this._ranges[ this._ranges.length - 1 ];
  28745. return this._lastRangeBackward ? range.end : range.start;
  28746. }
  28747. return null;
  28748. }
  28749. /**
  28750. * Selection focus. Focus is the position where the selection ends. If a user is making a selection
  28751. * by dragging the mouse, the focus is where the mouse cursor is.
  28752. *
  28753. * May be set to `null` if there are no ranges in the selection.
  28754. *
  28755. * @see #anchor
  28756. * @readonly
  28757. * @type {module:engine/model/position~Position|null}
  28758. */
  28759. get focus() {
  28760. if ( this._ranges.length > 0 ) {
  28761. const range = this._ranges[ this._ranges.length - 1 ];
  28762. return this._lastRangeBackward ? range.start : range.end;
  28763. }
  28764. return null;
  28765. }
  28766. /**
  28767. * Whether the selection is collapsed. Selection is collapsed when there is exactly one range in it
  28768. * and it is collapsed.
  28769. *
  28770. * @readonly
  28771. * @type {Boolean}
  28772. */
  28773. get isCollapsed() {
  28774. const length = this._ranges.length;
  28775. if ( length === 1 ) {
  28776. return this._ranges[ 0 ].isCollapsed;
  28777. } else {
  28778. return false;
  28779. }
  28780. }
  28781. /**
  28782. * Returns the number of ranges in the selection.
  28783. *
  28784. * @readonly
  28785. * @type {Number}
  28786. */
  28787. get rangeCount() {
  28788. return this._ranges.length;
  28789. }
  28790. /**
  28791. * Specifies whether the selection's {@link #focus} precedes the selection's {@link #anchor}.
  28792. *
  28793. * @readonly
  28794. * @type {Boolean}
  28795. */
  28796. get isBackward() {
  28797. return !this.isCollapsed && this._lastRangeBackward;
  28798. }
  28799. /**
  28800. * Checks whether this selection is equal to the given selection. Selections are equal if they have the same directions,
  28801. * the same number of ranges and all ranges from one selection equal to ranges from the another selection.
  28802. *
  28803. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} otherSelection
  28804. * Selection to compare with.
  28805. * @returns {Boolean} `true` if selections are equal, `false` otherwise.
  28806. */
  28807. isEqual( otherSelection ) {
  28808. if ( this.rangeCount != otherSelection.rangeCount ) {
  28809. return false;
  28810. } else if ( this.rangeCount === 0 ) {
  28811. return true;
  28812. }
  28813. if ( !this.anchor.isEqual( otherSelection.anchor ) || !this.focus.isEqual( otherSelection.focus ) ) {
  28814. return false;
  28815. }
  28816. for ( const thisRange of this._ranges ) {
  28817. let found = false;
  28818. for ( const otherRange of otherSelection._ranges ) {
  28819. if ( thisRange.isEqual( otherRange ) ) {
  28820. found = true;
  28821. break;
  28822. }
  28823. }
  28824. if ( !found ) {
  28825. return false;
  28826. }
  28827. }
  28828. return true;
  28829. }
  28830. /**
  28831. * Returns an iterable object that iterates over copies of selection ranges.
  28832. *
  28833. * @returns {Iterable.<module:engine/model/range~Range>}
  28834. */
  28835. * getRanges() {
  28836. for ( const range of this._ranges ) {
  28837. yield new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( range.start, range.end );
  28838. }
  28839. }
  28840. /**
  28841. * Returns a copy of the first range in the selection.
  28842. * First range is the one which {@link module:engine/model/range~Range#start start} position
  28843. * {@link module:engine/model/position~Position#isBefore is before} start position of all other ranges
  28844. * (not to confuse with the first range added to the selection).
  28845. *
  28846. * Returns `null` if there are no ranges in selection.
  28847. *
  28848. * @returns {module:engine/model/range~Range|null}
  28849. */
  28850. getFirstRange() {
  28851. let first = null;
  28852. for ( const range of this._ranges ) {
  28853. if ( !first || range.start.isBefore( first.start ) ) {
  28854. first = range;
  28855. }
  28856. }
  28857. return first ? new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( first.start, first.end ) : null;
  28858. }
  28859. /**
  28860. * Returns a copy of the last range in the selection.
  28861. * Last range is the one which {@link module:engine/model/range~Range#end end} position
  28862. * {@link module:engine/model/position~Position#isAfter is after} end position of all other ranges (not to confuse with the range most
  28863. * recently added to the selection).
  28864. *
  28865. * Returns `null` if there are no ranges in selection.
  28866. *
  28867. * @returns {module:engine/model/range~Range|null}
  28868. */
  28869. getLastRange() {
  28870. let last = null;
  28871. for ( const range of this._ranges ) {
  28872. if ( !last || range.end.isAfter( last.end ) ) {
  28873. last = range;
  28874. }
  28875. }
  28876. return last ? new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( last.start, last.end ) : null;
  28877. }
  28878. /**
  28879. * Returns the first position in the selection.
  28880. * First position is the position that {@link module:engine/model/position~Position#isBefore is before}
  28881. * any other position in the selection.
  28882. *
  28883. * Returns `null` if there are no ranges in selection.
  28884. *
  28885. * @returns {module:engine/model/position~Position|null}
  28886. */
  28887. getFirstPosition() {
  28888. const first = this.getFirstRange();
  28889. return first ? first.start.clone() : null;
  28890. }
  28891. /**
  28892. * Returns the last position in the selection.
  28893. * Last position is the position that {@link module:engine/model/position~Position#isAfter is after}
  28894. * any other position in the selection.
  28895. *
  28896. * Returns `null` if there are no ranges in selection.
  28897. *
  28898. * @returns {module:engine/model/position~Position|null}
  28899. */
  28900. getLastPosition() {
  28901. const lastRange = this.getLastRange();
  28902. return lastRange ? lastRange.end.clone() : null;
  28903. }
  28904. /**
  28905. * Sets this selection's ranges and direction to the specified location based on the given
  28906. * {@link module:engine/model/selection~Selectable selectable}.
  28907. *
  28908. * // Removes all selection's ranges.
  28909. * selection.setTo( null );
  28910. *
  28911. * // Sets selection to the given range.
  28912. * const range = writer.createRange( start, end );
  28913. * selection.setTo( range );
  28914. *
  28915. * // Sets selection to given ranges.
  28916. * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];
  28917. * selection.setTo( ranges );
  28918. *
  28919. * // Sets selection to other selection.
  28920. * // Note: It doesn't copies selection attributes.
  28921. * const otherSelection = writer.createSelection();
  28922. * selection.setTo( otherSelection );
  28923. *
  28924. * // Sets selection to the given document selection.
  28925. * // Note: It doesn't copies selection attributes.
  28926. * const documentSelection = new DocumentSelection( doc );
  28927. * selection.setTo( documentSelection );
  28928. *
  28929. * // Sets collapsed selection at the given position.
  28930. * const position = writer.createPositionFromPath( root, path );
  28931. * selection.setTo( position );
  28932. *
  28933. * // Sets collapsed selection at the position of the given node and an offset.
  28934. * selection.setTo( paragraph, offset );
  28935. *
  28936. * Creates a range inside an {@link module:engine/model/element~Element element} which starts before the first child of
  28937. * that element and ends after the last child of that element.
  28938. *
  28939. * selection.setTo( paragraph, 'in' );
  28940. *
  28941. * Creates a range on an {@link module:engine/model/item~Item item} which starts before the item and ends just after the item.
  28942. *
  28943. * selection.setTo( paragraph, 'on' );
  28944. *
  28945. * `Selection#setTo()`' method allow passing additional options (`backward`) as the last argument.
  28946. *
  28947. * // Sets backward selection.
  28948. * const selection = writer.createSelection( range, { backward: true } );
  28949. *
  28950. * @param {module:engine/model/selection~Selectable} selectable
  28951. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
  28952. * @param {Object} [options]
  28953. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  28954. */
  28955. setTo( selectable, placeOrOffset, options ) {
  28956. if ( selectable === null ) {
  28957. this._setRanges( [] );
  28958. } else if ( selectable instanceof Selection ) {
  28959. this._setRanges( selectable.getRanges(), selectable.isBackward );
  28960. } else if ( selectable && typeof selectable.getRanges == 'function' ) {
  28961. // We assume that the selectable is a DocumentSelection.
  28962. // It can't be imported here, because it would lead to circular imports.
  28963. this._setRanges( selectable.getRanges(), selectable.isBackward );
  28964. } else if ( selectable instanceof _range__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
  28965. this._setRanges( [ selectable ], !!placeOrOffset && !!placeOrOffset.backward );
  28966. } else if ( selectable instanceof _position__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  28967. this._setRanges( [ new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( selectable ) ] );
  28968. } else if ( selectable instanceof _node__WEBPACK_IMPORTED_MODULE_1__["default"] ) {
  28969. const backward = !!options && !!options.backward;
  28970. let range;
  28971. if ( placeOrOffset == 'in' ) {
  28972. range = _range__WEBPACK_IMPORTED_MODULE_2__["default"]._createIn( selectable );
  28973. } else if ( placeOrOffset == 'on' ) {
  28974. range = _range__WEBPACK_IMPORTED_MODULE_2__["default"]._createOn( selectable );
  28975. } else if ( placeOrOffset !== undefined ) {
  28976. range = new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( selectable, placeOrOffset ) );
  28977. } else {
  28978. /**
  28979. * selection.setTo requires the second parameter when the first parameter is a node.
  28980. *
  28981. * @error model-selection-setto-required-second-parameter
  28982. */
  28983. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"]( 'model-selection-setto-required-second-parameter', [ this, selectable ] );
  28984. }
  28985. this._setRanges( [ range ], backward );
  28986. } else if ( Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_6__["default"])( selectable ) ) {
  28987. // We assume that the selectable is an iterable of ranges.
  28988. this._setRanges( selectable, placeOrOffset && !!placeOrOffset.backward );
  28989. } else {
  28990. /**
  28991. * Cannot set the selection to the given place.
  28992. *
  28993. * Invalid parameters were specified when setting the selection. Common issues:
  28994. *
  28995. * * A {@link module:engine/model/textproxy~TextProxy} instance was passed instead of
  28996. * a real {@link module:engine/model/text~Text}.
  28997. * * View nodes were passed instead of model nodes.
  28998. * * `null`/`undefined` was passed.
  28999. *
  29000. * @error model-selection-setto-not-selectable
  29001. */
  29002. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"]( 'model-selection-setto-not-selectable', [ this, selectable ] );
  29003. }
  29004. }
  29005. /**
  29006. * Replaces all ranges that were added to the selection with given array of ranges. Last range of the array
  29007. * is treated like the last added range and is used to set {@link module:engine/model/selection~Selection#anchor} and
  29008. * {@link module:engine/model/selection~Selection#focus}. Accepts a flag describing in which direction the selection is made.
  29009. *
  29010. * @protected
  29011. * @fires change:range
  29012. * @param {Iterable.<module:engine/model/range~Range>} newRanges Ranges to set.
  29013. * @param {Boolean} [isLastBackward=false] Flag describing if last added range was selected forward - from start to end (`false`)
  29014. * or backward - from end to start (`true`).
  29015. */
  29016. _setRanges( newRanges, isLastBackward = false ) {
  29017. newRanges = Array.from( newRanges );
  29018. // Check whether there is any range in new ranges set that is different than all already added ranges.
  29019. const anyNewRange = newRanges.some( newRange => {
  29020. if ( !( newRange instanceof _range__WEBPACK_IMPORTED_MODULE_2__["default"] ) ) {
  29021. /**
  29022. * Selection range set to an object that is not an instance of {@link module:engine/model/range~Range}.
  29023. *
  29024. * Only {@link module:engine/model/range~Range} instances can be used to set a selection.
  29025. * Common mistakes leading to this error are:
  29026. *
  29027. * * using DOM `Range` object,
  29028. * * incorrect CKEditor 5 installation with multiple `ckeditor5-engine` packages having different versions.
  29029. *
  29030. * @error model-selection-set-ranges-not-range
  29031. */
  29032. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
  29033. 'model-selection-set-ranges-not-range',
  29034. [ this, newRanges ]
  29035. );
  29036. }
  29037. return this._ranges.every( oldRange => {
  29038. return !oldRange.isEqual( newRange );
  29039. } );
  29040. } );
  29041. // Don't do anything if nothing changed.
  29042. if ( newRanges.length === this._ranges.length && !anyNewRange ) {
  29043. return;
  29044. }
  29045. this._removeAllRanges();
  29046. for ( const range of newRanges ) {
  29047. this._pushRange( range );
  29048. }
  29049. this._lastRangeBackward = !!isLastBackward;
  29050. this.fire( 'change:range', { directChange: true } );
  29051. }
  29052. /**
  29053. * Moves {@link module:engine/model/selection~Selection#focus} to the specified location.
  29054. *
  29055. * The location can be specified in the same form as
  29056. * {@link module:engine/model/writer~Writer#createPositionAt writer.createPositionAt()} parameters.
  29057. *
  29058. * @fires change:range
  29059. * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
  29060. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  29061. * first parameter is a {@link module:engine/model/item~Item model item}.
  29062. */
  29063. setFocus( itemOrPosition, offset ) {
  29064. if ( this.anchor === null ) {
  29065. /**
  29066. * Cannot set selection focus if there are no ranges in selection.
  29067. *
  29068. * @error model-selection-setfocus-no-ranges
  29069. */
  29070. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"]( 'model-selection-setfocus-no-ranges', [ this, itemOrPosition ] );
  29071. }
  29072. const newFocus = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( itemOrPosition, offset );
  29073. if ( newFocus.compareWith( this.focus ) == 'same' ) {
  29074. return;
  29075. }
  29076. const anchor = this.anchor;
  29077. if ( this._ranges.length ) {
  29078. this._popRange();
  29079. }
  29080. if ( newFocus.compareWith( anchor ) == 'before' ) {
  29081. this._pushRange( new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( newFocus, anchor ) );
  29082. this._lastRangeBackward = true;
  29083. } else {
  29084. this._pushRange( new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( anchor, newFocus ) );
  29085. this._lastRangeBackward = false;
  29086. }
  29087. this.fire( 'change:range', { directChange: true } );
  29088. }
  29089. /**
  29090. * Gets an attribute value for given key or `undefined` if that attribute is not set on the selection.
  29091. *
  29092. * @param {String} key Key of attribute to look for.
  29093. * @returns {*} Attribute value or `undefined`.
  29094. */
  29095. getAttribute( key ) {
  29096. return this._attrs.get( key );
  29097. }
  29098. /**
  29099. * Returns iterable that iterates over this selection's attributes.
  29100. *
  29101. * Attributes are returned as arrays containing two items. First one is attribute key and second is attribute value.
  29102. * This format is accepted by native `Map` object and also can be passed in `Node` constructor.
  29103. *
  29104. * @returns {Iterable.<*>}
  29105. */
  29106. getAttributes() {
  29107. return this._attrs.entries();
  29108. }
  29109. /**
  29110. * Returns iterable that iterates over this selection's attribute keys.
  29111. *
  29112. * @returns {Iterable.<String>}
  29113. */
  29114. getAttributeKeys() {
  29115. return this._attrs.keys();
  29116. }
  29117. /**
  29118. * Checks if the selection has an attribute for given key.
  29119. *
  29120. * @param {String} key Key of attribute to check.
  29121. * @returns {Boolean} `true` if attribute with given key is set on selection, `false` otherwise.
  29122. */
  29123. hasAttribute( key ) {
  29124. return this._attrs.has( key );
  29125. }
  29126. /**
  29127. * Removes an attribute with given key from the selection.
  29128. *
  29129. * If given attribute was set on the selection, fires the {@link #event:change:range} event with
  29130. * removed attribute key.
  29131. *
  29132. * @fires change:attribute
  29133. * @param {String} key Key of attribute to remove.
  29134. */
  29135. removeAttribute( key ) {
  29136. if ( this.hasAttribute( key ) ) {
  29137. this._attrs.delete( key );
  29138. this.fire( 'change:attribute', { attributeKeys: [ key ], directChange: true } );
  29139. }
  29140. }
  29141. /**
  29142. * Sets attribute on the selection. If attribute with the same key already is set, it's value is overwritten.
  29143. *
  29144. * If the attribute value has changed, fires the {@link #event:change:range} event with
  29145. * the attribute key.
  29146. *
  29147. * @fires change:attribute
  29148. * @param {String} key Key of attribute to set.
  29149. * @param {*} value Attribute value.
  29150. */
  29151. setAttribute( key, value ) {
  29152. if ( this.getAttribute( key ) !== value ) {
  29153. this._attrs.set( key, value );
  29154. this.fire( 'change:attribute', { attributeKeys: [ key ], directChange: true } );
  29155. }
  29156. }
  29157. /**
  29158. * Returns the selected element. {@link module:engine/model/element~Element Element} is considered as selected if there is only
  29159. * one range in the selection, and that range contains exactly one element.
  29160. * Returns `null` if there is no selected element.
  29161. *
  29162. * @returns {module:engine/model/element~Element|null}
  29163. */
  29164. getSelectedElement() {
  29165. if ( this.rangeCount !== 1 ) {
  29166. return null;
  29167. }
  29168. return this.getFirstRange().getContainedElement();
  29169. }
  29170. /**
  29171. * Checks whether this object is of the given.
  29172. *
  29173. * selection.is( 'selection' ); // -> true
  29174. * selection.is( 'model:selection' ); // -> true
  29175. *
  29176. * selection.is( 'view:selection' ); // -> false
  29177. * selection.is( 'range' ); // -> false
  29178. *
  29179. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  29180. *
  29181. * @param {String} type
  29182. * @returns {Boolean}
  29183. */
  29184. is( type ) {
  29185. return type === 'selection' || type === 'model:selection';
  29186. }
  29187. /**
  29188. * Gets elements of type {@link module:engine/model/schema~Schema#isBlock "block"} touched by the selection.
  29189. *
  29190. * This method's result can be used for example to apply block styling to all blocks covered by this selection.
  29191. *
  29192. * **Note:** `getSelectedBlocks()` returns blocks that are nested in other non-block elements
  29193. * but will not return blocks nested in other blocks.
  29194. *
  29195. * In this case the function will return exactly all 3 paragraphs (note: `<blockQuote>` is not a block itself):
  29196. *
  29197. * <paragraph>[a</paragraph>
  29198. * <blockQuote>
  29199. * <paragraph>b</paragraph>
  29200. * </blockQuote>
  29201. * <paragraph>c]d</paragraph>
  29202. *
  29203. * In this case the paragraph will also be returned, despite the collapsed selection:
  29204. *
  29205. * <paragraph>[]a</paragraph>
  29206. *
  29207. * In such a scenario, however, only blocks A, B & E will be returned as blocks C & D are nested in block B:
  29208. *
  29209. * [<blockA></blockA>
  29210. * <blockB>
  29211. * <blockC></blockC>
  29212. * <blockD></blockD>
  29213. * </blockB>
  29214. * <blockE></blockE>]
  29215. *
  29216. * If the selection is inside a block all the inner blocks (A & B) are returned:
  29217. *
  29218. * <block>
  29219. * <blockA>[a</blockA>
  29220. * <blockB>b]</blockB>
  29221. * </block>
  29222. *
  29223. * **Special case**: If a selection ends at the beginning of a block, that block is not returned as from user perspective
  29224. * this block wasn't selected. See [#984](https://github.com/ckeditor/ckeditor5-engine/issues/984) for more details.
  29225. *
  29226. * <paragraph>[a</paragraph>
  29227. * <paragraph>b</paragraph>
  29228. * <paragraph>]c</paragraph> // this block will not be returned
  29229. *
  29230. * @returns {Iterable.<module:engine/model/element~Element>}
  29231. */
  29232. * getSelectedBlocks() {
  29233. const visited = new WeakSet();
  29234. for ( const range of this.getRanges() ) {
  29235. // Get start block of range in case of a collapsed range.
  29236. const startBlock = getParentBlock( range.start, visited );
  29237. if ( startBlock && isTopBlockInRange( startBlock, range ) ) {
  29238. yield startBlock;
  29239. }
  29240. for ( const value of range.getWalker() ) {
  29241. const block = value.item;
  29242. if ( value.type == 'elementEnd' && isUnvisitedTopBlock( block, visited, range ) ) {
  29243. yield block;
  29244. }
  29245. }
  29246. const endBlock = getParentBlock( range.end, visited );
  29247. // #984. Don't return the end block if the range ends right at its beginning.
  29248. if ( endBlock && !range.end.isTouching( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( endBlock, 0 ) ) && isTopBlockInRange( endBlock, range ) ) {
  29249. yield endBlock;
  29250. }
  29251. }
  29252. }
  29253. /**
  29254. * Checks whether the selection contains the entire content of the given element. This means that selection must start
  29255. * at a position {@link module:engine/model/position~Position#isTouching touching} the element's start and ends at position
  29256. * touching the element's end.
  29257. *
  29258. * By default, this method will check whether the entire content of the selection's current root is selected.
  29259. * Useful to check if e.g. the user has just pressed <kbd>Ctrl</kbd> + <kbd>A</kbd>.
  29260. *
  29261. * @param {module:engine/model/element~Element} [element=this.anchor.root]
  29262. * @returns {Boolean}
  29263. */
  29264. containsEntireContent( element = this.anchor.root ) {
  29265. const limitStartPosition = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( element, 0 );
  29266. const limitEndPosition = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( element, 'end' );
  29267. return limitStartPosition.isTouching( this.getFirstPosition() ) &&
  29268. limitEndPosition.isTouching( this.getLastPosition() );
  29269. }
  29270. /**
  29271. * Adds given range to internal {@link #_ranges ranges array}. Throws an error
  29272. * if given range is intersecting with any range that is already stored in this selection.
  29273. *
  29274. * @protected
  29275. * @param {module:engine/model/range~Range} range Range to add.
  29276. */
  29277. _pushRange( range ) {
  29278. this._checkRange( range );
  29279. this._ranges.push( new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( range.start, range.end ) );
  29280. }
  29281. /**
  29282. * Checks if given range intersects with ranges that are already in the selection. Throws an error if it does.
  29283. *
  29284. * @protected
  29285. * @param {module:engine/model/range~Range} range Range to check.
  29286. */
  29287. _checkRange( range ) {
  29288. for ( let i = 0; i < this._ranges.length; i++ ) {
  29289. if ( range.isIntersecting( this._ranges[ i ] ) ) {
  29290. /**
  29291. * Trying to add a range that intersects with another range in the selection.
  29292. *
  29293. * @error model-selection-range-intersects
  29294. * @param {module:engine/model/range~Range} addedRange Range that was added to the selection.
  29295. * @param {module:engine/model/range~Range} intersectingRange Range in the selection that intersects with `addedRange`.
  29296. */
  29297. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
  29298. 'model-selection-range-intersects',
  29299. [ this, range ],
  29300. { addedRange: range, intersectingRange: this._ranges[ i ] }
  29301. );
  29302. }
  29303. }
  29304. }
  29305. /**
  29306. * Deletes ranges from internal range array. Uses {@link #_popRange _popRange} to
  29307. * ensure proper ranges removal.
  29308. *
  29309. * @protected
  29310. */
  29311. _removeAllRanges() {
  29312. while ( this._ranges.length > 0 ) {
  29313. this._popRange();
  29314. }
  29315. }
  29316. /**
  29317. * Removes most recently added range from the selection.
  29318. *
  29319. * @protected
  29320. */
  29321. _popRange() {
  29322. this._ranges.pop();
  29323. }
  29324. /**
  29325. * Fired when selection range(s) changed.
  29326. *
  29327. * @event change:range
  29328. * @param {Boolean} directChange In case of {@link module:engine/model/selection~Selection} class it is always set
  29329. * to `true` which indicates that the selection change was caused by a direct use of selection's API.
  29330. * The {@link module:engine/model/documentselection~DocumentSelection}, however, may change because its position
  29331. * was directly changed through the {@link module:engine/model/writer~Writer writer} or because its position was
  29332. * changed because the structure of the model has been changed (which means an indirect change).
  29333. * The indirect change does not occur in case of normal (detached) selections because they are "static" (as "not live")
  29334. * which mean that they are not updated once the document changes.
  29335. */
  29336. /**
  29337. * Fired when selection attribute changed.
  29338. *
  29339. * @event change:attribute
  29340. * @param {Boolean} directChange In case of {@link module:engine/model/selection~Selection} class it is always set
  29341. * to `true` which indicates that the selection change was caused by a direct use of selection's API.
  29342. * The {@link module:engine/model/documentselection~DocumentSelection}, however, may change because its attributes
  29343. * were directly changed through the {@link module:engine/model/writer~Writer writer} or because its position was
  29344. * changed in the model and its attributes were refreshed (which means an indirect change).
  29345. * The indirect change does not occur in case of normal (detached) selections because they are "static" (as "not live")
  29346. * which mean that they are not updated once the document changes.
  29347. * @param {Array.<String>} attributeKeys Array containing keys of attributes that changed.
  29348. */
  29349. }
  29350. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_5__["default"])( Selection, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_3__["default"] );
  29351. // Checks whether the given element extends $block in the schema and has a parent (is not a root).
  29352. // Marks it as already visited.
  29353. function isUnvisitedBlock( element, visited ) {
  29354. if ( visited.has( element ) ) {
  29355. return false;
  29356. }
  29357. visited.add( element );
  29358. return element.root.document.model.schema.isBlock( element ) && element.parent;
  29359. }
  29360. // Checks if the given element is a $block was not previously visited and is a top block in a range.
  29361. function isUnvisitedTopBlock( element, visited, range ) {
  29362. return isUnvisitedBlock( element, visited ) && isTopBlockInRange( element, range );
  29363. }
  29364. // Finds the lowest element in position's ancestors which is a block.
  29365. // It will search until first ancestor that is a limit element.
  29366. // Marks all ancestors as already visited to not include any of them later on.
  29367. function getParentBlock( position, visited ) {
  29368. const element = position.parent;
  29369. const schema = element.root.document.model.schema;
  29370. const ancestors = position.parent.getAncestors( { parentFirst: true, includeSelf: true } );
  29371. let hasParentLimit = false;
  29372. const block = ancestors.find( element => {
  29373. // Stop searching after first parent node that is limit element.
  29374. if ( hasParentLimit ) {
  29375. return false;
  29376. }
  29377. hasParentLimit = schema.isLimit( element );
  29378. return !hasParentLimit && isUnvisitedBlock( element, visited );
  29379. } );
  29380. // Mark all ancestors of this position's parent, because find() might've stopped early and
  29381. // the found block may be a child of another block.
  29382. ancestors.forEach( element => visited.add( element ) );
  29383. return block;
  29384. }
  29385. // Checks if the blocks is not nested in other block inside a range.
  29386. //
  29387. // @param {module:engine/model/element~Element} block Block to check.
  29388. // @param {module:engine/model/range~Range} range Range to check.
  29389. function isTopBlockInRange( block, range ) {
  29390. const parentBlock = findAncestorBlock( block );
  29391. if ( !parentBlock ) {
  29392. return true;
  29393. }
  29394. // Add loose flag to check as parentRange can be equal to range.
  29395. const isParentInRange = range.containsRange( _range__WEBPACK_IMPORTED_MODULE_2__["default"]._createOn( parentBlock ), true );
  29396. return !isParentInRange;
  29397. }
  29398. // Returns first ancestor block of a node.
  29399. //
  29400. // @param {module:engine/model/node~Node} node
  29401. // @returns {module:engine/model/node~Node|undefined}
  29402. function findAncestorBlock( node ) {
  29403. const schema = node.root.document.model.schema;
  29404. let parent = node.parent;
  29405. while ( parent ) {
  29406. if ( schema.isBlock( parent ) ) {
  29407. return parent;
  29408. }
  29409. parent = parent.parent;
  29410. }
  29411. }
  29412. /**
  29413. * An entity that is used to set selection.
  29414. *
  29415. * See also {@link module:engine/model/selection~Selection#setTo}
  29416. *
  29417. * @typedef {
  29418. * module:engine/model/selection~Selection|
  29419. * module:engine/model/documentselection~DocumentSelection|
  29420. * module:engine/model/position~Position|
  29421. * module:engine/model/range~Range|
  29422. * module:engine/model/node~Node|
  29423. * Iterable.<module:engine/model/range~Range>|
  29424. * null
  29425. * } module:engine/model/selection~Selectable
  29426. */
  29427. /***/ }),
  29428. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js":
  29429. /*!*******************************************************************!*\
  29430. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js ***!
  29431. \*******************************************************************/
  29432. /*! exports provided: default */
  29433. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  29434. "use strict";
  29435. __webpack_require__.r(__webpack_exports__);
  29436. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Text; });
  29437. /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/node.js");
  29438. /**
  29439. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  29440. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  29441. */
  29442. /**
  29443. * @module engine/model/text
  29444. */
  29445. // @if CK_DEBUG_ENGINE // const { convertMapToStringifiedObject } = require( '../dev-utils/utils' );
  29446. /**
  29447. * Model text node. Type of {@link module:engine/model/node~Node node} that contains {@link module:engine/model/text~Text#data text data}.
  29448. *
  29449. * **Important:** see {@link module:engine/model/node~Node} to read about restrictions using `Text` and `Node` API.
  29450. *
  29451. * **Note:** keep in mind that `Text` instances might indirectly got removed from model tree when model is changed.
  29452. * This happens when {@link module:engine/model/writer~Writer model writer} is used to change model and the text node is merged with
  29453. * another text node. Then, both text nodes are removed and a new text node is inserted into the model. Because of
  29454. * this behavior, keeping references to `Text` is not recommended. Instead, consider creating
  29455. * {@link module:engine/model/liveposition~LivePosition live position} placed before the text node.
  29456. *
  29457. * @extends module:engine/model/node~Node
  29458. */
  29459. class Text extends _node__WEBPACK_IMPORTED_MODULE_0__["default"] {
  29460. /**
  29461. * Creates a text node.
  29462. *
  29463. * **Note:** Constructor of this class shouldn't be used directly in the code.
  29464. * Use the {@link module:engine/model/writer~Writer#createText} method instead.
  29465. *
  29466. * @protected
  29467. * @param {String} data Node's text.
  29468. * @param {Object} [attrs] Node's attributes. See {@link module:utils/tomap~toMap} for a list of accepted values.
  29469. */
  29470. constructor( data, attrs ) {
  29471. super( attrs );
  29472. /**
  29473. * Text data contained in this text node.
  29474. *
  29475. * @protected
  29476. * @type {String}
  29477. */
  29478. this._data = data || '';
  29479. }
  29480. /**
  29481. * @inheritDoc
  29482. */
  29483. get offsetSize() {
  29484. return this.data.length;
  29485. }
  29486. /**
  29487. * Returns a text data contained in the node.
  29488. *
  29489. * @readonly
  29490. * @type {String}
  29491. */
  29492. get data() {
  29493. return this._data;
  29494. }
  29495. /**
  29496. * Checks whether this object is of the given.
  29497. *
  29498. * text.is( '$text' ); // -> true
  29499. * text.is( 'node' ); // -> true
  29500. * text.is( 'model:$text' ); // -> true
  29501. * text.is( 'model:node' ); // -> true
  29502. *
  29503. * text.is( 'view:$text' ); // -> false
  29504. * text.is( 'documentSelection' ); // -> false
  29505. *
  29506. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  29507. *
  29508. * **Note:** Until version 20.0.0 this method wasn't accepting `'$text'` type. The legacy `'text'` type is still
  29509. * accepted for backward compatibility.
  29510. *
  29511. * @param {String} type Type to check.
  29512. * @returns {Boolean}
  29513. */
  29514. is( type ) {
  29515. return type === '$text' || type === 'model:$text' ||
  29516. // This are legacy values kept for backward compatibility.
  29517. type === 'text' || type === 'model:text' ||
  29518. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  29519. type === 'node' || type === 'model:node';
  29520. }
  29521. /**
  29522. * Converts `Text` instance to plain object and returns it.
  29523. *
  29524. * @returns {Object} `Text` instance converted to plain object.
  29525. */
  29526. toJSON() {
  29527. const json = super.toJSON();
  29528. json.data = this.data;
  29529. return json;
  29530. }
  29531. /**
  29532. * Creates a copy of this text node and returns it. Created text node has same text data and attributes as original text node.
  29533. *
  29534. * @protected
  29535. * @returns {module:engine/model/text~Text} `Text` instance created using given plain object.
  29536. */
  29537. _clone() {
  29538. return new Text( this.data, this.getAttributes() );
  29539. }
  29540. /**
  29541. * Creates a `Text` instance from given plain object (i.e. parsed JSON string).
  29542. *
  29543. * @param {Object} json Plain object to be converted to `Text`.
  29544. * @returns {module:engine/model/text~Text} `Text` instance created using given plain object.
  29545. */
  29546. static fromJSON( json ) {
  29547. return new Text( json.data, json.attributes );
  29548. }
  29549. // @if CK_DEBUG_ENGINE // toString() {
  29550. // @if CK_DEBUG_ENGINE // return `#${ this.data }`;
  29551. // @if CK_DEBUG_ENGINE // }
  29552. // @if CK_DEBUG_ENGINE // logExtended() {
  29553. // @if CK_DEBUG_ENGINE // console.log( `ModelText: ${ this }, attrs: ${ convertMapToStringifiedObject( this.getAttributes() ) }` );
  29554. // @if CK_DEBUG_ENGINE // }
  29555. // @if CK_DEBUG_ENGINE // log() {
  29556. // @if CK_DEBUG_ENGINE // console.log( 'ModelText: ' + this );
  29557. // @if CK_DEBUG_ENGINE // }
  29558. }
  29559. /***/ }),
  29560. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.js":
  29561. /*!************************************************************************!*\
  29562. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.js ***!
  29563. \************************************************************************/
  29564. /*! exports provided: default */
  29565. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  29566. "use strict";
  29567. __webpack_require__.r(__webpack_exports__);
  29568. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TextProxy; });
  29569. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  29570. /**
  29571. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  29572. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  29573. */
  29574. /**
  29575. * @module engine/model/textproxy
  29576. */
  29577. // @if CK_DEBUG_ENGINE // const { convertMapToStringifiedObject } = require( '../dev-utils/utils' );
  29578. /**
  29579. * `TextProxy` represents a part of {@link module:engine/model/text~Text text node}.
  29580. *
  29581. * Since {@link module:engine/model/position~Position positions} can be placed between characters of a text node,
  29582. * {@link module:engine/model/range~Range ranges} may contain only parts of text nodes. When {@link module:engine/model/range~Range#getItems
  29583. * getting items}
  29584. * contained in such range, we need to represent a part of that text node, since returning the whole text node would be incorrect.
  29585. * `TextProxy` solves this issue.
  29586. *
  29587. * `TextProxy` has an API similar to {@link module:engine/model/text~Text Text} and allows to do most of the common tasks performed
  29588. * on model nodes.
  29589. *
  29590. * **Note:** Some `TextProxy` instances may represent whole text node, not just a part of it.
  29591. * See {@link module:engine/model/textproxy~TextProxy#isPartial}.
  29592. *
  29593. * **Note:** `TextProxy` is not an instance of {@link module:engine/model/node~Node node}. Keep this in mind when using it as a
  29594. * parameter of methods.
  29595. *
  29596. * **Note:** `TextProxy` is a readonly interface. If you want to perform changes on model data represented by a `TextProxy`
  29597. * use {@link module:engine/model/writer~Writer model writer API}.
  29598. *
  29599. * **Note:** `TextProxy` instances are created on the fly, basing on the current state of model. Because of this, it is
  29600. * highly unrecommended to store references to `TextProxy` instances. `TextProxy` instances are not refreshed when
  29601. * model changes, so they might get invalidated. Instead, consider creating {@link module:engine/model/liveposition~LivePosition live
  29602. * position}.
  29603. *
  29604. * `TextProxy` instances are created by {@link module:engine/model/treewalker~TreeWalker model tree walker}. You should not need to create
  29605. * an instance of this class by your own.
  29606. */
  29607. class TextProxy {
  29608. /**
  29609. * Creates a text proxy.
  29610. *
  29611. * @protected
  29612. * @param {module:engine/model/text~Text} textNode Text node which part is represented by this text proxy.
  29613. * @param {Number} offsetInText Offset in {@link module:engine/model/textproxy~TextProxy#textNode text node} from which the text proxy
  29614. * starts.
  29615. * @param {Number} length Text proxy length, that is how many text node's characters, starting from `offsetInText` it represents.
  29616. * @constructor
  29617. */
  29618. constructor( textNode, offsetInText, length ) {
  29619. /**
  29620. * Text node which part is represented by this text proxy.
  29621. *
  29622. * @readonly
  29623. * @member {module:engine/model/text~Text}
  29624. */
  29625. this.textNode = textNode;
  29626. if ( offsetInText < 0 || offsetInText > textNode.offsetSize ) {
  29627. /**
  29628. * Given `offsetInText` value is incorrect.
  29629. *
  29630. * @error model-textproxy-wrong-offsetintext
  29631. */
  29632. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'model-textproxy-wrong-offsetintext', this );
  29633. }
  29634. if ( length < 0 || offsetInText + length > textNode.offsetSize ) {
  29635. /**
  29636. * Given `length` value is incorrect.
  29637. *
  29638. * @error model-textproxy-wrong-length
  29639. */
  29640. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'model-textproxy-wrong-length', this );
  29641. }
  29642. /**
  29643. * Text data represented by this text proxy.
  29644. *
  29645. * @readonly
  29646. * @member {String}
  29647. */
  29648. this.data = textNode.data.substring( offsetInText, offsetInText + length );
  29649. /**
  29650. * Offset in {@link module:engine/model/textproxy~TextProxy#textNode text node} from which the text proxy starts.
  29651. *
  29652. * @readonly
  29653. * @member {Number}
  29654. */
  29655. this.offsetInText = offsetInText;
  29656. }
  29657. /**
  29658. * Offset at which this text proxy starts in it's parent.
  29659. *
  29660. * @see module:engine/model/node~Node#startOffset
  29661. * @readonly
  29662. * @type {Number}
  29663. */
  29664. get startOffset() {
  29665. return this.textNode.startOffset !== null ? this.textNode.startOffset + this.offsetInText : null;
  29666. }
  29667. /**
  29668. * Offset size of this text proxy. Equal to the number of characters represented by the text proxy.
  29669. *
  29670. * @see module:engine/model/node~Node#offsetSize
  29671. * @readonly
  29672. * @type {Number}
  29673. */
  29674. get offsetSize() {
  29675. return this.data.length;
  29676. }
  29677. /**
  29678. * Offset at which this text proxy ends in it's parent.
  29679. *
  29680. * @see module:engine/model/node~Node#endOffset
  29681. * @readonly
  29682. * @type {Number}
  29683. */
  29684. get endOffset() {
  29685. return this.startOffset !== null ? this.startOffset + this.offsetSize : null;
  29686. }
  29687. /**
  29688. * Flag indicating whether `TextProxy` instance covers only part of the original {@link module:engine/model/text~Text text node}
  29689. * (`true`) or the whole text node (`false`).
  29690. *
  29691. * This is `false` when text proxy starts at the very beginning of {@link module:engine/model/textproxy~TextProxy#textNode textNode}
  29692. * ({@link module:engine/model/textproxy~TextProxy#offsetInText offsetInText} equals `0`) and text proxy sizes is equal to
  29693. * text node size.
  29694. *
  29695. * @readonly
  29696. * @type {Boolean}
  29697. */
  29698. get isPartial() {
  29699. return this.offsetSize !== this.textNode.offsetSize;
  29700. }
  29701. /**
  29702. * Parent of this text proxy, which is same as parent of text node represented by this text proxy.
  29703. *
  29704. * @readonly
  29705. * @type {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment|null}
  29706. */
  29707. get parent() {
  29708. return this.textNode.parent;
  29709. }
  29710. /**
  29711. * Root of this text proxy, which is same as root of text node represented by this text proxy.
  29712. *
  29713. * @readonly
  29714. * @type {module:engine/model/node~Node|module:engine/model/documentfragment~DocumentFragment}
  29715. */
  29716. get root() {
  29717. return this.textNode.root;
  29718. }
  29719. /**
  29720. * Checks whether this object is of the given.
  29721. *
  29722. * textProxy.is( '$textProxy' ); // -> true
  29723. * textProxy.is( 'model:$textProxy' ); // -> true
  29724. *
  29725. * textProxy.is( 'view:$textProxy' ); // -> false
  29726. * textProxy.is( 'range' ); // -> false
  29727. *
  29728. * {@link module:engine/model/node~Node#is Check the entire list of model objects} which implement the `is()` method.
  29729. *
  29730. * **Note:** Until version 20.0.0 this method wasn't accepting `'$textProxy'` type. The legacy `'textProxt'` type is still
  29731. * accepted for backward compatibility.
  29732. *
  29733. * @param {String} type Type to check.
  29734. * @returns {Boolean}
  29735. */
  29736. is( type ) {
  29737. return type === '$textProxy' || type === 'model:$textProxy' ||
  29738. // This are legacy values kept for backward compatibility.
  29739. type === 'textProxy' || type === 'model:textProxy';
  29740. }
  29741. /**
  29742. * Gets path to this text proxy.
  29743. *
  29744. * @see module:engine/model/node~Node#getPath
  29745. * @returns {Array.<Number>}
  29746. */
  29747. getPath() {
  29748. const path = this.textNode.getPath();
  29749. if ( path.length > 0 ) {
  29750. path[ path.length - 1 ] += this.offsetInText;
  29751. }
  29752. return path;
  29753. }
  29754. /**
  29755. * Returns ancestors array of this text proxy.
  29756. *
  29757. * @param {Object} options Options object.
  29758. * @param {Boolean} [options.includeSelf=false] When set to `true` this text proxy will be also included in parent's array.
  29759. * @param {Boolean} [options.parentFirst=false] When set to `true`, array will be sorted from text proxy parent to root element,
  29760. * otherwise root element will be the first item in the array.
  29761. * @returns {Array} Array with ancestors.
  29762. */
  29763. getAncestors( options = { includeSelf: false, parentFirst: false } ) {
  29764. const ancestors = [];
  29765. let parent = options.includeSelf ? this : this.parent;
  29766. while ( parent ) {
  29767. ancestors[ options.parentFirst ? 'push' : 'unshift' ]( parent );
  29768. parent = parent.parent;
  29769. }
  29770. return ancestors;
  29771. }
  29772. /**
  29773. * Checks if this text proxy has an attribute for given key.
  29774. *
  29775. * @param {String} key Key of attribute to check.
  29776. * @returns {Boolean} `true` if attribute with given key is set on text proxy, `false` otherwise.
  29777. */
  29778. hasAttribute( key ) {
  29779. return this.textNode.hasAttribute( key );
  29780. }
  29781. /**
  29782. * Gets an attribute value for given key or `undefined` if that attribute is not set on text proxy.
  29783. *
  29784. * @param {String} key Key of attribute to look for.
  29785. * @returns {*} Attribute value or `undefined`.
  29786. */
  29787. getAttribute( key ) {
  29788. return this.textNode.getAttribute( key );
  29789. }
  29790. /**
  29791. * Returns iterator that iterates over this node's attributes. Attributes are returned as arrays containing two
  29792. * items. First one is attribute key and second is attribute value.
  29793. *
  29794. * This format is accepted by native `Map` object and also can be passed in `Node` constructor.
  29795. *
  29796. * @returns {Iterable.<*>}
  29797. */
  29798. getAttributes() {
  29799. return this.textNode.getAttributes();
  29800. }
  29801. /**
  29802. * Returns iterator that iterates over this node's attribute keys.
  29803. *
  29804. * @returns {Iterable.<String>}
  29805. */
  29806. getAttributeKeys() {
  29807. return this.textNode.getAttributeKeys();
  29808. }
  29809. // @if CK_DEBUG_ENGINE // toString() {
  29810. // @if CK_DEBUG_ENGINE // return `#${ this.data }`;
  29811. // @if CK_DEBUG_ENGINE // }
  29812. // @if CK_DEBUG_ENGINE // log() {
  29813. // @if CK_DEBUG_ENGINE // console.log( 'ModelTextProxy: ' + this );
  29814. // @if CK_DEBUG_ENGINE // }
  29815. // @if CK_DEBUG_ENGINE // logExtended() {
  29816. // @if CK_DEBUG_ENGINE // console.log( `ModelTextProxy: ${ this }, ` +
  29817. // @if CK_DEBUG_ENGINE // `attrs: ${ convertMapToStringifiedObject( this.getAttributes() ) }` );
  29818. // @if CK_DEBUG_ENGINE // }
  29819. }
  29820. /***/ }),
  29821. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/treewalker.js":
  29822. /*!*************************************************************************!*\
  29823. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/treewalker.js ***!
  29824. \*************************************************************************/
  29825. /*! exports provided: default */
  29826. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  29827. "use strict";
  29828. __webpack_require__.r(__webpack_exports__);
  29829. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TreeWalker; });
  29830. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js");
  29831. /* harmony import */ var _textproxy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.js");
  29832. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
  29833. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  29834. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  29835. /**
  29836. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  29837. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  29838. */
  29839. /**
  29840. * @module engine/model/treewalker
  29841. */
  29842. /**
  29843. * Position iterator class. It allows to iterate forward and backward over the document.
  29844. */
  29845. class TreeWalker {
  29846. /**
  29847. * Creates a range iterator. All parameters are optional, but you have to specify either `boundaries` or `startPosition`.
  29848. *
  29849. * @constructor
  29850. * @param {Object} [options={}] Object with configuration.
  29851. * @param {'forward'|'backward'} [options.direction='forward'] Walking direction.
  29852. * @param {module:engine/model/range~Range} [options.boundaries=null] Range to define boundaries of the iterator.
  29853. * @param {module:engine/model/position~Position} [options.startPosition] Starting position.
  29854. * @param {Boolean} [options.singleCharacters=false] Flag indicating whether all consecutive characters with the same attributes
  29855. * should be returned one by one as multiple {@link module:engine/model/textproxy~TextProxy} (`true`) objects or as one
  29856. * {@link module:engine/model/textproxy~TextProxy} (`false`).
  29857. * @param {Boolean} [options.shallow=false] Flag indicating whether iterator should enter elements or not. If the
  29858. * iterator is shallow child nodes of any iterated node will not be returned along with `elementEnd` tag.
  29859. * @param {Boolean} [options.ignoreElementEnd=false] Flag indicating whether iterator should ignore `elementEnd`
  29860. * tags. If the option is true walker will not return a parent node of start position. If this option is `true`
  29861. * each {@link module:engine/model/element~Element} will be returned once, while if the option is `false` they might be returned
  29862. * twice: for `'elementStart'` and `'elementEnd'`.
  29863. */
  29864. constructor( options = {} ) {
  29865. if ( !options.boundaries && !options.startPosition ) {
  29866. /**
  29867. * Neither boundaries nor starting position of a `TreeWalker` have been defined.
  29868. *
  29869. * @error model-tree-walker-no-start-position
  29870. */
  29871. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
  29872. 'model-tree-walker-no-start-position',
  29873. null
  29874. );
  29875. }
  29876. const direction = options.direction || 'forward';
  29877. if ( direction != 'forward' && direction != 'backward' ) {
  29878. /**
  29879. * Only `backward` and `forward` direction allowed.
  29880. *
  29881. * @error model-tree-walker-unknown-direction
  29882. */
  29883. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"]( 'model-tree-walker-unknown-direction', options, { direction } );
  29884. }
  29885. /**
  29886. * Walking direction. Defaults `'forward'`.
  29887. *
  29888. * @readonly
  29889. * @member {'backward'|'forward'} module:engine/model/treewalker~TreeWalker#direction
  29890. */
  29891. this.direction = direction;
  29892. /**
  29893. * Iterator boundaries.
  29894. *
  29895. * When the iterator is walking `'forward'` on the end of boundary or is walking `'backward'`
  29896. * on the start of boundary, then `{ done: true }` is returned.
  29897. *
  29898. * If boundaries are not defined they are set before first and after last child of the root node.
  29899. *
  29900. * @readonly
  29901. * @member {module:engine/model/range~Range} module:engine/model/treewalker~TreeWalker#boundaries
  29902. */
  29903. this.boundaries = options.boundaries || null;
  29904. /**
  29905. * Iterator position. This is always static position, even if the initial position was a
  29906. * {@link module:engine/model/liveposition~LivePosition live position}. If start position is not defined then position depends
  29907. * on {@link #direction}. If direction is `'forward'` position starts form the beginning, when direction
  29908. * is `'backward'` position starts from the end.
  29909. *
  29910. * @readonly
  29911. * @member {module:engine/model/position~Position} module:engine/model/treewalker~TreeWalker#position
  29912. */
  29913. if ( options.startPosition ) {
  29914. this.position = options.startPosition.clone();
  29915. } else {
  29916. this.position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createAt( this.boundaries[ this.direction == 'backward' ? 'end' : 'start' ] );
  29917. }
  29918. // Reset position stickiness in case it was set to other value, as the stickiness is kept after cloning.
  29919. this.position.stickiness = 'toNone';
  29920. /**
  29921. * Flag indicating whether all consecutive characters with the same attributes should be
  29922. * returned as one {@link module:engine/model/textproxy~TextProxy} (`true`) or one by one (`false`).
  29923. *
  29924. * @readonly
  29925. * @member {Boolean} module:engine/model/treewalker~TreeWalker#singleCharacters
  29926. */
  29927. this.singleCharacters = !!options.singleCharacters;
  29928. /**
  29929. * Flag indicating whether iterator should enter elements or not. If the iterator is shallow child nodes of any
  29930. * iterated node will not be returned along with `elementEnd` tag.
  29931. *
  29932. * @readonly
  29933. * @member {Boolean} module:engine/model/treewalker~TreeWalker#shallow
  29934. */
  29935. this.shallow = !!options.shallow;
  29936. /**
  29937. * Flag indicating whether iterator should ignore `elementEnd` tags. If the option is true walker will not
  29938. * return a parent node of the start position. If this option is `true` each {@link module:engine/model/element~Element} will
  29939. * be returned once, while if the option is `false` they might be returned twice:
  29940. * for `'elementStart'` and `'elementEnd'`.
  29941. *
  29942. * @readonly
  29943. * @member {Boolean} module:engine/model/treewalker~TreeWalker#ignoreElementEnd
  29944. */
  29945. this.ignoreElementEnd = !!options.ignoreElementEnd;
  29946. /**
  29947. * Start boundary cached for optimization purposes.
  29948. *
  29949. * @private
  29950. * @member {module:engine/model/element~Element} module:engine/model/treewalker~TreeWalker#_boundaryStartParent
  29951. */
  29952. this._boundaryStartParent = this.boundaries ? this.boundaries.start.parent : null;
  29953. /**
  29954. * End boundary cached for optimization purposes.
  29955. *
  29956. * @private
  29957. * @member {module:engine/model/element~Element} module:engine/model/treewalker~TreeWalker#_boundaryEndParent
  29958. */
  29959. this._boundaryEndParent = this.boundaries ? this.boundaries.end.parent : null;
  29960. /**
  29961. * Parent of the most recently visited node. Cached for optimization purposes.
  29962. *
  29963. * @private
  29964. * @member {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment}
  29965. * module:engine/model/treewalker~TreeWalker#_visitedParent
  29966. */
  29967. this._visitedParent = this.position.parent;
  29968. }
  29969. /**
  29970. * Iterable interface.
  29971. *
  29972. * @returns {Iterable.<module:engine/model/treewalker~TreeWalkerValue>}
  29973. */
  29974. [ Symbol.iterator ]() {
  29975. return this;
  29976. }
  29977. /**
  29978. * Moves {@link #position} in the {@link #direction} skipping values as long as the callback function returns `true`.
  29979. *
  29980. * For example:
  29981. *
  29982. * walker.skip( value => value.type == 'text' ); // <paragraph>[]foo</paragraph> -> <paragraph>foo[]</paragraph>
  29983. * walker.skip( () => true ); // Move the position to the end: <paragraph>[]foo</paragraph> -> <paragraph>foo</paragraph>[]
  29984. * walker.skip( () => false ); // Do not move the position.
  29985. *
  29986. * @param {Function} skip Callback function. Gets {@link module:engine/model/treewalker~TreeWalkerValue} and should
  29987. * return `true` if the value should be skipped or `false` if not.
  29988. */
  29989. skip( skip ) {
  29990. let done, value, prevPosition, prevVisitedParent;
  29991. do {
  29992. prevPosition = this.position;
  29993. prevVisitedParent = this._visitedParent;
  29994. ( { done, value } = this.next() );
  29995. } while ( !done && skip( value ) );
  29996. if ( !done ) {
  29997. this.position = prevPosition;
  29998. this._visitedParent = prevVisitedParent;
  29999. }
  30000. }
  30001. /**
  30002. * Gets the next tree walker's value.
  30003. *
  30004. * @returns {module:engine/model/treewalker~TreeWalkerValue} Next tree walker's value.
  30005. */
  30006. next() {
  30007. if ( this.direction == 'forward' ) {
  30008. return this._next();
  30009. } else {
  30010. return this._previous();
  30011. }
  30012. }
  30013. /**
  30014. * Makes a step forward in model. Moves the {@link #position} to the next position and returns the encountered value.
  30015. *
  30016. * @private
  30017. * @returns {Object}
  30018. * @returns {Boolean} return.done True if iterator is done.
  30019. * @returns {module:engine/model/treewalker~TreeWalkerValue} return.value Information about taken step.
  30020. */
  30021. _next() {
  30022. const previousPosition = this.position;
  30023. const position = this.position.clone();
  30024. const parent = this._visitedParent;
  30025. // We are at the end of the root.
  30026. if ( parent.parent === null && position.offset === parent.maxOffset ) {
  30027. return { done: true };
  30028. }
  30029. // We reached the walker boundary.
  30030. if ( parent === this._boundaryEndParent && position.offset == this.boundaries.end.offset ) {
  30031. return { done: true };
  30032. }
  30033. // Get node just after the current position.
  30034. // Use a highly optimized version instead of checking the text node first and then getting the node after. See #6582.
  30035. const positionParent = position.parent;
  30036. const textNodeAtPosition = Object(_position__WEBPACK_IMPORTED_MODULE_3__["getTextNodeAtPosition"])( position, positionParent );
  30037. const node = textNodeAtPosition ? textNodeAtPosition : Object(_position__WEBPACK_IMPORTED_MODULE_3__["getNodeAfterPosition"])( position, positionParent, textNodeAtPosition );
  30038. if ( node instanceof _element__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
  30039. if ( !this.shallow ) {
  30040. // Manual operations on path internals for optimization purposes. Here and in the rest of the method.
  30041. position.path.push( 0 );
  30042. this._visitedParent = node;
  30043. } else {
  30044. position.offset++;
  30045. }
  30046. this.position = position;
  30047. return formatReturnValue( 'elementStart', node, previousPosition, position, 1 );
  30048. } else if ( node instanceof _text__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  30049. let charactersCount;
  30050. if ( this.singleCharacters ) {
  30051. charactersCount = 1;
  30052. } else {
  30053. let offset = node.endOffset;
  30054. if ( this._boundaryEndParent == parent && this.boundaries.end.offset < offset ) {
  30055. offset = this.boundaries.end.offset;
  30056. }
  30057. charactersCount = offset - position.offset;
  30058. }
  30059. const offsetInTextNode = position.offset - node.startOffset;
  30060. const item = new _textproxy__WEBPACK_IMPORTED_MODULE_1__["default"]( node, offsetInTextNode, charactersCount );
  30061. position.offset += charactersCount;
  30062. this.position = position;
  30063. return formatReturnValue( 'text', item, previousPosition, position, charactersCount );
  30064. } else {
  30065. // `node` is not set, we reached the end of current `parent`.
  30066. position.path.pop();
  30067. position.offset++;
  30068. this.position = position;
  30069. this._visitedParent = parent.parent;
  30070. if ( this.ignoreElementEnd ) {
  30071. return this._next();
  30072. } else {
  30073. return formatReturnValue( 'elementEnd', parent, previousPosition, position );
  30074. }
  30075. }
  30076. }
  30077. /**
  30078. * Makes a step backward in model. Moves the {@link #position} to the previous position and returns the encountered value.
  30079. *
  30080. * @private
  30081. * @returns {Object}
  30082. * @returns {Boolean} return.done True if iterator is done.
  30083. * @returns {module:engine/model/treewalker~TreeWalkerValue} return.value Information about taken step.
  30084. */
  30085. _previous() {
  30086. const previousPosition = this.position;
  30087. const position = this.position.clone();
  30088. const parent = this._visitedParent;
  30089. // We are at the beginning of the root.
  30090. if ( parent.parent === null && position.offset === 0 ) {
  30091. return { done: true };
  30092. }
  30093. // We reached the walker boundary.
  30094. if ( parent == this._boundaryStartParent && position.offset == this.boundaries.start.offset ) {
  30095. return { done: true };
  30096. }
  30097. // Get node just before the current position.
  30098. // Use a highly optimized version instead of checking the text node first and then getting the node before. See #6582.
  30099. const positionParent = position.parent;
  30100. const textNodeAtPosition = Object(_position__WEBPACK_IMPORTED_MODULE_3__["getTextNodeAtPosition"])( position, positionParent );
  30101. const node = textNodeAtPosition ? textNodeAtPosition : Object(_position__WEBPACK_IMPORTED_MODULE_3__["getNodeBeforePosition"])( position, positionParent, textNodeAtPosition );
  30102. if ( node instanceof _element__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
  30103. position.offset--;
  30104. if ( !this.shallow ) {
  30105. position.path.push( node.maxOffset );
  30106. this.position = position;
  30107. this._visitedParent = node;
  30108. if ( this.ignoreElementEnd ) {
  30109. return this._previous();
  30110. } else {
  30111. return formatReturnValue( 'elementEnd', node, previousPosition, position );
  30112. }
  30113. } else {
  30114. this.position = position;
  30115. return formatReturnValue( 'elementStart', node, previousPosition, position, 1 );
  30116. }
  30117. } else if ( node instanceof _text__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  30118. let charactersCount;
  30119. if ( this.singleCharacters ) {
  30120. charactersCount = 1;
  30121. } else {
  30122. let offset = node.startOffset;
  30123. if ( this._boundaryStartParent == parent && this.boundaries.start.offset > offset ) {
  30124. offset = this.boundaries.start.offset;
  30125. }
  30126. charactersCount = position.offset - offset;
  30127. }
  30128. const offsetInTextNode = position.offset - node.startOffset;
  30129. const item = new _textproxy__WEBPACK_IMPORTED_MODULE_1__["default"]( node, offsetInTextNode - charactersCount, charactersCount );
  30130. position.offset -= charactersCount;
  30131. this.position = position;
  30132. return formatReturnValue( 'text', item, previousPosition, position, charactersCount );
  30133. } else {
  30134. // `node` is not set, we reached the beginning of current `parent`.
  30135. position.path.pop();
  30136. this.position = position;
  30137. this._visitedParent = parent.parent;
  30138. return formatReturnValue( 'elementStart', parent, previousPosition, position, 1 );
  30139. }
  30140. }
  30141. }
  30142. function formatReturnValue( type, item, previousPosition, nextPosition, length ) {
  30143. return {
  30144. done: false,
  30145. value: {
  30146. type,
  30147. item,
  30148. previousPosition,
  30149. nextPosition,
  30150. length
  30151. }
  30152. };
  30153. }
  30154. /**
  30155. * Type of the step made by {@link module:engine/model/treewalker~TreeWalker}.
  30156. * Possible values: `'elementStart'` if walker is at the beginning of a node, `'elementEnd'` if walker is at the end of node,
  30157. * `'character'` if walker traversed over a character, or `'text'` if walker traversed over multiple characters (available in
  30158. * character merging mode, see {@link module:engine/model/treewalker~TreeWalker#constructor}).
  30159. *
  30160. * @typedef {'elementStart'|'elementEnd'|'character'|'text'} module:engine/model/treewalker~TreeWalkerValueType
  30161. */
  30162. /**
  30163. * Object returned by {@link module:engine/model/treewalker~TreeWalker} when traversing tree model.
  30164. *
  30165. * @typedef {Object} module:engine/model/treewalker~TreeWalkerValue
  30166. * @property {module:engine/model/treewalker~TreeWalkerValueType} type
  30167. * @property {module:engine/model/item~Item} item Item between old and new positions of {@link module:engine/model/treewalker~TreeWalker}.
  30168. * @property {module:engine/model/position~Position} previousPosition Previous position of the iterator.
  30169. * * Forward iteration: For `'elementEnd'` it is the last position inside the element. For all other types it is the
  30170. * position before the item.
  30171. * * Backward iteration: For `'elementStart'` it is the first position inside the element. For all other types it is
  30172. * the position after item.
  30173. * @property {module:engine/model/position~Position} nextPosition Next position of the iterator.
  30174. * * Forward iteration: For `'elementStart'` it is the first position inside the element. For all other types it is
  30175. * the position after the item.
  30176. * * Backward iteration: For `'elementEnd'` it is last position inside element. For all other types it is the position
  30177. * before the item.
  30178. * @property {Number} [length] Length of the item. For `'elementStart'` and `'character'` it is 1. For `'text'` it is
  30179. * the length of the text. For `'elementEnd'` it is `undefined`.
  30180. */
  30181. /**
  30182. * Tree walking directions.
  30183. *
  30184. * @typedef {'forward'|'backward'} module:engine/model/treewalker~TreeWalkerDirection
  30185. */
  30186. /***/ }),
  30187. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/autoparagraphing.js":
  30188. /*!*************************************************************************************!*\
  30189. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/autoparagraphing.js ***!
  30190. \*************************************************************************************/
  30191. /*! exports provided: autoParagraphEmptyRoots, isParagraphable, wrapInParagraph */
  30192. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  30193. "use strict";
  30194. __webpack_require__.r(__webpack_exports__);
  30195. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "autoParagraphEmptyRoots", function() { return autoParagraphEmptyRoots; });
  30196. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isParagraphable", function() { return isParagraphable; });
  30197. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapInParagraph", function() { return wrapInParagraph; });
  30198. /**
  30199. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  30200. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  30201. */
  30202. /**
  30203. * @module engine/model/utils/autoparagraphing
  30204. */
  30205. /**
  30206. * Fixes all empty roots.
  30207. *
  30208. * @protected
  30209. * @param {module:engine/model/writer~Writer} writer The model writer.
  30210. * @returns {Boolean} `true` if any change has been applied, `false` otherwise.
  30211. */
  30212. function autoParagraphEmptyRoots( writer ) {
  30213. const { schema, document } = writer.model;
  30214. for ( const rootName of document.getRootNames() ) {
  30215. const root = document.getRoot( rootName );
  30216. if ( root.isEmpty && !schema.checkChild( root, '$text' ) ) {
  30217. // If paragraph element is allowed in the root, create paragraph element.
  30218. if ( schema.checkChild( root, 'paragraph' ) ) {
  30219. writer.insertElement( 'paragraph', root );
  30220. // Other roots will get fixed in the next post-fixer round. Those will be triggered
  30221. // in the same batch no matter if this method was triggered by the post-fixing or not
  30222. // (the above insertElement call will trigger the post-fixers).
  30223. return true;
  30224. }
  30225. }
  30226. }
  30227. return false;
  30228. }
  30229. /**
  30230. * Checks if the given node wrapped with a paragraph would be accepted by the schema in the given position.
  30231. *
  30232. * @protected
  30233. * @param {module:engine/model/position~Position} position The position at which to check.
  30234. * @param {module:engine/model/node~Node|String} nodeOrType The child node or child type to check.
  30235. * @param {module:engine/model/schema~Schema} schema A schema instance used for element validation.
  30236. */
  30237. function isParagraphable( position, nodeOrType, schema ) {
  30238. const context = schema.createContext( position );
  30239. // When paragraph is allowed in this context...
  30240. if ( !schema.checkChild( context, 'paragraph' ) ) {
  30241. return false;
  30242. }
  30243. // And a node would be allowed in this paragraph...
  30244. if ( !schema.checkChild( context.push( 'paragraph' ), nodeOrType ) ) {
  30245. return false;
  30246. }
  30247. return true;
  30248. }
  30249. /**
  30250. * Inserts a new paragraph at the given position and returns a position inside that paragraph.
  30251. *
  30252. * @protected
  30253. * @param {module:engine/model/position~Position} position The position where a paragraph should be inserted.
  30254. * @param {module:engine/model/writer~Writer} writer The model writer.
  30255. * @returns {module:engine/model/position~Position} Position inside the created paragraph.
  30256. */
  30257. function wrapInParagraph( position, writer ) {
  30258. const paragraph = writer.createElement( 'paragraph' );
  30259. writer.insert( paragraph, position );
  30260. return writer.createPositionAt( paragraph, 0 );
  30261. }
  30262. /***/ }),
  30263. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/deletecontent.js":
  30264. /*!**********************************************************************************!*\
  30265. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/deletecontent.js ***!
  30266. \**********************************************************************************/
  30267. /*! exports provided: default */
  30268. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  30269. "use strict";
  30270. __webpack_require__.r(__webpack_exports__);
  30271. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return deleteContent; });
  30272. /* harmony import */ var _liveposition__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../liveposition */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/liveposition.js");
  30273. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  30274. /* harmony import */ var _documentselection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../documentselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js");
  30275. /**
  30276. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  30277. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  30278. */
  30279. /**
  30280. * @module engine/model/utils/deletecontent
  30281. */
  30282. /**
  30283. * Deletes content of the selection and merge siblings. The resulting selection is always collapsed.
  30284. *
  30285. * **Note:** Use {@link module:engine/model/model~Model#deleteContent} instead of this function.
  30286. * This function is only exposed to be reusable in algorithms
  30287. * which change the {@link module:engine/model/model~Model#deleteContent}
  30288. * method's behavior.
  30289. *
  30290. * @param {module:engine/model/model~Model} model The model in context of which the insertion
  30291. * should be performed.
  30292. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  30293. * Selection of which the content should be deleted.
  30294. * @param {Object} [options]
  30295. * @param {Boolean} [options.leaveUnmerged=false] Whether to merge elements after removing the content of the selection.
  30296. *
  30297. * For example `<heading>x[x</heading><paragraph>y]y</paragraph>` will become:
  30298. *
  30299. * * `<heading>x^y</heading>` with the option disabled (`leaveUnmerged == false`)
  30300. * * `<heading>x^</heading><paragraph>y</paragraph>` with enabled (`leaveUnmerged == true`).
  30301. *
  30302. * Note: {@link module:engine/model/schema~Schema#isObject object} and {@link module:engine/model/schema~Schema#isLimit limit}
  30303. * elements will not be merged.
  30304. *
  30305. * @param {Boolean} [options.doNotResetEntireContent=false] Whether to skip replacing the entire content with a
  30306. * paragraph when the entire content was selected.
  30307. *
  30308. * For example `<heading>[x</heading><paragraph>y]</paragraph>` will become:
  30309. *
  30310. * * `<paragraph>^</paragraph>` with the option disabled (`doNotResetEntireContent == false`)
  30311. * * `<heading>^</heading>` with enabled (`doNotResetEntireContent == true`).
  30312. *
  30313. * @param {Boolean} [options.doNotAutoparagraph=false] Whether to create a paragraph if after content deletion selection is moved
  30314. * to a place where text cannot be inserted.
  30315. *
  30316. * For example `<paragraph>x</paragraph>[<image src="foo.jpg"></image>]` will become:
  30317. *
  30318. * * `<paragraph>x</paragraph><paragraph>[]</paragraph>` with the option disabled (`doNotAutoparagraph == false`)
  30319. * * `<paragraph>x</paragraph>[]` with the option enabled (`doNotAutoparagraph == true`).
  30320. *
  30321. * If you use this option you need to make sure to handle invalid selections yourself or leave
  30322. * them to the selection post-fixer (may not always work).
  30323. *
  30324. * **Note:** if there is no valid position for the selection, the paragraph will always be created:
  30325. *
  30326. * `[<image src="foo.jpg"></image>]` -> `<paragraph>[]</paragraph>`.
  30327. */
  30328. function deleteContent( model, selection, options = {} ) {
  30329. if ( selection.isCollapsed ) {
  30330. return;
  30331. }
  30332. const selRange = selection.getFirstRange();
  30333. // If the selection is already removed, don't do anything.
  30334. if ( selRange.root.rootName == '$graveyard' ) {
  30335. return;
  30336. }
  30337. const schema = model.schema;
  30338. model.change( writer => {
  30339. // 1. Replace the entire content with paragraph.
  30340. // See: https://github.com/ckeditor/ckeditor5-engine/issues/1012#issuecomment-315017594.
  30341. if ( !options.doNotResetEntireContent && shouldEntireContentBeReplacedWithParagraph( schema, selection ) ) {
  30342. replaceEntireContentWithParagraph( writer, selection, schema );
  30343. return;
  30344. }
  30345. // Get the live positions for the range adjusted to span only blocks selected from the user perspective.
  30346. const [ startPosition, endPosition ] = getLivePositionsForSelectedBlocks( selRange );
  30347. // 2. Remove the content if there is any.
  30348. if ( !startPosition.isTouching( endPosition ) ) {
  30349. writer.remove( writer.createRange( startPosition, endPosition ) );
  30350. }
  30351. // 3. Merge elements in the right branch to the elements in the left branch.
  30352. // The only reasonable (in terms of data and selection correctness) case in which we need to do that is:
  30353. //
  30354. // <heading type=1>Fo[</heading><paragraph>]ar</paragraph> => <heading type=1>Fo^ar</heading>
  30355. //
  30356. // However, the algorithm supports also merging deeper structures (up to the depth of the shallower branch),
  30357. // as it's hard to imagine what should actually be the default behavior. Usually, specific features will
  30358. // want to override that behavior anyway.
  30359. if ( !options.leaveUnmerged ) {
  30360. mergeBranches( writer, startPosition, endPosition );
  30361. // TMP this will be replaced with a postfixer.
  30362. // We need to check and strip disallowed attributes in all nested nodes because after merge
  30363. // some attributes could end up in a path where are disallowed.
  30364. //
  30365. // e.g. bold is disallowed for <H1>
  30366. // <h1>Fo{o</h1><p>b}a<b>r</b><p> -> <h1>Fo{}a<b>r</b><h1> -> <h1>Fo{}ar<h1>.
  30367. schema.removeDisallowedAttributes( startPosition.parent.getChildren(), writer );
  30368. }
  30369. collapseSelectionAt( writer, selection, startPosition );
  30370. // 4. Add a paragraph to set selection in it.
  30371. // Check if a text is allowed in the new container. If not, try to create a new paragraph (if it's allowed here).
  30372. // If autoparagraphing is off, we assume that you know what you do so we leave the selection wherever it was.
  30373. if ( !options.doNotAutoparagraph && shouldAutoparagraph( schema, startPosition ) ) {
  30374. insertParagraph( writer, startPosition, selection );
  30375. }
  30376. startPosition.detach();
  30377. endPosition.detach();
  30378. } );
  30379. }
  30380. // Returns the live positions for the range adjusted to span only blocks selected from the user perspective. Example:
  30381. //
  30382. // <heading1>[foo</heading1>
  30383. // <paragraph>bar</paragraph>
  30384. // <heading1>]abc</heading1> <-- this block is not considered as selected
  30385. //
  30386. // This is the same behavior as in Selection#getSelectedBlocks() "special case".
  30387. function getLivePositionsForSelectedBlocks( range ) {
  30388. const model = range.root.document.model;
  30389. const startPosition = range.start;
  30390. let endPosition = range.end;
  30391. // If the end of selection is at the start position of last block in the selection, then
  30392. // shrink it to not include that trailing block. Note that this should happen only for not empty selection.
  30393. if ( model.hasContent( range, { ignoreMarkers: true } ) ) {
  30394. const endBlock = getParentBlock( endPosition );
  30395. if ( endBlock && endPosition.isTouching( model.createPositionAt( endBlock, 0 ) ) ) {
  30396. // Create forward selection as a probe to find a valid position after excluding last block from the range.
  30397. const selection = model.createSelection( range );
  30398. // Modify the forward selection in backward direction to shrink it and remove first position of following block from it.
  30399. // This is how modifySelection works and here we are making use of it.
  30400. model.modifySelection( selection, { direction: 'backward' } );
  30401. endPosition = selection.getLastPosition();
  30402. }
  30403. }
  30404. return [
  30405. _liveposition__WEBPACK_IMPORTED_MODULE_0__["default"].fromPosition( startPosition, 'toPrevious' ),
  30406. _liveposition__WEBPACK_IMPORTED_MODULE_0__["default"].fromPosition( endPosition, 'toNext' )
  30407. ];
  30408. }
  30409. // Finds the lowest element in position's ancestors which is a block.
  30410. // Returns null if a limit element is encountered before reaching a block element.
  30411. function getParentBlock( position ) {
  30412. const element = position.parent;
  30413. const schema = element.root.document.model.schema;
  30414. const ancestors = element.getAncestors( { parentFirst: true, includeSelf: true } );
  30415. for ( const element of ancestors ) {
  30416. if ( schema.isLimit( element ) ) {
  30417. return null;
  30418. }
  30419. if ( schema.isBlock( element ) ) {
  30420. return element;
  30421. }
  30422. }
  30423. }
  30424. // This function is a result of reaching the Ballmer's peak for just the right amount of time.
  30425. // Even I had troubles documenting it after a while and after reading it again I couldn't believe that it really works.
  30426. function mergeBranches( writer, startPosition, endPosition ) {
  30427. const model = writer.model;
  30428. // Verify if there is a need and possibility to merge.
  30429. if ( !checkShouldMerge( writer.model.schema, startPosition, endPosition ) ) {
  30430. return;
  30431. }
  30432. // If the start element on the common ancestor level is empty, and the end element on the same level is not empty
  30433. // then merge those to the right element so that it's properties are preserved (name, attributes).
  30434. // Because of OT merging is used instead of removing elements.
  30435. //
  30436. // Merge left:
  30437. // <heading1>foo[</heading1> -> <heading1>foo[]bar</heading1>
  30438. // <paragraph>]bar</paragraph> -> --^
  30439. //
  30440. // Merge right:
  30441. // <heading1>[</heading1> ->
  30442. // <paragraph>]bar</paragraph> -> <paragraph>[]bar</paragraph>
  30443. //
  30444. // Merge left:
  30445. // <blockQuote> -> <blockQuote>
  30446. // <heading1>foo[</heading1> -> <heading1>foo[]bar</heading1>
  30447. // <paragraph>]bar</paragraph> -> --^
  30448. // </blockQuote> -> </blockQuote>
  30449. //
  30450. // Merge right:
  30451. // <blockQuote> -> <blockQuote>
  30452. // <heading1>[</heading1> ->
  30453. // <paragraph>]bar</paragraph> -> <paragraph>[]bar</paragraph>
  30454. // </blockQuote> -> </blockQuote>
  30455. // Merging should not go deeper than common ancestor.
  30456. const [ startAncestor, endAncestor ] = getAncestorsJustBelowCommonAncestor( startPosition, endPosition );
  30457. if ( !model.hasContent( startAncestor, { ignoreMarkers: true } ) && model.hasContent( endAncestor, { ignoreMarkers: true } ) ) {
  30458. mergeBranchesRight( writer, startPosition, endPosition, startAncestor.parent );
  30459. } else {
  30460. mergeBranchesLeft( writer, startPosition, endPosition, startAncestor.parent );
  30461. }
  30462. }
  30463. // Merging blocks to the left (properties of the left block are preserved).
  30464. // Simple example:
  30465. // <heading1>foo[</heading1> -> <heading1>foo[bar</heading1>]
  30466. // <paragraph>]bar</paragraph> -> --^
  30467. //
  30468. // Nested example:
  30469. // <blockQuote> -> <blockQuote>
  30470. // <heading1>foo[</heading1> -> <heading1>foo[bar</heading1>
  30471. // </blockQuote> -> </blockQuote>] ^
  30472. // <blockBlock> -> |
  30473. // <paragraph>]bar</paragraph> -> ---
  30474. // </blockBlock> ->
  30475. //
  30476. function mergeBranchesLeft( writer, startPosition, endPosition, commonAncestor ) {
  30477. const startElement = startPosition.parent;
  30478. const endElement = endPosition.parent;
  30479. // Merging reached the common ancestor element, stop here.
  30480. if ( startElement == commonAncestor || endElement == commonAncestor ) {
  30481. return;
  30482. }
  30483. // Remember next positions to merge in next recursive step (also used as modification points pointers).
  30484. startPosition = writer.createPositionAfter( startElement );
  30485. endPosition = writer.createPositionBefore( endElement );
  30486. // Move endElement just after startElement if they aren't siblings.
  30487. if ( !endPosition.isEqual( startPosition ) ) {
  30488. //
  30489. // <blockQuote> -> <blockQuote>
  30490. // <heading1>foo[</heading1> -> <heading1>foo</heading1>[<paragraph>bar</paragraph>
  30491. // </blockQuote> -> </blockQuote> ^
  30492. // <blockBlock> -> <blockBlock> |
  30493. // <paragraph>]bar</paragraph> -> ] ---
  30494. // </blockBlock> -> </blockBlock>
  30495. //
  30496. writer.insert( endElement, startPosition );
  30497. }
  30498. // Merge two siblings (nodes on sides of startPosition):
  30499. //
  30500. // <blockQuote> -> <blockQuote>
  30501. // <heading1>foo</heading1>[<paragraph>bar</paragraph> -> <heading1>foo[bar</heading1>
  30502. // </blockQuote> -> </blockQuote>
  30503. // <blockBlock> -> <blockBlock>
  30504. // ] -> ]
  30505. // </blockBlock> -> </blockBlock>
  30506. //
  30507. // Or in simple case (without moving elements in above if):
  30508. // <heading1>foo</heading1>[<paragraph>bar</paragraph>] -> <heading1>foo[bar</heading1>]
  30509. //
  30510. writer.merge( startPosition );
  30511. // Remove empty end ancestors:
  30512. //
  30513. // <blockQuote> -> <blockQuote>
  30514. // <heading1>foo[bar</heading1> -> <heading1>foo[bar</heading1>
  30515. // </blockQuote> -> </blockQuote>
  30516. // <blockBlock> ->
  30517. // ] -> ]
  30518. // </blockBlock> ->
  30519. //
  30520. while ( endPosition.parent.isEmpty ) {
  30521. const parentToRemove = endPosition.parent;
  30522. endPosition = writer.createPositionBefore( parentToRemove );
  30523. writer.remove( parentToRemove );
  30524. }
  30525. // Verify if there is a need and possibility to merge next level.
  30526. if ( !checkShouldMerge( writer.model.schema, startPosition, endPosition ) ) {
  30527. return;
  30528. }
  30529. // Continue merging next level (blockQuote with blockBlock in the examples above if it would not be empty and got removed).
  30530. mergeBranchesLeft( writer, startPosition, endPosition, commonAncestor );
  30531. }
  30532. // Merging blocks to the right (properties of the right block are preserved).
  30533. // Simple example:
  30534. // <heading1>foo[</heading1> -> --v
  30535. // <paragraph>]bar</paragraph> -> [<paragraph>foo]bar</paragraph>
  30536. //
  30537. // Nested example:
  30538. // <blockQuote> ->
  30539. // <heading1>foo[</heading1> -> ---
  30540. // </blockQuote> -> |
  30541. // <blockBlock> -> [<blockBlock> v
  30542. // <paragraph>]bar</paragraph> -> <paragraph>foo]bar</paragraph>
  30543. // </blockBlock> -> </blockBlock>
  30544. //
  30545. function mergeBranchesRight( writer, startPosition, endPosition, commonAncestor ) {
  30546. const startElement = startPosition.parent;
  30547. const endElement = endPosition.parent;
  30548. // Merging reached the common ancestor element, stop here.
  30549. if ( startElement == commonAncestor || endElement == commonAncestor ) {
  30550. return;
  30551. }
  30552. // Remember next positions to merge in next recursive step (also used as modification points pointers).
  30553. startPosition = writer.createPositionAfter( startElement );
  30554. endPosition = writer.createPositionBefore( endElement );
  30555. // Move startElement just before endElement if they aren't siblings.
  30556. if ( !endPosition.isEqual( startPosition ) ) {
  30557. //
  30558. // <blockQuote> -> <blockQuote>
  30559. // <heading1>foo[</heading1> -> [ ---
  30560. // </blockQuote> -> </blockQuote> |
  30561. // <blockBlock> -> <blockBlock> v
  30562. // <paragraph>]bar</paragraph> -> <heading1>foo</heading1>]<paragraph>bar</paragraph>
  30563. // </blockBlock> -> </blockBlock>
  30564. //
  30565. writer.insert( startElement, endPosition );
  30566. }
  30567. // Remove empty end ancestors:
  30568. //
  30569. // <blockQuote> ->
  30570. // [ -> [
  30571. // </blockQuote> ->
  30572. // <blockBlock> -> <blockBlock>
  30573. // <heading1>foo</heading1>]<paragraph>bar</paragraph> -> <heading1>foo</heading1>]<paragraph>bar</paragraph>
  30574. // </blockBlock> -> </blockBlock>
  30575. //
  30576. while ( startPosition.parent.isEmpty ) {
  30577. const parentToRemove = startPosition.parent;
  30578. startPosition = writer.createPositionBefore( parentToRemove );
  30579. writer.remove( parentToRemove );
  30580. }
  30581. // Update endPosition after inserting and removing elements.
  30582. endPosition = writer.createPositionBefore( endElement );
  30583. // Merge right two siblings (nodes on sides of endPosition):
  30584. // ->
  30585. // [ -> [
  30586. // ->
  30587. // <blockBlock> -> <blockBlock>
  30588. // <heading1>foo</heading1>]<paragraph>bar</paragraph> -> <paragraph>foo]bar</paragraph>
  30589. // </blockBlock> -> </blockBlock>
  30590. //
  30591. // Or in simple case (without moving elements in above if):
  30592. // [<heading1>foo</heading1>]<paragraph>bar</paragraph> -> [<heading1>foo]bar</heading1>
  30593. //
  30594. mergeRight( writer, endPosition );
  30595. // Verify if there is a need and possibility to merge next level.
  30596. if ( !checkShouldMerge( writer.model.schema, startPosition, endPosition ) ) {
  30597. return;
  30598. }
  30599. // Continue merging next level (blockQuote with blockBlock in the examples above if it would not be empty and got removed).
  30600. mergeBranchesRight( writer, startPosition, endPosition, commonAncestor );
  30601. }
  30602. // There is no right merge operation so we need to simulate it.
  30603. function mergeRight( writer, position ) {
  30604. const startElement = position.nodeBefore;
  30605. const endElement = position.nodeAfter;
  30606. if ( startElement.name != endElement.name ) {
  30607. writer.rename( startElement, endElement.name );
  30608. }
  30609. writer.clearAttributes( startElement );
  30610. writer.setAttributes( Object.fromEntries( endElement.getAttributes() ), startElement );
  30611. writer.merge( position );
  30612. }
  30613. // Verifies if merging is needed and possible. It's not needed if both positions are in the same element
  30614. // and it's not possible if some element is a limit or the range crosses a limit element.
  30615. function checkShouldMerge( schema, startPosition, endPosition ) {
  30616. const startElement = startPosition.parent;
  30617. const endElement = endPosition.parent;
  30618. // If both positions ended up in the same parent, then there's nothing more to merge:
  30619. // <$root><p>x[</p><p>]y</p></$root> => <$root><p>xy</p>[]</$root>
  30620. if ( startElement == endElement ) {
  30621. return false;
  30622. }
  30623. // If one of the positions is a limit element, then there's nothing to merge because we don't want to cross the limit boundaries.
  30624. if ( schema.isLimit( startElement ) || schema.isLimit( endElement ) ) {
  30625. return false;
  30626. }
  30627. // Check if operations we'll need to do won't need to cross object or limit boundaries.
  30628. // E.g., we can't merge endElement into startElement in this case:
  30629. // <limit><startElement>x[</startElement></limit><endElement>]</endElement>
  30630. return isCrossingLimitElement( startPosition, endPosition, schema );
  30631. }
  30632. // Returns the elements that are the ancestors of the provided positions that are direct children of the common ancestor.
  30633. function getAncestorsJustBelowCommonAncestor( positionA, positionB ) {
  30634. const ancestorsA = positionA.getAncestors();
  30635. const ancestorsB = positionB.getAncestors();
  30636. let i = 0;
  30637. while ( ancestorsA[ i ] && ancestorsA[ i ] == ancestorsB[ i ] ) {
  30638. i++;
  30639. }
  30640. return [ ancestorsA[ i ], ancestorsB[ i ] ];
  30641. }
  30642. function shouldAutoparagraph( schema, position ) {
  30643. const isTextAllowed = schema.checkChild( position, '$text' );
  30644. const isParagraphAllowed = schema.checkChild( position, 'paragraph' );
  30645. return !isTextAllowed && isParagraphAllowed;
  30646. }
  30647. // Check if parents of two positions can be merged by checking if there are no limit/object
  30648. // boundaries between those two positions.
  30649. //
  30650. // E.g. in <bQ><p>x[]</p></bQ><widget><caption>{}</caption></widget>
  30651. // we'll check <p>, <bQ>, <widget> and <caption>.
  30652. // Usually, widget and caption are marked as objects/limits in the schema, so in this case merging will be blocked.
  30653. function isCrossingLimitElement( leftPos, rightPos, schema ) {
  30654. const rangeToCheck = new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( leftPos, rightPos );
  30655. for ( const value of rangeToCheck.getWalker() ) {
  30656. if ( schema.isLimit( value.item ) ) {
  30657. return false;
  30658. }
  30659. }
  30660. return true;
  30661. }
  30662. function insertParagraph( writer, position, selection ) {
  30663. const paragraph = writer.createElement( 'paragraph' );
  30664. writer.insert( paragraph, position );
  30665. collapseSelectionAt( writer, selection, writer.createPositionAt( paragraph, 0 ) );
  30666. }
  30667. function replaceEntireContentWithParagraph( writer, selection ) {
  30668. const limitElement = writer.model.schema.getLimitElement( selection );
  30669. writer.remove( writer.createRangeIn( limitElement ) );
  30670. insertParagraph( writer, writer.createPositionAt( limitElement, 0 ), selection );
  30671. }
  30672. // We want to replace the entire content with a paragraph when:
  30673. // * the entire content is selected,
  30674. // * selection contains at least two elements,
  30675. // * whether the paragraph is allowed in schema in the common ancestor.
  30676. function shouldEntireContentBeReplacedWithParagraph( schema, selection ) {
  30677. const limitElement = schema.getLimitElement( selection );
  30678. if ( !selection.containsEntireContent( limitElement ) ) {
  30679. return false;
  30680. }
  30681. const range = selection.getFirstRange();
  30682. if ( range.start.parent == range.end.parent ) {
  30683. return false;
  30684. }
  30685. return schema.checkChild( limitElement, 'paragraph' );
  30686. }
  30687. // Helper function that sets the selection. Depending whether given `selection` is a document selection or not,
  30688. // uses a different method to set it.
  30689. function collapseSelectionAt( writer, selection, positionOrRange ) {
  30690. if ( selection instanceof _documentselection__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
  30691. writer.setSelection( positionOrRange );
  30692. } else {
  30693. selection.setTo( positionOrRange );
  30694. }
  30695. }
  30696. /***/ }),
  30697. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/getselectedcontent.js":
  30698. /*!***************************************************************************************!*\
  30699. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/getselectedcontent.js ***!
  30700. \***************************************************************************************/
  30701. /*! exports provided: default */
  30702. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  30703. "use strict";
  30704. __webpack_require__.r(__webpack_exports__);
  30705. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getSelectedContent; });
  30706. /**
  30707. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  30708. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  30709. */
  30710. /**
  30711. * @module engine/model/utils/getselectedcontent
  30712. */
  30713. /**
  30714. * Gets a clone of the selected content.
  30715. *
  30716. * For example, for the following selection:
  30717. *
  30718. * ```html
  30719. * <p>x</p><quote><p>y</p><h>fir[st</h></quote><p>se]cond</p><p>z</p>
  30720. * ```
  30721. *
  30722. * It will return a document fragment with such a content:
  30723. *
  30724. * ```html
  30725. * <quote><h>st</h></quote><p>se</p>
  30726. * ```
  30727. *
  30728. * @param {module:engine/model/model~Model} model The model in context of which
  30729. * the selection modification should be performed.
  30730. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  30731. * The selection of which content will be returned.
  30732. * @returns {module:engine/model/documentfragment~DocumentFragment}
  30733. */
  30734. function getSelectedContent( model, selection ) {
  30735. return model.change( writer => {
  30736. const frag = writer.createDocumentFragment();
  30737. const range = selection.getFirstRange();
  30738. if ( !range || range.isCollapsed ) {
  30739. return frag;
  30740. }
  30741. const root = range.start.root;
  30742. const commonPath = range.start.getCommonPath( range.end );
  30743. const commonParent = root.getNodeByPath( commonPath );
  30744. // ## 1st step
  30745. //
  30746. // First, we'll clone a fragment represented by a minimal flat range
  30747. // containing the original range to be cloned.
  30748. // E.g. let's consider such a range:
  30749. //
  30750. // <p>x</p><quote><p>y</p><h>fir[st</h></quote><p>se]cond</p><p>z</p>
  30751. //
  30752. // A minimal flat range containing this one is:
  30753. //
  30754. // <p>x</p>[<quote><p>y</p><h>first</h></quote><p>second</p>]<p>z</p>
  30755. //
  30756. // We can easily clone this structure, preserving e.g. the <quote> element.
  30757. let flatSubtreeRange;
  30758. if ( range.start.parent == range.end.parent ) {
  30759. // The original range is flat, so take it.
  30760. flatSubtreeRange = range;
  30761. } else {
  30762. flatSubtreeRange = writer.createRange(
  30763. writer.createPositionAt( commonParent, range.start.path[ commonPath.length ] ),
  30764. writer.createPositionAt( commonParent, range.end.path[ commonPath.length ] + 1 )
  30765. );
  30766. }
  30767. const howMany = flatSubtreeRange.end.offset - flatSubtreeRange.start.offset;
  30768. // Clone the whole contents.
  30769. for ( const item of flatSubtreeRange.getItems( { shallow: true } ) ) {
  30770. if ( item.is( '$textProxy' ) ) {
  30771. writer.appendText( item.data, item.getAttributes(), frag );
  30772. } else {
  30773. writer.append( writer.cloneElement( item, true ), frag );
  30774. }
  30775. }
  30776. // ## 2nd step
  30777. //
  30778. // If the original range wasn't flat, then we need to remove the excess nodes from the both ends of the cloned fragment.
  30779. //
  30780. // For example, for the range shown in the 1st step comment, we need to remove these pieces:
  30781. //
  30782. // <quote>[<p>y</p>]<h>[fir]st</h></quote><p>se[cond]</p>
  30783. //
  30784. // So this will be the final copied content:
  30785. //
  30786. // <quote><h>st</h></quote><p>se</p>
  30787. //
  30788. // In order to do that, we remove content from these two ranges:
  30789. //
  30790. // [<quote><p>y</p><h>fir]st</h></quote><p>se[cond</p>]
  30791. if ( flatSubtreeRange != range ) {
  30792. // Find the position of the original range in the cloned fragment.
  30793. const newRange = range._getTransformedByMove( flatSubtreeRange.start, writer.createPositionAt( frag, 0 ), howMany )[ 0 ];
  30794. const leftExcessRange = writer.createRange( writer.createPositionAt( frag, 0 ), newRange.start );
  30795. const rightExcessRange = writer.createRange( newRange.end, writer.createPositionAt( frag, 'end' ) );
  30796. removeRangeContent( rightExcessRange, writer );
  30797. removeRangeContent( leftExcessRange, writer );
  30798. }
  30799. return frag;
  30800. } );
  30801. }
  30802. // After https://github.com/ckeditor/ckeditor5-engine/issues/690 is fixed,
  30803. // this function will, most likely, be able to rewritten using getMinimalFlatRanges().
  30804. function removeRangeContent( range, writer ) {
  30805. const parentsToCheck = [];
  30806. Array.from( range.getItems( { direction: 'backward' } ) )
  30807. // We should better store ranges because text proxies will lose integrity
  30808. // with the text nodes when we'll start removing content.
  30809. .map( item => writer.createRangeOn( item ) )
  30810. // Filter only these items which are fully contained in the passed range.
  30811. //
  30812. // E.g. for the following range: [<quote><p>y</p><h>fir]st</h>
  30813. // the walker will return the entire <h> element, when only the "fir" item inside it is fully contained.
  30814. .filter( itemRange => {
  30815. // We should be able to use Range.containsRange, but https://github.com/ckeditor/ckeditor5-engine/issues/691.
  30816. const contained =
  30817. ( itemRange.start.isAfter( range.start ) || itemRange.start.isEqual( range.start ) ) &&
  30818. ( itemRange.end.isBefore( range.end ) || itemRange.end.isEqual( range.end ) );
  30819. return contained;
  30820. } )
  30821. .forEach( itemRange => {
  30822. parentsToCheck.push( itemRange.start.parent );
  30823. writer.remove( itemRange );
  30824. } );
  30825. // Remove ancestors of the removed items if they turned to be empty now
  30826. // (their whole content was contained in the range).
  30827. parentsToCheck.forEach( parentToCheck => {
  30828. let parent = parentToCheck;
  30829. while ( parent.parent && parent.isEmpty ) {
  30830. const removeRange = writer.createRangeOn( parent );
  30831. parent = parent.parent;
  30832. writer.remove( removeRange );
  30833. }
  30834. } );
  30835. }
  30836. /***/ }),
  30837. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/insertcontent.js":
  30838. /*!**********************************************************************************!*\
  30839. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/insertcontent.js ***!
  30840. \**********************************************************************************/
  30841. /*! exports provided: default */
  30842. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  30843. "use strict";
  30844. __webpack_require__.r(__webpack_exports__);
  30845. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return insertContent; });
  30846. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  30847. /* harmony import */ var _liveposition__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../liveposition */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/liveposition.js");
  30848. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
  30849. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  30850. /* harmony import */ var _documentselection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../documentselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js");
  30851. /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/selection.js");
  30852. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  30853. /**
  30854. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  30855. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  30856. */
  30857. /**
  30858. * @module engine/model/utils/insertcontent
  30859. */
  30860. /**
  30861. * Inserts content into the editor (specified selection) as one would expect the paste
  30862. * functionality to work.
  30863. *
  30864. * If an instance of {@link module:engine/model/selection~Selection} is passed as `selectable` it will be modified
  30865. * to the insertion selection (equal to a range to be selected after insertion).
  30866. *
  30867. * If `selectable` is not passed, the content will be inserted using the current selection of the model document.
  30868. *
  30869. * **Note:** Use {@link module:engine/model/model~Model#insertContent} instead of this function.
  30870. * This function is only exposed to be reusable in algorithms which change the {@link module:engine/model/model~Model#insertContent}
  30871. * method's behavior.
  30872. *
  30873. * @param {module:engine/model/model~Model} model The model in context of which the insertion
  30874. * should be performed.
  30875. * @param {module:engine/model/documentfragment~DocumentFragment|module:engine/model/item~Item} content The content to insert.
  30876. * @param {module:engine/model/selection~Selectable} [selectable=model.document.selection]
  30877. * Selection into which the content should be inserted.
  30878. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
  30879. * @returns {module:engine/model/range~Range} Range which contains all the performed changes. This is a range that, if removed,
  30880. * would return the model to the state before the insertion. If no changes were preformed by `insertContent`, returns a range collapsed
  30881. * at the insertion position.
  30882. */
  30883. function insertContent( model, content, selectable, placeOrOffset ) {
  30884. return model.change( writer => {
  30885. let selection;
  30886. if ( !selectable ) {
  30887. selection = model.document.selection;
  30888. } else if ( selectable instanceof _selection__WEBPACK_IMPORTED_MODULE_5__["default"] || selectable instanceof _documentselection__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
  30889. selection = selectable;
  30890. } else {
  30891. selection = writer.createSelection( selectable, placeOrOffset );
  30892. }
  30893. if ( !selection.isCollapsed ) {
  30894. model.deleteContent( selection, { doNotAutoparagraph: true } );
  30895. }
  30896. const insertion = new Insertion( model, writer, selection.anchor );
  30897. let nodesToInsert;
  30898. if ( content.is( 'documentFragment' ) ) {
  30899. nodesToInsert = content.getChildren();
  30900. } else {
  30901. nodesToInsert = [ content ];
  30902. }
  30903. insertion.handleNodes( nodesToInsert, {
  30904. // The set of children being inserted is the only set in this context
  30905. // so it's the first and last (it's a hack ;)).
  30906. isFirst: true,
  30907. isLast: true
  30908. } );
  30909. const newRange = insertion.getSelectionRange();
  30910. /* istanbul ignore else */
  30911. if ( newRange ) {
  30912. if ( selection instanceof _documentselection__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
  30913. writer.setSelection( newRange );
  30914. } else {
  30915. selection.setTo( newRange );
  30916. }
  30917. } else {
  30918. // We are not testing else because it's a safe check for unpredictable edge cases:
  30919. // an insertion without proper range to select.
  30920. //
  30921. // @if CK_DEBUG // console.warn( 'Cannot determine a proper selection range after insertion.' );
  30922. }
  30923. const affectedRange = insertion.getAffectedRange() || model.createRange( selection.anchor );
  30924. insertion.destroy();
  30925. return affectedRange;
  30926. } );
  30927. }
  30928. /**
  30929. * Utility class for performing content insertion.
  30930. *
  30931. * @private
  30932. */
  30933. class Insertion {
  30934. constructor( model, writer, position ) {
  30935. /**
  30936. * The model in context of which the insertion should be performed.
  30937. *
  30938. * @member {module:engine/model~Model} #model
  30939. */
  30940. this.model = model;
  30941. /**
  30942. * Batch to which operations will be added.
  30943. *
  30944. * @member {module:engine/controller/writer~Batch} #writer
  30945. */
  30946. this.writer = writer;
  30947. /**
  30948. * The position at which (or near which) the next node will be inserted.
  30949. *
  30950. * @member {module:engine/model/position~Position} #position
  30951. */
  30952. this.position = position;
  30953. /**
  30954. * Elements with which the inserted elements can be merged.
  30955. *
  30956. * <p>x^</p><p>y</p> + <p>z</p> (can merge to <p>x</p>)
  30957. * <p>x</p><p>^y</p> + <p>z</p> (can merge to <p>y</p>)
  30958. * <p>x^y</p> + <p>z</p> (can merge to <p>xy</p> which will be split during the action,
  30959. * so both its pieces will be added to this set)
  30960. *
  30961. *
  30962. * @member {Set} #canMergeWith
  30963. */
  30964. this.canMergeWith = new Set( [ this.position.parent ] );
  30965. /**
  30966. * Schema of the model.
  30967. *
  30968. * @member {module:engine/model/schema~Schema} #schema
  30969. */
  30970. this.schema = model.schema;
  30971. this._filterAttributesOf = [];
  30972. /**
  30973. * Beginning of the affected range. See {@link module:engine/model/utils/insertcontent~Insertion#getAffectedRange}.
  30974. *
  30975. * @private
  30976. * @member {module:engine/model/liveposition~LivePosition|null} #_affectedStart
  30977. */
  30978. this._affectedStart = null;
  30979. /**
  30980. * End of the affected range. See {@link module:engine/model/utils/insertcontent~Insertion#getAffectedRange}.
  30981. *
  30982. * @private
  30983. * @member {module:engine/model/liveposition~LivePosition|null} #_affectedEnd
  30984. */
  30985. this._affectedEnd = null;
  30986. }
  30987. /**
  30988. * Handles insertion of a set of nodes.
  30989. *
  30990. * @param {Iterable.<module:engine/model/node~Node>} nodes Nodes to insert.
  30991. * @param {Object} parentContext Context in which parent of these nodes was supposed to be inserted.
  30992. * If the parent context is passed it means that the parent element was stripped (was not allowed).
  30993. */
  30994. handleNodes( nodes, parentContext ) {
  30995. nodes = Array.from( nodes );
  30996. for ( let i = 0; i < nodes.length; i++ ) {
  30997. const node = nodes[ i ];
  30998. this._handleNode( node, {
  30999. isFirst: i === 0 && parentContext.isFirst,
  31000. isLast: ( i === ( nodes.length - 1 ) ) && parentContext.isLast
  31001. } );
  31002. }
  31003. // TMP this will become a post-fixer.
  31004. this.schema.removeDisallowedAttributes( this._filterAttributesOf, this.writer );
  31005. this._filterAttributesOf = [];
  31006. }
  31007. /**
  31008. * Returns range to be selected after insertion.
  31009. * Returns `null` if there is no valid range to select after insertion.
  31010. *
  31011. * @returns {module:engine/model/range~Range|null}
  31012. */
  31013. getSelectionRange() {
  31014. if ( this.nodeToSelect ) {
  31015. return _range__WEBPACK_IMPORTED_MODULE_3__["default"]._createOn( this.nodeToSelect );
  31016. }
  31017. return this.model.schema.getNearestSelectionRange( this.position );
  31018. }
  31019. /**
  31020. * Returns a range which contains all the performed changes. This is a range that, if removed, would return the model to the state
  31021. * before the insertion. Returns `null` if no changes were done.
  31022. *
  31023. * @returns {module:engine/model/range~Range|null}
  31024. */
  31025. getAffectedRange() {
  31026. if ( !this._affectedStart ) {
  31027. return null;
  31028. }
  31029. return new _range__WEBPACK_IMPORTED_MODULE_3__["default"]( this._affectedStart, this._affectedEnd );
  31030. }
  31031. /**
  31032. * Destroys `Insertion` instance.
  31033. */
  31034. destroy() {
  31035. if ( this._affectedStart ) {
  31036. this._affectedStart.detach();
  31037. }
  31038. if ( this._affectedEnd ) {
  31039. this._affectedEnd.detach();
  31040. }
  31041. }
  31042. /**
  31043. * Handles insertion of a single node.
  31044. *
  31045. * @private
  31046. * @param {module:engine/model/node~Node} node
  31047. * @param {Object} context
  31048. * @param {Boolean} context.isFirst Whether the given node is the first one in the content to be inserted.
  31049. * @param {Boolean} context.isLast Whether the given node is the last one in the content to be inserted.
  31050. */
  31051. _handleNode( node, context ) {
  31052. // Let's handle object in a special way.
  31053. // * They should never be merged with other elements.
  31054. // * If they are not allowed in any of the selection ancestors, they could be either autoparagraphed or totally removed.
  31055. if ( this.schema.isObject( node ) ) {
  31056. this._handleObject( node, context );
  31057. return;
  31058. }
  31059. // Try to find a place for the given node.
  31060. // Split the position.parent's branch up to a point where the node can be inserted.
  31061. // If it isn't allowed in the whole branch, then of course don't split anything.
  31062. const isAllowed = this._checkAndSplitToAllowedPosition( node, context );
  31063. if ( !isAllowed ) {
  31064. this._handleDisallowedNode( node, context );
  31065. return;
  31066. }
  31067. this._insert( node );
  31068. // After the node was inserted we may try to merge it with its siblings.
  31069. // This should happen only if it was the first and/or last of the nodes (so only with boundary nodes)
  31070. // and only if the selection was in those elements initially.
  31071. //
  31072. // E.g.:
  31073. // <p>x^</p> + <p>y</p> => <p>x</p><p>y</p> => <p>xy[]</p>
  31074. // and:
  31075. // <p>x^y</p> + <p>z</p> => <p>x</p>^<p>y</p> + <p>z</p> => <p>x</p><p>z</p><p>y</p> => <p>xz[]y</p>
  31076. // but:
  31077. // <p>x</p><p>^</p><p>z</p> + <p>y</p> => <p>x</p><p>y</p><p>z</p> (no merging)
  31078. // <p>x</p>[<img>]<p>z</p> + <p>y</p> => <p>x</p><p>y</p><p>z</p> (no merging, note: after running deleteContents
  31079. // it's exactly the same case as above)
  31080. this._mergeSiblingsOf( node, context );
  31081. }
  31082. /**
  31083. * @private
  31084. * @param {module:engine/model/element~Element} node The object element.
  31085. * @param {Object} context
  31086. */
  31087. _handleObject( node, context ) {
  31088. // Try finding it a place in the tree.
  31089. if ( this._checkAndSplitToAllowedPosition( node ) ) {
  31090. this._insert( node );
  31091. }
  31092. // Try autoparagraphing.
  31093. else {
  31094. this._tryAutoparagraphing( node, context );
  31095. }
  31096. }
  31097. /**
  31098. * @private
  31099. * @param {module:engine/model/node~Node} node The disallowed node which needs to be handled.
  31100. * @param {Object} context
  31101. */
  31102. _handleDisallowedNode( node, context ) {
  31103. // If the node is an element, try inserting its children (strip the parent).
  31104. if ( node.is( 'element' ) ) {
  31105. this.handleNodes( node.getChildren(), context );
  31106. }
  31107. // If text is not allowed, try autoparagraphing it.
  31108. else {
  31109. this._tryAutoparagraphing( node, context );
  31110. }
  31111. }
  31112. /**
  31113. * @private
  31114. * @param {module:engine/model/node~Node} node The node to insert.
  31115. */
  31116. _insert( node ) {
  31117. /* istanbul ignore if */
  31118. if ( !this.schema.checkChild( this.position, node ) ) {
  31119. // Algorithm's correctness check. We should never end up here but it's good to know that we did.
  31120. // Note that it would often be a silent issue if we insert node in a place where it's not allowed.
  31121. /**
  31122. * Given node cannot be inserted on the given position.
  31123. *
  31124. * @error insertcontent-wrong-position
  31125. * @param {module:engine/model/node~Node} node Node to insert.
  31126. * @param {module:engine/model/position~Position} position Position to insert the node at.
  31127. */
  31128. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__["default"](
  31129. 'insertcontent-wrong-position',
  31130. this,
  31131. { node, position: this.position }
  31132. );
  31133. }
  31134. const livePos = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"].fromPosition( this.position, 'toNext' );
  31135. this._setAffectedBoundaries( this.position );
  31136. this.writer.insert( node, this.position );
  31137. this.position = livePos.toPosition();
  31138. livePos.detach();
  31139. // The last inserted object should be selected because we can't put a collapsed selection after it.
  31140. if ( this.schema.isObject( node ) && !this.schema.checkChild( this.position, '$text' ) ) {
  31141. this.nodeToSelect = node;
  31142. } else {
  31143. this.nodeToSelect = null;
  31144. }
  31145. this._filterAttributesOf.push( node );
  31146. }
  31147. /**
  31148. * Sets `_affectedStart` and `_affectedEnd` to the given `position`. Should be used before a change is done during insertion process to
  31149. * mark the affected range.
  31150. *
  31151. * This method is used before inserting a node or splitting a parent node. `_affectedStart` and `_affectedEnd` are also changed
  31152. * during merging, but the logic there is more complicated so it is left out of this function.
  31153. *
  31154. * @private
  31155. * @param {module:engine/model/position~Position} position
  31156. */
  31157. _setAffectedBoundaries( position ) {
  31158. // Set affected boundaries stickiness so that those position will "expand" when something is inserted in between them:
  31159. // <paragraph>Foo][bar</paragraph> -> <paragraph>Foo]xx[bar</paragraph>
  31160. // This is why it cannot be a range but two separate positions.
  31161. if ( !this._affectedStart ) {
  31162. this._affectedStart = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"].fromPosition( position, 'toPrevious' );
  31163. }
  31164. // If `_affectedEnd` is before the new boundary position, expand `_affectedEnd`. This can happen if first inserted node was
  31165. // inserted into the parent but the next node is moved-out of that parent:
  31166. // (1) <paragraph>Foo][</paragraph> -> <paragraph>Foo]xx[</paragraph>
  31167. // (2) <paragraph>Foo]xx[</paragraph> -> <paragraph>Foo]xx</paragraph><widget></widget>[
  31168. if ( !this._affectedEnd || this._affectedEnd.isBefore( position ) ) {
  31169. if ( this._affectedEnd ) {
  31170. this._affectedEnd.detach();
  31171. }
  31172. this._affectedEnd = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"].fromPosition( position, 'toNext' );
  31173. }
  31174. }
  31175. /**
  31176. * @private
  31177. * @param {module:engine/model/node~Node} node The node which could potentially be merged.
  31178. * @param {Object} context
  31179. */
  31180. _mergeSiblingsOf( node, context ) {
  31181. if ( !( node instanceof _element__WEBPACK_IMPORTED_MODULE_2__["default"] ) ) {
  31182. return;
  31183. }
  31184. const mergeLeft = this._canMergeLeft( node, context );
  31185. const mergeRight = this._canMergeRight( node, context );
  31186. const mergePosLeft = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"]._createBefore( node );
  31187. mergePosLeft.stickiness = 'toNext';
  31188. const mergePosRight = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"]._createAfter( node );
  31189. mergePosRight.stickiness = 'toNext';
  31190. if ( mergeLeft ) {
  31191. const livePosition = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"].fromPosition( this.position );
  31192. livePosition.stickiness = 'toNext';
  31193. // If `_affectedStart` is sames as merge position, it means that the element "marked" by `_affectedStart` is going to be
  31194. // removed and its contents will be moved. This won't transform `LivePosition` so `_affectedStart` needs to be moved
  31195. // by hand to properly reflect affected range. (Due to `_affectedStart` and `_affectedEnd` stickiness, the "range" is
  31196. // shown as `][`).
  31197. //
  31198. // Example - insert `<paragraph>Abc</paragraph><paragraph>Xyz</paragraph>` at the end of `<paragraph>Foo^</paragraph>`:
  31199. //
  31200. // <paragraph>Foo</paragraph><paragraph>Bar</paragraph> -->
  31201. // <paragraph>Foo</paragraph>]<paragraph>Abc</paragraph><paragraph>Xyz</paragraph>[<paragraph>Bar</paragraph> -->
  31202. // <paragraph>Foo]Abc</paragraph><paragraph>Xyz</paragraph>[<paragraph>Bar</paragraph>
  31203. //
  31204. // Note, that if we are here then something must have been inserted, so `_affectedStart` and `_affectedEnd` have to be set.
  31205. if ( this._affectedStart.isEqual( mergePosLeft ) ) {
  31206. this._affectedStart.detach();
  31207. this._affectedStart = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"]._createAt( mergePosLeft.nodeBefore, 'end', 'toPrevious' );
  31208. }
  31209. this.writer.merge( mergePosLeft );
  31210. // If only one element (the merged one) is in the "affected range", also move the affected range end appropriately.
  31211. //
  31212. // Example - insert `<paragraph>Abc</paragraph>` at the of `<paragraph>Foo^</paragraph>`:
  31213. //
  31214. // <paragraph>Foo</paragraph><paragraph>Bar</paragraph> -->
  31215. // <paragraph>Foo</paragraph>]<paragraph>Abc</paragraph>[<paragraph>Bar</paragraph> -->
  31216. // <paragraph>Foo]Abc</paragraph>[<paragraph>Bar</paragraph> -->
  31217. // <paragraph>Foo]Abc[</paragraph><paragraph>Bar</paragraph>
  31218. if ( mergePosLeft.isEqual( this._affectedEnd ) && context.isLast ) {
  31219. this._affectedEnd.detach();
  31220. this._affectedEnd = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"]._createAt( mergePosLeft.nodeBefore, 'end', 'toNext' );
  31221. }
  31222. this.position = livePosition.toPosition();
  31223. livePosition.detach();
  31224. }
  31225. if ( mergeRight ) {
  31226. /* istanbul ignore if */
  31227. if ( !this.position.isEqual( mergePosRight ) ) {
  31228. // Algorithm's correctness check. We should never end up here but it's good to know that we did.
  31229. // At this point the insertion position should be after the node we'll merge. If it isn't,
  31230. // it should need to be secured as in the left merge case.
  31231. /**
  31232. * An internal error occurred when merging inserted content with its siblings.
  31233. * The insertion position should equal the merge position.
  31234. *
  31235. * If you encountered this error, report it back to the CKEditor 5 team
  31236. * with as many details as possible regarding the content being inserted and the insertion position.
  31237. *
  31238. * @error insertcontent-invalid-insertion-position
  31239. */
  31240. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_6__["default"]( 'insertcontent-invalid-insertion-position', this );
  31241. }
  31242. // Move the position to the previous node, so it isn't moved to the graveyard on merge.
  31243. // <p>x</p>[]<p>y</p> => <p>x[]</p><p>y</p>
  31244. this.position = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( mergePosRight.nodeBefore, 'end' );
  31245. // OK: <p>xx[]</p> + <p>yy</p> => <p>xx[]yy</p> (when sticks to previous)
  31246. // NOK: <p>xx[]</p> + <p>yy</p> => <p>xxyy[]</p> (when sticks to next)
  31247. const livePosition = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"].fromPosition( this.position, 'toPrevious' );
  31248. // See comment above on moving `_affectedStart`.
  31249. if ( this._affectedEnd.isEqual( mergePosRight ) ) {
  31250. this._affectedEnd.detach();
  31251. this._affectedEnd = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"]._createAt( mergePosRight.nodeBefore, 'end', 'toNext' );
  31252. }
  31253. this.writer.merge( mergePosRight );
  31254. // See comment above on moving `_affectedStart`.
  31255. if ( mergePosRight.getShiftedBy( -1 ).isEqual( this._affectedStart ) && context.isFirst ) {
  31256. this._affectedStart.detach();
  31257. this._affectedStart = _liveposition__WEBPACK_IMPORTED_MODULE_1__["default"]._createAt( mergePosRight.nodeBefore, 0, 'toPrevious' );
  31258. }
  31259. this.position = livePosition.toPosition();
  31260. livePosition.detach();
  31261. }
  31262. if ( mergeLeft || mergeRight ) {
  31263. // After merge elements that were marked by _insert() to be filtered might be gone so
  31264. // we need to mark the new container.
  31265. this._filterAttributesOf.push( this.position.parent );
  31266. }
  31267. mergePosLeft.detach();
  31268. mergePosRight.detach();
  31269. }
  31270. /**
  31271. * Checks whether specified node can be merged with previous sibling element.
  31272. *
  31273. * @private
  31274. * @param {module:engine/model/node~Node} node The node which could potentially be merged.
  31275. * @param {Object} context
  31276. * @returns {Boolean}
  31277. */
  31278. _canMergeLeft( node, context ) {
  31279. const previousSibling = node.previousSibling;
  31280. return context.isFirst &&
  31281. ( previousSibling instanceof _element__WEBPACK_IMPORTED_MODULE_2__["default"] ) &&
  31282. this.canMergeWith.has( previousSibling ) &&
  31283. this.model.schema.checkMerge( previousSibling, node );
  31284. }
  31285. /**
  31286. * Checks whether specified node can be merged with next sibling element.
  31287. *
  31288. * @private
  31289. * @param {module:engine/model/node~Node} node The node which could potentially be merged.
  31290. * @param {Object} context
  31291. * @returns {Boolean}
  31292. */
  31293. _canMergeRight( node, context ) {
  31294. const nextSibling = node.nextSibling;
  31295. return context.isLast &&
  31296. ( nextSibling instanceof _element__WEBPACK_IMPORTED_MODULE_2__["default"] ) &&
  31297. this.canMergeWith.has( nextSibling ) &&
  31298. this.model.schema.checkMerge( node, nextSibling );
  31299. }
  31300. /**
  31301. * Tries wrapping the node in a new paragraph and inserting it this way.
  31302. *
  31303. * @private
  31304. * @param {module:engine/model/node~Node} node The node which needs to be autoparagraphed.
  31305. * @param {Object} context
  31306. */
  31307. _tryAutoparagraphing( node, context ) {
  31308. const paragraph = this.writer.createElement( 'paragraph' );
  31309. // Do not autoparagraph if the paragraph won't be allowed there,
  31310. // cause that would lead to an infinite loop. The paragraph would be rejected in
  31311. // the next _handleNode() call and we'd be here again.
  31312. if ( this._getAllowedIn( paragraph, this.position.parent ) && this.schema.checkChild( paragraph, node ) ) {
  31313. paragraph._appendChild( node );
  31314. this._handleNode( paragraph, context );
  31315. }
  31316. }
  31317. /**
  31318. * @private
  31319. * @param {module:engine/model/node~Node} node
  31320. * @returns {Boolean} Whether an allowed position was found.
  31321. * `false` is returned if the node isn't allowed at any position up in the tree, `true` if was.
  31322. */
  31323. _checkAndSplitToAllowedPosition( node ) {
  31324. const allowedIn = this._getAllowedIn( node, this.position.parent );
  31325. if ( !allowedIn ) {
  31326. return false;
  31327. }
  31328. while ( allowedIn != this.position.parent ) {
  31329. // If a parent which we'd need to leave is a limit element, break.
  31330. if ( this.schema.isLimit( this.position.parent ) ) {
  31331. return false;
  31332. }
  31333. if ( this.position.isAtStart ) {
  31334. // If insertion position is at the beginning of the parent, move it out instead of splitting.
  31335. // <p>^Foo</p> -> ^<p>Foo</p>
  31336. const parent = this.position.parent;
  31337. this.position = this.writer.createPositionBefore( parent );
  31338. // Special case – parent is empty (<p>^</p>).
  31339. //
  31340. // 1. parent.isEmpty
  31341. // We can remove the element after moving insertion position out of it.
  31342. //
  31343. // 2. parent.parent === allowedIn
  31344. // However parent should remain in place when allowed element is above limit element in document tree.
  31345. // For example there shouldn't be allowed to remove empty paragraph from tableCell, when is pasted
  31346. // content allowed in $root.
  31347. if ( parent.isEmpty && parent.parent === allowedIn ) {
  31348. this.writer.remove( parent );
  31349. }
  31350. } else if ( this.position.isAtEnd ) {
  31351. // If insertion position is at the end of the parent, move it out instead of splitting.
  31352. // <p>Foo^</p> -> <p>Foo</p>^
  31353. this.position = this.writer.createPositionAfter( this.position.parent );
  31354. } else {
  31355. const tempPos = this.writer.createPositionAfter( this.position.parent );
  31356. this._setAffectedBoundaries( this.position );
  31357. this.writer.split( this.position );
  31358. this.position = tempPos;
  31359. this.canMergeWith.add( this.position.nodeAfter );
  31360. }
  31361. }
  31362. return true;
  31363. }
  31364. /**
  31365. * Gets the element in which the given node is allowed. It checks the passed element and all its ancestors.
  31366. *
  31367. * @private
  31368. * @param {module:engine/model/node~Node} node The node to check.
  31369. * @param {module:engine/model/element~Element} element The element in which the node's correctness should be checked.
  31370. * @returns {module:engine/model/element~Element|null}
  31371. */
  31372. _getAllowedIn( node, element ) {
  31373. if ( this.schema.checkChild( element, node ) ) {
  31374. return element;
  31375. }
  31376. if ( element.parent ) {
  31377. return this._getAllowedIn( node, element.parent );
  31378. }
  31379. return null;
  31380. }
  31381. }
  31382. /***/ }),
  31383. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/modifyselection.js":
  31384. /*!************************************************************************************!*\
  31385. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/modifyselection.js ***!
  31386. \************************************************************************************/
  31387. /*! exports provided: default */
  31388. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  31389. "use strict";
  31390. __webpack_require__.r(__webpack_exports__);
  31391. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return modifySelection; });
  31392. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  31393. /* harmony import */ var _treewalker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../treewalker */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/treewalker.js");
  31394. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  31395. /* harmony import */ var _ckeditor_ckeditor5_utils_src_unicode__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/unicode */ "./node_modules/@ckeditor/ckeditor5-utils/src/unicode.js");
  31396. /* harmony import */ var _documentselection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../documentselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js");
  31397. /**
  31398. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  31399. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  31400. */
  31401. /**
  31402. * @module engine/model/utils/modifyselection
  31403. */
  31404. const wordBoundaryCharacters = ' ,.?!:;"-()';
  31405. /**
  31406. * Modifies the selection. Currently, the supported modifications are:
  31407. *
  31408. * * Extending. The selection focus is moved in the specified `options.direction` with a step specified in `options.unit`.
  31409. * Possible values for `unit` are:
  31410. * * `'character'` (default) - moves selection by one user-perceived character. In most cases this means moving by one
  31411. * character in `String` sense. However, unicode also defines "combing marks". These are special symbols, that combines
  31412. * with a symbol before it ("base character") to create one user-perceived character. For example, `q̣̇` is a normal
  31413. * letter `q` with two "combining marks": upper dot (`Ux0307`) and lower dot (`Ux0323`). For most actions, i.e. extending
  31414. * selection by one position, it is correct to include both "base character" and all of it's "combining marks". That is
  31415. * why `'character'` value is most natural and common method of modifying selection.
  31416. * * `'codePoint'` - moves selection by one unicode code point. In contrary to, `'character'` unit, this will insert
  31417. * selection between "base character" and "combining mark", because "combining marks" have their own unicode code points.
  31418. * However, for technical reasons, unicode code points with values above `UxFFFF` are represented in native `String` by
  31419. * two characters, called "surrogate pairs". Halves of "surrogate pairs" have a meaning only when placed next to each other.
  31420. * For example `𨭎` is represented in `String` by `\uD862\uDF4E`. Both `\uD862` and `\uDF4E` do not have any meaning
  31421. * outside the pair (are rendered as ? when alone). Position between them would be incorrect. In this case, selection
  31422. * extension will include whole "surrogate pair".
  31423. * * `'word'` - moves selection by a whole word.
  31424. *
  31425. * **Note:** if you extend a forward selection in a backward direction you will in fact shrink it.
  31426. *
  31427. * **Note:** Use {@link module:engine/model/model~Model#modifySelection} instead of this function.
  31428. * This function is only exposed to be reusable in algorithms
  31429. * which change the {@link module:engine/model/model~Model#modifySelection}
  31430. * method's behavior.
  31431. *
  31432. * @param {module:engine/model/model~Model} model The model in context of which
  31433. * the selection modification should be performed.
  31434. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  31435. * The selection to modify.
  31436. * @param {Object} [options]
  31437. * @param {'forward'|'backward'} [options.direction='forward'] The direction in which the selection should be modified.
  31438. * @param {'character'|'codePoint'|'word'} [options.unit='character'] The unit by which selection should be modified.
  31439. */
  31440. function modifySelection( model, selection, options = {} ) {
  31441. const schema = model.schema;
  31442. const isForward = options.direction != 'backward';
  31443. const unit = options.unit ? options.unit : 'character';
  31444. const focus = selection.focus;
  31445. const walker = new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( {
  31446. boundaries: getSearchRange( focus, isForward ),
  31447. singleCharacters: true,
  31448. direction: isForward ? 'forward' : 'backward'
  31449. } );
  31450. const data = { walker, schema, isForward, unit };
  31451. let next;
  31452. while ( ( next = walker.next() ) ) {
  31453. if ( next.done ) {
  31454. return;
  31455. }
  31456. const position = tryExtendingTo( data, next.value );
  31457. if ( position ) {
  31458. if ( selection instanceof _documentselection__WEBPACK_IMPORTED_MODULE_4__["default"] ) {
  31459. model.change( writer => {
  31460. writer.setSelectionFocus( position );
  31461. } );
  31462. } else {
  31463. selection.setFocus( position );
  31464. }
  31465. return;
  31466. }
  31467. }
  31468. }
  31469. // Checks whether the selection can be extended to the the walker's next value (next position).
  31470. // @param {{ walker, unit, isForward, schema }} data
  31471. // @param {module:engine/view/treewalker~TreeWalkerValue} value
  31472. function tryExtendingTo( data, value ) {
  31473. const { isForward, walker, unit, schema } = data;
  31474. const { type, item, nextPosition } = value;
  31475. // If found text, we can certainly put the focus in it. Let's just find a correct position
  31476. // based on the unit.
  31477. if ( type == 'text' ) {
  31478. if ( data.unit === 'word' ) {
  31479. return getCorrectWordBreakPosition( walker, isForward );
  31480. }
  31481. return getCorrectPosition( walker, unit, isForward );
  31482. }
  31483. // Entering an element.
  31484. if ( type == ( isForward ? 'elementStart' : 'elementEnd' ) ) {
  31485. // If it's a selectable, we can select it now.
  31486. if ( schema.isSelectable( item ) ) {
  31487. return _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( item, isForward ? 'after' : 'before' );
  31488. }
  31489. // If text allowed on this position, extend to this place.
  31490. if ( schema.checkChild( nextPosition, '$text' ) ) {
  31491. return nextPosition;
  31492. }
  31493. }
  31494. // Leaving an element.
  31495. else {
  31496. // If leaving a limit element, stop.
  31497. if ( schema.isLimit( item ) ) {
  31498. // NOTE: Fast-forward the walker until the end.
  31499. walker.skip( () => true );
  31500. return;
  31501. }
  31502. // If text allowed on this position, extend to this place.
  31503. if ( schema.checkChild( nextPosition, '$text' ) ) {
  31504. return nextPosition;
  31505. }
  31506. }
  31507. }
  31508. // Finds a correct position by walking in a text node and checking whether selection can be extended to given position
  31509. // or should be extended further.
  31510. //
  31511. // @param {module:engine/model/treewalker~TreeWalker} walker
  31512. // @param {String} unit The unit by which selection should be modified.
  31513. function getCorrectPosition( walker, unit ) {
  31514. const textNode = walker.position.textNode;
  31515. if ( textNode ) {
  31516. const data = textNode.data;
  31517. let offset = walker.position.offset - textNode.startOffset;
  31518. while ( Object(_ckeditor_ckeditor5_utils_src_unicode__WEBPACK_IMPORTED_MODULE_3__["isInsideSurrogatePair"])( data, offset ) || ( unit == 'character' && Object(_ckeditor_ckeditor5_utils_src_unicode__WEBPACK_IMPORTED_MODULE_3__["isInsideCombinedSymbol"])( data, offset ) ) ) {
  31519. walker.next();
  31520. offset = walker.position.offset - textNode.startOffset;
  31521. }
  31522. }
  31523. return walker.position;
  31524. }
  31525. // Finds a correct position of a word break by walking in a text node and checking whether selection can be extended to given position
  31526. // or should be extended further.
  31527. //
  31528. // @param {module:engine/model/treewalker~TreeWalker} walker
  31529. // @param {Boolean} isForward Is the direction in which the selection should be modified is forward.
  31530. function getCorrectWordBreakPosition( walker, isForward ) {
  31531. let textNode = walker.position.textNode;
  31532. if ( textNode ) {
  31533. let offset = walker.position.offset - textNode.startOffset;
  31534. while ( !isAtWordBoundary( textNode.data, offset, isForward ) && !isAtNodeBoundary( textNode, offset, isForward ) ) {
  31535. walker.next();
  31536. // Check of adjacent text nodes with different attributes (like BOLD).
  31537. // Example : 'foofoo []bar<$text bold="true">bar</$text> bazbaz'
  31538. // should expand to : 'foofoo [bar<$text bold="true">bar</$text>] bazbaz'.
  31539. const nextNode = isForward ? walker.position.nodeAfter : walker.position.nodeBefore;
  31540. // Scan only text nodes. Ignore inline elements (like `<softBreak>`).
  31541. if ( nextNode && nextNode.is( '$text' ) ) {
  31542. // Check boundary char of an adjacent text node.
  31543. const boundaryChar = nextNode.data.charAt( isForward ? 0 : nextNode.data.length - 1 );
  31544. // Go to the next node if the character at the boundary of that node belongs to the same word.
  31545. if ( !wordBoundaryCharacters.includes( boundaryChar ) ) {
  31546. // If adjacent text node belongs to the same word go to it & reset values.
  31547. walker.next();
  31548. textNode = walker.position.textNode;
  31549. }
  31550. }
  31551. offset = walker.position.offset - textNode.startOffset;
  31552. }
  31553. }
  31554. return walker.position;
  31555. }
  31556. function getSearchRange( start, isForward ) {
  31557. const root = start.root;
  31558. const searchEnd = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( root, isForward ? 'end' : 0 );
  31559. if ( isForward ) {
  31560. return new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( start, searchEnd );
  31561. } else {
  31562. return new _range__WEBPACK_IMPORTED_MODULE_2__["default"]( searchEnd, start );
  31563. }
  31564. }
  31565. // Checks if selection is on word boundary.
  31566. //
  31567. // @param {String} data The text node value to investigate.
  31568. // @param {Number} offset Position offset.
  31569. // @param {Boolean} isForward Is the direction in which the selection should be modified is forward.
  31570. function isAtWordBoundary( data, offset, isForward ) {
  31571. // The offset to check depends on direction.
  31572. const offsetToCheck = offset + ( isForward ? 0 : -1 );
  31573. return wordBoundaryCharacters.includes( data.charAt( offsetToCheck ) );
  31574. }
  31575. // Checks if selection is on node boundary.
  31576. //
  31577. // @param {module:engine/model/text~Text} textNode The text node to investigate.
  31578. // @param {Number} offset Position offset.
  31579. // @param {Boolean} isForward Is the direction in which the selection should be modified is forward.
  31580. function isAtNodeBoundary( textNode, offset, isForward ) {
  31581. return offset === ( isForward ? textNode.endOffset : 0 );
  31582. }
  31583. /***/ }),
  31584. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/selection-post-fixer.js":
  31585. /*!*****************************************************************************************!*\
  31586. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/selection-post-fixer.js ***!
  31587. \*****************************************************************************************/
  31588. /*! exports provided: injectSelectionPostFixer */
  31589. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  31590. "use strict";
  31591. __webpack_require__.r(__webpack_exports__);
  31592. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "injectSelectionPostFixer", function() { return injectSelectionPostFixer; });
  31593. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../range */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  31594. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  31595. /**
  31596. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  31597. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  31598. */
  31599. /**
  31600. * @module engine/model/utils/selection-post-fixer
  31601. */
  31602. /**
  31603. * Injects selection post-fixer to the model.
  31604. *
  31605. * The role of the selection post-fixer is to ensure that the selection is in a correct place
  31606. * after a {@link module:engine/model/model~Model#change `change()`} block was executed.
  31607. *
  31608. * The correct position means that:
  31609. *
  31610. * * All collapsed selection ranges are in a place where the {@link module:engine/model/schema~Schema}
  31611. * allows a `$text`.
  31612. * * None of the selection's non-collapsed ranges crosses a {@link module:engine/model/schema~Schema#isLimit limit element}
  31613. * boundary (a range must be rooted within one limit element).
  31614. * * Only {@link module:engine/model/schema~Schema#isSelectable selectable elements} can be selected from the outside
  31615. * (e.g. `[<paragraph>foo</paragraph>]` is invalid). This rule applies independently to both selection ends, so this
  31616. * selection is correct: `<paragraph>f[oo</paragraph><image></image>]`.
  31617. *
  31618. * If the position is not correct, the post-fixer will automatically correct it.
  31619. *
  31620. * ## Fixing a non-collapsed selection
  31621. *
  31622. * See as an example a selection that starts in a P1 element and ends inside the text of a TD element
  31623. * (`[` and `]` are range boundaries and `(l)` denotes an element defined as `isLimit=true`):
  31624. *
  31625. * root
  31626. * |- element P1
  31627. * | |- "foo" root
  31628. * |- element TABLE (l) P1 TABLE P2
  31629. * | |- element TR (l) f o[o TR TR b a r
  31630. * | | |- element TD (l) TD TD
  31631. * | | |- "aaa" a]a a b b b
  31632. * | |- element TR (l)
  31633. * | | |- element TD (l) ||
  31634. * | | |- "bbb" ||
  31635. * |- element P2 VV
  31636. * | |- "bar"
  31637. * root
  31638. * P1 TABLE] P2
  31639. * f o[o TR TR b a r
  31640. * TD TD
  31641. * a a a b b b
  31642. *
  31643. * In the example above, the TABLE, TR and TD are defined as `isLimit=true` in the schema. The range which is not contained within
  31644. * a single limit element must be expanded to select the outermost limit element. The range end is inside the text node of the TD element.
  31645. * As the TD element is a child of the TR and TABLE elements, where both are defined as `isLimit=true` in the schema, the range must be
  31646. * expanded to select the whole TABLE element.
  31647. *
  31648. * **Note** If the selection contains multiple ranges, the method returns a minimal set of ranges that are not intersecting after expanding
  31649. * them to select `isLimit=true` elements.
  31650. *
  31651. * @param {module:engine/model/model~Model} model
  31652. */
  31653. function injectSelectionPostFixer( model ) {
  31654. model.document.registerPostFixer( writer => selectionPostFixer( writer, model ) );
  31655. }
  31656. // The selection post-fixer.
  31657. //
  31658. // @param {module:engine/model/writer~Writer} writer
  31659. // @param {module:engine/model/model~Model} model
  31660. function selectionPostFixer( writer, model ) {
  31661. const selection = model.document.selection;
  31662. const schema = model.schema;
  31663. const ranges = [];
  31664. let wasFixed = false;
  31665. for ( const modelRange of selection.getRanges() ) {
  31666. // Go through all ranges in selection and try fixing each of them.
  31667. // Those ranges might overlap but will be corrected later.
  31668. const correctedRange = tryFixingRange( modelRange, schema );
  31669. // "Selection fixing" algorithms sometimes get lost. In consequence, it may happen
  31670. // that a new range is returned but, in fact, it has the same positions as the original
  31671. // range anyway. If this range is not discarded, a new selection will be set and that,
  31672. // for instance, would destroy the selection attributes. Let's make sure that the post-fixer
  31673. // actually worked first before setting a new selection.
  31674. //
  31675. // https://github.com/ckeditor/ckeditor5/issues/6693
  31676. if ( correctedRange && !correctedRange.isEqual( modelRange ) ) {
  31677. ranges.push( correctedRange );
  31678. wasFixed = true;
  31679. } else {
  31680. ranges.push( modelRange );
  31681. }
  31682. }
  31683. // If any of ranges were corrected update the selection.
  31684. if ( wasFixed ) {
  31685. writer.setSelection( mergeIntersectingRanges( ranges ), { backward: selection.isBackward } );
  31686. }
  31687. }
  31688. // Tries fixing a range if it's incorrect.
  31689. //
  31690. // @param {module:engine/model/range~Range} range
  31691. // @param {module:engine/model/schema~Schema} schema
  31692. // @returns {module:engine/model/range~Range|null} Returns fixed range or null if range is valid.
  31693. function tryFixingRange( range, schema ) {
  31694. if ( range.isCollapsed ) {
  31695. return tryFixingCollapsedRange( range, schema );
  31696. }
  31697. return tryFixingNonCollapsedRage( range, schema );
  31698. }
  31699. // Tries to fix collapsed ranges.
  31700. //
  31701. // * Fixes situation when a range is in a place where $text is not allowed
  31702. //
  31703. // @param {module:engine/model/range~Range} range Collapsed range to fix.
  31704. // @param {module:engine/model/schema~Schema} schema
  31705. // @returns {module:engine/model/range~Range|null} Returns fixed range or null if range is valid.
  31706. function tryFixingCollapsedRange( range, schema ) {
  31707. const originalPosition = range.start;
  31708. const nearestSelectionRange = schema.getNearestSelectionRange( originalPosition );
  31709. // This might be null ie when editor data is empty.
  31710. // In such cases there is no need to fix the selection range.
  31711. if ( !nearestSelectionRange ) {
  31712. return null;
  31713. }
  31714. if ( !nearestSelectionRange.isCollapsed ) {
  31715. return nearestSelectionRange;
  31716. }
  31717. const fixedPosition = nearestSelectionRange.start;
  31718. // Fixed position is the same as original - no need to return corrected range.
  31719. if ( originalPosition.isEqual( fixedPosition ) ) {
  31720. return null;
  31721. }
  31722. return new _range__WEBPACK_IMPORTED_MODULE_0__["default"]( fixedPosition );
  31723. }
  31724. // Tries to fix an expanded range.
  31725. //
  31726. // @param {module:engine/model/range~Range} range Expanded range to fix.
  31727. // @param {module:engine/model/schema~Schema} schema
  31728. // @returns {module:engine/model/range~Range|null} Returns fixed range or null if range is valid.
  31729. function tryFixingNonCollapsedRage( range, schema ) {
  31730. const { start, end } = range;
  31731. const isTextAllowedOnStart = schema.checkChild( start, '$text' );
  31732. const isTextAllowedOnEnd = schema.checkChild( end, '$text' );
  31733. const startLimitElement = schema.getLimitElement( start );
  31734. const endLimitElement = schema.getLimitElement( end );
  31735. // Ranges which both end are inside the same limit element (or root) might needs only minor fix.
  31736. if ( startLimitElement === endLimitElement ) {
  31737. // Range is valid when both position allows to place a text:
  31738. // - <block>f[oobarba]z</block>
  31739. // This would be "fixed" by a next check but as it will be the same it's better to return null so the selection stays the same.
  31740. if ( isTextAllowedOnStart && isTextAllowedOnEnd ) {
  31741. return null;
  31742. }
  31743. // Range that is on non-limit element (or is partially) must be fixed so it is placed inside the block around $text:
  31744. // - [<block>foo</block>] -> <block>[foo]</block>
  31745. // - [<block>foo]</block> -> <block>[foo]</block>
  31746. // - <block>f[oo</block>] -> <block>f[oo]</block>
  31747. // - [<block>foo</block><selectable></selectable>] -> <block>[foo</block><selectable></selectable>]
  31748. if ( checkSelectionOnNonLimitElements( start, end, schema ) ) {
  31749. const isStartBeforeSelectable = start.nodeAfter && schema.isSelectable( start.nodeAfter );
  31750. const fixedStart = isStartBeforeSelectable ? null : schema.getNearestSelectionRange( start, 'forward' );
  31751. const isEndAfterSelectable = end.nodeBefore && schema.isSelectable( end.nodeBefore );
  31752. const fixedEnd = isEndAfterSelectable ? null : schema.getNearestSelectionRange( end, 'backward' );
  31753. // The schema.getNearestSelectionRange might return null - if that happens use original position.
  31754. const rangeStart = fixedStart ? fixedStart.start : start;
  31755. const rangeEnd = fixedEnd ? fixedEnd.start : end;
  31756. return new _range__WEBPACK_IMPORTED_MODULE_0__["default"]( rangeStart, rangeEnd );
  31757. }
  31758. }
  31759. const isStartInLimit = startLimitElement && !startLimitElement.is( 'rootElement' );
  31760. const isEndInLimit = endLimitElement && !endLimitElement.is( 'rootElement' );
  31761. // At this point we eliminated valid positions on text nodes so if one of range positions is placed inside a limit element
  31762. // then the range crossed limit element boundaries and needs to be fixed.
  31763. if ( isStartInLimit || isEndInLimit ) {
  31764. const bothInSameParent = ( start.nodeAfter && end.nodeBefore ) && start.nodeAfter.parent === end.nodeBefore.parent;
  31765. const expandStart = isStartInLimit && ( !bothInSameParent || !isSelectable( start.nodeAfter, schema ) );
  31766. const expandEnd = isEndInLimit && ( !bothInSameParent || !isSelectable( end.nodeBefore, schema ) );
  31767. // Although we've already found limit element on start/end positions we must find the outer-most limit element.
  31768. // as limit elements might be nested directly inside (ie table > tableRow > tableCell).
  31769. let fixedStart = start;
  31770. let fixedEnd = end;
  31771. if ( expandStart ) {
  31772. fixedStart = _position__WEBPACK_IMPORTED_MODULE_1__["default"]._createBefore( findOutermostLimitAncestor( startLimitElement, schema ) );
  31773. }
  31774. if ( expandEnd ) {
  31775. fixedEnd = _position__WEBPACK_IMPORTED_MODULE_1__["default"]._createAfter( findOutermostLimitAncestor( endLimitElement, schema ) );
  31776. }
  31777. return new _range__WEBPACK_IMPORTED_MODULE_0__["default"]( fixedStart, fixedEnd );
  31778. }
  31779. // Range was not fixed at this point so it is valid - ie it was placed around limit element already.
  31780. return null;
  31781. }
  31782. // Finds the outer-most ancestor.
  31783. //
  31784. // @param {module:engine/model/node~Node} startingNode
  31785. // @param {module:engine/model/schema~Schema} schema
  31786. // @param {String} expandToDirection Direction of expansion - either 'start' or 'end' of the range.
  31787. // @returns {module:engine/model/node~Node}
  31788. function findOutermostLimitAncestor( startingNode, schema ) {
  31789. let isLimitNode = startingNode;
  31790. let parent = isLimitNode;
  31791. // Find outer most isLimit block as such blocks might be nested (ie. in tables).
  31792. while ( schema.isLimit( parent ) && parent.parent ) {
  31793. isLimitNode = parent;
  31794. parent = parent.parent;
  31795. }
  31796. return isLimitNode;
  31797. }
  31798. // Checks whether any of range boundaries is placed around non-limit elements.
  31799. //
  31800. // @param {module:engine/model/position~Position} start
  31801. // @param {module:engine/model/position~Position} end
  31802. // @param {module:engine/model/schema~Schema} schema
  31803. // @returns {Boolean}
  31804. function checkSelectionOnNonLimitElements( start, end, schema ) {
  31805. const startIsOnBlock = ( start.nodeAfter && !schema.isLimit( start.nodeAfter ) ) || schema.checkChild( start, '$text' );
  31806. const endIsOnBlock = ( end.nodeBefore && !schema.isLimit( end.nodeBefore ) ) || schema.checkChild( end, '$text' );
  31807. // We should fix such selection when one of those nodes needs fixing.
  31808. return startIsOnBlock || endIsOnBlock;
  31809. }
  31810. // Returns a minimal non-intersecting array of ranges.
  31811. //
  31812. // @param {Array.<module:engine/model/range~Range>} ranges
  31813. // @returns {Array.<module:engine/model/range~Range>}
  31814. function mergeIntersectingRanges( ranges ) {
  31815. const nonIntersectingRanges = [];
  31816. // First range will always be fine.
  31817. nonIntersectingRanges.push( ranges.shift() );
  31818. for ( const range of ranges ) {
  31819. const previousRange = nonIntersectingRanges.pop();
  31820. if ( range.isIntersecting( previousRange ) ) {
  31821. // Get the sum of two ranges.
  31822. const start = previousRange.start.isAfter( range.start ) ? range.start : previousRange.start;
  31823. const end = previousRange.end.isAfter( range.end ) ? previousRange.end : range.end;
  31824. const merged = new _range__WEBPACK_IMPORTED_MODULE_0__["default"]( start, end );
  31825. nonIntersectingRanges.push( merged );
  31826. } else {
  31827. nonIntersectingRanges.push( previousRange );
  31828. nonIntersectingRanges.push( range );
  31829. }
  31830. }
  31831. return nonIntersectingRanges;
  31832. }
  31833. // Checks if node exists and if it's a selectable.
  31834. //
  31835. // @param {module:engine/model/node~Node} node
  31836. // @param {module:engine/model/schema~Schema} schema
  31837. // @returns {Boolean}
  31838. function isSelectable( node, schema ) {
  31839. return node && schema.isSelectable( node );
  31840. }
  31841. /***/ }),
  31842. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/model/writer.js":
  31843. /*!*********************************************************************!*\
  31844. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/model/writer.js ***!
  31845. \*********************************************************************/
  31846. /*! exports provided: default */
  31847. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  31848. "use strict";
  31849. __webpack_require__.r(__webpack_exports__);
  31850. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Writer; });
  31851. /* harmony import */ var _operation_attributeoperation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./operation/attributeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/attributeoperation.js");
  31852. /* harmony import */ var _operation_detachoperation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./operation/detachoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/detachoperation.js");
  31853. /* harmony import */ var _operation_insertoperation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./operation/insertoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/insertoperation.js");
  31854. /* harmony import */ var _operation_markeroperation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./operation/markeroperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/markeroperation.js");
  31855. /* harmony import */ var _operation_moveoperation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./operation/moveoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/moveoperation.js");
  31856. /* harmony import */ var _operation_renameoperation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./operation/renameoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/renameoperation.js");
  31857. /* harmony import */ var _operation_rootattributeoperation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./operation/rootattributeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/rootattributeoperation.js");
  31858. /* harmony import */ var _operation_splitoperation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./operation/splitoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/splitoperation.js");
  31859. /* harmony import */ var _operation_mergeoperation__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./operation/mergeoperation */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/mergeoperation.js");
  31860. /* harmony import */ var _documentfragment__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./documentfragment */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentfragment.js");
  31861. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js");
  31862. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js");
  31863. /* harmony import */ var _rootelement__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./rootelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/rootelement.js");
  31864. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js");
  31865. /* harmony import */ var _range_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./range.js */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js");
  31866. /* harmony import */ var _documentselection__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./documentselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js");
  31867. /* harmony import */ var _ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/tomap */ "./node_modules/@ckeditor/ckeditor5-utils/src/tomap.js");
  31868. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  31869. /**
  31870. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  31871. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  31872. */
  31873. /**
  31874. * @module engine/model/writer
  31875. */
  31876. /**
  31877. * The model can only be modified by using the writer. It should be used whenever you want to create a node, modify
  31878. * child nodes, attributes or text, set the selection's position and its attributes.
  31879. *
  31880. * The instance of the writer is only available in the {@link module:engine/model/model~Model#change `change()`} or
  31881. * {@link module:engine/model/model~Model#enqueueChange `enqueueChange()`}.
  31882. *
  31883. * model.change( writer => {
  31884. * writer.insertText( 'foo', paragraph, 'end' );
  31885. * } );
  31886. *
  31887. * Note that the writer should never be stored and used outside of the `change()` and
  31888. * `enqueueChange()` blocks.
  31889. *
  31890. * Note that writer's methods do not check the {@link module:engine/model/schema~Schema}. It is possible
  31891. * to create incorrect model structures by using the writer. Read more about in
  31892. * {@glink framework/guides/deep-dive/schema#who-checks-the-schema "Who checks the schema?"}.
  31893. *
  31894. * @see module:engine/model/model~Model#change
  31895. * @see module:engine/model/model~Model#enqueueChange
  31896. */
  31897. class Writer {
  31898. /**
  31899. * Creates a writer instance.
  31900. *
  31901. * **Note:** It is not recommended to use it directly. Use {@link module:engine/model/model~Model#change `Model#change()`} or
  31902. * {@link module:engine/model/model~Model#enqueueChange `Model#enqueueChange()`} instead.
  31903. *
  31904. * @protected
  31905. * @param {module:engine/model/model~Model} model
  31906. * @param {module:engine/model/batch~Batch} batch
  31907. */
  31908. constructor( model, batch ) {
  31909. /**
  31910. * Instance of the model on which this writer operates.
  31911. *
  31912. * @readonly
  31913. * @type {module:engine/model/model~Model}
  31914. */
  31915. this.model = model;
  31916. /**
  31917. * The batch to which this writer will add changes.
  31918. *
  31919. * @readonly
  31920. * @type {module:engine/model/batch~Batch}
  31921. */
  31922. this.batch = batch;
  31923. }
  31924. /**
  31925. * Creates a new {@link module:engine/model/text~Text text node}.
  31926. *
  31927. * writer.createText( 'foo' );
  31928. * writer.createText( 'foo', { bold: true } );
  31929. *
  31930. * @param {String} data Text data.
  31931. * @param {Object} [attributes] Text attributes.
  31932. * @returns {module:engine/model/text~Text} Created text node.
  31933. */
  31934. createText( data, attributes ) {
  31935. return new _text__WEBPACK_IMPORTED_MODULE_10__["default"]( data, attributes );
  31936. }
  31937. /**
  31938. * Creates a new {@link module:engine/model/element~Element element}.
  31939. *
  31940. * writer.createElement( 'paragraph' );
  31941. * writer.createElement( 'paragraph', { alignment: 'center' } );
  31942. *
  31943. * @param {String} name Name of the element.
  31944. * @param {Object} [attributes] Elements attributes.
  31945. * @returns {module:engine/model/element~Element} Created element.
  31946. */
  31947. createElement( name, attributes ) {
  31948. return new _element__WEBPACK_IMPORTED_MODULE_11__["default"]( name, attributes );
  31949. }
  31950. /**
  31951. * Creates a new {@link module:engine/model/documentfragment~DocumentFragment document fragment}.
  31952. *
  31953. * @returns {module:engine/model/documentfragment~DocumentFragment} Created document fragment.
  31954. */
  31955. createDocumentFragment() {
  31956. return new _documentfragment__WEBPACK_IMPORTED_MODULE_9__["default"]();
  31957. }
  31958. /**
  31959. * Creates a copy of the element and returns it. Created element has the same name and attributes as the original element.
  31960. * If clone is deep, the original element's children are also cloned. If not, then empty element is returned.
  31961. *
  31962. * @param {module:engine/model/element~Element} element The element to clone.
  31963. * @param {Boolean} [deep=true] If set to `true` clones element and all its children recursively. When set to `false`,
  31964. * element will be cloned without any child.
  31965. */
  31966. cloneElement( element, deep = true ) {
  31967. return element._clone( deep );
  31968. }
  31969. /**
  31970. * Inserts item on given position.
  31971. *
  31972. * const paragraph = writer.createElement( 'paragraph' );
  31973. * writer.insert( paragraph, position );
  31974. *
  31975. * Instead of using position you can use parent and offset:
  31976. *
  31977. * const text = writer.createText( 'foo' );
  31978. * writer.insert( text, paragraph, 5 );
  31979. *
  31980. * You can also use `end` instead of the offset to insert at the end:
  31981. *
  31982. * const text = writer.createText( 'foo' );
  31983. * writer.insert( text, paragraph, 'end' );
  31984. *
  31985. * Or insert before or after another element:
  31986. *
  31987. * const paragraph = writer.createElement( 'paragraph' );
  31988. * writer.insert( paragraph, anotherParagraph, 'after' );
  31989. *
  31990. * These parameters works the same way as {@link #createPositionAt `writer.createPositionAt()`}.
  31991. *
  31992. * Note that if the item already has parent it will be removed from the previous parent.
  31993. *
  31994. * Note that you cannot re-insert a node from a document to a different document or a document fragment. In this case,
  31995. * `model-writer-insert-forbidden-move` is thrown.
  31996. *
  31997. * If you want to move {@link module:engine/model/range~Range range} instead of an
  31998. * {@link module:engine/model/item~Item item} use {@link module:engine/model/writer~Writer#move `Writer#move()`}.
  31999. *
  32000. * **Note:** For a paste-like content insertion mechanism see
  32001. * {@link module:engine/model/model~Model#insertContent `model.insertContent()`}.
  32002. *
  32003. * @param {module:engine/model/item~Item|module:engine/model/documentfragment~DocumentFragment} item Item or document
  32004. * fragment to insert.
  32005. * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
  32006. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  32007. * second parameter is a {@link module:engine/model/item~Item model item}.
  32008. */
  32009. insert( item, itemOrPosition, offset = 0 ) {
  32010. this._assertWriterUsedCorrectly();
  32011. if ( item instanceof _text__WEBPACK_IMPORTED_MODULE_10__["default"] && item.data == '' ) {
  32012. return;
  32013. }
  32014. const position = _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createAt( itemOrPosition, offset );
  32015. // If item has a parent already.
  32016. if ( item.parent ) {
  32017. // We need to check if item is going to be inserted within the same document.
  32018. if ( isSameTree( item.root, position.root ) ) {
  32019. // If it's we just need to move it.
  32020. this.move( _range_js__WEBPACK_IMPORTED_MODULE_14__["default"]._createOn( item ), position );
  32021. return;
  32022. }
  32023. // If it isn't the same root.
  32024. else {
  32025. if ( item.root.document ) {
  32026. /**
  32027. * Cannot move a node from a document to a different tree.
  32028. * It is forbidden to move a node that was already in a document outside of it.
  32029. *
  32030. * @error model-writer-insert-forbidden-move
  32031. */
  32032. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"](
  32033. 'model-writer-insert-forbidden-move',
  32034. this
  32035. );
  32036. } else {
  32037. // Move between two different document fragments or from document fragment to a document is possible.
  32038. // In that case, remove the item from it's original parent.
  32039. this.remove( item );
  32040. }
  32041. }
  32042. }
  32043. const version = position.root.document ? position.root.document.version : null;
  32044. const insert = new _operation_insertoperation__WEBPACK_IMPORTED_MODULE_2__["default"]( position, item, version );
  32045. if ( item instanceof _text__WEBPACK_IMPORTED_MODULE_10__["default"] ) {
  32046. insert.shouldReceiveAttributes = true;
  32047. }
  32048. this.batch.addOperation( insert );
  32049. this.model.applyOperation( insert );
  32050. // When element is a DocumentFragment we need to move its markers to Document#markers.
  32051. if ( item instanceof _documentfragment__WEBPACK_IMPORTED_MODULE_9__["default"] ) {
  32052. for ( const [ markerName, markerRange ] of item.markers ) {
  32053. // We need to migrate marker range from DocumentFragment to Document.
  32054. const rangeRootPosition = _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createAt( markerRange.root, 0 );
  32055. const range = new _range_js__WEBPACK_IMPORTED_MODULE_14__["default"](
  32056. markerRange.start._getCombined( rangeRootPosition, position ),
  32057. markerRange.end._getCombined( rangeRootPosition, position )
  32058. );
  32059. const options = { range, usingOperation: true, affectsData: true };
  32060. if ( this.model.markers.has( markerName ) ) {
  32061. this.updateMarker( markerName, options );
  32062. } else {
  32063. this.addMarker( markerName, options );
  32064. }
  32065. }
  32066. }
  32067. }
  32068. /**
  32069. * Creates and inserts text on given position. You can optionally set text attributes:
  32070. *
  32071. * writer.insertText( 'foo', position );
  32072. * writer.insertText( 'foo', { bold: true }, position );
  32073. *
  32074. * Instead of using position you can use parent and offset or define that text should be inserted at the end
  32075. * or before or after other node:
  32076. *
  32077. * // Inserts 'foo' in paragraph, at offset 5:
  32078. * writer.insertText( 'foo', paragraph, 5 );
  32079. * // Inserts 'foo' at the end of a paragraph:
  32080. * writer.insertText( 'foo', paragraph, 'end' );
  32081. * // Inserts 'foo' after an image:
  32082. * writer.insertText( 'foo', image, 'after' );
  32083. *
  32084. * These parameters work in the same way as {@link #createPositionAt `writer.createPositionAt()`}.
  32085. *
  32086. * @param {String} data Text data.
  32087. * @param {Object} [attributes] Text attributes.
  32088. * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
  32089. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  32090. * third parameter is a {@link module:engine/model/item~Item model item}.
  32091. */
  32092. insertText( text, attributes, itemOrPosition, offset ) {
  32093. if ( attributes instanceof _documentfragment__WEBPACK_IMPORTED_MODULE_9__["default"] || attributes instanceof _element__WEBPACK_IMPORTED_MODULE_11__["default"] || attributes instanceof _position__WEBPACK_IMPORTED_MODULE_13__["default"] ) {
  32094. this.insert( this.createText( text ), attributes, itemOrPosition );
  32095. } else {
  32096. this.insert( this.createText( text, attributes ), itemOrPosition, offset );
  32097. }
  32098. }
  32099. /**
  32100. * Creates and inserts element on given position. You can optionally set attributes:
  32101. *
  32102. * writer.insertElement( 'paragraph', position );
  32103. * writer.insertElement( 'paragraph', { alignment: 'center' }, position );
  32104. *
  32105. * Instead of using position you can use parent and offset or define that text should be inserted at the end
  32106. * or before or after other node:
  32107. *
  32108. * // Inserts paragraph in the root at offset 5:
  32109. * writer.insertElement( 'paragraph', root, 5 );
  32110. * // Inserts paragraph at the end of a blockquote:
  32111. * writer.insertElement( 'paragraph', blockquote, 'end' );
  32112. * // Inserts after an image:
  32113. * writer.insertElement( 'paragraph', image, 'after' );
  32114. *
  32115. * These parameters works the same way as {@link #createPositionAt `writer.createPositionAt()`}.
  32116. *
  32117. * @param {String} name Name of the element.
  32118. * @param {Object} [attributes] Elements attributes.
  32119. * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
  32120. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  32121. * third parameter is a {@link module:engine/model/item~Item model item}.
  32122. */
  32123. insertElement( name, attributes, itemOrPosition, offset ) {
  32124. if ( attributes instanceof _documentfragment__WEBPACK_IMPORTED_MODULE_9__["default"] || attributes instanceof _element__WEBPACK_IMPORTED_MODULE_11__["default"] || attributes instanceof _position__WEBPACK_IMPORTED_MODULE_13__["default"] ) {
  32125. this.insert( this.createElement( name ), attributes, itemOrPosition );
  32126. } else {
  32127. this.insert( this.createElement( name, attributes ), itemOrPosition, offset );
  32128. }
  32129. }
  32130. /**
  32131. * Inserts item at the end of the given parent.
  32132. *
  32133. * const paragraph = writer.createElement( 'paragraph' );
  32134. * writer.append( paragraph, root );
  32135. *
  32136. * Note that if the item already has parent it will be removed from the previous parent.
  32137. *
  32138. * If you want to move {@link module:engine/model/range~Range range} instead of an
  32139. * {@link module:engine/model/item~Item item} use {@link module:engine/model/writer~Writer#move `Writer#move()`}.
  32140. *
  32141. * @param {module:engine/model/item~Item|module:engine/model/documentfragment~DocumentFragment}
  32142. * item Item or document fragment to insert.
  32143. * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} parent
  32144. */
  32145. append( item, parent ) {
  32146. this.insert( item, parent, 'end' );
  32147. }
  32148. /**
  32149. * Creates text node and inserts it at the end of the parent. You can optionally set text attributes:
  32150. *
  32151. * writer.appendText( 'foo', paragraph );
  32152. * writer.appendText( 'foo', { bold: true }, paragraph );
  32153. *
  32154. * @param {String} text Text data.
  32155. * @param {Object} [attributes] Text attributes.
  32156. * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} parent
  32157. */
  32158. appendText( text, attributes, parent ) {
  32159. if ( attributes instanceof _documentfragment__WEBPACK_IMPORTED_MODULE_9__["default"] || attributes instanceof _element__WEBPACK_IMPORTED_MODULE_11__["default"] ) {
  32160. this.insert( this.createText( text ), attributes, 'end' );
  32161. } else {
  32162. this.insert( this.createText( text, attributes ), parent, 'end' );
  32163. }
  32164. }
  32165. /**
  32166. * Creates element and inserts it at the end of the parent. You can optionally set attributes:
  32167. *
  32168. * writer.appendElement( 'paragraph', root );
  32169. * writer.appendElement( 'paragraph', { alignment: 'center' }, root );
  32170. *
  32171. * @param {String} name Name of the element.
  32172. * @param {Object} [attributes] Elements attributes.
  32173. * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} parent
  32174. */
  32175. appendElement( name, attributes, parent ) {
  32176. if ( attributes instanceof _documentfragment__WEBPACK_IMPORTED_MODULE_9__["default"] || attributes instanceof _element__WEBPACK_IMPORTED_MODULE_11__["default"] ) {
  32177. this.insert( this.createElement( name ), attributes, 'end' );
  32178. } else {
  32179. this.insert( this.createElement( name, attributes ), parent, 'end' );
  32180. }
  32181. }
  32182. /**
  32183. * Sets value of the attribute with given key on a {@link module:engine/model/item~Item model item}
  32184. * or on a {@link module:engine/model/range~Range range}.
  32185. *
  32186. * @param {String} key Attribute key.
  32187. * @param {*} value Attribute new value.
  32188. * @param {module:engine/model/item~Item|module:engine/model/range~Range} itemOrRange
  32189. * Model item or range on which the attribute will be set.
  32190. */
  32191. setAttribute( key, value, itemOrRange ) {
  32192. this._assertWriterUsedCorrectly();
  32193. if ( itemOrRange instanceof _range_js__WEBPACK_IMPORTED_MODULE_14__["default"] ) {
  32194. const ranges = itemOrRange.getMinimalFlatRanges();
  32195. for ( const range of ranges ) {
  32196. setAttributeOnRange( this, key, value, range );
  32197. }
  32198. } else {
  32199. setAttributeOnItem( this, key, value, itemOrRange );
  32200. }
  32201. }
  32202. /**
  32203. * Sets values of attributes on a {@link module:engine/model/item~Item model item}
  32204. * or on a {@link module:engine/model/range~Range range}.
  32205. *
  32206. * writer.setAttributes( {
  32207. * bold: true,
  32208. * italic: true
  32209. * }, range );
  32210. *
  32211. * @param {Object} attributes Attributes keys and values.
  32212. * @param {module:engine/model/item~Item|module:engine/model/range~Range} itemOrRange
  32213. * Model item or range on which the attributes will be set.
  32214. */
  32215. setAttributes( attributes, itemOrRange ) {
  32216. for ( const [ key, val ] of Object(_ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_16__["default"])( attributes ) ) {
  32217. this.setAttribute( key, val, itemOrRange );
  32218. }
  32219. }
  32220. /**
  32221. * Removes an attribute with given key from a {@link module:engine/model/item~Item model item}
  32222. * or from a {@link module:engine/model/range~Range range}.
  32223. *
  32224. * @param {String} key Attribute key.
  32225. * @param {module:engine/model/item~Item|module:engine/model/range~Range} itemOrRange
  32226. * Model item or range from which the attribute will be removed.
  32227. */
  32228. removeAttribute( key, itemOrRange ) {
  32229. this._assertWriterUsedCorrectly();
  32230. if ( itemOrRange instanceof _range_js__WEBPACK_IMPORTED_MODULE_14__["default"] ) {
  32231. const ranges = itemOrRange.getMinimalFlatRanges();
  32232. for ( const range of ranges ) {
  32233. setAttributeOnRange( this, key, null, range );
  32234. }
  32235. } else {
  32236. setAttributeOnItem( this, key, null, itemOrRange );
  32237. }
  32238. }
  32239. /**
  32240. * Removes all attributes from all elements in the range or from the given item.
  32241. *
  32242. * @param {module:engine/model/item~Item|module:engine/model/range~Range} itemOrRange
  32243. * Model item or range from which all attributes will be removed.
  32244. */
  32245. clearAttributes( itemOrRange ) {
  32246. this._assertWriterUsedCorrectly();
  32247. const removeAttributesFromItem = item => {
  32248. for ( const attribute of item.getAttributeKeys() ) {
  32249. this.removeAttribute( attribute, item );
  32250. }
  32251. };
  32252. if ( !( itemOrRange instanceof _range_js__WEBPACK_IMPORTED_MODULE_14__["default"] ) ) {
  32253. removeAttributesFromItem( itemOrRange );
  32254. } else {
  32255. for ( const item of itemOrRange.getItems() ) {
  32256. removeAttributesFromItem( item );
  32257. }
  32258. }
  32259. }
  32260. /**
  32261. * Moves all items in the source range to the target position.
  32262. *
  32263. * writer.move( sourceRange, targetPosition );
  32264. *
  32265. * Instead of the target position you can use parent and offset or define that range should be moved to the end
  32266. * or before or after chosen item:
  32267. *
  32268. * // Moves all items in the range to the paragraph at offset 5:
  32269. * writer.move( sourceRange, paragraph, 5 );
  32270. * // Moves all items in the range to the end of a blockquote:
  32271. * writer.move( sourceRange, blockquote, 'end' );
  32272. * // Moves all items in the range to a position after an image:
  32273. * writer.move( sourceRange, image, 'after' );
  32274. *
  32275. * These parameters works the same way as {@link #createPositionAt `writer.createPositionAt()`}.
  32276. *
  32277. * Note that items can be moved only within the same tree. It means that you can move items within the same root
  32278. * (element or document fragment) or between {@link module:engine/model/document~Document#roots documents roots},
  32279. * but you can not move items from document fragment to the document or from one detached element to another. Use
  32280. * {@link module:engine/model/writer~Writer#insert} in such cases.
  32281. *
  32282. * @param {module:engine/model/range~Range} range Source range.
  32283. * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
  32284. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  32285. * second parameter is a {@link module:engine/model/item~Item model item}.
  32286. */
  32287. move( range, itemOrPosition, offset ) {
  32288. this._assertWriterUsedCorrectly();
  32289. if ( !( range instanceof _range_js__WEBPACK_IMPORTED_MODULE_14__["default"] ) ) {
  32290. /**
  32291. * Invalid range to move.
  32292. *
  32293. * @error writer-move-invalid-range
  32294. */
  32295. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-move-invalid-range', this );
  32296. }
  32297. if ( !range.isFlat ) {
  32298. /**
  32299. * Range to move is not flat.
  32300. *
  32301. * @error writer-move-range-not-flat
  32302. */
  32303. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-move-range-not-flat', this );
  32304. }
  32305. const position = _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createAt( itemOrPosition, offset );
  32306. // Do not move anything if the move target is same as moved range start.
  32307. if ( position.isEqual( range.start ) ) {
  32308. return;
  32309. }
  32310. // If part of the marker is removed, create additional marker operation for undo purposes.
  32311. this._addOperationForAffectedMarkers( 'move', range );
  32312. if ( !isSameTree( range.root, position.root ) ) {
  32313. /**
  32314. * Range is going to be moved within not the same document. Please use
  32315. * {@link module:engine/model/writer~Writer#insert insert} instead.
  32316. *
  32317. * @error writer-move-different-document
  32318. */
  32319. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-move-different-document', this );
  32320. }
  32321. const version = range.root.document ? range.root.document.version : null;
  32322. const operation = new _operation_moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( range.start, range.end.offset - range.start.offset, position, version );
  32323. this.batch.addOperation( operation );
  32324. this.model.applyOperation( operation );
  32325. }
  32326. /**
  32327. * Removes given model {@link module:engine/model/item~Item item} or {@link module:engine/model/range~Range range}.
  32328. *
  32329. * @param {module:engine/model/item~Item|module:engine/model/range~Range} itemOrRange Model item or range to remove.
  32330. */
  32331. remove( itemOrRange ) {
  32332. this._assertWriterUsedCorrectly();
  32333. const rangeToRemove = itemOrRange instanceof _range_js__WEBPACK_IMPORTED_MODULE_14__["default"] ? itemOrRange : _range_js__WEBPACK_IMPORTED_MODULE_14__["default"]._createOn( itemOrRange );
  32334. const ranges = rangeToRemove.getMinimalFlatRanges().reverse();
  32335. for ( const flat of ranges ) {
  32336. // If part of the marker is removed, create additional marker operation for undo purposes.
  32337. this._addOperationForAffectedMarkers( 'move', flat );
  32338. applyRemoveOperation( flat.start, flat.end.offset - flat.start.offset, this.batch, this.model );
  32339. }
  32340. }
  32341. /**
  32342. * Merges two siblings at the given position.
  32343. *
  32344. * Node before and after the position have to be an element. Otherwise `writer-merge-no-element-before` or
  32345. * `writer-merge-no-element-after` error will be thrown.
  32346. *
  32347. * @param {module:engine/model/position~Position} position Position between merged elements.
  32348. */
  32349. merge( position ) {
  32350. this._assertWriterUsedCorrectly();
  32351. const nodeBefore = position.nodeBefore;
  32352. const nodeAfter = position.nodeAfter;
  32353. // If part of the marker is removed, create additional marker operation for undo purposes.
  32354. this._addOperationForAffectedMarkers( 'merge', position );
  32355. if ( !( nodeBefore instanceof _element__WEBPACK_IMPORTED_MODULE_11__["default"] ) ) {
  32356. /**
  32357. * Node before merge position must be an element.
  32358. *
  32359. * @error writer-merge-no-element-before
  32360. */
  32361. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-merge-no-element-before', this );
  32362. }
  32363. if ( !( nodeAfter instanceof _element__WEBPACK_IMPORTED_MODULE_11__["default"] ) ) {
  32364. /**
  32365. * Node after merge position must be an element.
  32366. *
  32367. * @error writer-merge-no-element-after
  32368. */
  32369. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-merge-no-element-after', this );
  32370. }
  32371. if ( !position.root.document ) {
  32372. this._mergeDetached( position );
  32373. } else {
  32374. this._merge( position );
  32375. }
  32376. }
  32377. /**
  32378. * Shortcut for {@link module:engine/model/model~Model#createPositionFromPath `Model#createPositionFromPath()`}.
  32379. *
  32380. * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} root Root of the position.
  32381. * @param {Array.<Number>} path Position path. See {@link module:engine/model/position~Position#path}.
  32382. * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone'] Position stickiness.
  32383. * See {@link module:engine/model/position~PositionStickiness}.
  32384. * @returns {module:engine/model/position~Position}
  32385. */
  32386. createPositionFromPath( root, path, stickiness ) {
  32387. return this.model.createPositionFromPath( root, path, stickiness );
  32388. }
  32389. /**
  32390. * Shortcut for {@link module:engine/model/model~Model#createPositionAt `Model#createPositionAt()`}.
  32391. *
  32392. * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
  32393. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  32394. * first parameter is a {@link module:engine/model/item~Item model item}.
  32395. * @returns {module:engine/model/position~Position}
  32396. */
  32397. createPositionAt( itemOrPosition, offset ) {
  32398. return this.model.createPositionAt( itemOrPosition, offset );
  32399. }
  32400. /**
  32401. * Shortcut for {@link module:engine/model/model~Model#createPositionAfter `Model#createPositionAfter()`}.
  32402. *
  32403. * @param {module:engine/model/item~Item} item Item after which the position should be placed.
  32404. * @returns {module:engine/model/position~Position}
  32405. */
  32406. createPositionAfter( item ) {
  32407. return this.model.createPositionAfter( item );
  32408. }
  32409. /**
  32410. * Shortcut for {@link module:engine/model/model~Model#createPositionBefore `Model#createPositionBefore()`}.
  32411. *
  32412. * @param {module:engine/model/item~Item} item Item after which the position should be placed.
  32413. * @returns {module:engine/model/position~Position}
  32414. */
  32415. createPositionBefore( item ) {
  32416. return this.model.createPositionBefore( item );
  32417. }
  32418. /**
  32419. * Shortcut for {@link module:engine/model/model~Model#createRange `Model#createRange()`}.
  32420. *
  32421. * @param {module:engine/model/position~Position} start Start position.
  32422. * @param {module:engine/model/position~Position} [end] End position. If not set, range will be collapsed at `start` position.
  32423. * @returns {module:engine/model/range~Range}
  32424. */
  32425. createRange( start, end ) {
  32426. return this.model.createRange( start, end );
  32427. }
  32428. /**
  32429. * Shortcut for {@link module:engine/model/model~Model#createRangeIn `Model#createRangeIn()`}.
  32430. *
  32431. * @param {module:engine/model/element~Element} element Element which is a parent for the range.
  32432. * @returns {module:engine/model/range~Range}
  32433. */
  32434. createRangeIn( element ) {
  32435. return this.model.createRangeIn( element );
  32436. }
  32437. /**
  32438. * Shortcut for {@link module:engine/model/model~Model#createRangeOn `Model#createRangeOn()`}.
  32439. *
  32440. * @param {module:engine/model/element~Element} element Element which is a parent for the range.
  32441. * @returns {module:engine/model/range~Range}
  32442. */
  32443. createRangeOn( element ) {
  32444. return this.model.createRangeOn( element );
  32445. }
  32446. /**
  32447. * Shortcut for {@link module:engine/model/model~Model#createSelection `Model#createSelection()`}.
  32448. *
  32449. * @param {module:engine/model/selection~Selectable} selectable
  32450. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
  32451. * @param {Object} [options]
  32452. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  32453. * @returns {module:engine/model/selection~Selection}
  32454. */
  32455. createSelection( selectable, placeOrOffset, options ) {
  32456. return this.model.createSelection( selectable, placeOrOffset, options );
  32457. }
  32458. /**
  32459. * Performs merge action in a detached tree.
  32460. *
  32461. * @private
  32462. * @param {module:engine/model/position~Position} position Position between merged elements.
  32463. */
  32464. _mergeDetached( position ) {
  32465. const nodeBefore = position.nodeBefore;
  32466. const nodeAfter = position.nodeAfter;
  32467. this.move( _range_js__WEBPACK_IMPORTED_MODULE_14__["default"]._createIn( nodeAfter ), _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createAt( nodeBefore, 'end' ) );
  32468. this.remove( nodeAfter );
  32469. }
  32470. /**
  32471. * Performs merge action in a non-detached tree.
  32472. *
  32473. * @private
  32474. * @param {module:engine/model/position~Position} position Position between merged elements.
  32475. */
  32476. _merge( position ) {
  32477. const targetPosition = _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createAt( position.nodeBefore, 'end' );
  32478. const sourcePosition = _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createAt( position.nodeAfter, 0 );
  32479. const graveyard = position.root.document.graveyard;
  32480. const graveyardPosition = new _position__WEBPACK_IMPORTED_MODULE_13__["default"]( graveyard, [ 0 ] );
  32481. const version = position.root.document.version;
  32482. const merge = new _operation_mergeoperation__WEBPACK_IMPORTED_MODULE_8__["default"]( sourcePosition, position.nodeAfter.maxOffset, targetPosition, graveyardPosition, version );
  32483. this.batch.addOperation( merge );
  32484. this.model.applyOperation( merge );
  32485. }
  32486. /**
  32487. * Renames the given element.
  32488. *
  32489. * @param {module:engine/model/element~Element} element The element to rename.
  32490. * @param {String} newName New element name.
  32491. */
  32492. rename( element, newName ) {
  32493. this._assertWriterUsedCorrectly();
  32494. if ( !( element instanceof _element__WEBPACK_IMPORTED_MODULE_11__["default"] ) ) {
  32495. /**
  32496. * Trying to rename an object which is not an instance of Element.
  32497. *
  32498. * @error writer-rename-not-element-instance
  32499. */
  32500. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"](
  32501. 'writer-rename-not-element-instance',
  32502. this
  32503. );
  32504. }
  32505. const version = element.root.document ? element.root.document.version : null;
  32506. const renameOperation = new _operation_renameoperation__WEBPACK_IMPORTED_MODULE_5__["default"]( _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createBefore( element ), element.name, newName, version );
  32507. this.batch.addOperation( renameOperation );
  32508. this.model.applyOperation( renameOperation );
  32509. }
  32510. /**
  32511. * Splits elements starting from the given position and going to the top of the model tree as long as given
  32512. * `limitElement` is reached. When `limitElement` is not defined then only the parent of the given position will be split.
  32513. *
  32514. * The element needs to have a parent. It cannot be a root element nor a document fragment.
  32515. * The `writer-split-element-no-parent` error will be thrown if you try to split an element with no parent.
  32516. *
  32517. * @param {module:engine/model/position~Position} position Position of split.
  32518. * @param {module:engine/model/node~Node} [limitElement] Stop splitting when this element will be reached.
  32519. * @returns {Object} result Split result.
  32520. * @returns {module:engine/model/position~Position} result.position Position between split elements.
  32521. * @returns {module:engine/model/range~Range} result.range Range that stars from the end of the first split element and ends
  32522. * at the beginning of the first copy element.
  32523. */
  32524. split( position, limitElement ) {
  32525. this._assertWriterUsedCorrectly();
  32526. let splitElement = position.parent;
  32527. if ( !splitElement.parent ) {
  32528. /**
  32529. * Element with no parent can not be split.
  32530. *
  32531. * @error writer-split-element-no-parent
  32532. */
  32533. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-split-element-no-parent', this );
  32534. }
  32535. // When limit element is not defined lets set splitElement parent as limit.
  32536. if ( !limitElement ) {
  32537. limitElement = splitElement.parent;
  32538. }
  32539. if ( !position.parent.getAncestors( { includeSelf: true } ).includes( limitElement ) ) {
  32540. /**
  32541. * Limit element is not a position ancestor.
  32542. *
  32543. * @error writer-split-invalid-limit-element
  32544. */
  32545. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-split-invalid-limit-element', this );
  32546. }
  32547. // We need to cache elements that will be created as a result of the first split because
  32548. // we need to create a range from the end of the first split element to the beginning of the
  32549. // first copy element. This should be handled by LiveRange but it doesn't work on detached nodes.
  32550. let firstSplitElement, firstCopyElement;
  32551. do {
  32552. const version = splitElement.root.document ? splitElement.root.document.version : null;
  32553. const howMany = splitElement.maxOffset - position.offset;
  32554. const split = new _operation_splitoperation__WEBPACK_IMPORTED_MODULE_7__["default"]( position, howMany, null, version );
  32555. this.batch.addOperation( split );
  32556. this.model.applyOperation( split );
  32557. // Cache result of the first split.
  32558. if ( !firstSplitElement && !firstCopyElement ) {
  32559. firstSplitElement = splitElement;
  32560. firstCopyElement = position.parent.nextSibling;
  32561. }
  32562. position = this.createPositionAfter( position.parent );
  32563. splitElement = position.parent;
  32564. } while ( splitElement !== limitElement );
  32565. return {
  32566. position,
  32567. range: new _range_js__WEBPACK_IMPORTED_MODULE_14__["default"]( _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createAt( firstSplitElement, 'end' ), _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createAt( firstCopyElement, 0 ) )
  32568. };
  32569. }
  32570. /**
  32571. * Wraps the given range with the given element or with a new element (if a string was passed).
  32572. *
  32573. * **Note:** range to wrap should be a "flat range" (see {@link module:engine/model/range~Range#isFlat `Range#isFlat`}).
  32574. * If not, an error will be thrown.
  32575. *
  32576. * @param {module:engine/model/range~Range} range Range to wrap.
  32577. * @param {module:engine/model/element~Element|String} elementOrString Element or name of element to wrap the range with.
  32578. */
  32579. wrap( range, elementOrString ) {
  32580. this._assertWriterUsedCorrectly();
  32581. if ( !range.isFlat ) {
  32582. /**
  32583. * Range to wrap is not flat.
  32584. *
  32585. * @error writer-wrap-range-not-flat
  32586. */
  32587. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-wrap-range-not-flat', this );
  32588. }
  32589. const element = elementOrString instanceof _element__WEBPACK_IMPORTED_MODULE_11__["default"] ? elementOrString : new _element__WEBPACK_IMPORTED_MODULE_11__["default"]( elementOrString );
  32590. if ( element.childCount > 0 ) {
  32591. /**
  32592. * Element to wrap with is not empty.
  32593. *
  32594. * @error writer-wrap-element-not-empty
  32595. */
  32596. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-wrap-element-not-empty', this );
  32597. }
  32598. if ( element.parent !== null ) {
  32599. /**
  32600. * Element to wrap with is already attached to a tree model.
  32601. *
  32602. * @error writer-wrap-element-attached
  32603. */
  32604. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-wrap-element-attached', this );
  32605. }
  32606. this.insert( element, range.start );
  32607. // Shift the range-to-wrap because we just inserted an element before that range.
  32608. const shiftedRange = new _range_js__WEBPACK_IMPORTED_MODULE_14__["default"]( range.start.getShiftedBy( 1 ), range.end.getShiftedBy( 1 ) );
  32609. this.move( shiftedRange, _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createAt( element, 0 ) );
  32610. }
  32611. /**
  32612. * Unwraps children of the given element – all its children are moved before it and then the element is removed.
  32613. * Throws error if you try to unwrap an element which does not have a parent.
  32614. *
  32615. * @param {module:engine/model/element~Element} element Element to unwrap.
  32616. */
  32617. unwrap( element ) {
  32618. this._assertWriterUsedCorrectly();
  32619. if ( element.parent === null ) {
  32620. /**
  32621. * Trying to unwrap an element which has no parent.
  32622. *
  32623. * @error writer-unwrap-element-no-parent
  32624. */
  32625. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-unwrap-element-no-parent', this );
  32626. }
  32627. this.move( _range_js__WEBPACK_IMPORTED_MODULE_14__["default"]._createIn( element ), this.createPositionAfter( element ) );
  32628. this.remove( element );
  32629. }
  32630. /**
  32631. * Adds a {@link module:engine/model/markercollection~Marker marker}. Marker is a named range, which tracks
  32632. * changes in the document and updates its range automatically, when model tree changes.
  32633. *
  32634. * As the first parameter you can set marker name.
  32635. *
  32636. * The required `options.usingOperation` parameter lets you decide if the marker should be managed by operations or not. See
  32637. * {@link module:engine/model/markercollection~Marker marker class description} to learn about the difference between
  32638. * markers managed by operations and not-managed by operations.
  32639. *
  32640. * The `options.affectsData` parameter, which defaults to `false`, allows you to define if a marker affects the data. It should be
  32641. * `true` when the marker change changes the data returned by the
  32642. * {@link module:core/editor/utils/dataapimixin~DataApi#getData `editor.getData()`} method.
  32643. * When set to `true` it fires the {@link module:engine/model/document~Document#event:change:data `change:data`} event.
  32644. * When set to `false` it fires the {@link module:engine/model/document~Document#event:change `change`} event.
  32645. *
  32646. * Create marker directly base on marker's name:
  32647. *
  32648. * addMarker( markerName, { range, usingOperation: false } );
  32649. *
  32650. * Create marker using operation:
  32651. *
  32652. * addMarker( markerName, { range, usingOperation: true } );
  32653. *
  32654. * Create marker that affects the editor data:
  32655. *
  32656. * addMarker( markerName, { range, usingOperation: false, affectsData: true } );
  32657. *
  32658. * Note: For efficiency reasons, it's best to create and keep as little markers as possible.
  32659. *
  32660. * @see module:engine/model/markercollection~Marker
  32661. * @param {String} name Name of a marker to create - must be unique.
  32662. * @param {Object} options
  32663. * @param {Boolean} options.usingOperation Flag indicating that the marker should be added by MarkerOperation.
  32664. * See {@link module:engine/model/markercollection~Marker#managedUsingOperations}.
  32665. * @param {module:engine/model/range~Range} options.range Marker range.
  32666. * @param {Boolean} [options.affectsData=false] Flag indicating that the marker changes the editor data.
  32667. * @returns {module:engine/model/markercollection~Marker} Marker that was set.
  32668. */
  32669. addMarker( name, options ) {
  32670. this._assertWriterUsedCorrectly();
  32671. if ( !options || typeof options.usingOperation != 'boolean' ) {
  32672. /**
  32673. * The `options.usingOperation` parameter is required when adding a new marker.
  32674. *
  32675. * @error writer-addmarker-no-usingoperation
  32676. */
  32677. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-addmarker-no-usingoperation', this );
  32678. }
  32679. const usingOperation = options.usingOperation;
  32680. const range = options.range;
  32681. const affectsData = options.affectsData === undefined ? false : options.affectsData;
  32682. if ( this.model.markers.has( name ) ) {
  32683. /**
  32684. * Marker with provided name already exists.
  32685. *
  32686. * @error writer-addmarker-marker-exists
  32687. */
  32688. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-addmarker-marker-exists', this );
  32689. }
  32690. if ( !range ) {
  32691. /**
  32692. * Range parameter is required when adding a new marker.
  32693. *
  32694. * @error writer-addmarker-no-range
  32695. */
  32696. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-addmarker-no-range', this );
  32697. }
  32698. if ( !usingOperation ) {
  32699. return this.model.markers._set( name, range, usingOperation, affectsData );
  32700. }
  32701. applyMarkerOperation( this, name, null, range, affectsData );
  32702. return this.model.markers.get( name );
  32703. }
  32704. /**
  32705. * Adds, updates or refreshes a {@link module:engine/model/markercollection~Marker marker}. Marker is a named range, which tracks
  32706. * changes in the document and updates its range automatically, when model tree changes. Still, it is possible to change the
  32707. * marker's range directly using this method.
  32708. *
  32709. * As the first parameter you can set marker name or instance. If none of them is provided, new marker, with a unique
  32710. * name is created and returned.
  32711. *
  32712. * As the second parameter you can set the new marker data or leave this parameter as empty which will just refresh
  32713. * the marker by triggering downcast conversion for it. Refreshing the marker is useful when you want to change
  32714. * the marker {@link module:engine/view/element~Element view element} without changing any marker data.
  32715. *
  32716. * let isCommentActive = false;
  32717. *
  32718. * model.conversion.markerToHighlight( {
  32719. * model: 'comment',
  32720. * view: data => {
  32721. * const classes = [ 'comment-marker' ];
  32722. *
  32723. * if ( isCommentActive ) {
  32724. * classes.push( 'comment-marker--active' );
  32725. * }
  32726. *
  32727. * return { classes };
  32728. * }
  32729. * } );
  32730. *
  32731. * // Change the property that indicates if marker is displayed as active or not.
  32732. * isCommentActive = true;
  32733. *
  32734. * // And refresh the marker to convert it with additional class.
  32735. * model.change( writer => writer.updateMarker( 'comment' ) );
  32736. *
  32737. * The `options.usingOperation` parameter lets you change if the marker should be managed by operations or not. See
  32738. * {@link module:engine/model/markercollection~Marker marker class description} to learn about the difference between
  32739. * markers managed by operations and not-managed by operations. It is possible to change this option for an existing marker.
  32740. *
  32741. * The `options.affectsData` parameter, which defaults to `false`, allows you to define if a marker affects the data. It should be
  32742. * `true` when the marker change changes the data returned by
  32743. * the {@link module:core/editor/utils/dataapimixin~DataApi#getData `editor.getData()`} method.
  32744. * When set to `true` it fires the {@link module:engine/model/document~Document#event:change:data `change:data`} event.
  32745. * When set to `false` it fires the {@link module:engine/model/document~Document#event:change `change`} event.
  32746. *
  32747. * Update marker directly base on marker's name:
  32748. *
  32749. * updateMarker( markerName, { range } );
  32750. *
  32751. * Update marker using operation:
  32752. *
  32753. * updateMarker( marker, { range, usingOperation: true } );
  32754. * updateMarker( markerName, { range, usingOperation: true } );
  32755. *
  32756. * Change marker's option (start using operations to manage it):
  32757. *
  32758. * updateMarker( marker, { usingOperation: true } );
  32759. *
  32760. * Change marker's option (inform the engine, that the marker does not affect the data anymore):
  32761. *
  32762. * updateMarker( markerName, { affectsData: false } );
  32763. *
  32764. * @see module:engine/model/markercollection~Marker
  32765. * @param {String|module:engine/model/markercollection~Marker} markerOrName Name of a marker to update, or a marker instance.
  32766. * @param {Object} [options] If options object is not defined then marker will be refreshed by triggering
  32767. * downcast conversion for this marker with the same data.
  32768. * @param {module:engine/model/range~Range} [options.range] Marker range to update.
  32769. * @param {Boolean} [options.usingOperation] Flag indicated whether the marker should be added by MarkerOperation.
  32770. * See {@link module:engine/model/markercollection~Marker#managedUsingOperations}.
  32771. * @param {Boolean} [options.affectsData] Flag indicating that the marker changes the editor data.
  32772. */
  32773. updateMarker( markerOrName, options ) {
  32774. this._assertWriterUsedCorrectly();
  32775. const markerName = typeof markerOrName == 'string' ? markerOrName : markerOrName.name;
  32776. const currentMarker = this.model.markers.get( markerName );
  32777. if ( !currentMarker ) {
  32778. /**
  32779. * Marker with provided name does not exists.
  32780. *
  32781. * @error writer-updatemarker-marker-not-exists
  32782. */
  32783. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-updatemarker-marker-not-exists', this );
  32784. }
  32785. if ( !options ) {
  32786. this.model.markers._refresh( currentMarker );
  32787. return;
  32788. }
  32789. const hasUsingOperationDefined = typeof options.usingOperation == 'boolean';
  32790. const affectsDataDefined = typeof options.affectsData == 'boolean';
  32791. // Use previously defined marker's affectsData if the property is not provided.
  32792. const affectsData = affectsDataDefined ? options.affectsData : currentMarker.affectsData;
  32793. if ( !hasUsingOperationDefined && !options.range && !affectsDataDefined ) {
  32794. /**
  32795. * One of the options is required - provide range, usingOperations or affectsData.
  32796. *
  32797. * @error writer-updatemarker-wrong-options
  32798. */
  32799. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-updatemarker-wrong-options', this );
  32800. }
  32801. const currentRange = currentMarker.getRange();
  32802. const updatedRange = options.range ? options.range : currentRange;
  32803. if ( hasUsingOperationDefined && options.usingOperation !== currentMarker.managedUsingOperations ) {
  32804. // The marker type is changed so it's necessary to create proper operations.
  32805. if ( options.usingOperation ) {
  32806. // If marker changes to a managed one treat this as synchronizing existing marker.
  32807. // Create `MarkerOperation` with `oldRange` set to `null`, so reverse operation will remove the marker.
  32808. applyMarkerOperation( this, markerName, null, updatedRange, affectsData );
  32809. } else {
  32810. // If marker changes to a marker that do not use operations then we need to create additional operation
  32811. // that removes that marker first.
  32812. applyMarkerOperation( this, markerName, currentRange, null, affectsData );
  32813. // Although not managed the marker itself should stay in model and its range should be preserver or changed to passed range.
  32814. this.model.markers._set( markerName, updatedRange, undefined, affectsData );
  32815. }
  32816. return;
  32817. }
  32818. // Marker's type doesn't change so update it accordingly.
  32819. if ( currentMarker.managedUsingOperations ) {
  32820. applyMarkerOperation( this, markerName, currentRange, updatedRange, affectsData );
  32821. } else {
  32822. this.model.markers._set( markerName, updatedRange, undefined, affectsData );
  32823. }
  32824. }
  32825. /**
  32826. * Removes given {@link module:engine/model/markercollection~Marker marker} or marker with given name.
  32827. * The marker is removed accordingly to how it has been created, so if the marker was created using operation,
  32828. * it will be destroyed using operation.
  32829. *
  32830. * @param {module:engine/model/markercollection~Marker|String} markerOrName Marker or marker name to remove.
  32831. */
  32832. removeMarker( markerOrName ) {
  32833. this._assertWriterUsedCorrectly();
  32834. const name = typeof markerOrName == 'string' ? markerOrName : markerOrName.name;
  32835. if ( !this.model.markers.has( name ) ) {
  32836. /**
  32837. * Trying to remove marker which does not exist.
  32838. *
  32839. * @error writer-removemarker-no-marker
  32840. */
  32841. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-removemarker-no-marker', this );
  32842. }
  32843. const marker = this.model.markers.get( name );
  32844. if ( !marker.managedUsingOperations ) {
  32845. this.model.markers._remove( name );
  32846. return;
  32847. }
  32848. const oldRange = marker.getRange();
  32849. applyMarkerOperation( this, name, oldRange, null, marker.affectsData );
  32850. }
  32851. /**
  32852. * Sets the document's selection (ranges and direction) to the specified location based on the given
  32853. * {@link module:engine/model/selection~Selectable selectable} or creates an empty selection if no arguments were passed.
  32854. *
  32855. * // Sets selection to the given range.
  32856. * const range = writer.createRange( start, end );
  32857. * writer.setSelection( range );
  32858. *
  32859. * // Sets selection to given ranges.
  32860. * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];
  32861. * writer.setSelection( ranges );
  32862. *
  32863. * // Sets selection to other selection.
  32864. * const otherSelection = writer.createSelection();
  32865. * writer.setSelection( otherSelection );
  32866. *
  32867. * // Sets selection to the given document selection.
  32868. * const documentSelection = model.document.selection;
  32869. * writer.setSelection( documentSelection );
  32870. *
  32871. * // Sets collapsed selection at the given position.
  32872. * const position = writer.createPosition( root, path );
  32873. * writer.setSelection( position );
  32874. *
  32875. * // Sets collapsed selection at the position of the given node and an offset.
  32876. * writer.setSelection( paragraph, offset );
  32877. *
  32878. * Creates a range inside an {@link module:engine/model/element~Element element} which starts before the first child of
  32879. * that element and ends after the last child of that element.
  32880. *
  32881. * writer.setSelection( paragraph, 'in' );
  32882. *
  32883. * Creates a range on an {@link module:engine/model/item~Item item} which starts before the item and ends just after the item.
  32884. *
  32885. * writer.setSelection( paragraph, 'on' );
  32886. *
  32887. * // Removes all selection's ranges.
  32888. * writer.setSelection( null );
  32889. *
  32890. * `Writer#setSelection()` allow passing additional options (`backward`) as the last argument.
  32891. *
  32892. * // Sets selection as backward.
  32893. * writer.setSelection( range, { backward: true } );
  32894. *
  32895. * Throws `writer-incorrect-use` error when the writer is used outside the `change()` block.
  32896. *
  32897. * @param {module:engine/model/selection~Selectable} selectable
  32898. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
  32899. * @param {Object} [options]
  32900. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  32901. */
  32902. setSelection( selectable, placeOrOffset, options ) {
  32903. this._assertWriterUsedCorrectly();
  32904. this.model.document.selection._setTo( selectable, placeOrOffset, options );
  32905. }
  32906. /**
  32907. * Moves {@link module:engine/model/documentselection~DocumentSelection#focus} to the specified location.
  32908. *
  32909. * The location can be specified in the same form as
  32910. * {@link #createPositionAt `writer.createPositionAt()`} parameters.
  32911. *
  32912. * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition
  32913. * @param {Number|'end'|'before'|'after'} [offset=0] Offset or one of the flags. Used only when
  32914. * first parameter is a {@link module:engine/model/item~Item model item}.
  32915. */
  32916. setSelectionFocus( itemOrPosition, offset ) {
  32917. this._assertWriterUsedCorrectly();
  32918. this.model.document.selection._setFocus( itemOrPosition, offset );
  32919. }
  32920. /**
  32921. * Sets attribute(s) on the selection. If attribute with the same key already is set, it's value is overwritten.
  32922. *
  32923. * Using key and value pair:
  32924. *
  32925. * writer.setSelectionAttribute( 'italic', true );
  32926. *
  32927. * Using key-value object:
  32928. *
  32929. * writer.setSelectionAttribute( { italic: true, bold: false } );
  32930. *
  32931. * Using iterable object:
  32932. *
  32933. * writer.setSelectionAttribute( new Map( [ [ 'italic', true ] ] ) );
  32934. *
  32935. * @param {String|Object|Iterable.<*>} keyOrObjectOrIterable Key of the attribute to set
  32936. * or object / iterable of key => value attribute pairs.
  32937. * @param {*} [value] Attribute value.
  32938. */
  32939. setSelectionAttribute( keyOrObjectOrIterable, value ) {
  32940. this._assertWriterUsedCorrectly();
  32941. if ( typeof keyOrObjectOrIterable === 'string' ) {
  32942. this._setSelectionAttribute( keyOrObjectOrIterable, value );
  32943. } else {
  32944. for ( const [ key, value ] of Object(_ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_16__["default"])( keyOrObjectOrIterable ) ) {
  32945. this._setSelectionAttribute( key, value );
  32946. }
  32947. }
  32948. }
  32949. /**
  32950. * Removes attribute(s) with given key(s) from the selection.
  32951. *
  32952. * Remove one attribute:
  32953. *
  32954. * writer.removeSelectionAttribute( 'italic' );
  32955. *
  32956. * Remove multiple attributes:
  32957. *
  32958. * writer.removeSelectionAttribute( [ 'italic', 'bold' ] );
  32959. *
  32960. * @param {String|Iterable.<String>} keyOrIterableOfKeys Key of the attribute to remove or an iterable of attribute keys to remove.
  32961. */
  32962. removeSelectionAttribute( keyOrIterableOfKeys ) {
  32963. this._assertWriterUsedCorrectly();
  32964. if ( typeof keyOrIterableOfKeys === 'string' ) {
  32965. this._removeSelectionAttribute( keyOrIterableOfKeys );
  32966. } else {
  32967. for ( const key of keyOrIterableOfKeys ) {
  32968. this._removeSelectionAttribute( key );
  32969. }
  32970. }
  32971. }
  32972. /**
  32973. * Temporarily changes the {@link module:engine/model/documentselection~DocumentSelection#isGravityOverridden gravity}
  32974. * of the selection from left to right.
  32975. *
  32976. * The gravity defines from which direction the selection inherits its attributes. If it's the default left gravity,
  32977. * then the selection (after being moved by the user) inherits attributes from its left-hand side.
  32978. * This method allows to temporarily override this behavior by forcing the gravity to the right.
  32979. *
  32980. * For the following model fragment:
  32981. *
  32982. * <$text bold="true" linkHref="url">bar[]</$text><$text bold="true">biz</$text>
  32983. *
  32984. * * Default gravity: selection will have the `bold` and `linkHref` attributes.
  32985. * * Overridden gravity: selection will have `bold` attribute.
  32986. *
  32987. * **Note**: It returns an unique identifier which is required to restore the gravity. It guarantees the symmetry
  32988. * of the process.
  32989. *
  32990. * @returns {String} The unique id which allows restoring the gravity.
  32991. */
  32992. overrideSelectionGravity() {
  32993. return this.model.document.selection._overrideGravity();
  32994. }
  32995. /**
  32996. * Restores {@link ~Writer#overrideSelectionGravity} gravity to default.
  32997. *
  32998. * Restoring the gravity is only possible using the unique identifier returned by
  32999. * {@link ~Writer#overrideSelectionGravity}. Note that the gravity remains overridden as long as won't be restored
  33000. * the same number of times it was overridden.
  33001. *
  33002. * @param {String} uid The unique id returned by {@link ~Writer#overrideSelectionGravity}.
  33003. */
  33004. restoreSelectionGravity( uid ) {
  33005. this.model.document.selection._restoreGravity( uid );
  33006. }
  33007. /**
  33008. * @private
  33009. * @param {String} key Key of the attribute to remove.
  33010. * @param {*} value Attribute value.
  33011. */
  33012. _setSelectionAttribute( key, value ) {
  33013. const selection = this.model.document.selection;
  33014. // Store attribute in parent element if the selection is collapsed in an empty node.
  33015. if ( selection.isCollapsed && selection.anchor.parent.isEmpty ) {
  33016. const storeKey = _documentselection__WEBPACK_IMPORTED_MODULE_15__["default"]._getStoreAttributeKey( key );
  33017. this.setAttribute( storeKey, value, selection.anchor.parent );
  33018. }
  33019. selection._setAttribute( key, value );
  33020. }
  33021. /**
  33022. * @private
  33023. * @param {String} key Key of the attribute to remove.
  33024. */
  33025. _removeSelectionAttribute( key ) {
  33026. const selection = this.model.document.selection;
  33027. // Remove stored attribute from parent element if the selection is collapsed in an empty node.
  33028. if ( selection.isCollapsed && selection.anchor.parent.isEmpty ) {
  33029. const storeKey = _documentselection__WEBPACK_IMPORTED_MODULE_15__["default"]._getStoreAttributeKey( key );
  33030. this.removeAttribute( storeKey, selection.anchor.parent );
  33031. }
  33032. selection._removeAttribute( key );
  33033. }
  33034. /**
  33035. * Throws `writer-detached-writer-tries-to-modify-model` error when the writer is used outside of the `change()` block.
  33036. *
  33037. * @private
  33038. */
  33039. _assertWriterUsedCorrectly() {
  33040. /**
  33041. * Trying to use a writer outside a {@link module:engine/model/model~Model#change `change()`} or
  33042. * {@link module:engine/model/model~Model#enqueueChange `enqueueChange()`} blocks.
  33043. *
  33044. * The writer can only be used inside these blocks which ensures that the model
  33045. * can only be changed during such "sessions".
  33046. *
  33047. * @error writer-incorrect-use
  33048. */
  33049. if ( this.model._currentWriter !== this ) {
  33050. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_17__["default"]( 'writer-incorrect-use', this );
  33051. }
  33052. }
  33053. /**
  33054. * For given action `type` and `positionOrRange` where the action happens, this function finds all affected markers
  33055. * and applies a marker operation with the new marker range equal to the current range. Thanks to this, the marker range
  33056. * can be later correctly processed during undo.
  33057. *
  33058. * @private
  33059. * @param {'move'|'merge'} type Writer action type.
  33060. * @param {module:engine/model/position~Position|module:engine/model/range~Range} positionOrRange Position or range
  33061. * where the writer action happens.
  33062. */
  33063. _addOperationForAffectedMarkers( type, positionOrRange ) {
  33064. for ( const marker of this.model.markers ) {
  33065. if ( !marker.managedUsingOperations ) {
  33066. continue;
  33067. }
  33068. const markerRange = marker.getRange();
  33069. let isAffected = false;
  33070. if ( type === 'move' ) {
  33071. isAffected =
  33072. positionOrRange.containsPosition( markerRange.start ) ||
  33073. positionOrRange.start.isEqual( markerRange.start ) ||
  33074. positionOrRange.containsPosition( markerRange.end ) ||
  33075. positionOrRange.end.isEqual( markerRange.end );
  33076. } else {
  33077. // if type === 'merge'.
  33078. const elementBefore = positionOrRange.nodeBefore;
  33079. const elementAfter = positionOrRange.nodeAfter;
  33080. // Start: <p>Foo[</p><p>Bar]</p>
  33081. // After merge: <p>Foo[Bar]</p>
  33082. // After undoing split: <p>Foo</p><p>[Bar]</p> <-- incorrect, needs remembering for undo.
  33083. //
  33084. const affectedInLeftElement = markerRange.start.parent == elementBefore && markerRange.start.isAtEnd;
  33085. // Start: <p>[Foo</p><p>]Bar</p>
  33086. // After merge: <p>[Foo]Bar</p>
  33087. // After undoing split: <p>[Foo]</p><p>Bar</p> <-- incorrect, needs remembering for undo.
  33088. //
  33089. const affectedInRightElement = markerRange.end.parent == elementAfter && markerRange.end.offset == 0;
  33090. // Start: <p>[Foo</p>]<p>Bar</p>
  33091. // After merge: <p>[Foo]Bar</p>
  33092. // After undoing split: <p>[Foo]</p><p>Bar</p> <-- incorrect, needs remembering for undo.
  33093. //
  33094. const affectedAfterLeftElement = markerRange.end.nodeAfter == elementAfter;
  33095. // Start: <p>Foo</p>[<p>Bar]</p>
  33096. // After merge: <p>Foo[Bar]</p>
  33097. // After undoing split: <p>Foo</p><p>[Bar]</p> <-- incorrect, needs remembering for undo.
  33098. //
  33099. const affectedBeforeRightElement = markerRange.start.nodeAfter == elementAfter;
  33100. isAffected = affectedInLeftElement || affectedInRightElement || affectedAfterLeftElement || affectedBeforeRightElement;
  33101. }
  33102. if ( isAffected ) {
  33103. this.updateMarker( marker.name, { range: markerRange } );
  33104. }
  33105. }
  33106. }
  33107. }
  33108. // Sets given attribute to each node in given range. When attribute value is null then attribute will be removed.
  33109. //
  33110. // Because attribute operation needs to have the same attribute value on the whole range, this function splits
  33111. // the range into smaller parts.
  33112. //
  33113. // Given `range` must be flat.
  33114. //
  33115. // @private
  33116. // @param {module:engine/model/writer~Writer} writer
  33117. // @param {String} key Attribute key.
  33118. // @param {*} value Attribute new value.
  33119. // @param {module:engine/model/range~Range} range Model range on which the attribute will be set.
  33120. function setAttributeOnRange( writer, key, value, range ) {
  33121. const model = writer.model;
  33122. const doc = model.document;
  33123. // Position of the last split, the beginning of the new range.
  33124. let lastSplitPosition = range.start;
  33125. // Currently position in the scanning range. Because we need value after the position, it is not a current
  33126. // position of the iterator but the previous one (we need to iterate one more time to get the value after).
  33127. let position;
  33128. // Value before the currently position.
  33129. let valueBefore;
  33130. // Value after the currently position.
  33131. let valueAfter;
  33132. for ( const val of range.getWalker( { shallow: true } ) ) {
  33133. valueAfter = val.item.getAttribute( key );
  33134. // At the first run of the iterator the position in undefined. We also do not have a valueBefore, but
  33135. // because valueAfter may be null, valueBefore may be equal valueAfter ( undefined == null ).
  33136. if ( position && valueBefore != valueAfter ) {
  33137. // if valueBefore == value there is nothing to change, so we add operation only if these values are different.
  33138. if ( valueBefore != value ) {
  33139. addOperation();
  33140. }
  33141. lastSplitPosition = position;
  33142. }
  33143. position = val.nextPosition;
  33144. valueBefore = valueAfter;
  33145. }
  33146. // Because position in the loop is not the iterator position (see let position comment), the last position in
  33147. // the while loop will be last but one position in the range. We need to check the last position manually.
  33148. if ( position instanceof _position__WEBPACK_IMPORTED_MODULE_13__["default"] && position != lastSplitPosition && valueBefore != value ) {
  33149. addOperation();
  33150. }
  33151. function addOperation() {
  33152. const range = new _range_js__WEBPACK_IMPORTED_MODULE_14__["default"]( lastSplitPosition, position );
  33153. const version = range.root.document ? doc.version : null;
  33154. const operation = new _operation_attributeoperation__WEBPACK_IMPORTED_MODULE_0__["default"]( range, key, valueBefore, value, version );
  33155. writer.batch.addOperation( operation );
  33156. model.applyOperation( operation );
  33157. }
  33158. }
  33159. // Sets given attribute to the given node. When attribute value is null then attribute will be removed.
  33160. //
  33161. // @private
  33162. // @param {module:engine/model/writer~Writer} writer
  33163. // @param {String} key Attribute key.
  33164. // @param {*} value Attribute new value.
  33165. // @param {module:engine/model/item~Item} item Model item on which the attribute will be set.
  33166. function setAttributeOnItem( writer, key, value, item ) {
  33167. const model = writer.model;
  33168. const doc = model.document;
  33169. const previousValue = item.getAttribute( key );
  33170. let range, operation;
  33171. if ( previousValue != value ) {
  33172. const isRootChanged = item.root === item;
  33173. if ( isRootChanged ) {
  33174. // If we change attributes of root element, we have to use `RootAttributeOperation`.
  33175. const version = item.document ? doc.version : null;
  33176. operation = new _operation_rootattributeoperation__WEBPACK_IMPORTED_MODULE_6__["default"]( item, key, previousValue, value, version );
  33177. } else {
  33178. range = new _range_js__WEBPACK_IMPORTED_MODULE_14__["default"]( _position__WEBPACK_IMPORTED_MODULE_13__["default"]._createBefore( item ), writer.createPositionAfter( item ) );
  33179. const version = range.root.document ? doc.version : null;
  33180. operation = new _operation_attributeoperation__WEBPACK_IMPORTED_MODULE_0__["default"]( range, key, previousValue, value, version );
  33181. }
  33182. writer.batch.addOperation( operation );
  33183. model.applyOperation( operation );
  33184. }
  33185. }
  33186. // Creates and applies marker operation to {@link module:engine/model/operation/operation~Operation operation}.
  33187. //
  33188. // @private
  33189. // @param {module:engine/model/writer~Writer} writer
  33190. // @param {String} name Marker name.
  33191. // @param {module:engine/model/range~Range} oldRange Marker range before the change.
  33192. // @param {module:engine/model/range~Range} newRange Marker range after the change.
  33193. // @param {Boolean} affectsData
  33194. function applyMarkerOperation( writer, name, oldRange, newRange, affectsData ) {
  33195. const model = writer.model;
  33196. const doc = model.document;
  33197. const operation = new _operation_markeroperation__WEBPACK_IMPORTED_MODULE_3__["default"]( name, oldRange, newRange, model.markers, affectsData, doc.version );
  33198. writer.batch.addOperation( operation );
  33199. model.applyOperation( operation );
  33200. }
  33201. // Creates `MoveOperation` or `DetachOperation` that removes `howMany` nodes starting from `position`.
  33202. // The operation will be applied on given model instance and added to given operation instance.
  33203. //
  33204. // @private
  33205. // @param {module:engine/model/position~Position} position Position from which nodes are removed.
  33206. // @param {Number} howMany Number of nodes to remove.
  33207. // @param {Batch} batch Batch to which the operation will be added.
  33208. // @param {module:engine/model/model~Model} model Model instance on which operation will be applied.
  33209. function applyRemoveOperation( position, howMany, batch, model ) {
  33210. let operation;
  33211. if ( position.root.document ) {
  33212. const doc = model.document;
  33213. const graveyardPosition = new _position__WEBPACK_IMPORTED_MODULE_13__["default"]( doc.graveyard, [ 0 ] );
  33214. operation = new _operation_moveoperation__WEBPACK_IMPORTED_MODULE_4__["default"]( position, howMany, graveyardPosition, doc.version );
  33215. } else {
  33216. operation = new _operation_detachoperation__WEBPACK_IMPORTED_MODULE_1__["default"]( position, howMany );
  33217. }
  33218. batch.addOperation( operation );
  33219. model.applyOperation( operation );
  33220. }
  33221. // Returns `true` if both root elements are the same element or both are documents root elements.
  33222. //
  33223. // Elements in the same tree can be moved (for instance you can move element form one documents root to another, or
  33224. // within the same document fragment), but when element supposed to be moved from document fragment to the document, or
  33225. // to another document it should be removed and inserted to avoid problems with OT. This is because features like undo or
  33226. // collaboration may track changes on the document but ignore changes on detached fragments and should not get
  33227. // unexpected `move` operation.
  33228. function isSameTree( rootA, rootB ) {
  33229. // If it is the same root this is the same tree.
  33230. if ( rootA === rootB ) {
  33231. return true;
  33232. }
  33233. // If both roots are documents root it is operation within the document what we still treat as the same tree.
  33234. if ( rootA instanceof _rootelement__WEBPACK_IMPORTED_MODULE_12__["default"] && rootB instanceof _rootelement__WEBPACK_IMPORTED_MODULE_12__["default"] ) {
  33235. return true;
  33236. }
  33237. return false;
  33238. }
  33239. /***/ }),
  33240. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/attributeelement.js":
  33241. /*!******************************************************************************!*\
  33242. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/attributeelement.js ***!
  33243. \******************************************************************************/
  33244. /*! exports provided: default */
  33245. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  33246. "use strict";
  33247. __webpack_require__.r(__webpack_exports__);
  33248. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AttributeElement; });
  33249. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js");
  33250. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  33251. /**
  33252. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  33253. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  33254. */
  33255. /**
  33256. * @module engine/view/attributeelement
  33257. */
  33258. // Default attribute priority.
  33259. const DEFAULT_PRIORITY = 10;
  33260. /**
  33261. * Attribute elements are used to represent formatting elements in the view (think – `<b>`, `<span style="font-size: 2em">`, etc.).
  33262. * Most often they are created when downcasting model text attributes.
  33263. *
  33264. * Editing engine does not define a fixed HTML DTD. This is why a feature developer needs to choose between various
  33265. * types (container element, {@link module:engine/view/attributeelement~AttributeElement attribute element},
  33266. * {@link module:engine/view/emptyelement~EmptyElement empty element}, etc) when developing a feature.
  33267. *
  33268. * To create a new attribute element instance use the
  33269. * {@link module:engine/view/downcastwriter~DowncastWriter#createAttributeElement `DowncastWriter#createAttributeElement()`} method.
  33270. *
  33271. * @extends module:engine/view/element~Element
  33272. */
  33273. class AttributeElement extends _element__WEBPACK_IMPORTED_MODULE_0__["default"] {
  33274. /**
  33275. * Creates an attribute element.
  33276. *
  33277. * @see module:engine/view/downcastwriter~DowncastWriter#createAttributeElement
  33278. * @see module:engine/view/element~Element
  33279. * @protected
  33280. * @param {module:engine/view/document~Document} document The document instance to which this element belongs.
  33281. * @param {String} name Node name.
  33282. * @param {Object|Iterable} [attrs] Collection of attributes.
  33283. * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
  33284. * A list of nodes to be inserted into created element.
  33285. */
  33286. constructor( document, name, attrs, children ) {
  33287. super( document, name, attrs, children );
  33288. /**
  33289. * Returns block {@link module:engine/view/filler filler} offset or `null` if block filler is not needed.
  33290. *
  33291. * @method #getFillerOffset
  33292. * @returns {Number|null} Block filler offset or `null` if block filler is not needed.
  33293. */
  33294. this.getFillerOffset = getFillerOffset;
  33295. /**
  33296. * Element priority. Decides in what order elements are wrapped by {@link module:engine/view/downcastwriter~DowncastWriter}.
  33297. *
  33298. * @protected
  33299. * @member {Number}
  33300. */
  33301. this._priority = DEFAULT_PRIORITY;
  33302. /**
  33303. * Element identifier. If set, it is used by {@link module:engine/view/element~Element#isSimilar},
  33304. * and then two elements are considered similar if, and only if they have the same `_id`.
  33305. *
  33306. * @protected
  33307. * @member {String|Number}
  33308. */
  33309. this._id = null;
  33310. /**
  33311. * Keeps all the attribute elements that have the same {@link module:engine/view/attributeelement~AttributeElement#id ids}
  33312. * and still exist in the view tree.
  33313. *
  33314. * This property is managed by {@link module:engine/view/downcastwriter~DowncastWriter}.
  33315. *
  33316. * @protected
  33317. * @member {Set.<module:engine/view/attributeelement~AttributeElement>|null}
  33318. */
  33319. this._clonesGroup = null;
  33320. }
  33321. /**
  33322. * Element priority. Decides in what order elements are wrapped by {@link module:engine/view/downcastwriter~DowncastWriter}.
  33323. *
  33324. * @readonly
  33325. * @type {Number}
  33326. */
  33327. get priority() {
  33328. return this._priority;
  33329. }
  33330. /**
  33331. * Element identifier. If set, it is used by {@link module:engine/view/element~Element#isSimilar},
  33332. * and then two elements are considered similar if, and only if they have the same `id`.
  33333. *
  33334. * @readonly
  33335. * @type {String|Number}
  33336. */
  33337. get id() {
  33338. return this._id;
  33339. }
  33340. /**
  33341. * Returns all {@link module:engine/view/attributeelement~AttributeElement attribute elements} that has the
  33342. * same {@link module:engine/view/attributeelement~AttributeElement#id id} and are in the view tree (were not removed).
  33343. *
  33344. * Note: If this element has been removed from the tree, returned set will not include it.
  33345. *
  33346. * Throws {@link module:utils/ckeditorerror~CKEditorError attribute-element-get-elements-with-same-id-no-id}
  33347. * if this element has no `id`.
  33348. *
  33349. * @returns {Set.<module:engine/view/attributeelement~AttributeElement>} Set containing all the attribute elements
  33350. * with the same `id` that were added and not removed from the view tree.
  33351. */
  33352. getElementsWithSameId() {
  33353. if ( this.id === null ) {
  33354. /**
  33355. * Cannot get elements with the same id for an attribute element without id.
  33356. *
  33357. * @error attribute-element-get-elements-with-same-id-no-id
  33358. */
  33359. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
  33360. 'attribute-element-get-elements-with-same-id-no-id',
  33361. this
  33362. );
  33363. }
  33364. return new Set( this._clonesGroup );
  33365. }
  33366. /**
  33367. * Checks whether this object is of the given.
  33368. *
  33369. * attributeElement.is( 'attributeElement' ); // -> true
  33370. * attributeElement.is( 'element' ); // -> true
  33371. * attributeElement.is( 'node' ); // -> true
  33372. * attributeElement.is( 'view:attributeElement' ); // -> true
  33373. * attributeElement.is( 'view:element' ); // -> true
  33374. * attributeElement.is( 'view:node' ); // -> true
  33375. *
  33376. * attributeElement.is( 'model:element' ); // -> false
  33377. * attributeElement.is( 'documentFragment' ); // -> false
  33378. *
  33379. * Assuming that the object being checked is an attribute element, you can also check its
  33380. * {@link module:engine/view/attributeelement~AttributeElement#name name}:
  33381. *
  33382. * attributeElement.is( 'element', 'b' ); // -> true if this is a bold element
  33383. * attributeElement.is( 'attributeElement', 'b' ); // -> same as above
  33384. * text.is( 'element', 'b' ); -> false
  33385. *
  33386. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  33387. *
  33388. * @param {String} type Type to check.
  33389. * @param {String} [name] Element name.
  33390. * @returns {Boolean}
  33391. */
  33392. is( type, name = null ) {
  33393. if ( !name ) {
  33394. return type === 'attributeElement' || type === 'view:attributeElement' ||
  33395. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  33396. type === 'element' || type === 'view:element' ||
  33397. type === 'node' || type === 'view:node';
  33398. } else {
  33399. return name === this.name && (
  33400. type === 'attributeElement' || type === 'view:attributeElement' ||
  33401. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  33402. type === 'element' || type === 'view:element'
  33403. );
  33404. }
  33405. }
  33406. /**
  33407. * Checks if this element is similar to other element.
  33408. *
  33409. * If none of elements has set {@link module:engine/view/attributeelement~AttributeElement#id}, then both elements
  33410. * should have the same name, attributes and priority to be considered as similar. Two similar elements can contain
  33411. * different set of children nodes.
  33412. *
  33413. * If at least one element has {@link module:engine/view/attributeelement~AttributeElement#id} set, then both
  33414. * elements have to have the same {@link module:engine/view/attributeelement~AttributeElement#id} value to be
  33415. * considered similar.
  33416. *
  33417. * Similarity is important for {@link module:engine/view/downcastwriter~DowncastWriter}. For example:
  33418. *
  33419. * * two following similar elements can be merged together into one, longer element,
  33420. * * {@link module:engine/view/downcastwriter~DowncastWriter#unwrap} checks similarity of passed element and processed element to
  33421. * decide whether processed element should be unwrapped,
  33422. * * etc.
  33423. *
  33424. * @param {module:engine/view/element~Element} otherElement
  33425. * @returns {Boolean}
  33426. */
  33427. isSimilar( otherElement ) {
  33428. // If any element has an `id` set, just compare the ids.
  33429. if ( this.id !== null || otherElement.id !== null ) {
  33430. return this.id === otherElement.id;
  33431. }
  33432. return super.isSimilar( otherElement ) && this.priority == otherElement.priority;
  33433. }
  33434. /**
  33435. * Clones provided element with priority.
  33436. *
  33437. * @protected
  33438. * @param {Boolean} deep If set to `true` clones element and all its children recursively. When set to `false`,
  33439. * element will be cloned without any children.
  33440. * @returns {module:engine/view/attributeelement~AttributeElement} Clone of this element.
  33441. */
  33442. _clone( deep ) {
  33443. const cloned = super._clone( deep );
  33444. // Clone priority too.
  33445. cloned._priority = this._priority;
  33446. // And id too.
  33447. cloned._id = this._id;
  33448. return cloned;
  33449. }
  33450. }
  33451. /**
  33452. * Default attribute priority.
  33453. *
  33454. * @member {Number} module:engine/view/attributeelement~AttributeElement.DEFAULT_PRIORITY
  33455. */
  33456. AttributeElement.DEFAULT_PRIORITY = DEFAULT_PRIORITY;
  33457. // Returns block {@link module:engine/view/filler~Filler filler} offset or `null` if block filler is not needed.
  33458. //
  33459. // @returns {Number|null} Block filler offset or `null` if block filler is not needed.
  33460. function getFillerOffset() {
  33461. // <b>foo</b> does not need filler.
  33462. if ( nonUiChildrenCount( this ) ) {
  33463. return null;
  33464. }
  33465. let element = this.parent;
  33466. // <p><b></b></p> needs filler -> <p><b><br></b></p>
  33467. while ( element && element.is( 'attributeElement' ) ) {
  33468. if ( nonUiChildrenCount( element ) > 1 ) {
  33469. return null;
  33470. }
  33471. element = element.parent;
  33472. }
  33473. if ( !element || nonUiChildrenCount( element ) > 1 ) {
  33474. return null;
  33475. }
  33476. // Render block filler at the end of element (after all ui elements).
  33477. return this.childCount;
  33478. }
  33479. // Returns total count of children that are not {@link module:engine/view/uielement~UIElement UIElements}.
  33480. //
  33481. // @param {module:engine/view/element~Element} element
  33482. // @returns {Number}
  33483. function nonUiChildrenCount( element ) {
  33484. return Array.from( element.getChildren() ).filter( element => !element.is( 'uiElement' ) ).length;
  33485. }
  33486. /***/ }),
  33487. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/containerelement.js":
  33488. /*!******************************************************************************!*\
  33489. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/containerelement.js ***!
  33490. \******************************************************************************/
  33491. /*! exports provided: default, getFillerOffset */
  33492. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  33493. "use strict";
  33494. __webpack_require__.r(__webpack_exports__);
  33495. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ContainerElement; });
  33496. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFillerOffset", function() { return getFillerOffset; });
  33497. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js");
  33498. /**
  33499. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  33500. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  33501. */
  33502. /**
  33503. * @module engine/view/containerelement
  33504. */
  33505. /**
  33506. * Containers are elements which define document structure. They define boundaries for
  33507. * {@link module:engine/view/attributeelement~AttributeElement attributes}. They are mostly used for block elements like `<p>` or `<div>`.
  33508. *
  33509. * Editing engine does not define a fixed HTML DTD. This is why a feature developer needs to choose between various
  33510. * types (container element, {@link module:engine/view/attributeelement~AttributeElement attribute element},
  33511. * {@link module:engine/view/emptyelement~EmptyElement empty element}, etc) when developing a feature.
  33512. *
  33513. * The container element should be your default choice when writing a converter, unless:
  33514. *
  33515. * * this element represents a model text attribute (then use {@link module:engine/view/attributeelement~AttributeElement}),
  33516. * * this is an empty element like `<img>` (then use {@link module:engine/view/emptyelement~EmptyElement}),
  33517. * * this is a root element,
  33518. * * this is a nested editable element (then use {@link module:engine/view/editableelement~EditableElement}).
  33519. *
  33520. * To create a new container element instance use the
  33521. * {@link module:engine/view/downcastwriter~DowncastWriter#createContainerElement `DowncastWriter#createContainerElement()`}
  33522. * method.
  33523. *
  33524. * @extends module:engine/view/element~Element
  33525. */
  33526. class ContainerElement extends _element__WEBPACK_IMPORTED_MODULE_0__["default"] {
  33527. /**
  33528. * Creates a container element.
  33529. *
  33530. * @see module:engine/view/downcastwriter~DowncastWriter#createContainerElement
  33531. * @see module:engine/view/element~Element
  33532. * @protected
  33533. * @param {module:engine/view/document~Document} document The document instance to which this element belongs.
  33534. * @param {String} name Node name.
  33535. * @param {Object|Iterable} [attrs] Collection of attributes.
  33536. * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
  33537. * A list of nodes to be inserted into created element.
  33538. */
  33539. constructor( document, name, attrs, children ) {
  33540. super( document, name, attrs, children );
  33541. /**
  33542. * Returns block {@link module:engine/view/filler filler} offset or `null` if block filler is not needed.
  33543. *
  33544. * @method #getFillerOffset
  33545. * @returns {Number|null} Block filler offset or `null` if block filler is not needed.
  33546. */
  33547. this.getFillerOffset = getFillerOffset;
  33548. }
  33549. /**
  33550. * Checks whether this object is of the given.
  33551. *
  33552. * containerElement.is( 'containerElement' ); // -> true
  33553. * containerElement.is( 'element' ); // -> true
  33554. * containerElement.is( 'node' ); // -> true
  33555. * containerElement.is( 'view:containerElement' ); // -> true
  33556. * containerElement.is( 'view:element' ); // -> true
  33557. * containerElement.is( 'view:node' ); // -> true
  33558. *
  33559. * containerElement.is( 'model:element' ); // -> false
  33560. * containerElement.is( 'documentFragment' ); // -> false
  33561. *
  33562. * Assuming that the object being checked is a container element, you can also check its
  33563. * {@link module:engine/view/containerelement~ContainerElement#name name}:
  33564. *
  33565. * containerElement.is( 'element', 'div' ); // -> true if this is a div container element
  33566. * containerElement.is( 'contaienrElement', 'div' ); // -> same as above
  33567. * text.is( 'element', 'div' ); -> false
  33568. *
  33569. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  33570. *
  33571. * @param {String} type Type to check.
  33572. * @param {String} [name] Element name.
  33573. * @returns {Boolean}
  33574. */
  33575. is( type, name = null ) {
  33576. if ( !name ) {
  33577. return type === 'containerElement' || type === 'view:containerElement' ||
  33578. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  33579. type === 'element' || type === 'view:element' ||
  33580. type === 'node' || type === 'view:node';
  33581. } else {
  33582. return name === this.name && (
  33583. type === 'containerElement' || type === 'view:containerElement' ||
  33584. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  33585. type === 'element' || type === 'view:element'
  33586. );
  33587. }
  33588. }
  33589. }
  33590. /**
  33591. * Returns block {@link module:engine/view/filler filler} offset or `null` if block filler is not needed.
  33592. *
  33593. * @returns {Number|null} Block filler offset or `null` if block filler is not needed.
  33594. */
  33595. function getFillerOffset() {
  33596. const children = [ ...this.getChildren() ];
  33597. const lastChild = children[ this.childCount - 1 ];
  33598. // Block filler is required after a `<br>` if it's the last element in its container. See #1422.
  33599. if ( lastChild && lastChild.is( 'element', 'br' ) ) {
  33600. return this.childCount;
  33601. }
  33602. for ( const child of children ) {
  33603. // If there's any non-UI element – don't render the bogus.
  33604. if ( !child.is( 'uiElement' ) ) {
  33605. return null;
  33606. }
  33607. }
  33608. // If there are only UI elements – render the bogus at the end of the element.
  33609. return this.childCount;
  33610. }
  33611. /***/ }),
  33612. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/document.js":
  33613. /*!**********************************************************************!*\
  33614. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/document.js ***!
  33615. \**********************************************************************/
  33616. /*! exports provided: default */
  33617. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  33618. "use strict";
  33619. __webpack_require__.r(__webpack_exports__);
  33620. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Document; });
  33621. /* harmony import */ var _documentselection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./documentselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/documentselection.js");
  33622. /* harmony import */ var _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/collection */ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js");
  33623. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  33624. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  33625. /**
  33626. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  33627. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  33628. */
  33629. /**
  33630. * @module engine/view/document
  33631. */
  33632. // @if CK_DEBUG_ENGINE // const { logDocument } = require( '../dev-utils/utils' );
  33633. /**
  33634. * Document class creates an abstract layer over the content editable area, contains a tree of view elements and
  33635. * {@link module:engine/view/documentselection~DocumentSelection view selection} associated with this document.
  33636. *
  33637. * @mixes module:utils/observablemixin~ObservableMixin
  33638. */
  33639. class Document {
  33640. /**
  33641. * Creates a Document instance.
  33642. *
  33643. * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor The styles processor instance.
  33644. */
  33645. constructor( stylesProcessor ) {
  33646. /**
  33647. * Selection done on this document.
  33648. *
  33649. * @readonly
  33650. * @member {module:engine/view/documentselection~DocumentSelection} module:engine/view/document~Document#selection
  33651. */
  33652. this.selection = new _documentselection__WEBPACK_IMPORTED_MODULE_0__["default"]();
  33653. /**
  33654. * Roots of the view tree. Collection of the {@link module:engine/view/element~Element view elements}.
  33655. *
  33656. * View roots are created as a result of binding between {@link module:engine/view/document~Document#roots} and
  33657. * {@link module:engine/model/document~Document#roots} and this is handled by
  33658. * {@link module:engine/controller/editingcontroller~EditingController}, so to create view root we need to create
  33659. * model root using {@link module:engine/model/document~Document#createRoot}.
  33660. *
  33661. * @readonly
  33662. * @member {module:utils/collection~Collection} module:engine/view/document~Document#roots
  33663. */
  33664. this.roots = new _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_1__["default"]( { idProperty: 'rootName' } );
  33665. /**
  33666. * The styles processor instance used by this document when normalizing styles.
  33667. *
  33668. * @readonly
  33669. * @member {module:engine/view/stylesmap~StylesProcessor}
  33670. */
  33671. this.stylesProcessor = stylesProcessor;
  33672. /**
  33673. * Defines whether document is in read-only mode.
  33674. *
  33675. * When document is read-ony then all roots are read-only as well and caret placed inside this root is hidden.
  33676. *
  33677. * @observable
  33678. * @member {Boolean} #isReadOnly
  33679. */
  33680. this.set( 'isReadOnly', false );
  33681. /**
  33682. * True if document is focused.
  33683. *
  33684. * This property is updated by the {@link module:engine/view/observer/focusobserver~FocusObserver}.
  33685. * If the {@link module:engine/view/observer/focusobserver~FocusObserver} is disabled this property will not change.
  33686. *
  33687. * @readonly
  33688. * @observable
  33689. * @member {Boolean} module:engine/view/document~Document#isFocused
  33690. */
  33691. this.set( 'isFocused', false );
  33692. /**
  33693. * True if composition is in progress inside the document.
  33694. *
  33695. * This property is updated by the {@link module:engine/view/observer/compositionobserver~CompositionObserver}.
  33696. * If the {@link module:engine/view/observer/compositionobserver~CompositionObserver} is disabled this property will not change.
  33697. *
  33698. * @readonly
  33699. * @observable
  33700. * @member {Boolean} module:engine/view/document~Document#isComposing
  33701. */
  33702. this.set( 'isComposing', false );
  33703. /**
  33704. * Post-fixer callbacks registered to the view document.
  33705. *
  33706. * @private
  33707. * @member {Set}
  33708. */
  33709. this._postFixers = new Set();
  33710. }
  33711. /**
  33712. * Gets a {@link module:engine/view/document~Document#roots view root element} with the specified name. If the name is not
  33713. * specific "main" root is returned.
  33714. *
  33715. * @param {String} [name='main'] Name of the root.
  33716. * @returns {module:engine/view/rooteditableelement~RootEditableElement|null} The view root element with the specified name
  33717. * or null when there is no root of given name.
  33718. */
  33719. getRoot( name = 'main' ) {
  33720. return this.roots.get( name );
  33721. }
  33722. /**
  33723. * Allows registering post-fixer callbacks. A post-fixers mechanism allows to update the view tree just before it is rendered
  33724. * to the DOM.
  33725. *
  33726. * Post-fixers are executed right after all changes from the outermost change block were applied but
  33727. * before the {@link module:engine/view/view~View#event:render render event} is fired. If a post-fixer callback made
  33728. * a change, it should return `true`. When this happens, all post-fixers are fired again to check if something else should
  33729. * not be fixed in the new document tree state.
  33730. *
  33731. * View post-fixers are useful when you want to apply some fixes whenever the view structure changes. Keep in mind that
  33732. * changes executed in a view post-fixer should not break model-view mapping.
  33733. *
  33734. * The types of changes which should be safe:
  33735. *
  33736. * * adding or removing attribute from elements,
  33737. * * changes inside of {@link module:engine/view/uielement~UIElement UI elements},
  33738. * * {@link module:engine/model/differ~Differ#refreshItem marking some of the model elements to be re-converted}.
  33739. *
  33740. * Try to avoid changes which touch view structure:
  33741. *
  33742. * * you should not add or remove nor wrap or unwrap any view elements,
  33743. * * you should not change the editor data model in a view post-fixer.
  33744. *
  33745. * As a parameter, a post-fixer callback receives a {@link module:engine/view/downcastwriter~DowncastWriter downcast writer}.
  33746. *
  33747. * Typically, a post-fixer will look like this:
  33748. *
  33749. * editor.editing.view.document.registerPostFixer( writer => {
  33750. * if ( checkSomeCondition() ) {
  33751. * writer.doSomething();
  33752. *
  33753. * // Let other post-fixers know that something changed.
  33754. * return true;
  33755. * }
  33756. * } );
  33757. *
  33758. * Note that nothing happens right after you register a post-fixer (e.g. execute such a code in the console).
  33759. * That is because adding a post-fixer does not execute it.
  33760. * The post-fixer will be executed as soon as any change in the document needs to cause its rendering.
  33761. * If you want to re-render the editor's view after registering the post-fixer then you should do it manually by calling
  33762. * {@link module:engine/view/view~View#forceRender `view.forceRender()`}.
  33763. *
  33764. * If you need to register a callback which is executed when DOM elements are already updated,
  33765. * use {@link module:engine/view/view~View#event:render render event}.
  33766. *
  33767. * @param {Function} postFixer
  33768. */
  33769. registerPostFixer( postFixer ) {
  33770. this._postFixers.add( postFixer );
  33771. }
  33772. /**
  33773. * Destroys this instance. Makes sure that all observers are destroyed and listeners removed.
  33774. */
  33775. destroy() {
  33776. this.roots.map( root => root.destroy() );
  33777. this.stopListening();
  33778. }
  33779. /**
  33780. * Performs post-fixer loops. Executes post-fixer callbacks as long as none of them has done any changes to the model.
  33781. *
  33782. * @protected
  33783. * @param {module:engine/view/downcastwriter~DowncastWriter} writer
  33784. */
  33785. _callPostFixers( writer ) {
  33786. let wasFixed = false;
  33787. do {
  33788. for ( const callback of this._postFixers ) {
  33789. wasFixed = callback( writer );
  33790. if ( wasFixed ) {
  33791. break;
  33792. }
  33793. }
  33794. } while ( wasFixed );
  33795. }
  33796. /**
  33797. * Event fired whenever document content layout changes. It is fired whenever content is
  33798. * {@link module:engine/view/view~View#event:render rendered}, but should be also fired by observers in case of
  33799. * other actions which may change layout, for instance when image loads.
  33800. *
  33801. * @event layoutChanged
  33802. */
  33803. // @if CK_DEBUG_ENGINE // log( version ) {
  33804. // @if CK_DEBUG_ENGINE // logDocument( this, version );
  33805. // @if CK_DEBUG_ENGINE // }
  33806. }
  33807. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( Document, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_3__["default"] );
  33808. /**
  33809. * Enum representing type of the change.
  33810. *
  33811. * Possible values:
  33812. *
  33813. * * `children` - for child list changes,
  33814. * * `attributes` - for element attributes changes,
  33815. * * `text` - for text nodes changes.
  33816. *
  33817. * @typedef {String} module:engine/view/document~ChangeType
  33818. */
  33819. /***/ }),
  33820. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/documentfragment.js":
  33821. /*!******************************************************************************!*\
  33822. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/documentfragment.js ***!
  33823. \******************************************************************************/
  33824. /*! exports provided: default */
  33825. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  33826. "use strict";
  33827. __webpack_require__.r(__webpack_exports__);
  33828. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DocumentFragment; });
  33829. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js");
  33830. /* harmony import */ var _textproxy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/textproxy.js");
  33831. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  33832. /* harmony import */ var _ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
  33833. /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  33834. /**
  33835. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  33836. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  33837. */
  33838. /**
  33839. * @module engine/view/documentfragment
  33840. */
  33841. /**
  33842. * Document fragment.
  33843. *
  33844. * To create a new document fragment instance use the
  33845. * {@link module:engine/view/upcastwriter~UpcastWriter#createDocumentFragment `UpcastWriter#createDocumentFragment()`}
  33846. * method.
  33847. */
  33848. class DocumentFragment {
  33849. /**
  33850. * Creates new DocumentFragment instance.
  33851. *
  33852. * @protected
  33853. * @param {module:engine/view/document~Document} document The document to which this document fragment belongs.
  33854. * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
  33855. * A list of nodes to be inserted into the created document fragment.
  33856. */
  33857. constructor( document, children ) {
  33858. /**
  33859. * The document to which this document fragment belongs.
  33860. *
  33861. * @readonly
  33862. * @member {module:engine/view/document~Document}
  33863. */
  33864. this.document = document;
  33865. /**
  33866. * Array of child nodes.
  33867. *
  33868. * @protected
  33869. * @member {Array.<module:engine/view/element~Element>} module:engine/view/documentfragment~DocumentFragment#_children
  33870. */
  33871. this._children = [];
  33872. if ( children ) {
  33873. this._insertChild( 0, children );
  33874. }
  33875. }
  33876. /**
  33877. * Iterable interface.
  33878. *
  33879. * Iterates over nodes added to this document fragment.
  33880. *
  33881. * @returns {Iterable.<module:engine/view/node~Node>}
  33882. */
  33883. [ Symbol.iterator ]() {
  33884. return this._children[ Symbol.iterator ]();
  33885. }
  33886. /**
  33887. * Number of child nodes in this document fragment.
  33888. *
  33889. * @readonly
  33890. * @type {Number}
  33891. */
  33892. get childCount() {
  33893. return this._children.length;
  33894. }
  33895. /**
  33896. * Is `true` if there are no nodes inside this document fragment, `false` otherwise.
  33897. *
  33898. * @readonly
  33899. * @type {Boolean}
  33900. */
  33901. get isEmpty() {
  33902. return this.childCount === 0;
  33903. }
  33904. /**
  33905. * Artificial root of `DocumentFragment`. Returns itself. Added for compatibility reasons.
  33906. *
  33907. * @readonly
  33908. * @type {module:engine/model/documentfragment~DocumentFragment}
  33909. */
  33910. get root() {
  33911. return this;
  33912. }
  33913. /**
  33914. * Artificial parent of `DocumentFragment`. Returns `null`. Added for compatibility reasons.
  33915. *
  33916. * @readonly
  33917. * @type {null}
  33918. */
  33919. get parent() {
  33920. return null;
  33921. }
  33922. /**
  33923. * Checks whether this object is of the given type.
  33924. *
  33925. * docFrag.is( 'documentFragment' ); // -> true
  33926. * docFrag.is( 'view:documentFragment' ); // -> true
  33927. *
  33928. * docFrag.is( 'model:documentFragment' ); // -> false
  33929. * docFrag.is( 'element' ); // -> false
  33930. * docFrag.is( 'node' ); // -> false
  33931. *
  33932. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  33933. *
  33934. * @param {String} type
  33935. * @returns {Boolean}
  33936. */
  33937. is( type ) {
  33938. return type === 'documentFragment' || type === 'view:documentFragment';
  33939. }
  33940. /**
  33941. * {@link module:engine/view/documentfragment~DocumentFragment#_insertChild Insert} a child node or a list of child nodes at the end
  33942. * and sets the parent of these nodes to this fragment.
  33943. *
  33944. * @param {module:engine/view/item~Item|Iterable.<module:engine/view/item~Item>} items Items to be inserted.
  33945. * @returns {Number} Number of appended nodes.
  33946. */
  33947. _appendChild( items ) {
  33948. return this._insertChild( this.childCount, items );
  33949. }
  33950. /**
  33951. * Gets child at the given index.
  33952. *
  33953. * @param {Number} index Index of child.
  33954. * @returns {module:engine/view/node~Node} Child node.
  33955. */
  33956. getChild( index ) {
  33957. return this._children[ index ];
  33958. }
  33959. /**
  33960. * Gets index of the given child node. Returns `-1` if child node is not found.
  33961. *
  33962. * @param {module:engine/view/node~Node} node Child node.
  33963. * @returns {Number} Index of the child node.
  33964. */
  33965. getChildIndex( node ) {
  33966. return this._children.indexOf( node );
  33967. }
  33968. /**
  33969. * Gets child nodes iterator.
  33970. *
  33971. * @returns {Iterable.<module:engine/view/node~Node>} Child nodes iterator.
  33972. */
  33973. getChildren() {
  33974. return this._children[ Symbol.iterator ]();
  33975. }
  33976. /**
  33977. * Inserts a child node or a list of child nodes on the given index and sets the parent of these nodes to
  33978. * this fragment.
  33979. *
  33980. * @param {Number} index Position where nodes should be inserted.
  33981. * @param {module:engine/view/item~Item|Iterable.<module:engine/view/item~Item>} items Items to be inserted.
  33982. * @returns {Number} Number of inserted nodes.
  33983. */
  33984. _insertChild( index, items ) {
  33985. this._fireChange( 'children', this );
  33986. let count = 0;
  33987. const nodes = normalize( this.document, items );
  33988. for ( const node of nodes ) {
  33989. // If node that is being added to this element is already inside another element, first remove it from the old parent.
  33990. if ( node.parent !== null ) {
  33991. node._remove();
  33992. }
  33993. node.parent = this;
  33994. this._children.splice( index, 0, node );
  33995. index++;
  33996. count++;
  33997. }
  33998. return count;
  33999. }
  34000. /**
  34001. * Removes number of child nodes starting at the given index and set the parent of these nodes to `null`.
  34002. *
  34003. * @param {Number} index Number of the first node to remove.
  34004. * @param {Number} [howMany=1] Number of nodes to remove.
  34005. * @returns {Array.<module:engine/view/node~Node>} The array of removed nodes.
  34006. */
  34007. _removeChildren( index, howMany = 1 ) {
  34008. this._fireChange( 'children', this );
  34009. for ( let i = index; i < index + howMany; i++ ) {
  34010. this._children[ i ].parent = null;
  34011. }
  34012. return this._children.splice( index, howMany );
  34013. }
  34014. /**
  34015. * Fires `change` event with given type of the change.
  34016. *
  34017. * @private
  34018. * @param {module:engine/view/document~ChangeType} type Type of the change.
  34019. * @param {module:engine/view/node~Node} node Changed node.
  34020. * @fires module:engine/view/node~Node#change
  34021. */
  34022. _fireChange( type, node ) {
  34023. this.fire( 'change:' + type, node );
  34024. }
  34025. // @if CK_DEBUG_ENGINE // printTree() {
  34026. // @if CK_DEBUG_ENGINE // let string = 'ViewDocumentFragment: [';
  34027. // @if CK_DEBUG_ENGINE // for ( const child of this.getChildren() ) {
  34028. // @if CK_DEBUG_ENGINE // if ( child.is( '$text' ) ) {
  34029. // @if CK_DEBUG_ENGINE // string += '\n' + '\t'.repeat( 1 ) + child.data;
  34030. // @if CK_DEBUG_ENGINE // } else {
  34031. // @if CK_DEBUG_ENGINE // string += '\n' + child.printTree( 1 );
  34032. // @if CK_DEBUG_ENGINE // }
  34033. // @if CK_DEBUG_ENGINE // }
  34034. // @if CK_DEBUG_ENGINE // string += '\n]';
  34035. // @if CK_DEBUG_ENGINE // return string;
  34036. // @if CK_DEBUG_ENGINE // }
  34037. // @if CK_DEBUG_ENGINE // logTree() {
  34038. // @if CK_DEBUG_ENGINE // console.log( this.printTree() );
  34039. // @if CK_DEBUG_ENGINE // }
  34040. }
  34041. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( DocumentFragment, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_4__["default"] );
  34042. // Converts strings to Text and non-iterables to arrays.
  34043. //
  34044. // @param {String|module:engine/view/item~Item|Iterable.<String|module:engine/view/item~Item>}
  34045. // @returns {Iterable.<module:engine/view/node~Node>}
  34046. function normalize( document, nodes ) {
  34047. // Separate condition because string is iterable.
  34048. if ( typeof nodes == 'string' ) {
  34049. return [ new _text__WEBPACK_IMPORTED_MODULE_0__["default"]( document, nodes ) ];
  34050. }
  34051. if ( !Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_3__["default"])( nodes ) ) {
  34052. nodes = [ nodes ];
  34053. }
  34054. // Array.from to enable .map() on non-arrays.
  34055. return Array.from( nodes )
  34056. .map( node => {
  34057. if ( typeof node == 'string' ) {
  34058. return new _text__WEBPACK_IMPORTED_MODULE_0__["default"]( document, node );
  34059. }
  34060. if ( node instanceof _textproxy__WEBPACK_IMPORTED_MODULE_1__["default"] ) {
  34061. return new _text__WEBPACK_IMPORTED_MODULE_0__["default"]( document, node.data );
  34062. }
  34063. return node;
  34064. } );
  34065. }
  34066. /***/ }),
  34067. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/documentselection.js":
  34068. /*!*******************************************************************************!*\
  34069. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/documentselection.js ***!
  34070. \*******************************************************************************/
  34071. /*! exports provided: default */
  34072. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  34073. "use strict";
  34074. __webpack_require__.r(__webpack_exports__);
  34075. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DocumentSelection; });
  34076. /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js");
  34077. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  34078. /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  34079. /**
  34080. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  34081. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  34082. */
  34083. /**
  34084. * @module engine/view/documentselection
  34085. */
  34086. /**
  34087. * Class representing the document selection in the view.
  34088. *
  34089. * Its instance is available in {@link module:engine/view/document~Document#selection `Document#selection`}.
  34090. *
  34091. * It is similar to {@link module:engine/view/selection~Selection} but
  34092. * it has a read-only API and can be modified only by the writer available in
  34093. * the {@link module:engine/view/view~View#change `View#change()`} block
  34094. * (so via {@link module:engine/view/downcastwriter~DowncastWriter#setSelection `DowncastWriter#setSelection()`}).
  34095. */
  34096. class DocumentSelection {
  34097. /**
  34098. * Creates new DocumentSelection instance.
  34099. *
  34100. * // Creates empty selection without ranges.
  34101. * const selection = new DocumentSelection();
  34102. *
  34103. * // Creates selection at the given range.
  34104. * const range = writer.createRange( start, end );
  34105. * const selection = new DocumentSelection( range );
  34106. *
  34107. * // Creates selection at the given ranges
  34108. * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( start2, end2 ) ];
  34109. * const selection = new DocumentSelection( ranges );
  34110. *
  34111. * // Creates selection from the other selection.
  34112. * const otherSelection = writer.createSelection();
  34113. * const selection = new DocumentSelection( otherSelection );
  34114. *
  34115. * // Creates selection at the given position.
  34116. * const position = writer.createPositionAt( root, offset );
  34117. * const selection = new DocumentSelection( position );
  34118. *
  34119. * // Creates collapsed selection at the position of given item and offset.
  34120. * const paragraph = writer.createContainerElement( 'paragraph' );
  34121. * const selection = new DocumentSelection( paragraph, offset );
  34122. *
  34123. * // Creates a range inside an {@link module:engine/view/element~Element element} which starts before the
  34124. * // first child of that element and ends after the last child of that element.
  34125. * const selection = new DocumentSelection( paragraph, 'in' );
  34126. *
  34127. * // Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends
  34128. * // just after the item.
  34129. * const selection = new DocumentSelection( paragraph, 'on' );
  34130. *
  34131. * `Selection`'s constructor allow passing additional options (`backward`, `fake` and `label`) as the last argument.
  34132. *
  34133. * // Creates backward selection.
  34134. * const selection = new DocumentSelection( range, { backward: true } );
  34135. *
  34136. * Fake selection does not render as browser native selection over selected elements and is hidden to the user.
  34137. * This way, no native selection UI artifacts are displayed to the user and selection over elements can be
  34138. * represented in other way, for example by applying proper CSS class.
  34139. *
  34140. * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM
  34141. * (and be properly handled by screen readers).
  34142. *
  34143. * // Creates fake selection with label.
  34144. * const selection = new DocumentSelection( range, { fake: true, label: 'foo' } );
  34145. *
  34146. * @param {module:engine/view/selection~Selectable} [selectable=null]
  34147. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Offset or place when selectable is an `Item`.
  34148. * @param {Object} [options]
  34149. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  34150. * @param {Boolean} [options.fake] Sets this selection instance to be marked as `fake`.
  34151. * @param {String} [options.label] Label for the fake selection.
  34152. */
  34153. constructor( selectable = null, placeOrOffset, options ) {
  34154. /**
  34155. * Selection is used internally (`DocumentSelection` is a proxy to that selection).
  34156. *
  34157. * @private
  34158. * @member {module:engine/view/selection~Selection}
  34159. */
  34160. this._selection = new _selection__WEBPACK_IMPORTED_MODULE_0__["default"]();
  34161. // Delegate change event to be fired on DocumentSelection instance.
  34162. this._selection.delegate( 'change' ).to( this );
  34163. // Set selection data.
  34164. this._selection.setTo( selectable, placeOrOffset, options );
  34165. }
  34166. /**
  34167. * Returns true if selection instance is marked as `fake`.
  34168. *
  34169. * @see #_setTo
  34170. * @returns {Boolean}
  34171. */
  34172. get isFake() {
  34173. return this._selection.isFake;
  34174. }
  34175. /**
  34176. * Returns fake selection label.
  34177. *
  34178. * @see #_setTo
  34179. * @returns {String}
  34180. */
  34181. get fakeSelectionLabel() {
  34182. return this._selection.fakeSelectionLabel;
  34183. }
  34184. /**
  34185. * Selection anchor. Anchor may be described as a position where the selection starts. Together with
  34186. * {@link #focus focus} they define the direction of selection, which is important
  34187. * when expanding/shrinking selection. Anchor is always the start or end of the most recent added range.
  34188. * It may be a bit unintuitive when there are multiple ranges in selection.
  34189. *
  34190. * @see #focus
  34191. * @type {module:engine/view/position~Position}
  34192. */
  34193. get anchor() {
  34194. return this._selection.anchor;
  34195. }
  34196. /**
  34197. * Selection focus. Focus is a position where the selection ends.
  34198. *
  34199. * @see #anchor
  34200. * @type {module:engine/view/position~Position}
  34201. */
  34202. get focus() {
  34203. return this._selection.focus;
  34204. }
  34205. /**
  34206. * Returns whether the selection is collapsed. Selection is collapsed when there is exactly one range which is
  34207. * collapsed.
  34208. *
  34209. * @type {Boolean}
  34210. */
  34211. get isCollapsed() {
  34212. return this._selection.isCollapsed;
  34213. }
  34214. /**
  34215. * Returns number of ranges in selection.
  34216. *
  34217. * @type {Number}
  34218. */
  34219. get rangeCount() {
  34220. return this._selection.rangeCount;
  34221. }
  34222. /**
  34223. * Specifies whether the {@link #focus} precedes {@link #anchor}.
  34224. *
  34225. * @type {Boolean}
  34226. */
  34227. get isBackward() {
  34228. return this._selection.isBackward;
  34229. }
  34230. /**
  34231. * {@link module:engine/view/editableelement~EditableElement EditableElement} instance that contains this selection, or `null`
  34232. * if the selection is not inside an editable element.
  34233. *
  34234. * @type {module:engine/view/editableelement~EditableElement|null}
  34235. */
  34236. get editableElement() {
  34237. return this._selection.editableElement;
  34238. }
  34239. /**
  34240. * Used for the compatibility with the {@link module:engine/view/selection~Selection#isEqual} method.
  34241. *
  34242. * @protected
  34243. */
  34244. get _ranges() {
  34245. return this._selection._ranges;
  34246. }
  34247. /**
  34248. * Returns an iterable that contains copies of all ranges added to the selection.
  34249. *
  34250. * @returns {Iterable.<module:engine/view/range~Range>}
  34251. */
  34252. * getRanges() {
  34253. yield* this._selection.getRanges();
  34254. }
  34255. /**
  34256. * Returns copy of the first range in the selection. First range is the one which
  34257. * {@link module:engine/view/range~Range#start start} position {@link module:engine/view/position~Position#isBefore is before} start
  34258. * position of all other ranges (not to confuse with the first range added to the selection).
  34259. * Returns `null` if no ranges are added to selection.
  34260. *
  34261. * @returns {module:engine/view/range~Range|null}
  34262. */
  34263. getFirstRange() {
  34264. return this._selection.getFirstRange();
  34265. }
  34266. /**
  34267. * Returns copy of the last range in the selection. Last range is the one which {@link module:engine/view/range~Range#end end}
  34268. * position {@link module:engine/view/position~Position#isAfter is after} end position of all other ranges (not to confuse
  34269. * with the last range added to the selection). Returns `null` if no ranges are added to selection.
  34270. *
  34271. * @returns {module:engine/view/range~Range|null}
  34272. */
  34273. getLastRange() {
  34274. return this._selection.getLastRange();
  34275. }
  34276. /**
  34277. * Returns copy of the first position in the selection. First position is the position that
  34278. * {@link module:engine/view/position~Position#isBefore is before} any other position in the selection ranges.
  34279. * Returns `null` if no ranges are added to selection.
  34280. *
  34281. * @returns {module:engine/view/position~Position|null}
  34282. */
  34283. getFirstPosition() {
  34284. return this._selection.getFirstPosition();
  34285. }
  34286. /**
  34287. * Returns copy of the last position in the selection. Last position is the position that
  34288. * {@link module:engine/view/position~Position#isAfter is after} any other position in the selection ranges.
  34289. * Returns `null` if no ranges are added to selection.
  34290. *
  34291. * @returns {module:engine/view/position~Position|null}
  34292. */
  34293. getLastPosition() {
  34294. return this._selection.getLastPosition();
  34295. }
  34296. /**
  34297. * Returns the selected element. {@link module:engine/view/element~Element Element} is considered as selected if there is only
  34298. * one range in the selection, and that range contains exactly one element.
  34299. * Returns `null` if there is no selected element.
  34300. *
  34301. * @returns {module:engine/view/element~Element|null}
  34302. */
  34303. getSelectedElement() {
  34304. return this._selection.getSelectedElement();
  34305. }
  34306. /**
  34307. * Checks whether, this selection is equal to given selection. Selections are equal if they have same directions,
  34308. * same number of ranges and all ranges from one selection equal to a range from other selection.
  34309. *
  34310. * @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection} otherSelection
  34311. * Selection to compare with.
  34312. * @returns {Boolean} `true` if selections are equal, `false` otherwise.
  34313. */
  34314. isEqual( otherSelection ) {
  34315. return this._selection.isEqual( otherSelection );
  34316. }
  34317. /**
  34318. * Checks whether this selection is similar to given selection. Selections are similar if they have same directions, same
  34319. * number of ranges, and all {@link module:engine/view/range~Range#getTrimmed trimmed} ranges from one selection are
  34320. * equal to any trimmed range from other selection.
  34321. *
  34322. * @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection} otherSelection
  34323. * Selection to compare with.
  34324. * @returns {Boolean} `true` if selections are similar, `false` otherwise.
  34325. */
  34326. isSimilar( otherSelection ) {
  34327. return this._selection.isSimilar( otherSelection );
  34328. }
  34329. /**
  34330. * Checks whether this object is of the given type.
  34331. *
  34332. * docSelection.is( 'selection' ); // -> true
  34333. * docSelection.is( 'documentSelection' ); // -> true
  34334. * docSelection.is( 'view:selection' ); // -> true
  34335. * docSelection.is( 'view:documentSelection' ); // -> true
  34336. *
  34337. * docSelection.is( 'model:documentSelection' ); // -> false
  34338. * docSelection.is( 'element' ); // -> false
  34339. * docSelection.is( 'node' ); // -> false
  34340. *
  34341. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  34342. *
  34343. * @param {String} type
  34344. * @returns {Boolean}
  34345. */
  34346. is( type ) {
  34347. return type === 'selection' ||
  34348. type == 'documentSelection' ||
  34349. type == 'view:selection' ||
  34350. type == 'view:documentSelection';
  34351. }
  34352. /**
  34353. * Sets this selection's ranges and direction to the specified location based on the given
  34354. * {@link module:engine/view/selection~Selectable selectable}.
  34355. *
  34356. * // Sets selection to the given range.
  34357. * const range = writer.createRange( start, end );
  34358. * documentSelection._setTo( range );
  34359. *
  34360. * // Sets selection to given ranges.
  34361. * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( start2, end2 ) ];
  34362. * documentSelection._setTo( range );
  34363. *
  34364. * // Sets selection to the other selection.
  34365. * const otherSelection = writer.createSelection();
  34366. * documentSelection._setTo( otherSelection );
  34367. *
  34368. * // Sets collapsed selection at the given position.
  34369. * const position = writer.createPositionAt( root, offset );
  34370. * documentSelection._setTo( position );
  34371. *
  34372. * // Sets collapsed selection at the position of given item and offset.
  34373. * documentSelection._setTo( paragraph, offset );
  34374. *
  34375. * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of
  34376. * that element and ends after the last child of that element.
  34377. *
  34378. * documentSelection._setTo( paragraph, 'in' );
  34379. *
  34380. * Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends just after the item.
  34381. *
  34382. * documentSelection._setTo( paragraph, 'on' );
  34383. *
  34384. * // Clears selection. Removes all ranges.
  34385. * documentSelection._setTo( null );
  34386. *
  34387. * `Selection#_setTo()` method allow passing additional options (`backward`, `fake` and `label`) as the last argument.
  34388. *
  34389. * // Sets selection as backward.
  34390. * documentSelection._setTo( range, { backward: true } );
  34391. *
  34392. * Fake selection does not render as browser native selection over selected elements and is hidden to the user.
  34393. * This way, no native selection UI artifacts are displayed to the user and selection over elements can be
  34394. * represented in other way, for example by applying proper CSS class.
  34395. *
  34396. * Additionally fake's selection label can be provided. It will be used to des cribe fake selection in DOM
  34397. * (and be properly handled by screen readers).
  34398. *
  34399. * // Creates fake selection with label.
  34400. * documentSelection._setTo( range, { fake: true, label: 'foo' } );
  34401. *
  34402. * @protected
  34403. * @fires change
  34404. * @param {module:engine/view/selection~Selectable} selectable
  34405. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
  34406. * @param {Object} [options]
  34407. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  34408. * @param {Boolean} [options.fake] Sets this selection instance to be marked as `fake`.
  34409. * @param {String} [options.label] Label for the fake selection.
  34410. */
  34411. _setTo( selectable, placeOrOffset, options ) {
  34412. this._selection.setTo( selectable, placeOrOffset, options );
  34413. }
  34414. /**
  34415. * Moves {@link #focus} to the specified location.
  34416. *
  34417. * The location can be specified in the same form as {@link module:engine/view/view~View#createPositionAt view.createPositionAt()}
  34418. * parameters.
  34419. *
  34420. * @protected
  34421. * @fires change
  34422. * @param {module:engine/view/item~Item|module:engine/view/position~Position} itemOrPosition
  34423. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  34424. * first parameter is a {@link module:engine/view/item~Item view item}.
  34425. */
  34426. _setFocus( itemOrPosition, offset ) {
  34427. this._selection.setFocus( itemOrPosition, offset );
  34428. }
  34429. /**
  34430. * Fired whenever selection ranges are changed through {@link ~DocumentSelection Selection API}.
  34431. *
  34432. * @event change
  34433. */
  34434. }
  34435. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( DocumentSelection, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_2__["default"] );
  34436. /***/ }),
  34437. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/domconverter.js":
  34438. /*!**************************************************************************!*\
  34439. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/domconverter.js ***!
  34440. \**************************************************************************/
  34441. /*! exports provided: default */
  34442. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  34443. "use strict";
  34444. __webpack_require__.r(__webpack_exports__);
  34445. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DomConverter; });
  34446. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js");
  34447. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js");
  34448. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
  34449. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/range.js");
  34450. /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js");
  34451. /* harmony import */ var _documentfragment__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./documentfragment */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/documentfragment.js");
  34452. /* harmony import */ var _treewalker__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./treewalker */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/treewalker.js");
  34453. /* harmony import */ var _filler__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./filler */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/filler.js");
  34454. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
  34455. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_indexof__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/indexof */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/indexof.js");
  34456. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_getancestors__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/getancestors */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getancestors.js");
  34457. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_getcommonancestor__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/getcommonancestor */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getcommonancestor.js");
  34458. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/istext */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/istext.js");
  34459. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  34460. /**
  34461. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  34462. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  34463. */
  34464. /**
  34465. * @module engine/view/domconverter
  34466. */
  34467. /* globals document, Node, NodeFilter, Text */
  34468. // eslint-disable-next-line new-cap
  34469. const BR_FILLER_REF = Object(_filler__WEBPACK_IMPORTED_MODULE_7__["BR_FILLER"])( document );
  34470. /**
  34471. * `DomConverter` is a set of tools to do transformations between DOM nodes and view nodes. It also handles
  34472. * {@link module:engine/view/domconverter~DomConverter#bindElements bindings} between these nodes.
  34473. *
  34474. * An instance of the DOM converter is available under
  34475. * {@link module:engine/view/view~View#domConverter `editor.editing.view.domConverter`}.
  34476. *
  34477. * The DOM converter does not check which nodes should be rendered (use {@link module:engine/view/renderer~Renderer}), does not keep the
  34478. * state of a tree nor keeps the synchronization between the tree view and the DOM tree (use {@link module:engine/view/document~Document}).
  34479. *
  34480. * The DOM converter keeps DOM elements to view element bindings, so when the converter gets destroyed, the bindings are lost.
  34481. * Two converters will keep separate binding maps, so one tree view can be bound with two DOM trees.
  34482. */
  34483. class DomConverter {
  34484. /**
  34485. * Creates a DOM converter.
  34486. *
  34487. * @param {module:engine/view/document~Document} document The view document instance.
  34488. * @param {Object} options An object with configuration options.
  34489. * @param {module:engine/view/filler~BlockFillerMode} [options.blockFillerMode='br'] The type of the block filler to use.
  34490. */
  34491. constructor( document, options = {} ) {
  34492. /**
  34493. * @readonly
  34494. * @type {module:engine/view/document~Document}
  34495. */
  34496. this.document = document;
  34497. /**
  34498. * The mode of a block filler used by the DOM converter.
  34499. *
  34500. * @readonly
  34501. * @member {'br'|'nbsp'} module:engine/view/domconverter~DomConverter#blockFillerMode
  34502. */
  34503. this.blockFillerMode = options.blockFillerMode || 'br';
  34504. /**
  34505. * Elements which are considered pre-formatted elements.
  34506. *
  34507. * @readonly
  34508. * @member {Array.<String>} module:engine/view/domconverter~DomConverter#preElements
  34509. */
  34510. this.preElements = [ 'pre' ];
  34511. /**
  34512. * Elements which are considered block elements (and hence should be filled with a
  34513. * {@link #isBlockFiller block filler}).
  34514. *
  34515. * Whether an element is considered a block element also affects handling of trailing whitespaces.
  34516. *
  34517. * You can extend this array if you introduce support for block elements which are not yet recognized here.
  34518. *
  34519. * @readonly
  34520. * @member {Array.<String>} module:engine/view/domconverter~DomConverter#blockElements
  34521. */
  34522. this.blockElements = [ 'p', 'div', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'li', 'dd', 'dt', 'figcaption', 'td', 'th' ];
  34523. /**
  34524. * Block {@link module:engine/view/filler filler} creator, which is used to create all block fillers during the
  34525. * view-to-DOM conversion and to recognize block fillers during the DOM-to-view conversion.
  34526. *
  34527. * @readonly
  34528. * @private
  34529. * @member {Function} module:engine/view/domconverter~DomConverter#_blockFiller
  34530. */
  34531. this._blockFiller = this.blockFillerMode == 'br' ? _filler__WEBPACK_IMPORTED_MODULE_7__["BR_FILLER"] : _filler__WEBPACK_IMPORTED_MODULE_7__["NBSP_FILLER"];
  34532. /**
  34533. * The DOM-to-view mapping.
  34534. *
  34535. * @private
  34536. * @member {WeakMap} module:engine/view/domconverter~DomConverter#_domToViewMapping
  34537. */
  34538. this._domToViewMapping = new WeakMap();
  34539. /**
  34540. * The view-to-DOM mapping.
  34541. *
  34542. * @private
  34543. * @member {WeakMap} module:engine/view/domconverter~DomConverter#_viewToDomMapping
  34544. */
  34545. this._viewToDomMapping = new WeakMap();
  34546. /**
  34547. * Holds the mapping between fake selection containers and corresponding view selections.
  34548. *
  34549. * @private
  34550. * @member {WeakMap} module:engine/view/domconverter~DomConverter#_fakeSelectionMapping
  34551. */
  34552. this._fakeSelectionMapping = new WeakMap();
  34553. }
  34554. /**
  34555. * Binds given DOM element that represents fake selection to a **position** of a
  34556. * {@link module:engine/view/documentselection~DocumentSelection document selection}.
  34557. * Document selection copy is stored and can be retrieved by
  34558. * {@link module:engine/view/domconverter~DomConverter#fakeSelectionToView} method.
  34559. *
  34560. * @param {HTMLElement} domElement
  34561. * @param {module:engine/view/documentselection~DocumentSelection} viewDocumentSelection
  34562. */
  34563. bindFakeSelection( domElement, viewDocumentSelection ) {
  34564. this._fakeSelectionMapping.set( domElement, new _selection__WEBPACK_IMPORTED_MODULE_4__["default"]( viewDocumentSelection ) );
  34565. }
  34566. /**
  34567. * Returns {@link module:engine/view/selection~Selection view selection} instance corresponding to
  34568. * given DOM element that represents fake selection. Returns `undefined` if binding to given DOM element does not exists.
  34569. *
  34570. * @param {HTMLElement} domElement
  34571. * @returns {module:engine/view/selection~Selection|undefined}
  34572. */
  34573. fakeSelectionToView( domElement ) {
  34574. return this._fakeSelectionMapping.get( domElement );
  34575. }
  34576. /**
  34577. * Binds DOM and View elements, so it will be possible to get corresponding elements using
  34578. * {@link module:engine/view/domconverter~DomConverter#mapDomToView} and
  34579. * {@link module:engine/view/domconverter~DomConverter#mapViewToDom}.
  34580. *
  34581. * @param {HTMLElement} domElement DOM element to bind.
  34582. * @param {module:engine/view/element~Element} viewElement View element to bind.
  34583. */
  34584. bindElements( domElement, viewElement ) {
  34585. this._domToViewMapping.set( domElement, viewElement );
  34586. this._viewToDomMapping.set( viewElement, domElement );
  34587. }
  34588. /**
  34589. * Unbinds given `domElement` from the view element it was bound to. Unbinding is deep, meaning that all children of
  34590. * `domElement` will be unbound too.
  34591. *
  34592. * @param {HTMLElement} domElement DOM element to unbind.
  34593. */
  34594. unbindDomElement( domElement ) {
  34595. const viewElement = this._domToViewMapping.get( domElement );
  34596. if ( viewElement ) {
  34597. this._domToViewMapping.delete( domElement );
  34598. this._viewToDomMapping.delete( viewElement );
  34599. for ( const child of domElement.childNodes ) {
  34600. this.unbindDomElement( child );
  34601. }
  34602. }
  34603. }
  34604. /**
  34605. * Binds DOM and View document fragments, so it will be possible to get corresponding document fragments using
  34606. * {@link module:engine/view/domconverter~DomConverter#mapDomToView} and
  34607. * {@link module:engine/view/domconverter~DomConverter#mapViewToDom}.
  34608. *
  34609. * @param {DocumentFragment} domFragment DOM document fragment to bind.
  34610. * @param {module:engine/view/documentfragment~DocumentFragment} viewFragment View document fragment to bind.
  34611. */
  34612. bindDocumentFragments( domFragment, viewFragment ) {
  34613. this._domToViewMapping.set( domFragment, viewFragment );
  34614. this._viewToDomMapping.set( viewFragment, domFragment );
  34615. }
  34616. /**
  34617. * Converts view to DOM. For all text nodes, not bound elements and document fragments new items will
  34618. * be created. For bound elements and document fragments function will return corresponding items.
  34619. *
  34620. * @param {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment} viewNode
  34621. * View node or document fragment to transform.
  34622. * @param {Document} domDocument Document which will be used to create DOM nodes.
  34623. * @param {Object} [options] Conversion options.
  34624. * @param {Boolean} [options.bind=false] Determines whether new elements will be bound.
  34625. * @param {Boolean} [options.withChildren=true] If `true`, node's and document fragment's children will be converted too.
  34626. * @returns {Node|DocumentFragment} Converted node or DocumentFragment.
  34627. */
  34628. viewToDom( viewNode, domDocument, options = {} ) {
  34629. if ( viewNode.is( '$text' ) ) {
  34630. const textData = this._processDataFromViewText( viewNode );
  34631. return domDocument.createTextNode( textData );
  34632. } else {
  34633. if ( this.mapViewToDom( viewNode ) ) {
  34634. return this.mapViewToDom( viewNode );
  34635. }
  34636. let domElement;
  34637. if ( viewNode.is( 'documentFragment' ) ) {
  34638. // Create DOM document fragment.
  34639. domElement = domDocument.createDocumentFragment();
  34640. if ( options.bind ) {
  34641. this.bindDocumentFragments( domElement, viewNode );
  34642. }
  34643. } else if ( viewNode.is( 'uiElement' ) ) {
  34644. // UIElement has its own render() method (see #799).
  34645. domElement = viewNode.render( domDocument );
  34646. if ( options.bind ) {
  34647. this.bindElements( domElement, viewNode );
  34648. }
  34649. return domElement;
  34650. } else {
  34651. // Create DOM element.
  34652. if ( viewNode.hasAttribute( 'xmlns' ) ) {
  34653. domElement = domDocument.createElementNS( viewNode.getAttribute( 'xmlns' ), viewNode.name );
  34654. } else {
  34655. domElement = domDocument.createElement( viewNode.name );
  34656. }
  34657. // RawElement take care of their children in RawElement#render() method which can be customized
  34658. // (see https://github.com/ckeditor/ckeditor5/issues/4469).
  34659. if ( viewNode.is( 'rawElement' ) ) {
  34660. viewNode.render( domElement );
  34661. }
  34662. if ( options.bind ) {
  34663. this.bindElements( domElement, viewNode );
  34664. }
  34665. // Copy element's attributes.
  34666. for ( const key of viewNode.getAttributeKeys() ) {
  34667. domElement.setAttribute( key, viewNode.getAttribute( key ) );
  34668. }
  34669. }
  34670. if ( options.withChildren || options.withChildren === undefined ) {
  34671. for ( const child of this.viewChildrenToDom( viewNode, domDocument, options ) ) {
  34672. domElement.appendChild( child );
  34673. }
  34674. }
  34675. return domElement;
  34676. }
  34677. }
  34678. /**
  34679. * Converts children of the view element to DOM using the
  34680. * {@link module:engine/view/domconverter~DomConverter#viewToDom} method.
  34681. * Additionally, this method adds block {@link module:engine/view/filler filler} to the list of children, if needed.
  34682. *
  34683. * @param {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment} viewElement Parent view element.
  34684. * @param {Document} domDocument Document which will be used to create DOM nodes.
  34685. * @param {Object} options See {@link module:engine/view/domconverter~DomConverter#viewToDom} options parameter.
  34686. * @returns {Iterable.<Node>} DOM nodes.
  34687. */
  34688. * viewChildrenToDom( viewElement, domDocument, options = {} ) {
  34689. const fillerPositionOffset = viewElement.getFillerOffset && viewElement.getFillerOffset();
  34690. let offset = 0;
  34691. for ( const childView of viewElement.getChildren() ) {
  34692. if ( fillerPositionOffset === offset ) {
  34693. yield this._blockFiller( domDocument );
  34694. }
  34695. yield this.viewToDom( childView, domDocument, options );
  34696. offset++;
  34697. }
  34698. if ( fillerPositionOffset === offset ) {
  34699. yield this._blockFiller( domDocument );
  34700. }
  34701. }
  34702. /**
  34703. * Converts view {@link module:engine/view/range~Range} to DOM range.
  34704. * Inline and block {@link module:engine/view/filler fillers} are handled during the conversion.
  34705. *
  34706. * @param {module:engine/view/range~Range} viewRange View range.
  34707. * @returns {Range} DOM range.
  34708. */
  34709. viewRangeToDom( viewRange ) {
  34710. const domStart = this.viewPositionToDom( viewRange.start );
  34711. const domEnd = this.viewPositionToDom( viewRange.end );
  34712. const domRange = document.createRange();
  34713. domRange.setStart( domStart.parent, domStart.offset );
  34714. domRange.setEnd( domEnd.parent, domEnd.offset );
  34715. return domRange;
  34716. }
  34717. /**
  34718. * Converts view {@link module:engine/view/position~Position} to DOM parent and offset.
  34719. *
  34720. * Inline and block {@link module:engine/view/filler fillers} are handled during the conversion.
  34721. * If the converted position is directly before inline filler it is moved inside the filler.
  34722. *
  34723. * @param {module:engine/view/position~Position} viewPosition View position.
  34724. * @returns {Object|null} position DOM position or `null` if view position could not be converted to DOM.
  34725. * @returns {Node} position.parent DOM position parent.
  34726. * @returns {Number} position.offset DOM position offset.
  34727. */
  34728. viewPositionToDom( viewPosition ) {
  34729. const viewParent = viewPosition.parent;
  34730. if ( viewParent.is( '$text' ) ) {
  34731. const domParent = this.findCorrespondingDomText( viewParent );
  34732. if ( !domParent ) {
  34733. // Position is in a view text node that has not been rendered to DOM yet.
  34734. return null;
  34735. }
  34736. let offset = viewPosition.offset;
  34737. if ( Object(_filler__WEBPACK_IMPORTED_MODULE_7__["startsWithFiller"])( domParent ) ) {
  34738. offset += _filler__WEBPACK_IMPORTED_MODULE_7__["INLINE_FILLER_LENGTH"];
  34739. }
  34740. return { parent: domParent, offset };
  34741. } else {
  34742. // viewParent is instance of ViewElement.
  34743. let domParent, domBefore, domAfter;
  34744. if ( viewPosition.offset === 0 ) {
  34745. domParent = this.mapViewToDom( viewParent );
  34746. if ( !domParent ) {
  34747. // Position is in a view element that has not been rendered to DOM yet.
  34748. return null;
  34749. }
  34750. domAfter = domParent.childNodes[ 0 ];
  34751. } else {
  34752. const nodeBefore = viewPosition.nodeBefore;
  34753. domBefore = nodeBefore.is( '$text' ) ?
  34754. this.findCorrespondingDomText( nodeBefore ) :
  34755. this.mapViewToDom( viewPosition.nodeBefore );
  34756. if ( !domBefore ) {
  34757. // Position is after a view element that has not been rendered to DOM yet.
  34758. return null;
  34759. }
  34760. domParent = domBefore.parentNode;
  34761. domAfter = domBefore.nextSibling;
  34762. }
  34763. // If there is an inline filler at position return position inside the filler. We should never return
  34764. // the position before the inline filler.
  34765. if ( Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_12__["default"])( domAfter ) && Object(_filler__WEBPACK_IMPORTED_MODULE_7__["startsWithFiller"])( domAfter ) ) {
  34766. return { parent: domAfter, offset: _filler__WEBPACK_IMPORTED_MODULE_7__["INLINE_FILLER_LENGTH"] };
  34767. }
  34768. const offset = domBefore ? Object(_ckeditor_ckeditor5_utils_src_dom_indexof__WEBPACK_IMPORTED_MODULE_9__["default"])( domBefore ) + 1 : 0;
  34769. return { parent: domParent, offset };
  34770. }
  34771. }
  34772. /**
  34773. * Converts DOM to view. For all text nodes, not bound elements and document fragments new items will
  34774. * be created. For bound elements and document fragments function will return corresponding items. For
  34775. * {@link module:engine/view/filler fillers} `null` will be returned.
  34776. * For all DOM elements rendered by {@link module:engine/view/uielement~UIElement} that UIElement will be returned.
  34777. *
  34778. * @param {Node|DocumentFragment} domNode DOM node or document fragment to transform.
  34779. * @param {Object} [options] Conversion options.
  34780. * @param {Boolean} [options.bind=false] Determines whether new elements will be bound.
  34781. * @param {Boolean} [options.withChildren=true] If `true`, node's and document fragment's children will be converted too.
  34782. * @param {Boolean} [options.keepOriginalCase=false] If `false`, node's tag name will be converter to lower case.
  34783. * @returns {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment|null} Converted node or document fragment
  34784. * or `null` if DOM node is a {@link module:engine/view/filler filler} or the given node is an empty text node.
  34785. */
  34786. domToView( domNode, options = {} ) {
  34787. if ( this.isBlockFiller( domNode, this.blockFillerMode ) ) {
  34788. return null;
  34789. }
  34790. // When node is inside a UIElement or a RawElement return that parent as it's view representation.
  34791. const hostElement = this.getHostViewElement( domNode, this._domToViewMapping );
  34792. if ( hostElement ) {
  34793. return hostElement;
  34794. }
  34795. if ( Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_12__["default"])( domNode ) ) {
  34796. if ( Object(_filler__WEBPACK_IMPORTED_MODULE_7__["isInlineFiller"])( domNode ) ) {
  34797. return null;
  34798. } else {
  34799. const textData = this._processDataFromDomText( domNode );
  34800. return textData === '' ? null : new _text__WEBPACK_IMPORTED_MODULE_0__["default"]( this.document, textData );
  34801. }
  34802. } else if ( this.isComment( domNode ) ) {
  34803. return null;
  34804. } else {
  34805. if ( this.mapDomToView( domNode ) ) {
  34806. return this.mapDomToView( domNode );
  34807. }
  34808. let viewElement;
  34809. if ( this.isDocumentFragment( domNode ) ) {
  34810. // Create view document fragment.
  34811. viewElement = new _documentfragment__WEBPACK_IMPORTED_MODULE_5__["default"]( this.document );
  34812. if ( options.bind ) {
  34813. this.bindDocumentFragments( domNode, viewElement );
  34814. }
  34815. } else {
  34816. // Create view element.
  34817. const viewName = options.keepOriginalCase ? domNode.tagName : domNode.tagName.toLowerCase();
  34818. viewElement = new _element__WEBPACK_IMPORTED_MODULE_1__["default"]( this.document, viewName );
  34819. if ( options.bind ) {
  34820. this.bindElements( domNode, viewElement );
  34821. }
  34822. // Copy element's attributes.
  34823. const attrs = domNode.attributes;
  34824. for ( let i = attrs.length - 1; i >= 0; i-- ) {
  34825. viewElement._setAttribute( attrs[ i ].name, attrs[ i ].value );
  34826. }
  34827. }
  34828. if ( options.withChildren || options.withChildren === undefined ) {
  34829. for ( const child of this.domChildrenToView( domNode, options ) ) {
  34830. viewElement._appendChild( child );
  34831. }
  34832. }
  34833. return viewElement;
  34834. }
  34835. }
  34836. /**
  34837. * Converts children of the DOM element to view nodes using
  34838. * the {@link module:engine/view/domconverter~DomConverter#domToView} method.
  34839. * Additionally this method omits block {@link module:engine/view/filler filler}, if it exists in the DOM parent.
  34840. *
  34841. * @param {HTMLElement} domElement Parent DOM element.
  34842. * @param {Object} options See {@link module:engine/view/domconverter~DomConverter#domToView} options parameter.
  34843. * @returns {Iterable.<module:engine/view/node~Node>} View nodes.
  34844. */
  34845. * domChildrenToView( domElement, options = {} ) {
  34846. for ( let i = 0; i < domElement.childNodes.length; i++ ) {
  34847. const domChild = domElement.childNodes[ i ];
  34848. const viewChild = this.domToView( domChild, options );
  34849. if ( viewChild !== null ) {
  34850. yield viewChild;
  34851. }
  34852. }
  34853. }
  34854. /**
  34855. * Converts DOM selection to view {@link module:engine/view/selection~Selection}.
  34856. * Ranges which cannot be converted will be omitted.
  34857. *
  34858. * @param {Selection} domSelection DOM selection.
  34859. * @returns {module:engine/view/selection~Selection} View selection.
  34860. */
  34861. domSelectionToView( domSelection ) {
  34862. // DOM selection might be placed in fake selection container.
  34863. // If container contains fake selection - return corresponding view selection.
  34864. if ( domSelection.rangeCount === 1 ) {
  34865. let container = domSelection.getRangeAt( 0 ).startContainer;
  34866. // The DOM selection might be moved to the text node inside the fake selection container.
  34867. if ( Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_12__["default"])( container ) ) {
  34868. container = container.parentNode;
  34869. }
  34870. const viewSelection = this.fakeSelectionToView( container );
  34871. if ( viewSelection ) {
  34872. return viewSelection;
  34873. }
  34874. }
  34875. const isBackward = this.isDomSelectionBackward( domSelection );
  34876. const viewRanges = [];
  34877. for ( let i = 0; i < domSelection.rangeCount; i++ ) {
  34878. // DOM Range have correct start and end, no matter what is the DOM Selection direction. So we don't have to fix anything.
  34879. const domRange = domSelection.getRangeAt( i );
  34880. const viewRange = this.domRangeToView( domRange );
  34881. if ( viewRange ) {
  34882. viewRanges.push( viewRange );
  34883. }
  34884. }
  34885. return new _selection__WEBPACK_IMPORTED_MODULE_4__["default"]( viewRanges, { backward: isBackward } );
  34886. }
  34887. /**
  34888. * Converts DOM Range to view {@link module:engine/view/range~Range}.
  34889. * If the start or end position can not be converted `null` is returned.
  34890. *
  34891. * @param {Range} domRange DOM range.
  34892. * @returns {module:engine/view/range~Range|null} View range.
  34893. */
  34894. domRangeToView( domRange ) {
  34895. const viewStart = this.domPositionToView( domRange.startContainer, domRange.startOffset );
  34896. const viewEnd = this.domPositionToView( domRange.endContainer, domRange.endOffset );
  34897. if ( viewStart && viewEnd ) {
  34898. return new _range__WEBPACK_IMPORTED_MODULE_3__["default"]( viewStart, viewEnd );
  34899. }
  34900. return null;
  34901. }
  34902. /**
  34903. * Converts DOM parent and offset to view {@link module:engine/view/position~Position}.
  34904. *
  34905. * If the position is inside a {@link module:engine/view/filler filler} which has no corresponding view node,
  34906. * position of the filler will be converted and returned.
  34907. *
  34908. * If the position is inside DOM element rendered by {@link module:engine/view/uielement~UIElement}
  34909. * that position will be converted to view position before that UIElement.
  34910. *
  34911. * If structures are too different and it is not possible to find corresponding position then `null` will be returned.
  34912. *
  34913. * @param {Node} domParent DOM position parent.
  34914. * @param {Number} domOffset DOM position offset.
  34915. * @returns {module:engine/view/position~Position} viewPosition View position.
  34916. */
  34917. domPositionToView( domParent, domOffset ) {
  34918. if ( this.isBlockFiller( domParent, this.blockFillerMode ) ) {
  34919. return this.domPositionToView( domParent.parentNode, Object(_ckeditor_ckeditor5_utils_src_dom_indexof__WEBPACK_IMPORTED_MODULE_9__["default"])( domParent ) );
  34920. }
  34921. // If position is somewhere inside UIElement or a RawElement - return position before that element.
  34922. const viewElement = this.mapDomToView( domParent );
  34923. if ( viewElement && ( viewElement.is( 'uiElement' ) || viewElement.is( 'rawElement' ) ) ) {
  34924. return _position__WEBPACK_IMPORTED_MODULE_2__["default"]._createBefore( viewElement );
  34925. }
  34926. if ( Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_12__["default"])( domParent ) ) {
  34927. if ( Object(_filler__WEBPACK_IMPORTED_MODULE_7__["isInlineFiller"])( domParent ) ) {
  34928. return this.domPositionToView( domParent.parentNode, Object(_ckeditor_ckeditor5_utils_src_dom_indexof__WEBPACK_IMPORTED_MODULE_9__["default"])( domParent ) );
  34929. }
  34930. const viewParent = this.findCorrespondingViewText( domParent );
  34931. let offset = domOffset;
  34932. if ( !viewParent ) {
  34933. return null;
  34934. }
  34935. if ( Object(_filler__WEBPACK_IMPORTED_MODULE_7__["startsWithFiller"])( domParent ) ) {
  34936. offset -= _filler__WEBPACK_IMPORTED_MODULE_7__["INLINE_FILLER_LENGTH"];
  34937. offset = offset < 0 ? 0 : offset;
  34938. }
  34939. return new _position__WEBPACK_IMPORTED_MODULE_2__["default"]( viewParent, offset );
  34940. }
  34941. // domParent instanceof HTMLElement.
  34942. else {
  34943. if ( domOffset === 0 ) {
  34944. const viewParent = this.mapDomToView( domParent );
  34945. if ( viewParent ) {
  34946. return new _position__WEBPACK_IMPORTED_MODULE_2__["default"]( viewParent, 0 );
  34947. }
  34948. } else {
  34949. const domBefore = domParent.childNodes[ domOffset - 1 ];
  34950. const viewBefore = Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_12__["default"])( domBefore ) ?
  34951. this.findCorrespondingViewText( domBefore ) :
  34952. this.mapDomToView( domBefore );
  34953. // TODO #663
  34954. if ( viewBefore && viewBefore.parent ) {
  34955. return new _position__WEBPACK_IMPORTED_MODULE_2__["default"]( viewBefore.parent, viewBefore.index + 1 );
  34956. }
  34957. }
  34958. return null;
  34959. }
  34960. }
  34961. /**
  34962. * Returns corresponding view {@link module:engine/view/element~Element Element} or
  34963. * {@link module:engine/view/documentfragment~DocumentFragment} for provided DOM element or
  34964. * document fragment. If there is no view item {@link module:engine/view/domconverter~DomConverter#bindElements bound}
  34965. * to the given DOM - `undefined` is returned.
  34966. *
  34967. * For all DOM elements rendered by a {@link module:engine/view/uielement~UIElement} or
  34968. * a {@link module:engine/view/rawelement~RawElement}, the parent `UIElement` or `RawElement` will be returned.
  34969. *
  34970. * @param {DocumentFragment|Element} domElementOrDocumentFragment DOM element or document fragment.
  34971. * @returns {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment|undefined}
  34972. * Corresponding view element, document fragment or `undefined` if no element was bound.
  34973. */
  34974. mapDomToView( domElementOrDocumentFragment ) {
  34975. const hostElement = this.getHostViewElement( domElementOrDocumentFragment );
  34976. return hostElement || this._domToViewMapping.get( domElementOrDocumentFragment );
  34977. }
  34978. /**
  34979. * Finds corresponding text node. Text nodes are not {@link module:engine/view/domconverter~DomConverter#bindElements bound},
  34980. * corresponding text node is returned based on the sibling or parent.
  34981. *
  34982. * If the directly previous sibling is a {@link module:engine/view/domconverter~DomConverter#bindElements bound} element, it is used
  34983. * to find the corresponding text node.
  34984. *
  34985. * If this is a first child in the parent and the parent is a {@link module:engine/view/domconverter~DomConverter#bindElements bound}
  34986. * element, it is used to find the corresponding text node.
  34987. *
  34988. * For all text nodes rendered by a {@link module:engine/view/uielement~UIElement} or
  34989. * a {@link module:engine/view/rawelement~RawElement}, the parent `UIElement` or `RawElement` will be returned.
  34990. *
  34991. * Otherwise `null` is returned.
  34992. *
  34993. * Note that for the block or inline {@link module:engine/view/filler filler} this method returns `null`.
  34994. *
  34995. * @param {Text} domText DOM text node.
  34996. * @returns {module:engine/view/text~Text|null} Corresponding view text node or `null`, if it was not possible to find a
  34997. * corresponding node.
  34998. */
  34999. findCorrespondingViewText( domText ) {
  35000. if ( Object(_filler__WEBPACK_IMPORTED_MODULE_7__["isInlineFiller"])( domText ) ) {
  35001. return null;
  35002. }
  35003. // If DOM text was rendered by a UIElement or a RawElement - return this parent element.
  35004. const hostElement = this.getHostViewElement( domText );
  35005. if ( hostElement ) {
  35006. return hostElement;
  35007. }
  35008. const previousSibling = domText.previousSibling;
  35009. // Try to use previous sibling to find the corresponding text node.
  35010. if ( previousSibling ) {
  35011. if ( !( this.isElement( previousSibling ) ) ) {
  35012. // The previous is text or comment.
  35013. return null;
  35014. }
  35015. const viewElement = this.mapDomToView( previousSibling );
  35016. if ( viewElement ) {
  35017. const nextSibling = viewElement.nextSibling;
  35018. // It might be filler which has no corresponding view node.
  35019. if ( nextSibling instanceof _text__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  35020. return viewElement.nextSibling;
  35021. } else {
  35022. return null;
  35023. }
  35024. }
  35025. }
  35026. // Try to use parent to find the corresponding text node.
  35027. else {
  35028. const viewElement = this.mapDomToView( domText.parentNode );
  35029. if ( viewElement ) {
  35030. const firstChild = viewElement.getChild( 0 );
  35031. // It might be filler which has no corresponding view node.
  35032. if ( firstChild instanceof _text__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  35033. return firstChild;
  35034. } else {
  35035. return null;
  35036. }
  35037. }
  35038. }
  35039. return null;
  35040. }
  35041. /**
  35042. * Returns corresponding DOM item for provided {@link module:engine/view/element~Element Element} or
  35043. * {@link module:engine/view/documentfragment~DocumentFragment DocumentFragment}.
  35044. * To find a corresponding text for {@link module:engine/view/text~Text view Text instance}
  35045. * use {@link #findCorrespondingDomText}.
  35046. *
  35047. * @param {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment} viewNode
  35048. * View element or document fragment.
  35049. * @returns {Node|DocumentFragment|undefined} Corresponding DOM node or document fragment.
  35050. */
  35051. mapViewToDom( documentFragmentOrElement ) {
  35052. return this._viewToDomMapping.get( documentFragmentOrElement );
  35053. }
  35054. /**
  35055. * Finds corresponding text node. Text nodes are not {@link module:engine/view/domconverter~DomConverter#bindElements bound},
  35056. * corresponding text node is returned based on the sibling or parent.
  35057. *
  35058. * If the directly previous sibling is a {@link module:engine/view/domconverter~DomConverter#bindElements bound} element, it is used
  35059. * to find the corresponding text node.
  35060. *
  35061. * If this is a first child in the parent and the parent is a {@link module:engine/view/domconverter~DomConverter#bindElements bound}
  35062. * element, it is used to find the corresponding text node.
  35063. *
  35064. * Otherwise `null` is returned.
  35065. *
  35066. * @param {module:engine/view/text~Text} viewText View text node.
  35067. * @returns {Text|null} Corresponding DOM text node or `null`, if it was not possible to find a corresponding node.
  35068. */
  35069. findCorrespondingDomText( viewText ) {
  35070. const previousSibling = viewText.previousSibling;
  35071. // Try to use previous sibling to find the corresponding text node.
  35072. if ( previousSibling && this.mapViewToDom( previousSibling ) ) {
  35073. return this.mapViewToDom( previousSibling ).nextSibling;
  35074. }
  35075. // If this is a first node, try to use parent to find the corresponding text node.
  35076. if ( !previousSibling && viewText.parent && this.mapViewToDom( viewText.parent ) ) {
  35077. return this.mapViewToDom( viewText.parent ).childNodes[ 0 ];
  35078. }
  35079. return null;
  35080. }
  35081. /**
  35082. * Focuses DOM editable that is corresponding to provided {@link module:engine/view/editableelement~EditableElement}.
  35083. *
  35084. * @param {module:engine/view/editableelement~EditableElement} viewEditable
  35085. */
  35086. focus( viewEditable ) {
  35087. const domEditable = this.mapViewToDom( viewEditable );
  35088. if ( domEditable && domEditable.ownerDocument.activeElement !== domEditable ) {
  35089. // Save the scrollX and scrollY positions before the focus.
  35090. const { scrollX, scrollY } = _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_8__["default"].window;
  35091. const scrollPositions = [];
  35092. // Save all scrollLeft and scrollTop values starting from domEditable up to
  35093. // document#documentElement.
  35094. forEachDomNodeAncestor( domEditable, node => {
  35095. const { scrollLeft, scrollTop } = node;
  35096. scrollPositions.push( [ scrollLeft, scrollTop ] );
  35097. } );
  35098. domEditable.focus();
  35099. // Restore scrollLeft and scrollTop values starting from domEditable up to
  35100. // document#documentElement.
  35101. // https://github.com/ckeditor/ckeditor5-engine/issues/951
  35102. // https://github.com/ckeditor/ckeditor5-engine/issues/957
  35103. forEachDomNodeAncestor( domEditable, node => {
  35104. const [ scrollLeft, scrollTop ] = scrollPositions.shift();
  35105. node.scrollLeft = scrollLeft;
  35106. node.scrollTop = scrollTop;
  35107. } );
  35108. // Restore the scrollX and scrollY positions after the focus.
  35109. // https://github.com/ckeditor/ckeditor5-engine/issues/951
  35110. _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_8__["default"].window.scrollTo( scrollX, scrollY );
  35111. }
  35112. }
  35113. /**
  35114. * Returns `true` when `node.nodeType` equals `Node.ELEMENT_NODE`.
  35115. *
  35116. * @param {Node} node Node to check.
  35117. * @returns {Boolean}
  35118. */
  35119. isElement( node ) {
  35120. return node && node.nodeType == Node.ELEMENT_NODE;
  35121. }
  35122. /**
  35123. * Returns `true` when `node.nodeType` equals `Node.DOCUMENT_FRAGMENT_NODE`.
  35124. *
  35125. * @param {Node} node Node to check.
  35126. * @returns {Boolean}
  35127. */
  35128. isDocumentFragment( node ) {
  35129. return node && node.nodeType == Node.DOCUMENT_FRAGMENT_NODE;
  35130. }
  35131. /**
  35132. * Returns `true` when `node.nodeType` equals `Node.COMMENT_NODE`.
  35133. *
  35134. * @param {Node} node Node to check.
  35135. * @returns {Boolean}
  35136. */
  35137. isComment( node ) {
  35138. return node && node.nodeType == Node.COMMENT_NODE;
  35139. }
  35140. /**
  35141. * Checks if the node is an instance of the block filler for this DOM converter.
  35142. *
  35143. * const converter = new DomConverter( viewDocument, { blockFillerMode: 'br' } );
  35144. *
  35145. * converter.isBlockFiller( BR_FILLER( document ) ); // true
  35146. * converter.isBlockFiller( NBSP_FILLER( document ) ); // false
  35147. *
  35148. * **Note:**: For the `'nbsp'` mode the method also checks context of a node so it cannot be a detached node.
  35149. *
  35150. * **Note:** A special case in the `'nbsp'` mode exists where the `<br>` in `<p><br></p>` is treated as a block filler.
  35151. *
  35152. * @param {Node} domNode DOM node to check.
  35153. * @returns {Boolean} True if a node is considered a block filler for given mode.
  35154. */
  35155. isBlockFiller( domNode ) {
  35156. if ( this.blockFillerMode == 'br' ) {
  35157. return domNode.isEqualNode( BR_FILLER_REF );
  35158. }
  35159. // Special case for <p><br></p> in which case the <br> should be treated as filler even
  35160. // when we're in the 'nbsp' mode. See ckeditor5#5564.
  35161. if ( domNode.tagName === 'BR' && hasBlockParent( domNode, this.blockElements ) && domNode.parentNode.childNodes.length === 1 ) {
  35162. return true;
  35163. }
  35164. return isNbspBlockFiller( domNode, this.blockElements );
  35165. }
  35166. /**
  35167. * Returns `true` if given selection is a backward selection, that is, if it's `focus` is before `anchor`.
  35168. *
  35169. * @param {Selection} DOM Selection instance to check.
  35170. * @returns {Boolean}
  35171. */
  35172. isDomSelectionBackward( selection ) {
  35173. if ( selection.isCollapsed ) {
  35174. return false;
  35175. }
  35176. // Since it takes multiple lines of code to check whether a "DOM Position" is before/after another "DOM Position",
  35177. // we will use the fact that range will collapse if it's end is before it's start.
  35178. const range = document.createRange();
  35179. range.setStart( selection.anchorNode, selection.anchorOffset );
  35180. range.setEnd( selection.focusNode, selection.focusOffset );
  35181. const backward = range.collapsed;
  35182. range.detach();
  35183. return backward;
  35184. }
  35185. /**
  35186. * Returns a parent {@link module:engine/view/uielement~UIElement} or {@link module:engine/view/rawelement~RawElement}
  35187. * that hosts the provided DOM node. Returns `null` if there is no such parent.
  35188. *
  35189. * @param {Node} domNode
  35190. * @returns {module:engine/view/uielement~UIElement|module:engine/view/rawelement~RawElement|null}
  35191. */
  35192. getHostViewElement( domNode ) {
  35193. const ancestors = Object(_ckeditor_ckeditor5_utils_src_dom_getancestors__WEBPACK_IMPORTED_MODULE_10__["default"])( domNode );
  35194. // Remove domNode from the list.
  35195. ancestors.pop();
  35196. while ( ancestors.length ) {
  35197. const domNode = ancestors.pop();
  35198. const viewNode = this._domToViewMapping.get( domNode );
  35199. if ( viewNode && ( viewNode.is( 'uiElement' ) || viewNode.is( 'rawElement' ) ) ) {
  35200. return viewNode;
  35201. }
  35202. }
  35203. return null;
  35204. }
  35205. /**
  35206. * Checks if the given selection's boundaries are at correct places.
  35207. *
  35208. * The following places are considered as incorrect for selection boundaries:
  35209. *
  35210. * * before or in the middle of an inline filler sequence,
  35211. * * inside a DOM element which represents {@link module:engine/view/uielement~UIElement a view UI element},
  35212. * * inside a DOM element which represents {@link module:engine/view/rawelement~RawElement a view raw element}.
  35213. *
  35214. * @param {Selection} domSelection The DOM selection object to be checked.
  35215. * @returns {Boolean} `true` if the given selection is at a correct place, `false` otherwise.
  35216. */
  35217. isDomSelectionCorrect( domSelection ) {
  35218. return this._isDomSelectionPositionCorrect( domSelection.anchorNode, domSelection.anchorOffset ) &&
  35219. this._isDomSelectionPositionCorrect( domSelection.focusNode, domSelection.focusOffset );
  35220. }
  35221. /**
  35222. * Checks if the given DOM position is a correct place for selection boundary. See {@link #isDomSelectionCorrect}.
  35223. *
  35224. * @private
  35225. * @param {Element} domParent Position parent.
  35226. * @param {Number} offset Position offset.
  35227. * @returns {Boolean} `true` if given position is at a correct place for selection boundary, `false` otherwise.
  35228. */
  35229. _isDomSelectionPositionCorrect( domParent, offset ) {
  35230. // If selection is before or in the middle of inline filler string, it is incorrect.
  35231. if ( Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_12__["default"])( domParent ) && Object(_filler__WEBPACK_IMPORTED_MODULE_7__["startsWithFiller"])( domParent ) && offset < _filler__WEBPACK_IMPORTED_MODULE_7__["INLINE_FILLER_LENGTH"] ) {
  35232. // Selection in a text node, at wrong position (before or in the middle of filler).
  35233. return false;
  35234. }
  35235. if ( this.isElement( domParent ) && Object(_filler__WEBPACK_IMPORTED_MODULE_7__["startsWithFiller"])( domParent.childNodes[ offset ] ) ) {
  35236. // Selection in an element node, before filler text node.
  35237. return false;
  35238. }
  35239. const viewParent = this.mapDomToView( domParent );
  35240. // The position is incorrect when anchored inside a UIElement or a RawElement.
  35241. // Note: In case of UIElement and RawElement, mapDomToView() returns a parent element for any DOM child
  35242. // so there's no need to perform any additional checks.
  35243. if ( viewParent && ( viewParent.is( 'uiElement' ) || viewParent.is( 'rawElement' ) ) ) {
  35244. return false;
  35245. }
  35246. return true;
  35247. }
  35248. /**
  35249. * Takes text data from a given {@link module:engine/view/text~Text#data} and processes it so
  35250. * it is correctly displayed in the DOM.
  35251. *
  35252. * Following changes are done:
  35253. *
  35254. * * a space at the beginning is changed to `&nbsp;` if this is the first text node in its container
  35255. * element or if a previous text node ends with a space character,
  35256. * * space at the end of the text node is changed to `&nbsp;` if there are two spaces at the end of a node or if next node
  35257. * starts with a space or if it is the last text node in its container,
  35258. * * remaining spaces are replaced to a chain of spaces and `&nbsp;` (e.g. `'x x'` becomes `'x &nbsp; x'`).
  35259. *
  35260. * Content of {@link #preElements} is not processed.
  35261. *
  35262. * @private
  35263. * @param {module:engine/view/text~Text} node View text node to process.
  35264. * @returns {String} Processed text data.
  35265. */
  35266. _processDataFromViewText( node ) {
  35267. let data = node.data;
  35268. // If any of node ancestors has a name which is in `preElements` array, then currently processed
  35269. // view text node is (will be) in preformatted element. We should not change whitespaces then.
  35270. if ( node.getAncestors().some( parent => this.preElements.includes( parent.name ) ) ) {
  35271. return data;
  35272. }
  35273. // 1. Replace the first space with a nbsp if the previous node ends with a space or there is no previous node
  35274. // (container element boundary).
  35275. if ( data.charAt( 0 ) == ' ' ) {
  35276. const prevNode = this._getTouchingViewTextNode( node, false );
  35277. const prevEndsWithSpace = prevNode && this._nodeEndsWithSpace( prevNode );
  35278. if ( prevEndsWithSpace || !prevNode ) {
  35279. data = '\u00A0' + data.substr( 1 );
  35280. }
  35281. }
  35282. // 2. Replace the last space with nbsp if there are two spaces at the end or if the next node starts with space or there is no
  35283. // next node (container element boundary).
  35284. //
  35285. // Keep in mind that Firefox prefers $nbsp; before tag, not inside it:
  35286. //
  35287. // Foo <span>&nbsp;bar</span> <-- bad.
  35288. // Foo&nbsp;<span> bar</span> <-- good.
  35289. //
  35290. // More here: https://github.com/ckeditor/ckeditor5-engine/issues/1747.
  35291. if ( data.charAt( data.length - 1 ) == ' ' ) {
  35292. const nextNode = this._getTouchingViewTextNode( node, true );
  35293. if ( data.charAt( data.length - 2 ) == ' ' || !nextNode || nextNode.data.charAt( 0 ) == ' ' ) {
  35294. data = data.substr( 0, data.length - 1 ) + '\u00A0';
  35295. }
  35296. }
  35297. // 3. Create space+nbsp pairs.
  35298. return data.replace( / {2}/g, ' \u00A0' );
  35299. }
  35300. /**
  35301. * Checks whether given node ends with a space character after changing appropriate space characters to `&nbsp;`s.
  35302. *
  35303. * @private
  35304. * @param {module:engine/view/text~Text} node Node to check.
  35305. * @returns {Boolean} `true` if given `node` ends with space, `false` otherwise.
  35306. */
  35307. _nodeEndsWithSpace( node ) {
  35308. if ( node.getAncestors().some( parent => this.preElements.includes( parent.name ) ) ) {
  35309. return false;
  35310. }
  35311. const data = this._processDataFromViewText( node );
  35312. return data.charAt( data.length - 1 ) == ' ';
  35313. }
  35314. /**
  35315. * Takes text data from native `Text` node and processes it to a correct {@link module:engine/view/text~Text view text node} data.
  35316. *
  35317. * Following changes are done:
  35318. *
  35319. * * multiple whitespaces are replaced to a single space,
  35320. * * space at the beginning of a text node is removed if it is the first text node in its container
  35321. * element or if the previous text node ends with a space character,
  35322. * * space at the end of the text node is removed if there are two spaces at the end of a node or if next node
  35323. * starts with a space or if it is the last text node in its container
  35324. * * nbsps are converted to spaces.
  35325. *
  35326. * @param {Node} node DOM text node to process.
  35327. * @returns {String} Processed data.
  35328. * @private
  35329. */
  35330. _processDataFromDomText( node ) {
  35331. let data = node.data;
  35332. if ( _hasDomParentOfType( node, this.preElements ) ) {
  35333. return Object(_filler__WEBPACK_IMPORTED_MODULE_7__["getDataWithoutFiller"])( node );
  35334. }
  35335. // Change all consecutive whitespace characters (from the [ \n\t\r] set –
  35336. // see https://github.com/ckeditor/ckeditor5-engine/issues/822#issuecomment-311670249) to a single space character.
  35337. // That's how multiple whitespaces are treated when rendered, so we normalize those whitespaces.
  35338. // We're replacing 1+ (and not 2+) to also normalize singular \n\t\r characters (#822).
  35339. data = data.replace( /[ \n\t\r]{1,}/g, ' ' );
  35340. const prevNode = this._getTouchingInlineDomNode( node, false );
  35341. const nextNode = this._getTouchingInlineDomNode( node, true );
  35342. const shouldLeftTrim = this._checkShouldLeftTrimDomText( prevNode );
  35343. const shouldRightTrim = this._checkShouldRightTrimDomText( node, nextNode );
  35344. // If the previous dom text node does not exist or it ends by whitespace character, remove space character from the beginning
  35345. // of this text node. Such space character is treated as a whitespace.
  35346. if ( shouldLeftTrim ) {
  35347. data = data.replace( /^ /, '' );
  35348. }
  35349. // If the next text node does not exist remove space character from the end of this text node.
  35350. if ( shouldRightTrim ) {
  35351. data = data.replace( / $/, '' );
  35352. }
  35353. // At the beginning and end of a block element, Firefox inserts normal space + <br> instead of non-breaking space.
  35354. // This means that the text node starts/end with normal space instead of non-breaking space.
  35355. // This causes a problem because the normal space would be removed in `.replace` calls above. To prevent that,
  35356. // the inline filler is removed only after the data is initially processed (by the `.replace` above). See ckeditor5#692.
  35357. data = Object(_filler__WEBPACK_IMPORTED_MODULE_7__["getDataWithoutFiller"])( new Text( data ) );
  35358. // At this point we should have removed all whitespaces from DOM text data.
  35359. //
  35360. // Now, We will reverse the process that happens in `_processDataFromViewText`.
  35361. //
  35362. // We have to change &nbsp; chars, that were in DOM text data because of rendering reasons, to spaces.
  35363. // First, change all ` \u00A0` pairs (space + &nbsp;) to two spaces. DOM converter changes two spaces from model/view to
  35364. // ` \u00A0` to ensure proper rendering. Since here we convert back, we recognize those pairs and change them back to ` `.
  35365. data = data.replace( / \u00A0/g, ' ' );
  35366. // Then, let's change the last nbsp to a space.
  35367. if ( /( |\u00A0)\u00A0$/.test( data ) || !nextNode || ( nextNode.data && nextNode.data.charAt( 0 ) == ' ' ) ) {
  35368. data = data.replace( /\u00A0$/, ' ' );
  35369. }
  35370. // Then, change &nbsp; character that is at the beginning of the text node to space character.
  35371. // We do that replacement only if this is the first node or the previous node ends on whitespace character.
  35372. if ( shouldLeftTrim ) {
  35373. data = data.replace( /^\u00A0/, ' ' );
  35374. }
  35375. // At this point, all whitespaces should be removed and all &nbsp; created for rendering reasons should be
  35376. // changed to normal space. All left &nbsp; are &nbsp; inserted intentionally.
  35377. return data;
  35378. }
  35379. /**
  35380. * Helper function which checks if a DOM text node, preceded by the given `prevNode` should
  35381. * be trimmed from the left side.
  35382. *
  35383. * @param {Node} prevNode
  35384. */
  35385. _checkShouldLeftTrimDomText( prevNode ) {
  35386. if ( !prevNode ) {
  35387. return true;
  35388. }
  35389. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_13__["isElement"])( prevNode ) ) {
  35390. return true;
  35391. }
  35392. return /[^\S\u00A0]/.test( prevNode.data.charAt( prevNode.data.length - 1 ) );
  35393. }
  35394. /**
  35395. * Helper function which checks if a DOM text node, succeeded by the given `nextNode` should
  35396. * be trimmed from the right side.
  35397. *
  35398. * @param {Node} node
  35399. * @param {Node} nextNode
  35400. */
  35401. _checkShouldRightTrimDomText( node, nextNode ) {
  35402. if ( nextNode ) {
  35403. return false;
  35404. }
  35405. return !Object(_filler__WEBPACK_IMPORTED_MODULE_7__["startsWithFiller"])( node );
  35406. }
  35407. /**
  35408. * Helper function. For given {@link module:engine/view/text~Text view text node}, it finds previous or next sibling
  35409. * that is contained in the same container element. If there is no such sibling, `null` is returned.
  35410. *
  35411. * @param {module:engine/view/text~Text} node Reference node.
  35412. * @param {Boolean} getNext
  35413. * @returns {module:engine/view/text~Text|null} Touching text node or `null` if there is no next or previous touching text node.
  35414. */
  35415. _getTouchingViewTextNode( node, getNext ) {
  35416. const treeWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_6__["default"]( {
  35417. startPosition: getNext ? _position__WEBPACK_IMPORTED_MODULE_2__["default"]._createAfter( node ) : _position__WEBPACK_IMPORTED_MODULE_2__["default"]._createBefore( node ),
  35418. direction: getNext ? 'forward' : 'backward'
  35419. } );
  35420. for ( const value of treeWalker ) {
  35421. // ViewContainerElement is found on a way to next ViewText node, so given `node` was first/last
  35422. // text node in its container element.
  35423. if ( value.item.is( 'containerElement' ) ) {
  35424. return null;
  35425. }
  35426. // <br> found – it works like a block boundary, so do not scan further.
  35427. else if ( value.item.is( 'element', 'br' ) ) {
  35428. return null;
  35429. }
  35430. // Found a text node in the same container element.
  35431. else if ( value.item.is( '$textProxy' ) ) {
  35432. return value.item;
  35433. }
  35434. }
  35435. return null;
  35436. }
  35437. /**
  35438. * Helper function. For the given text node, it finds the closest touching node which is either
  35439. * a text node or a `<br>`. The search is terminated at block element boundaries and if a matching node
  35440. * wasn't found so far, `null` is returned.
  35441. *
  35442. * In the following DOM structure:
  35443. *
  35444. * <p>foo<b>bar</b><br>bom</p>
  35445. *
  35446. * * `foo` doesn't have its previous touching inline node (`null` is returned),
  35447. * * `foo`'s next touching inline node is `bar`
  35448. * * `bar`'s next touching inline node is `<br>`
  35449. *
  35450. * This method returns text nodes and `<br>` elements because these types of nodes affect how
  35451. * spaces in the given text node need to be converted.
  35452. *
  35453. * @private
  35454. * @param {Text} node
  35455. * @param {Boolean} getNext
  35456. * @returns {Text|Element|null}
  35457. */
  35458. _getTouchingInlineDomNode( node, getNext ) {
  35459. if ( !node.parentNode ) {
  35460. return null;
  35461. }
  35462. const direction = getNext ? 'nextNode' : 'previousNode';
  35463. const document = node.ownerDocument;
  35464. const topmostParent = Object(_ckeditor_ckeditor5_utils_src_dom_getancestors__WEBPACK_IMPORTED_MODULE_10__["default"])( node )[ 0 ];
  35465. const treeWalker = document.createTreeWalker( topmostParent, NodeFilter.SHOW_TEXT | NodeFilter.SHOW_ELEMENT, {
  35466. acceptNode( node ) {
  35467. if ( Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_12__["default"])( node ) ) {
  35468. return NodeFilter.FILTER_ACCEPT;
  35469. }
  35470. if ( node.tagName == 'BR' ) {
  35471. return NodeFilter.FILTER_ACCEPT;
  35472. }
  35473. return NodeFilter.FILTER_SKIP;
  35474. }
  35475. } );
  35476. treeWalker.currentNode = node;
  35477. const touchingNode = treeWalker[ direction ]();
  35478. if ( touchingNode !== null ) {
  35479. const lca = Object(_ckeditor_ckeditor5_utils_src_dom_getcommonancestor__WEBPACK_IMPORTED_MODULE_11__["default"])( node, touchingNode );
  35480. // If there is common ancestor between the text node and next/prev text node,
  35481. // and there are no block elements on a way from the text node to that ancestor,
  35482. // and there are no block elements on a way from next/prev text node to that ancestor...
  35483. if (
  35484. lca &&
  35485. !_hasDomParentOfType( node, this.blockElements, lca ) &&
  35486. !_hasDomParentOfType( touchingNode, this.blockElements, lca )
  35487. ) {
  35488. // Then they are in the same container element.
  35489. return touchingNode;
  35490. }
  35491. }
  35492. return null;
  35493. }
  35494. }
  35495. // Helper function.
  35496. // Used to check if given native `Element` or `Text` node has parent with tag name from `types` array.
  35497. //
  35498. // @param {Node} node
  35499. // @param {Array.<String>} types
  35500. // @param {Boolean} [boundaryParent] Can be given if parents should be checked up to a given element (excluding that element).
  35501. // @returns {Boolean} `true` if such parent exists or `false` if it does not.
  35502. function _hasDomParentOfType( node, types, boundaryParent ) {
  35503. let parents = Object(_ckeditor_ckeditor5_utils_src_dom_getancestors__WEBPACK_IMPORTED_MODULE_10__["default"])( node );
  35504. if ( boundaryParent ) {
  35505. parents = parents.slice( parents.indexOf( boundaryParent ) + 1 );
  35506. }
  35507. return parents.some( parent => parent.tagName && types.includes( parent.tagName.toLowerCase() ) );
  35508. }
  35509. // A helper that executes given callback for each DOM node's ancestor, starting from the given node
  35510. // and ending in document#documentElement.
  35511. //
  35512. // @param {Node} node
  35513. // @param {Function} callback A callback to be executed for each ancestor.
  35514. function forEachDomNodeAncestor( node, callback ) {
  35515. while ( node && node != _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_8__["default"].document ) {
  35516. callback( node );
  35517. node = node.parentNode;
  35518. }
  35519. }
  35520. // Checks if given node is a nbsp block filler.
  35521. //
  35522. // A &nbsp; is a block filler only if it is a single child of a block element.
  35523. //
  35524. // @param {Node} domNode DOM node.
  35525. // @returns {Boolean}
  35526. function isNbspBlockFiller( domNode, blockElements ) {
  35527. const isNBSP = Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_12__["default"])( domNode ) && domNode.data == '\u00A0';
  35528. return isNBSP && hasBlockParent( domNode, blockElements ) && domNode.parentNode.childNodes.length === 1;
  35529. }
  35530. // Checks if domNode has block parent.
  35531. //
  35532. // @param {Node} domNode DOM node.
  35533. // @returns {Boolean}
  35534. function hasBlockParent( domNode, blockElements ) {
  35535. const parent = domNode.parentNode;
  35536. return parent && parent.tagName && blockElements.includes( parent.tagName.toLowerCase() );
  35537. }
  35538. /**
  35539. * Enum representing type of the block filler.
  35540. *
  35541. * Possible values:
  35542. *
  35543. * * `br` - for `<br>` block filler used in editing view,
  35544. * * `nbsp` - for `&nbsp;` block fillers used in the data.
  35545. *
  35546. * @typedef {String} module:engine/view/filler~BlockFillerMode
  35547. */
  35548. /***/ }),
  35549. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/downcastwriter.js":
  35550. /*!****************************************************************************!*\
  35551. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/downcastwriter.js ***!
  35552. \****************************************************************************/
  35553. /*! exports provided: default */
  35554. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  35555. "use strict";
  35556. __webpack_require__.r(__webpack_exports__);
  35557. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DowncastWriter; });
  35558. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
  35559. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/range.js");
  35560. /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js");
  35561. /* harmony import */ var _containerelement__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./containerelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/containerelement.js");
  35562. /* harmony import */ var _attributeelement__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./attributeelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/attributeelement.js");
  35563. /* harmony import */ var _emptyelement__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./emptyelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/emptyelement.js");
  35564. /* harmony import */ var _uielement__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./uielement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/uielement.js");
  35565. /* harmony import */ var _rawelement__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./rawelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/rawelement.js");
  35566. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  35567. /* harmony import */ var _documentfragment__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./documentfragment */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/documentfragment.js");
  35568. /* harmony import */ var _ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
  35569. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js");
  35570. /* harmony import */ var _editableelement__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./editableelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/editableelement.js");
  35571. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  35572. /**
  35573. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  35574. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  35575. */
  35576. /**
  35577. * @module module:engine/view/downcastwriter
  35578. */
  35579. /**
  35580. * View downcast writer.
  35581. *
  35582. * It provides a set of methods used to manipulate view nodes.
  35583. *
  35584. * Do not create an instance of this writer manually. To modify a view structure, use
  35585. * the {@link module:engine/view/view~View#change `View#change()`} block.
  35586. *
  35587. * The `DowncastWriter` is designed to work with semantic views which are the views that were/are being downcasted from the model.
  35588. * To work with ordinary views (e.g. parsed from a pasted content) use the
  35589. * {@link module:engine/view/upcastwriter~UpcastWriter upcast writer}.
  35590. *
  35591. * Read more about changing the view in the {@glink framework/guides/architecture/editing-engine#changing-the-view Changing the view}
  35592. * section of the {@glink framework/guides/architecture/editing-engine Editing engine architecture} guide.
  35593. */
  35594. class DowncastWriter {
  35595. /**
  35596. * @param {module:engine/view/document~Document} document The view document instance.
  35597. */
  35598. constructor( document ) {
  35599. /**
  35600. * The view document instance in which this writer operates.
  35601. *
  35602. * @readonly
  35603. * @type {module:engine/view/document~Document}
  35604. */
  35605. this.document = document;
  35606. /**
  35607. * Holds references to the attribute groups that share the same {@link module:engine/view/attributeelement~AttributeElement#id id}.
  35608. * The keys are `id`s, the values are `Set`s holding {@link module:engine/view/attributeelement~AttributeElement}s.
  35609. *
  35610. * @private
  35611. * @type {Map.<String,Set>}
  35612. */
  35613. this._cloneGroups = new Map();
  35614. }
  35615. /**
  35616. * Sets {@link module:engine/view/documentselection~DocumentSelection selection's} ranges and direction to the
  35617. * specified location based on the given {@link module:engine/view/selection~Selectable selectable}.
  35618. *
  35619. * Usage:
  35620. *
  35621. * // Sets selection to the given range.
  35622. * const range = writer.createRange( start, end );
  35623. * writer.setSelection( range );
  35624. *
  35625. * // Sets backward selection to the given range.
  35626. * const range = writer.createRange( start, end );
  35627. * writer.setSelection( range );
  35628. *
  35629. * // Sets selection to given ranges.
  35630. * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( start2, end2 ) ];
  35631. * writer.setSelection( range );
  35632. *
  35633. * // Sets selection to the other selection.
  35634. * const otherSelection = writer.createSelection();
  35635. * writer.setSelection( otherSelection );
  35636. *
  35637. * // Sets collapsed selection at the given position.
  35638. * const position = writer.createPositionFromPath( root, path );
  35639. * writer.setSelection( position );
  35640. *
  35641. * // Sets collapsed selection at the position of given item and offset.
  35642. * const paragraph = writer.createContainerElement( 'p' );
  35643. * writer.setSelection( paragraph, offset );
  35644. *
  35645. * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of
  35646. * that element and ends after the last child of that element.
  35647. *
  35648. * writer.setSelection( paragraph, 'in' );
  35649. *
  35650. * Creates a range on the {@link module:engine/view/item~Item item} which starts before the item and ends just after the item.
  35651. *
  35652. * writer.setSelection( paragraph, 'on' );
  35653. *
  35654. * // Removes all ranges.
  35655. * writer.setSelection( null );
  35656. *
  35657. * `DowncastWriter#setSelection()` allow passing additional options (`backward`, `fake` and `label`) as the last argument.
  35658. *
  35659. * // Sets selection as backward.
  35660. * writer.setSelection( range, { backward: true } );
  35661. *
  35662. * // Sets selection as fake.
  35663. * // Fake selection does not render as browser native selection over selected elements and is hidden to the user.
  35664. * // This way, no native selection UI artifacts are displayed to the user and selection over elements can be
  35665. * // represented in other way, for example by applying proper CSS class.
  35666. * writer.setSelection( range, { fake: true } );
  35667. *
  35668. * // Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM
  35669. * // (and be properly handled by screen readers).
  35670. * writer.setSelection( range, { fake: true, label: 'foo' } );
  35671. *
  35672. * @param {module:engine/view/selection~Selectable} selectable
  35673. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
  35674. * @param {Object} [options]
  35675. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  35676. * @param {Boolean} [options.fake] Sets this selection instance to be marked as `fake`.
  35677. * @param {String} [options.label] Label for the fake selection.
  35678. */
  35679. setSelection( selectable, placeOrOffset, options ) {
  35680. this.document.selection._setTo( selectable, placeOrOffset, options );
  35681. }
  35682. /**
  35683. * Moves {@link module:engine/view/documentselection~DocumentSelection#focus selection's focus} to the specified location.
  35684. *
  35685. * The location can be specified in the same form as {@link module:engine/view/view~View#createPositionAt view.createPositionAt()}
  35686. * parameters.
  35687. *
  35688. * @param {module:engine/view/item~Item|module:engine/view/position~Position} itemOrPosition
  35689. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  35690. * first parameter is a {@link module:engine/view/item~Item view item}.
  35691. */
  35692. setSelectionFocus( itemOrPosition, offset ) {
  35693. this.document.selection._setFocus( itemOrPosition, offset );
  35694. }
  35695. /**
  35696. * Creates a new {@link module:engine/view/text~Text text node}.
  35697. *
  35698. * writer.createText( 'foo' );
  35699. *
  35700. * @param {String} data The text's data.
  35701. * @returns {module:engine/view/text~Text} The created text node.
  35702. */
  35703. createText( data ) {
  35704. return new _text__WEBPACK_IMPORTED_MODULE_11__["default"]( this.document, data );
  35705. }
  35706. /**
  35707. * Creates a new {@link module:engine/view/attributeelement~AttributeElement}.
  35708. *
  35709. * writer.createAttributeElement( 'strong' );
  35710. * writer.createAttributeElement( 'a', { href: 'foo.bar' } );
  35711. *
  35712. * // Make `<a>` element contain other attributes element so the `<a>` element is not broken.
  35713. * writer.createAttributeElement( 'a', { href: 'foo.bar' }, { priority: 5 } );
  35714. *
  35715. * // Set `id` of a marker element so it is not joined or merged with "normal" elements.
  35716. * writer.createAttributeElement( 'span', { class: 'my-marker' }, { id: 'marker:my' } );
  35717. *
  35718. * @param {String} name Name of the element.
  35719. * @param {Object} [attributes] Element's attributes.
  35720. * @param {Object} [options] Element's options.
  35721. * @param {Number} [options.priority] Element's {@link module:engine/view/attributeelement~AttributeElement#priority priority}.
  35722. * @param {Number|String} [options.id] Element's {@link module:engine/view/attributeelement~AttributeElement#id id}.
  35723. * @returns {module:engine/view/attributeelement~AttributeElement} Created element.
  35724. */
  35725. createAttributeElement( name, attributes, options = {} ) {
  35726. const attributeElement = new _attributeelement__WEBPACK_IMPORTED_MODULE_4__["default"]( this.document, name, attributes );
  35727. if ( options.priority ) {
  35728. attributeElement._priority = options.priority;
  35729. }
  35730. if ( options.id ) {
  35731. attributeElement._id = options.id;
  35732. }
  35733. return attributeElement;
  35734. }
  35735. /**
  35736. * Creates a new {@link module:engine/view/containerelement~ContainerElement}.
  35737. *
  35738. * writer.createContainerElement( 'p' );
  35739. *
  35740. * // Create element with custom attributes.
  35741. * writer.createContainerElement( 'div', { id: 'foo-bar', 'data-baz': '123' } );
  35742. *
  35743. * // Create element with custom styles.
  35744. * writer.createContainerElement( 'p', { style: 'font-weight: bold; padding-bottom: 10px' } );
  35745. *
  35746. * // Create element with custom classes.
  35747. * writer.createContainerElement( 'p', { class: 'foo bar baz' } );
  35748. *
  35749. * @param {String} name Name of the element.
  35750. * @param {Object} [attributes] Elements attributes.
  35751. * @returns {module:engine/view/containerelement~ContainerElement} Created element.
  35752. */
  35753. createContainerElement( name, attributes ) {
  35754. return new _containerelement__WEBPACK_IMPORTED_MODULE_3__["default"]( this.document, name, attributes );
  35755. }
  35756. /**
  35757. * Creates a new {@link module:engine/view/editableelement~EditableElement}.
  35758. *
  35759. * writer.createEditableElement( 'div' );
  35760. * writer.createEditableElement( 'div', { id: 'foo-1234' } );
  35761. *
  35762. * Note: The editable element is to be used in the editing pipeline. Usually, together with
  35763. * {@link module:widget/utils~toWidgetEditable `toWidgetEditable()`}.
  35764. *
  35765. * @param {String} name Name of the element.
  35766. * @param {Object} [attributes] Elements attributes.
  35767. * @returns {module:engine/view/editableelement~EditableElement} Created element.
  35768. */
  35769. createEditableElement( name, attributes ) {
  35770. const editableElement = new _editableelement__WEBPACK_IMPORTED_MODULE_12__["default"]( this.document, name, attributes );
  35771. editableElement._document = this.document;
  35772. return editableElement;
  35773. }
  35774. /**
  35775. * Creates a new {@link module:engine/view/emptyelement~EmptyElement}.
  35776. *
  35777. * writer.createEmptyElement( 'img' );
  35778. * writer.createEmptyElement( 'img', { id: 'foo-1234' } );
  35779. *
  35780. * @param {String} name Name of the element.
  35781. * @param {Object} [attributes] Elements attributes.
  35782. * @returns {module:engine/view/emptyelement~EmptyElement} Created element.
  35783. */
  35784. createEmptyElement( name, attributes ) {
  35785. return new _emptyelement__WEBPACK_IMPORTED_MODULE_5__["default"]( this.document, name, attributes );
  35786. }
  35787. /**
  35788. * Creates a new {@link module:engine/view/uielement~UIElement}.
  35789. *
  35790. * writer.createUIElement( 'span' );
  35791. * writer.createUIElement( 'span', { id: 'foo-1234' } );
  35792. *
  35793. * A custom render function can be provided as the third parameter:
  35794. *
  35795. * writer.createUIElement( 'span', null, function( domDocument ) {
  35796. * const domElement = this.toDomElement( domDocument );
  35797. * domElement.innerHTML = '<b>this is ui element</b>';
  35798. *
  35799. * return domElement;
  35800. * } );
  35801. *
  35802. * Unlike {@link #createRawElement raw elements}, UI elements are by no means editor content, for instance,
  35803. * they are ignored by the editor selection system.
  35804. *
  35805. * You should not use UI elements as data containers. Check out {@link #createRawElement} instead.
  35806. *
  35807. * @param {String} name The name of the element.
  35808. * @param {Object} [attributes] Element attributes.
  35809. * @param {Function} [renderFunction] A custom render function.
  35810. * @returns {module:engine/view/uielement~UIElement} The created element.
  35811. */
  35812. createUIElement( name, attributes, renderFunction ) {
  35813. const uiElement = new _uielement__WEBPACK_IMPORTED_MODULE_6__["default"]( this.document, name, attributes );
  35814. if ( renderFunction ) {
  35815. uiElement.render = renderFunction;
  35816. }
  35817. return uiElement;
  35818. }
  35819. /**
  35820. * Creates a new {@link module:engine/view/rawelement~RawElement}.
  35821. *
  35822. * writer.createRawElement( 'span', { id: 'foo-1234' }, function( domElement ) {
  35823. * domElement.innerHTML = '<b>This is the raw content of the raw element.</b>';
  35824. * } );
  35825. *
  35826. * Raw elements work as data containers ("wrappers", "sandboxes") but their children are not managed or
  35827. * even recognized by the editor. This encapsulation allows integrations to maintain custom DOM structures
  35828. * in the editor content without, for instance, worrying about compatibility with other editor features.
  35829. * Raw elements are a perfect tool for integration with external frameworks and data sources.
  35830. *
  35831. * Unlike {@link #createUIElement UI elements}, raw elements act like "real" editor content (similar to
  35832. * {@link module:engine/view/containerelement~ContainerElement} or {@link module:engine/view/emptyelement~EmptyElement}),
  35833. * and they are considered by the editor selection.
  35834. *
  35835. * You should not use raw elements to render the UI in the editor content. Check out {@link #createUIElement `#createUIElement()`}
  35836. * instead.
  35837. *
  35838. * @param {String} name The name of the element.
  35839. * @param {Object} [attributes] Element attributes.
  35840. * @param {Function} [renderFunction] A custom render function.
  35841. * @returns {module:engine/view/rawelement~RawElement} The created element.
  35842. */
  35843. createRawElement( name, attributes, renderFunction ) {
  35844. const rawElement = new _rawelement__WEBPACK_IMPORTED_MODULE_7__["default"]( this.document, name, attributes );
  35845. rawElement.render = renderFunction || ( () => {} );
  35846. return rawElement;
  35847. }
  35848. /**
  35849. * Adds or overwrites the element's attribute with a specified key and value.
  35850. *
  35851. * writer.setAttribute( 'href', 'http://ckeditor.com', linkElement );
  35852. *
  35853. * @param {String} key The attribute key.
  35854. * @param {String} value The attribute value.
  35855. * @param {module:engine/view/element~Element} element
  35856. */
  35857. setAttribute( key, value, element ) {
  35858. element._setAttribute( key, value );
  35859. }
  35860. /**
  35861. * Removes attribute from the element.
  35862. *
  35863. * writer.removeAttribute( 'href', linkElement );
  35864. *
  35865. * @param {String} key Attribute key.
  35866. * @param {module:engine/view/element~Element} element
  35867. */
  35868. removeAttribute( key, element ) {
  35869. element._removeAttribute( key );
  35870. }
  35871. /**
  35872. * Adds specified class to the element.
  35873. *
  35874. * writer.addClass( 'foo', linkElement );
  35875. * writer.addClass( [ 'foo', 'bar' ], linkElement );
  35876. *
  35877. * @param {Array.<String>|String} className
  35878. * @param {module:engine/view/element~Element} element
  35879. */
  35880. addClass( className, element ) {
  35881. element._addClass( className );
  35882. }
  35883. /**
  35884. * Removes specified class from the element.
  35885. *
  35886. * writer.removeClass( 'foo', linkElement );
  35887. * writer.removeClass( [ 'foo', 'bar' ], linkElement );
  35888. *
  35889. * @param {Array.<String>|String} className
  35890. * @param {module:engine/view/element~Element} element
  35891. */
  35892. removeClass( className, element ) {
  35893. element._removeClass( className );
  35894. }
  35895. /**
  35896. * Adds style to the element.
  35897. *
  35898. * writer.setStyle( 'color', 'red', element );
  35899. * writer.setStyle( {
  35900. * color: 'red',
  35901. * position: 'fixed'
  35902. * }, element );
  35903. *
  35904. * **Note**: The passed style can be normalized if
  35905. * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.
  35906. * See {@link module:engine/view/stylesmap~StylesMap#set `StylesMap#set()`} for details.
  35907. *
  35908. * @param {String|Object} property Property name or object with key - value pairs.
  35909. * @param {String} [value] Value to set. This parameter is ignored if object is provided as the first parameter.
  35910. * @param {module:engine/view/element~Element} element Element to set styles on.
  35911. */
  35912. setStyle( property, value, element ) {
  35913. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_13__["isPlainObject"])( property ) && element === undefined ) {
  35914. element = value;
  35915. }
  35916. element._setStyle( property, value );
  35917. }
  35918. /**
  35919. * Removes specified style from the element.
  35920. *
  35921. * writer.removeStyle( 'color', element ); // Removes 'color' style.
  35922. * writer.removeStyle( [ 'color', 'border-top' ], element ); // Removes both 'color' and 'border-top' styles.
  35923. *
  35924. * **Note**: This method can work with normalized style names if
  35925. * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.
  35926. * See {@link module:engine/view/stylesmap~StylesMap#remove `StylesMap#remove()`} for details.
  35927. *
  35928. * @param {Array.<String>|String} property
  35929. * @param {module:engine/view/element~Element} element
  35930. */
  35931. removeStyle( property, element ) {
  35932. element._removeStyle( property );
  35933. }
  35934. /**
  35935. * Sets a custom property on element. Unlike attributes, custom properties are not rendered to the DOM,
  35936. * so they can be used to add special data to elements.
  35937. *
  35938. * @param {String|Symbol} key
  35939. * @param {*} value
  35940. * @param {module:engine/view/element~Element} element
  35941. */
  35942. setCustomProperty( key, value, element ) {
  35943. element._setCustomProperty( key, value );
  35944. }
  35945. /**
  35946. * Removes a custom property stored under the given key.
  35947. *
  35948. * @param {String|Symbol} key
  35949. * @param {module:engine/view/element~Element} element
  35950. * @returns {Boolean} Returns true if property was removed.
  35951. */
  35952. removeCustomProperty( key, element ) {
  35953. return element._removeCustomProperty( key );
  35954. }
  35955. /**
  35956. * Breaks attribute elements at the provided position or at the boundaries of a provided range. It breaks attribute elements
  35957. * up to their first ancestor that is a container element.
  35958. *
  35959. * In following examples `<p>` is a container, `<b>` and `<u>` are attribute elements:
  35960. *
  35961. * <p>foo<b><u>bar{}</u></b></p> -> <p>foo<b><u>bar</u></b>[]</p>
  35962. * <p>foo<b><u>{}bar</u></b></p> -> <p>foo{}<b><u>bar</u></b></p>
  35963. * <p>foo<b><u>b{}ar</u></b></p> -> <p>foo<b><u>b</u></b>[]<b><u>ar</u></b></p>
  35964. * <p><b>fo{o</b><u>ba}r</u></p> -> <p><b>fo</b><b>o</b><u>ba</u><u>r</u></b></p>
  35965. *
  35966. * **Note:** {@link module:engine/view/documentfragment~DocumentFragment DocumentFragment} is treated like a container.
  35967. *
  35968. * **Note:** The difference between {@link module:engine/view/downcastwriter~DowncastWriter#breakAttributes breakAttributes()} and
  35969. * {@link module:engine/view/downcastwriter~DowncastWriter#breakContainer breakContainer()} is that `breakAttributes()` breaks all
  35970. * {@link module:engine/view/attributeelement~AttributeElement attribute elements} that are ancestors of a given `position`,
  35971. * up to the first encountered {@link module:engine/view/containerelement~ContainerElement container element}.
  35972. * `breakContainer()` assumes that a given `position` is directly in the container element and breaks that container element.
  35973. *
  35974. * Throws the `view-writer-invalid-range-container` {@link module:utils/ckeditorerror~CKEditorError CKEditorError}
  35975. * when the {@link module:engine/view/range~Range#start start}
  35976. * and {@link module:engine/view/range~Range#end end} positions of a passed range are not placed inside same parent container.
  35977. *
  35978. * Throws the `view-writer-cannot-break-empty-element` {@link module:utils/ckeditorerror~CKEditorError CKEditorError}
  35979. * when trying to break attributes inside an {@link module:engine/view/emptyelement~EmptyElement EmptyElement}.
  35980. *
  35981. * Throws the `view-writer-cannot-break-ui-element` {@link module:utils/ckeditorerror~CKEditorError CKEditorError}
  35982. * when trying to break attributes inside a {@link module:engine/view/uielement~UIElement UIElement}.
  35983. *
  35984. * @see module:engine/view/attributeelement~AttributeElement
  35985. * @see module:engine/view/containerelement~ContainerElement
  35986. * @see module:engine/view/downcastwriter~DowncastWriter#breakContainer
  35987. * @param {module:engine/view/position~Position|module:engine/view/range~Range} positionOrRange The position where
  35988. * to break attribute elements.
  35989. * @returns {module:engine/view/position~Position|module:engine/view/range~Range} The new position or range, after breaking the
  35990. * attribute elements.
  35991. */
  35992. breakAttributes( positionOrRange ) {
  35993. if ( positionOrRange instanceof _position__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  35994. return this._breakAttributes( positionOrRange );
  35995. } else {
  35996. return this._breakAttributesRange( positionOrRange );
  35997. }
  35998. }
  35999. /**
  36000. * Breaks a {@link module:engine/view/containerelement~ContainerElement container view element} into two, at the given position.
  36001. * The position has to be directly inside the container element and cannot be in the root. It does not break the conrainer view element
  36002. * if the position is at the beginning or at the end of its parent element.
  36003. *
  36004. * <p>foo^bar</p> -> <p>foo</p><p>bar</p>
  36005. * <div><p>foo</p>^<p>bar</p></div> -> <div><p>foo</p></div><div><p>bar</p></div>
  36006. * <p>^foobar</p> -> ^<p>foobar</p>
  36007. * <p>foobar^</p> -> <p>foobar</p>^
  36008. *
  36009. * **Note:** The difference between {@link module:engine/view/downcastwriter~DowncastWriter#breakAttributes breakAttributes()} and
  36010. * {@link module:engine/view/downcastwriter~DowncastWriter#breakContainer breakContainer()} is that `breakAttributes()` breaks all
  36011. * {@link module:engine/view/attributeelement~AttributeElement attribute elements} that are ancestors of a given `position`,
  36012. * up to the first encountered {@link module:engine/view/containerelement~ContainerElement container element}.
  36013. * `breakContainer()` assumes that the given `position` is directly in the container element and breaks that container element.
  36014. *
  36015. * @see module:engine/view/attributeelement~AttributeElement
  36016. * @see module:engine/view/containerelement~ContainerElement
  36017. * @see module:engine/view/downcastwriter~DowncastWriter#breakAttributes
  36018. * @param {module:engine/view/position~Position} position The position where to break the element.
  36019. * @returns {module:engine/view/position~Position} The position between broken elements. If an element has not been broken,
  36020. * the returned position is placed either before or after it.
  36021. */
  36022. breakContainer( position ) {
  36023. const element = position.parent;
  36024. if ( !( element.is( 'containerElement' ) ) ) {
  36025. /**
  36026. * Trying to break an element which is not a container element.
  36027. *
  36028. * @error view-writer-break-non-container-element
  36029. */
  36030. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-writer-break-non-container-element', this.document );
  36031. }
  36032. if ( !element.parent ) {
  36033. /**
  36034. * Trying to break root element.
  36035. *
  36036. * @error view-writer-break-root
  36037. */
  36038. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-writer-break-root', this.document );
  36039. }
  36040. if ( position.isAtStart ) {
  36041. return _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createBefore( element );
  36042. } else if ( !position.isAtEnd ) {
  36043. const newElement = element._clone( false );
  36044. this.insert( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAfter( element ), newElement );
  36045. const sourceRange = new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( position, _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( element, 'end' ) );
  36046. const targetPosition = new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( newElement, 0 );
  36047. this.move( sourceRange, targetPosition );
  36048. }
  36049. return _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAfter( element );
  36050. }
  36051. /**
  36052. * Merges {@link module:engine/view/attributeelement~AttributeElement attribute elements}. It also merges text nodes if needed.
  36053. * Only {@link module:engine/view/attributeelement~AttributeElement#isSimilar similar} attribute elements can be merged.
  36054. *
  36055. * In following examples `<p>` is a container and `<b>` is an attribute element:
  36056. *
  36057. * <p>foo[]bar</p> -> <p>foo{}bar</p>
  36058. * <p><b>foo</b>[]<b>bar</b></p> -> <p><b>foo{}bar</b></p>
  36059. * <p><b foo="bar">a</b>[]<b foo="baz">b</b></p> -> <p><b foo="bar">a</b>[]<b foo="baz">b</b></p>
  36060. *
  36061. * It will also take care about empty attributes when merging:
  36062. *
  36063. * <p><b>[]</b></p> -> <p>[]</p>
  36064. * <p><b>foo</b><i>[]</i><b>bar</b></p> -> <p><b>foo{}bar</b></p>
  36065. *
  36066. * **Note:** Difference between {@link module:engine/view/downcastwriter~DowncastWriter#mergeAttributes mergeAttributes} and
  36067. * {@link module:engine/view/downcastwriter~DowncastWriter#mergeContainers mergeContainers} is that `mergeAttributes` merges two
  36068. * {@link module:engine/view/attributeelement~AttributeElement attribute elements} or {@link module:engine/view/text~Text text nodes}
  36069. * while `mergeContainer` merges two {@link module:engine/view/containerelement~ContainerElement container elements}.
  36070. *
  36071. * @see module:engine/view/attributeelement~AttributeElement
  36072. * @see module:engine/view/containerelement~ContainerElement
  36073. * @see module:engine/view/downcastwriter~DowncastWriter#mergeContainers
  36074. * @param {module:engine/view/position~Position} position Merge position.
  36075. * @returns {module:engine/view/position~Position} Position after merge.
  36076. */
  36077. mergeAttributes( position ) {
  36078. const positionOffset = position.offset;
  36079. const positionParent = position.parent;
  36080. // When inside text node - nothing to merge.
  36081. if ( positionParent.is( '$text' ) ) {
  36082. return position;
  36083. }
  36084. // When inside empty attribute - remove it.
  36085. if ( positionParent.is( 'attributeElement' ) && positionParent.childCount === 0 ) {
  36086. const parent = positionParent.parent;
  36087. const offset = positionParent.index;
  36088. positionParent._remove();
  36089. this._removeFromClonedElementsGroup( positionParent );
  36090. return this.mergeAttributes( new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( parent, offset ) );
  36091. }
  36092. const nodeBefore = positionParent.getChild( positionOffset - 1 );
  36093. const nodeAfter = positionParent.getChild( positionOffset );
  36094. // Position should be placed between two nodes.
  36095. if ( !nodeBefore || !nodeAfter ) {
  36096. return position;
  36097. }
  36098. // When position is between two text nodes.
  36099. if ( nodeBefore.is( '$text' ) && nodeAfter.is( '$text' ) ) {
  36100. return mergeTextNodes( nodeBefore, nodeAfter );
  36101. }
  36102. // When position is between two same attribute elements.
  36103. else if ( nodeBefore.is( 'attributeElement' ) && nodeAfter.is( 'attributeElement' ) && nodeBefore.isSimilar( nodeAfter ) ) {
  36104. // Move all children nodes from node placed after selection and remove that node.
  36105. const count = nodeBefore.childCount;
  36106. nodeBefore._appendChild( nodeAfter.getChildren() );
  36107. nodeAfter._remove();
  36108. this._removeFromClonedElementsGroup( nodeAfter );
  36109. // New position is located inside the first node, before new nodes.
  36110. // Call this method recursively to merge again if needed.
  36111. return this.mergeAttributes( new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( nodeBefore, count ) );
  36112. }
  36113. return position;
  36114. }
  36115. /**
  36116. * Merges two {@link module:engine/view/containerelement~ContainerElement container elements} that are before and after given position.
  36117. * Precisely, the element after the position is removed and it's contents are moved to element before the position.
  36118. *
  36119. * <p>foo</p>^<p>bar</p> -> <p>foo^bar</p>
  36120. * <div>foo</div>^<p>bar</p> -> <div>foo^bar</div>
  36121. *
  36122. * **Note:** Difference between {@link module:engine/view/downcastwriter~DowncastWriter#mergeAttributes mergeAttributes} and
  36123. * {@link module:engine/view/downcastwriter~DowncastWriter#mergeContainers mergeContainers} is that `mergeAttributes` merges two
  36124. * {@link module:engine/view/attributeelement~AttributeElement attribute elements} or {@link module:engine/view/text~Text text nodes}
  36125. * while `mergeContainer` merges two {@link module:engine/view/containerelement~ContainerElement container elements}.
  36126. *
  36127. * @see module:engine/view/attributeelement~AttributeElement
  36128. * @see module:engine/view/containerelement~ContainerElement
  36129. * @see module:engine/view/downcastwriter~DowncastWriter#mergeAttributes
  36130. * @param {module:engine/view/position~Position} position Merge position.
  36131. * @returns {module:engine/view/position~Position} Position after merge.
  36132. */
  36133. mergeContainers( position ) {
  36134. const prev = position.nodeBefore;
  36135. const next = position.nodeAfter;
  36136. if ( !prev || !next || !prev.is( 'containerElement' ) || !next.is( 'containerElement' ) ) {
  36137. /**
  36138. * Element before and after given position cannot be merged.
  36139. *
  36140. * @error view-writer-merge-containers-invalid-position
  36141. */
  36142. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-writer-merge-containers-invalid-position', this.document );
  36143. }
  36144. const lastChild = prev.getChild( prev.childCount - 1 );
  36145. const newPosition = lastChild instanceof _text__WEBPACK_IMPORTED_MODULE_11__["default"] ? _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( lastChild, 'end' ) : _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( prev, 'end' );
  36146. this.move( _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createIn( next ), _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( prev, 'end' ) );
  36147. this.remove( _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( next ) );
  36148. return newPosition;
  36149. }
  36150. /**
  36151. * Inserts a node or nodes at specified position. Takes care about breaking attributes before insertion
  36152. * and merging them afterwards.
  36153. *
  36154. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-insert-invalid-node` when nodes to insert
  36155. * contains instances that are not {@link module:engine/view/text~Text Texts},
  36156. * {@link module:engine/view/attributeelement~AttributeElement AttributeElements},
  36157. * {@link module:engine/view/containerelement~ContainerElement ContainerElements},
  36158. * {@link module:engine/view/emptyelement~EmptyElement EmptyElements},
  36159. * {@link module:engine/view/rawelement~RawElement RawElements} or
  36160. * {@link module:engine/view/uielement~UIElement UIElements}.
  36161. *
  36162. * @param {module:engine/view/position~Position} position Insertion position.
  36163. * @param {module:engine/view/text~Text|module:engine/view/attributeelement~AttributeElement|
  36164. * module:engine/view/containerelement~ContainerElement|module:engine/view/emptyelement~EmptyElement|
  36165. * module:engine/view/rawelement~RawElement|module:engine/view/uielement~UIElement|
  36166. * Iterable.<module:engine/view/text~Text|
  36167. * module:engine/view/attributeelement~AttributeElement|module:engine/view/containerelement~ContainerElement|
  36168. * module:engine/view/emptyelement~EmptyElement|module:engine/view/rawelement~RawElement|
  36169. * module:engine/view/uielement~UIElement>} nodes Node or nodes to insert.
  36170. * @returns {module:engine/view/range~Range} Range around inserted nodes.
  36171. */
  36172. insert( position, nodes ) {
  36173. nodes = Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_10__["default"])( nodes ) ? [ ...nodes ] : [ nodes ];
  36174. // Check if nodes to insert are instances of AttributeElements, ContainerElements, EmptyElements, UIElements or Text.
  36175. validateNodesToInsert( nodes, this.document );
  36176. const container = getParentContainer( position );
  36177. if ( !container ) {
  36178. /**
  36179. * Position's parent container cannot be found.
  36180. *
  36181. * @error view-writer-invalid-position-container
  36182. */
  36183. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"](
  36184. 'view-writer-invalid-position-container',
  36185. this.document
  36186. );
  36187. }
  36188. const insertionPosition = this._breakAttributes( position, true );
  36189. const length = container._insertChild( insertionPosition.offset, nodes );
  36190. for ( const node of nodes ) {
  36191. this._addToClonedElementsGroup( node );
  36192. }
  36193. const endPosition = insertionPosition.getShiftedBy( length );
  36194. const start = this.mergeAttributes( insertionPosition );
  36195. // When no nodes were inserted - return collapsed range.
  36196. if ( length === 0 ) {
  36197. return new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( start, start );
  36198. } else {
  36199. // If start position was merged - move end position.
  36200. if ( !start.isEqual( insertionPosition ) ) {
  36201. endPosition.offset--;
  36202. }
  36203. const end = this.mergeAttributes( endPosition );
  36204. return new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( start, end );
  36205. }
  36206. }
  36207. /**
  36208. * Removes provided range from the container.
  36209. *
  36210. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-invalid-range-container` when
  36211. * {@link module:engine/view/range~Range#start start} and {@link module:engine/view/range~Range#end end} positions are not placed inside
  36212. * same parent container.
  36213. *
  36214. * @param {module:engine/view/range~Range|module:engine/view/item~Item} rangeOrItem Range to remove from container
  36215. * or an {@link module:engine/view/item~Item item} to remove. If range is provided, after removing, it will be updated
  36216. * to a collapsed range showing the new position.
  36217. * @returns {module:engine/view/documentfragment~DocumentFragment} Document fragment containing removed nodes.
  36218. */
  36219. remove( rangeOrItem ) {
  36220. const range = rangeOrItem instanceof _range__WEBPACK_IMPORTED_MODULE_1__["default"] ? rangeOrItem : _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( rangeOrItem );
  36221. validateRangeContainer( range, this.document );
  36222. // If range is collapsed - nothing to remove.
  36223. if ( range.isCollapsed ) {
  36224. return new _documentfragment__WEBPACK_IMPORTED_MODULE_9__["default"]( this.document );
  36225. }
  36226. // Break attributes at range start and end.
  36227. const { start: breakStart, end: breakEnd } = this._breakAttributesRange( range, true );
  36228. const parentContainer = breakStart.parent;
  36229. const count = breakEnd.offset - breakStart.offset;
  36230. // Remove nodes in range.
  36231. const removed = parentContainer._removeChildren( breakStart.offset, count );
  36232. for ( const node of removed ) {
  36233. this._removeFromClonedElementsGroup( node );
  36234. }
  36235. // Merge after removing.
  36236. const mergePosition = this.mergeAttributes( breakStart );
  36237. range.start = mergePosition;
  36238. range.end = mergePosition.clone();
  36239. // Return removed nodes.
  36240. return new _documentfragment__WEBPACK_IMPORTED_MODULE_9__["default"]( this.document, removed );
  36241. }
  36242. /**
  36243. * Removes matching elements from given range.
  36244. *
  36245. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-invalid-range-container` when
  36246. * {@link module:engine/view/range~Range#start start} and {@link module:engine/view/range~Range#end end} positions are not placed inside
  36247. * same parent container.
  36248. *
  36249. * @param {module:engine/view/range~Range} range Range to clear.
  36250. * @param {module:engine/view/element~Element} element Element to remove.
  36251. */
  36252. clear( range, element ) {
  36253. validateRangeContainer( range, this.document );
  36254. // Create walker on given range.
  36255. // We walk backward because when we remove element during walk it modifies range end position.
  36256. const walker = range.getWalker( {
  36257. direction: 'backward',
  36258. ignoreElementEnd: true
  36259. } );
  36260. // Let's walk.
  36261. for ( const current of walker ) {
  36262. const item = current.item;
  36263. let rangeToRemove;
  36264. // When current item matches to the given element.
  36265. if ( item.is( 'element' ) && element.isSimilar( item ) ) {
  36266. // Create range on this element.
  36267. rangeToRemove = _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( item );
  36268. // When range starts inside Text or TextProxy element.
  36269. } else if ( !current.nextPosition.isAfter( range.start ) && item.is( '$textProxy' ) ) {
  36270. // We need to check if parent of this text matches to given element.
  36271. const parentElement = item.getAncestors().find( ancestor => {
  36272. return ancestor.is( 'element' ) && element.isSimilar( ancestor );
  36273. } );
  36274. // If it is then create range inside this element.
  36275. if ( parentElement ) {
  36276. rangeToRemove = _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createIn( parentElement );
  36277. }
  36278. }
  36279. // If we have found element to remove.
  36280. if ( rangeToRemove ) {
  36281. // We need to check if element range stick out of the given range and truncate if it is.
  36282. if ( rangeToRemove.end.isAfter( range.end ) ) {
  36283. rangeToRemove.end = range.end;
  36284. }
  36285. if ( rangeToRemove.start.isBefore( range.start ) ) {
  36286. rangeToRemove.start = range.start;
  36287. }
  36288. // At the end we remove range with found element.
  36289. this.remove( rangeToRemove );
  36290. }
  36291. }
  36292. }
  36293. /**
  36294. * Moves nodes from provided range to target position.
  36295. *
  36296. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-invalid-range-container` when
  36297. * {@link module:engine/view/range~Range#start start} and {@link module:engine/view/range~Range#end end} positions are not placed inside
  36298. * same parent container.
  36299. *
  36300. * @param {module:engine/view/range~Range} sourceRange Range containing nodes to move.
  36301. * @param {module:engine/view/position~Position} targetPosition Position to insert.
  36302. * @returns {module:engine/view/range~Range} Range in target container. Inserted nodes are placed between
  36303. * {@link module:engine/view/range~Range#start start} and {@link module:engine/view/range~Range#end end} positions.
  36304. */
  36305. move( sourceRange, targetPosition ) {
  36306. let nodes;
  36307. if ( targetPosition.isAfter( sourceRange.end ) ) {
  36308. targetPosition = this._breakAttributes( targetPosition, true );
  36309. const parent = targetPosition.parent;
  36310. const countBefore = parent.childCount;
  36311. sourceRange = this._breakAttributesRange( sourceRange, true );
  36312. nodes = this.remove( sourceRange );
  36313. targetPosition.offset += ( parent.childCount - countBefore );
  36314. } else {
  36315. nodes = this.remove( sourceRange );
  36316. }
  36317. return this.insert( targetPosition, nodes );
  36318. }
  36319. /**
  36320. * Wraps elements within range with provided {@link module:engine/view/attributeelement~AttributeElement AttributeElement}.
  36321. * If a collapsed range is provided, it will be wrapped only if it is equal to view selection.
  36322. *
  36323. * If a collapsed range was passed and is same as selection, the selection
  36324. * will be moved to the inside of the wrapped attribute element.
  36325. *
  36326. * Throws {@link module:utils/ckeditorerror~CKEditorError} `view-writer-invalid-range-container`
  36327. * when {@link module:engine/view/range~Range#start}
  36328. * and {@link module:engine/view/range~Range#end} positions are not placed inside same parent container.
  36329. *
  36330. * Throws {@link module:utils/ckeditorerror~CKEditorError} `view-writer-wrap-invalid-attribute` when passed attribute element is not
  36331. * an instance of {@link module:engine/view/attributeelement~AttributeElement AttributeElement}.
  36332. *
  36333. * Throws {@link module:utils/ckeditorerror~CKEditorError} `view-writer-wrap-nonselection-collapsed-range` when passed range
  36334. * is collapsed and different than view selection.
  36335. *
  36336. * @param {module:engine/view/range~Range} range Range to wrap.
  36337. * @param {module:engine/view/attributeelement~AttributeElement} attribute Attribute element to use as wrapper.
  36338. * @returns {module:engine/view/range~Range} range Range after wrapping, spanning over wrapping attribute element.
  36339. */
  36340. wrap( range, attribute ) {
  36341. if ( !( attribute instanceof _attributeelement__WEBPACK_IMPORTED_MODULE_4__["default"] ) ) {
  36342. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"](
  36343. 'view-writer-wrap-invalid-attribute',
  36344. this.document
  36345. );
  36346. }
  36347. validateRangeContainer( range, this.document );
  36348. if ( !range.isCollapsed ) {
  36349. // Non-collapsed range. Wrap it with the attribute element.
  36350. return this._wrapRange( range, attribute );
  36351. } else {
  36352. // Collapsed range. Wrap position.
  36353. let position = range.start;
  36354. if ( position.parent.is( 'element' ) && !_hasNonUiChildren( position.parent ) ) {
  36355. position = position.getLastMatchingPosition( value => value.item.is( 'uiElement' ) );
  36356. }
  36357. position = this._wrapPosition( position, attribute );
  36358. const viewSelection = this.document.selection;
  36359. // If wrapping position is equal to view selection, move view selection inside wrapping attribute element.
  36360. if ( viewSelection.isCollapsed && viewSelection.getFirstPosition().isEqual( range.start ) ) {
  36361. this.setSelection( position );
  36362. }
  36363. return new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( position );
  36364. }
  36365. }
  36366. /**
  36367. * Unwraps nodes within provided range from attribute element.
  36368. *
  36369. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-invalid-range-container` when
  36370. * {@link module:engine/view/range~Range#start start} and {@link module:engine/view/range~Range#end end} positions are not placed inside
  36371. * same parent container.
  36372. *
  36373. * @param {module:engine/view/range~Range} range
  36374. * @param {module:engine/view/attributeelement~AttributeElement} attribute
  36375. */
  36376. unwrap( range, attribute ) {
  36377. if ( !( attribute instanceof _attributeelement__WEBPACK_IMPORTED_MODULE_4__["default"] ) ) {
  36378. /**
  36379. * The `attribute` passed to {@link module:engine/view/downcastwriter~DowncastWriter#unwrap `DowncastWriter#unwrap()`}
  36380. * must be an instance of {@link module:engine/view/attributeelement~AttributeElement `AttributeElement`}.
  36381. *
  36382. * @error view-writer-unwrap-invalid-attribute
  36383. */
  36384. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"](
  36385. 'view-writer-unwrap-invalid-attribute',
  36386. this.document
  36387. );
  36388. }
  36389. validateRangeContainer( range, this.document );
  36390. // If range is collapsed - nothing to unwrap.
  36391. if ( range.isCollapsed ) {
  36392. return range;
  36393. }
  36394. // Break attributes at range start and end.
  36395. const { start: breakStart, end: breakEnd } = this._breakAttributesRange( range, true );
  36396. const parentContainer = breakStart.parent;
  36397. // Unwrap children located between break points.
  36398. const newRange = this._unwrapChildren( parentContainer, breakStart.offset, breakEnd.offset, attribute );
  36399. // Merge attributes at the both ends and return a new range.
  36400. const start = this.mergeAttributes( newRange.start );
  36401. // If start position was merged - move end position back.
  36402. if ( !start.isEqual( newRange.start ) ) {
  36403. newRange.end.offset--;
  36404. }
  36405. const end = this.mergeAttributes( newRange.end );
  36406. return new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( start, end );
  36407. }
  36408. /**
  36409. * Renames element by creating a copy of renamed element but with changed name and then moving contents of the
  36410. * old element to the new one. Keep in mind that this will invalidate all {@link module:engine/view/position~Position positions} which
  36411. * has renamed element as {@link module:engine/view/position~Position#parent a parent}.
  36412. *
  36413. * New element has to be created because `Element#tagName` property in DOM is readonly.
  36414. *
  36415. * Since this function creates a new element and removes the given one, the new element is returned to keep reference.
  36416. *
  36417. * @param {String} newName New name for element.
  36418. * @param {module:engine/view/containerelement~ContainerElement} viewElement Element to be renamed.
  36419. */
  36420. rename( newName, viewElement ) {
  36421. const newElement = new _containerelement__WEBPACK_IMPORTED_MODULE_3__["default"]( this.document, newName, viewElement.getAttributes() );
  36422. this.insert( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAfter( viewElement ), newElement );
  36423. this.move( _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createIn( viewElement ), _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( newElement, 0 ) );
  36424. this.remove( _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( viewElement ) );
  36425. return newElement;
  36426. }
  36427. /**
  36428. * Cleans up memory by removing obsolete cloned elements group from the writer.
  36429. *
  36430. * Should be used whenever all {@link module:engine/view/attributeelement~AttributeElement attribute elements}
  36431. * with the same {@link module:engine/view/attributeelement~AttributeElement#id id} are going to be removed from the view and
  36432. * the group will no longer be needed.
  36433. *
  36434. * Cloned elements group are not removed automatically in case if the group is still needed after all its elements
  36435. * were removed from the view.
  36436. *
  36437. * Keep in mind that group names are equal to the `id` property of the attribute element.
  36438. *
  36439. * @param {String} groupName Name of the group to clear.
  36440. */
  36441. clearClonedElementsGroup( groupName ) {
  36442. this._cloneGroups.delete( groupName );
  36443. }
  36444. /**
  36445. * Creates position at the given location. The location can be specified as:
  36446. *
  36447. * * a {@link module:engine/view/position~Position position},
  36448. * * parent element and offset (offset defaults to `0`),
  36449. * * parent element and `'end'` (sets position at the end of that element),
  36450. * * {@link module:engine/view/item~Item view item} and `'before'` or `'after'` (sets position before or after given view item).
  36451. *
  36452. * This method is a shortcut to other constructors such as:
  36453. *
  36454. * * {@link #createPositionBefore},
  36455. * * {@link #createPositionAfter},
  36456. *
  36457. * @param {module:engine/view/item~Item|module:engine/model/position~Position} itemOrPosition
  36458. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  36459. * first parameter is a {@link module:engine/view/item~Item view item}.
  36460. */
  36461. createPositionAt( itemOrPosition, offset ) {
  36462. return _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAt( itemOrPosition, offset );
  36463. }
  36464. /**
  36465. * Creates a new position after given view item.
  36466. *
  36467. * @param {module:engine/view/item~Item} item View item after which the position should be located.
  36468. * @returns {module:engine/view/position~Position}
  36469. */
  36470. createPositionAfter( item ) {
  36471. return _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAfter( item );
  36472. }
  36473. /**
  36474. * Creates a new position before given view item.
  36475. *
  36476. * @param {module:engine/view/item~Item} item View item before which the position should be located.
  36477. * @returns {module:engine/view/position~Position}
  36478. */
  36479. createPositionBefore( item ) {
  36480. return _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createBefore( item );
  36481. }
  36482. /**
  36483. * Creates a range spanning from `start` position to `end` position.
  36484. *
  36485. * **Note:** This factory method creates its own {@link module:engine/view/position~Position} instances basing on passed values.
  36486. *
  36487. * @param {module:engine/view/position~Position} start Start position.
  36488. * @param {module:engine/view/position~Position} [end] End position. If not set, range will be collapsed at `start` position.
  36489. * @returns {module:engine/view/range~Range}
  36490. */
  36491. createRange( start, end ) {
  36492. return new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( start, end );
  36493. }
  36494. /**
  36495. * Creates a range that starts before given {@link module:engine/view/item~Item view item} and ends after it.
  36496. *
  36497. * @param {module:engine/view/item~Item} item
  36498. * @returns {module:engine/view/range~Range}
  36499. */
  36500. createRangeOn( item ) {
  36501. return _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( item );
  36502. }
  36503. /**
  36504. * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of
  36505. * that element and ends after the last child of that element.
  36506. *
  36507. * @param {module:engine/view/element~Element} element Element which is a parent for the range.
  36508. * @returns {module:engine/view/range~Range}
  36509. */
  36510. createRangeIn( element ) {
  36511. return _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createIn( element );
  36512. }
  36513. /**
  36514. Creates new {@link module:engine/view/selection~Selection} instance.
  36515. *
  36516. * // Creates empty selection without ranges.
  36517. * const selection = writer.createSelection();
  36518. *
  36519. * // Creates selection at the given range.
  36520. * const range = writer.createRange( start, end );
  36521. * const selection = writer.createSelection( range );
  36522. *
  36523. * // Creates selection at the given ranges
  36524. * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];
  36525. * const selection = writer.createSelection( ranges );
  36526. *
  36527. * // Creates selection from the other selection.
  36528. * const otherSelection = writer.createSelection();
  36529. * const selection = writer.createSelection( otherSelection );
  36530. *
  36531. * // Creates selection from the document selection.
  36532. * const selection = writer.createSelection( editor.editing.view.document.selection );
  36533. *
  36534. * // Creates selection at the given position.
  36535. * const position = writer.createPositionFromPath( root, path );
  36536. * const selection = writer.createSelection( position );
  36537. *
  36538. * // Creates collapsed selection at the position of given item and offset.
  36539. * const paragraph = writer.createContainerElement( 'p' );
  36540. * const selection = writer.createSelection( paragraph, offset );
  36541. *
  36542. * // Creates a range inside an {@link module:engine/view/element~Element element} which starts before the
  36543. * // first child of that element and ends after the last child of that element.
  36544. * const selection = writer.createSelection( paragraph, 'in' );
  36545. *
  36546. * // Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends
  36547. * // just after the item.
  36548. * const selection = writer.createSelection( paragraph, 'on' );
  36549. *
  36550. * `Selection`'s constructor allow passing additional options (`backward`, `fake` and `label`) as the last argument.
  36551. *
  36552. * // Creates backward selection.
  36553. * const selection = writer.createSelection( range, { backward: true } );
  36554. *
  36555. * Fake selection does not render as browser native selection over selected elements and is hidden to the user.
  36556. * This way, no native selection UI artifacts are displayed to the user and selection over elements can be
  36557. * represented in other way, for example by applying proper CSS class.
  36558. *
  36559. * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM
  36560. * (and be properly handled by screen readers).
  36561. *
  36562. * // Creates fake selection with label.
  36563. * const selection = writer.createSelection( range, { fake: true, label: 'foo' } );
  36564. *
  36565. * @param {module:engine/view/selection~Selectable} [selectable=null]
  36566. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Offset or place when selectable is an `Item`.
  36567. * @param {Object} [options]
  36568. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  36569. * @param {Boolean} [options.fake] Sets this selection instance to be marked as `fake`.
  36570. * @param {String} [options.label] Label for the fake selection.
  36571. * @returns {module:engine/view/selection~Selection}
  36572. */
  36573. createSelection( selectable, placeOrOffset, options ) {
  36574. return new _selection__WEBPACK_IMPORTED_MODULE_2__["default"]( selectable, placeOrOffset, options );
  36575. }
  36576. /**
  36577. * Wraps children with provided `wrapElement`. Only children contained in `parent` element between
  36578. * `startOffset` and `endOffset` will be wrapped.
  36579. *
  36580. * @private
  36581. * @param {module:engine/view/element~Element} parent
  36582. * @param {Number} startOffset
  36583. * @param {Number} endOffset
  36584. * @param {module:engine/view/element~Element} wrapElement
  36585. */
  36586. _wrapChildren( parent, startOffset, endOffset, wrapElement ) {
  36587. let i = startOffset;
  36588. const wrapPositions = [];
  36589. while ( i < endOffset ) {
  36590. const child = parent.getChild( i );
  36591. const isText = child.is( '$text' );
  36592. const isAttribute = child.is( 'attributeElement' );
  36593. const isEmpty = child.is( 'emptyElement' );
  36594. const isUI = child.is( 'uiElement' );
  36595. const isRaw = child.is( 'rawElement' );
  36596. //
  36597. // (In all examples, assume that `wrapElement` is `<span class="foo">` element.)
  36598. //
  36599. // Check if `wrapElement` can be joined with the wrapped element. One of requirements is having same name.
  36600. // If possible, join elements.
  36601. //
  36602. // <p><span class="bar">abc</span></p> --> <p><span class="foo bar">abc</span></p>
  36603. //
  36604. if ( isAttribute && this._wrapAttributeElement( wrapElement, child ) ) {
  36605. wrapPositions.push( new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( parent, i ) );
  36606. }
  36607. //
  36608. // Wrap the child if it is not an attribute element or if it is an attribute element that should be inside
  36609. // `wrapElement` (due to priority).
  36610. //
  36611. // <p>abc</p> --> <p><span class="foo">abc</span></p>
  36612. // <p><strong>abc</strong></p> --> <p><span class="foo"><strong>abc</strong></span></p>
  36613. else if ( isText || isEmpty || isUI || isRaw || ( isAttribute && shouldABeOutsideB( wrapElement, child ) ) ) {
  36614. // Clone attribute.
  36615. const newAttribute = wrapElement._clone();
  36616. // Wrap current node with new attribute.
  36617. child._remove();
  36618. newAttribute._appendChild( child );
  36619. parent._insertChild( i, newAttribute );
  36620. this._addToClonedElementsGroup( newAttribute );
  36621. wrapPositions.push( new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( parent, i ) );
  36622. }
  36623. //
  36624. // If other nested attribute is found and it wasn't wrapped (see above), continue wrapping inside it.
  36625. //
  36626. // <p><a href="foo.html">abc</a></p> --> <p><a href="foo.html"><span class="foo">abc</span></a></p>
  36627. //
  36628. else if ( isAttribute ) {
  36629. this._wrapChildren( child, 0, child.childCount, wrapElement );
  36630. }
  36631. i++;
  36632. }
  36633. // Merge at each wrap.
  36634. let offsetChange = 0;
  36635. for ( const position of wrapPositions ) {
  36636. position.offset -= offsetChange;
  36637. // Do not merge with elements outside selected children.
  36638. if ( position.offset == startOffset ) {
  36639. continue;
  36640. }
  36641. const newPosition = this.mergeAttributes( position );
  36642. // If nodes were merged - other merge offsets will change.
  36643. if ( !newPosition.isEqual( position ) ) {
  36644. offsetChange++;
  36645. endOffset--;
  36646. }
  36647. }
  36648. return _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createFromParentsAndOffsets( parent, startOffset, parent, endOffset );
  36649. }
  36650. /**
  36651. * Unwraps children from provided `unwrapElement`. Only children contained in `parent` element between
  36652. * `startOffset` and `endOffset` will be unwrapped.
  36653. *
  36654. * @private
  36655. * @param {module:engine/view/element~Element} parent
  36656. * @param {Number} startOffset
  36657. * @param {Number} endOffset
  36658. * @param {module:engine/view/element~Element} unwrapElement
  36659. */
  36660. _unwrapChildren( parent, startOffset, endOffset, unwrapElement ) {
  36661. let i = startOffset;
  36662. const unwrapPositions = [];
  36663. // Iterate over each element between provided offsets inside parent.
  36664. // We don't use tree walker or range iterator because we will be removing and merging potentially multiple nodes,
  36665. // so it could get messy. It is safer to it manually in this case.
  36666. while ( i < endOffset ) {
  36667. const child = parent.getChild( i );
  36668. // Skip all text nodes. There should be no container element's here either.
  36669. if ( !child.is( 'attributeElement' ) ) {
  36670. i++;
  36671. continue;
  36672. }
  36673. //
  36674. // (In all examples, assume that `unwrapElement` is `<span class="foo">` element.)
  36675. //
  36676. // If the child is similar to the given attribute element, unwrap it - it will be completely removed.
  36677. //
  36678. // <p><span class="foo">abc</span>xyz</p> --> <p>abcxyz</p>
  36679. //
  36680. if ( child.isSimilar( unwrapElement ) ) {
  36681. const unwrapped = child.getChildren();
  36682. const count = child.childCount;
  36683. // Replace wrapper element with its children
  36684. child._remove();
  36685. parent._insertChild( i, unwrapped );
  36686. this._removeFromClonedElementsGroup( child );
  36687. // Save start and end position of moved items.
  36688. unwrapPositions.push(
  36689. new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( parent, i ),
  36690. new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( parent, i + count )
  36691. );
  36692. // Skip elements that were unwrapped. Assuming there won't be another element to unwrap in child elements.
  36693. i += count;
  36694. endOffset += count - 1;
  36695. continue;
  36696. }
  36697. //
  36698. // If the child is not similar but is an attribute element, try partial unwrapping - remove the same attributes/styles/classes.
  36699. // Partial unwrapping will happen only if the elements have the same name.
  36700. //
  36701. // <p><span class="foo bar">abc</span>xyz</p> --> <p><span class="bar">abc</span>xyz</p>
  36702. // <p><i class="foo">abc</i>xyz</p> --> <p><i class="foo">abc</i>xyz</p>
  36703. //
  36704. if ( this._unwrapAttributeElement( unwrapElement, child ) ) {
  36705. unwrapPositions.push(
  36706. new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( parent, i ),
  36707. new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( parent, i + 1 )
  36708. );
  36709. i++;
  36710. continue;
  36711. }
  36712. //
  36713. // If other nested attribute is found, look through it's children for elements to unwrap.
  36714. //
  36715. // <p><i><span class="foo">abc</span></i><p> --> <p><i>abc</i><p>
  36716. //
  36717. this._unwrapChildren( child, 0, child.childCount, unwrapElement );
  36718. i++;
  36719. }
  36720. // Merge at each unwrap.
  36721. let offsetChange = 0;
  36722. for ( const position of unwrapPositions ) {
  36723. position.offset -= offsetChange;
  36724. // Do not merge with elements outside selected children.
  36725. if ( position.offset == startOffset || position.offset == endOffset ) {
  36726. continue;
  36727. }
  36728. const newPosition = this.mergeAttributes( position );
  36729. // If nodes were merged - other merge offsets will change.
  36730. if ( !newPosition.isEqual( position ) ) {
  36731. offsetChange++;
  36732. endOffset--;
  36733. }
  36734. }
  36735. return _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createFromParentsAndOffsets( parent, startOffset, parent, endOffset );
  36736. }
  36737. /**
  36738. * Helper function for `view.writer.wrap`. Wraps range with provided attribute element.
  36739. * This method will also merge newly added attribute element with its siblings whenever possible.
  36740. *
  36741. * Throws {@link module:utils/ckeditorerror~CKEditorError} `view-writer-wrap-invalid-attribute` when passed attribute element is not
  36742. * an instance of {@link module:engine/view/attributeelement~AttributeElement AttributeElement}.
  36743. *
  36744. * @private
  36745. * @param {module:engine/view/range~Range} range
  36746. * @param {module:engine/view/attributeelement~AttributeElement} attribute
  36747. * @returns {module:engine/view/range~Range} New range after wrapping, spanning over wrapping attribute element.
  36748. */
  36749. _wrapRange( range, attribute ) {
  36750. // Break attributes at range start and end.
  36751. const { start: breakStart, end: breakEnd } = this._breakAttributesRange( range, true );
  36752. const parentContainer = breakStart.parent;
  36753. // Wrap all children with attribute.
  36754. const newRange = this._wrapChildren( parentContainer, breakStart.offset, breakEnd.offset, attribute );
  36755. // Merge attributes at the both ends and return a new range.
  36756. const start = this.mergeAttributes( newRange.start );
  36757. // If start position was merged - move end position back.
  36758. if ( !start.isEqual( newRange.start ) ) {
  36759. newRange.end.offset--;
  36760. }
  36761. const end = this.mergeAttributes( newRange.end );
  36762. return new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( start, end );
  36763. }
  36764. /**
  36765. * Helper function for {@link #wrap}. Wraps position with provided attribute element.
  36766. * This method will also merge newly added attribute element with its siblings whenever possible.
  36767. *
  36768. * Throws {@link module:utils/ckeditorerror~CKEditorError} `view-writer-wrap-invalid-attribute` when passed attribute element is not
  36769. * an instance of {@link module:engine/view/attributeelement~AttributeElement AttributeElement}.
  36770. *
  36771. * @private
  36772. * @param {module:engine/view/position~Position} position
  36773. * @param {module:engine/view/attributeelement~AttributeElement} attribute
  36774. * @returns {module:engine/view/position~Position} New position after wrapping.
  36775. */
  36776. _wrapPosition( position, attribute ) {
  36777. // Return same position when trying to wrap with attribute similar to position parent.
  36778. if ( attribute.isSimilar( position.parent ) ) {
  36779. return movePositionToTextNode( position.clone() );
  36780. }
  36781. // When position is inside text node - break it and place new position between two text nodes.
  36782. if ( position.parent.is( '$text' ) ) {
  36783. position = breakTextNode( position );
  36784. }
  36785. // Create fake element that will represent position, and will not be merged with other attributes.
  36786. const fakePosition = this.createAttributeElement();
  36787. fakePosition._priority = Number.POSITIVE_INFINITY;
  36788. fakePosition.isSimilar = () => false;
  36789. // Insert fake element in position location.
  36790. position.parent._insertChild( position.offset, fakePosition );
  36791. // Range around inserted fake attribute element.
  36792. const wrapRange = new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( position, position.getShiftedBy( 1 ) );
  36793. // Wrap fake element with attribute (it will also merge if possible).
  36794. this.wrap( wrapRange, attribute );
  36795. // Remove fake element and place new position there.
  36796. const newPosition = new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( fakePosition.parent, fakePosition.index );
  36797. fakePosition._remove();
  36798. // If position is placed between text nodes - merge them and return position inside.
  36799. const nodeBefore = newPosition.nodeBefore;
  36800. const nodeAfter = newPosition.nodeAfter;
  36801. if ( nodeBefore instanceof _text__WEBPACK_IMPORTED_MODULE_11__["default"] && nodeAfter instanceof _text__WEBPACK_IMPORTED_MODULE_11__["default"] ) {
  36802. return mergeTextNodes( nodeBefore, nodeAfter );
  36803. }
  36804. // If position is next to text node - move position inside.
  36805. return movePositionToTextNode( newPosition );
  36806. }
  36807. /**
  36808. * Wraps one {@link module:engine/view/attributeelement~AttributeElement AttributeElement} into another by
  36809. * merging them if possible. When merging is possible - all attributes, styles and classes are moved from wrapper
  36810. * element to element being wrapped.
  36811. *
  36812. * @private
  36813. * @param {module:engine/view/attributeelement~AttributeElement} wrapper Wrapper AttributeElement.
  36814. * @param {module:engine/view/attributeelement~AttributeElement} toWrap AttributeElement to wrap using wrapper element.
  36815. * @returns {Boolean} Returns `true` if elements are merged.
  36816. */
  36817. _wrapAttributeElement( wrapper, toWrap ) {
  36818. if ( !canBeJoined( wrapper, toWrap ) ) {
  36819. return false;
  36820. }
  36821. // Can't merge if name or priority differs.
  36822. if ( wrapper.name !== toWrap.name || wrapper.priority !== toWrap.priority ) {
  36823. return false;
  36824. }
  36825. // Check if attributes can be merged.
  36826. for ( const key of wrapper.getAttributeKeys() ) {
  36827. // Classes and styles should be checked separately.
  36828. if ( key === 'class' || key === 'style' ) {
  36829. continue;
  36830. }
  36831. // If some attributes are different we cannot wrap.
  36832. if ( toWrap.hasAttribute( key ) && toWrap.getAttribute( key ) !== wrapper.getAttribute( key ) ) {
  36833. return false;
  36834. }
  36835. }
  36836. // Check if styles can be merged.
  36837. for ( const key of wrapper.getStyleNames() ) {
  36838. if ( toWrap.hasStyle( key ) && toWrap.getStyle( key ) !== wrapper.getStyle( key ) ) {
  36839. return false;
  36840. }
  36841. }
  36842. // Move all attributes/classes/styles from wrapper to wrapped AttributeElement.
  36843. for ( const key of wrapper.getAttributeKeys() ) {
  36844. // Classes and styles should be checked separately.
  36845. if ( key === 'class' || key === 'style' ) {
  36846. continue;
  36847. }
  36848. // Move only these attributes that are not present - other are similar.
  36849. if ( !toWrap.hasAttribute( key ) ) {
  36850. this.setAttribute( key, wrapper.getAttribute( key ), toWrap );
  36851. }
  36852. }
  36853. for ( const key of wrapper.getStyleNames() ) {
  36854. if ( !toWrap.hasStyle( key ) ) {
  36855. this.setStyle( key, wrapper.getStyle( key ), toWrap );
  36856. }
  36857. }
  36858. for ( const key of wrapper.getClassNames() ) {
  36859. if ( !toWrap.hasClass( key ) ) {
  36860. this.addClass( key, toWrap );
  36861. }
  36862. }
  36863. return true;
  36864. }
  36865. /**
  36866. * Unwraps {@link module:engine/view/attributeelement~AttributeElement AttributeElement} from another by removing
  36867. * corresponding attributes, classes and styles. All attributes, classes and styles from wrapper should be present
  36868. * inside element being unwrapped.
  36869. *
  36870. * @private
  36871. * @param {module:engine/view/attributeelement~AttributeElement} wrapper Wrapper AttributeElement.
  36872. * @param {module:engine/view/attributeelement~AttributeElement} toUnwrap AttributeElement to unwrap using wrapper element.
  36873. * @returns {Boolean} Returns `true` if elements are unwrapped.
  36874. **/
  36875. _unwrapAttributeElement( wrapper, toUnwrap ) {
  36876. if ( !canBeJoined( wrapper, toUnwrap ) ) {
  36877. return false;
  36878. }
  36879. // Can't unwrap if name or priority differs.
  36880. if ( wrapper.name !== toUnwrap.name || wrapper.priority !== toUnwrap.priority ) {
  36881. return false;
  36882. }
  36883. // Check if AttributeElement has all wrapper attributes.
  36884. for ( const key of wrapper.getAttributeKeys() ) {
  36885. // Classes and styles should be checked separately.
  36886. if ( key === 'class' || key === 'style' ) {
  36887. continue;
  36888. }
  36889. // If some attributes are missing or different we cannot unwrap.
  36890. if ( !toUnwrap.hasAttribute( key ) || toUnwrap.getAttribute( key ) !== wrapper.getAttribute( key ) ) {
  36891. return false;
  36892. }
  36893. }
  36894. // Check if AttributeElement has all wrapper classes.
  36895. if ( !toUnwrap.hasClass( ...wrapper.getClassNames() ) ) {
  36896. return false;
  36897. }
  36898. // Check if AttributeElement has all wrapper styles.
  36899. for ( const key of wrapper.getStyleNames() ) {
  36900. // If some styles are missing or different we cannot unwrap.
  36901. if ( !toUnwrap.hasStyle( key ) || toUnwrap.getStyle( key ) !== wrapper.getStyle( key ) ) {
  36902. return false;
  36903. }
  36904. }
  36905. // Remove all wrapper's attributes from unwrapped element.
  36906. for ( const key of wrapper.getAttributeKeys() ) {
  36907. // Classes and styles should be checked separately.
  36908. if ( key === 'class' || key === 'style' ) {
  36909. continue;
  36910. }
  36911. this.removeAttribute( key, toUnwrap );
  36912. }
  36913. // Remove all wrapper's classes from unwrapped element.
  36914. this.removeClass( Array.from( wrapper.getClassNames() ), toUnwrap );
  36915. // Remove all wrapper's styles from unwrapped element.
  36916. this.removeStyle( Array.from( wrapper.getStyleNames() ), toUnwrap );
  36917. return true;
  36918. }
  36919. /**
  36920. * Helper function used by other `DowncastWriter` methods. Breaks attribute elements at the boundaries of given range.
  36921. *
  36922. * @private
  36923. * @param {module:engine/view/range~Range} range Range which `start` and `end` positions will be used to break attributes.
  36924. * @param {Boolean} [forceSplitText=false] If set to `true`, will break text nodes even if they are directly in container element.
  36925. * This behavior will result in incorrect view state, but is needed by other view writing methods which then fixes view state.
  36926. * @returns {module:engine/view/range~Range} New range with located at break positions.
  36927. */
  36928. _breakAttributesRange( range, forceSplitText = false ) {
  36929. const rangeStart = range.start;
  36930. const rangeEnd = range.end;
  36931. validateRangeContainer( range, this.document );
  36932. // Break at the collapsed position. Return new collapsed range.
  36933. if ( range.isCollapsed ) {
  36934. const position = this._breakAttributes( range.start, forceSplitText );
  36935. return new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( position, position );
  36936. }
  36937. const breakEnd = this._breakAttributes( rangeEnd, forceSplitText );
  36938. const count = breakEnd.parent.childCount;
  36939. const breakStart = this._breakAttributes( rangeStart, forceSplitText );
  36940. // Calculate new break end offset.
  36941. breakEnd.offset += breakEnd.parent.childCount - count;
  36942. return new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( breakStart, breakEnd );
  36943. }
  36944. /**
  36945. * Helper function used by other `DowncastWriter` methods. Breaks attribute elements at given position.
  36946. *
  36947. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-cannot-break-empty-element` when break position
  36948. * is placed inside {@link module:engine/view/emptyelement~EmptyElement EmptyElement}.
  36949. *
  36950. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-cannot-break-ui-element` when break position
  36951. * is placed inside {@link module:engine/view/uielement~UIElement UIElement}.
  36952. *
  36953. * @private
  36954. * @param {module:engine/view/position~Position} position Position where to break attributes.
  36955. * @param {Boolean} [forceSplitText=false] If set to `true`, will break text nodes even if they are directly in container element.
  36956. * This behavior will result in incorrect view state, but is needed by other view writing methods which then fixes view state.
  36957. * @returns {module:engine/view/position~Position} New position after breaking the attributes.
  36958. */
  36959. _breakAttributes( position, forceSplitText = false ) {
  36960. const positionOffset = position.offset;
  36961. const positionParent = position.parent;
  36962. // If position is placed inside EmptyElement - throw an exception as we cannot break inside.
  36963. if ( position.parent.is( 'emptyElement' ) ) {
  36964. /**
  36965. * Cannot break an `EmptyElement` instance.
  36966. *
  36967. * This error is thrown if
  36968. * {@link module:engine/view/downcastwriter~DowncastWriter#breakAttributes `DowncastWriter#breakAttributes()`}
  36969. * was executed in an incorrect position.
  36970. *
  36971. * @error view-writer-cannot-break-empty-element
  36972. */
  36973. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-writer-cannot-break-empty-element', this.document );
  36974. }
  36975. // If position is placed inside UIElement - throw an exception as we cannot break inside.
  36976. if ( position.parent.is( 'uiElement' ) ) {
  36977. /**
  36978. * Cannot break a `UIElement` instance.
  36979. *
  36980. * This error is thrown if
  36981. * {@link module:engine/view/downcastwriter~DowncastWriter#breakAttributes `DowncastWriter#breakAttributes()`}
  36982. * was executed in an incorrect position.
  36983. *
  36984. * @error view-writer-cannot-break-ui-element
  36985. */
  36986. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-writer-cannot-break-ui-element', this.document );
  36987. }
  36988. // If position is placed inside RawElement - throw an exception as we cannot break inside.
  36989. if ( position.parent.is( 'rawElement' ) ) {
  36990. /**
  36991. * Cannot break a `RawElement` instance.
  36992. *
  36993. * This error is thrown if
  36994. * {@link module:engine/view/downcastwriter~DowncastWriter#breakAttributes `DowncastWriter#breakAttributes()`}
  36995. * was executed in an incorrect position.
  36996. *
  36997. * @error view-writer-cannot-break-raw-element
  36998. */
  36999. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-writer-cannot-break-raw-element', this.document );
  37000. }
  37001. // There are no attributes to break and text nodes breaking is not forced.
  37002. if ( !forceSplitText && positionParent.is( '$text' ) && isContainerOrFragment( positionParent.parent ) ) {
  37003. return position.clone();
  37004. }
  37005. // Position's parent is container, so no attributes to break.
  37006. if ( isContainerOrFragment( positionParent ) ) {
  37007. return position.clone();
  37008. }
  37009. // Break text and start again in new position.
  37010. if ( positionParent.is( '$text' ) ) {
  37011. return this._breakAttributes( breakTextNode( position ), forceSplitText );
  37012. }
  37013. const length = positionParent.childCount;
  37014. // <p>foo<b><u>bar{}</u></b></p>
  37015. // <p>foo<b><u>bar</u>[]</b></p>
  37016. // <p>foo<b><u>bar</u></b>[]</p>
  37017. if ( positionOffset == length ) {
  37018. const newPosition = new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( positionParent.parent, positionParent.index + 1 );
  37019. return this._breakAttributes( newPosition, forceSplitText );
  37020. } else {
  37021. // <p>foo<b><u>{}bar</u></b></p>
  37022. // <p>foo<b>[]<u>bar</u></b></p>
  37023. // <p>foo{}<b><u>bar</u></b></p>
  37024. if ( positionOffset === 0 ) {
  37025. const newPosition = new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( positionParent.parent, positionParent.index );
  37026. return this._breakAttributes( newPosition, forceSplitText );
  37027. }
  37028. // <p>foo<b><u>b{}ar</u></b></p>
  37029. // <p>foo<b><u>b[]ar</u></b></p>
  37030. // <p>foo<b><u>b</u>[]<u>ar</u></b></p>
  37031. // <p>foo<b><u>b</u></b>[]<b><u>ar</u></b></p>
  37032. else {
  37033. const offsetAfter = positionParent.index + 1;
  37034. // Break element.
  37035. const clonedNode = positionParent._clone();
  37036. // Insert cloned node to position's parent node.
  37037. positionParent.parent._insertChild( offsetAfter, clonedNode );
  37038. this._addToClonedElementsGroup( clonedNode );
  37039. // Get nodes to move.
  37040. const count = positionParent.childCount - positionOffset;
  37041. const nodesToMove = positionParent._removeChildren( positionOffset, count );
  37042. // Move nodes to cloned node.
  37043. clonedNode._appendChild( nodesToMove );
  37044. // Create new position to work on.
  37045. const newPosition = new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( positionParent.parent, offsetAfter );
  37046. return this._breakAttributes( newPosition, forceSplitText );
  37047. }
  37048. }
  37049. }
  37050. /**
  37051. * Stores the information that an {@link module:engine/view/attributeelement~AttributeElement attribute element} was
  37052. * added to the tree. Saves the reference to the group in the given element and updates the group, so other elements
  37053. * from the group now keep a reference to the given attribute element.
  37054. *
  37055. * The clones group can be obtained using {@link module:engine/view/attributeelement~AttributeElement#getElementsWithSameId}.
  37056. *
  37057. * Does nothing if added element has no {@link module:engine/view/attributeelement~AttributeElement#id id}.
  37058. *
  37059. * @private
  37060. * @param {module:engine/view/attributeelement~AttributeElement} element Attribute element to save.
  37061. */
  37062. _addToClonedElementsGroup( element ) {
  37063. // Add only if the element is in document tree.
  37064. if ( !element.root.is( 'rootElement' ) ) {
  37065. return;
  37066. }
  37067. // Traverse the element's children recursively to find other attribute elements that also might got inserted.
  37068. // The loop is at the beginning so we can make fast returns later in the code.
  37069. if ( element.is( 'element' ) ) {
  37070. for ( const child of element.getChildren() ) {
  37071. this._addToClonedElementsGroup( child );
  37072. }
  37073. }
  37074. const id = element.id;
  37075. if ( !id ) {
  37076. return;
  37077. }
  37078. let group = this._cloneGroups.get( id );
  37079. if ( !group ) {
  37080. group = new Set();
  37081. this._cloneGroups.set( id, group );
  37082. }
  37083. group.add( element );
  37084. element._clonesGroup = group;
  37085. }
  37086. /**
  37087. * Removes all the information about the given {@link module:engine/view/attributeelement~AttributeElement attribute element}
  37088. * from its clones group.
  37089. *
  37090. * Keep in mind, that the element will still keep a reference to the group (but the group will not keep a reference to it).
  37091. * This allows to reference the whole group even if the element was already removed from the tree.
  37092. *
  37093. * Does nothing if the element has no {@link module:engine/view/attributeelement~AttributeElement#id id}.
  37094. *
  37095. * @private
  37096. * @param {module:engine/view/attributeelement~AttributeElement} element Attribute element to remove.
  37097. */
  37098. _removeFromClonedElementsGroup( element ) {
  37099. // Traverse the element's children recursively to find other attribute elements that also got removed.
  37100. // The loop is at the beginning so we can make fast returns later in the code.
  37101. if ( element.is( 'element' ) ) {
  37102. for ( const child of element.getChildren() ) {
  37103. this._removeFromClonedElementsGroup( child );
  37104. }
  37105. }
  37106. const id = element.id;
  37107. if ( !id ) {
  37108. return;
  37109. }
  37110. const group = this._cloneGroups.get( id );
  37111. if ( !group ) {
  37112. return;
  37113. }
  37114. group.delete( element );
  37115. // Not removing group from element on purpose!
  37116. // If other parts of code have reference to this element, they will be able to get references to other elements from the group.
  37117. }
  37118. }
  37119. // Helper function for `view.writer.wrap`. Checks if given element has any children that are not ui elements.
  37120. function _hasNonUiChildren( parent ) {
  37121. return Array.from( parent.getChildren() ).some( child => !child.is( 'uiElement' ) );
  37122. }
  37123. /**
  37124. * The `attribute` passed to {@link module:engine/view/downcastwriter~DowncastWriter#wrap `DowncastWriter#wrap()`}
  37125. * must be an instance of {@link module:engine/view/attributeelement~AttributeElement `AttributeElement`}.
  37126. *
  37127. * @error view-writer-wrap-invalid-attribute
  37128. */
  37129. // Returns first parent container of specified {@link module:engine/view/position~Position Position}.
  37130. // Position's parent node is checked as first, then next parents are checked.
  37131. // Note that {@link module:engine/view/documentfragment~DocumentFragment DocumentFragment} is treated like a container.
  37132. //
  37133. // @param {module:engine/view/position~Position} position Position used as a start point to locate parent container.
  37134. // @returns {module:engine/view/containerelement~ContainerElement|module:engine/view/documentfragment~DocumentFragment|undefined}
  37135. // Parent container element or `undefined` if container is not found.
  37136. function getParentContainer( position ) {
  37137. let parent = position.parent;
  37138. while ( !isContainerOrFragment( parent ) ) {
  37139. if ( !parent ) {
  37140. return undefined;
  37141. }
  37142. parent = parent.parent;
  37143. }
  37144. return parent;
  37145. }
  37146. // Checks if first {@link module:engine/view/attributeelement~AttributeElement AttributeElement} provided to the function
  37147. // can be wrapped otuside second element. It is done by comparing elements'
  37148. // {@link module:engine/view/attributeelement~AttributeElement#priority priorities}, if both have same priority
  37149. // {@link module:engine/view/element~Element#getIdentity identities} are compared.
  37150. //
  37151. // @param {module:engine/view/attributeelement~AttributeElement} a
  37152. // @param {module:engine/view/attributeelement~AttributeElement} b
  37153. // @returns {Boolean}
  37154. function shouldABeOutsideB( a, b ) {
  37155. if ( a.priority < b.priority ) {
  37156. return true;
  37157. } else if ( a.priority > b.priority ) {
  37158. return false;
  37159. }
  37160. // When priorities are equal and names are different - use identities.
  37161. return a.getIdentity() < b.getIdentity();
  37162. }
  37163. // Returns new position that is moved to near text node. Returns same position if there is no text node before of after
  37164. // specified position.
  37165. //
  37166. // <p>foo[]</p> -> <p>foo{}</p>
  37167. // <p>[]foo</p> -> <p>{}foo</p>
  37168. //
  37169. // @param {module:engine/view/position~Position} position
  37170. // @returns {module:engine/view/position~Position} Position located inside text node or same position if there is no text nodes
  37171. // before or after position location.
  37172. function movePositionToTextNode( position ) {
  37173. const nodeBefore = position.nodeBefore;
  37174. if ( nodeBefore && nodeBefore.is( '$text' ) ) {
  37175. return new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( nodeBefore, nodeBefore.data.length );
  37176. }
  37177. const nodeAfter = position.nodeAfter;
  37178. if ( nodeAfter && nodeAfter.is( '$text' ) ) {
  37179. return new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( nodeAfter, 0 );
  37180. }
  37181. return position;
  37182. }
  37183. // Breaks text node into two text nodes when possible.
  37184. //
  37185. // <p>foo{}bar</p> -> <p>foo[]bar</p>
  37186. // <p>{}foobar</p> -> <p>[]foobar</p>
  37187. // <p>foobar{}</p> -> <p>foobar[]</p>
  37188. //
  37189. // @param {module:engine/view/position~Position} position Position that need to be placed inside text node.
  37190. // @returns {module:engine/view/position~Position} New position after breaking text node.
  37191. function breakTextNode( position ) {
  37192. if ( position.offset == position.parent.data.length ) {
  37193. return new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( position.parent.parent, position.parent.index + 1 );
  37194. }
  37195. if ( position.offset === 0 ) {
  37196. return new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( position.parent.parent, position.parent.index );
  37197. }
  37198. // Get part of the text that need to be moved.
  37199. const textToMove = position.parent.data.slice( position.offset );
  37200. // Leave rest of the text in position's parent.
  37201. position.parent._data = position.parent.data.slice( 0, position.offset );
  37202. // Insert new text node after position's parent text node.
  37203. position.parent.parent._insertChild( position.parent.index + 1, new _text__WEBPACK_IMPORTED_MODULE_11__["default"]( position.root.document, textToMove ) );
  37204. // Return new position between two newly created text nodes.
  37205. return new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( position.parent.parent, position.parent.index + 1 );
  37206. }
  37207. // Merges two text nodes into first node. Removes second node and returns merge position.
  37208. //
  37209. // @param {module:engine/view/text~Text} t1 First text node to merge. Data from second text node will be moved at the end of
  37210. // this text node.
  37211. // @param {module:engine/view/text~Text} t2 Second text node to merge. This node will be removed after merging.
  37212. // @returns {module:engine/view/position~Position} Position after merging text nodes.
  37213. function mergeTextNodes( t1, t2 ) {
  37214. // Merge text data into first text node and remove second one.
  37215. const nodeBeforeLength = t1.data.length;
  37216. t1._data += t2.data;
  37217. t2._remove();
  37218. return new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( t1, nodeBeforeLength );
  37219. }
  37220. // Checks if provided nodes are valid to insert.
  37221. //
  37222. // Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-insert-invalid-node` when nodes to insert
  37223. // contains instances that are not supported ones (see error description for valid ones.
  37224. //
  37225. // @param Iterable.<module:engine/view/text~Text|module:engine/view/element~Element> nodes
  37226. // @param {Object} errorContext
  37227. function validateNodesToInsert( nodes, errorContext ) {
  37228. for ( const node of nodes ) {
  37229. if ( !validNodesToInsert.some( ( validNode => node instanceof validNode ) ) ) { // eslint-disable-line no-use-before-define
  37230. /**
  37231. * One of the nodes to be inserted is of an invalid type.
  37232. *
  37233. * Nodes to be inserted with {@link module:engine/view/downcastwriter~DowncastWriter#insert `DowncastWriter#insert()`} should be
  37234. * of the following types:
  37235. *
  37236. * * {@link module:engine/view/attributeelement~AttributeElement AttributeElement},
  37237. * * {@link module:engine/view/containerelement~ContainerElement ContainerElement},
  37238. * * {@link module:engine/view/emptyelement~EmptyElement EmptyElement},
  37239. * * {@link module:engine/view/uielement~UIElement UIElement},
  37240. * * {@link module:engine/view/rawelement~RawElement RawElement},
  37241. * * {@link module:engine/view/text~Text Text}.
  37242. *
  37243. * @error view-writer-insert-invalid-node-type
  37244. */
  37245. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-writer-insert-invalid-node-type', errorContext );
  37246. }
  37247. if ( !node.is( '$text' ) ) {
  37248. validateNodesToInsert( node.getChildren(), errorContext );
  37249. }
  37250. }
  37251. }
  37252. const validNodesToInsert = [ _text__WEBPACK_IMPORTED_MODULE_11__["default"], _attributeelement__WEBPACK_IMPORTED_MODULE_4__["default"], _containerelement__WEBPACK_IMPORTED_MODULE_3__["default"], _emptyelement__WEBPACK_IMPORTED_MODULE_5__["default"], _rawelement__WEBPACK_IMPORTED_MODULE_7__["default"], _uielement__WEBPACK_IMPORTED_MODULE_6__["default"] ];
  37253. // Checks if node is ContainerElement or DocumentFragment, because in most cases they should be treated the same way.
  37254. //
  37255. // @param {module:engine/view/node~Node} node
  37256. // @returns {Boolean} Returns `true` if node is instance of ContainerElement or DocumentFragment.
  37257. function isContainerOrFragment( node ) {
  37258. return node && ( node.is( 'containerElement' ) || node.is( 'documentFragment' ) );
  37259. }
  37260. // Checks if {@link module:engine/view/range~Range#start range start} and {@link module:engine/view/range~Range#end range end} are placed
  37261. // inside same {@link module:engine/view/containerelement~ContainerElement container element}.
  37262. // Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-invalid-range-container` when validation fails.
  37263. //
  37264. // @param {module:engine/view/range~Range} range
  37265. // @param {Object} errorContext
  37266. function validateRangeContainer( range, errorContext ) {
  37267. const startContainer = getParentContainer( range.start );
  37268. const endContainer = getParentContainer( range.end );
  37269. if ( !startContainer || !endContainer || startContainer !== endContainer ) {
  37270. /**
  37271. * The container of the given range is invalid.
  37272. *
  37273. * This may happen if {@link module:engine/view/range~Range#start range start} and
  37274. * {@link module:engine/view/range~Range#end range end} positions are not placed inside the same container element or
  37275. * a parent container for these positions cannot be found.
  37276. *
  37277. * Methods like {@link module:engine/view/downcastwriter~DowncastWriter#wrap `DowncastWriter#remove()`},
  37278. * {@link module:engine/view/downcastwriter~DowncastWriter#wrap `DowncastWriter#clean()`},
  37279. * {@link module:engine/view/downcastwriter~DowncastWriter#wrap `DowncastWriter#wrap()`},
  37280. * {@link module:engine/view/downcastwriter~DowncastWriter#wrap `DowncastWriter#unwrap()`} need to be called
  37281. * on a range that has its start and end positions located in the same container element. Both positions can be
  37282. * nested within other elements (e.g. an attribute element) but the closest container ancestor must be the same.
  37283. *
  37284. * @error view-writer-invalid-range-container
  37285. */
  37286. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-writer-invalid-range-container', errorContext );
  37287. }
  37288. }
  37289. // Checks if two attribute elements can be joined together. Elements can be joined together if, and only if
  37290. // they do not have ids specified.
  37291. //
  37292. // @private
  37293. // @param {module:engine/view/element~Element} a
  37294. // @param {module:engine/view/element~Element} b
  37295. // @returns {Boolean}
  37296. function canBeJoined( a, b ) {
  37297. return a.id === null && b.id === null;
  37298. }
  37299. /***/ }),
  37300. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/editableelement.js":
  37301. /*!*****************************************************************************!*\
  37302. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/editableelement.js ***!
  37303. \*****************************************************************************/
  37304. /*! exports provided: default */
  37305. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  37306. "use strict";
  37307. __webpack_require__.r(__webpack_exports__);
  37308. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EditableElement; });
  37309. /* harmony import */ var _containerelement__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./containerelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/containerelement.js");
  37310. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  37311. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  37312. /**
  37313. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  37314. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  37315. */
  37316. /**
  37317. * @module engine/view/editableelement
  37318. */
  37319. /**
  37320. * Editable element which can be a {@link module:engine/view/rooteditableelement~RootEditableElement root}
  37321. * or nested editable area in the editor.
  37322. *
  37323. * Editable is automatically read-only when its {@link module:engine/view/document~Document Document} is read-only.
  37324. *
  37325. * The constructor of this class shouldn't be used directly. To create new `EditableElement` use the
  37326. * {@link module:engine/view/downcastwriter~DowncastWriter#createEditableElement `downcastWriter#createEditableElement()`} method.
  37327. *
  37328. * @extends module:engine/view/containerelement~ContainerElement
  37329. * @mixes module:utils/observablemixin~ObservableMixin
  37330. */
  37331. class EditableElement extends _containerelement__WEBPACK_IMPORTED_MODULE_0__["default"] {
  37332. /**
  37333. * Creates an editable element.
  37334. *
  37335. * @see module:engine/view/downcastwriter~DowncastWriter#createEditableElement
  37336. * @protected
  37337. */
  37338. constructor( document, name, attrs, children ) {
  37339. super( document, name, attrs, children );
  37340. /**
  37341. * Whether the editable is in read-write or read-only mode.
  37342. *
  37343. * @observable
  37344. * @member {Boolean} module:engine/view/editableelement~EditableElement#isReadOnly
  37345. */
  37346. this.set( 'isReadOnly', false );
  37347. /**
  37348. * Whether the editable is focused.
  37349. *
  37350. * This property updates when {@link module:engine/view/document~Document#isFocused document.isFocused} or view
  37351. * selection is changed.
  37352. *
  37353. * @readonly
  37354. * @observable
  37355. * @member {Boolean} module:engine/view/editableelement~EditableElement#isFocused
  37356. */
  37357. this.set( 'isFocused', false );
  37358. this.bind( 'isReadOnly' ).to( document );
  37359. this.bind( 'isFocused' ).to(
  37360. document,
  37361. 'isFocused',
  37362. isFocused => isFocused && document.selection.editableElement == this
  37363. );
  37364. // Update focus state based on selection changes.
  37365. this.listenTo( document.selection, 'change', () => {
  37366. this.isFocused = document.isFocused && document.selection.editableElement == this;
  37367. } );
  37368. }
  37369. /**
  37370. * Checks whether this object is of the given.
  37371. *
  37372. * editableElement.is( 'editableElement' ); // -> true
  37373. * editableElement.is( 'element' ); // -> true
  37374. * editableElement.is( 'node' ); // -> true
  37375. * editableElement.is( 'view:editableElement' ); // -> true
  37376. * editableElement.is( 'view:element' ); // -> true
  37377. * editableElement.is( 'view:node' ); // -> true
  37378. *
  37379. * editableElement.is( 'model:element' ); // -> false
  37380. * editableElement.is( 'documentFragment' ); // -> false
  37381. *
  37382. * Assuming that the object being checked is an editbale element, you can also check its
  37383. * {@link module:engine/view/editableelement~EditableElement#name name}:
  37384. *
  37385. * editableElement.is( 'element', 'div' ); // -> true if this is a div element
  37386. * editableElement.is( 'editableElement', 'div' ); // -> same as above
  37387. * text.is( 'element', 'div' ); -> false
  37388. *
  37389. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  37390. *
  37391. * @param {String} type Type to check.
  37392. * @param {String} [name] Element name.
  37393. * @returns {Boolean}
  37394. */
  37395. is( type, name = null ) {
  37396. if ( !name ) {
  37397. return type === 'editableElement' || type === 'view:editableElement' ||
  37398. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  37399. type === 'containerElement' || type === 'view:containerElement' ||
  37400. type === 'element' || type === 'view:element' ||
  37401. type === 'node' || type === 'view:node';
  37402. } else {
  37403. return name === this.name && (
  37404. type === 'editableElement' || type === 'view:editableElement' ||
  37405. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  37406. type === 'containerElement' || type === 'view:containerElement' ||
  37407. type === 'element' || type === 'view:element'
  37408. );
  37409. }
  37410. }
  37411. destroy() {
  37412. this.stopListening();
  37413. }
  37414. }
  37415. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( EditableElement, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_2__["default"] );
  37416. /***/ }),
  37417. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js":
  37418. /*!*********************************************************************!*\
  37419. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js ***!
  37420. \*********************************************************************/
  37421. /*! exports provided: default */
  37422. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  37423. "use strict";
  37424. __webpack_require__.r(__webpack_exports__);
  37425. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Element; });
  37426. /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/node.js");
  37427. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js");
  37428. /* harmony import */ var _textproxy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/textproxy.js");
  37429. /* harmony import */ var _ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/tomap */ "./node_modules/@ckeditor/ckeditor5-utils/src/tomap.js");
  37430. /* harmony import */ var _ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
  37431. /* harmony import */ var _matcher__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./matcher */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/matcher.js");
  37432. /* harmony import */ var _stylesmap__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./stylesmap */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/stylesmap.js");
  37433. /**
  37434. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  37435. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  37436. */
  37437. /**
  37438. * @module engine/view/element
  37439. */
  37440. // @if CK_DEBUG_ENGINE // const { convertMapToTags } = require( '../dev-utils/utils' );
  37441. /**
  37442. * View element.
  37443. *
  37444. * The editing engine does not define a fixed semantics of its elements (it is "DTD-free").
  37445. * This is why the type of the {@link module:engine/view/element~Element} need to
  37446. * be defined by the feature developer. When creating an element you should use one of the following methods:
  37447. *
  37448. * * {@link module:engine/view/downcastwriter~DowncastWriter#createContainerElement `downcastWriter#createContainerElement()`}
  37449. * in order to create a {@link module:engine/view/containerelement~ContainerElement},
  37450. * * {@link module:engine/view/downcastwriter~DowncastWriter#createAttributeElement `downcastWriter#createAttributeElement()`}
  37451. * in order to create a {@link module:engine/view/attributeelement~AttributeElement},
  37452. * * {@link module:engine/view/downcastwriter~DowncastWriter#createEmptyElement `downcastWriter#createEmptyElement()`}
  37453. * in order to create a {@link module:engine/view/emptyelement~EmptyElement}.
  37454. * * {@link module:engine/view/downcastwriter~DowncastWriter#createUIElement `downcastWriter#createUIElement()`}
  37455. * in order to create a {@link module:engine/view/uielement~UIElement}.
  37456. * * {@link module:engine/view/downcastwriter~DowncastWriter#createEditableElement `downcastWriter#createEditableElement()`}
  37457. * in order to create a {@link module:engine/view/editableelement~EditableElement}.
  37458. *
  37459. * Note that for view elements which are not created from the model, like elements from mutations, paste or
  37460. * {@link module:engine/controller/datacontroller~DataController#set data.set} it is not possible to define the type of the element.
  37461. * In such cases the {@link module:engine/view/upcastwriter~UpcastWriter#createElement `UpcastWriter#createElement()`} method
  37462. * should be used to create generic view elements.
  37463. *
  37464. * @extends module:engine/view/node~Node
  37465. */
  37466. class Element extends _node__WEBPACK_IMPORTED_MODULE_0__["default"] {
  37467. /**
  37468. * Creates a view element.
  37469. *
  37470. * Attributes can be passed in various formats:
  37471. *
  37472. * new Element( viewDocument, 'div', { class: 'editor', contentEditable: 'true' } ); // object
  37473. * new Element( viewDocument, 'div', [ [ 'class', 'editor' ], [ 'contentEditable', 'true' ] ] ); // map-like iterator
  37474. * new Element( viewDocument, 'div', mapOfAttributes ); // map
  37475. *
  37476. * @protected
  37477. * @param {module:engine/view/document~Document} document The document instance to which this element belongs.
  37478. * @param {String} name Node name.
  37479. * @param {Object|Iterable} [attrs] Collection of attributes.
  37480. * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
  37481. * A list of nodes to be inserted into created element.
  37482. */
  37483. constructor( document, name, attrs, children ) {
  37484. super( document );
  37485. /**
  37486. * Name of the element.
  37487. *
  37488. * @readonly
  37489. * @member {String}
  37490. */
  37491. this.name = name;
  37492. /**
  37493. * Map of attributes, where attributes names are keys and attributes values are values.
  37494. *
  37495. * @protected
  37496. * @member {Map} #_attrs
  37497. */
  37498. this._attrs = parseAttributes( attrs );
  37499. /**
  37500. * Array of child nodes.
  37501. *
  37502. * @protected
  37503. * @member {Array.<module:engine/view/node~Node>}
  37504. */
  37505. this._children = [];
  37506. if ( children ) {
  37507. this._insertChild( 0, children );
  37508. }
  37509. /**
  37510. * Set of classes associated with element instance.
  37511. *
  37512. * @protected
  37513. * @member {Set}
  37514. */
  37515. this._classes = new Set();
  37516. if ( this._attrs.has( 'class' ) ) {
  37517. // Remove class attribute and handle it by class set.
  37518. const classString = this._attrs.get( 'class' );
  37519. parseClasses( this._classes, classString );
  37520. this._attrs.delete( 'class' );
  37521. }
  37522. /**
  37523. * Normalized styles.
  37524. *
  37525. * @protected
  37526. * @member {module:engine/view/stylesmap~StylesMap} module:engine/view/element~Element#_styles
  37527. */
  37528. this._styles = new _stylesmap__WEBPACK_IMPORTED_MODULE_6__["default"]( this.document.stylesProcessor );
  37529. if ( this._attrs.has( 'style' ) ) {
  37530. // Remove style attribute and handle it by styles map.
  37531. this._styles.setTo( this._attrs.get( 'style' ) );
  37532. this._attrs.delete( 'style' );
  37533. }
  37534. /**
  37535. * Map of custom properties.
  37536. * Custom properties can be added to element instance, will be cloned but not rendered into DOM.
  37537. *
  37538. * @protected
  37539. * @member {Map}
  37540. */
  37541. this._customProperties = new Map();
  37542. }
  37543. /**
  37544. * Number of element's children.
  37545. *
  37546. * @readonly
  37547. * @type {Number}
  37548. */
  37549. get childCount() {
  37550. return this._children.length;
  37551. }
  37552. /**
  37553. * Is `true` if there are no nodes inside this element, `false` otherwise.
  37554. *
  37555. * @readonly
  37556. * @type {Boolean}
  37557. */
  37558. get isEmpty() {
  37559. return this._children.length === 0;
  37560. }
  37561. /**
  37562. * Checks whether this object is of the given.
  37563. *
  37564. * element.is( 'element' ); // -> true
  37565. * element.is( 'node' ); // -> true
  37566. * element.is( 'view:element' ); // -> true
  37567. * element.is( 'view:node' ); // -> true
  37568. *
  37569. * element.is( 'model:element' ); // -> false
  37570. * element.is( 'documentSelection' ); // -> false
  37571. *
  37572. * Assuming that the object being checked is an element, you can also check its
  37573. * {@link module:engine/view/element~Element#name name}:
  37574. *
  37575. * element.is( 'element', 'img' ); // -> true if this is an <img> element
  37576. * text.is( 'element', 'img' ); -> false
  37577. *
  37578. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  37579. *
  37580. * @param {String} type Type to check.
  37581. * @param {String} [name] Element name.
  37582. * @returns {Boolean}
  37583. */
  37584. is( type, name = null ) {
  37585. if ( !name ) {
  37586. return type === 'element' || type === 'view:element' ||
  37587. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  37588. type === 'node' || type === 'view:node';
  37589. } else {
  37590. return name === this.name && ( type === 'element' || type === 'view:element' );
  37591. }
  37592. }
  37593. /**
  37594. * Gets child at the given index.
  37595. *
  37596. * @param {Number} index Index of child.
  37597. * @returns {module:engine/view/node~Node} Child node.
  37598. */
  37599. getChild( index ) {
  37600. return this._children[ index ];
  37601. }
  37602. /**
  37603. * Gets index of the given child node. Returns `-1` if child node is not found.
  37604. *
  37605. * @param {module:engine/view/node~Node} node Child node.
  37606. * @returns {Number} Index of the child node.
  37607. */
  37608. getChildIndex( node ) {
  37609. return this._children.indexOf( node );
  37610. }
  37611. /**
  37612. * Gets child nodes iterator.
  37613. *
  37614. * @returns {Iterable.<module:engine/view/node~Node>} Child nodes iterator.
  37615. */
  37616. getChildren() {
  37617. return this._children[ Symbol.iterator ]();
  37618. }
  37619. /**
  37620. * Returns an iterator that contains the keys for attributes. Order of inserting attributes is not preserved.
  37621. *
  37622. * @returns {Iterable.<String>} Keys for attributes.
  37623. */
  37624. * getAttributeKeys() {
  37625. if ( this._classes.size > 0 ) {
  37626. yield 'class';
  37627. }
  37628. if ( !this._styles.isEmpty ) {
  37629. yield 'style';
  37630. }
  37631. yield* this._attrs.keys();
  37632. }
  37633. /**
  37634. * Returns iterator that iterates over this element's attributes.
  37635. *
  37636. * Attributes are returned as arrays containing two items. First one is attribute key and second is attribute value.
  37637. * This format is accepted by native `Map` object and also can be passed in `Node` constructor.
  37638. *
  37639. * @returns {Iterable.<*>}
  37640. */
  37641. * getAttributes() {
  37642. yield* this._attrs.entries();
  37643. if ( this._classes.size > 0 ) {
  37644. yield [ 'class', this.getAttribute( 'class' ) ];
  37645. }
  37646. if ( !this._styles.isEmpty ) {
  37647. yield [ 'style', this.getAttribute( 'style' ) ];
  37648. }
  37649. }
  37650. /**
  37651. * Gets attribute by key. If attribute is not present - returns undefined.
  37652. *
  37653. * @param {String} key Attribute key.
  37654. * @returns {String|undefined} Attribute value.
  37655. */
  37656. getAttribute( key ) {
  37657. if ( key == 'class' ) {
  37658. if ( this._classes.size > 0 ) {
  37659. return [ ...this._classes ].join( ' ' );
  37660. }
  37661. return undefined;
  37662. }
  37663. if ( key == 'style' ) {
  37664. const inlineStyle = this._styles.toString();
  37665. return inlineStyle == '' ? undefined : inlineStyle;
  37666. }
  37667. return this._attrs.get( key );
  37668. }
  37669. /**
  37670. * Returns a boolean indicating whether an attribute with the specified key exists in the element.
  37671. *
  37672. * @param {String} key Attribute key.
  37673. * @returns {Boolean} `true` if attribute with the specified key exists in the element, false otherwise.
  37674. */
  37675. hasAttribute( key ) {
  37676. if ( key == 'class' ) {
  37677. return this._classes.size > 0;
  37678. }
  37679. if ( key == 'style' ) {
  37680. return !this._styles.isEmpty;
  37681. }
  37682. return this._attrs.has( key );
  37683. }
  37684. /**
  37685. * Checks if this element is similar to other element.
  37686. * Both elements should have the same name and attributes to be considered as similar. Two similar elements
  37687. * can contain different set of children nodes.
  37688. *
  37689. * @param {module:engine/view/element~Element} otherElement
  37690. * @returns {Boolean}
  37691. */
  37692. isSimilar( otherElement ) {
  37693. if ( !( otherElement instanceof Element ) ) {
  37694. return false;
  37695. }
  37696. // If exactly the same Element is provided - return true immediately.
  37697. if ( this === otherElement ) {
  37698. return true;
  37699. }
  37700. // Check element name.
  37701. if ( this.name != otherElement.name ) {
  37702. return false;
  37703. }
  37704. // Check number of attributes, classes and styles.
  37705. if ( this._attrs.size !== otherElement._attrs.size || this._classes.size !== otherElement._classes.size ||
  37706. this._styles.size !== otherElement._styles.size ) {
  37707. return false;
  37708. }
  37709. // Check if attributes are the same.
  37710. for ( const [ key, value ] of this._attrs ) {
  37711. if ( !otherElement._attrs.has( key ) || otherElement._attrs.get( key ) !== value ) {
  37712. return false;
  37713. }
  37714. }
  37715. // Check if classes are the same.
  37716. for ( const className of this._classes ) {
  37717. if ( !otherElement._classes.has( className ) ) {
  37718. return false;
  37719. }
  37720. }
  37721. // Check if styles are the same.
  37722. for ( const property of this._styles.getStyleNames() ) {
  37723. if (
  37724. !otherElement._styles.has( property ) ||
  37725. otherElement._styles.getAsString( property ) !== this._styles.getAsString( property )
  37726. ) {
  37727. return false;
  37728. }
  37729. }
  37730. return true;
  37731. }
  37732. /**
  37733. * Returns true if class is present.
  37734. * If more then one class is provided - returns true only when all classes are present.
  37735. *
  37736. * element.hasClass( 'foo' ); // Returns true if 'foo' class is present.
  37737. * element.hasClass( 'foo', 'bar' ); // Returns true if 'foo' and 'bar' classes are both present.
  37738. *
  37739. * @param {...String} className
  37740. */
  37741. hasClass( ...className ) {
  37742. for ( const name of className ) {
  37743. if ( !this._classes.has( name ) ) {
  37744. return false;
  37745. }
  37746. }
  37747. return true;
  37748. }
  37749. /**
  37750. * Returns iterator that contains all class names.
  37751. *
  37752. * @returns {Iterable.<String>}
  37753. */
  37754. getClassNames() {
  37755. return this._classes.keys();
  37756. }
  37757. /**
  37758. * Returns style value for the given property mae.
  37759. * If the style does not exist `undefined` is returned.
  37760. *
  37761. * **Note**: This method can work with normalized style names if
  37762. * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.
  37763. * See {@link module:engine/view/stylesmap~StylesMap#getAsString `StylesMap#getAsString()`} for details.
  37764. *
  37765. * For an element with style set to `'margin:1px'`:
  37766. *
  37767. * // Enable 'margin' shorthand processing:
  37768. * editor.data.addStyleProcessorRules( addMarginRules );
  37769. *
  37770. * const element = view.change( writer => {
  37771. * const element = writer.createElement();
  37772. * writer.setStyle( 'margin', '1px' );
  37773. * writer.setStyle( 'margin-bottom', '3em' );
  37774. *
  37775. * return element;
  37776. * } );
  37777. *
  37778. * element.getStyle( 'margin' ); // -> 'margin: 1px 1px 3em;'
  37779. *
  37780. * @param {String} property
  37781. * @returns {String|undefined}
  37782. */
  37783. getStyle( property ) {
  37784. return this._styles.getAsString( property );
  37785. }
  37786. /**
  37787. * Returns a normalized style object or single style value.
  37788. *
  37789. * For an element with style set to: margin:1px 2px 3em;
  37790. *
  37791. * element.getNormalizedStyle( 'margin' ) );
  37792. *
  37793. * will return:
  37794. *
  37795. * {
  37796. * top: '1px',
  37797. * right: '2px',
  37798. * bottom: '3em',
  37799. * left: '2px' // a normalized value from margin shorthand
  37800. * }
  37801. *
  37802. * and reading for single style value:
  37803. *
  37804. * styles.getNormalizedStyle( 'margin-left' );
  37805. *
  37806. * Will return a `2px` string.
  37807. *
  37808. * **Note**: This method will return normalized values only if
  37809. * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.
  37810. * See {@link module:engine/view/stylesmap~StylesMap#getNormalized `StylesMap#getNormalized()`} for details.
  37811. *
  37812. *
  37813. * @param {String} property Name of CSS property
  37814. * @returns {Object|String|undefined}
  37815. */
  37816. getNormalizedStyle( property ) {
  37817. return this._styles.getNormalized( property );
  37818. }
  37819. /**
  37820. * Returns iterator that contains all style names.
  37821. *
  37822. * @returns {Iterable.<String>}
  37823. */
  37824. getStyleNames() {
  37825. return this._styles.getStyleNames();
  37826. }
  37827. /**
  37828. * Returns true if style keys are present.
  37829. * If more then one style property is provided - returns true only when all properties are present.
  37830. *
  37831. * element.hasStyle( 'color' ); // Returns true if 'border-top' style is present.
  37832. * element.hasStyle( 'color', 'border-top' ); // Returns true if 'color' and 'border-top' styles are both present.
  37833. *
  37834. * @param {...String} property
  37835. */
  37836. hasStyle( ...property ) {
  37837. for ( const name of property ) {
  37838. if ( !this._styles.has( name ) ) {
  37839. return false;
  37840. }
  37841. }
  37842. return true;
  37843. }
  37844. /**
  37845. * Returns ancestor element that match specified pattern.
  37846. * Provided patterns should be compatible with {@link module:engine/view/matcher~Matcher Matcher} as it is used internally.
  37847. *
  37848. * @see module:engine/view/matcher~Matcher
  37849. * @param {Object|String|RegExp|Function} patterns Patterns used to match correct ancestor.
  37850. * See {@link module:engine/view/matcher~Matcher}.
  37851. * @returns {module:engine/view/element~Element|null} Found element or `null` if no matching ancestor was found.
  37852. */
  37853. findAncestor( ...patterns ) {
  37854. const matcher = new _matcher__WEBPACK_IMPORTED_MODULE_5__["default"]( ...patterns );
  37855. let parent = this.parent;
  37856. while ( parent ) {
  37857. if ( matcher.match( parent ) ) {
  37858. return parent;
  37859. }
  37860. parent = parent.parent;
  37861. }
  37862. return null;
  37863. }
  37864. /**
  37865. * Returns the custom property value for the given key.
  37866. *
  37867. * @param {String|Symbol} key
  37868. * @returns {*}
  37869. */
  37870. getCustomProperty( key ) {
  37871. return this._customProperties.get( key );
  37872. }
  37873. /**
  37874. * Returns an iterator which iterates over this element's custom properties.
  37875. * Iterator provides `[ key, value ]` pairs for each stored property.
  37876. *
  37877. * @returns {Iterable.<*>}
  37878. */
  37879. * getCustomProperties() {
  37880. yield* this._customProperties.entries();
  37881. }
  37882. /**
  37883. * Returns identity string based on element's name, styles, classes and other attributes.
  37884. * Two elements that {@link #isSimilar are similar} will have same identity string.
  37885. * It has the following format:
  37886. *
  37887. * 'name class="class1,class2" style="style1:value1;style2:value2" attr1="val1" attr2="val2"'
  37888. *
  37889. * For example:
  37890. *
  37891. * const element = writer.createContainerElement( 'foo', {
  37892. * banana: '10',
  37893. * apple: '20',
  37894. * style: 'color: red; border-color: white;',
  37895. * class: 'baz'
  37896. * } );
  37897. *
  37898. * // returns 'foo class="baz" style="border-color:white;color:red" apple="20" banana="10"'
  37899. * element.getIdentity();
  37900. *
  37901. * **Note**: Classes, styles and other attributes are sorted alphabetically.
  37902. *
  37903. * @returns {String}
  37904. */
  37905. getIdentity() {
  37906. const classes = Array.from( this._classes ).sort().join( ',' );
  37907. const styles = this._styles.toString();
  37908. const attributes = Array.from( this._attrs ).map( i => `${ i[ 0 ] }="${ i[ 1 ] }"` ).sort().join( ' ' );
  37909. return this.name +
  37910. ( classes == '' ? '' : ` class="${ classes }"` ) +
  37911. ( !styles ? '' : ` style="${ styles }"` ) +
  37912. ( attributes == '' ? '' : ` ${ attributes }` );
  37913. }
  37914. /**
  37915. * Clones provided element.
  37916. *
  37917. * @protected
  37918. * @param {Boolean} [deep=false] If set to `true` clones element and all its children recursively. When set to `false`,
  37919. * element will be cloned without any children.
  37920. * @returns {module:engine/view/element~Element} Clone of this element.
  37921. */
  37922. _clone( deep = false ) {
  37923. const childrenClone = [];
  37924. if ( deep ) {
  37925. for ( const child of this.getChildren() ) {
  37926. childrenClone.push( child._clone( deep ) );
  37927. }
  37928. }
  37929. // ContainerElement and AttributeElement should be also cloned properly.
  37930. const cloned = new this.constructor( this.document, this.name, this._attrs, childrenClone );
  37931. // Classes and styles are cloned separately - this solution is faster than adding them back to attributes and
  37932. // parse once again in constructor.
  37933. cloned._classes = new Set( this._classes );
  37934. cloned._styles.set( this._styles.getNormalized() );
  37935. // Clone custom properties.
  37936. cloned._customProperties = new Map( this._customProperties );
  37937. // Clone filler offset method.
  37938. // We can't define this method in a prototype because it's behavior which
  37939. // is changed by e.g. toWidget() function from ckeditor5-widget. Perhaps this should be one of custom props.
  37940. cloned.getFillerOffset = this.getFillerOffset;
  37941. return cloned;
  37942. }
  37943. /**
  37944. * {@link module:engine/view/element~Element#_insertChild Insert} a child node or a list of child nodes at the end of this node
  37945. * and sets the parent of these nodes to this element.
  37946. *
  37947. * @see module:engine/view/downcastwriter~DowncastWriter#insert
  37948. * @protected
  37949. * @param {module:engine/view/item~Item|Iterable.<module:engine/view/item~Item>} items Items to be inserted.
  37950. * @fires module:engine/view/node~Node#change
  37951. * @returns {Number} Number of appended nodes.
  37952. */
  37953. _appendChild( items ) {
  37954. return this._insertChild( this.childCount, items );
  37955. }
  37956. /**
  37957. * Inserts a child node or a list of child nodes on the given index and sets the parent of these nodes to
  37958. * this element.
  37959. *
  37960. * @see module:engine/view/downcastwriter~DowncastWriter#insert
  37961. * @protected
  37962. * @param {Number} index Position where nodes should be inserted.
  37963. * @param {module:engine/view/item~Item|Iterable.<module:engine/view/item~Item>} items Items to be inserted.
  37964. * @fires module:engine/view/node~Node#change
  37965. * @returns {Number} Number of inserted nodes.
  37966. */
  37967. _insertChild( index, items ) {
  37968. this._fireChange( 'children', this );
  37969. let count = 0;
  37970. const nodes = normalize( this.document, items );
  37971. for ( const node of nodes ) {
  37972. // If node that is being added to this element is already inside another element, first remove it from the old parent.
  37973. if ( node.parent !== null ) {
  37974. node._remove();
  37975. }
  37976. node.parent = this;
  37977. node.document = this.document;
  37978. this._children.splice( index, 0, node );
  37979. index++;
  37980. count++;
  37981. }
  37982. return count;
  37983. }
  37984. /**
  37985. * Removes number of child nodes starting at the given index and set the parent of these nodes to `null`.
  37986. *
  37987. * @see module:engine/view/downcastwriter~DowncastWriter#remove
  37988. * @protected
  37989. * @param {Number} index Number of the first node to remove.
  37990. * @param {Number} [howMany=1] Number of nodes to remove.
  37991. * @fires module:engine/view/node~Node#change
  37992. * @returns {Array.<module:engine/view/node~Node>} The array of removed nodes.
  37993. */
  37994. _removeChildren( index, howMany = 1 ) {
  37995. this._fireChange( 'children', this );
  37996. for ( let i = index; i < index + howMany; i++ ) {
  37997. this._children[ i ].parent = null;
  37998. }
  37999. return this._children.splice( index, howMany );
  38000. }
  38001. /**
  38002. * Adds or overwrite attribute with a specified key and value.
  38003. *
  38004. * @see module:engine/view/downcastwriter~DowncastWriter#setAttribute
  38005. * @protected
  38006. * @param {String} key Attribute key.
  38007. * @param {String} value Attribute value.
  38008. * @fires module:engine/view/node~Node#change
  38009. */
  38010. _setAttribute( key, value ) {
  38011. value = String( value );
  38012. this._fireChange( 'attributes', this );
  38013. if ( key == 'class' ) {
  38014. parseClasses( this._classes, value );
  38015. } else if ( key == 'style' ) {
  38016. this._styles.setTo( value );
  38017. } else {
  38018. this._attrs.set( key, value );
  38019. }
  38020. }
  38021. /**
  38022. * Removes attribute from the element.
  38023. *
  38024. * @see module:engine/view/downcastwriter~DowncastWriter#removeAttribute
  38025. * @protected
  38026. * @param {String} key Attribute key.
  38027. * @returns {Boolean} Returns true if an attribute existed and has been removed.
  38028. * @fires module:engine/view/node~Node#change
  38029. */
  38030. _removeAttribute( key ) {
  38031. this._fireChange( 'attributes', this );
  38032. // Remove class attribute.
  38033. if ( key == 'class' ) {
  38034. if ( this._classes.size > 0 ) {
  38035. this._classes.clear();
  38036. return true;
  38037. }
  38038. return false;
  38039. }
  38040. // Remove style attribute.
  38041. if ( key == 'style' ) {
  38042. if ( !this._styles.isEmpty ) {
  38043. this._styles.clear();
  38044. return true;
  38045. }
  38046. return false;
  38047. }
  38048. // Remove other attributes.
  38049. return this._attrs.delete( key );
  38050. }
  38051. /**
  38052. * Adds specified class.
  38053. *
  38054. * element._addClass( 'foo' ); // Adds 'foo' class.
  38055. * element._addClass( [ 'foo', 'bar' ] ); // Adds 'foo' and 'bar' classes.
  38056. *
  38057. * @see module:engine/view/downcastwriter~DowncastWriter#addClass
  38058. * @protected
  38059. * @param {Array.<String>|String} className
  38060. * @fires module:engine/view/node~Node#change
  38061. */
  38062. _addClass( className ) {
  38063. this._fireChange( 'attributes', this );
  38064. className = Array.isArray( className ) ? className : [ className ];
  38065. className.forEach( name => this._classes.add( name ) );
  38066. }
  38067. /**
  38068. * Removes specified class.
  38069. *
  38070. * element._removeClass( 'foo' ); // Removes 'foo' class.
  38071. * element._removeClass( [ 'foo', 'bar' ] ); // Removes both 'foo' and 'bar' classes.
  38072. *
  38073. * @see module:engine/view/downcastwriter~DowncastWriter#removeClass
  38074. * @protected
  38075. * @param {Array.<String>|String} className
  38076. * @fires module:engine/view/node~Node#change
  38077. */
  38078. _removeClass( className ) {
  38079. this._fireChange( 'attributes', this );
  38080. className = Array.isArray( className ) ? className : [ className ];
  38081. className.forEach( name => this._classes.delete( name ) );
  38082. }
  38083. /**
  38084. * Adds style to the element.
  38085. *
  38086. * element._setStyle( 'color', 'red' );
  38087. * element._setStyle( {
  38088. * color: 'red',
  38089. * position: 'fixed'
  38090. * } );
  38091. *
  38092. * **Note**: This method can work with normalized style names if
  38093. * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.
  38094. * See {@link module:engine/view/stylesmap~StylesMap#set `StylesMap#set()`} for details.
  38095. *
  38096. * @see module:engine/view/downcastwriter~DowncastWriter#setStyle
  38097. * @protected
  38098. * @param {String|Object} property Property name or object with key - value pairs.
  38099. * @param {String} [value] Value to set. This parameter is ignored if object is provided as the first parameter.
  38100. * @fires module:engine/view/node~Node#change
  38101. */
  38102. _setStyle( property, value ) {
  38103. this._fireChange( 'attributes', this );
  38104. this._styles.set( property, value );
  38105. }
  38106. /**
  38107. * Removes specified style.
  38108. *
  38109. * element._removeStyle( 'color' ); // Removes 'color' style.
  38110. * element._removeStyle( [ 'color', 'border-top' ] ); // Removes both 'color' and 'border-top' styles.
  38111. *
  38112. * **Note**: This method can work with normalized style names if
  38113. * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.
  38114. * See {@link module:engine/view/stylesmap~StylesMap#remove `StylesMap#remove()`} for details.
  38115. *
  38116. * @see module:engine/view/downcastwriter~DowncastWriter#removeStyle
  38117. * @protected
  38118. * @param {Array.<String>|String} property
  38119. * @fires module:engine/view/node~Node#change
  38120. */
  38121. _removeStyle( property ) {
  38122. this._fireChange( 'attributes', this );
  38123. property = Array.isArray( property ) ? property : [ property ];
  38124. property.forEach( name => this._styles.remove( name ) );
  38125. }
  38126. /**
  38127. * Sets a custom property. Unlike attributes, custom properties are not rendered to the DOM,
  38128. * so they can be used to add special data to elements.
  38129. *
  38130. * @see module:engine/view/downcastwriter~DowncastWriter#setCustomProperty
  38131. * @protected
  38132. * @param {String|Symbol} key
  38133. * @param {*} value
  38134. */
  38135. _setCustomProperty( key, value ) {
  38136. this._customProperties.set( key, value );
  38137. }
  38138. /**
  38139. * Removes the custom property stored under the given key.
  38140. *
  38141. * @see module:engine/view/downcastwriter~DowncastWriter#removeCustomProperty
  38142. * @protected
  38143. * @param {String|Symbol} key
  38144. * @returns {Boolean} Returns true if property was removed.
  38145. */
  38146. _removeCustomProperty( key ) {
  38147. return this._customProperties.delete( key );
  38148. }
  38149. /**
  38150. * Returns block {@link module:engine/view/filler filler} offset or `null` if block filler is not needed.
  38151. *
  38152. * @abstract
  38153. * @method module:engine/view/element~Element#getFillerOffset
  38154. */
  38155. // @if CK_DEBUG_ENGINE // printTree( level = 0) {
  38156. // @if CK_DEBUG_ENGINE // let string = '';
  38157. // @if CK_DEBUG_ENGINE // string += '\t'.repeat( level ) + `<${ this.name }${ convertMapToTags( this.getAttributes() ) }>`;
  38158. // @if CK_DEBUG_ENGINE // for ( const child of this.getChildren() ) {
  38159. // @if CK_DEBUG_ENGINE // if ( child.is( '$text' ) ) {
  38160. // @if CK_DEBUG_ENGINE // string += '\n' + '\t'.repeat( level + 1 ) + child.data;
  38161. // @if CK_DEBUG_ENGINE // } else {
  38162. // @if CK_DEBUG_ENGINE // string += '\n' + child.printTree( level + 1 );
  38163. // @if CK_DEBUG_ENGINE // }
  38164. // @if CK_DEBUG_ENGINE // }
  38165. // @if CK_DEBUG_ENGINE // if ( this.childCount ) {
  38166. // @if CK_DEBUG_ENGINE // string += '\n' + '\t'.repeat( level );
  38167. // @if CK_DEBUG_ENGINE // }
  38168. // @if CK_DEBUG_ENGINE // string += `</${ this.name }>`;
  38169. // @if CK_DEBUG_ENGINE // return string;
  38170. // @if CK_DEBUG_ENGINE // }
  38171. // @if CK_DEBUG_ENGINE // logTree() {
  38172. // @if CK_DEBUG_ENGINE // console.log( this.printTree() );
  38173. // @if CK_DEBUG_ENGINE // }
  38174. }
  38175. // Parses attributes provided to the element constructor before they are applied to an element. If attributes are passed
  38176. // as an object (instead of `Iterable`), the object is transformed to the map. Attributes with `null` value are removed.
  38177. // Attributes with non-`String` value are converted to `String`.
  38178. //
  38179. // @param {Object|Iterable} attrs Attributes to parse.
  38180. // @returns {Map} Parsed attributes.
  38181. function parseAttributes( attrs ) {
  38182. attrs = Object(_ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_3__["default"])( attrs );
  38183. for ( const [ key, value ] of attrs ) {
  38184. if ( value === null ) {
  38185. attrs.delete( key );
  38186. } else if ( typeof value != 'string' ) {
  38187. attrs.set( key, String( value ) );
  38188. }
  38189. }
  38190. return attrs;
  38191. }
  38192. // Parses class attribute and puts all classes into classes set.
  38193. // Classes set s cleared before insertion.
  38194. //
  38195. // @param {Set.<String>} classesSet Set to insert parsed classes.
  38196. // @param {String} classesString String with classes to parse.
  38197. function parseClasses( classesSet, classesString ) {
  38198. const classArray = classesString.split( /\s+/ );
  38199. classesSet.clear();
  38200. classArray.forEach( name => classesSet.add( name ) );
  38201. }
  38202. // Converts strings to Text and non-iterables to arrays.
  38203. //
  38204. // @param {String|module:engine/view/item~Item|Iterable.<String|module:engine/view/item~Item>}
  38205. // @returns {Iterable.<module:engine/view/node~Node>}
  38206. function normalize( document, nodes ) {
  38207. // Separate condition because string is iterable.
  38208. if ( typeof nodes == 'string' ) {
  38209. return [ new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( document, nodes ) ];
  38210. }
  38211. if ( !Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_4__["default"])( nodes ) ) {
  38212. nodes = [ nodes ];
  38213. }
  38214. // Array.from to enable .map() on non-arrays.
  38215. return Array.from( nodes )
  38216. .map( node => {
  38217. if ( typeof node == 'string' ) {
  38218. return new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( document, node );
  38219. }
  38220. if ( node instanceof _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
  38221. return new _text__WEBPACK_IMPORTED_MODULE_1__["default"]( document, node.data );
  38222. }
  38223. return node;
  38224. } );
  38225. }
  38226. /***/ }),
  38227. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/emptyelement.js":
  38228. /*!**************************************************************************!*\
  38229. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/emptyelement.js ***!
  38230. \**************************************************************************/
  38231. /*! exports provided: default */
  38232. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38233. "use strict";
  38234. __webpack_require__.r(__webpack_exports__);
  38235. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EmptyElement; });
  38236. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js");
  38237. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  38238. /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/node.js");
  38239. /**
  38240. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  38241. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  38242. */
  38243. /**
  38244. * @module engine/view/emptyelement
  38245. */
  38246. /**
  38247. * Empty element class. It is used to represent elements that cannot contain any child nodes (for example `<img>` elements).
  38248. *
  38249. * To create a new empty element use the
  38250. * {@link module:engine/view/downcastwriter~DowncastWriter#createEmptyElement `downcastWriter#createEmptyElement()`} method.
  38251. *
  38252. * @extends module:engine/view/element~Element
  38253. */
  38254. class EmptyElement extends _element__WEBPACK_IMPORTED_MODULE_0__["default"] {
  38255. /**
  38256. * Creates new instance of EmptyElement.
  38257. *
  38258. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-emptyelement-cannot-add` when third parameter is passed,
  38259. * to inform that usage of EmptyElement is incorrect (adding child nodes to EmptyElement is forbidden).
  38260. *
  38261. * @see module:engine/view/downcastwriter~DowncastWriter#createEmptyElement
  38262. * @protected
  38263. * @param {module:engine/view/document~Document} document The document instance to which this element belongs.
  38264. * @param {String} name Node name.
  38265. * @param {Object|Iterable} [attrs] Collection of attributes.
  38266. * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
  38267. * A list of nodes to be inserted into created element.
  38268. */
  38269. constructor( document, name, attrs, children ) {
  38270. super( document, name, attrs, children );
  38271. /**
  38272. * Returns `null` because filler is not needed for EmptyElements.
  38273. *
  38274. * @method #getFillerOffset
  38275. * @returns {null} Always returns null.
  38276. */
  38277. this.getFillerOffset = getFillerOffset;
  38278. }
  38279. /**
  38280. * Checks whether this object is of the given.
  38281. *
  38282. * emptyElement.is( 'emptyElement' ); // -> true
  38283. * emptyElement.is( 'element' ); // -> true
  38284. * emptyElement.is( 'node' ); // -> true
  38285. * emptyElement.is( 'view:emptyElement' ); // -> true
  38286. * emptyElement.is( 'view:element' ); // -> true
  38287. * emptyElement.is( 'view:node' ); // -> true
  38288. *
  38289. * emptyElement.is( 'model:element' ); // -> false
  38290. * emptyElement.is( 'documentFragment' ); // -> false
  38291. *
  38292. * Assuming that the object being checked is an empty element, you can also check its
  38293. * {@link module:engine/view/emptyelement~EmptyElement#name name}:
  38294. *
  38295. * emptyElement.is( 'element', 'img' ); // -> true if this is a img element
  38296. * emptyElement.is( 'emptyElement', 'img' ); // -> same as above
  38297. * text.is( 'element', 'img' ); -> false
  38298. *
  38299. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  38300. *
  38301. * @param {String} type Type to check.
  38302. * @param {String} [name] Element name.
  38303. * @returns {Boolean}
  38304. */
  38305. is( type, name = null ) {
  38306. if ( !name ) {
  38307. return type === 'emptyElement' || type === 'view:emptyElement' ||
  38308. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  38309. type === 'element' || type === 'view:element' ||
  38310. type === 'node' || type === 'view:node';
  38311. } else {
  38312. return name === this.name && (
  38313. type === 'emptyElement' || type === 'view:emptyElement' ||
  38314. type === 'element' || type === 'view:element'
  38315. );
  38316. }
  38317. }
  38318. /**
  38319. * Overrides {@link module:engine/view/element~Element#_insertChild} method.
  38320. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-emptyelement-cannot-add` to prevent
  38321. * adding any child nodes to EmptyElement.
  38322. *
  38323. * @protected
  38324. */
  38325. _insertChild( index, nodes ) {
  38326. if ( nodes && ( nodes instanceof _node__WEBPACK_IMPORTED_MODULE_2__["default"] || Array.from( nodes ).length > 0 ) ) {
  38327. /**
  38328. * Cannot add children to {@link module:engine/view/emptyelement~EmptyElement}.
  38329. *
  38330. * @error view-emptyelement-cannot-add
  38331. */
  38332. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
  38333. 'view-emptyelement-cannot-add',
  38334. [ this, nodes ]
  38335. );
  38336. }
  38337. }
  38338. }
  38339. // Returns `null` because block filler is not needed for EmptyElements.
  38340. //
  38341. // @returns {null}
  38342. function getFillerOffset() {
  38343. return null;
  38344. }
  38345. /***/ }),
  38346. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/filler.js":
  38347. /*!********************************************************************!*\
  38348. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/filler.js ***!
  38349. \********************************************************************/
  38350. /*! exports provided: NBSP_FILLER, BR_FILLER, INLINE_FILLER_LENGTH, INLINE_FILLER, startsWithFiller, isInlineFiller, getDataWithoutFiller, injectQuirksHandling */
  38351. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38352. "use strict";
  38353. __webpack_require__.r(__webpack_exports__);
  38354. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NBSP_FILLER", function() { return NBSP_FILLER; });
  38355. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BR_FILLER", function() { return BR_FILLER; });
  38356. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "INLINE_FILLER_LENGTH", function() { return INLINE_FILLER_LENGTH; });
  38357. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "INLINE_FILLER", function() { return INLINE_FILLER; });
  38358. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWithFiller", function() { return startsWithFiller; });
  38359. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isInlineFiller", function() { return isInlineFiller; });
  38360. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDataWithoutFiller", function() { return getDataWithoutFiller; });
  38361. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "injectQuirksHandling", function() { return injectQuirksHandling; });
  38362. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
  38363. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/istext */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/istext.js");
  38364. /**
  38365. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  38366. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  38367. */
  38368. /**
  38369. * Set of utils related to block and inline fillers handling.
  38370. *
  38371. * Browsers do not allow to put caret in elements which does not have height. Because of it, we need to fill all
  38372. * empty elements which should be selectable with elements or characters called "fillers". Unfortunately there is no one
  38373. * universal filler, this is why two types are uses:
  38374. *
  38375. * * Block filler is an element which fill block elements, like `<p>`. CKEditor uses `<br>` as a block filler during the editing,
  38376. * as browsers do natively. So instead of an empty `<p>` there will be `<p><br></p>`. The advantage of block filler is that
  38377. * it is transparent for the selection, so when the caret is before the `<br>` and user presses right arrow he will be
  38378. * moved to the next paragraph, not after the `<br>`. The disadvantage is that it breaks a block, so it can not be used
  38379. * in the middle of a line of text. The {@link module:engine/view/filler~BR_FILLER `<br>` filler} can be replaced with any other
  38380. * character in the data output, for instance {@link module:engine/view/filler~NBSP_FILLER non-breaking space}.
  38381. *
  38382. * * Inline filler is a filler which does not break a line of text, so it can be used inside the text, for instance in the empty
  38383. * `<b>` surrendered by text: `foo<b></b>bar`, if we want to put the caret there. CKEditor uses a sequence of the zero-width
  38384. * spaces as an {@link module:engine/view/filler~INLINE_FILLER inline filler} having the predetermined
  38385. * {@link module:engine/view/filler~INLINE_FILLER_LENGTH length}. A sequence is used, instead of a single character to
  38386. * avoid treating random zero-width spaces as the inline filler. Disadvantage of the inline filler is that it is not
  38387. * transparent for the selection. The arrow key moves the caret between zero-width spaces characters, so the additional
  38388. * code is needed to handle the caret.
  38389. *
  38390. * Both inline and block fillers are handled by the {@link module:engine/view/renderer~Renderer renderer} and are not present in the
  38391. * view.
  38392. *
  38393. * @module engine/view/filler
  38394. */
  38395. /**
  38396. * Non-breaking space filler creator. This is a function which creates `&nbsp;` text node.
  38397. * It defines how the filler is created.
  38398. *
  38399. * @see module:engine/view/filler~BR_FILLER
  38400. * @function
  38401. */
  38402. const NBSP_FILLER = domDocument => domDocument.createTextNode( '\u00A0' );
  38403. /**
  38404. * `<br>` filler creator. This is a function which creates `<br data-cke-filler="true">` element.
  38405. * It defines how the filler is created.
  38406. *
  38407. * @see module:engine/view/filler~NBSP_FILLER
  38408. * @function
  38409. */
  38410. const BR_FILLER = domDocument => {
  38411. const fillerBr = domDocument.createElement( 'br' );
  38412. fillerBr.dataset.ckeFiller = true;
  38413. return fillerBr;
  38414. };
  38415. /**
  38416. * Length of the {@link module:engine/view/filler~INLINE_FILLER INLINE_FILLER}.
  38417. */
  38418. const INLINE_FILLER_LENGTH = 7;
  38419. /**
  38420. * Inline filler which is a sequence of the zero width spaces.
  38421. *
  38422. * @type {String}
  38423. */
  38424. const INLINE_FILLER = ( () => {
  38425. let inlineFiller = '';
  38426. for ( let i = 0; i < INLINE_FILLER_LENGTH; i++ ) {
  38427. inlineFiller += '\u200b';
  38428. }
  38429. return inlineFiller;
  38430. } )(); // Usu IIF so the INLINE_FILLER appears as a constant in the docs.
  38431. /**
  38432. * Checks if the node is a text node which starts with the {@link module:engine/view/filler~INLINE_FILLER inline filler}.
  38433. *
  38434. * startsWithFiller( document.createTextNode( INLINE_FILLER ) ); // true
  38435. * startsWithFiller( document.createTextNode( INLINE_FILLER + 'foo' ) ); // true
  38436. * startsWithFiller( document.createTextNode( 'foo' ) ); // false
  38437. * startsWithFiller( document.createElement( 'p' ) ); // false
  38438. *
  38439. * @param {Node} domNode DOM node.
  38440. * @returns {Boolean} True if the text node starts with the {@link module:engine/view/filler~INLINE_FILLER inline filler}.
  38441. */
  38442. function startsWithFiller( domNode ) {
  38443. return Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_1__["default"])( domNode ) && ( domNode.data.substr( 0, INLINE_FILLER_LENGTH ) === INLINE_FILLER );
  38444. }
  38445. /**
  38446. * Checks if the text node contains only the {@link module:engine/view/filler~INLINE_FILLER inline filler}.
  38447. *
  38448. * isInlineFiller( document.createTextNode( INLINE_FILLER ) ); // true
  38449. * isInlineFiller( document.createTextNode( INLINE_FILLER + 'foo' ) ); // false
  38450. *
  38451. * @param {Text} domText DOM text node.
  38452. * @returns {Boolean} True if the text node contains only the {@link module:engine/view/filler~INLINE_FILLER inline filler}.
  38453. */
  38454. function isInlineFiller( domText ) {
  38455. return domText.data.length == INLINE_FILLER_LENGTH && startsWithFiller( domText );
  38456. }
  38457. /**
  38458. * Get string data from the text node, removing an {@link module:engine/view/filler~INLINE_FILLER inline filler} from it,
  38459. * if text node contains it.
  38460. *
  38461. * getDataWithoutFiller( document.createTextNode( INLINE_FILLER + 'foo' ) ) == 'foo' // true
  38462. * getDataWithoutFiller( document.createTextNode( 'foo' ) ) == 'foo' // true
  38463. *
  38464. * @param {Text} domText DOM text node, possible with inline filler.
  38465. * @returns {String} Data without filler.
  38466. */
  38467. function getDataWithoutFiller( domText ) {
  38468. if ( startsWithFiller( domText ) ) {
  38469. return domText.data.slice( INLINE_FILLER_LENGTH );
  38470. } else {
  38471. return domText.data;
  38472. }
  38473. }
  38474. /**
  38475. * Assign key observer which move cursor from the end of the inline filler to the beginning of it when
  38476. * the left arrow is pressed, so the filler does not break navigation.
  38477. *
  38478. * @param {module:engine/view/view~View} view View controller instance we should inject quirks handling on.
  38479. */
  38480. function injectQuirksHandling( view ) {
  38481. view.document.on( 'keydown', jumpOverInlineFiller );
  38482. }
  38483. // Move cursor from the end of the inline filler to the beginning of it when, so the filler does not break navigation.
  38484. function jumpOverInlineFiller( evt, data ) {
  38485. if ( data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__["keyCodes"].arrowleft ) {
  38486. const domSelection = data.domTarget.ownerDocument.defaultView.getSelection();
  38487. if ( domSelection.rangeCount == 1 && domSelection.getRangeAt( 0 ).collapsed ) {
  38488. const domParent = domSelection.getRangeAt( 0 ).startContainer;
  38489. const domOffset = domSelection.getRangeAt( 0 ).startOffset;
  38490. if ( startsWithFiller( domParent ) && domOffset <= INLINE_FILLER_LENGTH ) {
  38491. domSelection.collapse( domParent, 0 );
  38492. }
  38493. }
  38494. }
  38495. }
  38496. /***/ }),
  38497. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/matcher.js":
  38498. /*!*********************************************************************!*\
  38499. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/matcher.js ***!
  38500. \*********************************************************************/
  38501. /*! exports provided: default */
  38502. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38503. "use strict";
  38504. __webpack_require__.r(__webpack_exports__);
  38505. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Matcher; });
  38506. /**
  38507. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  38508. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  38509. */
  38510. /**
  38511. * @module engine/view/matcher
  38512. */
  38513. /**
  38514. * View matcher class.
  38515. * Instance of this class can be used to find {@link module:engine/view/element~Element elements} that match given pattern.
  38516. */
  38517. class Matcher {
  38518. /**
  38519. * Creates new instance of Matcher.
  38520. *
  38521. * @param {String|RegExp|Object} [pattern] Match patterns. See {@link module:engine/view/matcher~Matcher#add add method} for
  38522. * more information.
  38523. */
  38524. constructor( ...pattern ) {
  38525. /**
  38526. * @private
  38527. * @type {Array<String|RegExp|Object>}
  38528. */
  38529. this._patterns = [];
  38530. this.add( ...pattern );
  38531. }
  38532. /**
  38533. * Adds pattern or patterns to matcher instance.
  38534. *
  38535. * // String.
  38536. * matcher.add( 'div' );
  38537. *
  38538. * // Regular expression.
  38539. * matcher.add( /^\w/ );
  38540. *
  38541. * // Single class.
  38542. * matcher.add( {
  38543. * classes: 'foobar'
  38544. * } );
  38545. *
  38546. * See {@link module:engine/view/matcher~MatcherPattern} for more examples.
  38547. *
  38548. * Multiple patterns can be added in one call:
  38549. *
  38550. * matcher.add( 'div', { classes: 'foobar' } );
  38551. *
  38552. * @param {Object|String|RegExp|Function} pattern Object describing pattern details. If string or regular expression
  38553. * is provided it will be used to match element's name. Pattern can be also provided in a form
  38554. * of a function - then this function will be called with each {@link module:engine/view/element~Element element} as a parameter.
  38555. * Function's return value will be stored under `match` key of the object returned from
  38556. * {@link module:engine/view/matcher~Matcher#match match} or {@link module:engine/view/matcher~Matcher#matchAll matchAll} methods.
  38557. * @param {String|RegExp} [pattern.name] Name or regular expression to match element's name.
  38558. * @param {Object} [pattern.attributes] Object with key-value pairs representing attributes to match. Each object key
  38559. * represents attribute name. Value under that key can be either:
  38560. * * `true` - then attribute is just required (can be empty),
  38561. * * a string - then attribute has to be equal, or
  38562. * * a regular expression - then attribute has to match the expression.
  38563. * @param {String|RegExp|Array} [pattern.classes] Class name or array of class names to match. Each name can be
  38564. * provided in a form of string or regular expression.
  38565. * @param {Object} [pattern.styles] Object with key-value pairs representing styles to match. Each object key
  38566. * represents style name. Value under that key can be either a string or a regular expression and it will be used
  38567. * to match style value.
  38568. */
  38569. add( ...pattern ) {
  38570. for ( let item of pattern ) {
  38571. // String or RegExp pattern is used as element's name.
  38572. if ( typeof item == 'string' || item instanceof RegExp ) {
  38573. item = { name: item };
  38574. }
  38575. // Single class name/RegExp can be provided.
  38576. if ( item.classes && ( typeof item.classes == 'string' || item.classes instanceof RegExp ) ) {
  38577. item.classes = [ item.classes ];
  38578. }
  38579. this._patterns.push( item );
  38580. }
  38581. }
  38582. /**
  38583. * Matches elements for currently stored patterns. Returns match information about first found
  38584. * {@link module:engine/view/element~Element element}, otherwise returns `null`.
  38585. *
  38586. * Example of returned object:
  38587. *
  38588. * {
  38589. * element: <instance of found element>,
  38590. * pattern: <pattern used to match found element>,
  38591. * match: {
  38592. * name: true,
  38593. * attributes: [ 'title', 'href' ],
  38594. * classes: [ 'foo' ],
  38595. * styles: [ 'color', 'position' ]
  38596. * }
  38597. * }
  38598. *
  38599. * @see module:engine/view/matcher~Matcher#add
  38600. * @see module:engine/view/matcher~Matcher#matchAll
  38601. * @param {...module:engine/view/element~Element} element View element to match against stored patterns.
  38602. * @returns {Object|null} result
  38603. * @returns {module:engine/view/element~Element} result.element Matched view element.
  38604. * @returns {Object|String|RegExp|Function} result.pattern Pattern that was used to find matched element.
  38605. * @returns {Object} result.match Object representing matched element parts.
  38606. * @returns {Boolean} [result.match.name] True if name of the element was matched.
  38607. * @returns {Array} [result.match.attributes] Array with matched attribute names.
  38608. * @returns {Array} [result.match.classes] Array with matched class names.
  38609. * @returns {Array} [result.match.styles] Array with matched style names.
  38610. */
  38611. match( ...element ) {
  38612. for ( const singleElement of element ) {
  38613. for ( const pattern of this._patterns ) {
  38614. const match = isElementMatching( singleElement, pattern );
  38615. if ( match ) {
  38616. return {
  38617. element: singleElement,
  38618. pattern,
  38619. match
  38620. };
  38621. }
  38622. }
  38623. }
  38624. return null;
  38625. }
  38626. /**
  38627. * Matches elements for currently stored patterns. Returns array of match information with all found
  38628. * {@link module:engine/view/element~Element elements}. If no element is found - returns `null`.
  38629. *
  38630. * @see module:engine/view/matcher~Matcher#add
  38631. * @see module:engine/view/matcher~Matcher#match
  38632. * @param {...module:engine/view/element~Element} element View element to match against stored patterns.
  38633. * @returns {Array.<Object>|null} Array with match information about found elements or `null`. For more information
  38634. * see {@link module:engine/view/matcher~Matcher#match match method} description.
  38635. */
  38636. matchAll( ...element ) {
  38637. const results = [];
  38638. for ( const singleElement of element ) {
  38639. for ( const pattern of this._patterns ) {
  38640. const match = isElementMatching( singleElement, pattern );
  38641. if ( match ) {
  38642. results.push( {
  38643. element: singleElement,
  38644. pattern,
  38645. match
  38646. } );
  38647. }
  38648. }
  38649. }
  38650. return results.length > 0 ? results : null;
  38651. }
  38652. /**
  38653. * Returns the name of the element to match if there is exactly one pattern added to the matcher instance
  38654. * and it matches element name defined by `string` (not `RegExp`). Otherwise, returns `null`.
  38655. *
  38656. * @returns {String|null} Element name trying to match.
  38657. */
  38658. getElementName() {
  38659. if ( this._patterns.length !== 1 ) {
  38660. return null;
  38661. }
  38662. const pattern = this._patterns[ 0 ];
  38663. const name = pattern.name;
  38664. return ( typeof pattern != 'function' && name && !( name instanceof RegExp ) ) ? name : null;
  38665. }
  38666. }
  38667. // Returns match information if {@link module:engine/view/element~Element element} is matching provided pattern.
  38668. // If element cannot be matched to provided pattern - returns `null`.
  38669. //
  38670. // @param {module:engine/view/element~Element} element
  38671. // @param {Object|String|RegExp|Function} pattern
  38672. // @returns {Object|null} Returns object with match information or null if element is not matching.
  38673. function isElementMatching( element, pattern ) {
  38674. // If pattern is provided as function - return result of that function;
  38675. if ( typeof pattern == 'function' ) {
  38676. return pattern( element );
  38677. }
  38678. const match = {};
  38679. // Check element's name.
  38680. if ( pattern.name ) {
  38681. match.name = matchName( pattern.name, element.name );
  38682. if ( !match.name ) {
  38683. return null;
  38684. }
  38685. }
  38686. // Check element's attributes.
  38687. if ( pattern.attributes ) {
  38688. match.attributes = matchAttributes( pattern.attributes, element );
  38689. if ( !match.attributes ) {
  38690. return null;
  38691. }
  38692. }
  38693. // Check element's classes.
  38694. if ( pattern.classes ) {
  38695. match.classes = matchClasses( pattern.classes, element );
  38696. if ( !match.classes ) {
  38697. return false;
  38698. }
  38699. }
  38700. // Check element's styles.
  38701. if ( pattern.styles ) {
  38702. match.styles = matchStyles( pattern.styles, element );
  38703. if ( !match.styles ) {
  38704. return false;
  38705. }
  38706. }
  38707. return match;
  38708. }
  38709. // Checks if name can be matched by provided pattern.
  38710. //
  38711. // @param {String|RegExp} pattern
  38712. // @param {String} name
  38713. // @returns {Boolean} Returns `true` if name can be matched, `false` otherwise.
  38714. function matchName( pattern, name ) {
  38715. // If pattern is provided as RegExp - test against this regexp.
  38716. if ( pattern instanceof RegExp ) {
  38717. return pattern.test( name );
  38718. }
  38719. return pattern === name;
  38720. }
  38721. // Checks if attributes of provided element can be matched against provided patterns.
  38722. //
  38723. // @param {Object} patterns Object with information about attributes to match. Each key of the object will be
  38724. // used as attribute name. Value of each key can be a string or regular expression to match against attribute value.
  38725. // @param {module:engine/view/element~Element} element Element which attributes will be tested.
  38726. // @returns {Array|null} Returns array with matched attribute names or `null` if no attributes were matched.
  38727. function matchAttributes( patterns, element ) {
  38728. const match = [];
  38729. for ( const name in patterns ) {
  38730. const pattern = patterns[ name ];
  38731. if ( element.hasAttribute( name ) ) {
  38732. const attribute = element.getAttribute( name );
  38733. if ( pattern === true ) {
  38734. match.push( name );
  38735. } else if ( pattern instanceof RegExp ) {
  38736. if ( pattern.test( attribute ) ) {
  38737. match.push( name );
  38738. } else {
  38739. return null;
  38740. }
  38741. } else if ( attribute === pattern ) {
  38742. match.push( name );
  38743. } else {
  38744. return null;
  38745. }
  38746. } else {
  38747. return null;
  38748. }
  38749. }
  38750. return match;
  38751. }
  38752. // Checks if classes of provided element can be matched against provided patterns.
  38753. //
  38754. // @param {Array.<String|RegExp>} patterns Array of strings or regular expressions to match against element's classes.
  38755. // @param {module:engine/view/element~Element} element Element which classes will be tested.
  38756. // @returns {Array|null} Returns array with matched class names or `null` if no classes were matched.
  38757. function matchClasses( patterns, element ) {
  38758. const match = [];
  38759. for ( const pattern of patterns ) {
  38760. if ( pattern instanceof RegExp ) {
  38761. const classes = element.getClassNames();
  38762. for ( const name of classes ) {
  38763. if ( pattern.test( name ) ) {
  38764. match.push( name );
  38765. }
  38766. }
  38767. if ( match.length === 0 ) {
  38768. return null;
  38769. }
  38770. } else if ( element.hasClass( pattern ) ) {
  38771. match.push( pattern );
  38772. } else {
  38773. return null;
  38774. }
  38775. }
  38776. return match;
  38777. }
  38778. // Checks if styles of provided element can be matched against provided patterns.
  38779. //
  38780. // @param {Object} patterns Object with information about styles to match. Each key of the object will be
  38781. // used as style name. Value of each key can be a string or regular expression to match against style value.
  38782. // @param {module:engine/view/element~Element} element Element which styles will be tested.
  38783. // @returns {Array|null} Returns array with matched style names or `null` if no styles were matched.
  38784. function matchStyles( patterns, element ) {
  38785. const match = [];
  38786. for ( const name in patterns ) {
  38787. const pattern = patterns[ name ];
  38788. if ( element.hasStyle( name ) ) {
  38789. const style = element.getStyle( name );
  38790. if ( pattern instanceof RegExp ) {
  38791. if ( pattern.test( style ) ) {
  38792. match.push( name );
  38793. } else {
  38794. return null;
  38795. }
  38796. } else if ( style === pattern ) {
  38797. match.push( name );
  38798. } else {
  38799. return null;
  38800. }
  38801. } else {
  38802. return null;
  38803. }
  38804. }
  38805. return match;
  38806. }
  38807. /**
  38808. * An entity that is a valid pattern recognized by a matcher. `MatcherPattern` is used by {@link ~Matcher} to recognize
  38809. * if a view element fits in a group of view elements described by the pattern.
  38810. *
  38811. * `MatcherPattern` can be given as a `String`, a `RegExp`, an `Object` or a `Function`.
  38812. *
  38813. * If `MatcherPattern` is given as a `String` or `RegExp`, it will match any view element that has a matching name:
  38814. *
  38815. * // Match any element with name equal to 'div'.
  38816. * const pattern = 'div';
  38817. *
  38818. * // Match any element which name starts on 'p'.
  38819. * const pattern = /^p/;
  38820. *
  38821. * If `MatcherPattern` is given as an `Object`, all the object's properties will be matched with view element properties.
  38822. *
  38823. * // Match view element's name.
  38824. * const pattern = { name: /^p/ };
  38825. *
  38826. * // Match view element which has matching attributes.
  38827. * const pattern = {
  38828. * attributes: {
  38829. * title: 'foobar', // Attribute title should equal 'foobar'.
  38830. * foo: /^\w+/, // Attribute foo should match /^\w+/ regexp.
  38831. * bar: true // Attribute bar should be set (can be empty).
  38832. * }
  38833. * };
  38834. *
  38835. * // Match view element which has given class.
  38836. * const pattern = {
  38837. * classes: 'foobar'
  38838. * };
  38839. *
  38840. * // Match view element class using regular expression.
  38841. * const pattern = {
  38842. * classes: /foo.../
  38843. * };
  38844. *
  38845. * // Multiple classes to match.
  38846. * const pattern = {
  38847. * classes: [ 'baz', 'bar', /foo.../ ]
  38848. * };
  38849. *
  38850. * // Match view element which has given styles.
  38851. * const pattern = {
  38852. * styles: {
  38853. * position: 'absolute',
  38854. * color: /^\w*blue$/
  38855. * }
  38856. * };
  38857. *
  38858. * // Pattern with multiple properties.
  38859. * const pattern = {
  38860. * name: 'span',
  38861. * styles: {
  38862. * 'font-weight': 'bold'
  38863. * },
  38864. * classes: 'highlighted'
  38865. * };
  38866. *
  38867. * If `MatcherPattern` is given as a `Function`, the function takes a view element as a first and only parameter and
  38868. * the function should decide whether that element matches. If so, it should return what part of the view element has been matched.
  38869. * Otherwise, the function should return `null`. The returned result will be included in `match` property of the object
  38870. * returned by {@link ~Matcher#match} call.
  38871. *
  38872. * // Match an empty <div> element.
  38873. * const pattern = element => {
  38874. * if ( element.name == 'div' && element.childCount > 0 ) {
  38875. * // Return which part of the element was matched.
  38876. * return { name: true };
  38877. * }
  38878. *
  38879. * return null;
  38880. * };
  38881. *
  38882. * // Match a <p> element with big font ("heading-like" element).
  38883. * const pattern = element => {
  38884. * if ( element.name == 'p' ) {
  38885. * const fontSize = element.getStyle( 'font-size' );
  38886. * const size = fontSize.match( /(\d+)/px );
  38887. *
  38888. * if ( size && Number( size[ 1 ] ) > 26 ) {
  38889. * return { name: true, attribute: [ 'font-size' ] };
  38890. * }
  38891. * }
  38892. *
  38893. * return null;
  38894. * };
  38895. *
  38896. * `MatcherPattern` is defined in a way that it is a superset of {@link module:engine/view/elementdefinition~ElementDefinition},
  38897. * that is, every `ElementDefinition` also can be used as a `MatcherPattern`.
  38898. *
  38899. * @typedef {String|RegExp|Object|Function} module:engine/view/matcher~MatcherPattern
  38900. *
  38901. * @property {String|RegExp} [name] View element name to match.
  38902. * @property {String|RegExp|Array.<String|RegExp>} [classes] View element's class name(s) to match.
  38903. * @property {Object} [styles] Object with key-value pairs representing styles to match.
  38904. * Each object key represents style name. Value can be given as `String` or `RegExp`.
  38905. * @property {Object} [attributes] Object with key-value pairs representing attributes to match.
  38906. * Each object key represents attribute name. Value can be given as `String` or `RegExp`.
  38907. */
  38908. /***/ }),
  38909. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/node.js":
  38910. /*!******************************************************************!*\
  38911. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/node.js ***!
  38912. \******************************************************************/
  38913. /*! exports provided: default */
  38914. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38915. "use strict";
  38916. __webpack_require__.r(__webpack_exports__);
  38917. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Node; });
  38918. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  38919. /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  38920. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  38921. /* harmony import */ var _ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/comparearrays */ "./node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.js");
  38922. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  38923. /* harmony import */ var _ckeditor_ckeditor5_utils_src_version__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/version */ "./node_modules/@ckeditor/ckeditor5-utils/src/version.js");
  38924. /**
  38925. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  38926. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  38927. */
  38928. /**
  38929. * @module engine/view/node
  38930. */
  38931. // To check if component is loaded more than once.
  38932. /**
  38933. * Abstract view node class.
  38934. *
  38935. * This is an abstract class. Its constructor should not be used directly.
  38936. * Use the {@link module:engine/view/downcastwriter~DowncastWriter} or {@link module:engine/view/upcastwriter~UpcastWriter}
  38937. * to create new instances of view nodes.
  38938. *
  38939. * @abstract
  38940. */
  38941. class Node {
  38942. /**
  38943. * Creates a tree view node.
  38944. *
  38945. * @protected
  38946. * @param {module:engine/view/document~Document} document The document instance to which this node belongs.
  38947. */
  38948. constructor( document ) {
  38949. /**
  38950. * The document instance to which this node belongs.
  38951. *
  38952. * @readonly
  38953. * @member {module:engine/view/document~Document}
  38954. */
  38955. this.document = document;
  38956. /**
  38957. * Parent element. Null by default. Set by {@link module:engine/view/element~Element#_insertChild}.
  38958. *
  38959. * @readonly
  38960. * @member {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment|null}
  38961. */
  38962. this.parent = null;
  38963. }
  38964. /**
  38965. * Index of the node in the parent element or null if the node has no parent.
  38966. *
  38967. * Accessing this property throws an error if this node's parent element does not contain it.
  38968. * This means that view tree got broken.
  38969. *
  38970. * @readonly
  38971. * @type {Number|null}
  38972. */
  38973. get index() {
  38974. let pos;
  38975. if ( !this.parent ) {
  38976. return null;
  38977. }
  38978. // No parent or child doesn't exist in parent's children.
  38979. if ( ( pos = this.parent.getChildIndex( this ) ) == -1 ) {
  38980. /**
  38981. * The node's parent does not contain this node. It means that the document tree is corrupted.
  38982. *
  38983. * @error view-node-not-found-in-parent
  38984. */
  38985. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'view-node-not-found-in-parent', this );
  38986. }
  38987. return pos;
  38988. }
  38989. /**
  38990. * Node's next sibling, or `null` if it is the last child.
  38991. *
  38992. * @readonly
  38993. * @type {module:engine/view/node~Node|null}
  38994. */
  38995. get nextSibling() {
  38996. const index = this.index;
  38997. return ( index !== null && this.parent.getChild( index + 1 ) ) || null;
  38998. }
  38999. /**
  39000. * Node's previous sibling, or `null` if it is the first child.
  39001. *
  39002. * @readonly
  39003. * @type {module:engine/view/node~Node|null}
  39004. */
  39005. get previousSibling() {
  39006. const index = this.index;
  39007. return ( index !== null && this.parent.getChild( index - 1 ) ) || null;
  39008. }
  39009. /**
  39010. * Top-most ancestor of the node. If the node has no parent it is the root itself.
  39011. *
  39012. * @readonly
  39013. * @type {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment}
  39014. */
  39015. get root() {
  39016. let root = this; // eslint-disable-line consistent-this
  39017. while ( root.parent ) {
  39018. root = root.parent;
  39019. }
  39020. return root;
  39021. }
  39022. /**
  39023. * Returns true if the node is in a tree rooted in the document (is a descendant of one of its roots).
  39024. *
  39025. * @returns {Boolean}
  39026. */
  39027. isAttached() {
  39028. return this.root.is( 'rootElement' );
  39029. }
  39030. /**
  39031. * Gets a path to the node. The path is an array containing indices of consecutive ancestors of this node,
  39032. * beginning from {@link module:engine/view/node~Node#root root}, down to this node's index.
  39033. *
  39034. * const abc = downcastWriter.createText( 'abc' );
  39035. * const foo = downcastWriter.createText( 'foo' );
  39036. * const h1 = downcastWriter.createElement( 'h1', null, downcastWriter.createText( 'header' ) );
  39037. * const p = downcastWriter.createElement( 'p', null, [ abc, foo ] );
  39038. * const div = downcastWriter.createElement( 'div', null, [ h1, p ] );
  39039. * foo.getPath(); // Returns [ 1, 3 ]. `foo` is in `p` which is in `div`. `p` starts at offset 1, while `foo` at 3.
  39040. * h1.getPath(); // Returns [ 0 ].
  39041. * div.getPath(); // Returns [].
  39042. *
  39043. * @returns {Array.<Number>} The path.
  39044. */
  39045. getPath() {
  39046. const path = [];
  39047. let node = this; // eslint-disable-line consistent-this
  39048. while ( node.parent ) {
  39049. path.unshift( node.index );
  39050. node = node.parent;
  39051. }
  39052. return path;
  39053. }
  39054. /**
  39055. * Returns ancestors array of this node.
  39056. *
  39057. * @param {Object} options Options object.
  39058. * @param {Boolean} [options.includeSelf=false] When set to `true` this node will be also included in parent's array.
  39059. * @param {Boolean} [options.parentFirst=false] When set to `true`, array will be sorted from node's parent to root element,
  39060. * otherwise root element will be the first item in the array.
  39061. * @returns {Array} Array with ancestors.
  39062. */
  39063. getAncestors( options = { includeSelf: false, parentFirst: false } ) {
  39064. const ancestors = [];
  39065. let parent = options.includeSelf ? this : this.parent;
  39066. while ( parent ) {
  39067. ancestors[ options.parentFirst ? 'push' : 'unshift' ]( parent );
  39068. parent = parent.parent;
  39069. }
  39070. return ancestors;
  39071. }
  39072. /**
  39073. * Returns a {@link module:engine/view/element~Element} or {@link module:engine/view/documentfragment~DocumentFragment}
  39074. * which is a common ancestor of both nodes.
  39075. *
  39076. * @param {module:engine/view/node~Node} node The second node.
  39077. * @param {Object} options Options object.
  39078. * @param {Boolean} [options.includeSelf=false] When set to `true` both nodes will be considered "ancestors" too.
  39079. * Which means that if e.g. node A is inside B, then their common ancestor will be B.
  39080. * @returns {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment|null}
  39081. */
  39082. getCommonAncestor( node, options = {} ) {
  39083. const ancestorsA = this.getAncestors( options );
  39084. const ancestorsB = node.getAncestors( options );
  39085. let i = 0;
  39086. while ( ancestorsA[ i ] == ancestorsB[ i ] && ancestorsA[ i ] ) {
  39087. i++;
  39088. }
  39089. return i === 0 ? null : ancestorsA[ i - 1 ];
  39090. }
  39091. /**
  39092. * Returns whether this node is before given node. `false` is returned if nodes are in different trees (for example,
  39093. * in different {@link module:engine/view/documentfragment~DocumentFragment}s).
  39094. *
  39095. * @param {module:engine/view/node~Node} node Node to compare with.
  39096. * @returns {Boolean}
  39097. */
  39098. isBefore( node ) {
  39099. // Given node is not before this node if they are same.
  39100. if ( this == node ) {
  39101. return false;
  39102. }
  39103. // Return `false` if it is impossible to compare nodes.
  39104. if ( this.root !== node.root ) {
  39105. return false;
  39106. }
  39107. const thisPath = this.getPath();
  39108. const nodePath = node.getPath();
  39109. const result = Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_3__["default"])( thisPath, nodePath );
  39110. switch ( result ) {
  39111. case 'prefix':
  39112. return true;
  39113. case 'extension':
  39114. return false;
  39115. default:
  39116. return thisPath[ result ] < nodePath[ result ];
  39117. }
  39118. }
  39119. /**
  39120. * Returns whether this node is after given node. `false` is returned if nodes are in different trees (for example,
  39121. * in different {@link module:engine/view/documentfragment~DocumentFragment}s).
  39122. *
  39123. * @param {module:engine/view/node~Node} node Node to compare with.
  39124. * @returns {Boolean}
  39125. */
  39126. isAfter( node ) {
  39127. // Given node is not before this node if they are same.
  39128. if ( this == node ) {
  39129. return false;
  39130. }
  39131. // Return `false` if it is impossible to compare nodes.
  39132. if ( this.root !== node.root ) {
  39133. return false;
  39134. }
  39135. // In other cases, just check if the `node` is before, and return the opposite.
  39136. return !this.isBefore( node );
  39137. }
  39138. /**
  39139. * Removes node from parent.
  39140. *
  39141. * @protected
  39142. */
  39143. _remove() {
  39144. this.parent._removeChildren( this.index );
  39145. }
  39146. /**
  39147. * @protected
  39148. * @param {module:engine/view/document~ChangeType} type Type of the change.
  39149. * @param {module:engine/view/node~Node} node Changed node.
  39150. * @fires change
  39151. */
  39152. _fireChange( type, node ) {
  39153. this.fire( 'change:' + type, node );
  39154. if ( this.parent ) {
  39155. this.parent._fireChange( type, node );
  39156. }
  39157. }
  39158. /**
  39159. * Custom toJSON method to solve child-parent circular dependencies.
  39160. *
  39161. * @returns {Object} Clone of this object with the parent property removed.
  39162. */
  39163. toJSON() {
  39164. const json = Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["clone"])( this );
  39165. // Due to circular references we need to remove parent reference.
  39166. delete json.parent;
  39167. return json;
  39168. }
  39169. /**
  39170. * Checks whether this object is of the given type.
  39171. *
  39172. * This method is useful when processing view objects that are of unknown type. For example, a function
  39173. * may return a {@link module:engine/view/documentfragment~DocumentFragment} or a {@link module:engine/view/node~Node}
  39174. * that can be either a text node or an element. This method can be used to check what kind of object is returned.
  39175. *
  39176. * someObject.is( 'element' ); // -> true if this is an element
  39177. * someObject.is( 'node' ); // -> true if this is a node (a text node or an element)
  39178. * someObject.is( 'documentFragment' ); // -> true if this is a document fragment
  39179. *
  39180. * Since this method is also available on a range of model objects, you can prefix the type of the object with
  39181. * `model:` or `view:` to check, for example, if this is the model's or view's element:
  39182. *
  39183. * viewElement.is( 'view:element' ); // -> true
  39184. * viewElement.is( 'model:element' ); // -> false
  39185. *
  39186. * By using this method it is also possible to check a name of an element:
  39187. *
  39188. * imgElement.is( 'element', 'img' ); // -> true
  39189. * imgElement.is( 'view:element', 'img' ); // -> same as above, but more precise
  39190. *
  39191. * The list of view objects which implement the `is()` method:
  39192. *
  39193. * * {@link module:engine/view/attributeelement~AttributeElement#is `AttributeElement#is()`}
  39194. * * {@link module:engine/view/containerelement~ContainerElement#is `ContainerElement#is()`}
  39195. * * {@link module:engine/view/documentfragment~DocumentFragment#is `DocumentFragment#is()`}
  39196. * * {@link module:engine/view/documentselection~DocumentSelection#is `DocumentSelection#is()`}
  39197. * * {@link module:engine/view/editableelement~EditableElement#is `EditableElement#is()`}
  39198. * * {@link module:engine/view/element~Element#is `Element#is()`}
  39199. * * {@link module:engine/view/emptyelement~EmptyElement#is `EmptyElement#is()`}
  39200. * * {@link module:engine/view/node~Node#is `Node#is()`}
  39201. * * {@link module:engine/view/position~Position#is `Position#is()`}
  39202. * * {@link module:engine/view/range~Range#is `Range#is()`}
  39203. * * {@link module:engine/view/rooteditableelement~RootEditableElement#is `RootEditableElement#is()`}
  39204. * * {@link module:engine/view/selection~Selection#is `Selection#is()`}
  39205. * * {@link module:engine/view/text~Text#is `Text#is()`}
  39206. * * {@link module:engine/view/textproxy~TextProxy#is `TextProxy#is()`}
  39207. * * {@link module:engine/view/uielement~UIElement#is `UIElement#is()`}
  39208. *
  39209. * @method #is
  39210. * @param {String} type Type to check.
  39211. * @returns {Boolean}
  39212. */
  39213. is( type ) {
  39214. return type === 'node' || type === 'view:node';
  39215. }
  39216. /**
  39217. * Clones this node.
  39218. *
  39219. * @protected
  39220. * @method #_clone
  39221. * @returns {module:engine/view/node~Node} Clone of this node.
  39222. */
  39223. /**
  39224. * Checks if provided node is similar to this node.
  39225. *
  39226. * @method #isSimilar
  39227. * @returns {Boolean} True if nodes are similar.
  39228. */
  39229. }
  39230. /**
  39231. * Fired when list of {@link module:engine/view/element~Element elements} children changes.
  39232. *
  39233. * Change event is bubbled – it is fired on all ancestors.
  39234. *
  39235. * @event change:children
  39236. * @param {module:engine/view/node~Node} changedNode
  39237. */
  39238. /**
  39239. * Fired when list of {@link module:engine/view/element~Element elements} attributes changes.
  39240. *
  39241. * Change event is bubbled – it is fired on all ancestors.
  39242. *
  39243. * @event change:attributes
  39244. * @param {module:engine/view/node~Node} changedNode
  39245. */
  39246. /**
  39247. * Fired when {@link module:engine/view/text~Text text nodes} data changes.
  39248. *
  39249. * Change event is bubbled – it is fired on all ancestors.
  39250. *
  39251. * @event change:text
  39252. * @param {module:engine/view/node~Node} changedNode
  39253. */
  39254. /**
  39255. * @event change
  39256. */
  39257. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( Node, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  39258. /***/ }),
  39259. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/clickobserver.js":
  39260. /*!************************************************************************************!*\
  39261. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/clickobserver.js ***!
  39262. \************************************************************************************/
  39263. /*! exports provided: default */
  39264. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39265. "use strict";
  39266. __webpack_require__.r(__webpack_exports__);
  39267. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ClickObserver; });
  39268. /* harmony import */ var _domeventobserver__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./domeventobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js");
  39269. /**
  39270. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  39271. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  39272. */
  39273. /**
  39274. * @module engine/view/observer/clickobserver
  39275. */
  39276. /**
  39277. * {@link module:engine/view/document~Document#event:click Click} event observer.
  39278. *
  39279. * Note that this observer is not available by default. To make it available it needs to be added to
  39280. * {@link module:engine/view/view~View view controller}
  39281. * by a {@link module:engine/view/view~View#addObserver} method.
  39282. *
  39283. * @extends module:engine/view/observer/domeventobserver~DomEventObserver
  39284. */
  39285. class ClickObserver extends _domeventobserver__WEBPACK_IMPORTED_MODULE_0__["default"] {
  39286. constructor( view ) {
  39287. super( view );
  39288. this.domEventType = 'click';
  39289. }
  39290. onDomEvent( domEvent ) {
  39291. this.fire( domEvent.type, domEvent );
  39292. }
  39293. }
  39294. /**
  39295. * Fired when one of the editables has been clicked.
  39296. *
  39297. * Introduced by {@link module:engine/view/observer/clickobserver~ClickObserver}.
  39298. *
  39299. * Note that this event is not available by default. To make it available
  39300. * {@link module:engine/view/observer/clickobserver~ClickObserver} needs to be added
  39301. * to {@link module:engine/view/view~View} by a {@link module:engine/view/view~View#addObserver} method.
  39302. *
  39303. * @see module:engine/view/observer/clickobserver~ClickObserver
  39304. * @event module:engine/view/document~Document#event:click
  39305. * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
  39306. */
  39307. /***/ }),
  39308. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/compositionobserver.js":
  39309. /*!******************************************************************************************!*\
  39310. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/compositionobserver.js ***!
  39311. \******************************************************************************************/
  39312. /*! exports provided: default */
  39313. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39314. "use strict";
  39315. __webpack_require__.r(__webpack_exports__);
  39316. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CompositionObserver; });
  39317. /* harmony import */ var _domeventobserver__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./domeventobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js");
  39318. /**
  39319. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  39320. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  39321. */
  39322. /**
  39323. * @module engine/view/observer/compositionobserver
  39324. */
  39325. /**
  39326. * {@link module:engine/view/document~Document#event:compositionstart Compositionstart},
  39327. * {@link module:engine/view/document~Document#event:compositionupdate compositionupdate} and
  39328. * {@link module:engine/view/document~Document#event:compositionend compositionend} events observer.
  39329. *
  39330. * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
  39331. *
  39332. * @extends module:engine/view/observer/domeventobserver~DomEventObserver
  39333. */
  39334. class CompositionObserver extends _domeventobserver__WEBPACK_IMPORTED_MODULE_0__["default"] {
  39335. constructor( view ) {
  39336. super( view );
  39337. this.domEventType = [ 'compositionstart', 'compositionupdate', 'compositionend' ];
  39338. const document = this.document;
  39339. document.on( 'compositionstart', () => {
  39340. document.isComposing = true;
  39341. } );
  39342. document.on( 'compositionend', () => {
  39343. document.isComposing = false;
  39344. } );
  39345. }
  39346. onDomEvent( domEvent ) {
  39347. this.fire( domEvent.type, domEvent );
  39348. }
  39349. }
  39350. /**
  39351. * Fired when composition starts inside one of the editables.
  39352. *
  39353. * Introduced by {@link module:engine/view/observer/compositionobserver~CompositionObserver}.
  39354. *
  39355. * Note that because {@link module:engine/view/observer/compositionobserver~CompositionObserver} is attached by the
  39356. * {@link module:engine/view/view~View} this event is available by default.
  39357. *
  39358. * @see module:engine/view/observer/compositionobserver~CompositionObserver
  39359. * @event module:engine/view/document~Document#event:compositionstart
  39360. * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
  39361. */
  39362. /**
  39363. * Fired when composition is updated inside one of the editables.
  39364. *
  39365. * Introduced by {@link module:engine/view/observer/compositionobserver~CompositionObserver}.
  39366. *
  39367. * Note that because {@link module:engine/view/observer/compositionobserver~CompositionObserver} is attached by the
  39368. * {@link module:engine/view/view~View} this event is available by default.
  39369. *
  39370. * @see module:engine/view/observer/compositionobserver~CompositionObserver
  39371. * @event module:engine/view/document~Document#event:compositionupdate
  39372. * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
  39373. */
  39374. /**
  39375. * Fired when composition ends inside one of the editables.
  39376. *
  39377. * Introduced by {@link module:engine/view/observer/compositionobserver~CompositionObserver}.
  39378. *
  39379. * Note that because {@link module:engine/view/observer/compositionobserver~CompositionObserver} is attached by the
  39380. * {@link module:engine/view/view~View} this event is available by default.
  39381. *
  39382. * @see module:engine/view/observer/compositionobserver~CompositionObserver
  39383. * @event module:engine/view/document~Document#event:compositionend
  39384. * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
  39385. */
  39386. /***/ }),
  39387. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventdata.js":
  39388. /*!***********************************************************************************!*\
  39389. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventdata.js ***!
  39390. \***********************************************************************************/
  39391. /*! exports provided: default */
  39392. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39393. "use strict";
  39394. __webpack_require__.r(__webpack_exports__);
  39395. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DomEventData; });
  39396. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  39397. /**
  39398. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  39399. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  39400. */
  39401. /**
  39402. * @module engine/view/observer/domeventdata
  39403. */
  39404. /**
  39405. * Information about a DOM event in context of the {@link module:engine/view/document~Document}.
  39406. * It wraps the native event, which usually should not be used as the wrapper contains
  39407. * additional data (like key code for keyboard events).
  39408. */
  39409. class DomEventData {
  39410. /**
  39411. * @param {module:engine/view/view~View} view The instance of the view controller.
  39412. * @param {Event} domEvent The DOM event.
  39413. * @param {Object} [additionalData] Additional properties that the instance should contain.
  39414. */
  39415. constructor( view, domEvent, additionalData ) {
  39416. /**
  39417. * Instance of the view controller.
  39418. *
  39419. * @readonly
  39420. * @member {module:engine/view/view~View} module:engine/view/observer/observer~Observer.DomEvent#view
  39421. */
  39422. this.view = view;
  39423. /**
  39424. * The instance of the document.
  39425. *
  39426. * @readonly
  39427. * @member {module:engine/view/document~Document} module:engine/view/observer/observer~Observer.DomEvent#document
  39428. */
  39429. this.document = view.document;
  39430. /**
  39431. * The DOM event.
  39432. *
  39433. * @readonly
  39434. * @member {Event} module:engine/view/observer/observer~Observer.DomEvent#domEvent
  39435. */
  39436. this.domEvent = domEvent;
  39437. /**
  39438. * The DOM target.
  39439. *
  39440. * @readonly
  39441. * @member {HTMLElement} module:engine/view/observer/observer~Observer.DomEvent#target
  39442. */
  39443. this.domTarget = domEvent.target;
  39444. Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["extend"])( this, additionalData );
  39445. }
  39446. /**
  39447. * The tree view element representing the target.
  39448. *
  39449. * @readonly
  39450. * @type module:engine/view/element~Element
  39451. */
  39452. get target() {
  39453. return this.view.domConverter.mapDomToView( this.domTarget );
  39454. }
  39455. /**
  39456. * Prevents the native's event default action.
  39457. */
  39458. preventDefault() {
  39459. this.domEvent.preventDefault();
  39460. }
  39461. /**
  39462. * Stops native event propagation.
  39463. */
  39464. stopPropagation() {
  39465. this.domEvent.stopPropagation();
  39466. }
  39467. }
  39468. /***/ }),
  39469. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js":
  39470. /*!***************************************************************************************!*\
  39471. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js ***!
  39472. \***************************************************************************************/
  39473. /*! exports provided: default */
  39474. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39475. "use strict";
  39476. __webpack_require__.r(__webpack_exports__);
  39477. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DomEventObserver; });
  39478. /* harmony import */ var _observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./observer */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js");
  39479. /* harmony import */ var _domeventdata__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./domeventdata */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventdata.js");
  39480. /**
  39481. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  39482. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  39483. */
  39484. /**
  39485. * @module engine/view/observer/domeventobserver
  39486. */
  39487. /**
  39488. * Base class for DOM event observers. This class handles
  39489. * {@link module:engine/view/observer/observer~Observer#observe adding} listeners to DOM elements,
  39490. * {@link module:engine/view/observer/observer~Observer#disable disabling} and
  39491. * {@link module:engine/view/observer/observer~Observer#enable re-enabling} events.
  39492. * Child class needs to define
  39493. * {@link module:engine/view/observer/domeventobserver~DomEventObserver#domEventType DOM event type} and
  39494. * {@link module:engine/view/observer/domeventobserver~DomEventObserver#onDomEvent callback}.
  39495. *
  39496. * For instance:
  39497. *
  39498. * class ClickObserver extends DomEventObserver {
  39499. * // It can also be defined as a normal property in the constructor.
  39500. * get domEventType() {
  39501. * return 'click';
  39502. * }
  39503. *
  39504. * onDomEvent( domEvent ) {
  39505. * this.fire( 'click', domEvent );
  39506. * }
  39507. * }
  39508. *
  39509. * @extends module:engine/view/observer/observer~Observer
  39510. */
  39511. class DomEventObserver extends _observer__WEBPACK_IMPORTED_MODULE_0__["default"] {
  39512. /**
  39513. * Type of the DOM event the observer should listen on. Array of types can be defined
  39514. * if the obsever should listen to multiple DOM events.
  39515. *
  39516. * @readonly
  39517. * @member {String|Array.<String>} #domEventType
  39518. */
  39519. /**
  39520. * Callback which should be called when the DOM event occurred. Note that the callback will not be called if
  39521. * observer {@link #isEnabled is not enabled}.
  39522. *
  39523. * @see #domEventType
  39524. * @abstract
  39525. * @method #onDomEvent
  39526. */
  39527. /**
  39528. * @inheritDoc
  39529. */
  39530. constructor( view ) {
  39531. super( view );
  39532. /**
  39533. * If set to `true` DOM events will be listened on the capturing phase.
  39534. * Default value is `false`.
  39535. *
  39536. * @member {Boolean}
  39537. */
  39538. this.useCapture = false;
  39539. }
  39540. /**
  39541. * @inheritDoc
  39542. */
  39543. observe( domElement ) {
  39544. const types = typeof this.domEventType == 'string' ? [ this.domEventType ] : this.domEventType;
  39545. types.forEach( type => {
  39546. this.listenTo( domElement, type, ( eventInfo, domEvent ) => {
  39547. if ( this.isEnabled && !this.checkShouldIgnoreEventFromTarget( domEvent.target ) ) {
  39548. this.onDomEvent( domEvent );
  39549. }
  39550. }, { useCapture: this.useCapture } );
  39551. } );
  39552. }
  39553. /**
  39554. * Calls `Document#fire()` if observer {@link #isEnabled is enabled}.
  39555. *
  39556. * @see module:utils/emittermixin~EmitterMixin#fire
  39557. * @param {String} eventType The event type (name).
  39558. * @param {Event} domEvent The DOM event.
  39559. * @param {Object} [additionalData] The additional data which should extend the
  39560. * {@link module:engine/view/observer/domeventdata~DomEventData event data} object.
  39561. */
  39562. fire( eventType, domEvent, additionalData ) {
  39563. if ( this.isEnabled ) {
  39564. this.document.fire( eventType, new _domeventdata__WEBPACK_IMPORTED_MODULE_1__["default"]( this.view, domEvent, additionalData ) );
  39565. }
  39566. }
  39567. }
  39568. /***/ }),
  39569. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/fakeselectionobserver.js":
  39570. /*!********************************************************************************************!*\
  39571. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/fakeselectionobserver.js ***!
  39572. \********************************************************************************************/
  39573. /*! exports provided: default */
  39574. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39575. "use strict";
  39576. __webpack_require__.r(__webpack_exports__);
  39577. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FakeSelectionObserver; });
  39578. /* harmony import */ var _observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./observer */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js");
  39579. /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js");
  39580. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
  39581. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  39582. /**
  39583. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  39584. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  39585. */
  39586. /**
  39587. * @module engine/view/observer/fakeselectionobserver
  39588. */
  39589. /**
  39590. * Fake selection observer class. If view selection is fake it is placed in dummy DOM container. This observer listens
  39591. * on {@link module:engine/view/document~Document#event:keydown keydown} events and handles moving fake view selection to the correct place
  39592. * if arrow keys are pressed.
  39593. * Fires {@link module:engine/view/document~Document#event:selectionChange selectionChange event} simulating natural behaviour of
  39594. * {@link module:engine/view/observer/selectionobserver~SelectionObserver SelectionObserver}.
  39595. *
  39596. * @extends module:engine/view/observer/observer~Observer
  39597. */
  39598. class FakeSelectionObserver extends _observer__WEBPACK_IMPORTED_MODULE_0__["default"] {
  39599. /**
  39600. * Creates new FakeSelectionObserver instance.
  39601. *
  39602. * @param {module:engine/view/view~View} view
  39603. */
  39604. constructor( view ) {
  39605. super( view );
  39606. /**
  39607. * Fires debounced event `selectionChangeDone`. It uses `lodash#debounce` method to delay function call.
  39608. *
  39609. * @private
  39610. * @param {Object} data Selection change data.
  39611. * @method #_fireSelectionChangeDoneDebounced
  39612. */
  39613. this._fireSelectionChangeDoneDebounced = Object(lodash_es__WEBPACK_IMPORTED_MODULE_3__["debounce"])( data => this.document.fire( 'selectionChangeDone', data ), 200 );
  39614. }
  39615. /**
  39616. * @inheritDoc
  39617. */
  39618. observe() {
  39619. const document = this.document;
  39620. document.on( 'keydown', ( eventInfo, data ) => {
  39621. const selection = document.selection;
  39622. if ( selection.isFake && Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_2__["isArrowKeyCode"])( data.keyCode ) && this.isEnabled ) {
  39623. // Prevents default key down handling - no selection change will occur.
  39624. data.preventDefault();
  39625. this._handleSelectionMove( data.keyCode );
  39626. }
  39627. }, { priority: 'lowest' } );
  39628. }
  39629. /**
  39630. * @inheritDoc
  39631. */
  39632. destroy() {
  39633. super.destroy();
  39634. this._fireSelectionChangeDoneDebounced.cancel();
  39635. }
  39636. /**
  39637. * Handles collapsing view selection according to given key code. If left or up key is provided - new selection will be
  39638. * collapsed to left. If right or down key is pressed - new selection will be collapsed to right.
  39639. *
  39640. * This method fires {@link module:engine/view/document~Document#event:selectionChange} and
  39641. * {@link module:engine/view/document~Document#event:selectionChangeDone} events imitating behaviour of
  39642. * {@link module:engine/view/observer/selectionobserver~SelectionObserver}.
  39643. *
  39644. * @private
  39645. * @param {Number} keyCode
  39646. * @fires module:engine/view/document~Document#event:selectionChange
  39647. * @fires module:engine/view/document~Document#event:selectionChangeDone
  39648. */
  39649. _handleSelectionMove( keyCode ) {
  39650. const selection = this.document.selection;
  39651. const newSelection = new _selection__WEBPACK_IMPORTED_MODULE_1__["default"]( selection.getRanges(), { backward: selection.isBackward, fake: false } );
  39652. // Left or up arrow pressed - move selection to start.
  39653. if ( keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_2__["keyCodes"].arrowleft || keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_2__["keyCodes"].arrowup ) {
  39654. newSelection.setTo( newSelection.getFirstPosition() );
  39655. }
  39656. // Right or down arrow pressed - move selection to end.
  39657. if ( keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_2__["keyCodes"].arrowright || keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_2__["keyCodes"].arrowdown ) {
  39658. newSelection.setTo( newSelection.getLastPosition() );
  39659. }
  39660. const data = {
  39661. oldSelection: selection,
  39662. newSelection,
  39663. domSelection: null
  39664. };
  39665. // Fire dummy selection change event.
  39666. this.document.fire( 'selectionChange', data );
  39667. // Call` #_fireSelectionChangeDoneDebounced` every time when `selectionChange` event is fired.
  39668. // This function is debounced what means that `selectionChangeDone` event will be fired only when
  39669. // defined int the function time will elapse since the last time the function was called.
  39670. // So `selectionChangeDone` will be fired when selection will stop changing.
  39671. this._fireSelectionChangeDoneDebounced( data );
  39672. }
  39673. }
  39674. /***/ }),
  39675. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/focusobserver.js":
  39676. /*!************************************************************************************!*\
  39677. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/focusobserver.js ***!
  39678. \************************************************************************************/
  39679. /*! exports provided: default */
  39680. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39681. "use strict";
  39682. __webpack_require__.r(__webpack_exports__);
  39683. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FocusObserver; });
  39684. /* harmony import */ var _domeventobserver__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./domeventobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js");
  39685. /**
  39686. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  39687. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  39688. */
  39689. /**
  39690. * @module engine/view/observer/focusobserver
  39691. */
  39692. /* globals setTimeout, clearTimeout */
  39693. /**
  39694. * {@link module:engine/view/document~Document#event:focus Focus}
  39695. * and {@link module:engine/view/document~Document#event:blur blur} events observer.
  39696. * Focus observer handle also {@link module:engine/view/rooteditableelement~RootEditableElement#isFocused isFocused} property of the
  39697. * {@link module:engine/view/rooteditableelement~RootEditableElement root elements}.
  39698. *
  39699. * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
  39700. *
  39701. * @extends module:engine/view/observer/domeventobserver~DomEventObserver
  39702. */
  39703. class FocusObserver extends _domeventobserver__WEBPACK_IMPORTED_MODULE_0__["default"] {
  39704. constructor( view ) {
  39705. super( view );
  39706. this.domEventType = [ 'focus', 'blur' ];
  39707. this.useCapture = true;
  39708. const document = this.document;
  39709. document.on( 'focus', () => {
  39710. document.isFocused = true;
  39711. // Unfortunately native `selectionchange` event is fired asynchronously.
  39712. // We need to wait until `SelectionObserver` handle the event and then render. Otherwise rendering will
  39713. // overwrite new DOM selection with selection from the view.
  39714. // See https://github.com/ckeditor/ckeditor5-engine/issues/795 for more details.
  39715. // Long timeout is needed to solve #676 and https://github.com/ckeditor/ckeditor5-engine/issues/1157 issues.
  39716. this._renderTimeoutId = setTimeout( () => view.forceRender(), 50 );
  39717. } );
  39718. document.on( 'blur', ( evt, data ) => {
  39719. const selectedEditable = document.selection.editableElement;
  39720. if ( selectedEditable === null || selectedEditable === data.target ) {
  39721. document.isFocused = false;
  39722. // Re-render the document to update view elements.
  39723. view.forceRender();
  39724. }
  39725. } );
  39726. /**
  39727. * Identifier of the timeout currently used by focus listener to delay rendering execution.
  39728. *
  39729. * @private
  39730. * @member {Number} #_renderTimeoutId
  39731. */
  39732. }
  39733. onDomEvent( domEvent ) {
  39734. this.fire( domEvent.type, domEvent );
  39735. }
  39736. /**
  39737. * @inheritDoc
  39738. */
  39739. destroy() {
  39740. if ( this._renderTimeoutId ) {
  39741. clearTimeout( this._renderTimeoutId );
  39742. }
  39743. super.destroy();
  39744. }
  39745. }
  39746. /**
  39747. * Fired when one of the editables gets focus.
  39748. *
  39749. * Introduced by {@link module:engine/view/observer/focusobserver~FocusObserver}.
  39750. *
  39751. * Note that because {@link module:engine/view/observer/focusobserver~FocusObserver} is attached by the
  39752. * {@link module:engine/view/view~View} this event is available by default.
  39753. *
  39754. * @see module:engine/view/observer/focusobserver~FocusObserver
  39755. * @event module:engine/view/document~Document#event:focus
  39756. * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
  39757. */
  39758. /**
  39759. * Fired when one of the editables loses focus.
  39760. *
  39761. * Introduced by {@link module:engine/view/observer/focusobserver~FocusObserver}.
  39762. *
  39763. * Note that because {@link module:engine/view/observer/focusobserver~FocusObserver} is attached by the
  39764. * {@link module:engine/view/view~View} this event is available by default.
  39765. *
  39766. * @see module:engine/view/observer/focusobserver~FocusObserver
  39767. * @event module:engine/view/document~Document#event:blur
  39768. * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
  39769. */
  39770. /***/ }),
  39771. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/inputobserver.js":
  39772. /*!************************************************************************************!*\
  39773. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/inputobserver.js ***!
  39774. \************************************************************************************/
  39775. /*! exports provided: default */
  39776. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39777. "use strict";
  39778. __webpack_require__.r(__webpack_exports__);
  39779. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InputObserver; });
  39780. /* harmony import */ var _domeventobserver__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./domeventobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js");
  39781. /**
  39782. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  39783. * For licensing, see LICENSE.md.
  39784. */
  39785. /**
  39786. * @module engine/view/observer/inputobserver
  39787. */
  39788. /**
  39789. * Observer for events connected with data input.
  39790. *
  39791. * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
  39792. *
  39793. * @extends module:engine/view/observer/domeventobserver~DomEventObserver
  39794. */
  39795. class InputObserver extends _domeventobserver__WEBPACK_IMPORTED_MODULE_0__["default"] {
  39796. constructor( view ) {
  39797. super( view );
  39798. this.domEventType = [ 'beforeinput' ];
  39799. }
  39800. onDomEvent( domEvent ) {
  39801. this.fire( domEvent.type, domEvent );
  39802. }
  39803. }
  39804. /**
  39805. * Fired before browser inputs (or deletes) some data.
  39806. *
  39807. * This event is available only on browsers which support DOM `beforeinput` event.
  39808. *
  39809. * Introduced by {@link module:engine/view/observer/inputobserver~InputObserver}.
  39810. *
  39811. * Note that because {@link module:engine/view/observer/inputobserver~InputObserver} is attached by the
  39812. * {@link module:engine/view/view~View} this event is available by default.
  39813. *
  39814. * @see module:engine/view/observer/inputobserver~InputObserver
  39815. * @event module:engine/view/document~Document#event:beforeinput
  39816. * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
  39817. */
  39818. /***/ }),
  39819. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/keyobserver.js":
  39820. /*!**********************************************************************************!*\
  39821. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/keyobserver.js ***!
  39822. \**********************************************************************************/
  39823. /*! exports provided: default */
  39824. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39825. "use strict";
  39826. __webpack_require__.r(__webpack_exports__);
  39827. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return KeyObserver; });
  39828. /* harmony import */ var _domeventobserver__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./domeventobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js");
  39829. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
  39830. /**
  39831. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  39832. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  39833. */
  39834. /**
  39835. * @module engine/view/observer/keyobserver
  39836. */
  39837. /**
  39838. * Observer for events connected with pressing keyboard keys.
  39839. *
  39840. * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
  39841. *
  39842. * @extends module:engine/view/observer/domeventobserver~DomEventObserver
  39843. */
  39844. class KeyObserver extends _domeventobserver__WEBPACK_IMPORTED_MODULE_0__["default"] {
  39845. constructor( view ) {
  39846. super( view );
  39847. this.domEventType = [ 'keydown', 'keyup' ];
  39848. }
  39849. onDomEvent( domEvt ) {
  39850. this.fire( domEvt.type, domEvt, {
  39851. keyCode: domEvt.keyCode,
  39852. altKey: domEvt.altKey,
  39853. ctrlKey: domEvt.ctrlKey || domEvt.metaKey,
  39854. shiftKey: domEvt.shiftKey,
  39855. get keystroke() {
  39856. return Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_1__["getCode"])( this );
  39857. }
  39858. } );
  39859. }
  39860. }
  39861. /**
  39862. * Fired when a key has been pressed.
  39863. *
  39864. * Introduced by {@link module:engine/view/observer/keyobserver~KeyObserver}.
  39865. *
  39866. * Note that because {@link module:engine/view/observer/keyobserver~KeyObserver} is attached by the
  39867. * {@link module:engine/view/view~View} this event is available by default.
  39868. *
  39869. * @see module:engine/view/observer/keyobserver~KeyObserver
  39870. * @event module:engine/view/document~Document#event:keydown
  39871. * @param {module:engine/view/observer/keyobserver~KeyEventData} keyEventData
  39872. */
  39873. /**
  39874. * Fired when a key has been released.
  39875. *
  39876. * Introduced by {@link module:engine/view/observer/keyobserver~KeyObserver}.
  39877. *
  39878. * Note that because {@link module:engine/view/observer/keyobserver~KeyObserver} is attached by the
  39879. * {@link module:engine/view/view~View} this event is available by default.
  39880. *
  39881. * @see module:engine/view/observer/keyobserver~KeyObserver
  39882. * @event module:engine/view/document~Document#event:keyup
  39883. * @param {module:engine/view/observer/keyobserver~KeyEventData} keyEventData
  39884. */
  39885. /**
  39886. * The value of both events - {@link module:engine/view/document~Document#event:keydown} and
  39887. * {@link module:engine/view/document~Document#event:keyup}.
  39888. *
  39889. * @class module:engine/view/observer/keyobserver~KeyEventData
  39890. * @extends module:engine/view/observer/domeventdata~DomEventData
  39891. * @implements module:utils/keyboard~KeystrokeInfo
  39892. */
  39893. /**
  39894. * Code of the whole keystroke. See {@link module:utils/keyboard~getCode}.
  39895. *
  39896. * @readonly
  39897. * @member {Number} module:engine/view/observer/keyobserver~KeyEventData#keystroke
  39898. */
  39899. /***/ }),
  39900. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mouseobserver.js":
  39901. /*!************************************************************************************!*\
  39902. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mouseobserver.js ***!
  39903. \************************************************************************************/
  39904. /*! exports provided: default */
  39905. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39906. "use strict";
  39907. __webpack_require__.r(__webpack_exports__);
  39908. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MouseObserver; });
  39909. /* harmony import */ var _domeventobserver__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./domeventobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js");
  39910. /**
  39911. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  39912. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  39913. */
  39914. /**
  39915. * @module engine/view/observer/mouseobserver
  39916. */
  39917. /**
  39918. * Mouse events observer.
  39919. *
  39920. * Note that this observer is not available by default. To make it available it needs to be added to
  39921. * {@link module:engine/view/view~View} by {@link module:engine/view/view~View#addObserver} method.
  39922. *
  39923. * @extends module:engine/view/observer/domeventobserver~DomEventObserver
  39924. */
  39925. class MouseObserver extends _domeventobserver__WEBPACK_IMPORTED_MODULE_0__["default"] {
  39926. constructor( view ) {
  39927. super( view );
  39928. this.domEventType = 'mousedown';
  39929. }
  39930. onDomEvent( domEvent ) {
  39931. this.fire( domEvent.type, domEvent );
  39932. }
  39933. }
  39934. /**
  39935. * Fired when mouse button is pressed down on one of the editables.
  39936. *
  39937. * Introduced by {@link module:engine/view/observer/mouseobserver~MouseObserver}.
  39938. *
  39939. * Note that this event is not available by default. To make it available {@link module:engine/view/observer/mouseobserver~MouseObserver}
  39940. * needs to be added to {@link module:engine/view/view~View} by a {@link module:engine/view/view~View#addObserver} method.
  39941. *
  39942. * @see module:engine/view/observer/mouseobserver~MouseObserver
  39943. * @event module:engine/view/document~Document#event:mousedown
  39944. * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
  39945. */
  39946. /***/ }),
  39947. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mutationobserver.js":
  39948. /*!***************************************************************************************!*\
  39949. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mutationobserver.js ***!
  39950. \***************************************************************************************/
  39951. /*! exports provided: default */
  39952. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  39953. "use strict";
  39954. __webpack_require__.r(__webpack_exports__);
  39955. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MutationObserver; });
  39956. /* harmony import */ var _observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./observer */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js");
  39957. /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js");
  39958. /* harmony import */ var _filler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../filler */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/filler.js");
  39959. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  39960. /**
  39961. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  39962. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  39963. */
  39964. /**
  39965. * @module engine/view/observer/mutationobserver
  39966. */
  39967. /* globals window */
  39968. /**
  39969. * Mutation observer class observes changes in the DOM, fires {@link module:engine/view/document~Document#event:mutations} event, mark view
  39970. * elements as changed and call {@link module:engine/view/renderer~Renderer#render}.
  39971. * Because all mutated nodes are marked as "to be rendered" and the
  39972. * {@link module:engine/view/renderer~Renderer#render} is called, all changes will be reverted, unless the mutation will be handled by the
  39973. * {@link module:engine/view/document~Document#event:mutations} event listener. It means user will see only handled changes, and the editor
  39974. * will block all changes which are not handled.
  39975. *
  39976. * Mutation Observer also take care of reducing number of mutations which are fired. It removes duplicates and
  39977. * mutations on elements which do not have corresponding view elements. Also
  39978. * {@link module:engine/view/observer/mutationobserver~MutatedText text mutation} is fired only if parent element do not change child list.
  39979. *
  39980. * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
  39981. *
  39982. * @extends module:engine/view/observer/observer~Observer
  39983. */
  39984. class MutationObserver extends _observer__WEBPACK_IMPORTED_MODULE_0__["default"] {
  39985. constructor( view ) {
  39986. super( view );
  39987. /**
  39988. * Native mutation observer config.
  39989. *
  39990. * @private
  39991. * @member {Object}
  39992. */
  39993. this._config = {
  39994. childList: true,
  39995. characterData: true,
  39996. characterDataOldValue: true,
  39997. subtree: true
  39998. };
  39999. /**
  40000. * Reference to the {@link module:engine/view/view~View#domConverter}.
  40001. *
  40002. * @member {module:engine/view/domconverter~DomConverter}
  40003. */
  40004. this.domConverter = view.domConverter;
  40005. /**
  40006. * Reference to the {@link module:engine/view/view~View#_renderer}.
  40007. *
  40008. * @member {module:engine/view/renderer~Renderer}
  40009. */
  40010. this.renderer = view._renderer;
  40011. /**
  40012. * Observed DOM elements.
  40013. *
  40014. * @private
  40015. * @member {Array.<HTMLElement>}
  40016. */
  40017. this._domElements = [];
  40018. /**
  40019. * Native mutation observer.
  40020. *
  40021. * @private
  40022. * @member {MutationObserver}
  40023. */
  40024. this._mutationObserver = new window.MutationObserver( this._onMutations.bind( this ) );
  40025. }
  40026. /**
  40027. * Synchronously fires {@link module:engine/view/document~Document#event:mutations} event with all mutations in record queue.
  40028. * At the same time empties the queue so mutations will not be fired twice.
  40029. */
  40030. flush() {
  40031. this._onMutations( this._mutationObserver.takeRecords() );
  40032. }
  40033. /**
  40034. * @inheritDoc
  40035. */
  40036. observe( domElement ) {
  40037. this._domElements.push( domElement );
  40038. if ( this.isEnabled ) {
  40039. this._mutationObserver.observe( domElement, this._config );
  40040. }
  40041. }
  40042. /**
  40043. * @inheritDoc
  40044. */
  40045. enable() {
  40046. super.enable();
  40047. for ( const domElement of this._domElements ) {
  40048. this._mutationObserver.observe( domElement, this._config );
  40049. }
  40050. }
  40051. /**
  40052. * @inheritDoc
  40053. */
  40054. disable() {
  40055. super.disable();
  40056. this._mutationObserver.disconnect();
  40057. }
  40058. /**
  40059. * @inheritDoc
  40060. */
  40061. destroy() {
  40062. super.destroy();
  40063. this._mutationObserver.disconnect();
  40064. }
  40065. /**
  40066. * Handles mutations. Deduplicates, mark view elements to sync, fire event and call render.
  40067. *
  40068. * @private
  40069. * @param {Array.<Object>} domMutations Array of native mutations.
  40070. */
  40071. _onMutations( domMutations ) {
  40072. // As a result of this.flush() we can have an empty collection.
  40073. if ( domMutations.length === 0 ) {
  40074. return;
  40075. }
  40076. const domConverter = this.domConverter;
  40077. // Use map and set for deduplication.
  40078. const mutatedTexts = new Map();
  40079. const mutatedElements = new Set();
  40080. // Handle `childList` mutations first, so we will be able to check if the `characterData` mutation is in the
  40081. // element with changed structure anyway.
  40082. for ( const mutation of domMutations ) {
  40083. if ( mutation.type === 'childList' ) {
  40084. const element = domConverter.mapDomToView( mutation.target );
  40085. // Do not collect mutations from UIElements and RawElements.
  40086. if ( element && ( element.is( 'uiElement' ) || element.is( 'rawElement' ) ) ) {
  40087. continue;
  40088. }
  40089. if ( element && !this._isBogusBrMutation( mutation ) ) {
  40090. mutatedElements.add( element );
  40091. }
  40092. }
  40093. }
  40094. // Handle `characterData` mutations later, when we have the full list of nodes which changed structure.
  40095. for ( const mutation of domMutations ) {
  40096. const element = domConverter.mapDomToView( mutation.target );
  40097. // Do not collect mutations from UIElements and RawElements.
  40098. if ( element && ( element.is( 'uiElement' ) || element.is( 'rawElement' ) ) ) {
  40099. continue;
  40100. }
  40101. if ( mutation.type === 'characterData' ) {
  40102. const text = domConverter.findCorrespondingViewText( mutation.target );
  40103. if ( text && !mutatedElements.has( text.parent ) ) {
  40104. // Use text as a key, for deduplication. If there will be another mutation on the same text element
  40105. // we will have only one in the map.
  40106. mutatedTexts.set( text, {
  40107. type: 'text',
  40108. oldText: text.data,
  40109. newText: Object(_filler__WEBPACK_IMPORTED_MODULE_2__["getDataWithoutFiller"])( mutation.target ),
  40110. node: text
  40111. } );
  40112. }
  40113. // When we added first letter to the text node which had only inline filler, for the DOM it is mutation
  40114. // on text, but for the view, where filler text node did not existed, new text node was created, so we
  40115. // need to fire 'children' mutation instead of 'text'.
  40116. else if ( !text && Object(_filler__WEBPACK_IMPORTED_MODULE_2__["startsWithFiller"])( mutation.target ) ) {
  40117. mutatedElements.add( domConverter.mapDomToView( mutation.target.parentNode ) );
  40118. }
  40119. }
  40120. }
  40121. // Now we build the list of mutations to fire and mark elements. We did not do it earlier to avoid marking the
  40122. // same node multiple times in case of duplication.
  40123. // List of mutations we will fire.
  40124. const viewMutations = [];
  40125. for ( const mutatedText of mutatedTexts.values() ) {
  40126. this.renderer.markToSync( 'text', mutatedText.node );
  40127. viewMutations.push( mutatedText );
  40128. }
  40129. for ( const viewElement of mutatedElements ) {
  40130. const domElement = domConverter.mapViewToDom( viewElement );
  40131. const viewChildren = Array.from( viewElement.getChildren() );
  40132. const newViewChildren = Array.from( domConverter.domChildrenToView( domElement, { withChildren: false } ) );
  40133. // It may happen that as a result of many changes (sth was inserted and then removed),
  40134. // both elements haven't really changed. #1031
  40135. if ( !Object(lodash_es__WEBPACK_IMPORTED_MODULE_3__["isEqualWith"])( viewChildren, newViewChildren, sameNodes ) ) {
  40136. this.renderer.markToSync( 'children', viewElement );
  40137. viewMutations.push( {
  40138. type: 'children',
  40139. oldChildren: viewChildren,
  40140. newChildren: newViewChildren,
  40141. node: viewElement
  40142. } );
  40143. }
  40144. }
  40145. // Retrieve `domSelection` using `ownerDocument` of one of mutated nodes.
  40146. // There should not be simultaneous mutation in multiple documents, so it's fine.
  40147. const domSelection = domMutations[ 0 ].target.ownerDocument.getSelection();
  40148. let viewSelection = null;
  40149. if ( domSelection && domSelection.anchorNode ) {
  40150. // If `domSelection` is inside a dom node that is already bound to a view node from view tree, get
  40151. // corresponding selection in the view and pass it together with `viewMutations`. The `viewSelection` may
  40152. // be used by features handling mutations.
  40153. // Only one range is supported.
  40154. const viewSelectionAnchor = domConverter.domPositionToView( domSelection.anchorNode, domSelection.anchorOffset );
  40155. const viewSelectionFocus = domConverter.domPositionToView( domSelection.focusNode, domSelection.focusOffset );
  40156. // Anchor and focus has to be properly mapped to view.
  40157. if ( viewSelectionAnchor && viewSelectionFocus ) {
  40158. viewSelection = new _selection__WEBPACK_IMPORTED_MODULE_1__["default"]( viewSelectionAnchor );
  40159. viewSelection.setFocus( viewSelectionFocus );
  40160. }
  40161. }
  40162. // In case only non-relevant mutations were recorded it skips the event and force render (#5600).
  40163. if ( viewMutations.length ) {
  40164. this.document.fire( 'mutations', viewMutations, viewSelection );
  40165. // If nothing changes on `mutations` event, at this point we have "dirty DOM" (changed) and de-synched
  40166. // view (which has not been changed). In order to "reset DOM" we render the view again.
  40167. this.view.forceRender();
  40168. }
  40169. function sameNodes( child1, child2 ) {
  40170. // First level of comparison (array of children vs array of children) – use the Lodash's default behavior.
  40171. if ( Array.isArray( child1 ) ) {
  40172. return;
  40173. }
  40174. // Elements.
  40175. if ( child1 === child2 ) {
  40176. return true;
  40177. }
  40178. // Texts.
  40179. else if ( child1.is( '$text' ) && child2.is( '$text' ) ) {
  40180. return child1.data === child2.data;
  40181. }
  40182. // Not matching types.
  40183. return false;
  40184. }
  40185. }
  40186. /**
  40187. * Checks if mutation was generated by the browser inserting bogus br on the end of the block element.
  40188. * Such mutations are generated while pressing space or performing native spellchecker correction
  40189. * on the end of the block element in Firefox browser.
  40190. *
  40191. * @private
  40192. * @param {Object} mutation Native mutation object.
  40193. * @returns {Boolean}
  40194. */
  40195. _isBogusBrMutation( mutation ) {
  40196. let addedNode = null;
  40197. // Check if mutation added only one node on the end of its parent.
  40198. if ( mutation.nextSibling === null && mutation.removedNodes.length === 0 && mutation.addedNodes.length == 1 ) {
  40199. addedNode = this.domConverter.domToView( mutation.addedNodes[ 0 ], {
  40200. withChildren: false
  40201. } );
  40202. }
  40203. return addedNode && addedNode.is( 'element', 'br' );
  40204. }
  40205. }
  40206. /**
  40207. * Fired when mutation occurred. If tree view is not changed on this event, DOM will be reverted to the state before
  40208. * mutation, so all changes which should be applied, should be handled on this event.
  40209. *
  40210. * Introduced by {@link module:engine/view/observer/mutationobserver~MutationObserver}.
  40211. *
  40212. * Note that because {@link module:engine/view/observer/mutationobserver~MutationObserver} is attached by the
  40213. * {@link module:engine/view/view~View} this event is available by default.
  40214. *
  40215. * @see module:engine/view/observer/mutationobserver~MutationObserver
  40216. * @event module:engine/view/document~Document#event:mutations
  40217. * @param {Array.<module:engine/view/observer/mutationobserver~MutatedText|module:engine/view/observer/mutationobserver~MutatedChildren>}
  40218. * viewMutations Array of mutations.
  40219. * For mutated texts it will be {@link module:engine/view/observer/mutationobserver~MutatedText} and for mutated elements it will be
  40220. * {@link module:engine/view/observer/mutationobserver~MutatedChildren}. You can recognize the type based on the `type` property.
  40221. * @param {module:engine/view/selection~Selection|null} viewSelection View selection that is a result of converting DOM selection to view.
  40222. * Keep in
  40223. * mind that the DOM selection is already "updated", meaning that it already acknowledges changes done in mutation.
  40224. */
  40225. /**
  40226. * Mutation item for text.
  40227. *
  40228. * @see module:engine/view/document~Document#event:mutations
  40229. * @see module:engine/view/observer/mutationobserver~MutatedChildren
  40230. *
  40231. * @typedef {Object} module:engine/view/observer/mutationobserver~MutatedText
  40232. *
  40233. * @property {String} type For text mutations it is always 'text'.
  40234. * @property {module:engine/view/text~Text} node Mutated text node.
  40235. * @property {String} oldText Old text.
  40236. * @property {String} newText New text.
  40237. */
  40238. /**
  40239. * Mutation item for child nodes.
  40240. *
  40241. * @see module:engine/view/document~Document#event:mutations
  40242. * @see module:engine/view/observer/mutationobserver~MutatedText
  40243. *
  40244. * @typedef {Object} module:engine/view/observer/mutationobserver~MutatedChildren
  40245. *
  40246. * @property {String} type For child nodes mutations it is always 'children'.
  40247. * @property {module:engine/view/element~Element} node Parent of the mutated children.
  40248. * @property {Array.<module:engine/view/node~Node>} oldChildren Old child nodes.
  40249. * @property {Array.<module:engine/view/node~Node>} newChildren New child nodes.
  40250. */
  40251. /***/ }),
  40252. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js":
  40253. /*!*******************************************************************************!*\
  40254. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js ***!
  40255. \*******************************************************************************/
  40256. /*! exports provided: default */
  40257. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40258. "use strict";
  40259. __webpack_require__.r(__webpack_exports__);
  40260. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Observer; });
  40261. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_emittermixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js");
  40262. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  40263. /**
  40264. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  40265. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  40266. */
  40267. /**
  40268. * @module engine/view/observer/observer
  40269. */
  40270. /**
  40271. * Abstract base observer class. Observers are classes which listen to DOM events, do the preliminary
  40272. * processing and fire events on the {@link module:engine/view/document~Document} objects.
  40273. * Observers can also add features to the view, for instance by updating its status or marking elements
  40274. * which need refresh on DOM events.
  40275. *
  40276. * @abstract
  40277. */
  40278. class Observer {
  40279. /**
  40280. * Creates an instance of the observer.
  40281. *
  40282. * @param {module:engine/view/view~View} view
  40283. */
  40284. constructor( view ) {
  40285. /**
  40286. * Instance of the view controller.
  40287. *
  40288. * @readonly
  40289. * @member {module:engine/view/view~View}
  40290. */
  40291. this.view = view;
  40292. /**
  40293. * Reference to the {@link module:engine/view/document~Document} object.
  40294. *
  40295. * @readonly
  40296. * @member {module:engine/view/document~Document}
  40297. */
  40298. this.document = view.document;
  40299. /**
  40300. * State of the observer. If it is disabled events will not be fired.
  40301. *
  40302. * @readonly
  40303. * @member {Boolean}
  40304. */
  40305. this.isEnabled = false;
  40306. }
  40307. /**
  40308. * Enables the observer. This method is called when the observer is registered to the
  40309. * {@link module:engine/view/view~View} and after {@link module:engine/view/view~View#forceRender rendering}
  40310. * (all observers are {@link #disable disabled} before rendering).
  40311. *
  40312. * A typical use case for disabling observers is that mutation observers need to be disabled for the rendering.
  40313. * However, a child class may not need to be disabled, so it can implement an empty method.
  40314. *
  40315. * @see module:engine/view/observer/observer~Observer#disable
  40316. */
  40317. enable() {
  40318. this.isEnabled = true;
  40319. }
  40320. /**
  40321. * Disables the observer. This method is called before
  40322. * {@link module:engine/view/view~View#forceRender rendering} to prevent firing events during rendering.
  40323. *
  40324. * @see module:engine/view/observer/observer~Observer#enable
  40325. */
  40326. disable() {
  40327. this.isEnabled = false;
  40328. }
  40329. /**
  40330. * Disables and destroys the observer, among others removes event listeners created by the observer.
  40331. */
  40332. destroy() {
  40333. this.disable();
  40334. this.stopListening();
  40335. }
  40336. /**
  40337. * Checks whether the given DOM event should be ignored (should not be turned into a synthetic view document event).
  40338. *
  40339. * Currently, an event will be ignored only if its target or any of its ancestors has the `data-cke-ignore-events` attribute.
  40340. * This attribute can be used inside structures generated by
  40341. * {@link module:engine/view/downcastwriter~DowncastWriter#createUIElement `DowncastWriter#createUIElement()`} to ignore events
  40342. * fired within a UI that should be excluded from CKEditor 5's realms.
  40343. *
  40344. * @param {Node} domTarget The DOM event target to check (usually an element, sometimes a text node and
  40345. * potentially sometimes a document too).
  40346. * @returns {Boolean} Whether this event should be ignored by the observer.
  40347. */
  40348. checkShouldIgnoreEventFromTarget( domTarget ) {
  40349. if ( domTarget && domTarget.nodeType === 3 ) {
  40350. domTarget = domTarget.parentNode;
  40351. }
  40352. if ( !domTarget || domTarget.nodeType !== 1 ) {
  40353. return false;
  40354. }
  40355. return domTarget.matches( '[data-cke-ignore-events], [data-cke-ignore-events] *' );
  40356. }
  40357. /**
  40358. * Starts observing the given root element.
  40359. *
  40360. * @method #observe
  40361. * @param {HTMLElement} domElement
  40362. * @param {String} name The name of the root element.
  40363. */
  40364. }
  40365. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( Observer, _ckeditor_ckeditor5_utils_src_dom_emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
  40366. /***/ }),
  40367. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/selectionobserver.js":
  40368. /*!****************************************************************************************!*\
  40369. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/selectionobserver.js ***!
  40370. \****************************************************************************************/
  40371. /*! exports provided: default */
  40372. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40373. "use strict";
  40374. __webpack_require__.r(__webpack_exports__);
  40375. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SelectionObserver; });
  40376. /* harmony import */ var _observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./observer */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js");
  40377. /* harmony import */ var _mutationobserver__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mutationobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mutationobserver.js");
  40378. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  40379. /**
  40380. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  40381. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  40382. */
  40383. /**
  40384. * @module engine/view/observer/selectionobserver
  40385. */
  40386. /* global setInterval, clearInterval */
  40387. /**
  40388. * Selection observer class observes selection changes in the document. If selection changes on the document this
  40389. * observer checks if there are any mutations and if DOM selection is different than the
  40390. * {@link module:engine/view/document~Document#selection view selection}. Selection observer fires
  40391. * {@link module:engine/view/document~Document#event:selectionChange} event only if selection change was the only change in the document
  40392. * and DOM selection is different then the view selection.
  40393. *
  40394. * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
  40395. *
  40396. * @see module:engine/view/observer/mutationobserver~MutationObserver
  40397. * @extends module:engine/view/observer/observer~Observer
  40398. */
  40399. class SelectionObserver extends _observer__WEBPACK_IMPORTED_MODULE_0__["default"] {
  40400. constructor( view ) {
  40401. super( view );
  40402. /**
  40403. * Instance of the mutation observer. Selection observer calls
  40404. * {@link module:engine/view/observer/mutationobserver~MutationObserver#flush} to ensure that the mutations will be handled
  40405. * before the {@link module:engine/view/document~Document#event:selectionChange} event is fired.
  40406. *
  40407. * @readonly
  40408. * @member {module:engine/view/observer/mutationobserver~MutationObserver}
  40409. * module:engine/view/observer/selectionobserver~SelectionObserver#mutationObserver
  40410. */
  40411. this.mutationObserver = view.getObserver( _mutationobserver__WEBPACK_IMPORTED_MODULE_1__["default"] );
  40412. /**
  40413. * Reference to the view {@link module:engine/view/documentselection~DocumentSelection} object used to compare
  40414. * new selection with it.
  40415. *
  40416. * @readonly
  40417. * @member {module:engine/view/documentselection~DocumentSelection}
  40418. * module:engine/view/observer/selectionobserver~SelectionObserver#selection
  40419. */
  40420. this.selection = this.document.selection;
  40421. /* eslint-disable max-len */
  40422. /**
  40423. * Reference to the {@link module:engine/view/view~View#domConverter}.
  40424. *
  40425. * @readonly
  40426. * @member {module:engine/view/domconverter~DomConverter} module:engine/view/observer/selectionobserver~SelectionObserver#domConverter
  40427. */
  40428. /* eslint-enable max-len */
  40429. this.domConverter = view.domConverter;
  40430. /**
  40431. * Set of documents which have added "selectionchange" listener to avoid adding listener twice to the same
  40432. * document.
  40433. *
  40434. * @private
  40435. * @member {WeakSet.<Document>} module:engine/view/observer/selectionobserver~SelectionObserver#_documents
  40436. */
  40437. this._documents = new WeakSet();
  40438. /**
  40439. * Fires debounced event `selectionChangeDone`. It uses `lodash#debounce` method to delay function call.
  40440. *
  40441. * @private
  40442. * @param {Object} data Selection change data.
  40443. * @method #_fireSelectionChangeDoneDebounced
  40444. */
  40445. this._fireSelectionChangeDoneDebounced = Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["debounce"])( data => this.document.fire( 'selectionChangeDone', data ), 200 );
  40446. this._clearInfiniteLoopInterval = setInterval( () => this._clearInfiniteLoop(), 1000 );
  40447. /**
  40448. * Private property to check if the code does not enter infinite loop.
  40449. *
  40450. * @private
  40451. * @member {Number} module:engine/view/observer/selectionobserver~SelectionObserver#_loopbackCounter
  40452. */
  40453. this._loopbackCounter = 0;
  40454. }
  40455. /**
  40456. * @inheritDoc
  40457. */
  40458. observe( domElement ) {
  40459. const domDocument = domElement.ownerDocument;
  40460. // Add listener once per each document.
  40461. if ( this._documents.has( domDocument ) ) {
  40462. return;
  40463. }
  40464. this.listenTo( domDocument, 'selectionchange', ( evt, domEvent ) => {
  40465. this._handleSelectionChange( domEvent, domDocument );
  40466. } );
  40467. this._documents.add( domDocument );
  40468. }
  40469. /**
  40470. * @inheritDoc
  40471. */
  40472. destroy() {
  40473. super.destroy();
  40474. clearInterval( this._clearInfiniteLoopInterval );
  40475. this._fireSelectionChangeDoneDebounced.cancel();
  40476. }
  40477. /**
  40478. * Selection change listener. {@link module:engine/view/observer/mutationobserver~MutationObserver#flush Flush} mutations, check if
  40479. * selection changes and fires {@link module:engine/view/document~Document#event:selectionChange} event on every change
  40480. * and {@link module:engine/view/document~Document#event:selectionChangeDone} when selection stop changing.
  40481. *
  40482. * @private
  40483. * @param {Event} domEvent DOM event.
  40484. * @param {Document} domDocument DOM document.
  40485. */
  40486. _handleSelectionChange( domEvent, domDocument ) {
  40487. if ( !this.isEnabled ) {
  40488. return;
  40489. }
  40490. const domSelection = domDocument.defaultView.getSelection();
  40491. if ( this.checkShouldIgnoreEventFromTarget( domSelection.anchorNode ) ) {
  40492. return;
  40493. }
  40494. // Ensure the mutation event will be before selection event on all browsers.
  40495. this.mutationObserver.flush();
  40496. // If there were mutations then the view will be re-rendered by the mutation observer and selection
  40497. // will be updated, so selections will equal and event will not be fired, as expected.
  40498. const newViewSelection = this.domConverter.domSelectionToView( domSelection );
  40499. // Do not convert selection change if the new view selection has no ranges in it.
  40500. //
  40501. // It means that the DOM selection is in some way incorrect. Ranges that were in the DOM selection could not be
  40502. // converted to the view. This happens when the DOM selection was moved outside of the editable element.
  40503. if ( newViewSelection.rangeCount == 0 ) {
  40504. this.view.hasDomSelection = false;
  40505. return;
  40506. }
  40507. this.view.hasDomSelection = true;
  40508. if ( this.selection.isEqual( newViewSelection ) && this.domConverter.isDomSelectionCorrect( domSelection ) ) {
  40509. return;
  40510. }
  40511. // Ensure we are not in the infinite loop (#400).
  40512. // This counter is reset each second. 60 selection changes in 1 second is enough high number
  40513. // to be very difficult (impossible) to achieve using just keyboard keys (during normal editor use).
  40514. if ( ++this._loopbackCounter > 60 ) {
  40515. // Selection change observer detected an infinite rendering loop.
  40516. // Most probably you try to put the selection in the position which is not allowed
  40517. // by the browser and browser fixes it automatically what causes `selectionchange` event on
  40518. // which a loopback through a model tries to re-render the wrong selection and again.
  40519. //
  40520. // @if CK_DEBUG // console.warn( 'Selection change observer detected an infinite rendering loop.' );
  40521. return;
  40522. }
  40523. if ( this.selection.isSimilar( newViewSelection ) ) {
  40524. // If selection was equal and we are at this point of algorithm, it means that it was incorrect.
  40525. // Just re-render it, no need to fire any events, etc.
  40526. this.view.forceRender();
  40527. } else {
  40528. const data = {
  40529. oldSelection: this.selection,
  40530. newSelection: newViewSelection,
  40531. domSelection
  40532. };
  40533. // Prepare data for new selection and fire appropriate events.
  40534. this.document.fire( 'selectionChange', data );
  40535. // Call` #_fireSelectionChangeDoneDebounced` every time when `selectionChange` event is fired.
  40536. // This function is debounced what means that `selectionChangeDone` event will be fired only when
  40537. // defined int the function time will elapse since the last time the function was called.
  40538. // So `selectionChangeDone` will be fired when selection will stop changing.
  40539. this._fireSelectionChangeDoneDebounced( data );
  40540. }
  40541. }
  40542. /**
  40543. * Clears `SelectionObserver` internal properties connected with preventing infinite loop.
  40544. *
  40545. * @protected
  40546. */
  40547. _clearInfiniteLoop() {
  40548. this._loopbackCounter = 0;
  40549. }
  40550. }
  40551. /**
  40552. * Fired when selection has changed. This event is fired only when the selection change was the only change that happened
  40553. * in the document, and old selection is different then the new selection.
  40554. *
  40555. * Introduced by {@link module:engine/view/observer/selectionobserver~SelectionObserver}.
  40556. *
  40557. * Note that because {@link module:engine/view/observer/selectionobserver~SelectionObserver} is attached by the
  40558. * {@link module:engine/view/view~View} this event is available by default.
  40559. *
  40560. * @see module:engine/view/observer/selectionobserver~SelectionObserver
  40561. * @event module:engine/view/document~Document#event:selectionChange
  40562. * @param {Object} data
  40563. * @param {module:engine/view/documentselection~DocumentSelection} data.oldSelection Old View selection which is
  40564. * {@link module:engine/view/document~Document#selection}.
  40565. * @param {module:engine/view/selection~Selection} data.newSelection New View selection which is converted DOM selection.
  40566. * @param {Selection} data.domSelection Native DOM selection.
  40567. */
  40568. /**
  40569. * Fired when selection stops changing.
  40570. *
  40571. * Introduced by {@link module:engine/view/observer/selectionobserver~SelectionObserver}.
  40572. *
  40573. * Note that because {@link module:engine/view/observer/selectionobserver~SelectionObserver} is attached by the
  40574. * {@link module:engine/view/view~View} this event is available by default.
  40575. *
  40576. * @see module:engine/view/observer/selectionobserver~SelectionObserver
  40577. * @event module:engine/view/document~Document#event:selectionChangeDone
  40578. * @param {Object} data
  40579. * @param {module:engine/view/documentselection~DocumentSelection} data.oldSelection Old View selection which is
  40580. * {@link module:engine/view/document~Document#selection}.
  40581. * @param {module:engine/view/selection~Selection} data.newSelection New View selection which is converted DOM selection.
  40582. * @param {Selection} data.domSelection Native DOM selection.
  40583. */
  40584. /***/ }),
  40585. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/placeholder.js":
  40586. /*!*************************************************************************!*\
  40587. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/placeholder.js ***!
  40588. \*************************************************************************/
  40589. /*! exports provided: enablePlaceholder, disablePlaceholder, showPlaceholder, hidePlaceholder, needsPlaceholder */
  40590. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40591. "use strict";
  40592. __webpack_require__.r(__webpack_exports__);
  40593. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "enablePlaceholder", function() { return enablePlaceholder; });
  40594. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "disablePlaceholder", function() { return disablePlaceholder; });
  40595. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "showPlaceholder", function() { return showPlaceholder; });
  40596. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hidePlaceholder", function() { return hidePlaceholder; });
  40597. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "needsPlaceholder", function() { return needsPlaceholder; });
  40598. /* harmony import */ var _theme_placeholder_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../theme/placeholder.css */ "./node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css");
  40599. /* harmony import */ var _theme_placeholder_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_theme_placeholder_css__WEBPACK_IMPORTED_MODULE_0__);
  40600. /**
  40601. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  40602. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  40603. */
  40604. /**
  40605. * @module engine/view/placeholder
  40606. */
  40607. // Each document stores information about its placeholder elements and check functions.
  40608. const documentPlaceholders = new WeakMap();
  40609. /**
  40610. * A helper that enables a placeholder on the provided view element (also updates its visibility).
  40611. * The placeholder is a CSS pseudo–element (with a text content) attached to the element.
  40612. *
  40613. * To change the placeholder text, simply call this method again with new options.
  40614. *
  40615. * To disable the placeholder, use {@link module:engine/view/placeholder~disablePlaceholder `disablePlaceholder()`} helper.
  40616. *
  40617. * @param {Object} [options] Configuration options of the placeholder.
  40618. * @param {module:engine/view/view~View} options.view Editing view instance.
  40619. * @param {module:engine/view/element~Element} options.element Element that will gain a placeholder.
  40620. * See `options.isDirectHost` to learn more.
  40621. * @param {String} options.text Placeholder text.
  40622. * @param {Boolean} [options.isDirectHost=true] If set `false`, the placeholder will not be enabled directly
  40623. * in the passed `element` but in one of its children (selected automatically, i.e. a first empty child element).
  40624. * Useful when attaching placeholders to elements that can host other elements (not just text), for instance,
  40625. * editable root elements.
  40626. */
  40627. function enablePlaceholder( options ) {
  40628. const { view, element, text, isDirectHost = true } = options;
  40629. const doc = view.document;
  40630. // Use a single a single post fixer per—document to update all placeholders.
  40631. if ( !documentPlaceholders.has( doc ) ) {
  40632. documentPlaceholders.set( doc, new Map() );
  40633. // If a post-fixer callback makes a change, it should return `true` so other post–fixers
  40634. // can re–evaluate the document again.
  40635. doc.registerPostFixer( writer => updateDocumentPlaceholders( doc, writer ) );
  40636. }
  40637. // Store information about the element placeholder under its document.
  40638. documentPlaceholders.get( doc ).set( element, {
  40639. text,
  40640. isDirectHost
  40641. } );
  40642. // Update the placeholders right away.
  40643. view.change( writer => updateDocumentPlaceholders( doc, writer ) );
  40644. }
  40645. /**
  40646. * Disables the placeholder functionality from a given element.
  40647. *
  40648. * See {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`} to learn more.
  40649. *
  40650. * @param {module:engine/view/view~View} view
  40651. * @param {module:engine/view/element~Element} element
  40652. */
  40653. function disablePlaceholder( view, element ) {
  40654. const doc = element.document;
  40655. view.change( writer => {
  40656. if ( !documentPlaceholders.has( doc ) ) {
  40657. return;
  40658. }
  40659. const placeholders = documentPlaceholders.get( doc );
  40660. const config = placeholders.get( element );
  40661. writer.removeAttribute( 'data-placeholder', config.hostElement );
  40662. hidePlaceholder( writer, config.hostElement );
  40663. placeholders.delete( element );
  40664. } );
  40665. }
  40666. /**
  40667. * Shows a placeholder in the provided element by changing related attributes and CSS classes.
  40668. *
  40669. * **Note**: This helper will not update the placeholder visibility nor manage the
  40670. * it in any way in the future. What it does is a one–time state change of an element. Use
  40671. * {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`} and
  40672. * {@link module:engine/view/placeholder~disablePlaceholder `disablePlaceholder()`} for full
  40673. * placeholder functionality.
  40674. *
  40675. * **Note**: This helper will blindly show the placeholder directly in the root editable element if
  40676. * one is passed, which could result in a visual clash if the editable element has some children
  40677. * (for instance, an empty paragraph). Use {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`}
  40678. * in that case or make sure the correct element is passed to the helper.
  40679. *
  40680. * @param {module:engine/view/downcastwriter~DowncastWriter} writer
  40681. * @param {module:engine/view/element~Element} element
  40682. * @returns {Boolean} `true`, if any changes were made to the `element`.
  40683. */
  40684. function showPlaceholder( writer, element ) {
  40685. if ( !element.hasClass( 'ck-placeholder' ) ) {
  40686. writer.addClass( 'ck-placeholder', element );
  40687. return true;
  40688. }
  40689. return false;
  40690. }
  40691. /**
  40692. * Hides a placeholder in the element by changing related attributes and CSS classes.
  40693. *
  40694. * **Note**: This helper will not update the placeholder visibility nor manage the
  40695. * it in any way in the future. What it does is a one–time state change of an element. Use
  40696. * {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`} and
  40697. * {@link module:engine/view/placeholder~disablePlaceholder `disablePlaceholder()`} for full
  40698. * placeholder functionality.
  40699. *
  40700. * @param {module:engine/view/downcastwriter~DowncastWriter} writer
  40701. * @param {module:engine/view/element~Element} element
  40702. * @returns {Boolean} `true`, if any changes were made to the `element`.
  40703. */
  40704. function hidePlaceholder( writer, element ) {
  40705. if ( element.hasClass( 'ck-placeholder' ) ) {
  40706. writer.removeClass( 'ck-placeholder', element );
  40707. return true;
  40708. }
  40709. return false;
  40710. }
  40711. /**
  40712. * Checks if a placeholder should be displayed in the element.
  40713. *
  40714. * **Note**: This helper will blindly check the possibility of showing a placeholder directly in the
  40715. * root editable element if one is passed, which may not be the expected result. If an element can
  40716. * host other elements (not just text), most likely one of its children should be checked instead
  40717. * because it will be the final host for the placeholder. Use
  40718. * {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`} in that case or make
  40719. * sure the correct element is passed to the helper.
  40720. *
  40721. * @param {module:engine/view/element~Element} element
  40722. * @returns {Boolean}
  40723. */
  40724. function needsPlaceholder( element ) {
  40725. if ( !element.isAttached() ) {
  40726. return false;
  40727. }
  40728. // The element is empty only as long as it contains nothing but uiElements.
  40729. const isEmptyish = !Array.from( element.getChildren() )
  40730. .some( element => !element.is( 'uiElement' ) );
  40731. const doc = element.document;
  40732. // If the element is empty and the document is blurred.
  40733. if ( !doc.isFocused && isEmptyish ) {
  40734. return true;
  40735. }
  40736. const viewSelection = doc.selection;
  40737. const selectionAnchor = viewSelection.anchor;
  40738. // If document is focused and the element is empty but the selection is not anchored inside it.
  40739. if ( isEmptyish && selectionAnchor && selectionAnchor.parent !== element ) {
  40740. return true;
  40741. }
  40742. return false;
  40743. }
  40744. // Updates all placeholders associated with a document in a post–fixer callback.
  40745. //
  40746. // @private
  40747. // @param { module:engine/view/document~Document} doc
  40748. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  40749. // @returns {Boolean} True if any changes were made to the view document.
  40750. function updateDocumentPlaceholders( doc, writer ) {
  40751. const placeholders = documentPlaceholders.get( doc );
  40752. let wasViewModified = false;
  40753. for ( const [ element, config ] of placeholders ) {
  40754. if ( updatePlaceholder( writer, element, config ) ) {
  40755. wasViewModified = true;
  40756. }
  40757. }
  40758. return wasViewModified;
  40759. }
  40760. // Updates a single placeholder in a post–fixer callback.
  40761. //
  40762. // @private
  40763. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  40764. // @param {module:engine/view/element~Element} element
  40765. // @param {Object} config Configuration of the placeholder
  40766. // @param {String} config.text
  40767. // @param {Boolean} config.isDirectHost
  40768. // @returns {Boolean} True if any changes were made to the view document.
  40769. function updatePlaceholder( writer, element, config ) {
  40770. const { text, isDirectHost } = config;
  40771. const hostElement = isDirectHost ? element : getChildPlaceholderHostSubstitute( element );
  40772. let wasViewModified = false;
  40773. // When not a direct host, it could happen that there is no child element
  40774. // capable of displaying a placeholder.
  40775. if ( !hostElement ) {
  40776. return false;
  40777. }
  40778. // Cache the host element. It will be necessary for disablePlaceholder() to know
  40779. // which element should have class and attribute removed because, depending on
  40780. // the config.isDirectHost value, it could be the element or one of its descendants.
  40781. config.hostElement = hostElement;
  40782. // This may be necessary when updating the placeholder text to something else.
  40783. if ( hostElement.getAttribute( 'data-placeholder' ) !== text ) {
  40784. writer.setAttribute( 'data-placeholder', text, hostElement );
  40785. wasViewModified = true;
  40786. }
  40787. if ( needsPlaceholder( hostElement ) ) {
  40788. if ( showPlaceholder( writer, hostElement ) ) {
  40789. wasViewModified = true;
  40790. }
  40791. } else if ( hidePlaceholder( writer, hostElement ) ) {
  40792. wasViewModified = true;
  40793. }
  40794. return wasViewModified;
  40795. }
  40796. // Gets a child element capable of displaying a placeholder if a parent element can host more
  40797. // than just text (for instance, when it is a root editable element). The child element
  40798. // can then be used in other placeholder helpers as a substitute of its parent.
  40799. //
  40800. // @private
  40801. // @param {module:engine/view/element~Element} parent
  40802. // @returns {module:engine/view/element~Element|null}
  40803. function getChildPlaceholderHostSubstitute( parent ) {
  40804. if ( parent.childCount === 1 ) {
  40805. const firstChild = parent.getChild( 0 );
  40806. if ( firstChild.is( 'element' ) && !firstChild.is( 'uiElement' ) ) {
  40807. return firstChild;
  40808. }
  40809. }
  40810. return null;
  40811. }
  40812. /***/ }),
  40813. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js":
  40814. /*!**********************************************************************!*\
  40815. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js ***!
  40816. \**********************************************************************/
  40817. /*! exports provided: default */
  40818. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  40819. "use strict";
  40820. __webpack_require__.r(__webpack_exports__);
  40821. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Position; });
  40822. /* harmony import */ var _treewalker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./treewalker */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/treewalker.js");
  40823. /* harmony import */ var _ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/comparearrays */ "./node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.js");
  40824. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  40825. /* harmony import */ var _editableelement__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./editableelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/editableelement.js");
  40826. /* harmony import */ var _ckeditor_ckeditor5_utils_src_version__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/version */ "./node_modules/@ckeditor/ckeditor5-utils/src/version.js");
  40827. /**
  40828. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  40829. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  40830. */
  40831. /**
  40832. * @module engine/view/position
  40833. */
  40834. // To check if component is loaded more than once.
  40835. /**
  40836. * Position in the view tree. Position is represented by its parent node and an offset in this parent.
  40837. *
  40838. * In order to create a new position instance use the `createPosition*()` factory methods available in:
  40839. *
  40840. * * {@link module:engine/view/view~View}
  40841. * * {@link module:engine/view/downcastwriter~DowncastWriter}
  40842. * * {@link module:engine/view/upcastwriter~UpcastWriter}
  40843. */
  40844. class Position {
  40845. /**
  40846. * Creates a position.
  40847. *
  40848. * @param {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment} parent Position parent.
  40849. * @param {Number} offset Position offset.
  40850. */
  40851. constructor( parent, offset ) {
  40852. /**
  40853. * Position parent.
  40854. *
  40855. * @readonly
  40856. * @member {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment}
  40857. * module:engine/view/position~Position#parent
  40858. */
  40859. this.parent = parent;
  40860. /**
  40861. * Position offset.
  40862. *
  40863. * @readonly
  40864. * @member {Number} module:engine/view/position~Position#offset
  40865. */
  40866. this.offset = offset;
  40867. }
  40868. /**
  40869. * Node directly after the position. Equals `null` when there is no node after position or position is located
  40870. * inside text node.
  40871. *
  40872. * @readonly
  40873. * @type {module:engine/view/node~Node|null}
  40874. */
  40875. get nodeAfter() {
  40876. if ( this.parent.is( '$text' ) ) {
  40877. return null;
  40878. }
  40879. return this.parent.getChild( this.offset ) || null;
  40880. }
  40881. /**
  40882. * Node directly before the position. Equals `null` when there is no node before position or position is located
  40883. * inside text node.
  40884. *
  40885. * @readonly
  40886. * @type {module:engine/view/node~Node|null}
  40887. */
  40888. get nodeBefore() {
  40889. if ( this.parent.is( '$text' ) ) {
  40890. return null;
  40891. }
  40892. return this.parent.getChild( this.offset - 1 ) || null;
  40893. }
  40894. /**
  40895. * Is `true` if position is at the beginning of its {@link module:engine/view/position~Position#parent parent}, `false` otherwise.
  40896. *
  40897. * @readonly
  40898. * @type {Boolean}
  40899. */
  40900. get isAtStart() {
  40901. return this.offset === 0;
  40902. }
  40903. /**
  40904. * Is `true` if position is at the end of its {@link module:engine/view/position~Position#parent parent}, `false` otherwise.
  40905. *
  40906. * @readonly
  40907. * @type {Boolean}
  40908. */
  40909. get isAtEnd() {
  40910. const endOffset = this.parent.is( '$text' ) ? this.parent.data.length : this.parent.childCount;
  40911. return this.offset === endOffset;
  40912. }
  40913. /**
  40914. * Position's root, that is the root of the position's parent element.
  40915. *
  40916. * @readonly
  40917. * @type {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment}
  40918. */
  40919. get root() {
  40920. return this.parent.root;
  40921. }
  40922. /**
  40923. * {@link module:engine/view/editableelement~EditableElement EditableElement} instance that contains this position, or `null` if
  40924. * position is not inside an editable element.
  40925. *
  40926. * @type {module:engine/view/editableelement~EditableElement|null}
  40927. */
  40928. get editableElement() {
  40929. let editable = this.parent;
  40930. while ( !( editable instanceof _editableelement__WEBPACK_IMPORTED_MODULE_3__["default"] ) ) {
  40931. if ( editable.parent ) {
  40932. editable = editable.parent;
  40933. } else {
  40934. return null;
  40935. }
  40936. }
  40937. return editable;
  40938. }
  40939. /**
  40940. * Returns a new instance of Position with offset incremented by `shift` value.
  40941. *
  40942. * @param {Number} shift How position offset should get changed. Accepts negative values.
  40943. * @returns {module:engine/view/position~Position} Shifted position.
  40944. */
  40945. getShiftedBy( shift ) {
  40946. const shifted = Position._createAt( this );
  40947. const offset = shifted.offset + shift;
  40948. shifted.offset = offset < 0 ? 0 : offset;
  40949. return shifted;
  40950. }
  40951. /**
  40952. * Gets the farthest position which matches the callback using
  40953. * {@link module:engine/view/treewalker~TreeWalker TreeWalker}.
  40954. *
  40955. * For example:
  40956. *
  40957. * getLastMatchingPosition( value => value.type == 'text' ); // <p>{}foo</p> -> <p>foo[]</p>
  40958. * getLastMatchingPosition( value => value.type == 'text', { direction: 'backward' } ); // <p>foo[]</p> -> <p>{}foo</p>
  40959. * getLastMatchingPosition( value => false ); // Do not move the position.
  40960. *
  40961. * @param {Function} skip Callback function. Gets {@link module:engine/view/treewalker~TreeWalkerValue} and should
  40962. * return `true` if the value should be skipped or `false` if not.
  40963. * @param {Object} options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}.
  40964. *
  40965. * @returns {module:engine/view/position~Position} The position after the last item which matches the `skip` callback test.
  40966. */
  40967. getLastMatchingPosition( skip, options = {} ) {
  40968. options.startPosition = this;
  40969. const treeWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( options );
  40970. treeWalker.skip( skip );
  40971. return treeWalker.position;
  40972. }
  40973. /**
  40974. * Returns ancestors array of this position, that is this position's parent and it's ancestors.
  40975. *
  40976. * @returns {Array} Array with ancestors.
  40977. */
  40978. getAncestors() {
  40979. if ( this.parent.is( 'documentFragment' ) ) {
  40980. return [ this.parent ];
  40981. } else {
  40982. return this.parent.getAncestors( { includeSelf: true } );
  40983. }
  40984. }
  40985. /**
  40986. * Returns a {@link module:engine/view/node~Node} or {@link module:engine/view/documentfragment~DocumentFragment}
  40987. * which is a common ancestor of both positions.
  40988. *
  40989. * @param {module:engine/view/position~Position} position
  40990. * @returns {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment|null}
  40991. */
  40992. getCommonAncestor( position ) {
  40993. const ancestorsA = this.getAncestors();
  40994. const ancestorsB = position.getAncestors();
  40995. let i = 0;
  40996. while ( ancestorsA[ i ] == ancestorsB[ i ] && ancestorsA[ i ] ) {
  40997. i++;
  40998. }
  40999. return i === 0 ? null : ancestorsA[ i - 1 ];
  41000. }
  41001. /**
  41002. * Checks whether this object is of the given type.
  41003. *
  41004. * position.is( 'position' ); // -> true
  41005. * position.is( 'view:position' ); // -> true
  41006. *
  41007. * position.is( 'model:position' ); // -> false
  41008. * position.is( 'element' ); // -> false
  41009. * position.is( 'range' ); // -> false
  41010. *
  41011. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  41012. *
  41013. * @param {String} type
  41014. * @returns {Boolean}
  41015. */
  41016. is( type ) {
  41017. return type === 'position' || type === 'view:position';
  41018. }
  41019. /**
  41020. * Checks whether this position equals given position.
  41021. *
  41022. * @param {module:engine/view/position~Position} otherPosition Position to compare with.
  41023. * @returns {Boolean} True if positions are same.
  41024. */
  41025. isEqual( otherPosition ) {
  41026. return ( this.parent == otherPosition.parent && this.offset == otherPosition.offset );
  41027. }
  41028. /**
  41029. * Checks whether this position is located before given position. When method returns `false` it does not mean that
  41030. * this position is after give one. Two positions may be located inside separate roots and in that situation this
  41031. * method will still return `false`.
  41032. *
  41033. * @see module:engine/view/position~Position#isAfter
  41034. * @see module:engine/view/position~Position#compareWith
  41035. * @param {module:engine/view/position~Position} otherPosition Position to compare with.
  41036. * @returns {Boolean} Returns `true` if this position is before given position.
  41037. */
  41038. isBefore( otherPosition ) {
  41039. return this.compareWith( otherPosition ) == 'before';
  41040. }
  41041. /**
  41042. * Checks whether this position is located after given position. When method returns `false` it does not mean that
  41043. * this position is before give one. Two positions may be located inside separate roots and in that situation this
  41044. * method will still return `false`.
  41045. *
  41046. * @see module:engine/view/position~Position#isBefore
  41047. * @see module:engine/view/position~Position#compareWith
  41048. * @param {module:engine/view/position~Position} otherPosition Position to compare with.
  41049. * @returns {Boolean} Returns `true` if this position is after given position.
  41050. */
  41051. isAfter( otherPosition ) {
  41052. return this.compareWith( otherPosition ) == 'after';
  41053. }
  41054. /**
  41055. * Checks whether this position is before, after or in same position that other position. Two positions may be also
  41056. * different when they are located in separate roots.
  41057. *
  41058. * @param {module:engine/view/position~Position} otherPosition Position to compare with.
  41059. * @returns {module:engine/view/position~PositionRelation}
  41060. */
  41061. compareWith( otherPosition ) {
  41062. if ( this.root !== otherPosition.root ) {
  41063. return 'different';
  41064. }
  41065. if ( this.isEqual( otherPosition ) ) {
  41066. return 'same';
  41067. }
  41068. // Get path from root to position's parent element.
  41069. const thisPath = this.parent.is( 'node' ) ? this.parent.getPath() : [];
  41070. const otherPath = otherPosition.parent.is( 'node' ) ? otherPosition.parent.getPath() : [];
  41071. // Add the positions' offsets to the parents offsets.
  41072. thisPath.push( this.offset );
  41073. otherPath.push( otherPosition.offset );
  41074. // Compare both path arrays to find common ancestor.
  41075. const result = Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_1__["default"])( thisPath, otherPath );
  41076. switch ( result ) {
  41077. case 'prefix':
  41078. return 'before';
  41079. case 'extension':
  41080. return 'after';
  41081. default:
  41082. return thisPath[ result ] < otherPath[ result ] ? 'before' : 'after';
  41083. }
  41084. }
  41085. /**
  41086. * Creates a {@link module:engine/view/treewalker~TreeWalker TreeWalker} instance with this positions as a start position.
  41087. *
  41088. * @param {Object} options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}
  41089. * @param {module:engine/view/range~Range} [options.boundaries=null] Range to define boundaries of the iterator.
  41090. * @param {Boolean} [options.singleCharacters=false]
  41091. * @param {Boolean} [options.shallow=false]
  41092. * @param {Boolean} [options.ignoreElementEnd=false]
  41093. */
  41094. getWalker( options = {} ) {
  41095. options.startPosition = this;
  41096. return new _treewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( options );
  41097. }
  41098. clone() {
  41099. return new Position( this.parent, this.offset );
  41100. }
  41101. /**
  41102. * Creates position at the given location. The location can be specified as:
  41103. *
  41104. * * a {@link module:engine/view/position~Position position},
  41105. * * parent element and offset (offset defaults to `0`),
  41106. * * parent element and `'end'` (sets position at the end of that element),
  41107. * * {@link module:engine/view/item~Item view item} and `'before'` or `'after'` (sets position before or after given view item).
  41108. *
  41109. * This method is a shortcut to other constructors such as:
  41110. *
  41111. * * {@link module:engine/view/position~Position._createBefore},
  41112. * * {@link module:engine/view/position~Position._createAfter}.
  41113. *
  41114. * @protected
  41115. * @param {module:engine/view/item~Item|module:engine/view/position~Position} itemOrPosition
  41116. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  41117. * first parameter is a {@link module:engine/view/item~Item view item}.
  41118. */
  41119. static _createAt( itemOrPosition, offset ) {
  41120. if ( itemOrPosition instanceof Position ) {
  41121. return new this( itemOrPosition.parent, itemOrPosition.offset );
  41122. } else {
  41123. const node = itemOrPosition;
  41124. if ( offset == 'end' ) {
  41125. offset = node.is( '$text' ) ? node.data.length : node.childCount;
  41126. } else if ( offset == 'before' ) {
  41127. return this._createBefore( node );
  41128. } else if ( offset == 'after' ) {
  41129. return this._createAfter( node );
  41130. } else if ( offset !== 0 && !offset ) {
  41131. /**
  41132. * {@link module:engine/view/view~View#createPositionAt `View#createPositionAt()`}
  41133. * requires the offset to be specified when the first parameter is a view item.
  41134. *
  41135. * @error view-createpositionat-offset-required
  41136. */
  41137. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'view-createpositionat-offset-required', node );
  41138. }
  41139. return new Position( node, offset );
  41140. }
  41141. }
  41142. /**
  41143. * Creates a new position after given view item.
  41144. *
  41145. * @protected
  41146. * @param {module:engine/view/item~Item} item View item after which the position should be located.
  41147. * @returns {module:engine/view/position~Position}
  41148. */
  41149. static _createAfter( item ) {
  41150. // TextProxy is not a instance of Node so we need do handle it in specific way.
  41151. if ( item.is( '$textProxy' ) ) {
  41152. return new Position( item.textNode, item.offsetInText + item.data.length );
  41153. }
  41154. if ( !item.parent ) {
  41155. /**
  41156. * You can not make a position after a root.
  41157. *
  41158. * @error view-position-after-root
  41159. * @param {module:engine/view/node~Node} root
  41160. */
  41161. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'view-position-after-root', item, { root: item } );
  41162. }
  41163. return new Position( item.parent, item.index + 1 );
  41164. }
  41165. /**
  41166. * Creates a new position before given view item.
  41167. *
  41168. * @protected
  41169. * @param {module:engine/view/item~Item} item View item before which the position should be located.
  41170. * @returns {module:engine/view/position~Position}
  41171. */
  41172. static _createBefore( item ) {
  41173. // TextProxy is not a instance of Node so we need do handle it in specific way.
  41174. if ( item.is( '$textProxy' ) ) {
  41175. return new Position( item.textNode, item.offsetInText );
  41176. }
  41177. if ( !item.parent ) {
  41178. /**
  41179. * You cannot make a position before a root.
  41180. *
  41181. * @error view-position-before-root
  41182. * @param {module:engine/view/node~Node} root
  41183. */
  41184. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'view-position-before-root', item, { root: item } );
  41185. }
  41186. return new Position( item.parent, item.index );
  41187. }
  41188. }
  41189. /**
  41190. * A flag indicating whether this position is `'before'` or `'after'` or `'same'` as given position.
  41191. * If positions are in different roots `'different'` flag is returned.
  41192. *
  41193. * @typedef {String} module:engine/view/position~PositionRelation
  41194. */
  41195. /***/ }),
  41196. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/range.js":
  41197. /*!*******************************************************************!*\
  41198. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/range.js ***!
  41199. \*******************************************************************/
  41200. /*! exports provided: default */
  41201. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41202. "use strict";
  41203. __webpack_require__.r(__webpack_exports__);
  41204. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Range; });
  41205. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
  41206. /* harmony import */ var _treewalker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./treewalker */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/treewalker.js");
  41207. /**
  41208. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  41209. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  41210. */
  41211. /**
  41212. * @module engine/view/range
  41213. */
  41214. /**
  41215. * Range in the view tree. A range is represented by its start and end {@link module:engine/view/position~Position positions}.
  41216. *
  41217. * In order to create a new position instance use the `createPosition*()` factory methods available in:
  41218. *
  41219. * * {@link module:engine/view/view~View}
  41220. * * {@link module:engine/view/downcastwriter~DowncastWriter}
  41221. * * {@link module:engine/view/upcastwriter~UpcastWriter}
  41222. */
  41223. class Range {
  41224. /**
  41225. * Creates a range spanning from `start` position to `end` position.
  41226. *
  41227. * **Note:** Constructor creates it's own {@link module:engine/view/position~Position} instances basing on passed values.
  41228. *
  41229. * @param {module:engine/view/position~Position} start Start position.
  41230. * @param {module:engine/view/position~Position} [end] End position. If not set, range will be collapsed at the `start` position.
  41231. */
  41232. constructor( start, end = null ) {
  41233. /**
  41234. * Start position.
  41235. *
  41236. * @readonly
  41237. * @member {module:engine/view/position~Position}
  41238. */
  41239. this.start = start.clone();
  41240. /**
  41241. * End position.
  41242. *
  41243. * @readonly
  41244. * @member {module:engine/view/position~Position}
  41245. */
  41246. this.end = end ? end.clone() : start.clone();
  41247. }
  41248. /**
  41249. * Iterable interface.
  41250. *
  41251. * Iterates over all {@link module:engine/view/item~Item view items} that are in this range and returns
  41252. * them together with additional information like length or {@link module:engine/view/position~Position positions},
  41253. * grouped as {@link module:engine/view/treewalker~TreeWalkerValue}.
  41254. *
  41255. * This iterator uses {@link module:engine/view/treewalker~TreeWalker TreeWalker} with `boundaries` set to this range and
  41256. * `ignoreElementEnd` option
  41257. * set to `true`.
  41258. *
  41259. * @returns {Iterable.<module:engine/view/treewalker~TreeWalkerValue>}
  41260. */
  41261. * [ Symbol.iterator ]() {
  41262. yield* new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( { boundaries: this, ignoreElementEnd: true } );
  41263. }
  41264. /**
  41265. * Returns whether the range is collapsed, that is it start and end positions are equal.
  41266. *
  41267. * @type {Boolean}
  41268. */
  41269. get isCollapsed() {
  41270. return this.start.isEqual( this.end );
  41271. }
  41272. /**
  41273. * Returns whether this range is flat, that is if {@link module:engine/view/range~Range#start start} position and
  41274. * {@link module:engine/view/range~Range#end end} position are in the same {@link module:engine/view/position~Position#parent parent}.
  41275. *
  41276. * @type {Boolean}
  41277. */
  41278. get isFlat() {
  41279. return this.start.parent === this.end.parent;
  41280. }
  41281. /**
  41282. * Range root element.
  41283. *
  41284. * @type {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment}
  41285. */
  41286. get root() {
  41287. return this.start.root;
  41288. }
  41289. /**
  41290. * Creates a maximal range that has the same content as this range but is expanded in both ways (at the beginning
  41291. * and at the end).
  41292. *
  41293. * For example:
  41294. *
  41295. * <p>Foo</p><p><b>{Bar}</b></p> -> <p>Foo</p>[<p><b>Bar</b>]</p>
  41296. * <p><b>foo</b>{bar}<span></span></p> -> <p><b>foo[</b>bar<span></span>]</p>
  41297. *
  41298. * Note that in the sample above:
  41299. *
  41300. * - `<p>` have type of {@link module:engine/view/containerelement~ContainerElement},
  41301. * - `<b>` have type of {@link module:engine/view/attributeelement~AttributeElement},
  41302. * - `<span>` have type of {@link module:engine/view/uielement~UIElement}.
  41303. *
  41304. * @returns {module:engine/view/range~Range} Enlarged range.
  41305. */
  41306. getEnlarged() {
  41307. let start = this.start.getLastMatchingPosition( enlargeTrimSkip, { direction: 'backward' } );
  41308. let end = this.end.getLastMatchingPosition( enlargeTrimSkip );
  41309. // Fix positions, in case if they are in Text node.
  41310. if ( start.parent.is( '$text' ) && start.isAtStart ) {
  41311. start = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createBefore( start.parent );
  41312. }
  41313. if ( end.parent.is( '$text' ) && end.isAtEnd ) {
  41314. end = _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createAfter( end.parent );
  41315. }
  41316. return new Range( start, end );
  41317. }
  41318. /**
  41319. * Creates a minimum range that has the same content as this range but is trimmed in both ways (at the beginning
  41320. * and at the end).
  41321. *
  41322. * For example:
  41323. *
  41324. * <p>Foo</p>[<p><b>Bar</b>]</p> -> <p>Foo</p><p><b>{Bar}</b></p>
  41325. * <p><b>foo[</b>bar<span></span>]</p> -> <p><b>foo</b>{bar}<span></span></p>
  41326. *
  41327. * Note that in the sample above:
  41328. *
  41329. * - `<p>` have type of {@link module:engine/view/containerelement~ContainerElement},
  41330. * - `<b>` have type of {@link module:engine/view/attributeelement~AttributeElement},
  41331. * - `<span>` have type of {@link module:engine/view/uielement~UIElement}.
  41332. *
  41333. * @returns {module:engine/view/range~Range} Shrink range.
  41334. */
  41335. getTrimmed() {
  41336. let start = this.start.getLastMatchingPosition( enlargeTrimSkip );
  41337. if ( start.isAfter( this.end ) || start.isEqual( this.end ) ) {
  41338. return new Range( start, start );
  41339. }
  41340. let end = this.end.getLastMatchingPosition( enlargeTrimSkip, { direction: 'backward' } );
  41341. const nodeAfterStart = start.nodeAfter;
  41342. const nodeBeforeEnd = end.nodeBefore;
  41343. // Because TreeWalker prefers positions next to text node, we need to move them manually into these text nodes.
  41344. if ( nodeAfterStart && nodeAfterStart.is( '$text' ) ) {
  41345. start = new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( nodeAfterStart, 0 );
  41346. }
  41347. if ( nodeBeforeEnd && nodeBeforeEnd.is( '$text' ) ) {
  41348. end = new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( nodeBeforeEnd, nodeBeforeEnd.data.length );
  41349. }
  41350. return new Range( start, end );
  41351. }
  41352. /**
  41353. * Two ranges are equal if their start and end positions are equal.
  41354. *
  41355. * @param {module:engine/view/range~Range} otherRange Range to compare with.
  41356. * @returns {Boolean} `true` if ranges are equal, `false` otherwise
  41357. */
  41358. isEqual( otherRange ) {
  41359. return this == otherRange || ( this.start.isEqual( otherRange.start ) && this.end.isEqual( otherRange.end ) );
  41360. }
  41361. /**
  41362. * Checks whether this range contains given {@link module:engine/view/position~Position position}.
  41363. *
  41364. * @param {module:engine/view/position~Position} position Position to check.
  41365. * @returns {Boolean} `true` if given {@link module:engine/view/position~Position position} is contained in this range,
  41366. * `false` otherwise.
  41367. */
  41368. containsPosition( position ) {
  41369. return position.isAfter( this.start ) && position.isBefore( this.end );
  41370. }
  41371. /**
  41372. * Checks whether this range contains given {@link module:engine/view/range~Range range}.
  41373. *
  41374. * @param {module:engine/view/range~Range} otherRange Range to check.
  41375. * @param {Boolean} [loose=false] Whether the check is loose or strict. If the check is strict (`false`), compared range cannot
  41376. * start or end at the same position as this range boundaries. If the check is loose (`true`), compared range can start, end or
  41377. * even be equal to this range. Note that collapsed ranges are always compared in strict mode.
  41378. * @returns {Boolean} `true` if given {@link module:engine/view/range~Range range} boundaries are contained by this range, `false`
  41379. * otherwise.
  41380. */
  41381. containsRange( otherRange, loose = false ) {
  41382. if ( otherRange.isCollapsed ) {
  41383. loose = false;
  41384. }
  41385. const containsStart = this.containsPosition( otherRange.start ) || ( loose && this.start.isEqual( otherRange.start ) );
  41386. const containsEnd = this.containsPosition( otherRange.end ) || ( loose && this.end.isEqual( otherRange.end ) );
  41387. return containsStart && containsEnd;
  41388. }
  41389. /**
  41390. * Computes which part(s) of this {@link module:engine/view/range~Range range} is not a part of given
  41391. * {@link module:engine/view/range~Range range}.
  41392. * Returned array contains zero, one or two {@link module:engine/view/range~Range ranges}.
  41393. *
  41394. * Examples:
  41395. *
  41396. * let foo = downcastWriter.createText( 'foo' );
  41397. * let img = downcastWriter.createContainerElement( 'img' );
  41398. * let bar = downcastWriter.createText( 'bar' );
  41399. * let p = downcastWriter.createContainerElement( 'p', null, [ foo, img, bar ] );
  41400. *
  41401. * let range = view.createRange( view.createPositionAt( foo, 2 ), view.createPositionAt( bar, 1 ); // "o", img, "b" are in range.
  41402. * let otherRange = view.createRange( // "oo", img, "ba" are in range.
  41403. * view.createPositionAt( foo, 1 ),
  41404. * view.createPositionAt( bar, 2 )
  41405. * );
  41406. * let transformed = range.getDifference( otherRange );
  41407. * // transformed array has no ranges because `otherRange` contains `range`
  41408. *
  41409. * otherRange = view.createRange( view.createPositionAt( foo, 1 ), view.createPositionAt( p, 2 ); // "oo", img are in range.
  41410. * transformed = range.getDifference( otherRange );
  41411. * // transformed array has one range: from ( p, 2 ) to ( bar, 1 )
  41412. *
  41413. * otherRange = view.createRange( view.createPositionAt( p, 1 ), view.createPositionAt( p, 2 ) ); // img is in range.
  41414. * transformed = range.getDifference( otherRange );
  41415. * // transformed array has two ranges: from ( foo, 1 ) to ( p, 1 ) and from ( p, 2 ) to ( bar, 1 )
  41416. *
  41417. * @param {module:engine/view/range~Range} otherRange Range to differentiate against.
  41418. * @returns {Array.<module:engine/view/range~Range>} The difference between ranges.
  41419. */
  41420. getDifference( otherRange ) {
  41421. const ranges = [];
  41422. if ( this.isIntersecting( otherRange ) ) {
  41423. // Ranges intersect.
  41424. if ( this.containsPosition( otherRange.start ) ) {
  41425. // Given range start is inside this range. This means that we have to
  41426. // add shrunken range - from the start to the middle of this range.
  41427. ranges.push( new Range( this.start, otherRange.start ) );
  41428. }
  41429. if ( this.containsPosition( otherRange.end ) ) {
  41430. // Given range end is inside this range. This means that we have to
  41431. // add shrunken range - from the middle of this range to the end.
  41432. ranges.push( new Range( otherRange.end, this.end ) );
  41433. }
  41434. } else {
  41435. // Ranges do not intersect, return the original range.
  41436. ranges.push( this.clone() );
  41437. }
  41438. return ranges;
  41439. }
  41440. /**
  41441. * Returns an intersection of this {@link module:engine/view/range~Range range} and given {@link module:engine/view/range~Range range}.
  41442. * Intersection is a common part of both of those ranges. If ranges has no common part, returns `null`.
  41443. *
  41444. * Examples:
  41445. *
  41446. * let foo = downcastWriter.createText( 'foo' );
  41447. * let img = downcastWriter.createContainerElement( 'img' );
  41448. * let bar = downcastWriter.createText( 'bar' );
  41449. * let p = downcastWriter.createContainerElement( 'p', null, [ foo, img, bar ] );
  41450. *
  41451. * let range = view.createRange( view.createPositionAt( foo, 2 ), view.createPositionAt( bar, 1 ); // "o", img, "b" are in range.
  41452. * let otherRange = view.createRange( view.createPositionAt( foo, 1 ), view.createPositionAt( p, 2 ); // "oo", img are in range.
  41453. * let transformed = range.getIntersection( otherRange ); // range from ( foo, 1 ) to ( p, 2 ).
  41454. *
  41455. * otherRange = view.createRange( view.createPositionAt( bar, 1 ), view.createPositionAt( bar, 3 ); "ar" is in range.
  41456. * transformed = range.getIntersection( otherRange ); // null - no common part.
  41457. *
  41458. * @param {module:engine/view/range~Range} otherRange Range to check for intersection.
  41459. * @returns {module:engine/view/range~Range|null} A common part of given ranges or `null` if ranges have no common part.
  41460. */
  41461. getIntersection( otherRange ) {
  41462. if ( this.isIntersecting( otherRange ) ) {
  41463. // Ranges intersect, so a common range will be returned.
  41464. // At most, it will be same as this range.
  41465. let commonRangeStart = this.start;
  41466. let commonRangeEnd = this.end;
  41467. if ( this.containsPosition( otherRange.start ) ) {
  41468. // Given range start is inside this range. This means thaNt we have to
  41469. // shrink common range to the given range start.
  41470. commonRangeStart = otherRange.start;
  41471. }
  41472. if ( this.containsPosition( otherRange.end ) ) {
  41473. // Given range end is inside this range. This means that we have to
  41474. // shrink common range to the given range end.
  41475. commonRangeEnd = otherRange.end;
  41476. }
  41477. return new Range( commonRangeStart, commonRangeEnd );
  41478. }
  41479. // Ranges do not intersect, so they do not have common part.
  41480. return null;
  41481. }
  41482. /**
  41483. * Creates a {@link module:engine/view/treewalker~TreeWalker TreeWalker} instance with this range as a boundary.
  41484. *
  41485. * @param {Object} options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}.
  41486. * @param {module:engine/view/position~Position} [options.startPosition]
  41487. * @param {Boolean} [options.singleCharacters=false]
  41488. * @param {Boolean} [options.shallow=false]
  41489. * @param {Boolean} [options.ignoreElementEnd=false]
  41490. * @returns {module:engine/view/treewalker~TreeWalker}
  41491. */
  41492. getWalker( options = {} ) {
  41493. options.boundaries = this;
  41494. return new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( options );
  41495. }
  41496. /**
  41497. * Returns a {@link module:engine/view/node~Node} or {@link module:engine/view/documentfragment~DocumentFragment}
  41498. * which is a common ancestor of range's both ends (in which the entire range is contained).
  41499. *
  41500. * @returns {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment|null}
  41501. */
  41502. getCommonAncestor() {
  41503. return this.start.getCommonAncestor( this.end );
  41504. }
  41505. /**
  41506. * Returns an {@link module:engine/view/element~Element Element} contained by the range.
  41507. * The element will be returned when it is the **only** node within the range and **fully–contained**
  41508. * at the same time.
  41509. *
  41510. * @returns {module:engine/view/element~Element|null}
  41511. */
  41512. getContainedElement() {
  41513. if ( this.isCollapsed ) {
  41514. return null;
  41515. }
  41516. let nodeAfterStart = this.start.nodeAfter;
  41517. let nodeBeforeEnd = this.end.nodeBefore;
  41518. // Handle the situation when the range position is at the beginning / at the end of a text node.
  41519. // In such situation `.nodeAfter` and `.nodeBefore` are `null` but the range still might be spanning
  41520. // over one element.
  41521. //
  41522. // <p>Foo{<span class="widget"></span>}bar</p> vs <p>Foo[<span class="widget"></span>]bar</p>
  41523. //
  41524. // These are basically the same range, only the difference is if the range position is at
  41525. // at the end/at the beginning of a text node or just before/just after the text node.
  41526. //
  41527. if ( this.start.parent.is( '$text' ) && this.start.isAtEnd && this.start.parent.nextSibling ) {
  41528. nodeAfterStart = this.start.parent.nextSibling;
  41529. }
  41530. if ( this.end.parent.is( '$text' ) && this.end.isAtStart && this.end.parent.previousSibling ) {
  41531. nodeBeforeEnd = this.end.parent.previousSibling;
  41532. }
  41533. if ( nodeAfterStart && nodeAfterStart.is( 'element' ) && nodeAfterStart === nodeBeforeEnd ) {
  41534. return nodeAfterStart;
  41535. }
  41536. return null;
  41537. }
  41538. /**
  41539. * Clones this range.
  41540. *
  41541. * @returns {module:engine/view/range~Range}
  41542. */
  41543. clone() {
  41544. return new Range( this.start, this.end );
  41545. }
  41546. /**
  41547. * Returns an iterator that iterates over all {@link module:engine/view/item~Item view items} that are in this range and returns
  41548. * them.
  41549. *
  41550. * This method uses {@link module:engine/view/treewalker~TreeWalker} with `boundaries` set to this range and `ignoreElementEnd` option
  41551. * set to `true`. However it returns only {@link module:engine/view/item~Item items},
  41552. * not {@link module:engine/view/treewalker~TreeWalkerValue}.
  41553. *
  41554. * You may specify additional options for the tree walker. See {@link module:engine/view/treewalker~TreeWalker} for
  41555. * a full list of available options.
  41556. *
  41557. * @param {Object} options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}.
  41558. * @returns {Iterable.<module:engine/view/item~Item>}
  41559. */
  41560. * getItems( options = {} ) {
  41561. options.boundaries = this;
  41562. options.ignoreElementEnd = true;
  41563. const treeWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( options );
  41564. for ( const value of treeWalker ) {
  41565. yield value.item;
  41566. }
  41567. }
  41568. /**
  41569. * Returns an iterator that iterates over all {@link module:engine/view/position~Position positions} that are boundaries or
  41570. * contained in this range.
  41571. *
  41572. * This method uses {@link module:engine/view/treewalker~TreeWalker} with `boundaries` set to this range. However it returns only
  41573. * {@link module:engine/view/position~Position positions}, not {@link module:engine/view/treewalker~TreeWalkerValue}.
  41574. *
  41575. * You may specify additional options for the tree walker. See {@link module:engine/view/treewalker~TreeWalker} for
  41576. * a full list of available options.
  41577. *
  41578. * @param {Object} options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}.
  41579. * @returns {Iterable.<module:engine/view/position~Position>}
  41580. */
  41581. * getPositions( options = {} ) {
  41582. options.boundaries = this;
  41583. const treeWalker = new _treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( options );
  41584. yield treeWalker.position;
  41585. for ( const value of treeWalker ) {
  41586. yield value.nextPosition;
  41587. }
  41588. }
  41589. /**
  41590. * Checks whether this object is of the given type.
  41591. *
  41592. * range.is( 'range' ); // -> true
  41593. * range.is( 'view:range' ); // -> true
  41594. *
  41595. * range.is( 'model:range' ); // -> false
  41596. * range.is( 'element' ); // -> false
  41597. * range.is( 'selection' ); // -> false
  41598. *
  41599. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  41600. *
  41601. * @param {String} type
  41602. * @returns {Boolean}
  41603. */
  41604. is( type ) {
  41605. return type === 'range' || type === 'view:range';
  41606. }
  41607. /**
  41608. * Checks and returns whether this range intersects with the given range.
  41609. *
  41610. * @param {module:engine/view/range~Range} otherRange Range to compare with.
  41611. * @returns {Boolean} True if ranges intersect.
  41612. */
  41613. isIntersecting( otherRange ) {
  41614. return this.start.isBefore( otherRange.end ) && this.end.isAfter( otherRange.start );
  41615. }
  41616. /**
  41617. * Creates a range from the given parents and offsets.
  41618. *
  41619. * @protected
  41620. * @param {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment} startElement Start position
  41621. * parent element.
  41622. * @param {Number} startOffset Start position offset.
  41623. * @param {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment} endElement End position
  41624. * parent element.
  41625. * @param {Number} endOffset End position offset.
  41626. * @returns {module:engine/view/range~Range} Created range.
  41627. */
  41628. static _createFromParentsAndOffsets( startElement, startOffset, endElement, endOffset ) {
  41629. return new this(
  41630. new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( startElement, startOffset ),
  41631. new _position__WEBPACK_IMPORTED_MODULE_0__["default"]( endElement, endOffset )
  41632. );
  41633. }
  41634. /**
  41635. * Creates a new range, spreading from specified {@link module:engine/view/position~Position position} to a position moved by
  41636. * given `shift`. If `shift` is a negative value, shifted position is treated as the beginning of the range.
  41637. *
  41638. * @protected
  41639. * @param {module:engine/view/position~Position} position Beginning of the range.
  41640. * @param {Number} shift How long the range should be.
  41641. * @returns {module:engine/view/range~Range}
  41642. */
  41643. static _createFromPositionAndShift( position, shift ) {
  41644. const start = position;
  41645. const end = position.getShiftedBy( shift );
  41646. return shift > 0 ? new this( start, end ) : new this( end, start );
  41647. }
  41648. /**
  41649. * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of
  41650. * that element and ends after the last child of that element.
  41651. *
  41652. * @protected
  41653. * @param {module:engine/view/element~Element} element Element which is a parent for the range.
  41654. * @returns {module:engine/view/range~Range}
  41655. */
  41656. static _createIn( element ) {
  41657. return this._createFromParentsAndOffsets( element, 0, element, element.childCount );
  41658. }
  41659. /**
  41660. * Creates a range that starts before given {@link module:engine/view/item~Item view item} and ends after it.
  41661. *
  41662. * @protected
  41663. * @param {module:engine/view/item~Item} item
  41664. * @returns {module:engine/view/range~Range}
  41665. */
  41666. static _createOn( item ) {
  41667. const size = item.is( '$textProxy' ) ? item.offsetSize : 1;
  41668. return this._createFromPositionAndShift( _position__WEBPACK_IMPORTED_MODULE_0__["default"]._createBefore( item ), size );
  41669. }
  41670. }
  41671. // Function used by getEnlarged and getTrimmed methods.
  41672. function enlargeTrimSkip( value ) {
  41673. if ( value.item.is( 'attributeElement' ) || value.item.is( 'uiElement' ) ) {
  41674. return true;
  41675. }
  41676. return false;
  41677. }
  41678. /***/ }),
  41679. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/rawelement.js":
  41680. /*!************************************************************************!*\
  41681. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/rawelement.js ***!
  41682. \************************************************************************/
  41683. /*! exports provided: default */
  41684. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41685. "use strict";
  41686. __webpack_require__.r(__webpack_exports__);
  41687. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RawElement; });
  41688. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js");
  41689. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  41690. /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/node.js");
  41691. /**
  41692. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  41693. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  41694. */
  41695. /**
  41696. * @module engine/view/rawelement
  41697. */
  41698. /**
  41699. * The raw element class.
  41700. *
  41701. * The raw elements work as data containers ("wrappers", "sandboxes") but their children are not managed or
  41702. * even recognized by the editor. This encapsulation allows integrations to maintain custom DOM structures
  41703. * in the editor content without, for instance, worrying about compatibility with other editor features.
  41704. * Raw elements are a perfect tool for integration with external frameworks and data sources.
  41705. *
  41706. * Unlike {@link module:engine/view/uielement~UIElement UI elements}, raw elements act like real editor
  41707. * content (similar to {@link module:engine/view/containerelement~ContainerElement} or
  41708. * {@link module:engine/view/emptyelement~EmptyElement}), they are considered by the editor selection and
  41709. * {@link module:widget/utils~toWidget they can work as widgets}.
  41710. *
  41711. * To create a new raw element, use the
  41712. * {@link module:engine/view/downcastwriter~DowncastWriter#createRawElement `downcastWriter#createRawElement()`} method.
  41713. *
  41714. * @extends module:engine/view/element~Element
  41715. */
  41716. class RawElement extends _element__WEBPACK_IMPORTED_MODULE_0__["default"] {
  41717. /**
  41718. * Creates a new instance of a raw element.
  41719. *
  41720. * Throws the `view-rawelement-cannot-add` {@link module:utils/ckeditorerror~CKEditorError CKEditorError} when the `children`
  41721. * parameter is passed to inform that the usage of `RawElement` is incorrect (adding child nodes to `RawElement` is forbidden).
  41722. *
  41723. * @see module:engine/view/downcastwriter~DowncastWriter#createRawElement
  41724. * @protected
  41725. * @param {module:engine/view/document~Document} document The document instance to which this element belongs.
  41726. * @param {String} name A node name.
  41727. * @param {Object|Iterable} [attrs] The collection of attributes.
  41728. * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
  41729. * A list of nodes to be inserted into the created element.
  41730. */
  41731. constructor( document, name, attrs, children ) {
  41732. super( document, name, attrs, children );
  41733. /**
  41734. * Returns `null` because filler is not needed for raw elements.
  41735. *
  41736. * @method #getFillerOffset
  41737. * @returns {null} Always returns null.
  41738. */
  41739. this.getFillerOffset = getFillerOffset;
  41740. }
  41741. /**
  41742. * Checks whether this object is of the given type or name.
  41743. *
  41744. * rawElement.is( 'rawElement' ); // -> true
  41745. * rawElement.is( 'element' ); // -> true
  41746. * rawElement.is( 'node' ); // -> true
  41747. * rawElement.is( 'view:rawElement' ); // -> true
  41748. * rawElement.is( 'view:element' ); // -> true
  41749. * rawElement.is( 'view:node' ); // -> true
  41750. *
  41751. * rawElement.is( 'model:element' ); // -> false
  41752. * rawElement.is( 'documentFragment' ); // -> false
  41753. *
  41754. * Assuming that the object being checked is a raw element, you can also check its
  41755. * {@link module:engine/view/rawelement~RawElement#name name}:
  41756. *
  41757. * rawElement.is( 'img' ); // -> true if this is an img element
  41758. * rawElement.is( 'rawElement', 'img' ); // -> same as above
  41759. * text.is( 'img' ); -> false
  41760. *
  41761. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  41762. *
  41763. * @param {String} type The type to check when the `name` parameter is present.
  41764. * Otherwise, it acts like the `name` parameter.
  41765. * @param {String} [name] The element name.
  41766. * @returns {Boolean}
  41767. */
  41768. is( type, name = null ) {
  41769. if ( !name ) {
  41770. return type === 'rawElement' || type === 'view:rawElement' ||
  41771. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  41772. type === this.name || type === 'view:' + this.name ||
  41773. type === 'element' || type === 'view:element' ||
  41774. type === 'node' || type === 'view:node';
  41775. } else {
  41776. return name === this.name && (
  41777. type === 'rawElement' || type === 'view:rawElement' ||
  41778. type === 'element' || type === 'view:element'
  41779. );
  41780. }
  41781. }
  41782. /**
  41783. * Overrides the {@link module:engine/view/element~Element#_insertChild} method.
  41784. * Throws the `view-rawelement-cannot-add` {@link module:utils/ckeditorerror~CKEditorError CKEditorError} to prevent
  41785. * adding any child nodes to a raw element.
  41786. *
  41787. * @protected
  41788. */
  41789. _insertChild( index, nodes ) {
  41790. if ( nodes && ( nodes instanceof _node__WEBPACK_IMPORTED_MODULE_2__["default"] || Array.from( nodes ).length > 0 ) ) {
  41791. /**
  41792. * Cannot add children to a {@link module:engine/view/rawelement~RawElement} instance.
  41793. *
  41794. * @error view-rawelement-cannot-add
  41795. */
  41796. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
  41797. 'view-rawelement-cannot-add',
  41798. [ this, nodes ]
  41799. );
  41800. }
  41801. }
  41802. /**
  41803. * This allows rendering the children of a {@link module:engine/view/rawelement~RawElement} on the DOM level.
  41804. * This method is called by the {@link module:engine/view/domconverter~DomConverter} with the raw DOM element
  41805. * passed as an argument, leaving the number and shape of the children up to the integrator.
  41806. *
  41807. * This method **must be defined** for the raw element to work:
  41808. *
  41809. * const myRawElement = downcastWriter.createRawElement( 'div' );
  41810. *
  41811. * myRawElement.render = function( domElement ) {
  41812. * domElement.innerHTML = '<b>This is the raw content of myRawElement.</b>';
  41813. * };
  41814. *
  41815. * @method #render
  41816. * @param {HTMLElement} domElement The native DOM element representing the raw view element.
  41817. */
  41818. }
  41819. // Returns `null` because block filler is not needed for raw elements.
  41820. //
  41821. // @returns {null}
  41822. function getFillerOffset() {
  41823. return null;
  41824. }
  41825. /***/ }),
  41826. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/renderer.js":
  41827. /*!**********************************************************************!*\
  41828. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/renderer.js ***!
  41829. \**********************************************************************/
  41830. /*! exports provided: default */
  41831. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  41832. "use strict";
  41833. __webpack_require__.r(__webpack_exports__);
  41834. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Renderer; });
  41835. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js");
  41836. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
  41837. /* harmony import */ var _filler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./filler */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/filler.js");
  41838. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  41839. /* harmony import */ var _ckeditor_ckeditor5_utils_src_diff__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/diff */ "./node_modules/@ckeditor/ckeditor5-utils/src/diff.js");
  41840. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_insertat__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/insertat */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/insertat.js");
  41841. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_remove__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/remove */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/remove.js");
  41842. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  41843. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  41844. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/istext */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/istext.js");
  41845. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_isnode__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/isnode */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/isnode.js");
  41846. /* harmony import */ var _ckeditor_ckeditor5_utils_src_fastdiff__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/fastdiff */ "./node_modules/@ckeditor/ckeditor5-utils/src/fastdiff.js");
  41847. /* harmony import */ var _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/env */ "./node_modules/@ckeditor/ckeditor5-utils/src/env.js");
  41848. /**
  41849. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  41850. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  41851. */
  41852. /* globals Node */
  41853. /**
  41854. * @module engine/view/renderer
  41855. */
  41856. /**
  41857. * Renderer is responsible for updating the DOM structure and the DOM selection based on
  41858. * the {@link module:engine/view/renderer~Renderer#markToSync information about updated view nodes}.
  41859. * In other words, it renders the view to the DOM.
  41860. *
  41861. * Its main responsibility is to make only the necessary, minimal changes to the DOM. However, unlike in many
  41862. * virtual DOM implementations, the primary reason for doing minimal changes is not the performance but ensuring
  41863. * that native editing features such as text composition, autocompletion, spell checking, selection's x-index are
  41864. * affected as little as possible.
  41865. *
  41866. * Renderer uses {@link module:engine/view/domconverter~DomConverter} to transform view nodes and positions
  41867. * to and from the DOM.
  41868. */
  41869. class Renderer {
  41870. /**
  41871. * Creates a renderer instance.
  41872. *
  41873. * @param {module:engine/view/domconverter~DomConverter} domConverter Converter instance.
  41874. * @param {module:engine/view/documentselection~DocumentSelection} selection View selection.
  41875. */
  41876. constructor( domConverter, selection ) {
  41877. /**
  41878. * Set of DOM Documents instances.
  41879. *
  41880. * @readonly
  41881. * @member {Set.<Document>}
  41882. */
  41883. this.domDocuments = new Set();
  41884. /**
  41885. * Converter instance.
  41886. *
  41887. * @readonly
  41888. * @member {module:engine/view/domconverter~DomConverter}
  41889. */
  41890. this.domConverter = domConverter;
  41891. /**
  41892. * Set of nodes which attributes changed and may need to be rendered.
  41893. *
  41894. * @readonly
  41895. * @member {Set.<module:engine/view/node~Node>}
  41896. */
  41897. this.markedAttributes = new Set();
  41898. /**
  41899. * Set of elements which child lists changed and may need to be rendered.
  41900. *
  41901. * @readonly
  41902. * @member {Set.<module:engine/view/node~Node>}
  41903. */
  41904. this.markedChildren = new Set();
  41905. /**
  41906. * Set of text nodes which text data changed and may need to be rendered.
  41907. *
  41908. * @readonly
  41909. * @member {Set.<module:engine/view/node~Node>}
  41910. */
  41911. this.markedTexts = new Set();
  41912. /**
  41913. * View selection. Renderer updates DOM selection based on the view selection.
  41914. *
  41915. * @readonly
  41916. * @member {module:engine/view/documentselection~DocumentSelection}
  41917. */
  41918. this.selection = selection;
  41919. /**
  41920. * Indicates if the view document is focused and selection can be rendered. Selection will not be rendered if
  41921. * this is set to `false`.
  41922. *
  41923. * @member {Boolean}
  41924. */
  41925. this.isFocused = false;
  41926. /**
  41927. * The text node in which the inline filler was rendered.
  41928. *
  41929. * @private
  41930. * @member {Text}
  41931. */
  41932. this._inlineFiller = null;
  41933. /**
  41934. * DOM element containing fake selection.
  41935. *
  41936. * @private
  41937. * @type {null|HTMLElement}
  41938. */
  41939. this._fakeSelectionContainer = null;
  41940. }
  41941. /**
  41942. * Marks a view node to be updated in the DOM by {@link #render `render()`}.
  41943. *
  41944. * Note that only view nodes whose parents have corresponding DOM elements need to be marked to be synchronized.
  41945. *
  41946. * @see #markedAttributes
  41947. * @see #markedChildren
  41948. * @see #markedTexts
  41949. *
  41950. * @param {module:engine/view/document~ChangeType} type Type of the change.
  41951. * @param {module:engine/view/node~Node} node Node to be marked.
  41952. */
  41953. markToSync( type, node ) {
  41954. if ( type === 'text' ) {
  41955. if ( this.domConverter.mapViewToDom( node.parent ) ) {
  41956. this.markedTexts.add( node );
  41957. }
  41958. } else {
  41959. // If the node has no DOM element it is not rendered yet,
  41960. // its children/attributes do not need to be marked to be sync.
  41961. if ( !this.domConverter.mapViewToDom( node ) ) {
  41962. return;
  41963. }
  41964. if ( type === 'attributes' ) {
  41965. this.markedAttributes.add( node );
  41966. } else if ( type === 'children' ) {
  41967. this.markedChildren.add( node );
  41968. } else {
  41969. /**
  41970. * Unknown type passed to Renderer.markToSync.
  41971. *
  41972. * @error view-renderer-unknown-type
  41973. */
  41974. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-renderer-unknown-type', this );
  41975. }
  41976. }
  41977. }
  41978. /**
  41979. * Renders all buffered changes ({@link #markedAttributes}, {@link #markedChildren} and {@link #markedTexts}) and
  41980. * the current view selection (if needed) to the DOM by applying a minimal set of changes to it.
  41981. *
  41982. * Renderer tries not to break the text composition (e.g. IME) and x-index of the selection,
  41983. * so it does as little as it is needed to update the DOM.
  41984. *
  41985. * Renderer also handles {@link module:engine/view/filler fillers}. Especially, it checks if the inline filler is needed
  41986. * at the selection position and adds or removes it. To prevent breaking text composition inline filler will not be
  41987. * removed as long as the selection is in the text node which needed it at first.
  41988. */
  41989. render() {
  41990. let inlineFillerPosition;
  41991. // Refresh mappings.
  41992. for ( const element of this.markedChildren ) {
  41993. this._updateChildrenMappings( element );
  41994. }
  41995. // There was inline filler rendered in the DOM but it's not
  41996. // at the selection position any more, so we can remove it
  41997. // (cause even if it's needed, it must be placed in another location).
  41998. if ( this._inlineFiller && !this._isSelectionInInlineFiller() ) {
  41999. this._removeInlineFiller();
  42000. }
  42001. // If we've got the filler, let's try to guess its position in the view.
  42002. if ( this._inlineFiller ) {
  42003. inlineFillerPosition = this._getInlineFillerPosition();
  42004. }
  42005. // Otherwise, if it's needed, create it at the selection position.
  42006. else if ( this._needsInlineFillerAtSelection() ) {
  42007. inlineFillerPosition = this.selection.getFirstPosition();
  42008. // Do not use `markToSync` so it will be added even if the parent is already added.
  42009. this.markedChildren.add( inlineFillerPosition.parent );
  42010. }
  42011. for ( const element of this.markedAttributes ) {
  42012. this._updateAttrs( element );
  42013. }
  42014. for ( const element of this.markedChildren ) {
  42015. this._updateChildren( element, { inlineFillerPosition } );
  42016. }
  42017. for ( const node of this.markedTexts ) {
  42018. if ( !this.markedChildren.has( node.parent ) && this.domConverter.mapViewToDom( node.parent ) ) {
  42019. this._updateText( node, { inlineFillerPosition } );
  42020. }
  42021. }
  42022. // Check whether the inline filler is required and where it really is in the DOM.
  42023. // At this point in most cases it will be in the DOM, but there are exceptions.
  42024. // For example, if the inline filler was deep in the created DOM structure, it will not be created.
  42025. // Similarly, if it was removed at the beginning of this function and then neither text nor children were updated,
  42026. // it will not be present.
  42027. // Fix those and similar scenarios.
  42028. if ( inlineFillerPosition ) {
  42029. const fillerDomPosition = this.domConverter.viewPositionToDom( inlineFillerPosition );
  42030. const domDocument = fillerDomPosition.parent.ownerDocument;
  42031. if ( !Object(_filler__WEBPACK_IMPORTED_MODULE_2__["startsWithFiller"])( fillerDomPosition.parent ) ) {
  42032. // Filler has not been created at filler position. Create it now.
  42033. this._inlineFiller = addInlineFiller( domDocument, fillerDomPosition.parent, fillerDomPosition.offset );
  42034. } else {
  42035. // Filler has been found, save it.
  42036. this._inlineFiller = fillerDomPosition.parent;
  42037. }
  42038. } else {
  42039. // There is no filler needed.
  42040. this._inlineFiller = null;
  42041. }
  42042. this._updateSelection();
  42043. this._updateFocus();
  42044. this.markedTexts.clear();
  42045. this.markedAttributes.clear();
  42046. this.markedChildren.clear();
  42047. }
  42048. /**
  42049. * Updates mappings of view element's children.
  42050. *
  42051. * Children that were replaced in the view structure by similar elements (same tag name) are treated as 'replaced'.
  42052. * This means that their mappings can be updated so the new view elements are mapped to the existing DOM elements.
  42053. * Thanks to that these elements do not need to be re-rendered completely.
  42054. *
  42055. * @private
  42056. * @param {module:engine/view/node~Node} viewElement The view element whose children mappings will be updated.
  42057. */
  42058. _updateChildrenMappings( viewElement ) {
  42059. const domElement = this.domConverter.mapViewToDom( viewElement );
  42060. if ( !domElement ) {
  42061. // If there is no `domElement` it means that it was already removed from DOM and there is no need to process it.
  42062. return;
  42063. }
  42064. const actualDomChildren = this.domConverter.mapViewToDom( viewElement ).childNodes;
  42065. const expectedDomChildren = Array.from(
  42066. this.domConverter.viewChildrenToDom( viewElement, domElement.ownerDocument, { withChildren: false } )
  42067. );
  42068. const diff = this._diffNodeLists( actualDomChildren, expectedDomChildren );
  42069. const actions = this._findReplaceActions( diff, actualDomChildren, expectedDomChildren );
  42070. if ( actions.indexOf( 'replace' ) !== -1 ) {
  42071. const counter = { equal: 0, insert: 0, delete: 0 };
  42072. for ( const action of actions ) {
  42073. if ( action === 'replace' ) {
  42074. const insertIndex = counter.equal + counter.insert;
  42075. const deleteIndex = counter.equal + counter.delete;
  42076. const viewChild = viewElement.getChild( insertIndex );
  42077. // UIElement and RawElement are special cases. Their children are not stored in a view (#799)
  42078. // so we cannot use them with replacing flow (since they use view children during rendering
  42079. // which will always result in rendering empty elements).
  42080. if ( viewChild && !( viewChild.is( 'uiElement' ) || viewChild.is( 'rawElement' ) ) ) {
  42081. this._updateElementMappings( viewChild, actualDomChildren[ deleteIndex ] );
  42082. }
  42083. Object(_ckeditor_ckeditor5_utils_src_dom_remove__WEBPACK_IMPORTED_MODULE_6__["default"])( expectedDomChildren[ insertIndex ] );
  42084. counter.equal++;
  42085. } else {
  42086. counter[ action ]++;
  42087. }
  42088. }
  42089. }
  42090. }
  42091. /**
  42092. * Updates mappings of a given view element.
  42093. *
  42094. * @private
  42095. * @param {module:engine/view/node~Node} viewElement The view element whose mappings will be updated.
  42096. * @param {Node} domElement The DOM element representing the given view element.
  42097. */
  42098. _updateElementMappings( viewElement, domElement ) {
  42099. // Remap 'DomConverter' bindings.
  42100. this.domConverter.unbindDomElement( domElement );
  42101. this.domConverter.bindElements( domElement, viewElement );
  42102. // View element may have children which needs to be updated, but are not marked, mark them to update.
  42103. this.markedChildren.add( viewElement );
  42104. // Because we replace new view element mapping with the existing one, the corresponding DOM element
  42105. // will not be rerendered. The new view element may have different attributes than the previous one.
  42106. // Since its corresponding DOM element will not be rerendered, new attributes will not be added
  42107. // to the DOM, so we need to mark it here to make sure its attributes gets updated. See #1427 for more
  42108. // detailed case study.
  42109. // Also there are cases where replaced element is removed from the view structure and then has
  42110. // its attributes changed or removed. In such cases the element will not be present in `markedAttributes`
  42111. // and also may be the same (`element.isSimilar()`) as the reused element not having its attributes updated.
  42112. // To prevent such situations we always mark reused element to have its attributes rerenderd (#1560).
  42113. this.markedAttributes.add( viewElement );
  42114. }
  42115. /**
  42116. * Gets the position of the inline filler based on the current selection.
  42117. * Here, we assume that we know that the filler is needed and
  42118. * {@link #_isSelectionInInlineFiller is at the selection position}, and, since it is needed,
  42119. * it is somewhere at the selection position.
  42120. *
  42121. * Note: The filler position cannot be restored based on the filler's DOM text node, because
  42122. * when this method is called (before rendering), the bindings will often be broken. View-to-DOM
  42123. * bindings are only dependable after rendering.
  42124. *
  42125. * @private
  42126. * @returns {module:engine/view/position~Position}
  42127. */
  42128. _getInlineFillerPosition() {
  42129. const firstPos = this.selection.getFirstPosition();
  42130. if ( firstPos.parent.is( '$text' ) ) {
  42131. return _position__WEBPACK_IMPORTED_MODULE_1__["default"]._createBefore( this.selection.getFirstPosition().parent );
  42132. } else {
  42133. return firstPos;
  42134. }
  42135. }
  42136. /**
  42137. * Returns `true` if the selection has not left the inline filler's text node.
  42138. * If it is `true`, it means that the filler had been added for a reason and the selection did not
  42139. * leave the filler's text node. For example, the user can be in the middle of a composition so it should not be touched.
  42140. *
  42141. * @private
  42142. * @returns {Boolean} `true` if the inline filler and selection are in the same place.
  42143. */
  42144. _isSelectionInInlineFiller() {
  42145. if ( this.selection.rangeCount != 1 || !this.selection.isCollapsed ) {
  42146. return false;
  42147. }
  42148. // Note, we can't check if selection's position equals position of the
  42149. // this._inlineFiller node, because of #663. We may not be able to calculate
  42150. // the filler's position in the view at this stage.
  42151. // Instead, we check it the other way – whether selection is anchored in
  42152. // that text node or next to it.
  42153. // Possible options are:
  42154. // "FILLER{}"
  42155. // "FILLERadded-text{}"
  42156. const selectionPosition = this.selection.getFirstPosition();
  42157. const position = this.domConverter.viewPositionToDom( selectionPosition );
  42158. if ( position && Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_9__["default"])( position.parent ) && Object(_filler__WEBPACK_IMPORTED_MODULE_2__["startsWithFiller"])( position.parent ) ) {
  42159. return true;
  42160. }
  42161. return false;
  42162. }
  42163. /**
  42164. * Removes the inline filler.
  42165. *
  42166. * @private
  42167. */
  42168. _removeInlineFiller() {
  42169. const domFillerNode = this._inlineFiller;
  42170. // Something weird happened and the stored node doesn't contain the filler's text.
  42171. if ( !Object(_filler__WEBPACK_IMPORTED_MODULE_2__["startsWithFiller"])( domFillerNode ) ) {
  42172. /**
  42173. * The inline filler node was lost. Most likely, something overwrote the filler text node
  42174. * in the DOM.
  42175. *
  42176. * @error view-renderer-filler-was-lost
  42177. */
  42178. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_8__["default"]( 'view-renderer-filler-was-lost', this );
  42179. }
  42180. if ( Object(_filler__WEBPACK_IMPORTED_MODULE_2__["isInlineFiller"])( domFillerNode ) ) {
  42181. domFillerNode.parentNode.removeChild( domFillerNode );
  42182. } else {
  42183. domFillerNode.data = domFillerNode.data.substr( _filler__WEBPACK_IMPORTED_MODULE_2__["INLINE_FILLER_LENGTH"] );
  42184. }
  42185. this._inlineFiller = null;
  42186. }
  42187. /**
  42188. * Checks if the inline {@link module:engine/view/filler filler} should be added.
  42189. *
  42190. * @private
  42191. * @returns {Boolean} `true` if the inline filler should be added.
  42192. */
  42193. _needsInlineFillerAtSelection() {
  42194. if ( this.selection.rangeCount != 1 || !this.selection.isCollapsed ) {
  42195. return false;
  42196. }
  42197. const selectionPosition = this.selection.getFirstPosition();
  42198. const selectionParent = selectionPosition.parent;
  42199. const selectionOffset = selectionPosition.offset;
  42200. // If there is no DOM root we do not care about fillers.
  42201. if ( !this.domConverter.mapViewToDom( selectionParent.root ) ) {
  42202. return false;
  42203. }
  42204. if ( !( selectionParent.is( 'element' ) ) ) {
  42205. return false;
  42206. }
  42207. // Prevent adding inline filler inside elements with contenteditable=false.
  42208. // https://github.com/ckeditor/ckeditor5-engine/issues/1170
  42209. if ( !isEditable( selectionParent ) ) {
  42210. return false;
  42211. }
  42212. // We have block filler, we do not need inline one.
  42213. if ( selectionOffset === selectionParent.getFillerOffset() ) {
  42214. return false;
  42215. }
  42216. const nodeBefore = selectionPosition.nodeBefore;
  42217. const nodeAfter = selectionPosition.nodeAfter;
  42218. if ( nodeBefore instanceof _text__WEBPACK_IMPORTED_MODULE_0__["default"] || nodeAfter instanceof _text__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  42219. return false;
  42220. }
  42221. return true;
  42222. }
  42223. /**
  42224. * Checks if text needs to be updated and possibly updates it.
  42225. *
  42226. * @private
  42227. * @param {module:engine/view/text~Text} viewText View text to update.
  42228. * @param {Object} options
  42229. * @param {module:engine/view/position~Position} options.inlineFillerPosition The position where the inline
  42230. * filler should be rendered.
  42231. */
  42232. _updateText( viewText, options ) {
  42233. const domText = this.domConverter.findCorrespondingDomText( viewText );
  42234. const newDomText = this.domConverter.viewToDom( viewText, domText.ownerDocument );
  42235. const actualText = domText.data;
  42236. let expectedText = newDomText.data;
  42237. const filler = options.inlineFillerPosition;
  42238. if ( filler && filler.parent == viewText.parent && filler.offset == viewText.index ) {
  42239. expectedText = _filler__WEBPACK_IMPORTED_MODULE_2__["INLINE_FILLER"] + expectedText;
  42240. }
  42241. if ( actualText != expectedText ) {
  42242. const actions = Object(_ckeditor_ckeditor5_utils_src_fastdiff__WEBPACK_IMPORTED_MODULE_11__["default"])( actualText, expectedText );
  42243. for ( const action of actions ) {
  42244. if ( action.type === 'insert' ) {
  42245. domText.insertData( action.index, action.values.join( '' ) );
  42246. } else { // 'delete'
  42247. domText.deleteData( action.index, action.howMany );
  42248. }
  42249. }
  42250. }
  42251. }
  42252. /**
  42253. * Checks if attribute list needs to be updated and possibly updates it.
  42254. *
  42255. * @private
  42256. * @param {module:engine/view/element~Element} viewElement The view element to update.
  42257. */
  42258. _updateAttrs( viewElement ) {
  42259. const domElement = this.domConverter.mapViewToDom( viewElement );
  42260. if ( !domElement ) {
  42261. // If there is no `domElement` it means that 'viewElement' is outdated as its mapping was updated
  42262. // in 'this._updateChildrenMappings()'. There is no need to process it as new view element which
  42263. // replaced old 'viewElement' mapping was also added to 'this.markedAttributes'
  42264. // in 'this._updateChildrenMappings()' so it will be processed separately.
  42265. return;
  42266. }
  42267. const domAttrKeys = Array.from( domElement.attributes ).map( attr => attr.name );
  42268. const viewAttrKeys = viewElement.getAttributeKeys();
  42269. // Add or overwrite attributes.
  42270. for ( const key of viewAttrKeys ) {
  42271. domElement.setAttribute( key, viewElement.getAttribute( key ) );
  42272. }
  42273. // Remove from DOM attributes which do not exists in the view.
  42274. for ( const key of domAttrKeys ) {
  42275. if ( !viewElement.hasAttribute( key ) ) {
  42276. domElement.removeAttribute( key );
  42277. }
  42278. }
  42279. }
  42280. /**
  42281. * Checks if elements child list needs to be updated and possibly updates it.
  42282. *
  42283. * @private
  42284. * @param {module:engine/view/element~Element} viewElement View element to update.
  42285. * @param {Object} options
  42286. * @param {module:engine/view/position~Position} options.inlineFillerPosition The position where the inline
  42287. * filler should be rendered.
  42288. */
  42289. _updateChildren( viewElement, options ) {
  42290. const domElement = this.domConverter.mapViewToDom( viewElement );
  42291. if ( !domElement ) {
  42292. // If there is no `domElement` it means that it was already removed from DOM.
  42293. // There is no need to process it. It will be processed when re-inserted.
  42294. return;
  42295. }
  42296. const inlineFillerPosition = options.inlineFillerPosition;
  42297. const actualDomChildren = this.domConverter.mapViewToDom( viewElement ).childNodes;
  42298. const expectedDomChildren = Array.from(
  42299. this.domConverter.viewChildrenToDom( viewElement, domElement.ownerDocument, { bind: true, inlineFillerPosition } )
  42300. );
  42301. // Inline filler element has to be created as it is present in the DOM, but not in the view. It is required
  42302. // during diffing so text nodes could be compared correctly and also during rendering to maintain
  42303. // proper order and indexes while updating the DOM.
  42304. if ( inlineFillerPosition && inlineFillerPosition.parent === viewElement ) {
  42305. addInlineFiller( domElement.ownerDocument, expectedDomChildren, inlineFillerPosition.offset );
  42306. }
  42307. const diff = this._diffNodeLists( actualDomChildren, expectedDomChildren );
  42308. let i = 0;
  42309. const nodesToUnbind = new Set();
  42310. // Handle deletions first.
  42311. // This is to prevent a situation where an element that already exists in `actualDomChildren` is inserted at a different
  42312. // index in `actualDomChildren`. Since `actualDomChildren` is a `NodeList`, this works like move, not like an insert,
  42313. // and it disrupts the whole algorithm. See https://github.com/ckeditor/ckeditor5/issues/6367.
  42314. //
  42315. // It doesn't matter in what order we remove or add nodes, as long as we remove and add correct nodes at correct indexes.
  42316. for ( const action of diff ) {
  42317. if ( action === 'delete' ) {
  42318. nodesToUnbind.add( actualDomChildren[ i ] );
  42319. Object(_ckeditor_ckeditor5_utils_src_dom_remove__WEBPACK_IMPORTED_MODULE_6__["default"])( actualDomChildren[ i ] );
  42320. } else if ( action === 'equal' ) {
  42321. i++;
  42322. }
  42323. }
  42324. i = 0;
  42325. for ( const action of diff ) {
  42326. if ( action === 'insert' ) {
  42327. Object(_ckeditor_ckeditor5_utils_src_dom_insertat__WEBPACK_IMPORTED_MODULE_5__["default"])( domElement, i, expectedDomChildren[ i ] );
  42328. i++;
  42329. } else if ( action === 'equal' ) {
  42330. // Force updating text nodes inside elements which did not change and do not need to be re-rendered (#1125).
  42331. // Do it here (not in the loop above) because only after insertions the `i` index is correct.
  42332. this._markDescendantTextToSync( this.domConverter.domToView( expectedDomChildren[ i ] ) );
  42333. i++;
  42334. }
  42335. }
  42336. // Unbind removed nodes. When node does not have a parent it means that it was removed from DOM tree during
  42337. // comparison with the expected DOM. We don't need to check child nodes, because if child node was reinserted,
  42338. // it was moved to DOM tree out of the removed node.
  42339. for ( const node of nodesToUnbind ) {
  42340. if ( !node.parentNode ) {
  42341. this.domConverter.unbindDomElement( node );
  42342. }
  42343. }
  42344. }
  42345. /**
  42346. * Shorthand for diffing two arrays or node lists of DOM nodes.
  42347. *
  42348. * @private
  42349. * @param {Array.<Node>|NodeList} actualDomChildren Actual DOM children
  42350. * @param {Array.<Node>|NodeList} expectedDomChildren Expected DOM children.
  42351. * @returns {Array.<String>} The list of actions based on the {@link module:utils/diff~diff} function.
  42352. */
  42353. _diffNodeLists( actualDomChildren, expectedDomChildren ) {
  42354. actualDomChildren = filterOutFakeSelectionContainer( actualDomChildren, this._fakeSelectionContainer );
  42355. return Object(_ckeditor_ckeditor5_utils_src_diff__WEBPACK_IMPORTED_MODULE_4__["default"])( actualDomChildren, expectedDomChildren, sameNodes.bind( null, this.domConverter ) );
  42356. }
  42357. /**
  42358. * Finds DOM nodes that were replaced with the similar nodes (same tag name) in the view. All nodes are compared
  42359. * within one `insert`/`delete` action group, for example:
  42360. *
  42361. * Actual DOM: <p><b>Foo</b>Bar<i>Baz</i><b>Bax</b></p>
  42362. * Expected DOM: <p>Bar<b>123</b><i>Baz</i><b>456</b></p>
  42363. * Input actions: [ insert, insert, delete, delete, equal, insert, delete ]
  42364. * Output actions: [ insert, replace, delete, equal, replace ]
  42365. *
  42366. * @private
  42367. * @param {Array.<String>} actions Actions array which is a result of the {@link module:utils/diff~diff} function.
  42368. * @param {Array.<Node>|NodeList} actualDom Actual DOM children
  42369. * @param {Array.<Node>} expectedDom Expected DOM children.
  42370. * @returns {Array.<String>} Actions array modified with the `replace` actions.
  42371. */
  42372. _findReplaceActions( actions, actualDom, expectedDom ) {
  42373. // If there is no both 'insert' and 'delete' actions, no need to check for replaced elements.
  42374. if ( actions.indexOf( 'insert' ) === -1 || actions.indexOf( 'delete' ) === -1 ) {
  42375. return actions;
  42376. }
  42377. let newActions = [];
  42378. let actualSlice = [];
  42379. let expectedSlice = [];
  42380. const counter = { equal: 0, insert: 0, delete: 0 };
  42381. for ( const action of actions ) {
  42382. if ( action === 'insert' ) {
  42383. expectedSlice.push( expectedDom[ counter.equal + counter.insert ] );
  42384. } else if ( action === 'delete' ) {
  42385. actualSlice.push( actualDom[ counter.equal + counter.delete ] );
  42386. } else { // equal
  42387. newActions = newActions.concat( Object(_ckeditor_ckeditor5_utils_src_diff__WEBPACK_IMPORTED_MODULE_4__["default"])( actualSlice, expectedSlice, areSimilar ).map( x => x === 'equal' ? 'replace' : x ) );
  42388. newActions.push( 'equal' );
  42389. // Reset stored elements on 'equal'.
  42390. actualSlice = [];
  42391. expectedSlice = [];
  42392. }
  42393. counter[ action ]++;
  42394. }
  42395. return newActions.concat( Object(_ckeditor_ckeditor5_utils_src_diff__WEBPACK_IMPORTED_MODULE_4__["default"])( actualSlice, expectedSlice, areSimilar ).map( x => x === 'equal' ? 'replace' : x ) );
  42396. }
  42397. /**
  42398. * Marks text nodes to be synchronized.
  42399. *
  42400. * If a text node is passed, it will be marked. If an element is passed, all descendant text nodes inside it will be marked.
  42401. *
  42402. * @private
  42403. * @param {module:engine/view/node~Node} viewNode View node to sync.
  42404. */
  42405. _markDescendantTextToSync( viewNode ) {
  42406. if ( !viewNode ) {
  42407. return;
  42408. }
  42409. if ( viewNode.is( '$text' ) ) {
  42410. this.markedTexts.add( viewNode );
  42411. } else if ( viewNode.is( 'element' ) ) {
  42412. for ( const child of viewNode.getChildren() ) {
  42413. this._markDescendantTextToSync( child );
  42414. }
  42415. }
  42416. }
  42417. /**
  42418. * Checks if the selection needs to be updated and possibly updates it.
  42419. *
  42420. * @private
  42421. */
  42422. _updateSelection() {
  42423. // If there is no selection - remove DOM and fake selections.
  42424. if ( this.selection.rangeCount === 0 ) {
  42425. this._removeDomSelection();
  42426. this._removeFakeSelection();
  42427. return;
  42428. }
  42429. const domRoot = this.domConverter.mapViewToDom( this.selection.editableElement );
  42430. // Do nothing if there is no focus, or there is no DOM element corresponding to selection's editable element.
  42431. if ( !this.isFocused || !domRoot ) {
  42432. return;
  42433. }
  42434. // Render selection.
  42435. if ( this.selection.isFake ) {
  42436. this._updateFakeSelection( domRoot );
  42437. } else {
  42438. this._removeFakeSelection();
  42439. this._updateDomSelection( domRoot );
  42440. }
  42441. }
  42442. /**
  42443. * Updates the fake selection.
  42444. *
  42445. * @private
  42446. * @param {HTMLElement} domRoot A valid DOM root where the fake selection container should be added.
  42447. */
  42448. _updateFakeSelection( domRoot ) {
  42449. const domDocument = domRoot.ownerDocument;
  42450. if ( !this._fakeSelectionContainer ) {
  42451. this._fakeSelectionContainer = createFakeSelectionContainer( domDocument );
  42452. }
  42453. const container = this._fakeSelectionContainer;
  42454. // Bind fake selection container with the current selection *position*.
  42455. this.domConverter.bindFakeSelection( container, this.selection );
  42456. if ( !this._fakeSelectionNeedsUpdate( domRoot ) ) {
  42457. return;
  42458. }
  42459. if ( !container.parentElement || container.parentElement != domRoot ) {
  42460. domRoot.appendChild( container );
  42461. }
  42462. container.textContent = this.selection.fakeSelectionLabel || '\u00A0';
  42463. const domSelection = domDocument.getSelection();
  42464. const domRange = domDocument.createRange();
  42465. domSelection.removeAllRanges();
  42466. domRange.selectNodeContents( container );
  42467. domSelection.addRange( domRange );
  42468. }
  42469. /**
  42470. * Updates the DOM selection.
  42471. *
  42472. * @private
  42473. * @param {HTMLElement} domRoot A valid DOM root where the DOM selection should be rendered.
  42474. */
  42475. _updateDomSelection( domRoot ) {
  42476. const domSelection = domRoot.ownerDocument.defaultView.getSelection();
  42477. // Let's check whether DOM selection needs updating at all.
  42478. if ( !this._domSelectionNeedsUpdate( domSelection ) ) {
  42479. return;
  42480. }
  42481. // Multi-range selection is not available in most browsers, and, at least in Chrome, trying to
  42482. // set such selection, that is not continuous, throws an error. Because of that, we will just use anchor
  42483. // and focus of view selection.
  42484. // Since we are not supporting multi-range selection, we also do not need to check if proper editable is
  42485. // selected. If there is any editable selected, it is okay (editable is taken from selection anchor).
  42486. const anchor = this.domConverter.viewPositionToDom( this.selection.anchor );
  42487. const focus = this.domConverter.viewPositionToDom( this.selection.focus );
  42488. // Focus the new editing host.
  42489. // Otherwise, FF may throw an error (https://github.com/ckeditor/ckeditor5/issues/721).
  42490. domRoot.focus();
  42491. domSelection.collapse( anchor.parent, anchor.offset );
  42492. domSelection.extend( focus.parent, focus.offset );
  42493. // Firefox–specific hack (https://github.com/ckeditor/ckeditor5-engine/issues/1439).
  42494. if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_12__["default"].isGecko ) {
  42495. fixGeckoSelectionAfterBr( focus, domSelection );
  42496. }
  42497. }
  42498. /**
  42499. * Checks whether a given DOM selection needs to be updated.
  42500. *
  42501. * @private
  42502. * @param {Selection} domSelection The DOM selection to check.
  42503. * @returns {Boolean}
  42504. */
  42505. _domSelectionNeedsUpdate( domSelection ) {
  42506. if ( !this.domConverter.isDomSelectionCorrect( domSelection ) ) {
  42507. // Current DOM selection is in incorrect position. We need to update it.
  42508. return true;
  42509. }
  42510. const oldViewSelection = domSelection && this.domConverter.domSelectionToView( domSelection );
  42511. if ( oldViewSelection && this.selection.isEqual( oldViewSelection ) ) {
  42512. return false;
  42513. }
  42514. // If selection is not collapsed, it does not need to be updated if it is similar.
  42515. if ( !this.selection.isCollapsed && this.selection.isSimilar( oldViewSelection ) ) {
  42516. // Selection did not changed and is correct, do not update.
  42517. return false;
  42518. }
  42519. // Selections are not similar.
  42520. return true;
  42521. }
  42522. /**
  42523. * Checks whether the fake selection needs to be updated.
  42524. *
  42525. * @private
  42526. * @param {HTMLElement} domRoot A valid DOM root where a new fake selection container should be added.
  42527. * @returns {Boolean}
  42528. */
  42529. _fakeSelectionNeedsUpdate( domRoot ) {
  42530. const container = this._fakeSelectionContainer;
  42531. const domSelection = domRoot.ownerDocument.getSelection();
  42532. // Fake selection needs to be updated if there's no fake selection container, or the container currently sits
  42533. // in a different root.
  42534. if ( !container || container.parentElement !== domRoot ) {
  42535. return true;
  42536. }
  42537. // Make sure that the selection actually is within the fake selection.
  42538. if ( domSelection.anchorNode !== container && !container.contains( domSelection.anchorNode ) ) {
  42539. return true;
  42540. }
  42541. return container.textContent !== this.selection.fakeSelectionLabel;
  42542. }
  42543. /**
  42544. * Removes the DOM selection.
  42545. *
  42546. * @private
  42547. */
  42548. _removeDomSelection() {
  42549. for ( const doc of this.domDocuments ) {
  42550. const domSelection = doc.getSelection();
  42551. if ( domSelection.rangeCount ) {
  42552. const activeDomElement = doc.activeElement;
  42553. const viewElement = this.domConverter.mapDomToView( activeDomElement );
  42554. if ( activeDomElement && viewElement ) {
  42555. doc.getSelection().removeAllRanges();
  42556. }
  42557. }
  42558. }
  42559. }
  42560. /**
  42561. * Removes the fake selection.
  42562. *
  42563. * @private
  42564. */
  42565. _removeFakeSelection() {
  42566. const container = this._fakeSelectionContainer;
  42567. if ( container ) {
  42568. container.remove();
  42569. }
  42570. }
  42571. /**
  42572. * Checks if focus needs to be updated and possibly updates it.
  42573. *
  42574. * @private
  42575. */
  42576. _updateFocus() {
  42577. if ( this.isFocused ) {
  42578. const editable = this.selection.editableElement;
  42579. if ( editable ) {
  42580. this.domConverter.focus( editable );
  42581. }
  42582. }
  42583. }
  42584. }
  42585. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_3__["default"])( Renderer, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_7__["default"] );
  42586. // Checks if provided element is editable.
  42587. //
  42588. // @private
  42589. // @param {module:engine/view/element~Element} element
  42590. // @returns {Boolean}
  42591. function isEditable( element ) {
  42592. if ( element.getAttribute( 'contenteditable' ) == 'false' ) {
  42593. return false;
  42594. }
  42595. const parent = element.findAncestor( element => element.hasAttribute( 'contenteditable' ) );
  42596. return !parent || parent.getAttribute( 'contenteditable' ) == 'true';
  42597. }
  42598. // Adds inline filler at a given position.
  42599. //
  42600. // The position can be given as an array of DOM nodes and an offset in that array,
  42601. // or a DOM parent element and an offset in that element.
  42602. //
  42603. // @private
  42604. // @param {Document} domDocument
  42605. // @param {Element|Array.<Node>} domParentOrArray
  42606. // @param {Number} offset
  42607. // @returns {Text} The DOM text node that contains an inline filler.
  42608. function addInlineFiller( domDocument, domParentOrArray, offset ) {
  42609. const childNodes = domParentOrArray instanceof Array ? domParentOrArray : domParentOrArray.childNodes;
  42610. const nodeAfterFiller = childNodes[ offset ];
  42611. if ( Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_9__["default"])( nodeAfterFiller ) ) {
  42612. nodeAfterFiller.data = _filler__WEBPACK_IMPORTED_MODULE_2__["INLINE_FILLER"] + nodeAfterFiller.data;
  42613. return nodeAfterFiller;
  42614. } else {
  42615. const fillerNode = domDocument.createTextNode( _filler__WEBPACK_IMPORTED_MODULE_2__["INLINE_FILLER"] );
  42616. if ( Array.isArray( domParentOrArray ) ) {
  42617. childNodes.splice( offset, 0, fillerNode );
  42618. } else {
  42619. Object(_ckeditor_ckeditor5_utils_src_dom_insertat__WEBPACK_IMPORTED_MODULE_5__["default"])( domParentOrArray, offset, fillerNode );
  42620. }
  42621. return fillerNode;
  42622. }
  42623. }
  42624. // Whether two DOM nodes should be considered as similar.
  42625. // Nodes are considered similar if they have the same tag name.
  42626. //
  42627. // @private
  42628. // @param {Node} node1
  42629. // @param {Node} node2
  42630. // @returns {Boolean}
  42631. function areSimilar( node1, node2 ) {
  42632. return Object(_ckeditor_ckeditor5_utils_src_dom_isnode__WEBPACK_IMPORTED_MODULE_10__["default"])( node1 ) && Object(_ckeditor_ckeditor5_utils_src_dom_isnode__WEBPACK_IMPORTED_MODULE_10__["default"])( node2 ) &&
  42633. !Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_9__["default"])( node1 ) && !Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_9__["default"])( node2 ) &&
  42634. node1.nodeType !== Node.COMMENT_NODE && node2.nodeType !== Node.COMMENT_NODE &&
  42635. node1.tagName.toLowerCase() === node2.tagName.toLowerCase();
  42636. }
  42637. // Whether two dom nodes should be considered as the same.
  42638. // Two nodes which are considered the same are:
  42639. //
  42640. // * Text nodes with the same text.
  42641. // * Element nodes represented by the same object.
  42642. // * Two block filler elements.
  42643. //
  42644. // @private
  42645. // @param {String} blockFillerMode Block filler mode, see {@link module:engine/view/domconverter~DomConverter#blockFillerMode}.
  42646. // @param {Node} node1
  42647. // @param {Node} node2
  42648. // @returns {Boolean}
  42649. function sameNodes( domConverter, actualDomChild, expectedDomChild ) {
  42650. // Elements.
  42651. if ( actualDomChild === expectedDomChild ) {
  42652. return true;
  42653. }
  42654. // Texts.
  42655. else if ( Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_9__["default"])( actualDomChild ) && Object(_ckeditor_ckeditor5_utils_src_dom_istext__WEBPACK_IMPORTED_MODULE_9__["default"])( expectedDomChild ) ) {
  42656. return actualDomChild.data === expectedDomChild.data;
  42657. }
  42658. // Block fillers.
  42659. else if ( domConverter.isBlockFiller( actualDomChild ) &&
  42660. domConverter.isBlockFiller( expectedDomChild ) ) {
  42661. return true;
  42662. }
  42663. // Not matching types.
  42664. return false;
  42665. }
  42666. // The following is a Firefox–specific hack (https://github.com/ckeditor/ckeditor5-engine/issues/1439).
  42667. // When the native DOM selection is at the end of the block and preceded by <br /> e.g.
  42668. //
  42669. // <p>foo<br/>[]</p>
  42670. //
  42671. // which happens a lot when using the soft line break, the browser fails to (visually) move the
  42672. // caret to the new line. A quick fix is as simple as force–refreshing the selection with the same range.
  42673. function fixGeckoSelectionAfterBr( focus, domSelection ) {
  42674. const parent = focus.parent;
  42675. // This fix works only when the focus point is at the very end of an element.
  42676. // There is no point in running it in cases unrelated to the browser bug.
  42677. if ( parent.nodeType != Node.ELEMENT_NODE || focus.offset != parent.childNodes.length - 1 ) {
  42678. return;
  42679. }
  42680. const childAtOffset = parent.childNodes[ focus.offset ];
  42681. // To stay on the safe side, the fix being as specific as possible, it targets only the
  42682. // selection which is at the very end of the element and preceded by <br />.
  42683. if ( childAtOffset && childAtOffset.tagName == 'BR' ) {
  42684. domSelection.addRange( domSelection.getRangeAt( 0 ) );
  42685. }
  42686. }
  42687. function filterOutFakeSelectionContainer( domChildList, fakeSelectionContainer ) {
  42688. const childList = Array.from( domChildList );
  42689. if ( childList.length == 0 || !fakeSelectionContainer ) {
  42690. return childList;
  42691. }
  42692. const last = childList[ childList.length - 1 ];
  42693. if ( last == fakeSelectionContainer ) {
  42694. childList.pop();
  42695. }
  42696. return childList;
  42697. }
  42698. // Creates a fake selection container for a given document.
  42699. //
  42700. // @private
  42701. // @param {Document} domDocument
  42702. // @returns {HTMLElement}
  42703. function createFakeSelectionContainer( domDocument ) {
  42704. const container = domDocument.createElement( 'div' );
  42705. Object.assign( container.style, {
  42706. position: 'fixed',
  42707. top: 0,
  42708. left: '-9999px',
  42709. // See https://github.com/ckeditor/ckeditor5/issues/752.
  42710. width: '42px'
  42711. } );
  42712. // Fill it with a text node so we can update it later.
  42713. container.textContent = '\u00A0';
  42714. return container;
  42715. }
  42716. /***/ }),
  42717. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/rooteditableelement.js":
  42718. /*!*********************************************************************************!*\
  42719. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/rooteditableelement.js ***!
  42720. \*********************************************************************************/
  42721. /*! exports provided: default */
  42722. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42723. "use strict";
  42724. __webpack_require__.r(__webpack_exports__);
  42725. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RootEditableElement; });
  42726. /* harmony import */ var _editableelement__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./editableelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/editableelement.js");
  42727. /**
  42728. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  42729. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  42730. */
  42731. /**
  42732. * @module engine/view/rooteditableelement
  42733. */
  42734. const rootNameSymbol = Symbol( 'rootName' );
  42735. /**
  42736. * Class representing a single root in the data view. A root can be either {@link ~RootEditableElement#isReadOnly editable or read-only},
  42737. * but in both cases it is called "an editable". Roots can contain other {@link module:engine/view/editableelement~EditableElement
  42738. * editable elements} making them "nested editables".
  42739. *
  42740. * @extends module:engine/view/editableelement~EditableElement
  42741. */
  42742. class RootEditableElement extends _editableelement__WEBPACK_IMPORTED_MODULE_0__["default"] {
  42743. /**
  42744. * Creates root editable element.
  42745. *
  42746. * @param {module:engine/view/document~Document} document The document instance to which this element belongs.
  42747. * @param {String} name Node name.
  42748. */
  42749. constructor( document, name ) {
  42750. super( document, name );
  42751. /**
  42752. * Name of this root inside {@link module:engine/view/document~Document} that is an owner of this root. If no
  42753. * other name is set, `main` name is used.
  42754. *
  42755. * @readonly
  42756. * @member {String}
  42757. */
  42758. this.rootName = 'main';
  42759. }
  42760. /**
  42761. * Checks whether this object is of the given.
  42762. *
  42763. * rootEditableElement.is( 'rootElement' ); // -> true
  42764. * rootEditableElement.is( 'editableElement' ); // -> true
  42765. * rootEditableElement.is( 'element' ); // -> true
  42766. * rootEditableElement.is( 'node' ); // -> true
  42767. * rootEditableElement.is( 'view:editableElement' ); // -> true
  42768. * rootEditableElement.is( 'view:element' ); // -> true
  42769. * rootEditableElement.is( 'view:node' ); // -> true
  42770. *
  42771. * rootEditableElement.is( 'model:element' ); // -> false
  42772. * rootEditableElement.is( 'documentFragment' ); // -> false
  42773. *
  42774. * Assuming that the object being checked is a root editable element, you can also check its
  42775. * {@link module:engine/view/rooteditableelement~RootEditableElement#name name}:
  42776. *
  42777. * rootEditableElement.is( 'element', 'div' ); // -> true if this is a div root editable element
  42778. * rootEditableElement.is( 'rootElement', 'div' ); // -> same as above
  42779. * text.is( 'element', 'div' ); -> false
  42780. *
  42781. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  42782. *
  42783. * @param {String} type Type to check.
  42784. * @param {String} [name] Element name.
  42785. * @returns {Boolean}
  42786. */
  42787. is( type, name = null ) {
  42788. if ( !name ) {
  42789. return type === 'rootElement' || type === 'view:rootElement' ||
  42790. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  42791. type === 'editableElement' || type === 'view:editableElement' ||
  42792. type === 'containerElement' || type === 'view:containerElement' ||
  42793. type === 'element' || type === 'view:element' ||
  42794. type === 'node' || type === 'view:node';
  42795. } else {
  42796. return name === this.name && (
  42797. type === 'rootElement' || type === 'view:rootElement' ||
  42798. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  42799. type === 'editableElement' || type === 'view:editableElement' ||
  42800. type === 'containerElement' || type === 'view:containerElement' ||
  42801. type === 'element' || type === 'view:element'
  42802. );
  42803. }
  42804. }
  42805. get rootName() {
  42806. return this.getCustomProperty( rootNameSymbol );
  42807. }
  42808. set rootName( rootName ) {
  42809. this._setCustomProperty( rootNameSymbol, rootName );
  42810. }
  42811. /**
  42812. * Overrides old element name and sets new one.
  42813. * This is needed because view roots are created before they are attached to the DOM.
  42814. * The name of the root element is temporary at this stage. It has to be changed when the
  42815. * view root element is attached to the DOM element.
  42816. *
  42817. * @protected
  42818. * @param {String} name The new name of element.
  42819. */
  42820. set _name( name ) {
  42821. this.name = name;
  42822. }
  42823. }
  42824. /***/ }),
  42825. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js":
  42826. /*!***********************************************************************!*\
  42827. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js ***!
  42828. \***********************************************************************/
  42829. /*! exports provided: default */
  42830. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42831. "use strict";
  42832. __webpack_require__.r(__webpack_exports__);
  42833. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Selection; });
  42834. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  42835. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/range.js");
  42836. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
  42837. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  42838. /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  42839. /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/node.js");
  42840. /* harmony import */ var _ckeditor_ckeditor5_utils_src_count__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/count */ "./node_modules/@ckeditor/ckeditor5-utils/src/count.js");
  42841. /* harmony import */ var _ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
  42842. /* harmony import */ var _documentselection__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./documentselection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/documentselection.js");
  42843. /**
  42844. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  42845. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  42846. */
  42847. /**
  42848. * @module engine/view/selection
  42849. */
  42850. /**
  42851. * Class representing an arbirtary selection in the view.
  42852. * See also {@link module:engine/view/documentselection~DocumentSelection}.
  42853. *
  42854. * New selection instances can be created via the constructor or one these methods:
  42855. *
  42856. * * {@link module:engine/view/view~View#createSelection `View#createSelection()`},
  42857. * * {@link module:engine/view/upcastwriter~UpcastWriter#createSelection `UpcastWriter#createSelection()`}.
  42858. *
  42859. * A selection can consist of {@link module:engine/view/range~Range ranges} that can be set by using
  42860. * the {@link module:engine/view/selection~Selection#setTo `Selection#setTo()`} method.
  42861. */
  42862. class Selection {
  42863. /**
  42864. * Creates new selection instance.
  42865. *
  42866. * **Note**: The selection constructor is available as a factory method:
  42867. *
  42868. * * {@link module:engine/view/view~View#createSelection `View#createSelection()`},
  42869. * * {@link module:engine/view/upcastwriter~UpcastWriter#createSelection `UpcastWriter#createSelection()`}.
  42870. *
  42871. * // Creates empty selection without ranges.
  42872. * const selection = writer.createSelection();
  42873. *
  42874. * // Creates selection at the given range.
  42875. * const range = writer.createRange( start, end );
  42876. * const selection = writer.createSelection( range );
  42877. *
  42878. * // Creates selection at the given ranges
  42879. * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];
  42880. * const selection = writer.createSelection( ranges );
  42881. *
  42882. * // Creates selection from the other selection.
  42883. * const otherSelection = writer.createSelection();
  42884. * const selection = writer.createSelection( otherSelection );
  42885. *
  42886. * // Creates selection from the document selection.
  42887. * const selection = writer.createSelection( editor.editing.view.document.selection );
  42888. *
  42889. * // Creates selection at the given position.
  42890. * const position = writer.createPositionFromPath( root, path );
  42891. * const selection = writer.createSelection( position );
  42892. *
  42893. * // Creates collapsed selection at the position of given item and offset.
  42894. * const paragraph = writer.createContainerElement( 'paragraph' );
  42895. * const selection = writer.createSelection( paragraph, offset );
  42896. *
  42897. * // Creates a range inside an {@link module:engine/view/element~Element element} which starts before the
  42898. * // first child of that element and ends after the last child of that element.
  42899. * const selection = writer.createSelection( paragraph, 'in' );
  42900. *
  42901. * // Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends
  42902. * // just after the item.
  42903. * const selection = writer.createSelection( paragraph, 'on' );
  42904. *
  42905. * `Selection`'s constructor allow passing additional options (`backward`, `fake` and `label`) as the last argument.
  42906. *
  42907. * // Creates backward selection.
  42908. * const selection = writer.createSelection( range, { backward: true } );
  42909. *
  42910. * Fake selection does not render as browser native selection over selected elements and is hidden to the user.
  42911. * This way, no native selection UI artifacts are displayed to the user and selection over elements can be
  42912. * represented in other way, for example by applying proper CSS class.
  42913. *
  42914. * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM
  42915. * (and be properly handled by screen readers).
  42916. *
  42917. * // Creates fake selection with label.
  42918. * const selection = writer.createSelection( range, { fake: true, label: 'foo' } );
  42919. *
  42920. * @param {module:engine/view/selection~Selectable} [selectable=null]
  42921. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Offset or place when selectable is an `Item`.
  42922. * @param {Object} [options]
  42923. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  42924. * @param {Boolean} [options.fake] Sets this selection instance to be marked as `fake`.
  42925. * @param {String} [options.label] Label for the fake selection.
  42926. */
  42927. constructor( selectable = null, placeOrOffset, options ) {
  42928. /**
  42929. * Stores all ranges that are selected.
  42930. *
  42931. * @protected
  42932. * @member {Array.<module:engine/view/range~Range>}
  42933. */
  42934. this._ranges = [];
  42935. /**
  42936. * Specifies whether the last added range was added as a backward or forward range.
  42937. *
  42938. * @protected
  42939. * @member {Boolean}
  42940. */
  42941. this._lastRangeBackward = false;
  42942. /**
  42943. * Specifies whether selection instance is fake.
  42944. *
  42945. * @private
  42946. * @member {Boolean}
  42947. */
  42948. this._isFake = false;
  42949. /**
  42950. * Fake selection's label.
  42951. *
  42952. * @private
  42953. * @member {String}
  42954. */
  42955. this._fakeSelectionLabel = '';
  42956. this.setTo( selectable, placeOrOffset, options );
  42957. }
  42958. /**
  42959. * Returns true if selection instance is marked as `fake`.
  42960. *
  42961. * @see #setTo
  42962. * @returns {Boolean}
  42963. */
  42964. get isFake() {
  42965. return this._isFake;
  42966. }
  42967. /**
  42968. * Returns fake selection label.
  42969. *
  42970. * @see #setTo
  42971. * @returns {String}
  42972. */
  42973. get fakeSelectionLabel() {
  42974. return this._fakeSelectionLabel;
  42975. }
  42976. /**
  42977. * Selection anchor. Anchor may be described as a position where the selection starts. Together with
  42978. * {@link #focus focus} they define the direction of selection, which is important
  42979. * when expanding/shrinking selection. Anchor is always the start or end of the most recent added range.
  42980. * It may be a bit unintuitive when there are multiple ranges in selection.
  42981. *
  42982. * @see #focus
  42983. * @type {module:engine/view/position~Position}
  42984. */
  42985. get anchor() {
  42986. if ( !this._ranges.length ) {
  42987. return null;
  42988. }
  42989. const range = this._ranges[ this._ranges.length - 1 ];
  42990. const anchor = this._lastRangeBackward ? range.end : range.start;
  42991. return anchor.clone();
  42992. }
  42993. /**
  42994. * Selection focus. Focus is a position where the selection ends.
  42995. *
  42996. * @see #anchor
  42997. * @type {module:engine/view/position~Position}
  42998. */
  42999. get focus() {
  43000. if ( !this._ranges.length ) {
  43001. return null;
  43002. }
  43003. const range = this._ranges[ this._ranges.length - 1 ];
  43004. const focus = this._lastRangeBackward ? range.start : range.end;
  43005. return focus.clone();
  43006. }
  43007. /**
  43008. * Returns whether the selection is collapsed. Selection is collapsed when there is exactly one range which is
  43009. * collapsed.
  43010. *
  43011. * @type {Boolean}
  43012. */
  43013. get isCollapsed() {
  43014. return this.rangeCount === 1 && this._ranges[ 0 ].isCollapsed;
  43015. }
  43016. /**
  43017. * Returns number of ranges in selection.
  43018. *
  43019. * @type {Number}
  43020. */
  43021. get rangeCount() {
  43022. return this._ranges.length;
  43023. }
  43024. /**
  43025. * Specifies whether the {@link #focus} precedes {@link #anchor}.
  43026. *
  43027. * @type {Boolean}
  43028. */
  43029. get isBackward() {
  43030. return !this.isCollapsed && this._lastRangeBackward;
  43031. }
  43032. /**
  43033. * {@link module:engine/view/editableelement~EditableElement EditableElement} instance that contains this selection, or `null`
  43034. * if the selection is not inside an editable element.
  43035. *
  43036. * @type {module:engine/view/editableelement~EditableElement|null}
  43037. */
  43038. get editableElement() {
  43039. if ( this.anchor ) {
  43040. return this.anchor.editableElement;
  43041. }
  43042. return null;
  43043. }
  43044. /**
  43045. * Returns an iterable that contains copies of all ranges added to the selection.
  43046. *
  43047. * @returns {Iterable.<module:engine/view/range~Range>}
  43048. */
  43049. * getRanges() {
  43050. for ( const range of this._ranges ) {
  43051. yield range.clone();
  43052. }
  43053. }
  43054. /**
  43055. * Returns copy of the first range in the selection. First range is the one which
  43056. * {@link module:engine/view/range~Range#start start} position {@link module:engine/view/position~Position#isBefore is before} start
  43057. * position of all other ranges (not to confuse with the first range added to the selection).
  43058. * Returns `null` if no ranges are added to selection.
  43059. *
  43060. * @returns {module:engine/view/range~Range|null}
  43061. */
  43062. getFirstRange() {
  43063. let first = null;
  43064. for ( const range of this._ranges ) {
  43065. if ( !first || range.start.isBefore( first.start ) ) {
  43066. first = range;
  43067. }
  43068. }
  43069. return first ? first.clone() : null;
  43070. }
  43071. /**
  43072. * Returns copy of the last range in the selection. Last range is the one which {@link module:engine/view/range~Range#end end}
  43073. * position {@link module:engine/view/position~Position#isAfter is after} end position of all other ranges (not to confuse
  43074. * with the last range added to the selection). Returns `null` if no ranges are added to selection.
  43075. *
  43076. * @returns {module:engine/view/range~Range|null}
  43077. */
  43078. getLastRange() {
  43079. let last = null;
  43080. for ( const range of this._ranges ) {
  43081. if ( !last || range.end.isAfter( last.end ) ) {
  43082. last = range;
  43083. }
  43084. }
  43085. return last ? last.clone() : null;
  43086. }
  43087. /**
  43088. * Returns copy of the first position in the selection. First position is the position that
  43089. * {@link module:engine/view/position~Position#isBefore is before} any other position in the selection ranges.
  43090. * Returns `null` if no ranges are added to selection.
  43091. *
  43092. * @returns {module:engine/view/position~Position|null}
  43093. */
  43094. getFirstPosition() {
  43095. const firstRange = this.getFirstRange();
  43096. return firstRange ? firstRange.start.clone() : null;
  43097. }
  43098. /**
  43099. * Returns copy of the last position in the selection. Last position is the position that
  43100. * {@link module:engine/view/position~Position#isAfter is after} any other position in the selection ranges.
  43101. * Returns `null` if no ranges are added to selection.
  43102. *
  43103. * @returns {module:engine/view/position~Position|null}
  43104. */
  43105. getLastPosition() {
  43106. const lastRange = this.getLastRange();
  43107. return lastRange ? lastRange.end.clone() : null;
  43108. }
  43109. /**
  43110. * Checks whether, this selection is equal to given selection. Selections are equal if they have same directions,
  43111. * same number of ranges and all ranges from one selection equal to a range from other selection.
  43112. *
  43113. * @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection} otherSelection
  43114. * Selection to compare with.
  43115. * @returns {Boolean} `true` if selections are equal, `false` otherwise.
  43116. */
  43117. isEqual( otherSelection ) {
  43118. if ( this.isFake != otherSelection.isFake ) {
  43119. return false;
  43120. }
  43121. if ( this.isFake && this.fakeSelectionLabel != otherSelection.fakeSelectionLabel ) {
  43122. return false;
  43123. }
  43124. if ( this.rangeCount != otherSelection.rangeCount ) {
  43125. return false;
  43126. } else if ( this.rangeCount === 0 ) {
  43127. return true;
  43128. }
  43129. if ( !this.anchor.isEqual( otherSelection.anchor ) || !this.focus.isEqual( otherSelection.focus ) ) {
  43130. return false;
  43131. }
  43132. for ( const thisRange of this._ranges ) {
  43133. let found = false;
  43134. for ( const otherRange of otherSelection._ranges ) {
  43135. if ( thisRange.isEqual( otherRange ) ) {
  43136. found = true;
  43137. break;
  43138. }
  43139. }
  43140. if ( !found ) {
  43141. return false;
  43142. }
  43143. }
  43144. return true;
  43145. }
  43146. /**
  43147. * Checks whether this selection is similar to given selection. Selections are similar if they have same directions, same
  43148. * number of ranges, and all {@link module:engine/view/range~Range#getTrimmed trimmed} ranges from one selection are
  43149. * equal to any trimmed range from other selection.
  43150. *
  43151. * @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection} otherSelection
  43152. * Selection to compare with.
  43153. * @returns {Boolean} `true` if selections are similar, `false` otherwise.
  43154. */
  43155. isSimilar( otherSelection ) {
  43156. if ( this.isBackward != otherSelection.isBackward ) {
  43157. return false;
  43158. }
  43159. const numOfRangesA = Object(_ckeditor_ckeditor5_utils_src_count__WEBPACK_IMPORTED_MODULE_6__["default"])( this.getRanges() );
  43160. const numOfRangesB = Object(_ckeditor_ckeditor5_utils_src_count__WEBPACK_IMPORTED_MODULE_6__["default"])( otherSelection.getRanges() );
  43161. // If selections have different number of ranges, they cannot be similar.
  43162. if ( numOfRangesA != numOfRangesB ) {
  43163. return false;
  43164. }
  43165. // If both selections have no ranges, they are similar.
  43166. if ( numOfRangesA == 0 ) {
  43167. return true;
  43168. }
  43169. // Check if each range in one selection has a similar range in other selection.
  43170. for ( let rangeA of this.getRanges() ) {
  43171. rangeA = rangeA.getTrimmed();
  43172. let found = false;
  43173. for ( let rangeB of otherSelection.getRanges() ) {
  43174. rangeB = rangeB.getTrimmed();
  43175. if ( rangeA.start.isEqual( rangeB.start ) && rangeA.end.isEqual( rangeB.end ) ) {
  43176. found = true;
  43177. break;
  43178. }
  43179. }
  43180. // For `rangeA`, neither range in `otherSelection` was similar. So selections are not similar.
  43181. if ( !found ) {
  43182. return false;
  43183. }
  43184. }
  43185. // There were no ranges that weren't matched. Selections are similar.
  43186. return true;
  43187. }
  43188. /**
  43189. * Returns the selected element. {@link module:engine/view/element~Element Element} is considered as selected if there is only
  43190. * one range in the selection, and that range contains exactly one element.
  43191. * Returns `null` if there is no selected element.
  43192. *
  43193. * @returns {module:engine/view/element~Element|null}
  43194. */
  43195. getSelectedElement() {
  43196. if ( this.rangeCount !== 1 ) {
  43197. return null;
  43198. }
  43199. return this.getFirstRange().getContainedElement();
  43200. }
  43201. /**
  43202. * Sets this selection's ranges and direction to the specified location based on the given
  43203. * {@link module:engine/view/selection~Selectable selectable}.
  43204. *
  43205. * // Sets selection to the given range.
  43206. * const range = writer.createRange( start, end );
  43207. * selection.setTo( range );
  43208. *
  43209. * // Sets selection to given ranges.
  43210. * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];
  43211. * selection.setTo( range );
  43212. *
  43213. * // Sets selection to the other selection.
  43214. * const otherSelection = writer.createSelection();
  43215. * selection.setTo( otherSelection );
  43216. *
  43217. * // Sets selection to contents of DocumentSelection.
  43218. * selection.setTo( editor.editing.view.document.selection );
  43219. *
  43220. * // Sets collapsed selection at the given position.
  43221. * const position = writer.createPositionAt( root, path );
  43222. * selection.setTo( position );
  43223. *
  43224. * // Sets collapsed selection at the position of given item and offset.
  43225. * selection.setTo( paragraph, offset );
  43226. *
  43227. * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of
  43228. * that element and ends after the last child of that element.
  43229. *
  43230. * selection.setTo( paragraph, 'in' );
  43231. *
  43232. * Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends just after the item.
  43233. *
  43234. * selection.setTo( paragraph, 'on' );
  43235. *
  43236. * // Clears selection. Removes all ranges.
  43237. * selection.setTo( null );
  43238. *
  43239. * `Selection#setTo()` method allow passing additional options (`backward`, `fake` and `label`) as the last argument.
  43240. *
  43241. * // Sets selection as backward.
  43242. * selection.setTo( range, { backward: true } );
  43243. *
  43244. * Fake selection does not render as browser native selection over selected elements and is hidden to the user.
  43245. * This way, no native selection UI artifacts are displayed to the user and selection over elements can be
  43246. * represented in other way, for example by applying proper CSS class.
  43247. *
  43248. * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM
  43249. * (and be properly handled by screen readers).
  43250. *
  43251. * // Creates fake selection with label.
  43252. * selection.setTo( range, { fake: true, label: 'foo' } );
  43253. *
  43254. * @fires change
  43255. * @param {module:engine/view/selection~Selectable} selectable
  43256. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
  43257. * @param {Object} [options]
  43258. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  43259. * @param {Boolean} [options.fake] Sets this selection instance to be marked as `fake`.
  43260. * @param {String} [options.label] Label for the fake selection.
  43261. */
  43262. setTo( selectable, placeOrOffset, options ) {
  43263. if ( selectable === null ) {
  43264. this._setRanges( [] );
  43265. this._setFakeOptions( placeOrOffset );
  43266. } else if ( selectable instanceof Selection || selectable instanceof _documentselection__WEBPACK_IMPORTED_MODULE_8__["default"] ) {
  43267. this._setRanges( selectable.getRanges(), selectable.isBackward );
  43268. this._setFakeOptions( { fake: selectable.isFake, label: selectable.fakeSelectionLabel } );
  43269. } else if ( selectable instanceof _range__WEBPACK_IMPORTED_MODULE_1__["default"] ) {
  43270. this._setRanges( [ selectable ], placeOrOffset && placeOrOffset.backward );
  43271. this._setFakeOptions( placeOrOffset );
  43272. } else if ( selectable instanceof _position__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
  43273. this._setRanges( [ new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( selectable ) ] );
  43274. this._setFakeOptions( placeOrOffset );
  43275. } else if ( selectable instanceof _node__WEBPACK_IMPORTED_MODULE_5__["default"] ) {
  43276. const backward = !!options && !!options.backward;
  43277. let range;
  43278. if ( placeOrOffset === undefined ) {
  43279. /**
  43280. * selection.setTo requires the second parameter when the first parameter is a node.
  43281. *
  43282. * @error view-selection-setto-required-second-parameter
  43283. */
  43284. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'view-selection-setto-required-second-parameter', this );
  43285. } else if ( placeOrOffset == 'in' ) {
  43286. range = _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createIn( selectable );
  43287. } else if ( placeOrOffset == 'on' ) {
  43288. range = _range__WEBPACK_IMPORTED_MODULE_1__["default"]._createOn( selectable );
  43289. } else {
  43290. range = new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( _position__WEBPACK_IMPORTED_MODULE_2__["default"]._createAt( selectable, placeOrOffset ) );
  43291. }
  43292. this._setRanges( [ range ], backward );
  43293. this._setFakeOptions( options );
  43294. } else if ( Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_7__["default"])( selectable ) ) {
  43295. // We assume that the selectable is an iterable of ranges.
  43296. // Array.from() is used to prevent setting ranges to the old iterable
  43297. this._setRanges( selectable, placeOrOffset && placeOrOffset.backward );
  43298. this._setFakeOptions( placeOrOffset );
  43299. } else {
  43300. /**
  43301. * Cannot set selection to given place.
  43302. *
  43303. * @error view-selection-setto-not-selectable
  43304. */
  43305. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'view-selection-setto-not-selectable', this );
  43306. }
  43307. this.fire( 'change' );
  43308. }
  43309. /**
  43310. * Moves {@link #focus} to the specified location.
  43311. *
  43312. * The location can be specified in the same form as {@link module:engine/view/view~View#createPositionAt view.createPositionAt()}
  43313. * parameters.
  43314. *
  43315. * @fires change
  43316. * @param {module:engine/view/item~Item|module:engine/view/position~Position} itemOrPosition
  43317. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  43318. * first parameter is a {@link module:engine/view/item~Item view item}.
  43319. */
  43320. setFocus( itemOrPosition, offset ) {
  43321. if ( this.anchor === null ) {
  43322. /**
  43323. * Cannot set selection focus if there are no ranges in selection.
  43324. *
  43325. * @error view-selection-setfocus-no-ranges
  43326. */
  43327. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'view-selection-setfocus-no-ranges', this );
  43328. }
  43329. const newFocus = _position__WEBPACK_IMPORTED_MODULE_2__["default"]._createAt( itemOrPosition, offset );
  43330. if ( newFocus.compareWith( this.focus ) == 'same' ) {
  43331. return;
  43332. }
  43333. const anchor = this.anchor;
  43334. this._ranges.pop();
  43335. if ( newFocus.compareWith( anchor ) == 'before' ) {
  43336. this._addRange( new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( newFocus, anchor ), true );
  43337. } else {
  43338. this._addRange( new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( anchor, newFocus ) );
  43339. }
  43340. this.fire( 'change' );
  43341. }
  43342. /**
  43343. * Checks whether this object is of the given type.
  43344. *
  43345. * selection.is( 'selection' ); // -> true
  43346. * selection.is( 'view:selection' ); // -> true
  43347. *
  43348. * selection.is( 'model:selection' ); // -> false
  43349. * selection.is( 'element' ); // -> false
  43350. * selection.is( 'range' ); // -> false
  43351. *
  43352. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  43353. *
  43354. * @param {String} type
  43355. * @returns {Boolean}
  43356. */
  43357. is( type ) {
  43358. return type === 'selection' || type === 'view:selection';
  43359. }
  43360. /**
  43361. * Replaces all ranges that were added to the selection with given array of ranges. Last range of the array
  43362. * is treated like the last added range and is used to set {@link #anchor anchor} and {@link #focus focus}.
  43363. * Accepts a flag describing in which way the selection is made.
  43364. *
  43365. * @private
  43366. * @param {Iterable.<module:engine/view/range~Range>} newRanges Iterable object of ranges to set.
  43367. * @param {Boolean} [isLastBackward=false] Flag describing if last added range was selected forward - from start to end
  43368. * (`false`) or backward - from end to start (`true`). Defaults to `false`.
  43369. */
  43370. _setRanges( newRanges, isLastBackward = false ) {
  43371. // New ranges should be copied to prevent removing them by setting them to `[]` first.
  43372. // Only applies to situations when selection is set to the same selection or same selection's ranges.
  43373. newRanges = Array.from( newRanges );
  43374. this._ranges = [];
  43375. for ( const range of newRanges ) {
  43376. this._addRange( range );
  43377. }
  43378. this._lastRangeBackward = !!isLastBackward;
  43379. }
  43380. /**
  43381. * Sets this selection instance to be marked as `fake`. A fake selection does not render as browser native selection
  43382. * over selected elements and is hidden to the user. This way, no native selection UI artifacts are displayed to
  43383. * the user and selection over elements can be represented in other way, for example by applying proper CSS class.
  43384. *
  43385. * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM (and be
  43386. * properly handled by screen readers).
  43387. *
  43388. * @private
  43389. * @param {Object} [options] Options.
  43390. * @param {Boolean} [options.fake] If set to true selection will be marked as `fake`.
  43391. * @param {String} [options.label=''] Fake selection label.
  43392. */
  43393. _setFakeOptions( options = {} ) {
  43394. this._isFake = !!options.fake;
  43395. this._fakeSelectionLabel = options.fake ? options.label || '' : '';
  43396. }
  43397. /**
  43398. * Adds a range to the selection. Added range is copied. This means that passed range is not saved in the
  43399. * selection instance and you can safely operate on it.
  43400. *
  43401. * Accepts a flag describing in which way the selection is made - passed range might be selected from
  43402. * {@link module:engine/view/range~Range#start start} to {@link module:engine/view/range~Range#end end}
  43403. * or from {@link module:engine/view/range~Range#end end} to {@link module:engine/view/range~Range#start start}.
  43404. * The flag is used to set {@link #anchor anchor} and {@link #focus focus} properties.
  43405. *
  43406. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-selection-range-intersects` if added range intersects
  43407. * with ranges already stored in Selection instance.
  43408. *
  43409. * @private
  43410. * @fires change
  43411. * @param {module:engine/view/range~Range} range
  43412. * @param {Boolean} [isBackward]
  43413. */
  43414. _addRange( range, isBackward = false ) {
  43415. if ( !( range instanceof _range__WEBPACK_IMPORTED_MODULE_1__["default"] ) ) {
  43416. /**
  43417. * Selection range set to an object that is not an instance of {@link module:engine/view/range~Range}.
  43418. *
  43419. * @error view-selection-add-range-not-range
  43420. */
  43421. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  43422. 'view-selection-add-range-not-range',
  43423. this
  43424. );
  43425. }
  43426. this._pushRange( range );
  43427. this._lastRangeBackward = !!isBackward;
  43428. }
  43429. /**
  43430. * Adds range to selection - creates copy of given range so it can be safely used and modified.
  43431. *
  43432. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-selection-range-intersects` if added range intersects
  43433. * with ranges already stored in selection instance.
  43434. *
  43435. * @private
  43436. * @param {module:engine/view/range~Range} range
  43437. */
  43438. _pushRange( range ) {
  43439. for ( const storedRange of this._ranges ) {
  43440. if ( range.isIntersecting( storedRange ) ) {
  43441. /**
  43442. * Trying to add a range that intersects with another range from selection.
  43443. *
  43444. * @error view-selection-range-intersects
  43445. * @param {module:engine/view/range~Range} addedRange Range that was added to the selection.
  43446. * @param {module:engine/view/range~Range} intersectingRange Range from selection that intersects with `addedRange`.
  43447. */
  43448. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  43449. 'view-selection-range-intersects',
  43450. this,
  43451. { addedRange: range, intersectingRange: storedRange }
  43452. );
  43453. }
  43454. }
  43455. this._ranges.push( new _range__WEBPACK_IMPORTED_MODULE_1__["default"]( range.start, range.end ) );
  43456. }
  43457. /**
  43458. * Fired whenever selection ranges are changed through {@link ~Selection Selection API}.
  43459. *
  43460. * @event change
  43461. */
  43462. }
  43463. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_3__["default"])( Selection, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_4__["default"] );
  43464. /**
  43465. * An entity that is used to set selection.
  43466. *
  43467. * See also {@link module:engine/view/selection~Selection#setTo}
  43468. *
  43469. * @typedef {
  43470. * module:engine/view/selection~Selection|
  43471. * module:engine/view/documentselection~DocumentSelection|
  43472. * module:engine/view/position~Position|
  43473. * Iterable.<module:engine/view/range~Range>|
  43474. * module:engine/view/range~Range|
  43475. * module:engine/view/item~Item|
  43476. * null
  43477. * } module:engine/view/selection~Selectable
  43478. */
  43479. /***/ }),
  43480. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/background.js":
  43481. /*!*******************************************************************************!*\
  43482. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/background.js ***!
  43483. \*******************************************************************************/
  43484. /*! exports provided: addBackgroundRules */
  43485. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43486. "use strict";
  43487. __webpack_require__.r(__webpack_exports__);
  43488. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addBackgroundRules", function() { return addBackgroundRules; });
  43489. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/utils.js");
  43490. /**
  43491. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  43492. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  43493. */
  43494. /**
  43495. * @module engine/view/styles/background
  43496. */
  43497. /**
  43498. * Adds a background CSS styles processing rules.
  43499. *
  43500. * editor.data.addStyleProcessorRules( addBackgroundRules );
  43501. *
  43502. * The normalized value is stored as:
  43503. *
  43504. * const styles = {
  43505. * background: {
  43506. * color,
  43507. * repeat,
  43508. * position,
  43509. * attachment,
  43510. * image
  43511. * }
  43512. * };
  43513. *
  43514. * **Note**: Currently only `'background-color'` longhand value is parsed besides `'background'` shorthand. The reducer also supports only
  43515. * `'background-color'` value.
  43516. *
  43517. * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor
  43518. */
  43519. function addBackgroundRules( stylesProcessor ) {
  43520. stylesProcessor.setNormalizer( 'background', normalizeBackground );
  43521. stylesProcessor.setNormalizer( 'background-color', value => ( { path: 'background.color', value } ) );
  43522. stylesProcessor.setReducer( 'background', value => {
  43523. const ret = [];
  43524. ret.push( [ 'background-color', value.color ] );
  43525. return ret;
  43526. } );
  43527. }
  43528. function normalizeBackground( value ) {
  43529. const background = {};
  43530. const parts = Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getShorthandValues"])( value );
  43531. for ( const part of parts ) {
  43532. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_0__["isRepeat"])( part ) ) {
  43533. background.repeat = background.repeat || [];
  43534. background.repeat.push( part );
  43535. } else if ( Object(_utils__WEBPACK_IMPORTED_MODULE_0__["isPosition"])( part ) ) {
  43536. background.position = background.position || [];
  43537. background.position.push( part );
  43538. } else if ( Object(_utils__WEBPACK_IMPORTED_MODULE_0__["isAttachment"])( part ) ) {
  43539. background.attachment = part;
  43540. } else if ( Object(_utils__WEBPACK_IMPORTED_MODULE_0__["isColor"])( part ) ) {
  43541. background.color = part;
  43542. } else if ( Object(_utils__WEBPACK_IMPORTED_MODULE_0__["isURL"])( part ) ) {
  43543. background.image = part;
  43544. }
  43545. }
  43546. return {
  43547. path: 'background',
  43548. value: background
  43549. };
  43550. }
  43551. /***/ }),
  43552. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/utils.js":
  43553. /*!**************************************************************************!*\
  43554. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/utils.js ***!
  43555. \**************************************************************************/
  43556. /*! exports provided: isColor, isLineStyle, isLength, isPercentage, isRepeat, isPosition, isAttachment, isURL, getBoxSidesValues, getBoxSidesValueReducer, getBoxSidesShorthandValue, getPositionShorthandNormalizer, getShorthandValues */
  43557. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43558. "use strict";
  43559. __webpack_require__.r(__webpack_exports__);
  43560. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isColor", function() { return isColor; });
  43561. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLineStyle", function() { return isLineStyle; });
  43562. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLength", function() { return isLength; });
  43563. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPercentage", function() { return isPercentage; });
  43564. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isRepeat", function() { return isRepeat; });
  43565. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPosition", function() { return isPosition; });
  43566. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isAttachment", function() { return isAttachment; });
  43567. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isURL", function() { return isURL; });
  43568. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBoxSidesValues", function() { return getBoxSidesValues; });
  43569. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBoxSidesValueReducer", function() { return getBoxSidesValueReducer; });
  43570. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBoxSidesShorthandValue", function() { return getBoxSidesShorthandValue; });
  43571. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getPositionShorthandNormalizer", function() { return getPositionShorthandNormalizer; });
  43572. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getShorthandValues", function() { return getShorthandValues; });
  43573. /**
  43574. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  43575. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  43576. */
  43577. /**
  43578. * @module engine/view/styles/utils
  43579. */
  43580. const HEX_COLOR_REGEXP = /^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;
  43581. const RGB_COLOR_REGEXP = /^rgb\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}[0-9]{1,3}[ %]?\)$/i;
  43582. const RGBA_COLOR_REGEXP = /^rgba\([ ]?([0-9]{1,3}[ %]?,[ ]?){3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i;
  43583. const HSL_COLOR_REGEXP = /^hsl\([ ]?([0-9]{1,3}[ %]?[,]?[ ]*){3}(1|[0-9]+%|[0]?\.?[0-9]+)?\)$/i;
  43584. const HSLA_COLOR_REGEXP = /^hsla\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i;
  43585. const COLOR_NAMES = new Set( [
  43586. // CSS Level 1
  43587. 'black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia',
  43588. 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua',
  43589. // CSS Level 2 (Revision 1)
  43590. 'orange',
  43591. // CSS Color Module Level 3
  43592. 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown',
  43593. 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan',
  43594. 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta',
  43595. 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue',
  43596. 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey',
  43597. 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod',
  43598. 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush',
  43599. 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray',
  43600. 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray',
  43601. 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine',
  43602. 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen',
  43603. 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite',
  43604. 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred',
  43605. 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon',
  43606. 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow',
  43607. 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen',
  43608. // CSS Color Module Level 4
  43609. 'rebeccapurple',
  43610. // Keywords
  43611. 'currentcolor', 'transparent'
  43612. ] );
  43613. /**
  43614. * Checks if string contains [color](https://developer.mozilla.org/en-US/docs/Web/CSS/color) CSS value.
  43615. *
  43616. * isColor( '#f00' ); // true
  43617. * isColor( '#AA00BB33' ); // true
  43618. * isColor( 'rgb(0, 0, 250)' ); // true
  43619. * isColor( 'hsla(240, 100%, 50%, .7)' ); // true
  43620. * isColor( 'deepskyblue' ); // true
  43621. *
  43622. * **Note**: It does not support CSS Level 4 whitespace syntax, system colors and radius values for HSL colors.
  43623. *
  43624. * @param {String} string
  43625. * @returns {Boolean}
  43626. */
  43627. function isColor( string ) {
  43628. // As far as I was able to test checking some pre-conditions is faster than joining each test with ||.
  43629. if ( string.startsWith( '#' ) ) {
  43630. return HEX_COLOR_REGEXP.test( string );
  43631. }
  43632. if ( string.startsWith( 'rgb' ) ) {
  43633. return RGB_COLOR_REGEXP.test( string ) || RGBA_COLOR_REGEXP.test( string );
  43634. }
  43635. if ( string.startsWith( 'hsl' ) ) {
  43636. return HSL_COLOR_REGEXP.test( string ) || HSLA_COLOR_REGEXP.test( string );
  43637. }
  43638. // Array check > RegExp test.
  43639. return COLOR_NAMES.has( string.toLowerCase() );
  43640. }
  43641. const lineStyleValues = [ 'none', 'hidden', 'dotted', 'dashed', 'solid', 'double', 'groove', 'ridge', 'inset', 'outset' ];
  43642. /**
  43643. * Checks if string contains [line style](https://developer.mozilla.org/en-US/docs/Web/CSS/border-style) CSS value.
  43644. *
  43645. * @param {String} string
  43646. * @returns {Boolean}
  43647. */
  43648. function isLineStyle( string ) {
  43649. return lineStyleValues.includes( string );
  43650. }
  43651. const lengthRegExp = /^([+-]?[0-9]*[.]?[0-9]+(px|cm|mm|in|pc|pt|ch|em|ex|rem|vh|vw|vmin|vmax)|0)$/;
  43652. /**
  43653. * Checks if string contains [length](https://developer.mozilla.org/en-US/docs/Web/CSS/length) CSS value.
  43654. *
  43655. * @param {String} string
  43656. * @returns {Boolean}
  43657. */
  43658. function isLength( string ) {
  43659. return lengthRegExp.test( string );
  43660. }
  43661. const PERCENTAGE_VALUE_REGEXP = /^[+-]?[0-9]*[.]?[0-9]+%$/;
  43662. /**
  43663. * Checks if string contains [percentage](https://developer.mozilla.org/en-US/docs/Web/CSS/percentage) CSS value.
  43664. *
  43665. * @param {String} string
  43666. * @returns {Boolean}
  43667. */
  43668. function isPercentage( string ) {
  43669. return PERCENTAGE_VALUE_REGEXP.test( string );
  43670. }
  43671. const repeatValues = [ 'repeat-x', 'repeat-y', 'repeat', 'space', 'round', 'no-repeat' ];
  43672. /**
  43673. * Checks if string contains [background repeat](https://developer.mozilla.org/en-US/docs/Web/CSS/background-repeat) CSS value.
  43674. *
  43675. * @param {String} string
  43676. * @returns {Boolean}
  43677. */
  43678. function isRepeat( string ) {
  43679. return repeatValues.includes( string );
  43680. }
  43681. const positionValues = [ 'center', 'top', 'bottom', 'left', 'right' ];
  43682. /**
  43683. * Checks if string contains [background position](https://developer.mozilla.org/en-US/docs/Web/CSS/background-position) CSS value.
  43684. *
  43685. * @param {String} string
  43686. * @returns {Boolean}
  43687. */
  43688. function isPosition( string ) {
  43689. return positionValues.includes( string );
  43690. }
  43691. const attachmentValues = [ 'fixed', 'scroll', 'local' ];
  43692. /**
  43693. * Checks if string contains [background attachment](https://developer.mozilla.org/en-US/docs/Web/CSS/background-attachment) CSS value.
  43694. *
  43695. * @param {String} string
  43696. * @returns {Boolean}
  43697. */
  43698. function isAttachment( string ) {
  43699. return attachmentValues.includes( string );
  43700. }
  43701. const urlRegExp = /^url\(/;
  43702. /**
  43703. * Checks if string contains [URL](https://developer.mozilla.org/en-US/docs/Web/CSS/url) CSS value.
  43704. *
  43705. * @param {String} string
  43706. * @returns {Boolean}
  43707. */
  43708. function isURL( string ) {
  43709. return urlRegExp.test( string );
  43710. }
  43711. function getBoxSidesValues( value = '' ) {
  43712. if ( value === '' ) {
  43713. return { top: undefined, right: undefined, bottom: undefined, left: undefined };
  43714. }
  43715. const values = getShorthandValues( value );
  43716. const top = values[ 0 ];
  43717. const bottom = values[ 2 ] || top;
  43718. const right = values[ 1 ] || top;
  43719. const left = values[ 3 ] || right;
  43720. return { top, bottom, right, left };
  43721. }
  43722. /**
  43723. * Default reducer for CSS properties that concerns edges of a box
  43724. * [shorthand](https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties) notations:
  43725. *
  43726. * stylesProcessor.setReducer( 'padding', getBoxSidesValueReducer( 'padding' ) );
  43727. *
  43728. * @param {String} styleShorthand
  43729. * @returns {Function}
  43730. */
  43731. function getBoxSidesValueReducer( styleShorthand ) {
  43732. return value => {
  43733. const { top, right, bottom, left } = value;
  43734. const reduced = [];
  43735. if ( ![ top, right, left, bottom ].every( value => !!value ) ) {
  43736. if ( top ) {
  43737. reduced.push( [ styleShorthand + '-top', top ] );
  43738. }
  43739. if ( right ) {
  43740. reduced.push( [ styleShorthand + '-right', right ] );
  43741. }
  43742. if ( bottom ) {
  43743. reduced.push( [ styleShorthand + '-bottom', bottom ] );
  43744. }
  43745. if ( left ) {
  43746. reduced.push( [ styleShorthand + '-left', left ] );
  43747. }
  43748. } else {
  43749. reduced.push( [ styleShorthand, getBoxSidesShorthandValue( value ) ] );
  43750. }
  43751. return reduced;
  43752. };
  43753. }
  43754. /**
  43755. * Returns a [shorthand](https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties) notation
  43756. * of a CSS property value.
  43757. *
  43758. * getBoxSidesShorthandValue( { top: '1px', right: '1px', bottom: '2px', left: '1px' } );
  43759. * // will return '1px 1px 2px'
  43760. *
  43761. * @param {module:engine/view/stylesmap~BoxSides} styleShorthand
  43762. * @returns {Function}
  43763. */
  43764. function getBoxSidesShorthandValue( { top, right, bottom, left } ) {
  43765. const out = [];
  43766. if ( left !== right ) {
  43767. out.push( top, right, bottom, left );
  43768. } else if ( bottom !== top ) {
  43769. out.push( top, right, bottom );
  43770. } else if ( right !== top ) {
  43771. out.push( top, right );
  43772. } else {
  43773. out.push( top );
  43774. }
  43775. return out.join( ' ' );
  43776. }
  43777. /**
  43778. * Creates a normalizer for a [shorthand](https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties) 1-to-4 value.
  43779. *
  43780. * stylesProcessor.setNormalizer( 'margin', getPositionShorthandNormalizer( 'margin' ) );
  43781. *
  43782. * @param {String} shorthand
  43783. * @returns {Function}
  43784. */
  43785. function getPositionShorthandNormalizer( shorthand ) {
  43786. return value => {
  43787. return {
  43788. path: shorthand,
  43789. value: getBoxSidesValues( value )
  43790. };
  43791. };
  43792. }
  43793. /**
  43794. * Parses parts of a 1-to-4 value notation - handles some CSS values with spaces (like RGB()).
  43795. *
  43796. * getShorthandValues( 'red blue RGB(0, 0, 0)');
  43797. * // will return [ 'red', 'blue', 'RGB(0, 0, 0)' ]
  43798. *
  43799. * @param {String} string
  43800. * @returns {Array.<String>}
  43801. */
  43802. function getShorthandValues( string ) {
  43803. return string
  43804. .replace( /, /g, ',' ) // Exclude comma from spaces evaluation as values are separated by spaces.
  43805. .split( ' ' )
  43806. .map( string => string.replace( /,/g, ', ' ) ); // Restore original notation.
  43807. }
  43808. /***/ }),
  43809. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/stylesmap.js":
  43810. /*!***********************************************************************!*\
  43811. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/stylesmap.js ***!
  43812. \***********************************************************************/
  43813. /*! exports provided: default, StylesProcessor */
  43814. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43815. "use strict";
  43816. __webpack_require__.r(__webpack_exports__);
  43817. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return StylesMap; });
  43818. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StylesProcessor", function() { return StylesProcessor; });
  43819. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  43820. /**
  43821. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  43822. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  43823. */
  43824. /**
  43825. * @module engine/view/stylesmap
  43826. */
  43827. /**
  43828. * Styles map. Allows handling (adding, removing, retrieving) a set of style rules (usually, of an element).
  43829. *
  43830. * The styles map is capable of normalizing style names so e.g. the following operations are possible:
  43831. */
  43832. class StylesMap {
  43833. /**
  43834. * Creates Styles instance.
  43835. *
  43836. * @param {module:engine/view/stylesmap~StylesProcessor} styleProcessor
  43837. */
  43838. constructor( styleProcessor ) {
  43839. /**
  43840. * Keeps an internal representation of styles map. Normalized styles are kept as object tree to allow unified modification and
  43841. * value access model using lodash's get, set, unset, etc methods.
  43842. *
  43843. * When no style processor rules are defined the it acts as simple key-value storage.
  43844. *
  43845. * @private
  43846. * @type {Object}
  43847. */
  43848. this._styles = {};
  43849. /**
  43850. * An instance of the {@link module:engine/view/stylesmap~StylesProcessor}.
  43851. *
  43852. * @private
  43853. * @member {module:engine/view/stylesmap~StylesProcessor}
  43854. */
  43855. this._styleProcessor = styleProcessor;
  43856. }
  43857. /**
  43858. * Returns true if style map has no styles set.
  43859. *
  43860. * @returns {Boolean}
  43861. */
  43862. get isEmpty() {
  43863. const entries = Object.entries( this._styles );
  43864. const from = Array.from( entries );
  43865. return !from.length;
  43866. }
  43867. /**
  43868. * Number of styles defined.
  43869. *
  43870. * @type {Number}
  43871. */
  43872. get size() {
  43873. if ( this.isEmpty ) {
  43874. return 0;
  43875. }
  43876. return this.getStyleNames().length;
  43877. }
  43878. /**
  43879. * Set styles map to a new value.
  43880. *
  43881. * styles.setTo( 'border:1px solid blue;margin-top:1px;' );
  43882. *
  43883. * @param {String} inlineStyle
  43884. */
  43885. setTo( inlineStyle ) {
  43886. this.clear();
  43887. const parsedStyles = Array.from( parseInlineStyles( inlineStyle ).entries() );
  43888. for ( const [ key, value ] of parsedStyles ) {
  43889. this._styleProcessor.toNormalizedForm( key, value, this._styles );
  43890. }
  43891. }
  43892. /**
  43893. * Checks if a given style is set.
  43894. *
  43895. * styles.setTo( 'margin-left:1px;' );
  43896. *
  43897. * styles.has( 'margin-left' ); // -> true
  43898. * styles.has( 'padding' ); // -> false
  43899. *
  43900. * **Note**: This check supports normalized style names.
  43901. *
  43902. * // Enable 'margin' shorthand processing:
  43903. * editor.data.addStyleProcessorRules( addMarginRules );
  43904. *
  43905. * styles.setTo( 'margin:2px;' );
  43906. *
  43907. * styles.has( 'margin' ); // -> true
  43908. * styles.has( 'margin-top' ); // -> true
  43909. * styles.has( 'margin-left' ); // -> true
  43910. *
  43911. * styles.remove( 'margin-top' );
  43912. *
  43913. * styles.has( 'margin' ); // -> false
  43914. * styles.has( 'margin-top' ); // -> false
  43915. * styles.has( 'margin-left' ); // -> true
  43916. *
  43917. * @param {String} name Style name.
  43918. * @returns {Boolean}
  43919. */
  43920. has( name ) {
  43921. if ( this.isEmpty ) {
  43922. return false;
  43923. }
  43924. const styles = this._styleProcessor.getReducedForm( name, this._styles );
  43925. const propertyDescriptor = styles.find( ( [ property ] ) => property === name );
  43926. // Only return a value if it is set;
  43927. return Array.isArray( propertyDescriptor );
  43928. }
  43929. /**
  43930. * Sets a given style.
  43931. *
  43932. * Can insert one by one:
  43933. *
  43934. * styles.set( 'color', 'blue' );
  43935. * styles.set( 'margin-right', '1em' );
  43936. *
  43937. * or many styles at once:
  43938. *
  43939. * styles.set( {
  43940. * color: 'blue',
  43941. * 'margin-right': '1em'
  43942. * } );
  43943. *
  43944. * ***Note**:* This method uses {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules
  43945. * enabled style processor rules} to normalize passed values.
  43946. *
  43947. * // Enable 'margin' shorthand processing:
  43948. * editor.data.addStyleProcessorRules( addMarginRules );
  43949. *
  43950. * styles.set( 'margin', '2px' );
  43951. *
  43952. * The above code will set margin to:
  43953. *
  43954. * styles.getNormalized( 'margin' );
  43955. * // -> { top: '2px', right: '2px', bottom: '2px', left: '2px' }
  43956. *
  43957. * Which makes it possible to retrieve a "sub-value":
  43958. *
  43959. * styles.get( 'margin-left' ); // -> '2px'
  43960. *
  43961. * Or modify it:
  43962. *
  43963. * styles.remove( 'margin-left' );
  43964. *
  43965. * styles.getNormalized( 'margin' ); // -> { top: '1px', bottom: '1px', right: '1px' }
  43966. * styles.toString(); // -> 'margin-bottom:1px;margin-right:1px;margin-top:1px;'
  43967. *
  43968. * This method also allows to set normalized values directly (if a particular styles processor rule was enabled):
  43969. *
  43970. * styles.set( 'border-color', { top: 'blue' } );
  43971. * styles.set( 'margin', { right: '2em' } );
  43972. *
  43973. * styles.toString(); // -> 'border-color-top:blue;margin-right:2em;'
  43974. *
  43975. * @param {String|Object} nameOrObject Style property name or object with multiple properties.
  43976. * @param {String|Object} valueOrObject Value to set.
  43977. */
  43978. set( nameOrObject, valueOrObject ) {
  43979. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isObject"])( nameOrObject ) ) {
  43980. for ( const [ key, value ] of Object.entries( nameOrObject ) ) {
  43981. this._styleProcessor.toNormalizedForm( key, value, this._styles );
  43982. }
  43983. } else {
  43984. this._styleProcessor.toNormalizedForm( nameOrObject, valueOrObject, this._styles );
  43985. }
  43986. }
  43987. /**
  43988. * Removes given style.
  43989. *
  43990. * styles.setTo( 'background:#f00;margin-right:2px;' );
  43991. *
  43992. * styles.remove( 'background' );
  43993. *
  43994. * styles.toString(); // -> 'margin-right:2px;'
  43995. *
  43996. * ***Note**:* This method uses {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules
  43997. * enabled style processor rules} to normalize passed values.
  43998. *
  43999. * // Enable 'margin' shorthand processing:
  44000. * editor.data.addStyleProcessorRules( addMarginRules );
  44001. *
  44002. * styles.setTo( 'margin:1px' );
  44003. *
  44004. * styles.remove( 'margin-top' );
  44005. * styles.remove( 'margin-right' );
  44006. *
  44007. * styles.toString(); // -> 'margin-bottom:1px;margin-left:1px;'
  44008. *
  44009. * @param {String} name Style name.
  44010. */
  44011. remove( name ) {
  44012. const path = toPath( name );
  44013. Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["unset"])( this._styles, path );
  44014. delete this._styles[ name ];
  44015. this._cleanEmptyObjectsOnPath( path );
  44016. }
  44017. /**
  44018. * Returns a normalized style object or a single value.
  44019. *
  44020. * // Enable 'margin' shorthand processing:
  44021. * editor.data.addStyleProcessorRules( addMarginRules );
  44022. *
  44023. * const styles = new Styles();
  44024. * styles.setTo( 'margin:1px 2px 3em;' );
  44025. *
  44026. * styles.getNormalized( 'margin' );
  44027. * // will log:
  44028. * // {
  44029. * // top: '1px',
  44030. * // right: '2px',
  44031. * // bottom: '3em',
  44032. * // left: '2px' // normalized value from margin shorthand
  44033. * // }
  44034. *
  44035. * styles.getNormalized( 'margin-left' ); // -> '2px'
  44036. *
  44037. * **Note**: This method will only return normalized styles if a style processor was defined.
  44038. *
  44039. * @param {String} name Style name.
  44040. * @returns {Object|String|undefined}
  44041. */
  44042. getNormalized( name ) {
  44043. return this._styleProcessor.getNormalized( name, this._styles );
  44044. }
  44045. /**
  44046. * Returns a normalized style string. Styles are sorted by name.
  44047. *
  44048. * styles.set( 'margin' , '1px' );
  44049. * styles.set( 'background', '#f00' );
  44050. *
  44051. * styles.toString(); // -> 'background:#f00;margin:1px;'
  44052. *
  44053. * **Note**: This method supports normalized styles if defined.
  44054. *
  44055. * // Enable 'margin' shorthand processing:
  44056. * editor.data.addStyleProcessorRules( addMarginRules );
  44057. *
  44058. * styles.set( 'margin' , '1px' );
  44059. * styles.set( 'background', '#f00' );
  44060. * styles.remove( 'margin-top' );
  44061. * styles.remove( 'margin-right' );
  44062. *
  44063. * styles.toString(); // -> 'background:#f00;margin-bottom:1px;margin-left:1px;'
  44064. *
  44065. * @returns {String}
  44066. */
  44067. toString() {
  44068. if ( this.isEmpty ) {
  44069. return '';
  44070. }
  44071. return this._getStylesEntries()
  44072. .map( arr => arr.join( ':' ) )
  44073. .sort()
  44074. .join( ';' ) + ';';
  44075. }
  44076. /**
  44077. * Returns property as a value string or undefined if property is not set.
  44078. *
  44079. * // Enable 'margin' shorthand processing:
  44080. * editor.data.addStyleProcessorRules( addMarginRules );
  44081. *
  44082. * const styles = new Styles();
  44083. * styles.setTo( 'margin:1px;' );
  44084. * styles.set( 'margin-bottom', '3em' );
  44085. *
  44086. * styles.getAsString( 'margin' ); // -> 'margin: 1px 1px 3em;'
  44087. *
  44088. * Note, however, that all sub-values must be set for the longhand property name to return a value:
  44089. *
  44090. * const styles = new Styles();
  44091. * styles.setTo( 'margin:1px;' );
  44092. * styles.remove( 'margin-bottom' );
  44093. *
  44094. * styles.getAsString( 'margin' ); // -> undefined
  44095. *
  44096. * In the above scenario, it is not possible to return a `margin` value, so `undefined` is returned.
  44097. * Instead, you should use:
  44098. *
  44099. * const styles = new Styles();
  44100. * styles.setTo( 'margin:1px;' );
  44101. * styles.remove( 'margin-bottom' );
  44102. *
  44103. * for ( const styleName of styles.getStyleNames() ) {
  44104. * console.log( styleName, styles.getAsString( styleName ) );
  44105. * }
  44106. * // 'margin-top', '1px'
  44107. * // 'margin-right', '1px'
  44108. * // 'margin-left', '1px'
  44109. *
  44110. * In general, it is recommend to iterate over style names like in the example above. This way, you will always get all
  44111. * the currently set style values. So, if all the 4 margin values would be set
  44112. * the for-of loop above would yield only `'margin'`, `'1px'`:
  44113. *
  44114. * const styles = new Styles();
  44115. * styles.setTo( 'margin:1px;' );
  44116. *
  44117. * for ( const styleName of styles.getStyleNames() ) {
  44118. * console.log( styleName, styles.getAsString( styleName ) );
  44119. * }
  44120. * // 'margin', '1px'
  44121. *
  44122. * **Note**: To get a normalized version of a longhand property use the {@link #getNormalized `#getNormalized()`} method.
  44123. *
  44124. * @param {String} propertyName
  44125. * @returns {String|undefined}
  44126. */
  44127. getAsString( propertyName ) {
  44128. if ( this.isEmpty ) {
  44129. return;
  44130. }
  44131. if ( this._styles[ propertyName ] && !Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isObject"])( this._styles[ propertyName ] ) ) {
  44132. // Try return styles set directly - values that are not parsed.
  44133. return this._styles[ propertyName ];
  44134. }
  44135. const styles = this._styleProcessor.getReducedForm( propertyName, this._styles );
  44136. const propertyDescriptor = styles.find( ( [ property ] ) => property === propertyName );
  44137. // Only return a value if it is set;
  44138. if ( Array.isArray( propertyDescriptor ) ) {
  44139. return propertyDescriptor[ 1 ];
  44140. }
  44141. }
  44142. /**
  44143. * Returns style property names as they would appear when using {@link #toString `#toString()`}.
  44144. *
  44145. * @returns {Array.<String>}
  44146. */
  44147. getStyleNames() {
  44148. if ( this.isEmpty ) {
  44149. return [];
  44150. }
  44151. const entries = this._getStylesEntries();
  44152. return entries.map( ( [ key ] ) => key );
  44153. }
  44154. /**
  44155. * Removes all styles.
  44156. */
  44157. clear() {
  44158. this._styles = {};
  44159. }
  44160. /**
  44161. * Returns normalized styles entries for further processing.
  44162. *
  44163. * @private
  44164. * @returns {Array.<module:engine/view/stylesmap~PropertyDescriptor>}
  44165. */
  44166. _getStylesEntries() {
  44167. const parsed = [];
  44168. const keys = Object.keys( this._styles );
  44169. for ( const key of keys ) {
  44170. parsed.push( ...this._styleProcessor.getReducedForm( key, this._styles ) );
  44171. }
  44172. return parsed;
  44173. }
  44174. /**
  44175. * Removes empty objects upon removing an entry from internal object.
  44176. *
  44177. * @param {String} path
  44178. * @private
  44179. */
  44180. _cleanEmptyObjectsOnPath( path ) {
  44181. const pathParts = path.split( '.' );
  44182. const isChildPath = pathParts.length > 1;
  44183. if ( !isChildPath ) {
  44184. return;
  44185. }
  44186. const parentPath = pathParts.splice( 0, pathParts.length - 1 ).join( '.' );
  44187. const parentObject = Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["get"])( this._styles, parentPath );
  44188. if ( !parentObject ) {
  44189. return;
  44190. }
  44191. const isParentEmpty = !Array.from( Object.keys( parentObject ) ).length;
  44192. if ( isParentEmpty ) {
  44193. this.remove( parentPath );
  44194. }
  44195. }
  44196. }
  44197. /**
  44198. * Style processor is responsible for writing and reading a normalized styles object.
  44199. */
  44200. class StylesProcessor {
  44201. /**
  44202. * Creates StylesProcessor instance.
  44203. *
  44204. * @private
  44205. */
  44206. constructor() {
  44207. this._normalizers = new Map();
  44208. this._extractors = new Map();
  44209. this._reducers = new Map();
  44210. this._consumables = new Map();
  44211. }
  44212. /**
  44213. * Parse style string value to a normalized object and appends it to styles object.
  44214. *
  44215. * const styles = {};
  44216. *
  44217. * stylesProcessor.toNormalizedForm( 'margin', '1px', styles );
  44218. *
  44219. * // styles will consist: { margin: { top: '1px', right: '1px', bottom: '1px', left: '1px; } }
  44220. *
  44221. * **Note**: To define normalizer callbacks use {@link #setNormalizer}.
  44222. *
  44223. * @param {String} name Name of style property.
  44224. * @param {String} propertyValue Value of style property.
  44225. * @param {Object} styles Object holding normalized styles.
  44226. */
  44227. toNormalizedForm( name, propertyValue, styles ) {
  44228. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isObject"])( propertyValue ) ) {
  44229. appendStyleValue( styles, toPath( name ), propertyValue );
  44230. return;
  44231. }
  44232. if ( this._normalizers.has( name ) ) {
  44233. const normalizer = this._normalizers.get( name );
  44234. const { path, value } = normalizer( propertyValue );
  44235. appendStyleValue( styles, path, value );
  44236. } else {
  44237. appendStyleValue( styles, name, propertyValue );
  44238. }
  44239. }
  44240. /**
  44241. * Returns a normalized version of a style property.
  44242. * const styles = {
  44243. * margin: { top: '1px', right: '1px', bottom: '1px', left: '1px; },
  44244. * background: { color: '#f00' }
  44245. * };
  44246. *
  44247. * stylesProcessor.getNormalized( 'background' );
  44248. * // will return: { color: '#f00' }
  44249. *
  44250. * stylesProcessor.getNormalized( 'margin-top' );
  44251. * // will return: '1px'
  44252. *
  44253. * **Note**: In some cases extracting single value requires defining an extractor callback {@link #setExtractor}.
  44254. *
  44255. * @param {String} name Name of style property.
  44256. * @param {Object} styles Object holding normalized styles.
  44257. * @returns {*}
  44258. */
  44259. getNormalized( name, styles ) {
  44260. if ( !name ) {
  44261. return Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["merge"])( {}, styles );
  44262. }
  44263. // Might be empty string.
  44264. if ( styles[ name ] !== undefined ) {
  44265. return styles[ name ];
  44266. }
  44267. if ( this._extractors.has( name ) ) {
  44268. const extractor = this._extractors.get( name );
  44269. if ( typeof extractor === 'string' ) {
  44270. return Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["get"])( styles, extractor );
  44271. }
  44272. const value = extractor( name, styles );
  44273. if ( value ) {
  44274. return value;
  44275. }
  44276. }
  44277. return Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["get"])( styles, toPath( name ) );
  44278. }
  44279. /**
  44280. * Returns a reduced form of style property form normalized object.
  44281. *
  44282. * For default margin reducer, the below code:
  44283. *
  44284. * stylesProcessor.getReducedForm( 'margin', {
  44285. * margin: { top: '1px', right: '1px', bottom: '2px', left: '1px; }
  44286. * } );
  44287. *
  44288. * will return:
  44289. *
  44290. * [
  44291. * [ 'margin', '1px 1px 2px' ]
  44292. * ]
  44293. *
  44294. * because it might be represented as a shorthand 'margin' value. However if one of margin long hand values is missing it should return:
  44295. *
  44296. * [
  44297. * [ 'margin-top', '1px' ],
  44298. * [ 'margin-right', '1px' ],
  44299. * [ 'margin-bottom', '2px' ]
  44300. * // the 'left' value is missing - cannot use 'margin' shorthand.
  44301. * ]
  44302. *
  44303. * **Note**: To define reducer callbacks use {@link #setReducer}.
  44304. *
  44305. * @param {String} name
  44306. * @param {String} name Name of style property.
  44307. * @param {Object} styles Object holding normalized styles.
  44308. * @returns {Array.<module:engine/view/stylesmap~PropertyDescriptor>}
  44309. */
  44310. getReducedForm( name, styles ) {
  44311. const normalizedValue = this.getNormalized( name, styles );
  44312. // Might be empty string.
  44313. if ( normalizedValue === undefined ) {
  44314. return [];
  44315. }
  44316. if ( this._reducers.has( name ) ) {
  44317. const reducer = this._reducers.get( name );
  44318. return reducer( normalizedValue );
  44319. }
  44320. return [ [ name, normalizedValue ] ];
  44321. }
  44322. /**
  44323. * Returns related style names.
  44324. *
  44325. * stylesProcessor.getRelatedStyles( 'margin' );
  44326. * // will return: [ 'margin-top', 'margin-right', 'margin-bottom', 'margin-left' ];
  44327. *
  44328. * stylesProcessor.getRelatedStyles( 'margin-top' );
  44329. * // will return: [ 'margin' ];
  44330. *
  44331. * **Note**: To define new style relations load an existing style processor or use
  44332. * {@link module:engine/view/stylesmap~StylesProcessor#setStyleRelation `StylesProcessor.setStyleRelation()`}.
  44333. *
  44334. * @param {String} name
  44335. * @returns {Array.<String>}
  44336. */
  44337. getRelatedStyles( name ) {
  44338. return this._consumables.get( name ) || [];
  44339. }
  44340. /**
  44341. * Adds a normalizer method for a style property.
  44342. *
  44343. * A normalizer returns describing how the value should be normalized.
  44344. *
  44345. * For instance 'margin' style is a shorthand for four margin values:
  44346. *
  44347. * - 'margin-top'
  44348. * - 'margin-right'
  44349. * - 'margin-bottom'
  44350. * - 'margin-left'
  44351. *
  44352. * and can be written in various ways if some values are equal to others. For instance `'margin: 1px 2em;'` is a shorthand for
  44353. * `'margin-top: 1px;margin-right: 2em;margin-bottom: 1px;margin-left: 2em'`.
  44354. *
  44355. * A normalizer should parse various margin notations as a single object:
  44356. *
  44357. * const styles = {
  44358. * margin: {
  44359. * top: '1px',
  44360. * right: '2em',
  44361. * bottom: '1px',
  44362. * left: '2em'
  44363. * }
  44364. * };
  44365. *
  44366. * Thus a normalizer for 'margin' style should return an object defining style path and value to store:
  44367. *
  44368. * const returnValue = {
  44369. * path: 'margin',
  44370. * value: {
  44371. * top: '1px',
  44372. * right: '2em',
  44373. * bottom: '1px',
  44374. * left: '2em'
  44375. * }
  44376. * };
  44377. *
  44378. * Additionally to fully support all margin notations there should be also defined 4 normalizers for longhand margin notations. Below
  44379. * is an example for 'margin-top' style property normalizer:
  44380. *
  44381. * stylesProcessor.setNormalizer( 'margin-top', valueString => {
  44382. * return {
  44383. * path: 'margin.top',
  44384. * value: valueString
  44385. * }
  44386. * } );
  44387. *
  44388. * @param {String} name
  44389. * @param {Function} callback
  44390. */
  44391. setNormalizer( name, callback ) {
  44392. this._normalizers.set( name, callback );
  44393. }
  44394. /**
  44395. * Adds a extractor callback for a style property.
  44396. *
  44397. * Most normalized style values are stored as one level objects. It is assumed that `'margin-top'` style will be stored as:
  44398. *
  44399. * const styles = {
  44400. * margin: {
  44401. * top: 'value'
  44402. * }
  44403. * }
  44404. *
  44405. * However, some styles can have conflicting notations and thus it might be harder to extract a style value from shorthand. For instance
  44406. * the 'border-top-style' can be defined using `'border-top:solid'`, `'border-style:solid none none none'` or by `'border:solid'`
  44407. * shorthands. The default border styles processors stores styles as:
  44408. *
  44409. * const styles = {
  44410. * border: {
  44411. * style: {
  44412. * top: 'solid'
  44413. * }
  44414. * }
  44415. * }
  44416. *
  44417. * as it is better to modify border style independently from other values. On the other part the output of the border might be
  44418. * desired as `border-top`, `border-left`, etc notation.
  44419. *
  44420. * In the above example a reducer should return a side border value that combines style, color and width:
  44421. *
  44422. * styleProcessor.setExtractor( 'border-top', styles => {
  44423. * return {
  44424. * color: styles.border.color.top,
  44425. * style: styles.border.style.top,
  44426. * width: styles.border.width.top
  44427. * }
  44428. * } );
  44429. *
  44430. * @param {String} name
  44431. * @param {Function|String} callbackOrPath Callback that return a requested value or path string for single values.
  44432. */
  44433. setExtractor( name, callbackOrPath ) {
  44434. this._extractors.set( name, callbackOrPath );
  44435. }
  44436. /**
  44437. * Adds a reducer callback for a style property.
  44438. *
  44439. * Reducer returns a minimal notation for given style name. For longhand properties it is not required to write a reducer as
  44440. * by default the direct value from style path is taken.
  44441. *
  44442. * For shorthand styles a reducer should return minimal style notation either by returning single name-value tuple or multiple tuples
  44443. * if a shorthand cannot be used. For instance for a margin shorthand a reducer might return:
  44444. *
  44445. * const marginShortHandTuple = [
  44446. * [ 'margin', '1px 1px 2px' ]
  44447. * ];
  44448. *
  44449. * or a longhand tuples for defined values:
  44450. *
  44451. * // Considering margin.bottom and margin.left are undefined.
  44452. * const marginLonghandsTuples = [
  44453. * [ 'margin-top', '1px' ],
  44454. * [ 'margin-right', '1px' ]
  44455. * ];
  44456. *
  44457. * A reducer obtains a normalized style value:
  44458. *
  44459. * // Simplified reducer that always outputs 4 values which are always present:
  44460. * stylesProcessor.setReducer( 'margin', margin => {
  44461. * return [
  44462. * [ 'margin', `${ margin.top } ${ margin.right } ${ margin.bottom } ${ margin.left }` ]
  44463. * ]
  44464. * } );
  44465. *
  44466. * @param {String} name
  44467. * @param {Function} callback
  44468. */
  44469. setReducer( name, callback ) {
  44470. this._reducers.set( name, callback );
  44471. }
  44472. /**
  44473. * Defines a style shorthand relation to other style notations.
  44474. *
  44475. * stylesProcessor.setStyleRelation( 'margin', [
  44476. * 'margin-top',
  44477. * 'margin-right',
  44478. * 'margin-bottom',
  44479. * 'margin-left'
  44480. * ] );
  44481. *
  44482. * This enables expanding of style names for shorthands. For instance, if defined,
  44483. * {@link module:engine/conversion/viewconsumable~ViewConsumable view consumable} items are automatically created
  44484. * for long-hand margin style notation alongside the `'margin'` item.
  44485. *
  44486. * This means that when an element being converted has a style `margin`, a converter for `margin-left` will work just
  44487. * fine since the view consumable will contain a consumable `margin-left` item (thanks to the relation) and
  44488. * `element.getStyle( 'margin-left' )` will work as well assuming that the style processor was correctly configured.
  44489. * However, once `margin-left` is consumed, `margin` will not be consumable anymore.
  44490. *
  44491. * @param {String} shorthandName
  44492. * @param {Array.<String>} styleNames
  44493. */
  44494. setStyleRelation( shorthandName, styleNames ) {
  44495. this._mapStyleNames( shorthandName, styleNames );
  44496. for ( const alsoName of styleNames ) {
  44497. this._mapStyleNames( alsoName, [ shorthandName ] );
  44498. }
  44499. }
  44500. /**
  44501. * Set two-way binding of style names.
  44502. *
  44503. * @param {String} name
  44504. * @param {Array.<String>} styleNames
  44505. * @private
  44506. */
  44507. _mapStyleNames( name, styleNames ) {
  44508. if ( !this._consumables.has( name ) ) {
  44509. this._consumables.set( name, [] );
  44510. }
  44511. this._consumables.get( name ).push( ...styleNames );
  44512. }
  44513. }
  44514. // Parses inline styles and puts property - value pairs into styles map.
  44515. //
  44516. // @param {String} stylesString Styles to parse.
  44517. // @returns {Map.<String, String>} stylesMap Map of parsed properties and values.
  44518. function parseInlineStyles( stylesString ) {
  44519. // `null` if no quote was found in input string or last found quote was a closing quote. See below.
  44520. let quoteType = null;
  44521. let propertyNameStart = 0;
  44522. let propertyValueStart = 0;
  44523. let propertyName = null;
  44524. const stylesMap = new Map();
  44525. // Do not set anything if input string is empty.
  44526. if ( stylesString === '' ) {
  44527. return stylesMap;
  44528. }
  44529. // Fix inline styles that do not end with `;` so they are compatible with algorithm below.
  44530. if ( stylesString.charAt( stylesString.length - 1 ) != ';' ) {
  44531. stylesString = stylesString + ';';
  44532. }
  44533. // Seek the whole string for "special characters".
  44534. for ( let i = 0; i < stylesString.length; i++ ) {
  44535. const char = stylesString.charAt( i );
  44536. if ( quoteType === null ) {
  44537. // No quote found yet or last found quote was a closing quote.
  44538. switch ( char ) {
  44539. case ':':
  44540. // Most of time colon means that property name just ended.
  44541. // Sometimes however `:` is found inside property value (for example in background image url).
  44542. if ( !propertyName ) {
  44543. // Treat this as end of property only if property name is not already saved.
  44544. // Save property name.
  44545. propertyName = stylesString.substr( propertyNameStart, i - propertyNameStart );
  44546. // Save this point as the start of property value.
  44547. propertyValueStart = i + 1;
  44548. }
  44549. break;
  44550. case '"':
  44551. case '\'':
  44552. // Opening quote found (this is an opening quote, because `quoteType` is `null`).
  44553. quoteType = char;
  44554. break;
  44555. case ';': {
  44556. // Property value just ended.
  44557. // Use previously stored property value start to obtain property value.
  44558. const propertyValue = stylesString.substr( propertyValueStart, i - propertyValueStart );
  44559. if ( propertyName ) {
  44560. // Save parsed part.
  44561. stylesMap.set( propertyName.trim(), propertyValue.trim() );
  44562. }
  44563. propertyName = null;
  44564. // Save this point as property name start. Property name starts immediately after previous property value ends.
  44565. propertyNameStart = i + 1;
  44566. break;
  44567. }
  44568. }
  44569. } else if ( char === quoteType ) {
  44570. // If a quote char is found and it is a closing quote, mark this fact by `null`-ing `quoteType`.
  44571. quoteType = null;
  44572. }
  44573. }
  44574. return stylesMap;
  44575. }
  44576. // Return lodash compatible path from style name.
  44577. function toPath( name ) {
  44578. return name.replace( '-', '.' );
  44579. }
  44580. // Appends style definition to the styles object.
  44581. //
  44582. // @param {String} nameOrPath
  44583. // @param {String|Object} valueOrObject
  44584. // @private
  44585. function appendStyleValue( stylesObject, nameOrPath, valueOrObject ) {
  44586. let valueToSet = valueOrObject;
  44587. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isObject"])( valueOrObject ) ) {
  44588. valueToSet = Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["merge"])( {}, Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["get"])( stylesObject, nameOrPath ), valueOrObject );
  44589. }
  44590. Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["set"])( stylesObject, nameOrPath, valueToSet );
  44591. }
  44592. /**
  44593. * A CSS style property descriptor that contains tuplet of two strings:
  44594. *
  44595. * - first string describes property name
  44596. * - second string describes property value
  44597. *
  44598. * const marginDescriptor = [ 'margin', '2px 3em' ];
  44599. * const marginTopDescriptor = [ 'margin-top', '2px' ];
  44600. *
  44601. * @typedef {Array.<String, String>} module:engine/view/stylesmap~PropertyDescriptor
  44602. */
  44603. /**
  44604. * An object describing values associated with the sides of a box, for instance margins, paddings,
  44605. * border widths, border colors, etc.
  44606. *
  44607. * const margin = {
  44608. * top: '1px',
  44609. * right: '3px',
  44610. * bottom: '3px',
  44611. * left: '7px'
  44612. * };
  44613. *
  44614. * const borderColor = {
  44615. * top: 'red',
  44616. * right: 'blue',
  44617. * bottom: 'blue',
  44618. * left: 'red'
  44619. * };
  44620. *
  44621. * @typedef {Object} module:engine/view/stylesmap~BoxSides
  44622. *
  44623. * @property {String} top Top side value.
  44624. * @property {String} right Right side value.
  44625. * @property {String} bottom Bottom side value.
  44626. * @property {String} left Left side value.
  44627. */
  44628. /***/ }),
  44629. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js":
  44630. /*!******************************************************************!*\
  44631. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js ***!
  44632. \******************************************************************/
  44633. /*! exports provided: default */
  44634. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44635. "use strict";
  44636. __webpack_require__.r(__webpack_exports__);
  44637. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Text; });
  44638. /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/node.js");
  44639. /**
  44640. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  44641. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  44642. */
  44643. /**
  44644. * @module engine/view/text
  44645. */
  44646. /**
  44647. * Tree view text node.
  44648. *
  44649. * The constructor of this class should not be used directly. To create a new text node instance
  44650. * use the {@link module:engine/view/downcastwriter~DowncastWriter#createText `DowncastWriter#createText()`}
  44651. * method when working on data downcasted from the model or the
  44652. * {@link module:engine/view/upcastwriter~UpcastWriter#createText `UpcastWriter#createText()`}
  44653. * method when working on non-semantic views.
  44654. *
  44655. * @extends module:engine/view/node~Node
  44656. */
  44657. class Text extends _node__WEBPACK_IMPORTED_MODULE_0__["default"] {
  44658. /**
  44659. * Creates a tree view text node.
  44660. *
  44661. * @protected
  44662. * @param {module:engine/view/document~Document} document The document instance to which this text node belongs.
  44663. * @param {String} data The text's data.
  44664. */
  44665. constructor( document, data ) {
  44666. super( document );
  44667. /**
  44668. * The text content.
  44669. *
  44670. * Setting the data fires the {@link module:engine/view/node~Node#event:change:text change event}.
  44671. *
  44672. * @protected
  44673. * @member {String} module:engine/view/text~Text#_textData
  44674. */
  44675. this._textData = data;
  44676. }
  44677. /**
  44678. * Checks whether this object is of the given type.
  44679. *
  44680. * text.is( '$text' ); // -> true
  44681. * text.is( 'node' ); // -> true
  44682. * text.is( 'view:$text' ); // -> true
  44683. * text.is( 'view:node' ); // -> true
  44684. *
  44685. * text.is( 'model:$text' ); // -> false
  44686. * text.is( 'element' ); // -> false
  44687. * text.is( 'range' ); // -> false
  44688. *
  44689. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  44690. *
  44691. * **Note:** Until version 20.0.0 this method wasn't accepting `'$text'` type. The legacy `'text'` type is still
  44692. * accepted for backward compatibility.
  44693. *
  44694. * @param {String} type Type to check.
  44695. * @returns {Boolean}
  44696. */
  44697. is( type ) {
  44698. return type === '$text' || type === 'view:$text' ||
  44699. // This are legacy values kept for backward compatibility.
  44700. type === 'text' || type === 'view:text' ||
  44701. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  44702. type === 'node' || type === 'view:node';
  44703. }
  44704. /**
  44705. * The text content.
  44706. *
  44707. * @readonly
  44708. * @type {String}
  44709. */
  44710. get data() {
  44711. return this._textData;
  44712. }
  44713. /**
  44714. * The `_data` property is controlled by a getter and a setter.
  44715. *
  44716. * The getter is required when using the addition assignment operator on protected property:
  44717. *
  44718. * const foo = downcastWriter.createText( 'foo' );
  44719. * const bar = downcastWriter.createText( 'bar' );
  44720. *
  44721. * foo._data += bar.data; // executes: `foo._data = foo._data + bar.data`
  44722. * console.log( foo.data ); // prints: 'foobar'
  44723. *
  44724. * If the protected getter didn't exist, `foo._data` will return `undefined` and result of the merge will be invalid.
  44725. *
  44726. * The setter sets data and fires the {@link module:engine/view/node~Node#event:change:text change event}.
  44727. *
  44728. * @protected
  44729. * @type {String}
  44730. */
  44731. get _data() {
  44732. return this.data;
  44733. }
  44734. set _data( data ) {
  44735. this._fireChange( 'text', this );
  44736. this._textData = data;
  44737. }
  44738. /**
  44739. * Checks if this text node is similar to other text node.
  44740. * Both nodes should have the same data to be considered as similar.
  44741. *
  44742. * @param {module:engine/view/text~Text} otherNode Node to check if it is same as this node.
  44743. * @returns {Boolean}
  44744. */
  44745. isSimilar( otherNode ) {
  44746. if ( !( otherNode instanceof Text ) ) {
  44747. return false;
  44748. }
  44749. return this === otherNode || this.data === otherNode.data;
  44750. }
  44751. /**
  44752. * Clones this node.
  44753. *
  44754. * @protected
  44755. * @returns {module:engine/view/text~Text} Text node that is a clone of this node.
  44756. */
  44757. _clone() {
  44758. return new Text( this.document, this.data );
  44759. }
  44760. // @if CK_DEBUG_ENGINE // toString() {
  44761. // @if CK_DEBUG_ENGINE // return `#${ this.data }`;
  44762. // @if CK_DEBUG_ENGINE // }
  44763. // @if CK_DEBUG_ENGINE // log() {
  44764. // @if CK_DEBUG_ENGINE // console.log( 'ViewText: ' + this );
  44765. // @if CK_DEBUG_ENGINE // }
  44766. // @if CK_DEBUG_ENGINE // logExtended() {
  44767. // @if CK_DEBUG_ENGINE // console.log( 'ViewText: ' + this );
  44768. // @if CK_DEBUG_ENGINE // }
  44769. }
  44770. /***/ }),
  44771. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/textproxy.js":
  44772. /*!***********************************************************************!*\
  44773. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/textproxy.js ***!
  44774. \***********************************************************************/
  44775. /*! exports provided: default */
  44776. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44777. "use strict";
  44778. __webpack_require__.r(__webpack_exports__);
  44779. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TextProxy; });
  44780. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  44781. /**
  44782. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  44783. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  44784. */
  44785. /**
  44786. * @module engine/view/textproxy
  44787. */
  44788. /**
  44789. * TextProxy is a wrapper for substring of {@link module:engine/view/text~Text}. Instance of this class is created by
  44790. * {@link module:engine/view/treewalker~TreeWalker} when only a part of {@link module:engine/view/text~Text} needs to be returned.
  44791. *
  44792. * `TextProxy` has an API similar to {@link module:engine/view/text~Text Text} and allows to do most of the common tasks performed
  44793. * on view nodes.
  44794. *
  44795. * **Note:** Some `TextProxy` instances may represent whole text node, not just a part of it.
  44796. * See {@link module:engine/view/textproxy~TextProxy#isPartial}.
  44797. *
  44798. * **Note:** `TextProxy` is a readonly interface.
  44799. *
  44800. * **Note:** `TextProxy` instances are created on the fly basing on the current state of parent {@link module:engine/view/text~Text}.
  44801. * Because of this it is highly unrecommended to store references to `TextProxy instances because they might get
  44802. * invalidated due to operations on Document. Also TextProxy is not a {@link module:engine/view/node~Node} so it can not be
  44803. * inserted as a child of {@link module:engine/view/element~Element}.
  44804. *
  44805. * `TextProxy` instances are created by {@link module:engine/view/treewalker~TreeWalker view tree walker}. You should not need to create
  44806. * an instance of this class by your own.
  44807. */
  44808. class TextProxy {
  44809. /**
  44810. * Creates a text proxy.
  44811. *
  44812. * @protected
  44813. * @param {module:engine/view/text~Text} textNode Text node which part is represented by this text proxy.
  44814. * @param {Number} offsetInText Offset in {@link module:engine/view/textproxy~TextProxy#textNode text node}
  44815. * from which the text proxy starts.
  44816. * @param {Number} length Text proxy length, that is how many text node's characters, starting from `offsetInText` it represents.
  44817. * @constructor
  44818. */
  44819. constructor( textNode, offsetInText, length ) {
  44820. /**
  44821. * Reference to the {@link module:engine/view/text~Text} element which TextProxy is a substring.
  44822. *
  44823. * @readonly
  44824. * @member {module:engine/view/text~Text} module:engine/view/textproxy~TextProxy#textNode
  44825. */
  44826. this.textNode = textNode;
  44827. if ( offsetInText < 0 || offsetInText > textNode.data.length ) {
  44828. /**
  44829. * Given offsetInText value is incorrect.
  44830. *
  44831. * @error view-textproxy-wrong-offsetintext
  44832. */
  44833. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'view-textproxy-wrong-offsetintext', this );
  44834. }
  44835. if ( length < 0 || offsetInText + length > textNode.data.length ) {
  44836. /**
  44837. * Given length value is incorrect.
  44838. *
  44839. * @error view-textproxy-wrong-length
  44840. */
  44841. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'view-textproxy-wrong-length', this );
  44842. }
  44843. /**
  44844. * Text data represented by this text proxy.
  44845. *
  44846. * @readonly
  44847. * @member {String} module:engine/view/textproxy~TextProxy#data
  44848. */
  44849. this.data = textNode.data.substring( offsetInText, offsetInText + length );
  44850. /**
  44851. * Offset in the `textNode` where this `TextProxy` instance starts.
  44852. *
  44853. * @readonly
  44854. * @member {Number} module:engine/view/textproxy~TextProxy#offsetInText
  44855. */
  44856. this.offsetInText = offsetInText;
  44857. }
  44858. /**
  44859. * Offset size of this node.
  44860. *
  44861. * @readonly
  44862. * @type {Number}
  44863. */
  44864. get offsetSize() {
  44865. return this.data.length;
  44866. }
  44867. /**
  44868. * Flag indicating whether `TextProxy` instance covers only part of the original {@link module:engine/view/text~Text text node}
  44869. * (`true`) or the whole text node (`false`).
  44870. *
  44871. * This is `false` when text proxy starts at the very beginning of {@link module:engine/view/textproxy~TextProxy#textNode textNode}
  44872. * ({@link module:engine/view/textproxy~TextProxy#offsetInText offsetInText} equals `0`) and text proxy sizes is equal to
  44873. * text node size.
  44874. *
  44875. * @readonly
  44876. * @type {Boolean}
  44877. */
  44878. get isPartial() {
  44879. return this.data.length !== this.textNode.data.length;
  44880. }
  44881. /**
  44882. * Parent of this text proxy, which is same as parent of text node represented by this text proxy.
  44883. *
  44884. * @readonly
  44885. * @type {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment|null}
  44886. */
  44887. get parent() {
  44888. return this.textNode.parent;
  44889. }
  44890. /**
  44891. * Root of this text proxy, which is same as root of text node represented by this text proxy.
  44892. *
  44893. * @readonly
  44894. * @type {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment}
  44895. */
  44896. get root() {
  44897. return this.textNode.root;
  44898. }
  44899. /**
  44900. * {@link module:engine/view/document~Document View document} that owns this text proxy, or `null` if the text proxy is inside
  44901. * {@link module:engine/view/documentfragment~DocumentFragment document fragment}.
  44902. *
  44903. * @readonly
  44904. * @type {module:engine/view/document~Document|null}
  44905. */
  44906. get document() {
  44907. return this.textNode.document;
  44908. }
  44909. /**
  44910. * Checks whether this object is of the given type.
  44911. *
  44912. * textProxy.is( '$textProxy' ); // -> true
  44913. * textProxy.is( 'view:$textProxy' ); // -> true
  44914. *
  44915. * textProxy.is( 'model:$textProxy' ); // -> false
  44916. * textProxy.is( 'element' ); // -> false
  44917. * textProxy.is( 'range' ); // -> false
  44918. *
  44919. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  44920. *
  44921. * **Note:** Until version 20.0.0 this method wasn't accepting `'$textProxy'` type. The legacy `'textProxy'` type is still
  44922. * accepted for backward compatibility.
  44923. *
  44924. * @param {String} type Type to check.
  44925. * @returns {Boolean}
  44926. */
  44927. is( type ) {
  44928. return type === '$textProxy' || type === 'view:$textProxy' ||
  44929. // This are legacy values kept for backward compatibility.
  44930. type === 'textProxy' || type === 'view:textProxy';
  44931. }
  44932. /**
  44933. * Returns ancestors array of this text proxy.
  44934. *
  44935. * @param {Object} options Options object.
  44936. * @param {Boolean} [options.includeSelf=false] When set to `true` {#textNode} will be also included in parent's array.
  44937. * @param {Boolean} [options.parentFirst=false] When set to `true`, array will be sorted from text proxy parent to
  44938. * root element, otherwise root element will be the first item in the array.
  44939. * @returns {Array} Array with ancestors.
  44940. */
  44941. getAncestors( options = { includeSelf: false, parentFirst: false } ) {
  44942. const ancestors = [];
  44943. let parent = options.includeSelf ? this.textNode : this.parent;
  44944. while ( parent !== null ) {
  44945. ancestors[ options.parentFirst ? 'push' : 'unshift' ]( parent );
  44946. parent = parent.parent;
  44947. }
  44948. return ancestors;
  44949. }
  44950. // @if CK_DEBUG_ENGINE // toString() {
  44951. // @if CK_DEBUG_ENGINE // return `#${ this.data }`;
  44952. // @if CK_DEBUG_ENGINE // }
  44953. // @if CK_DEBUG_ENGINE // log() {
  44954. // @if CK_DEBUG_ENGINE // console.log( 'ViewTextProxy: ' + this );
  44955. // @if CK_DEBUG_ENGINE // }
  44956. // @if CK_DEBUG_ENGINE // logExtended() {
  44957. // @if CK_DEBUG_ENGINE // console.log( 'ViewTextProxy: ' + this );
  44958. // @if CK_DEBUG_ENGINE // }
  44959. }
  44960. /***/ }),
  44961. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/treewalker.js":
  44962. /*!************************************************************************!*\
  44963. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/treewalker.js ***!
  44964. \************************************************************************/
  44965. /*! exports provided: default */
  44966. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  44967. "use strict";
  44968. __webpack_require__.r(__webpack_exports__);
  44969. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TreeWalker; });
  44970. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js");
  44971. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js");
  44972. /* harmony import */ var _textproxy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./textproxy */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/textproxy.js");
  44973. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
  44974. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  44975. /**
  44976. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  44977. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  44978. */
  44979. /**
  44980. * @module engine/view/treewalker
  44981. */
  44982. /**
  44983. * Position iterator class. It allows to iterate forward and backward over the document.
  44984. */
  44985. class TreeWalker {
  44986. /**
  44987. * Creates a range iterator. All parameters are optional, but you have to specify either `boundaries` or `startPosition`.
  44988. *
  44989. * @constructor
  44990. * @param {Object} options Object with configuration.
  44991. * @param {module:engine/view/range~Range} [options.boundaries=null] Range to define boundaries of the iterator.
  44992. * @param {module:engine/view/position~Position} [options.startPosition] Starting position.
  44993. * @param {'forward'|'backward'} [options.direction='forward'] Walking direction.
  44994. * @param {Boolean} [options.singleCharacters=false] Flag indicating whether all characters from
  44995. * {@link module:engine/view/text~Text} should be returned as one {@link module:engine/view/text~Text} (`false`) ore one by one as
  44996. * {@link module:engine/view/textproxy~TextProxy} (`true`).
  44997. * @param {Boolean} [options.shallow=false] Flag indicating whether iterator should enter elements or not. If the
  44998. * iterator is shallow child nodes of any iterated node will not be returned along with `elementEnd` tag.
  44999. * @param {Boolean} [options.ignoreElementEnd=false] Flag indicating whether iterator should ignore `elementEnd`
  45000. * tags. If the option is true walker will not return a parent node of start position. If this option is `true`
  45001. * each {@link module:engine/view/element~Element} will be returned once, while if the option is `false` they might be returned
  45002. * twice: for `'elementStart'` and `'elementEnd'`.
  45003. */
  45004. constructor( options = {} ) {
  45005. if ( !options.boundaries && !options.startPosition ) {
  45006. /**
  45007. * Neither boundaries nor starting position have been defined.
  45008. *
  45009. * @error view-tree-walker-no-start-position
  45010. */
  45011. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
  45012. 'view-tree-walker-no-start-position',
  45013. null
  45014. );
  45015. }
  45016. if ( options.direction && options.direction != 'forward' && options.direction != 'backward' ) {
  45017. /**
  45018. * Only `backward` and `forward` direction allowed.
  45019. *
  45020. * @error view-tree-walker-unknown-direction
  45021. */
  45022. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"]( 'view-tree-walker-unknown-direction', options.startPosition, { direction: options.direction } );
  45023. }
  45024. /**
  45025. * Iterator boundaries.
  45026. *
  45027. * When the iterator is walking `'forward'` on the end of boundary or is walking `'backward'`
  45028. * on the start of boundary, then `{ done: true }` is returned.
  45029. *
  45030. * If boundaries are not defined they are set before first and after last child of the root node.
  45031. *
  45032. * @readonly
  45033. * @member {module:engine/view/range~Range} module:engine/view/treewalker~TreeWalker#boundaries
  45034. */
  45035. this.boundaries = options.boundaries || null;
  45036. /**
  45037. * Iterator position. If start position is not defined then position depends on {@link #direction}. If direction is
  45038. * `'forward'` position starts form the beginning, when direction is `'backward'` position starts from the end.
  45039. *
  45040. * @readonly
  45041. * @member {module:engine/view/position~Position} module:engine/view/treewalker~TreeWalker#position
  45042. */
  45043. if ( options.startPosition ) {
  45044. this.position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createAt( options.startPosition );
  45045. } else {
  45046. this.position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createAt( options.boundaries[ options.direction == 'backward' ? 'end' : 'start' ] );
  45047. }
  45048. /**
  45049. * Walking direction. Defaults `'forward'`.
  45050. *
  45051. * @readonly
  45052. * @member {'backward'|'forward'} module:engine/view/treewalker~TreeWalker#direction
  45053. */
  45054. this.direction = options.direction || 'forward';
  45055. /**
  45056. * Flag indicating whether all characters from {@link module:engine/view/text~Text} should be returned as one
  45057. * {@link module:engine/view/text~Text} or one by one as {@link module:engine/view/textproxy~TextProxy}.
  45058. *
  45059. * @readonly
  45060. * @member {Boolean} module:engine/view/treewalker~TreeWalker#singleCharacters
  45061. */
  45062. this.singleCharacters = !!options.singleCharacters;
  45063. /**
  45064. * Flag indicating whether iterator should enter elements or not. If the iterator is shallow child nodes of any
  45065. * iterated node will not be returned along with `elementEnd` tag.
  45066. *
  45067. * @readonly
  45068. * @member {Boolean} module:engine/view/treewalker~TreeWalker#shallow
  45069. */
  45070. this.shallow = !!options.shallow;
  45071. /**
  45072. * Flag indicating whether iterator should ignore `elementEnd` tags. If set to `true`, walker will not
  45073. * return a parent node of the start position. Each {@link module:engine/view/element~Element} will be returned once.
  45074. * When set to `false` each element might be returned twice: for `'elementStart'` and `'elementEnd'`.
  45075. *
  45076. * @readonly
  45077. * @member {Boolean} module:engine/view/treewalker~TreeWalker#ignoreElementEnd
  45078. */
  45079. this.ignoreElementEnd = !!options.ignoreElementEnd;
  45080. /**
  45081. * Start boundary parent.
  45082. *
  45083. * @private
  45084. * @member {module:engine/view/node~Node} module:engine/view/treewalker~TreeWalker#_boundaryStartParent
  45085. */
  45086. this._boundaryStartParent = this.boundaries ? this.boundaries.start.parent : null;
  45087. /**
  45088. * End boundary parent.
  45089. *
  45090. * @private
  45091. * @member {module:engine/view/node~Node} module:engine/view/treewalker~TreeWalker#_boundaryEndParent
  45092. */
  45093. this._boundaryEndParent = this.boundaries ? this.boundaries.end.parent : null;
  45094. }
  45095. /**
  45096. * Iterable interface.
  45097. *
  45098. * @returns {Iterable.<module:engine/view/treewalker~TreeWalkerValue>}
  45099. */
  45100. [ Symbol.iterator ]() {
  45101. return this;
  45102. }
  45103. /**
  45104. * Moves {@link #position} in the {@link #direction} skipping values as long as the callback function returns `true`.
  45105. *
  45106. * For example:
  45107. *
  45108. * walker.skip( value => value.type == 'text' ); // <p>{}foo</p> -> <p>foo[]</p>
  45109. * walker.skip( value => true ); // Move the position to the end: <p>{}foo</p> -> <p>foo</p>[]
  45110. * walker.skip( value => false ); // Do not move the position.
  45111. *
  45112. * @param {Function} skip Callback function. Gets {@link module:engine/view/treewalker~TreeWalkerValue} and should
  45113. * return `true` if the value should be skipped or `false` if not.
  45114. */
  45115. skip( skip ) {
  45116. let done, value, prevPosition;
  45117. do {
  45118. prevPosition = this.position;
  45119. ( { done, value } = this.next() );
  45120. } while ( !done && skip( value ) );
  45121. if ( !done ) {
  45122. this.position = prevPosition;
  45123. }
  45124. }
  45125. /**
  45126. * Gets the next tree walker's value.
  45127. *
  45128. * @returns {module:engine/view/treewalker~TreeWalkerValue} Object implementing iterator interface, returning
  45129. * information about taken step.
  45130. */
  45131. next() {
  45132. if ( this.direction == 'forward' ) {
  45133. return this._next();
  45134. } else {
  45135. return this._previous();
  45136. }
  45137. }
  45138. /**
  45139. * Makes a step forward in view. Moves the {@link #position} to the next position and returns the encountered value.
  45140. *
  45141. * @private
  45142. * @returns {Object}
  45143. * @returns {Boolean} return.done `true` if iterator is done, `false` otherwise.
  45144. * @returns {module:engine/view/treewalker~TreeWalkerValue} return.value Information about taken step.
  45145. */
  45146. _next() {
  45147. let position = this.position.clone();
  45148. const previousPosition = this.position;
  45149. const parent = position.parent;
  45150. // We are at the end of the root.
  45151. if ( parent.parent === null && position.offset === parent.childCount ) {
  45152. return { done: true };
  45153. }
  45154. // We reached the walker boundary.
  45155. if ( parent === this._boundaryEndParent && position.offset == this.boundaries.end.offset ) {
  45156. return { done: true };
  45157. }
  45158. // Get node just after current position.
  45159. let node;
  45160. // Text is a specific parent because it contains string instead of child nodes.
  45161. if ( parent instanceof _text__WEBPACK_IMPORTED_MODULE_1__["default"] ) {
  45162. if ( position.isAtEnd ) {
  45163. // Prevent returning "elementEnd" for Text node. Skip that value and return the next walker step.
  45164. this.position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createAfter( parent );
  45165. return this._next();
  45166. }
  45167. node = parent.data[ position.offset ];
  45168. } else {
  45169. node = parent.getChild( position.offset );
  45170. }
  45171. if ( node instanceof _element__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  45172. if ( !this.shallow ) {
  45173. position = new _position__WEBPACK_IMPORTED_MODULE_3__["default"]( node, 0 );
  45174. } else {
  45175. position.offset++;
  45176. }
  45177. this.position = position;
  45178. return this._formatReturnValue( 'elementStart', node, previousPosition, position, 1 );
  45179. } else if ( node instanceof _text__WEBPACK_IMPORTED_MODULE_1__["default"] ) {
  45180. if ( this.singleCharacters ) {
  45181. position = new _position__WEBPACK_IMPORTED_MODULE_3__["default"]( node, 0 );
  45182. this.position = position;
  45183. return this._next();
  45184. } else {
  45185. let charactersCount = node.data.length;
  45186. let item;
  45187. // If text stick out of walker range, we need to cut it and wrap in TextProxy.
  45188. if ( node == this._boundaryEndParent ) {
  45189. charactersCount = this.boundaries.end.offset;
  45190. item = new _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"]( node, 0, charactersCount );
  45191. position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createAfter( item );
  45192. } else {
  45193. item = new _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"]( node, 0, node.data.length );
  45194. // If not just keep moving forward.
  45195. position.offset++;
  45196. }
  45197. this.position = position;
  45198. return this._formatReturnValue( 'text', item, previousPosition, position, charactersCount );
  45199. }
  45200. } else if ( typeof node == 'string' ) {
  45201. let textLength;
  45202. if ( this.singleCharacters ) {
  45203. textLength = 1;
  45204. } else {
  45205. // Check if text stick out of walker range.
  45206. const endOffset = parent === this._boundaryEndParent ? this.boundaries.end.offset : parent.data.length;
  45207. textLength = endOffset - position.offset;
  45208. }
  45209. const textProxy = new _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"]( parent, position.offset, textLength );
  45210. position.offset += textLength;
  45211. this.position = position;
  45212. return this._formatReturnValue( 'text', textProxy, previousPosition, position, textLength );
  45213. } else {
  45214. // `node` is not set, we reached the end of current `parent`.
  45215. position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createAfter( parent );
  45216. this.position = position;
  45217. if ( this.ignoreElementEnd ) {
  45218. return this._next();
  45219. } else {
  45220. return this._formatReturnValue( 'elementEnd', parent, previousPosition, position );
  45221. }
  45222. }
  45223. }
  45224. /**
  45225. * Makes a step backward in view. Moves the {@link #position} to the previous position and returns the encountered value.
  45226. *
  45227. * @private
  45228. * @returns {Object}
  45229. * @returns {Boolean} return.done True if iterator is done.
  45230. * @returns {module:engine/view/treewalker~TreeWalkerValue} return.value Information about taken step.
  45231. */
  45232. _previous() {
  45233. let position = this.position.clone();
  45234. const previousPosition = this.position;
  45235. const parent = position.parent;
  45236. // We are at the beginning of the root.
  45237. if ( parent.parent === null && position.offset === 0 ) {
  45238. return { done: true };
  45239. }
  45240. // We reached the walker boundary.
  45241. if ( parent == this._boundaryStartParent && position.offset == this.boundaries.start.offset ) {
  45242. return { done: true };
  45243. }
  45244. // Get node just before current position.
  45245. let node;
  45246. // Text {@link module:engine/view/text~Text} element is a specific parent because contains string instead of child nodes.
  45247. if ( parent instanceof _text__WEBPACK_IMPORTED_MODULE_1__["default"] ) {
  45248. if ( position.isAtStart ) {
  45249. // Prevent returning "elementStart" for Text node. Skip that value and return the next walker step.
  45250. this.position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createBefore( parent );
  45251. return this._previous();
  45252. }
  45253. node = parent.data[ position.offset - 1 ];
  45254. } else {
  45255. node = parent.getChild( position.offset - 1 );
  45256. }
  45257. if ( node instanceof _element__WEBPACK_IMPORTED_MODULE_0__["default"] ) {
  45258. if ( !this.shallow ) {
  45259. position = new _position__WEBPACK_IMPORTED_MODULE_3__["default"]( node, node.childCount );
  45260. this.position = position;
  45261. if ( this.ignoreElementEnd ) {
  45262. return this._previous();
  45263. } else {
  45264. return this._formatReturnValue( 'elementEnd', node, previousPosition, position );
  45265. }
  45266. } else {
  45267. position.offset--;
  45268. this.position = position;
  45269. return this._formatReturnValue( 'elementStart', node, previousPosition, position, 1 );
  45270. }
  45271. } else if ( node instanceof _text__WEBPACK_IMPORTED_MODULE_1__["default"] ) {
  45272. if ( this.singleCharacters ) {
  45273. position = new _position__WEBPACK_IMPORTED_MODULE_3__["default"]( node, node.data.length );
  45274. this.position = position;
  45275. return this._previous();
  45276. } else {
  45277. let charactersCount = node.data.length;
  45278. let item;
  45279. // If text stick out of walker range, we need to cut it and wrap in TextProxy.
  45280. if ( node == this._boundaryStartParent ) {
  45281. const offset = this.boundaries.start.offset;
  45282. item = new _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"]( node, offset, node.data.length - offset );
  45283. charactersCount = item.data.length;
  45284. position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createBefore( item );
  45285. } else {
  45286. item = new _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"]( node, 0, node.data.length );
  45287. // If not just keep moving backward.
  45288. position.offset--;
  45289. }
  45290. this.position = position;
  45291. return this._formatReturnValue( 'text', item, previousPosition, position, charactersCount );
  45292. }
  45293. } else if ( typeof node == 'string' ) {
  45294. let textLength;
  45295. if ( !this.singleCharacters ) {
  45296. // Check if text stick out of walker range.
  45297. const startOffset = parent === this._boundaryStartParent ? this.boundaries.start.offset : 0;
  45298. textLength = position.offset - startOffset;
  45299. } else {
  45300. textLength = 1;
  45301. }
  45302. position.offset -= textLength;
  45303. const textProxy = new _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"]( parent, position.offset, textLength );
  45304. this.position = position;
  45305. return this._formatReturnValue( 'text', textProxy, previousPosition, position, textLength );
  45306. } else {
  45307. // `node` is not set, we reached the beginning of current `parent`.
  45308. position = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createBefore( parent );
  45309. this.position = position;
  45310. return this._formatReturnValue( 'elementStart', parent, previousPosition, position, 1 );
  45311. }
  45312. }
  45313. /**
  45314. * Format returned data and adjust `previousPosition` and `nextPosition` if reach the bound of the {@link module:engine/view/text~Text}.
  45315. *
  45316. * @private
  45317. * @param {module:engine/view/treewalker~TreeWalkerValueType} type Type of step.
  45318. * @param {module:engine/view/item~Item} item Item between old and new position.
  45319. * @param {module:engine/view/position~Position} previousPosition Previous position of iterator.
  45320. * @param {module:engine/view/position~Position} nextPosition Next position of iterator.
  45321. * @param {Number} [length] Length of the item.
  45322. * @returns {module:engine/view/treewalker~TreeWalkerValue}
  45323. */
  45324. _formatReturnValue( type, item, previousPosition, nextPosition, length ) {
  45325. // Text is a specific parent, because contains string instead of children.
  45326. // Walker doesn't enter to the Text except situations when walker is iterating over every single character,
  45327. // or the bound starts/ends inside the Text. So when the position is at the beginning or at the end of the Text
  45328. // we move it just before or just after Text.
  45329. if ( item instanceof _textproxy__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
  45330. // Position is at the end of Text.
  45331. if ( item.offsetInText + item.data.length == item.textNode.data.length ) {
  45332. if ( this.direction == 'forward' && !( this.boundaries && this.boundaries.end.isEqual( this.position ) ) ) {
  45333. nextPosition = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createAfter( item.textNode );
  45334. // When we change nextPosition of returned value we need also update walker current position.
  45335. this.position = nextPosition;
  45336. } else {
  45337. previousPosition = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createAfter( item.textNode );
  45338. }
  45339. }
  45340. // Position is at the begining ot the text.
  45341. if ( item.offsetInText === 0 ) {
  45342. if ( this.direction == 'backward' && !( this.boundaries && this.boundaries.start.isEqual( this.position ) ) ) {
  45343. nextPosition = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createBefore( item.textNode );
  45344. // When we change nextPosition of returned value we need also update walker current position.
  45345. this.position = nextPosition;
  45346. } else {
  45347. previousPosition = _position__WEBPACK_IMPORTED_MODULE_3__["default"]._createBefore( item.textNode );
  45348. }
  45349. }
  45350. }
  45351. return {
  45352. done: false,
  45353. value: {
  45354. type,
  45355. item,
  45356. previousPosition,
  45357. nextPosition,
  45358. length
  45359. }
  45360. };
  45361. }
  45362. }
  45363. /**
  45364. * Type of the step made by {@link module:engine/view/treewalker~TreeWalker}.
  45365. * Possible values: `'elementStart'` if walker is at the beginning of a node, `'elementEnd'` if walker is at the end
  45366. * of node, or `'text'` if walker traversed over single and multiple characters.
  45367. * For {@link module:engine/view/text~Text} `elementStart` and `elementEnd` is not returned.
  45368. *
  45369. * @typedef {String} module:engine/view/treewalker~TreeWalkerValueType
  45370. */
  45371. /**
  45372. * Object returned by {@link module:engine/view/treewalker~TreeWalker} when traversing tree view.
  45373. *
  45374. * @typedef {Object} module:engine/view/treewalker~TreeWalkerValue
  45375. * @property {module:engine/view/treewalker~TreeWalkerValueType} type
  45376. * @property {module:engine/view/item~Item} item Item between the old and the new positions
  45377. * of the tree walker.
  45378. * @property {module:engine/view/position~Position} previousPosition Previous position of the iterator.
  45379. * * Forward iteration: For `'elementEnd'` it is the last position inside the element. For all other types it is the
  45380. * position before the item.
  45381. * * Backward iteration: For `'elementStart'` it is the first position inside the element. For all other types it is
  45382. * the position after item.
  45383. * * If the position is at the beginning or at the end of the {@link module:engine/view/text~Text} it is always moved from the
  45384. * inside of the text to its parent just before or just after that text.
  45385. * @property {module:engine/view/position~Position} nextPosition Next position of the iterator.
  45386. * * Forward iteration: For `'elementStart'` it is the first position inside the element. For all other types it is
  45387. * the position after the item.
  45388. * * Backward iteration: For `'elementEnd'` it is last position inside element. For all other types it is the position
  45389. * before the item.
  45390. * * If the position is at the beginning or at the end of the {@link module:engine/view/text~Text} it is always moved from the
  45391. * inside of the text to its parent just before or just after that text.
  45392. * @property {Number} [length] Length of the item. For `'elementStart'` it is `1`. For `'text'` it is
  45393. * the length of that text. For `'elementEnd'` it is `undefined`.
  45394. */
  45395. /**
  45396. * Tree walking directions.
  45397. *
  45398. * @typedef {'forward'|'backward'} module:engine/view/treewalker~TreeWalkerDirection
  45399. */
  45400. /***/ }),
  45401. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/uielement.js":
  45402. /*!***********************************************************************!*\
  45403. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/uielement.js ***!
  45404. \***********************************************************************/
  45405. /*! exports provided: default, injectUiElementHandling */
  45406. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45407. "use strict";
  45408. __webpack_require__.r(__webpack_exports__);
  45409. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UIElement; });
  45410. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "injectUiElementHandling", function() { return injectUiElementHandling; });
  45411. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js");
  45412. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  45413. /* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/node.js");
  45414. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
  45415. /**
  45416. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  45417. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  45418. */
  45419. /**
  45420. * @module engine/view/uielement
  45421. */
  45422. /**
  45423. * UI element class. It should be used to represent editing UI which needs to be injected into the editing view
  45424. * If possible, you should keep your UI outside the editing view. However, if that is not possible,
  45425. * UI elements can be used.
  45426. *
  45427. * How a UI element is rendered is in your control (you pass a callback to
  45428. * {@link module:engine/view/downcastwriter~DowncastWriter#createUIElement `downcastWriter#createUIElement()`}).
  45429. * The editor will ignore your UI element – the selection cannot be placed in it, it is skipped (invisible) when
  45430. * the user modifies the selection by using arrow keys and the editor does not listen to any mutations which
  45431. * happen inside your UI elements.
  45432. *
  45433. * The limitation is that you cannot convert a model element to a UI element. UI elements need to be
  45434. * created for {@link module:engine/model/markercollection~Marker markers} or as additinal elements
  45435. * inside normal {@link module:engine/view/containerelement~ContainerElement container elements}.
  45436. *
  45437. * To create a new UI element use the
  45438. * {@link module:engine/view/downcastwriter~DowncastWriter#createUIElement `downcastWriter#createUIElement()`} method.
  45439. *
  45440. * @extends module:engine/view/element~Element
  45441. */
  45442. class UIElement extends _element__WEBPACK_IMPORTED_MODULE_0__["default"] {
  45443. /**
  45444. * Creates new instance of UIElement.
  45445. *
  45446. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-uielement-cannot-add` when third parameter is passed,
  45447. * to inform that usage of UIElement is incorrect (adding child nodes to UIElement is forbidden).
  45448. *
  45449. * @see module:engine/view/downcastwriter~DowncastWriter#createUIElement
  45450. * @protected
  45451. * @param {module:engine/view/document~Document} document The document instance to which this element belongs.
  45452. * @param {String} name Node name.
  45453. * @param {Object|Iterable} [attributes] Collection of attributes.
  45454. * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
  45455. * A list of nodes to be inserted into created element.
  45456. */
  45457. constructor( document, name, attributes, children ) {
  45458. super( document, name, attributes, children );
  45459. /**
  45460. * Returns `null` because filler is not needed for UIElements.
  45461. *
  45462. * @method #getFillerOffset
  45463. * @returns {null} Always returns null.
  45464. */
  45465. this.getFillerOffset = getFillerOffset;
  45466. }
  45467. /**
  45468. * Checks whether this object is of the given.
  45469. *
  45470. * uiElement.is( 'uiElement' ); // -> true
  45471. * uiElement.is( 'element' ); // -> true
  45472. * uiElement.is( 'node' ); // -> true
  45473. * uiElement.is( 'view:uiElement' ); // -> true
  45474. * uiElement.is( 'view:element' ); // -> true
  45475. * uiElement.is( 'view:node' ); // -> true
  45476. *
  45477. * uiElement.is( 'model:element' ); // -> false
  45478. * uiElement.is( 'documentFragment' ); // -> false
  45479. *
  45480. * Assuming that the object being checked is an ui element, you can also check its
  45481. * {@link module:engine/view/uielement~UIElement#name name}:
  45482. *
  45483. * uiElement.is( 'element', 'span' ); // -> true if this is a span ui element
  45484. * uiElement.is( 'uiElement', 'span' ); // -> same as above
  45485. * text.is( 'element', 'span' ); -> false
  45486. *
  45487. * {@link module:engine/view/node~Node#is Check the entire list of view objects} which implement the `is()` method.
  45488. *
  45489. * @param {String} type Type to check.
  45490. * @param {String} [name] Element name.
  45491. * @returns {Boolean}
  45492. */
  45493. is( type, name = null ) {
  45494. if ( !name ) {
  45495. return type === 'uiElement' || type === 'view:uiElement' ||
  45496. // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
  45497. type === 'element' || type === 'view:element' ||
  45498. type === 'node' || type === 'view:node';
  45499. } else {
  45500. return name === this.name && (
  45501. type === 'uiElement' || type === 'view:uiElement' ||
  45502. type === 'element' || type === 'view:element'
  45503. );
  45504. }
  45505. }
  45506. /**
  45507. * Overrides {@link module:engine/view/element~Element#_insertChild} method.
  45508. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-uielement-cannot-add` to prevent adding any child nodes
  45509. * to UIElement.
  45510. *
  45511. * @protected
  45512. */
  45513. _insertChild( index, nodes ) {
  45514. if ( nodes && ( nodes instanceof _node__WEBPACK_IMPORTED_MODULE_2__["default"] || Array.from( nodes ).length > 0 ) ) {
  45515. /**
  45516. * Cannot add children to {@link module:engine/view/uielement~UIElement}.
  45517. *
  45518. * @error view-uielement-cannot-add
  45519. */
  45520. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'view-uielement-cannot-add', this );
  45521. }
  45522. }
  45523. /**
  45524. * Renders this {@link module:engine/view/uielement~UIElement} to DOM. This method is called by
  45525. * {@link module:engine/view/domconverter~DomConverter}.
  45526. * Do not use inheritance to create custom rendering method, replace `render()` method instead:
  45527. *
  45528. * const myUIElement = downcastWriter.createUIElement( 'span' );
  45529. * myUIElement.render = function( domDocument ) {
  45530. * const domElement = this.toDomElement( domDocument );
  45531. * domElement.innerHTML = '<b>this is ui element</b>';
  45532. *
  45533. * return domElement;
  45534. * };
  45535. *
  45536. * If changes in your UI element should trigger some editor UI update you should call
  45537. * the {@link module:core/editor/editorui~EditorUI#update `editor.ui.update()`} method
  45538. * after rendering your UI element.
  45539. *
  45540. * @param {Document} domDocument
  45541. * @returns {HTMLElement}
  45542. */
  45543. render( domDocument ) {
  45544. return this.toDomElement( domDocument );
  45545. }
  45546. /**
  45547. * Creates DOM element based on this view UIElement.
  45548. * Note that each time this method is called new DOM element is created.
  45549. *
  45550. * @param {Document} domDocument
  45551. * @returns {HTMLElement}
  45552. */
  45553. toDomElement( domDocument ) {
  45554. const domElement = domDocument.createElement( this.name );
  45555. for ( const key of this.getAttributeKeys() ) {
  45556. domElement.setAttribute( key, this.getAttribute( key ) );
  45557. }
  45558. return domElement;
  45559. }
  45560. }
  45561. /**
  45562. * This function injects UI element handling to the given {@link module:engine/view/document~Document document}.
  45563. *
  45564. * A callback is added to {@link module:engine/view/document~Document#event:keydown document keydown event}.
  45565. * The callback handles the situation when right arrow key is pressed and selection is collapsed before a UI element.
  45566. * Without this handler, it would be impossible to "jump over" UI element using right arrow key.
  45567. *
  45568. * @param {module:engine/view/view~View} view View controller to which the quirks handling will be injected.
  45569. */
  45570. function injectUiElementHandling( view ) {
  45571. view.document.on( 'keydown', ( evt, data ) => jumpOverUiElement( evt, data, view.domConverter ) );
  45572. }
  45573. // Returns `null` because block filler is not needed for UIElements.
  45574. //
  45575. // @returns {null}
  45576. function getFillerOffset() {
  45577. return null;
  45578. }
  45579. // Selection cannot be placed in a `UIElement`. Whenever it is placed there, it is moved before it. This
  45580. // causes a situation when it is impossible to jump over `UIElement` using right arrow key, because the selection
  45581. // ends up in ui element (in DOM) and is moved back to the left. This handler fixes this situation.
  45582. function jumpOverUiElement( evt, data, domConverter ) {
  45583. if ( data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_3__["keyCodes"].arrowright ) {
  45584. const domSelection = data.domTarget.ownerDocument.defaultView.getSelection();
  45585. const domSelectionCollapsed = domSelection.rangeCount == 1 && domSelection.getRangeAt( 0 ).collapsed;
  45586. // Jump over UI element if selection is collapsed or shift key is pressed. These are the cases when selection would extend.
  45587. if ( domSelectionCollapsed || data.shiftKey ) {
  45588. const domParent = domSelection.focusNode;
  45589. const domOffset = domSelection.focusOffset;
  45590. const viewPosition = domConverter.domPositionToView( domParent, domOffset );
  45591. // In case if dom element is not converted to view or is not mapped or something. Happens for example in some tests.
  45592. if ( viewPosition === null ) {
  45593. return;
  45594. }
  45595. // Skip all following ui elements.
  45596. let jumpedOverAnyUiElement = false;
  45597. const nextViewPosition = viewPosition.getLastMatchingPosition( value => {
  45598. if ( value.item.is( 'uiElement' ) ) {
  45599. // Remember that there was at least one ui element.
  45600. jumpedOverAnyUiElement = true;
  45601. }
  45602. // Jump over ui elements, jump over empty attribute elements, move up from inside of attribute element.
  45603. if ( value.item.is( 'uiElement' ) || value.item.is( 'attributeElement' ) ) {
  45604. return true;
  45605. }
  45606. // Don't jump over text or don't get out of container element.
  45607. return false;
  45608. } );
  45609. // If anything has been skipped, fix position.
  45610. // This `if` could be possibly omitted but maybe it is better not to mess with DOM selection if not needed.
  45611. if ( jumpedOverAnyUiElement ) {
  45612. const newDomPosition = domConverter.viewPositionToDom( nextViewPosition );
  45613. if ( domSelectionCollapsed ) {
  45614. // Selection was collapsed, so collapse it at further position.
  45615. domSelection.collapse( newDomPosition.parent, newDomPosition.offset );
  45616. } else {
  45617. // Selection was not collapse, so extend it instead of collapsing.
  45618. domSelection.extend( newDomPosition.parent, newDomPosition.offset );
  45619. }
  45620. }
  45621. }
  45622. }
  45623. }
  45624. /***/ }),
  45625. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/upcastwriter.js":
  45626. /*!**************************************************************************!*\
  45627. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/upcastwriter.js ***!
  45628. \**************************************************************************/
  45629. /*! exports provided: default */
  45630. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45631. "use strict";
  45632. __webpack_require__.r(__webpack_exports__);
  45633. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UpcastWriter; });
  45634. /* harmony import */ var _documentfragment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./documentfragment */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/documentfragment.js");
  45635. /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./element */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js");
  45636. /* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./text */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js");
  45637. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  45638. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
  45639. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/range.js");
  45640. /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js");
  45641. /**
  45642. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  45643. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  45644. */
  45645. /**
  45646. * @module module:engine/view/upcastwriter
  45647. */
  45648. /**
  45649. * View upcast writer. It provides a set of methods used to manipulate non-semantic view trees.
  45650. *
  45651. * It should be used only while working on a non-semantic view
  45652. * (e.g. a view created from HTML string on paste).
  45653. * To manipulate a view which was or is being downcasted from the the model use the
  45654. * {@link module:engine/view/downcastwriter~DowncastWriter downcast writer}.
  45655. *
  45656. * Read more about changing the view in the {@glink framework/guides/architecture/editing-engine#changing-the-view Changing the view}
  45657. * section of the {@glink framework/guides/architecture/editing-engine Editing engine architecture} guide.
  45658. *
  45659. * Unlike `DowncastWriter`, which is available in the {@link module:engine/view/view~View#change `View#change()`} block,
  45660. * `UpcastWriter` can be created wherever you need it:
  45661. *
  45662. * const writer = new UpcastWriter( viewDocument );
  45663. * const text = writer.createText( 'foo!' );
  45664. *
  45665. * writer.appendChild( text, someViewElement );
  45666. */
  45667. class UpcastWriter {
  45668. /**
  45669. * @param {module:engine/view/document~Document} document The view document instance in which this upcast writer operates.
  45670. */
  45671. constructor( document ) {
  45672. /**
  45673. * The view document instance in which this upcast writer operates.
  45674. *
  45675. * @readonly
  45676. * @type {module:engine/view/document~Document}
  45677. */
  45678. this.document = document;
  45679. }
  45680. /**
  45681. * Creates a new {@link module:engine/view/documentfragment~DocumentFragment} instance.
  45682. *
  45683. * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
  45684. * A list of nodes to be inserted into the created document fragment.
  45685. * @returns {module:engine/view/documentfragment~DocumentFragment} The created document fragment.
  45686. */
  45687. createDocumentFragment( children ) {
  45688. return new _documentfragment__WEBPACK_IMPORTED_MODULE_0__["default"]( this.document, children );
  45689. }
  45690. /**
  45691. * Creates a new {@link module:engine/view/element~Element} instance.
  45692. *
  45693. * Attributes can be passed in various formats:
  45694. *
  45695. * upcastWriter.createElement( 'div', { class: 'editor', contentEditable: 'true' } ); // object
  45696. * upcastWriter.createElement( 'div', [ [ 'class', 'editor' ], [ 'contentEditable', 'true' ] ] ); // map-like iterator
  45697. * upcastWriter.createElement( 'div', mapOfAttributes ); // map
  45698. *
  45699. * @param {String} name Node name.
  45700. * @param {Object|Iterable} [attrs] Collection of attributes.
  45701. * @param {module:engine/view/node~Node|Iterable.<module:engine/view/node~Node>} [children]
  45702. * A list of nodes to be inserted into created element.
  45703. * @returns {module:engine/view/element~Element} Created element.
  45704. */
  45705. createElement( name, attrs, children ) {
  45706. return new _element__WEBPACK_IMPORTED_MODULE_1__["default"]( this.document, name, attrs, children );
  45707. }
  45708. /**
  45709. * Creates a new {@link module:engine/view/text~Text} instance.
  45710. *
  45711. * @param {String} data The text's data.
  45712. * @returns {module:engine/view/text~Text} The created text node.
  45713. */
  45714. createText( data ) {
  45715. return new _text__WEBPACK_IMPORTED_MODULE_2__["default"]( this.document, data );
  45716. }
  45717. /**
  45718. * Clones the provided element.
  45719. *
  45720. * @see module:engine/view/element~Element#_clone
  45721. * @param {module:engine/view/element~Element} element Element to be cloned.
  45722. * @param {Boolean} [deep=false] If set to `true` clones element and all its children recursively. When set to `false`,
  45723. * element will be cloned without any children.
  45724. * @returns {module:engine/view/element~Element} Clone of this element.
  45725. */
  45726. clone( element, deep = false ) {
  45727. return element._clone( deep );
  45728. }
  45729. /**
  45730. * Appends a child node or a list of child nodes at the end of this node
  45731. * and sets the parent of these nodes to this element.
  45732. *
  45733. * @see module:engine/view/element~Element#_appendChild
  45734. * @param {module:engine/view/item~Item|Iterable.<module:engine/view/item~Item>} items Items to be inserted.
  45735. * @param {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment} element Element
  45736. * to which items will be appended.
  45737. * @fires module:engine/view/node~Node#event:change
  45738. * @returns {Number} Number of appended nodes.
  45739. */
  45740. appendChild( items, element ) {
  45741. return element._appendChild( items );
  45742. }
  45743. /**
  45744. * Inserts a child node or a list of child nodes on the given index and sets the parent of these nodes to
  45745. * this element.
  45746. *
  45747. * @see module:engine/view/element~Element#_insertChild
  45748. * @param {Number} index Offset at which nodes should be inserted.
  45749. * @param {module:engine/view/item~Item|Iterable.<module:engine/view/item~Item>} items Items to be inserted.
  45750. * @param {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment} element Element
  45751. * to which items will be inserted.
  45752. * @fires module:engine/view/node~Node#event:change
  45753. * @returns {Number} Number of inserted nodes.
  45754. */
  45755. insertChild( index, items, element ) {
  45756. return element._insertChild( index, items );
  45757. }
  45758. /**
  45759. * Removes the given number of child nodes starting at the given index and set the parent of these nodes to `null`.
  45760. *
  45761. * @see module:engine/view/element~Element#_removeChildren
  45762. * @param {Number} index Offset from which nodes will be removed.
  45763. * @param {Number} howMany Number of nodes to remove.
  45764. * @param {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment} element Element
  45765. * which children will be removed.
  45766. * @fires module:engine/view/node~Node#event:change
  45767. * @returns {Array.<module:engine/view/node~Node>} The array containing removed nodes.
  45768. */
  45769. removeChildren( index, howMany, element ) {
  45770. return element._removeChildren( index, howMany );
  45771. }
  45772. /**
  45773. * Removes given element from the view structure. Will not have effect on detached elements.
  45774. *
  45775. * @param {module:engine/view/element~Element} element Element which will be removed.
  45776. * @returns {Array.<module:engine/view/node~Node>} The array containing removed nodes.
  45777. */
  45778. remove( element ) {
  45779. const parent = element.parent;
  45780. if ( parent ) {
  45781. return this.removeChildren( parent.getChildIndex( element ), 1, parent );
  45782. }
  45783. return [];
  45784. }
  45785. /**
  45786. * Replaces given element with the new one in the view structure. Will not have effect on detached elements.
  45787. *
  45788. * @param {module:engine/view/element~Element} oldElement Element which will be replaced.
  45789. * @param {module:engine/view/element~Element} newElement Element which will be inserted in the place of the old element.
  45790. * @returns {Boolean} Whether old element was successfully replaced.
  45791. */
  45792. replace( oldElement, newElement ) {
  45793. const parent = oldElement.parent;
  45794. if ( parent ) {
  45795. const index = parent.getChildIndex( oldElement );
  45796. this.removeChildren( index, 1, parent );
  45797. this.insertChild( index, newElement, parent );
  45798. return true;
  45799. }
  45800. return false;
  45801. }
  45802. /**
  45803. * Removes given element from view structure and places its children in its position.
  45804. * It does nothing if element has no parent.
  45805. *
  45806. * @param {module:engine/view/element~Element} element Element to unwrap.
  45807. */
  45808. unwrapElement( element ) {
  45809. const parent = element.parent;
  45810. if ( parent ) {
  45811. const index = parent.getChildIndex( element );
  45812. this.remove( element );
  45813. this.insertChild( index, element.getChildren(), parent );
  45814. }
  45815. }
  45816. /**
  45817. * Renames element by creating a copy of a given element but with its name changed and then moving contents of the
  45818. * old element to the new one.
  45819. *
  45820. * Since this function creates a new element and removes the given one, the new element is returned to keep reference.
  45821. *
  45822. * @param {String} newName New element name.
  45823. * @param {module:engine/view/element~Element} element Element to be renamed.
  45824. * @returns {module:engine/view/element~Element|null} New element or null if the old element
  45825. * was not replaced (happens for detached elements).
  45826. */
  45827. rename( newName, element ) {
  45828. const newElement = new _element__WEBPACK_IMPORTED_MODULE_1__["default"]( this.document, newName, element.getAttributes(), element.getChildren() );
  45829. return this.replace( element, newElement ) ? newElement : null;
  45830. }
  45831. /**
  45832. * Adds or overwrites element's attribute with a specified key and value.
  45833. *
  45834. * writer.setAttribute( linkElement, 'href', 'http://ckeditor.com' );
  45835. *
  45836. * @see module:engine/view/element~Element#_setAttribute
  45837. * @param {String} key Attribute key.
  45838. * @param {String} value Attribute value.
  45839. * @param {module:engine/view/element~Element} element Element for which attribute will be set.
  45840. */
  45841. setAttribute( key, value, element ) {
  45842. element._setAttribute( key, value );
  45843. }
  45844. /**
  45845. * Removes attribute from the element.
  45846. *
  45847. * writer.removeAttribute( linkElement, 'href' );
  45848. *
  45849. * @see module:engine/view/element~Element#_removeAttribute
  45850. * @param {String} key Attribute key.
  45851. * @param {module:engine/view/element~Element} element Element from which attribute will be removed.
  45852. */
  45853. removeAttribute( key, element ) {
  45854. element._removeAttribute( key );
  45855. }
  45856. /**
  45857. * Adds specified class to the element.
  45858. *
  45859. * writer.addClass( linkElement, 'foo' );
  45860. * writer.addClass( linkElement, [ 'foo', 'bar' ] );
  45861. *
  45862. * @see module:engine/view/element~Element#_addClass
  45863. * @param {Array.<String>|String} className Single class name or array of class names which will be added.
  45864. * @param {module:engine/view/element~Element} element Element for which class will be added.
  45865. */
  45866. addClass( className, element ) {
  45867. element._addClass( className );
  45868. }
  45869. /**
  45870. * Removes specified class from the element.
  45871. *
  45872. * writer.removeClass( linkElement, 'foo' );
  45873. * writer.removeClass( linkElement, [ 'foo', 'bar' ] );
  45874. *
  45875. * @see module:engine/view/element~Element#_removeClass
  45876. * @param {Array.<String>|String} className Single class name or array of class names which will be removed.
  45877. * @param {module:engine/view/element~Element} element Element from which class will be removed.
  45878. */
  45879. removeClass( className, element ) {
  45880. element._removeClass( className );
  45881. }
  45882. /**
  45883. * Adds style to the element.
  45884. *
  45885. * writer.setStyle( element, 'color', 'red' );
  45886. * writer.setStyle( element, {
  45887. * color: 'red',
  45888. * position: 'fixed'
  45889. * } );
  45890. *
  45891. * **Note**: This method can work with normalized style names if
  45892. * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.
  45893. * See {@link module:engine/view/stylesmap~StylesMap#set `StylesMap#set()`} for details.
  45894. *
  45895. * @see module:engine/view/element~Element#_setStyle
  45896. * @param {String|Object} property Property name or object with key - value pairs.
  45897. * @param {String} [value] Value to set. This parameter is ignored if object is provided as the first parameter.
  45898. * @param {module:engine/view/element~Element} element Element for which style will be added.
  45899. */
  45900. setStyle( property, value, element ) {
  45901. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_3__["isPlainObject"])( property ) && element === undefined ) {
  45902. element = value;
  45903. }
  45904. element._setStyle( property, value );
  45905. }
  45906. /**
  45907. * Removes specified style from the element.
  45908. *
  45909. * writer.removeStyle( element, 'color' ); // Removes 'color' style.
  45910. * writer.removeStyle( element, [ 'color', 'border-top' ] ); // Removes both 'color' and 'border-top' styles.
  45911. *
  45912. * **Note**: This method can work with normalized style names if
  45913. * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.
  45914. * See {@link module:engine/view/stylesmap~StylesMap#remove `StylesMap#remove()`} for details.
  45915. *
  45916. * @see module:engine/view/element~Element#_removeStyle
  45917. * @param {Array.<String>|String} property Style property name or names to be removed.
  45918. * @param {module:engine/view/element~Element} element Element from which style will be removed.
  45919. */
  45920. removeStyle( property, element ) {
  45921. element._removeStyle( property );
  45922. }
  45923. /**
  45924. * Sets a custom property on element. Unlike attributes, custom properties are not rendered to the DOM,
  45925. * so they can be used to add special data to elements.
  45926. *
  45927. * @see module:engine/view/element~Element#_setCustomProperty
  45928. * @param {String|Symbol} key Custom property name/key.
  45929. * @param {*} value Custom property value to be stored.
  45930. * @param {module:engine/view/element~Element} element Element for which custom property will be set.
  45931. */
  45932. setCustomProperty( key, value, element ) {
  45933. element._setCustomProperty( key, value );
  45934. }
  45935. /**
  45936. * Removes a custom property stored under the given key.
  45937. *
  45938. * @see module:engine/view/element~Element#_removeCustomProperty
  45939. * @param {String|Symbol} key Name/key of the custom property to be removed.
  45940. * @param {module:engine/view/element~Element} element Element from which the custom property will be removed.
  45941. * @returns {Boolean} Returns true if property was removed.
  45942. */
  45943. removeCustomProperty( key, element ) {
  45944. return element._removeCustomProperty( key );
  45945. }
  45946. /**
  45947. * Creates position at the given location. The location can be specified as:
  45948. *
  45949. * * a {@link module:engine/view/position~Position position},
  45950. * * parent element and offset (offset defaults to `0`),
  45951. * * parent element and `'end'` (sets position at the end of that element),
  45952. * * {@link module:engine/view/item~Item view item} and `'before'` or `'after'` (sets position before or after given view item).
  45953. *
  45954. * This method is a shortcut to other constructors such as:
  45955. *
  45956. * * {@link #createPositionBefore},
  45957. * * {@link #createPositionAfter},
  45958. *
  45959. * @param {module:engine/view/item~Item|module:engine/model/position~Position} itemOrPosition
  45960. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  45961. * first parameter is a {@link module:engine/view/item~Item view item}.
  45962. */
  45963. createPositionAt( itemOrPosition, offset ) {
  45964. return _position__WEBPACK_IMPORTED_MODULE_4__["default"]._createAt( itemOrPosition, offset );
  45965. }
  45966. /**
  45967. * Creates a new position after given view item.
  45968. *
  45969. * @param {module:engine/view/item~Item} item View item after which the position should be located.
  45970. * @returns {module:engine/view/position~Position}
  45971. */
  45972. createPositionAfter( item ) {
  45973. return _position__WEBPACK_IMPORTED_MODULE_4__["default"]._createAfter( item );
  45974. }
  45975. /**
  45976. * Creates a new position before given view item.
  45977. *
  45978. * @param {module:engine/view/item~Item} item View item before which the position should be located.
  45979. * @returns {module:engine/view/position~Position}
  45980. */
  45981. createPositionBefore( item ) {
  45982. return _position__WEBPACK_IMPORTED_MODULE_4__["default"]._createBefore( item );
  45983. }
  45984. /**
  45985. * Creates a range spanning from `start` position to `end` position.
  45986. *
  45987. * **Note:** This factory method creates it's own {@link module:engine/view/position~Position} instances basing on passed values.
  45988. *
  45989. * @param {module:engine/view/position~Position} start Start position.
  45990. * @param {module:engine/view/position~Position} [end] End position. If not set, range will be collapsed at `start` position.
  45991. * @returns {module:engine/view/range~Range}
  45992. */
  45993. createRange( start, end ) {
  45994. return new _range__WEBPACK_IMPORTED_MODULE_5__["default"]( start, end );
  45995. }
  45996. /**
  45997. * Creates a range that starts before given {@link module:engine/view/item~Item view item} and ends after it.
  45998. *
  45999. * @param {module:engine/view/item~Item} item
  46000. * @returns {module:engine/view/range~Range}
  46001. */
  46002. createRangeOn( item ) {
  46003. return _range__WEBPACK_IMPORTED_MODULE_5__["default"]._createOn( item );
  46004. }
  46005. /**
  46006. * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of
  46007. * that element and ends after the last child of that element.
  46008. *
  46009. * @param {module:engine/view/element~Element} element Element which is a parent for the range.
  46010. * @returns {module:engine/view/range~Range}
  46011. */
  46012. createRangeIn( element ) {
  46013. return _range__WEBPACK_IMPORTED_MODULE_5__["default"]._createIn( element );
  46014. }
  46015. /**
  46016. * Creates a new {@link module:engine/view/selection~Selection} instance.
  46017. *
  46018. * // Creates empty selection without ranges.
  46019. * const selection = writer.createSelection();
  46020. *
  46021. * // Creates selection at the given range.
  46022. * const range = writer.createRange( start, end );
  46023. * const selection = writer.createSelection( range );
  46024. *
  46025. * // Creates selection at the given ranges
  46026. * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];
  46027. * const selection = writer.createSelection( ranges );
  46028. *
  46029. * // Creates selection from the other selection.
  46030. * const otherSelection = writer.createSelection();
  46031. * const selection = writer.createSelection( otherSelection );
  46032. *
  46033. * // Creates selection from the document selection.
  46034. * const selection = writer.createSelection( editor.editing.view.document.selection );
  46035. *
  46036. * // Creates selection at the given position.
  46037. * const position = writer.createPositionFromPath( root, path );
  46038. * const selection = writer.createSelection( position );
  46039. *
  46040. * // Creates collapsed selection at the position of given item and offset.
  46041. * const paragraph = writer.createContainerElement( 'paragraph' );
  46042. * const selection = writer.createSelection( paragraph, offset );
  46043. *
  46044. * // Creates a range inside an {@link module:engine/view/element~Element element} which starts before the
  46045. * // first child of that element and ends after the last child of that element.
  46046. * const selection = writer.createSelection( paragraph, 'in' );
  46047. *
  46048. * // Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends
  46049. * // just after the item.
  46050. * const selection = writer.createSelection( paragraph, 'on' );
  46051. *
  46052. * `Selection`'s constructor allow passing additional options (`backward`, `fake` and `label`) as the last argument.
  46053. *
  46054. * // Creates backward selection.
  46055. * const selection = writer.createSelection( range, { backward: true } );
  46056. *
  46057. * Fake selection does not render as browser native selection over selected elements and is hidden to the user.
  46058. * This way, no native selection UI artifacts are displayed to the user and selection over elements can be
  46059. * represented in other way, for example by applying proper CSS class.
  46060. *
  46061. * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM
  46062. * (and be properly handled by screen readers).
  46063. *
  46064. * // Creates fake selection with label.
  46065. * const selection = writer.createSelection( range, { fake: true, label: 'foo' } );
  46066. *
  46067. * @param {module:engine/view/selection~Selectable} [selectable=null]
  46068. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Offset or place when selectable is an `Item`.
  46069. * @param {Object} [options]
  46070. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  46071. * @param {Boolean} [options.fake] Sets this selection instance to be marked as `fake`.
  46072. * @param {String} [options.label] Label for the fake selection.
  46073. * @returns {module:engine/view/selection~Selection}
  46074. */
  46075. createSelection( selectable, placeOrOffset, options ) {
  46076. return new _selection__WEBPACK_IMPORTED_MODULE_6__["default"]( selectable, placeOrOffset, options );
  46077. }
  46078. }
  46079. /***/ }),
  46080. /***/ "./node_modules/@ckeditor/ckeditor5-engine/src/view/view.js":
  46081. /*!******************************************************************!*\
  46082. !*** ./node_modules/@ckeditor/ckeditor5-engine/src/view/view.js ***!
  46083. \******************************************************************/
  46084. /*! exports provided: default */
  46085. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46086. "use strict";
  46087. __webpack_require__.r(__webpack_exports__);
  46088. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return View; });
  46089. /* harmony import */ var _document__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./document */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/document.js");
  46090. /* harmony import */ var _downcastwriter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./downcastwriter */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/downcastwriter.js");
  46091. /* harmony import */ var _renderer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./renderer */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/renderer.js");
  46092. /* harmony import */ var _domconverter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./domconverter */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/domconverter.js");
  46093. /* harmony import */ var _position__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./position */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js");
  46094. /* harmony import */ var _range__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./range */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/range.js");
  46095. /* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./selection */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js");
  46096. /* harmony import */ var _observer_mutationobserver__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./observer/mutationobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mutationobserver.js");
  46097. /* harmony import */ var _observer_keyobserver__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./observer/keyobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/keyobserver.js");
  46098. /* harmony import */ var _observer_fakeselectionobserver__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./observer/fakeselectionobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/fakeselectionobserver.js");
  46099. /* harmony import */ var _observer_selectionobserver__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./observer/selectionobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/selectionobserver.js");
  46100. /* harmony import */ var _observer_focusobserver__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./observer/focusobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/focusobserver.js");
  46101. /* harmony import */ var _observer_compositionobserver__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./observer/compositionobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/compositionobserver.js");
  46102. /* harmony import */ var _observer_inputobserver__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./observer/inputobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/inputobserver.js");
  46103. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  46104. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  46105. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_scroll__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/scroll */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/scroll.js");
  46106. /* harmony import */ var _uielement__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./uielement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/uielement.js");
  46107. /* harmony import */ var _filler__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./filler */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/filler.js");
  46108. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  46109. /* harmony import */ var _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/env */ "./node_modules/@ckeditor/ckeditor5-utils/src/env.js");
  46110. /**
  46111. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  46112. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  46113. */
  46114. /**
  46115. * @module engine/view/view
  46116. */
  46117. /**
  46118. * Editor's view controller class. Its main responsibility is DOM - View management for editing purposes, to provide
  46119. * abstraction over the DOM structure and events and hide all browsers quirks.
  46120. *
  46121. * View controller renders view document to DOM whenever view structure changes. To determine when view can be rendered,
  46122. * all changes need to be done using the {@link module:engine/view/view~View#change} method, using
  46123. * {@link module:engine/view/downcastwriter~DowncastWriter}:
  46124. *
  46125. * view.change( writer => {
  46126. * writer.insert( position, writer.createText( 'foo' ) );
  46127. * } );
  46128. *
  46129. * View controller also register {@link module:engine/view/observer/observer~Observer observers} which observes changes
  46130. * on DOM and fire events on the {@link module:engine/view/document~Document Document}.
  46131. * Note that the following observers are added by the class constructor and are always available:
  46132. *
  46133. * * {@link module:engine/view/observer/mutationobserver~MutationObserver},
  46134. * * {@link module:engine/view/observer/selectionobserver~SelectionObserver},
  46135. * * {@link module:engine/view/observer/focusobserver~FocusObserver},
  46136. * * {@link module:engine/view/observer/keyobserver~KeyObserver},
  46137. * * {@link module:engine/view/observer/fakeselectionobserver~FakeSelectionObserver}.
  46138. * * {@link module:engine/view/observer/compositionobserver~CompositionObserver}.
  46139. *
  46140. * This class also {@link module:engine/view/view~View#attachDomRoot binds the DOM and the view elements}.
  46141. *
  46142. * If you do not need full a DOM - view management, and only want to transform a tree of view elements to a tree of DOM
  46143. * elements you do not need this controller. You can use the {@link module:engine/view/domconverter~DomConverter DomConverter} instead.
  46144. *
  46145. * @mixes module:utils/observablemixin~ObservableMixin
  46146. */
  46147. class View {
  46148. /**
  46149. * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor The styles processor instance.
  46150. */
  46151. constructor( stylesProcessor ) {
  46152. /**
  46153. * Instance of the {@link module:engine/view/document~Document} associated with this view controller.
  46154. *
  46155. * @readonly
  46156. * @type {module:engine/view/document~Document}
  46157. */
  46158. this.document = new _document__WEBPACK_IMPORTED_MODULE_0__["default"]( stylesProcessor );
  46159. /**
  46160. * Instance of the {@link module:engine/view/domconverter~DomConverter domConverter} used by
  46161. * {@link module:engine/view/view~View#_renderer renderer}
  46162. * and {@link module:engine/view/observer/observer~Observer observers}.
  46163. *
  46164. * @readonly
  46165. * @type {module:engine/view/domconverter~DomConverter}
  46166. */
  46167. this.domConverter = new _domconverter__WEBPACK_IMPORTED_MODULE_3__["default"]( this.document );
  46168. /**
  46169. * Roots of the DOM tree. Map on the `HTMLElement`s with roots names as keys.
  46170. *
  46171. * @readonly
  46172. * @type {Map.<String, HTMLElement>}
  46173. */
  46174. this.domRoots = new Map();
  46175. /**
  46176. * Used to prevent calling {@link #forceRender} and {@link #change} during rendering view to the DOM.
  46177. *
  46178. * @readonly
  46179. * @member {Boolean} #isRenderingInProgress
  46180. */
  46181. this.set( 'isRenderingInProgress', false );
  46182. /**
  46183. * Informs whether the DOM selection is inside any of the DOM roots managed by the view.
  46184. *
  46185. * @readonly
  46186. * @member {Boolean} #hasDomSelection
  46187. */
  46188. this.set( 'hasDomSelection', false );
  46189. /**
  46190. * Instance of the {@link module:engine/view/renderer~Renderer renderer}.
  46191. *
  46192. * @protected
  46193. * @type {module:engine/view/renderer~Renderer}
  46194. */
  46195. this._renderer = new _renderer__WEBPACK_IMPORTED_MODULE_2__["default"]( this.domConverter, this.document.selection );
  46196. this._renderer.bind( 'isFocused' ).to( this.document );
  46197. /**
  46198. * A DOM root attributes cache. It saves the initial values of DOM root attributes before the DOM element
  46199. * is {@link module:engine/view/view~View#attachDomRoot attached} to the view so later on, when
  46200. * the view is destroyed ({@link module:engine/view/view~View#detachDomRoot}), they can be easily restored.
  46201. * This way, the DOM element can go back to the (clean) state as if the editing view never used it.
  46202. *
  46203. * @private
  46204. * @member {WeakMap.<HTMLElement,Object>}
  46205. */
  46206. this._initialDomRootAttributes = new WeakMap();
  46207. /**
  46208. * Map of registered {@link module:engine/view/observer/observer~Observer observers}.
  46209. *
  46210. * @private
  46211. * @type {Map.<Function, module:engine/view/observer/observer~Observer>}
  46212. */
  46213. this._observers = new Map();
  46214. /**
  46215. * Is set to `true` when {@link #change view changes} are currently in progress.
  46216. *
  46217. * @private
  46218. * @type {Boolean}
  46219. */
  46220. this._ongoingChange = false;
  46221. /**
  46222. * Used to prevent calling {@link #forceRender} and {@link #change} during rendering view to the DOM.
  46223. *
  46224. * @private
  46225. * @type {Boolean}
  46226. */
  46227. this._postFixersInProgress = false;
  46228. /**
  46229. * Internal flag to temporary disable rendering. See the usage in the {@link #_disableRendering}.
  46230. *
  46231. * @private
  46232. * @type {Boolean}
  46233. */
  46234. this._renderingDisabled = false;
  46235. /**
  46236. * Internal flag that disables rendering when there are no changes since the last rendering.
  46237. * It stores information about changed selection and changed elements from attached document roots.
  46238. *
  46239. * @private
  46240. * @type {Boolean}
  46241. */
  46242. this._hasChangedSinceTheLastRendering = false;
  46243. /**
  46244. * DowncastWriter instance used in {@link #change change method} callbacks.
  46245. *
  46246. * @private
  46247. * @type {module:engine/view/downcastwriter~DowncastWriter}
  46248. */
  46249. this._writer = new _downcastwriter__WEBPACK_IMPORTED_MODULE_1__["default"]( this.document );
  46250. // Add default observers.
  46251. this.addObserver( _observer_mutationobserver__WEBPACK_IMPORTED_MODULE_7__["default"] );
  46252. this.addObserver( _observer_selectionobserver__WEBPACK_IMPORTED_MODULE_10__["default"] );
  46253. this.addObserver( _observer_focusobserver__WEBPACK_IMPORTED_MODULE_11__["default"] );
  46254. this.addObserver( _observer_keyobserver__WEBPACK_IMPORTED_MODULE_8__["default"] );
  46255. this.addObserver( _observer_fakeselectionobserver__WEBPACK_IMPORTED_MODULE_9__["default"] );
  46256. this.addObserver( _observer_compositionobserver__WEBPACK_IMPORTED_MODULE_12__["default"] );
  46257. if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_20__["default"].isAndroid ) {
  46258. this.addObserver( _observer_inputobserver__WEBPACK_IMPORTED_MODULE_13__["default"] );
  46259. }
  46260. // Inject quirks handlers.
  46261. Object(_filler__WEBPACK_IMPORTED_MODULE_18__["injectQuirksHandling"])( this );
  46262. Object(_uielement__WEBPACK_IMPORTED_MODULE_17__["injectUiElementHandling"])( this );
  46263. // Use 'normal' priority so that rendering is performed as first when using that priority.
  46264. this.on( 'render', () => {
  46265. this._render();
  46266. // Informs that layout has changed after render.
  46267. this.document.fire( 'layoutChanged' );
  46268. // Reset the `_hasChangedSinceTheLastRendering` flag after rendering.
  46269. this._hasChangedSinceTheLastRendering = false;
  46270. } );
  46271. // Listen to the document selection changes directly.
  46272. this.listenTo( this.document.selection, 'change', () => {
  46273. this._hasChangedSinceTheLastRendering = true;
  46274. } );
  46275. }
  46276. /**
  46277. * Attaches a DOM root element to the view element and enable all observers on that element.
  46278. * Also {@link module:engine/view/renderer~Renderer#markToSync mark element} to be synchronized
  46279. * with the view what means that all child nodes will be removed and replaced with content of the view root.
  46280. *
  46281. * This method also will change view element name as the same as tag name of given dom root.
  46282. * Name is always transformed to lower case.
  46283. *
  46284. * **Note:** Use {@link #detachDomRoot `detachDomRoot()`} to revert this action.
  46285. *
  46286. * @param {Element} domRoot DOM root element.
  46287. * @param {String} [name='main'] Name of the root.
  46288. */
  46289. attachDomRoot( domRoot, name = 'main' ) {
  46290. const viewRoot = this.document.getRoot( name );
  46291. // Set view root name the same as DOM root tag name.
  46292. viewRoot._name = domRoot.tagName.toLowerCase();
  46293. const initialDomRootAttributes = {};
  46294. // 1. Copy and cache the attributes to remember the state of the element before attaching.
  46295. // The cached attributes will be restored in detachDomRoot() so the element goes to the
  46296. // clean state as if the editing view never used it.
  46297. // 2. Apply the attributes using the view writer, so they all go under the control of the engine.
  46298. // The editing view takes over the attribute management completely because various
  46299. // features (e.g. addPlaceholder()) require dynamic changes of those attributes and they
  46300. // cannot be managed by the engine and the UI library at the same time.
  46301. for ( const { name, value } of Array.from( domRoot.attributes ) ) {
  46302. initialDomRootAttributes[ name ] = value;
  46303. // Do not use writer.setAttribute() for the class attribute. The EditableUIView class
  46304. // and its descendants could have already set some using the writer.addClass() on the view
  46305. // document root. They haven't been rendered yet so they are not present in the DOM root.
  46306. // Using writer.setAttribute( 'class', ... ) would override them completely.
  46307. if ( name === 'class' ) {
  46308. this._writer.addClass( value.split( ' ' ), viewRoot );
  46309. } else {
  46310. this._writer.setAttribute( name, value, viewRoot );
  46311. }
  46312. }
  46313. this._initialDomRootAttributes.set( domRoot, initialDomRootAttributes );
  46314. const updateContenteditableAttribute = () => {
  46315. this._writer.setAttribute( 'contenteditable', !viewRoot.isReadOnly, viewRoot );
  46316. if ( viewRoot.isReadOnly ) {
  46317. this._writer.addClass( 'ck-read-only', viewRoot );
  46318. } else {
  46319. this._writer.removeClass( 'ck-read-only', viewRoot );
  46320. }
  46321. };
  46322. // Set initial value.
  46323. updateContenteditableAttribute();
  46324. this.domRoots.set( name, domRoot );
  46325. this.domConverter.bindElements( domRoot, viewRoot );
  46326. this._renderer.markToSync( 'children', viewRoot );
  46327. this._renderer.markToSync( 'attributes', viewRoot );
  46328. this._renderer.domDocuments.add( domRoot.ownerDocument );
  46329. viewRoot.on( 'change:children', ( evt, node ) => this._renderer.markToSync( 'children', node ) );
  46330. viewRoot.on( 'change:attributes', ( evt, node ) => this._renderer.markToSync( 'attributes', node ) );
  46331. viewRoot.on( 'change:text', ( evt, node ) => this._renderer.markToSync( 'text', node ) );
  46332. viewRoot.on( 'change:isReadOnly', () => this.change( updateContenteditableAttribute ) );
  46333. viewRoot.on( 'change', () => {
  46334. this._hasChangedSinceTheLastRendering = true;
  46335. } );
  46336. for ( const observer of this._observers.values() ) {
  46337. observer.observe( domRoot, name );
  46338. }
  46339. }
  46340. /**
  46341. * Detaches a DOM root element from the view element and restores its attributes to the state before
  46342. * {@link #attachDomRoot `attachDomRoot()`}.
  46343. *
  46344. * @param {String} name Name of the root to detach.
  46345. */
  46346. detachDomRoot( name ) {
  46347. const domRoot = this.domRoots.get( name );
  46348. // Remove all root attributes so the DOM element is "bare".
  46349. Array.from( domRoot.attributes ).forEach( ( { name } ) => domRoot.removeAttribute( name ) );
  46350. const initialDomRootAttributes = this._initialDomRootAttributes.get( domRoot );
  46351. // Revert all view root attributes back to the state before attachDomRoot was called.
  46352. for ( const attribute in initialDomRootAttributes ) {
  46353. domRoot.setAttribute( attribute, initialDomRootAttributes[ attribute ] );
  46354. }
  46355. this.domRoots.delete( name );
  46356. this.domConverter.unbindDomElement( domRoot );
  46357. }
  46358. /**
  46359. * Gets DOM root element.
  46360. *
  46361. * @param {String} [name='main'] Name of the root.
  46362. * @returns {Element} DOM root element instance.
  46363. */
  46364. getDomRoot( name = 'main' ) {
  46365. return this.domRoots.get( name );
  46366. }
  46367. /**
  46368. * Creates observer of the given type if not yet created, {@link module:engine/view/observer/observer~Observer#enable enables} it
  46369. * and {@link module:engine/view/observer/observer~Observer#observe attaches} to all existing and future
  46370. * {@link #domRoots DOM roots}.
  46371. *
  46372. * Note: Observers are recognized by their constructor (classes). A single observer will be instantiated and used only
  46373. * when registered for the first time. This means that features and other components can register a single observer
  46374. * multiple times without caring whether it has been already added or not.
  46375. *
  46376. * @param {Function} Observer The constructor of an observer to add.
  46377. * Should create an instance inheriting from {@link module:engine/view/observer/observer~Observer}.
  46378. * @returns {module:engine/view/observer/observer~Observer} Added observer instance.
  46379. */
  46380. addObserver( Observer ) {
  46381. let observer = this._observers.get( Observer );
  46382. if ( observer ) {
  46383. return observer;
  46384. }
  46385. observer = new Observer( this );
  46386. this._observers.set( Observer, observer );
  46387. for ( const [ name, domElement ] of this.domRoots ) {
  46388. observer.observe( domElement, name );
  46389. }
  46390. observer.enable();
  46391. return observer;
  46392. }
  46393. /**
  46394. * Returns observer of the given type or `undefined` if such observer has not been added yet.
  46395. *
  46396. * @param {Function} Observer The constructor of an observer to get.
  46397. * @returns {module:engine/view/observer/observer~Observer|undefined} Observer instance or undefined.
  46398. */
  46399. getObserver( Observer ) {
  46400. return this._observers.get( Observer );
  46401. }
  46402. /**
  46403. * Disables all added observers.
  46404. */
  46405. disableObservers() {
  46406. for ( const observer of this._observers.values() ) {
  46407. observer.disable();
  46408. }
  46409. }
  46410. /**
  46411. * Enables all added observers.
  46412. */
  46413. enableObservers() {
  46414. for ( const observer of this._observers.values() ) {
  46415. observer.enable();
  46416. }
  46417. }
  46418. /**
  46419. * Scrolls the page viewport and {@link #domRoots} with their ancestors to reveal the
  46420. * caret, if not already visible to the user.
  46421. */
  46422. scrollToTheSelection() {
  46423. const range = this.document.selection.getFirstRange();
  46424. if ( range ) {
  46425. Object(_ckeditor_ckeditor5_utils_src_dom_scroll__WEBPACK_IMPORTED_MODULE_16__["scrollViewportToShowTarget"])( {
  46426. target: this.domConverter.viewRangeToDom( range ),
  46427. viewportOffset: 20
  46428. } );
  46429. }
  46430. }
  46431. /**
  46432. * It will focus DOM element representing {@link module:engine/view/editableelement~EditableElement EditableElement}
  46433. * that is currently having selection inside.
  46434. */
  46435. focus() {
  46436. if ( !this.document.isFocused ) {
  46437. const editable = this.document.selection.editableElement;
  46438. if ( editable ) {
  46439. this.domConverter.focus( editable );
  46440. this.forceRender();
  46441. } else {
  46442. // Before focusing view document, selection should be placed inside one of the view's editables.
  46443. // Normally its selection will be converted from model document (which have default selection), but
  46444. // when using view document on its own, we need to manually place selection before focusing it.
  46445. //
  46446. // @if CK_DEBUG // console.warn( 'There is no selection in any editable to focus.' );
  46447. }
  46448. }
  46449. }
  46450. /**
  46451. * The `change()` method is the primary way of changing the view. You should use it to modify any node in the view tree.
  46452. * It makes sure that after all changes are made the view is rendered to the DOM (assuming that the view will be changed
  46453. * inside the callback). It prevents situations when the DOM is updated when the view state is not yet correct. It allows
  46454. * to nest calls one inside another and still performs a single rendering after all those changes are made.
  46455. * It also returns the return value of its callback.
  46456. *
  46457. * const text = view.change( writer => {
  46458. * const newText = writer.createText( 'foo' );
  46459. * writer.insert( position1, newText );
  46460. *
  46461. * view.change( writer => {
  46462. * writer.insert( position2, writer.createText( 'bar' ) );
  46463. * } );
  46464. *
  46465. * writer.remove( range );
  46466. *
  46467. * return newText;
  46468. * } );
  46469. *
  46470. * When the outermost change block is done and rendering to the DOM is over the
  46471. * {@link module:engine/view/view~View#event:render `View#render`} event is fired.
  46472. *
  46473. * This method throws a `applying-view-changes-on-rendering` error when
  46474. * the change block is used after rendering to the DOM has started.
  46475. *
  46476. * @param {Function} callback Callback function which may modify the view.
  46477. * @returns {*} Value returned by the callback.
  46478. */
  46479. change( callback ) {
  46480. if ( this.isRenderingInProgress || this._postFixersInProgress ) {
  46481. /**
  46482. * Thrown when there is an attempt to make changes to the view tree when it is in incorrect state. This may
  46483. * cause some unexpected behaviour and inconsistency between the DOM and the view.
  46484. * This may be caused by:
  46485. *
  46486. * * calling {@link #change} or {@link #forceRender} during rendering process,
  46487. * * calling {@link #change} or {@link #forceRender} inside of
  46488. * {@link module:engine/view/document~Document#registerPostFixer post-fixer function}.
  46489. *
  46490. * @error cannot-change-view-tree
  46491. */
  46492. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_19__["default"](
  46493. 'cannot-change-view-tree',
  46494. this
  46495. );
  46496. }
  46497. try {
  46498. // Recursive call to view.change() method - execute listener immediately.
  46499. if ( this._ongoingChange ) {
  46500. return callback( this._writer );
  46501. }
  46502. // This lock will assure that all recursive calls to view.change() will end up in same block - one "render"
  46503. // event for all nested calls.
  46504. this._ongoingChange = true;
  46505. const callbackResult = callback( this._writer );
  46506. this._ongoingChange = false;
  46507. // This lock is used by editing controller to render changes from outer most model.change() once. As plugins might call
  46508. // view.change() inside model.change() block - this will ensures that postfixers and rendering are called once after all
  46509. // changes. Also, we don't need to render anything if there're no changes since last rendering.
  46510. if ( !this._renderingDisabled && this._hasChangedSinceTheLastRendering ) {
  46511. this._postFixersInProgress = true;
  46512. this.document._callPostFixers( this._writer );
  46513. this._postFixersInProgress = false;
  46514. this.fire( 'render' );
  46515. }
  46516. return callbackResult;
  46517. } catch ( err ) {
  46518. // @if CK_DEBUG // throw err;
  46519. /* istanbul ignore next */
  46520. _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_19__["default"].rethrowUnexpectedError( err, this );
  46521. }
  46522. }
  46523. /**
  46524. * Forces rendering {@link module:engine/view/document~Document view document} to DOM. If any view changes are
  46525. * currently in progress, rendering will start after all {@link #change change blocks} are processed.
  46526. *
  46527. * Note that this method is dedicated for special cases. All view changes should be wrapped in the {@link #change}
  46528. * block and the view will automatically check whether it needs to render DOM or not.
  46529. *
  46530. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `applying-view-changes-on-rendering` when
  46531. * trying to re-render when rendering to DOM has already started.
  46532. */
  46533. forceRender() {
  46534. this._hasChangedSinceTheLastRendering = true;
  46535. this.change( () => {} );
  46536. }
  46537. /**
  46538. * Destroys this instance. Makes sure that all observers are destroyed and listeners removed.
  46539. */
  46540. destroy() {
  46541. for ( const observer of this._observers.values() ) {
  46542. observer.destroy();
  46543. }
  46544. this.document.destroy();
  46545. this.stopListening();
  46546. }
  46547. /**
  46548. * Creates position at the given location. The location can be specified as:
  46549. *
  46550. * * a {@link module:engine/view/position~Position position},
  46551. * * parent element and offset (offset defaults to `0`),
  46552. * * parent element and `'end'` (sets position at the end of that element),
  46553. * * {@link module:engine/view/item~Item view item} and `'before'` or `'after'` (sets position before or after given view item).
  46554. *
  46555. * This method is a shortcut to other constructors such as:
  46556. *
  46557. * * {@link #createPositionBefore},
  46558. * * {@link #createPositionAfter},
  46559. *
  46560. * @param {module:engine/view/item~Item|module:engine/model/position~Position} itemOrPosition
  46561. * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when
  46562. * first parameter is a {@link module:engine/view/item~Item view item}.
  46563. */
  46564. createPositionAt( itemOrPosition, offset ) {
  46565. return _position__WEBPACK_IMPORTED_MODULE_4__["default"]._createAt( itemOrPosition, offset );
  46566. }
  46567. /**
  46568. * Creates a new position after given view item.
  46569. *
  46570. * @param {module:engine/view/item~Item} item View item after which the position should be located.
  46571. * @returns {module:engine/view/position~Position}
  46572. */
  46573. createPositionAfter( item ) {
  46574. return _position__WEBPACK_IMPORTED_MODULE_4__["default"]._createAfter( item );
  46575. }
  46576. /**
  46577. * Creates a new position before given view item.
  46578. *
  46579. * @param {module:engine/view/item~Item} item View item before which the position should be located.
  46580. * @returns {module:engine/view/position~Position}
  46581. */
  46582. createPositionBefore( item ) {
  46583. return _position__WEBPACK_IMPORTED_MODULE_4__["default"]._createBefore( item );
  46584. }
  46585. /**
  46586. * Creates a range spanning from `start` position to `end` position.
  46587. *
  46588. * **Note:** This factory method creates it's own {@link module:engine/view/position~Position} instances basing on passed values.
  46589. *
  46590. * @param {module:engine/view/position~Position} start Start position.
  46591. * @param {module:engine/view/position~Position} [end] End position. If not set, range will be collapsed at `start` position.
  46592. * @returns {module:engine/view/range~Range}
  46593. */
  46594. createRange( start, end ) {
  46595. return new _range__WEBPACK_IMPORTED_MODULE_5__["default"]( start, end );
  46596. }
  46597. /**
  46598. * Creates a range that starts before given {@link module:engine/view/item~Item view item} and ends after it.
  46599. *
  46600. * @param {module:engine/view/item~Item} item
  46601. * @returns {module:engine/view/range~Range}
  46602. */
  46603. createRangeOn( item ) {
  46604. return _range__WEBPACK_IMPORTED_MODULE_5__["default"]._createOn( item );
  46605. }
  46606. /**
  46607. * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of
  46608. * that element and ends after the last child of that element.
  46609. *
  46610. * @param {module:engine/view/element~Element} element Element which is a parent for the range.
  46611. * @returns {module:engine/view/range~Range}
  46612. */
  46613. createRangeIn( element ) {
  46614. return _range__WEBPACK_IMPORTED_MODULE_5__["default"]._createIn( element );
  46615. }
  46616. /**
  46617. Creates new {@link module:engine/view/selection~Selection} instance.
  46618. *
  46619. * // Creates empty selection without ranges.
  46620. * const selection = view.createSelection();
  46621. *
  46622. * // Creates selection at the given range.
  46623. * const range = view.createRange( start, end );
  46624. * const selection = view.createSelection( range );
  46625. *
  46626. * // Creates selection at the given ranges
  46627. * const ranges = [ view.createRange( start1, end2 ), view.createRange( star2, end2 ) ];
  46628. * const selection = view.createSelection( ranges );
  46629. *
  46630. * // Creates selection from the other selection.
  46631. * const otherSelection = view.createSelection();
  46632. * const selection = view.createSelection( otherSelection );
  46633. *
  46634. * // Creates selection from the document selection.
  46635. * const selection = view.createSelection( editor.editing.view.document.selection );
  46636. *
  46637. * // Creates selection at the given position.
  46638. * const position = view.createPositionFromPath( root, path );
  46639. * const selection = view.createSelection( position );
  46640. *
  46641. * // Creates collapsed selection at the position of given item and offset.
  46642. * const paragraph = view.createContainerElement( 'paragraph' );
  46643. * const selection = view.createSelection( paragraph, offset );
  46644. *
  46645. * // Creates a range inside an {@link module:engine/view/element~Element element} which starts before the
  46646. * // first child of that element and ends after the last child of that element.
  46647. * const selection = view.createSelection( paragraph, 'in' );
  46648. *
  46649. * // Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends
  46650. * // just after the item.
  46651. * const selection = view.createSelection( paragraph, 'on' );
  46652. *
  46653. * `Selection`'s factory method allow passing additional options (`backward`, `fake` and `label`) as the last argument.
  46654. *
  46655. * // Creates backward selection.
  46656. * const selection = view.createSelection( range, { backward: true } );
  46657. *
  46658. * Fake selection does not render as browser native selection over selected elements and is hidden to the user.
  46659. * This way, no native selection UI artifacts are displayed to the user and selection over elements can be
  46660. * represented in other way, for example by applying proper CSS class.
  46661. *
  46662. * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM
  46663. * (and be properly handled by screen readers).
  46664. *
  46665. * // Creates fake selection with label.
  46666. * const selection = view.createSelection( range, { fake: true, label: 'foo' } );
  46667. *
  46668. * @param {module:engine/view/selection~Selectable} [selectable=null]
  46669. * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Offset or place when selectable is an `Item`.
  46670. * @param {Object} [options]
  46671. * @param {Boolean} [options.backward] Sets this selection instance to be backward.
  46672. * @param {Boolean} [options.fake] Sets this selection instance to be marked as `fake`.
  46673. * @param {String} [options.label] Label for the fake selection.
  46674. * @returns {module:engine/view/selection~Selection}
  46675. */
  46676. createSelection( selectable, placeOrOffset, options ) {
  46677. return new _selection__WEBPACK_IMPORTED_MODULE_6__["default"]( selectable, placeOrOffset, options );
  46678. }
  46679. /**
  46680. * Disables or enables rendering. If the flag is set to `true` then the rendering will be disabled.
  46681. * If the flag is set to `false` and if there was some change in the meantime, then the rendering action will be performed.
  46682. *
  46683. * @protected
  46684. * @param {Boolean} flag A flag indicates whether the rendering should be disabled.
  46685. */
  46686. _disableRendering( flag ) {
  46687. this._renderingDisabled = flag;
  46688. if ( flag == false ) {
  46689. // Render when you stop blocking rendering.
  46690. this.change( () => {} );
  46691. }
  46692. }
  46693. /**
  46694. * Renders all changes. In order to avoid triggering the observers (e.g. mutations) all observers are disabled
  46695. * before rendering and re-enabled after that.
  46696. *
  46697. * @private
  46698. */
  46699. _render() {
  46700. this.isRenderingInProgress = true;
  46701. this.disableObservers();
  46702. this._renderer.render();
  46703. this.enableObservers();
  46704. this.isRenderingInProgress = false;
  46705. }
  46706. /**
  46707. * Fired after a topmost {@link module:engine/view/view~View#change change block} and all
  46708. * {@link module:engine/view/document~Document#registerPostFixer post-fixers} are executed.
  46709. *
  46710. * Actual rendering is performed as a first listener on 'normal' priority.
  46711. *
  46712. * view.on( 'render', () => {
  46713. * // Rendering to the DOM is complete.
  46714. * } );
  46715. *
  46716. * This event is useful when you want to update interface elements after the rendering, e.g. position of the
  46717. * balloon panel. If you wants to change view structure use
  46718. * {@link module:engine/view/document~Document#registerPostFixer post-fixers}.
  46719. *
  46720. * @event module:engine/view/view~View#event:render
  46721. */
  46722. }
  46723. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_15__["default"])( View, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_14__["default"] );
  46724. /***/ }),
  46725. /***/ "./node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css":
  46726. /*!***********************************************************************!*\
  46727. !*** ./node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css ***!
  46728. \***********************************************************************/
  46729. /*! no static exports found */
  46730. /***/ (function(module, exports, __webpack_require__) {
  46731. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  46732. var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./placeholder.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css");
  46733. content = content.__esModule ? content.default : content;
  46734. if (typeof content === 'string') {
  46735. content = [[module.i, content, '']];
  46736. }
  46737. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  46738. options.insert = "head";
  46739. options.singleton = true;
  46740. var update = api(content, options);
  46741. module.exports = content.locals || {};
  46742. /***/ }),
  46743. /***/ "./node_modules/@ckeditor/ckeditor5-enter/src/enter.js":
  46744. /*!*************************************************************!*\
  46745. !*** ./node_modules/@ckeditor/ckeditor5-enter/src/enter.js ***!
  46746. \*************************************************************/
  46747. /*! exports provided: default */
  46748. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46749. "use strict";
  46750. __webpack_require__.r(__webpack_exports__);
  46751. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Enter; });
  46752. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  46753. /* harmony import */ var _entercommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./entercommand */ "./node_modules/@ckeditor/ckeditor5-enter/src/entercommand.js");
  46754. /* harmony import */ var _enterobserver__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./enterobserver */ "./node_modules/@ckeditor/ckeditor5-enter/src/enterobserver.js");
  46755. /**
  46756. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  46757. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  46758. */
  46759. /**
  46760. * @module enter/enter
  46761. */
  46762. /**
  46763. * This plugin handles the <kbd>Enter</kbd> key (hard line break) in the editor.
  46764. *
  46765. * See also the {@link module:enter/shiftenter~ShiftEnter} plugin.
  46766. *
  46767. * For more information about this feature see the {@glink api/enter package page}.
  46768. *
  46769. * @extends module:core/plugin~Plugin
  46770. */
  46771. class Enter extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  46772. /**
  46773. * @inheritDoc
  46774. */
  46775. static get pluginName() {
  46776. return 'Enter';
  46777. }
  46778. init() {
  46779. const editor = this.editor;
  46780. const view = editor.editing.view;
  46781. const viewDocument = view.document;
  46782. view.addObserver( _enterobserver__WEBPACK_IMPORTED_MODULE_2__["default"] );
  46783. editor.commands.add( 'enter', new _entercommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor ) );
  46784. this.listenTo( viewDocument, 'enter', ( evt, data ) => {
  46785. data.preventDefault();
  46786. // The soft enter key is handled by the ShiftEnter plugin.
  46787. if ( data.isSoft ) {
  46788. return;
  46789. }
  46790. editor.execute( 'enter' );
  46791. view.scrollToTheSelection();
  46792. }, { priority: 'low' } );
  46793. }
  46794. }
  46795. /***/ }),
  46796. /***/ "./node_modules/@ckeditor/ckeditor5-enter/src/entercommand.js":
  46797. /*!********************************************************************!*\
  46798. !*** ./node_modules/@ckeditor/ckeditor5-enter/src/entercommand.js ***!
  46799. \********************************************************************/
  46800. /*! exports provided: default */
  46801. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46802. "use strict";
  46803. __webpack_require__.r(__webpack_exports__);
  46804. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EnterCommand; });
  46805. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  46806. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-enter/src/utils.js");
  46807. /**
  46808. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  46809. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  46810. */
  46811. /**
  46812. * @module enter/entercommand
  46813. */
  46814. /**
  46815. * Enter command. It is used by the {@link module:enter/enter~Enter Enter feature} to handle the <kbd>Enter</kbd> key.
  46816. *
  46817. * @extends module:core/command~Command
  46818. */
  46819. class EnterCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  46820. /**
  46821. * @inheritDoc
  46822. */
  46823. execute() {
  46824. const model = this.editor.model;
  46825. const doc = model.document;
  46826. model.change( writer => {
  46827. enterBlock( this.editor.model, writer, doc.selection, model.schema );
  46828. this.fire( 'afterExecute', { writer } );
  46829. } );
  46830. }
  46831. }
  46832. // Creates a new block in the way that the <kbd>Enter</kbd> key is expected to work.
  46833. //
  46834. // @param {module:engine/model~Model} model
  46835. // @param {module:engine/model/writer~Writer} writer
  46836. // @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  46837. // Selection on which the action should be performed.
  46838. // @param {module:engine/model/schema~Schema} schema
  46839. function enterBlock( model, writer, selection, schema ) {
  46840. const isSelectionEmpty = selection.isCollapsed;
  46841. const range = selection.getFirstRange();
  46842. const startElement = range.start.parent;
  46843. const endElement = range.end.parent;
  46844. // Don't touch the roots and other limit elements.
  46845. if ( schema.isLimit( startElement ) || schema.isLimit( endElement ) ) {
  46846. // Delete the selected content but only if inside a single limit element.
  46847. // Abort, when crossing limit elements boundary (e.g. <limit1>x[x</limit1>donttouchme<limit2>y]y</limit2>).
  46848. // This is an edge case and it's hard to tell what should actually happen because such a selection
  46849. // is not entirely valid.
  46850. if ( !isSelectionEmpty && startElement == endElement ) {
  46851. model.deleteContent( selection );
  46852. }
  46853. return;
  46854. }
  46855. if ( isSelectionEmpty ) {
  46856. const attributesToCopy = Object(_utils__WEBPACK_IMPORTED_MODULE_1__["getCopyOnEnterAttributes"])( writer.model.schema, selection.getAttributes() );
  46857. splitBlock( writer, range.start );
  46858. writer.setSelectionAttribute( attributesToCopy );
  46859. } else {
  46860. const leaveUnmerged = !( range.start.isAtStart && range.end.isAtEnd );
  46861. const isContainedWithinOneElement = ( startElement == endElement );
  46862. model.deleteContent( selection, { leaveUnmerged } );
  46863. if ( leaveUnmerged ) {
  46864. // Partially selected elements.
  46865. //
  46866. // <h>x[xx]x</h> -> <h>x^x</h> -> <h>x</h><h>^x</h>
  46867. if ( isContainedWithinOneElement ) {
  46868. splitBlock( writer, selection.focus );
  46869. }
  46870. // Selection over multiple elements.
  46871. //
  46872. // <h>x[x</h><p>y]y<p> -> <h>x^</h><p>y</p> -> <h>x</h><p>^y</p>
  46873. else {
  46874. writer.setSelection( endElement, 0 );
  46875. }
  46876. }
  46877. }
  46878. }
  46879. function splitBlock( writer, splitPos ) {
  46880. writer.split( splitPos );
  46881. writer.setSelection( splitPos.parent.nextSibling, 0 );
  46882. }
  46883. /***/ }),
  46884. /***/ "./node_modules/@ckeditor/ckeditor5-enter/src/enterobserver.js":
  46885. /*!*********************************************************************!*\
  46886. !*** ./node_modules/@ckeditor/ckeditor5-enter/src/enterobserver.js ***!
  46887. \*********************************************************************/
  46888. /*! exports provided: default */
  46889. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46890. "use strict";
  46891. __webpack_require__.r(__webpack_exports__);
  46892. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EnterObserver; });
  46893. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_observer_observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/observer/observer */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js");
  46894. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_observer_domeventdata__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/observer/domeventdata */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventdata.js");
  46895. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
  46896. /**
  46897. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  46898. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  46899. */
  46900. /**
  46901. * @module enter/enterobserver
  46902. */
  46903. /**
  46904. * Enter observer introduces the {@link module:engine/view/document~Document#event:enter} event.
  46905. *
  46906. * @extends module:engine/view/observer/observer~Observer
  46907. */
  46908. class EnterObserver extends _ckeditor_ckeditor5_engine_src_view_observer_observer__WEBPACK_IMPORTED_MODULE_0__["default"] {
  46909. constructor( view ) {
  46910. super( view );
  46911. const doc = this.document;
  46912. doc.on( 'keydown', ( evt, data ) => {
  46913. if ( this.isEnabled && data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_2__["keyCodes"].enter ) {
  46914. // Save the event object to check later if it was stopped or not.
  46915. let event;
  46916. doc.once( 'enter', evt => ( event = evt ), { priority: 'highest' } );
  46917. doc.fire( 'enter', new _ckeditor_ckeditor5_engine_src_view_observer_domeventdata__WEBPACK_IMPORTED_MODULE_1__["default"]( doc, data.domEvent, {
  46918. isSoft: data.shiftKey
  46919. } ) );
  46920. // Stop `keydown` event if `enter` event was stopped.
  46921. // https://github.com/ckeditor/ckeditor5/issues/753
  46922. if ( event && event.stop.called ) {
  46923. evt.stop();
  46924. }
  46925. }
  46926. } );
  46927. }
  46928. /**
  46929. * @inheritDoc
  46930. */
  46931. observe() {}
  46932. }
  46933. /**
  46934. * Event fired when the user presses the <kbd>Enter</kbd> key.
  46935. *
  46936. * Note: This event is fired by the {@link module:enter/enterobserver~EnterObserver observer}
  46937. * (usually registered by the {@link module:enter/enter~Enter Enter feature} and
  46938. * {@link module:enter/shiftenter~ShiftEnter ShiftEnter feature}).
  46939. *
  46940. * @event module:engine/view/document~Document#event:enter
  46941. * @param {module:engine/view/observer/domeventdata~DomEventData} data
  46942. * @param {Boolean} data.isSoft Whether it's a soft enter (<kbd>Shift</kbd>+<kbd>Enter</kbd>) or hard enter (<kbd>Enter</kbd>).
  46943. */
  46944. /***/ }),
  46945. /***/ "./node_modules/@ckeditor/ckeditor5-enter/src/shiftenter.js":
  46946. /*!******************************************************************!*\
  46947. !*** ./node_modules/@ckeditor/ckeditor5-enter/src/shiftenter.js ***!
  46948. \******************************************************************/
  46949. /*! exports provided: default */
  46950. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46951. "use strict";
  46952. __webpack_require__.r(__webpack_exports__);
  46953. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ShiftEnter; });
  46954. /* harmony import */ var _shiftentercommand__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./shiftentercommand */ "./node_modules/@ckeditor/ckeditor5-enter/src/shiftentercommand.js");
  46955. /* harmony import */ var _enterobserver__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./enterobserver */ "./node_modules/@ckeditor/ckeditor5-enter/src/enterobserver.js");
  46956. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  46957. /**
  46958. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  46959. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  46960. */
  46961. /**
  46962. * @module enter/shiftenter
  46963. */
  46964. /**
  46965. * This plugin handles the <kbd>Shift</kbd>+<kbd>Enter</kbd> keystroke (soft line break) in the editor.
  46966. *
  46967. * See also the {@link module:enter/enter~Enter} plugin.
  46968. *
  46969. * For more information about this feature see the {@glink api/enter package page}.
  46970. *
  46971. * @extends module:core/plugin~Plugin
  46972. */
  46973. class ShiftEnter extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_2__["default"] {
  46974. /**
  46975. * @inheritDoc
  46976. */
  46977. static get pluginName() {
  46978. return 'ShiftEnter';
  46979. }
  46980. init() {
  46981. const editor = this.editor;
  46982. const schema = editor.model.schema;
  46983. const conversion = editor.conversion;
  46984. const view = editor.editing.view;
  46985. const viewDocument = view.document;
  46986. // Configure the schema.
  46987. schema.register( 'softBreak', {
  46988. allowWhere: '$text',
  46989. isInline: true
  46990. } );
  46991. // Configure converters.
  46992. conversion.for( 'upcast' )
  46993. .elementToElement( {
  46994. model: 'softBreak',
  46995. view: 'br'
  46996. } );
  46997. conversion.for( 'downcast' )
  46998. .elementToElement( {
  46999. model: 'softBreak',
  47000. view: ( modelElement, { writer } ) => writer.createEmptyElement( 'br' )
  47001. } );
  47002. view.addObserver( _enterobserver__WEBPACK_IMPORTED_MODULE_1__["default"] );
  47003. editor.commands.add( 'shiftEnter', new _shiftentercommand__WEBPACK_IMPORTED_MODULE_0__["default"]( editor ) );
  47004. this.listenTo( viewDocument, 'enter', ( evt, data ) => {
  47005. data.preventDefault();
  47006. // The hard enter key is handled by the Enter plugin.
  47007. if ( !data.isSoft ) {
  47008. return;
  47009. }
  47010. editor.execute( 'shiftEnter' );
  47011. view.scrollToTheSelection();
  47012. }, { priority: 'low' } );
  47013. }
  47014. }
  47015. /***/ }),
  47016. /***/ "./node_modules/@ckeditor/ckeditor5-enter/src/shiftentercommand.js":
  47017. /*!*************************************************************************!*\
  47018. !*** ./node_modules/@ckeditor/ckeditor5-enter/src/shiftentercommand.js ***!
  47019. \*************************************************************************/
  47020. /*! exports provided: default */
  47021. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  47022. "use strict";
  47023. __webpack_require__.r(__webpack_exports__);
  47024. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ShiftEnterCommand; });
  47025. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  47026. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-enter/src/utils.js");
  47027. /**
  47028. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  47029. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  47030. */
  47031. /**
  47032. * @module enter/shiftentercommand
  47033. */
  47034. /**
  47035. * ShiftEnter command. It is used by the {@link module:enter/shiftenter~ShiftEnter ShiftEnter feature} to handle
  47036. * the <kbd>Shift</kbd>+<kbd>Enter</kbd> keystroke.
  47037. *
  47038. * @extends module:core/command~Command
  47039. */
  47040. class ShiftEnterCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  47041. /**
  47042. * @inheritDoc
  47043. */
  47044. execute() {
  47045. const model = this.editor.model;
  47046. const doc = model.document;
  47047. model.change( writer => {
  47048. softBreakAction( model, writer, doc.selection );
  47049. this.fire( 'afterExecute', { writer } );
  47050. } );
  47051. }
  47052. refresh() {
  47053. const model = this.editor.model;
  47054. const doc = model.document;
  47055. this.isEnabled = isEnabled( model.schema, doc.selection );
  47056. }
  47057. }
  47058. // Checks whether the ShiftEnter command should be enabled in the specified selection.
  47059. //
  47060. // @param {module:engine/model/schema~Schema} schema
  47061. // @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  47062. function isEnabled( schema, selection ) {
  47063. // At this moment it is okay to support single range selections only.
  47064. // But in the future we may need to change that.
  47065. if ( selection.rangeCount > 1 ) {
  47066. return false;
  47067. }
  47068. const anchorPos = selection.anchor;
  47069. // Check whether the break element can be inserted in the current selection anchor.
  47070. if ( !anchorPos || !schema.checkChild( anchorPos, 'softBreak' ) ) {
  47071. return false;
  47072. }
  47073. const range = selection.getFirstRange();
  47074. const startElement = range.start.parent;
  47075. const endElement = range.end.parent;
  47076. // Do not modify the content if selection is cross-limit elements.
  47077. if ( ( isInsideLimitElement( startElement, schema ) || isInsideLimitElement( endElement, schema ) ) && startElement !== endElement ) {
  47078. return false;
  47079. }
  47080. return true;
  47081. }
  47082. // Creates a break in the way that the <kbd>Shift</kbd>+<kbd>Enter</kbd> keystroke is expected to work.
  47083. //
  47084. // @param {module:engine/model~Model} model
  47085. // @param {module:engine/model/writer~Writer} writer
  47086. // @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  47087. // Selection on which the action should be performed.
  47088. function softBreakAction( model, writer, selection ) {
  47089. const isSelectionEmpty = selection.isCollapsed;
  47090. const range = selection.getFirstRange();
  47091. const startElement = range.start.parent;
  47092. const endElement = range.end.parent;
  47093. const isContainedWithinOneElement = ( startElement == endElement );
  47094. if ( isSelectionEmpty ) {
  47095. const attributesToCopy = Object(_utils__WEBPACK_IMPORTED_MODULE_1__["getCopyOnEnterAttributes"])( model.schema, selection.getAttributes() );
  47096. insertBreak( model, writer, range.end );
  47097. writer.removeSelectionAttribute( selection.getAttributeKeys() );
  47098. writer.setSelectionAttribute( attributesToCopy );
  47099. } else {
  47100. const leaveUnmerged = !( range.start.isAtStart && range.end.isAtEnd );
  47101. model.deleteContent( selection, { leaveUnmerged } );
  47102. // Selection within one element:
  47103. //
  47104. // <h>x[xx]x</h> -> <h>x^x</h> -> <h>x<br>^x</h>
  47105. if ( isContainedWithinOneElement ) {
  47106. insertBreak( model, writer, selection.focus );
  47107. }
  47108. // Selection over multiple elements.
  47109. //
  47110. // <h>x[x</h><p>y]y<p> -> <h>x^</h><p>y</p> -> <h>x</h><p>^y</p>
  47111. //
  47112. // We chose not to insert a line break in this case because:
  47113. //
  47114. // * it's not a very common scenario,
  47115. // * it actually surprised me when I saw the "expected behavior" in real life.
  47116. //
  47117. // It's ok if the user will need to be more specific where they want the <br> to be inserted.
  47118. else {
  47119. // Move the selection to the 2nd element (last step of the example above).
  47120. if ( leaveUnmerged ) {
  47121. writer.setSelection( endElement, 0 );
  47122. }
  47123. }
  47124. }
  47125. }
  47126. function insertBreak( model, writer, position ) {
  47127. const breakLineElement = writer.createElement( 'softBreak' );
  47128. model.insertContent( breakLineElement, position );
  47129. writer.setSelection( breakLineElement, 'after' );
  47130. }
  47131. // Checks whether the specified `element` is a child of the limit element.
  47132. //
  47133. // Checking whether the `<p>` element is inside a limit element:
  47134. // - <$root><p>Text.</p></$root> => false
  47135. // - <$root><limitElement><p>Text</p></limitElement></$root> => true
  47136. //
  47137. // @param {module:engine/model/element~Element} element
  47138. // @param {module:engine/schema~Schema} schema
  47139. // @returns {Boolean}
  47140. function isInsideLimitElement( element, schema ) {
  47141. // `$root` is a limit element but in this case is an invalid element.
  47142. if ( element.is( 'rootElement' ) ) {
  47143. return false;
  47144. }
  47145. return schema.isLimit( element ) || isInsideLimitElement( element.parent, schema );
  47146. }
  47147. /***/ }),
  47148. /***/ "./node_modules/@ckeditor/ckeditor5-enter/src/utils.js":
  47149. /*!*************************************************************!*\
  47150. !*** ./node_modules/@ckeditor/ckeditor5-enter/src/utils.js ***!
  47151. \*************************************************************/
  47152. /*! exports provided: getCopyOnEnterAttributes */
  47153. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  47154. "use strict";
  47155. __webpack_require__.r(__webpack_exports__);
  47156. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCopyOnEnterAttributes", function() { return getCopyOnEnterAttributes; });
  47157. /**
  47158. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  47159. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  47160. */
  47161. /**
  47162. * @module enter/utils
  47163. */
  47164. /**
  47165. * Returns attributes that should be preserved on the enter key.
  47166. *
  47167. * Filtering is realized based on `copyOnEnter` attribute property. Read more about attribute properties
  47168. * {@link module:engine/model/schema~Schema#setAttributeProperties here}.
  47169. *
  47170. * @param {module:engine/model/schema~Schema} schema
  47171. * @param {Iterable.<*>} allAttributes attributes to filter.
  47172. * @returns {Iterable.<*>}
  47173. */
  47174. function* getCopyOnEnterAttributes( schema, allAttributes ) {
  47175. for ( const attribute of allAttributes ) {
  47176. if ( attribute && schema.getAttributeProperties( attribute[ 0 ] ).copyOnEnter ) {
  47177. yield attribute;
  47178. }
  47179. }
  47180. }
  47181. /***/ }),
  47182. /***/ "./node_modules/@ckeditor/ckeditor5-essentials/src/essentials.js":
  47183. /*!***********************************************************************!*\
  47184. !*** ./node_modules/@ckeditor/ckeditor5-essentials/src/essentials.js ***!
  47185. \***********************************************************************/
  47186. /*! exports provided: default */
  47187. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  47188. "use strict";
  47189. __webpack_require__.r(__webpack_exports__);
  47190. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Essentials; });
  47191. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  47192. /* harmony import */ var _ckeditor_ckeditor5_clipboard_src_clipboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-clipboard/src/clipboard */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboard.js");
  47193. /* harmony import */ var _ckeditor_ckeditor5_enter_src_enter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-enter/src/enter */ "./node_modules/@ckeditor/ckeditor5-enter/src/enter.js");
  47194. /* harmony import */ var _ckeditor_ckeditor5_enter_src_shiftenter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-enter/src/shiftenter */ "./node_modules/@ckeditor/ckeditor5-enter/src/shiftenter.js");
  47195. /* harmony import */ var _ckeditor_ckeditor5_select_all_src_selectall__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-select-all/src/selectall */ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectall.js");
  47196. /* harmony import */ var _ckeditor_ckeditor5_typing_src_typing__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-typing/src/typing */ "./node_modules/@ckeditor/ckeditor5-typing/src/typing.js");
  47197. /* harmony import */ var _ckeditor_ckeditor5_undo_src_undo__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-undo/src/undo */ "./node_modules/@ckeditor/ckeditor5-undo/src/undo.js");
  47198. /**
  47199. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  47200. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  47201. */
  47202. /**
  47203. * @module essentials/essentials
  47204. */
  47205. /**
  47206. * A plugin including all essential editing features. It represents a set of features that enables similar functionalities
  47207. * to a `<textarea>` element.
  47208. *
  47209. * It includes:
  47210. *
  47211. * * {@link module:clipboard/clipboard~Clipboard},
  47212. * * {@link module:enter/enter~Enter},
  47213. * * {@link module:select-all/selectall~SelectAll},
  47214. * * {@link module:enter/shiftenter~ShiftEnter},
  47215. * * {@link module:typing/typing~Typing},
  47216. * * {@link module:undo/undo~Undo}.
  47217. *
  47218. * This plugin set does not define any block-level containers (such as {@link module:paragraph/paragraph~Paragraph}).
  47219. * If your editor is supposed to handle block content, make sure to include it.
  47220. *
  47221. * @extends module:core/plugin~Plugin
  47222. */
  47223. class Essentials extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  47224. /**
  47225. * @inheritDoc
  47226. */
  47227. static get requires() {
  47228. return [ _ckeditor_ckeditor5_clipboard_src_clipboard__WEBPACK_IMPORTED_MODULE_1__["default"], _ckeditor_ckeditor5_enter_src_enter__WEBPACK_IMPORTED_MODULE_2__["default"], _ckeditor_ckeditor5_select_all_src_selectall__WEBPACK_IMPORTED_MODULE_4__["default"], _ckeditor_ckeditor5_enter_src_shiftenter__WEBPACK_IMPORTED_MODULE_3__["default"], _ckeditor_ckeditor5_typing_src_typing__WEBPACK_IMPORTED_MODULE_5__["default"], _ckeditor_ckeditor5_undo_src_undo__WEBPACK_IMPORTED_MODULE_6__["default"] ];
  47229. }
  47230. /**
  47231. * @inheritDoc
  47232. */
  47233. static get pluginName() {
  47234. return 'Essentials';
  47235. }
  47236. }
  47237. /***/ }),
  47238. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/documentcolorcollection.js":
  47239. /*!******************************************************************************!*\
  47240. !*** ./node_modules/@ckeditor/ckeditor5-font/src/documentcolorcollection.js ***!
  47241. \******************************************************************************/
  47242. /*! exports provided: default */
  47243. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  47244. "use strict";
  47245. __webpack_require__.r(__webpack_exports__);
  47246. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DocumentColorCollection; });
  47247. /* harmony import */ var _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/collection */ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js");
  47248. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  47249. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  47250. /**
  47251. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  47252. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  47253. */
  47254. /**
  47255. * @module font/documentcolorcollection
  47256. */
  47257. /**
  47258. * A collection to store document colors. It enforces colors to be unique.
  47259. *
  47260. * @mixes module:utils/observablemixin~ObservableMixin
  47261. * @extends module:utils/collection~Collection
  47262. */
  47263. class DocumentColorCollection extends _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_0__["default"] {
  47264. constructor( options ) {
  47265. super( options );
  47266. /**
  47267. * Indicates whether the document color collection is empty.
  47268. *
  47269. * @observable
  47270. * @readonly
  47271. * @member {Boolean} #isEmpty
  47272. */
  47273. this.set( 'isEmpty', true );
  47274. this.on( 'change', () => {
  47275. this.set( 'isEmpty', this.length === 0 );
  47276. } );
  47277. }
  47278. /**
  47279. * Adds a color to the document color collection.
  47280. *
  47281. * This method ensures that no color duplicates are inserted (compared using
  47282. * the color value of the {@link module:ui/colorgrid/colorgrid~ColorDefinition}).
  47283. *
  47284. * If the item does not have an ID, it will be automatically generated and set on the item.
  47285. *
  47286. * @chainable
  47287. * @param {module:ui/colorgrid/colorgrid~ColorDefinition} item
  47288. * @param {Number} [index] The position of the item in the collection. The item
  47289. * is pushed to the collection when `index` is not specified.
  47290. * @fires add
  47291. * @fires change
  47292. */
  47293. add( item, index ) {
  47294. if ( this.find( element => element.color === item.color ) ) {
  47295. // No duplicates are allowed.
  47296. return;
  47297. }
  47298. super.add( item, index );
  47299. }
  47300. /**
  47301. * Checks if an object with given colors is present in the document color collection.
  47302. *
  47303. * @param {String} color
  47304. * @returns {Boolean}
  47305. */
  47306. hasColor( color ) {
  47307. return !!this.find( item => item.color === color );
  47308. }
  47309. }
  47310. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( DocumentColorCollection, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  47311. /***/ }),
  47312. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor.js":
  47313. /*!**************************************************************************!*\
  47314. !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor.js ***!
  47315. \**************************************************************************/
  47316. /*! exports provided: default */
  47317. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  47318. "use strict";
  47319. __webpack_require__.r(__webpack_exports__);
  47320. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontBackgroundColor; });
  47321. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  47322. /* harmony import */ var _fontbackgroundcolor_fontbackgroundcolorediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fontbackgroundcolor/fontbackgroundcolorediting */ "./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorediting.js");
  47323. /* harmony import */ var _fontbackgroundcolor_fontbackgroundcolorui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fontbackgroundcolor/fontbackgroundcolorui */ "./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorui.js");
  47324. /**
  47325. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  47326. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  47327. */
  47328. /**
  47329. * @module font/fontbackgroundcolor
  47330. */
  47331. /**
  47332. * The font background color plugin.
  47333. *
  47334. * For a detailed overview, check the {@glink features/font font feature} documentation
  47335. * and the {@glink api/font package page}.
  47336. *
  47337. * This is a "glue" plugin which loads
  47338. * the {@link module:font/fontbackgroundcolor/fontbackgroundcolorediting~FontBackgroundColorEditing} and
  47339. * {@link module:font/fontbackgroundcolor/fontbackgroundcolorui~FontBackgroundColorUI} features in the editor.
  47340. *
  47341. * @extends module:core/plugin~Plugin
  47342. */
  47343. class FontBackgroundColor extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  47344. /**
  47345. * @inheritDoc
  47346. */
  47347. static get requires() {
  47348. return [ _fontbackgroundcolor_fontbackgroundcolorediting__WEBPACK_IMPORTED_MODULE_1__["default"], _fontbackgroundcolor_fontbackgroundcolorui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  47349. }
  47350. /**
  47351. * @inheritDoc
  47352. */
  47353. static get pluginName() {
  47354. return 'FontBackgroundColor';
  47355. }
  47356. }
  47357. /**
  47358. * The configuration of the font background color feature.
  47359. * It is introduced by the {@link module:font/fontbackgroundcolor/fontbackgroundcolorediting~FontBackgroundColorEditing} feature.
  47360. *
  47361. * Read more in {@link module:font/fontbackgroundcolor~FontBackgroundColorConfig}.
  47362. *
  47363. * @member {module:font/fontbackgroundcolor~FontBackgroundColorConfig} module:core/editor/editorconfig~EditorConfig#fontBackgroundColor
  47364. */
  47365. /**
  47366. * The configuration of the font background color feature.
  47367. * This option is used by the {@link module:font/fontbackgroundcolor/fontbackgroundcolorediting~FontBackgroundColorEditing} feature.
  47368. *
  47369. * ClassicEditor
  47370. * .create( {
  47371. * fontBackgroundColor: ... // Font background color feature configuration.
  47372. * } )
  47373. * .then( ... )
  47374. * .catch( ... );
  47375. *
  47376. * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
  47377. *
  47378. * @interface module:font/fontbackgroundcolor~FontBackgroundColorConfig
  47379. */
  47380. /**
  47381. * Available font background colors defined as an array of strings or objects.
  47382. *
  47383. * The default value registers the following colors:
  47384. *
  47385. * const fontBackgroundColorConfig = {
  47386. * colors: [
  47387. * {
  47388. * color: 'hsl(0, 0%, 0%)',
  47389. * label: 'Black'
  47390. * },
  47391. * {
  47392. * color: 'hsl(0, 0%, 30%)',
  47393. * label: 'Dim grey'
  47394. * },
  47395. * {
  47396. * color: 'hsl(0, 0%, 60%)',
  47397. * label: 'Grey'
  47398. * },
  47399. * {
  47400. * color: 'hsl(0, 0%, 90%)',
  47401. * label: 'Light grey'
  47402. * },
  47403. * {
  47404. * color: 'hsl(0, 0%, 100%)',
  47405. * label: 'White',
  47406. * hasBorder: true
  47407. * },
  47408. * {
  47409. * color: 'hsl(0, 75%, 60%)',
  47410. * label: 'Red'
  47411. * },
  47412. * {
  47413. * color: 'hsl(30, 75%, 60%)',
  47414. * label: 'Orange'
  47415. * },
  47416. * {
  47417. * color: 'hsl(60, 75%, 60%)',
  47418. * label: 'Yellow'
  47419. * },
  47420. * {
  47421. * color: 'hsl(90, 75%, 60%)',
  47422. * label: 'Light green'
  47423. * },
  47424. * {
  47425. * color: 'hsl(120, 75%, 60%)',
  47426. * label: 'Green'
  47427. * },
  47428. * {
  47429. * color: 'hsl(150, 75%, 60%)',
  47430. * label: 'Aquamarine'
  47431. * },
  47432. * {
  47433. * color: 'hsl(180, 75%, 60%)',
  47434. * label: 'Turquoise'
  47435. * },
  47436. * {
  47437. * color: 'hsl(210, 75%, 60%)',
  47438. * label: 'Light blue'
  47439. * },
  47440. * {
  47441. * color: 'hsl(240, 75%, 60%)',
  47442. * label: 'Blue'
  47443. * },
  47444. * {
  47445. * color: 'hsl(270, 75%, 60%)',
  47446. * label: 'Purple'
  47447. * }
  47448. * ]
  47449. * };
  47450. *
  47451. * **Note**: The colors are displayed in the `'fontBackgroundColor'` dropdown.
  47452. *
  47453. * @member {Array.<String|Object>} module:font/fontbackgroundcolor~FontBackgroundColorConfig#colors
  47454. */
  47455. /**
  47456. * Represents the number of columns in the font background color dropdown.
  47457. *
  47458. * The default value is:
  47459. *
  47460. * const fontBackgroundColorConfig = {
  47461. * columns: 5
  47462. * }
  47463. *
  47464. * @member {Number} module:font/fontbackgroundcolor~FontBackgroundColorConfig#columns
  47465. */
  47466. /**
  47467. * Determines the maximum number of available document colors.
  47468. * Setting it to `0` will disable the document colors feature.
  47469. *
  47470. * By default it equals to the {@link module:font/fontbackgroundcolor~FontBackgroundColorConfig#columns} value.
  47471. *
  47472. * Examples:
  47473. *
  47474. * // 1) Neither document colors nor columns are defined in the configuration.
  47475. * // Document colors will equal 5,
  47476. * // because the value will be inherited from columns,
  47477. * // which has a predefined value of 5.
  47478. * const fontBackgroundColorConfig = {}
  47479. *
  47480. * // 2) Document colors will equal 8, because the value will be inherited from columns.
  47481. * const fontBackgroundColorConfig = {
  47482. * columns: 8
  47483. * }
  47484. *
  47485. * // 3) Document colors will equal 24, because it has its own value defined.
  47486. * const fontBackgroundColorConfig = {
  47487. * columns: 8,
  47488. * documentColors: 24
  47489. * }
  47490. *
  47491. * // 4) The document colors feature will be disabled.
  47492. * const fontBackgroundColorConfig = {
  47493. * columns: 8,
  47494. * documentColors: 0
  47495. * }
  47496. *
  47497. * @member {Number} module:font/fontbackgroundcolor~FontBackgroundColorConfig#documentColors
  47498. */
  47499. /***/ }),
  47500. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorcommand.js":
  47501. /*!*****************************************************************************************************!*\
  47502. !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorcommand.js ***!
  47503. \*****************************************************************************************************/
  47504. /*! exports provided: default */
  47505. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  47506. "use strict";
  47507. __webpack_require__.r(__webpack_exports__);
  47508. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontBackgroundColorCommand; });
  47509. /* harmony import */ var _fontcommand__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../fontcommand */ "./node_modules/@ckeditor/ckeditor5-font/src/fontcommand.js");
  47510. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-font/src/utils.js");
  47511. /**
  47512. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  47513. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  47514. */
  47515. /**
  47516. * @module font/fontbackgroundcolor/fontbackgroundcolorcommand
  47517. */
  47518. /**
  47519. * The font background color command. It is used by
  47520. * {@link module:font/fontbackgroundcolor/fontbackgroundcolorediting~FontBackgroundColorEditing}
  47521. * to apply the font background color.
  47522. *
  47523. * editor.execute( 'fontBackgroundColor', { value: 'rgb(250, 20, 20)' } );
  47524. *
  47525. * **Note**: Executing the command with the `null` value removes the attribute from the model.
  47526. *
  47527. * @extends module:font/fontcommand~FontCommand
  47528. */
  47529. class FontBackgroundColorCommand extends _fontcommand__WEBPACK_IMPORTED_MODULE_0__["default"] {
  47530. /**
  47531. * @inheritDoc
  47532. */
  47533. constructor( editor ) {
  47534. super( editor, _utils__WEBPACK_IMPORTED_MODULE_1__["FONT_BACKGROUND_COLOR"] );
  47535. }
  47536. }
  47537. /***/ }),
  47538. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorediting.js":
  47539. /*!*****************************************************************************************************!*\
  47540. !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorediting.js ***!
  47541. \*****************************************************************************************************/
  47542. /*! exports provided: default */
  47543. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  47544. "use strict";
  47545. __webpack_require__.r(__webpack_exports__);
  47546. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontBackgroundColorEditing; });
  47547. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  47548. /* harmony import */ var _fontbackgroundcolorcommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fontbackgroundcolorcommand */ "./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorcommand.js");
  47549. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-font/src/utils.js");
  47550. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_styles_background__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/styles/background */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/background.js");
  47551. /**
  47552. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  47553. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  47554. */
  47555. /**
  47556. * @module font/fontbackgroundcolor/fontbackgroundcolorediting
  47557. */
  47558. /**
  47559. * The font background color editing feature.
  47560. *
  47561. * It introduces the {@link module:font/fontbackgroundcolor/fontbackgroundcolorcommand~FontBackgroundColorCommand command} and
  47562. * the `fontBackgroundColor` attribute in the {@link module:engine/model/model~Model model} which renders
  47563. * in the {@link module:engine/view/view view} as a `<span>` element (`<span style="background-color: ...">`),
  47564. * depending on the {@link module:font/fontbackgroundcolor~FontBackgroundColorConfig configuration}.
  47565. *
  47566. * @extends module:core/plugin~Plugin
  47567. */
  47568. class FontBackgroundColorEditing extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  47569. /**
  47570. * @inheritDoc
  47571. */
  47572. static get pluginName() {
  47573. return 'FontBackgroundColorEditing';
  47574. }
  47575. /**
  47576. * @inheritDoc
  47577. */
  47578. constructor( editor ) {
  47579. super( editor );
  47580. editor.config.define( _utils__WEBPACK_IMPORTED_MODULE_2__["FONT_BACKGROUND_COLOR"], {
  47581. colors: [
  47582. {
  47583. color: 'hsl(0, 0%, 0%)',
  47584. label: 'Black'
  47585. },
  47586. {
  47587. color: 'hsl(0, 0%, 30%)',
  47588. label: 'Dim grey'
  47589. },
  47590. {
  47591. color: 'hsl(0, 0%, 60%)',
  47592. label: 'Grey'
  47593. },
  47594. {
  47595. color: 'hsl(0, 0%, 90%)',
  47596. label: 'Light grey'
  47597. },
  47598. {
  47599. color: 'hsl(0, 0%, 100%)',
  47600. label: 'White',
  47601. hasBorder: true
  47602. },
  47603. {
  47604. color: 'hsl(0, 75%, 60%)',
  47605. label: 'Red'
  47606. },
  47607. {
  47608. color: 'hsl(30, 75%, 60%)',
  47609. label: 'Orange'
  47610. },
  47611. {
  47612. color: 'hsl(60, 75%, 60%)',
  47613. label: 'Yellow'
  47614. },
  47615. {
  47616. color: 'hsl(90, 75%, 60%)',
  47617. label: 'Light green'
  47618. },
  47619. {
  47620. color: 'hsl(120, 75%, 60%)',
  47621. label: 'Green'
  47622. },
  47623. {
  47624. color: 'hsl(150, 75%, 60%)',
  47625. label: 'Aquamarine'
  47626. },
  47627. {
  47628. color: 'hsl(180, 75%, 60%)',
  47629. label: 'Turquoise'
  47630. },
  47631. {
  47632. color: 'hsl(210, 75%, 60%)',
  47633. label: 'Light blue'
  47634. },
  47635. {
  47636. color: 'hsl(240, 75%, 60%)',
  47637. label: 'Blue'
  47638. },
  47639. {
  47640. color: 'hsl(270, 75%, 60%)',
  47641. label: 'Purple'
  47642. }
  47643. ],
  47644. columns: 5
  47645. } );
  47646. editor.data.addStyleProcessorRules( _ckeditor_ckeditor5_engine_src_view_styles_background__WEBPACK_IMPORTED_MODULE_3__["addBackgroundRules"] );
  47647. editor.conversion.for( 'upcast' ).elementToAttribute( {
  47648. view: {
  47649. name: 'span',
  47650. styles: {
  47651. 'background-color': /[\s\S]+/
  47652. }
  47653. },
  47654. model: {
  47655. key: _utils__WEBPACK_IMPORTED_MODULE_2__["FONT_BACKGROUND_COLOR"],
  47656. value: Object(_utils__WEBPACK_IMPORTED_MODULE_2__["renderUpcastAttribute"])( 'background-color' )
  47657. }
  47658. } );
  47659. editor.conversion.for( 'downcast' ).attributeToElement( {
  47660. model: _utils__WEBPACK_IMPORTED_MODULE_2__["FONT_BACKGROUND_COLOR"],
  47661. view: Object(_utils__WEBPACK_IMPORTED_MODULE_2__["renderDowncastElement"])( 'background-color' )
  47662. } );
  47663. editor.commands.add( _utils__WEBPACK_IMPORTED_MODULE_2__["FONT_BACKGROUND_COLOR"], new _fontbackgroundcolorcommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor ) );
  47664. // Allow the font backgroundColor attribute on text nodes.
  47665. editor.model.schema.extend( '$text', { allowAttributes: _utils__WEBPACK_IMPORTED_MODULE_2__["FONT_BACKGROUND_COLOR"] } );
  47666. editor.model.schema.setAttributeProperties( _utils__WEBPACK_IMPORTED_MODULE_2__["FONT_BACKGROUND_COLOR"], {
  47667. isFormatting: true,
  47668. copyOnEnter: true
  47669. } );
  47670. }
  47671. }
  47672. /***/ }),
  47673. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorui.js":
  47674. /*!************************************************************************************************!*\
  47675. !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorui.js ***!
  47676. \************************************************************************************************/
  47677. /*! exports provided: default */
  47678. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  47679. "use strict";
  47680. __webpack_require__.r(__webpack_exports__);
  47681. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontBackgroundColorUI; });
  47682. /* harmony import */ var _ui_colorui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ui/colorui */ "./node_modules/@ckeditor/ckeditor5-font/src/ui/colorui.js");
  47683. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-font/src/utils.js");
  47684. /* harmony import */ var _theme_icons_font_background_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/icons/font-background.svg */ "./node_modules/@ckeditor/ckeditor5-font/theme/icons/font-background.svg");
  47685. /**
  47686. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  47687. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  47688. */
  47689. /**
  47690. * @module font/fontbackgroundcolor/fontbackgroundcolorui
  47691. */
  47692. /**
  47693. * The font background color UI plugin. It introduces the `'fontBackgroundColor'` dropdown.
  47694. *
  47695. * @extends module:core/plugin~Plugin
  47696. */
  47697. class FontBackgroundColorUI extends _ui_colorui__WEBPACK_IMPORTED_MODULE_0__["default"] {
  47698. /**
  47699. * @inheritDoc
  47700. */
  47701. constructor( editor ) {
  47702. const t = editor.locale.t;
  47703. super( editor, {
  47704. commandName: _utils__WEBPACK_IMPORTED_MODULE_1__["FONT_BACKGROUND_COLOR"],
  47705. componentName: _utils__WEBPACK_IMPORTED_MODULE_1__["FONT_BACKGROUND_COLOR"],
  47706. icon: _theme_icons_font_background_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  47707. dropdownLabel: t( 'Font Background Color' )
  47708. } );
  47709. }
  47710. /**
  47711. * @inheritDoc
  47712. */
  47713. static get pluginName() {
  47714. return 'FontBackgroundColorUI';
  47715. }
  47716. }
  47717. /***/ }),
  47718. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontcolor.js":
  47719. /*!****************************************************************!*\
  47720. !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontcolor.js ***!
  47721. \****************************************************************/
  47722. /*! exports provided: default */
  47723. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  47724. "use strict";
  47725. __webpack_require__.r(__webpack_exports__);
  47726. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontColor; });
  47727. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  47728. /* harmony import */ var _fontcolor_fontcolorediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fontcolor/fontcolorediting */ "./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorediting.js");
  47729. /* harmony import */ var _fontcolor_fontcolorui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fontcolor/fontcolorui */ "./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorui.js");
  47730. /**
  47731. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  47732. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  47733. */
  47734. /**
  47735. * @module font/fontcolor
  47736. */
  47737. /**
  47738. * The font color plugin.
  47739. *
  47740. * For a detailed overview, check the {@glink features/font font feature} documentation
  47741. * and the {@glink api/font package page}.
  47742. *
  47743. * This is a "glue" plugin which loads the {@link module:font/fontcolor/fontcolorediting~FontColorEditing} and
  47744. * {@link module:font/fontcolor/fontcolorui~FontColorUI} features in the editor.
  47745. *
  47746. * @extends module:core/plugin~Plugin
  47747. */
  47748. class FontColor extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  47749. /**
  47750. * @inheritDoc
  47751. */
  47752. static get requires() {
  47753. return [ _fontcolor_fontcolorediting__WEBPACK_IMPORTED_MODULE_1__["default"], _fontcolor_fontcolorui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  47754. }
  47755. /**
  47756. * @inheritDoc
  47757. */
  47758. static get pluginName() {
  47759. return 'FontColor';
  47760. }
  47761. }
  47762. /**
  47763. * The configuration of the font color feature.
  47764. * It is introduced by the {@link module:font/fontcolor/fontcolorediting~FontColorEditing} feature.
  47765. *
  47766. * Read more in {@link module:font/fontcolor~FontColorConfig}.
  47767. *
  47768. * @member {module:font/fontcolor~FontColorConfig} module:core/editor/editorconfig~EditorConfig#fontColor
  47769. */
  47770. /**
  47771. * The configuration of the font color feature.
  47772. * This option is used by the {@link module:font/fontcolor/fontcolorediting~FontColorEditing} feature.
  47773. *
  47774. * ClassicEditor
  47775. * .create( {
  47776. * fontColor: ... // Font color feature configuration.
  47777. * } )
  47778. * .then( ... )
  47779. * .catch( ... );
  47780. *
  47781. * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
  47782. *
  47783. * @interface module:font/fontcolor~FontColorConfig
  47784. */
  47785. /**
  47786. * Available font colors defined as an array of strings or objects.
  47787. *
  47788. * The default value registers the following colors:
  47789. *
  47790. * const fontColorConfig = {
  47791. * colors: [
  47792. * {
  47793. * color: 'hsl(0, 0%, 0%)',
  47794. * label: 'Black'
  47795. * },
  47796. * {
  47797. * color: 'hsl(0, 0%, 30%)',
  47798. * label: 'Dim grey'
  47799. * },
  47800. * {
  47801. * color: 'hsl(0, 0%, 60%)',
  47802. * label: 'Grey'
  47803. * },
  47804. * {
  47805. * color: 'hsl(0, 0%, 90%)',
  47806. * label: 'Light grey'
  47807. * },
  47808. * {
  47809. * color: 'hsl(0, 0%, 100%)',
  47810. * label: 'White',
  47811. * hasBorder: true
  47812. * },
  47813. * {
  47814. * color: 'hsl(0, 75%, 60%)',
  47815. * label: 'Red'
  47816. * },
  47817. * {
  47818. * color: 'hsl(30, 75%, 60%)',
  47819. * label: 'Orange'
  47820. * },
  47821. * {
  47822. * color: 'hsl(60, 75%, 60%)',
  47823. * label: 'Yellow'
  47824. * },
  47825. * {
  47826. * color: 'hsl(90, 75%, 60%)',
  47827. * label: 'Light green'
  47828. * },
  47829. * {
  47830. * color: 'hsl(120, 75%, 60%)',
  47831. * label: 'Green'
  47832. * },
  47833. * {
  47834. * color: 'hsl(150, 75%, 60%)',
  47835. * label: 'Aquamarine'
  47836. * },
  47837. * {
  47838. * color: 'hsl(180, 75%, 60%)',
  47839. * label: 'Turquoise'
  47840. * },
  47841. * {
  47842. * color: 'hsl(210, 75%, 60%)',
  47843. * label: 'Light blue'
  47844. * },
  47845. * {
  47846. * color: 'hsl(240, 75%, 60%)',
  47847. * label: 'Blue'
  47848. * },
  47849. * {
  47850. * color: 'hsl(270, 75%, 60%)',
  47851. * label: 'Purple'
  47852. * }
  47853. * ]
  47854. * };
  47855. *
  47856. * **Note**: The colors are displayed in the `'fontColor'` dropdown.
  47857. *
  47858. * @member {Array.<String|Object>} module:font/fontcolor~FontColorConfig#colors
  47859. */
  47860. /**
  47861. * Represents the number of columns in the font color dropdown.
  47862. *
  47863. * The default value is:
  47864. *
  47865. * const fontColorConfig = {
  47866. * columns: 5
  47867. * }
  47868. *
  47869. * @member {Number} module:font/fontcolor~FontColorConfig#columns
  47870. */
  47871. /**
  47872. * Determines the maximum number of available document colors.
  47873. * Setting it to `0` will disable the document colors feature.
  47874. *
  47875. * By default it equals to the {@link module:font/fontcolor~FontColorConfig#columns} value.
  47876. *
  47877. * Examples:
  47878. *
  47879. * // 1) Neither document colors nor columns are defined in the configuration.
  47880. * // Document colors will equal 5,
  47881. * // because the value will be inherited from columns,
  47882. * // which has a predefined value of 5.
  47883. * const fontColorConfig = {}
  47884. *
  47885. * // 2) Document colors will equal 8, because the value will be inherited from columns.
  47886. * const fontColorConfig = {
  47887. * columns: 8
  47888. * }
  47889. *
  47890. * // 3) Document colors will equal 24, because it has its own value defined.
  47891. * const fontColorConfig = {
  47892. * columns: 8,
  47893. * documentColors: 24
  47894. * }
  47895. *
  47896. * // 4) The document colors feature will be disabled.
  47897. * const fontColorConfig = {
  47898. * columns: 8,
  47899. * documentColors: 0
  47900. * }
  47901. *
  47902. * @member {Number} module:font/fontcolor~FontColorConfig#documentColors
  47903. */
  47904. /***/ }),
  47905. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorcommand.js":
  47906. /*!*********************************************************************************!*\
  47907. !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorcommand.js ***!
  47908. \*********************************************************************************/
  47909. /*! exports provided: default */
  47910. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  47911. "use strict";
  47912. __webpack_require__.r(__webpack_exports__);
  47913. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontColorCommand; });
  47914. /* harmony import */ var _fontcommand__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../fontcommand */ "./node_modules/@ckeditor/ckeditor5-font/src/fontcommand.js");
  47915. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-font/src/utils.js");
  47916. /**
  47917. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  47918. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  47919. */
  47920. /**
  47921. * @module font/fontcolor/fontcolorcommand
  47922. */
  47923. /**
  47924. * The font color command. It is used by {@link module:font/fontcolor/fontcolorediting~FontColorEditing}
  47925. * to apply the font color.
  47926. *
  47927. * editor.execute( 'fontColor', { value: 'rgb(250, 20, 20)' } );
  47928. *
  47929. * **Note**: Executing the command with the `null` value removes the attribute from the model.
  47930. *
  47931. * @extends module:font/fontcommand~FontCommand
  47932. */
  47933. class FontColorCommand extends _fontcommand__WEBPACK_IMPORTED_MODULE_0__["default"] {
  47934. /**
  47935. * @inheritDoc
  47936. */
  47937. constructor( editor ) {
  47938. super( editor, _utils__WEBPACK_IMPORTED_MODULE_1__["FONT_COLOR"] );
  47939. }
  47940. }
  47941. /***/ }),
  47942. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorediting.js":
  47943. /*!*********************************************************************************!*\
  47944. !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorediting.js ***!
  47945. \*********************************************************************************/
  47946. /*! exports provided: default */
  47947. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  47948. "use strict";
  47949. __webpack_require__.r(__webpack_exports__);
  47950. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontColorEditing; });
  47951. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  47952. /* harmony import */ var _fontcolorcommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fontcolorcommand */ "./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorcommand.js");
  47953. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-font/src/utils.js");
  47954. /**
  47955. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  47956. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  47957. */
  47958. /**
  47959. * @module font/fontcolor/fontcolorediting
  47960. */
  47961. /**
  47962. * The font color editing feature.
  47963. *
  47964. * It introduces the {@link module:font/fontcolor/fontcolorcommand~FontColorCommand command} and
  47965. * the `fontColor` attribute in the {@link module:engine/model/model~Model model} which renders
  47966. * in the {@link module:engine/view/view view} as a `<span>` element (`<span style="color: ...">`),
  47967. * depending on the {@link module:font/fontcolor~FontColorConfig configuration}.
  47968. *
  47969. * @extends module:core/plugin~Plugin
  47970. */
  47971. class FontColorEditing extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  47972. /**
  47973. * @inheritDoc
  47974. */
  47975. static get pluginName() {
  47976. return 'FontColorEditing';
  47977. }
  47978. /**
  47979. * @inheritDoc
  47980. */
  47981. constructor( editor ) {
  47982. super( editor );
  47983. editor.config.define( _utils__WEBPACK_IMPORTED_MODULE_2__["FONT_COLOR"], {
  47984. colors: [
  47985. {
  47986. color: 'hsl(0, 0%, 0%)',
  47987. label: 'Black'
  47988. },
  47989. {
  47990. color: 'hsl(0, 0%, 30%)',
  47991. label: 'Dim grey'
  47992. },
  47993. {
  47994. color: 'hsl(0, 0%, 60%)',
  47995. label: 'Grey'
  47996. },
  47997. {
  47998. color: 'hsl(0, 0%, 90%)',
  47999. label: 'Light grey'
  48000. },
  48001. {
  48002. color: 'hsl(0, 0%, 100%)',
  48003. label: 'White',
  48004. hasBorder: true
  48005. },
  48006. {
  48007. color: 'hsl(0, 75%, 60%)',
  48008. label: 'Red'
  48009. },
  48010. {
  48011. color: 'hsl(30, 75%, 60%)',
  48012. label: 'Orange'
  48013. },
  48014. {
  48015. color: 'hsl(60, 75%, 60%)',
  48016. label: 'Yellow'
  48017. },
  48018. {
  48019. color: 'hsl(90, 75%, 60%)',
  48020. label: 'Light green'
  48021. },
  48022. {
  48023. color: 'hsl(120, 75%, 60%)',
  48024. label: 'Green'
  48025. },
  48026. {
  48027. color: 'hsl(150, 75%, 60%)',
  48028. label: 'Aquamarine'
  48029. },
  48030. {
  48031. color: 'hsl(180, 75%, 60%)',
  48032. label: 'Turquoise'
  48033. },
  48034. {
  48035. color: 'hsl(210, 75%, 60%)',
  48036. label: 'Light blue'
  48037. },
  48038. {
  48039. color: 'hsl(240, 75%, 60%)',
  48040. label: 'Blue'
  48041. },
  48042. {
  48043. color: 'hsl(270, 75%, 60%)',
  48044. label: 'Purple'
  48045. }
  48046. ],
  48047. columns: 5
  48048. } );
  48049. editor.conversion.for( 'upcast' ).elementToAttribute( {
  48050. view: {
  48051. name: 'span',
  48052. styles: {
  48053. 'color': /[\s\S]+/
  48054. }
  48055. },
  48056. model: {
  48057. key: _utils__WEBPACK_IMPORTED_MODULE_2__["FONT_COLOR"],
  48058. value: Object(_utils__WEBPACK_IMPORTED_MODULE_2__["renderUpcastAttribute"])( 'color' )
  48059. }
  48060. } );
  48061. editor.conversion.for( 'downcast' ).attributeToElement( {
  48062. model: _utils__WEBPACK_IMPORTED_MODULE_2__["FONT_COLOR"],
  48063. view: Object(_utils__WEBPACK_IMPORTED_MODULE_2__["renderDowncastElement"])( 'color' )
  48064. } );
  48065. editor.commands.add( _utils__WEBPACK_IMPORTED_MODULE_2__["FONT_COLOR"], new _fontcolorcommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor ) );
  48066. // Allow the font color attribute on text nodes.
  48067. editor.model.schema.extend( '$text', { allowAttributes: _utils__WEBPACK_IMPORTED_MODULE_2__["FONT_COLOR"] } );
  48068. editor.model.schema.setAttributeProperties( _utils__WEBPACK_IMPORTED_MODULE_2__["FONT_COLOR"], {
  48069. isFormatting: true,
  48070. copyOnEnter: true
  48071. } );
  48072. }
  48073. }
  48074. /***/ }),
  48075. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorui.js":
  48076. /*!****************************************************************************!*\
  48077. !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorui.js ***!
  48078. \****************************************************************************/
  48079. /*! exports provided: default */
  48080. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  48081. "use strict";
  48082. __webpack_require__.r(__webpack_exports__);
  48083. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontColorUI; });
  48084. /* harmony import */ var _ui_colorui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ui/colorui */ "./node_modules/@ckeditor/ckeditor5-font/src/ui/colorui.js");
  48085. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-font/src/utils.js");
  48086. /* harmony import */ var _theme_icons_font_color_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/icons/font-color.svg */ "./node_modules/@ckeditor/ckeditor5-font/theme/icons/font-color.svg");
  48087. /**
  48088. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  48089. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  48090. */
  48091. /**
  48092. * @module font/fontcolor/fontcolorui
  48093. */
  48094. /**
  48095. * The font color UI plugin. It introduces the `'fontColor'` dropdown.
  48096. *
  48097. * @extends module:core/plugin~Plugin
  48098. */
  48099. class FontColorUI extends _ui_colorui__WEBPACK_IMPORTED_MODULE_0__["default"] {
  48100. /**
  48101. * @inheritDoc
  48102. */
  48103. constructor( editor ) {
  48104. const t = editor.locale.t;
  48105. super( editor, {
  48106. commandName: _utils__WEBPACK_IMPORTED_MODULE_1__["FONT_COLOR"],
  48107. componentName: _utils__WEBPACK_IMPORTED_MODULE_1__["FONT_COLOR"],
  48108. icon: _theme_icons_font_color_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  48109. dropdownLabel: t( 'Font Color' )
  48110. } );
  48111. }
  48112. /**
  48113. * @inheritDoc
  48114. */
  48115. static get pluginName() {
  48116. return 'FontColorUI';
  48117. }
  48118. }
  48119. /***/ }),
  48120. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/fontcommand.js":
  48121. /*!******************************************************************!*\
  48122. !*** ./node_modules/@ckeditor/ckeditor5-font/src/fontcommand.js ***!
  48123. \******************************************************************/
  48124. /*! exports provided: default */
  48125. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  48126. "use strict";
  48127. __webpack_require__.r(__webpack_exports__);
  48128. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FontCommand; });
  48129. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  48130. /**
  48131. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  48132. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  48133. */
  48134. /**
  48135. * @module font/fontcommand
  48136. */
  48137. /**
  48138. * The base font command.
  48139. *
  48140. * @extends module:core/command~Command
  48141. */
  48142. class FontCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  48143. /**
  48144. * Creates an instance of the command.
  48145. *
  48146. * @param {module:core/editor/editor~Editor} editor Editor instance.
  48147. * @param {String} attributeKey The name of a model attribute on which this command operates.
  48148. */
  48149. constructor( editor, attributeKey ) {
  48150. super( editor );
  48151. /**
  48152. * When set, it reflects the {@link #attributeKey} value of the selection.
  48153. *
  48154. * @observable
  48155. * @readonly
  48156. * @member {String} module:font/fontcommand~FontCommand#value
  48157. */
  48158. /**
  48159. * A model attribute on which this command operates.
  48160. *
  48161. * @readonly
  48162. * @member {Boolean} module:font/fontcommand~FontCommand#attributeKey
  48163. */
  48164. this.attributeKey = attributeKey;
  48165. }
  48166. /**
  48167. * @inheritDoc
  48168. */
  48169. refresh() {
  48170. const model = this.editor.model;
  48171. const doc = model.document;
  48172. this.value = doc.selection.getAttribute( this.attributeKey );
  48173. this.isEnabled = model.schema.checkAttributeInSelection( doc.selection, this.attributeKey );
  48174. }
  48175. /**
  48176. * Executes the command. Applies the `value` of the {@link #attributeKey} to the selection.
  48177. * If no `value` is passed, it removes the attribute from the selection.
  48178. *
  48179. * @protected
  48180. * @param {Object} [options] Options for the executed command.
  48181. * @param {String} [options.value] The value to apply.
  48182. * @fires execute
  48183. */
  48184. execute( options = {} ) {
  48185. const model = this.editor.model;
  48186. const document = model.document;
  48187. const selection = document.selection;
  48188. const value = options.value;
  48189. model.change( writer => {
  48190. if ( selection.isCollapsed ) {
  48191. if ( value ) {
  48192. writer.setSelectionAttribute( this.attributeKey, value );
  48193. } else {
  48194. writer.removeSelectionAttribute( this.attributeKey );
  48195. }
  48196. } else {
  48197. const ranges = model.schema.getValidRanges( selection.getRanges(), this.attributeKey );
  48198. for ( const range of ranges ) {
  48199. if ( value ) {
  48200. writer.setAttribute( this.attributeKey, value, range );
  48201. } else {
  48202. writer.removeAttribute( this.attributeKey, range );
  48203. }
  48204. }
  48205. }
  48206. } );
  48207. }
  48208. }
  48209. /***/ }),
  48210. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/ui/colortableview.js":
  48211. /*!************************************************************************!*\
  48212. !*** ./node_modules/@ckeditor/ckeditor5-font/src/ui/colortableview.js ***!
  48213. \************************************************************************/
  48214. /*! exports provided: default */
  48215. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  48216. "use strict";
  48217. __webpack_require__.r(__webpack_exports__);
  48218. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ColorTableView; });
  48219. /* harmony import */ var _ckeditor_ckeditor5_ui_src_view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  48220. /* harmony import */ var _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  48221. /* harmony import */ var _ckeditor_ckeditor5_ui_src_colorgrid_colortileview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/colorgrid/colortileview */ "./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colortileview.js");
  48222. /* harmony import */ var _ckeditor_ckeditor5_ui_src_colorgrid_colorgridview__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/colorgrid/colorgridview */ "./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colorgridview.js");
  48223. /* harmony import */ var _ckeditor_ckeditor5_ui_src_label_labelview__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/label/labelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/label/labelview.js");
  48224. /* harmony import */ var _documentcolorcollection__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../documentcolorcollection */ "./node_modules/@ckeditor/ckeditor5-font/src/documentcolorcollection.js");
  48225. /* harmony import */ var _ckeditor_ckeditor5_ui_src_template__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/template */ "./node_modules/@ckeditor/ckeditor5-ui/src/template.js");
  48226. /* harmony import */ var _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/focustracker */ "./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js");
  48227. /* harmony import */ var _ckeditor_ckeditor5_ui_src_focuscycler__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/focuscycler */ "./node_modules/@ckeditor/ckeditor5-ui/src/focuscycler.js");
  48228. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keystrokehandler */ "./node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js");
  48229. /* harmony import */ var _ckeditor_ckeditor5_core_theme_icons_eraser_svg__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/theme/icons/eraser.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/eraser.svg");
  48230. /* harmony import */ var _theme_fontcolor_css__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../theme/fontcolor.css */ "./node_modules/@ckeditor/ckeditor5-font/theme/fontcolor.css");
  48231. /* harmony import */ var _theme_fontcolor_css__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_theme_fontcolor_css__WEBPACK_IMPORTED_MODULE_11__);
  48232. /**
  48233. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  48234. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  48235. */
  48236. /**
  48237. * @module font/ui/colortableview
  48238. */
  48239. /**
  48240. * A class which represents a view with the following sub–components:
  48241. *
  48242. * * A remove color button,
  48243. * * A static {@link module:ui/colorgrid/colorgrid~ColorGridView} of colors defined in the configuration,
  48244. * * A dynamic {@link module:ui/colorgrid/colorgrid~ColorGridView} of colors used in the document.
  48245. *
  48246. * @extends module:ui/view~View
  48247. */
  48248. class ColorTableView extends _ckeditor_ckeditor5_ui_src_view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  48249. /**
  48250. * Creates a view to be inserted as a child of {@link module:ui/dropdown/dropdownview~DropdownView}.
  48251. *
  48252. * @param {module:utils/locale~Locale} [locale] The localization services instance.
  48253. * @param {Object} config The configuration object.
  48254. * @param {Array.<module:ui/colorgrid/colorgrid~ColorDefinition>} config.colors An array with definitions of colors to
  48255. * be displayed in the table.
  48256. * @param {Number} config.columns The number of columns in the color grid.
  48257. * @param {String} config.removeButtonLabel The label of the button responsible for removing the color.
  48258. * @param {String} config.documentColorsLabel The label for the section with the document colors.
  48259. * @param {String} config.documentColorsCount The number of colors in the document colors section inside the color dropdown.
  48260. */
  48261. constructor( locale, { colors, columns, removeButtonLabel, documentColorsLabel, documentColorsCount } ) {
  48262. super( locale );
  48263. /**
  48264. * A collection of the children of the table.
  48265. *
  48266. * @readonly
  48267. * @member {module:ui/viewcollection~ViewCollection}
  48268. */
  48269. this.items = this.createCollection();
  48270. /**
  48271. * An array with objects representing colors to be displayed in the grid.
  48272. *
  48273. * @type {Arrray.<module:ui/colorgrid/colorgrid~ColorDefinition>}
  48274. */
  48275. this.colorDefinitions = colors;
  48276. /**
  48277. * Tracks information about the DOM focus in the list.
  48278. *
  48279. * @readonly
  48280. * @member {module:utils/focustracker~FocusTracker}
  48281. */
  48282. this.focusTracker = new _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_7__["default"]();
  48283. /**
  48284. * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
  48285. *
  48286. * @readonly
  48287. * @member {module:utils/keystrokehandler~KeystrokeHandler}
  48288. */
  48289. this.keystrokes = new _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_9__["default"]();
  48290. /**
  48291. * Keeps the value of the command associated with the table for the current selection.
  48292. *
  48293. * @type {String}
  48294. */
  48295. this.set( 'selectedColor' );
  48296. /**
  48297. * The label of the button responsible for removing color attributes.
  48298. *
  48299. * @type {String}
  48300. */
  48301. this.removeButtonLabel = removeButtonLabel;
  48302. /**
  48303. * The number of columns in the color grid.
  48304. *
  48305. * @type {Number}
  48306. */
  48307. this.columns = columns;
  48308. /**
  48309. * A collection of definitions that store the document colors.
  48310. *
  48311. * @readonly
  48312. * @member {module:font/documentcolorcollection~DocumentColorCollection}
  48313. */
  48314. this.documentColors = new _documentcolorcollection__WEBPACK_IMPORTED_MODULE_5__["default"]();
  48315. /**
  48316. * The maximum number of colors in the document colors section.
  48317. * If it equals 0, the document colors section is not added.
  48318. *
  48319. * @readonly
  48320. * @type {Number}
  48321. */
  48322. this.documentColorsCount = documentColorsCount;
  48323. /**
  48324. * Preserves the reference to {@link module:ui/colorgrid/colorgrid~ColorGridView} used to create
  48325. * the default (static) color set.
  48326. *
  48327. * The property is loaded once the the parent dropdown is opened the first time.
  48328. *
  48329. * @readonly
  48330. * @member {module:ui/colorgrid/colorgrid~ColorGridView|undefined} #staticColorsGrid
  48331. */
  48332. /**
  48333. * Preserves the reference to {@link module:ui/colorgrid/colorgrid~ColorGridView} used to create
  48334. * the document colors. It remains undefined if the document colors feature is disabled.
  48335. *
  48336. * The property is loaded once the the parent dropdown is opened the first time.
  48337. *
  48338. * @readonly
  48339. * @member {module:ui/colorgrid/colorgrid~ColorGridView|undefined} #documentColorsGrid
  48340. */
  48341. /**
  48342. * Helps cycling over focusable {@link #items} in the list.
  48343. *
  48344. * @readonly
  48345. * @protected
  48346. * @member {module:ui/focuscycler~FocusCycler}
  48347. */
  48348. this._focusCycler = new _ckeditor_ckeditor5_ui_src_focuscycler__WEBPACK_IMPORTED_MODULE_8__["default"]( {
  48349. focusables: this.items,
  48350. focusTracker: this.focusTracker,
  48351. keystrokeHandler: this.keystrokes,
  48352. actions: {
  48353. // Navigate list items backwards using the Arrow Up key.
  48354. focusPrevious: 'arrowup',
  48355. // Navigate list items forwards using the Arrow Down key.
  48356. focusNext: 'arrowdown'
  48357. }
  48358. } );
  48359. /**
  48360. * Document color section's label.
  48361. *
  48362. * @private
  48363. * @readonly
  48364. * @type {String}
  48365. */
  48366. this._documentColorsLabel = documentColorsLabel;
  48367. this.setTemplate( {
  48368. tag: 'div',
  48369. attributes: {
  48370. class: [
  48371. 'ck',
  48372. 'ck-color-table'
  48373. ]
  48374. },
  48375. children: this.items
  48376. } );
  48377. this.items.add( this._removeColorButton() );
  48378. }
  48379. /**
  48380. * Scans through the editor model and searches for text node attributes with the given attribute name.
  48381. * Found entries are set as document colors.
  48382. *
  48383. * All the previously stored document colors will be lost in the process.
  48384. *
  48385. * @param {module:engine/model/model~Model} model The model used as a source to obtain the document colors.
  48386. * @param {String} attributeName Determines the name of the related model's attribute for a given dropdown.
  48387. */
  48388. updateDocumentColors( model, attributeName ) {
  48389. const document = model.document;
  48390. const maxCount = this.documentColorsCount;
  48391. this.documentColors.clear();
  48392. for ( const rootName of document.getRootNames() ) {
  48393. const root = document.getRoot( rootName );
  48394. const range = model.createRangeIn( root );
  48395. for ( const node of range.getItems() ) {
  48396. if ( node.is( '$textProxy' ) && node.hasAttribute( attributeName ) ) {
  48397. this._addColorToDocumentColors( node.getAttribute( attributeName ) );
  48398. if ( this.documentColors.length >= maxCount ) {
  48399. return;
  48400. }
  48401. }
  48402. }
  48403. }
  48404. }
  48405. /**
  48406. * Refreshes the state of the selected color in one or both {@link module:ui/colorgrid/colorgrid~ColorGridView}s
  48407. * available in the {@link module:font/ui/colortableview~ColorTableView}. It guarantees that the selection will occur only in one
  48408. * of them.
  48409. */
  48410. updateSelectedColors() {
  48411. const documentColorsGrid = this.documentColorsGrid;
  48412. const staticColorsGrid = this.staticColorsGrid;
  48413. const selectedColor = this.selectedColor;
  48414. staticColorsGrid.selectedColor = selectedColor;
  48415. if ( documentColorsGrid ) {
  48416. documentColorsGrid.selectedColor = selectedColor;
  48417. }
  48418. }
  48419. /**
  48420. * @inheritDoc
  48421. */
  48422. render() {
  48423. super.render();
  48424. // Items added before rendering should be known to the #focusTracker.
  48425. for ( const item of this.items ) {
  48426. this.focusTracker.add( item.element );
  48427. }
  48428. // Start listening for the keystrokes coming from #element.
  48429. this.keystrokes.listenTo( this.element );
  48430. }
  48431. /**
  48432. * Appends {@link #staticColorsGrid} and {@link #documentColorsGrid} views.
  48433. */
  48434. appendGrids() {
  48435. if ( this.staticColorsGrid ) {
  48436. return;
  48437. }
  48438. this.staticColorsGrid = this._createStaticColorsGrid();
  48439. this.items.add( this.staticColorsGrid );
  48440. if ( this.documentColorsCount ) {
  48441. // Create a label for document colors.
  48442. const bind = _ckeditor_ckeditor5_ui_src_template__WEBPACK_IMPORTED_MODULE_6__["default"].bind( this.documentColors, this.documentColors );
  48443. const label = new _ckeditor_ckeditor5_ui_src_label_labelview__WEBPACK_IMPORTED_MODULE_4__["default"]( this.locale );
  48444. label.text = this._documentColorsLabel;
  48445. label.extendTemplate( {
  48446. attributes: {
  48447. class: [
  48448. 'ck',
  48449. 'ck-color-grid__label',
  48450. bind.if( 'isEmpty', 'ck-hidden' )
  48451. ]
  48452. }
  48453. } );
  48454. this.items.add( label );
  48455. this.documentColorsGrid = this._createDocumentColorsGrid();
  48456. this.items.add( this.documentColorsGrid );
  48457. }
  48458. }
  48459. /**
  48460. * Focuses the first focusable element in {@link #items}.
  48461. */
  48462. focus() {
  48463. this._focusCycler.focusFirst();
  48464. }
  48465. /**
  48466. * Focuses the last focusable element in {@link #items}.
  48467. */
  48468. focusLast() {
  48469. this._focusCycler.focusLast();
  48470. }
  48471. /**
  48472. * Adds the remove color button as a child of the current view.
  48473. *
  48474. * @private
  48475. * @returns {module:ui/button/buttonview~ButtonView}
  48476. */
  48477. _removeColorButton() {
  48478. const buttonView = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__["default"]();
  48479. buttonView.set( {
  48480. withText: true,
  48481. icon: _ckeditor_ckeditor5_core_theme_icons_eraser_svg__WEBPACK_IMPORTED_MODULE_10__["default"],
  48482. tooltip: true,
  48483. label: this.removeButtonLabel
  48484. } );
  48485. buttonView.class = 'ck-color-table__remove-color';
  48486. buttonView.on( 'execute', () => {
  48487. this.fire( 'execute', { value: null } );
  48488. } );
  48489. return buttonView;
  48490. }
  48491. /**
  48492. * Creates a static color table grid based on the editor configuration.
  48493. *
  48494. * @private
  48495. * @returns {module:ui/colorgrid/colorgrid~ColorGridView}
  48496. */
  48497. _createStaticColorsGrid() {
  48498. const colorGrid = new _ckeditor_ckeditor5_ui_src_colorgrid_colorgridview__WEBPACK_IMPORTED_MODULE_3__["default"]( this.locale, {
  48499. colorDefinitions: this.colorDefinitions,
  48500. columns: this.columns
  48501. } );
  48502. colorGrid.delegate( 'execute' ).to( this );
  48503. return colorGrid;
  48504. }
  48505. /**
  48506. * Creates the document colors section view and binds it to {@link #documentColors}.
  48507. *
  48508. * @private
  48509. * @returns {module:ui/colorgrid/colorgrid~ColorGridView}
  48510. */
  48511. _createDocumentColorsGrid() {
  48512. const bind = _ckeditor_ckeditor5_ui_src_template__WEBPACK_IMPORTED_MODULE_6__["default"].bind( this.documentColors, this.documentColors );
  48513. const documentColorsGrid = new _ckeditor_ckeditor5_ui_src_colorgrid_colorgridview__WEBPACK_IMPORTED_MODULE_3__["default"]( this.locale, {
  48514. columns: this.columns
  48515. } );
  48516. documentColorsGrid.delegate( 'execute' ).to( this );
  48517. documentColorsGrid.extendTemplate( {
  48518. attributes: {
  48519. class: bind.if( 'isEmpty', 'ck-hidden' )
  48520. }
  48521. } );
  48522. documentColorsGrid.items.bindTo( this.documentColors ).using(
  48523. colorObj => {
  48524. const colorTile = new _ckeditor_ckeditor5_ui_src_colorgrid_colortileview__WEBPACK_IMPORTED_MODULE_2__["default"]();
  48525. colorTile.set( {
  48526. color: colorObj.color,
  48527. hasBorder: colorObj.options && colorObj.options.hasBorder
  48528. } );
  48529. if ( colorObj.label ) {
  48530. colorTile.set( {
  48531. label: colorObj.label,
  48532. tooltip: true
  48533. } );
  48534. }
  48535. colorTile.on( 'execute', () => {
  48536. this.fire( 'execute', {
  48537. value: colorObj.color
  48538. } );
  48539. } );
  48540. return colorTile;
  48541. }
  48542. );
  48543. // Selected color should be cleared when document colors became empty.
  48544. this.documentColors.on( 'change:isEmpty', ( evt, name, val ) => {
  48545. if ( val ) {
  48546. documentColorsGrid.selectedColor = null;
  48547. }
  48548. } );
  48549. return documentColorsGrid;
  48550. }
  48551. /**
  48552. * Adds a given color to the document colors list. If possible, the method will attempt to use
  48553. * data from the {@link #colorDefinitions} (label, color options).
  48554. *
  48555. * @private
  48556. * @param {String} color A string that stores the value of the recently applied color.
  48557. */
  48558. _addColorToDocumentColors( color ) {
  48559. const predefinedColor = this.colorDefinitions
  48560. .find( definition => definition.color === color );
  48561. if ( !predefinedColor ) {
  48562. this.documentColors.add( {
  48563. color,
  48564. label: color,
  48565. options: {
  48566. hasBorder: false
  48567. }
  48568. } );
  48569. } else {
  48570. this.documentColors.add( Object.assign( {}, predefinedColor ) );
  48571. }
  48572. }
  48573. }
  48574. /***/ }),
  48575. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/ui/colorui.js":
  48576. /*!*****************************************************************!*\
  48577. !*** ./node_modules/@ckeditor/ckeditor5-font/src/ui/colorui.js ***!
  48578. \*****************************************************************/
  48579. /*! exports provided: default */
  48580. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  48581. "use strict";
  48582. __webpack_require__.r(__webpack_exports__);
  48583. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ColorUI; });
  48584. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  48585. /* harmony import */ var _ckeditor_ckeditor5_ui_src_dropdown_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/dropdown/utils */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/utils.js");
  48586. /* harmony import */ var _ckeditor_ckeditor5_ui_src_colorgrid_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/colorgrid/utils */ "./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/utils.js");
  48587. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-font/src/utils.js");
  48588. /**
  48589. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  48590. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  48591. */
  48592. /**
  48593. * @module font/ui/colorui
  48594. */
  48595. /**
  48596. * The color UI plugin which isolates the common logic responsible for displaying dropdowns with color grids.
  48597. *
  48598. * It is used to create the `'fontBackgroundColor'` and `'fontColor'` dropdowns, each hosting
  48599. * a {@link module:font/ui/colortableview~ColorTableView}.
  48600. *
  48601. * @extends module:core/plugin~Plugin
  48602. */
  48603. class ColorUI extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  48604. /**
  48605. * Creates a plugin which introduces a dropdown with a pre–configured {@link module:font/ui/colortableview~ColorTableView}.
  48606. *
  48607. * @param {module:core/editor/editor~Editor} editor
  48608. * @param {Object} config The configuration object.
  48609. * @param {String} config.commandName The name of the command which will be executed when a color tile is clicked.
  48610. * @param {String} config.componentName The name of the dropdown in the {@link module:ui/componentfactory~ComponentFactory}
  48611. * and the configuration scope name in `editor.config`.
  48612. * @param {String} config.icon The SVG icon used by the dropdown.
  48613. * @param {String} config.dropdownLabel The label used by the dropdown.
  48614. */
  48615. constructor( editor, { commandName, icon, componentName, dropdownLabel } ) {
  48616. super( editor );
  48617. /**
  48618. * The name of the command which will be executed when a color tile is clicked.
  48619. *
  48620. * @type {String}
  48621. */
  48622. this.commandName = commandName;
  48623. /**
  48624. * The name of this component in the {@link module:ui/componentfactory~ComponentFactory}.
  48625. * Also the configuration scope name in `editor.config`.
  48626. *
  48627. * @type {String}
  48628. */
  48629. this.componentName = componentName;
  48630. /**
  48631. * The SVG icon used by the dropdown.
  48632. * @type {String}
  48633. */
  48634. this.icon = icon;
  48635. /**
  48636. * The label used by the dropdown.
  48637. *
  48638. * @type {String}
  48639. */
  48640. this.dropdownLabel = dropdownLabel;
  48641. /**
  48642. * The number of columns in the color grid.
  48643. *
  48644. * @type {Number}
  48645. */
  48646. this.columns = editor.config.get( `${ this.componentName }.columns` );
  48647. /**
  48648. * Keeps a reference to {@link module:font/ui/colortableview~ColorTableView}.
  48649. *
  48650. * @member {module:font/ui/colortableview~ColorTableView}
  48651. */
  48652. this.colorTableView = undefined;
  48653. }
  48654. /**
  48655. * @inheritDoc
  48656. */
  48657. init() {
  48658. const editor = this.editor;
  48659. const locale = editor.locale;
  48660. const t = locale.t;
  48661. const command = editor.commands.get( this.commandName );
  48662. const colorsConfig = Object(_ckeditor_ckeditor5_ui_src_colorgrid_utils__WEBPACK_IMPORTED_MODULE_2__["normalizeColorOptions"])( editor.config.get( this.componentName ).colors );
  48663. const localizedColors = Object(_ckeditor_ckeditor5_ui_src_colorgrid_utils__WEBPACK_IMPORTED_MODULE_2__["getLocalizedColorOptions"])( locale, colorsConfig );
  48664. const documentColorsCount = editor.config.get( `${ this.componentName }.documentColors` );
  48665. // Register the UI component.
  48666. editor.ui.componentFactory.add( this.componentName, locale => {
  48667. const dropdownView = Object(_ckeditor_ckeditor5_ui_src_dropdown_utils__WEBPACK_IMPORTED_MODULE_1__["createDropdown"])( locale );
  48668. this.colorTableView = Object(_utils__WEBPACK_IMPORTED_MODULE_3__["addColorTableToDropdown"])( {
  48669. dropdownView,
  48670. colors: localizedColors.map( option => ( {
  48671. label: option.label,
  48672. color: option.model,
  48673. options: {
  48674. hasBorder: option.hasBorder
  48675. }
  48676. } ) ),
  48677. columns: this.columns,
  48678. removeButtonLabel: t( 'Remove color' ),
  48679. documentColorsLabel: documentColorsCount !== 0 ? t( 'Document colors' ) : undefined,
  48680. documentColorsCount: documentColorsCount === undefined ? this.columns : documentColorsCount
  48681. } );
  48682. this.colorTableView.bind( 'selectedColor' ).to( command, 'value' );
  48683. dropdownView.buttonView.set( {
  48684. label: this.dropdownLabel,
  48685. icon: this.icon,
  48686. tooltip: true
  48687. } );
  48688. dropdownView.extendTemplate( {
  48689. attributes: {
  48690. class: 'ck-color-ui-dropdown'
  48691. }
  48692. } );
  48693. dropdownView.bind( 'isEnabled' ).to( command );
  48694. dropdownView.on( 'execute', ( evt, data ) => {
  48695. editor.execute( this.commandName, data );
  48696. editor.editing.view.focus();
  48697. } );
  48698. dropdownView.on( 'change:isOpen', ( evt, name, isVisible ) => {
  48699. // Grids rendering is deferred (#6192).
  48700. dropdownView.colorTableView.appendGrids();
  48701. if ( isVisible ) {
  48702. if ( documentColorsCount !== 0 ) {
  48703. this.colorTableView.updateDocumentColors( editor.model, this.componentName );
  48704. }
  48705. this.colorTableView.updateSelectedColors();
  48706. }
  48707. } );
  48708. return dropdownView;
  48709. } );
  48710. }
  48711. }
  48712. /***/ }),
  48713. /***/ "./node_modules/@ckeditor/ckeditor5-font/src/utils.js":
  48714. /*!************************************************************!*\
  48715. !*** ./node_modules/@ckeditor/ckeditor5-font/src/utils.js ***!
  48716. \************************************************************/
  48717. /*! exports provided: FONT_SIZE, FONT_FAMILY, FONT_COLOR, FONT_BACKGROUND_COLOR, buildDefinition, renderUpcastAttribute, renderDowncastElement, addColorTableToDropdown */
  48718. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  48719. "use strict";
  48720. __webpack_require__.r(__webpack_exports__);
  48721. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FONT_SIZE", function() { return FONT_SIZE; });
  48722. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FONT_FAMILY", function() { return FONT_FAMILY; });
  48723. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FONT_COLOR", function() { return FONT_COLOR; });
  48724. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FONT_BACKGROUND_COLOR", function() { return FONT_BACKGROUND_COLOR; });
  48725. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "buildDefinition", function() { return buildDefinition; });
  48726. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderUpcastAttribute", function() { return renderUpcastAttribute; });
  48727. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderDowncastElement", function() { return renderDowncastElement; });
  48728. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addColorTableToDropdown", function() { return addColorTableToDropdown; });
  48729. /* harmony import */ var _ui_colortableview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ui/colortableview */ "./node_modules/@ckeditor/ckeditor5-font/src/ui/colortableview.js");
  48730. /**
  48731. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  48732. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  48733. */
  48734. /**
  48735. * @module font/utils
  48736. */
  48737. /**
  48738. * The name of the font size plugin.
  48739. */
  48740. const FONT_SIZE = 'fontSize';
  48741. /**
  48742. * The name of the font family plugin.
  48743. */
  48744. const FONT_FAMILY = 'fontFamily';
  48745. /**
  48746. * The name of the font color plugin.
  48747. */
  48748. const FONT_COLOR = 'fontColor';
  48749. /**
  48750. * The name of the font background color plugin.
  48751. */
  48752. const FONT_BACKGROUND_COLOR = 'fontBackgroundColor';
  48753. /**
  48754. * Builds a proper {@link module:engine/conversion/conversion~ConverterDefinition converter definition} out of input data.
  48755. *
  48756. * @param {String} modelAttributeKey Key
  48757. * @param {Array.<module:font/fontfamily~FontFamilyOption>|Array.<module:font/fontsize~FontSizeOption>} options
  48758. * @returns {module:engine/conversion/conversion~ConverterDefinition}
  48759. */
  48760. function buildDefinition( modelAttributeKey, options ) {
  48761. const definition = {
  48762. model: {
  48763. key: modelAttributeKey,
  48764. values: []
  48765. },
  48766. view: {},
  48767. upcastAlso: {}
  48768. };
  48769. for ( const option of options ) {
  48770. definition.model.values.push( option.model );
  48771. definition.view[ option.model ] = option.view;
  48772. if ( option.upcastAlso ) {
  48773. definition.upcastAlso[ option.model ] = option.upcastAlso;
  48774. }
  48775. }
  48776. return definition;
  48777. }
  48778. /**
  48779. * A {@link module:font/fontcolor~FontColor font color} and
  48780. * {@link module:font/fontbackgroundcolor~FontBackgroundColor font background color} helper
  48781. * responsible for upcasting data to the model.
  48782. *
  48783. * **Note**: The `styleAttr` parameter should be either `'color'` or `'background-color'`.
  48784. *
  48785. * @param {String} styleAttr
  48786. * @return {String}
  48787. */
  48788. function renderUpcastAttribute( styleAttr ) {
  48789. return viewElement => normalizeColorCode( viewElement.getStyle( styleAttr ) );
  48790. }
  48791. /**
  48792. * A {@link module:font/fontcolor~FontColor font color} and
  48793. * {@link module:font/fontbackgroundcolor~FontBackgroundColor font background color} helper
  48794. * responsible for downcasting a color attribute to a `<span>` element.
  48795. *
  48796. * **Note**: The `styleAttr` parameter should be either `'color'` or `'background-color'`.
  48797. *
  48798. * @param {String} styleAttr
  48799. */
  48800. function renderDowncastElement( styleAttr ) {
  48801. return ( modelAttributeValue, { writer } ) => writer.createAttributeElement( 'span', {
  48802. style: `${ styleAttr }:${ modelAttributeValue }`
  48803. }, { priority: 7 } );
  48804. }
  48805. /**
  48806. * A helper that adds {@link module:font/ui/colortableview~ColorTableView} to the color dropdown with proper initial values.
  48807. *
  48808. * @param {Object} config The configuration object.
  48809. * @param {module:ui/dropdown/dropdownview~DropdownView} config.dropdownView The dropdown view to which
  48810. * a {@link module:font/ui/colortableview~ColorTableView} will be added.
  48811. * @param {Array.<module:ui/colorgrid/colorgrid~ColorDefinition>} config.colors An array with definitions
  48812. * representing colors to be displayed in the color table.
  48813. * @param {String} config.removeButtonLabel The label for the button responsible for removing the color.
  48814. * @param {String} config.documentColorsLabel The label for the section with document colors.
  48815. * @param {String} config.documentColorsCount The number of document colors inside the dropdown.
  48816. * @returns {module:font/ui/colortableview~ColorTableView} The new color table view.
  48817. */
  48818. function addColorTableToDropdown( { dropdownView, colors, columns, removeButtonLabel, documentColorsLabel, documentColorsCount } ) {
  48819. const locale = dropdownView.locale;
  48820. const colorTableView = new _ui_colortableview__WEBPACK_IMPORTED_MODULE_0__["default"]( locale, { colors, columns, removeButtonLabel, documentColorsLabel, documentColorsCount } );
  48821. dropdownView.colorTableView = colorTableView;
  48822. dropdownView.panelView.children.add( colorTableView );
  48823. colorTableView.delegate( 'execute' ).to( dropdownView, 'execute' );
  48824. return colorTableView;
  48825. }
  48826. // Fixes the color value string.
  48827. //
  48828. // @param {String} value
  48829. // @returns {String}
  48830. function normalizeColorCode( value ) {
  48831. return value.replace( /\s/g, '' );
  48832. }
  48833. /***/ }),
  48834. /***/ "./node_modules/@ckeditor/ckeditor5-font/theme/fontcolor.css":
  48835. /*!*******************************************************************!*\
  48836. !*** ./node_modules/@ckeditor/ckeditor5-font/theme/fontcolor.css ***!
  48837. \*******************************************************************/
  48838. /*! no static exports found */
  48839. /***/ (function(module, exports, __webpack_require__) {
  48840. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  48841. var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./fontcolor.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-font/theme/fontcolor.css");
  48842. content = content.__esModule ? content.default : content;
  48843. if (typeof content === 'string') {
  48844. content = [[module.i, content, '']];
  48845. }
  48846. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  48847. options.insert = "head";
  48848. options.singleton = true;
  48849. var update = api(content, options);
  48850. module.exports = content.locals || {};
  48851. /***/ }),
  48852. /***/ "./node_modules/@ckeditor/ckeditor5-font/theme/icons/font-background.svg":
  48853. /*!*******************************************************************************!*\
  48854. !*** ./node_modules/@ckeditor/ckeditor5-font/theme/icons/font-background.svg ***!
  48855. \*******************************************************************************/
  48856. /*! exports provided: default */
  48857. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  48858. "use strict";
  48859. __webpack_require__.r(__webpack_exports__);
  48860. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M4 2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm8.38 9.262H7.62L10 5.506l2.38 5.756zm.532 1.285L14.34 16h1.426L10.804 4H9.196L4.234 16H5.66l1.428-3.453h5.824z\"/></svg>");
  48861. /***/ }),
  48862. /***/ "./node_modules/@ckeditor/ckeditor5-font/theme/icons/font-color.svg":
  48863. /*!**************************************************************************!*\
  48864. !*** ./node_modules/@ckeditor/ckeditor5-font/theme/icons/font-color.svg ***!
  48865. \**************************************************************************/
  48866. /*! exports provided: default */
  48867. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  48868. "use strict";
  48869. __webpack_require__.r(__webpack_exports__);
  48870. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12.4 10.3L10 4.5l-2.4 5.8h4.8zm.5 1.2H7.1L5.7 15H4.2l5-12h1.6l5 12h-1.5L13 11.5zm3.1 7H4a1 1 0 0 1 0-2h12a1 1 0 0 1 0 2z\"/></svg>");
  48871. /***/ }),
  48872. /***/ "./node_modules/@ckeditor/ckeditor5-heading/src/heading.js":
  48873. /*!*****************************************************************!*\
  48874. !*** ./node_modules/@ckeditor/ckeditor5-heading/src/heading.js ***!
  48875. \*****************************************************************/
  48876. /*! exports provided: default */
  48877. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  48878. "use strict";
  48879. __webpack_require__.r(__webpack_exports__);
  48880. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Heading; });
  48881. /* harmony import */ var _headingediting__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./headingediting */ "./node_modules/@ckeditor/ckeditor5-heading/src/headingediting.js");
  48882. /* harmony import */ var _headingui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./headingui */ "./node_modules/@ckeditor/ckeditor5-heading/src/headingui.js");
  48883. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  48884. /* harmony import */ var _theme_heading_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../theme/heading.css */ "./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css");
  48885. /* harmony import */ var _theme_heading_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_theme_heading_css__WEBPACK_IMPORTED_MODULE_3__);
  48886. /**
  48887. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  48888. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  48889. */
  48890. /**
  48891. * @module heading/heading
  48892. */
  48893. /**
  48894. * The headings feature.
  48895. *
  48896. * For a detailed overview, check the {@glink features/headings Headings feature documentation}
  48897. * and the {@glink api/heading package page}.
  48898. *
  48899. * This is a "glue" plugin which loads the {@link module:heading/headingediting~HeadingEditing heading editing feature}
  48900. * and {@link module:heading/headingui~HeadingUI heading UI feature}.
  48901. *
  48902. * @extends module:core/plugin~Plugin
  48903. */
  48904. class Heading extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_2__["default"] {
  48905. /**
  48906. * @inheritDoc
  48907. */
  48908. static get requires() {
  48909. return [ _headingediting__WEBPACK_IMPORTED_MODULE_0__["default"], _headingui__WEBPACK_IMPORTED_MODULE_1__["default"] ];
  48910. }
  48911. /**
  48912. * @inheritDoc
  48913. */
  48914. static get pluginName() {
  48915. return 'Heading';
  48916. }
  48917. }
  48918. /**
  48919. * The configuration of the heading feature. Introduced by the {@link module:heading/headingediting~HeadingEditing} feature.
  48920. *
  48921. * Read more in {@link module:heading/heading~HeadingConfig}.
  48922. *
  48923. * @member {module:heading/heading~HeadingConfig} module:core/editor/editorconfig~EditorConfig#heading
  48924. */
  48925. /**
  48926. * The configuration of the heading feature.
  48927. * The option is used by the {@link module:heading/headingediting~HeadingEditing} feature.
  48928. *
  48929. * ClassicEditor
  48930. * .create( {
  48931. * heading: ... // Heading feature config.
  48932. * } )
  48933. * .then( ... )
  48934. * .catch( ... );
  48935. *
  48936. * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
  48937. *
  48938. * @interface HeadingConfig
  48939. */
  48940. /**
  48941. * The available heading options.
  48942. *
  48943. * The default value is:
  48944. *
  48945. * const headingConfig = {
  48946. * options: [
  48947. * { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
  48948. * { model: 'heading1', view: 'h2', title: 'Heading 1', class: 'ck-heading_heading1' },
  48949. * { model: 'heading2', view: 'h3', title: 'Heading 2', class: 'ck-heading_heading2' },
  48950. * { model: 'heading3', view: 'h4', title: 'Heading 3', class: 'ck-heading_heading3' }
  48951. * ]
  48952. * };
  48953. *
  48954. * It defines 3 levels of headings. In the editor model they will use `heading1`, `heading2`, and `heading3` elements.
  48955. * Their respective view elements (so the elements output by the editor) will be: `h2`, `h3`, and `h4`. This means that
  48956. * if you choose "Heading 1" in the headings dropdown the editor will turn the current block to `<heading1>` in the model
  48957. * which will result in rendering (and outputting to data) the `<h2>` element.
  48958. *
  48959. * The `title` and `class` properties will be used by the `headings` dropdown to render available options.
  48960. * Usually, the first option in the headings dropdown is the "Paragraph" option, hence it's also defined on the list.
  48961. * However, you don't need to define its view representation because it's handled by
  48962. * the {@link module:paragraph/paragraph~Paragraph} feature (which is required by
  48963. * the {@link module:heading/headingediting~HeadingEditing} feature).
  48964. *
  48965. * You can **read more** about configuring heading levels and **see more examples** in
  48966. * the {@glink features/headings Headings} guide.
  48967. *
  48968. * Note: In the model you should always start from `heading1`, regardless of how the headings are represented in the view.
  48969. * That's assumption is used by features like {@link module:autoformat/autoformat~Autoformat} to know which element
  48970. * they should use when applying the first level heading.
  48971. *
  48972. * The defined headings are also available as values passed to the `'heading'` command under their model names.
  48973. * For example, the below code will apply `<heading1>` to the current selection:
  48974. *
  48975. * editor.execute( 'heading', { value: 'heading1' } );
  48976. *
  48977. * @member {Array.<module:heading/heading~HeadingOption>} module:heading/heading~HeadingConfig#options
  48978. */
  48979. /**
  48980. * Heading option descriptor.
  48981. *
  48982. * @typedef {Object} module:heading/heading~HeadingOption
  48983. * @property {String} model Name of the model element to convert.
  48984. * @property {module:engine/view/elementdefinition~ElementDefinition} view Definition of a view element to convert from/to.
  48985. * @property {String} title The user-readable title of the option.
  48986. * @property {String} class The class which will be added to the dropdown item representing this option.
  48987. * @property {String} [icon] Icon used by {@link module:heading/headingbuttonsui~HeadingButtonsUI}. It can be omitted when using
  48988. * the default configuration.
  48989. * @extends module:engine/conversion/conversion~ConverterDefinition
  48990. */
  48991. /***/ }),
  48992. /***/ "./node_modules/@ckeditor/ckeditor5-heading/src/headingcommand.js":
  48993. /*!************************************************************************!*\
  48994. !*** ./node_modules/@ckeditor/ckeditor5-heading/src/headingcommand.js ***!
  48995. \************************************************************************/
  48996. /*! exports provided: default */
  48997. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  48998. "use strict";
  48999. __webpack_require__.r(__webpack_exports__);
  49000. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return HeadingCommand; });
  49001. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  49002. /* harmony import */ var _ckeditor_ckeditor5_utils_src_first__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/first */ "./node_modules/@ckeditor/ckeditor5-utils/src/first.js");
  49003. /**
  49004. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  49005. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  49006. */
  49007. /**
  49008. * @module heading/headingcommand
  49009. */
  49010. /**
  49011. * The heading command. It is used by the {@link module:heading/heading~Heading heading feature} to apply headings.
  49012. *
  49013. * @extends module:core/command~Command
  49014. */
  49015. class HeadingCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  49016. /**
  49017. * Creates an instance of the command.
  49018. *
  49019. * @param {module:core/editor/editor~Editor} editor Editor instance.
  49020. * @param {Array.<String>} modelElements Names of the element which this command can apply in the model.
  49021. */
  49022. constructor( editor, modelElements ) {
  49023. super( editor );
  49024. /**
  49025. * If the selection starts in a heading (which {@link #modelElements is supported by this command})
  49026. * the value is set to the name of that heading model element.
  49027. * It is set to `false` otherwise.
  49028. *
  49029. * @observable
  49030. * @readonly
  49031. * @member {Boolean|String} #value
  49032. */
  49033. /**
  49034. * Set of defined model's elements names that this command support.
  49035. * See {@link module:heading/heading~HeadingOption}.
  49036. *
  49037. * @readonly
  49038. * @member {Array.<String>}
  49039. */
  49040. this.modelElements = modelElements;
  49041. }
  49042. /**
  49043. * @inheritDoc
  49044. */
  49045. refresh() {
  49046. const block = Object(_ckeditor_ckeditor5_utils_src_first__WEBPACK_IMPORTED_MODULE_1__["default"])( this.editor.model.document.selection.getSelectedBlocks() );
  49047. this.value = !!block && this.modelElements.includes( block.name ) && block.name;
  49048. this.isEnabled = !!block && this.modelElements.some( heading => checkCanBecomeHeading( block, heading, this.editor.model.schema ) );
  49049. }
  49050. /**
  49051. * Executes the command. Applies the heading to the selected blocks or, if the first selected
  49052. * block is a heading already, turns selected headings (of this level only) to paragraphs.
  49053. *
  49054. * @param {Object} options
  49055. * @param {String} options.value Name of the element which this command will apply in the model.
  49056. * @fires execute
  49057. */
  49058. execute( options ) {
  49059. const model = this.editor.model;
  49060. const document = model.document;
  49061. const modelElement = options.value;
  49062. model.change( writer => {
  49063. const blocks = Array.from( document.selection.getSelectedBlocks() )
  49064. .filter( block => {
  49065. return checkCanBecomeHeading( block, modelElement, model.schema );
  49066. } );
  49067. for ( const block of blocks ) {
  49068. if ( !block.is( 'element', modelElement ) ) {
  49069. writer.rename( block, modelElement );
  49070. }
  49071. }
  49072. } );
  49073. }
  49074. }
  49075. // Checks whether the given block can be replaced by a specific heading.
  49076. //
  49077. // @private
  49078. // @param {module:engine/model/element~Element} block A block to be tested.
  49079. // @param {module:heading/headingcommand~HeadingCommand#modelElement} heading Command element name in the model.
  49080. // @param {module:engine/model/schema~Schema} schema The schema of the document.
  49081. // @returns {Boolean}
  49082. function checkCanBecomeHeading( block, heading, schema ) {
  49083. return schema.checkChild( block.parent, heading ) && !schema.isObject( block );
  49084. }
  49085. /***/ }),
  49086. /***/ "./node_modules/@ckeditor/ckeditor5-heading/src/headingediting.js":
  49087. /*!************************************************************************!*\
  49088. !*** ./node_modules/@ckeditor/ckeditor5-heading/src/headingediting.js ***!
  49089. \************************************************************************/
  49090. /*! exports provided: default */
  49091. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  49092. "use strict";
  49093. __webpack_require__.r(__webpack_exports__);
  49094. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return HeadingEditing; });
  49095. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  49096. /* harmony import */ var _ckeditor_ckeditor5_paragraph_src_paragraph__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-paragraph/src/paragraph */ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraph.js");
  49097. /* harmony import */ var _headingcommand__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./headingcommand */ "./node_modules/@ckeditor/ckeditor5-heading/src/headingcommand.js");
  49098. /* harmony import */ var _ckeditor_ckeditor5_utils_src_priorities__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/priorities */ "./node_modules/@ckeditor/ckeditor5-utils/src/priorities.js");
  49099. /**
  49100. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  49101. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  49102. */
  49103. /**
  49104. * @module heading/headingediting
  49105. */
  49106. const defaultModelElement = 'paragraph';
  49107. /**
  49108. * The headings engine feature. It handles switching between block formats &ndash; headings and paragraph.
  49109. * This class represents the engine part of the heading feature. See also {@link module:heading/heading~Heading}.
  49110. * It introduces `heading1`-`headingN` commands which allow to convert paragraphs into headings.
  49111. *
  49112. * @extends module:core/plugin~Plugin
  49113. */
  49114. class HeadingEditing extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  49115. /**
  49116. * @inheritDoc
  49117. */
  49118. static get pluginName() {
  49119. return 'HeadingEditing';
  49120. }
  49121. /**
  49122. * @inheritDoc
  49123. */
  49124. constructor( editor ) {
  49125. super( editor );
  49126. editor.config.define( 'heading', {
  49127. options: [
  49128. { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
  49129. { model: 'heading1', view: 'h2', title: 'Heading 1', class: 'ck-heading_heading1' },
  49130. { model: 'heading2', view: 'h3', title: 'Heading 2', class: 'ck-heading_heading2' },
  49131. { model: 'heading3', view: 'h4', title: 'Heading 3', class: 'ck-heading_heading3' }
  49132. ]
  49133. } );
  49134. }
  49135. /**
  49136. * @inheritDoc
  49137. */
  49138. static get requires() {
  49139. return [ _ckeditor_ckeditor5_paragraph_src_paragraph__WEBPACK_IMPORTED_MODULE_1__["default"] ];
  49140. }
  49141. /**
  49142. * @inheritDoc
  49143. */
  49144. init() {
  49145. const editor = this.editor;
  49146. const options = editor.config.get( 'heading.options' );
  49147. const modelElements = [];
  49148. for ( const option of options ) {
  49149. // Skip paragraph - it is defined in required Paragraph feature.
  49150. if ( option.model !== defaultModelElement ) {
  49151. // Schema.
  49152. editor.model.schema.register( option.model, {
  49153. inheritAllFrom: '$block'
  49154. } );
  49155. editor.conversion.elementToElement( option );
  49156. modelElements.push( option.model );
  49157. }
  49158. }
  49159. this._addDefaultH1Conversion( editor );
  49160. // Register the heading command for this option.
  49161. editor.commands.add( 'heading', new _headingcommand__WEBPACK_IMPORTED_MODULE_2__["default"]( editor, modelElements ) );
  49162. }
  49163. /**
  49164. * @inheritDoc
  49165. */
  49166. afterInit() {
  49167. // If the enter command is added to the editor, alter its behavior.
  49168. // Enter at the end of a heading element should create a paragraph.
  49169. const editor = this.editor;
  49170. const enterCommand = editor.commands.get( 'enter' );
  49171. const options = editor.config.get( 'heading.options' );
  49172. if ( enterCommand ) {
  49173. this.listenTo( enterCommand, 'afterExecute', ( evt, data ) => {
  49174. const positionParent = editor.model.document.selection.getFirstPosition().parent;
  49175. const isHeading = options.some( option => positionParent.is( 'element', option.model ) );
  49176. if ( isHeading && !positionParent.is( 'element', defaultModelElement ) && positionParent.childCount === 0 ) {
  49177. data.writer.rename( positionParent, defaultModelElement );
  49178. }
  49179. } );
  49180. }
  49181. }
  49182. /**
  49183. * Adds default conversion for `h1` -> `heading1` with a low priority.
  49184. *
  49185. * @private
  49186. * @param {module:core/editor/editor~Editor} editor Editor instance on which to add the `h1` conversion.
  49187. */
  49188. _addDefaultH1Conversion( editor ) {
  49189. editor.conversion.for( 'upcast' ).elementToElement( {
  49190. model: 'heading1',
  49191. view: 'h1',
  49192. // With a `low` priority, `paragraph` plugin autoparagraphing mechanism is executed. Make sure
  49193. // this listener is called before it. If not, `h1` will be transformed into a paragraph.
  49194. converterPriority: _ckeditor_ckeditor5_utils_src_priorities__WEBPACK_IMPORTED_MODULE_3__["default"].get( 'low' ) + 1
  49195. } );
  49196. }
  49197. }
  49198. /***/ }),
  49199. /***/ "./node_modules/@ckeditor/ckeditor5-heading/src/headingui.js":
  49200. /*!*******************************************************************!*\
  49201. !*** ./node_modules/@ckeditor/ckeditor5-heading/src/headingui.js ***!
  49202. \*******************************************************************/
  49203. /*! exports provided: default */
  49204. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  49205. "use strict";
  49206. __webpack_require__.r(__webpack_exports__);
  49207. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return HeadingUI; });
  49208. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  49209. /* harmony import */ var _ckeditor_ckeditor5_ui_src_model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/model */ "./node_modules/@ckeditor/ckeditor5-ui/src/model.js");
  49210. /* harmony import */ var _ckeditor_ckeditor5_ui_src_dropdown_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/dropdown/utils */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/utils.js");
  49211. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-heading/src/utils.js");
  49212. /* harmony import */ var _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/collection */ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js");
  49213. /* harmony import */ var _theme_heading_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../theme/heading.css */ "./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css");
  49214. /* harmony import */ var _theme_heading_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_theme_heading_css__WEBPACK_IMPORTED_MODULE_5__);
  49215. /**
  49216. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  49217. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  49218. */
  49219. /**
  49220. * @module heading/headingui
  49221. */
  49222. /**
  49223. * The headings UI feature. It introduces the `headings` dropdown.
  49224. *
  49225. * @extends module:core/plugin~Plugin
  49226. */
  49227. class HeadingUI extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  49228. /**
  49229. * @inheritDoc
  49230. */
  49231. init() {
  49232. const editor = this.editor;
  49233. const t = editor.t;
  49234. const options = Object(_utils__WEBPACK_IMPORTED_MODULE_3__["getLocalizedOptions"])( editor );
  49235. const defaultTitle = t( 'Choose heading' );
  49236. const dropdownTooltip = t( 'Heading' );
  49237. // Register UI component.
  49238. editor.ui.componentFactory.add( 'heading', locale => {
  49239. const titles = {};
  49240. const itemDefinitions = new _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_4__["default"]();
  49241. const headingCommand = editor.commands.get( 'heading' );
  49242. const paragraphCommand = editor.commands.get( 'paragraph' );
  49243. const commands = [ headingCommand ];
  49244. for ( const option of options ) {
  49245. const def = {
  49246. type: 'button',
  49247. model: new _ckeditor_ckeditor5_ui_src_model__WEBPACK_IMPORTED_MODULE_1__["default"]( {
  49248. label: option.title,
  49249. class: option.class,
  49250. withText: true
  49251. } )
  49252. };
  49253. if ( option.model === 'paragraph' ) {
  49254. def.model.bind( 'isOn' ).to( paragraphCommand, 'value' );
  49255. def.model.set( 'commandName', 'paragraph' );
  49256. commands.push( paragraphCommand );
  49257. } else {
  49258. def.model.bind( 'isOn' ).to( headingCommand, 'value', value => value === option.model );
  49259. def.model.set( {
  49260. commandName: 'heading',
  49261. commandValue: option.model
  49262. } );
  49263. }
  49264. // Add the option to the collection.
  49265. itemDefinitions.add( def );
  49266. titles[ option.model ] = option.title;
  49267. }
  49268. const dropdownView = Object(_ckeditor_ckeditor5_ui_src_dropdown_utils__WEBPACK_IMPORTED_MODULE_2__["createDropdown"])( locale );
  49269. Object(_ckeditor_ckeditor5_ui_src_dropdown_utils__WEBPACK_IMPORTED_MODULE_2__["addListToDropdown"])( dropdownView, itemDefinitions );
  49270. dropdownView.buttonView.set( {
  49271. isOn: false,
  49272. withText: true,
  49273. tooltip: dropdownTooltip
  49274. } );
  49275. dropdownView.extendTemplate( {
  49276. attributes: {
  49277. class: [
  49278. 'ck-heading-dropdown'
  49279. ]
  49280. }
  49281. } );
  49282. dropdownView.bind( 'isEnabled' ).toMany( commands, 'isEnabled', ( ...areEnabled ) => {
  49283. return areEnabled.some( isEnabled => isEnabled );
  49284. } );
  49285. dropdownView.buttonView.bind( 'label' ).to( headingCommand, 'value', paragraphCommand, 'value', ( value, para ) => {
  49286. const whichModel = value || para && 'paragraph';
  49287. // If none of the commands is active, display default title.
  49288. return titles[ whichModel ] ? titles[ whichModel ] : defaultTitle;
  49289. } );
  49290. // Execute command when an item from the dropdown is selected.
  49291. this.listenTo( dropdownView, 'execute', evt => {
  49292. editor.execute( evt.source.commandName, evt.source.commandValue ? { value: evt.source.commandValue } : undefined );
  49293. editor.editing.view.focus();
  49294. } );
  49295. return dropdownView;
  49296. } );
  49297. }
  49298. }
  49299. /***/ }),
  49300. /***/ "./node_modules/@ckeditor/ckeditor5-heading/src/utils.js":
  49301. /*!***************************************************************!*\
  49302. !*** ./node_modules/@ckeditor/ckeditor5-heading/src/utils.js ***!
  49303. \***************************************************************/
  49304. /*! exports provided: getLocalizedOptions */
  49305. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  49306. "use strict";
  49307. __webpack_require__.r(__webpack_exports__);
  49308. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocalizedOptions", function() { return getLocalizedOptions; });
  49309. /**
  49310. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  49311. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  49312. */
  49313. /**
  49314. * @module heading/utils
  49315. */
  49316. /**
  49317. * Returns heading options as defined in `config.heading.options` but processed to consider
  49318. * the editor localization, i.e. to display {@link module:heading/heading~HeadingOption}
  49319. * in the correct language.
  49320. *
  49321. * Note: The reason behind this method is that there is no way to use {@link module:utils/locale~Locale#t}
  49322. * when the user configuration is defined because the editor does not exist yet.
  49323. *
  49324. * @param {module:core/editor/editor~Editor} editor
  49325. * @returns {Array.<module:heading/heading~HeadingOption>}.
  49326. */
  49327. function getLocalizedOptions( editor ) {
  49328. const t = editor.t;
  49329. const localizedTitles = {
  49330. Paragraph: t( 'Paragraph' ),
  49331. 'Heading 1': t( 'Heading 1' ),
  49332. 'Heading 2': t( 'Heading 2' ),
  49333. 'Heading 3': t( 'Heading 3' ),
  49334. 'Heading 4': t( 'Heading 4' ),
  49335. 'Heading 5': t( 'Heading 5' ),
  49336. 'Heading 6': t( 'Heading 6' )
  49337. };
  49338. return editor.config.get( 'heading.options' ).map( option => {
  49339. const title = localizedTitles[ option.title ];
  49340. if ( title && title != option.title ) {
  49341. option.title = title;
  49342. }
  49343. return option;
  49344. } );
  49345. }
  49346. /***/ }),
  49347. /***/ "./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css":
  49348. /*!********************************************************************!*\
  49349. !*** ./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css ***!
  49350. \********************************************************************/
  49351. /*! no static exports found */
  49352. /***/ (function(module, exports, __webpack_require__) {
  49353. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  49354. var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./heading.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css");
  49355. content = content.__esModule ? content.default : content;
  49356. if (typeof content === 'string') {
  49357. content = [[module.i, content, '']];
  49358. }
  49359. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  49360. options.insert = "head";
  49361. options.singleton = true;
  49362. var update = api(content, options);
  49363. module.exports = content.locals || {};
  49364. /***/ }),
  49365. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/image.js":
  49366. /*!*************************************************************!*\
  49367. !*** ./node_modules/@ckeditor/ckeditor5-image/src/image.js ***!
  49368. \*************************************************************/
  49369. /*! exports provided: default */
  49370. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  49371. "use strict";
  49372. __webpack_require__.r(__webpack_exports__);
  49373. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Image; });
  49374. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  49375. /* harmony import */ var _src_image_imageediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../src/image/imageediting */ "./node_modules/@ckeditor/ckeditor5-image/src/image/imageediting.js");
  49376. /* harmony import */ var _ckeditor_ckeditor5_widget_src_widget__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-widget/src/widget */ "./node_modules/@ckeditor/ckeditor5-widget/src/widget.js");
  49377. /* harmony import */ var _imagetextalternative__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./imagetextalternative */ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative.js");
  49378. /* harmony import */ var _theme_image_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../theme/image.css */ "./node_modules/@ckeditor/ckeditor5-image/theme/image.css");
  49379. /* harmony import */ var _theme_image_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_theme_image_css__WEBPACK_IMPORTED_MODULE_4__);
  49380. /**
  49381. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  49382. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  49383. */
  49384. /**
  49385. * @module image/image
  49386. */
  49387. /**
  49388. * The image plugin.
  49389. *
  49390. * For a detailed overview, check the {@glink features/image image feature} documentation.
  49391. *
  49392. * This is a "glue" plugin which loads the following plugins:
  49393. *
  49394. * * {@link module:image/image/imageediting~ImageEditing},
  49395. * * {@link module:image/imagetextalternative~ImageTextAlternative}.
  49396. *
  49397. * Usually, it is used in conjuction with other plugins from this package. See the {@glink api/image package page}
  49398. * for more information.
  49399. *
  49400. * @extends module:core/plugin~Plugin
  49401. */
  49402. class Image extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  49403. /**
  49404. * @inheritDoc
  49405. */
  49406. static get requires() {
  49407. return [ _src_image_imageediting__WEBPACK_IMPORTED_MODULE_1__["default"], _ckeditor_ckeditor5_widget_src_widget__WEBPACK_IMPORTED_MODULE_2__["default"], _imagetextalternative__WEBPACK_IMPORTED_MODULE_3__["default"] ];
  49408. }
  49409. /**
  49410. * @inheritDoc
  49411. */
  49412. static get pluginName() {
  49413. return 'Image';
  49414. }
  49415. }
  49416. /**
  49417. * The configuration of the image features. Used by the image features in the `@ckeditor/ckeditor5-image` package.
  49418. *
  49419. * Read more in {@link module:image/image~ImageConfig}.
  49420. *
  49421. * @member {module:image/image~ImageConfig} module:core/editor/editorconfig~EditorConfig#image
  49422. */
  49423. /**
  49424. * The configuration of the image features. Used by the image features in the `@ckeditor/ckeditor5-image` package.
  49425. *
  49426. * ClassicEditor
  49427. * .create( editorElement, {
  49428. * image: ... // Image feature options.
  49429. * } )
  49430. * .then( ... )
  49431. * .catch( ... );
  49432. *
  49433. * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
  49434. *
  49435. * @interface ImageConfig
  49436. */
  49437. /***/ }),
  49438. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/image/converters.js":
  49439. /*!************************************************************************!*\
  49440. !*** ./node_modules/@ckeditor/ckeditor5-image/src/image/converters.js ***!
  49441. \************************************************************************/
  49442. /*! exports provided: viewFigureToModel, srcsetAttributeConverter, modelToViewAttributeConverter */
  49443. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  49444. "use strict";
  49445. __webpack_require__.r(__webpack_exports__);
  49446. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "viewFigureToModel", function() { return viewFigureToModel; });
  49447. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "srcsetAttributeConverter", function() { return srcsetAttributeConverter; });
  49448. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelToViewAttributeConverter", function() { return modelToViewAttributeConverter; });
  49449. /* harmony import */ var _ckeditor_ckeditor5_utils_src_first__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/first */ "./node_modules/@ckeditor/ckeditor5-utils/src/first.js");
  49450. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
  49451. /**
  49452. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  49453. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  49454. */
  49455. /**
  49456. * @module image/image/converters
  49457. */
  49458. /**
  49459. * Returns a function that converts the image view representation:
  49460. *
  49461. * <figure class="image"><img src="..." alt="..."></img></figure>
  49462. *
  49463. * to the model representation:
  49464. *
  49465. * <image src="..." alt="..."></image>
  49466. *
  49467. * The entire content of the `<figure>` element except the first `<img>` is being converted as children
  49468. * of the `<image>` model element.
  49469. *
  49470. * @returns {Function}
  49471. */
  49472. function viewFigureToModel() {
  49473. return dispatcher => {
  49474. dispatcher.on( 'element:figure', converter );
  49475. };
  49476. function converter( evt, data, conversionApi ) {
  49477. // Do not convert if this is not an "image figure".
  49478. if ( !conversionApi.consumable.test( data.viewItem, { name: true, classes: 'image' } ) ) {
  49479. return;
  49480. }
  49481. // Find an image element inside the figure element.
  49482. const viewImage = Object(_utils__WEBPACK_IMPORTED_MODULE_1__["getViewImgFromWidget"])( data.viewItem );
  49483. // Do not convert if image element is absent, is missing src attribute or was already converted.
  49484. if ( !viewImage || !viewImage.hasAttribute( 'src' ) || !conversionApi.consumable.test( viewImage, { name: true } ) ) {
  49485. return;
  49486. }
  49487. // Convert view image to model image.
  49488. const conversionResult = conversionApi.convertItem( viewImage, data.modelCursor );
  49489. // Get image element from conversion result.
  49490. const modelImage = Object(_ckeditor_ckeditor5_utils_src_first__WEBPACK_IMPORTED_MODULE_0__["default"])( conversionResult.modelRange.getItems() );
  49491. // When image wasn't successfully converted then finish conversion.
  49492. if ( !modelImage ) {
  49493. return;
  49494. }
  49495. // Convert rest of the figure element's children as an image children.
  49496. conversionApi.convertChildren( data.viewItem, modelImage );
  49497. conversionApi.updateConversionResult( modelImage, data );
  49498. }
  49499. }
  49500. /**
  49501. * Converter used to convert the `srcset` model image attribute to the `srcset`, `sizes` and `width` attributes in the view.
  49502. *
  49503. * @returns {Function}
  49504. */
  49505. function srcsetAttributeConverter() {
  49506. return dispatcher => {
  49507. dispatcher.on( 'attribute:srcset:image', converter );
  49508. };
  49509. function converter( evt, data, conversionApi ) {
  49510. if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
  49511. return;
  49512. }
  49513. const writer = conversionApi.writer;
  49514. const figure = conversionApi.mapper.toViewElement( data.item );
  49515. const img = Object(_utils__WEBPACK_IMPORTED_MODULE_1__["getViewImgFromWidget"])( figure );
  49516. if ( data.attributeNewValue === null ) {
  49517. const srcset = data.attributeOldValue;
  49518. if ( srcset.data ) {
  49519. writer.removeAttribute( 'srcset', img );
  49520. writer.removeAttribute( 'sizes', img );
  49521. if ( srcset.width ) {
  49522. writer.removeAttribute( 'width', img );
  49523. }
  49524. }
  49525. } else {
  49526. const srcset = data.attributeNewValue;
  49527. if ( srcset.data ) {
  49528. writer.setAttribute( 'srcset', srcset.data, img );
  49529. // Always outputting `100vw`. See https://github.com/ckeditor/ckeditor5-image/issues/2.
  49530. writer.setAttribute( 'sizes', '100vw', img );
  49531. if ( srcset.width ) {
  49532. writer.setAttribute( 'width', srcset.width, img );
  49533. }
  49534. }
  49535. }
  49536. }
  49537. }
  49538. function modelToViewAttributeConverter( attributeKey ) {
  49539. return dispatcher => {
  49540. dispatcher.on( `attribute:${ attributeKey }:image`, converter );
  49541. };
  49542. function converter( evt, data, conversionApi ) {
  49543. if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
  49544. return;
  49545. }
  49546. const viewWriter = conversionApi.writer;
  49547. const figure = conversionApi.mapper.toViewElement( data.item );
  49548. const img = Object(_utils__WEBPACK_IMPORTED_MODULE_1__["getViewImgFromWidget"])( figure );
  49549. viewWriter.setAttribute( data.attributeKey, data.attributeNewValue || '', img );
  49550. }
  49551. }
  49552. /***/ }),
  49553. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/image/imageediting.js":
  49554. /*!**************************************************************************!*\
  49555. !*** ./node_modules/@ckeditor/ckeditor5-image/src/image/imageediting.js ***!
  49556. \**************************************************************************/
  49557. /*! exports provided: default, createImageViewElement */
  49558. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  49559. "use strict";
  49560. __webpack_require__.r(__webpack_exports__);
  49561. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageEditing; });
  49562. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createImageViewElement", function() { return createImageViewElement; });
  49563. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  49564. /* harmony import */ var _imageloadobserver__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./imageloadobserver */ "./node_modules/@ckeditor/ckeditor5-image/src/image/imageloadobserver.js");
  49565. /* harmony import */ var _converters__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./converters */ "./node_modules/@ckeditor/ckeditor5-image/src/image/converters.js");
  49566. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
  49567. /* harmony import */ var _imageinsertcommand__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./imageinsertcommand */ "./node_modules/@ckeditor/ckeditor5-image/src/image/imageinsertcommand.js");
  49568. /**
  49569. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  49570. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  49571. */
  49572. /**
  49573. * @module image/image/imageediting
  49574. */
  49575. /**
  49576. * The image engine plugin.
  49577. *
  49578. * It registers:
  49579. *
  49580. * * `<image>` as a block element in the document schema, and allows `alt`, `src` and `srcset` attributes.
  49581. * * converters for editing and data pipelines.
  49582. * * `'imageInsert'` command.
  49583. *
  49584. * @extends module:core/plugin~Plugin
  49585. */
  49586. class ImageEditing extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  49587. /**
  49588. * @inheritDoc
  49589. */
  49590. static get pluginName() {
  49591. return 'ImageEditing';
  49592. }
  49593. /**
  49594. * @inheritDoc
  49595. */
  49596. init() {
  49597. const editor = this.editor;
  49598. const schema = editor.model.schema;
  49599. const t = editor.t;
  49600. const conversion = editor.conversion;
  49601. // See https://github.com/ckeditor/ckeditor5-image/issues/142.
  49602. editor.editing.view.addObserver( _imageloadobserver__WEBPACK_IMPORTED_MODULE_1__["default"] );
  49603. // Configure schema.
  49604. schema.register( 'image', {
  49605. isObject: true,
  49606. isBlock: true,
  49607. allowWhere: '$block',
  49608. allowAttributes: [ 'alt', 'src', 'srcset' ]
  49609. } );
  49610. conversion.for( 'dataDowncast' ).elementToElement( {
  49611. model: 'image',
  49612. view: ( modelElement, { writer } ) => createImageViewElement( writer )
  49613. } );
  49614. conversion.for( 'editingDowncast' ).elementToElement( {
  49615. model: 'image',
  49616. view: ( modelElement, { writer } ) => Object(_utils__WEBPACK_IMPORTED_MODULE_3__["toImageWidget"])( createImageViewElement( writer ), writer, t( 'image widget' ) )
  49617. } );
  49618. conversion.for( 'downcast' )
  49619. .add( Object(_converters__WEBPACK_IMPORTED_MODULE_2__["modelToViewAttributeConverter"])( 'src' ) )
  49620. .add( Object(_converters__WEBPACK_IMPORTED_MODULE_2__["modelToViewAttributeConverter"])( 'alt' ) )
  49621. .add( Object(_converters__WEBPACK_IMPORTED_MODULE_2__["srcsetAttributeConverter"])() );
  49622. conversion.for( 'upcast' )
  49623. .elementToElement( {
  49624. view: {
  49625. name: 'img',
  49626. attributes: {
  49627. src: true
  49628. }
  49629. },
  49630. model: ( viewImage, { writer } ) => writer.createElement( 'image', { src: viewImage.getAttribute( 'src' ) } )
  49631. } )
  49632. .attributeToAttribute( {
  49633. view: {
  49634. name: 'img',
  49635. key: 'alt'
  49636. },
  49637. model: 'alt'
  49638. } )
  49639. .attributeToAttribute( {
  49640. view: {
  49641. name: 'img',
  49642. key: 'srcset'
  49643. },
  49644. model: {
  49645. key: 'srcset',
  49646. value: viewImage => {
  49647. const value = {
  49648. data: viewImage.getAttribute( 'srcset' )
  49649. };
  49650. if ( viewImage.hasAttribute( 'width' ) ) {
  49651. value.width = viewImage.getAttribute( 'width' );
  49652. }
  49653. return value;
  49654. }
  49655. }
  49656. } )
  49657. .add( Object(_converters__WEBPACK_IMPORTED_MODULE_2__["viewFigureToModel"])() );
  49658. editor.commands.add( 'imageInsert', new _imageinsertcommand__WEBPACK_IMPORTED_MODULE_4__["default"]( editor ) );
  49659. }
  49660. }
  49661. // Creates a view element representing the image.
  49662. //
  49663. // <figure class="image"><img></img></figure>
  49664. //
  49665. // Note that `alt` and `src` attributes are converted separately, so they are not included.
  49666. //
  49667. // @private
  49668. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  49669. // @returns {module:engine/view/containerelement~ContainerElement}
  49670. function createImageViewElement( writer ) {
  49671. const emptyElement = writer.createEmptyElement( 'img' );
  49672. const figure = writer.createContainerElement( 'figure', { class: 'image' } );
  49673. writer.insert( writer.createPositionAt( figure, 0 ), emptyElement );
  49674. return figure;
  49675. }
  49676. /***/ }),
  49677. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/image/imageinsertcommand.js":
  49678. /*!********************************************************************************!*\
  49679. !*** ./node_modules/@ckeditor/ckeditor5-image/src/image/imageinsertcommand.js ***!
  49680. \********************************************************************************/
  49681. /*! exports provided: default */
  49682. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  49683. "use strict";
  49684. __webpack_require__.r(__webpack_exports__);
  49685. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageInsertCommand; });
  49686. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  49687. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
  49688. /**
  49689. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  49690. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  49691. */
  49692. /**
  49693. * @module image/image/imageinsertcommand
  49694. */
  49695. /**
  49696. * Insert image command.
  49697. *
  49698. * The command is registered by the {@link module:image/image/imageediting~ImageEditing} plugin as `'imageInsert'`.
  49699. *
  49700. * In order to insert an image at the current selection position
  49701. * (according to the {@link module:widget/utils~findOptimalInsertionPosition} algorithm),
  49702. * execute the command and specify the image source:
  49703. *
  49704. * editor.execute( 'imageInsert', { source: 'http://url.to.the/image' } );
  49705. *
  49706. * It is also possible to insert multiple images at once:
  49707. *
  49708. * editor.execute( 'imageInsert', {
  49709. * source: [
  49710. * 'path/to/image.jpg',
  49711. * 'path/to/other-image.jpg'
  49712. * ]
  49713. * } );
  49714. *
  49715. * @extends module:core/command~Command
  49716. */
  49717. class ImageInsertCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  49718. /**
  49719. * @inheritDoc
  49720. */
  49721. refresh() {
  49722. this.isEnabled = Object(_utils__WEBPACK_IMPORTED_MODULE_1__["isImageAllowed"])( this.editor.model );
  49723. }
  49724. /**
  49725. * Executes the command.
  49726. *
  49727. * @fires execute
  49728. * @param {Object} options Options for the executed command.
  49729. * @param {String|Array.<String>} options.source The image source or an array of image sources to insert.
  49730. */
  49731. execute( options ) {
  49732. const model = this.editor.model;
  49733. model.change( writer => {
  49734. const sources = Array.isArray( options.source ) ? options.source : [ options.source ];
  49735. for ( const src of sources ) {
  49736. Object(_utils__WEBPACK_IMPORTED_MODULE_1__["insertImage"])( writer, model, { src } );
  49737. }
  49738. } );
  49739. }
  49740. }
  49741. /***/ }),
  49742. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/image/imageloadobserver.js":
  49743. /*!*******************************************************************************!*\
  49744. !*** ./node_modules/@ckeditor/ckeditor5-image/src/image/imageloadobserver.js ***!
  49745. \*******************************************************************************/
  49746. /*! exports provided: default */
  49747. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  49748. "use strict";
  49749. __webpack_require__.r(__webpack_exports__);
  49750. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageLoadObserver; });
  49751. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_observer_observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/observer/observer */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js");
  49752. /**
  49753. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  49754. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  49755. */
  49756. /**
  49757. * @module image/image/imageloadobserver
  49758. */
  49759. /**
  49760. * Observes all new images added to the {@link module:engine/view/document~Document},
  49761. * fires {@link module:engine/view/document~Document#event:imageLoaded} and
  49762. * {@link module:engine/view/document~Document#event:layoutChanged} event every time when the new image
  49763. * has been loaded.
  49764. *
  49765. * **Note:** This event is not fired for images that has been added to the document and rendered as `complete` (already loaded).
  49766. *
  49767. * @extends module:engine/view/observer/observer~Observer
  49768. */
  49769. class ImageLoadObserver extends _ckeditor_ckeditor5_engine_src_view_observer_observer__WEBPACK_IMPORTED_MODULE_0__["default"] {
  49770. /**
  49771. * @inheritDoc
  49772. */
  49773. observe( domRoot ) {
  49774. this.listenTo( domRoot, 'load', ( event, domEvent ) => {
  49775. const domElement = domEvent.target;
  49776. if ( this.checkShouldIgnoreEventFromTarget( domElement ) ) {
  49777. return;
  49778. }
  49779. if ( domElement.tagName == 'IMG' ) {
  49780. this._fireEvents( domEvent );
  49781. }
  49782. // Use capture phase for better performance (#4504).
  49783. }, { useCapture: true } );
  49784. }
  49785. /**
  49786. * Fires {@link module:engine/view/document~Document#event:layoutChanged} and
  49787. * {@link module:engine/view/document~Document#event:imageLoaded}
  49788. * if observer {@link #isEnabled is enabled}.
  49789. *
  49790. * @protected
  49791. * @param {Event} domEvent The DOM event.
  49792. */
  49793. _fireEvents( domEvent ) {
  49794. if ( this.isEnabled ) {
  49795. this.document.fire( 'layoutChanged' );
  49796. this.document.fire( 'imageLoaded', domEvent );
  49797. }
  49798. }
  49799. }
  49800. /**
  49801. * Fired when an <img/> DOM element has been loaded in the DOM root.
  49802. *
  49803. * Introduced by {@link module:image/image/imageloadobserver~ImageLoadObserver}.
  49804. *
  49805. * @see module:image/image/imageloadobserver~ImageLoadObserver
  49806. * @event module:engine/view/document~Document#event:imageLoaded
  49807. * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
  49808. */
  49809. /***/ }),
  49810. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/image/ui/utils.js":
  49811. /*!**********************************************************************!*\
  49812. !*** ./node_modules/@ckeditor/ckeditor5-image/src/image/ui/utils.js ***!
  49813. \**********************************************************************/
  49814. /*! exports provided: repositionContextualBalloon, getBalloonPositionData */
  49815. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  49816. "use strict";
  49817. __webpack_require__.r(__webpack_exports__);
  49818. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "repositionContextualBalloon", function() { return repositionContextualBalloon; });
  49819. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBalloonPositionData", function() { return getBalloonPositionData; });
  49820. /* harmony import */ var _ckeditor_ckeditor5_ui_src_panel_balloon_balloonpanelview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview.js");
  49821. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
  49822. /**
  49823. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  49824. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  49825. */
  49826. /**
  49827. * @module image/image/ui/utils
  49828. */
  49829. /**
  49830. * A helper utility that positions the
  49831. * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} instance
  49832. * with respect to the image in the editor content, if one is selected.
  49833. *
  49834. * @param {module:core/editor/editor~Editor} editor The editor instance.
  49835. */
  49836. function repositionContextualBalloon( editor ) {
  49837. const balloon = editor.plugins.get( 'ContextualBalloon' );
  49838. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_1__["getSelectedImageWidget"])( editor.editing.view.document.selection ) ) {
  49839. const position = getBalloonPositionData( editor );
  49840. balloon.updatePosition( position );
  49841. }
  49842. }
  49843. /**
  49844. * Returns the positioning options that control the geometry of the
  49845. * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} with respect
  49846. * to the selected element in the editor content.
  49847. *
  49848. * @param {module:core/editor/editor~Editor} editor The editor instance.
  49849. * @returns {module:utils/dom/position~Options}
  49850. */
  49851. function getBalloonPositionData( editor ) {
  49852. const editingView = editor.editing.view;
  49853. const defaultPositions = _ckeditor_ckeditor5_ui_src_panel_balloon_balloonpanelview__WEBPACK_IMPORTED_MODULE_0__["default"].defaultPositions;
  49854. return {
  49855. target: editingView.domConverter.viewToDom( editingView.document.selection.getSelectedElement() ),
  49856. positions: [
  49857. defaultPositions.northArrowSouth,
  49858. defaultPositions.northArrowSouthWest,
  49859. defaultPositions.northArrowSouthEast,
  49860. defaultPositions.southArrowNorth,
  49861. defaultPositions.southArrowNorthWest,
  49862. defaultPositions.southArrowNorthEast
  49863. ]
  49864. };
  49865. }
  49866. /***/ }),
  49867. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js":
  49868. /*!*******************************************************************!*\
  49869. !*** ./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js ***!
  49870. \*******************************************************************/
  49871. /*! exports provided: toImageWidget, isImageWidget, getSelectedImageWidget, isImage, insertImage, isImageAllowed, getViewImgFromWidget */
  49872. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  49873. "use strict";
  49874. __webpack_require__.r(__webpack_exports__);
  49875. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toImageWidget", function() { return toImageWidget; });
  49876. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isImageWidget", function() { return isImageWidget; });
  49877. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSelectedImageWidget", function() { return getSelectedImageWidget; });
  49878. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isImage", function() { return isImage; });
  49879. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertImage", function() { return insertImage; });
  49880. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isImageAllowed", function() { return isImageAllowed; });
  49881. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getViewImgFromWidget", function() { return getViewImgFromWidget; });
  49882. /* harmony import */ var _ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-widget/src/utils */ "./node_modules/@ckeditor/ckeditor5-widget/src/utils.js");
  49883. /**
  49884. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  49885. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  49886. */
  49887. /**
  49888. * @module image/image/utils
  49889. */
  49890. /**
  49891. * Converts a given {@link module:engine/view/element~Element} to an image widget:
  49892. * * Adds a {@link module:engine/view/element~Element#_setCustomProperty custom property} allowing to recognize the image widget element.
  49893. * * Calls the {@link module:widget/utils~toWidget} function with the proper element's label creator.
  49894. *
  49895. * @param {module:engine/view/element~Element} viewElement
  49896. * @param {module:engine/view/downcastwriter~DowncastWriter} writer An instance of the view writer.
  49897. * @param {String} label The element's label. It will be concatenated with the image `alt` attribute if one is present.
  49898. * @returns {module:engine/view/element~Element}
  49899. */
  49900. function toImageWidget( viewElement, writer, label ) {
  49901. writer.setCustomProperty( 'image', true, viewElement );
  49902. return Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_0__["toWidget"])( viewElement, writer, { label: labelCreator } );
  49903. function labelCreator() {
  49904. const imgElement = getViewImgFromWidget( viewElement );
  49905. const altText = imgElement.getAttribute( 'alt' );
  49906. return altText ? `${ altText } ${ label }` : label;
  49907. }
  49908. }
  49909. /**
  49910. * Checks if a given view element is an image widget.
  49911. *
  49912. * @param {module:engine/view/element~Element} viewElement
  49913. * @returns {Boolean}
  49914. */
  49915. function isImageWidget( viewElement ) {
  49916. return !!viewElement.getCustomProperty( 'image' ) && Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_0__["isWidget"])( viewElement );
  49917. }
  49918. /**
  49919. * Returns an image widget editing view element if one is selected.
  49920. *
  49921. * @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection} selection
  49922. * @returns {module:engine/view/element~Element|null}
  49923. */
  49924. function getSelectedImageWidget( selection ) {
  49925. const viewElement = selection.getSelectedElement();
  49926. if ( viewElement && isImageWidget( viewElement ) ) {
  49927. return viewElement;
  49928. }
  49929. return null;
  49930. }
  49931. /**
  49932. * Checks if the provided model element is an `image`.
  49933. *
  49934. * @param {module:engine/model/element~Element} modelElement
  49935. * @returns {Boolean}
  49936. */
  49937. function isImage( modelElement ) {
  49938. return !!modelElement && modelElement.is( 'element', 'image' );
  49939. }
  49940. /**
  49941. * Handles inserting single file. This method unifies image insertion using {@link module:widget/utils~findOptimalInsertionPosition} method.
  49942. *
  49943. * model.change( writer => {
  49944. * insertImage( writer, model, { src: 'path/to/image.jpg' } );
  49945. * } );
  49946. *
  49947. * @param {module:engine/model/writer~Writer} writer
  49948. * @param {module:engine/model/model~Model} model
  49949. * @param {Object} [attributes={}] Attributes of inserted image
  49950. */
  49951. function insertImage( writer, model, attributes = {} ) {
  49952. const imageElement = writer.createElement( 'image', attributes );
  49953. const insertAtSelection = Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_0__["findOptimalInsertionPosition"])( model.document.selection, model );
  49954. model.insertContent( imageElement, insertAtSelection );
  49955. // Inserting an image might've failed due to schema regulations.
  49956. if ( imageElement.parent ) {
  49957. writer.setSelection( imageElement, 'on' );
  49958. }
  49959. }
  49960. /**
  49961. * Checks if image can be inserted at current model selection.
  49962. *
  49963. * @param {module:engine/model/model~Model} model
  49964. * @returns {Boolean}
  49965. */
  49966. function isImageAllowed( model ) {
  49967. const schema = model.schema;
  49968. const selection = model.document.selection;
  49969. return isImageAllowedInParent( selection, schema, model ) &&
  49970. !checkSelectionOnObject( selection, schema ) &&
  49971. isInOtherImage( selection );
  49972. }
  49973. /**
  49974. * Get view `<img>` element from the view widget (`<figure>`).
  49975. *
  49976. * Assuming that image is always a first child of a widget (ie. `figureView.getChild( 0 )`) is unsafe as other features might
  49977. * inject their own elements to the widget.
  49978. *
  49979. * The `<img>` can be wrapped to other elements, e.g. `<a>`. Nested check required.
  49980. *
  49981. * @param {module:engine/view/element~Element} figureView
  49982. * @returns {module:engine/view/element~Element}
  49983. */
  49984. function getViewImgFromWidget( figureView ) {
  49985. const figureChildren = [];
  49986. for ( const figureChild of figureView.getChildren() ) {
  49987. figureChildren.push( figureChild );
  49988. if ( figureChild.is( 'element' ) ) {
  49989. figureChildren.push( ...figureChild.getChildren() );
  49990. }
  49991. }
  49992. return figureChildren.find( viewChild => viewChild.is( 'element', 'img' ) );
  49993. }
  49994. // Checks if image is allowed by schema in optimal insertion parent.
  49995. //
  49996. // @returns {Boolean}
  49997. function isImageAllowedInParent( selection, schema, model ) {
  49998. const parent = getInsertImageParent( selection, model );
  49999. return schema.checkChild( parent, 'image' );
  50000. }
  50001. // Check if selection is on object.
  50002. //
  50003. // @returns {Boolean}
  50004. function checkSelectionOnObject( selection, schema ) {
  50005. const selectedElement = selection.getSelectedElement();
  50006. return selectedElement && schema.isObject( selectedElement );
  50007. }
  50008. // Checks if selection is placed in other image (ie. in caption).
  50009. function isInOtherImage( selection ) {
  50010. return [ ...selection.focus.getAncestors() ].every( ancestor => !ancestor.is( 'element', 'image' ) );
  50011. }
  50012. // Returns a node that will be used to insert image with `model.insertContent` to check if image can be placed there.
  50013. function getInsertImageParent( selection, model ) {
  50014. const insertAt = Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_0__["findOptimalInsertionPosition"])( selection, model );
  50015. const parent = insertAt.parent;
  50016. if ( parent.isEmpty && !parent.is( 'element', '$root' ) ) {
  50017. return parent.parent;
  50018. }
  50019. return parent;
  50020. }
  50021. /***/ }),
  50022. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagecaption.js":
  50023. /*!********************************************************************!*\
  50024. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagecaption.js ***!
  50025. \********************************************************************/
  50026. /*! exports provided: default */
  50027. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  50028. "use strict";
  50029. __webpack_require__.r(__webpack_exports__);
  50030. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageCaption; });
  50031. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  50032. /* harmony import */ var _imagecaption_imagecaptionediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./imagecaption/imagecaptionediting */ "./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/imagecaptionediting.js");
  50033. /* harmony import */ var _theme_imagecaption_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../theme/imagecaption.css */ "./node_modules/@ckeditor/ckeditor5-image/theme/imagecaption.css");
  50034. /* harmony import */ var _theme_imagecaption_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_theme_imagecaption_css__WEBPACK_IMPORTED_MODULE_2__);
  50035. /**
  50036. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  50037. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  50038. */
  50039. /**
  50040. * @module image/imagecaption
  50041. */
  50042. /**
  50043. * The image caption plugin.
  50044. *
  50045. * For a detailed overview, check the {@glink features/image#image-captions image caption} documentation.
  50046. *
  50047. * @extends module:core/plugin~Plugin
  50048. */
  50049. class ImageCaption extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  50050. /**
  50051. * @inheritDoc
  50052. */
  50053. static get requires() {
  50054. return [ _imagecaption_imagecaptionediting__WEBPACK_IMPORTED_MODULE_1__["default"] ];
  50055. }
  50056. /**
  50057. * @inheritDoc
  50058. */
  50059. static get pluginName() {
  50060. return 'ImageCaption';
  50061. }
  50062. }
  50063. /***/ }),
  50064. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/imagecaptionediting.js":
  50065. /*!****************************************************************************************!*\
  50066. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/imagecaptionediting.js ***!
  50067. \****************************************************************************************/
  50068. /*! exports provided: default */
  50069. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  50070. "use strict";
  50071. __webpack_require__.r(__webpack_exports__);
  50072. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageCaptionEditing; });
  50073. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  50074. /* harmony import */ var _image_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../image/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
  50075. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/utils.js");
  50076. /**
  50077. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  50078. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  50079. */
  50080. /**
  50081. * @module image/imagecaption/imagecaptionediting
  50082. */
  50083. /**
  50084. * The image caption engine plugin.
  50085. *
  50086. * It registers proper converters. It takes care of adding a caption element if the image without it is inserted
  50087. * to the model document.
  50088. *
  50089. * @extends module:core/plugin~Plugin
  50090. */
  50091. class ImageCaptionEditing extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  50092. /**
  50093. * @inheritDoc
  50094. */
  50095. static get pluginName() {
  50096. return 'ImageCaptionEditing';
  50097. }
  50098. /**
  50099. * @inheritDoc
  50100. */
  50101. init() {
  50102. const editor = this.editor;
  50103. const view = editor.editing.view;
  50104. const schema = editor.model.schema;
  50105. const data = editor.data;
  50106. const editing = editor.editing;
  50107. const t = editor.t;
  50108. /**
  50109. * The last selected caption editable.
  50110. * It is used for hiding the editable when it is empty and the image widget is no longer selected.
  50111. *
  50112. * @private
  50113. * @member {module:engine/view/editableelement~EditableElement} #_lastSelectedCaption
  50114. */
  50115. // Schema configuration.
  50116. schema.register( 'caption', {
  50117. allowIn: 'image',
  50118. allowContentOf: '$block',
  50119. isLimit: true
  50120. } );
  50121. // Add caption element to each image inserted without it.
  50122. editor.model.document.registerPostFixer( writer => this._insertMissingModelCaptionElement( writer ) );
  50123. // View to model converter for the data pipeline.
  50124. editor.conversion.for( 'upcast' ).elementToElement( {
  50125. view: _utils__WEBPACK_IMPORTED_MODULE_2__["matchImageCaption"],
  50126. model: 'caption'
  50127. } );
  50128. // Model to view converter for the data pipeline.
  50129. const createCaptionForData = writer => writer.createContainerElement( 'figcaption' );
  50130. data.downcastDispatcher.on( 'insert:caption', captionModelToView( createCaptionForData, false ) );
  50131. // Model to view converter for the editing pipeline.
  50132. const createCaptionForEditing = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["captionElementCreator"])( view, t( 'Enter image caption' ) );
  50133. editing.downcastDispatcher.on( 'insert:caption', captionModelToView( createCaptionForEditing ) );
  50134. // Always show caption in view when something is inserted in model.
  50135. editing.downcastDispatcher.on(
  50136. 'insert',
  50137. this._fixCaptionVisibility( data => data.item ),
  50138. { priority: 'high' }
  50139. );
  50140. // Hide caption when everything is removed from it.
  50141. editing.downcastDispatcher.on( 'remove', this._fixCaptionVisibility( data => data.position.parent ), { priority: 'high' } );
  50142. // Update caption visibility on view in post fixer.
  50143. view.document.registerPostFixer( writer => this._updateCaptionVisibility( writer ) );
  50144. }
  50145. /**
  50146. * Updates the view before each rendering, making sure that empty captions (so unnecessary ones) are hidden
  50147. * and then visible when the image is selected.
  50148. *
  50149. * @private
  50150. * @param {module:engine/view/downcastwriter~DowncastWriter} viewWriter
  50151. * @returns {Boolean} Returns `true` when the view is updated.
  50152. */
  50153. _updateCaptionVisibility( viewWriter ) {
  50154. const mapper = this.editor.editing.mapper;
  50155. const lastCaption = this._lastSelectedCaption;
  50156. let viewCaption;
  50157. // If whole image is selected.
  50158. const modelSelection = this.editor.model.document.selection;
  50159. const selectedElement = modelSelection.getSelectedElement();
  50160. if ( selectedElement && selectedElement.is( 'element', 'image' ) ) {
  50161. const modelCaption = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["getCaptionFromImage"])( selectedElement );
  50162. viewCaption = mapper.toViewElement( modelCaption );
  50163. }
  50164. // If selection is placed inside caption.
  50165. const position = modelSelection.getFirstPosition();
  50166. const modelCaption = getParentCaption( position.parent );
  50167. if ( modelCaption ) {
  50168. viewCaption = mapper.toViewElement( modelCaption );
  50169. }
  50170. // Is currently any caption selected?
  50171. if ( viewCaption ) {
  50172. // Was any caption selected before?
  50173. if ( lastCaption ) {
  50174. // Same caption as before?
  50175. if ( lastCaption === viewCaption ) {
  50176. return showCaption( viewCaption, viewWriter );
  50177. } else {
  50178. hideCaptionIfEmpty( lastCaption, viewWriter );
  50179. this._lastSelectedCaption = viewCaption;
  50180. return showCaption( viewCaption, viewWriter );
  50181. }
  50182. } else {
  50183. this._lastSelectedCaption = viewCaption;
  50184. return showCaption( viewCaption, viewWriter );
  50185. }
  50186. } else {
  50187. // Was any caption selected before?
  50188. if ( lastCaption ) {
  50189. const viewModified = hideCaptionIfEmpty( lastCaption, viewWriter );
  50190. this._lastSelectedCaption = null;
  50191. return viewModified;
  50192. } else {
  50193. return false;
  50194. }
  50195. }
  50196. }
  50197. /**
  50198. * Returns a converter that fixes caption visibility during the model-to-view conversion.
  50199. * Checks if the changed node is placed inside the caption element and fixes its visibility in the view.
  50200. *
  50201. * @private
  50202. * @param {Function} nodeFinder
  50203. * @returns {Function}
  50204. */
  50205. _fixCaptionVisibility( nodeFinder ) {
  50206. return ( evt, data, conversionApi ) => {
  50207. const node = nodeFinder( data );
  50208. const modelCaption = getParentCaption( node );
  50209. const mapper = this.editor.editing.mapper;
  50210. const viewWriter = conversionApi.writer;
  50211. if ( modelCaption ) {
  50212. const viewCaption = mapper.toViewElement( modelCaption );
  50213. if ( viewCaption ) {
  50214. if ( modelCaption.childCount ) {
  50215. viewWriter.removeClass( 'ck-hidden', viewCaption );
  50216. } else {
  50217. viewWriter.addClass( 'ck-hidden', viewCaption );
  50218. }
  50219. }
  50220. }
  50221. };
  50222. }
  50223. /**
  50224. * Checks whether the data inserted to the model document have an image element that has no caption element inside it.
  50225. * If there is none, it adds it to the image element.
  50226. *
  50227. * @private
  50228. * @param {module:engine/model/writer~Writer} writer The writer to make changes with.
  50229. * @returns {Boolean} `true` if any change was applied, `false` otherwise.
  50230. */
  50231. _insertMissingModelCaptionElement( writer ) {
  50232. const model = this.editor.model;
  50233. const changes = model.document.differ.getChanges();
  50234. const imagesWithoutCaption = [];
  50235. for ( const entry of changes ) {
  50236. if ( entry.type == 'insert' && entry.name != '$text' ) {
  50237. const item = entry.position.nodeAfter;
  50238. if ( item.is( 'element', 'image' ) && !Object(_utils__WEBPACK_IMPORTED_MODULE_2__["getCaptionFromImage"])( item ) ) {
  50239. imagesWithoutCaption.push( item );
  50240. }
  50241. // Check elements with children for nested images.
  50242. if ( !item.is( 'element', 'image' ) && item.childCount ) {
  50243. for ( const nestedItem of model.createRangeIn( item ).getItems() ) {
  50244. if ( nestedItem.is( 'element', 'image' ) && !Object(_utils__WEBPACK_IMPORTED_MODULE_2__["getCaptionFromImage"])( nestedItem ) ) {
  50245. imagesWithoutCaption.push( nestedItem );
  50246. }
  50247. }
  50248. }
  50249. }
  50250. }
  50251. for ( const image of imagesWithoutCaption ) {
  50252. writer.appendElement( 'caption', image );
  50253. }
  50254. return !!imagesWithoutCaption.length;
  50255. }
  50256. }
  50257. // Creates a converter that converts image caption model element to view element.
  50258. //
  50259. // @private
  50260. // @param {Function} elementCreator
  50261. // @param {Boolean} [hide=true] When set to `false` view element will not be inserted when it's empty.
  50262. // @returns {Function}
  50263. function captionModelToView( elementCreator, hide = true ) {
  50264. return ( evt, data, conversionApi ) => {
  50265. const captionElement = data.item;
  50266. // Return if element shouldn't be present when empty.
  50267. if ( !captionElement.childCount && !hide ) {
  50268. return;
  50269. }
  50270. if ( Object(_image_utils__WEBPACK_IMPORTED_MODULE_1__["isImage"])( captionElement.parent ) ) {
  50271. if ( !conversionApi.consumable.consume( data.item, 'insert' ) ) {
  50272. return;
  50273. }
  50274. const viewImage = conversionApi.mapper.toViewElement( data.range.start.parent );
  50275. const viewCaption = elementCreator( conversionApi.writer );
  50276. const viewWriter = conversionApi.writer;
  50277. // Hide if empty.
  50278. if ( !captionElement.childCount ) {
  50279. viewWriter.addClass( 'ck-hidden', viewCaption );
  50280. }
  50281. insertViewCaptionAndBind( viewCaption, data.item, viewImage, conversionApi );
  50282. }
  50283. };
  50284. }
  50285. // Inserts `viewCaption` at the end of `viewImage` and binds it to `modelCaption`.
  50286. //
  50287. // @private
  50288. // @param {module:engine/view/containerelement~ContainerElement} viewCaption
  50289. // @param {module:engine/model/element~Element} modelCaption
  50290. // @param {module:engine/view/containerelement~ContainerElement} viewImage
  50291. // @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
  50292. function insertViewCaptionAndBind( viewCaption, modelCaption, viewImage, conversionApi ) {
  50293. const viewPosition = conversionApi.writer.createPositionAt( viewImage, 'end' );
  50294. conversionApi.writer.insert( viewPosition, viewCaption );
  50295. conversionApi.mapper.bindElements( modelCaption, viewCaption );
  50296. }
  50297. // Checks if the provided node or one of its ancestors is a caption element, and returns it.
  50298. //
  50299. // @private
  50300. // @param {module:engine/model/node~Node} node
  50301. // @returns {module:engine/model/element~Element|null}
  50302. function getParentCaption( node ) {
  50303. const ancestors = node.getAncestors( { includeSelf: true } );
  50304. const caption = ancestors.find( ancestor => ancestor.name == 'caption' );
  50305. if ( caption && caption.parent && caption.parent.name == 'image' ) {
  50306. return caption;
  50307. }
  50308. return null;
  50309. }
  50310. // Hides a given caption in the view if it is empty.
  50311. //
  50312. // @private
  50313. // @param {module:engine/view/containerelement~ContainerElement} caption
  50314. // @param {module:engine/view/downcastwriter~DowncastWriter} viewWriter
  50315. // @returns {Boolean} Returns `true` if the view was modified.
  50316. function hideCaptionIfEmpty( caption, viewWriter ) {
  50317. if ( !caption.childCount && !caption.hasClass( 'ck-hidden' ) ) {
  50318. viewWriter.addClass( 'ck-hidden', caption );
  50319. return true;
  50320. }
  50321. return false;
  50322. }
  50323. // Shows the caption.
  50324. //
  50325. // @private
  50326. // @param {module:engine/view/containerelement~ContainerElement} caption
  50327. // @param {module:engine/view/downcastwriter~DowncastWriter} viewWriter
  50328. // @returns {Boolean} Returns `true` if the view was modified.
  50329. function showCaption( caption, viewWriter ) {
  50330. if ( caption.hasClass( 'ck-hidden' ) ) {
  50331. viewWriter.removeClass( 'ck-hidden', caption );
  50332. return true;
  50333. }
  50334. return false;
  50335. }
  50336. /***/ }),
  50337. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/utils.js":
  50338. /*!**************************************************************************!*\
  50339. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/utils.js ***!
  50340. \**************************************************************************/
  50341. /*! exports provided: captionElementCreator, isCaption, getCaptionFromImage, matchImageCaption */
  50342. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  50343. "use strict";
  50344. __webpack_require__.r(__webpack_exports__);
  50345. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "captionElementCreator", function() { return captionElementCreator; });
  50346. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isCaption", function() { return isCaption; });
  50347. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCaptionFromImage", function() { return getCaptionFromImage; });
  50348. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matchImageCaption", function() { return matchImageCaption; });
  50349. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_placeholder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/placeholder */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/placeholder.js");
  50350. /* harmony import */ var _ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-widget/src/utils */ "./node_modules/@ckeditor/ckeditor5-widget/src/utils.js");
  50351. /**
  50352. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  50353. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  50354. */
  50355. /**
  50356. * @module image/imagecaption/utils
  50357. */
  50358. /**
  50359. * Returns a function that creates a caption editable element for the given {@link module:engine/view/document~Document}.
  50360. *
  50361. * @param {module:engine/view/view~View} view
  50362. * @param {String} placeholderText The text to be displayed when the caption is empty.
  50363. * @returns {Function}
  50364. */
  50365. function captionElementCreator( view, placeholderText ) {
  50366. return writer => {
  50367. const editable = writer.createEditableElement( 'figcaption' );
  50368. writer.setCustomProperty( 'imageCaption', true, editable );
  50369. Object(_ckeditor_ckeditor5_engine_src_view_placeholder__WEBPACK_IMPORTED_MODULE_0__["enablePlaceholder"])( {
  50370. view,
  50371. element: editable,
  50372. text: placeholderText
  50373. } );
  50374. return Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_1__["toWidgetEditable"])( editable, writer );
  50375. };
  50376. }
  50377. /**
  50378. * Returns `true` if a given view element is the image caption editable.
  50379. *
  50380. * @param {module:engine/view/element~Element} viewElement
  50381. * @returns {Boolean}
  50382. */
  50383. function isCaption( viewElement ) {
  50384. return !!viewElement.getCustomProperty( 'imageCaption' );
  50385. }
  50386. /**
  50387. * Returns the caption model element from a given image element. Returns `null` if no caption is found.
  50388. *
  50389. * @param {module:engine/model/element~Element} imageModelElement
  50390. * @returns {module:engine/model/element~Element|null}
  50391. */
  50392. function getCaptionFromImage( imageModelElement ) {
  50393. for ( const node of imageModelElement.getChildren() ) {
  50394. if ( !!node && node.is( 'element', 'caption' ) ) {
  50395. return node;
  50396. }
  50397. }
  50398. return null;
  50399. }
  50400. /**
  50401. * {@link module:engine/view/matcher~Matcher} pattern. Checks if a given element is a `<figcaption>` element that is placed
  50402. * inside the image `<figure>` element.
  50403. *
  50404. * @param {module:engine/view/element~Element} element
  50405. * @returns {Object|null} Returns the object accepted by {@link module:engine/view/matcher~Matcher} or `null` if the element
  50406. * cannot be matched.
  50407. */
  50408. function matchImageCaption( element ) {
  50409. const parent = element.parent;
  50410. // Convert only captions for images.
  50411. if ( element.name == 'figcaption' && parent && parent.name == 'figure' && parent.hasClass( 'image' ) ) {
  50412. return { name: true };
  50413. }
  50414. return null;
  50415. }
  50416. /***/ }),
  50417. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize.js":
  50418. /*!*******************************************************************!*\
  50419. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageresize.js ***!
  50420. \*******************************************************************/
  50421. /*! exports provided: default */
  50422. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  50423. "use strict";
  50424. __webpack_require__.r(__webpack_exports__);
  50425. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageResize; });
  50426. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  50427. /* harmony import */ var _imageresize_imageresizebuttons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./imageresize/imageresizebuttons */ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizebuttons.js");
  50428. /* harmony import */ var _imageresize_imageresizeediting__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./imageresize/imageresizeediting */ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizeediting.js");
  50429. /* harmony import */ var _imageresize_imageresizehandles__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./imageresize/imageresizehandles */ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizehandles.js");
  50430. /* harmony import */ var _theme_imageresize_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../theme/imageresize.css */ "./node_modules/@ckeditor/ckeditor5-image/theme/imageresize.css");
  50431. /* harmony import */ var _theme_imageresize_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_theme_imageresize_css__WEBPACK_IMPORTED_MODULE_4__);
  50432. /**
  50433. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  50434. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  50435. */
  50436. /**
  50437. * @module image/imageresize
  50438. */
  50439. /**
  50440. * The image resize plugin.
  50441. *
  50442. * It adds a possibility to resize each image using handles.
  50443. *
  50444. * @extends module:core/plugin~Plugin
  50445. */
  50446. class ImageResize extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  50447. /**
  50448. * @inheritDoc
  50449. */
  50450. static get requires() {
  50451. return [ _imageresize_imageresizeediting__WEBPACK_IMPORTED_MODULE_2__["default"], _imageresize_imageresizehandles__WEBPACK_IMPORTED_MODULE_3__["default"], _imageresize_imageresizebuttons__WEBPACK_IMPORTED_MODULE_1__["default"] ];
  50452. }
  50453. /**
  50454. * @inheritDoc
  50455. */
  50456. static get pluginName() {
  50457. return 'ImageResize';
  50458. }
  50459. }
  50460. /**
  50461. * The available options are `'px'` or `'%'`.
  50462. *
  50463. * Determines the size unit applied to the resized image.
  50464. *
  50465. * ClassicEditor
  50466. * .create( editorElement, {
  50467. * image: {
  50468. * resizeUnit: 'px'
  50469. * }
  50470. * } )
  50471. * .then( ... )
  50472. * .catch( ... );
  50473. *
  50474. *
  50475. * This option is used by the {@link module:image/imageresize~ImageResize} feature.
  50476. *
  50477. * @default '%'
  50478. * @member {String} module:image/image~ImageConfig#resizeUnit
  50479. */
  50480. /**
  50481. * The image resize options.
  50482. *
  50483. * Each option should have at least these two properties:
  50484. *
  50485. * * name: The name of the UI component registered in the global
  50486. * {@link module:core/editor/editorui~EditorUI#componentFactory component factory} of the editor,
  50487. * representing the button a user can click to change the size of an image,
  50488. * * value: An actual image width applied when a user clicks the mentioned button
  50489. * ({@link module:image/imageresize/imageresizecommand~ImageResizeCommand} gets executed).
  50490. * The value property is combined with the {@link module:image/image~ImageConfig#resizeUnit `config.image.resizeUnit`} (`%` by default).
  50491. * For instance: `value: '50'` and `resizeUnit: '%'` will render as `'50%'` in the UI.
  50492. *
  50493. * **Resetting the image size**
  50494. *
  50495. * If you want to set an option that will reset image to its original size, you need to pass a `null` value
  50496. * to one of the options. The `:original` token is not mandatory, you can call it anything you wish, but it must reflect
  50497. * in the standalone buttons configuration for the image toolbar.
  50498. *
  50499. * ClassicEditor
  50500. * .create( editorElement, {
  50501. * image: {
  50502. * resizeUnit: "%",
  50503. * resizeOptions: [ {
  50504. * name: 'imageResize:original',
  50505. * value: null
  50506. * },
  50507. * {
  50508. * name: 'imageResize:50',
  50509. * value: '50'
  50510. * },
  50511. * {
  50512. * name: 'imageResize:75',
  50513. * value: '75'
  50514. * } ]
  50515. * }
  50516. * } )
  50517. * .then( ... )
  50518. * .catch( ... );
  50519. *
  50520. * **Resizing images using a dropdown**
  50521. *
  50522. * With resize options defined, you can decide whether you want to display them as a dropdown or as standalone buttons.
  50523. * For the dropdown, you need to pass only the `imageResize` token to the
  50524. {@link module:image/image~ImageConfig#toolbar `config.image.toolbar`}. The dropdown contains all defined options by default:
  50525. *
  50526. * ClassicEditor
  50527. * .create( editorElement, {
  50528. * image: {
  50529. * resizeUnit: "%",
  50530. * resizeOptions: [ {
  50531. * name: 'imageResize:original',
  50532. * value: null
  50533. * },
  50534. * {
  50535. * name: 'imageResize:50',
  50536. * value: '50'
  50537. * },
  50538. * {
  50539. * name: 'imageResize:75',
  50540. * value: '75'
  50541. * } ],
  50542. * toolbar: [ 'imageResize', ... ],
  50543. * }
  50544. * } )
  50545. * .then( ... )
  50546. * .catch( ... );
  50547. *
  50548. * **Resizing images using individual buttons**
  50549. *
  50550. * If you want to have separate buttons for {@link module:image/imageresize/imageresizebuttons~ImageResizeOption each option},
  50551. * pass their names to the {@link module:image/image~ImageConfig#toolbar `config.image.toolbar`} instead. Please keep in mind
  50552. * that this time **you must define the additional
  50553. * {@link module:image/imageresize/imageresizebuttons~ImageResizeOption `icon` property}**:
  50554. *
  50555. * ClassicEditor
  50556. * .create( editorElement, {
  50557. * image: {
  50558. * resizeUnit: "%",
  50559. * resizeOptions: [ {
  50560. * name: 'imageResize:original',
  50561. * value: null,
  50562. * icon: 'original'
  50563. * },
  50564. * {
  50565. * name: 'imageResize:25',
  50566. * value: '25',
  50567. * icon: 'small'
  50568. * },
  50569. * {
  50570. * name: 'imageResize:50',
  50571. * value: '50',
  50572. * icon: 'medium'
  50573. * },
  50574. * {
  50575. * name: 'imageResize:75',
  50576. * value: '75',
  50577. * icon: 'large'
  50578. * } ],
  50579. * toolbar: [ 'imageResize:25', 'imageResize:50', 'imageResize:75', 'imageResize:original', ... ],
  50580. * }
  50581. * } )
  50582. * .then( ... )
  50583. * .catch( ... );
  50584. *
  50585. * **Customizing resize button labels**
  50586. *
  50587. * You can set your own label for each resize button. To do that, add the `label` property like in the example below.
  50588. *
  50589. * * When using the **dropdown**, the labels are displayed on the list of all options when you open the dropdown.
  50590. * * When using **standalone buttons**, the labels will are displayed as tooltips when a user hovers over the button.
  50591. *
  50592. * ClassicEditor
  50593. * .create( editorElement, {
  50594. * image: {
  50595. * resizeUnit: "%",
  50596. * resizeOptions: [ {
  50597. * name: 'imageResize:original',
  50598. * value: null,
  50599. * label: 'Original size'
  50600. * // Note: add the "icon" property if you're configuring a standalone button.
  50601. * },
  50602. * {
  50603. * name: 'imageResize:50',
  50604. * value: '50',
  50605. * label: 'Medium size'
  50606. * // Note: add the "icon" property if you're configuring a standalone button.
  50607. * },
  50608. * {
  50609. * name: 'imageResize:75',
  50610. * value: '75',
  50611. * label: 'Large size'
  50612. * // Note: add the "icon" property if you're configuring a standalone button.
  50613. * } ]
  50614. * }
  50615. * } )
  50616. * .then( ... )
  50617. * .catch( ... );
  50618. *
  50619. * **Default value**
  50620. *
  50621. * The following configuration is used by default:
  50622. *
  50623. * resizeOptions = [
  50624. * {
  50625. * name: 'imageResize:original',
  50626. * value: null,
  50627. * icon: 'original'
  50628. * },
  50629. * {
  50630. * name: 'imageResize:25',
  50631. * value: '25',
  50632. * icon: 'small'
  50633. * },
  50634. * {
  50635. * name: 'imageResize:50',
  50636. * value: '50',
  50637. * icon: 'medium'
  50638. * },
  50639. * {
  50640. * name: 'imageResize:75',
  50641. * value: '75',
  50642. * icon: 'large'
  50643. * }
  50644. * ];
  50645. *
  50646. * @member {Array.<module:image/imageresize/imageresizebuttons~ImageResizeOption>} module:image/image~ImageConfig#resizeOptions
  50647. */
  50648. /***/ }),
  50649. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizebuttons.js":
  50650. /*!**************************************************************************************!*\
  50651. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizebuttons.js ***!
  50652. \**************************************************************************************/
  50653. /*! exports provided: default */
  50654. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  50655. "use strict";
  50656. __webpack_require__.r(__webpack_exports__);
  50657. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageResizeButtons; });
  50658. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  50659. /* harmony import */ var _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  50660. /* harmony import */ var _imageresizeediting__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./imageresizeediting */ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizeediting.js");
  50661. /* harmony import */ var _ckeditor_ckeditor5_ui_src_dropdown_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/dropdown/utils */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/utils.js");
  50662. /* harmony import */ var _ckeditor_ckeditor5_ui_src_dropdown_button_dropdownbuttonview__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/dropdown/button/dropdownbuttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/dropdownbuttonview.js");
  50663. /* harmony import */ var _ckeditor_ckeditor5_ui_src_model__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/model */ "./node_modules/@ckeditor/ckeditor5-ui/src/model.js");
  50664. /* harmony import */ var _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/collection */ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js");
  50665. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  50666. /* harmony import */ var _ckeditor_ckeditor5_core_theme_icons_object_size_small_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/theme/icons/object-size-small.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-small.svg");
  50667. /* harmony import */ var _ckeditor_ckeditor5_core_theme_icons_object_size_medium_svg__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/theme/icons/object-size-medium.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-medium.svg");
  50668. /* harmony import */ var _ckeditor_ckeditor5_core_theme_icons_object_size_large_svg__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/theme/icons/object-size-large.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-large.svg");
  50669. /* harmony import */ var _ckeditor_ckeditor5_core_theme_icons_object_size_full_svg__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/theme/icons/object-size-full.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-full.svg");
  50670. /**
  50671. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  50672. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  50673. */
  50674. /**
  50675. * @module image/imageresize/imageresizebuttons
  50676. */
  50677. const RESIZE_ICONS = {
  50678. small: _ckeditor_ckeditor5_core_theme_icons_object_size_small_svg__WEBPACK_IMPORTED_MODULE_8__["default"],
  50679. medium: _ckeditor_ckeditor5_core_theme_icons_object_size_medium_svg__WEBPACK_IMPORTED_MODULE_9__["default"],
  50680. large: _ckeditor_ckeditor5_core_theme_icons_object_size_large_svg__WEBPACK_IMPORTED_MODULE_10__["default"],
  50681. original: _ckeditor_ckeditor5_core_theme_icons_object_size_full_svg__WEBPACK_IMPORTED_MODULE_11__["default"]
  50682. };
  50683. /**
  50684. * The image resize buttons plugin.
  50685. *
  50686. * It adds a possibility to resize images using the toolbar dropdown or individual buttons, depending on the plugin configuration.
  50687. *
  50688. * @extends module:core/plugin~Plugin
  50689. */
  50690. class ImageResizeButtons extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  50691. /**
  50692. * @inheritDoc
  50693. */
  50694. static get requires() {
  50695. return [ _imageresizeediting__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  50696. }
  50697. /**
  50698. * @inheritDoc
  50699. */
  50700. static get pluginName() {
  50701. return 'ImageResizeButtons';
  50702. }
  50703. /**
  50704. * @inheritDoc
  50705. */
  50706. constructor( editor ) {
  50707. super( editor );
  50708. /**
  50709. * The resize unit.
  50710. *
  50711. * @readonly
  50712. * @private
  50713. * @type {module:image/image~ImageConfig#resizeUnit}
  50714. * @default '%'
  50715. */
  50716. this._resizeUnit = editor.config.get( 'image.resizeUnit' );
  50717. }
  50718. /**
  50719. * @inheritDoc
  50720. */
  50721. init() {
  50722. const editor = this.editor;
  50723. const options = editor.config.get( 'image.resizeOptions' );
  50724. const command = editor.commands.get( 'imageResize' );
  50725. this.bind( 'isEnabled' ).to( command );
  50726. for ( const option of options ) {
  50727. this._registerImageResizeButton( option );
  50728. }
  50729. this._registerImageResizeDropdown( options );
  50730. }
  50731. /**
  50732. * A helper function that creates a standalone button component for the plugin.
  50733. *
  50734. * @private
  50735. * @param {module:image/imageresize/imageresizebuttons~ImageResizeOption} resizeOption A model of the resize option.
  50736. */
  50737. _registerImageResizeButton( option ) {
  50738. const editor = this.editor;
  50739. const { name, value, icon } = option;
  50740. const optionValueWithUnit = value ? value + this._resizeUnit : null;
  50741. editor.ui.componentFactory.add( name, locale => {
  50742. const button = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__["default"]( locale );
  50743. const command = editor.commands.get( 'imageResize' );
  50744. const labelText = this._getOptionLabelValue( option, true );
  50745. if ( !RESIZE_ICONS[ icon ] ) {
  50746. /**
  50747. * When configuring {@link module:image/image~ImageConfig#resizeOptions `config.image.resizeOptions`} for standalone
  50748. * buttons, a valid `icon` token must be set for each option.
  50749. *
  50750. * See all valid options described in the
  50751. * {@link module:image/imageresize/imageresizebuttons~ImageResizeOption plugin configuration}.
  50752. *
  50753. * @error imageresizebuttons-missing-icon
  50754. * @param {module:image/imageresize/imageresizebuttons~ImageResizeOption} option Invalid image resize option.
  50755. */
  50756. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_7__["default"](
  50757. 'imageresizebuttons-missing-icon',
  50758. editor,
  50759. option
  50760. );
  50761. }
  50762. button.set( {
  50763. // Use the `label` property for a verbose description (because of ARIA).
  50764. label: labelText,
  50765. icon: RESIZE_ICONS[ icon ],
  50766. tooltip: labelText,
  50767. isToggleable: true
  50768. } );
  50769. // Bind button to the command.
  50770. button.bind( 'isEnabled' ).to( this );
  50771. button.bind( 'isOn' ).to( command, 'value', getIsOnButtonCallback( optionValueWithUnit ) );
  50772. this.listenTo( button, 'execute', () => {
  50773. editor.execute( 'imageResize', { width: optionValueWithUnit } );
  50774. } );
  50775. return button;
  50776. } );
  50777. }
  50778. /**
  50779. * A helper function that creates a dropdown component for the plugin containing all the resize options defined in
  50780. * the editor configuration.
  50781. *
  50782. * @private
  50783. * @param {Array.<module:image/imageresize/imageresizebuttons~ImageResizeOption>} options An array of configured options.
  50784. */
  50785. _registerImageResizeDropdown( options ) {
  50786. const editor = this.editor;
  50787. const t = editor.t;
  50788. const originalSizeOption = options.find( option => !option.value );
  50789. // Register dropdown.
  50790. editor.ui.componentFactory.add( 'imageResize', locale => {
  50791. const command = editor.commands.get( 'imageResize' );
  50792. const dropdownView = Object(_ckeditor_ckeditor5_ui_src_dropdown_utils__WEBPACK_IMPORTED_MODULE_3__["createDropdown"])( locale, _ckeditor_ckeditor5_ui_src_dropdown_button_dropdownbuttonview__WEBPACK_IMPORTED_MODULE_4__["default"] );
  50793. const dropdownButton = dropdownView.buttonView;
  50794. dropdownButton.set( {
  50795. tooltip: t( 'Resize image' ),
  50796. commandValue: originalSizeOption.value,
  50797. icon: _ckeditor_ckeditor5_core_theme_icons_object_size_medium_svg__WEBPACK_IMPORTED_MODULE_9__["default"],
  50798. isToggleable: true,
  50799. label: this._getOptionLabelValue( originalSizeOption ),
  50800. withText: true,
  50801. class: 'ck-resize-image-button'
  50802. } );
  50803. dropdownButton.bind( 'label' ).to( command, 'value', commandValue => {
  50804. if ( commandValue && commandValue.width ) {
  50805. return commandValue.width;
  50806. } else {
  50807. return this._getOptionLabelValue( originalSizeOption );
  50808. }
  50809. } );
  50810. dropdownView.bind( 'isOn' ).to( command );
  50811. dropdownView.bind( 'isEnabled' ).to( this );
  50812. Object(_ckeditor_ckeditor5_ui_src_dropdown_utils__WEBPACK_IMPORTED_MODULE_3__["addListToDropdown"])( dropdownView, this._getResizeDropdownListItemDefinitions( options, command ) );
  50813. dropdownView.listView.ariaLabel = t( 'Image resize list' );
  50814. // Execute command when an item from the dropdown is selected.
  50815. this.listenTo( dropdownView, 'execute', evt => {
  50816. editor.execute( evt.source.commandName, { width: evt.source.commandValue } );
  50817. editor.editing.view.focus();
  50818. } );
  50819. return dropdownView;
  50820. } );
  50821. }
  50822. /**
  50823. * A helper function for creating an option label value string.
  50824. *
  50825. * @private
  50826. * @param {module:image/imageresize/imageresizebuttons~ImageResizeOption} option A resize option object.
  50827. * @param {Boolean} [forTooltip] An optional flag for creating a tooltip label.
  50828. * @returns {String} A user-defined label combined from the numeric value and the resize unit or the default label
  50829. * for reset options (`Original`).
  50830. */
  50831. _getOptionLabelValue( option, forTooltip ) {
  50832. const t = this.editor.t;
  50833. if ( option.label ) {
  50834. return option.label;
  50835. } else if ( forTooltip ) {
  50836. if ( option.value ) {
  50837. return t( 'Resize image to %0', option.value + this._resizeUnit );
  50838. } else {
  50839. return t( 'Resize image to the original size' );
  50840. }
  50841. } else {
  50842. if ( option.value ) {
  50843. return option.value + this._resizeUnit;
  50844. } else {
  50845. return t( 'Original' );
  50846. }
  50847. }
  50848. }
  50849. /**
  50850. * A helper function that parses the resize options and returns list item definitions ready for use in the dropdown.
  50851. *
  50852. * @private
  50853. * @param {Array.<module:image/imageresize/imageresizebuttons~ImageResizeOption>} options The resize options.
  50854. * @param {module:image/imageresize/imageresizecommand~ImageResizeCommand} command The resize image command.
  50855. * @returns {Iterable.<module:ui/dropdown/utils~ListDropdownItemDefinition>} Dropdown item definitions.
  50856. */
  50857. _getResizeDropdownListItemDefinitions( options, command ) {
  50858. const itemDefinitions = new _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_6__["default"]();
  50859. options.map( option => {
  50860. const optionValueWithUnit = option.value ? option.value + this._resizeUnit : null;
  50861. const definition = {
  50862. type: 'button',
  50863. model: new _ckeditor_ckeditor5_ui_src_model__WEBPACK_IMPORTED_MODULE_5__["default"]( {
  50864. commandName: 'imageResize',
  50865. commandValue: optionValueWithUnit,
  50866. label: this._getOptionLabelValue( option ),
  50867. withText: true,
  50868. icon: null
  50869. } )
  50870. };
  50871. definition.model.bind( 'isOn' ).to( command, 'value', getIsOnButtonCallback( optionValueWithUnit ) );
  50872. itemDefinitions.add( definition );
  50873. } );
  50874. return itemDefinitions;
  50875. }
  50876. }
  50877. // A helper function for setting the `isOn` state of buttons in value bindings.
  50878. function getIsOnButtonCallback( value ) {
  50879. return commandValue => {
  50880. if ( value === null && commandValue === value ) {
  50881. return true;
  50882. }
  50883. return commandValue && commandValue.width === value;
  50884. };
  50885. }
  50886. /**
  50887. * The image resize option used in the {@link module:image/image~ImageConfig#resizeOptions image resize configuration}.
  50888. *
  50889. * @typedef {Object} module:image/imageresize/imageresizebuttons~ImageResizeOption
  50890. * @property {String} name The name of the UI component that changes the image size.
  50891. * * If you configure the feature using individual resize buttons, you can refer to this name in the
  50892. * {@link module:image/image~ImageConfig#toolbar image toolbar configuration}.
  50893. * * If you configure the feature using the resize dropdown, this name will be used for a list item in the dropdown.
  50894. * @property {String} value The value of the resize option without the unit
  50895. * ({@link module:image/image~ImageConfig#resizeUnit configured separately}). `null` resets an image to its original size.
  50896. * @property {String} [resizeOptions.icon] An icon used by an individual resize button (see the `name` property to learn more).
  50897. * Available icons are: `'small'`, `'medium'`, `'large'`, `'original'`.
  50898. * @property {String} [label] An option label displayed in the dropdown or, if the feature is configured using
  50899. * individual buttons, a {@link module:ui/button/buttonview~ButtonView#tooltip} and an ARIA attribute of a button.
  50900. * If not specified, the label is generated automatically based on the `value` option and the
  50901. * {@link module:image/image~ImageConfig#resizeUnit `config.image.resizeUnit`}.
  50902. */
  50903. /***/ }),
  50904. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizecommand.js":
  50905. /*!**************************************************************************************!*\
  50906. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizecommand.js ***!
  50907. \**************************************************************************************/
  50908. /*! exports provided: default */
  50909. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  50910. "use strict";
  50911. __webpack_require__.r(__webpack_exports__);
  50912. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageResizeCommand; });
  50913. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  50914. /* harmony import */ var _image_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../image/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
  50915. /**
  50916. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  50917. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  50918. */
  50919. /**
  50920. * @module image/imageresize/imageresizecommand
  50921. */
  50922. /**
  50923. * The image resize command. Currently, it only supports the width attribute.
  50924. *
  50925. * @extends module:core/command~Command
  50926. */
  50927. class ImageResizeCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  50928. /**
  50929. * @inheritDoc
  50930. */
  50931. refresh() {
  50932. const element = this.editor.model.document.selection.getSelectedElement();
  50933. this.isEnabled = Object(_image_utils__WEBPACK_IMPORTED_MODULE_1__["isImage"])( element );
  50934. if ( !element || !element.hasAttribute( 'width' ) ) {
  50935. this.value = null;
  50936. } else {
  50937. this.value = {
  50938. width: element.getAttribute( 'width' ),
  50939. height: null
  50940. };
  50941. }
  50942. }
  50943. /**
  50944. * Executes the command.
  50945. *
  50946. * // Sets the width to 50%:
  50947. * editor.execute( 'imageResize', { width: '50%' } );
  50948. *
  50949. * // Removes the width attribute:
  50950. * editor.execute( 'imageResize', { width: null } );
  50951. *
  50952. * @param {Object} options
  50953. * @param {String|null} options.width The new width of the image.
  50954. * @fires execute
  50955. */
  50956. execute( options ) {
  50957. const model = this.editor.model;
  50958. const imageElement = model.document.selection.getSelectedElement();
  50959. this.value = {
  50960. width: options.width,
  50961. height: null
  50962. };
  50963. if ( imageElement ) {
  50964. model.change( writer => {
  50965. writer.setAttribute( 'width', options.width, imageElement );
  50966. } );
  50967. }
  50968. }
  50969. }
  50970. /***/ }),
  50971. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizeediting.js":
  50972. /*!**************************************************************************************!*\
  50973. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizeediting.js ***!
  50974. \**************************************************************************************/
  50975. /*! exports provided: default */
  50976. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  50977. "use strict";
  50978. __webpack_require__.r(__webpack_exports__);
  50979. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageResizeEditing; });
  50980. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  50981. /* harmony import */ var _imageresizecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./imageresizecommand */ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizecommand.js");
  50982. /**
  50983. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  50984. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  50985. */
  50986. /**
  50987. * @module image/imageresize/imageresizeediting
  50988. */
  50989. /**
  50990. * The image resize editing feature.
  50991. *
  50992. * It adds the ability to resize each image using handles or manually by
  50993. * {@link module:image/imageresize/imageresizebuttons~ImageResizeButtons} buttons.
  50994. *
  50995. * @extends module:core/plugin~Plugin
  50996. */
  50997. class ImageResizeEditing extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  50998. /**
  50999. * @inheritDoc
  51000. */
  51001. static get pluginName() {
  51002. return 'ImageResizeEditing';
  51003. }
  51004. /**
  51005. * @inheritDoc
  51006. */
  51007. constructor( editor ) {
  51008. super( editor );
  51009. editor.config.define( 'image', {
  51010. resizeUnit: '%',
  51011. resizeOptions: [ {
  51012. name: 'imageResize:original',
  51013. value: null,
  51014. icon: 'original'
  51015. },
  51016. {
  51017. name: 'imageResize:25',
  51018. value: '25',
  51019. icon: 'small'
  51020. },
  51021. {
  51022. name: 'imageResize:50',
  51023. value: '50',
  51024. icon: 'medium'
  51025. },
  51026. {
  51027. name: 'imageResize:75',
  51028. value: '75',
  51029. icon: 'large'
  51030. } ]
  51031. } );
  51032. }
  51033. /**
  51034. * @inheritDoc
  51035. */
  51036. init() {
  51037. const editor = this.editor;
  51038. const command = new _imageresizecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor );
  51039. this._registerSchema();
  51040. this._registerConverters();
  51041. editor.commands.add( 'imageResize', command );
  51042. }
  51043. /**
  51044. * @private
  51045. */
  51046. _registerSchema() {
  51047. this.editor.model.schema.extend( 'image', { allowAttributes: 'width' } );
  51048. this.editor.model.schema.setAttributeProperties( 'width', {
  51049. isFormatting: true
  51050. } );
  51051. }
  51052. /**
  51053. * Registers image resize converters.
  51054. *
  51055. * @private
  51056. */
  51057. _registerConverters() {
  51058. const editor = this.editor;
  51059. // Dedicated converter to propagate image's attribute to the img tag.
  51060. editor.conversion.for( 'downcast' ).add( dispatcher =>
  51061. dispatcher.on( 'attribute:width:image', ( evt, data, conversionApi ) => {
  51062. if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
  51063. return;
  51064. }
  51065. const viewWriter = conversionApi.writer;
  51066. const figure = conversionApi.mapper.toViewElement( data.item );
  51067. if ( data.attributeNewValue !== null ) {
  51068. viewWriter.setStyle( 'width', data.attributeNewValue, figure );
  51069. viewWriter.addClass( 'image_resized', figure );
  51070. } else {
  51071. viewWriter.removeStyle( 'width', figure );
  51072. viewWriter.removeClass( 'image_resized', figure );
  51073. }
  51074. } )
  51075. );
  51076. editor.conversion.for( 'upcast' )
  51077. .attributeToAttribute( {
  51078. view: {
  51079. name: 'figure',
  51080. styles: {
  51081. width: /.+/
  51082. }
  51083. },
  51084. model: {
  51085. key: 'width',
  51086. value: viewElement => viewElement.getStyle( 'width' )
  51087. }
  51088. } );
  51089. }
  51090. }
  51091. /***/ }),
  51092. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizehandles.js":
  51093. /*!**************************************************************************************!*\
  51094. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizehandles.js ***!
  51095. \**************************************************************************************/
  51096. /*! exports provided: default */
  51097. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51098. "use strict";
  51099. __webpack_require__.r(__webpack_exports__);
  51100. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageResizeHandles; });
  51101. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  51102. /* harmony import */ var _ckeditor_ckeditor5_widget_src_widgetresize__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-widget/src/widgetresize */ "./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize.js");
  51103. /**
  51104. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  51105. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  51106. */
  51107. /**
  51108. * @module image/imageresize/imageresizehandles
  51109. */
  51110. /**
  51111. * The image resize by handles feature.
  51112. *
  51113. * It adds the ability to resize each image using handles or manually by
  51114. * {@link module:image/imageresize/imageresizebuttons~ImageResizeButtons} buttons.
  51115. *
  51116. * @extends module:core/plugin~Plugin
  51117. */
  51118. class ImageResizeHandles extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  51119. /**
  51120. * @inheritDoc
  51121. */
  51122. static get requires() {
  51123. return [ _ckeditor_ckeditor5_widget_src_widgetresize__WEBPACK_IMPORTED_MODULE_1__["default"] ];
  51124. }
  51125. /**
  51126. * @inheritDoc
  51127. */
  51128. static get pluginName() {
  51129. return 'ImageResizeHandles';
  51130. }
  51131. /**
  51132. * @inheritDoc
  51133. */
  51134. init() {
  51135. const editor = this.editor;
  51136. const command = editor.commands.get( 'imageResize' );
  51137. this.bind( 'isEnabled' ).to( command );
  51138. editor.editing.downcastDispatcher.on( 'insert:image', ( evt, data, conversionApi ) => {
  51139. const widget = conversionApi.mapper.toViewElement( data.item );
  51140. const resizer = editor.plugins
  51141. .get( _ckeditor_ckeditor5_widget_src_widgetresize__WEBPACK_IMPORTED_MODULE_1__["default"] )
  51142. .attachTo( {
  51143. unit: editor.config.get( 'image.resizeUnit' ),
  51144. modelElement: data.item,
  51145. viewElement: widget,
  51146. editor,
  51147. getHandleHost( domWidgetElement ) {
  51148. return domWidgetElement.querySelector( 'img' );
  51149. },
  51150. getResizeHost( domWidgetElement ) {
  51151. return domWidgetElement;
  51152. },
  51153. // TODO consider other positions.
  51154. isCentered() {
  51155. const imageStyle = data.item.getAttribute( 'imageStyle' );
  51156. return !imageStyle || imageStyle == 'full' || imageStyle == 'alignCenter';
  51157. },
  51158. onCommit( newValue ) {
  51159. editor.execute( 'imageResize', { width: newValue } );
  51160. }
  51161. } );
  51162. resizer.on( 'updateSize', () => {
  51163. if ( !widget.hasClass( 'image_resized' ) ) {
  51164. editor.editing.view.change( writer => {
  51165. writer.addClass( 'image_resized', widget );
  51166. } );
  51167. }
  51168. } );
  51169. resizer.bind( 'isEnabled' ).to( this );
  51170. }, { priority: 'low' } );
  51171. }
  51172. }
  51173. /***/ }),
  51174. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle.js":
  51175. /*!******************************************************************!*\
  51176. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagestyle.js ***!
  51177. \******************************************************************/
  51178. /*! exports provided: default */
  51179. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51180. "use strict";
  51181. __webpack_require__.r(__webpack_exports__);
  51182. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageStyle; });
  51183. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  51184. /* harmony import */ var _imagestyle_imagestyleediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./imagestyle/imagestyleediting */ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestyleediting.js");
  51185. /* harmony import */ var _imagestyle_imagestyleui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./imagestyle/imagestyleui */ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestyleui.js");
  51186. /**
  51187. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  51188. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  51189. */
  51190. /**
  51191. * @module image/imagestyle
  51192. */
  51193. /**
  51194. * The image style plugin.
  51195. *
  51196. * For a detailed overview, check the {@glink features/image#image-styles image styles} documentation.
  51197. *
  51198. * This is a "glue" plugin which loads the {@link module:image/imagestyle/imagestyleediting~ImageStyleEditing}
  51199. * and {@link module:image/imagestyle/imagestyleui~ImageStyleUI} plugins.
  51200. *
  51201. * @extends module:core/plugin~Plugin
  51202. */
  51203. class ImageStyle extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  51204. /**
  51205. * @inheritDoc
  51206. */
  51207. static get requires() {
  51208. return [ _imagestyle_imagestyleediting__WEBPACK_IMPORTED_MODULE_1__["default"], _imagestyle_imagestyleui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  51209. }
  51210. /**
  51211. * @inheritDoc
  51212. */
  51213. static get pluginName() {
  51214. return 'ImageStyle';
  51215. }
  51216. }
  51217. /**
  51218. * Available image styles.
  51219. *
  51220. * The default value is:
  51221. *
  51222. * const imageConfig = {
  51223. * styles: [ 'full', 'side' ]
  51224. * };
  51225. *
  51226. * which configures two default styles:
  51227. *
  51228. * * the "full" style which does not apply any class, e.g. for images styled to span 100% width of the content,
  51229. * * the "side" style with the `.image-style-side` CSS class.
  51230. *
  51231. * See {@link module:image/imagestyle/utils~defaultStyles} to learn more about default
  51232. * styles provided by the image feature.
  51233. *
  51234. * The {@link module:image/imagestyle/utils~defaultStyles default styles} can be customized,
  51235. * e.g. to change the icon, title or CSS class of the style. The feature also provides several
  51236. * {@link module:image/imagestyle/utils~defaultIcons default icons} to choose from.
  51237. *
  51238. * import customIcon from 'custom-icon.svg';
  51239. *
  51240. * // ...
  51241. *
  51242. * const imageConfig = {
  51243. * styles: [
  51244. * // This will only customize the icon of the "full" style.
  51245. * // Note: 'right' is one of default icons provided by the feature.
  51246. * { name: 'full', icon: 'right' },
  51247. *
  51248. * // This will customize the icon, title and CSS class of the default "side" style.
  51249. * { name: 'side', icon: customIcon, title: 'My side style', className: 'custom-side-image' }
  51250. * ]
  51251. * };
  51252. *
  51253. * If none of the default styles is good enough, it is possible to define independent custom styles, too:
  51254. *
  51255. * import fullSizeIcon from '@ckeditor/ckeditor5-core/theme/icons/object-center.svg';
  51256. * import sideIcon from '@ckeditor/ckeditor5-core/theme/icons/object-right.svg';
  51257. *
  51258. * // ...
  51259. *
  51260. * const imageConfig = {
  51261. * styles: [
  51262. * // A completely custom full size style with no class, used as a default.
  51263. * { name: 'fullSize', title: 'Full size', icon: fullSizeIcon, isDefault: true },
  51264. *
  51265. * { name: 'side', title: 'To the side', icon: sideIcon, className: 'side-image' }
  51266. * ]
  51267. * };
  51268. *
  51269. * Note: Setting `title` to one of {@link module:image/imagestyle/imagestyleui~ImageStyleUI#localizedDefaultStylesTitles}
  51270. * will automatically translate it to the language of the editor.
  51271. *
  51272. * Read more about styling images in the {@glink features/image#image-styles Image styles guide}.
  51273. *
  51274. * The feature creates commands based on defined styles, so you can change the style of a selected image by executing
  51275. * the following command:
  51276. *
  51277. * editor.execute( 'imageStyle' { value: 'side' } );
  51278. *
  51279. * The feature also creates buttons that execute the commands. So, assuming that you use the
  51280. * default image styles setting, you can {@link module:image/image~ImageConfig#toolbar configure the image toolbar}
  51281. * (or any other toolbar) to contain these options:
  51282. *
  51283. * const imageConfig = {
  51284. * toolbar: [ 'imageStyle:full', 'imageStyle:side' ]
  51285. * };
  51286. *
  51287. * @member {Array.<module:image/imagestyle/imagestyleediting~ImageStyleFormat>} module:image/image~ImageConfig#styles
  51288. */
  51289. /***/ }),
  51290. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/converters.js":
  51291. /*!*****************************************************************************!*\
  51292. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/converters.js ***!
  51293. \*****************************************************************************/
  51294. /*! exports provided: modelToViewStyleAttribute, viewToModelStyleAttribute */
  51295. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51296. "use strict";
  51297. __webpack_require__.r(__webpack_exports__);
  51298. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelToViewStyleAttribute", function() { return modelToViewStyleAttribute; });
  51299. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "viewToModelStyleAttribute", function() { return viewToModelStyleAttribute; });
  51300. /* harmony import */ var _ckeditor_ckeditor5_utils_src_first__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/first */ "./node_modules/@ckeditor/ckeditor5-utils/src/first.js");
  51301. /**
  51302. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  51303. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  51304. */
  51305. /**
  51306. * @module image/imagestyle/converters
  51307. */
  51308. /**
  51309. * Returns a converter for the `imageStyle` attribute. It can be used for adding, changing and removing the attribute.
  51310. *
  51311. * @param {Object} styles An object containing available styles. See {@link module:image/imagestyle/imagestyleediting~ImageStyleFormat}
  51312. * for more details.
  51313. * @returns {Function} A model-to-view attribute converter.
  51314. */
  51315. function modelToViewStyleAttribute( styles ) {
  51316. return ( evt, data, conversionApi ) => {
  51317. if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
  51318. return;
  51319. }
  51320. // Check if there is class name associated with given value.
  51321. const newStyle = getStyleByName( data.attributeNewValue, styles );
  51322. const oldStyle = getStyleByName( data.attributeOldValue, styles );
  51323. const viewElement = conversionApi.mapper.toViewElement( data.item );
  51324. const viewWriter = conversionApi.writer;
  51325. if ( oldStyle ) {
  51326. viewWriter.removeClass( oldStyle.className, viewElement );
  51327. }
  51328. if ( newStyle ) {
  51329. viewWriter.addClass( newStyle.className, viewElement );
  51330. }
  51331. };
  51332. }
  51333. /**
  51334. * Returns a view-to-model converter converting image CSS classes to a proper value in the model.
  51335. *
  51336. * @param {Array.<module:image/imagestyle/imagestyleediting~ImageStyleFormat>} styles The styles for which the converter is created.
  51337. * @returns {Function} A view-to-model converter.
  51338. */
  51339. function viewToModelStyleAttribute( styles ) {
  51340. // Convert only non–default styles.
  51341. const filteredStyles = styles.filter( style => !style.isDefault );
  51342. return ( evt, data, conversionApi ) => {
  51343. if ( !data.modelRange ) {
  51344. return;
  51345. }
  51346. const viewFigureElement = data.viewItem;
  51347. const modelImageElement = Object(_ckeditor_ckeditor5_utils_src_first__WEBPACK_IMPORTED_MODULE_0__["default"])( data.modelRange.getItems() );
  51348. // Check if `imageStyle` attribute is allowed for current element.
  51349. if ( !conversionApi.schema.checkAttribute( modelImageElement, 'imageStyle' ) ) {
  51350. return;
  51351. }
  51352. // Convert style one by one.
  51353. for ( const style of filteredStyles ) {
  51354. // Try to consume class corresponding with style.
  51355. if ( conversionApi.consumable.consume( viewFigureElement, { classes: style.className } ) ) {
  51356. // And convert this style to model attribute.
  51357. conversionApi.writer.setAttribute( 'imageStyle', style.name, modelImageElement );
  51358. }
  51359. }
  51360. };
  51361. }
  51362. // Returns the style with a given `name` from an array of styles.
  51363. //
  51364. // @param {String} name
  51365. // @param {Array.<module:image/imagestyle/imagestyleediting~ImageStyleFormat> } styles
  51366. // @returns {module:image/imagestyle/imagestyleediting~ImageStyleFormat|undefined}
  51367. function getStyleByName( name, styles ) {
  51368. for ( const style of styles ) {
  51369. if ( style.name === name ) {
  51370. return style;
  51371. }
  51372. }
  51373. }
  51374. /***/ }),
  51375. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestylecommand.js":
  51376. /*!************************************************************************************!*\
  51377. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestylecommand.js ***!
  51378. \************************************************************************************/
  51379. /*! exports provided: default */
  51380. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51381. "use strict";
  51382. __webpack_require__.r(__webpack_exports__);
  51383. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageStyleCommand; });
  51384. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  51385. /* harmony import */ var _image_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../image/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
  51386. /**
  51387. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  51388. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  51389. */
  51390. /**
  51391. * @module image/imagestyle/imagestylecommand
  51392. */
  51393. /**
  51394. * The image style command. It is used to apply different image styles.
  51395. *
  51396. * @extends module:core/command~Command
  51397. */
  51398. class ImageStyleCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  51399. /**
  51400. * Creates an instance of the image style command. Each command instance is handling one style.
  51401. *
  51402. * @param {module:core/editor/editor~Editor} editor The editor instance.
  51403. * @param {Array.<module:image/imagestyle/imagestyleediting~ImageStyleFormat>} styles The styles that this command supports.
  51404. */
  51405. constructor( editor, styles ) {
  51406. super( editor );
  51407. /**
  51408. * The name of the default style, if it is present. If there is no default style, it defaults to `false`.
  51409. *
  51410. * @readonly
  51411. * @type {Boolean|String}
  51412. */
  51413. this.defaultStyle = false;
  51414. /**
  51415. * A style handled by this command.
  51416. *
  51417. * @readonly
  51418. * @member {Array.<module:image/imagestyle/imagestyleediting~ImageStyleFormat>} #styles
  51419. */
  51420. this.styles = styles.reduce( ( styles, style ) => {
  51421. styles[ style.name ] = style;
  51422. if ( style.isDefault ) {
  51423. this.defaultStyle = style.name;
  51424. }
  51425. return styles;
  51426. }, {} );
  51427. }
  51428. /**
  51429. * @inheritDoc
  51430. */
  51431. refresh() {
  51432. const element = this.editor.model.document.selection.getSelectedElement();
  51433. this.isEnabled = Object(_image_utils__WEBPACK_IMPORTED_MODULE_1__["isImage"])( element );
  51434. if ( !element ) {
  51435. this.value = false;
  51436. } else if ( element.hasAttribute( 'imageStyle' ) ) {
  51437. const attributeValue = element.getAttribute( 'imageStyle' );
  51438. this.value = this.styles[ attributeValue ] ? attributeValue : false;
  51439. } else {
  51440. this.value = this.defaultStyle;
  51441. }
  51442. }
  51443. /**
  51444. * Executes the command.
  51445. *
  51446. * editor.execute( 'imageStyle', { value: 'side' } );
  51447. *
  51448. * @param {Object} options
  51449. * @param {String} options.value The name of the style (based on the
  51450. * {@link module:image/image~ImageConfig#styles `image.styles`} configuration option).
  51451. * @fires execute
  51452. */
  51453. execute( options ) {
  51454. const styleName = options.value;
  51455. const model = this.editor.model;
  51456. const imageElement = model.document.selection.getSelectedElement();
  51457. model.change( writer => {
  51458. // Default style means that there is no `imageStyle` attribute in the model.
  51459. // https://github.com/ckeditor/ckeditor5-image/issues/147
  51460. if ( this.styles[ styleName ].isDefault ) {
  51461. writer.removeAttribute( 'imageStyle', imageElement );
  51462. } else {
  51463. writer.setAttribute( 'imageStyle', styleName, imageElement );
  51464. }
  51465. } );
  51466. }
  51467. }
  51468. /***/ }),
  51469. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestyleediting.js":
  51470. /*!************************************************************************************!*\
  51471. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestyleediting.js ***!
  51472. \************************************************************************************/
  51473. /*! exports provided: default */
  51474. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51475. "use strict";
  51476. __webpack_require__.r(__webpack_exports__);
  51477. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageStyleEditing; });
  51478. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  51479. /* harmony import */ var _imagestylecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./imagestylecommand */ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestylecommand.js");
  51480. /* harmony import */ var _converters__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./converters */ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/converters.js");
  51481. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/utils.js");
  51482. /**
  51483. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  51484. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  51485. */
  51486. /**
  51487. * @module image/imagestyle/imagestyleediting
  51488. */
  51489. /**
  51490. * The image style engine plugin. It sets the default configuration, creates converters and registers
  51491. * {@link module:image/imagestyle/imagestylecommand~ImageStyleCommand ImageStyleCommand}.
  51492. *
  51493. * @extends module:core/plugin~Plugin
  51494. */
  51495. class ImageStyleEditing extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  51496. /**
  51497. * @inheritDoc
  51498. */
  51499. static get pluginName() {
  51500. return 'ImageStyleEditing';
  51501. }
  51502. /**
  51503. * @inheritDoc
  51504. */
  51505. init() {
  51506. const editor = this.editor;
  51507. const schema = editor.model.schema;
  51508. const data = editor.data;
  51509. const editing = editor.editing;
  51510. // Define default configuration.
  51511. editor.config.define( 'image.styles', [ 'full', 'side' ] );
  51512. // Get configuration.
  51513. const styles = Object(_utils__WEBPACK_IMPORTED_MODULE_3__["normalizeImageStyles"])( editor.config.get( 'image.styles' ) );
  51514. // Allow imageStyle attribute in image.
  51515. // We could call it 'style' but https://github.com/ckeditor/ckeditor5-engine/issues/559.
  51516. schema.extend( 'image', { allowAttributes: 'imageStyle' } );
  51517. // Converters for imageStyle attribute from model to view.
  51518. const modelToViewConverter = Object(_converters__WEBPACK_IMPORTED_MODULE_2__["modelToViewStyleAttribute"])( styles );
  51519. editing.downcastDispatcher.on( 'attribute:imageStyle:image', modelToViewConverter );
  51520. data.downcastDispatcher.on( 'attribute:imageStyle:image', modelToViewConverter );
  51521. // Converter for figure element from view to model.
  51522. data.upcastDispatcher.on( 'element:figure', Object(_converters__WEBPACK_IMPORTED_MODULE_2__["viewToModelStyleAttribute"])( styles ), { priority: 'low' } );
  51523. // Register imageStyle command.
  51524. editor.commands.add( 'imageStyle', new _imagestylecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, styles ) );
  51525. }
  51526. }
  51527. /**
  51528. * The image style format descriptor.
  51529. *
  51530. * import fullSizeIcon from 'path/to/icon.svg';
  51531. *
  51532. * const imageStyleFormat = {
  51533. * name: 'fullSize',
  51534. * icon: fullSizeIcon,
  51535. * title: 'Full size image',
  51536. * className: 'image-full-size'
  51537. * }
  51538. *
  51539. * @typedef {Object} module:image/imagestyle/imagestyleediting~ImageStyleFormat
  51540. *
  51541. * @property {String} name The unique name of the style. It will be used to:
  51542. *
  51543. * * Store the chosen style in the model by setting the `imageStyle` attribute of the `<image>` element.
  51544. * * As a value of the {@link module:image/imagestyle/imagestylecommand~ImageStyleCommand#execute `imageStyle` command},
  51545. * * when registering a button for each of the styles (`'imageStyle:{name}'`) in the
  51546. * {@link module:ui/componentfactory~ComponentFactory UI components factory} (this functionality is provided by the
  51547. * {@link module:image/imagestyle/imagestyleui~ImageStyleUI} plugin).
  51548. *
  51549. * @property {Boolean} [isDefault] When set, the style will be used as the default one.
  51550. * A default style does not apply any CSS class to the view element.
  51551. *
  51552. * @property {String} icon One of the following to be used when creating the style's button:
  51553. *
  51554. * * An SVG icon source (as an XML string).
  51555. * * One of {@link module:image/imagestyle/utils~defaultIcons} to use a default icon provided by the plugin.
  51556. *
  51557. * @property {String} title The style's title.
  51558. *
  51559. * @property {String} className The CSS class used to represent the style in the view.
  51560. */
  51561. /***/ }),
  51562. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestyleui.js":
  51563. /*!*******************************************************************************!*\
  51564. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestyleui.js ***!
  51565. \*******************************************************************************/
  51566. /*! exports provided: default */
  51567. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51568. "use strict";
  51569. __webpack_require__.r(__webpack_exports__);
  51570. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageStyleUI; });
  51571. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  51572. /* harmony import */ var _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  51573. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/utils.js");
  51574. /* harmony import */ var _theme_imagestyle_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/imagestyle.css */ "./node_modules/@ckeditor/ckeditor5-image/theme/imagestyle.css");
  51575. /* harmony import */ var _theme_imagestyle_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_theme_imagestyle_css__WEBPACK_IMPORTED_MODULE_3__);
  51576. /**
  51577. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  51578. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  51579. */
  51580. /**
  51581. * @module image/imagestyle/imagestyleui
  51582. */
  51583. /**
  51584. * The image style UI plugin.
  51585. *
  51586. * @extends module:core/plugin~Plugin
  51587. */
  51588. class ImageStyleUI extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  51589. /**
  51590. * @inheritDoc
  51591. */
  51592. static get pluginName() {
  51593. return 'ImageStyleUI';
  51594. }
  51595. /**
  51596. * Returns the default localized style titles provided by the plugin.
  51597. *
  51598. * The following localized titles corresponding with
  51599. * {@link module:image/imagestyle/utils~defaultStyles} are available:
  51600. *
  51601. * * `'Full size image'`,
  51602. * * `'Side image'`,
  51603. * * `'Left aligned image'`,
  51604. * * `'Centered image'`,
  51605. * * `'Right aligned image'`
  51606. *
  51607. * @returns {Object.<String,String>}
  51608. */
  51609. get localizedDefaultStylesTitles() {
  51610. const t = this.editor.t;
  51611. return {
  51612. 'Full size image': t( 'Full size image' ),
  51613. 'Side image': t( 'Side image' ),
  51614. 'Left aligned image': t( 'Left aligned image' ),
  51615. 'Centered image': t( 'Centered image' ),
  51616. 'Right aligned image': t( 'Right aligned image' )
  51617. };
  51618. }
  51619. /**
  51620. * @inheritDoc
  51621. */
  51622. init() {
  51623. const editor = this.editor;
  51624. const configuredStyles = editor.config.get( 'image.styles' );
  51625. const translatedStyles = translateStyles( Object(_utils__WEBPACK_IMPORTED_MODULE_2__["normalizeImageStyles"])( configuredStyles ), this.localizedDefaultStylesTitles );
  51626. for ( const style of translatedStyles ) {
  51627. this._createButton( style );
  51628. }
  51629. }
  51630. /**
  51631. * Creates a button for each style and stores it in the editor {@link module:ui/componentfactory~ComponentFactory ComponentFactory}.
  51632. *
  51633. * @private
  51634. * @param {module:image/imagestyle/imagestyleediting~ImageStyleFormat} style
  51635. */
  51636. _createButton( style ) {
  51637. const editor = this.editor;
  51638. const componentName = `imageStyle:${ style.name }`;
  51639. editor.ui.componentFactory.add( componentName, locale => {
  51640. const command = editor.commands.get( 'imageStyle' );
  51641. const view = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__["default"]( locale );
  51642. view.set( {
  51643. label: style.title,
  51644. icon: style.icon,
  51645. tooltip: true,
  51646. isToggleable: true
  51647. } );
  51648. view.bind( 'isEnabled' ).to( command, 'isEnabled' );
  51649. view.bind( 'isOn' ).to( command, 'value', value => value === style.name );
  51650. this.listenTo( view, 'execute', () => {
  51651. editor.execute( 'imageStyle', { value: style.name } );
  51652. editor.editing.view.focus();
  51653. } );
  51654. return view;
  51655. } );
  51656. }
  51657. }
  51658. /**
  51659. * Returns the translated `title` from the passed styles array.
  51660. *
  51661. * @param {Array.<module:image/imagestyle/imagestyleediting~ImageStyleFormat>} styles
  51662. * @param titles
  51663. * @returns {Array.<module:image/imagestyle/imagestyleediting~ImageStyleFormat>}
  51664. */
  51665. function translateStyles( styles, titles ) {
  51666. for ( const style of styles ) {
  51667. // Localize the titles of the styles, if a title corresponds with
  51668. // a localized default provided by the plugin.
  51669. if ( titles[ style.title ] ) {
  51670. style.title = titles[ style.title ];
  51671. }
  51672. }
  51673. return styles;
  51674. }
  51675. /***/ }),
  51676. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/utils.js":
  51677. /*!************************************************************************!*\
  51678. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/utils.js ***!
  51679. \************************************************************************/
  51680. /*! exports provided: normalizeImageStyles */
  51681. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51682. "use strict";
  51683. __webpack_require__.r(__webpack_exports__);
  51684. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeImageStyles", function() { return normalizeImageStyles; });
  51685. /* harmony import */ var _ckeditor_ckeditor5_core_theme_icons_object_full_width_svg__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/theme/icons/object-full-width.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-full-width.svg");
  51686. /* harmony import */ var _ckeditor_ckeditor5_core_theme_icons_object_left_svg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/theme/icons/object-left.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-left.svg");
  51687. /* harmony import */ var _ckeditor_ckeditor5_core_theme_icons_object_center_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/theme/icons/object-center.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-center.svg");
  51688. /* harmony import */ var _ckeditor_ckeditor5_core_theme_icons_object_right_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/theme/icons/object-right.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-right.svg");
  51689. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  51690. /**
  51691. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  51692. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  51693. */
  51694. /**
  51695. * @module image/imagestyle/utils
  51696. */
  51697. /**
  51698. * Default image styles provided by the plugin that can be referred in the
  51699. * {@link module:image/image~ImageConfig#styles} configuration.
  51700. *
  51701. * Among them, 2 default semantic content styles are available:
  51702. *
  51703. * * `full` is a full–width image without any CSS class,
  51704. * * `side` is a side image styled with the `image-style-side` CSS class.
  51705. *
  51706. * There are also 3 styles focused on formatting:
  51707. *
  51708. * * `alignLeft` aligns the image to the left using the `image-style-align-left` class,
  51709. * * `alignCenter` centers the image using the `image-style-align-center` class,
  51710. * * `alignRight` aligns the image to the right using the `image-style-align-right` class,
  51711. *
  51712. * @member {Object.<String,Object>}
  51713. */
  51714. const defaultStyles = {
  51715. // This option is equal to the situation when no style is applied.
  51716. full: {
  51717. name: 'full',
  51718. title: 'Full size image',
  51719. icon: _ckeditor_ckeditor5_core_theme_icons_object_full_width_svg__WEBPACK_IMPORTED_MODULE_0__["default"],
  51720. isDefault: true
  51721. },
  51722. // This represents a side image.
  51723. side: {
  51724. name: 'side',
  51725. title: 'Side image',
  51726. icon: _ckeditor_ckeditor5_core_theme_icons_object_right_svg__WEBPACK_IMPORTED_MODULE_3__["default"],
  51727. className: 'image-style-side'
  51728. },
  51729. // This style represents an image aligned to the left.
  51730. alignLeft: {
  51731. name: 'alignLeft',
  51732. title: 'Left aligned image',
  51733. icon: _ckeditor_ckeditor5_core_theme_icons_object_left_svg__WEBPACK_IMPORTED_MODULE_1__["default"],
  51734. className: 'image-style-align-left'
  51735. },
  51736. // This style represents a centered image.
  51737. alignCenter: {
  51738. name: 'alignCenter',
  51739. title: 'Centered image',
  51740. icon: _ckeditor_ckeditor5_core_theme_icons_object_center_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  51741. className: 'image-style-align-center'
  51742. },
  51743. // This style represents an image aligned to the right.
  51744. alignRight: {
  51745. name: 'alignRight',
  51746. title: 'Right aligned image',
  51747. icon: _ckeditor_ckeditor5_core_theme_icons_object_right_svg__WEBPACK_IMPORTED_MODULE_3__["default"],
  51748. className: 'image-style-align-right'
  51749. }
  51750. };
  51751. /**
  51752. * Default image style icons provided by the plugin that can be referred in the
  51753. * {@link module:image/image~ImageConfig#styles} configuration.
  51754. *
  51755. * There are 4 icons available: `'full'`, `'left'`, `'center'` and `'right'`.
  51756. *
  51757. * @member {Object.<String, String>}
  51758. */
  51759. const defaultIcons = {
  51760. full: _ckeditor_ckeditor5_core_theme_icons_object_full_width_svg__WEBPACK_IMPORTED_MODULE_0__["default"],
  51761. left: _ckeditor_ckeditor5_core_theme_icons_object_left_svg__WEBPACK_IMPORTED_MODULE_1__["default"],
  51762. right: _ckeditor_ckeditor5_core_theme_icons_object_right_svg__WEBPACK_IMPORTED_MODULE_3__["default"],
  51763. center: _ckeditor_ckeditor5_core_theme_icons_object_center_svg__WEBPACK_IMPORTED_MODULE_2__["default"]
  51764. };
  51765. /**
  51766. * Returns a {@link module:image/image~ImageConfig#styles} array with items normalized in the
  51767. * {@link module:image/imagestyle/imagestyleediting~ImageStyleFormat} format and a complete `icon` markup for each style.
  51768. *
  51769. * @returns {Array.<module:image/imagestyle/imagestyleediting~ImageStyleFormat>}
  51770. */
  51771. function normalizeImageStyles( configuredStyles = [] ) {
  51772. return configuredStyles.map( _normalizeStyle );
  51773. }
  51774. // Normalizes an image style provided in the {@link module:image/image~ImageConfig#styles}
  51775. // and returns it in a {@link module:image/imagestyle/imagestyleediting~ImageStyleFormat}.
  51776. //
  51777. // @param {Object} style
  51778. // @returns {@link module:image/imagestyle/imagestyleediting~ImageStyleFormat}
  51779. function _normalizeStyle( style ) {
  51780. // Just the name of the style has been passed.
  51781. if ( typeof style == 'string' ) {
  51782. const styleName = style;
  51783. // If it's one of the defaults, just use it.
  51784. if ( defaultStyles[ styleName ] ) {
  51785. // Clone the style to avoid overriding defaults.
  51786. style = Object.assign( {}, defaultStyles[ styleName ] );
  51787. }
  51788. // If it's just a name but none of the defaults, warn because probably it's a mistake.
  51789. else {
  51790. /**
  51791. * There is no such image style of given name.
  51792. *
  51793. * @error image-style-not-found
  51794. * @param {String} name Name of a missing style name.
  51795. */
  51796. Object(_ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["logWarning"])( 'image-style-not-found', { name: styleName } );
  51797. // Normalize the style anyway to prevent errors.
  51798. style = {
  51799. name: styleName
  51800. };
  51801. }
  51802. }
  51803. // If an object style has been passed and if the name matches one of the defaults,
  51804. // extend it with defaults – the user wants to customize a default style.
  51805. // Note: Don't override the user–defined style object, clone it instead.
  51806. else if ( defaultStyles[ style.name ] ) {
  51807. const defaultStyle = defaultStyles[ style.name ];
  51808. const extendedStyle = Object.assign( {}, style );
  51809. for ( const prop in defaultStyle ) {
  51810. if ( !Object.prototype.hasOwnProperty.call( style, prop ) ) {
  51811. extendedStyle[ prop ] = defaultStyle[ prop ];
  51812. }
  51813. }
  51814. style = extendedStyle;
  51815. }
  51816. // If an icon is defined as a string and correspond with a name
  51817. // in default icons, use the default icon provided by the plugin.
  51818. if ( typeof style.icon == 'string' && defaultIcons[ style.icon ] ) {
  51819. style.icon = defaultIcons[ style.icon ];
  51820. }
  51821. return style;
  51822. }
  51823. /***/ }),
  51824. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative.js":
  51825. /*!****************************************************************************!*\
  51826. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative.js ***!
  51827. \****************************************************************************/
  51828. /*! exports provided: default */
  51829. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51830. "use strict";
  51831. __webpack_require__.r(__webpack_exports__);
  51832. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageTextAlternative; });
  51833. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  51834. /* harmony import */ var _imagetextalternative_imagetextalternativeediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./imagetextalternative/imagetextalternativeediting */ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativeediting.js");
  51835. /* harmony import */ var _imagetextalternative_imagetextalternativeui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./imagetextalternative/imagetextalternativeui */ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativeui.js");
  51836. /**
  51837. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  51838. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  51839. */
  51840. /**
  51841. * @module image/imagetextalternative
  51842. */
  51843. /**
  51844. * The image text alternative plugin.
  51845. *
  51846. * For a detailed overview, check the {@glink features/image#image-styles image styles} documentation.
  51847. *
  51848. * This is a "glue" plugin which loads the
  51849. * {@link module:image/imagetextalternative/imagetextalternativeediting~ImageTextAlternativeEditing}
  51850. * and {@link module:image/imagetextalternative/imagetextalternativeui~ImageTextAlternativeUI} plugins.
  51851. *
  51852. * @extends module:core/plugin~Plugin
  51853. */
  51854. class ImageTextAlternative extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  51855. /**
  51856. * @inheritDoc
  51857. */
  51858. static get requires() {
  51859. return [ _imagetextalternative_imagetextalternativeediting__WEBPACK_IMPORTED_MODULE_1__["default"], _imagetextalternative_imagetextalternativeui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  51860. }
  51861. /**
  51862. * @inheritDoc
  51863. */
  51864. static get pluginName() {
  51865. return 'ImageTextAlternative';
  51866. }
  51867. }
  51868. /***/ }),
  51869. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativecommand.js":
  51870. /*!********************************************************************************************************!*\
  51871. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativecommand.js ***!
  51872. \********************************************************************************************************/
  51873. /*! exports provided: default */
  51874. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51875. "use strict";
  51876. __webpack_require__.r(__webpack_exports__);
  51877. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageTextAlternativeCommand; });
  51878. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  51879. /* harmony import */ var _image_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../image/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
  51880. /**
  51881. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  51882. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  51883. */
  51884. /**
  51885. * @module image/imagetextalternative/imagetextalternativecommand
  51886. */
  51887. /**
  51888. * The image text alternative command. It is used to change the `alt` attribute of `<image>` elements.
  51889. *
  51890. * @extends module:core/command~Command
  51891. */
  51892. class ImageTextAlternativeCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  51893. /**
  51894. * The command value: `false` if there is no `alt` attribute, otherwise the value of the `alt` attribute.
  51895. *
  51896. * @readonly
  51897. * @observable
  51898. * @member {String|Boolean} #value
  51899. */
  51900. /**
  51901. * @inheritDoc
  51902. */
  51903. refresh() {
  51904. const element = this.editor.model.document.selection.getSelectedElement();
  51905. this.isEnabled = Object(_image_utils__WEBPACK_IMPORTED_MODULE_1__["isImage"])( element );
  51906. if ( Object(_image_utils__WEBPACK_IMPORTED_MODULE_1__["isImage"])( element ) && element.hasAttribute( 'alt' ) ) {
  51907. this.value = element.getAttribute( 'alt' );
  51908. } else {
  51909. this.value = false;
  51910. }
  51911. }
  51912. /**
  51913. * Executes the command.
  51914. *
  51915. * @fires execute
  51916. * @param {Object} options
  51917. * @param {String} options.newValue The new value of the `alt` attribute to set.
  51918. */
  51919. execute( options ) {
  51920. const model = this.editor.model;
  51921. const imageElement = model.document.selection.getSelectedElement();
  51922. model.change( writer => {
  51923. writer.setAttribute( 'alt', options.newValue, imageElement );
  51924. } );
  51925. }
  51926. }
  51927. /***/ }),
  51928. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativeediting.js":
  51929. /*!********************************************************************************************************!*\
  51930. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativeediting.js ***!
  51931. \********************************************************************************************************/
  51932. /*! exports provided: default */
  51933. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51934. "use strict";
  51935. __webpack_require__.r(__webpack_exports__);
  51936. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageTextAlternativeEditing; });
  51937. /* harmony import */ var _imagetextalternativecommand__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./imagetextalternativecommand */ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativecommand.js");
  51938. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  51939. /**
  51940. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  51941. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  51942. */
  51943. /**
  51944. * @module image/imagetextalternative/imagetextalternativeediting
  51945. */
  51946. /**
  51947. * The image text alternative editing plugin.
  51948. *
  51949. * Registers the `'imageTextAlternative'` command.
  51950. *
  51951. * @extends module:core/plugin~Plugin
  51952. */
  51953. class ImageTextAlternativeEditing extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_1__["default"] {
  51954. /**
  51955. * @inheritDoc
  51956. */
  51957. static get pluginName() {
  51958. return 'ImageTextAlternativeEditing';
  51959. }
  51960. /**
  51961. * @inheritDoc
  51962. */
  51963. init() {
  51964. this.editor.commands.add( 'imageTextAlternative', new _imagetextalternativecommand__WEBPACK_IMPORTED_MODULE_0__["default"]( this.editor ) );
  51965. }
  51966. }
  51967. /***/ }),
  51968. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativeui.js":
  51969. /*!***************************************************************************************************!*\
  51970. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativeui.js ***!
  51971. \***************************************************************************************************/
  51972. /*! exports provided: default */
  51973. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51974. "use strict";
  51975. __webpack_require__.r(__webpack_exports__);
  51976. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageTextAlternativeUI; });
  51977. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  51978. /* harmony import */ var _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  51979. /* harmony import */ var _ckeditor_ckeditor5_ui_src_bindings_clickoutsidehandler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler */ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler.js");
  51980. /* harmony import */ var _ui_textalternativeformview__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ui/textalternativeformview */ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/ui/textalternativeformview.js");
  51981. /* harmony import */ var _ckeditor_ckeditor5_ui_src_panel_balloon_contextualballoon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon */ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon.js");
  51982. /* harmony import */ var _ckeditor_ckeditor5_core_theme_icons_low_vision_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/theme/icons/low-vision.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/low-vision.svg");
  51983. /* harmony import */ var _image_ui_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../image/ui/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/ui/utils.js");
  51984. /* harmony import */ var _image_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../image/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
  51985. /**
  51986. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  51987. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  51988. */
  51989. /**
  51990. * @module image/imagetextalternative/imagetextalternativeui
  51991. */
  51992. /**
  51993. * The image text alternative UI plugin.
  51994. *
  51995. * The plugin uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon}.
  51996. *
  51997. * @extends module:core/plugin~Plugin
  51998. */
  51999. class ImageTextAlternativeUI extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  52000. /**
  52001. * @inheritDoc
  52002. */
  52003. static get requires() {
  52004. return [ _ckeditor_ckeditor5_ui_src_panel_balloon_contextualballoon__WEBPACK_IMPORTED_MODULE_4__["default"] ];
  52005. }
  52006. /**
  52007. * @inheritDoc
  52008. */
  52009. static get pluginName() {
  52010. return 'ImageTextAlternativeUI';
  52011. }
  52012. /**
  52013. * @inheritDoc
  52014. */
  52015. init() {
  52016. this._createButton();
  52017. this._createForm();
  52018. }
  52019. /**
  52020. * @inheritDoc
  52021. */
  52022. destroy() {
  52023. super.destroy();
  52024. // Destroy created UI components as they are not automatically destroyed (see ckeditor5#1341).
  52025. this._form.destroy();
  52026. }
  52027. /**
  52028. * Creates a button showing the balloon panel for changing the image text alternative and
  52029. * registers it in the editor {@link module:ui/componentfactory~ComponentFactory ComponentFactory}.
  52030. *
  52031. * @private
  52032. */
  52033. _createButton() {
  52034. const editor = this.editor;
  52035. const t = editor.t;
  52036. editor.ui.componentFactory.add( 'imageTextAlternative', locale => {
  52037. const command = editor.commands.get( 'imageTextAlternative' );
  52038. const view = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__["default"]( locale );
  52039. view.set( {
  52040. label: t( 'Change image text alternative' ),
  52041. icon: _ckeditor_ckeditor5_core_theme_icons_low_vision_svg__WEBPACK_IMPORTED_MODULE_5__["default"],
  52042. tooltip: true
  52043. } );
  52044. view.bind( 'isEnabled' ).to( command, 'isEnabled' );
  52045. this.listenTo( view, 'execute', () => {
  52046. this._showForm();
  52047. } );
  52048. return view;
  52049. } );
  52050. }
  52051. /**
  52052. * Creates the {@link module:image/imagetextalternative/ui/textalternativeformview~TextAlternativeFormView}
  52053. * form.
  52054. *
  52055. * @private
  52056. */
  52057. _createForm() {
  52058. const editor = this.editor;
  52059. const view = editor.editing.view;
  52060. const viewDocument = view.document;
  52061. /**
  52062. * The contextual balloon plugin instance.
  52063. *
  52064. * @private
  52065. * @member {module:ui/panel/balloon/contextualballoon~ContextualBalloon}
  52066. */
  52067. this._balloon = this.editor.plugins.get( 'ContextualBalloon' );
  52068. /**
  52069. * A form containing a textarea and buttons, used to change the `alt` text value.
  52070. *
  52071. * @member {module:image/imagetextalternative/ui/textalternativeformview~TextAlternativeFormView}
  52072. */
  52073. this._form = new _ui_textalternativeformview__WEBPACK_IMPORTED_MODULE_3__["default"]( editor.locale );
  52074. // Render the form so its #element is available for clickOutsideHandler.
  52075. this._form.render();
  52076. this.listenTo( this._form, 'submit', () => {
  52077. editor.execute( 'imageTextAlternative', {
  52078. newValue: this._form.labeledInput.fieldView.element.value
  52079. } );
  52080. this._hideForm( true );
  52081. } );
  52082. this.listenTo( this._form, 'cancel', () => {
  52083. this._hideForm( true );
  52084. } );
  52085. // Close the form on Esc key press.
  52086. this._form.keystrokes.set( 'Esc', ( data, cancel ) => {
  52087. this._hideForm( true );
  52088. cancel();
  52089. } );
  52090. // Reposition the balloon or hide the form if an image widget is no longer selected.
  52091. this.listenTo( editor.ui, 'update', () => {
  52092. if ( !Object(_image_utils__WEBPACK_IMPORTED_MODULE_7__["getSelectedImageWidget"])( viewDocument.selection ) ) {
  52093. this._hideForm( true );
  52094. } else if ( this._isVisible ) {
  52095. Object(_image_ui_utils__WEBPACK_IMPORTED_MODULE_6__["repositionContextualBalloon"])( editor );
  52096. }
  52097. } );
  52098. // Close on click outside of balloon panel element.
  52099. Object(_ckeditor_ckeditor5_ui_src_bindings_clickoutsidehandler__WEBPACK_IMPORTED_MODULE_2__["default"])( {
  52100. emitter: this._form,
  52101. activator: () => this._isVisible,
  52102. contextElements: [ this._balloon.view.element ],
  52103. callback: () => this._hideForm()
  52104. } );
  52105. }
  52106. /**
  52107. * Shows the {@link #_form} in the {@link #_balloon}.
  52108. *
  52109. * @private
  52110. */
  52111. _showForm() {
  52112. if ( this._isVisible ) {
  52113. return;
  52114. }
  52115. const editor = this.editor;
  52116. const command = editor.commands.get( 'imageTextAlternative' );
  52117. const labeledInput = this._form.labeledInput;
  52118. if ( !this._isInBalloon ) {
  52119. this._balloon.add( {
  52120. view: this._form,
  52121. position: Object(_image_ui_utils__WEBPACK_IMPORTED_MODULE_6__["getBalloonPositionData"])( editor )
  52122. } );
  52123. }
  52124. // Make sure that each time the panel shows up, the field remains in sync with the value of
  52125. // the command. If the user typed in the input, then canceled the balloon (`labeledInput#value`
  52126. // stays unaltered) and re-opened it without changing the value of the command, they would see the
  52127. // old value instead of the actual value of the command.
  52128. // https://github.com/ckeditor/ckeditor5-image/issues/114
  52129. labeledInput.fieldView.value = labeledInput.fieldView.element.value = command.value || '';
  52130. this._form.labeledInput.fieldView.select();
  52131. }
  52132. /**
  52133. * Removes the {@link #_form} from the {@link #_balloon}.
  52134. *
  52135. * @param {Boolean} [focusEditable=false] Controls whether the editing view is focused afterwards.
  52136. * @private
  52137. */
  52138. _hideForm( focusEditable ) {
  52139. if ( !this._isInBalloon ) {
  52140. return;
  52141. }
  52142. // Blur the input element before removing it from DOM to prevent issues in some browsers.
  52143. // See https://github.com/ckeditor/ckeditor5/issues/1501.
  52144. if ( this._form.focusTracker.isFocused ) {
  52145. this._form.saveButtonView.focus();
  52146. }
  52147. this._balloon.remove( this._form );
  52148. if ( focusEditable ) {
  52149. this.editor.editing.view.focus();
  52150. }
  52151. }
  52152. /**
  52153. * Returns `true` when the {@link #_form} is the visible view in the {@link #_balloon}.
  52154. *
  52155. * @private
  52156. * @type {Boolean}
  52157. */
  52158. get _isVisible() {
  52159. return this._balloon.visibleView === this._form;
  52160. }
  52161. /**
  52162. * Returns `true` when the {@link #_form} is in the {@link #_balloon}.
  52163. *
  52164. * @private
  52165. * @type {Boolean}
  52166. */
  52167. get _isInBalloon() {
  52168. return this._balloon.hasView( this._form );
  52169. }
  52170. }
  52171. /***/ }),
  52172. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/ui/textalternativeformview.js":
  52173. /*!*******************************************************************************************************!*\
  52174. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/ui/textalternativeformview.js ***!
  52175. \*******************************************************************************************************/
  52176. /*! exports provided: default */
  52177. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  52178. "use strict";
  52179. __webpack_require__.r(__webpack_exports__);
  52180. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TextAlternativeFormView; });
  52181. /* harmony import */ var _ckeditor_ckeditor5_ui_src_view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  52182. /* harmony import */ var _ckeditor_ckeditor5_ui_src_viewcollection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/viewcollection */ "./node_modules/@ckeditor/ckeditor5-ui/src/viewcollection.js");
  52183. /* harmony import */ var _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  52184. /* harmony import */ var _ckeditor_ckeditor5_ui_src_labeledfield_labeledfieldview__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/labeledfield/labeledfieldview */ "./node_modules/@ckeditor/ckeditor5-ui/src/labeledfield/labeledfieldview.js");
  52185. /* harmony import */ var _ckeditor_ckeditor5_ui_src_labeledfield_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/labeledfield/utils */ "./node_modules/@ckeditor/ckeditor5-ui/src/labeledfield/utils.js");
  52186. /* harmony import */ var _ckeditor_ckeditor5_ui_src_bindings_submithandler__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/bindings/submithandler */ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/submithandler.js");
  52187. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keystrokehandler */ "./node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js");
  52188. /* harmony import */ var _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/focustracker */ "./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js");
  52189. /* harmony import */ var _ckeditor_ckeditor5_ui_src_focuscycler__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/focuscycler */ "./node_modules/@ckeditor/ckeditor5-ui/src/focuscycler.js");
  52190. /* harmony import */ var _ckeditor_ckeditor5_core_theme_icons_check_svg__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/theme/icons/check.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/check.svg");
  52191. /* harmony import */ var _ckeditor_ckeditor5_core_theme_icons_cancel_svg__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/theme/icons/cancel.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/cancel.svg");
  52192. /* harmony import */ var _theme_textalternativeform_css__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../theme/textalternativeform.css */ "./node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css");
  52193. /* harmony import */ var _theme_textalternativeform_css__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_theme_textalternativeform_css__WEBPACK_IMPORTED_MODULE_11__);
  52194. /* harmony import */ var _ckeditor_ckeditor5_ui_theme_components_responsive_form_responsiveform_css__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css");
  52195. /* harmony import */ var _ckeditor_ckeditor5_ui_theme_components_responsive_form_responsiveform_css__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_ckeditor_ckeditor5_ui_theme_components_responsive_form_responsiveform_css__WEBPACK_IMPORTED_MODULE_12__);
  52196. /**
  52197. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  52198. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  52199. */
  52200. /**
  52201. * @module image/imagetextalternative/ui/textalternativeformview
  52202. */
  52203. /**
  52204. * The TextAlternativeFormView class.
  52205. *
  52206. * @extends module:ui/view~View
  52207. */
  52208. class TextAlternativeFormView extends _ckeditor_ckeditor5_ui_src_view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  52209. /**
  52210. * @inheritDoc
  52211. */
  52212. constructor( locale ) {
  52213. super( locale );
  52214. const t = this.locale.t;
  52215. /**
  52216. * Tracks information about the DOM focus in the form.
  52217. *
  52218. * @readonly
  52219. * @member {module:utils/focustracker~FocusTracker}
  52220. */
  52221. this.focusTracker = new _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_7__["default"]();
  52222. /**
  52223. * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
  52224. *
  52225. * @readonly
  52226. * @member {module:utils/keystrokehandler~KeystrokeHandler}
  52227. */
  52228. this.keystrokes = new _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_6__["default"]();
  52229. /**
  52230. * An input with a label.
  52231. *
  52232. * @member {module:ui/labeledfield/labeledfieldview~LabeledFieldView} #labeledInput
  52233. */
  52234. this.labeledInput = this._createLabeledInputView();
  52235. /**
  52236. * A button used to submit the form.
  52237. *
  52238. * @member {module:ui/button/buttonview~ButtonView} #saveButtonView
  52239. */
  52240. this.saveButtonView = this._createButton( t( 'Save' ), _ckeditor_ckeditor5_core_theme_icons_check_svg__WEBPACK_IMPORTED_MODULE_9__["default"], 'ck-button-save' );
  52241. this.saveButtonView.type = 'submit';
  52242. /**
  52243. * A button used to cancel the form.
  52244. *
  52245. * @member {module:ui/button/buttonview~ButtonView} #cancelButtonView
  52246. */
  52247. this.cancelButtonView = this._createButton( t( 'Cancel' ), _ckeditor_ckeditor5_core_theme_icons_cancel_svg__WEBPACK_IMPORTED_MODULE_10__["default"], 'ck-button-cancel', 'cancel' );
  52248. /**
  52249. * A collection of views which can be focused in the form.
  52250. *
  52251. * @readonly
  52252. * @protected
  52253. * @member {module:ui/viewcollection~ViewCollection}
  52254. */
  52255. this._focusables = new _ckeditor_ckeditor5_ui_src_viewcollection__WEBPACK_IMPORTED_MODULE_1__["default"]();
  52256. /**
  52257. * Helps cycling over {@link #_focusables} in the form.
  52258. *
  52259. * @readonly
  52260. * @protected
  52261. * @member {module:ui/focuscycler~FocusCycler}
  52262. */
  52263. this._focusCycler = new _ckeditor_ckeditor5_ui_src_focuscycler__WEBPACK_IMPORTED_MODULE_8__["default"]( {
  52264. focusables: this._focusables,
  52265. focusTracker: this.focusTracker,
  52266. keystrokeHandler: this.keystrokes,
  52267. actions: {
  52268. // Navigate form fields backwards using the Shift + Tab keystroke.
  52269. focusPrevious: 'shift + tab',
  52270. // Navigate form fields forwards using the Tab key.
  52271. focusNext: 'tab'
  52272. }
  52273. } );
  52274. this.setTemplate( {
  52275. tag: 'form',
  52276. attributes: {
  52277. class: [
  52278. 'ck',
  52279. 'ck-text-alternative-form',
  52280. 'ck-responsive-form'
  52281. ],
  52282. // https://github.com/ckeditor/ckeditor5-image/issues/40
  52283. tabindex: '-1'
  52284. },
  52285. children: [
  52286. this.labeledInput,
  52287. this.saveButtonView,
  52288. this.cancelButtonView
  52289. ]
  52290. } );
  52291. }
  52292. /**
  52293. * @inheritDoc
  52294. */
  52295. render() {
  52296. super.render();
  52297. this.keystrokes.listenTo( this.element );
  52298. Object(_ckeditor_ckeditor5_ui_src_bindings_submithandler__WEBPACK_IMPORTED_MODULE_5__["default"])( { view: this } );
  52299. [ this.labeledInput, this.saveButtonView, this.cancelButtonView ]
  52300. .forEach( v => {
  52301. // Register the view as focusable.
  52302. this._focusables.add( v );
  52303. // Register the view in the focus tracker.
  52304. this.focusTracker.add( v.element );
  52305. } );
  52306. }
  52307. /**
  52308. * Creates the button view.
  52309. *
  52310. * @private
  52311. * @param {String} label The button label
  52312. * @param {String} icon The button's icon.
  52313. * @param {String} className The additional button CSS class name.
  52314. * @param {String} [eventName] The event name that the ButtonView#execute event will be delegated to.
  52315. * @returns {module:ui/button/buttonview~ButtonView} The button view instance.
  52316. */
  52317. _createButton( label, icon, className, eventName ) {
  52318. const button = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_2__["default"]( this.locale );
  52319. button.set( {
  52320. label,
  52321. icon,
  52322. tooltip: true
  52323. } );
  52324. button.extendTemplate( {
  52325. attributes: {
  52326. class: className
  52327. }
  52328. } );
  52329. if ( eventName ) {
  52330. button.delegate( 'execute' ).to( this, eventName );
  52331. }
  52332. return button;
  52333. }
  52334. /**
  52335. * Creates an input with a label.
  52336. *
  52337. * @private
  52338. * @returns {module:ui/labeledfield/labeledfieldview~LabeledFieldView} Labeled field view instance.
  52339. */
  52340. _createLabeledInputView() {
  52341. const t = this.locale.t;
  52342. const labeledInput = new _ckeditor_ckeditor5_ui_src_labeledfield_labeledfieldview__WEBPACK_IMPORTED_MODULE_3__["default"]( this.locale, _ckeditor_ckeditor5_ui_src_labeledfield_utils__WEBPACK_IMPORTED_MODULE_4__["createLabeledInputText"] );
  52343. labeledInput.label = t( 'Text alternative' );
  52344. labeledInput.fieldView.placeholder = t( 'Text alternative' );
  52345. return labeledInput;
  52346. }
  52347. }
  52348. /***/ }),
  52349. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imagetoolbar.js":
  52350. /*!********************************************************************!*\
  52351. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imagetoolbar.js ***!
  52352. \********************************************************************/
  52353. /*! exports provided: default */
  52354. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  52355. "use strict";
  52356. __webpack_require__.r(__webpack_exports__);
  52357. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageToolbar; });
  52358. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  52359. /* harmony import */ var _image_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./image/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
  52360. /* harmony import */ var _ckeditor_ckeditor5_widget_src_widgettoolbarrepository__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-widget/src/widgettoolbarrepository */ "./node_modules/@ckeditor/ckeditor5-widget/src/widgettoolbarrepository.js");
  52361. /**
  52362. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  52363. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  52364. */
  52365. /**
  52366. * @module image/imagetoolbar
  52367. */
  52368. /**
  52369. * The image toolbar plugin. It creates and manages the image toolbar (the toolbar displayed when an image is selected).
  52370. *
  52371. * For a detailed overview, check the {@glink features/image#image-contextual-toolbar image contextual toolbar} documentation.
  52372. *
  52373. * Instances of toolbar components (e.g. buttons) are created using the editor's
  52374. * {@link module:ui/componentfactory~ComponentFactory component factory}
  52375. * based on the {@link module:image/image~ImageConfig#toolbar `image.toolbar` configuration option}.
  52376. *
  52377. * The toolbar uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon}.
  52378. *
  52379. * @extends module:core/plugin~Plugin
  52380. */
  52381. class ImageToolbar extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  52382. /**
  52383. * @inheritDoc
  52384. */
  52385. static get requires() {
  52386. return [ _ckeditor_ckeditor5_widget_src_widgettoolbarrepository__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  52387. }
  52388. /**
  52389. * @inheritDoc
  52390. */
  52391. static get pluginName() {
  52392. return 'ImageToolbar';
  52393. }
  52394. /**
  52395. * @inheritDoc
  52396. */
  52397. afterInit() {
  52398. const editor = this.editor;
  52399. const t = editor.t;
  52400. const widgetToolbarRepository = editor.plugins.get( _ckeditor_ckeditor5_widget_src_widgettoolbarrepository__WEBPACK_IMPORTED_MODULE_2__["default"] );
  52401. widgetToolbarRepository.register( 'image', {
  52402. ariaLabel: t( 'Image toolbar' ),
  52403. items: editor.config.get( 'image.toolbar' ) || [],
  52404. getRelatedElement: _image_utils__WEBPACK_IMPORTED_MODULE_1__["getSelectedImageWidget"]
  52405. } );
  52406. }
  52407. }
  52408. /**
  52409. * Items to be placed in the image toolbar.
  52410. * This option is used by the {@link module:image/imagetoolbar~ImageToolbar} feature.
  52411. *
  52412. * Assuming that you use the following features:
  52413. *
  52414. * * {@link module:image/imagestyle~ImageStyle} (with a default configuration),
  52415. * * {@link module:image/imagetextalternative~ImageTextAlternative},
  52416. *
  52417. * three toolbar items will be available in {@link module:ui/componentfactory~ComponentFactory}:
  52418. * `'imageStyle:full'`, `'imageStyle:side'`, and `'imageTextAlternative'` so you can configure the toolbar like this:
  52419. *
  52420. * const imageConfig = {
  52421. * toolbar: [ 'imageStyle:full', 'imageStyle:side', '|', 'imageTextAlternative' ]
  52422. * };
  52423. *
  52424. * Of course, the same buttons can also be used in the
  52425. * {@link module:core/editor/editorconfig~EditorConfig#toolbar main editor toolbar}.
  52426. *
  52427. * Read more about configuring toolbar in {@link module:core/editor/editorconfig~EditorConfig#toolbar}.
  52428. *
  52429. * @member {Array.<String>} module:image/image~ImageConfig#toolbar
  52430. */
  52431. /***/ }),
  52432. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload.js":
  52433. /*!*******************************************************************!*\
  52434. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageupload.js ***!
  52435. \*******************************************************************/
  52436. /*! exports provided: default */
  52437. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  52438. "use strict";
  52439. __webpack_require__.r(__webpack_exports__);
  52440. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageUpload; });
  52441. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  52442. /* harmony import */ var _imageupload_imageuploadui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./imageupload/imageuploadui */ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadui.js");
  52443. /* harmony import */ var _imageupload_imageuploadprogress__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./imageupload/imageuploadprogress */ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadprogress.js");
  52444. /* harmony import */ var _imageupload_imageuploadediting__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./imageupload/imageuploadediting */ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadediting.js");
  52445. /**
  52446. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  52447. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  52448. */
  52449. /**
  52450. * @module image/imageupload
  52451. */
  52452. /**
  52453. * The image upload plugin.
  52454. *
  52455. * For a detailed overview, check the {@glink features/image-upload/image-upload image upload feature} documentation.
  52456. *
  52457. * This plugin does not do anything directly, but it loads a set of specific plugins to enable image uploading:
  52458. *
  52459. * * {@link module:image/imageupload/imageuploadediting~ImageUploadEditing},
  52460. * * {@link module:image/imageupload/imageuploadui~ImageUploadUI},
  52461. * * {@link module:image/imageupload/imageuploadprogress~ImageUploadProgress}.
  52462. *
  52463. * @extends module:core/plugin~Plugin
  52464. */
  52465. class ImageUpload extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  52466. /**
  52467. * @inheritDoc
  52468. */
  52469. static get pluginName() {
  52470. return 'ImageUpload';
  52471. }
  52472. /**
  52473. * @inheritDoc
  52474. */
  52475. static get requires() {
  52476. return [ _imageupload_imageuploadediting__WEBPACK_IMPORTED_MODULE_3__["default"], _imageupload_imageuploadui__WEBPACK_IMPORTED_MODULE_1__["default"], _imageupload_imageuploadprogress__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  52477. }
  52478. }
  52479. /**
  52480. * The image upload configuration.
  52481. *
  52482. * @member {module:image/imageupload~ImageUploadConfig} module:image/image~ImageConfig#upload
  52483. */
  52484. /**
  52485. * The configuration of the image upload feature. Used by the image upload feature in the `@ckeditor/ckeditor5-image` package.
  52486. *
  52487. * ClassicEditor
  52488. * .create( editorElement, {
  52489. * image: {
  52490. * upload: ... // Image upload feature options.
  52491. * }
  52492. * } )
  52493. * .then( ... )
  52494. * .catch( ... );
  52495. *
  52496. * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
  52497. *
  52498. * @interface module:image/imageupload~ImageUploadConfig
  52499. */
  52500. /**
  52501. * The list of accepted image types.
  52502. *
  52503. * The accepted types of images can be customized to allow only certain types of images:
  52504. *
  52505. * // Allow only JPEG and PNG images:
  52506. * const imageUploadConfig = {
  52507. * types: [ 'png', 'jpeg' ]
  52508. * };
  52509. *
  52510. * The type string should match [one of the sub-types](https://www.iana.org/assignments/media-types/media-types.xhtml#image)
  52511. * of the image MIME type. For example, for the `image/jpeg` MIME type, add `'jpeg'` to your image upload configuration.
  52512. *
  52513. * **Note:** This setting only restricts some image types to be selected and uploaded through the CKEditor UI and commands. Image type
  52514. * recognition and filtering should also be implemented on the server which accepts image uploads.
  52515. *
  52516. * @member {Array.<String>} module:image/imageupload~ImageUploadConfig#types
  52517. * @default [ 'jpeg', 'png', 'gif', 'bmp', 'webp', 'tiff' ]
  52518. */
  52519. /***/ }),
  52520. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadcommand.js":
  52521. /*!**************************************************************************************!*\
  52522. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadcommand.js ***!
  52523. \**************************************************************************************/
  52524. /*! exports provided: default */
  52525. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  52526. "use strict";
  52527. __webpack_require__.r(__webpack_exports__);
  52528. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageUploadCommand; });
  52529. /* harmony import */ var _ckeditor_ckeditor5_upload_src_filerepository__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-upload/src/filerepository */ "./node_modules/@ckeditor/ckeditor5-upload/src/filerepository.js");
  52530. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  52531. /* harmony import */ var _image_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../image/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
  52532. /**
  52533. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  52534. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  52535. */
  52536. /**
  52537. * @module image/imageupload/imageuploadcommand
  52538. */
  52539. /**
  52540. * The image upload command.
  52541. *
  52542. * The command is registered by the {@link module:image/imageupload/imageuploadediting~ImageUploadEditing} plugin as `'imageUpload'`.
  52543. *
  52544. * In order to upload an image at the current selection position
  52545. * (according to the {@link module:widget/utils~findOptimalInsertionPosition} algorithm),
  52546. * execute the command and pass the native image file instance:
  52547. *
  52548. * this.listenTo( editor.editing.view.document, 'clipboardInput', ( evt, data ) => {
  52549. * // Assuming that only images were pasted:
  52550. * const images = Array.from( data.dataTransfer.files );
  52551. *
  52552. * // Upload the first image:
  52553. * editor.execute( 'imageUpload', { file: images[ 0 ] } );
  52554. * } );
  52555. *
  52556. * It is also possible to insert multiple images at once:
  52557. *
  52558. * editor.execute( 'imageUpload', {
  52559. * file: [
  52560. * file1,
  52561. * file2
  52562. * ]
  52563. * } );
  52564. *
  52565. * @extends module:core/command~Command
  52566. */
  52567. class ImageUploadCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_1__["default"] {
  52568. /**
  52569. * @inheritDoc
  52570. */
  52571. refresh() {
  52572. const imageElement = this.editor.model.document.selection.getSelectedElement();
  52573. const isImage = imageElement && imageElement.name === 'image' || false;
  52574. this.isEnabled = Object(_image_utils__WEBPACK_IMPORTED_MODULE_2__["isImageAllowed"])( this.editor.model ) || isImage;
  52575. }
  52576. /**
  52577. * Executes the command.
  52578. *
  52579. * @fires execute
  52580. * @param {Object} options Options for the executed command.
  52581. * @param {File|Array.<File>} options.file The image file or an array of image files to upload.
  52582. */
  52583. execute( options ) {
  52584. const editor = this.editor;
  52585. const model = editor.model;
  52586. const fileRepository = editor.plugins.get( _ckeditor_ckeditor5_upload_src_filerepository__WEBPACK_IMPORTED_MODULE_0__["default"] );
  52587. model.change( writer => {
  52588. const filesToUpload = Array.isArray( options.file ) ? options.file : [ options.file ];
  52589. for ( const file of filesToUpload ) {
  52590. uploadImage( writer, model, fileRepository, file );
  52591. }
  52592. } );
  52593. }
  52594. }
  52595. // Handles uploading single file.
  52596. //
  52597. // @param {module:engine/model/writer~writer} writer
  52598. // @param {module:engine/model/model~Model} model
  52599. // @param {File} file
  52600. function uploadImage( writer, model, fileRepository, file ) {
  52601. const loader = fileRepository.createLoader( file );
  52602. // Do not throw when upload adapter is not set. FileRepository will log an error anyway.
  52603. if ( !loader ) {
  52604. return;
  52605. }
  52606. Object(_image_utils__WEBPACK_IMPORTED_MODULE_2__["insertImage"])( writer, model, { uploadId: loader.id } );
  52607. }
  52608. /***/ }),
  52609. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadediting.js":
  52610. /*!**************************************************************************************!*\
  52611. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadediting.js ***!
  52612. \**************************************************************************************/
  52613. /*! exports provided: default, isHtmlIncluded */
  52614. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  52615. "use strict";
  52616. __webpack_require__.r(__webpack_exports__);
  52617. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageUploadEditing; });
  52618. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isHtmlIncluded", function() { return isHtmlIncluded; });
  52619. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  52620. /* harmony import */ var _ckeditor_ckeditor5_upload_src_filerepository__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-upload/src/filerepository */ "./node_modules/@ckeditor/ckeditor5-upload/src/filerepository.js");
  52621. /* harmony import */ var _ckeditor_ckeditor5_ui_src_notification_notification__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/notification/notification */ "./node_modules/@ckeditor/ckeditor5-ui/src/notification/notification.js");
  52622. /* harmony import */ var _ckeditor_ckeditor5_clipboard_src_clipboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-clipboard/src/clipboard */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboard.js");
  52623. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_upcastwriter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/upcastwriter */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/upcastwriter.js");
  52624. /* harmony import */ var _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/env */ "./node_modules/@ckeditor/ckeditor5-utils/src/env.js");
  52625. /* harmony import */ var _src_imageupload_imageuploadcommand__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../src/imageupload/imageuploadcommand */ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadcommand.js");
  52626. /* harmony import */ var _src_imageupload_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../src/imageupload/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/utils.js");
  52627. /* harmony import */ var _image_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../image/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
  52628. /**
  52629. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  52630. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  52631. */
  52632. /**
  52633. * @module image/imageupload/imageuploadediting
  52634. */
  52635. /**
  52636. * The editing part of the image upload feature. It registers the `'imageUpload'` command.
  52637. *
  52638. * @extends module:core/plugin~Plugin
  52639. */
  52640. class ImageUploadEditing extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  52641. /**
  52642. * @inheritDoc
  52643. */
  52644. static get requires() {
  52645. return [ _ckeditor_ckeditor5_upload_src_filerepository__WEBPACK_IMPORTED_MODULE_1__["default"], _ckeditor_ckeditor5_ui_src_notification_notification__WEBPACK_IMPORTED_MODULE_2__["default"], _ckeditor_ckeditor5_clipboard_src_clipboard__WEBPACK_IMPORTED_MODULE_3__["default"] ];
  52646. }
  52647. static get pluginName() {
  52648. return 'ImageUploadEditing';
  52649. }
  52650. /**
  52651. * @inheritDoc
  52652. */
  52653. constructor( editor ) {
  52654. super( editor );
  52655. editor.config.define( 'image', {
  52656. upload: {
  52657. types: [ 'jpeg', 'png', 'gif', 'bmp', 'webp', 'tiff' ]
  52658. }
  52659. } );
  52660. }
  52661. /**
  52662. * @inheritDoc
  52663. */
  52664. init() {
  52665. const editor = this.editor;
  52666. const doc = editor.model.document;
  52667. const schema = editor.model.schema;
  52668. const conversion = editor.conversion;
  52669. const fileRepository = editor.plugins.get( _ckeditor_ckeditor5_upload_src_filerepository__WEBPACK_IMPORTED_MODULE_1__["default"] );
  52670. const imageTypes = Object(_src_imageupload_utils__WEBPACK_IMPORTED_MODULE_7__["createImageTypeRegExp"])( editor.config.get( 'image.upload.types' ) );
  52671. // Setup schema to allow uploadId and uploadStatus for images.
  52672. schema.extend( 'image', {
  52673. allowAttributes: [ 'uploadId', 'uploadStatus' ]
  52674. } );
  52675. // Register imageUpload command.
  52676. editor.commands.add( 'imageUpload', new _src_imageupload_imageuploadcommand__WEBPACK_IMPORTED_MODULE_6__["default"]( editor ) );
  52677. // Register upcast converter for uploadId.
  52678. conversion.for( 'upcast' )
  52679. .attributeToAttribute( {
  52680. view: {
  52681. name: 'img',
  52682. key: 'uploadId'
  52683. },
  52684. model: 'uploadId'
  52685. } );
  52686. // Handle pasted images.
  52687. // For every image file, a new file loader is created and a placeholder image is
  52688. // inserted into the content. Then, those images are uploaded once they appear in the model
  52689. // (see Document#change listener below).
  52690. this.listenTo( editor.editing.view.document, 'clipboardInput', ( evt, data ) => {
  52691. // Skip if non empty HTML data is included.
  52692. // https://github.com/ckeditor/ckeditor5-upload/issues/68
  52693. if ( isHtmlIncluded( data.dataTransfer ) ) {
  52694. return;
  52695. }
  52696. const images = Array.from( data.dataTransfer.files ).filter( file => {
  52697. // See https://github.com/ckeditor/ckeditor5-image/pull/254.
  52698. if ( !file ) {
  52699. return false;
  52700. }
  52701. return imageTypes.test( file.type );
  52702. } );
  52703. const ranges = data.targetRanges.map( viewRange => editor.editing.mapper.toModelRange( viewRange ) );
  52704. editor.model.change( writer => {
  52705. // Set selection to paste target.
  52706. writer.setSelection( ranges );
  52707. if ( images.length ) {
  52708. evt.stop();
  52709. // Upload images after the selection has changed in order to ensure the command's state is refreshed.
  52710. editor.model.enqueueChange( 'default', () => {
  52711. editor.execute( 'imageUpload', { file: images } );
  52712. } );
  52713. }
  52714. } );
  52715. } );
  52716. // Handle HTML pasted with images with base64 or blob sources.
  52717. // For every image file, a new file loader is created and a placeholder image is
  52718. // inserted into the content. Then, those images are uploaded once they appear in the model
  52719. // (see Document#change listener below).
  52720. this.listenTo( editor.plugins.get( _ckeditor_ckeditor5_clipboard_src_clipboard__WEBPACK_IMPORTED_MODULE_3__["default"] ), 'inputTransformation', ( evt, data ) => {
  52721. const fetchableImages = Array.from( editor.editing.view.createRangeIn( data.content ) )
  52722. .filter( value => Object(_src_imageupload_utils__WEBPACK_IMPORTED_MODULE_7__["isLocalImage"])( value.item ) && !value.item.getAttribute( 'uploadProcessed' ) )
  52723. .map( value => { return { promise: Object(_src_imageupload_utils__WEBPACK_IMPORTED_MODULE_7__["fetchLocalImage"])( value.item ), imageElement: value.item }; } );
  52724. if ( !fetchableImages.length ) {
  52725. return;
  52726. }
  52727. const writer = new _ckeditor_ckeditor5_engine_src_view_upcastwriter__WEBPACK_IMPORTED_MODULE_4__["default"]( editor.editing.view.document );
  52728. for ( const fetchableImage of fetchableImages ) {
  52729. // Set attribute marking that the image was processed already.
  52730. writer.setAttribute( 'uploadProcessed', true, fetchableImage.imageElement );
  52731. const loader = fileRepository.createLoader( fetchableImage.promise );
  52732. if ( loader ) {
  52733. writer.setAttribute( 'src', '', fetchableImage.imageElement );
  52734. writer.setAttribute( 'uploadId', loader.id, fetchableImage.imageElement );
  52735. }
  52736. }
  52737. } );
  52738. // Prevents from the browser redirecting to the dropped image.
  52739. editor.editing.view.document.on( 'dragover', ( evt, data ) => {
  52740. data.preventDefault();
  52741. } );
  52742. // Upload placeholder images that appeared in the model.
  52743. doc.on( 'change', () => {
  52744. const changes = doc.differ.getChanges( { includeChangesInGraveyard: true } );
  52745. for ( const entry of changes ) {
  52746. if ( entry.type == 'insert' && entry.name != '$text' ) {
  52747. const item = entry.position.nodeAfter;
  52748. const isInGraveyard = entry.position.root.rootName == '$graveyard';
  52749. for ( const image of getImagesFromChangeItem( editor, item ) ) {
  52750. // Check if the image element still has upload id.
  52751. const uploadId = image.getAttribute( 'uploadId' );
  52752. if ( !uploadId ) {
  52753. continue;
  52754. }
  52755. // Check if the image is loaded on this client.
  52756. const loader = fileRepository.loaders.get( uploadId );
  52757. if ( !loader ) {
  52758. continue;
  52759. }
  52760. if ( isInGraveyard ) {
  52761. // If the image was inserted to the graveyard - abort the loading process.
  52762. loader.abort();
  52763. } else if ( loader.status == 'idle' ) {
  52764. // If the image was inserted into content and has not been loaded yet, start loading it.
  52765. this._readAndUpload( loader, image );
  52766. }
  52767. }
  52768. }
  52769. }
  52770. } );
  52771. }
  52772. /**
  52773. * Reads and uploads an image.
  52774. *
  52775. * The image is read from the disk and as a Base64-encoded string it is set temporarily to
  52776. * `image[src]`. When the image is successfully uploaded, the temporary data is replaced with the target
  52777. * image's URL (the URL to the uploaded image on the server).
  52778. *
  52779. * @protected
  52780. * @param {module:upload/filerepository~FileLoader} loader
  52781. * @param {module:engine/model/element~Element} imageElement
  52782. * @returns {Promise}
  52783. */
  52784. _readAndUpload( loader, imageElement ) {
  52785. const editor = this.editor;
  52786. const model = editor.model;
  52787. const t = editor.locale.t;
  52788. const fileRepository = editor.plugins.get( _ckeditor_ckeditor5_upload_src_filerepository__WEBPACK_IMPORTED_MODULE_1__["default"] );
  52789. const notification = editor.plugins.get( _ckeditor_ckeditor5_ui_src_notification_notification__WEBPACK_IMPORTED_MODULE_2__["default"] );
  52790. model.enqueueChange( 'transparent', writer => {
  52791. writer.setAttribute( 'uploadStatus', 'reading', imageElement );
  52792. } );
  52793. return loader.read()
  52794. .then( () => {
  52795. const promise = loader.upload();
  52796. // Force re–paint in Safari. Without it, the image will display with a wrong size.
  52797. // https://github.com/ckeditor/ckeditor5/issues/1975
  52798. /* istanbul ignore next */
  52799. if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_5__["default"].isSafari ) {
  52800. const viewFigure = editor.editing.mapper.toViewElement( imageElement );
  52801. const viewImg = Object(_image_utils__WEBPACK_IMPORTED_MODULE_8__["getViewImgFromWidget"])( viewFigure );
  52802. editor.editing.view.once( 'render', () => {
  52803. // Early returns just to be safe. There might be some code ran
  52804. // in between the outer scope and this callback.
  52805. if ( !viewImg.parent ) {
  52806. return;
  52807. }
  52808. const domFigure = editor.editing.view.domConverter.mapViewToDom( viewImg.parent );
  52809. if ( !domFigure ) {
  52810. return;
  52811. }
  52812. const originalDisplay = domFigure.style.display;
  52813. domFigure.style.display = 'none';
  52814. // Make sure this line will never be removed during minification for having "no effect".
  52815. domFigure._ckHack = domFigure.offsetHeight;
  52816. domFigure.style.display = originalDisplay;
  52817. } );
  52818. }
  52819. model.enqueueChange( 'transparent', writer => {
  52820. writer.setAttribute( 'uploadStatus', 'uploading', imageElement );
  52821. } );
  52822. return promise;
  52823. } )
  52824. .then( data => {
  52825. model.enqueueChange( 'transparent', writer => {
  52826. writer.setAttributes( { uploadStatus: 'complete', src: data.default }, imageElement );
  52827. this._parseAndSetSrcsetAttributeOnImage( data, imageElement, writer );
  52828. } );
  52829. clean();
  52830. } )
  52831. .catch( error => {
  52832. // If status is not 'error' nor 'aborted' - throw error because it means that something else went wrong,
  52833. // it might be generic error and it would be real pain to find what is going on.
  52834. if ( loader.status !== 'error' && loader.status !== 'aborted' ) {
  52835. throw error;
  52836. }
  52837. // Might be 'aborted'.
  52838. if ( loader.status == 'error' && error ) {
  52839. notification.showWarning( error, {
  52840. title: t( 'Upload failed' ),
  52841. namespace: 'upload'
  52842. } );
  52843. }
  52844. clean();
  52845. // Permanently remove image from insertion batch.
  52846. model.enqueueChange( 'transparent', writer => {
  52847. writer.remove( imageElement );
  52848. } );
  52849. } );
  52850. function clean() {
  52851. model.enqueueChange( 'transparent', writer => {
  52852. writer.removeAttribute( 'uploadId', imageElement );
  52853. writer.removeAttribute( 'uploadStatus', imageElement );
  52854. } );
  52855. fileRepository.destroyLoader( loader );
  52856. }
  52857. }
  52858. /**
  52859. * Creates the `srcset` attribute based on a given file upload response and sets it as an attribute to a specific image element.
  52860. *
  52861. * @protected
  52862. * @param {Object} data Data object from which `srcset` will be created.
  52863. * @param {module:engine/model/element~Element} image The image element on which the `srcset` attribute will be set.
  52864. * @param {module:engine/model/writer~Writer} writer
  52865. */
  52866. _parseAndSetSrcsetAttributeOnImage( data, image, writer ) {
  52867. // Srcset attribute for responsive images support.
  52868. let maxWidth = 0;
  52869. const srcsetAttribute = Object.keys( data )
  52870. // Filter out keys that are not integers.
  52871. .filter( key => {
  52872. const width = parseInt( key, 10 );
  52873. if ( !isNaN( width ) ) {
  52874. maxWidth = Math.max( maxWidth, width );
  52875. return true;
  52876. }
  52877. } )
  52878. // Convert each key to srcset entry.
  52879. .map( key => `${ data[ key ] } ${ key }w` )
  52880. // Join all entries.
  52881. .join( ', ' );
  52882. if ( srcsetAttribute != '' ) {
  52883. writer.setAttribute( 'srcset', {
  52884. data: srcsetAttribute,
  52885. width: maxWidth
  52886. }, image );
  52887. }
  52888. }
  52889. }
  52890. // Returns `true` if non-empty `text/html` is included in the data transfer.
  52891. //
  52892. // @param {module:clipboard/datatransfer~DataTransfer} dataTransfer
  52893. // @returns {Boolean}
  52894. function isHtmlIncluded( dataTransfer ) {
  52895. return Array.from( dataTransfer.types ).includes( 'text/html' ) && dataTransfer.getData( 'text/html' ) !== '';
  52896. }
  52897. function getImagesFromChangeItem( editor, item ) {
  52898. return Array.from( editor.model.createRangeOn( item ) )
  52899. .filter( value => value.item.is( 'element', 'image' ) )
  52900. .map( value => value.item );
  52901. }
  52902. /***/ }),
  52903. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadprogress.js":
  52904. /*!***************************************************************************************!*\
  52905. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadprogress.js ***!
  52906. \***************************************************************************************/
  52907. /*! exports provided: default */
  52908. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  52909. "use strict";
  52910. __webpack_require__.r(__webpack_exports__);
  52911. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageUploadProgress; });
  52912. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  52913. /* harmony import */ var _ckeditor_ckeditor5_upload_src_filerepository__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-upload/src/filerepository */ "./node_modules/@ckeditor/ckeditor5-upload/src/filerepository.js");
  52914. /* harmony import */ var _theme_icons_image_placeholder_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/icons/image_placeholder.svg */ "./node_modules/@ckeditor/ckeditor5-image/theme/icons/image_placeholder.svg");
  52915. /* harmony import */ var _image_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../image/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
  52916. /* harmony import */ var _theme_imageuploadprogress_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../theme/imageuploadprogress.css */ "./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css");
  52917. /* harmony import */ var _theme_imageuploadprogress_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_theme_imageuploadprogress_css__WEBPACK_IMPORTED_MODULE_4__);
  52918. /* harmony import */ var _theme_imageuploadicon_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../theme/imageuploadicon.css */ "./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css");
  52919. /* harmony import */ var _theme_imageuploadicon_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_theme_imageuploadicon_css__WEBPACK_IMPORTED_MODULE_5__);
  52920. /* harmony import */ var _theme_imageuploadloader_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../theme/imageuploadloader.css */ "./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css");
  52921. /* harmony import */ var _theme_imageuploadloader_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_theme_imageuploadloader_css__WEBPACK_IMPORTED_MODULE_6__);
  52922. /**
  52923. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  52924. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  52925. */
  52926. /**
  52927. * @module image/imageupload/imageuploadprogress
  52928. */
  52929. /* globals setTimeout */
  52930. /**
  52931. * The image upload progress plugin.
  52932. * It shows a placeholder when the image is read from the disk and a progress bar while the image is uploading.
  52933. *
  52934. * @extends module:core/plugin~Plugin
  52935. */
  52936. class ImageUploadProgress extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  52937. /**
  52938. * @inheritDoc
  52939. */
  52940. constructor( editor ) {
  52941. super( editor );
  52942. /**
  52943. * The image placeholder that is displayed before real image data can be accessed.
  52944. *
  52945. * @protected
  52946. * @member {String} #placeholder
  52947. */
  52948. this.placeholder = 'data:image/svg+xml;utf8,' + encodeURIComponent( _theme_icons_image_placeholder_svg__WEBPACK_IMPORTED_MODULE_2__["default"] );
  52949. }
  52950. /**
  52951. * @inheritDoc
  52952. */
  52953. init() {
  52954. const editor = this.editor;
  52955. // Upload status change - update image's view according to that status.
  52956. editor.editing.downcastDispatcher.on( 'attribute:uploadStatus:image', ( ...args ) => this.uploadStatusChange( ...args ) );
  52957. }
  52958. /**
  52959. * This method is called each time the image `uploadStatus` attribute is changed.
  52960. *
  52961. * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
  52962. * @param {Object} data Additional information about the change.
  52963. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
  52964. */
  52965. uploadStatusChange( evt, data, conversionApi ) {
  52966. const editor = this.editor;
  52967. const modelImage = data.item;
  52968. const uploadId = modelImage.getAttribute( 'uploadId' );
  52969. if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
  52970. return;
  52971. }
  52972. const fileRepository = editor.plugins.get( _ckeditor_ckeditor5_upload_src_filerepository__WEBPACK_IMPORTED_MODULE_1__["default"] );
  52973. const status = uploadId ? data.attributeNewValue : null;
  52974. const placeholder = this.placeholder;
  52975. const viewFigure = editor.editing.mapper.toViewElement( modelImage );
  52976. const viewWriter = conversionApi.writer;
  52977. if ( status == 'reading' ) {
  52978. // Start "appearing" effect and show placeholder with infinite progress bar on the top
  52979. // while image is read from disk.
  52980. _startAppearEffect( viewFigure, viewWriter );
  52981. _showPlaceholder( placeholder, viewFigure, viewWriter );
  52982. return;
  52983. }
  52984. // Show progress bar on the top of the image when image is uploading.
  52985. if ( status == 'uploading' ) {
  52986. const loader = fileRepository.loaders.get( uploadId );
  52987. // Start appear effect if needed - see https://github.com/ckeditor/ckeditor5-image/issues/191.
  52988. _startAppearEffect( viewFigure, viewWriter );
  52989. if ( !loader ) {
  52990. // There is no loader associated with uploadId - this means that image came from external changes.
  52991. // In such cases we still want to show the placeholder until image is fully uploaded.
  52992. // Show placeholder if needed - see https://github.com/ckeditor/ckeditor5-image/issues/191.
  52993. _showPlaceholder( placeholder, viewFigure, viewWriter );
  52994. } else {
  52995. // Hide placeholder and initialize progress bar showing upload progress.
  52996. _hidePlaceholder( viewFigure, viewWriter );
  52997. _showProgressBar( viewFigure, viewWriter, loader, editor.editing.view );
  52998. _displayLocalImage( viewFigure, viewWriter, loader );
  52999. }
  53000. return;
  53001. }
  53002. if ( status == 'complete' && fileRepository.loaders.get( uploadId ) ) {
  53003. _showCompleteIcon( viewFigure, viewWriter, editor.editing.view );
  53004. }
  53005. // Clean up.
  53006. _hideProgressBar( viewFigure, viewWriter );
  53007. _hidePlaceholder( viewFigure, viewWriter );
  53008. _stopAppearEffect( viewFigure, viewWriter );
  53009. }
  53010. }
  53011. // Adds ck-appear class to the image figure if one is not already applied.
  53012. //
  53013. // @param {module:engine/view/containerelement~ContainerElement} viewFigure
  53014. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  53015. function _startAppearEffect( viewFigure, writer ) {
  53016. if ( !viewFigure.hasClass( 'ck-appear' ) ) {
  53017. writer.addClass( 'ck-appear', viewFigure );
  53018. }
  53019. }
  53020. // Removes ck-appear class to the image figure if one is not already removed.
  53021. //
  53022. // @param {module:engine/view/containerelement~ContainerElement} viewFigure
  53023. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  53024. function _stopAppearEffect( viewFigure, writer ) {
  53025. writer.removeClass( 'ck-appear', viewFigure );
  53026. }
  53027. // Shows placeholder together with infinite progress bar on given image figure.
  53028. //
  53029. // @param {String} Data-uri with a svg placeholder.
  53030. // @param {module:engine/view/containerelement~ContainerElement} viewFigure
  53031. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  53032. function _showPlaceholder( placeholder, viewFigure, writer ) {
  53033. if ( !viewFigure.hasClass( 'ck-image-upload-placeholder' ) ) {
  53034. writer.addClass( 'ck-image-upload-placeholder', viewFigure );
  53035. }
  53036. const viewImg = Object(_image_utils__WEBPACK_IMPORTED_MODULE_3__["getViewImgFromWidget"])( viewFigure );
  53037. if ( viewImg.getAttribute( 'src' ) !== placeholder ) {
  53038. writer.setAttribute( 'src', placeholder, viewImg );
  53039. }
  53040. if ( !_getUIElement( viewFigure, 'placeholder' ) ) {
  53041. writer.insert( writer.createPositionAfter( viewImg ), _createPlaceholder( writer ) );
  53042. }
  53043. }
  53044. // Removes placeholder together with infinite progress bar on given image figure.
  53045. //
  53046. // @param {module:engine/view/containerelement~ContainerElement} viewFigure
  53047. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  53048. function _hidePlaceholder( viewFigure, writer ) {
  53049. if ( viewFigure.hasClass( 'ck-image-upload-placeholder' ) ) {
  53050. writer.removeClass( 'ck-image-upload-placeholder', viewFigure );
  53051. }
  53052. _removeUIElement( viewFigure, writer, 'placeholder' );
  53053. }
  53054. // Shows progress bar displaying upload progress.
  53055. // Attaches it to the file loader to update when upload percentace is changed.
  53056. //
  53057. // @param {module:engine/view/containerelement~ContainerElement} viewFigure
  53058. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  53059. // @param {module:upload/filerepository~FileLoader} loader
  53060. // @param {module:engine/view/view~View} view
  53061. function _showProgressBar( viewFigure, writer, loader, view ) {
  53062. const progressBar = _createProgressBar( writer );
  53063. writer.insert( writer.createPositionAt( viewFigure, 'end' ), progressBar );
  53064. // Update progress bar width when uploadedPercent is changed.
  53065. loader.on( 'change:uploadedPercent', ( evt, name, value ) => {
  53066. view.change( writer => {
  53067. writer.setStyle( 'width', value + '%', progressBar );
  53068. } );
  53069. } );
  53070. }
  53071. // Hides upload progress bar.
  53072. //
  53073. // @param {module:engine/view/containerelement~ContainerElement} viewFigure
  53074. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  53075. function _hideProgressBar( viewFigure, writer ) {
  53076. _removeUIElement( viewFigure, writer, 'progressBar' );
  53077. }
  53078. // Shows complete icon and hides after a certain amount of time.
  53079. //
  53080. // @param {module:engine/view/containerelement~ContainerElement} viewFigure
  53081. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  53082. // @param {module:engine/view/view~View} view
  53083. function _showCompleteIcon( viewFigure, writer, view ) {
  53084. const completeIcon = writer.createUIElement( 'div', { class: 'ck-image-upload-complete-icon' } );
  53085. writer.insert( writer.createPositionAt( viewFigure, 'end' ), completeIcon );
  53086. setTimeout( () => {
  53087. view.change( writer => writer.remove( writer.createRangeOn( completeIcon ) ) );
  53088. }, 3000 );
  53089. }
  53090. // Create progress bar element using {@link module:engine/view/uielement~UIElement}.
  53091. //
  53092. // @private
  53093. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  53094. // @returns {module:engine/view/uielement~UIElement}
  53095. function _createProgressBar( writer ) {
  53096. const progressBar = writer.createUIElement( 'div', { class: 'ck-progress-bar' } );
  53097. writer.setCustomProperty( 'progressBar', true, progressBar );
  53098. return progressBar;
  53099. }
  53100. // Create placeholder element using {@link module:engine/view/uielement~UIElement}.
  53101. //
  53102. // @private
  53103. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  53104. // @returns {module:engine/view/uielement~UIElement}
  53105. function _createPlaceholder( writer ) {
  53106. const placeholder = writer.createUIElement( 'div', { class: 'ck-upload-placeholder-loader' } );
  53107. writer.setCustomProperty( 'placeholder', true, placeholder );
  53108. return placeholder;
  53109. }
  53110. // Returns {@link module:engine/view/uielement~UIElement} of given unique property from image figure element.
  53111. // Returns `undefined` if element is not found.
  53112. //
  53113. // @private
  53114. // @param {module:engine/view/element~Element} imageFigure
  53115. // @param {String} uniqueProperty
  53116. // @returns {module:engine/view/uielement~UIElement|undefined}
  53117. function _getUIElement( imageFigure, uniqueProperty ) {
  53118. for ( const child of imageFigure.getChildren() ) {
  53119. if ( child.getCustomProperty( uniqueProperty ) ) {
  53120. return child;
  53121. }
  53122. }
  53123. }
  53124. // Removes {@link module:engine/view/uielement~UIElement} of given unique property from image figure element.
  53125. //
  53126. // @private
  53127. // @param {module:engine/view/element~Element} imageFigure
  53128. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  53129. // @param {String} uniqueProperty
  53130. function _removeUIElement( viewFigure, writer, uniqueProperty ) {
  53131. const element = _getUIElement( viewFigure, uniqueProperty );
  53132. if ( element ) {
  53133. writer.remove( writer.createRangeOn( element ) );
  53134. }
  53135. }
  53136. // Displays local data from file loader.
  53137. //
  53138. // @param {module:engine/view/element~Element} imageFigure
  53139. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  53140. // @param {module:upload/filerepository~FileLoader} loader
  53141. function _displayLocalImage( viewFigure, writer, loader ) {
  53142. if ( loader.data ) {
  53143. const viewImg = Object(_image_utils__WEBPACK_IMPORTED_MODULE_3__["getViewImgFromWidget"])( viewFigure );
  53144. writer.setAttribute( 'src', loader.data, viewImg );
  53145. }
  53146. }
  53147. /***/ }),
  53148. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadui.js":
  53149. /*!*********************************************************************************!*\
  53150. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadui.js ***!
  53151. \*********************************************************************************/
  53152. /*! exports provided: default */
  53153. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53154. "use strict";
  53155. __webpack_require__.r(__webpack_exports__);
  53156. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ImageUploadUI; });
  53157. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  53158. /* harmony import */ var _ckeditor_ckeditor5_upload_src_ui_filedialogbuttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-upload/src/ui/filedialogbuttonview */ "./node_modules/@ckeditor/ckeditor5-upload/src/ui/filedialogbuttonview.js");
  53159. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/utils.js");
  53160. /* harmony import */ var _ckeditor_ckeditor5_core_theme_icons_image_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/theme/icons/image.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/image.svg");
  53161. /**
  53162. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  53163. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  53164. */
  53165. /**
  53166. * @module image/imageupload/imageuploadui
  53167. */
  53168. /**
  53169. * The image upload button plugin.
  53170. *
  53171. * For a detailed overview, check the {@glink features/image-upload/image-upload Image upload feature} documentation.
  53172. *
  53173. * Adds the `'imageUpload'` button to the {@link module:ui/componentfactory~ComponentFactory UI component factory}.
  53174. *
  53175. * @extends module:core/plugin~Plugin
  53176. */
  53177. class ImageUploadUI extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  53178. /**
  53179. * @inheritDoc
  53180. */
  53181. static get pluginName() {
  53182. return 'ImageUploadUI';
  53183. }
  53184. /**
  53185. * @inheritDoc
  53186. */
  53187. init() {
  53188. const editor = this.editor;
  53189. const t = editor.t;
  53190. // Setup `imageUpload` button.
  53191. editor.ui.componentFactory.add( 'imageUpload', locale => {
  53192. const view = new _ckeditor_ckeditor5_upload_src_ui_filedialogbuttonview__WEBPACK_IMPORTED_MODULE_1__["default"]( locale );
  53193. const command = editor.commands.get( 'imageUpload' );
  53194. const imageTypes = editor.config.get( 'image.upload.types' );
  53195. const imageTypesRegExp = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["createImageTypeRegExp"])( imageTypes );
  53196. view.set( {
  53197. acceptedType: imageTypes.map( type => `image/${ type }` ).join( ',' ),
  53198. allowMultipleFiles: true
  53199. } );
  53200. view.buttonView.set( {
  53201. label: t( 'Insert image' ),
  53202. icon: _ckeditor_ckeditor5_core_theme_icons_image_svg__WEBPACK_IMPORTED_MODULE_3__["default"],
  53203. tooltip: true
  53204. } );
  53205. view.buttonView.bind( 'isEnabled' ).to( command );
  53206. view.on( 'done', ( evt, files ) => {
  53207. const imagesToUpload = Array.from( files ).filter( file => imageTypesRegExp.test( file.type ) );
  53208. if ( imagesToUpload.length ) {
  53209. editor.execute( 'imageUpload', { file: imagesToUpload } );
  53210. }
  53211. } );
  53212. return view;
  53213. } );
  53214. }
  53215. }
  53216. /***/ }),
  53217. /***/ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload/utils.js":
  53218. /*!*************************************************************************!*\
  53219. !*** ./node_modules/@ckeditor/ckeditor5-image/src/imageupload/utils.js ***!
  53220. \*************************************************************************/
  53221. /*! exports provided: createImageTypeRegExp, fetchLocalImage, isLocalImage */
  53222. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53223. "use strict";
  53224. __webpack_require__.r(__webpack_exports__);
  53225. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createImageTypeRegExp", function() { return createImageTypeRegExp; });
  53226. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fetchLocalImage", function() { return fetchLocalImage; });
  53227. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLocalImage", function() { return isLocalImage; });
  53228. /**
  53229. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  53230. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  53231. */
  53232. /**
  53233. * @module image/imageupload/utils
  53234. */
  53235. /* global fetch, File */
  53236. /**
  53237. * Creates a regular expression used to test for image files.
  53238. *
  53239. * const imageType = createImageTypeRegExp( [ 'png', 'jpeg', 'svg+xml', 'vnd.microsoft.icon' ] );
  53240. *
  53241. * console.log( 'is supported image', imageType.test( file.type ) );
  53242. *
  53243. * @param {Array.<String>} types
  53244. * @returns {RegExp}
  53245. */
  53246. function createImageTypeRegExp( types ) {
  53247. // Sanitize the MIME type name which may include: "+", "-" or ".".
  53248. const regExpSafeNames = types.map( type => type.replace( '+', '\\+' ) );
  53249. return new RegExp( `^image\\/(${ regExpSafeNames.join( '|' ) })$` );
  53250. }
  53251. /**
  53252. * Creates a promise that fetches the image local source (Base64 or blob) and resolves with a `File` object.
  53253. *
  53254. * @param {module:engine/view/element~Element} image Image whose source to fetch.
  53255. * @returns {Promise.<File>} A promise which resolves when an image source is fetched and converted to a `File` instance.
  53256. * It resolves with a `File` object. If there were any errors during file processing, the promise will be rejected.
  53257. */
  53258. function fetchLocalImage( image ) {
  53259. return new Promise( ( resolve, reject ) => {
  53260. const imageSrc = image.getAttribute( 'src' );
  53261. // Fetch works asynchronously and so does not block browser UI when processing data.
  53262. fetch( imageSrc )
  53263. .then( resource => resource.blob() )
  53264. .then( blob => {
  53265. const mimeType = getImageMimeType( blob, imageSrc );
  53266. const ext = mimeType.replace( 'image/', '' );
  53267. const filename = `image.${ ext }`;
  53268. const file = new File( [ blob ], filename, { type: mimeType } );
  53269. resolve( file );
  53270. } )
  53271. .catch( reject );
  53272. } );
  53273. }
  53274. /**
  53275. * Checks whether a given node is an image element with a local source (Base64 or blob).
  53276. *
  53277. * @param {module:engine/view/node~Node} node The node to check.
  53278. * @returns {Boolean}
  53279. */
  53280. function isLocalImage( node ) {
  53281. if ( !node.is( 'element', 'img' ) || !node.getAttribute( 'src' ) ) {
  53282. return false;
  53283. }
  53284. return node.getAttribute( 'src' ).match( /^data:image\/\w+;base64,/g ) ||
  53285. node.getAttribute( 'src' ).match( /^blob:/g );
  53286. }
  53287. // Extracts an image type based on its blob representation or its source.
  53288. //
  53289. // @param {String} src Image `src` attribute value.
  53290. // @param {Blob} blob Image blob representation.
  53291. // @returns {String}
  53292. function getImageMimeType( blob, src ) {
  53293. if ( blob.type ) {
  53294. return blob.type;
  53295. } else if ( src.match( /data:(image\/\w+);base64/ ) ) {
  53296. return src.match( /data:(image\/\w+);base64/ )[ 1 ].toLowerCase();
  53297. } else {
  53298. // Fallback to 'jpeg' as common extension.
  53299. return 'image/jpeg';
  53300. }
  53301. }
  53302. /***/ }),
  53303. /***/ "./node_modules/@ckeditor/ckeditor5-image/theme/icons/image_placeholder.svg":
  53304. /*!**********************************************************************************!*\
  53305. !*** ./node_modules/@ckeditor/ckeditor5-image/theme/icons/image_placeholder.svg ***!
  53306. \**********************************************************************************/
  53307. /*! exports provided: default */
  53308. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53309. "use strict";
  53310. __webpack_require__.r(__webpack_exports__);
  53311. /* harmony default export */ __webpack_exports__["default"] = ("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 700 250\"><rect rx=\"4\"/></svg>");
  53312. /***/ }),
  53313. /***/ "./node_modules/@ckeditor/ckeditor5-image/theme/image.css":
  53314. /*!****************************************************************!*\
  53315. !*** ./node_modules/@ckeditor/ckeditor5-image/theme/image.css ***!
  53316. \****************************************************************/
  53317. /*! no static exports found */
  53318. /***/ (function(module, exports, __webpack_require__) {
  53319. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  53320. var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./image.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/image.css");
  53321. content = content.__esModule ? content.default : content;
  53322. if (typeof content === 'string') {
  53323. content = [[module.i, content, '']];
  53324. }
  53325. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  53326. options.insert = "head";
  53327. options.singleton = true;
  53328. var update = api(content, options);
  53329. module.exports = content.locals || {};
  53330. /***/ }),
  53331. /***/ "./node_modules/@ckeditor/ckeditor5-image/theme/imagecaption.css":
  53332. /*!***********************************************************************!*\
  53333. !*** ./node_modules/@ckeditor/ckeditor5-image/theme/imagecaption.css ***!
  53334. \***********************************************************************/
  53335. /*! no static exports found */
  53336. /***/ (function(module, exports, __webpack_require__) {
  53337. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  53338. var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./imagecaption.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imagecaption.css");
  53339. content = content.__esModule ? content.default : content;
  53340. if (typeof content === 'string') {
  53341. content = [[module.i, content, '']];
  53342. }
  53343. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  53344. options.insert = "head";
  53345. options.singleton = true;
  53346. var update = api(content, options);
  53347. module.exports = content.locals || {};
  53348. /***/ }),
  53349. /***/ "./node_modules/@ckeditor/ckeditor5-image/theme/imageresize.css":
  53350. /*!**********************************************************************!*\
  53351. !*** ./node_modules/@ckeditor/ckeditor5-image/theme/imageresize.css ***!
  53352. \**********************************************************************/
  53353. /*! no static exports found */
  53354. /***/ (function(module, exports, __webpack_require__) {
  53355. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  53356. var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./imageresize.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imageresize.css");
  53357. content = content.__esModule ? content.default : content;
  53358. if (typeof content === 'string') {
  53359. content = [[module.i, content, '']];
  53360. }
  53361. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  53362. options.insert = "head";
  53363. options.singleton = true;
  53364. var update = api(content, options);
  53365. module.exports = content.locals || {};
  53366. /***/ }),
  53367. /***/ "./node_modules/@ckeditor/ckeditor5-image/theme/imagestyle.css":
  53368. /*!*********************************************************************!*\
  53369. !*** ./node_modules/@ckeditor/ckeditor5-image/theme/imagestyle.css ***!
  53370. \*********************************************************************/
  53371. /*! no static exports found */
  53372. /***/ (function(module, exports, __webpack_require__) {
  53373. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  53374. var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./imagestyle.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imagestyle.css");
  53375. content = content.__esModule ? content.default : content;
  53376. if (typeof content === 'string') {
  53377. content = [[module.i, content, '']];
  53378. }
  53379. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  53380. options.insert = "head";
  53381. options.singleton = true;
  53382. var update = api(content, options);
  53383. module.exports = content.locals || {};
  53384. /***/ }),
  53385. /***/ "./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css":
  53386. /*!**************************************************************************!*\
  53387. !*** ./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css ***!
  53388. \**************************************************************************/
  53389. /*! no static exports found */
  53390. /***/ (function(module, exports, __webpack_require__) {
  53391. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  53392. var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./imageuploadicon.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css");
  53393. content = content.__esModule ? content.default : content;
  53394. if (typeof content === 'string') {
  53395. content = [[module.i, content, '']];
  53396. }
  53397. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  53398. options.insert = "head";
  53399. options.singleton = true;
  53400. var update = api(content, options);
  53401. module.exports = content.locals || {};
  53402. /***/ }),
  53403. /***/ "./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css":
  53404. /*!****************************************************************************!*\
  53405. !*** ./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css ***!
  53406. \****************************************************************************/
  53407. /*! no static exports found */
  53408. /***/ (function(module, exports, __webpack_require__) {
  53409. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  53410. var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./imageuploadloader.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css");
  53411. content = content.__esModule ? content.default : content;
  53412. if (typeof content === 'string') {
  53413. content = [[module.i, content, '']];
  53414. }
  53415. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  53416. options.insert = "head";
  53417. options.singleton = true;
  53418. var update = api(content, options);
  53419. module.exports = content.locals || {};
  53420. /***/ }),
  53421. /***/ "./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css":
  53422. /*!******************************************************************************!*\
  53423. !*** ./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css ***!
  53424. \******************************************************************************/
  53425. /*! no static exports found */
  53426. /***/ (function(module, exports, __webpack_require__) {
  53427. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  53428. var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./imageuploadprogress.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css");
  53429. content = content.__esModule ? content.default : content;
  53430. if (typeof content === 'string') {
  53431. content = [[module.i, content, '']];
  53432. }
  53433. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  53434. options.insert = "head";
  53435. options.singleton = true;
  53436. var update = api(content, options);
  53437. module.exports = content.locals || {};
  53438. /***/ }),
  53439. /***/ "./node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css":
  53440. /*!******************************************************************************!*\
  53441. !*** ./node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css ***!
  53442. \******************************************************************************/
  53443. /*! no static exports found */
  53444. /***/ (function(module, exports, __webpack_require__) {
  53445. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  53446. var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./textalternativeform.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css");
  53447. content = content.__esModule ? content.default : content;
  53448. if (typeof content === 'string') {
  53449. content = [[module.i, content, '']];
  53450. }
  53451. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  53452. options.insert = "head";
  53453. options.singleton = true;
  53454. var update = api(content, options);
  53455. module.exports = content.locals || {};
  53456. /***/ }),
  53457. /***/ "./node_modules/@ckeditor/ckeditor5-indent/src/indent.js":
  53458. /*!***************************************************************!*\
  53459. !*** ./node_modules/@ckeditor/ckeditor5-indent/src/indent.js ***!
  53460. \***************************************************************/
  53461. /*! exports provided: default */
  53462. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53463. "use strict";
  53464. __webpack_require__.r(__webpack_exports__);
  53465. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Indent; });
  53466. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  53467. /* harmony import */ var _indentediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./indentediting */ "./node_modules/@ckeditor/ckeditor5-indent/src/indentediting.js");
  53468. /* harmony import */ var _indentui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./indentui */ "./node_modules/@ckeditor/ckeditor5-indent/src/indentui.js");
  53469. /**
  53470. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  53471. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  53472. */
  53473. /**
  53474. * @module indent/indent
  53475. */
  53476. /**
  53477. * The indent feature.
  53478. *
  53479. * This plugin acts as a single entry point plugin for other features that implement indentation of elements like lists or paragraphs.
  53480. *
  53481. * The compatible features are:
  53482. *
  53483. * * The {@link module:list/list~List} or {@link module:list/listediting~ListEditing} feature for list indentation.
  53484. * * The {@link module:indent/indentblock~IndentBlock} feature for block indentation.
  53485. *
  53486. * This is a "glue" plugin that loads the following plugins:
  53487. *
  53488. * * The {@link module:indent/indentediting~IndentEditing indent editing feature}.
  53489. * * The {@link module:indent/indentui~IndentUI indent UI feature}.
  53490. *
  53491. * The dependent plugins register the `'indent'` and `'outdent'` commands and introduce the `'indent'` and `'outdent'` buttons
  53492. * that allow to increase or decrease text indentation of supported elements.
  53493. *
  53494. * **Note**: In order for the commands and buttons to work, at least one of compatible features is required.
  53495. *
  53496. * @extends module:core/plugin~Plugin
  53497. */
  53498. class Indent extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  53499. /**
  53500. * @inheritDoc
  53501. */
  53502. static get pluginName() {
  53503. return 'Indent';
  53504. }
  53505. /**
  53506. * @inheritDoc
  53507. */
  53508. static get requires() {
  53509. return [ _indentediting__WEBPACK_IMPORTED_MODULE_1__["default"], _indentui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  53510. }
  53511. }
  53512. /***/ }),
  53513. /***/ "./node_modules/@ckeditor/ckeditor5-indent/src/indentediting.js":
  53514. /*!**********************************************************************!*\
  53515. !*** ./node_modules/@ckeditor/ckeditor5-indent/src/indentediting.js ***!
  53516. \**********************************************************************/
  53517. /*! exports provided: default */
  53518. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53519. "use strict";
  53520. __webpack_require__.r(__webpack_exports__);
  53521. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return IndentEditing; });
  53522. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  53523. /* harmony import */ var _ckeditor_ckeditor5_core_src_multicommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/multicommand */ "./node_modules/@ckeditor/ckeditor5-core/src/multicommand.js");
  53524. /**
  53525. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  53526. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  53527. */
  53528. /**
  53529. * @module indent/indentediting
  53530. */
  53531. /**
  53532. * The indent editing feature.
  53533. *
  53534. * This plugin registers the `'indent'` and `'outdent'` commands.
  53535. *
  53536. * **Note**: In order for the commands to work, at least one of the compatible features is required. Read more in the
  53537. * {@link module:indent/indent~Indent indent feature} API documentation.
  53538. *
  53539. * @extends module:core/plugin~Plugin
  53540. */
  53541. class IndentEditing extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  53542. /**
  53543. * @inheritDoc
  53544. */
  53545. static get pluginName() {
  53546. return 'IndentEditing';
  53547. }
  53548. /**
  53549. * @inheritDoc
  53550. */
  53551. init() {
  53552. const editor = this.editor;
  53553. editor.commands.add( 'indent', new _ckeditor_ckeditor5_core_src_multicommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor ) );
  53554. editor.commands.add( 'outdent', new _ckeditor_ckeditor5_core_src_multicommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor ) );
  53555. }
  53556. }
  53557. /***/ }),
  53558. /***/ "./node_modules/@ckeditor/ckeditor5-indent/src/indentui.js":
  53559. /*!*****************************************************************!*\
  53560. !*** ./node_modules/@ckeditor/ckeditor5-indent/src/indentui.js ***!
  53561. \*****************************************************************/
  53562. /*! exports provided: default */
  53563. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53564. "use strict";
  53565. __webpack_require__.r(__webpack_exports__);
  53566. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return IndentUI; });
  53567. /* harmony import */ var _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  53568. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  53569. /* harmony import */ var _theme_icons_indent_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../theme/icons/indent.svg */ "./node_modules/@ckeditor/ckeditor5-indent/theme/icons/indent.svg");
  53570. /* harmony import */ var _theme_icons_outdent_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../theme/icons/outdent.svg */ "./node_modules/@ckeditor/ckeditor5-indent/theme/icons/outdent.svg");
  53571. /**
  53572. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  53573. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  53574. */
  53575. /**
  53576. * @module indent/indentui
  53577. */
  53578. /**
  53579. * The indent UI feature.
  53580. *
  53581. * This plugin registers the `'indent'` and `'outdent'` buttons.
  53582. *
  53583. * **Note**: In order for the commands to work, at least one of the compatible features is required. Read more in
  53584. * the {@link module:indent/indent~Indent indent feature} API documentation.
  53585. *
  53586. * @extends module:core/plugin~Plugin
  53587. */
  53588. class IndentUI extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_1__["default"] {
  53589. /**
  53590. * @inheritDoc
  53591. */
  53592. static get pluginName() {
  53593. return 'IndentUI';
  53594. }
  53595. /**
  53596. * @inheritDoc
  53597. */
  53598. init() {
  53599. const editor = this.editor;
  53600. const locale = editor.locale;
  53601. const t = editor.t;
  53602. const localizedIndentIcon = locale.uiLanguageDirection == 'ltr' ? _theme_icons_indent_svg__WEBPACK_IMPORTED_MODULE_2__["default"] : _theme_icons_outdent_svg__WEBPACK_IMPORTED_MODULE_3__["default"];
  53603. const localizedOutdentIcon = locale.uiLanguageDirection == 'ltr' ? _theme_icons_outdent_svg__WEBPACK_IMPORTED_MODULE_3__["default"] : _theme_icons_indent_svg__WEBPACK_IMPORTED_MODULE_2__["default"];
  53604. this._defineButton( 'indent', t( 'Increase indent' ), localizedIndentIcon );
  53605. this._defineButton( 'outdent', t( 'Decrease indent' ), localizedOutdentIcon );
  53606. }
  53607. /**
  53608. * Defines a UI button.
  53609. *
  53610. * @param {String} commandName
  53611. * @param {String} label
  53612. * @param {String} icon
  53613. * @private
  53614. */
  53615. _defineButton( commandName, label, icon ) {
  53616. const editor = this.editor;
  53617. editor.ui.componentFactory.add( commandName, locale => {
  53618. const command = editor.commands.get( commandName );
  53619. const view = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_0__["default"]( locale );
  53620. view.set( {
  53621. label,
  53622. icon,
  53623. tooltip: true
  53624. } );
  53625. view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
  53626. this.listenTo( view, 'execute', () => {
  53627. editor.execute( commandName );
  53628. editor.editing.view.focus();
  53629. } );
  53630. return view;
  53631. } );
  53632. }
  53633. }
  53634. /***/ }),
  53635. /***/ "./node_modules/@ckeditor/ckeditor5-indent/theme/icons/indent.svg":
  53636. /*!************************************************************************!*\
  53637. !*** ./node_modules/@ckeditor/ckeditor5-indent/theme/icons/indent.svg ***!
  53638. \************************************************************************/
  53639. /*! exports provided: default */
  53640. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53641. "use strict";
  53642. __webpack_require__.r(__webpack_exports__);
  53643. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm5 6c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM2.75 16.5h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 1 0 0 1.5zM1.632 6.95L5.02 9.358a.4.4 0 0 1-.013.661l-3.39 2.207A.4.4 0 0 1 1 11.892V7.275a.4.4 0 0 1 .632-.326z\"/></svg>");
  53644. /***/ }),
  53645. /***/ "./node_modules/@ckeditor/ckeditor5-indent/theme/icons/outdent.svg":
  53646. /*!*************************************************************************!*\
  53647. !*** ./node_modules/@ckeditor/ckeditor5-indent/theme/icons/outdent.svg ***!
  53648. \*************************************************************************/
  53649. /*! exports provided: default */
  53650. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53651. "use strict";
  53652. __webpack_require__.r(__webpack_exports__);
  53653. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm5 6c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM2.75 16.5h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 1 0 0 1.5zm1.618-9.55L.98 9.358a.4.4 0 0 0 .013.661l3.39 2.207A.4.4 0 0 0 5 11.892V7.275a.4.4 0 0 0-.632-.326z\"/></svg>");
  53654. /***/ }),
  53655. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/autolink.js":
  53656. /*!***************************************************************!*\
  53657. !*** ./node_modules/@ckeditor/ckeditor5-link/src/autolink.js ***!
  53658. \***************************************************************/
  53659. /*! exports provided: default */
  53660. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53661. "use strict";
  53662. __webpack_require__.r(__webpack_exports__);
  53663. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AutoLink; });
  53664. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  53665. /* harmony import */ var _ckeditor_ckeditor5_typing_src_textwatcher__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-typing/src/textwatcher */ "./node_modules/@ckeditor/ckeditor5-typing/src/textwatcher.js");
  53666. /* harmony import */ var _ckeditor_ckeditor5_typing_src_utils_getlasttextline__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-typing/src/utils/getlasttextline */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/getlasttextline.js");
  53667. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-link/src/utils.js");
  53668. /**
  53669. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  53670. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  53671. */
  53672. /**
  53673. * @module link/autolink
  53674. */
  53675. const MIN_LINK_LENGTH_WITH_SPACE_AT_END = 4; // Ie: "t.co " (length 5).
  53676. // This was tweak from https://gist.github.com/dperini/729294.
  53677. const URL_REG_EXP = new RegExp(
  53678. // Group 1: Line start or after a space.
  53679. '(^|\\s)' +
  53680. // Group 2: Detected URL (or e-mail).
  53681. '(' +
  53682. // Protocol identifier or short syntax "//"
  53683. // a. Full form http://user@foo.bar.baz:8080/foo/bar.html#baz?foo=bar
  53684. '(' +
  53685. '(?:(?:(?:https?|ftp):)?\\/\\/)' +
  53686. // BasicAuth using user:pass (optional)
  53687. '(?:\\S+(?::\\S*)?@)?' +
  53688. '(?:' +
  53689. // Host & domain names.
  53690. '(?![-_])(?:[-\\w\\u00a1-\\uffff]{0,63}[^-_]\\.)+' +
  53691. // TLD identifier name.
  53692. '(?:[a-z\\u00a1-\\uffff]{2,})' +
  53693. ')' +
  53694. // port number (optional)
  53695. '(?::\\d{2,5})?' +
  53696. // resource path (optional)
  53697. '(?:[/?#]\\S*)?' +
  53698. ')' +
  53699. '|' +
  53700. // b. Short form (either www.example.com or example@example.com)
  53701. '(' +
  53702. '(www.|(\\S+@))' +
  53703. // Host & domain names.
  53704. '((?![-_])(?:[-\\w\\u00a1-\\uffff]{0,63}[^-_]\\.))+' +
  53705. // TLD identifier name.
  53706. '(?:[a-z\\u00a1-\\uffff]{2,})' +
  53707. ')' +
  53708. ')$', 'i' );
  53709. const URL_GROUP_IN_MATCH = 2;
  53710. /**
  53711. * The autolink plugin.
  53712. *
  53713. * @extends module:core/plugin~Plugin
  53714. */
  53715. class AutoLink extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  53716. /**
  53717. * @inheritDoc
  53718. */
  53719. static get pluginName() {
  53720. return 'AutoLink';
  53721. }
  53722. /**
  53723. * @inheritDoc
  53724. */
  53725. init() {
  53726. const editor = this.editor;
  53727. const selection = editor.model.document.selection;
  53728. selection.on( 'change:range', () => {
  53729. // Disable plugin when selection is inside a code block.
  53730. this.isEnabled = !selection.anchor.parent.is( 'element', 'codeBlock' );
  53731. } );
  53732. this._enableTypingHandling();
  53733. }
  53734. /**
  53735. * @inheritDoc
  53736. */
  53737. afterInit() {
  53738. this._enableEnterHandling();
  53739. this._enableShiftEnterHandling();
  53740. }
  53741. /**
  53742. * Enables autolinking on typing.
  53743. *
  53744. * @private
  53745. */
  53746. _enableTypingHandling() {
  53747. const editor = this.editor;
  53748. const watcher = new _ckeditor_ckeditor5_typing_src_textwatcher__WEBPACK_IMPORTED_MODULE_1__["default"]( editor.model, text => {
  53749. // 1. Detect "Space" after a text with a potential link.
  53750. if ( !isSingleSpaceAtTheEnd( text ) ) {
  53751. return;
  53752. }
  53753. // 2. Check text before last typed "Space".
  53754. const url = getUrlAtTextEnd( text.substr( 0, text.length - 1 ) );
  53755. if ( url ) {
  53756. return { url };
  53757. }
  53758. } );
  53759. const input = editor.plugins.get( 'Input' );
  53760. watcher.on( 'matched:data', ( evt, data ) => {
  53761. const { batch, range, url } = data;
  53762. if ( !input.isInput( batch ) ) {
  53763. return;
  53764. }
  53765. const linkEnd = range.end.getShiftedBy( -1 ); // Executed after a space character.
  53766. const linkStart = linkEnd.getShiftedBy( -url.length );
  53767. const linkRange = editor.model.createRange( linkStart, linkEnd );
  53768. this._applyAutoLink( url, linkRange );
  53769. } );
  53770. watcher.bind( 'isEnabled' ).to( this );
  53771. }
  53772. /**
  53773. * Enables autolinking on the <kbd>Enter</kbd> key.
  53774. *
  53775. * @private
  53776. */
  53777. _enableEnterHandling() {
  53778. const editor = this.editor;
  53779. const model = editor.model;
  53780. const enterCommand = editor.commands.get( 'enter' );
  53781. if ( !enterCommand ) {
  53782. return;
  53783. }
  53784. enterCommand.on( 'execute', () => {
  53785. const position = model.document.selection.getFirstPosition();
  53786. if ( !position.parent.previousSibling ) {
  53787. return;
  53788. }
  53789. const rangeToCheck = model.createRangeIn( position.parent.previousSibling );
  53790. this._checkAndApplyAutoLinkOnRange( rangeToCheck );
  53791. } );
  53792. }
  53793. /**
  53794. * Enables autolinking on the <kbd>Shift</kbd>+<kbd>Enter</kbd> keyboard shortcut.
  53795. *
  53796. * @private
  53797. */
  53798. _enableShiftEnterHandling() {
  53799. const editor = this.editor;
  53800. const model = editor.model;
  53801. const shiftEnterCommand = editor.commands.get( 'shiftEnter' );
  53802. if ( !shiftEnterCommand ) {
  53803. return;
  53804. }
  53805. shiftEnterCommand.on( 'execute', () => {
  53806. const position = model.document.selection.getFirstPosition();
  53807. const rangeToCheck = model.createRange(
  53808. model.createPositionAt( position.parent, 0 ),
  53809. position.getShiftedBy( -1 )
  53810. );
  53811. this._checkAndApplyAutoLinkOnRange( rangeToCheck );
  53812. } );
  53813. }
  53814. /**
  53815. * Checks if the passed range contains a linkable text.
  53816. *
  53817. * @param {module:engine/model/range~Range} rangeToCheck
  53818. * @private
  53819. */
  53820. _checkAndApplyAutoLinkOnRange( rangeToCheck ) {
  53821. const model = this.editor.model;
  53822. const { text, range } = Object(_ckeditor_ckeditor5_typing_src_utils_getlasttextline__WEBPACK_IMPORTED_MODULE_2__["default"])( rangeToCheck, model );
  53823. const url = getUrlAtTextEnd( text );
  53824. if ( url ) {
  53825. const linkRange = model.createRange(
  53826. range.end.getShiftedBy( -url.length ),
  53827. range.end
  53828. );
  53829. this._applyAutoLink( url, linkRange );
  53830. }
  53831. }
  53832. /**
  53833. * Applies a link on a given range.
  53834. *
  53835. * @param {String} url The URL to link.
  53836. * @param {module:engine/model/range~Range} range The text range to apply the link attribute to.
  53837. * @private
  53838. */
  53839. _applyAutoLink( link, range ) {
  53840. const model = this.editor.model;
  53841. if ( !this.isEnabled || !isLinkAllowedOnRange( range, model ) ) {
  53842. return;
  53843. }
  53844. // Enqueue change to make undo step.
  53845. model.enqueueChange( writer => {
  53846. const defaultProtocol = this.editor.config.get( 'link.defaultProtocol' );
  53847. const parsedUrl = Object(_utils__WEBPACK_IMPORTED_MODULE_3__["addLinkProtocolIfApplicable"])( link, defaultProtocol );
  53848. writer.setAttribute( 'linkHref', parsedUrl, range );
  53849. } );
  53850. }
  53851. }
  53852. // Check if text should be evaluated by the plugin in order to reduce number of RegExp checks on whole text.
  53853. function isSingleSpaceAtTheEnd( text ) {
  53854. return text.length > MIN_LINK_LENGTH_WITH_SPACE_AT_END && text[ text.length - 1 ] === ' ' && text[ text.length - 2 ] !== ' ';
  53855. }
  53856. function getUrlAtTextEnd( text ) {
  53857. const match = URL_REG_EXP.exec( text );
  53858. return match ? match[ URL_GROUP_IN_MATCH ] : null;
  53859. }
  53860. function isLinkAllowedOnRange( range, model ) {
  53861. return model.schema.checkAttributeInSelection( model.createSelection( range ), 'linkHref' );
  53862. }
  53863. /***/ }),
  53864. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/link.js":
  53865. /*!***********************************************************!*\
  53866. !*** ./node_modules/@ckeditor/ckeditor5-link/src/link.js ***!
  53867. \***********************************************************/
  53868. /*! exports provided: default */
  53869. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53870. "use strict";
  53871. __webpack_require__.r(__webpack_exports__);
  53872. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Link; });
  53873. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  53874. /* harmony import */ var _linkediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./linkediting */ "./node_modules/@ckeditor/ckeditor5-link/src/linkediting.js");
  53875. /* harmony import */ var _linkui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./linkui */ "./node_modules/@ckeditor/ckeditor5-link/src/linkui.js");
  53876. /* harmony import */ var _autolink__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./autolink */ "./node_modules/@ckeditor/ckeditor5-link/src/autolink.js");
  53877. /**
  53878. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  53879. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  53880. */
  53881. /**
  53882. * @module link/link
  53883. */
  53884. /**
  53885. * The link plugin.
  53886. *
  53887. * This is a "glue" plugin that loads the {@link module:link/linkediting~LinkEditing link editing feature}
  53888. * and {@link module:link/linkui~LinkUI link UI feature}.
  53889. *
  53890. * @extends module:core/plugin~Plugin
  53891. */
  53892. class Link extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  53893. /**
  53894. * @inheritDoc
  53895. */
  53896. static get requires() {
  53897. return [ _linkediting__WEBPACK_IMPORTED_MODULE_1__["default"], _linkui__WEBPACK_IMPORTED_MODULE_2__["default"], _autolink__WEBPACK_IMPORTED_MODULE_3__["default"] ];
  53898. }
  53899. /**
  53900. * @inheritDoc
  53901. */
  53902. static get pluginName() {
  53903. return 'Link';
  53904. }
  53905. }
  53906. /**
  53907. * The configuration of the {@link module:link/link~Link} feature.
  53908. *
  53909. * Read more in {@link module:link/link~LinkConfig}.
  53910. *
  53911. * @member {module:link/link~LinkConfig} module:core/editor/editorconfig~EditorConfig#link
  53912. */
  53913. /**
  53914. * The configuration of the {@link module:link/link~Link link feature}.
  53915. *
  53916. * ClassicEditor
  53917. * .create( editorElement, {
  53918. * link: ... // Link feature configuration.
  53919. * } )
  53920. * .then( ... )
  53921. * .catch( ... );
  53922. *
  53923. * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
  53924. * @interface LinkConfig
  53925. */
  53926. /**
  53927. * When set, the editor will add the given protocol to the link when the user creates a link without one.
  53928. * For example, when the user is creating a link and types `ckeditor.com` in the link form input, during link submission
  53929. * the editor will automatically add the `http://` protocol, so the link will look as follows: `http://ckeditor.com`.
  53930. *
  53931. * The feature also provides email address auto-detection. When you submit `hello@example.com`,
  53932. * the plugin will automatically change it to `mailto:hello@example.com`.
  53933. *
  53934. * ClassicEditor
  53935. * .create( editorElement, {
  53936. * link: {
  53937. * defaultProtocol: 'http://'
  53938. * }
  53939. * } )
  53940. * .then( ... )
  53941. * .catch( ... );
  53942. *
  53943. * **NOTE:** If no configuration is provided, the editor will not auto-fix the links.
  53944. *
  53945. * @member {String} module:link/link~LinkConfig#defaultProtocol
  53946. */
  53947. /**
  53948. * When set to `true`, the `target="blank"` and `rel="noopener noreferrer"` attributes are automatically added to all external links
  53949. * in the editor. "External links" are all links in the editor content starting with `http`, `https`, or `//`.
  53950. *
  53951. * ClassicEditor
  53952. * .create( editorElement, {
  53953. * link: {
  53954. * addTargetToExternalLinks: true
  53955. * }
  53956. * } )
  53957. * .then( ... )
  53958. * .catch( ... );
  53959. *
  53960. * Internally, this option activates a predefined {@link module:link/link~LinkConfig#decorators automatic link decorator}
  53961. * that extends all external links with the `target` and `rel` attributes.
  53962. *
  53963. * **Note**: To control the `target` and `rel` attributes of specific links in the edited content, a dedicated
  53964. * {@link module:link/link~LinkDecoratorManualDefinition manual} decorator must be defined in the
  53965. * {@link module:link/link~LinkConfig#decorators `config.link.decorators`} array. In such scenario,
  53966. * the `config.link.addTargetToExternalLinks` option should remain `undefined` or `false` to not interfere with the manual decorator.
  53967. *
  53968. * It is possible to add other {@link module:link/link~LinkDecoratorAutomaticDefinition automatic}
  53969. * or {@link module:link/link~LinkDecoratorManualDefinition manual} link decorators when this option is active.
  53970. *
  53971. * More information about decorators can be found in the {@link module:link/link~LinkConfig#decorators decorators configuration}
  53972. * reference.
  53973. *
  53974. * @default false
  53975. * @member {Boolean} module:link/link~LinkConfig#addTargetToExternalLinks
  53976. */
  53977. /**
  53978. * Decorators provide an easy way to configure and manage additional link attributes in the editor content. There are
  53979. * two types of link decorators:
  53980. *
  53981. * * {@link module:link/link~LinkDecoratorAutomaticDefinition Automatic} &ndash; They match links against pre–defined rules and
  53982. * manage their attributes based on the results.
  53983. * * {@link module:link/link~LinkDecoratorManualDefinition Manual} &ndash; They allow users to control link attributes individually,
  53984. * using the editor UI.
  53985. *
  53986. * Link decorators are defined as objects with key-value pairs, where the key is the name provided for a given decorator and the
  53987. * value is the decorator definition.
  53988. *
  53989. * The name of the decorator also corresponds to the {@glink framework/guides/architecture/editing-engine#text-attributes text attribute}
  53990. * in the model. For instance, the `isExternal` decorator below is represented as a `linkIsExternal` attribute in the model.
  53991. *
  53992. * ClassicEditor
  53993. * .create( editorElement, {
  53994. * link: {
  53995. * decorators: {
  53996. * isExternal: {
  53997. * mode: 'automatic',
  53998. * callback: url => url.startsWith( 'http://' ),
  53999. * attributes: {
  54000. * target: '_blank',
  54001. * rel: 'noopener noreferrer'
  54002. * }
  54003. * },
  54004. * isDownloadable: {
  54005. * mode: 'manual',
  54006. * label: 'Downloadable',
  54007. * attributes: {
  54008. * download: 'file.png',
  54009. * }
  54010. * },
  54011. * // ...
  54012. * }
  54013. * }
  54014. * } )
  54015. * .then( ... )
  54016. * .catch( ... );
  54017. *
  54018. * To learn more about the configuration syntax, check out the {@link module:link/link~LinkDecoratorAutomaticDefinition automatic}
  54019. * and {@link module:link/link~LinkDecoratorManualDefinition manual} decorator option reference.
  54020. *
  54021. * **Warning:** Currently, link decorators work independently of one another and no conflict resolution mechanism exists.
  54022. * For example, configuring the `target` attribute using both an automatic and a manual decorator at the same time could end up with
  54023. * quirky results. The same applies if multiple manual or automatic decorators were defined for the same attribute.
  54024. *
  54025. * **Note**: Since the `target` attribute management for external links is a common use case, there is a predefined automatic decorator
  54026. * dedicated for that purpose which can be enabled by turning a single option on. Check out the
  54027. * {@link module:link/link~LinkConfig#addTargetToExternalLinks `config.link.addTargetToExternalLinks`}
  54028. * configuration description to learn more.
  54029. *
  54030. * See also the {@glink features/link#custom-link-attributes-decorators link feature guide} for more information.
  54031. *
  54032. * @member {Object.<String, module:link/link~LinkDecoratorDefinition>} module:link/link~LinkConfig#decorators
  54033. */
  54034. /**
  54035. * A link decorator definition. Two types implement this defition:
  54036. *
  54037. * * {@link module:link/link~LinkDecoratorManualDefinition}
  54038. * * {@link module:link/link~LinkDecoratorAutomaticDefinition}
  54039. *
  54040. * Refer to their document for more information about available options or to the
  54041. * {@glink features/link#custom-link-attributes-decorators link feature guide} for general information.
  54042. *
  54043. * @interface LinkDecoratorDefinition
  54044. */
  54045. /**
  54046. * Link decorator type.
  54047. *
  54048. * Check out the {@glink features/link#custom-link-attributes-decorators link feature guide} for more information.
  54049. *
  54050. * @member {'manual'|'automatic'} module:link/link~LinkDecoratorDefinition#mode
  54051. */
  54052. /**
  54053. * Describes an automatic {@link module:link/link~LinkConfig#decorators link decorator}. This decorator type matches
  54054. * all links in the editor content against a function that decides whether the link should receive a pre–defined set of attributes.
  54055. *
  54056. * It takes an object with key-value pairs of attributes and a callback function that must return a Boolean value based on the link's
  54057. * `href` (URL). When the callback returns `true`, attributes are applied to the link.
  54058. *
  54059. * For example, to add the `target="_blank"` attribute to all links in the editor starting with `http://`, the
  54060. * configuration could look like this:
  54061. *
  54062. * {
  54063. * mode: 'automatic',
  54064. * callback: url => url.startsWith( 'http://' ),
  54065. * attributes: {
  54066. * target: '_blank'
  54067. * }
  54068. * }
  54069. *
  54070. * **Note**: Since the `target` attribute management for external links is a common use case, there is a predefined automatic decorator
  54071. * dedicated for that purpose that can be enabled by turning a single option on. Check out the
  54072. * {@link module:link/link~LinkConfig#addTargetToExternalLinks `config.link.addTargetToExternalLinks`}
  54073. * configuration description to learn more.
  54074. *
  54075. * @typedef {Object} module:link/link~LinkDecoratorAutomaticDefinition
  54076. * @property {'automatic'} mode Link decorator type. It is `'automatic'` for all automatic decorators.
  54077. * @property {Function} callback Takes a `url` as a parameter and returns `true` if the `attributes` should be applied to the link.
  54078. * @property {Object} attributes Key-value pairs used as link attributes added to the output during the
  54079. * {@glink framework/guides/architecture/editing-engine#conversion downcasting}.
  54080. * Attributes should follow the {@link module:engine/view/elementdefinition~ElementDefinition} syntax.
  54081. */
  54082. /**
  54083. * Describes a manual {@link module:link/link~LinkConfig#decorators link decorator}. This decorator type is represented in
  54084. * the link feature's {@link module:link/linkui user interface} as a switch that the user can use to control the presence
  54085. * of a predefined set of attributes.
  54086. *
  54087. * For instance, to allow the users to manually control the presence of the `target="_blank"` and
  54088. * `rel="noopener noreferrer"` attributes on specific links, the decorator could look as follows:
  54089. *
  54090. * {
  54091. * mode: 'manual',
  54092. * label: 'Open in a new tab',
  54093. * defaultValue: true,
  54094. * attributes: {
  54095. * target: '_blank',
  54096. * rel: 'noopener noreferrer'
  54097. * }
  54098. * }
  54099. *
  54100. * @typedef {Object} module:link/link~LinkDecoratorManualDefinition
  54101. * @property {'manual'} mode Link decorator type. It is `'manual'` for all manual decorators.
  54102. * @property {String} label The label of the UI button that the user can use to control the presence of link attributes.
  54103. * @property {Object} attributes Key-value pairs used as link attributes added to the output during the
  54104. * {@glink framework/guides/architecture/editing-engine#conversion downcasting}.
  54105. * Attributes should follow the {@link module:engine/view/elementdefinition~ElementDefinition} syntax.
  54106. * @property {Boolean} [defaultValue] Controls whether the decorator is "on" by default.
  54107. */
  54108. /***/ }),
  54109. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/linkcommand.js":
  54110. /*!******************************************************************!*\
  54111. !*** ./node_modules/@ckeditor/ckeditor5-link/src/linkcommand.js ***!
  54112. \******************************************************************/
  54113. /*! exports provided: default */
  54114. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  54115. "use strict";
  54116. __webpack_require__.r(__webpack_exports__);
  54117. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LinkCommand; });
  54118. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  54119. /* harmony import */ var _ckeditor_ckeditor5_typing_src_utils_findattributerange__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-typing/src/utils/findattributerange */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/findattributerange.js");
  54120. /* harmony import */ var _ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/tomap */ "./node_modules/@ckeditor/ckeditor5-utils/src/tomap.js");
  54121. /* harmony import */ var _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/collection */ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js");
  54122. /* harmony import */ var _ckeditor_ckeditor5_utils_src_first__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/first */ "./node_modules/@ckeditor/ckeditor5-utils/src/first.js");
  54123. /* harmony import */ var _utils_automaticdecorators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/automaticdecorators */ "./node_modules/@ckeditor/ckeditor5-link/src/utils/automaticdecorators.js");
  54124. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-link/src/utils.js");
  54125. /**
  54126. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  54127. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  54128. */
  54129. /**
  54130. * @module link/linkcommand
  54131. */
  54132. /**
  54133. * The link command. It is used by the {@link module:link/link~Link link feature}.
  54134. *
  54135. * @extends module:core/command~Command
  54136. */
  54137. class LinkCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  54138. /**
  54139. * The value of the `'linkHref'` attribute if the start of the selection is located in a node with this attribute.
  54140. *
  54141. * @observable
  54142. * @readonly
  54143. * @member {Object|undefined} #value
  54144. */
  54145. constructor( editor ) {
  54146. super( editor );
  54147. /**
  54148. * A collection of {@link module:link/utils~ManualDecorator manual decorators}
  54149. * corresponding to the {@link module:link/link~LinkConfig#decorators decorator configuration}.
  54150. *
  54151. * You can consider it a model with states of manual decorators added to the currently selected link.
  54152. *
  54153. * @readonly
  54154. * @type {module:utils/collection~Collection}
  54155. */
  54156. this.manualDecorators = new _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_3__["default"]();
  54157. /**
  54158. * An instance of the helper that ties together all {@link module:link/link~LinkDecoratorAutomaticDefinition}
  54159. * that are used by the {@glink features/link link} and the {@glink features/image#linking-images linking images} features.
  54160. *
  54161. * @readonly
  54162. * @type {module:link/utils~AutomaticDecorators}
  54163. */
  54164. this.automaticDecorators = new _utils_automaticdecorators__WEBPACK_IMPORTED_MODULE_5__["default"]();
  54165. }
  54166. /**
  54167. * Synchronizes the state of {@link #manualDecorators} with the currently present elements in the model.
  54168. */
  54169. restoreManualDecoratorStates() {
  54170. for ( const manualDecorator of this.manualDecorators ) {
  54171. manualDecorator.value = this._getDecoratorStateFromModel( manualDecorator.id );
  54172. }
  54173. }
  54174. /**
  54175. * @inheritDoc
  54176. */
  54177. refresh() {
  54178. const model = this.editor.model;
  54179. const doc = model.document;
  54180. const selectedElement = Object(_ckeditor_ckeditor5_utils_src_first__WEBPACK_IMPORTED_MODULE_4__["default"])( doc.selection.getSelectedBlocks() );
  54181. // A check for the `LinkImage` plugin. If the selection contains an element, get values from the element.
  54182. // Currently the selection reads attributes from text nodes only. See #7429 and #7465.
  54183. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_6__["isImageAllowed"])( selectedElement, model.schema ) ) {
  54184. this.value = selectedElement.getAttribute( 'linkHref' );
  54185. this.isEnabled = model.schema.checkAttribute( selectedElement, 'linkHref' );
  54186. } else {
  54187. this.value = doc.selection.getAttribute( 'linkHref' );
  54188. this.isEnabled = model.schema.checkAttributeInSelection( doc.selection, 'linkHref' );
  54189. }
  54190. for ( const manualDecorator of this.manualDecorators ) {
  54191. manualDecorator.value = this._getDecoratorStateFromModel( manualDecorator.id );
  54192. }
  54193. }
  54194. /**
  54195. * Executes the command.
  54196. *
  54197. * When the selection is non-collapsed, the `linkHref` attribute will be applied to nodes inside the selection, but only to
  54198. * those nodes where the `linkHref` attribute is allowed (disallowed nodes will be omitted).
  54199. *
  54200. * When the selection is collapsed and is not inside the text with the `linkHref` attribute, a
  54201. * new {@link module:engine/model/text~Text text node} with the `linkHref` attribute will be inserted in place of the caret, but
  54202. * only if such element is allowed in this place. The `_data` of the inserted text will equal the `href` parameter.
  54203. * The selection will be updated to wrap the just inserted text node.
  54204. *
  54205. * When the selection is collapsed and inside the text with the `linkHref` attribute, the attribute value will be updated.
  54206. *
  54207. * # Decorators and model attribute management
  54208. *
  54209. * There is an optional argument to this command that applies or removes model
  54210. * {@glink framework/guides/architecture/editing-engine#text-attributes text attributes} brought by
  54211. * {@link module:link/utils~ManualDecorator manual link decorators}.
  54212. *
  54213. * Text attribute names in the model correspond to the entries in the {@link module:link/link~LinkConfig#decorators configuration}.
  54214. * For every decorator configured, a model text attribute exists with the "link" prefix. For example, a `'linkMyDecorator'` attribute
  54215. * corresponds to `'myDecorator'` in the configuration.
  54216. *
  54217. * To learn more about link decorators, check out the {@link module:link/link~LinkConfig#decorators `config.link.decorators`}
  54218. * documentation.
  54219. *
  54220. * Here is how to manage decorator attributes with the link command:
  54221. *
  54222. * const linkCommand = editor.commands.get( 'link' );
  54223. *
  54224. * // Adding a new decorator attribute.
  54225. * linkCommand.execute( 'http://example.com', {
  54226. * linkIsExternal: true
  54227. * } );
  54228. *
  54229. * // Removing a decorator attribute from the selection.
  54230. * linkCommand.execute( 'http://example.com', {
  54231. * linkIsExternal: false
  54232. * } );
  54233. *
  54234. * // Adding multiple decorator attributes at the same time.
  54235. * linkCommand.execute( 'http://example.com', {
  54236. * linkIsExternal: true,
  54237. * linkIsDownloadable: true,
  54238. * } );
  54239. *
  54240. * // Removing and adding decorator attributes at the same time.
  54241. * linkCommand.execute( 'http://example.com', {
  54242. * linkIsExternal: false,
  54243. * linkFoo: true,
  54244. * linkIsDownloadable: false,
  54245. * } );
  54246. *
  54247. * **Note**: If the decorator attribute name is not specified, its state remains untouched.
  54248. *
  54249. * **Note**: {@link module:link/unlinkcommand~UnlinkCommand#execute `UnlinkCommand#execute()`} removes all
  54250. * decorator attributes.
  54251. *
  54252. * @fires execute
  54253. * @param {String} href Link destination.
  54254. * @param {Object} [manualDecoratorIds={}] The information about manual decorator attributes to be applied or removed upon execution.
  54255. */
  54256. execute( href, manualDecoratorIds = {} ) {
  54257. const model = this.editor.model;
  54258. const selection = model.document.selection;
  54259. // Stores information about manual decorators to turn them on/off when command is applied.
  54260. const truthyManualDecorators = [];
  54261. const falsyManualDecorators = [];
  54262. for ( const name in manualDecoratorIds ) {
  54263. if ( manualDecoratorIds[ name ] ) {
  54264. truthyManualDecorators.push( name );
  54265. } else {
  54266. falsyManualDecorators.push( name );
  54267. }
  54268. }
  54269. model.change( writer => {
  54270. // If selection is collapsed then update selected link or insert new one at the place of caret.
  54271. if ( selection.isCollapsed ) {
  54272. const position = selection.getFirstPosition();
  54273. // When selection is inside text with `linkHref` attribute.
  54274. if ( selection.hasAttribute( 'linkHref' ) ) {
  54275. // Then update `linkHref` value.
  54276. const linkRange = Object(_ckeditor_ckeditor5_typing_src_utils_findattributerange__WEBPACK_IMPORTED_MODULE_1__["default"])( position, 'linkHref', selection.getAttribute( 'linkHref' ), model );
  54277. writer.setAttribute( 'linkHref', href, linkRange );
  54278. truthyManualDecorators.forEach( item => {
  54279. writer.setAttribute( item, true, linkRange );
  54280. } );
  54281. falsyManualDecorators.forEach( item => {
  54282. writer.removeAttribute( item, linkRange );
  54283. } );
  54284. // Put the selection at the end of the updated link.
  54285. writer.setSelection( writer.createPositionAfter( linkRange.end.nodeBefore ) );
  54286. }
  54287. // If not then insert text node with `linkHref` attribute in place of caret.
  54288. // However, since selection in collapsed, attribute value will be used as data for text node.
  54289. // So, if `href` is empty, do not create text node.
  54290. else if ( href !== '' ) {
  54291. const attributes = Object(_ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_2__["default"])( selection.getAttributes() );
  54292. attributes.set( 'linkHref', href );
  54293. truthyManualDecorators.forEach( item => {
  54294. attributes.set( item, true );
  54295. } );
  54296. const node = writer.createText( href, attributes );
  54297. model.insertContent( node, position );
  54298. // Put the selection at the end of the inserted link.
  54299. writer.setSelection( writer.createPositionAfter( node ) );
  54300. }
  54301. // Remove the `linkHref` attribute and all link decorators from the selection.
  54302. // It stops adding a new content into the link element.
  54303. [ 'linkHref', ...truthyManualDecorators, ...falsyManualDecorators ].forEach( item => {
  54304. writer.removeSelectionAttribute( item );
  54305. } );
  54306. } else {
  54307. // If selection has non-collapsed ranges, we change attribute on nodes inside those ranges
  54308. // omitting nodes where the `linkHref` attribute is disallowed.
  54309. const ranges = model.schema.getValidRanges( selection.getRanges(), 'linkHref' );
  54310. // But for the first, check whether the `linkHref` attribute is allowed on selected blocks (e.g. the "image" element).
  54311. const allowedRanges = [];
  54312. for ( const element of selection.getSelectedBlocks() ) {
  54313. if ( model.schema.checkAttribute( element, 'linkHref' ) ) {
  54314. allowedRanges.push( writer.createRangeOn( element ) );
  54315. }
  54316. }
  54317. // Ranges that accept the `linkHref` attribute. Since we will iterate over `allowedRanges`, let's clone it.
  54318. const rangesToUpdate = allowedRanges.slice();
  54319. // For all selection ranges we want to check whether given range is inside an element that accepts the `linkHref` attribute.
  54320. // If so, we don't want to propagate applying the attribute to its children.
  54321. for ( const range of ranges ) {
  54322. if ( this._isRangeToUpdate( range, allowedRanges ) ) {
  54323. rangesToUpdate.push( range );
  54324. }
  54325. }
  54326. for ( const range of rangesToUpdate ) {
  54327. writer.setAttribute( 'linkHref', href, range );
  54328. truthyManualDecorators.forEach( item => {
  54329. writer.setAttribute( item, true, range );
  54330. } );
  54331. falsyManualDecorators.forEach( item => {
  54332. writer.removeAttribute( item, range );
  54333. } );
  54334. }
  54335. }
  54336. } );
  54337. }
  54338. /**
  54339. * Provides information whether a decorator with a given name is present in the currently processed selection.
  54340. *
  54341. * @private
  54342. * @param {String} decoratorName The name of the manual decorator used in the model
  54343. * @returns {Boolean} The information whether a given decorator is currently present in the selection.
  54344. */
  54345. _getDecoratorStateFromModel( decoratorName ) {
  54346. const model = this.editor.model;
  54347. const doc = model.document;
  54348. const selectedElement = Object(_ckeditor_ckeditor5_utils_src_first__WEBPACK_IMPORTED_MODULE_4__["default"])( doc.selection.getSelectedBlocks() );
  54349. // A check for the `LinkImage` plugin. If the selection contains an element, get values from the element.
  54350. // Currently the selection reads attributes from text nodes only. See #7429 and #7465.
  54351. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_6__["isImageAllowed"])( selectedElement, model.schema ) ) {
  54352. return selectedElement.getAttribute( decoratorName );
  54353. }
  54354. return doc.selection.getAttribute( decoratorName );
  54355. }
  54356. /**
  54357. * Checks whether specified `range` is inside an element that accepts the `linkHref` attribute.
  54358. *
  54359. * @private
  54360. * @param {module:engine/view/range~Range} range A range to check.
  54361. * @param {Array.<module:engine/view/range~Range>} allowedRanges An array of ranges created on elements where the attribute is accepted.
  54362. * @returns {Boolean}
  54363. */
  54364. _isRangeToUpdate( range, allowedRanges ) {
  54365. for ( const allowedRange of allowedRanges ) {
  54366. // A range is inside an element that will have the `linkHref` attribute. Do not modify its nodes.
  54367. if ( allowedRange.containsRange( range ) ) {
  54368. return false;
  54369. }
  54370. }
  54371. return true;
  54372. }
  54373. }
  54374. /***/ }),
  54375. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/linkediting.js":
  54376. /*!******************************************************************!*\
  54377. !*** ./node_modules/@ckeditor/ckeditor5-link/src/linkediting.js ***!
  54378. \******************************************************************/
  54379. /*! exports provided: default */
  54380. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  54381. "use strict";
  54382. __webpack_require__.r(__webpack_exports__);
  54383. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LinkEditing; });
  54384. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  54385. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_observer_mouseobserver__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/observer/mouseobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mouseobserver.js");
  54386. /* harmony import */ var _ckeditor_ckeditor5_typing_src_twostepcaretmovement__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-typing/src/twostepcaretmovement */ "./node_modules/@ckeditor/ckeditor5-typing/src/twostepcaretmovement.js");
  54387. /* harmony import */ var _ckeditor_ckeditor5_typing_src_utils_inlinehighlight__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-typing/src/utils/inlinehighlight */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/inlinehighlight.js");
  54388. /* harmony import */ var _ckeditor_ckeditor5_typing_src_input__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-typing/src/input */ "./node_modules/@ckeditor/ckeditor5-typing/src/input.js");
  54389. /* harmony import */ var _ckeditor_ckeditor5_clipboard_src_clipboard__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-clipboard/src/clipboard */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboard.js");
  54390. /* harmony import */ var _linkcommand__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./linkcommand */ "./node_modules/@ckeditor/ckeditor5-link/src/linkcommand.js");
  54391. /* harmony import */ var _unlinkcommand__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./unlinkcommand */ "./node_modules/@ckeditor/ckeditor5-link/src/unlinkcommand.js");
  54392. /* harmony import */ var _utils_manualdecorator__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils/manualdecorator */ "./node_modules/@ckeditor/ckeditor5-link/src/utils/manualdecorator.js");
  54393. /* harmony import */ var _ckeditor_ckeditor5_typing_src_utils_findattributerange__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ckeditor/ckeditor5-typing/src/utils/findattributerange */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/findattributerange.js");
  54394. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
  54395. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-link/src/utils.js");
  54396. /* harmony import */ var _theme_link_css__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../theme/link.css */ "./node_modules/@ckeditor/ckeditor5-link/theme/link.css");
  54397. /* harmony import */ var _theme_link_css__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_theme_link_css__WEBPACK_IMPORTED_MODULE_12__);
  54398. /**
  54399. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  54400. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  54401. */
  54402. /**
  54403. * @module link/linkediting
  54404. */
  54405. const HIGHLIGHT_CLASS = 'ck-link_selected';
  54406. const DECORATOR_AUTOMATIC = 'automatic';
  54407. const DECORATOR_MANUAL = 'manual';
  54408. const EXTERNAL_LINKS_REGEXP = /^(https?:)?\/\//;
  54409. /**
  54410. * The link engine feature.
  54411. *
  54412. * It introduces the `linkHref="url"` attribute in the model which renders to the view as a `<a href="url">` element
  54413. * as well as `'link'` and `'unlink'` commands.
  54414. *
  54415. * @extends module:core/plugin~Plugin
  54416. */
  54417. class LinkEditing extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  54418. /**
  54419. * @inheritDoc
  54420. */
  54421. static get pluginName() {
  54422. return 'LinkEditing';
  54423. }
  54424. /**
  54425. * @inheritDoc
  54426. */
  54427. static get requires() {
  54428. // Clipboard is required for handling cut and paste events while typing over the link.
  54429. return [ _ckeditor_ckeditor5_typing_src_twostepcaretmovement__WEBPACK_IMPORTED_MODULE_2__["default"], _ckeditor_ckeditor5_typing_src_input__WEBPACK_IMPORTED_MODULE_4__["default"], _ckeditor_ckeditor5_clipboard_src_clipboard__WEBPACK_IMPORTED_MODULE_5__["default"] ];
  54430. }
  54431. /**
  54432. * @inheritDoc
  54433. */
  54434. constructor( editor ) {
  54435. super( editor );
  54436. editor.config.define( 'link', {
  54437. addTargetToExternalLinks: false
  54438. } );
  54439. }
  54440. /**
  54441. * @inheritDoc
  54442. */
  54443. init() {
  54444. const editor = this.editor;
  54445. // Allow link attribute on all inline nodes.
  54446. editor.model.schema.extend( '$text', { allowAttributes: 'linkHref' } );
  54447. editor.conversion.for( 'dataDowncast' )
  54448. .attributeToElement( { model: 'linkHref', view: _utils__WEBPACK_IMPORTED_MODULE_11__["createLinkElement"] } );
  54449. editor.conversion.for( 'editingDowncast' )
  54450. .attributeToElement( { model: 'linkHref', view: ( href, conversionApi ) => {
  54451. return Object(_utils__WEBPACK_IMPORTED_MODULE_11__["createLinkElement"])( Object(_utils__WEBPACK_IMPORTED_MODULE_11__["ensureSafeUrl"])( href ), conversionApi );
  54452. } } );
  54453. editor.conversion.for( 'upcast' )
  54454. .elementToAttribute( {
  54455. view: {
  54456. name: 'a',
  54457. attributes: {
  54458. href: true
  54459. }
  54460. },
  54461. model: {
  54462. key: 'linkHref',
  54463. value: viewElement => viewElement.getAttribute( 'href' )
  54464. }
  54465. } );
  54466. // Create linking commands.
  54467. editor.commands.add( 'link', new _linkcommand__WEBPACK_IMPORTED_MODULE_6__["default"]( editor ) );
  54468. editor.commands.add( 'unlink', new _unlinkcommand__WEBPACK_IMPORTED_MODULE_7__["default"]( editor ) );
  54469. const linkDecorators = Object(_utils__WEBPACK_IMPORTED_MODULE_11__["getLocalizedDecorators"])( editor.t, Object(_utils__WEBPACK_IMPORTED_MODULE_11__["normalizeDecorators"])( editor.config.get( 'link.decorators' ) ) );
  54470. this._enableAutomaticDecorators( linkDecorators.filter( item => item.mode === DECORATOR_AUTOMATIC ) );
  54471. this._enableManualDecorators( linkDecorators.filter( item => item.mode === DECORATOR_MANUAL ) );
  54472. // Enable two-step caret movement for `linkHref` attribute.
  54473. const twoStepCaretMovementPlugin = editor.plugins.get( _ckeditor_ckeditor5_typing_src_twostepcaretmovement__WEBPACK_IMPORTED_MODULE_2__["default"] );
  54474. twoStepCaretMovementPlugin.registerAttribute( 'linkHref' );
  54475. // Setup highlight over selected link.
  54476. Object(_ckeditor_ckeditor5_typing_src_utils_inlinehighlight__WEBPACK_IMPORTED_MODULE_3__["default"])( editor, 'linkHref', 'a', HIGHLIGHT_CLASS );
  54477. // Change the attributes of the selection in certain situations after the link was inserted into the document.
  54478. this._enableInsertContentSelectionAttributesFixer();
  54479. // Handle a click at the beginning/end of a link element.
  54480. this._enableClickingAfterLink();
  54481. // Handle typing over the link.
  54482. this._enableTypingOverLink();
  54483. // Handle removing the content after the link element.
  54484. this._handleDeleteContentAfterLink();
  54485. }
  54486. /**
  54487. * Processes an array of configured {@link module:link/link~LinkDecoratorAutomaticDefinition automatic decorators}
  54488. * and registers a {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher downcast dispatcher}
  54489. * for each one of them. Downcast dispatchers are obtained using the
  54490. * {@link module:link/utils~AutomaticDecorators#getDispatcher} method.
  54491. *
  54492. * **Note**: This method also activates the automatic external link decorator if enabled with
  54493. * {@link module:link/link~LinkConfig#addTargetToExternalLinks `config.link.addTargetToExternalLinks`}.
  54494. *
  54495. * @private
  54496. * @param {Array.<module:link/link~LinkDecoratorAutomaticDefinition>} automaticDecoratorDefinitions
  54497. */
  54498. _enableAutomaticDecorators( automaticDecoratorDefinitions ) {
  54499. const editor = this.editor;
  54500. // Store automatic decorators in the command instance as we do the same with manual decorators.
  54501. // Thanks to that, `LinkImageEditing` plugin can re-use the same definitions.
  54502. const command = editor.commands.get( 'link' );
  54503. const automaticDecorators = command.automaticDecorators;
  54504. // Adds a default decorator for external links.
  54505. if ( editor.config.get( 'link.addTargetToExternalLinks' ) ) {
  54506. automaticDecorators.add( {
  54507. id: 'linkIsExternal',
  54508. mode: DECORATOR_AUTOMATIC,
  54509. callback: url => EXTERNAL_LINKS_REGEXP.test( url ),
  54510. attributes: {
  54511. target: '_blank',
  54512. rel: 'noopener noreferrer'
  54513. }
  54514. } );
  54515. }
  54516. automaticDecorators.add( automaticDecoratorDefinitions );
  54517. if ( automaticDecorators.length ) {
  54518. editor.conversion.for( 'downcast' ).add( automaticDecorators.getDispatcher() );
  54519. }
  54520. }
  54521. /**
  54522. * Processes an array of configured {@link module:link/link~LinkDecoratorManualDefinition manual decorators},
  54523. * transforms them into {@link module:link/utils~ManualDecorator} instances and stores them in the
  54524. * {@link module:link/linkcommand~LinkCommand#manualDecorators} collection (a model for manual decorators state).
  54525. *
  54526. * Also registers an {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToElement attribute-to-element}
  54527. * converter for each manual decorator and extends the {@link module:engine/model/schema~Schema model's schema}
  54528. * with adequate model attributes.
  54529. *
  54530. * @private
  54531. * @param {Array.<module:link/link~LinkDecoratorManualDefinition>} manualDecoratorDefinitions
  54532. */
  54533. _enableManualDecorators( manualDecoratorDefinitions ) {
  54534. if ( !manualDecoratorDefinitions.length ) {
  54535. return;
  54536. }
  54537. const editor = this.editor;
  54538. const command = editor.commands.get( 'link' );
  54539. const manualDecorators = command.manualDecorators;
  54540. manualDecoratorDefinitions.forEach( decorator => {
  54541. editor.model.schema.extend( '$text', { allowAttributes: decorator.id } );
  54542. // Keeps reference to manual decorator to decode its name to attributes during downcast.
  54543. manualDecorators.add( new _utils_manualdecorator__WEBPACK_IMPORTED_MODULE_8__["default"]( decorator ) );
  54544. editor.conversion.for( 'downcast' ).attributeToElement( {
  54545. model: decorator.id,
  54546. view: ( manualDecoratorName, { writer } ) => {
  54547. if ( manualDecoratorName ) {
  54548. const attributes = manualDecorators.get( decorator.id ).attributes;
  54549. const element = writer.createAttributeElement( 'a', attributes, { priority: 5 } );
  54550. writer.setCustomProperty( 'link', true, element );
  54551. return element;
  54552. }
  54553. } } );
  54554. editor.conversion.for( 'upcast' ).elementToAttribute( {
  54555. view: {
  54556. name: 'a',
  54557. attributes: manualDecorators.get( decorator.id ).attributes
  54558. },
  54559. model: {
  54560. key: decorator.id
  54561. }
  54562. } );
  54563. } );
  54564. }
  54565. /**
  54566. * Starts listening to {@link module:engine/model/model~Model#event:insertContent} and corrects the model
  54567. * selection attributes if the selection is at the end of a link after inserting the content.
  54568. *
  54569. * The purpose of this action is to improve the overall UX because the user is no longer "trapped" by the
  54570. * `linkHref` attribute of the selection and they can type a "clean" (`linkHref`–less) text right away.
  54571. *
  54572. * See https://github.com/ckeditor/ckeditor5/issues/6053.
  54573. *
  54574. * @private
  54575. */
  54576. _enableInsertContentSelectionAttributesFixer() {
  54577. const editor = this.editor;
  54578. const model = editor.model;
  54579. const selection = model.document.selection;
  54580. const linkCommand = editor.commands.get( 'link' );
  54581. this.listenTo( model, 'insertContent', () => {
  54582. const nodeBefore = selection.anchor.nodeBefore;
  54583. const nodeAfter = selection.anchor.nodeAfter;
  54584. // NOTE: ↰ and ↱ represent the gravity of the selection.
  54585. // The only truly valid case is:
  54586. //
  54587. // ↰
  54588. // ...<$text linkHref="foo">INSERTED[]</$text>
  54589. //
  54590. // If the selection is not "trapped" by the `linkHref` attribute after inserting, there's nothing
  54591. // to fix there.
  54592. if ( !selection.hasAttribute( 'linkHref' ) ) {
  54593. return;
  54594. }
  54595. // Filter out the following case where a link with the same href (e.g. <a href="foo">INSERTED</a>) is inserted
  54596. // in the middle of an existing link:
  54597. //
  54598. // Before insertion:
  54599. // ↰
  54600. // <$text linkHref="foo">l[]ink</$text>
  54601. //
  54602. // Expected after insertion:
  54603. // ↰
  54604. // <$text linkHref="foo">lINSERTED[]ink</$text>
  54605. //
  54606. if ( !nodeBefore ) {
  54607. return;
  54608. }
  54609. // Filter out the following case where the selection has the "linkHref" attribute because the
  54610. // gravity is overridden and some text with another attribute (e.g. <b>INSERTED</b>) is inserted:
  54611. //
  54612. // Before insertion:
  54613. //
  54614. // ↱
  54615. // <$text linkHref="foo">[]link</$text>
  54616. //
  54617. // Expected after insertion:
  54618. //
  54619. // ↱
  54620. // <$text bold="true">INSERTED</$text><$text linkHref="foo">[]link</$text>
  54621. //
  54622. if ( !nodeBefore.hasAttribute( 'linkHref' ) ) {
  54623. return;
  54624. }
  54625. // Filter out the following case where a link is a inserted in the middle (or before) another link
  54626. // (different URLs, so they will not merge). In this (let's say weird) case, we can leave the selection
  54627. // attributes as they are because the user will end up writing in one link or another anyway.
  54628. //
  54629. // Before insertion:
  54630. //
  54631. // ↰
  54632. // <$text linkHref="foo">l[]ink</$text>
  54633. //
  54634. // Expected after insertion:
  54635. //
  54636. // ↰
  54637. // <$text linkHref="foo">l</$text><$text linkHref="bar">INSERTED[]</$text><$text linkHref="foo">ink</$text>
  54638. //
  54639. if ( nodeAfter && nodeAfter.hasAttribute( 'linkHref' ) ) {
  54640. return;
  54641. }
  54642. model.change( writer => {
  54643. removeLinkAttributesFromSelection( writer, linkCommand.manualDecorators );
  54644. } );
  54645. }, { priority: 'low' } );
  54646. }
  54647. /**
  54648. * Starts listening to {@link module:engine/view/document~Document#event:mousedown} and
  54649. * {@link module:engine/view/document~Document#event:selectionChange} and puts the selection before/after a link node
  54650. * if clicked at the beginning/ending of the link.
  54651. *
  54652. * The purpose of this action is to allow typing around the link node directly after a click.
  54653. *
  54654. * See https://github.com/ckeditor/ckeditor5/issues/1016.
  54655. *
  54656. * @private
  54657. */
  54658. _enableClickingAfterLink() {
  54659. const editor = this.editor;
  54660. const linkCommand = editor.commands.get( 'link' );
  54661. editor.editing.view.addObserver( _ckeditor_ckeditor5_engine_src_view_observer_mouseobserver__WEBPACK_IMPORTED_MODULE_1__["default"] );
  54662. let clicked = false;
  54663. // Detect the click.
  54664. this.listenTo( editor.editing.view.document, 'mousedown', () => {
  54665. clicked = true;
  54666. } );
  54667. // When the selection has changed...
  54668. this.listenTo( editor.editing.view.document, 'selectionChange', () => {
  54669. if ( !clicked ) {
  54670. return;
  54671. }
  54672. // ...and it was caused by the click...
  54673. clicked = false;
  54674. const selection = editor.model.document.selection;
  54675. // ...and no text is selected...
  54676. if ( !selection.isCollapsed ) {
  54677. return;
  54678. }
  54679. // ...and clicked text is the link...
  54680. if ( !selection.hasAttribute( 'linkHref' ) ) {
  54681. return;
  54682. }
  54683. const position = selection.getFirstPosition();
  54684. const linkRange = Object(_ckeditor_ckeditor5_typing_src_utils_findattributerange__WEBPACK_IMPORTED_MODULE_9__["default"])( position, 'linkHref', selection.getAttribute( 'linkHref' ), editor.model );
  54685. // ...check whether clicked start/end boundary of the link.
  54686. // If so, remove the `linkHref` attribute.
  54687. if ( position.isTouching( linkRange.start ) || position.isTouching( linkRange.end ) ) {
  54688. editor.model.change( writer => {
  54689. removeLinkAttributesFromSelection( writer, linkCommand.manualDecorators );
  54690. } );
  54691. }
  54692. } );
  54693. }
  54694. /**
  54695. * Starts listening to {@link module:engine/model/model~Model#deleteContent} and {@link module:engine/model/model~Model#insertContent}
  54696. * and checks whether typing over the link. If so, attributes of removed text are preserved and applied to the inserted text.
  54697. *
  54698. * The purpose of this action is to allow modifying a text without loosing the `linkHref` attribute (and other).
  54699. *
  54700. * See https://github.com/ckeditor/ckeditor5/issues/4762.
  54701. *
  54702. * @private
  54703. */
  54704. _enableTypingOverLink() {
  54705. const editor = this.editor;
  54706. const view = editor.editing.view;
  54707. // Selection attributes when started typing over the link.
  54708. let selectionAttributes;
  54709. // Whether pressed `Backspace` or `Delete`. If so, attributes should not be preserved.
  54710. let deletedContent;
  54711. // Detect pressing `Backspace` / `Delete`.
  54712. this.listenTo( view.document, 'delete', () => {
  54713. deletedContent = true;
  54714. }, { priority: 'high' } );
  54715. // Listening to `model#deleteContent` allows detecting whether selected content was a link.
  54716. // If so, before removing the element, we will copy its attributes.
  54717. this.listenTo( editor.model, 'deleteContent', () => {
  54718. const selection = editor.model.document.selection;
  54719. // Copy attributes only if anything is selected.
  54720. if ( selection.isCollapsed ) {
  54721. return;
  54722. }
  54723. // When the content was deleted, do not preserve attributes.
  54724. if ( deletedContent ) {
  54725. deletedContent = false;
  54726. return;
  54727. }
  54728. // Enabled only when typing.
  54729. if ( !isTyping( editor ) ) {
  54730. return;
  54731. }
  54732. if ( shouldCopyAttributes( editor.model ) ) {
  54733. selectionAttributes = selection.getAttributes();
  54734. }
  54735. }, { priority: 'high' } );
  54736. // Listening to `model#insertContent` allows detecting the content insertion.
  54737. // We want to apply attributes that were removed while typing over the link.
  54738. this.listenTo( editor.model, 'insertContent', ( evt, [ element ] ) => {
  54739. deletedContent = false;
  54740. // Enabled only when typing.
  54741. if ( !isTyping( editor ) ) {
  54742. return;
  54743. }
  54744. if ( !selectionAttributes ) {
  54745. return;
  54746. }
  54747. editor.model.change( writer => {
  54748. for ( const [ attribute, value ] of selectionAttributes ) {
  54749. writer.setAttribute( attribute, value, element );
  54750. }
  54751. } );
  54752. selectionAttributes = null;
  54753. }, { priority: 'high' } );
  54754. }
  54755. /**
  54756. * Starts listening to {@link module:engine/model/model~Model#deleteContent} and checks whether
  54757. * removing a content right after the "linkHref" attribute.
  54758. *
  54759. * If so, the selection should not preserve the `linkHref` attribute. However, if
  54760. * the {@link module:typing/twostepcaretmovement~TwoStepCaretMovement} plugin is active and
  54761. * the selection has the "linkHref" attribute due to overriden gravity (at the end), the `linkHref` attribute should stay untouched.
  54762. *
  54763. * The purpose of this action is to allow removing the link text and keep the selection outside the link.
  54764. *
  54765. * See https://github.com/ckeditor/ckeditor5/issues/7521.
  54766. *
  54767. * @private
  54768. */
  54769. _handleDeleteContentAfterLink() {
  54770. const editor = this.editor;
  54771. const model = editor.model;
  54772. const selection = model.document.selection;
  54773. const view = editor.editing.view;
  54774. const linkCommand = editor.commands.get( 'link' );
  54775. // A flag whether attributes `linkHref` attribute should be preserved.
  54776. let shouldPreserveAttributes = false;
  54777. // A flag whether the `Backspace` key was pressed.
  54778. let hasBackspacePressed = false;
  54779. // Detect pressing `Backspace`.
  54780. this.listenTo( view.document, 'delete', ( evt, data ) => {
  54781. hasBackspacePressed = data.domEvent.keyCode === _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_10__["keyCodes"].backspace;
  54782. }, { priority: 'high' } );
  54783. // Before removing the content, check whether the selection is inside a link or at the end of link but with 2-SCM enabled.
  54784. // If so, we want to preserve link attributes.
  54785. this.listenTo( model, 'deleteContent', () => {
  54786. // Reset the state.
  54787. shouldPreserveAttributes = false;
  54788. const position = selection.getFirstPosition();
  54789. const linkHref = selection.getAttribute( 'linkHref' );
  54790. if ( !linkHref ) {
  54791. return;
  54792. }
  54793. const linkRange = Object(_ckeditor_ckeditor5_typing_src_utils_findattributerange__WEBPACK_IMPORTED_MODULE_9__["default"])( position, 'linkHref', linkHref, model );
  54794. // Preserve `linkHref` attribute if the selection is in the middle of the link or
  54795. // the selection is at the end of the link and 2-SCM is activated.
  54796. shouldPreserveAttributes = linkRange.containsPosition( position ) || linkRange.end.isEqual( position );
  54797. }, { priority: 'high' } );
  54798. // After removing the content, check whether the current selection should preserve the `linkHref` attribute.
  54799. this.listenTo( model, 'deleteContent', () => {
  54800. // If didn't press `Backspace`.
  54801. if ( !hasBackspacePressed ) {
  54802. return;
  54803. }
  54804. hasBackspacePressed = false;
  54805. // Disable the mechanism if inside a link (`<$text url="foo">F[]oo</$text>` or <$text url="foo">Foo[]</$text>`).
  54806. if ( shouldPreserveAttributes ) {
  54807. return;
  54808. }
  54809. // Use `model.enqueueChange()` in order to execute the callback at the end of the changes process.
  54810. editor.model.enqueueChange( writer => {
  54811. removeLinkAttributesFromSelection( writer, linkCommand.manualDecorators );
  54812. } );
  54813. }, { priority: 'low' } );
  54814. }
  54815. }
  54816. // Make the selection free of link-related model attributes.
  54817. // All link-related model attributes start with "link". That includes not only "linkHref"
  54818. // but also all decorator attributes (they have dynamic names).
  54819. //
  54820. // @param {module:engine/model/writer~Writer} writer
  54821. // @param {module:utils/collection~Collection} manualDecorators
  54822. function removeLinkAttributesFromSelection( writer, manualDecorators ) {
  54823. writer.removeSelectionAttribute( 'linkHref' );
  54824. for ( const decorator of manualDecorators ) {
  54825. writer.removeSelectionAttribute( decorator.id );
  54826. }
  54827. }
  54828. // Checks whether selection's attributes should be copied to the new inserted text.
  54829. //
  54830. // @param {module:engine/model/model~Model} model
  54831. // @returns {Boolean}
  54832. function shouldCopyAttributes( model ) {
  54833. const selection = model.document.selection;
  54834. const firstPosition = selection.getFirstPosition();
  54835. const lastPosition = selection.getLastPosition();
  54836. const nodeAtFirstPosition = firstPosition.nodeAfter;
  54837. // The text link node does not exist...
  54838. if ( !nodeAtFirstPosition ) {
  54839. return false;
  54840. }
  54841. // ...or it isn't the text node...
  54842. if ( !nodeAtFirstPosition.is( '$text' ) ) {
  54843. return false;
  54844. }
  54845. // ...or isn't the link.
  54846. if ( !nodeAtFirstPosition.hasAttribute( 'linkHref' ) ) {
  54847. return false;
  54848. }
  54849. // `textNode` = the position is inside the link element.
  54850. // `nodeBefore` = the position is at the end of the link element.
  54851. const nodeAtLastPosition = lastPosition.textNode || lastPosition.nodeBefore;
  54852. // If both references the same node selection contains a single text node.
  54853. if ( nodeAtFirstPosition === nodeAtLastPosition ) {
  54854. return true;
  54855. }
  54856. // If nodes are not equal, maybe the link nodes has defined additional attributes inside.
  54857. // First, we need to find the entire link range.
  54858. const linkRange = Object(_ckeditor_ckeditor5_typing_src_utils_findattributerange__WEBPACK_IMPORTED_MODULE_9__["default"])( firstPosition, 'linkHref', nodeAtFirstPosition.getAttribute( 'linkHref' ), model );
  54859. // Then we can check whether selected range is inside the found link range. If so, attributes should be preserved.
  54860. return linkRange.containsRange( model.createRange( firstPosition, lastPosition ), true );
  54861. }
  54862. // Checks whether provided changes were caused by typing.
  54863. //
  54864. // @params {module:core/editor/editor~Editor} editor
  54865. // @returns {Boolean}
  54866. function isTyping( editor ) {
  54867. const input = editor.plugins.get( 'Input' );
  54868. return input.isInput( editor.model.change( writer => writer.batch ) );
  54869. }
  54870. /***/ }),
  54871. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/linkimage.js":
  54872. /*!****************************************************************!*\
  54873. !*** ./node_modules/@ckeditor/ckeditor5-link/src/linkimage.js ***!
  54874. \****************************************************************/
  54875. /*! exports provided: default */
  54876. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  54877. "use strict";
  54878. __webpack_require__.r(__webpack_exports__);
  54879. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LinkImage; });
  54880. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  54881. /* harmony import */ var _linkimageediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./linkimageediting */ "./node_modules/@ckeditor/ckeditor5-link/src/linkimageediting.js");
  54882. /* harmony import */ var _linkimageui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./linkimageui */ "./node_modules/@ckeditor/ckeditor5-link/src/linkimageui.js");
  54883. /* harmony import */ var _theme_linkimage_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../theme/linkimage.css */ "./node_modules/@ckeditor/ckeditor5-link/theme/linkimage.css");
  54884. /* harmony import */ var _theme_linkimage_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_theme_linkimage_css__WEBPACK_IMPORTED_MODULE_3__);
  54885. /**
  54886. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  54887. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  54888. */
  54889. /**
  54890. * @module link/linkimage
  54891. */
  54892. /**
  54893. * The `LinkImage` plugin.
  54894. *
  54895. * This is a "glue" plugin that loads the {@link module:link/linkimageediting~LinkImageEditing link image editing feature}
  54896. * and {@link module:link/linkimageui~LinkImageUI link image UI feature}.
  54897. *
  54898. * @extends module:core/plugin~Plugin
  54899. */
  54900. class LinkImage extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  54901. /**
  54902. * @inheritDoc
  54903. */
  54904. static get requires() {
  54905. return [ _linkimageediting__WEBPACK_IMPORTED_MODULE_1__["default"], _linkimageui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  54906. }
  54907. /**
  54908. * @inheritDoc
  54909. */
  54910. static get pluginName() {
  54911. return 'LinkImage';
  54912. }
  54913. }
  54914. /***/ }),
  54915. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/linkimageediting.js":
  54916. /*!***********************************************************************!*\
  54917. !*** ./node_modules/@ckeditor/ckeditor5-link/src/linkimageediting.js ***!
  54918. \***********************************************************************/
  54919. /*! exports provided: default */
  54920. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  54921. "use strict";
  54922. __webpack_require__.r(__webpack_exports__);
  54923. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LinkImageEditing; });
  54924. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  54925. /* harmony import */ var _ckeditor_ckeditor5_image_src_image_imageediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-image/src/image/imageediting */ "./node_modules/@ckeditor/ckeditor5-image/src/image/imageediting.js");
  54926. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_matcher__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/matcher */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/matcher.js");
  54927. /* harmony import */ var _ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/tomap */ "./node_modules/@ckeditor/ckeditor5-utils/src/tomap.js");
  54928. /* harmony import */ var _linkediting__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./linkediting */ "./node_modules/@ckeditor/ckeditor5-link/src/linkediting.js");
  54929. /* harmony import */ var _theme_icons_link_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../theme/icons/link.svg */ "./node_modules/@ckeditor/ckeditor5-link/theme/icons/link.svg");
  54930. /**
  54931. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  54932. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  54933. */
  54934. /**
  54935. * @module link/linkimageediting
  54936. */
  54937. /**
  54938. * The link image engine feature.
  54939. *
  54940. * It accepts the `linkHref="url"` attribute in the model for the {@link module:image/image~Image `<image>`} element
  54941. * which allows linking images.
  54942. *
  54943. * @extends module:core/plugin~Plugin
  54944. */
  54945. class LinkImageEditing extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  54946. /**
  54947. * @inheritDoc
  54948. */
  54949. static get requires() {
  54950. return [ _ckeditor_ckeditor5_image_src_image_imageediting__WEBPACK_IMPORTED_MODULE_1__["default"], _linkediting__WEBPACK_IMPORTED_MODULE_4__["default"] ];
  54951. }
  54952. /**
  54953. * @inheritDoc
  54954. */
  54955. static get pluginName() {
  54956. return 'LinkImageEditing';
  54957. }
  54958. init() {
  54959. const editor = this.editor;
  54960. editor.model.schema.extend( 'image', { allowAttributes: [ 'linkHref' ] } );
  54961. editor.conversion.for( 'upcast' ).add( upcastLink() );
  54962. editor.conversion.for( 'editingDowncast' ).add( downcastImageLink( { attachIconIndicator: true } ) );
  54963. editor.conversion.for( 'dataDowncast' ).add( downcastImageLink( { attachIconIndicator: false } ) );
  54964. // Definitions for decorators are provided by the `link` command and the `LinkEditing` plugin.
  54965. this._enableAutomaticDecorators();
  54966. this._enableManualDecorators();
  54967. }
  54968. /**
  54969. * Processes {@link module:link/link~LinkDecoratorAutomaticDefinition automatic decorators} definitions and
  54970. * attaches proper converters that will work when linking an image.`
  54971. *
  54972. * @private
  54973. */
  54974. _enableAutomaticDecorators() {
  54975. const editor = this.editor;
  54976. const command = editor.commands.get( 'link' );
  54977. const automaticDecorators = command.automaticDecorators;
  54978. if ( automaticDecorators.length ) {
  54979. editor.conversion.for( 'downcast' ).add( automaticDecorators.getDispatcherForLinkedImage() );
  54980. }
  54981. }
  54982. /**
  54983. * Processes transformed {@link module:link/utils~ManualDecorator} instances and attaches proper converters
  54984. * that will work when linking an image.
  54985. *
  54986. * @private
  54987. */
  54988. _enableManualDecorators() {
  54989. const editor = this.editor;
  54990. const command = editor.commands.get( 'link' );
  54991. const manualDecorators = command.manualDecorators;
  54992. for ( const decorator of command.manualDecorators ) {
  54993. editor.model.schema.extend( 'image', { allowAttributes: decorator.id } );
  54994. editor.conversion.for( 'downcast' ).add( downcastImageLinkManualDecorator( manualDecorators, decorator ) );
  54995. editor.conversion.for( 'upcast' ).add( upcastImageLinkManualDecorator( manualDecorators, decorator ) );
  54996. }
  54997. }
  54998. }
  54999. // Returns a converter that consumes the 'href' attribute if a link contains an image.
  55000. //
  55001. // @private
  55002. // @returns {Function}
  55003. function upcastLink() {
  55004. return dispatcher => {
  55005. dispatcher.on( 'element:a', ( evt, data, conversionApi ) => {
  55006. const viewLink = data.viewItem;
  55007. const imageInLink = getFirstImage( viewLink );
  55008. if ( !imageInLink ) {
  55009. return;
  55010. }
  55011. // There's an image inside an <a> element - we consume it so it won't be picked up by the Link plugin.
  55012. const consumableAttributes = { attributes: [ 'href' ] };
  55013. // Consume the `href` attribute so the default one will not convert it to $text attribute.
  55014. if ( !conversionApi.consumable.consume( viewLink, consumableAttributes ) ) {
  55015. // Might be consumed by something else - i.e. other converter with priority=highest - a standard check.
  55016. return;
  55017. }
  55018. const linkHref = viewLink.getAttribute( 'href' );
  55019. // Missing the 'href' attribute.
  55020. if ( !linkHref ) {
  55021. return;
  55022. }
  55023. // A full definition of the image feature.
  55024. // figure > a > img: parent of the view link element is an image element (figure).
  55025. let modelElement = data.modelCursor.parent;
  55026. if ( !modelElement.is( 'element', 'image' ) ) {
  55027. // a > img: parent of the view link is not the image (figure) element. We need to convert it manually.
  55028. const conversionResult = conversionApi.convertItem( imageInLink, data.modelCursor );
  55029. // Set image range as conversion result.
  55030. data.modelRange = conversionResult.modelRange;
  55031. // Continue conversion where image conversion ends.
  55032. data.modelCursor = conversionResult.modelCursor;
  55033. modelElement = data.modelCursor.nodeBefore;
  55034. }
  55035. if ( modelElement && modelElement.is( 'element', 'image' ) ) {
  55036. // Set the linkHref attribute from link element on model image element.
  55037. conversionApi.writer.setAttribute( 'linkHref', linkHref, modelElement );
  55038. }
  55039. }, { priority: 'high' } );
  55040. // Using the same priority that `upcastImageLinkManualDecorator()` converter guarantees
  55041. // that manual decorators will decorate the proper element.
  55042. };
  55043. }
  55044. // Return a converter that adds the `<a>` element to data.
  55045. //
  55046. // @private
  55047. // @params {Object} options
  55048. // @params {Boolean} options.attachIconIndicator=false If set to `true`, an icon that informs about the linked image will be added.
  55049. // @returns {Function}
  55050. function downcastImageLink( options ) {
  55051. return dispatcher => {
  55052. dispatcher.on( 'attribute:linkHref:image', ( evt, data, conversionApi ) => {
  55053. // The image will be already converted - so it will be present in the view.
  55054. const viewFigure = conversionApi.mapper.toViewElement( data.item );
  55055. const writer = conversionApi.writer;
  55056. // But we need to check whether the link element exists.
  55057. const linkInImage = Array.from( viewFigure.getChildren() ).find( child => child.name === 'a' );
  55058. let linkIconIndicator;
  55059. if ( options.attachIconIndicator ) {
  55060. // Create an icon indicator for a linked image.
  55061. linkIconIndicator = writer.createUIElement( 'span', { class: 'ck ck-link-image_icon' }, function( domDocument ) {
  55062. const domElement = this.toDomElement( domDocument );
  55063. domElement.innerHTML = _theme_icons_link_svg__WEBPACK_IMPORTED_MODULE_5__["default"];
  55064. return domElement;
  55065. } );
  55066. }
  55067. // If so, update the attribute if it's defined or remove the entire link if the attribute is empty.
  55068. if ( linkInImage ) {
  55069. if ( data.attributeNewValue ) {
  55070. writer.setAttribute( 'href', data.attributeNewValue, linkInImage );
  55071. } else {
  55072. const viewImage = Array.from( linkInImage.getChildren() ).find( child => child.name === 'img' );
  55073. writer.move( writer.createRangeOn( viewImage ), writer.createPositionAt( viewFigure, 0 ) );
  55074. writer.remove( linkInImage );
  55075. }
  55076. } else {
  55077. // But if it does not exist. Let's wrap already converted image by newly created link element.
  55078. // 1. Create an empty link element.
  55079. const linkElement = writer.createContainerElement( 'a', { href: data.attributeNewValue } );
  55080. // 2. Insert link inside the associated image.
  55081. writer.insert( writer.createPositionAt( viewFigure, 0 ), linkElement );
  55082. // 3. Move the image to the link.
  55083. writer.move( writer.createRangeOn( viewFigure.getChild( 1 ) ), writer.createPositionAt( linkElement, 0 ) );
  55084. // 4. Inset the linked image icon indicator while downcast to editing.
  55085. if ( linkIconIndicator ) {
  55086. writer.insert( writer.createPositionAt( linkElement, 'end' ), linkIconIndicator );
  55087. }
  55088. }
  55089. } );
  55090. };
  55091. }
  55092. // Returns a converter that decorates the `<a>` element when the image is the link label.
  55093. //
  55094. // @private
  55095. // @returns {Function}
  55096. function downcastImageLinkManualDecorator( manualDecorators, decorator ) {
  55097. return dispatcher => {
  55098. dispatcher.on( `attribute:${ decorator.id }:image`, ( evt, data, conversionApi ) => {
  55099. const attributes = manualDecorators.get( decorator.id ).attributes;
  55100. const viewFigure = conversionApi.mapper.toViewElement( data.item );
  55101. const linkInImage = Array.from( viewFigure.getChildren() ).find( child => child.name === 'a' );
  55102. for ( const [ key, val ] of Object(_ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_3__["default"])( attributes ) ) {
  55103. conversionApi.writer.setAttribute( key, val, linkInImage );
  55104. }
  55105. } );
  55106. };
  55107. }
  55108. // Returns a converter that checks whether manual decorators should be applied to the link.
  55109. //
  55110. // @private
  55111. // @returns {Function}
  55112. function upcastImageLinkManualDecorator( manualDecorators, decorator ) {
  55113. return dispatcher => {
  55114. dispatcher.on( 'element:a', ( evt, data, conversionApi ) => {
  55115. const viewLink = data.viewItem;
  55116. const imageInLink = getFirstImage( viewLink );
  55117. // We need to check whether an image is inside a link because the converter handles
  55118. // only manual decorators for linked images. See #7975.
  55119. if ( !imageInLink ) {
  55120. return;
  55121. }
  55122. const consumableAttributes = {
  55123. attributes: manualDecorators.get( decorator.id ).attributes
  55124. };
  55125. const matcher = new _ckeditor_ckeditor5_engine_src_view_matcher__WEBPACK_IMPORTED_MODULE_2__["default"]( consumableAttributes );
  55126. const result = matcher.match( viewLink );
  55127. // The link element does not have required attributes or/and proper values.
  55128. if ( !result ) {
  55129. return;
  55130. }
  55131. // Check whether we can consume those attributes.
  55132. if ( !conversionApi.consumable.consume( viewLink, result.match ) ) {
  55133. return;
  55134. }
  55135. // At this stage we can assume that we have the `<image>` element.
  55136. // `nodeBefore` comes after conversion: `<a><img></a>`.
  55137. // `parent` comes with full image definition: `<figure><a><img></a></figure>.
  55138. // See the body of the `upcastLink()` function.
  55139. const modelElement = data.modelCursor.nodeBefore || data.modelCursor.parent;
  55140. conversionApi.writer.setAttribute( decorator.id, true, modelElement );
  55141. }, { priority: 'high' } );
  55142. // Using the same priority that `upcastLink()` converter guarantees that the linked image was properly converted.
  55143. };
  55144. }
  55145. // Returns the first image in a given view element.
  55146. //
  55147. // @private
  55148. // @param {module:engine/view/element~Element}
  55149. // @returns {module:engine/view/element~Element|undefined}
  55150. function getFirstImage( viewElement ) {
  55151. return Array.from( viewElement.getChildren() ).find( child => child.name === 'img' );
  55152. }
  55153. /***/ }),
  55154. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/linkimageui.js":
  55155. /*!******************************************************************!*\
  55156. !*** ./node_modules/@ckeditor/ckeditor5-link/src/linkimageui.js ***!
  55157. \******************************************************************/
  55158. /*! exports provided: default */
  55159. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  55160. "use strict";
  55161. __webpack_require__.r(__webpack_exports__);
  55162. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LinkImageUI; });
  55163. /* harmony import */ var _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  55164. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  55165. /* harmony import */ var _ckeditor_ckeditor5_image_src_image__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-image/src/image */ "./node_modules/@ckeditor/ckeditor5-image/src/image.js");
  55166. /* harmony import */ var _linkui__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./linkui */ "./node_modules/@ckeditor/ckeditor5-link/src/linkui.js");
  55167. /* harmony import */ var _linkediting__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./linkediting */ "./node_modules/@ckeditor/ckeditor5-link/src/linkediting.js");
  55168. /* harmony import */ var _ckeditor_ckeditor5_image_src_image_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-image/src/image/utils */ "./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js");
  55169. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-link/src/utils.js");
  55170. /* harmony import */ var _theme_icons_link_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../theme/icons/link.svg */ "./node_modules/@ckeditor/ckeditor5-link/theme/icons/link.svg");
  55171. /**
  55172. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  55173. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  55174. */
  55175. /**
  55176. * @module link/linkimageui
  55177. */
  55178. /**
  55179. * The link image UI plugin.
  55180. *
  55181. * This plugin provides the `'linkImage'` button that can be displayed in the {@link module:image/imagetoolbar~ImageToolbar}.
  55182. * It can be used to wrap images in links.
  55183. *
  55184. * @extends module:core/plugin~Plugin
  55185. */
  55186. class LinkImageUI extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_1__["default"] {
  55187. /**
  55188. * @inheritDoc
  55189. */
  55190. static get requires() {
  55191. return [ _ckeditor_ckeditor5_image_src_image__WEBPACK_IMPORTED_MODULE_2__["default"], _linkediting__WEBPACK_IMPORTED_MODULE_4__["default"], _linkui__WEBPACK_IMPORTED_MODULE_3__["default"] ];
  55192. }
  55193. /**
  55194. * @inheritDoc
  55195. */
  55196. static get pluginName() {
  55197. return 'LinkImageUI';
  55198. }
  55199. /**
  55200. * @inheritDoc
  55201. */
  55202. init() {
  55203. const editor = this.editor;
  55204. const viewDocument = editor.editing.view.document;
  55205. this.listenTo( viewDocument, 'click', ( evt, data ) => {
  55206. const hasLink = isImageLinked( viewDocument.selection.getSelectedElement() );
  55207. if ( hasLink ) {
  55208. data.preventDefault();
  55209. }
  55210. } );
  55211. this._createToolbarLinkImageButton();
  55212. }
  55213. /**
  55214. * Creates a `LinkImageUI` button view.
  55215. *
  55216. * Clicking this button shows a {@link module:link/linkui~LinkUI#_balloon} attached to the selection.
  55217. * When an image is already linked, the view shows {@link module:link/linkui~LinkUI#actionsView} or
  55218. * {@link module:link/linkui~LinkUI#formView} if it is not.
  55219. *
  55220. * @private
  55221. */
  55222. _createToolbarLinkImageButton() {
  55223. const editor = this.editor;
  55224. const t = editor.t;
  55225. editor.ui.componentFactory.add( 'linkImage', locale => {
  55226. const button = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_0__["default"]( locale );
  55227. const plugin = editor.plugins.get( 'LinkUI' );
  55228. const linkCommand = editor.commands.get( 'link' );
  55229. button.set( {
  55230. isEnabled: true,
  55231. label: t( 'Link image' ),
  55232. icon: _theme_icons_link_svg__WEBPACK_IMPORTED_MODULE_7__["default"],
  55233. keystroke: _utils__WEBPACK_IMPORTED_MODULE_6__["LINK_KEYSTROKE"],
  55234. tooltip: true,
  55235. isToggleable: true
  55236. } );
  55237. // Bind button to the command.
  55238. button.bind( 'isEnabled' ).to( linkCommand, 'isEnabled' );
  55239. button.bind( 'isOn' ).to( linkCommand, 'value', value => !!value );
  55240. // Show the actionsView or formView (both from LinkUI) on button click depending on whether the image is linked already.
  55241. this.listenTo( button, 'execute', () => {
  55242. const hasLink = isImageLinked( editor.editing.view.document.selection.getSelectedElement() );
  55243. if ( hasLink ) {
  55244. plugin._addActionsView();
  55245. } else {
  55246. plugin._showUI( true );
  55247. }
  55248. } );
  55249. return button;
  55250. } );
  55251. }
  55252. }
  55253. // A helper function that checks whether the element is a linked image.
  55254. //
  55255. // @param {module:engine/model/element~Element} element
  55256. // @returns {Boolean}
  55257. function isImageLinked( element ) {
  55258. const isImage = element && Object(_ckeditor_ckeditor5_image_src_image_utils__WEBPACK_IMPORTED_MODULE_5__["isImageWidget"])( element );
  55259. if ( !isImage ) {
  55260. return false;
  55261. }
  55262. return element.getChild( 0 ).is( 'element', 'a' );
  55263. }
  55264. /***/ }),
  55265. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/linkui.js":
  55266. /*!*************************************************************!*\
  55267. !*** ./node_modules/@ckeditor/ckeditor5-link/src/linkui.js ***!
  55268. \*************************************************************/
  55269. /*! exports provided: default */
  55270. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  55271. "use strict";
  55272. __webpack_require__.r(__webpack_exports__);
  55273. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LinkUI; });
  55274. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  55275. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_observer_clickobserver__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/observer/clickobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/clickobserver.js");
  55276. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-link/src/utils.js");
  55277. /* harmony import */ var _ckeditor_ckeditor5_ui_src_panel_balloon_contextualballoon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon */ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon.js");
  55278. /* harmony import */ var _ckeditor_ckeditor5_ui_src_bindings_clickoutsidehandler__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler */ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler.js");
  55279. /* harmony import */ var _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  55280. /* harmony import */ var _ui_linkformview__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ui/linkformview */ "./node_modules/@ckeditor/ckeditor5-link/src/ui/linkformview.js");
  55281. /* harmony import */ var _ui_linkactionsview__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ui/linkactionsview */ "./node_modules/@ckeditor/ckeditor5-link/src/ui/linkactionsview.js");
  55282. /* harmony import */ var _theme_icons_link_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../theme/icons/link.svg */ "./node_modules/@ckeditor/ckeditor5-link/theme/icons/link.svg");
  55283. /**
  55284. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  55285. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  55286. */
  55287. /**
  55288. * @module link/linkui
  55289. */
  55290. const VISUAL_SELECTION_MARKER_NAME = 'link-ui';
  55291. /**
  55292. * The link UI plugin. It introduces the `'link'` and `'unlink'` buttons and support for the <kbd>Ctrl+K</kbd> keystroke.
  55293. *
  55294. * It uses the
  55295. * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon plugin}.
  55296. *
  55297. * @extends module:core/plugin~Plugin
  55298. */
  55299. class LinkUI extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  55300. /**
  55301. * @inheritDoc
  55302. */
  55303. static get requires() {
  55304. return [ _ckeditor_ckeditor5_ui_src_panel_balloon_contextualballoon__WEBPACK_IMPORTED_MODULE_3__["default"] ];
  55305. }
  55306. /**
  55307. * @inheritDoc
  55308. */
  55309. static get pluginName() {
  55310. return 'LinkUI';
  55311. }
  55312. /**
  55313. * @inheritDoc
  55314. */
  55315. init() {
  55316. const editor = this.editor;
  55317. editor.editing.view.addObserver( _ckeditor_ckeditor5_engine_src_view_observer_clickobserver__WEBPACK_IMPORTED_MODULE_1__["default"] );
  55318. /**
  55319. * The actions view displayed inside of the balloon.
  55320. *
  55321. * @member {module:link/ui/linkactionsview~LinkActionsView}
  55322. */
  55323. this.actionsView = this._createActionsView();
  55324. /**
  55325. * The form view displayed inside the balloon.
  55326. *
  55327. * @member {module:link/ui/linkformview~LinkFormView}
  55328. */
  55329. this.formView = this._createFormView();
  55330. /**
  55331. * The contextual balloon plugin instance.
  55332. *
  55333. * @private
  55334. * @member {module:ui/panel/balloon/contextualballoon~ContextualBalloon}
  55335. */
  55336. this._balloon = editor.plugins.get( _ckeditor_ckeditor5_ui_src_panel_balloon_contextualballoon__WEBPACK_IMPORTED_MODULE_3__["default"] );
  55337. // Create toolbar buttons.
  55338. this._createToolbarLinkButton();
  55339. // Attach lifecycle actions to the the balloon.
  55340. this._enableUserBalloonInteractions();
  55341. // Renders a fake visual selection marker on an expanded selection.
  55342. editor.conversion.for( 'editingDowncast' ).markerToHighlight( {
  55343. model: VISUAL_SELECTION_MARKER_NAME,
  55344. view: {
  55345. classes: [ 'ck-fake-link-selection' ]
  55346. }
  55347. } );
  55348. // Renders a fake visual selection marker on a collapsed selection.
  55349. editor.conversion.for( 'editingDowncast' ).markerToElement( {
  55350. model: VISUAL_SELECTION_MARKER_NAME,
  55351. view: {
  55352. name: 'span',
  55353. classes: [ 'ck-fake-link-selection', 'ck-fake-link-selection_collapsed' ]
  55354. }
  55355. } );
  55356. }
  55357. /**
  55358. * @inheritDoc
  55359. */
  55360. destroy() {
  55361. super.destroy();
  55362. // Destroy created UI components as they are not automatically destroyed (see ckeditor5#1341).
  55363. this.formView.destroy();
  55364. }
  55365. /**
  55366. * Creates the {@link module:link/ui/linkactionsview~LinkActionsView} instance.
  55367. *
  55368. * @private
  55369. * @returns {module:link/ui/linkactionsview~LinkActionsView} The link actions view instance.
  55370. */
  55371. _createActionsView() {
  55372. const editor = this.editor;
  55373. const actionsView = new _ui_linkactionsview__WEBPACK_IMPORTED_MODULE_7__["default"]( editor.locale );
  55374. const linkCommand = editor.commands.get( 'link' );
  55375. const unlinkCommand = editor.commands.get( 'unlink' );
  55376. actionsView.bind( 'href' ).to( linkCommand, 'value' );
  55377. actionsView.editButtonView.bind( 'isEnabled' ).to( linkCommand );
  55378. actionsView.unlinkButtonView.bind( 'isEnabled' ).to( unlinkCommand );
  55379. // Execute unlink command after clicking on the "Edit" button.
  55380. this.listenTo( actionsView, 'edit', () => {
  55381. this._addFormView();
  55382. } );
  55383. // Execute unlink command after clicking on the "Unlink" button.
  55384. this.listenTo( actionsView, 'unlink', () => {
  55385. editor.execute( 'unlink' );
  55386. this._hideUI();
  55387. } );
  55388. // Close the panel on esc key press when the **actions have focus**.
  55389. actionsView.keystrokes.set( 'Esc', ( data, cancel ) => {
  55390. this._hideUI();
  55391. cancel();
  55392. } );
  55393. // Open the form view on Ctrl+K when the **actions have focus**..
  55394. actionsView.keystrokes.set( _utils__WEBPACK_IMPORTED_MODULE_2__["LINK_KEYSTROKE"], ( data, cancel ) => {
  55395. this._addFormView();
  55396. cancel();
  55397. } );
  55398. return actionsView;
  55399. }
  55400. /**
  55401. * Creates the {@link module:link/ui/linkformview~LinkFormView} instance.
  55402. *
  55403. * @private
  55404. * @returns {module:link/ui/linkformview~LinkFormView} The link form view instance.
  55405. */
  55406. _createFormView() {
  55407. const editor = this.editor;
  55408. const linkCommand = editor.commands.get( 'link' );
  55409. const defaultProtocol = editor.config.get( 'link.defaultProtocol' );
  55410. const formView = new _ui_linkformview__WEBPACK_IMPORTED_MODULE_6__["default"]( editor.locale, linkCommand, defaultProtocol );
  55411. formView.urlInputView.fieldView.bind( 'value' ).to( linkCommand, 'value' );
  55412. // Form elements should be read-only when corresponding commands are disabled.
  55413. formView.urlInputView.bind( 'isReadOnly' ).to( linkCommand, 'isEnabled', value => !value );
  55414. formView.saveButtonView.bind( 'isEnabled' ).to( linkCommand );
  55415. // Execute link command after clicking the "Save" button.
  55416. this.listenTo( formView, 'submit', () => {
  55417. const { value } = formView.urlInputView.fieldView.element;
  55418. const parsedUrl = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["addLinkProtocolIfApplicable"])( value, defaultProtocol );
  55419. editor.execute( 'link', parsedUrl, formView.getDecoratorSwitchesState() );
  55420. this._closeFormView();
  55421. } );
  55422. // Hide the panel after clicking the "Cancel" button.
  55423. this.listenTo( formView, 'cancel', () => {
  55424. this._closeFormView();
  55425. } );
  55426. // Close the panel on esc key press when the **form has focus**.
  55427. formView.keystrokes.set( 'Esc', ( data, cancel ) => {
  55428. this._closeFormView();
  55429. cancel();
  55430. } );
  55431. return formView;
  55432. }
  55433. /**
  55434. * Creates a toolbar Link button. Clicking this button will show
  55435. * a {@link #_balloon} attached to the selection.
  55436. *
  55437. * @private
  55438. */
  55439. _createToolbarLinkButton() {
  55440. const editor = this.editor;
  55441. const linkCommand = editor.commands.get( 'link' );
  55442. const t = editor.t;
  55443. // Handle the `Ctrl+K` keystroke and show the panel.
  55444. editor.keystrokes.set( _utils__WEBPACK_IMPORTED_MODULE_2__["LINK_KEYSTROKE"], ( keyEvtData, cancel ) => {
  55445. // Prevent focusing the search bar in FF, Chrome and Edge. See https://github.com/ckeditor/ckeditor5/issues/4811.
  55446. cancel();
  55447. if ( linkCommand.isEnabled ) {
  55448. this._showUI( true );
  55449. }
  55450. } );
  55451. editor.ui.componentFactory.add( 'link', locale => {
  55452. const button = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_5__["default"]( locale );
  55453. button.isEnabled = true;
  55454. button.label = t( 'Link' );
  55455. button.icon = _theme_icons_link_svg__WEBPACK_IMPORTED_MODULE_8__["default"];
  55456. button.keystroke = _utils__WEBPACK_IMPORTED_MODULE_2__["LINK_KEYSTROKE"];
  55457. button.tooltip = true;
  55458. button.isToggleable = true;
  55459. // Bind button to the command.
  55460. button.bind( 'isEnabled' ).to( linkCommand, 'isEnabled' );
  55461. button.bind( 'isOn' ).to( linkCommand, 'value', value => !!value );
  55462. // Show the panel on button click.
  55463. this.listenTo( button, 'execute', () => this._showUI( true ) );
  55464. return button;
  55465. } );
  55466. }
  55467. /**
  55468. * Attaches actions that control whether the balloon panel containing the
  55469. * {@link #formView} is visible or not.
  55470. *
  55471. * @private
  55472. */
  55473. _enableUserBalloonInteractions() {
  55474. const viewDocument = this.editor.editing.view.document;
  55475. // Handle click on view document and show panel when selection is placed inside the link element.
  55476. // Keep panel open until selection will be inside the same link element.
  55477. this.listenTo( viewDocument, 'click', () => {
  55478. const parentLink = this._getSelectedLinkElement();
  55479. if ( parentLink ) {
  55480. // Then show panel but keep focus inside editor editable.
  55481. this._showUI();
  55482. }
  55483. } );
  55484. // Focus the form if the balloon is visible and the Tab key has been pressed.
  55485. this.editor.keystrokes.set( 'Tab', ( data, cancel ) => {
  55486. if ( this._areActionsVisible && !this.actionsView.focusTracker.isFocused ) {
  55487. this.actionsView.focus();
  55488. cancel();
  55489. }
  55490. }, {
  55491. // Use the high priority because the link UI navigation is more important
  55492. // than other feature's actions, e.g. list indentation.
  55493. // https://github.com/ckeditor/ckeditor5-link/issues/146
  55494. priority: 'high'
  55495. } );
  55496. // Close the panel on the Esc key press when the editable has focus and the balloon is visible.
  55497. this.editor.keystrokes.set( 'Esc', ( data, cancel ) => {
  55498. if ( this._isUIVisible ) {
  55499. this._hideUI();
  55500. cancel();
  55501. }
  55502. } );
  55503. // Close on click outside of balloon panel element.
  55504. Object(_ckeditor_ckeditor5_ui_src_bindings_clickoutsidehandler__WEBPACK_IMPORTED_MODULE_4__["default"])( {
  55505. emitter: this.formView,
  55506. activator: () => this._isUIInPanel,
  55507. contextElements: [ this._balloon.view.element ],
  55508. callback: () => this._hideUI()
  55509. } );
  55510. }
  55511. /**
  55512. * Adds the {@link #actionsView} to the {@link #_balloon}.
  55513. *
  55514. * @protected
  55515. */
  55516. _addActionsView() {
  55517. if ( this._areActionsInPanel ) {
  55518. return;
  55519. }
  55520. this._balloon.add( {
  55521. view: this.actionsView,
  55522. position: this._getBalloonPositionData()
  55523. } );
  55524. }
  55525. /**
  55526. * Adds the {@link #formView} to the {@link #_balloon}.
  55527. *
  55528. * @protected
  55529. */
  55530. _addFormView() {
  55531. if ( this._isFormInPanel ) {
  55532. return;
  55533. }
  55534. const editor = this.editor;
  55535. const linkCommand = editor.commands.get( 'link' );
  55536. this._balloon.add( {
  55537. view: this.formView,
  55538. position: this._getBalloonPositionData()
  55539. } );
  55540. // Select input when form view is currently visible.
  55541. if ( this._balloon.visibleView === this.formView ) {
  55542. this.formView.urlInputView.fieldView.select();
  55543. }
  55544. // Make sure that each time the panel shows up, the URL field remains in sync with the value of
  55545. // the command. If the user typed in the input, then canceled the balloon (`urlInputView.fieldView#value` stays
  55546. // unaltered) and re-opened it without changing the value of the link command (e.g. because they
  55547. // clicked the same link), they would see the old value instead of the actual value of the command.
  55548. // https://github.com/ckeditor/ckeditor5-link/issues/78
  55549. // https://github.com/ckeditor/ckeditor5-link/issues/123
  55550. this.formView.urlInputView.fieldView.element.value = linkCommand.value || '';
  55551. }
  55552. /**
  55553. * Closes the form view. Decides whether the balloon should be hidden completely or if the action view should be shown. This is
  55554. * decided upon the link command value (which has a value if the document selection is in the link).
  55555. *
  55556. * Additionally, if any {@link module:link/link~LinkConfig#decorators} are defined in the editor configuration, the state of
  55557. * switch buttons responsible for manual decorator handling is restored.
  55558. *
  55559. * @private
  55560. */
  55561. _closeFormView() {
  55562. const linkCommand = this.editor.commands.get( 'link' );
  55563. // Restore manual decorator states to represent the current model state. This case is important to reset the switch buttons
  55564. // when the user cancels the editing form.
  55565. linkCommand.restoreManualDecoratorStates();
  55566. if ( linkCommand.value !== undefined ) {
  55567. this._removeFormView();
  55568. } else {
  55569. this._hideUI();
  55570. }
  55571. }
  55572. /**
  55573. * Removes the {@link #formView} from the {@link #_balloon}.
  55574. *
  55575. * @protected
  55576. */
  55577. _removeFormView() {
  55578. if ( this._isFormInPanel ) {
  55579. // Blur the input element before removing it from DOM to prevent issues in some browsers.
  55580. // See https://github.com/ckeditor/ckeditor5/issues/1501.
  55581. this.formView.saveButtonView.focus();
  55582. this._balloon.remove( this.formView );
  55583. // Because the form has an input which has focus, the focus must be brought back
  55584. // to the editor. Otherwise, it would be lost.
  55585. this.editor.editing.view.focus();
  55586. this._hideFakeVisualSelection();
  55587. }
  55588. }
  55589. /**
  55590. * Shows the correct UI type. It is either {@link #formView} or {@link #actionsView}.
  55591. *
  55592. * @param {Boolean} forceVisible
  55593. * @private
  55594. */
  55595. _showUI( forceVisible = false ) {
  55596. // When there's no link under the selection, go straight to the editing UI.
  55597. if ( !this._getSelectedLinkElement() ) {
  55598. // Show visual selection on a text without a link when the contextual balloon is displayed.
  55599. // See https://github.com/ckeditor/ckeditor5/issues/4721.
  55600. this._showFakeVisualSelection();
  55601. this._addActionsView();
  55602. // Be sure panel with link is visible.
  55603. if ( forceVisible ) {
  55604. this._balloon.showStack( 'main' );
  55605. }
  55606. this._addFormView();
  55607. }
  55608. // If there's a link under the selection...
  55609. else {
  55610. // Go to the editing UI if actions are already visible.
  55611. if ( this._areActionsVisible ) {
  55612. this._addFormView();
  55613. }
  55614. // Otherwise display just the actions UI.
  55615. else {
  55616. this._addActionsView();
  55617. }
  55618. // Be sure panel with link is visible.
  55619. if ( forceVisible ) {
  55620. this._balloon.showStack( 'main' );
  55621. }
  55622. }
  55623. // Begin responding to ui#update once the UI is added.
  55624. this._startUpdatingUI();
  55625. }
  55626. /**
  55627. * Removes the {@link #formView} from the {@link #_balloon}.
  55628. *
  55629. * See {@link #_addFormView}, {@link #_addActionsView}.
  55630. *
  55631. * @protected
  55632. */
  55633. _hideUI() {
  55634. if ( !this._isUIInPanel ) {
  55635. return;
  55636. }
  55637. const editor = this.editor;
  55638. this.stopListening( editor.ui, 'update' );
  55639. this.stopListening( this._balloon, 'change:visibleView' );
  55640. // Make sure the focus always gets back to the editable _before_ removing the focused form view.
  55641. // Doing otherwise causes issues in some browsers. See https://github.com/ckeditor/ckeditor5-link/issues/193.
  55642. editor.editing.view.focus();
  55643. // Remove form first because it's on top of the stack.
  55644. this._removeFormView();
  55645. // Then remove the actions view because it's beneath the form.
  55646. this._balloon.remove( this.actionsView );
  55647. this._hideFakeVisualSelection();
  55648. }
  55649. /**
  55650. * Makes the UI react to the {@link module:core/editor/editorui~EditorUI#event:update} event to
  55651. * reposition itself when the editor UI should be refreshed.
  55652. *
  55653. * See: {@link #_hideUI} to learn when the UI stops reacting to the `update` event.
  55654. *
  55655. * @protected
  55656. */
  55657. _startUpdatingUI() {
  55658. const editor = this.editor;
  55659. const viewDocument = editor.editing.view.document;
  55660. let prevSelectedLink = this._getSelectedLinkElement();
  55661. let prevSelectionParent = getSelectionParent();
  55662. const update = () => {
  55663. const selectedLink = this._getSelectedLinkElement();
  55664. const selectionParent = getSelectionParent();
  55665. // Hide the panel if:
  55666. //
  55667. // * the selection went out of the EXISTING link element. E.g. user moved the caret out
  55668. // of the link,
  55669. // * the selection went to a different parent when creating a NEW link. E.g. someone
  55670. // else modified the document.
  55671. // * the selection has expanded (e.g. displaying link actions then pressing SHIFT+Right arrow).
  55672. //
  55673. // Note: #_getSelectedLinkElement will return a link for a non-collapsed selection only
  55674. // when fully selected.
  55675. if ( ( prevSelectedLink && !selectedLink ) ||
  55676. ( !prevSelectedLink && selectionParent !== prevSelectionParent ) ) {
  55677. this._hideUI();
  55678. }
  55679. // Update the position of the panel when:
  55680. // * link panel is in the visible stack
  55681. // * the selection remains in the original link element,
  55682. // * there was no link element in the first place, i.e. creating a new link
  55683. else if ( this._isUIVisible ) {
  55684. // If still in a link element, simply update the position of the balloon.
  55685. // If there was no link (e.g. inserting one), the balloon must be moved
  55686. // to the new position in the editing view (a new native DOM range).
  55687. this._balloon.updatePosition( this._getBalloonPositionData() );
  55688. }
  55689. prevSelectedLink = selectedLink;
  55690. prevSelectionParent = selectionParent;
  55691. };
  55692. function getSelectionParent() {
  55693. return viewDocument.selection.focus.getAncestors()
  55694. .reverse()
  55695. .find( node => node.is( 'element' ) );
  55696. }
  55697. this.listenTo( editor.ui, 'update', update );
  55698. this.listenTo( this._balloon, 'change:visibleView', update );
  55699. }
  55700. /**
  55701. * Returns `true` when {@link #formView} is in the {@link #_balloon}.
  55702. *
  55703. * @readonly
  55704. * @protected
  55705. * @type {Boolean}
  55706. */
  55707. get _isFormInPanel() {
  55708. return this._balloon.hasView( this.formView );
  55709. }
  55710. /**
  55711. * Returns `true` when {@link #actionsView} is in the {@link #_balloon}.
  55712. *
  55713. * @readonly
  55714. * @protected
  55715. * @type {Boolean}
  55716. */
  55717. get _areActionsInPanel() {
  55718. return this._balloon.hasView( this.actionsView );
  55719. }
  55720. /**
  55721. * Returns `true` when {@link #actionsView} is in the {@link #_balloon} and it is
  55722. * currently visible.
  55723. *
  55724. * @readonly
  55725. * @protected
  55726. * @type {Boolean}
  55727. */
  55728. get _areActionsVisible() {
  55729. return this._balloon.visibleView === this.actionsView;
  55730. }
  55731. /**
  55732. * Returns `true` when {@link #actionsView} or {@link #formView} is in the {@link #_balloon}.
  55733. *
  55734. * @readonly
  55735. * @protected
  55736. * @type {Boolean}
  55737. */
  55738. get _isUIInPanel() {
  55739. return this._isFormInPanel || this._areActionsInPanel;
  55740. }
  55741. /**
  55742. * Returns `true` when {@link #actionsView} or {@link #formView} is in the {@link #_balloon} and it is
  55743. * currently visible.
  55744. *
  55745. * @readonly
  55746. * @protected
  55747. * @type {Boolean}
  55748. */
  55749. get _isUIVisible() {
  55750. const visibleView = this._balloon.visibleView;
  55751. return visibleView == this.formView || this._areActionsVisible;
  55752. }
  55753. /**
  55754. * Returns positioning options for the {@link #_balloon}. They control the way the balloon is attached
  55755. * to the target element or selection.
  55756. *
  55757. * If the selection is collapsed and inside a link element, the panel will be attached to the
  55758. * entire link element. Otherwise, it will be attached to the selection.
  55759. *
  55760. * @private
  55761. * @returns {module:utils/dom/position~Options}
  55762. */
  55763. _getBalloonPositionData() {
  55764. const view = this.editor.editing.view;
  55765. const model = this.editor.model;
  55766. const viewDocument = view.document;
  55767. let target = null;
  55768. if ( model.markers.has( VISUAL_SELECTION_MARKER_NAME ) ) {
  55769. // There are cases when we highlight selection using a marker (#7705, #4721).
  55770. const markerViewElements = Array.from( this.editor.editing.mapper.markerNameToElements( VISUAL_SELECTION_MARKER_NAME ) );
  55771. const newRange = view.createRange(
  55772. view.createPositionBefore( markerViewElements[ 0 ] ),
  55773. view.createPositionAfter( markerViewElements[ markerViewElements.length - 1 ] )
  55774. );
  55775. target = view.domConverter.viewRangeToDom( newRange );
  55776. } else {
  55777. const targetLink = this._getSelectedLinkElement();
  55778. const range = viewDocument.selection.getFirstRange();
  55779. target = targetLink ?
  55780. // When selection is inside link element, then attach panel to this element.
  55781. view.domConverter.mapViewToDom( targetLink ) :
  55782. // Otherwise attach panel to the selection.
  55783. view.domConverter.viewRangeToDom( range );
  55784. }
  55785. return { target };
  55786. }
  55787. /**
  55788. * Returns the link {@link module:engine/view/attributeelement~AttributeElement} under
  55789. * the {@link module:engine/view/document~Document editing view's} selection or `null`
  55790. * if there is none.
  55791. *
  55792. * **Note**: For a non–collapsed selection, the link element is only returned when **fully**
  55793. * selected and the **only** element within the selection boundaries.
  55794. *
  55795. * @private
  55796. * @returns {module:engine/view/attributeelement~AttributeElement|null}
  55797. */
  55798. _getSelectedLinkElement() {
  55799. const view = this.editor.editing.view;
  55800. const selection = view.document.selection;
  55801. if ( selection.isCollapsed ) {
  55802. return findLinkElementAncestor( selection.getFirstPosition() );
  55803. } else {
  55804. // The range for fully selected link is usually anchored in adjacent text nodes.
  55805. // Trim it to get closer to the actual link element.
  55806. const range = selection.getFirstRange().getTrimmed();
  55807. const startLink = findLinkElementAncestor( range.start );
  55808. const endLink = findLinkElementAncestor( range.end );
  55809. if ( !startLink || startLink != endLink ) {
  55810. return null;
  55811. }
  55812. // Check if the link element is fully selected.
  55813. if ( view.createRangeIn( startLink ).getTrimmed().isEqual( range ) ) {
  55814. return startLink;
  55815. } else {
  55816. return null;
  55817. }
  55818. }
  55819. }
  55820. /**
  55821. * Displays a fake visual selection when the contextual balloon is displayed.
  55822. *
  55823. * This adds a 'link-ui' marker into the document that is rendered as a highlight on selected text fragment.
  55824. *
  55825. * @private
  55826. */
  55827. _showFakeVisualSelection() {
  55828. const model = this.editor.model;
  55829. model.change( writer => {
  55830. const range = model.document.selection.getFirstRange();
  55831. if ( model.markers.has( VISUAL_SELECTION_MARKER_NAME ) ) {
  55832. writer.updateMarker( VISUAL_SELECTION_MARKER_NAME, { range } );
  55833. } else {
  55834. if ( range.start.isAtEnd ) {
  55835. const focus = model.document.selection.focus;
  55836. const nextValidRange = getNextValidRange( range, focus, writer );
  55837. writer.addMarker( VISUAL_SELECTION_MARKER_NAME, {
  55838. usingOperation: false,
  55839. affectsData: false,
  55840. range: nextValidRange
  55841. } );
  55842. } else {
  55843. writer.addMarker( VISUAL_SELECTION_MARKER_NAME, {
  55844. usingOperation: false,
  55845. affectsData: false,
  55846. range
  55847. } );
  55848. }
  55849. }
  55850. } );
  55851. }
  55852. /**
  55853. * Hides the fake visual selection created in {@link #_showFakeVisualSelection}.
  55854. *
  55855. * @private
  55856. */
  55857. _hideFakeVisualSelection() {
  55858. const model = this.editor.model;
  55859. if ( model.markers.has( VISUAL_SELECTION_MARKER_NAME ) ) {
  55860. model.change( writer => {
  55861. writer.removeMarker( VISUAL_SELECTION_MARKER_NAME );
  55862. } );
  55863. }
  55864. }
  55865. }
  55866. // Returns a link element if there's one among the ancestors of the provided `Position`.
  55867. //
  55868. // @private
  55869. // @param {module:engine/view/position~Position} View position to analyze.
  55870. // @returns {module:engine/view/attributeelement~AttributeElement|null} Link element at the position or null.
  55871. function findLinkElementAncestor( position ) {
  55872. return position.getAncestors().find( ancestor => Object(_utils__WEBPACK_IMPORTED_MODULE_2__["isLinkElement"])( ancestor ) );
  55873. }
  55874. // Returns next valid range for the fake visual selection marker.
  55875. //
  55876. // @private
  55877. // @param {module:engine/model/range~Range} range Current range.
  55878. // @param {module:engine/model/position~Position} focus Selection focus.
  55879. // @param {module:engine/model/writer~Writer} writer Writer.
  55880. // @returns {module:engine/model/range~Range} New valid range for the fake visual selection marker.
  55881. function getNextValidRange( range, focus, writer ) {
  55882. const nextStartPath = [ range.start.path[ 0 ] + 1, 0 ];
  55883. const nextStartPosition = writer.createPositionFromPath( range.start.root, nextStartPath, 'toNext' );
  55884. const nextRange = writer.createRange( nextStartPosition, range.end );
  55885. // Block creating a potential next valid range over the current range end.
  55886. if ( nextRange.start.path[ 0 ] > range.end.path[ 0 ] ) {
  55887. return writer.createRange( focus );
  55888. }
  55889. if ( nextStartPosition.isAtStart && nextStartPosition.isAtEnd ) {
  55890. return getNextValidRange( nextRange, focus, writer );
  55891. }
  55892. return nextRange;
  55893. }
  55894. /***/ }),
  55895. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/ui/linkactionsview.js":
  55896. /*!*************************************************************************!*\
  55897. !*** ./node_modules/@ckeditor/ckeditor5-link/src/ui/linkactionsview.js ***!
  55898. \*************************************************************************/
  55899. /*! exports provided: default */
  55900. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  55901. "use strict";
  55902. __webpack_require__.r(__webpack_exports__);
  55903. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LinkActionsView; });
  55904. /* harmony import */ var _ckeditor_ckeditor5_ui_src_view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  55905. /* harmony import */ var _ckeditor_ckeditor5_ui_src_viewcollection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/viewcollection */ "./node_modules/@ckeditor/ckeditor5-ui/src/viewcollection.js");
  55906. /* harmony import */ var _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  55907. /* harmony import */ var _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/focustracker */ "./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js");
  55908. /* harmony import */ var _ckeditor_ckeditor5_ui_src_focuscycler__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/focuscycler */ "./node_modules/@ckeditor/ckeditor5-ui/src/focuscycler.js");
  55909. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keystrokehandler */ "./node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js");
  55910. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-link/src/utils.js");
  55911. /* harmony import */ var _theme_icons_unlink_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../theme/icons/unlink.svg */ "./node_modules/@ckeditor/ckeditor5-link/theme/icons/unlink.svg");
  55912. /* harmony import */ var _ckeditor_ckeditor5_core_theme_icons_pencil_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/theme/icons/pencil.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/pencil.svg");
  55913. /* harmony import */ var _theme_linkactions_css__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../theme/linkactions.css */ "./node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css");
  55914. /* harmony import */ var _theme_linkactions_css__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_theme_linkactions_css__WEBPACK_IMPORTED_MODULE_9__);
  55915. /* harmony import */ var _ckeditor_ckeditor5_ui_theme_components_responsive_form_responsiveform_css__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css");
  55916. /* harmony import */ var _ckeditor_ckeditor5_ui_theme_components_responsive_form_responsiveform_css__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_ckeditor_ckeditor5_ui_theme_components_responsive_form_responsiveform_css__WEBPACK_IMPORTED_MODULE_10__);
  55917. /**
  55918. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  55919. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  55920. */
  55921. /**
  55922. * @module link/ui/linkactionsview
  55923. */
  55924. /**
  55925. * The link actions view class. This view displays the link preview, allows
  55926. * unlinking or editing the link.
  55927. *
  55928. * @extends module:ui/view~View
  55929. */
  55930. class LinkActionsView extends _ckeditor_ckeditor5_ui_src_view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  55931. /**
  55932. * @inheritDoc
  55933. */
  55934. constructor( locale ) {
  55935. super( locale );
  55936. const t = locale.t;
  55937. /**
  55938. * Tracks information about DOM focus in the actions.
  55939. *
  55940. * @readonly
  55941. * @member {module:utils/focustracker~FocusTracker}
  55942. */
  55943. this.focusTracker = new _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_3__["default"]();
  55944. /**
  55945. * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
  55946. *
  55947. * @readonly
  55948. * @member {module:utils/keystrokehandler~KeystrokeHandler}
  55949. */
  55950. this.keystrokes = new _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_5__["default"]();
  55951. /**
  55952. * The href preview view.
  55953. *
  55954. * @member {module:ui/view~View}
  55955. */
  55956. this.previewButtonView = this._createPreviewButton();
  55957. /**
  55958. * The unlink button view.
  55959. *
  55960. * @member {module:ui/button/buttonview~ButtonView}
  55961. */
  55962. this.unlinkButtonView = this._createButton( t( 'Unlink' ), _theme_icons_unlink_svg__WEBPACK_IMPORTED_MODULE_7__["default"], 'unlink' );
  55963. /**
  55964. * The edit link button view.
  55965. *
  55966. * @member {module:ui/button/buttonview~ButtonView}
  55967. */
  55968. this.editButtonView = this._createButton( t( 'Edit link' ), _ckeditor_ckeditor5_core_theme_icons_pencil_svg__WEBPACK_IMPORTED_MODULE_8__["default"], 'edit' );
  55969. /**
  55970. * The value of the "href" attribute of the link to use in the {@link #previewButtonView}.
  55971. *
  55972. * @observable
  55973. * @member {String}
  55974. */
  55975. this.set( 'href' );
  55976. /**
  55977. * A collection of views that can be focused in the view.
  55978. *
  55979. * @readonly
  55980. * @protected
  55981. * @member {module:ui/viewcollection~ViewCollection}
  55982. */
  55983. this._focusables = new _ckeditor_ckeditor5_ui_src_viewcollection__WEBPACK_IMPORTED_MODULE_1__["default"]();
  55984. /**
  55985. * Helps cycling over {@link #_focusables} in the view.
  55986. *
  55987. * @readonly
  55988. * @protected
  55989. * @member {module:ui/focuscycler~FocusCycler}
  55990. */
  55991. this._focusCycler = new _ckeditor_ckeditor5_ui_src_focuscycler__WEBPACK_IMPORTED_MODULE_4__["default"]( {
  55992. focusables: this._focusables,
  55993. focusTracker: this.focusTracker,
  55994. keystrokeHandler: this.keystrokes,
  55995. actions: {
  55996. // Navigate fields backwards using the Shift + Tab keystroke.
  55997. focusPrevious: 'shift + tab',
  55998. // Navigate fields forwards using the Tab key.
  55999. focusNext: 'tab'
  56000. }
  56001. } );
  56002. this.setTemplate( {
  56003. tag: 'div',
  56004. attributes: {
  56005. class: [
  56006. 'ck',
  56007. 'ck-link-actions',
  56008. 'ck-responsive-form'
  56009. ],
  56010. // https://github.com/ckeditor/ckeditor5-link/issues/90
  56011. tabindex: '-1'
  56012. },
  56013. children: [
  56014. this.previewButtonView,
  56015. this.editButtonView,
  56016. this.unlinkButtonView
  56017. ]
  56018. } );
  56019. }
  56020. /**
  56021. * @inheritDoc
  56022. */
  56023. render() {
  56024. super.render();
  56025. const childViews = [
  56026. this.previewButtonView,
  56027. this.editButtonView,
  56028. this.unlinkButtonView
  56029. ];
  56030. childViews.forEach( v => {
  56031. // Register the view as focusable.
  56032. this._focusables.add( v );
  56033. // Register the view in the focus tracker.
  56034. this.focusTracker.add( v.element );
  56035. } );
  56036. // Start listening for the keystrokes coming from #element.
  56037. this.keystrokes.listenTo( this.element );
  56038. }
  56039. /**
  56040. * Focuses the fist {@link #_focusables} in the actions.
  56041. */
  56042. focus() {
  56043. this._focusCycler.focusFirst();
  56044. }
  56045. /**
  56046. * Creates a button view.
  56047. *
  56048. * @private
  56049. * @param {String} label The button label.
  56050. * @param {String} icon The button icon.
  56051. * @param {String} [eventName] An event name that the `ButtonView#execute` event will be delegated to.
  56052. * @returns {module:ui/button/buttonview~ButtonView} The button view instance.
  56053. */
  56054. _createButton( label, icon, eventName ) {
  56055. const button = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_2__["default"]( this.locale );
  56056. button.set( {
  56057. label,
  56058. icon,
  56059. tooltip: true
  56060. } );
  56061. button.delegate( 'execute' ).to( this, eventName );
  56062. return button;
  56063. }
  56064. /**
  56065. * Creates a link href preview button.
  56066. *
  56067. * @private
  56068. * @returns {module:ui/button/buttonview~ButtonView} The button view instance.
  56069. */
  56070. _createPreviewButton() {
  56071. const button = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_2__["default"]( this.locale );
  56072. const bind = this.bindTemplate;
  56073. const t = this.t;
  56074. button.set( {
  56075. withText: true,
  56076. tooltip: t( 'Open link in new tab' )
  56077. } );
  56078. button.extendTemplate( {
  56079. attributes: {
  56080. class: [
  56081. 'ck',
  56082. 'ck-link-actions__preview'
  56083. ],
  56084. href: bind.to( 'href', href => href && Object(_utils__WEBPACK_IMPORTED_MODULE_6__["ensureSafeUrl"])( href ) ),
  56085. target: '_blank',
  56086. rel: 'noopener noreferrer'
  56087. }
  56088. } );
  56089. button.bind( 'label' ).to( this, 'href', href => {
  56090. return href || t( 'This link has no URL' );
  56091. } );
  56092. button.bind( 'isEnabled' ).to( this, 'href', href => !!href );
  56093. button.template.tag = 'a';
  56094. button.template.eventListeners = {};
  56095. return button;
  56096. }
  56097. }
  56098. /**
  56099. * Fired when the {@link #editButtonView} is clicked.
  56100. *
  56101. * @event edit
  56102. */
  56103. /**
  56104. * Fired when the {@link #unlinkButtonView} is clicked.
  56105. *
  56106. * @event unlink
  56107. */
  56108. /***/ }),
  56109. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/ui/linkformview.js":
  56110. /*!**********************************************************************!*\
  56111. !*** ./node_modules/@ckeditor/ckeditor5-link/src/ui/linkformview.js ***!
  56112. \**********************************************************************/
  56113. /*! exports provided: default */
  56114. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  56115. "use strict";
  56116. __webpack_require__.r(__webpack_exports__);
  56117. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LinkFormView; });
  56118. /* harmony import */ var _ckeditor_ckeditor5_ui_src_view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  56119. /* harmony import */ var _ckeditor_ckeditor5_ui_src_viewcollection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/viewcollection */ "./node_modules/@ckeditor/ckeditor5-ui/src/viewcollection.js");
  56120. /* harmony import */ var _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  56121. /* harmony import */ var _ckeditor_ckeditor5_ui_src_button_switchbuttonview__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/button/switchbuttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/switchbuttonview.js");
  56122. /* harmony import */ var _ckeditor_ckeditor5_ui_src_labeledfield_labeledfieldview__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/labeledfield/labeledfieldview */ "./node_modules/@ckeditor/ckeditor5-ui/src/labeledfield/labeledfieldview.js");
  56123. /* harmony import */ var _ckeditor_ckeditor5_ui_src_labeledfield_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/labeledfield/utils */ "./node_modules/@ckeditor/ckeditor5-ui/src/labeledfield/utils.js");
  56124. /* harmony import */ var _ckeditor_ckeditor5_ui_src_bindings_submithandler__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/bindings/submithandler */ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/submithandler.js");
  56125. /* harmony import */ var _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/focustracker */ "./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js");
  56126. /* harmony import */ var _ckeditor_ckeditor5_ui_src_focuscycler__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/focuscycler */ "./node_modules/@ckeditor/ckeditor5-ui/src/focuscycler.js");
  56127. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keystrokehandler */ "./node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js");
  56128. /* harmony import */ var _ckeditor_ckeditor5_core_theme_icons_check_svg__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/theme/icons/check.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/check.svg");
  56129. /* harmony import */ var _ckeditor_ckeditor5_core_theme_icons_cancel_svg__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/theme/icons/cancel.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/cancel.svg");
  56130. /* harmony import */ var _theme_linkform_css__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../theme/linkform.css */ "./node_modules/@ckeditor/ckeditor5-link/theme/linkform.css");
  56131. /* harmony import */ var _theme_linkform_css__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_theme_linkform_css__WEBPACK_IMPORTED_MODULE_12__);
  56132. /* harmony import */ var _ckeditor_ckeditor5_ui_theme_components_responsive_form_responsiveform_css__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css");
  56133. /* harmony import */ var _ckeditor_ckeditor5_ui_theme_components_responsive_form_responsiveform_css__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_ckeditor_ckeditor5_ui_theme_components_responsive_form_responsiveform_css__WEBPACK_IMPORTED_MODULE_13__);
  56134. /**
  56135. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  56136. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  56137. */
  56138. /**
  56139. * @module link/ui/linkformview
  56140. */
  56141. /**
  56142. * The link form view controller class.
  56143. *
  56144. * See {@link module:link/ui/linkformview~LinkFormView}.
  56145. *
  56146. * @extends module:ui/view~View
  56147. */
  56148. class LinkFormView extends _ckeditor_ckeditor5_ui_src_view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  56149. /**
  56150. * Creates an instance of the {@link module:link/ui/linkformview~LinkFormView} class.
  56151. *
  56152. * Also see {@link #render}.
  56153. *
  56154. * @param {module:utils/locale~Locale} [locale] The localization services instance.
  56155. * @param {module:link/linkcommand~LinkCommand} linkCommand Reference to {@link module:link/linkcommand~LinkCommand}.
  56156. * @param {String} [protocol] A value of a protocol to be displayed in the input's placeholder.
  56157. */
  56158. constructor( locale, linkCommand, protocol ) {
  56159. super( locale );
  56160. const t = locale.t;
  56161. /**
  56162. * Tracks information about DOM focus in the form.
  56163. *
  56164. * @readonly
  56165. * @member {module:utils/focustracker~FocusTracker}
  56166. */
  56167. this.focusTracker = new _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_7__["default"]();
  56168. /**
  56169. * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
  56170. *
  56171. * @readonly
  56172. * @member {module:utils/keystrokehandler~KeystrokeHandler}
  56173. */
  56174. this.keystrokes = new _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_9__["default"]();
  56175. /**
  56176. * The URL input view.
  56177. *
  56178. * @member {module:ui/labeledfield/labeledfieldview~LabeledFieldView}
  56179. */
  56180. this.urlInputView = this._createUrlInput( protocol );
  56181. /**
  56182. * The Save button view.
  56183. *
  56184. * @member {module:ui/button/buttonview~ButtonView}
  56185. */
  56186. this.saveButtonView = this._createButton( t( 'Save' ), _ckeditor_ckeditor5_core_theme_icons_check_svg__WEBPACK_IMPORTED_MODULE_10__["default"], 'ck-button-save' );
  56187. this.saveButtonView.type = 'submit';
  56188. /**
  56189. * The Cancel button view.
  56190. *
  56191. * @member {module:ui/button/buttonview~ButtonView}
  56192. */
  56193. this.cancelButtonView = this._createButton( t( 'Cancel' ), _ckeditor_ckeditor5_core_theme_icons_cancel_svg__WEBPACK_IMPORTED_MODULE_11__["default"], 'ck-button-cancel', 'cancel' );
  56194. /**
  56195. * A collection of {@link module:ui/button/switchbuttonview~SwitchButtonView},
  56196. * which corresponds to {@link module:link/linkcommand~LinkCommand#manualDecorators manual decorators}
  56197. * configured in the editor.
  56198. *
  56199. * @private
  56200. * @readonly
  56201. * @type {module:ui/viewcollection~ViewCollection}
  56202. */
  56203. this._manualDecoratorSwitches = this._createManualDecoratorSwitches( linkCommand );
  56204. /**
  56205. * A collection of child views in the form.
  56206. *
  56207. * @readonly
  56208. * @type {module:ui/viewcollection~ViewCollection}
  56209. */
  56210. this.children = this._createFormChildren( linkCommand.manualDecorators );
  56211. /**
  56212. * A collection of views that can be focused in the form.
  56213. *
  56214. * @readonly
  56215. * @protected
  56216. * @member {module:ui/viewcollection~ViewCollection}
  56217. */
  56218. this._focusables = new _ckeditor_ckeditor5_ui_src_viewcollection__WEBPACK_IMPORTED_MODULE_1__["default"]();
  56219. /**
  56220. * Helps cycling over {@link #_focusables} in the form.
  56221. *
  56222. * @readonly
  56223. * @protected
  56224. * @member {module:ui/focuscycler~FocusCycler}
  56225. */
  56226. this._focusCycler = new _ckeditor_ckeditor5_ui_src_focuscycler__WEBPACK_IMPORTED_MODULE_8__["default"]( {
  56227. focusables: this._focusables,
  56228. focusTracker: this.focusTracker,
  56229. keystrokeHandler: this.keystrokes,
  56230. actions: {
  56231. // Navigate form fields backwards using the Shift + Tab keystroke.
  56232. focusPrevious: 'shift + tab',
  56233. // Navigate form fields forwards using the Tab key.
  56234. focusNext: 'tab'
  56235. }
  56236. } );
  56237. const classList = [ 'ck', 'ck-link-form', 'ck-responsive-form' ];
  56238. if ( linkCommand.manualDecorators.length ) {
  56239. classList.push( 'ck-link-form_layout-vertical', 'ck-vertical-form' );
  56240. }
  56241. this.setTemplate( {
  56242. tag: 'form',
  56243. attributes: {
  56244. class: classList,
  56245. // https://github.com/ckeditor/ckeditor5-link/issues/90
  56246. tabindex: '-1'
  56247. },
  56248. children: this.children
  56249. } );
  56250. }
  56251. /**
  56252. * Obtains the state of the {@link module:ui/button/switchbuttonview~SwitchButtonView switch buttons} representing
  56253. * {@link module:link/linkcommand~LinkCommand#manualDecorators manual link decorators}
  56254. * in the {@link module:link/ui/linkformview~LinkFormView}.
  56255. *
  56256. * @returns {Object.<String,Boolean>} Key-value pairs, where the key is the name of the decorator and the value is
  56257. * its state.
  56258. */
  56259. getDecoratorSwitchesState() {
  56260. return Array.from( this._manualDecoratorSwitches ).reduce( ( accumulator, switchButton ) => {
  56261. accumulator[ switchButton.name ] = switchButton.isOn;
  56262. return accumulator;
  56263. }, {} );
  56264. }
  56265. /**
  56266. * @inheritDoc
  56267. */
  56268. render() {
  56269. super.render();
  56270. Object(_ckeditor_ckeditor5_ui_src_bindings_submithandler__WEBPACK_IMPORTED_MODULE_6__["default"])( {
  56271. view: this
  56272. } );
  56273. const childViews = [
  56274. this.urlInputView,
  56275. ...this._manualDecoratorSwitches,
  56276. this.saveButtonView,
  56277. this.cancelButtonView
  56278. ];
  56279. childViews.forEach( v => {
  56280. // Register the view as focusable.
  56281. this._focusables.add( v );
  56282. // Register the view in the focus tracker.
  56283. this.focusTracker.add( v.element );
  56284. } );
  56285. // Start listening for the keystrokes coming from #element.
  56286. this.keystrokes.listenTo( this.element );
  56287. }
  56288. /**
  56289. * Focuses the fist {@link #_focusables} in the form.
  56290. */
  56291. focus() {
  56292. this._focusCycler.focusFirst();
  56293. }
  56294. /**
  56295. * Creates a labeled input view.
  56296. *
  56297. * @private
  56298. * @param {String} [protocol=http://] A value of a protocol to be displayed in the input's placeholder.
  56299. * @returns {module:ui/labeledfield/labeledfieldview~LabeledFieldView} Labeled field view instance.
  56300. */
  56301. _createUrlInput( protocol = 'https://' ) {
  56302. const t = this.locale.t;
  56303. const labeledInput = new _ckeditor_ckeditor5_ui_src_labeledfield_labeledfieldview__WEBPACK_IMPORTED_MODULE_4__["default"]( this.locale, _ckeditor_ckeditor5_ui_src_labeledfield_utils__WEBPACK_IMPORTED_MODULE_5__["createLabeledInputText"] );
  56304. labeledInput.label = t( 'Link URL' );
  56305. labeledInput.fieldView.placeholder = protocol + 'example.com';
  56306. return labeledInput;
  56307. }
  56308. /**
  56309. * Creates a button view.
  56310. *
  56311. * @private
  56312. * @param {String} label The button label.
  56313. * @param {String} icon The button icon.
  56314. * @param {String} className The additional button CSS class name.
  56315. * @param {String} [eventName] An event name that the `ButtonView#execute` event will be delegated to.
  56316. * @returns {module:ui/button/buttonview~ButtonView} The button view instance.
  56317. */
  56318. _createButton( label, icon, className, eventName ) {
  56319. const button = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_2__["default"]( this.locale );
  56320. button.set( {
  56321. label,
  56322. icon,
  56323. tooltip: true
  56324. } );
  56325. button.extendTemplate( {
  56326. attributes: {
  56327. class: className
  56328. }
  56329. } );
  56330. if ( eventName ) {
  56331. button.delegate( 'execute' ).to( this, eventName );
  56332. }
  56333. return button;
  56334. }
  56335. /**
  56336. * Populates {@link module:ui/viewcollection~ViewCollection} of {@link module:ui/button/switchbuttonview~SwitchButtonView}
  56337. * made based on {@link module:link/linkcommand~LinkCommand#manualDecorators}.
  56338. *
  56339. * @private
  56340. * @param {module:link/linkcommand~LinkCommand} linkCommand A reference to the link command.
  56341. * @returns {module:ui/viewcollection~ViewCollection} of switch buttons.
  56342. */
  56343. _createManualDecoratorSwitches( linkCommand ) {
  56344. const switches = this.createCollection();
  56345. for ( const manualDecorator of linkCommand.manualDecorators ) {
  56346. const switchButton = new _ckeditor_ckeditor5_ui_src_button_switchbuttonview__WEBPACK_IMPORTED_MODULE_3__["default"]( this.locale );
  56347. switchButton.set( {
  56348. name: manualDecorator.id,
  56349. label: manualDecorator.label,
  56350. withText: true
  56351. } );
  56352. switchButton.bind( 'isOn' ).toMany( [ manualDecorator, linkCommand ], 'value', ( decoratorValue, commandValue ) => {
  56353. return commandValue === undefined && decoratorValue === undefined ? manualDecorator.defaultValue : decoratorValue;
  56354. } );
  56355. switchButton.on( 'execute', () => {
  56356. manualDecorator.set( 'value', !switchButton.isOn );
  56357. } );
  56358. switches.add( switchButton );
  56359. }
  56360. return switches;
  56361. }
  56362. /**
  56363. * Populates the {@link #children} collection of the form.
  56364. *
  56365. * If {@link module:link/linkcommand~LinkCommand#manualDecorators manual decorators} are configured in the editor, it creates an
  56366. * additional `View` wrapping all {@link #_manualDecoratorSwitches} switch buttons corresponding
  56367. * to these decorators.
  56368. *
  56369. * @private
  56370. * @param {module:utils/collection~Collection} manualDecorators A reference to
  56371. * the collection of manual decorators stored in the link command.
  56372. * @returns {module:ui/viewcollection~ViewCollection} The children of link form view.
  56373. */
  56374. _createFormChildren( manualDecorators ) {
  56375. const children = this.createCollection();
  56376. children.add( this.urlInputView );
  56377. if ( manualDecorators.length ) {
  56378. const additionalButtonsView = new _ckeditor_ckeditor5_ui_src_view__WEBPACK_IMPORTED_MODULE_0__["default"]();
  56379. additionalButtonsView.setTemplate( {
  56380. tag: 'ul',
  56381. children: this._manualDecoratorSwitches.map( switchButton => ( {
  56382. tag: 'li',
  56383. children: [ switchButton ],
  56384. attributes: {
  56385. class: [
  56386. 'ck',
  56387. 'ck-list__item'
  56388. ]
  56389. }
  56390. } ) ),
  56391. attributes: {
  56392. class: [
  56393. 'ck',
  56394. 'ck-reset',
  56395. 'ck-list'
  56396. ]
  56397. }
  56398. } );
  56399. children.add( additionalButtonsView );
  56400. }
  56401. children.add( this.saveButtonView );
  56402. children.add( this.cancelButtonView );
  56403. return children;
  56404. }
  56405. }
  56406. /**
  56407. * Fired when the form view is submitted (when one of the children triggered the submit event),
  56408. * for example with a click on {@link #saveButtonView}.
  56409. *
  56410. * @event submit
  56411. */
  56412. /**
  56413. * Fired when the form view is canceled, for example with a click on {@link #cancelButtonView}.
  56414. *
  56415. * @event cancel
  56416. */
  56417. /***/ }),
  56418. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/unlinkcommand.js":
  56419. /*!********************************************************************!*\
  56420. !*** ./node_modules/@ckeditor/ckeditor5-link/src/unlinkcommand.js ***!
  56421. \********************************************************************/
  56422. /*! exports provided: default */
  56423. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  56424. "use strict";
  56425. __webpack_require__.r(__webpack_exports__);
  56426. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UnlinkCommand; });
  56427. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  56428. /* harmony import */ var _ckeditor_ckeditor5_typing_src_utils_findattributerange__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-typing/src/utils/findattributerange */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/findattributerange.js");
  56429. /* harmony import */ var _ckeditor_ckeditor5_utils_src_first__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/first */ "./node_modules/@ckeditor/ckeditor5-utils/src/first.js");
  56430. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-link/src/utils.js");
  56431. /**
  56432. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  56433. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  56434. */
  56435. /**
  56436. * @module link/unlinkcommand
  56437. */
  56438. /**
  56439. * The unlink command. It is used by the {@link module:link/link~Link link plugin}.
  56440. *
  56441. * @extends module:core/command~Command
  56442. */
  56443. class UnlinkCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  56444. /**
  56445. * @inheritDoc
  56446. */
  56447. refresh() {
  56448. const model = this.editor.model;
  56449. const doc = model.document;
  56450. const selectedElement = Object(_ckeditor_ckeditor5_utils_src_first__WEBPACK_IMPORTED_MODULE_2__["default"])( doc.selection.getSelectedBlocks() );
  56451. // A check for the `LinkImage` plugin. If the selection contains an image element, get values from the element.
  56452. // Currently the selection reads attributes from text nodes only. See #7429 and #7465.
  56453. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_3__["isImageAllowed"])( selectedElement, model.schema ) ) {
  56454. this.isEnabled = model.schema.checkAttribute( selectedElement, 'linkHref' );
  56455. } else {
  56456. this.isEnabled = model.schema.checkAttributeInSelection( doc.selection, 'linkHref' );
  56457. }
  56458. }
  56459. /**
  56460. * Executes the command.
  56461. *
  56462. * When the selection is collapsed, it removes the `linkHref` attribute from each node with the same `linkHref` attribute value.
  56463. * When the selection is non-collapsed, it removes the `linkHref` attribute from each node in selected ranges.
  56464. *
  56465. * # Decorators
  56466. *
  56467. * If {@link module:link/link~LinkConfig#decorators `config.link.decorators`} is specified,
  56468. * all configured decorators are removed together with the `linkHref` attribute.
  56469. *
  56470. * @fires execute
  56471. */
  56472. execute() {
  56473. const editor = this.editor;
  56474. const model = this.editor.model;
  56475. const selection = model.document.selection;
  56476. const linkCommand = editor.commands.get( 'link' );
  56477. model.change( writer => {
  56478. // Get ranges to unlink.
  56479. const rangesToUnlink = selection.isCollapsed ?
  56480. [ Object(_ckeditor_ckeditor5_typing_src_utils_findattributerange__WEBPACK_IMPORTED_MODULE_1__["default"])(
  56481. selection.getFirstPosition(),
  56482. 'linkHref',
  56483. selection.getAttribute( 'linkHref' ),
  56484. model
  56485. ) ] :
  56486. selection.getRanges();
  56487. // Remove `linkHref` attribute from specified ranges.
  56488. for ( const range of rangesToUnlink ) {
  56489. writer.removeAttribute( 'linkHref', range );
  56490. // If there are registered custom attributes, then remove them during unlink.
  56491. if ( linkCommand ) {
  56492. for ( const manualDecorator of linkCommand.manualDecorators ) {
  56493. writer.removeAttribute( manualDecorator.id, range );
  56494. }
  56495. }
  56496. }
  56497. } );
  56498. }
  56499. }
  56500. /***/ }),
  56501. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/utils.js":
  56502. /*!************************************************************!*\
  56503. !*** ./node_modules/@ckeditor/ckeditor5-link/src/utils.js ***!
  56504. \************************************************************/
  56505. /*! exports provided: LINK_KEYSTROKE, isLinkElement, createLinkElement, ensureSafeUrl, getLocalizedDecorators, normalizeDecorators, isImageAllowed, isEmail, addLinkProtocolIfApplicable */
  56506. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  56507. "use strict";
  56508. __webpack_require__.r(__webpack_exports__);
  56509. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LINK_KEYSTROKE", function() { return LINK_KEYSTROKE; });
  56510. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLinkElement", function() { return isLinkElement; });
  56511. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLinkElement", function() { return createLinkElement; });
  56512. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ensureSafeUrl", function() { return ensureSafeUrl; });
  56513. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocalizedDecorators", function() { return getLocalizedDecorators; });
  56514. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeDecorators", function() { return normalizeDecorators; });
  56515. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isImageAllowed", function() { return isImageAllowed; });
  56516. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEmail", function() { return isEmail; });
  56517. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addLinkProtocolIfApplicable", function() { return addLinkProtocolIfApplicable; });
  56518. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  56519. /**
  56520. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  56521. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  56522. */
  56523. /**
  56524. * @module link/utils
  56525. */
  56526. const ATTRIBUTE_WHITESPACES = /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g; // eslint-disable-line no-control-regex
  56527. const SAFE_URL = /^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i;
  56528. // Simplified email test - should be run over previously found URL.
  56529. const EMAIL_REG_EXP = /^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i;
  56530. // The regex checks for the protocol syntax ('xxxx://' or 'xxxx:')
  56531. // or non-word characters at the beginning of the link ('/', '#' etc.).
  56532. const PROTOCOL_REG_EXP = /^((\w+:(\/{2,})?)|(\W))/i;
  56533. /**
  56534. * A keystroke used by the {@link module:link/linkui~LinkUI link UI feature}.
  56535. */
  56536. const LINK_KEYSTROKE = 'Ctrl+K';
  56537. /**
  56538. * Returns `true` if a given view node is the link element.
  56539. *
  56540. * @param {module:engine/view/node~Node} node
  56541. * @returns {Boolean}
  56542. */
  56543. function isLinkElement( node ) {
  56544. return node.is( 'attributeElement' ) && !!node.getCustomProperty( 'link' );
  56545. }
  56546. /**
  56547. * Creates link {@link module:engine/view/attributeelement~AttributeElement} with the provided `href` attribute.
  56548. *
  56549. * @param {String} href
  56550. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
  56551. * @returns {module:engine/view/attributeelement~AttributeElement}
  56552. */
  56553. function createLinkElement( href, { writer } ) {
  56554. // Priority 5 - https://github.com/ckeditor/ckeditor5-link/issues/121.
  56555. const linkElement = writer.createAttributeElement( 'a', { href }, { priority: 5 } );
  56556. writer.setCustomProperty( 'link', true, linkElement );
  56557. return linkElement;
  56558. }
  56559. /**
  56560. * Returns a safe URL based on a given value.
  56561. *
  56562. * A URL is considered safe if it is safe for the user (does not contain any malicious code).
  56563. *
  56564. * If a URL is considered unsafe, a simple `"#"` is returned.
  56565. *
  56566. * @protected
  56567. * @param {*} url
  56568. * @returns {String} Safe URL.
  56569. */
  56570. function ensureSafeUrl( url ) {
  56571. url = String( url );
  56572. return isSafeUrl( url ) ? url : '#';
  56573. }
  56574. // Checks whether the given URL is safe for the user (does not contain any malicious code).
  56575. //
  56576. // @param {String} url URL to check.
  56577. function isSafeUrl( url ) {
  56578. const normalizedUrl = url.replace( ATTRIBUTE_WHITESPACES, '' );
  56579. return normalizedUrl.match( SAFE_URL );
  56580. }
  56581. /**
  56582. * Returns the {@link module:link/link~LinkConfig#decorators `config.link.decorators`} configuration processed
  56583. * to respect the locale of the editor, i.e. to display the {@link module:link/link~LinkDecoratorManualDefinition label}
  56584. * in the correct language.
  56585. *
  56586. * **Note**: Only the few most commonly used labels are translated automatically. Other labels should be manually
  56587. * translated in the {@link module:link/link~LinkConfig#decorators `config.link.decorators`} configuration.
  56588. *
  56589. * @param {module:utils/locale~Locale#t} t shorthand for {@link module:utils/locale~Locale#t Locale#t}
  56590. * @param {Array.<module:link/link~LinkDecoratorDefinition>} The decorator reference
  56591. * where the label values should be localized.
  56592. * @returns {Array.<module:link/link~LinkDecoratorDefinition>}
  56593. */
  56594. function getLocalizedDecorators( t, decorators ) {
  56595. const localizedDecoratorsLabels = {
  56596. 'Open in a new tab': t( 'Open in a new tab' ),
  56597. 'Downloadable': t( 'Downloadable' )
  56598. };
  56599. decorators.forEach( decorator => {
  56600. if ( decorator.label && localizedDecoratorsLabels[ decorator.label ] ) {
  56601. decorator.label = localizedDecoratorsLabels[ decorator.label ];
  56602. }
  56603. return decorator;
  56604. } );
  56605. return decorators;
  56606. }
  56607. /**
  56608. * Converts an object with defined decorators to a normalized array of decorators. The `id` key is added for each decorator and
  56609. * is used as the attribute's name in the model.
  56610. *
  56611. * @param {Object.<String, module:link/link~LinkDecoratorDefinition>} decorators
  56612. * @returns {Array.<module:link/link~LinkDecoratorDefinition>}
  56613. */
  56614. function normalizeDecorators( decorators ) {
  56615. const retArray = [];
  56616. if ( decorators ) {
  56617. for ( const [ key, value ] of Object.entries( decorators ) ) {
  56618. const decorator = Object.assign(
  56619. {},
  56620. value,
  56621. { id: `link${ Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["upperFirst"])( key ) }` }
  56622. );
  56623. retArray.push( decorator );
  56624. }
  56625. }
  56626. return retArray;
  56627. }
  56628. /**
  56629. * Returns `true` if the specified `element` is an image and it can be linked (the element allows having the `linkHref` attribute).
  56630. *
  56631. * @params {module:engine/model/element~Element|null} element
  56632. * @params {module:engine/model/schema~Schema} schema
  56633. * @returns {Boolean}
  56634. */
  56635. function isImageAllowed( element, schema ) {
  56636. if ( !element ) {
  56637. return false;
  56638. }
  56639. return element.is( 'element', 'image' ) && schema.checkAttribute( 'image', 'linkHref' );
  56640. }
  56641. /**
  56642. * Returns `true` if the specified `value` is an email.
  56643. *
  56644. * @params {String} value
  56645. * @returns {Boolean}
  56646. */
  56647. function isEmail( value ) {
  56648. return EMAIL_REG_EXP.test( value );
  56649. }
  56650. /**
  56651. * Adds protocol prefix to the specified `link` when:
  56652. *
  56653. * * it doesn't contain it already, and there is a {@link module:link/link~LinkConfig#defaultProtocol `defaultProtocol` }
  56654. * config value provided
  56655. * * or the link is an email address
  56656. *
  56657. *
  56658. * @params {String} link
  56659. * @params {String} defaultProtocol
  56660. * @returns {Boolean}
  56661. */
  56662. function addLinkProtocolIfApplicable( link, defaultProtocol ) {
  56663. const protocol = isEmail( link ) ? 'mailto:' : defaultProtocol;
  56664. const isProtocolNeeded = !!protocol && !PROTOCOL_REG_EXP.test( link );
  56665. return link && isProtocolNeeded ? protocol + link : link;
  56666. }
  56667. /***/ }),
  56668. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/utils/automaticdecorators.js":
  56669. /*!********************************************************************************!*\
  56670. !*** ./node_modules/@ckeditor/ckeditor5-link/src/utils/automaticdecorators.js ***!
  56671. \********************************************************************************/
  56672. /*! exports provided: default */
  56673. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  56674. "use strict";
  56675. __webpack_require__.r(__webpack_exports__);
  56676. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return AutomaticDecorators; });
  56677. /* harmony import */ var _ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/tomap */ "./node_modules/@ckeditor/ckeditor5-utils/src/tomap.js");
  56678. /**
  56679. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  56680. * For licensing, see LICENSE.md.
  56681. */
  56682. /**
  56683. * @module link/utils
  56684. */
  56685. /**
  56686. * Helper class that ties together all {@link module:link/link~LinkDecoratorAutomaticDefinition} and provides
  56687. * the {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToElement downcast dispatchers} for them.
  56688. */
  56689. class AutomaticDecorators {
  56690. constructor() {
  56691. /**
  56692. * Stores the definition of {@link module:link/link~LinkDecoratorAutomaticDefinition automatic decorators}.
  56693. * This data is used as a source for a downcast dispatcher to create a proper conversion to output data.
  56694. *
  56695. * @private
  56696. * @type {Set}
  56697. */
  56698. this._definitions = new Set();
  56699. }
  56700. /**
  56701. * Gives information about the number of decorators stored in the {@link module:link/utils~AutomaticDecorators} instance.
  56702. *
  56703. * @readonly
  56704. * @protected
  56705. * @type {Number}
  56706. */
  56707. get length() {
  56708. return this._definitions.size;
  56709. }
  56710. /**
  56711. * Adds automatic decorator objects or an array with them to be used during downcasting.
  56712. *
  56713. * @param {module:link/link~LinkDecoratorAutomaticDefinition|Array.<module:link/link~LinkDecoratorAutomaticDefinition>} item
  56714. * A configuration object of automatic rules for decorating links. It might also be an array of such objects.
  56715. */
  56716. add( item ) {
  56717. if ( Array.isArray( item ) ) {
  56718. item.forEach( item => this._definitions.add( item ) );
  56719. } else {
  56720. this._definitions.add( item );
  56721. }
  56722. }
  56723. /**
  56724. * Provides the conversion helper used in the {@link module:engine/conversion/downcasthelpers~DowncastHelpers#add} method.
  56725. *
  56726. * @returns {Function} A dispatcher function used as conversion helper
  56727. * in {@link module:engine/conversion/downcasthelpers~DowncastHelpers#add}.
  56728. */
  56729. getDispatcher() {
  56730. return dispatcher => {
  56731. dispatcher.on( 'attribute:linkHref', ( evt, data, conversionApi ) => {
  56732. // There is only test as this behavior decorates links and
  56733. // it is run before dispatcher which actually consumes this node.
  56734. // This allows on writing own dispatcher with highest priority,
  56735. // which blocks both native converter and this additional decoration.
  56736. if ( !conversionApi.consumable.test( data.item, 'attribute:linkHref' ) ) {
  56737. return;
  56738. }
  56739. const viewWriter = conversionApi.writer;
  56740. const viewSelection = viewWriter.document.selection;
  56741. for ( const item of this._definitions ) {
  56742. const viewElement = viewWriter.createAttributeElement( 'a', item.attributes, {
  56743. priority: 5
  56744. } );
  56745. viewWriter.setCustomProperty( 'link', true, viewElement );
  56746. if ( item.callback( data.attributeNewValue ) ) {
  56747. if ( data.item.is( 'selection' ) ) {
  56748. viewWriter.wrap( viewSelection.getFirstRange(), viewElement );
  56749. } else {
  56750. viewWriter.wrap( conversionApi.mapper.toViewRange( data.range ), viewElement );
  56751. }
  56752. } else {
  56753. viewWriter.unwrap( conversionApi.mapper.toViewRange( data.range ), viewElement );
  56754. }
  56755. }
  56756. }, { priority: 'high' } );
  56757. };
  56758. }
  56759. /**
  56760. * Provides the conversion helper used in the {@link module:engine/conversion/downcasthelpers~DowncastHelpers#add} method
  56761. * when linking images.
  56762. *
  56763. * @returns {Function} A dispatcher function used as conversion helper
  56764. * in {@link module:engine/conversion/downcasthelpers~DowncastHelpers#add}.
  56765. */
  56766. getDispatcherForLinkedImage() {
  56767. return dispatcher => {
  56768. dispatcher.on( 'attribute:linkHref:image', ( evt, data, conversionApi ) => {
  56769. const viewFigure = conversionApi.mapper.toViewElement( data.item );
  56770. const linkInImage = Array.from( viewFigure.getChildren() ).find( child => child.name === 'a' );
  56771. for ( const item of this._definitions ) {
  56772. const attributes = Object(_ckeditor_ckeditor5_utils_src_tomap__WEBPACK_IMPORTED_MODULE_0__["default"])( item.attributes );
  56773. if ( item.callback( data.attributeNewValue ) ) {
  56774. for ( const [ key, val ] of attributes ) {
  56775. if ( key === 'class' ) {
  56776. conversionApi.writer.addClass( val, linkInImage );
  56777. } else {
  56778. conversionApi.writer.setAttribute( key, val, linkInImage );
  56779. }
  56780. }
  56781. } else {
  56782. for ( const [ key, val ] of attributes ) {
  56783. if ( key === 'class' ) {
  56784. conversionApi.writer.removeClass( val, linkInImage );
  56785. } else {
  56786. conversionApi.writer.removeAttribute( key, linkInImage );
  56787. }
  56788. }
  56789. }
  56790. }
  56791. } );
  56792. };
  56793. }
  56794. }
  56795. /***/ }),
  56796. /***/ "./node_modules/@ckeditor/ckeditor5-link/src/utils/manualdecorator.js":
  56797. /*!****************************************************************************!*\
  56798. !*** ./node_modules/@ckeditor/ckeditor5-link/src/utils/manualdecorator.js ***!
  56799. \****************************************************************************/
  56800. /*! exports provided: default */
  56801. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  56802. "use strict";
  56803. __webpack_require__.r(__webpack_exports__);
  56804. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ManualDecorator; });
  56805. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  56806. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  56807. /**
  56808. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  56809. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  56810. */
  56811. /**
  56812. * @module link/utils
  56813. */
  56814. /**
  56815. * Helper class that stores manual decorators with observable {@link module:link/utils~ManualDecorator#value}
  56816. * to support integration with the UI state. An instance of this class is a model with the state of individual manual decorators.
  56817. * These decorators are kept as collections in {@link module:link/linkcommand~LinkCommand#manualDecorators}.
  56818. *
  56819. * @mixes module:utils/observablemixin~ObservableMixin
  56820. */
  56821. class ManualDecorator {
  56822. /**
  56823. * Creates a new instance of {@link module:link/utils~ManualDecorator}.
  56824. *
  56825. * @param {Object} config
  56826. * @param {String} config.id The name of the attribute used in the model that represents a given manual decorator.
  56827. * For example: `'linkIsExternal'`.
  56828. * @param {String} config.label The label used in the user interface to toggle the manual decorator.
  56829. * @param {Object} config.attributes A set of attributes added to output data when the decorator is active for a specific link.
  56830. * Attributes should keep the format of attributes defined in {@link module:engine/view/elementdefinition~ElementDefinition}.
  56831. * @param {Boolean} [config.defaultValue] Controls whether the decorator is "on" by default.
  56832. */
  56833. constructor( { id, label, attributes, defaultValue } ) {
  56834. /**
  56835. * An ID of a manual decorator which is the name of the attribute in the model, for example: 'linkManualDecorator0'.
  56836. *
  56837. * @type {String}
  56838. */
  56839. this.id = id;
  56840. /**
  56841. * The value of the current manual decorator. It reflects its state from the UI.
  56842. *
  56843. * @observable
  56844. * @member {Boolean} module:link/utils~ManualDecorator#value
  56845. */
  56846. this.set( 'value' );
  56847. /**
  56848. * The default value of manual decorator.
  56849. *
  56850. * @type {Boolean}
  56851. */
  56852. this.defaultValue = defaultValue;
  56853. /**
  56854. * The label used in the user interface to toggle the manual decorator.
  56855. *
  56856. * @type {String}
  56857. */
  56858. this.label = label;
  56859. /**
  56860. * A set of attributes added to downcasted data when the decorator is activated for a specific link.
  56861. * Attributes should be added in a form of attributes defined in {@link module:engine/view/elementdefinition~ElementDefinition}.
  56862. *
  56863. * @type {Object}
  56864. */
  56865. this.attributes = attributes;
  56866. }
  56867. }
  56868. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( ManualDecorator, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
  56869. /***/ }),
  56870. /***/ "./node_modules/@ckeditor/ckeditor5-link/theme/icons/link.svg":
  56871. /*!********************************************************************!*\
  56872. !*** ./node_modules/@ckeditor/ckeditor5-link/theme/icons/link.svg ***!
  56873. \********************************************************************/
  56874. /*! exports provided: default */
  56875. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  56876. "use strict";
  56877. __webpack_require__.r(__webpack_exports__);
  56878. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M11.077 15l.991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.748.748 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.741.741 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294l.006.004zm5.494-5.335a.748.748 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.748.748 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955zm-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184z\"/></svg>");
  56879. /***/ }),
  56880. /***/ "./node_modules/@ckeditor/ckeditor5-link/theme/icons/unlink.svg":
  56881. /*!**********************************************************************!*\
  56882. !*** ./node_modules/@ckeditor/ckeditor5-link/theme/icons/unlink.svg ***!
  56883. \**********************************************************************/
  56884. /*! exports provided: default */
  56885. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  56886. "use strict";
  56887. __webpack_require__.r(__webpack_exports__);
  56888. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M11.077 15l.991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.748.748 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.741.741 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294l.006.004zm5.494-5.335a.748.748 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.748.748 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955zm-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184zm4.919 10.562l-1.414 1.414a.75.75 0 1 1-1.06-1.06l1.414-1.415-1.415-1.414a.75.75 0 0 1 1.061-1.06l1.414 1.414 1.414-1.415a.75.75 0 0 1 1.061 1.061l-1.414 1.414 1.414 1.415a.75.75 0 0 1-1.06 1.06l-1.415-1.414z\"/></svg>");
  56889. /***/ }),
  56890. /***/ "./node_modules/@ckeditor/ckeditor5-link/theme/link.css":
  56891. /*!**************************************************************!*\
  56892. !*** ./node_modules/@ckeditor/ckeditor5-link/theme/link.css ***!
  56893. \**************************************************************/
  56894. /*! no static exports found */
  56895. /***/ (function(module, exports, __webpack_require__) {
  56896. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  56897. var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./link.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-link/theme/link.css");
  56898. content = content.__esModule ? content.default : content;
  56899. if (typeof content === 'string') {
  56900. content = [[module.i, content, '']];
  56901. }
  56902. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  56903. options.insert = "head";
  56904. options.singleton = true;
  56905. var update = api(content, options);
  56906. module.exports = content.locals || {};
  56907. /***/ }),
  56908. /***/ "./node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css":
  56909. /*!*********************************************************************!*\
  56910. !*** ./node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css ***!
  56911. \*********************************************************************/
  56912. /*! no static exports found */
  56913. /***/ (function(module, exports, __webpack_require__) {
  56914. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  56915. var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./linkactions.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css");
  56916. content = content.__esModule ? content.default : content;
  56917. if (typeof content === 'string') {
  56918. content = [[module.i, content, '']];
  56919. }
  56920. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  56921. options.insert = "head";
  56922. options.singleton = true;
  56923. var update = api(content, options);
  56924. module.exports = content.locals || {};
  56925. /***/ }),
  56926. /***/ "./node_modules/@ckeditor/ckeditor5-link/theme/linkform.css":
  56927. /*!******************************************************************!*\
  56928. !*** ./node_modules/@ckeditor/ckeditor5-link/theme/linkform.css ***!
  56929. \******************************************************************/
  56930. /*! no static exports found */
  56931. /***/ (function(module, exports, __webpack_require__) {
  56932. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  56933. var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./linkform.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-link/theme/linkform.css");
  56934. content = content.__esModule ? content.default : content;
  56935. if (typeof content === 'string') {
  56936. content = [[module.i, content, '']];
  56937. }
  56938. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  56939. options.insert = "head";
  56940. options.singleton = true;
  56941. var update = api(content, options);
  56942. module.exports = content.locals || {};
  56943. /***/ }),
  56944. /***/ "./node_modules/@ckeditor/ckeditor5-link/theme/linkimage.css":
  56945. /*!*******************************************************************!*\
  56946. !*** ./node_modules/@ckeditor/ckeditor5-link/theme/linkimage.css ***!
  56947. \*******************************************************************/
  56948. /*! no static exports found */
  56949. /***/ (function(module, exports, __webpack_require__) {
  56950. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  56951. var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./linkimage.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-link/theme/linkimage.css");
  56952. content = content.__esModule ? content.default : content;
  56953. if (typeof content === 'string') {
  56954. content = [[module.i, content, '']];
  56955. }
  56956. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  56957. options.insert = "head";
  56958. options.singleton = true;
  56959. var update = api(content, options);
  56960. module.exports = content.locals || {};
  56961. /***/ }),
  56962. /***/ "./node_modules/@ckeditor/ckeditor5-list/src/converters.js":
  56963. /*!*****************************************************************!*\
  56964. !*** ./node_modules/@ckeditor/ckeditor5-list/src/converters.js ***!
  56965. \*****************************************************************/
  56966. /*! exports provided: modelViewInsertion, modelViewRemove, modelViewChangeType, modelViewMergeAfterChangeType, modelViewChangeIndent, modelViewSplitOnInsert, modelViewMergeAfter, viewModelConverter, cleanList, cleanListItem, modelToViewPosition, viewToModelPosition, modelChangePostFixer, modelIndentPasteFixer */
  56967. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  56968. "use strict";
  56969. __webpack_require__.r(__webpack_exports__);
  56970. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelViewInsertion", function() { return modelViewInsertion; });
  56971. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelViewRemove", function() { return modelViewRemove; });
  56972. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelViewChangeType", function() { return modelViewChangeType; });
  56973. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelViewMergeAfterChangeType", function() { return modelViewMergeAfterChangeType; });
  56974. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelViewChangeIndent", function() { return modelViewChangeIndent; });
  56975. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelViewSplitOnInsert", function() { return modelViewSplitOnInsert; });
  56976. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelViewMergeAfter", function() { return modelViewMergeAfter; });
  56977. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "viewModelConverter", function() { return viewModelConverter; });
  56978. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cleanList", function() { return cleanList; });
  56979. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cleanListItem", function() { return cleanListItem; });
  56980. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelToViewPosition", function() { return modelToViewPosition; });
  56981. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "viewToModelPosition", function() { return viewToModelPosition; });
  56982. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelChangePostFixer", function() { return modelChangePostFixer; });
  56983. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modelIndentPasteFixer", function() { return modelIndentPasteFixer; });
  56984. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-list/src/utils.js");
  56985. /* harmony import */ var _ckeditor_ckeditor5_engine_src_model_treewalker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/model/treewalker */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/treewalker.js");
  56986. /**
  56987. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  56988. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  56989. */
  56990. /**
  56991. * @module list/converters
  56992. */
  56993. /**
  56994. * A model-to-view converter for the `listItem` model element insertion.
  56995. *
  56996. * It creates a `<ul><li></li><ul>` (or `<ol>`) view structure out of a `listItem` model element, inserts it at the correct
  56997. * position, and merges the list with surrounding lists (if available).
  56998. *
  56999. * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert
  57000. * @param {module:engine/model/model~Model} model Model instance.
  57001. * @returns {Function} Returns a conversion callback.
  57002. */
  57003. function modelViewInsertion( model ) {
  57004. return ( evt, data, conversionApi ) => {
  57005. const consumable = conversionApi.consumable;
  57006. if ( !consumable.test( data.item, 'insert' ) ||
  57007. !consumable.test( data.item, 'attribute:listType' ) ||
  57008. !consumable.test( data.item, 'attribute:listIndent' )
  57009. ) {
  57010. return;
  57011. }
  57012. consumable.consume( data.item, 'insert' );
  57013. consumable.consume( data.item, 'attribute:listType' );
  57014. consumable.consume( data.item, 'attribute:listIndent' );
  57015. const modelItem = data.item;
  57016. const viewItem = Object(_utils__WEBPACK_IMPORTED_MODULE_0__["generateLiInUl"])( modelItem, conversionApi );
  57017. Object(_utils__WEBPACK_IMPORTED_MODULE_0__["injectViewList"])( modelItem, viewItem, conversionApi, model );
  57018. };
  57019. }
  57020. /**
  57021. * A model-to-view converter for the `listItem` model element removal.
  57022. *
  57023. * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:remove
  57024. * @param {module:engine/model/model~Model} model Model instance.
  57025. * @returns {Function} Returns a conversion callback.
  57026. */
  57027. function modelViewRemove( model ) {
  57028. return ( evt, data, conversionApi ) => {
  57029. const viewPosition = conversionApi.mapper.toViewPosition( data.position );
  57030. const viewStart = viewPosition.getLastMatchingPosition( value => !value.item.is( 'element', 'li' ) );
  57031. const viewItem = viewStart.nodeAfter;
  57032. const viewWriter = conversionApi.writer;
  57033. // 1. Break the container after and before the list item.
  57034. // This will create a view list with one view list item - the one to remove.
  57035. viewWriter.breakContainer( viewWriter.createPositionBefore( viewItem ) );
  57036. viewWriter.breakContainer( viewWriter.createPositionAfter( viewItem ) );
  57037. // 2. Remove the list with the item to remove.
  57038. const viewList = viewItem.parent;
  57039. const viewListPrev = viewList.previousSibling;
  57040. const removeRange = viewWriter.createRangeOn( viewList );
  57041. const removed = viewWriter.remove( removeRange );
  57042. // 3. Merge the whole created by breaking and removing the list.
  57043. if ( viewListPrev && viewListPrev.nextSibling ) {
  57044. Object(_utils__WEBPACK_IMPORTED_MODULE_0__["mergeViewLists"])( viewWriter, viewListPrev, viewListPrev.nextSibling );
  57045. }
  57046. // 4. Bring back nested list that was in the removed <li>.
  57047. const modelItem = conversionApi.mapper.toModelElement( viewItem );
  57048. hoistNestedLists( modelItem.getAttribute( 'listIndent' ) + 1, data.position, removeRange.start, viewItem, conversionApi, model );
  57049. // 5. Unbind removed view item and all children.
  57050. for ( const child of viewWriter.createRangeIn( removed ).getItems() ) {
  57051. conversionApi.mapper.unbindViewElement( child );
  57052. }
  57053. evt.stop();
  57054. };
  57055. }
  57056. /**
  57057. * A model-to-view converter for the `type` attribute change on the `listItem` model element.
  57058. *
  57059. * This change means that the `<li>` element parent changes from `<ul>` to `<ol>` (or vice versa). This is accomplished
  57060. * by breaking view elements and changing their name. The next {@link module:list/converters~modelViewMergeAfterChangeType}
  57061. * converter will attempt to merge split nodes.
  57062. *
  57063. * Splitting this conversion into 2 steps makes it possible to add an additional conversion in the middle.
  57064. * Check {@link module:list/todolistconverters~modelViewChangeType} to see an example of it.
  57065. *
  57066. * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute
  57067. * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
  57068. * @param {Object} data Additional information about the change.
  57069. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface.
  57070. */
  57071. function modelViewChangeType( evt, data, conversionApi ) {
  57072. if ( !conversionApi.consumable.consume( data.item, 'attribute:listType' ) ) {
  57073. return;
  57074. }
  57075. const viewItem = conversionApi.mapper.toViewElement( data.item );
  57076. const viewWriter = conversionApi.writer;
  57077. // Break the container after and before the list item.
  57078. // This will create a view list with one view list item -- the one that changed type.
  57079. viewWriter.breakContainer( viewWriter.createPositionBefore( viewItem ) );
  57080. viewWriter.breakContainer( viewWriter.createPositionAfter( viewItem ) );
  57081. // Change name of the view list that holds the changed view item.
  57082. // We cannot just change name property, because that would not render properly.
  57083. const viewList = viewItem.parent;
  57084. const listName = data.attributeNewValue == 'numbered' ? 'ol' : 'ul';
  57085. viewWriter.rename( listName, viewList );
  57086. }
  57087. /**
  57088. * A model-to-view converter that attempts to merge nodes split by {@link module:list/converters~modelViewChangeType}.
  57089. *
  57090. * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute
  57091. * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
  57092. * @param {Object} data Additional information about the change.
  57093. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface.
  57094. */
  57095. function modelViewMergeAfterChangeType( evt, data, conversionApi ) {
  57096. const viewItem = conversionApi.mapper.toViewElement( data.item );
  57097. const viewList = viewItem.parent;
  57098. const viewWriter = conversionApi.writer;
  57099. // Merge the changed view list with other lists, if possible.
  57100. Object(_utils__WEBPACK_IMPORTED_MODULE_0__["mergeViewLists"])( viewWriter, viewList, viewList.nextSibling );
  57101. Object(_utils__WEBPACK_IMPORTED_MODULE_0__["mergeViewLists"])( viewWriter, viewList.previousSibling, viewList );
  57102. // Consumable insertion of children inside the item. They are already handled by re-building the item in view.
  57103. for ( const child of data.item.getChildren() ) {
  57104. conversionApi.consumable.consume( child, 'insert' );
  57105. }
  57106. }
  57107. /**
  57108. * A model-to-view converter for the `listIndent` attribute change on the `listItem` model element.
  57109. *
  57110. * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute
  57111. * @param {module:engine/model/model~Model} model Model instance.
  57112. * @returns {Function} Returns a conversion callback.
  57113. */
  57114. function modelViewChangeIndent( model ) {
  57115. return ( evt, data, conversionApi ) => {
  57116. if ( !conversionApi.consumable.consume( data.item, 'attribute:listIndent' ) ) {
  57117. return;
  57118. }
  57119. const viewItem = conversionApi.mapper.toViewElement( data.item );
  57120. const viewWriter = conversionApi.writer;
  57121. // 1. Break the container after and before the list item.
  57122. // This will create a view list with one view list item -- the one that changed type.
  57123. viewWriter.breakContainer( viewWriter.createPositionBefore( viewItem ) );
  57124. viewWriter.breakContainer( viewWriter.createPositionAfter( viewItem ) );
  57125. // 2. Extract view list with changed view list item and merge "hole" possibly created by breaking and removing elements.
  57126. const viewList = viewItem.parent;
  57127. const viewListPrev = viewList.previousSibling;
  57128. const removeRange = viewWriter.createRangeOn( viewList );
  57129. viewWriter.remove( removeRange );
  57130. if ( viewListPrev && viewListPrev.nextSibling ) {
  57131. Object(_utils__WEBPACK_IMPORTED_MODULE_0__["mergeViewLists"])( viewWriter, viewListPrev, viewListPrev.nextSibling );
  57132. }
  57133. // 3. Bring back nested list that was in the removed <li>.
  57134. hoistNestedLists( data.attributeOldValue + 1, data.range.start, removeRange.start, viewItem, conversionApi, model );
  57135. // 4. Inject view list like it is newly inserted.
  57136. Object(_utils__WEBPACK_IMPORTED_MODULE_0__["injectViewList"])( data.item, viewItem, conversionApi, model );
  57137. // 5. Consume insertion of children inside the item. They are already handled by re-building the item in view.
  57138. for ( const child of data.item.getChildren() ) {
  57139. conversionApi.consumable.consume( child, 'insert' );
  57140. }
  57141. };
  57142. }
  57143. /**
  57144. * A special model-to-view converter introduced by the {@link module:list/list~List list feature}. This converter is fired for
  57145. * insert change of every model item, and should be fired before the actual converter. The converter checks whether the inserted
  57146. * model item is a non-`listItem` element. If it is, and it is inserted inside a view list, the converter breaks the
  57147. * list so the model element is inserted to the view parent element corresponding to its model parent element.
  57148. *
  57149. * The converter prevents such situations:
  57150. *
  57151. * // Model: // View:
  57152. * <listItem>foo</listItem> <ul>
  57153. * <listItem>bar</listItem> <li>foo</li>
  57154. * <li>bar</li>
  57155. * </ul>
  57156. *
  57157. * // After change: // Correct view guaranteed by this converter:
  57158. * <listItem>foo</listItem> <ul><li>foo</li></ul><p>xxx</p><ul><li>bar</li></ul>
  57159. * <paragraph>xxx</paragraph> // Instead of this wrong view state:
  57160. * <listItem>bar</listItem> <ul><li>foo</li><p>xxx</p><li>bar</li></ul>
  57161. *
  57162. * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert
  57163. * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
  57164. * @param {Object} data Additional information about the change.
  57165. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface.
  57166. */
  57167. function modelViewSplitOnInsert( evt, data, conversionApi ) {
  57168. if ( data.item.name != 'listItem' ) {
  57169. let viewPosition = conversionApi.mapper.toViewPosition( data.range.start );
  57170. const viewWriter = conversionApi.writer;
  57171. const lists = [];
  57172. // Break multiple ULs/OLs if there are.
  57173. //
  57174. // Imagine following list:
  57175. //
  57176. // 1 --------
  57177. // 1.1 --------
  57178. // 1.1.1 --------
  57179. // 1.1.2 --------
  57180. // 1.1.3 --------
  57181. // 1.1.3.1 --------
  57182. // 1.2 --------
  57183. // 1.2.1 --------
  57184. // 2 --------
  57185. //
  57186. // Insert paragraph after item 1.1.1:
  57187. //
  57188. // 1 --------
  57189. // 1.1 --------
  57190. // 1.1.1 --------
  57191. //
  57192. // Lorem ipsum.
  57193. //
  57194. // 1.1.2 --------
  57195. // 1.1.3 --------
  57196. // 1.1.3.1 --------
  57197. // 1.2 --------
  57198. // 1.2.1 --------
  57199. // 2 --------
  57200. //
  57201. // In this case 1.1.2 has to become beginning of a new list.
  57202. // We need to break list before 1.1.2 (obvious), then we need to break list also before 1.2.
  57203. // Then we need to move those broken pieces one after another and merge:
  57204. //
  57205. // 1 --------
  57206. // 1.1 --------
  57207. // 1.1.1 --------
  57208. //
  57209. // Lorem ipsum.
  57210. //
  57211. // 1.1.2 --------
  57212. // 1.1.3 --------
  57213. // 1.1.3.1 --------
  57214. // 1.2 --------
  57215. // 1.2.1 --------
  57216. // 2 --------
  57217. //
  57218. while ( viewPosition.parent.name == 'ul' || viewPosition.parent.name == 'ol' ) {
  57219. viewPosition = viewWriter.breakContainer( viewPosition );
  57220. if ( viewPosition.parent.name != 'li' ) {
  57221. break;
  57222. }
  57223. // Remove lists that are after inserted element.
  57224. // They will be brought back later, below the inserted element.
  57225. const removeStart = viewPosition;
  57226. const removeEnd = viewWriter.createPositionAt( viewPosition.parent, 'end' );
  57227. // Don't remove if there is nothing to remove.
  57228. if ( !removeStart.isEqual( removeEnd ) ) {
  57229. const removed = viewWriter.remove( viewWriter.createRange( removeStart, removeEnd ) );
  57230. lists.push( removed );
  57231. }
  57232. viewPosition = viewWriter.createPositionAfter( viewPosition.parent );
  57233. }
  57234. // Bring back removed lists.
  57235. if ( lists.length > 0 ) {
  57236. for ( let i = 0; i < lists.length; i++ ) {
  57237. const previousList = viewPosition.nodeBefore;
  57238. const insertedRange = viewWriter.insert( viewPosition, lists[ i ] );
  57239. viewPosition = insertedRange.end;
  57240. // Don't merge first list! We want a split in that place (this is why this converter is introduced).
  57241. if ( i > 0 ) {
  57242. const mergePos = Object(_utils__WEBPACK_IMPORTED_MODULE_0__["mergeViewLists"])( viewWriter, previousList, previousList.nextSibling );
  57243. // If `mergePos` is in `previousList` it means that the lists got merged.
  57244. // In this case, we need to fix insert position.
  57245. if ( mergePos && mergePos.parent == previousList ) {
  57246. viewPosition.offset--;
  57247. }
  57248. }
  57249. }
  57250. // Merge last inserted list with element after it.
  57251. Object(_utils__WEBPACK_IMPORTED_MODULE_0__["mergeViewLists"])( viewWriter, viewPosition.nodeBefore, viewPosition.nodeAfter );
  57252. }
  57253. }
  57254. }
  57255. /**
  57256. * A special model-to-view converter introduced by the {@link module:list/list~List list feature}. This converter takes care of
  57257. * merging view lists after something is removed or moved from near them.
  57258. *
  57259. * Example:
  57260. *
  57261. * // Model: // View:
  57262. * <listItem>foo</listItem> <ul><li>foo</li></ul>
  57263. * <paragraph>xxx</paragraph> <p>xxx</p>
  57264. * <listItem>bar</listItem> <ul><li>bar</li></ul>
  57265. *
  57266. * // After change: // Correct view guaranteed by this converter:
  57267. * <listItem>foo</listItem> <ul>
  57268. * <listItem>bar</listItem> <li>foo</li>
  57269. * <li>bar</li>
  57270. * </ul>
  57271. *
  57272. * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:remove
  57273. * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
  57274. * @param {Object} data Additional information about the change.
  57275. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface.
  57276. */
  57277. function modelViewMergeAfter( evt, data, conversionApi ) {
  57278. const viewPosition = conversionApi.mapper.toViewPosition( data.position );
  57279. const viewItemPrev = viewPosition.nodeBefore;
  57280. const viewItemNext = viewPosition.nodeAfter;
  57281. // Merge lists if something (remove, move) was done from inside of list.
  57282. // Merging will be done only if both items are view lists of the same type.
  57283. // The check is done inside the helper function.
  57284. Object(_utils__WEBPACK_IMPORTED_MODULE_0__["mergeViewLists"])( conversionApi.writer, viewItemPrev, viewItemNext );
  57285. }
  57286. /**
  57287. * A view-to-model converter that converts the `<li>` view elements into the `listItem` model elements.
  57288. *
  57289. * To set correct values of the `listType` and `listIndent` attributes the converter:
  57290. * * checks `<li>`'s parent,
  57291. * * stores and increases the `conversionApi.store.indent` value when `<li>`'s sub-items are converted.
  57292. *
  57293. * @see module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element
  57294. * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
  57295. * @param {Object} data An object containing conversion input and a placeholder for conversion output and possibly other values.
  57296. * @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion interface to be used by the callback.
  57297. */
  57298. function viewModelConverter( evt, data, conversionApi ) {
  57299. if ( conversionApi.consumable.consume( data.viewItem, { name: true } ) ) {
  57300. const writer = conversionApi.writer;
  57301. // 1. Create `listItem` model element.
  57302. const listItem = writer.createElement( 'listItem' );
  57303. // 2. Handle `listItem` model element attributes.
  57304. const indent = getIndent( data.viewItem );
  57305. writer.setAttribute( 'listIndent', indent, listItem );
  57306. // Set 'bulleted' as default. If this item is pasted into a context,
  57307. const type = data.viewItem.parent && data.viewItem.parent.name == 'ol' ? 'numbered' : 'bulleted';
  57308. writer.setAttribute( 'listType', type, listItem );
  57309. if ( !conversionApi.safeInsert( listItem, data.modelCursor ) ) {
  57310. return;
  57311. }
  57312. const nextPosition = viewToModelListItemChildrenConverter( listItem, data.viewItem.getChildren(), conversionApi );
  57313. // Result range starts before the first item and ends after the last.
  57314. data.modelRange = writer.createRange( data.modelCursor, nextPosition );
  57315. conversionApi.updateConversionResult( listItem, data );
  57316. }
  57317. }
  57318. /**
  57319. * A view-to-model converter for the `<ul>` and `<ol>` view elements that cleans the input view of garbage.
  57320. * This is mostly to clean whitespaces from between the `<li>` view elements inside the view list element, however, also
  57321. * incorrect data can be cleared if the view was incorrect.
  57322. *
  57323. * @see module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element
  57324. * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
  57325. * @param {Object} data An object containing conversion input and a placeholder for conversion output and possibly other values.
  57326. * @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion interface to be used by the callback.
  57327. */
  57328. function cleanList( evt, data, conversionApi ) {
  57329. if ( conversionApi.consumable.test( data.viewItem, { name: true } ) ) {
  57330. // Caching children because when we start removing them iterating fails.
  57331. const children = Array.from( data.viewItem.getChildren() );
  57332. for ( const child of children ) {
  57333. const isWrongElement = !( child.is( 'element', 'li' ) || isList( child ) );
  57334. if ( isWrongElement ) {
  57335. child._remove();
  57336. }
  57337. }
  57338. }
  57339. }
  57340. /**
  57341. * A view-to-model converter for the `<li>` elements that cleans whitespace formatting from the input view.
  57342. *
  57343. * @see module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element
  57344. * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
  57345. * @param {Object} data An object containing conversion input and a placeholder for conversion output and possibly other values.
  57346. * @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion interface to be used by the callback.
  57347. */
  57348. function cleanListItem( evt, data, conversionApi ) {
  57349. if ( conversionApi.consumable.test( data.viewItem, { name: true } ) ) {
  57350. if ( data.viewItem.childCount === 0 ) {
  57351. return;
  57352. }
  57353. const children = [ ...data.viewItem.getChildren() ];
  57354. let foundList = false;
  57355. let firstNode = true;
  57356. for ( const child of children ) {
  57357. if ( foundList && !isList( child ) ) {
  57358. child._remove();
  57359. }
  57360. if ( child.is( '$text' ) ) {
  57361. // If this is the first node and it's a text node, left-trim it.
  57362. if ( firstNode ) {
  57363. child._data = child.data.replace( /^\s+/, '' );
  57364. }
  57365. // If this is the last text node before <ul> or <ol>, right-trim it.
  57366. if ( !child.nextSibling || isList( child.nextSibling ) ) {
  57367. child._data = child.data.replace( /\s+$/, '' );
  57368. }
  57369. } else if ( isList( child ) ) {
  57370. // If this is a <ul> or <ol>, do not process it, just mark that we already visited list element.
  57371. foundList = true;
  57372. }
  57373. firstNode = false;
  57374. }
  57375. }
  57376. }
  57377. /**
  57378. * Returns a callback for model position to view position mapping for {@link module:engine/conversion/mapper~Mapper}. The callback fixes
  57379. * positions between the `listItem` elements that would be incorrectly mapped because of how list items are represented in the model
  57380. * and in the view.
  57381. *
  57382. * @see module:engine/conversion/mapper~Mapper#event:modelToViewPosition
  57383. * @param {module:engine/view/view~View} view A view instance.
  57384. * @returns {Function}
  57385. */
  57386. function modelToViewPosition( view ) {
  57387. return ( evt, data ) => {
  57388. if ( data.isPhantom ) {
  57389. return;
  57390. }
  57391. const modelItem = data.modelPosition.nodeBefore;
  57392. if ( modelItem && modelItem.is( 'element', 'listItem' ) ) {
  57393. const viewItem = data.mapper.toViewElement( modelItem );
  57394. const topmostViewList = viewItem.getAncestors().find( isList );
  57395. const walker = view.createPositionAt( viewItem, 0 ).getWalker();
  57396. for ( const value of walker ) {
  57397. if ( value.type == 'elementStart' && value.item.is( 'element', 'li' ) ) {
  57398. data.viewPosition = value.previousPosition;
  57399. break;
  57400. } else if ( value.type == 'elementEnd' && value.item == topmostViewList ) {
  57401. data.viewPosition = value.nextPosition;
  57402. break;
  57403. }
  57404. }
  57405. }
  57406. };
  57407. }
  57408. /**
  57409. * The callback for view position to model position mapping for {@link module:engine/conversion/mapper~Mapper}. The callback fixes
  57410. * positions between the `<li>` elements that would be incorrectly mapped because of how list items are represented in the model
  57411. * and in the view.
  57412. *
  57413. * @see module:engine/conversion/mapper~Mapper#event:viewToModelPosition
  57414. * @param {module:engine/model/model~Model} model Model instance.
  57415. * @returns {Function} Returns a conversion callback.
  57416. */
  57417. function viewToModelPosition( model ) {
  57418. return ( evt, data ) => {
  57419. const viewPos = data.viewPosition;
  57420. const viewParent = viewPos.parent;
  57421. const mapper = data.mapper;
  57422. if ( viewParent.name == 'ul' || viewParent.name == 'ol' ) {
  57423. // Position is directly in <ul> or <ol>.
  57424. if ( !viewPos.isAtEnd ) {
  57425. // If position is not at the end, it must be before <li>.
  57426. // Get that <li>, map it to `listItem` and set model position before that `listItem`.
  57427. const modelNode = mapper.toModelElement( viewPos.nodeAfter );
  57428. data.modelPosition = model.createPositionBefore( modelNode );
  57429. } else {
  57430. // Position is at the end of <ul> or <ol>, so there is no <li> after it to be mapped.
  57431. // There is <li> before the position, but we cannot just map it to `listItem` and set model position after it,
  57432. // because that <li> may contain nested items.
  57433. // We will check "model length" of that <li>, in other words - how many `listItem`s are in that <li>.
  57434. const modelNode = mapper.toModelElement( viewPos.nodeBefore );
  57435. const modelLength = mapper.getModelLength( viewPos.nodeBefore );
  57436. // Then we get model position before mapped `listItem` and shift it accordingly.
  57437. data.modelPosition = model.createPositionBefore( modelNode ).getShiftedBy( modelLength );
  57438. }
  57439. evt.stop();
  57440. } else if (
  57441. viewParent.name == 'li' &&
  57442. viewPos.nodeBefore &&
  57443. ( viewPos.nodeBefore.name == 'ul' || viewPos.nodeBefore.name == 'ol' )
  57444. ) {
  57445. // In most cases when view position is in <li> it is in text and this is a correct position.
  57446. // However, if position is after <ul> or <ol> we have to fix it -- because in model <ul>/<ol> are not in the `listItem`.
  57447. const modelNode = mapper.toModelElement( viewParent );
  57448. // Check all <ul>s and <ol>s that are in the <li> but before mapped position.
  57449. // Get model length of those elements and then add it to the offset of `listItem` mapped to the original <li>.
  57450. let modelLength = 1; // Starts from 1 because the original <li> has to be counted in too.
  57451. let viewList = viewPos.nodeBefore;
  57452. while ( viewList && isList( viewList ) ) {
  57453. modelLength += mapper.getModelLength( viewList );
  57454. viewList = viewList.previousSibling;
  57455. }
  57456. data.modelPosition = model.createPositionBefore( modelNode ).getShiftedBy( modelLength );
  57457. evt.stop();
  57458. }
  57459. };
  57460. }
  57461. /**
  57462. * Post-fixer that reacts to changes on document and fixes incorrect model states.
  57463. *
  57464. * In the example below, there is a correct list structure.
  57465. * Then the middle element is removed so the list structure will become incorrect:
  57466. *
  57467. * <listItem listType="bulleted" listIndent=0>Item 1</listItem>
  57468. * <listItem listType="bulleted" listIndent=1>Item 2</listItem> <--- this is removed.
  57469. * <listItem listType="bulleted" listIndent=2>Item 3</listItem>
  57470. *
  57471. * The list structure after the middle element is removed:
  57472. *
  57473. * <listItem listType="bulleted" listIndent=0>Item 1</listItem>
  57474. * <listItem listType="bulleted" listIndent=2>Item 3</listItem>
  57475. *
  57476. * Should become:
  57477. *
  57478. * <listItem listType="bulleted" listIndent=0>Item 1</listItem>
  57479. * <listItem listType="bulleted" listIndent=1>Item 3</listItem> <--- note that indent got post-fixed.
  57480. *
  57481. * @param {module:engine/model/model~Model} model The data model.
  57482. * @param {module:engine/model/writer~Writer} writer The writer to do changes with.
  57483. * @returns {Boolean} `true` if any change has been applied, `false` otherwise.
  57484. */
  57485. function modelChangePostFixer( model, writer ) {
  57486. const changes = model.document.differ.getChanges();
  57487. const itemToListHead = new Map();
  57488. let applied = false;
  57489. for ( const entry of changes ) {
  57490. if ( entry.type == 'insert' && entry.name == 'listItem' ) {
  57491. _addListToFix( entry.position );
  57492. } else if ( entry.type == 'insert' && entry.name != 'listItem' ) {
  57493. if ( entry.name != '$text' ) {
  57494. // In case of renamed element.
  57495. const item = entry.position.nodeAfter;
  57496. if ( item.hasAttribute( 'listIndent' ) ) {
  57497. writer.removeAttribute( 'listIndent', item );
  57498. applied = true;
  57499. }
  57500. if ( item.hasAttribute( 'listType' ) ) {
  57501. writer.removeAttribute( 'listType', item );
  57502. applied = true;
  57503. }
  57504. if ( item.hasAttribute( 'listStyle' ) ) {
  57505. writer.removeAttribute( 'listStyle', item );
  57506. applied = true;
  57507. }
  57508. for ( const innerItem of Array.from( model.createRangeIn( item ) ).filter( e => e.item.is( 'element', 'listItem' ) ) ) {
  57509. _addListToFix( innerItem.previousPosition );
  57510. }
  57511. }
  57512. const posAfter = entry.position.getShiftedBy( entry.length );
  57513. _addListToFix( posAfter );
  57514. } else if ( entry.type == 'remove' && entry.name == 'listItem' ) {
  57515. _addListToFix( entry.position );
  57516. } else if ( entry.type == 'attribute' && entry.attributeKey == 'listIndent' ) {
  57517. _addListToFix( entry.range.start );
  57518. } else if ( entry.type == 'attribute' && entry.attributeKey == 'listType' ) {
  57519. _addListToFix( entry.range.start );
  57520. }
  57521. }
  57522. for ( const listHead of itemToListHead.values() ) {
  57523. _fixListIndents( listHead );
  57524. _fixListTypes( listHead );
  57525. }
  57526. return applied;
  57527. function _addListToFix( position ) {
  57528. const previousNode = position.nodeBefore;
  57529. if ( !previousNode || !previousNode.is( 'element', 'listItem' ) ) {
  57530. const item = position.nodeAfter;
  57531. if ( item && item.is( 'element', 'listItem' ) ) {
  57532. itemToListHead.set( item, item );
  57533. }
  57534. } else {
  57535. let listHead = previousNode;
  57536. if ( itemToListHead.has( listHead ) ) {
  57537. return;
  57538. }
  57539. for (
  57540. // Cache previousSibling and reuse for performance reasons. See #6581.
  57541. let previousSibling = listHead.previousSibling;
  57542. previousSibling && previousSibling.is( 'element', 'listItem' );
  57543. previousSibling = listHead.previousSibling
  57544. ) {
  57545. listHead = previousSibling;
  57546. if ( itemToListHead.has( listHead ) ) {
  57547. return;
  57548. }
  57549. }
  57550. itemToListHead.set( previousNode, listHead );
  57551. }
  57552. }
  57553. function _fixListIndents( item ) {
  57554. let maxIndent = 0;
  57555. let fixBy = null;
  57556. while ( item && item.is( 'element', 'listItem' ) ) {
  57557. const itemIndent = item.getAttribute( 'listIndent' );
  57558. if ( itemIndent > maxIndent ) {
  57559. let newIndent;
  57560. if ( fixBy === null ) {
  57561. fixBy = itemIndent - maxIndent;
  57562. newIndent = maxIndent;
  57563. } else {
  57564. if ( fixBy > itemIndent ) {
  57565. fixBy = itemIndent;
  57566. }
  57567. newIndent = itemIndent - fixBy;
  57568. }
  57569. writer.setAttribute( 'listIndent', newIndent, item );
  57570. applied = true;
  57571. } else {
  57572. fixBy = null;
  57573. maxIndent = item.getAttribute( 'listIndent' ) + 1;
  57574. }
  57575. item = item.nextSibling;
  57576. }
  57577. }
  57578. function _fixListTypes( item ) {
  57579. let typesStack = [];
  57580. let prev = null;
  57581. while ( item && item.is( 'element', 'listItem' ) ) {
  57582. const itemIndent = item.getAttribute( 'listIndent' );
  57583. if ( prev && prev.getAttribute( 'listIndent' ) > itemIndent ) {
  57584. typesStack = typesStack.slice( 0, itemIndent + 1 );
  57585. }
  57586. if ( itemIndent != 0 ) {
  57587. if ( typesStack[ itemIndent ] ) {
  57588. const type = typesStack[ itemIndent ];
  57589. if ( item.getAttribute( 'listType' ) != type ) {
  57590. writer.setAttribute( 'listType', type, item );
  57591. applied = true;
  57592. }
  57593. } else {
  57594. typesStack[ itemIndent ] = item.getAttribute( 'listType' );
  57595. }
  57596. }
  57597. prev = item;
  57598. item = item.nextSibling;
  57599. }
  57600. }
  57601. }
  57602. /**
  57603. * A fixer for pasted content that includes list items.
  57604. *
  57605. * It fixes indentation of pasted list items so the pasted items match correctly to the context they are pasted into.
  57606. *
  57607. * Example:
  57608. *
  57609. * <listItem listType="bulleted" listIndent=0>A</listItem>
  57610. * <listItem listType="bulleted" listIndent=1>B^</listItem>
  57611. * // At ^ paste: <listItem listType="bulleted" listIndent=4>X</listItem>
  57612. * // <listItem listType="bulleted" listIndent=5>Y</listItem>
  57613. * <listItem listType="bulleted" listIndent=2>C</listItem>
  57614. *
  57615. * Should become:
  57616. *
  57617. * <listItem listType="bulleted" listIndent=0>A</listItem>
  57618. * <listItem listType="bulleted" listIndent=1>BX</listItem>
  57619. * <listItem listType="bulleted" listIndent=2>Y/listItem>
  57620. * <listItem listType="bulleted" listIndent=2>C</listItem>
  57621. *
  57622. * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the fired event.
  57623. * @param {Array} args Arguments of {@link module:engine/model/model~Model#insertContent}.
  57624. */
  57625. function modelIndentPasteFixer( evt, [ content, selectable ] ) {
  57626. // Check whether inserted content starts from a `listItem`. If it does not, it means that there are some other
  57627. // elements before it and there is no need to fix indents, because even if we insert that content into a list,
  57628. // that list will be broken.
  57629. // Note: we also need to handle singular elements because inserting item with indent 0 into 0,1,[],2
  57630. // would create incorrect model.
  57631. let item = content.is( 'documentFragment' ) ? content.getChild( 0 ) : content;
  57632. let selection;
  57633. if ( !selectable ) {
  57634. selection = this.document.selection;
  57635. } else {
  57636. selection = this.createSelection( selectable );
  57637. }
  57638. if ( item && item.is( 'element', 'listItem' ) ) {
  57639. // Get a reference list item. Inserted list items will be fixed according to that item.
  57640. const pos = selection.getFirstPosition();
  57641. let refItem = null;
  57642. if ( pos.parent.is( 'element', 'listItem' ) ) {
  57643. refItem = pos.parent;
  57644. } else if ( pos.nodeBefore && pos.nodeBefore.is( 'element', 'listItem' ) ) {
  57645. refItem = pos.nodeBefore;
  57646. }
  57647. // If there is `refItem` it means that we do insert list items into an existing list.
  57648. if ( refItem ) {
  57649. // First list item in `data` has indent equal to 0 (it is a first list item). It should have indent equal
  57650. // to the indent of reference item. We have to fix the first item and all of it's children and following siblings.
  57651. // Indent of all those items has to be adjusted to reference item.
  57652. const indentChange = refItem.getAttribute( 'listIndent' );
  57653. // Fix only if there is anything to fix.
  57654. if ( indentChange > 0 ) {
  57655. // Adjust indent of all "first" list items in inserted data.
  57656. while ( item && item.is( 'element', 'listItem' ) ) {
  57657. item._setAttribute( 'listIndent', item.getAttribute( 'listIndent' ) + indentChange );
  57658. item = item.nextSibling;
  57659. }
  57660. }
  57661. }
  57662. }
  57663. }
  57664. // Helper function that converts children of a given `<li>` view element into corresponding model elements.
  57665. // The function maintains proper order of elements if model `listItem` is split during the conversion
  57666. // due to block children conversion.
  57667. //
  57668. // @param {module:engine/model/element~Element} listItemModel List item model element to which converted children will be inserted.
  57669. // @param {Iterable.<module:engine/view/node~Node>} viewChildren View elements which will be converted.
  57670. // @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion interface to be used by the callback.
  57671. // @returns {module:engine/model/position~Position} Position on which next elements should be inserted after children conversion.
  57672. function viewToModelListItemChildrenConverter( listItemModel, viewChildren, conversionApi ) {
  57673. const { writer, schema } = conversionApi;
  57674. // A position after the last inserted `listItem`.
  57675. let nextPosition = writer.createPositionAfter( listItemModel );
  57676. // Check all children of the converted `<li>`. At this point we assume there are no "whitespace" view text nodes
  57677. // in view list, between view list items. This should be handled by `<ul>` and `<ol>` converters.
  57678. for ( const child of viewChildren ) {
  57679. if ( child.name == 'ul' || child.name == 'ol' ) {
  57680. // If the children is a list, we will insert its conversion result after currently handled `listItem`.
  57681. // Then, next insertion position will be set after all the new list items (and maybe other elements if
  57682. // something split list item).
  57683. //
  57684. // If this is a list, we expect that some `listItem`s and possibly other blocks will be inserted, however `.modelCursor`
  57685. // should be set after last `listItem` (or block). This is why it feels safe to use it as `nextPosition`
  57686. nextPosition = conversionApi.convertItem( child, nextPosition ).modelCursor;
  57687. } else {
  57688. // If this is not a list, try inserting content at the end of the currently handled `listItem`.
  57689. const result = conversionApi.convertItem( child, writer.createPositionAt( listItemModel, 'end' ) );
  57690. // It may end up that the current `listItem` becomes split (if that content cannot be inside `listItem`). For example:
  57691. //
  57692. // <li><p>Foo</p></li>
  57693. //
  57694. // will be converted to:
  57695. //
  57696. // <listItem></listItem><paragraph>Foo</paragraph><listItem></listItem>
  57697. //
  57698. const convertedChild = result.modelRange.start.nodeAfter;
  57699. const wasSplit = convertedChild && convertedChild.is( 'element' ) && !schema.checkChild( listItemModel, convertedChild.name );
  57700. if ( wasSplit ) {
  57701. // As `lastListItem` got split, we need to update it to the second part of the split `listItem` element.
  57702. //
  57703. // `modelCursor` should be set to a position where the conversion should continue. There are multiple possible scenarios
  57704. // that may happen. Usually, `modelCursor` (marked as `#` below) would point to the second list item after conversion:
  57705. //
  57706. // `<li><p>Foo</p></li>` -> `<listItem></listItem><paragraph>Foo</paragraph><listItem>#</listItem>`
  57707. //
  57708. // However, in some cases, like auto-paragraphing, the position is placed at the end of the block element:
  57709. //
  57710. // `<li><div>Foo</div></li>` -> `<listItem></listItem><paragraph>Foo#</paragraph><listItem></listItem>`
  57711. //
  57712. // or after an element if another element broken auto-paragraphed element:
  57713. //
  57714. // `<li><div><h2>Foo</h2></div></li>` -> `<listItem></listItem><heading1>Foo</heading1>#<listItem></listItem>`
  57715. //
  57716. // We need to check for such cases and use proper list item and position based on it.
  57717. //
  57718. if ( result.modelCursor.parent.is( 'element', 'listItem' ) ) {
  57719. // (1).
  57720. listItemModel = result.modelCursor.parent;
  57721. } else {
  57722. // (2), (3).
  57723. listItemModel = findNextListItem( result.modelCursor );
  57724. }
  57725. nextPosition = writer.createPositionAfter( listItemModel );
  57726. }
  57727. }
  57728. }
  57729. return nextPosition;
  57730. }
  57731. // Helper function that seeks for a next list item starting from given `startPosition`.
  57732. function findNextListItem( startPosition ) {
  57733. const treeWalker = new _ckeditor_ckeditor5_engine_src_model_treewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( { startPosition } );
  57734. let value;
  57735. do {
  57736. value = treeWalker.next();
  57737. } while ( !value.value.item.is( 'element', 'listItem' ) );
  57738. return value.value.item;
  57739. }
  57740. // Helper function that takes all children of given `viewRemovedItem` and moves them in a correct place, according
  57741. // to other given parameters.
  57742. function hoistNestedLists( nextIndent, modelRemoveStartPosition, viewRemoveStartPosition, viewRemovedItem, conversionApi, model ) {
  57743. // Find correct previous model list item element.
  57744. // The element has to have either same or smaller indent than given reference indent.
  57745. // This will be the model element which will get nested items (if it has smaller indent) or sibling items (if it has same indent).
  57746. // Keep in mind that such element might not be found, if removed item was the first item.
  57747. const prevModelItem = Object(_utils__WEBPACK_IMPORTED_MODULE_0__["getSiblingListItem"])( modelRemoveStartPosition.nodeBefore, {
  57748. sameIndent: true,
  57749. smallerIndent: true,
  57750. listIndent: nextIndent,
  57751. foo: 'b'
  57752. } );
  57753. const mapper = conversionApi.mapper;
  57754. const viewWriter = conversionApi.writer;
  57755. // Indent of found element or `null` if the element has not been found.
  57756. const prevIndent = prevModelItem ? prevModelItem.getAttribute( 'listIndent' ) : null;
  57757. let insertPosition;
  57758. if ( !prevModelItem ) {
  57759. // If element has not been found, simply insert lists at the position where the removed item was:
  57760. //
  57761. // Lorem ipsum.
  57762. // 1 -------- <--- this is removed, no previous list item, put nested items in place of removed item.
  57763. // 1.1 -------- <--- this is reference indent.
  57764. // 1.1.1 --------
  57765. // 1.1.2 --------
  57766. // 1.2 --------
  57767. //
  57768. // Becomes:
  57769. //
  57770. // Lorem ipsum.
  57771. // 1.1 --------
  57772. // 1.1.1 --------
  57773. // 1.1.2 --------
  57774. // 1.2 --------
  57775. insertPosition = viewRemoveStartPosition;
  57776. } else if ( prevIndent == nextIndent ) {
  57777. // If element has been found and has same indent as reference indent it means that nested items should
  57778. // become siblings of found element:
  57779. //
  57780. // 1 --------
  57781. // 1.1 --------
  57782. // 1.2 -------- <--- this is `prevModelItem`.
  57783. // 2 -------- <--- this is removed, previous list item has indent same as reference indent.
  57784. // 2.1 -------- <--- this is reference indent, this and 2.2 should become siblings of 1.2.
  57785. // 2.2 --------
  57786. //
  57787. // Becomes:
  57788. //
  57789. // 1 --------
  57790. // 1.1 --------
  57791. // 1.2 --------
  57792. // 2.1 --------
  57793. // 2.2 --------
  57794. const prevViewList = mapper.toViewElement( prevModelItem ).parent;
  57795. insertPosition = viewWriter.createPositionAfter( prevViewList );
  57796. } else {
  57797. // If element has been found and has smaller indent as reference indent it means that nested items
  57798. // should become nested items of found item:
  57799. //
  57800. // 1 -------- <--- this is `prevModelItem`.
  57801. // 1.1 -------- <--- this is removed, previous list item has indent smaller than reference indent.
  57802. // 1.1.1 -------- <--- this is reference indent, this and 1.1.1 should become nested items of 1.
  57803. // 1.1.2 --------
  57804. // 1.2 --------
  57805. //
  57806. // Becomes:
  57807. //
  57808. // 1 --------
  57809. // 1.1.1 --------
  57810. // 1.1.2 --------
  57811. // 1.2 --------
  57812. //
  57813. // Note: in this case 1.1.1 have indent 2 while 1 have indent 0. In model that should not be possible,
  57814. // because following item may have indent bigger only by one. But this is fixed by postfixer.
  57815. const modelPosition = model.createPositionAt( prevModelItem, 'end' );
  57816. insertPosition = mapper.toViewPosition( modelPosition );
  57817. }
  57818. insertPosition = Object(_utils__WEBPACK_IMPORTED_MODULE_0__["positionAfterUiElements"])( insertPosition );
  57819. // Handle multiple lists. This happens if list item has nested numbered and bulleted lists. Following lists
  57820. // are inserted after the first list (no need to recalculate insertion position for them).
  57821. for ( const child of [ ...viewRemovedItem.getChildren() ] ) {
  57822. if ( isList( child ) ) {
  57823. insertPosition = viewWriter.move( viewWriter.createRangeOn( child ), insertPosition ).end;
  57824. Object(_utils__WEBPACK_IMPORTED_MODULE_0__["mergeViewLists"])( viewWriter, child, child.nextSibling );
  57825. Object(_utils__WEBPACK_IMPORTED_MODULE_0__["mergeViewLists"])( viewWriter, child.previousSibling, child );
  57826. }
  57827. }
  57828. }
  57829. // Checks if view element is a list type (ul or ol).
  57830. //
  57831. // @param {module:engine/view/element~Element} viewElement
  57832. // @returns {Boolean}
  57833. function isList( viewElement ) {
  57834. return viewElement.is( 'element', 'ol' ) || viewElement.is( 'element', 'ul' );
  57835. }
  57836. // Calculates the indent value for a list item. Handles HTML compliant and non-compliant lists.
  57837. //
  57838. // Also, fixes non HTML compliant lists indents:
  57839. //
  57840. // before: fixed list:
  57841. // OL OL
  57842. // |-> LI (parent LIs: 0) |-> LI (indent: 0)
  57843. // |-> OL |-> OL
  57844. // |-> OL |
  57845. // | |-> OL |
  57846. // | |-> OL |
  57847. // | |-> LI (parent LIs: 1) |-> LI (indent: 1)
  57848. // |-> LI (parent LIs: 1) |-> LI (indent: 1)
  57849. //
  57850. // before: fixed list:
  57851. // OL OL
  57852. // |-> OL |
  57853. // |-> OL |
  57854. // |-> OL |
  57855. // |-> LI (parent LIs: 0) |-> LI (indent: 0)
  57856. //
  57857. // before: fixed list:
  57858. // OL OL
  57859. // |-> LI (parent LIs: 0) |-> LI (indent: 0)
  57860. // |-> OL |-> OL
  57861. // |-> LI (parent LIs: 0) |-> LI (indent: 1)
  57862. //
  57863. // @param {module:engine/view/element~Element} listItem
  57864. // @param {Object} conversionStore
  57865. // @returns {Number}
  57866. function getIndent( listItem ) {
  57867. let indent = 0;
  57868. let parent = listItem.parent;
  57869. while ( parent ) {
  57870. // Each LI in the tree will result in an increased indent for HTML compliant lists.
  57871. if ( parent.is( 'element', 'li' ) ) {
  57872. indent++;
  57873. } else {
  57874. // If however the list is nested in other list we should check previous sibling of any of the list elements...
  57875. const previousSibling = parent.previousSibling;
  57876. // ...because the we might need increase its indent:
  57877. // before: fixed list:
  57878. // OL OL
  57879. // |-> LI (parent LIs: 0) |-> LI (indent: 0)
  57880. // |-> OL |-> OL
  57881. // |-> LI (parent LIs: 0) |-> LI (indent: 1)
  57882. if ( previousSibling && previousSibling.is( 'element', 'li' ) ) {
  57883. indent++;
  57884. }
  57885. }
  57886. parent = parent.parent;
  57887. }
  57888. return indent;
  57889. }
  57890. /***/ }),
  57891. /***/ "./node_modules/@ckeditor/ckeditor5-list/src/indentcommand.js":
  57892. /*!********************************************************************!*\
  57893. !*** ./node_modules/@ckeditor/ckeditor5-list/src/indentcommand.js ***!
  57894. \********************************************************************/
  57895. /*! exports provided: default */
  57896. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  57897. "use strict";
  57898. __webpack_require__.r(__webpack_exports__);
  57899. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return IndentCommand; });
  57900. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  57901. /* harmony import */ var _ckeditor_ckeditor5_utils_src_first__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/first */ "./node_modules/@ckeditor/ckeditor5-utils/src/first.js");
  57902. /**
  57903. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  57904. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  57905. */
  57906. /**
  57907. * @module list/indentcommand
  57908. */
  57909. /**
  57910. * The list indent command. It is used by the {@link module:list/list~List list feature}.
  57911. *
  57912. * @extends module:core/command~Command
  57913. */
  57914. class IndentCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  57915. /**
  57916. * Creates an instance of the command.
  57917. *
  57918. * @param {module:core/editor/editor~Editor} editor The editor instance.
  57919. * @param {'forward'|'backward'} indentDirection The direction of indent. If it is equal to `backward`, the command
  57920. * will outdent a list item.
  57921. */
  57922. constructor( editor, indentDirection ) {
  57923. super( editor );
  57924. /**
  57925. * Determines by how much the command will change the list item's indent attribute.
  57926. *
  57927. * @readonly
  57928. * @private
  57929. * @member {Number}
  57930. */
  57931. this._indentBy = indentDirection == 'forward' ? 1 : -1;
  57932. }
  57933. /**
  57934. * @inheritDoc
  57935. */
  57936. refresh() {
  57937. this.isEnabled = this._checkEnabled();
  57938. }
  57939. /**
  57940. * Indents or outdents (depending on the {@link #constructor}'s `indentDirection` parameter) selected list items.
  57941. *
  57942. * @fires execute
  57943. * @fires _executeCleanup
  57944. */
  57945. execute() {
  57946. const model = this.editor.model;
  57947. const doc = model.document;
  57948. let itemsToChange = Array.from( doc.selection.getSelectedBlocks() );
  57949. model.change( writer => {
  57950. const lastItem = itemsToChange[ itemsToChange.length - 1 ];
  57951. // Indenting a list item should also indent all the items that are already sub-items of indented item.
  57952. let next = lastItem.nextSibling;
  57953. // Check all items after last indented item, as long as their indent is bigger than indent of that item.
  57954. while ( next && next.name == 'listItem' && next.getAttribute( 'listIndent' ) > lastItem.getAttribute( 'listIndent' ) ) {
  57955. itemsToChange.push( next );
  57956. next = next.nextSibling;
  57957. }
  57958. // We need to be sure to keep model in correct state after each small change, because converters
  57959. // bases on that state and assumes that model is correct.
  57960. // Because of that, if the command outdents items, we will outdent them starting from the last item, as
  57961. // it is safer.
  57962. if ( this._indentBy < 0 ) {
  57963. itemsToChange = itemsToChange.reverse();
  57964. }
  57965. for ( const item of itemsToChange ) {
  57966. const indent = item.getAttribute( 'listIndent' ) + this._indentBy;
  57967. // If indent is lower than 0, it means that the item got outdented when it was not indented.
  57968. // This means that we need to convert that list item to paragraph.
  57969. if ( indent < 0 ) {
  57970. // To keep the model as correct as possible, first rename listItem, then remove attributes,
  57971. // as listItem without attributes is very incorrect and will cause problems in converters.
  57972. // No need to remove attributes, will be removed by post fixer.
  57973. writer.rename( item, 'paragraph' );
  57974. }
  57975. // If indent is >= 0, change the attribute value.
  57976. else {
  57977. writer.setAttribute( 'listIndent', indent, item );
  57978. }
  57979. }
  57980. /**
  57981. * Event fired by the {@link #execute} method.
  57982. *
  57983. * It allows to execute an action after executing the {@link ~IndentCommand#execute} method, for example adjusting
  57984. * attributes of changed list items.
  57985. *
  57986. * @protected
  57987. * @event _executeCleanup
  57988. */
  57989. this.fire( '_executeCleanup', itemsToChange );
  57990. } );
  57991. }
  57992. /**
  57993. * Checks whether the command can be enabled in the current context.
  57994. *
  57995. * @private
  57996. * @returns {Boolean} Whether the command should be enabled.
  57997. */
  57998. _checkEnabled() {
  57999. // Check whether any of position's ancestor is a list item.
  58000. const listItem = Object(_ckeditor_ckeditor5_utils_src_first__WEBPACK_IMPORTED_MODULE_1__["default"])( this.editor.model.document.selection.getSelectedBlocks() );
  58001. // If selection is not in a list item, the command is disabled.
  58002. if ( !listItem || !listItem.is( 'element', 'listItem' ) ) {
  58003. return false;
  58004. }
  58005. if ( this._indentBy > 0 ) {
  58006. // Cannot indent first item in it's list. Check if before `listItem` is a list item that is in same list.
  58007. // To be in the same list, the item has to have same attributes and cannot be "split" by an item with lower indent.
  58008. const indent = listItem.getAttribute( 'listIndent' );
  58009. const type = listItem.getAttribute( 'listType' );
  58010. let prev = listItem.previousSibling;
  58011. while ( prev && prev.is( 'element', 'listItem' ) && prev.getAttribute( 'listIndent' ) >= indent ) {
  58012. if ( prev.getAttribute( 'listIndent' ) == indent ) {
  58013. // The item is on the same level.
  58014. // If it has same type, it means that we found a preceding sibling from the same list.
  58015. // If it does not have same type, it means that `listItem` is on different list (this can happen only
  58016. // on top level lists, though).
  58017. return prev.getAttribute( 'listType' ) == type;
  58018. }
  58019. prev = prev.previousSibling;
  58020. }
  58021. // Could not find similar list item, this means that `listItem` is first in its list.
  58022. return false;
  58023. }
  58024. // If we are outdenting it is enough to be in list item. Every list item can always be outdented.
  58025. return true;
  58026. }
  58027. }
  58028. /***/ }),
  58029. /***/ "./node_modules/@ckeditor/ckeditor5-list/src/list.js":
  58030. /*!***********************************************************!*\
  58031. !*** ./node_modules/@ckeditor/ckeditor5-list/src/list.js ***!
  58032. \***********************************************************/
  58033. /*! exports provided: default */
  58034. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  58035. "use strict";
  58036. __webpack_require__.r(__webpack_exports__);
  58037. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return List; });
  58038. /* harmony import */ var _listediting__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./listediting */ "./node_modules/@ckeditor/ckeditor5-list/src/listediting.js");
  58039. /* harmony import */ var _listui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./listui */ "./node_modules/@ckeditor/ckeditor5-list/src/listui.js");
  58040. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  58041. /**
  58042. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  58043. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  58044. */
  58045. /**
  58046. * @module list/list
  58047. */
  58048. /**
  58049. * The list feature.
  58050. *
  58051. * This is a "glue" plugin that loads the {@link module:list/listediting~ListEditing list editing feature}
  58052. * and {@link module:list/listui~ListUI list UI feature}.
  58053. *
  58054. * @extends module:core/plugin~Plugin
  58055. */
  58056. class List extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_2__["default"] {
  58057. /**
  58058. * @inheritDoc
  58059. */
  58060. static get requires() {
  58061. return [ _listediting__WEBPACK_IMPORTED_MODULE_0__["default"], _listui__WEBPACK_IMPORTED_MODULE_1__["default"] ];
  58062. }
  58063. /**
  58064. * @inheritDoc
  58065. */
  58066. static get pluginName() {
  58067. return 'List';
  58068. }
  58069. }
  58070. /***/ }),
  58071. /***/ "./node_modules/@ckeditor/ckeditor5-list/src/listcommand.js":
  58072. /*!******************************************************************!*\
  58073. !*** ./node_modules/@ckeditor/ckeditor5-list/src/listcommand.js ***!
  58074. \******************************************************************/
  58075. /*! exports provided: default */
  58076. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  58077. "use strict";
  58078. __webpack_require__.r(__webpack_exports__);
  58079. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ListCommand; });
  58080. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  58081. /* harmony import */ var _ckeditor_ckeditor5_utils_src_first__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/first */ "./node_modules/@ckeditor/ckeditor5-utils/src/first.js");
  58082. /**
  58083. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  58084. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  58085. */
  58086. /**
  58087. * @module list/listcommand
  58088. */
  58089. /**
  58090. * The list command. It is used by the {@link module:list/list~List list feature}.
  58091. *
  58092. * @extends module:core/command~Command
  58093. */
  58094. class ListCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  58095. /**
  58096. * Creates an instance of the command.
  58097. *
  58098. * @param {module:core/editor/editor~Editor} editor The editor instance.
  58099. * @param {'numbered'|'bulleted'} type List type that will be handled by this command.
  58100. */
  58101. constructor( editor, type ) {
  58102. super( editor );
  58103. /**
  58104. * The type of the list created by the command.
  58105. *
  58106. * @readonly
  58107. * @member {'numbered'|'bulleted'|'todo'}
  58108. */
  58109. this.type = type;
  58110. /**
  58111. * A flag indicating whether the command is active, which means that the selection starts in a list of the same type.
  58112. *
  58113. * @observable
  58114. * @readonly
  58115. * @member {Boolean} #value
  58116. */
  58117. }
  58118. /**
  58119. * @inheritDoc
  58120. */
  58121. refresh() {
  58122. this.value = this._getValue();
  58123. this.isEnabled = this._checkEnabled();
  58124. }
  58125. /**
  58126. * Executes the command.
  58127. *
  58128. * @protected
  58129. */
  58130. execute() {
  58131. const model = this.editor.model;
  58132. const document = model.document;
  58133. const blocks = Array.from( document.selection.getSelectedBlocks() )
  58134. .filter( block => checkCanBecomeListItem( block, model.schema ) );
  58135. // Whether we are turning off some items.
  58136. const turnOff = this.value === true;
  58137. // If we are turning off items, we are going to rename them to paragraphs.
  58138. model.change( writer => {
  58139. // If part of a list got turned off, we need to handle (outdent) all of sub-items of the last turned-off item.
  58140. // To be sure that model is all the time in a good state, we first fix items below turned-off item.
  58141. if ( turnOff ) {
  58142. // Start from the model item that is just after the last turned-off item.
  58143. let next = blocks[ blocks.length - 1 ].nextSibling;
  58144. let currentIndent = Number.POSITIVE_INFINITY;
  58145. let changes = [];
  58146. // Correct indent of all items after the last turned off item.
  58147. // Rules that should be followed:
  58148. // 1. All direct sub-items of turned-off item should become indent 0, because the first item after it
  58149. // will be the first item of a new list. Other items are at the same level, so should have same 0 index.
  58150. // 2. All items with indent lower than indent of turned-off item should become indent 0, because they
  58151. // should not end up as a child of any of list items that they were not children of before.
  58152. // 3. All other items should have their indent changed relatively to it's parent.
  58153. //
  58154. // For example:
  58155. // 1 * --------
  58156. // 2 * --------
  58157. // 3 * -------- <-- this is turned off.
  58158. // 4 * -------- <-- this has to become indent = 0, because it will be first item on a new list.
  58159. // 5 * -------- <-- this should be still be a child of item above, so indent = 1.
  58160. // 6 * -------- <-- this has to become indent = 0, because it should not be a child of any of items above.
  58161. // 7 * -------- <-- this should be still be a child of item above, so indent = 1.
  58162. // 8 * -------- <-- this has to become indent = 0.
  58163. // 9 * -------- <-- this should still be a child of item above, so indent = 1.
  58164. // 10 * -------- <-- this should still be a child of item above, so indent = 2.
  58165. // 11 * -------- <-- this should still be at the same level as item above, so indent = 2.
  58166. // 12 * -------- <-- this and all below are left unchanged.
  58167. // 13 * --------
  58168. // 14 * --------
  58169. //
  58170. // After turning off 3 the list becomes:
  58171. //
  58172. // 1 * --------
  58173. // 2 * --------
  58174. //
  58175. // 3 --------
  58176. //
  58177. // 4 * --------
  58178. // 5 * --------
  58179. // 6 * --------
  58180. // 7 * --------
  58181. // 8 * --------
  58182. // 9 * --------
  58183. // 10 * --------
  58184. // 11 * --------
  58185. // 12 * --------
  58186. // 13 * --------
  58187. // 14 * --------
  58188. //
  58189. // Thanks to this algorithm no lists are mismatched and no items get unexpected children/parent, while
  58190. // those parent-child connection which are possible to maintain are still maintained. It's worth noting
  58191. // that this is the same effect that we would be get by multiple use of outdent command. However doing
  58192. // it like this is much more efficient because it's less operation (less memory usage, easier OT) and
  58193. // less conversion (faster).
  58194. while ( next && next.name == 'listItem' && next.getAttribute( 'listIndent' ) !== 0 ) {
  58195. // Check each next list item, as long as its indent is bigger than 0.
  58196. // If the indent is 0 we are not going to change anything anyway.
  58197. const indent = next.getAttribute( 'listIndent' );
  58198. // We check if that's item indent is lower as current relative indent.
  58199. if ( indent < currentIndent ) {
  58200. // If it is, current relative indent becomes that indent.
  58201. currentIndent = indent;
  58202. }
  58203. // Fix indent relatively to current relative indent.
  58204. // Note, that if we just changed the current relative indent, the newIndent will be equal to 0.
  58205. const newIndent = indent - currentIndent;
  58206. // Save the entry in changes array. We do not apply it at the moment, because we will need to
  58207. // reverse the changes so the last item is changed first.
  58208. // This is to keep model in correct state all the time.
  58209. changes.push( { element: next, listIndent: newIndent } );
  58210. // Find next item.
  58211. next = next.nextSibling;
  58212. }
  58213. changes = changes.reverse();
  58214. for ( const item of changes ) {
  58215. writer.setAttribute( 'listIndent', item.listIndent, item.element );
  58216. }
  58217. }
  58218. // If we are turning on, we might change some items that are already `listItem`s but with different type.
  58219. // Changing one nested list item to other type should also trigger changing all its siblings so the
  58220. // whole nested list is of the same type.
  58221. // Example (assume changing to numbered list):
  58222. // * ------ <-- do not fix, top level item
  58223. // * ------ <-- fix, because latter list item of this item's list is changed
  58224. // * ------ <-- do not fix, item is not affected (different list)
  58225. // * ------ <-- fix, because latter list item of this item's list is changed
  58226. // * ------ <-- fix, because latter list item of this item's list is changed
  58227. // * ---[-- <-- already in selection
  58228. // * ------ <-- already in selection
  58229. // * ------ <-- already in selection
  58230. // * ------ <-- already in selection, but does not cause other list items to change because is top-level
  58231. // * ---]-- <-- already in selection
  58232. // * ------ <-- fix, because preceding list item of this item's list is changed
  58233. // * ------ <-- do not fix, item is not affected (different list)
  58234. // * ------ <-- do not fix, top level item
  58235. if ( !turnOff ) {
  58236. // Find lowest indent among selected items. This will be indicator what is the indent of
  58237. // top-most list affected by the command.
  58238. let lowestIndent = Number.POSITIVE_INFINITY;
  58239. for ( const item of blocks ) {
  58240. if ( item.is( 'element', 'listItem' ) && item.getAttribute( 'listIndent' ) < lowestIndent ) {
  58241. lowestIndent = item.getAttribute( 'listIndent' );
  58242. }
  58243. }
  58244. // Do not execute the fix for top-level lists.
  58245. lowestIndent = lowestIndent === 0 ? 1 : lowestIndent;
  58246. // Fix types of list items that are "before" the selected blocks.
  58247. _fixType( blocks, true, lowestIndent );
  58248. // Fix types of list items that are "after" the selected blocks.
  58249. _fixType( blocks, false, lowestIndent );
  58250. }
  58251. // Phew! Now it will be easier :).
  58252. // For each block element that was in the selection, we will either: turn it to list item,
  58253. // turn it to paragraph, or change it's type. Or leave it as it is.
  58254. // Do it in reverse as there might be multiple blocks (same as with changing indents).
  58255. for ( const element of blocks.reverse() ) {
  58256. if ( turnOff && element.name == 'listItem' ) {
  58257. // We are turning off and the element is a `listItem` - it should be converted to `paragraph`.
  58258. // List item specific attributes are removed by post fixer.
  58259. writer.rename( element, 'paragraph' );
  58260. } else if ( !turnOff && element.name != 'listItem' ) {
  58261. // We are turning on and the element is not a `listItem` - it should be converted to `listItem`.
  58262. // The order of operations is important to keep model in correct state.
  58263. writer.setAttributes( { listType: this.type, listIndent: 0 }, element );
  58264. writer.rename( element, 'listItem' );
  58265. } else if ( !turnOff && element.name == 'listItem' && element.getAttribute( 'listType' ) != this.type ) {
  58266. // We are turning on and the element is a `listItem` but has different type - change it's type and
  58267. // type of it's all siblings that have same indent.
  58268. writer.setAttribute( 'listType', this.type, element );
  58269. }
  58270. }
  58271. /**
  58272. * Event fired by the {@link #execute} method.
  58273. *
  58274. * It allows to execute an action after executing the {@link ~ListCommand#execute} method, for example adjusting
  58275. * attributes of changed blocks.
  58276. *
  58277. * @protected
  58278. * @event _executeCleanup
  58279. */
  58280. this.fire( '_executeCleanup', blocks );
  58281. } );
  58282. }
  58283. /**
  58284. * Checks the command's {@link #value}.
  58285. *
  58286. * @private
  58287. * @returns {Boolean} The current value.
  58288. */
  58289. _getValue() {
  58290. // Check whether closest `listItem` ancestor of the position has a correct type.
  58291. const listItem = Object(_ckeditor_ckeditor5_utils_src_first__WEBPACK_IMPORTED_MODULE_1__["default"])( this.editor.model.document.selection.getSelectedBlocks() );
  58292. return !!listItem && listItem.is( 'element', 'listItem' ) && listItem.getAttribute( 'listType' ) == this.type;
  58293. }
  58294. /**
  58295. * Checks whether the command can be enabled in the current context.
  58296. *
  58297. * @private
  58298. * @returns {Boolean} Whether the command should be enabled.
  58299. */
  58300. _checkEnabled() {
  58301. // If command value is true it means that we are in list item, so the command should be enabled.
  58302. if ( this.value ) {
  58303. return true;
  58304. }
  58305. const selection = this.editor.model.document.selection;
  58306. const schema = this.editor.model.schema;
  58307. const firstBlock = Object(_ckeditor_ckeditor5_utils_src_first__WEBPACK_IMPORTED_MODULE_1__["default"])( selection.getSelectedBlocks() );
  58308. if ( !firstBlock ) {
  58309. return false;
  58310. }
  58311. // Otherwise, check if list item can be inserted at the position start.
  58312. return checkCanBecomeListItem( firstBlock, schema );
  58313. }
  58314. }
  58315. // Helper function used when one or more list item have their type changed. Fixes type of other list items
  58316. // that are affected by the change (are in same lists) but are not directly in selection. The function got extracted
  58317. // not to duplicated code, as same fix has to be performed before and after selection.
  58318. //
  58319. // @param {Array.<module:engine/model/node~Node>} blocks Blocks that are in selection.
  58320. // @param {Boolean} isBackward Specified whether fix will be applied for blocks before first selected block (`true`)
  58321. // or blocks after last selected block (`false`).
  58322. // @param {Number} lowestIndent Lowest indent among selected blocks.
  58323. function _fixType( blocks, isBackward, lowestIndent ) {
  58324. // We need to check previous sibling of first changed item and next siblings of last changed item.
  58325. const startingItem = isBackward ? blocks[ 0 ] : blocks[ blocks.length - 1 ];
  58326. if ( startingItem.is( 'element', 'listItem' ) ) {
  58327. let item = startingItem[ isBackward ? 'previousSibling' : 'nextSibling' ];
  58328. // During processing items, keeps the lowest indent of already processed items.
  58329. // This saves us from changing too many items.
  58330. // Following example is for going forward as it is easier to read, however same applies to going backward.
  58331. // * ------
  58332. // * ------
  58333. // * --[---
  58334. // * ------ <-- `lowestIndent` should be 1
  58335. // * --]--- <-- `startingItem`, `currentIndent` = 2, `lowestIndent` == 1
  58336. // * ------ <-- should be fixed, `indent` == 2 == `currentIndent`
  58337. // * ------ <-- should be fixed, set `currentIndent` to 1, `indent` == 1 == `currentIndent`
  58338. // * ------ <-- should not be fixed, item is in different list, `indent` = 2, `indent` != `currentIndent`
  58339. // * ------ <-- should be fixed, `indent` == 1 == `currentIndent`
  58340. // * ------ <-- break loop (`indent` < `lowestIndent`)
  58341. let currentIndent = startingItem.getAttribute( 'listIndent' );
  58342. // Look back until a list item with indent lower than reference `lowestIndent`.
  58343. // That would be the parent of nested sublist which contains item having `lowestIndent`.
  58344. while ( item && item.is( 'element', 'listItem' ) && item.getAttribute( 'listIndent' ) >= lowestIndent ) {
  58345. if ( currentIndent > item.getAttribute( 'listIndent' ) ) {
  58346. currentIndent = item.getAttribute( 'listIndent' );
  58347. }
  58348. // Found an item that is in the same nested sublist.
  58349. if ( item.getAttribute( 'listIndent' ) == currentIndent ) {
  58350. // Just add the item to selected blocks like it was selected by the user.
  58351. blocks[ isBackward ? 'unshift' : 'push' ]( item );
  58352. }
  58353. item = item[ isBackward ? 'previousSibling' : 'nextSibling' ];
  58354. }
  58355. }
  58356. }
  58357. // Checks whether the given block can be replaced by a listItem.
  58358. //
  58359. // @private
  58360. // @param {module:engine/model/element~Element} block A block to be tested.
  58361. // @param {module:engine/model/schema~Schema} schema The schema of the document.
  58362. // @returns {Boolean}
  58363. function checkCanBecomeListItem( block, schema ) {
  58364. return schema.checkChild( block.parent, 'listItem' ) && !schema.isObject( block );
  58365. }
  58366. /***/ }),
  58367. /***/ "./node_modules/@ckeditor/ckeditor5-list/src/listediting.js":
  58368. /*!******************************************************************!*\
  58369. !*** ./node_modules/@ckeditor/ckeditor5-list/src/listediting.js ***!
  58370. \******************************************************************/
  58371. /*! exports provided: default */
  58372. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  58373. "use strict";
  58374. __webpack_require__.r(__webpack_exports__);
  58375. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ListEditing; });
  58376. /* harmony import */ var _listcommand__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./listcommand */ "./node_modules/@ckeditor/ckeditor5-list/src/listcommand.js");
  58377. /* harmony import */ var _indentcommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./indentcommand */ "./node_modules/@ckeditor/ckeditor5-list/src/indentcommand.js");
  58378. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  58379. /* harmony import */ var _ckeditor_ckeditor5_paragraph_src_paragraph__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-paragraph/src/paragraph */ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraph.js");
  58380. /* harmony import */ var _converters__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./converters */ "./node_modules/@ckeditor/ckeditor5-list/src/converters.js");
  58381. /**
  58382. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  58383. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  58384. */
  58385. /**
  58386. * @module list/listediting
  58387. */
  58388. /**
  58389. * The engine of the list feature. It handles creating, editing and removing lists and list items.
  58390. *
  58391. * It registers the `'numberedList'`, `'bulletedList'`, `'indentList'` and `'outdentList'` commands.
  58392. *
  58393. * @extends module:core/plugin~Plugin
  58394. */
  58395. class ListEditing extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_2__["default"] {
  58396. /**
  58397. * @inheritDoc
  58398. */
  58399. static get pluginName() {
  58400. return 'ListEditing';
  58401. }
  58402. /**
  58403. * @inheritDoc
  58404. */
  58405. static get requires() {
  58406. return [ _ckeditor_ckeditor5_paragraph_src_paragraph__WEBPACK_IMPORTED_MODULE_3__["default"] ];
  58407. }
  58408. /**
  58409. * @inheritDoc
  58410. */
  58411. init() {
  58412. const editor = this.editor;
  58413. // Schema.
  58414. // Note: in case `$block` will ever be allowed in `listItem`, keep in mind that this feature
  58415. // uses `Selection#getSelectedBlocks()` without any additional processing to obtain all selected list items.
  58416. // If there are blocks allowed inside list item, algorithms using `getSelectedBlocks()` will have to be modified.
  58417. editor.model.schema.register( 'listItem', {
  58418. inheritAllFrom: '$block',
  58419. allowAttributes: [ 'listType', 'listIndent' ]
  58420. } );
  58421. // Converters.
  58422. const data = editor.data;
  58423. const editing = editor.editing;
  58424. editor.model.document.registerPostFixer( writer => Object(_converters__WEBPACK_IMPORTED_MODULE_4__["modelChangePostFixer"])( editor.model, writer ) );
  58425. editing.mapper.registerViewToModelLength( 'li', getViewListItemLength );
  58426. data.mapper.registerViewToModelLength( 'li', getViewListItemLength );
  58427. editing.mapper.on( 'modelToViewPosition', Object(_converters__WEBPACK_IMPORTED_MODULE_4__["modelToViewPosition"])( editing.view ) );
  58428. editing.mapper.on( 'viewToModelPosition', Object(_converters__WEBPACK_IMPORTED_MODULE_4__["viewToModelPosition"])( editor.model ) );
  58429. data.mapper.on( 'modelToViewPosition', Object(_converters__WEBPACK_IMPORTED_MODULE_4__["modelToViewPosition"])( editing.view ) );
  58430. editor.conversion.for( 'editingDowncast' )
  58431. .add( dispatcher => {
  58432. dispatcher.on( 'insert', _converters__WEBPACK_IMPORTED_MODULE_4__["modelViewSplitOnInsert"], { priority: 'high' } );
  58433. dispatcher.on( 'insert:listItem', Object(_converters__WEBPACK_IMPORTED_MODULE_4__["modelViewInsertion"])( editor.model ) );
  58434. dispatcher.on( 'attribute:listType:listItem', _converters__WEBPACK_IMPORTED_MODULE_4__["modelViewChangeType"], { priority: 'high' } );
  58435. dispatcher.on( 'attribute:listType:listItem', _converters__WEBPACK_IMPORTED_MODULE_4__["modelViewMergeAfterChangeType"], { priority: 'low' } );
  58436. dispatcher.on( 'attribute:listIndent:listItem', Object(_converters__WEBPACK_IMPORTED_MODULE_4__["modelViewChangeIndent"])( editor.model ) );
  58437. dispatcher.on( 'remove:listItem', Object(_converters__WEBPACK_IMPORTED_MODULE_4__["modelViewRemove"])( editor.model ) );
  58438. dispatcher.on( 'remove', _converters__WEBPACK_IMPORTED_MODULE_4__["modelViewMergeAfter"], { priority: 'low' } );
  58439. } );
  58440. editor.conversion.for( 'dataDowncast' )
  58441. .add( dispatcher => {
  58442. dispatcher.on( 'insert', _converters__WEBPACK_IMPORTED_MODULE_4__["modelViewSplitOnInsert"], { priority: 'high' } );
  58443. dispatcher.on( 'insert:listItem', Object(_converters__WEBPACK_IMPORTED_MODULE_4__["modelViewInsertion"])( editor.model ) );
  58444. } );
  58445. editor.conversion.for( 'upcast' )
  58446. .add( dispatcher => {
  58447. dispatcher.on( 'element:ul', _converters__WEBPACK_IMPORTED_MODULE_4__["cleanList"], { priority: 'high' } );
  58448. dispatcher.on( 'element:ol', _converters__WEBPACK_IMPORTED_MODULE_4__["cleanList"], { priority: 'high' } );
  58449. dispatcher.on( 'element:li', _converters__WEBPACK_IMPORTED_MODULE_4__["cleanListItem"], { priority: 'high' } );
  58450. dispatcher.on( 'element:li', _converters__WEBPACK_IMPORTED_MODULE_4__["viewModelConverter"] );
  58451. } );
  58452. // Fix indentation of pasted items.
  58453. editor.model.on( 'insertContent', _converters__WEBPACK_IMPORTED_MODULE_4__["modelIndentPasteFixer"], { priority: 'high' } );
  58454. // Register commands for numbered and bulleted list.
  58455. editor.commands.add( 'numberedList', new _listcommand__WEBPACK_IMPORTED_MODULE_0__["default"]( editor, 'numbered' ) );
  58456. editor.commands.add( 'bulletedList', new _listcommand__WEBPACK_IMPORTED_MODULE_0__["default"]( editor, 'bulleted' ) );
  58457. // Register commands for indenting.
  58458. editor.commands.add( 'indentList', new _indentcommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, 'forward' ) );
  58459. editor.commands.add( 'outdentList', new _indentcommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, 'backward' ) );
  58460. const viewDocument = editing.view.document;
  58461. // Overwrite default Enter key behavior.
  58462. // If Enter key is pressed with selection collapsed in empty list item, outdent it instead of breaking it.
  58463. this.listenTo( viewDocument, 'enter', ( evt, data ) => {
  58464. const doc = this.editor.model.document;
  58465. const positionParent = doc.selection.getLastPosition().parent;
  58466. if ( doc.selection.isCollapsed && positionParent.name == 'listItem' && positionParent.isEmpty ) {
  58467. this.editor.execute( 'outdentList' );
  58468. data.preventDefault();
  58469. evt.stop();
  58470. }
  58471. } );
  58472. // Overwrite default Backspace key behavior.
  58473. // If Backspace key is pressed with selection collapsed on first position in first list item, outdent it. #83
  58474. this.listenTo( viewDocument, 'delete', ( evt, data ) => {
  58475. // Check conditions from those that require less computations like those immediately available.
  58476. if ( data.direction !== 'backward' ) {
  58477. return;
  58478. }
  58479. const selection = this.editor.model.document.selection;
  58480. if ( !selection.isCollapsed ) {
  58481. return;
  58482. }
  58483. const firstPosition = selection.getFirstPosition();
  58484. if ( !firstPosition.isAtStart ) {
  58485. return;
  58486. }
  58487. const positionParent = firstPosition.parent;
  58488. if ( positionParent.name !== 'listItem' ) {
  58489. return;
  58490. }
  58491. const previousIsAListItem = positionParent.previousSibling && positionParent.previousSibling.name === 'listItem';
  58492. if ( previousIsAListItem ) {
  58493. return;
  58494. }
  58495. this.editor.execute( 'outdentList' );
  58496. data.preventDefault();
  58497. evt.stop();
  58498. }, { priority: 'high' } );
  58499. const getCommandExecuter = commandName => {
  58500. return ( data, cancel ) => {
  58501. const command = this.editor.commands.get( commandName );
  58502. if ( command.isEnabled ) {
  58503. this.editor.execute( commandName );
  58504. cancel();
  58505. }
  58506. };
  58507. };
  58508. editor.keystrokes.set( 'Tab', getCommandExecuter( 'indentList' ) );
  58509. editor.keystrokes.set( 'Shift+Tab', getCommandExecuter( 'outdentList' ) );
  58510. }
  58511. /**
  58512. * @inheritDoc
  58513. */
  58514. afterInit() {
  58515. const commands = this.editor.commands;
  58516. const indent = commands.get( 'indent' );
  58517. const outdent = commands.get( 'outdent' );
  58518. if ( indent ) {
  58519. indent.registerChildCommand( commands.get( 'indentList' ) );
  58520. }
  58521. if ( outdent ) {
  58522. outdent.registerChildCommand( commands.get( 'outdentList' ) );
  58523. }
  58524. }
  58525. }
  58526. function getViewListItemLength( element ) {
  58527. let length = 1;
  58528. for ( const child of element.getChildren() ) {
  58529. if ( child.name == 'ul' || child.name == 'ol' ) {
  58530. for ( const item of child.getChildren() ) {
  58531. length += getViewListItemLength( item );
  58532. }
  58533. }
  58534. }
  58535. return length;
  58536. }
  58537. /***/ }),
  58538. /***/ "./node_modules/@ckeditor/ckeditor5-list/src/listui.js":
  58539. /*!*************************************************************!*\
  58540. !*** ./node_modules/@ckeditor/ckeditor5-list/src/listui.js ***!
  58541. \*************************************************************/
  58542. /*! exports provided: default */
  58543. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  58544. "use strict";
  58545. __webpack_require__.r(__webpack_exports__);
  58546. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ListUI; });
  58547. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-list/src/utils.js");
  58548. /* harmony import */ var _theme_icons_numberedlist_svg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../theme/icons/numberedlist.svg */ "./node_modules/@ckeditor/ckeditor5-list/theme/icons/numberedlist.svg");
  58549. /* harmony import */ var _theme_icons_bulletedlist_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../theme/icons/bulletedlist.svg */ "./node_modules/@ckeditor/ckeditor5-list/theme/icons/bulletedlist.svg");
  58550. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  58551. /**
  58552. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  58553. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  58554. */
  58555. /**
  58556. * @module list/listui
  58557. */
  58558. /**
  58559. * The list UI feature. It introduces the `'numberedList'` and `'bulletedList'` buttons that
  58560. * allow to convert paragraphs to and from list items and indent or outdent them.
  58561. *
  58562. * @extends module:core/plugin~Plugin
  58563. */
  58564. class ListUI extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_3__["default"] {
  58565. /**
  58566. * @inheritDoc
  58567. */
  58568. init() {
  58569. const t = this.editor.t;
  58570. // Create two buttons and link them with numberedList and bulletedList commands.
  58571. Object(_utils__WEBPACK_IMPORTED_MODULE_0__["createUIComponent"])( this.editor, 'numberedList', t( 'Numbered List' ), _theme_icons_numberedlist_svg__WEBPACK_IMPORTED_MODULE_1__["default"] );
  58572. Object(_utils__WEBPACK_IMPORTED_MODULE_0__["createUIComponent"])( this.editor, 'bulletedList', t( 'Bulleted List' ), _theme_icons_bulletedlist_svg__WEBPACK_IMPORTED_MODULE_2__["default"] );
  58573. }
  58574. }
  58575. /***/ }),
  58576. /***/ "./node_modules/@ckeditor/ckeditor5-list/src/utils.js":
  58577. /*!************************************************************!*\
  58578. !*** ./node_modules/@ckeditor/ckeditor5-list/src/utils.js ***!
  58579. \************************************************************/
  58580. /*! exports provided: createViewListItemElement, generateLiInUl, injectViewList, mergeViewLists, positionAfterUiElements, getSiblingListItem, createUIComponent, findNestedList, getSiblingNodes */
  58581. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  58582. "use strict";
  58583. __webpack_require__.r(__webpack_exports__);
  58584. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createViewListItemElement", function() { return createViewListItemElement; });
  58585. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "generateLiInUl", function() { return generateLiInUl; });
  58586. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "injectViewList", function() { return injectViewList; });
  58587. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeViewLists", function() { return mergeViewLists; });
  58588. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "positionAfterUiElements", function() { return positionAfterUiElements; });
  58589. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSiblingListItem", function() { return getSiblingListItem; });
  58590. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createUIComponent", function() { return createUIComponent; });
  58591. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findNestedList", function() { return findNestedList; });
  58592. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSiblingNodes", function() { return getSiblingNodes; });
  58593. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_containerelement__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/containerelement */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/containerelement.js");
  58594. /* harmony import */ var _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  58595. /* harmony import */ var _ckeditor_ckeditor5_engine_src_model_treewalker__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/model/treewalker */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/treewalker.js");
  58596. /**
  58597. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  58598. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  58599. */
  58600. /**
  58601. * @module list/utils
  58602. */
  58603. /**
  58604. * Creates a list item {@link module:engine/view/containerelement~ContainerElement}.
  58605. *
  58606. * @param {module:engine/view/downcastwriter~DowncastWriter} writer The writer instance.
  58607. * @returns {module:engine/view/containerelement~ContainerElement}
  58608. */
  58609. function createViewListItemElement( writer ) {
  58610. const viewItem = writer.createContainerElement( 'li' );
  58611. viewItem.getFillerOffset = getListItemFillerOffset;
  58612. return viewItem;
  58613. }
  58614. /**
  58615. * Helper function that creates a `<ul><li></li></ul>` or (`<ol>`) structure out of the given `modelItem` model `listItem` element.
  58616. * Then, it binds the created view list item (`<li>`) with the model `listItem` element.
  58617. * The function then returns the created view list item (`<li>`).
  58618. *
  58619. * @param {module:engine/model/item~Item} modelItem Model list item.
  58620. * @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion interface.
  58621. * @returns {module:engine/view/containerelement~ContainerElement} View list element.
  58622. */
  58623. function generateLiInUl( modelItem, conversionApi ) {
  58624. const mapper = conversionApi.mapper;
  58625. const viewWriter = conversionApi.writer;
  58626. const listType = modelItem.getAttribute( 'listType' ) == 'numbered' ? 'ol' : 'ul';
  58627. const viewItem = createViewListItemElement( viewWriter );
  58628. const viewList = viewWriter.createContainerElement( listType, null );
  58629. viewWriter.insert( viewWriter.createPositionAt( viewList, 0 ), viewItem );
  58630. mapper.bindElements( modelItem, viewItem );
  58631. return viewItem;
  58632. }
  58633. /**
  58634. * Helper function that inserts a view list at a correct place and merges it with its siblings.
  58635. * It takes a model list item element (`modelItem`) and a corresponding view list item element (`injectedItem`). The view list item
  58636. * should be in a view list element (`<ul>` or `<ol>`) and should be its only child.
  58637. * See comments below to better understand the algorithm.
  58638. *
  58639. * @param {module:engine/view/item~Item} modelItem Model list item.
  58640. * @param {module:engine/view/containerelement~ContainerElement} injectedItem
  58641. * @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion interface.
  58642. * @param {module:engine/model/model~Model} model The model instance.
  58643. */
  58644. function injectViewList( modelItem, injectedItem, conversionApi, model ) {
  58645. const injectedList = injectedItem.parent;
  58646. const mapper = conversionApi.mapper;
  58647. const viewWriter = conversionApi.writer;
  58648. // The position where the view list will be inserted.
  58649. let insertPosition = mapper.toViewPosition( model.createPositionBefore( modelItem ) );
  58650. // 1. Find the previous list item that has the same or smaller indent. Basically we are looking for the first model item
  58651. // that is a "parent" or "sibling" of the injected model item.
  58652. // If there is no such list item, it means that the injected list item is the first item in "its list".
  58653. const refItem = getSiblingListItem( modelItem.previousSibling, {
  58654. sameIndent: true,
  58655. smallerIndent: true,
  58656. listIndent: modelItem.getAttribute( 'listIndent' )
  58657. } );
  58658. const prevItem = modelItem.previousSibling;
  58659. if ( refItem && refItem.getAttribute( 'listIndent' ) == modelItem.getAttribute( 'listIndent' ) ) {
  58660. // There is a list item with the same indent - we found the same-level sibling.
  58661. // Break the list after it. The inserted view item will be added in the broken space.
  58662. const viewItem = mapper.toViewElement( refItem );
  58663. insertPosition = viewWriter.breakContainer( viewWriter.createPositionAfter( viewItem ) );
  58664. } else {
  58665. // There is no list item with the same indent. Check the previous model item.
  58666. if ( prevItem && prevItem.name == 'listItem' ) {
  58667. // If it is a list item, it has to have a lower indent.
  58668. // It means that the inserted item should be added to it as its nested item.
  58669. insertPosition = mapper.toViewPosition( model.createPositionAt( prevItem, 'end' ) );
  58670. // There could be some not mapped elements (eg. span in to-do list) but we need to insert
  58671. // a nested list directly inside the li element.
  58672. const mappedViewAncestor = mapper.findMappedViewAncestor( insertPosition );
  58673. const nestedList = findNestedList( mappedViewAncestor );
  58674. // If there already is some nested list, then use it's position.
  58675. if ( nestedList ) {
  58676. insertPosition = viewWriter.createPositionBefore( nestedList );
  58677. } else {
  58678. // Else just put new list on the end of list item content.
  58679. insertPosition = viewWriter.createPositionAt( mappedViewAncestor, 'end' );
  58680. }
  58681. } else {
  58682. // The previous item is not a list item (or does not exist at all).
  58683. // Just map the position and insert the view item at the mapped position.
  58684. insertPosition = mapper.toViewPosition( model.createPositionBefore( modelItem ) );
  58685. }
  58686. }
  58687. insertPosition = positionAfterUiElements( insertPosition );
  58688. // Insert the view item.
  58689. viewWriter.insert( insertPosition, injectedList );
  58690. // 2. Handle possible children of the injected model item.
  58691. if ( prevItem && prevItem.name == 'listItem' ) {
  58692. const prevView = mapper.toViewElement( prevItem );
  58693. const walkerBoundaries = viewWriter.createRange( viewWriter.createPositionAt( prevView, 0 ), insertPosition );
  58694. const walker = walkerBoundaries.getWalker( { ignoreElementEnd: true } );
  58695. for ( const value of walker ) {
  58696. if ( value.item.is( 'element', 'li' ) ) {
  58697. const breakPosition = viewWriter.breakContainer( viewWriter.createPositionBefore( value.item ) );
  58698. const viewList = value.item.parent;
  58699. const targetPosition = viewWriter.createPositionAt( injectedItem, 'end' );
  58700. mergeViewLists( viewWriter, targetPosition.nodeBefore, targetPosition.nodeAfter );
  58701. viewWriter.move( viewWriter.createRangeOn( viewList ), targetPosition );
  58702. walker.position = breakPosition;
  58703. }
  58704. }
  58705. } else {
  58706. const nextViewList = injectedList.nextSibling;
  58707. if ( nextViewList && ( nextViewList.is( 'element', 'ul' ) || nextViewList.is( 'element', 'ol' ) ) ) {
  58708. let lastSubChild = null;
  58709. for ( const child of nextViewList.getChildren() ) {
  58710. const modelChild = mapper.toModelElement( child );
  58711. if ( modelChild && modelChild.getAttribute( 'listIndent' ) > modelItem.getAttribute( 'listIndent' ) ) {
  58712. lastSubChild = child;
  58713. } else {
  58714. break;
  58715. }
  58716. }
  58717. if ( lastSubChild ) {
  58718. viewWriter.breakContainer( viewWriter.createPositionAfter( lastSubChild ) );
  58719. viewWriter.move( viewWriter.createRangeOn( lastSubChild.parent ), viewWriter.createPositionAt( injectedItem, 'end' ) );
  58720. }
  58721. }
  58722. }
  58723. // Merge the inserted view list with its possible neighbor lists.
  58724. mergeViewLists( viewWriter, injectedList, injectedList.nextSibling );
  58725. mergeViewLists( viewWriter, injectedList.previousSibling, injectedList );
  58726. }
  58727. /**
  58728. * Helper function that takes two parameters that are expected to be view list elements, and merges them.
  58729. * The merge happens only if both parameters are list elements of the same type (the same element name and the same class attributes).
  58730. *
  58731. * @param {module:engine/view/downcastwriter~DowncastWriter} viewWriter The writer instance.
  58732. * @param {module:engine/view/item~Item} firstList The first element to compare.
  58733. * @param {module:engine/view/item~Item} secondList The second element to compare.
  58734. * @returns {module:engine/view/position~Position|null} The position after merge or `null` when there was no merge.
  58735. */
  58736. function mergeViewLists( viewWriter, firstList, secondList ) {
  58737. // Check if two lists are going to be merged.
  58738. if ( !firstList || !secondList || ( firstList.name != 'ul' && firstList.name != 'ol' ) ) {
  58739. return null;
  58740. }
  58741. // Both parameters are list elements, so compare types now.
  58742. if ( firstList.name != secondList.name || firstList.getAttribute( 'class' ) !== secondList.getAttribute( 'class' ) ) {
  58743. return null;
  58744. }
  58745. return viewWriter.mergeContainers( viewWriter.createPositionAfter( firstList ) );
  58746. }
  58747. /**
  58748. * Helper function that for a given `view.Position`, returns a `view.Position` that is after all `view.UIElement`s that
  58749. * are after the given position.
  58750. *
  58751. * For example:
  58752. * `<container:p>foo^<ui:span></ui:span><ui:span></ui:span>bar</container:p>`
  58753. * For position ^, the position before "bar" will be returned.
  58754. *
  58755. * @param {module:engine/view/position~Position} viewPosition
  58756. * @returns {module:engine/view/position~Position}
  58757. */
  58758. function positionAfterUiElements( viewPosition ) {
  58759. return viewPosition.getLastMatchingPosition( value => value.item.is( 'uiElement' ) );
  58760. }
  58761. /**
  58762. * Helper function that searches for a previous list item sibling of a given model item that meets the given criteria
  58763. * passed by the options object.
  58764. *
  58765. * @param {module:engine/model/item~Item} modelItem
  58766. * @param {Object} options Search criteria.
  58767. * @param {Boolean} [options.sameIndent=false] Whether the sought sibling should have the same indentation.
  58768. * @param {Boolean} [options.smallerIndent=false] Whether the sought sibling should have a smaller indentation.
  58769. * @param {Number} [options.listIndent] The reference indentation.
  58770. * @param {'forward'|'backward'} [options.direction='backward'] Walking direction.
  58771. * @returns {module:engine/model/item~Item|null}
  58772. */
  58773. function getSiblingListItem( modelItem, options ) {
  58774. const sameIndent = !!options.sameIndent;
  58775. const smallerIndent = !!options.smallerIndent;
  58776. const indent = options.listIndent;
  58777. let item = modelItem;
  58778. while ( item && item.name == 'listItem' ) {
  58779. const itemIndent = item.getAttribute( 'listIndent' );
  58780. if ( ( sameIndent && indent == itemIndent ) || ( smallerIndent && indent > itemIndent ) ) {
  58781. return item;
  58782. }
  58783. if ( options.direction === 'forward' ) {
  58784. item = item.nextSibling;
  58785. } else {
  58786. item = item.previousSibling;
  58787. }
  58788. }
  58789. return null;
  58790. }
  58791. /**
  58792. * Helper method for creating a UI button and linking it with an appropriate command.
  58793. *
  58794. * @private
  58795. * @param {module:core/editor/editor~Editor} editor The editor instance to which the UI component will be added.
  58796. * @param {String} commandName The name of the command.
  58797. * @param {Object} label The button label.
  58798. * @param {String} icon The source of the icon.
  58799. */
  58800. function createUIComponent( editor, commandName, label, icon ) {
  58801. editor.ui.componentFactory.add( commandName, locale => {
  58802. const command = editor.commands.get( commandName );
  58803. const buttonView = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__["default"]( locale );
  58804. buttonView.set( {
  58805. label,
  58806. icon,
  58807. tooltip: true,
  58808. isToggleable: true
  58809. } );
  58810. // Bind button model to command.
  58811. buttonView.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
  58812. // Execute command.
  58813. buttonView.on( 'execute', () => {
  58814. editor.execute( commandName );
  58815. editor.editing.view.focus();
  58816. } );
  58817. return buttonView;
  58818. } );
  58819. }
  58820. /**
  58821. * Returns a first list view element that is direct child of the given view element.
  58822. *
  58823. * @param {module:engine/view/element~Element} viewElement
  58824. * @return {module:engine/view/element~Element|null}
  58825. */
  58826. function findNestedList( viewElement ) {
  58827. for ( const node of viewElement.getChildren() ) {
  58828. if ( node.name == 'ul' || node.name == 'ol' ) {
  58829. return node;
  58830. }
  58831. }
  58832. return null;
  58833. }
  58834. /**
  58835. * Returns an array with all `listItem` elements that represents the same list.
  58836. *
  58837. * It means that values for `listIndent`, `listType`, and `listStyle` for all items are equal.
  58838. *
  58839. * @param {module:engine/model/position~Position} position Starting position.
  58840. * @param {'forward'|'backward'} direction Walking direction.
  58841. * @returns {Array.<module:engine/model/element~Element>}
  58842. */
  58843. function getSiblingNodes( position, direction ) {
  58844. const items = [];
  58845. const listItem = position.parent;
  58846. const walkerOptions = {
  58847. ignoreElementEnd: true,
  58848. startPosition: position,
  58849. shallow: true,
  58850. direction
  58851. };
  58852. const limitIndent = listItem.getAttribute( 'listIndent' );
  58853. const nodes = [ ...new _ckeditor_ckeditor5_engine_src_model_treewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( walkerOptions ) ]
  58854. .filter( value => value.item.is( 'element' ) )
  58855. .map( value => value.item );
  58856. for ( const element of nodes ) {
  58857. // If found something else than `listItem`, we're out of the list scope.
  58858. if ( !element.is( 'element', 'listItem' ) ) {
  58859. break;
  58860. }
  58861. // If current parsed item has lower indent that element that the element that was a starting point,
  58862. // it means we left a nested list. Abort searching items.
  58863. //
  58864. // ■ List item 1. [listIndent=0]
  58865. // ○ List item 2.[] [listIndent=1], limitIndent = 1,
  58866. // ○ List item 3. [listIndent=1]
  58867. // ■ List item 4. [listIndent=0]
  58868. //
  58869. // Abort searching when leave nested list.
  58870. if ( element.getAttribute( 'listIndent' ) < limitIndent ) {
  58871. break;
  58872. }
  58873. // ■ List item 1.[] [listIndent=0] limitIndent = 0,
  58874. // ○ List item 2. [listIndent=1]
  58875. // ○ List item 3. [listIndent=1]
  58876. // ■ List item 4. [listIndent=0]
  58877. //
  58878. // Ignore nested lists.
  58879. if ( element.getAttribute( 'listIndent' ) > limitIndent ) {
  58880. continue;
  58881. }
  58882. // ■ List item 1.[] [listType=bulleted]
  58883. // 1. List item 2. [listType=numbered]
  58884. // 2.List item 3. [listType=numbered]
  58885. //
  58886. // Abort searching when found a different kind of a list.
  58887. if ( element.getAttribute( 'listType' ) !== listItem.getAttribute( 'listType' ) ) {
  58888. break;
  58889. }
  58890. // ■ List item 1.[] [listType=bulleted]
  58891. // ■ List item 2. [listType=bulleted]
  58892. // ○ List item 3. [listType=bulleted]
  58893. // ○ List item 4. [listType=bulleted]
  58894. //
  58895. // Abort searching when found a different list style.
  58896. if ( element.getAttribute( 'listStyle' ) !== listItem.getAttribute( 'listStyle' ) ) {
  58897. break;
  58898. }
  58899. if ( direction === 'backward' ) {
  58900. items.unshift( element );
  58901. } else {
  58902. items.push( element );
  58903. }
  58904. }
  58905. return items;
  58906. }
  58907. // Implementation of getFillerOffset for view list item element.
  58908. //
  58909. // @returns {Number|null} Block filler offset or `null` if block filler is not needed.
  58910. function getListItemFillerOffset() {
  58911. const hasOnlyLists = !this.isEmpty && ( this.getChild( 0 ).name == 'ul' || this.getChild( 0 ).name == 'ol' );
  58912. if ( this.isEmpty || hasOnlyLists ) {
  58913. return 0;
  58914. }
  58915. return _ckeditor_ckeditor5_engine_src_view_containerelement__WEBPACK_IMPORTED_MODULE_0__["getFillerOffset"].call( this );
  58916. }
  58917. /***/ }),
  58918. /***/ "./node_modules/@ckeditor/ckeditor5-list/theme/icons/bulletedlist.svg":
  58919. /*!****************************************************************************!*\
  58920. !*** ./node_modules/@ckeditor/ckeditor5-list/theme/icons/bulletedlist.svg ***!
  58921. \****************************************************************************/
  58922. /*! exports provided: default */
  58923. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  58924. "use strict";
  58925. __webpack_require__.r(__webpack_exports__);
  58926. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M7 5.75c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zm-6 0C1 4.784 1.777 4 2.75 4c.966 0 1.75.777 1.75 1.75 0 .966-.777 1.75-1.75 1.75C1.784 7.5 1 6.723 1 5.75zm6 9c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zm-6 0c0-.966.777-1.75 1.75-1.75.966 0 1.75.777 1.75 1.75 0 .966-.777 1.75-1.75 1.75-.966 0-1.75-.777-1.75-1.75z\"/></svg>");
  58927. /***/ }),
  58928. /***/ "./node_modules/@ckeditor/ckeditor5-list/theme/icons/numberedlist.svg":
  58929. /*!****************************************************************************!*\
  58930. !*** ./node_modules/@ckeditor/ckeditor5-list/theme/icons/numberedlist.svg ***!
  58931. \****************************************************************************/
  58932. /*! exports provided: default */
  58933. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  58934. "use strict";
  58935. __webpack_require__.r(__webpack_exports__);
  58936. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M7 5.75c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM3.5 3v5H2V3.7H1v-1h2.5V3zM.343 17.857l2.59-3.257H2.92a.6.6 0 1 0-1.04 0H.302a2 2 0 1 1 3.995 0h-.001c-.048.405-.16.734-.333.988-.175.254-.59.692-1.244 1.312H4.3v1h-4l.043-.043zM7 14.75a.75.75 0 0 1 .75-.75h9.5a.75.75 0 1 1 0 1.5h-9.5a.75.75 0 0 1-.75-.75z\"/></svg>");
  58937. /***/ }),
  58938. /***/ "./node_modules/@ckeditor/ckeditor5-paragraph/src/insertparagraphcommand.js":
  58939. /*!**********************************************************************************!*\
  58940. !*** ./node_modules/@ckeditor/ckeditor5-paragraph/src/insertparagraphcommand.js ***!
  58941. \**********************************************************************************/
  58942. /*! exports provided: default */
  58943. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  58944. "use strict";
  58945. __webpack_require__.r(__webpack_exports__);
  58946. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InsertParagraphCommand; });
  58947. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  58948. /**
  58949. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  58950. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  58951. */
  58952. /**
  58953. * @module paragraph/insertparagraphcommand
  58954. */
  58955. /**
  58956. * The insert paragraph command. It inserts a new paragraph at a specific
  58957. * {@link module:engine/model/position~Position document position}.
  58958. *
  58959. * // Insert a new paragraph before an element in the document.
  58960. * editor.execute( 'insertParagraph', {
  58961. * position: editor.model.createPositionBefore( element )
  58962. * } );
  58963. *
  58964. * If a paragraph is disallowed in the context of the specific position, the command
  58965. * will attempt to split position ancestors to find a place where it is possible
  58966. * to insert a paragraph.
  58967. *
  58968. * **Note**: This command moves the selection to the inserted paragraph.
  58969. *
  58970. * @extends module:core/command~Command
  58971. */
  58972. class InsertParagraphCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  58973. /**
  58974. * Executes the command.
  58975. *
  58976. * @param {Object} options Options for the executed command.
  58977. * @param {module:engine/model/position~Position} options.position The model position at which
  58978. * the new paragraph will be inserted.
  58979. * @fires execute
  58980. */
  58981. execute( options ) {
  58982. const model = this.editor.model;
  58983. let position = options.position;
  58984. model.change( writer => {
  58985. const paragraph = writer.createElement( 'paragraph' );
  58986. if ( !model.schema.checkChild( position.parent, paragraph ) ) {
  58987. const allowedParent = model.schema.findAllowedParent( position, paragraph );
  58988. // It could be there's no ancestor limit that would allow paragraph.
  58989. // In theory, "paragraph" could be disallowed even in the "$root".
  58990. if ( !allowedParent ) {
  58991. return;
  58992. }
  58993. position = writer.split( position, allowedParent ).position;
  58994. }
  58995. model.insertContent( paragraph, position );
  58996. writer.setSelection( paragraph, 'in' );
  58997. } );
  58998. }
  58999. }
  59000. /***/ }),
  59001. /***/ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraph.js":
  59002. /*!*********************************************************************!*\
  59003. !*** ./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraph.js ***!
  59004. \*********************************************************************/
  59005. /*! exports provided: default */
  59006. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59007. "use strict";
  59008. __webpack_require__.r(__webpack_exports__);
  59009. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Paragraph; });
  59010. /* harmony import */ var _paragraphcommand__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./paragraphcommand */ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraphcommand.js");
  59011. /* harmony import */ var _insertparagraphcommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./insertparagraphcommand */ "./node_modules/@ckeditor/ckeditor5-paragraph/src/insertparagraphcommand.js");
  59012. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  59013. /**
  59014. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  59015. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  59016. */
  59017. /**
  59018. * @module paragraph/paragraph
  59019. */
  59020. /**
  59021. * The paragraph feature for the editor.
  59022. *
  59023. * It introduces the `<paragraph>` element in the model which renders as a `<p>` element in the DOM and data.
  59024. *
  59025. * It also brings two editors commands:
  59026. *
  59027. * * The {@link module:paragraph/paragraphcommand~ParagraphCommand `'paragraph'`} command that converts all
  59028. * blocks in the model selection into paragraphs.
  59029. * * The {@link module:paragraph/insertparagraphcommand~InsertParagraphCommand `'insertParagraph'`} command
  59030. * that inserts a new paragraph at a specified location in the model.
  59031. *
  59032. * @extends module:core/plugin~Plugin
  59033. */
  59034. class Paragraph extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_2__["default"] {
  59035. /**
  59036. * @inheritDoc
  59037. */
  59038. static get pluginName() {
  59039. return 'Paragraph';
  59040. }
  59041. /**
  59042. * @inheritDoc
  59043. */
  59044. init() {
  59045. const editor = this.editor;
  59046. const model = editor.model;
  59047. editor.commands.add( 'paragraph', new _paragraphcommand__WEBPACK_IMPORTED_MODULE_0__["default"]( editor ) );
  59048. editor.commands.add( 'insertParagraph', new _insertparagraphcommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor ) );
  59049. // Schema.
  59050. model.schema.register( 'paragraph', { inheritAllFrom: '$block' } );
  59051. editor.conversion.elementToElement( { model: 'paragraph', view: 'p' } );
  59052. // Conversion for paragraph-like elements which has not been converted by any plugin.
  59053. editor.conversion.for( 'upcast' ).elementToElement( {
  59054. model: ( viewElement, { writer } ) => {
  59055. if ( !Paragraph.paragraphLikeElements.has( viewElement.name ) ) {
  59056. return null;
  59057. }
  59058. // Do not auto-paragraph empty elements.
  59059. if ( viewElement.isEmpty ) {
  59060. return null;
  59061. }
  59062. return writer.createElement( 'paragraph' );
  59063. },
  59064. view: /.+/,
  59065. converterPriority: 'low'
  59066. } );
  59067. }
  59068. }
  59069. /**
  59070. * A list of element names which should be treated by the autoparagraphing algorithms as
  59071. * paragraph-like. This means that e.g. the following content:
  59072. *
  59073. * <h1>Foo</h1>
  59074. * <table>
  59075. * <tr>
  59076. * <td>X</td>
  59077. * <td>
  59078. * <ul>
  59079. * <li>Y</li>
  59080. * <li>Z</li>
  59081. * </ul>
  59082. * </td>
  59083. * </tr>
  59084. * </table>
  59085. *
  59086. * contains five paragraph-like elements: `<h1>`, two `<td>`s and two `<li>`s.
  59087. * Hence, if none of the features is going to convert those elements the above content will be automatically handled
  59088. * by the paragraph feature and converted to:
  59089. *
  59090. * <p>Foo</p>
  59091. * <p>X</p>
  59092. * <p>Y</p>
  59093. * <p>Z</p>
  59094. *
  59095. * Note: The `<td>` containing two `<li>` elements was ignored as the innermost paragraph-like elements
  59096. * have a priority upon conversion.
  59097. *
  59098. * @member {Set.<String>} module:paragraph/paragraph~Paragraph.paragraphLikeElements
  59099. */
  59100. Paragraph.paragraphLikeElements = new Set( [
  59101. 'blockquote',
  59102. 'dd',
  59103. 'div',
  59104. 'dt',
  59105. 'h1',
  59106. 'h2',
  59107. 'h3',
  59108. 'h4',
  59109. 'h5',
  59110. 'h6',
  59111. 'li',
  59112. 'p',
  59113. 'td',
  59114. 'th'
  59115. ] );
  59116. /***/ }),
  59117. /***/ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraphcommand.js":
  59118. /*!****************************************************************************!*\
  59119. !*** ./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraphcommand.js ***!
  59120. \****************************************************************************/
  59121. /*! exports provided: default */
  59122. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59123. "use strict";
  59124. __webpack_require__.r(__webpack_exports__);
  59125. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ParagraphCommand; });
  59126. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  59127. /* harmony import */ var _ckeditor_ckeditor5_utils_src_first__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/first */ "./node_modules/@ckeditor/ckeditor5-utils/src/first.js");
  59128. /**
  59129. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  59130. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  59131. */
  59132. /**
  59133. * @module paragraph/paragraphcommand
  59134. */
  59135. /**
  59136. * The paragraph command.
  59137. *
  59138. * @extends module:core/command~Command
  59139. */
  59140. class ParagraphCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  59141. /**
  59142. * The value of the command. Indicates whether the selection start is placed in a paragraph.
  59143. *
  59144. * @readonly
  59145. * @observable
  59146. * @member {Boolean} #value
  59147. */
  59148. /**
  59149. * @inheritDoc
  59150. */
  59151. refresh() {
  59152. const model = this.editor.model;
  59153. const document = model.document;
  59154. const block = Object(_ckeditor_ckeditor5_utils_src_first__WEBPACK_IMPORTED_MODULE_1__["default"])( document.selection.getSelectedBlocks() );
  59155. this.value = !!block && block.is( 'element', 'paragraph' );
  59156. this.isEnabled = !!block && checkCanBecomeParagraph( block, model.schema );
  59157. }
  59158. /**
  59159. * Executes the command. All the blocks (see {@link module:engine/model/schema~Schema}) in the selection
  59160. * will be turned to paragraphs.
  59161. *
  59162. * @fires execute
  59163. * @param {Object} [options] Options for the executed command.
  59164. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} [options.selection]
  59165. * The selection that the command should be applied to.
  59166. * By default, if not provided, the command is applied to the {@link module:engine/model/document~Document#selection}.
  59167. */
  59168. execute( options = {} ) {
  59169. const model = this.editor.model;
  59170. const document = model.document;
  59171. model.change( writer => {
  59172. const blocks = ( options.selection || document.selection ).getSelectedBlocks();
  59173. for ( const block of blocks ) {
  59174. if ( !block.is( 'element', 'paragraph' ) && checkCanBecomeParagraph( block, model.schema ) ) {
  59175. writer.rename( block, 'paragraph' );
  59176. }
  59177. }
  59178. } );
  59179. }
  59180. }
  59181. // Checks whether the given block can be replaced by a paragraph.
  59182. //
  59183. // @private
  59184. // @param {module:engine/model/element~Element} block A block to be tested.
  59185. // @param {module:engine/model/schema~Schema} schema The schema of the document.
  59186. // @returns {Boolean}
  59187. function checkCanBecomeParagraph( block, schema ) {
  59188. return schema.checkChild( block.parent, 'paragraph' ) && !schema.isObject( block );
  59189. }
  59190. /***/ }),
  59191. /***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/image.js":
  59192. /*!*********************************************************************************!*\
  59193. !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/image.js ***!
  59194. \*********************************************************************************/
  59195. /*! exports provided: replaceImagesSourceWithBase64, _convertHexToBase64 */
  59196. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59197. "use strict";
  59198. __webpack_require__.r(__webpack_exports__);
  59199. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "replaceImagesSourceWithBase64", function() { return replaceImagesSourceWithBase64; });
  59200. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_convertHexToBase64", function() { return _convertHexToBase64; });
  59201. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_matcher__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/matcher */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/matcher.js");
  59202. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_upcastwriter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/upcastwriter */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/upcastwriter.js");
  59203. /**
  59204. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  59205. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  59206. */
  59207. /**
  59208. * @module paste-from-office/filters/image
  59209. */
  59210. /* globals btoa */
  59211. /**
  59212. * Replaces source attribute of all `<img>` elements representing regular
  59213. * images (not the Word shapes) with inlined base64 image representation extracted from RTF or Blob data.
  59214. *
  59215. * @param {module:engine/view/documentfragment~DocumentFragment} documentFragment Document fragment on which transform images.
  59216. * @param {String} rtfData The RTF data from which images representation will be used.
  59217. */
  59218. function replaceImagesSourceWithBase64( documentFragment, rtfData ) {
  59219. if ( !documentFragment.childCount ) {
  59220. return;
  59221. }
  59222. const upcastWriter = new _ckeditor_ckeditor5_engine_src_view_upcastwriter__WEBPACK_IMPORTED_MODULE_1__["default"]();
  59223. const shapesIds = findAllShapesIds( documentFragment, upcastWriter );
  59224. removeAllImgElementsRepresentingShapes( shapesIds, documentFragment, upcastWriter );
  59225. removeAllShapeElements( documentFragment, upcastWriter );
  59226. const images = findAllImageElementsWithLocalSource( documentFragment, upcastWriter );
  59227. if ( images.length ) {
  59228. replaceImagesFileSourceWithInlineRepresentation( images, extractImageDataFromRtf( rtfData ), upcastWriter );
  59229. }
  59230. }
  59231. /**
  59232. * Converts given HEX string to base64 representation.
  59233. *
  59234. * @protected
  59235. * @param {String} hexString The HEX string to be converted.
  59236. * @returns {String} Base64 representation of a given HEX string.
  59237. */
  59238. function _convertHexToBase64( hexString ) {
  59239. return btoa( hexString.match( /\w{2}/g ).map( char => {
  59240. return String.fromCharCode( parseInt( char, 16 ) );
  59241. } ).join( '' ) );
  59242. }
  59243. // Finds all shapes (`<v:*>...</v:*>`) ids. Shapes can represent images (canvas)
  59244. // or Word shapes (which does not have RTF or Blob representation).
  59245. //
  59246. // @param {module:engine/view/documentfragment~DocumentFragment} documentFragment Document fragment
  59247. // from which to extract shape ids.
  59248. // @param {module:engine/view/upcastwriter~UpcastWriter} writer
  59249. // @returns {Array.<String>} Array of shape ids.
  59250. function findAllShapesIds( documentFragment, writer ) {
  59251. const range = writer.createRangeIn( documentFragment );
  59252. const shapeElementsMatcher = new _ckeditor_ckeditor5_engine_src_view_matcher__WEBPACK_IMPORTED_MODULE_0__["default"]( {
  59253. name: /v:(.+)/
  59254. } );
  59255. const shapesIds = [];
  59256. for ( const value of range ) {
  59257. const el = value.item;
  59258. const prevSiblingName = el.previousSibling && el.previousSibling.name || null;
  59259. // If shape element have 'o:gfxdata' attribute and is not directly before `<v:shapetype>` element it means it represent Word shape.
  59260. if ( shapeElementsMatcher.match( el ) && el.getAttribute( 'o:gfxdata' ) && prevSiblingName !== 'v:shapetype' ) {
  59261. shapesIds.push( value.item.getAttribute( 'id' ) );
  59262. }
  59263. }
  59264. return shapesIds;
  59265. }
  59266. // Removes all `<img>` elements which represents Word shapes and not regular images.
  59267. //
  59268. // @param {Array.<String>} shapesIds Shape ids which will be checked against `<img>` elements.
  59269. // @param {module:engine/view/documentfragment~DocumentFragment} documentFragment Document fragment from which to remove `<img>` elements.
  59270. // @param {module:engine/view/upcastwriter~UpcastWriter} writer
  59271. function removeAllImgElementsRepresentingShapes( shapesIds, documentFragment, writer ) {
  59272. const range = writer.createRangeIn( documentFragment );
  59273. const imageElementsMatcher = new _ckeditor_ckeditor5_engine_src_view_matcher__WEBPACK_IMPORTED_MODULE_0__["default"]( {
  59274. name: 'img'
  59275. } );
  59276. const imgs = [];
  59277. for ( const value of range ) {
  59278. if ( imageElementsMatcher.match( value.item ) ) {
  59279. const el = value.item;
  59280. const shapes = el.getAttribute( 'v:shapes' ) ? el.getAttribute( 'v:shapes' ).split( ' ' ) : [];
  59281. if ( shapes.length && shapes.every( shape => shapesIds.indexOf( shape ) > -1 ) ) {
  59282. imgs.push( el );
  59283. // Shapes may also have empty source while content is paste in some browsers (Safari).
  59284. } else if ( !el.getAttribute( 'src' ) ) {
  59285. imgs.push( el );
  59286. }
  59287. }
  59288. }
  59289. for ( const img of imgs ) {
  59290. writer.remove( img );
  59291. }
  59292. }
  59293. // Removes all shape elements (`<v:*>...</v:*>`) so they do not pollute the output structure.
  59294. //
  59295. // @param {module:engine/view/documentfragment~DocumentFragment} documentFragment Document fragment from which to remove shape elements.
  59296. // @param {module:engine/view/upcastwriter~UpcastWriter} writer
  59297. function removeAllShapeElements( documentFragment, writer ) {
  59298. const range = writer.createRangeIn( documentFragment );
  59299. const shapeElementsMatcher = new _ckeditor_ckeditor5_engine_src_view_matcher__WEBPACK_IMPORTED_MODULE_0__["default"]( {
  59300. name: /v:(.+)/
  59301. } );
  59302. const shapes = [];
  59303. for ( const value of range ) {
  59304. if ( shapeElementsMatcher.match( value.item ) ) {
  59305. shapes.push( value.item );
  59306. }
  59307. }
  59308. for ( const shape of shapes ) {
  59309. writer.remove( shape );
  59310. }
  59311. }
  59312. // Finds all `<img>` elements in a given document fragment which have source pointing to local `file://` resource.
  59313. //
  59314. // @param {module:engine/view/documentfragment~DocumentFragment} documentFragment Document fragment in which to look for `<img>` elements.
  59315. // @param {module:engine/view/upcastwriter~UpcastWriter} writer
  59316. // @returns {Object} result All found images grouped by source type.
  59317. // @returns {Array.<module:engine/view/element~Element>} result.file Array of found `<img>` elements with `file://` source.
  59318. // @returns {Array.<module:engine/view/element~Element>} result.blob Array of found `<img>` elements with `blob:` source.
  59319. function findAllImageElementsWithLocalSource( documentFragment, writer ) {
  59320. const range = writer.createRangeIn( documentFragment );
  59321. const imageElementsMatcher = new _ckeditor_ckeditor5_engine_src_view_matcher__WEBPACK_IMPORTED_MODULE_0__["default"]( {
  59322. name: 'img'
  59323. } );
  59324. const imgs = [];
  59325. for ( const value of range ) {
  59326. if ( imageElementsMatcher.match( value.item ) ) {
  59327. if ( value.item.getAttribute( 'src' ).startsWith( 'file://' ) ) {
  59328. imgs.push( value.item );
  59329. }
  59330. }
  59331. }
  59332. return imgs;
  59333. }
  59334. // Extracts all images HEX representations from a given RTF data.
  59335. //
  59336. // @param {String} rtfData The RTF data from which to extract images HEX representation.
  59337. // @returns {Array.<Object>} Array of found HEX representations. Each array item is an object containing:
  59338. //
  59339. // * {String} hex Image representation in HEX format.
  59340. // * {string} type Type of image, `image/png` or `image/jpeg`.
  59341. function extractImageDataFromRtf( rtfData ) {
  59342. if ( !rtfData ) {
  59343. return [];
  59344. }
  59345. const regexPictureHeader = /{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/;
  59346. const regexPicture = new RegExp( '(?:(' + regexPictureHeader.source + '))([\\da-fA-F\\s]+)\\}', 'g' );
  59347. const images = rtfData.match( regexPicture );
  59348. const result = [];
  59349. if ( images ) {
  59350. for ( const image of images ) {
  59351. let imageType = false;
  59352. if ( image.includes( '\\pngblip' ) ) {
  59353. imageType = 'image/png';
  59354. } else if ( image.includes( '\\jpegblip' ) ) {
  59355. imageType = 'image/jpeg';
  59356. }
  59357. if ( imageType ) {
  59358. result.push( {
  59359. hex: image.replace( regexPictureHeader, '' ).replace( /[^\da-fA-F]/g, '' ),
  59360. type: imageType
  59361. } );
  59362. }
  59363. }
  59364. }
  59365. return result;
  59366. }
  59367. // Replaces `src` attribute value of all given images with the corresponding base64 image representation.
  59368. //
  59369. // @param {Array.<module:engine/view/element~Element>} imageElements Array of image elements which will have its source replaced.
  59370. // @param {Array.<Object>} imagesHexSources Array of images hex sources (usually the result of `extractImageDataFromRtf()` function).
  59371. // The array should be the same length as `imageElements` parameter.
  59372. // @param {module:engine/view/upcastwriter~UpcastWriter} writer
  59373. function replaceImagesFileSourceWithInlineRepresentation( imageElements, imagesHexSources, writer ) {
  59374. // Assume there is an equal amount of image elements and images HEX sources so they can be matched accordingly based on existing order.
  59375. if ( imageElements.length === imagesHexSources.length ) {
  59376. for ( let i = 0; i < imageElements.length; i++ ) {
  59377. const newSrc = `data:${ imagesHexSources[ i ].type };base64,${ _convertHexToBase64( imagesHexSources[ i ].hex ) }`;
  59378. writer.setAttribute( 'src', newSrc, imageElements[ i ] );
  59379. }
  59380. }
  59381. }
  59382. /***/ }),
  59383. /***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/list.js":
  59384. /*!********************************************************************************!*\
  59385. !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/list.js ***!
  59386. \********************************************************************************/
  59387. /*! exports provided: transformListItemLikeElementsIntoLists, unwrapParagraphInListItem */
  59388. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59389. "use strict";
  59390. __webpack_require__.r(__webpack_exports__);
  59391. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformListItemLikeElementsIntoLists", function() { return transformListItemLikeElementsIntoLists; });
  59392. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unwrapParagraphInListItem", function() { return unwrapParagraphInListItem; });
  59393. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_matcher__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/matcher */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/matcher.js");
  59394. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_upcastwriter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/upcastwriter */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/upcastwriter.js");
  59395. /**
  59396. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  59397. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  59398. */
  59399. /**
  59400. * @module paste-from-office/filters/list
  59401. */
  59402. /**
  59403. * Transforms Word specific list-like elements to the semantic HTML lists.
  59404. *
  59405. * Lists in Word are represented by block elements with special attributes like:
  59406. *
  59407. * <p class=MsoListParagraphCxSpFirst style='mso-list:l1 level1 lfo1'>...</p> // Paragraph based list.
  59408. * <h1 style='mso-list:l0 level1 lfo1'>...</h1> // Heading 1 based list.
  59409. *
  59410. * @param {module:engine/view/documentfragment~DocumentFragment} documentFragment The view structure to be transformed.
  59411. * @param {String} stylesString Styles from which list-like elements styling will be extracted.
  59412. */
  59413. function transformListItemLikeElementsIntoLists( documentFragment, stylesString ) {
  59414. if ( !documentFragment.childCount ) {
  59415. return;
  59416. }
  59417. const writer = new _ckeditor_ckeditor5_engine_src_view_upcastwriter__WEBPACK_IMPORTED_MODULE_1__["default"]( documentFragment.document );
  59418. const itemLikeElements = findAllItemLikeElements( documentFragment, writer );
  59419. if ( !itemLikeElements.length ) {
  59420. return;
  59421. }
  59422. let currentList = null;
  59423. let currentIndentation = 1;
  59424. itemLikeElements.forEach( ( itemLikeElement, i ) => {
  59425. const isDifferentList = isNewListNeeded( itemLikeElements[ i - 1 ], itemLikeElement );
  59426. const previousItemLikeElement = isDifferentList ? null : itemLikeElements[ i - 1 ];
  59427. const indentationDifference = getIndentationDifference( previousItemLikeElement, itemLikeElement );
  59428. if ( isDifferentList ) {
  59429. currentList = null;
  59430. currentIndentation = 1;
  59431. }
  59432. if ( !currentList || indentationDifference !== 0 ) {
  59433. const listStyle = detectListStyle( itemLikeElement, stylesString );
  59434. if ( !currentList ) {
  59435. currentList = insertNewEmptyList( listStyle, itemLikeElement.element, writer );
  59436. } else if ( itemLikeElement.indent > currentIndentation ) {
  59437. const lastListItem = currentList.getChild( currentList.childCount - 1 );
  59438. const lastListItemChild = lastListItem.getChild( lastListItem.childCount - 1 );
  59439. currentList = insertNewEmptyList( listStyle, lastListItemChild, writer );
  59440. currentIndentation += 1;
  59441. } else if ( itemLikeElement.indent < currentIndentation ) {
  59442. const differentIndentation = currentIndentation - itemLikeElement.indent;
  59443. currentList = findParentListAtLevel( currentList, differentIndentation );
  59444. currentIndentation = parseInt( itemLikeElement.indent );
  59445. }
  59446. if ( itemLikeElement.indent <= currentIndentation ) {
  59447. if ( !currentList.is( 'element', listStyle.type ) ) {
  59448. currentList = writer.rename( listStyle.type, currentList );
  59449. }
  59450. }
  59451. }
  59452. const listItem = transformElementIntoListItem( itemLikeElement.element, writer );
  59453. writer.appendChild( listItem, currentList );
  59454. } );
  59455. }
  59456. /**
  59457. * Removes paragraph wrapping content inside a list item.
  59458. *
  59459. * @param {module:engine/view/documentfragment~DocumentFragment} documentFragment
  59460. * @param {module:engine/view/upcastwriter~UpcastWriter} writer
  59461. */
  59462. function unwrapParagraphInListItem( documentFragment, writer ) {
  59463. for ( const value of writer.createRangeIn( documentFragment ) ) {
  59464. const element = value.item;
  59465. if ( element.is( 'element', 'li' ) ) {
  59466. // Google Docs allows on single paragraph inside LI.
  59467. const firstChild = element.getChild( 0 );
  59468. if ( firstChild && firstChild.is( 'element', 'p' ) ) {
  59469. writer.unwrapElement( firstChild );
  59470. }
  59471. }
  59472. }
  59473. }
  59474. // Finds all list-like elements in a given document fragment.
  59475. //
  59476. // @param {module:engine/view/documentfragment~DocumentFragment} documentFragment Document fragment
  59477. // in which to look for list-like nodes.
  59478. // @param {module:engine/view/upcastwriter~UpcastWriter} writer
  59479. // @returns {Array.<Object>} Array of found list-like items. Each item is an object containing:
  59480. //
  59481. // * {module:engine/src/view/element~Element} element List-like element.
  59482. // * {Number} id List item id parsed from `mso-list` style (see `getListItemData()` function).
  59483. // * {Number} order List item creation order parsed from `mso-list` style (see `getListItemData()` function).
  59484. // * {Number} indent List item indentation level parsed from `mso-list` style (see `getListItemData()` function).
  59485. function findAllItemLikeElements( documentFragment, writer ) {
  59486. const range = writer.createRangeIn( documentFragment );
  59487. // Matcher for finding list-like elements.
  59488. const itemLikeElementsMatcher = new _ckeditor_ckeditor5_engine_src_view_matcher__WEBPACK_IMPORTED_MODULE_0__["default"]( {
  59489. name: /^p|h\d+$/,
  59490. styles: {
  59491. 'mso-list': /.*/
  59492. }
  59493. } );
  59494. const itemLikeElements = [];
  59495. for ( const value of range ) {
  59496. if ( value.type === 'elementStart' && itemLikeElementsMatcher.match( value.item ) ) {
  59497. const itemData = getListItemData( value.item );
  59498. itemLikeElements.push( {
  59499. element: value.item,
  59500. id: itemData.id,
  59501. order: itemData.order,
  59502. indent: itemData.indent
  59503. } );
  59504. }
  59505. }
  59506. return itemLikeElements;
  59507. }
  59508. // Extracts list item style from the provided CSS.
  59509. //
  59510. // List item style is extracted from CSS stylesheet. Each list with its specific style attribute
  59511. // value (`mso-list:l1 level1 lfo1`) has its dedicated properties in a CSS stylesheet defined with a selector like:
  59512. //
  59513. // @list l1:level1 { ... }
  59514. //
  59515. // It contains `mso-level-number-format` property which defines list numbering/bullet style. If this property
  59516. // is not defined it means default `decimal` numbering.
  59517. //
  59518. // Here CSS string representation is used as `mso-level-number-format` property is an invalid CSS property
  59519. // and will be removed during CSS parsing.
  59520. //
  59521. // @param {Object} listLikeItem List-like item for which list style will be searched for. Usually
  59522. // a result of `findAllItemLikeElements()` function.
  59523. // @param {String} stylesString CSS stylesheet.
  59524. // @returns {Object} result
  59525. // @returns {String} result.type List type, could be `ul` or `ol`.
  59526. // @returns {String} result.style List style, for example: `decimal`, `lower-roman`, etc. It is extracted
  59527. // directly from Word stylesheet without further processing and may be not compatible
  59528. // with CSS `list-style-type` property accepted values.
  59529. function detectListStyle( listLikeItem, stylesString ) {
  59530. const listStyleRegexp = new RegExp( `@list l${ listLikeItem.id }:level${ listLikeItem.indent }\\s*({[^}]*)`, 'gi' );
  59531. const listStyleTypeRegex = /mso-level-number-format:([^;]*);/gi;
  59532. const listStyleMatch = listStyleRegexp.exec( stylesString );
  59533. let listStyleType = 'decimal'; // Decimal is default one.
  59534. if ( listStyleMatch && listStyleMatch[ 1 ] ) {
  59535. const listStyleTypeMatch = listStyleTypeRegex.exec( listStyleMatch[ 1 ] );
  59536. if ( listStyleTypeMatch && listStyleTypeMatch[ 1 ] ) {
  59537. listStyleType = listStyleTypeMatch[ 1 ].trim();
  59538. }
  59539. }
  59540. return {
  59541. type: listStyleType !== 'bullet' && listStyleType !== 'image' ? 'ol' : 'ul',
  59542. style: listStyleType
  59543. };
  59544. }
  59545. // Creates empty list of a given type and inserts it after a specified element.
  59546. //
  59547. // @param {Object} listStyle List style object which determines the type of newly created list.
  59548. // Usually a result of `detectListStyle()` function.
  59549. // @param {module:engine/view/element~Element} element Element after which list is inserted.
  59550. // @param {module:engine/view/upcastwriter~UpcastWriter} writer
  59551. // @returns {module:engine/view/element~Element} Newly created list element.
  59552. function insertNewEmptyList( listStyle, element, writer ) {
  59553. const parent = element.parent;
  59554. const list = writer.createElement( listStyle.type );
  59555. const position = parent.getChildIndex( element ) + 1;
  59556. writer.insertChild( position, list, parent );
  59557. return list;
  59558. }
  59559. // Transforms given element into a semantic list item. As the function operates on a provided
  59560. // {module:engine/src/view/element~Element element} it will modify the view structure to which this element belongs.
  59561. //
  59562. // @param {module:engine/view/element~Element} element Element which will be transformed into list item.
  59563. // @param {module:engine/view/upcastwriter~UpcastWriter} writer
  59564. // @returns {module:engine/view/element~Element} New element to which the given one was transformed. It is
  59565. // inserted in place of the old element (the reference to the old element is lost due to renaming).
  59566. function transformElementIntoListItem( element, writer ) {
  59567. removeBulletElement( element, writer );
  59568. return writer.rename( 'li', element );
  59569. }
  59570. // Extracts list item information from Word specific list-like element style:
  59571. //
  59572. // `style="mso-list:l1 level1 lfo1"`
  59573. //
  59574. // where:
  59575. //
  59576. // * `l1` is a list id (however it does not mean this is a continuous list - see #43),
  59577. // * `level1` is a list item indentation level,
  59578. // * `lfo1` is a list insertion order in a document.
  59579. //
  59580. // @param {module:engine/view/element~Element} element Element from which style data is extracted.
  59581. // @returns {Object} result
  59582. // @returns {Number} result.id Parent list id.
  59583. // @returns {Number} result.order List item creation order.
  59584. // @returns {Number} result.indent List item indentation level.
  59585. function getListItemData( element ) {
  59586. const data = {};
  59587. const listStyle = element.getStyle( 'mso-list' );
  59588. if ( listStyle ) {
  59589. const idMatch = listStyle.match( /(^|\s+)l(\d+)/i );
  59590. const orderMatch = listStyle.match( /\s*lfo(\d+)/i );
  59591. const indentMatch = listStyle.match( /\s*level(\d+)/i );
  59592. if ( idMatch && orderMatch && indentMatch ) {
  59593. data.id = idMatch[ 2 ];
  59594. data.order = orderMatch[ 1 ];
  59595. data.indent = indentMatch[ 1 ];
  59596. }
  59597. }
  59598. return data;
  59599. }
  59600. // Removes span with a numbering/bullet from a given element.
  59601. //
  59602. // @param {module:engine/view/element~Element} element
  59603. // @param {module:engine/view/upcastwriter~UpcastWriter} writer
  59604. function removeBulletElement( element, writer ) {
  59605. // Matcher for finding `span` elements holding lists numbering/bullets.
  59606. const bulletMatcher = new _ckeditor_ckeditor5_engine_src_view_matcher__WEBPACK_IMPORTED_MODULE_0__["default"]( {
  59607. name: 'span',
  59608. styles: {
  59609. 'mso-list': 'Ignore'
  59610. }
  59611. } );
  59612. const range = writer.createRangeIn( element );
  59613. for ( const value of range ) {
  59614. if ( value.type === 'elementStart' && bulletMatcher.match( value.item ) ) {
  59615. writer.remove( value.item );
  59616. }
  59617. }
  59618. }
  59619. // Whether previous and current item belongs to the same list. It is determined based on `item.id`
  59620. // (extracted from `mso-list` style, see #getListItemData) and previous sibling of the current item.
  59621. //
  59622. // @param {Object} previousItem
  59623. // @param {Object} currentItem
  59624. // @returns {Boolean}
  59625. function isNewListNeeded( previousItem, currentItem ) {
  59626. if ( !previousItem ) {
  59627. return true;
  59628. }
  59629. if ( previousItem.id !== currentItem.id ) {
  59630. return true;
  59631. }
  59632. const previousSibling = currentItem.element.previousSibling;
  59633. if ( !previousSibling ) {
  59634. return true;
  59635. }
  59636. // Even with the same id the list does not have to be continuous (#43).
  59637. return !isList( previousSibling );
  59638. }
  59639. function isList( element ) {
  59640. return element.is( 'element', 'ol' ) || element.is( 'element', 'ul' );
  59641. }
  59642. // Calculates the indentation difference between two given list items (based on indent attribute
  59643. // extracted from `mso-list` style, see #getListItemData).
  59644. //
  59645. // @param {Object} previousItem
  59646. // @param {Object} currentItem
  59647. // @returns {Number}
  59648. function getIndentationDifference( previousItem, currentItem ) {
  59649. return previousItem ? currentItem.indent - previousItem.indent : currentItem.indent - 1;
  59650. }
  59651. // Finds parent list element (ul/ol) of a given list element with indentation level lower by a given value.
  59652. //
  59653. // @param {module:engine/view/element~Element} listElement List element from which to start looking for a parent list.
  59654. // @param {Number} indentationDifference Indentation difference between lists.
  59655. // @returns {module:engine/view/element~Element} Found list element with indentation level lower by a given value.
  59656. function findParentListAtLevel( listElement, indentationDifference ) {
  59657. const ancestors = listElement.getAncestors( { parentFirst: true } );
  59658. let parentList = null;
  59659. let levelChange = 0;
  59660. for ( const ancestor of ancestors ) {
  59661. if ( ancestor.name === 'ul' || ancestor.name === 'ol' ) {
  59662. levelChange++;
  59663. }
  59664. if ( levelChange === indentationDifference ) {
  59665. parentList = ancestor;
  59666. break;
  59667. }
  59668. }
  59669. return parentList;
  59670. }
  59671. /***/ }),
  59672. /***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/parse.js":
  59673. /*!*********************************************************************************!*\
  59674. !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/parse.js ***!
  59675. \*********************************************************************************/
  59676. /*! exports provided: parseHtml */
  59677. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59678. "use strict";
  59679. __webpack_require__.r(__webpack_exports__);
  59680. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseHtml", function() { return parseHtml; });
  59681. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_domconverter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/domconverter */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/domconverter.js");
  59682. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_document__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/document */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/document.js");
  59683. /* harmony import */ var _space__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./space */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/space.js");
  59684. /**
  59685. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  59686. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  59687. */
  59688. /**
  59689. * @module paste-from-office/filters/parse
  59690. */
  59691. /* globals DOMParser */
  59692. /**
  59693. * Parses provided HTML extracting contents of `<body>` and `<style>` tags.
  59694. *
  59695. * @param {String} htmlString HTML string to be parsed.
  59696. * @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor
  59697. * @returns {Object} result
  59698. * @returns {module:engine/view/documentfragment~DocumentFragment} result.body Parsed body
  59699. * content as a traversable structure.
  59700. * @returns {String} result.bodyString Entire body content as a string.
  59701. * @returns {Array.<CSSStyleSheet>} result.styles Array of native `CSSStyleSheet` objects, each representing
  59702. * separate `style` tag from the source HTML.
  59703. * @returns {String} result.stylesString All `style` tags contents combined in the order of occurrence into one string.
  59704. */
  59705. function parseHtml( htmlString, stylesProcessor ) {
  59706. const domParser = new DOMParser();
  59707. // Remove Word specific "if comments" so content inside is not omitted by the parser.
  59708. htmlString = htmlString.replace( /<!--\[if gte vml 1]>/g, '' );
  59709. const normalizedHtml = Object(_space__WEBPACK_IMPORTED_MODULE_2__["normalizeSpacing"])( cleanContentAfterBody( htmlString ) );
  59710. // Parse htmlString as native Document object.
  59711. const htmlDocument = domParser.parseFromString( normalizedHtml, 'text/html' );
  59712. Object(_space__WEBPACK_IMPORTED_MODULE_2__["normalizeSpacerunSpans"])( htmlDocument );
  59713. // Get `innerHTML` first as transforming to View modifies the source document.
  59714. const bodyString = htmlDocument.body.innerHTML;
  59715. // Transform document.body to View.
  59716. const bodyView = documentToView( htmlDocument, stylesProcessor );
  59717. // Extract stylesheets.
  59718. const stylesObject = extractStyles( htmlDocument );
  59719. return {
  59720. body: bodyView,
  59721. bodyString,
  59722. styles: stylesObject.styles,
  59723. stylesString: stylesObject.stylesString
  59724. };
  59725. }
  59726. // Transforms native `Document` object into {@link module:engine/view/documentfragment~DocumentFragment}.
  59727. //
  59728. // @param {Document} htmlDocument Native `Document` object to be transformed.
  59729. // @param {module:engine/view/stylesmap~StylesProcessor} stylesProcessor
  59730. // @returns {module:engine/view/documentfragment~DocumentFragment}
  59731. function documentToView( htmlDocument, stylesProcessor ) {
  59732. const viewDocument = new _ckeditor_ckeditor5_engine_src_view_document__WEBPACK_IMPORTED_MODULE_1__["default"]( stylesProcessor );
  59733. const domConverter = new _ckeditor_ckeditor5_engine_src_view_domconverter__WEBPACK_IMPORTED_MODULE_0__["default"]( viewDocument, { blockFillerMode: 'nbsp' } );
  59734. const fragment = htmlDocument.createDocumentFragment();
  59735. const nodes = htmlDocument.body.childNodes;
  59736. while ( nodes.length > 0 ) {
  59737. fragment.appendChild( nodes[ 0 ] );
  59738. }
  59739. return domConverter.domToView( fragment );
  59740. }
  59741. // Extracts both `CSSStyleSheet` and string representation from all `style` elements available in a provided `htmlDocument`.
  59742. //
  59743. // @param {Document} htmlDocument Native `Document` object from which styles will be extracted.
  59744. // @returns {Object} result
  59745. // @returns {Array.<CSSStyleSheet>} result.styles Array of native `CSSStyleSheet` object, each representing
  59746. // separate `style` tag from the source object.
  59747. // @returns {String} result.stylesString All `style` tags contents combined in the order of occurrence as one string.
  59748. function extractStyles( htmlDocument ) {
  59749. const styles = [];
  59750. const stylesString = [];
  59751. const styleTags = Array.from( htmlDocument.getElementsByTagName( 'style' ) );
  59752. for ( const style of styleTags ) {
  59753. if ( style.sheet && style.sheet.cssRules && style.sheet.cssRules.length ) {
  59754. styles.push( style.sheet );
  59755. stylesString.push( style.innerHTML );
  59756. }
  59757. }
  59758. return {
  59759. styles,
  59760. stylesString: stylesString.join( ' ' )
  59761. };
  59762. }
  59763. // Removes leftover content from between closing </body> and closing </html> tag:
  59764. //
  59765. // <html><body><p>Foo Bar</p></body><span>Fo</span></html> -> <html><body><p>Foo Bar</p></body></html>
  59766. //
  59767. // This function is used as specific browsers (Edge) add some random content after `body` tag when pasting from Word.
  59768. // @param {String} htmlString The HTML string to be cleaned.
  59769. // @returns {String} The HTML string with leftover content removed.
  59770. function cleanContentAfterBody( htmlString ) {
  59771. const regexp = /<\/body>(.*?)(<\/html>|$)/;
  59772. const match = htmlString.match( regexp );
  59773. if ( match && match[ 1 ] ) {
  59774. htmlString = htmlString.slice( 0, match.index ) + htmlString.slice( match.index ).replace( match[ 1 ], '' );
  59775. }
  59776. return htmlString;
  59777. }
  59778. /***/ }),
  59779. /***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/removeboldwrapper.js":
  59780. /*!*********************************************************************************************!*\
  59781. !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/removeboldwrapper.js ***!
  59782. \*********************************************************************************************/
  59783. /*! exports provided: default */
  59784. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59785. "use strict";
  59786. __webpack_require__.r(__webpack_exports__);
  59787. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return removeBoldWrapper; });
  59788. /**
  59789. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  59790. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  59791. */
  59792. /**
  59793. * @module paste-from-office/filters/removeboldwrapper
  59794. */
  59795. /**
  59796. * Removes `<b>` tag wrapper added by Google Docs to a copied content.
  59797. *
  59798. * @param {module:engine/view/documentfragment~DocumentFragment} documentFragment element `data.content` obtained from clipboard
  59799. * @param {module:engine/view/upcastwriter~UpcastWriter} writer
  59800. */
  59801. function removeBoldWrapper( documentFragment, writer ) {
  59802. for ( const child of documentFragment.getChildren() ) {
  59803. if ( child.is( 'element', 'b' ) && child.getStyle( 'font-weight' ) === 'normal' ) {
  59804. const childIndex = documentFragment.getChildIndex( child );
  59805. writer.remove( child );
  59806. writer.insertChild( childIndex, child.getChildren(), documentFragment );
  59807. }
  59808. }
  59809. }
  59810. /***/ }),
  59811. /***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/space.js":
  59812. /*!*********************************************************************************!*\
  59813. !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/space.js ***!
  59814. \*********************************************************************************/
  59815. /*! exports provided: normalizeSpacing, normalizeSpacerunSpans */
  59816. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59817. "use strict";
  59818. __webpack_require__.r(__webpack_exports__);
  59819. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeSpacing", function() { return normalizeSpacing; });
  59820. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeSpacerunSpans", function() { return normalizeSpacerunSpans; });
  59821. /**
  59822. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  59823. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  59824. */
  59825. /**
  59826. * @module paste-from-office/filters/space
  59827. */
  59828. /**
  59829. * Replaces last space preceding elements closing tag with `&nbsp;`. Such operation prevents spaces from being removed
  59830. * during further DOM/View processing (see especially {@link module:engine/view/domconverter~DomConverter#_processDataFromDomText}).
  59831. * This method also takes into account Word specific `<o:p></o:p>` empty tags.
  59832. * Additionally multiline sequences of spaces and new lines between tags are removed (see #39 and #40).
  59833. *
  59834. * @param {String} htmlString HTML string in which spacing should be normalized.
  59835. * @returns {String} Input HTML with spaces normalized.
  59836. */
  59837. function normalizeSpacing( htmlString ) {
  59838. // Run normalizeSafariSpaceSpans() two times to cover nested spans.
  59839. return normalizeSafariSpaceSpans( normalizeSafariSpaceSpans( htmlString ) )
  59840. // Remove all \r\n from "spacerun spans" so the last replace line doesn't strip all whitespaces.
  59841. .replace( /(<span\s+style=['"]mso-spacerun:yes['"]>[\s]*?)[\r\n]+(\s*<\/span>)/g, '$1$2' )
  59842. .replace( /<span\s+style=['"]mso-spacerun:yes['"]><\/span>/g, '' )
  59843. .replace( / <\//g, '\u00A0</' )
  59844. .replace( / <o:p><\/o:p>/g, '\u00A0<o:p></o:p>' )
  59845. // Remove <o:p> block filler from empty paragraph. Safari uses \u00A0 instead of &nbsp;.
  59846. .replace( /<o:p>(&nbsp;|\u00A0)<\/o:p>/g, '' )
  59847. // Remove all whitespaces when they contain any \r or \n.
  59848. .replace( />(\s*[\r\n]\s*)</g, '><' );
  59849. }
  59850. /**
  59851. * Normalizes spacing in special Word `spacerun spans` (`<span style='mso-spacerun:yes'>\s+</span>`) by replacing
  59852. * all spaces with `&nbsp; ` pairs. This prevents spaces from being removed during further DOM/View processing
  59853. * (see especially {@link module:engine/view/domconverter~DomConverter#_processDataFromDomText}).
  59854. *
  59855. * @param {Document} htmlDocument Native `Document` object in which spacing should be normalized.
  59856. */
  59857. function normalizeSpacerunSpans( htmlDocument ) {
  59858. htmlDocument.querySelectorAll( 'span[style*=spacerun]' ).forEach( el => {
  59859. const innerTextLength = el.innerText.length || 0;
  59860. el.innerHTML = Array( innerTextLength + 1 ).join( '\u00A0 ' ).substr( 0, innerTextLength );
  59861. } );
  59862. }
  59863. // Normalizes specific spacing generated by Safari when content pasted from Word (`<span class="Apple-converted-space"> </span>`)
  59864. // by replacing all spaces sequences longer than 1 space with `&nbsp; ` pairs. This prevents spaces from being removed during
  59865. // further DOM/View processing (see especially {@link module:engine/view/domconverter~DomConverter#_processDataFromDomText}).
  59866. //
  59867. // This function is similar to {@link module:clipboard/utils/normalizeclipboarddata normalizeClipboardData util} but uses
  59868. // regular spaces / &nbsp; sequence for replacement.
  59869. //
  59870. // @param {String} htmlString HTML string in which spacing should be normalized
  59871. // @returns {String} Input HTML with spaces normalized.
  59872. function normalizeSafariSpaceSpans( htmlString ) {
  59873. return htmlString.replace( /<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g, ( fullMatch, spaces ) => {
  59874. return spaces.length === 1 ? ' ' : Array( spaces.length + 1 ).join( '\u00A0 ' ).substr( 0, spaces.length );
  59875. } );
  59876. }
  59877. /***/ }),
  59878. /***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/googledocsnormalizer.js":
  59879. /*!****************************************************************************************************!*\
  59880. !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/googledocsnormalizer.js ***!
  59881. \****************************************************************************************************/
  59882. /*! exports provided: default */
  59883. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59884. "use strict";
  59885. __webpack_require__.r(__webpack_exports__);
  59886. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return GoogleDocsNormalizer; });
  59887. /* harmony import */ var _filters_removeboldwrapper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../filters/removeboldwrapper */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/removeboldwrapper.js");
  59888. /* harmony import */ var _filters_list__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../filters/list */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/list.js");
  59889. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_upcastwriter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/upcastwriter */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/upcastwriter.js");
  59890. /**
  59891. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  59892. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  59893. */
  59894. /**
  59895. * @module paste-from-office/normalizers/googledocsnormalizer
  59896. */
  59897. const googleDocsMatch = /id=("|')docs-internal-guid-[-0-9a-f]+("|')/i;
  59898. /**
  59899. * Normalizer for the content pasted from Google Docs.
  59900. *
  59901. * @implements module:paste-from-office/normalizer~Normalizer
  59902. */
  59903. class GoogleDocsNormalizer {
  59904. /**
  59905. * Creates a new `GoogleDocsNormalizer` instance.
  59906. *
  59907. * @param {module:engine/view/document~Document} document View document.
  59908. */
  59909. constructor( document ) {
  59910. /**
  59911. * @readonly
  59912. * @type {module:engine/view/document~Document}
  59913. */
  59914. this.document = document;
  59915. }
  59916. /**
  59917. * @inheritDoc
  59918. */
  59919. isActive( htmlString ) {
  59920. return googleDocsMatch.test( htmlString );
  59921. }
  59922. /**
  59923. * @inheritDoc
  59924. */
  59925. execute( data ) {
  59926. const writer = new _ckeditor_ckeditor5_engine_src_view_upcastwriter__WEBPACK_IMPORTED_MODULE_2__["default"]( this.document );
  59927. Object(_filters_removeboldwrapper__WEBPACK_IMPORTED_MODULE_0__["default"])( data.content, writer );
  59928. Object(_filters_list__WEBPACK_IMPORTED_MODULE_1__["unwrapParagraphInListItem"])( data.content, writer );
  59929. }
  59930. }
  59931. /***/ }),
  59932. /***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/mswordnormalizer.js":
  59933. /*!************************************************************************************************!*\
  59934. !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/mswordnormalizer.js ***!
  59935. \************************************************************************************************/
  59936. /*! exports provided: default */
  59937. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59938. "use strict";
  59939. __webpack_require__.r(__webpack_exports__);
  59940. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MSWordNormalizer; });
  59941. /* harmony import */ var _filters_parse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../filters/parse */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/parse.js");
  59942. /* harmony import */ var _filters_list__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../filters/list */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/list.js");
  59943. /* harmony import */ var _filters_image__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../filters/image */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/image.js");
  59944. /**
  59945. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  59946. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  59947. */
  59948. /**
  59949. * @module paste-from-office/normalizers/mswordnormalizer
  59950. */
  59951. const msWordMatch1 = /<meta\s*name="?generator"?\s*content="?microsoft\s*word\s*\d+"?\/?>/i;
  59952. const msWordMatch2 = /xmlns:o="urn:schemas-microsoft-com/i;
  59953. /**
  59954. * Normalizer for the content pasted from Microsoft Word.
  59955. *
  59956. * @implements module:paste-from-office/normalizer~Normalizer
  59957. */
  59958. class MSWordNormalizer {
  59959. /**
  59960. * Creates a new `MSWordNormalizer` instance.
  59961. *
  59962. * @param {module:engine/view/document~Document} document View document.
  59963. */
  59964. constructor( document ) {
  59965. /**
  59966. * @readonly
  59967. * @type {module:engine/view/document~Document}
  59968. */
  59969. this.document = document;
  59970. }
  59971. /**
  59972. * @inheritDoc
  59973. */
  59974. isActive( htmlString ) {
  59975. return msWordMatch1.test( htmlString ) || msWordMatch2.test( htmlString );
  59976. }
  59977. /**
  59978. * @inheritDoc
  59979. */
  59980. execute( data ) {
  59981. const { body, stylesString } = Object(_filters_parse__WEBPACK_IMPORTED_MODULE_0__["parseHtml"])( data.dataTransfer.getData( 'text/html' ), this.document.stylesProcessor );
  59982. Object(_filters_list__WEBPACK_IMPORTED_MODULE_1__["transformListItemLikeElementsIntoLists"])( body, stylesString );
  59983. Object(_filters_image__WEBPACK_IMPORTED_MODULE_2__["replaceImagesSourceWithBase64"])( body, data.dataTransfer.getData( 'text/rtf' ) );
  59984. data.content = body;
  59985. }
  59986. }
  59987. /***/ }),
  59988. /***/ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice.js":
  59989. /*!***********************************************************************************!*\
  59990. !*** ./node_modules/@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice.js ***!
  59991. \***********************************************************************************/
  59992. /*! exports provided: default */
  59993. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59994. "use strict";
  59995. __webpack_require__.r(__webpack_exports__);
  59996. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return PasteFromOffice; });
  59997. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  59998. /* harmony import */ var _normalizers_googledocsnormalizer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./normalizers/googledocsnormalizer */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/googledocsnormalizer.js");
  59999. /* harmony import */ var _normalizers_mswordnormalizer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./normalizers/mswordnormalizer */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/mswordnormalizer.js");
  60000. /* harmony import */ var _ckeditor_ckeditor5_clipboard_src_clipboard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-clipboard/src/clipboard */ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboard.js");
  60001. /**
  60002. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  60003. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  60004. */
  60005. /**
  60006. * @module paste-from-office/pastefromoffice
  60007. */
  60008. /**
  60009. * The Paste from Office plugin.
  60010. *
  60011. * This plugin handles content pasted from Office apps and transforms it (if necessary)
  60012. * to a valid structure which can then be understood by the editor features.
  60013. *
  60014. * Transformation is made by a set of predefined {@link module:paste-from-office/normalizer~Normalizer normalizers}.
  60015. * This plugin includes following normalizers:
  60016. * * {@link module:paste-from-office/normalizers/mswordnormalizer~MSWordNormalizer Microsoft Word normalizer}
  60017. * * {@link module:paste-from-office/normalizers/googledocsnormalizer~GoogleDocsNormalizer Google Docs normalizer}
  60018. *
  60019. * For more information about this feature check the {@glink api/paste-from-office package page}.
  60020. *
  60021. * @extends module:core/plugin~Plugin
  60022. */
  60023. class PasteFromOffice extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  60024. /**
  60025. * @inheritDoc
  60026. */
  60027. static get pluginName() {
  60028. return 'PasteFromOffice';
  60029. }
  60030. /**
  60031. * @inheritDoc
  60032. */
  60033. static get requires() {
  60034. return [ _ckeditor_ckeditor5_clipboard_src_clipboard__WEBPACK_IMPORTED_MODULE_3__["default"] ];
  60035. }
  60036. /**
  60037. * @inheritDoc
  60038. */
  60039. init() {
  60040. const editor = this.editor;
  60041. const viewDocument = editor.editing.view.document;
  60042. const normalizers = [];
  60043. normalizers.push( new _normalizers_mswordnormalizer__WEBPACK_IMPORTED_MODULE_2__["default"]( viewDocument ) );
  60044. normalizers.push( new _normalizers_googledocsnormalizer__WEBPACK_IMPORTED_MODULE_1__["default"]( viewDocument ) );
  60045. editor.plugins.get( 'Clipboard' ).on(
  60046. 'inputTransformation',
  60047. ( evt, data ) => {
  60048. if ( data.isTransformedWithPasteFromOffice ) {
  60049. return;
  60050. }
  60051. const htmlString = data.dataTransfer.getData( 'text/html' );
  60052. const activeNormalizer = normalizers.find( normalizer => normalizer.isActive( htmlString ) );
  60053. if ( activeNormalizer ) {
  60054. activeNormalizer.execute( data );
  60055. data.isTransformedWithPasteFromOffice = true;
  60056. }
  60057. },
  60058. { priority: 'high' }
  60059. );
  60060. }
  60061. }
  60062. /***/ }),
  60063. /***/ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectall.js":
  60064. /*!**********************************************************************!*\
  60065. !*** ./node_modules/@ckeditor/ckeditor5-select-all/src/selectall.js ***!
  60066. \**********************************************************************/
  60067. /*! exports provided: default */
  60068. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60069. "use strict";
  60070. __webpack_require__.r(__webpack_exports__);
  60071. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SelectAll; });
  60072. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  60073. /* harmony import */ var _selectallediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./selectallediting */ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectallediting.js");
  60074. /* harmony import */ var _selectallui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./selectallui */ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectallui.js");
  60075. /**
  60076. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  60077. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  60078. */
  60079. /**
  60080. * @module select-all/selectall
  60081. */
  60082. /**
  60083. * The select all feature.
  60084. *
  60085. * This is a "glue" plugin which loads the {@link module:select-all/selectallediting~SelectAllEditing select all editing feature}
  60086. * and the {@link module:select-all/selectallui~SelectAllUI select all UI feature}.
  60087. *
  60088. * Please refer to the documentation of individual features to learn more.
  60089. *
  60090. * @extends module:core/plugin~Plugin
  60091. */
  60092. class SelectAll extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  60093. /**
  60094. * @inheritDoc
  60095. */
  60096. static get requires() {
  60097. return [ _selectallediting__WEBPACK_IMPORTED_MODULE_1__["default"], _selectallui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  60098. }
  60099. /**
  60100. * @inheritDoc
  60101. */
  60102. static get pluginName() {
  60103. return 'SelectAll';
  60104. }
  60105. }
  60106. /***/ }),
  60107. /***/ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectallcommand.js":
  60108. /*!*****************************************************************************!*\
  60109. !*** ./node_modules/@ckeditor/ckeditor5-select-all/src/selectallcommand.js ***!
  60110. \*****************************************************************************/
  60111. /*! exports provided: default */
  60112. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60113. "use strict";
  60114. __webpack_require__.r(__webpack_exports__);
  60115. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SelectAllCommand; });
  60116. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  60117. /**
  60118. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  60119. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  60120. */
  60121. /**
  60122. * @module select-all/selectallcommand
  60123. */
  60124. /**
  60125. * The select all command.
  60126. *
  60127. * It is used by the {@link module:select-all/selectallediting~SelectAllEditing select all editing feature} to handle
  60128. * the <kbd>Ctrl/⌘</kbd>+<kbd>A</kbd> keystroke.
  60129. *
  60130. * Executing this command changes the {@glink framework/guides/architecture/editing-engine#model model}
  60131. * selection so it contains the entire content of the editable root of the editor the selection is
  60132. * {@link module:engine/model/selection~Selection#anchor anchored} in.
  60133. *
  60134. * If the selection was anchored in a {@glink framework/guides/tutorials/implementing-a-block-widget nested editable}
  60135. * (e.g. a caption of an image), the new selection will contain its entire content. Successive executions of this command
  60136. * will expand the selection to encompass more and more content up to the entire editable root of the editor.
  60137. *
  60138. * @extends module:core/command~Command
  60139. */
  60140. class SelectAllCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  60141. /**
  60142. * @inheritDoc
  60143. */
  60144. execute() {
  60145. const model = this.editor.model;
  60146. const selection = model.document.selection;
  60147. let scopeElement = model.schema.getLimitElement( selection );
  60148. // If an entire scope is selected, or the selection's ancestor is not a scope yet,
  60149. // browse through ancestors to find the enclosing parent scope.
  60150. if ( selection.containsEntireContent( scopeElement ) || !isSelectAllScope( model.schema, scopeElement ) ) {
  60151. do {
  60152. scopeElement = scopeElement.parent;
  60153. // Do nothing, if the entire `root` is already selected.
  60154. if ( !scopeElement ) {
  60155. return;
  60156. }
  60157. } while ( !isSelectAllScope( model.schema, scopeElement ) );
  60158. }
  60159. model.change( writer => {
  60160. writer.setSelection( scopeElement, 'in' );
  60161. } );
  60162. }
  60163. }
  60164. // Checks whether the element is a valid select-all scope.
  60165. // Returns true, if the element is a {@link module:engine/model/schema~Schema#isLimit limit},
  60166. // and can contain any text or paragraph.
  60167. //
  60168. // @param {module:engine/model/schema~Schema} schema The schema to check against.
  60169. // @param {module:engine/model/element~Element} element
  60170. // @return {Boolean}
  60171. function isSelectAllScope( schema, element ) {
  60172. return schema.isLimit( element ) && ( schema.checkChild( element, '$text' ) || schema.checkChild( element, 'paragraph' ) );
  60173. }
  60174. /***/ }),
  60175. /***/ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectallediting.js":
  60176. /*!*****************************************************************************!*\
  60177. !*** ./node_modules/@ckeditor/ckeditor5-select-all/src/selectallediting.js ***!
  60178. \*****************************************************************************/
  60179. /*! exports provided: default */
  60180. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60181. "use strict";
  60182. __webpack_require__.r(__webpack_exports__);
  60183. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SelectAllEditing; });
  60184. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  60185. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
  60186. /* harmony import */ var _selectallcommand__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./selectallcommand */ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectallcommand.js");
  60187. /**
  60188. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  60189. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  60190. */
  60191. /**
  60192. * @module select-all/selectallediting
  60193. */
  60194. const SELECT_ALL_KEYSTROKE = Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_1__["parseKeystroke"])( 'Ctrl+A' );
  60195. /**
  60196. * The select all editing feature.
  60197. *
  60198. * It registers the `'selectAll'` {@link module:select-all/selectallcommand~SelectAllCommand command}
  60199. * and the <kbd>Ctrl/⌘</kbd>+<kbd>A</kbd> keystroke listener which executes it.
  60200. *
  60201. * @extends module:core/plugin~Plugin
  60202. */
  60203. class SelectAllEditing extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  60204. /**
  60205. * @inheritDoc
  60206. */
  60207. static get pluginName() {
  60208. return 'SelectAllEditing';
  60209. }
  60210. /**
  60211. * @inheritDoc
  60212. */
  60213. init() {
  60214. const editor = this.editor;
  60215. const view = editor.editing.view;
  60216. const viewDocument = view.document;
  60217. editor.commands.add( 'selectAll', new _selectallcommand__WEBPACK_IMPORTED_MODULE_2__["default"]( editor ) );
  60218. this.listenTo( viewDocument, 'keydown', ( eventInfo, domEventData ) => {
  60219. if ( Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_1__["getCode"])( domEventData ) === SELECT_ALL_KEYSTROKE ) {
  60220. editor.execute( 'selectAll' );
  60221. domEventData.preventDefault();
  60222. }
  60223. } );
  60224. }
  60225. }
  60226. /***/ }),
  60227. /***/ "./node_modules/@ckeditor/ckeditor5-select-all/src/selectallui.js":
  60228. /*!************************************************************************!*\
  60229. !*** ./node_modules/@ckeditor/ckeditor5-select-all/src/selectallui.js ***!
  60230. \************************************************************************/
  60231. /*! exports provided: default */
  60232. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60233. "use strict";
  60234. __webpack_require__.r(__webpack_exports__);
  60235. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SelectAllUI; });
  60236. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  60237. /* harmony import */ var _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  60238. /* harmony import */ var _theme_icons_select_all_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../theme/icons/select-all.svg */ "./node_modules/@ckeditor/ckeditor5-select-all/theme/icons/select-all.svg");
  60239. /**
  60240. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  60241. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  60242. */
  60243. /**
  60244. * @module select-all/selectallui
  60245. */
  60246. /**
  60247. * The select all UI feature.
  60248. *
  60249. * It registers the `'selectAll'` UI button in the editor's
  60250. * {@link module:ui/componentfactory~ComponentFactory component factory}. When clicked, the button
  60251. * executes the {@link module:select-all/selectallcommand~SelectAllCommand select all command}.
  60252. *
  60253. * @extends module:core/plugin~Plugin
  60254. */
  60255. class SelectAllUI extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  60256. /**
  60257. * @inheritDoc
  60258. */
  60259. static get pluginName() {
  60260. return 'SelectAllUI';
  60261. }
  60262. /**
  60263. * @inheritDoc
  60264. */
  60265. init() {
  60266. const editor = this.editor;
  60267. editor.ui.componentFactory.add( 'selectAll', locale => {
  60268. const command = editor.commands.get( 'selectAll' );
  60269. const view = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__["default"]( locale );
  60270. const t = locale.t;
  60271. view.set( {
  60272. label: t( 'Select all' ),
  60273. icon: _theme_icons_select_all_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  60274. keystroke: 'Ctrl+A',
  60275. tooltip: true
  60276. } );
  60277. view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
  60278. // Execute the command.
  60279. this.listenTo( view, 'execute', () => {
  60280. editor.execute( 'selectAll' );
  60281. editor.editing.view.focus();
  60282. } );
  60283. return view;
  60284. } );
  60285. }
  60286. }
  60287. /***/ }),
  60288. /***/ "./node_modules/@ckeditor/ckeditor5-select-all/theme/icons/select-all.svg":
  60289. /*!********************************************************************************!*\
  60290. !*** ./node_modules/@ckeditor/ckeditor5-select-all/theme/icons/select-all.svg ***!
  60291. \********************************************************************************/
  60292. /*! exports provided: default */
  60293. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60294. "use strict";
  60295. __webpack_require__.r(__webpack_exports__);
  60296. /* harmony default export */ __webpack_exports__["default"] = ("<svg width=\"20\" height=\"20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M.75 15.5a.75.75 0 0 1 .75.75V18l.008.09A.5.5 0 0 0 2 18.5h1.75a.75.75 0 1 1 0 1.5H1.5l-.144-.007a1.5 1.5 0 0 1-1.35-1.349L0 18.5v-2.25a.75.75 0 0 1 .75-.75zm18.5 0a.75.75 0 0 1 .75.75v2.25l-.007.144a1.5 1.5 0 0 1-1.349 1.35L18.5 20h-2.25a.75.75 0 1 1 0-1.5H18a.5.5 0 0 0 .492-.41L18.5 18v-1.75a.75.75 0 0 1 .75-.75zm-10.45 3c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2H7.2a.2.2 0 0 1-.2-.2v-1.1c0-.11.09-.2.2-.2h1.6zm4 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2h-1.6a.2.2 0 0 1-.2-.2v-1.1c0-.11.09-.2.2-.2h1.6zm.45-5.5a.75.75 0 1 1 0 1.5h-8.5a.75.75 0 1 1 0-1.5h8.5zM1.3 11c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2H.2a.2.2 0 0 1-.2-.2v-1.6c0-.11.09-.2.2-.2h1.1zm18.5 0c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2h-1.1a.2.2 0 0 1-.2-.2v-1.6c0-.11.09-.2.2-.2h1.1zm-4.55-2a.75.75 0 1 1 0 1.5H4.75a.75.75 0 1 1 0-1.5h10.5zM1.3 7c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2H.2a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2h1.1zm18.5 0c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2h-1.1a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2h1.1zm-4.55-2a.75.75 0 1 1 0 1.5h-2.5a.75.75 0 1 1 0-1.5h2.5zm-5 0a.75.75 0 1 1 0 1.5h-5.5a.75.75 0 0 1 0-1.5h5.5zm-6.5-5a.75.75 0 0 1 0 1.5H2a.5.5 0 0 0-.492.41L1.5 2v1.75a.75.75 0 0 1-1.5 0V1.5l.007-.144A1.5 1.5 0 0 1 1.356.006L1.5 0h2.25zM18.5 0l.144.007a1.5 1.5 0 0 1 1.35 1.349L20 1.5v2.25a.75.75 0 1 1-1.5 0V2l-.008-.09A.5.5 0 0 0 18 1.5h-1.75a.75.75 0 1 1 0-1.5h2.25zM8.8 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2H7.2a.2.2 0 0 1-.2-.2V.2c0-.11.09-.2.2-.2h1.6zm4 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2h-1.6a.2.2 0 0 1-.2-.2V.2c0-.11.09-.2.2-.2h1.6z\"/></svg>");
  60297. /***/ }),
  60298. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/insertcolumncommand.js":
  60299. /*!************************************************************************************!*\
  60300. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/insertcolumncommand.js ***!
  60301. \************************************************************************************/
  60302. /*! exports provided: default */
  60303. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60304. "use strict";
  60305. __webpack_require__.r(__webpack_exports__);
  60306. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InsertColumnCommand; });
  60307. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  60308. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  60309. /**
  60310. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  60311. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  60312. */
  60313. /**
  60314. * @module table/commands/insertcolumncommand
  60315. */
  60316. /**
  60317. * The insert column command.
  60318. *
  60319. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'insertTableColumnLeft'` and
  60320. * `'insertTableColumnRight'` editor commands.
  60321. *
  60322. * To insert a column to the left of the selected cell, execute the following command:
  60323. *
  60324. * editor.execute( 'insertTableColumnLeft' );
  60325. *
  60326. * To insert a column to the right of the selected cell, execute the following command:
  60327. *
  60328. * editor.execute( 'insertTableColumnRight' );
  60329. *
  60330. * @extends module:core/command~Command
  60331. */
  60332. class InsertColumnCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  60333. /**
  60334. * Creates a new `InsertColumnCommand` instance.
  60335. *
  60336. * @param {module:core/editor/editor~Editor} editor An editor on which this command will be used.
  60337. * @param {Object} options
  60338. * @param {String} [options.order="right"] The order of insertion relative to the column in which the caret is located.
  60339. * Possible values: `"left"` and `"right"`.
  60340. */
  60341. constructor( editor, options = {} ) {
  60342. super( editor );
  60343. /**
  60344. * The order of insertion relative to the column in which the caret is located.
  60345. *
  60346. * @readonly
  60347. * @member {String} module:table/commands/insertcolumncommand~InsertColumnCommand#order
  60348. */
  60349. this.order = options.order || 'right';
  60350. }
  60351. /**
  60352. * @inheritDoc
  60353. */
  60354. refresh() {
  60355. const selection = this.editor.model.document.selection;
  60356. const tableParent = selection.getFirstPosition().findAncestor( 'table' );
  60357. this.isEnabled = !!tableParent;
  60358. }
  60359. /**
  60360. * Executes the command.
  60361. *
  60362. * Depending on the command's {@link #order} value, it inserts a column to the `'left'` or `'right'` of the column
  60363. * in which the selection is set.
  60364. *
  60365. * @fires execute
  60366. */
  60367. execute() {
  60368. const editor = this.editor;
  60369. const selection = editor.model.document.selection;
  60370. const tableUtils = editor.plugins.get( 'TableUtils' );
  60371. const insertBefore = this.order === 'left';
  60372. const affectedTableCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( selection );
  60373. const columnIndexes = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getColumnIndexes"])( affectedTableCells );
  60374. const column = insertBefore ? columnIndexes.first : columnIndexes.last;
  60375. const table = affectedTableCells[ 0 ].findAncestor( 'table' );
  60376. tableUtils.insertColumns( table, { columns: 1, at: insertBefore ? column : column + 1 } );
  60377. }
  60378. }
  60379. /***/ }),
  60380. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/insertrowcommand.js":
  60381. /*!*********************************************************************************!*\
  60382. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/insertrowcommand.js ***!
  60383. \*********************************************************************************/
  60384. /*! exports provided: default */
  60385. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60386. "use strict";
  60387. __webpack_require__.r(__webpack_exports__);
  60388. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InsertRowCommand; });
  60389. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  60390. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  60391. /**
  60392. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  60393. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  60394. */
  60395. /**
  60396. * @module table/commands/insertrowcommand
  60397. */
  60398. /**
  60399. * The insert row command.
  60400. *
  60401. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'insertTableRowBelow'` and
  60402. * `'insertTableRowAbove'` editor commands.
  60403. *
  60404. * To insert a row below the selected cell, execute the following command:
  60405. *
  60406. * editor.execute( 'insertTableRowBelow' );
  60407. *
  60408. * To insert a row above the selected cell, execute the following command:
  60409. *
  60410. * editor.execute( 'insertTableRowAbove' );
  60411. *
  60412. * @extends module:core/command~Command
  60413. */
  60414. class InsertRowCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  60415. /**
  60416. * Creates a new `InsertRowCommand` instance.
  60417. *
  60418. * @param {module:core/editor/editor~Editor} editor The editor on which this command will be used.
  60419. * @param {Object} options
  60420. * @param {String} [options.order="below"] The order of insertion relative to the row in which the caret is located.
  60421. * Possible values: `"above"` and `"below"`.
  60422. */
  60423. constructor( editor, options = {} ) {
  60424. super( editor );
  60425. /**
  60426. * The order of insertion relative to the row in which the caret is located.
  60427. *
  60428. * @readonly
  60429. * @member {String} module:table/commands/insertrowcommand~InsertRowCommand#order
  60430. */
  60431. this.order = options.order || 'below';
  60432. }
  60433. /**
  60434. * @inheritDoc
  60435. */
  60436. refresh() {
  60437. const selection = this.editor.model.document.selection;
  60438. const tableParent = selection.getFirstPosition().findAncestor( 'table' );
  60439. this.isEnabled = !!tableParent;
  60440. }
  60441. /**
  60442. * Executes the command.
  60443. *
  60444. * Depending on the command's {@link #order} value, it inserts a row `'below'` or `'above'` the row in which selection is set.
  60445. *
  60446. * @fires execute
  60447. */
  60448. execute() {
  60449. const editor = this.editor;
  60450. const selection = editor.model.document.selection;
  60451. const tableUtils = editor.plugins.get( 'TableUtils' );
  60452. const insertAbove = this.order === 'above';
  60453. const affectedTableCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( selection );
  60454. const rowIndexes = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getRowIndexes"])( affectedTableCells );
  60455. const row = insertAbove ? rowIndexes.first : rowIndexes.last;
  60456. const table = affectedTableCells[ 0 ].findAncestor( 'table' );
  60457. tableUtils.insertRows( table, { at: insertAbove ? row : row + 1, copyStructureFromAbove: !insertAbove } );
  60458. }
  60459. }
  60460. /***/ }),
  60461. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/inserttablecommand.js":
  60462. /*!***********************************************************************************!*\
  60463. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/inserttablecommand.js ***!
  60464. \***********************************************************************************/
  60465. /*! exports provided: default */
  60466. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60467. "use strict";
  60468. __webpack_require__.r(__webpack_exports__);
  60469. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InsertTableCommand; });
  60470. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  60471. /* harmony import */ var _ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-widget/src/utils */ "./node_modules/@ckeditor/ckeditor5-widget/src/utils.js");
  60472. /**
  60473. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  60474. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  60475. */
  60476. /**
  60477. * @module table/commands/inserttablecommand
  60478. */
  60479. /**
  60480. * The insert table command.
  60481. *
  60482. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'insertTable'` editor command.
  60483. *
  60484. * To insert a table at the current selection, execute the command and specify the dimensions:
  60485. *
  60486. * editor.execute( 'insertTable', { rows: 20, columns: 5 } );
  60487. *
  60488. * @extends module:core/command~Command
  60489. */
  60490. class InsertTableCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  60491. /**
  60492. * @inheritDoc
  60493. */
  60494. refresh() {
  60495. const model = this.editor.model;
  60496. const selection = model.document.selection;
  60497. const schema = model.schema;
  60498. const validParent = getInsertTableParent( selection.getFirstPosition() );
  60499. this.isEnabled = schema.checkChild( validParent, 'table' );
  60500. }
  60501. /**
  60502. * Executes the command.
  60503. *
  60504. * Inserts a table with the given number of rows and columns into the editor.
  60505. *
  60506. * @param {Object} options
  60507. * @param {Number} [options.rows=2] The number of rows to create in the inserted table.
  60508. * @param {Number} [options.columns=2] The number of columns to create in the inserted table.
  60509. * @param {Number} [options.headingRows=0] The number of heading rows.
  60510. * @param {Number} [options.headingColumns=0] The number of heading columns.
  60511. * @fires execute
  60512. */
  60513. execute( options = {} ) {
  60514. const model = this.editor.model;
  60515. const selection = model.document.selection;
  60516. const tableUtils = this.editor.plugins.get( 'TableUtils' );
  60517. const insertPosition = Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_1__["findOptimalInsertionPosition"])( selection, model );
  60518. model.change( writer => {
  60519. const table = tableUtils.createTable( writer, options );
  60520. model.insertContent( table, insertPosition );
  60521. writer.setSelection( writer.createPositionAt( table.getNodeByPath( [ 0, 0, 0 ] ), 0 ) );
  60522. } );
  60523. }
  60524. }
  60525. // Returns valid parent to insert table
  60526. //
  60527. // @param {module:engine/model/position} position
  60528. function getInsertTableParent( position ) {
  60529. const parent = position.parent;
  60530. return parent === parent.root ? parent : parent.parent;
  60531. }
  60532. /***/ }),
  60533. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/mergecellcommand.js":
  60534. /*!*********************************************************************************!*\
  60535. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/mergecellcommand.js ***!
  60536. \*********************************************************************************/
  60537. /*! exports provided: default */
  60538. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60539. "use strict";
  60540. __webpack_require__.r(__webpack_exports__);
  60541. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MergeCellCommand; });
  60542. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  60543. /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
  60544. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  60545. /* harmony import */ var _utils_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/common */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js");
  60546. /* harmony import */ var _utils_structure__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/structure */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js");
  60547. /**
  60548. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  60549. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  60550. */
  60551. /**
  60552. * @module table/commands/mergecellcommand
  60553. */
  60554. /**
  60555. * The merge cell command.
  60556. *
  60557. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'mergeTableCellRight'`, `'mergeTableCellLeft'`,
  60558. * `'mergeTableCellUp'` and `'mergeTableCellDown'` editor commands.
  60559. *
  60560. * To merge a table cell at the current selection with another cell, execute the command corresponding with the preferred direction.
  60561. *
  60562. * For example, to merge with a cell to the right:
  60563. *
  60564. * editor.execute( 'mergeTableCellRight' );
  60565. *
  60566. * **Note**: If a table cell has a different [`rowspan`](https://www.w3.org/TR/html50/tabular-data.html#attr-tdth-rowspan)
  60567. * (for `'mergeTableCellRight'` and `'mergeTableCellLeft'`) or [`colspan`](https://www.w3.org/TR/html50/tabular-data.html#attr-tdth-colspan)
  60568. * (for `'mergeTableCellUp'` and `'mergeTableCellDown'`), the command will be disabled.
  60569. *
  60570. * @extends module:core/command~Command
  60571. */
  60572. class MergeCellCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  60573. /**
  60574. * Creates a new `MergeCellCommand` instance.
  60575. *
  60576. * @param {module:core/editor/editor~Editor} editor The editor on which this command will be used.
  60577. * @param {Object} options
  60578. * @param {String} options.direction Indicates which cell to merge with the currently selected one.
  60579. * Possible values are: `'left'`, `'right'`, `'up'` and `'down'`.
  60580. */
  60581. constructor( editor, options ) {
  60582. super( editor );
  60583. /**
  60584. * The direction that indicates which cell will be merged with the currently selected one.
  60585. *
  60586. * @readonly
  60587. * @member {String} #direction
  60588. */
  60589. this.direction = options.direction;
  60590. /**
  60591. * Whether the merge is horizontal (left/right) or vertical (up/down).
  60592. *
  60593. * @readonly
  60594. * @member {Boolean} #isHorizontal
  60595. */
  60596. this.isHorizontal = this.direction == 'right' || this.direction == 'left';
  60597. }
  60598. /**
  60599. * @inheritDoc
  60600. */
  60601. refresh() {
  60602. const cellToMerge = this._getMergeableCell();
  60603. this.value = cellToMerge;
  60604. this.isEnabled = !!cellToMerge;
  60605. }
  60606. /**
  60607. * Executes the command.
  60608. *
  60609. * Depending on the command's {@link #direction} value, it will merge the cell that is to the `'left'`, `'right'`, `'up'` or `'down'`.
  60610. *
  60611. * @fires execute
  60612. */
  60613. execute() {
  60614. const model = this.editor.model;
  60615. const doc = model.document;
  60616. const tableCell = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getTableCellsContainingSelection"])( doc.selection )[ 0 ];
  60617. const cellToMerge = this.value;
  60618. const direction = this.direction;
  60619. model.change( writer => {
  60620. const isMergeNext = direction == 'right' || direction == 'down';
  60621. // The merge mechanism is always the same so sort cells to be merged.
  60622. const cellToExpand = isMergeNext ? tableCell : cellToMerge;
  60623. const cellToRemove = isMergeNext ? cellToMerge : tableCell;
  60624. // Cache the parent of cell to remove for later check.
  60625. const removedTableCellRow = cellToRemove.parent;
  60626. mergeTableCells( cellToRemove, cellToExpand, writer );
  60627. const spanAttribute = this.isHorizontal ? 'colspan' : 'rowspan';
  60628. const cellSpan = parseInt( tableCell.getAttribute( spanAttribute ) || 1 );
  60629. const cellToMergeSpan = parseInt( cellToMerge.getAttribute( spanAttribute ) || 1 );
  60630. // Update table cell span attribute and merge set selection on merged contents.
  60631. writer.setAttribute( spanAttribute, cellSpan + cellToMergeSpan, cellToExpand );
  60632. writer.setSelection( writer.createRangeIn( cellToExpand ) );
  60633. const tableUtils = this.editor.plugins.get( 'TableUtils' );
  60634. const table = removedTableCellRow.findAncestor( 'table' );
  60635. // Remove empty rows and columns after merging.
  60636. Object(_utils_structure__WEBPACK_IMPORTED_MODULE_4__["removeEmptyRowsColumns"])( table, tableUtils );
  60637. } );
  60638. }
  60639. /**
  60640. * Returns a cell that can be merged with the current cell depending on the command's direction.
  60641. *
  60642. * @returns {module:engine/model/element~Element|undefined}
  60643. * @private
  60644. */
  60645. _getMergeableCell() {
  60646. const model = this.editor.model;
  60647. const doc = model.document;
  60648. const tableCell = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getTableCellsContainingSelection"])( doc.selection )[ 0 ];
  60649. if ( !tableCell ) {
  60650. return;
  60651. }
  60652. const tableUtils = this.editor.plugins.get( 'TableUtils' );
  60653. // First get the cell on proper direction.
  60654. const cellToMerge = this.isHorizontal ?
  60655. getHorizontalCell( tableCell, this.direction, tableUtils ) :
  60656. getVerticalCell( tableCell, this.direction );
  60657. if ( !cellToMerge ) {
  60658. return;
  60659. }
  60660. // If found check if the span perpendicular to merge direction is equal on both cells.
  60661. const spanAttribute = this.isHorizontal ? 'rowspan' : 'colspan';
  60662. const span = parseInt( tableCell.getAttribute( spanAttribute ) || 1 );
  60663. const cellToMergeSpan = parseInt( cellToMerge.getAttribute( spanAttribute ) || 1 );
  60664. if ( cellToMergeSpan === span ) {
  60665. return cellToMerge;
  60666. }
  60667. }
  60668. }
  60669. // Returns the cell that can be merged horizontally.
  60670. //
  60671. // @param {module:engine/model/element~Element} tableCell
  60672. // @param {String} direction
  60673. // @returns {module:engine/model/node~Node|null}
  60674. function getHorizontalCell( tableCell, direction, tableUtils ) {
  60675. const tableRow = tableCell.parent;
  60676. const table = tableRow.parent;
  60677. const horizontalCell = direction == 'right' ? tableCell.nextSibling : tableCell.previousSibling;
  60678. const hasHeadingColumns = ( table.getAttribute( 'headingColumns' ) || 0 ) > 0;
  60679. if ( !horizontalCell ) {
  60680. return;
  60681. }
  60682. // Sort cells:
  60683. const cellOnLeft = direction == 'right' ? tableCell : horizontalCell;
  60684. const cellOnRight = direction == 'right' ? horizontalCell : tableCell;
  60685. // Get their column indexes:
  60686. const { column: leftCellColumn } = tableUtils.getCellLocation( cellOnLeft );
  60687. const { column: rightCellColumn } = tableUtils.getCellLocation( cellOnRight );
  60688. const leftCellSpan = parseInt( cellOnLeft.getAttribute( 'colspan' ) || 1 );
  60689. const isCellOnLeftInHeadingColumn = Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["isHeadingColumnCell"])( tableUtils, cellOnLeft, table );
  60690. const isCellOnRightInHeadingColumn = Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["isHeadingColumnCell"])( tableUtils, cellOnRight, table );
  60691. // We cannot merge heading columns cells with regular cells.
  60692. if ( hasHeadingColumns && isCellOnLeftInHeadingColumn != isCellOnRightInHeadingColumn ) {
  60693. return;
  60694. }
  60695. // The cell on the right must have index that is distant to the cell on the left by the left cell's width (colspan).
  60696. const cellsAreTouching = leftCellColumn + leftCellSpan === rightCellColumn;
  60697. // If the right cell's column index is different it means that there are rowspanned cells between them.
  60698. return cellsAreTouching ? horizontalCell : undefined;
  60699. }
  60700. // Returns the cell that can be merged vertically.
  60701. //
  60702. // @param {module:engine/model/element~Element} tableCell
  60703. // @param {String} direction
  60704. // @returns {module:engine/model/node~Node|null}
  60705. function getVerticalCell( tableCell, direction ) {
  60706. const tableRow = tableCell.parent;
  60707. const table = tableRow.parent;
  60708. const rowIndex = table.getChildIndex( tableRow );
  60709. // Don't search for mergeable cell if direction points out of the table.
  60710. if ( ( direction == 'down' && rowIndex === table.childCount - 1 ) || ( direction == 'up' && rowIndex === 0 ) ) {
  60711. return;
  60712. }
  60713. const rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 );
  60714. const headingRows = table.getAttribute( 'headingRows' ) || 0;
  60715. const isMergeWithBodyCell = direction == 'down' && ( rowIndex + rowspan ) === headingRows;
  60716. const isMergeWithHeadCell = direction == 'up' && rowIndex === headingRows;
  60717. // Don't search for mergeable cell if direction points out of the current table section.
  60718. if ( headingRows && ( isMergeWithBodyCell || isMergeWithHeadCell ) ) {
  60719. return;
  60720. }
  60721. const currentCellRowSpan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 );
  60722. const rowOfCellToMerge = direction == 'down' ? rowIndex + currentCellRowSpan : rowIndex;
  60723. const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( table, { endRow: rowOfCellToMerge } ) ];
  60724. const currentCellData = tableMap.find( value => value.cell === tableCell );
  60725. const mergeColumn = currentCellData.column;
  60726. const cellToMergeData = tableMap.find( ( { row, cellHeight, column } ) => {
  60727. if ( column !== mergeColumn ) {
  60728. return false;
  60729. }
  60730. if ( direction == 'down' ) {
  60731. // If merging a cell below the mergeRow is already calculated.
  60732. return row === rowOfCellToMerge;
  60733. } else {
  60734. // If merging a cell above calculate if it spans to mergeRow.
  60735. return rowOfCellToMerge === row + cellHeight;
  60736. }
  60737. } );
  60738. return cellToMergeData && cellToMergeData.cell;
  60739. }
  60740. // Merges two table cells. It will ensure that after merging cells with an empty paragraph, the resulting table cell will only have one
  60741. // paragraph. If one of the merged table cells is empty, the merged table cell will have the contents of the non-empty table cell.
  60742. // If both are empty, the merged table cell will have only one empty paragraph.
  60743. //
  60744. // @param {module:engine/model/element~Element} cellToRemove
  60745. // @param {module:engine/model/element~Element} cellToExpand
  60746. // @param {module:engine/model/writer~Writer} writer
  60747. function mergeTableCells( cellToRemove, cellToExpand, writer ) {
  60748. if ( !isEmpty( cellToRemove ) ) {
  60749. if ( isEmpty( cellToExpand ) ) {
  60750. writer.remove( writer.createRangeIn( cellToExpand ) );
  60751. }
  60752. writer.move( writer.createRangeIn( cellToRemove ), writer.createPositionAt( cellToExpand, 'end' ) );
  60753. }
  60754. // Remove merged table cell.
  60755. writer.remove( cellToRemove );
  60756. }
  60757. // Checks if the passed table cell contains an empty paragraph.
  60758. //
  60759. // @param {module:engine/model/element~Element} tableCell
  60760. // @returns {Boolean}
  60761. function isEmpty( tableCell ) {
  60762. return tableCell.childCount == 1 && tableCell.getChild( 0 ).is( 'element', 'paragraph' ) && tableCell.getChild( 0 ).isEmpty;
  60763. }
  60764. /***/ }),
  60765. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/mergecellscommand.js":
  60766. /*!**********************************************************************************!*\
  60767. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/mergecellscommand.js ***!
  60768. \**********************************************************************************/
  60769. /*! exports provided: default */
  60770. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60771. "use strict";
  60772. __webpack_require__.r(__webpack_exports__);
  60773. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MergeCellsCommand; });
  60774. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  60775. /* harmony import */ var _tableutils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../tableutils */ "./node_modules/@ckeditor/ckeditor5-table/src/tableutils.js");
  60776. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  60777. /* harmony import */ var _utils_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/common */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js");
  60778. /* harmony import */ var _utils_structure__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/structure */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js");
  60779. /**
  60780. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  60781. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  60782. */
  60783. /**
  60784. * @module table/commands/mergecellscommand
  60785. */
  60786. /**
  60787. * The merge cells command.
  60788. *
  60789. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'mergeTableCells'` editor command.
  60790. *
  60791. * For example, to merge selected table cells:
  60792. *
  60793. * editor.execute( 'mergeTableCells' );
  60794. *
  60795. * @extends module:core/command~Command
  60796. */
  60797. class MergeCellsCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  60798. /**
  60799. * @inheritDoc
  60800. */
  60801. refresh() {
  60802. const selectedTableCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectedTableCells"])( this.editor.model.document.selection );
  60803. this.isEnabled = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["isSelectionRectangular"])( selectedTableCells, this.editor.plugins.get( _tableutils__WEBPACK_IMPORTED_MODULE_1__["default"] ) );
  60804. }
  60805. /**
  60806. * Executes the command.
  60807. *
  60808. * @fires execute
  60809. */
  60810. execute() {
  60811. const model = this.editor.model;
  60812. const tableUtils = this.editor.plugins.get( _tableutils__WEBPACK_IMPORTED_MODULE_1__["default"] );
  60813. model.change( writer => {
  60814. const selectedTableCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectedTableCells"])( model.document.selection );
  60815. // All cells will be merged into the first one.
  60816. const firstTableCell = selectedTableCells.shift();
  60817. // Update target cell dimensions.
  60818. const { mergeWidth, mergeHeight } = getMergeDimensions( firstTableCell, selectedTableCells, tableUtils );
  60819. Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'colspan', mergeWidth, firstTableCell, writer );
  60820. Object(_utils_common__WEBPACK_IMPORTED_MODULE_3__["updateNumericAttribute"])( 'rowspan', mergeHeight, firstTableCell, writer );
  60821. for ( const tableCell of selectedTableCells ) {
  60822. mergeTableCells( tableCell, firstTableCell, writer );
  60823. }
  60824. const table = firstTableCell.findAncestor( 'table' );
  60825. // Remove rows and columns that become empty (have no anchored cells).
  60826. Object(_utils_structure__WEBPACK_IMPORTED_MODULE_4__["removeEmptyRowsColumns"])( table, tableUtils );
  60827. writer.setSelection( firstTableCell, 'in' );
  60828. } );
  60829. }
  60830. }
  60831. // Merges two table cells. It will ensure that after merging cells with empty paragraphs the resulting table cell will only have one
  60832. // paragraph. If one of the merged table cells is empty, the merged table cell will have contents of the non-empty table cell.
  60833. // If both are empty, the merged table cell will have only one empty paragraph.
  60834. //
  60835. // @param {module:engine/model/element~Element} cellBeingMerged
  60836. // @param {module:engine/model/element~Element} targetCell
  60837. // @param {module:engine/model/writer~Writer} writer
  60838. function mergeTableCells( cellBeingMerged, targetCell, writer ) {
  60839. if ( !isEmpty( cellBeingMerged ) ) {
  60840. if ( isEmpty( targetCell ) ) {
  60841. writer.remove( writer.createRangeIn( targetCell ) );
  60842. }
  60843. writer.move( writer.createRangeIn( cellBeingMerged ), writer.createPositionAt( targetCell, 'end' ) );
  60844. }
  60845. // Remove merged table cell.
  60846. writer.remove( cellBeingMerged );
  60847. }
  60848. // Checks if the passed table cell contains an empty paragraph.
  60849. //
  60850. // @param {module:engine/model/element~Element} tableCell
  60851. // @returns {Boolean}
  60852. function isEmpty( tableCell ) {
  60853. return tableCell.childCount == 1 && tableCell.getChild( 0 ).is( 'element', 'paragraph' ) && tableCell.getChild( 0 ).isEmpty;
  60854. }
  60855. function getMergeDimensions( firstTableCell, selectedTableCells, tableUtils ) {
  60856. let maxWidthOffset = 0;
  60857. let maxHeightOffset = 0;
  60858. for ( const tableCell of selectedTableCells ) {
  60859. const { row, column } = tableUtils.getCellLocation( tableCell );
  60860. maxWidthOffset = getMaxOffset( tableCell, column, maxWidthOffset, 'colspan' );
  60861. maxHeightOffset = getMaxOffset( tableCell, row, maxHeightOffset, 'rowspan' );
  60862. }
  60863. // Update table cell span attribute and merge set selection on a merged contents.
  60864. const { row: firstCellRow, column: firstCellColumn } = tableUtils.getCellLocation( firstTableCell );
  60865. const mergeWidth = maxWidthOffset - firstCellColumn;
  60866. const mergeHeight = maxHeightOffset - firstCellRow;
  60867. return { mergeWidth, mergeHeight };
  60868. }
  60869. function getMaxOffset( tableCell, start, currentMaxOffset, which ) {
  60870. const dimensionValue = parseInt( tableCell.getAttribute( which ) || 1 );
  60871. return Math.max( currentMaxOffset, start + dimensionValue );
  60872. }
  60873. /***/ }),
  60874. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/removecolumncommand.js":
  60875. /*!************************************************************************************!*\
  60876. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/removecolumncommand.js ***!
  60877. \************************************************************************************/
  60878. /*! exports provided: default */
  60879. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60880. "use strict";
  60881. __webpack_require__.r(__webpack_exports__);
  60882. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RemoveColumnCommand; });
  60883. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  60884. /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
  60885. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  60886. /**
  60887. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  60888. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  60889. */
  60890. /**
  60891. * @module table/commands/removecolumncommand
  60892. */
  60893. /**
  60894. * The remove column command.
  60895. *
  60896. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'removeTableColumn'` editor command.
  60897. *
  60898. * To remove the column containing the selected cell, execute the command:
  60899. *
  60900. * editor.execute( 'removeTableColumn' );
  60901. *
  60902. * @extends module:core/command~Command
  60903. */
  60904. class RemoveColumnCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  60905. /**
  60906. * @inheritDoc
  60907. */
  60908. refresh() {
  60909. const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectionAffectedTableCells"])( this.editor.model.document.selection );
  60910. const firstCell = selectedCells[ 0 ];
  60911. if ( firstCell ) {
  60912. const table = firstCell.findAncestor( 'table' );
  60913. const tableColumnCount = this.editor.plugins.get( 'TableUtils' ).getColumns( table );
  60914. const { first, last } = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getColumnIndexes"])( selectedCells );
  60915. this.isEnabled = last - first < ( tableColumnCount - 1 );
  60916. } else {
  60917. this.isEnabled = false;
  60918. }
  60919. }
  60920. /**
  60921. * @inheritDoc
  60922. */
  60923. execute() {
  60924. const [ firstCell, lastCell ] = getBoundaryCells( this.editor.model.document.selection );
  60925. const table = firstCell.parent.parent;
  60926. // Cache the table before removing or updating colspans.
  60927. const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( table ) ];
  60928. // Store column indexes of removed columns.
  60929. const removedColumnIndexes = {
  60930. first: tableMap.find( value => value.cell === firstCell ).column,
  60931. last: tableMap.find( value => value.cell === lastCell ).column
  60932. };
  60933. const cellToFocus = getCellToFocus( tableMap, firstCell, lastCell, removedColumnIndexes );
  60934. this.editor.model.change( writer => {
  60935. const columnsToRemove = removedColumnIndexes.last - removedColumnIndexes.first + 1;
  60936. this.editor.plugins.get( 'TableUtils' ).removeColumns( table, {
  60937. at: removedColumnIndexes.first,
  60938. columns: columnsToRemove
  60939. } );
  60940. writer.setSelection( writer.createPositionAt( cellToFocus, 0 ) );
  60941. } );
  60942. }
  60943. }
  60944. // Returns a proper table cell to focus after removing a column.
  60945. // - selection is on last table cell it will return previous cell.
  60946. function getCellToFocus( tableMap, firstCell, lastCell, removedColumnIndexes ) {
  60947. const colspan = parseInt( lastCell.getAttribute( 'colspan' ) || 1 );
  60948. // If the table cell is spanned over 2+ columns - it will be truncated so the selection should
  60949. // stay in that cell.
  60950. if ( colspan > 1 ) {
  60951. return lastCell;
  60952. }
  60953. // Normally, look for the cell in the same row that precedes the first cell to put selection there ("column on the left").
  60954. // If the deleted column is the first column of the table, there will be no predecessor: use the cell
  60955. // from the column that follows then (also in the same row).
  60956. else if ( firstCell.previousSibling || lastCell.nextSibling ) {
  60957. return lastCell.nextSibling || firstCell.previousSibling;
  60958. }
  60959. // It can happen that table cells have no siblings in a row, for instance, when there are row spans
  60960. // in the table (in the previous row). Then just look for the closest cell that is in a column
  60961. // that will not be removed to put the selection there.
  60962. else {
  60963. // Look for any cell in a column that precedes the first removed column.
  60964. if ( removedColumnIndexes.first ) {
  60965. return tableMap.reverse().find( ( { column } ) => {
  60966. return column < removedColumnIndexes.first;
  60967. } ).cell;
  60968. }
  60969. // If the first removed column is the first column of the table, then
  60970. // look for any cell that is in a column that follows the last removed column.
  60971. else {
  60972. return tableMap.reverse().find( ( { column } ) => {
  60973. return column > removedColumnIndexes.last;
  60974. } ).cell;
  60975. }
  60976. }
  60977. }
  60978. // Returns helper object returning the first and the last cell contained in given selection, based on DOM order.
  60979. function getBoundaryCells( selection ) {
  60980. const referenceCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectionAffectedTableCells"])( selection );
  60981. const firstCell = referenceCells[ 0 ];
  60982. const lastCell = referenceCells.pop();
  60983. const returnValue = [ firstCell, lastCell ];
  60984. return firstCell.isBefore( lastCell ) ? returnValue : returnValue.reverse();
  60985. }
  60986. /***/ }),
  60987. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/removerowcommand.js":
  60988. /*!*********************************************************************************!*\
  60989. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/removerowcommand.js ***!
  60990. \*********************************************************************************/
  60991. /*! exports provided: default */
  60992. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60993. "use strict";
  60994. __webpack_require__.r(__webpack_exports__);
  60995. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RemoveRowCommand; });
  60996. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  60997. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  60998. /**
  60999. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  61000. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  61001. */
  61002. /**
  61003. * @module table/commands/removerowcommand
  61004. */
  61005. /**
  61006. * The remove row command.
  61007. *
  61008. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'removeTableRow'` editor command.
  61009. *
  61010. * To remove the row containing the selected cell, execute the command:
  61011. *
  61012. * editor.execute( 'removeTableRow' );
  61013. *
  61014. * @extends module:core/command~Command
  61015. */
  61016. class RemoveRowCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  61017. /**
  61018. * @inheritDoc
  61019. */
  61020. refresh() {
  61021. const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( this.editor.model.document.selection );
  61022. const firstCell = selectedCells[ 0 ];
  61023. if ( firstCell ) {
  61024. const table = firstCell.findAncestor( 'table' );
  61025. const tableRowCount = this.editor.plugins.get( 'TableUtils' ).getRows( table );
  61026. const lastRowIndex = tableRowCount - 1;
  61027. const selectedRowIndexes = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getRowIndexes"])( selectedCells );
  61028. const areAllRowsSelected = selectedRowIndexes.first === 0 && selectedRowIndexes.last === lastRowIndex;
  61029. // Disallow selecting whole table -> delete whole table should be used instead.
  61030. this.isEnabled = !areAllRowsSelected;
  61031. } else {
  61032. this.isEnabled = false;
  61033. }
  61034. }
  61035. /**
  61036. * @inheritDoc
  61037. */
  61038. execute() {
  61039. const model = this.editor.model;
  61040. const referenceCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( model.document.selection );
  61041. const removedRowIndexes = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getRowIndexes"])( referenceCells );
  61042. const firstCell = referenceCells[ 0 ];
  61043. const table = firstCell.findAncestor( 'table' );
  61044. const columnIndexToFocus = this.editor.plugins.get( 'TableUtils' ).getCellLocation( firstCell ).column;
  61045. model.change( writer => {
  61046. const rowsToRemove = removedRowIndexes.last - removedRowIndexes.first + 1;
  61047. this.editor.plugins.get( 'TableUtils' ).removeRows( table, {
  61048. at: removedRowIndexes.first,
  61049. rows: rowsToRemove
  61050. } );
  61051. const cellToFocus = getCellToFocus( table, removedRowIndexes.first, columnIndexToFocus );
  61052. writer.setSelection( writer.createPositionAt( cellToFocus, 0 ) );
  61053. } );
  61054. }
  61055. }
  61056. // Returns a cell that should be focused before removing the row, belonging to the same column as the currently focused cell.
  61057. // * If the row was not the last one, the cell to focus will be in the row that followed it (before removal).
  61058. // * If the row was the last one, the cell to focus will be in the row that preceded it (before removal).
  61059. function getCellToFocus( table, removedRowIndex, columnToFocus ) {
  61060. const row = table.getChild( removedRowIndex ) || table.getChild( table.childCount - 1 );
  61061. // Default to first table cell.
  61062. let cellToFocus = row.getChild( 0 );
  61063. let column = 0;
  61064. for ( const tableCell of row.getChildren() ) {
  61065. if ( column > columnToFocus ) {
  61066. return cellToFocus;
  61067. }
  61068. cellToFocus = tableCell;
  61069. column += parseInt( tableCell.getAttribute( 'colspan' ) || 1 );
  61070. }
  61071. return cellToFocus;
  61072. }
  61073. /***/ }),
  61074. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/selectcolumncommand.js":
  61075. /*!************************************************************************************!*\
  61076. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/selectcolumncommand.js ***!
  61077. \************************************************************************************/
  61078. /*! exports provided: default */
  61079. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61080. "use strict";
  61081. __webpack_require__.r(__webpack_exports__);
  61082. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SelectColumnCommand; });
  61083. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  61084. /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
  61085. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  61086. /**
  61087. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  61088. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  61089. */
  61090. /**
  61091. * @module table/commands/selectcolumncommand
  61092. */
  61093. /**
  61094. * The select column command.
  61095. *
  61096. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'selectTableColumn'` editor command.
  61097. *
  61098. * To select the columns containing the selected cells, execute the command:
  61099. *
  61100. * editor.execute( 'selectTableColumn' );
  61101. *
  61102. * @extends module:core/command~Command
  61103. */
  61104. class SelectColumnCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  61105. /**
  61106. * @inheritDoc
  61107. */
  61108. refresh() {
  61109. const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectionAffectedTableCells"])( this.editor.model.document.selection );
  61110. this.isEnabled = selectedCells.length > 0;
  61111. }
  61112. /**
  61113. * @inheritDoc
  61114. */
  61115. execute() {
  61116. const model = this.editor.model;
  61117. const referenceCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectionAffectedTableCells"])( model.document.selection );
  61118. const firstCell = referenceCells[ 0 ];
  61119. const lastCell = referenceCells.pop();
  61120. const table = firstCell.findAncestor( 'table' );
  61121. const tableUtils = this.editor.plugins.get( 'TableUtils' );
  61122. const startLocation = tableUtils.getCellLocation( firstCell );
  61123. const endLocation = tableUtils.getCellLocation( lastCell );
  61124. const startColumn = Math.min( startLocation.column, endLocation.column );
  61125. const endColumn = Math.max( startLocation.column, endLocation.column );
  61126. const rangesToSelect = [];
  61127. for ( const cellInfo of new _tablewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( table, { startColumn, endColumn } ) ) {
  61128. rangesToSelect.push( model.createRangeOn( cellInfo.cell ) );
  61129. }
  61130. model.change( writer => {
  61131. writer.setSelection( rangesToSelect );
  61132. } );
  61133. }
  61134. }
  61135. /***/ }),
  61136. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/selectrowcommand.js":
  61137. /*!*********************************************************************************!*\
  61138. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/selectrowcommand.js ***!
  61139. \*********************************************************************************/
  61140. /*! exports provided: default */
  61141. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61142. "use strict";
  61143. __webpack_require__.r(__webpack_exports__);
  61144. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SelectRowCommand; });
  61145. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  61146. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  61147. /**
  61148. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  61149. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  61150. */
  61151. /**
  61152. * @module table/commands/selectrowcommand
  61153. */
  61154. /**
  61155. * The select row command.
  61156. *
  61157. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'selectTableRow'` editor command.
  61158. *
  61159. * To select the rows containing the selected cells, execute the command:
  61160. *
  61161. * editor.execute( 'selectTableRow' );
  61162. *
  61163. * @extends module:core/command~Command
  61164. */
  61165. class SelectRowCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  61166. /**
  61167. * @inheritDoc
  61168. */
  61169. refresh() {
  61170. const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( this.editor.model.document.selection );
  61171. this.isEnabled = selectedCells.length > 0;
  61172. }
  61173. /**
  61174. * @inheritDoc
  61175. */
  61176. execute() {
  61177. const model = this.editor.model;
  61178. const referenceCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( model.document.selection );
  61179. const rowIndexes = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getRowIndexes"])( referenceCells );
  61180. const table = referenceCells[ 0 ].findAncestor( 'table' );
  61181. const rangesToSelect = [];
  61182. for ( let rowIndex = rowIndexes.first; rowIndex <= rowIndexes.last; rowIndex++ ) {
  61183. for ( const cell of table.getChild( rowIndex ).getChildren() ) {
  61184. rangesToSelect.push( model.createRangeOn( cell ) );
  61185. }
  61186. }
  61187. model.change( writer => {
  61188. writer.setSelection( rangesToSelect );
  61189. } );
  61190. }
  61191. }
  61192. /***/ }),
  61193. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/setheadercolumncommand.js":
  61194. /*!***************************************************************************************!*\
  61195. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/setheadercolumncommand.js ***!
  61196. \***************************************************************************************/
  61197. /*! exports provided: default */
  61198. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61199. "use strict";
  61200. __webpack_require__.r(__webpack_exports__);
  61201. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SetHeaderColumnCommand; });
  61202. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  61203. /* harmony import */ var _utils_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/common */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js");
  61204. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  61205. /* harmony import */ var _utils_structure__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/structure */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js");
  61206. /**
  61207. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  61208. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  61209. */
  61210. /**
  61211. * @module table/commands/setheadercolumncommand
  61212. */
  61213. /**
  61214. * The header column command.
  61215. *
  61216. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'setTableColumnHeader'` editor command.
  61217. *
  61218. * You can make the column containing the selected cell a [header](https://www.w3.org/TR/html50/tabular-data.html#the-th-element)
  61219. * by executing:
  61220. *
  61221. * editor.execute( 'setTableColumnHeader' );
  61222. *
  61223. * **Note:** All preceding columns will also become headers. If the current column is already a header, executing this command
  61224. * will make it a regular column back again (including the following columns).
  61225. *
  61226. * @extends module:core/command~Command
  61227. */
  61228. class SetHeaderColumnCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  61229. /**
  61230. * @inheritDoc
  61231. */
  61232. refresh() {
  61233. const model = this.editor.model;
  61234. const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectionAffectedTableCells"])( model.document.selection );
  61235. const tableUtils = this.editor.plugins.get( 'TableUtils' );
  61236. const isInTable = selectedCells.length > 0;
  61237. this.isEnabled = isInTable;
  61238. /**
  61239. * Flag indicating whether the command is active. The command is active when the
  61240. * {@link module:engine/model/selection~Selection} is in a header column.
  61241. *
  61242. * @observable
  61243. * @readonly
  61244. * @member {Boolean} #value
  61245. */
  61246. this.value = isInTable && selectedCells.every( cell => Object(_utils_common__WEBPACK_IMPORTED_MODULE_1__["isHeadingColumnCell"])( tableUtils, cell ) );
  61247. }
  61248. /**
  61249. * Executes the command.
  61250. *
  61251. * When the selection is in a non-header column, the command will set the `headingColumns` table attribute to cover that column.
  61252. *
  61253. * When the selection is already in a header column, it will set `headingColumns` so the heading section will end before that column.
  61254. *
  61255. * @fires execute
  61256. * @param {Object} [options]
  61257. * @param {Boolean} [options.forceValue] If set, the command will set (`true`) or unset (`false`) the header columns according to
  61258. * the `forceValue` parameter instead of the current model state.
  61259. */
  61260. execute( options = {} ) {
  61261. if ( options.forceValue === this.value ) {
  61262. return;
  61263. }
  61264. const model = this.editor.model;
  61265. const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectionAffectedTableCells"])( model.document.selection );
  61266. const table = selectedCells[ 0 ].findAncestor( 'table' );
  61267. const { first, last } = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getColumnIndexes"])( selectedCells );
  61268. const headingColumnsToSet = this.value ? first : last + 1;
  61269. model.change( writer => {
  61270. if ( headingColumnsToSet ) {
  61271. // Changing heading columns requires to check if any of a heading cell is overlapping horizontally the table head.
  61272. // Any table cell that has a colspan attribute > 1 will not exceed the table head so we need to fix it in columns before.
  61273. const overlappingCells = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_3__["getHorizontallyOverlappingCells"])( table, headingColumnsToSet );
  61274. for ( const { cell, column } of overlappingCells ) {
  61275. Object(_utils_structure__WEBPACK_IMPORTED_MODULE_3__["splitVertically"])( cell, column, headingColumnsToSet, writer );
  61276. }
  61277. }
  61278. Object(_utils_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'headingColumns', headingColumnsToSet, table, writer, 0 );
  61279. } );
  61280. }
  61281. }
  61282. /***/ }),
  61283. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/setheaderrowcommand.js":
  61284. /*!************************************************************************************!*\
  61285. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/setheaderrowcommand.js ***!
  61286. \************************************************************************************/
  61287. /*! exports provided: default */
  61288. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61289. "use strict";
  61290. __webpack_require__.r(__webpack_exports__);
  61291. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SetHeaderRowCommand; });
  61292. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  61293. /* harmony import */ var _utils_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/common */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js");
  61294. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  61295. /* harmony import */ var _utils_structure__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/structure */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js");
  61296. /**
  61297. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  61298. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  61299. */
  61300. /**
  61301. * @module table/commands/setheaderrowcommand
  61302. */
  61303. /**
  61304. * The header row command.
  61305. *
  61306. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'setTableColumnHeader'` editor command.
  61307. *
  61308. * You can make the row containing the selected cell a [header](https://www.w3.org/TR/html50/tabular-data.html#the-th-element) by executing:
  61309. *
  61310. * editor.execute( 'setTableRowHeader' );
  61311. *
  61312. * **Note:** All preceding rows will also become headers. If the current row is already a header, executing this command
  61313. * will make it a regular row back again (including the following rows).
  61314. *
  61315. * @extends module:core/command~Command
  61316. */
  61317. class SetHeaderRowCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  61318. /**
  61319. * @inheritDoc
  61320. */
  61321. refresh() {
  61322. const model = this.editor.model;
  61323. const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectionAffectedTableCells"])( model.document.selection );
  61324. const isInTable = selectedCells.length > 0;
  61325. this.isEnabled = isInTable;
  61326. /**
  61327. * Flag indicating whether the command is active. The command is active when the
  61328. * {@link module:engine/model/selection~Selection} is in a header row.
  61329. *
  61330. * @observable
  61331. * @readonly
  61332. * @member {Boolean} #value
  61333. */
  61334. this.value = isInTable && selectedCells.every( cell => this._isInHeading( cell, cell.parent.parent ) );
  61335. }
  61336. /**
  61337. * Executes the command.
  61338. *
  61339. * When the selection is in a non-header row, the command will set the `headingRows` table attribute to cover that row.
  61340. *
  61341. * When the selection is already in a header row, it will set `headingRows` so the heading section will end before that row.
  61342. *
  61343. * @fires execute
  61344. * @param {Object} options
  61345. * @param {Boolean} [options.forceValue] If set, the command will set (`true`) or unset (`false`) the header rows according to
  61346. * the `forceValue` parameter instead of the current model state.
  61347. */
  61348. execute( options = {} ) {
  61349. if ( options.forceValue === this.value ) {
  61350. return;
  61351. }
  61352. const model = this.editor.model;
  61353. const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getSelectionAffectedTableCells"])( model.document.selection );
  61354. const table = selectedCells[ 0 ].findAncestor( 'table' );
  61355. const { first, last } = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_2__["getRowIndexes"])( selectedCells );
  61356. const headingRowsToSet = this.value ? first : last + 1;
  61357. const currentHeadingRows = table.getAttribute( 'headingRows' ) || 0;
  61358. model.change( writer => {
  61359. if ( headingRowsToSet ) {
  61360. // Changing heading rows requires to check if any of a heading cell is overlapping vertically the table head.
  61361. // Any table cell that has a rowspan attribute > 1 will not exceed the table head so we need to fix it in rows below.
  61362. const startRow = headingRowsToSet > currentHeadingRows ? currentHeadingRows : 0;
  61363. const overlappingCells = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_3__["getVerticallyOverlappingCells"])( table, headingRowsToSet, startRow );
  61364. for ( const { cell } of overlappingCells ) {
  61365. Object(_utils_structure__WEBPACK_IMPORTED_MODULE_3__["splitHorizontally"])( cell, headingRowsToSet, writer );
  61366. }
  61367. }
  61368. Object(_utils_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'headingRows', headingRowsToSet, table, writer, 0 );
  61369. } );
  61370. }
  61371. /**
  61372. * Checks if a table cell is in the heading section.
  61373. *
  61374. * @param {module:engine/model/element~Element} tableCell
  61375. * @param {module:engine/model/element~Element} table
  61376. * @returns {Boolean}
  61377. * @private
  61378. */
  61379. _isInHeading( tableCell, table ) {
  61380. const headingRows = parseInt( table.getAttribute( 'headingRows' ) || 0 );
  61381. return !!headingRows && tableCell.parent.index < headingRows;
  61382. }
  61383. }
  61384. /***/ }),
  61385. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/commands/splitcellcommand.js":
  61386. /*!*********************************************************************************!*\
  61387. !*** ./node_modules/@ckeditor/ckeditor5-table/src/commands/splitcellcommand.js ***!
  61388. \*********************************************************************************/
  61389. /*! exports provided: default */
  61390. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61391. "use strict";
  61392. __webpack_require__.r(__webpack_exports__);
  61393. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SplitCellCommand; });
  61394. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  61395. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  61396. /**
  61397. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  61398. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  61399. */
  61400. /**
  61401. * @module table/commands/splitcellcommand
  61402. */
  61403. /**
  61404. * The split cell command.
  61405. *
  61406. * The command is registered by {@link module:table/tableediting~TableEditing} as the `'splitTableCellVertically'`
  61407. * and `'splitTableCellHorizontally'` editor commands.
  61408. *
  61409. * You can split any cell vertically or horizontally by executing this command. For example, to split the selected table cell vertically:
  61410. *
  61411. * editor.execute( 'splitTableCellVertically' );
  61412. *
  61413. * @extends module:core/command~Command
  61414. */
  61415. class SplitCellCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  61416. /**
  61417. * Creates a new `SplitCellCommand` instance.
  61418. *
  61419. * @param {module:core/editor/editor~Editor} editor The editor on which this command will be used.
  61420. * @param {Object} options
  61421. * @param {String} options.direction Indicates whether the command should split cells `'horizontally'` or `'vertically'`.
  61422. */
  61423. constructor( editor, options = {} ) {
  61424. super( editor );
  61425. /**
  61426. * The direction that indicates which cell will be split.
  61427. *
  61428. * @readonly
  61429. * @member {String} #direction
  61430. */
  61431. this.direction = options.direction || 'horizontally';
  61432. }
  61433. /**
  61434. * @inheritDoc
  61435. */
  61436. refresh() {
  61437. const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( this.editor.model.document.selection );
  61438. this.isEnabled = selectedCells.length === 1;
  61439. }
  61440. /**
  61441. * @inheritDoc
  61442. */
  61443. execute() {
  61444. const tableCell = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_1__["getSelectionAffectedTableCells"])( this.editor.model.document.selection )[ 0 ];
  61445. const isHorizontal = this.direction === 'horizontally';
  61446. const tableUtils = this.editor.plugins.get( 'TableUtils' );
  61447. if ( isHorizontal ) {
  61448. tableUtils.splitCellHorizontally( tableCell, 2 );
  61449. } else {
  61450. tableUtils.splitCellVertically( tableCell, 2 );
  61451. }
  61452. }
  61453. }
  61454. /***/ }),
  61455. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/converters/downcast.js":
  61456. /*!***************************************************************************!*\
  61457. !*** ./node_modules/@ckeditor/ckeditor5-table/src/converters/downcast.js ***!
  61458. \***************************************************************************/
  61459. /*! exports provided: downcastInsertTable, downcastInsertRow, downcastInsertCell, downcastTableHeadingColumnsChange, downcastRemoveRow, convertParagraphInTableCell, isSingleParagraphWithoutAttributes */
  61460. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61461. "use strict";
  61462. __webpack_require__.r(__webpack_exports__);
  61463. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "downcastInsertTable", function() { return downcastInsertTable; });
  61464. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "downcastInsertRow", function() { return downcastInsertRow; });
  61465. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "downcastInsertCell", function() { return downcastInsertCell; });
  61466. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "downcastTableHeadingColumnsChange", function() { return downcastTableHeadingColumnsChange; });
  61467. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "downcastRemoveRow", function() { return downcastRemoveRow; });
  61468. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertParagraphInTableCell", function() { return convertParagraphInTableCell; });
  61469. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSingleParagraphWithoutAttributes", function() { return isSingleParagraphWithoutAttributes; });
  61470. /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
  61471. /* harmony import */ var _ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-widget/src/utils */ "./node_modules/@ckeditor/ckeditor5-widget/src/utils.js");
  61472. /**
  61473. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  61474. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  61475. */
  61476. /**
  61477. * @module table/converters/downcast
  61478. */
  61479. /**
  61480. * Model table element to view table element conversion helper.
  61481. *
  61482. * This conversion helper creates the whole table element with child elements.
  61483. *
  61484. * @param {Object} options
  61485. * @param {Boolean} options.asWidget If set to `true`, the downcast conversion will produce a widget.
  61486. * @returns {Function} Conversion helper.
  61487. */
  61488. function downcastInsertTable( options = {} ) {
  61489. return dispatcher => dispatcher.on( 'insert:table', ( evt, data, conversionApi ) => {
  61490. const table = data.item;
  61491. if ( !conversionApi.consumable.consume( table, 'insert' ) ) {
  61492. return;
  61493. }
  61494. // Consume attributes if present to not fire attribute change downcast
  61495. conversionApi.consumable.consume( table, 'attribute:headingRows:table' );
  61496. conversionApi.consumable.consume( table, 'attribute:headingColumns:table' );
  61497. const asWidget = options && options.asWidget;
  61498. const figureElement = conversionApi.writer.createContainerElement( 'figure', { class: 'table' } );
  61499. const tableElement = conversionApi.writer.createContainerElement( 'table' );
  61500. conversionApi.writer.insert( conversionApi.writer.createPositionAt( figureElement, 0 ), tableElement );
  61501. let tableWidget;
  61502. if ( asWidget ) {
  61503. tableWidget = toTableWidget( figureElement, conversionApi.writer );
  61504. }
  61505. const tableWalker = new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table );
  61506. const tableAttributes = {
  61507. headingRows: table.getAttribute( 'headingRows' ) || 0,
  61508. headingColumns: table.getAttribute( 'headingColumns' ) || 0
  61509. };
  61510. // Cache for created table rows.
  61511. const viewRows = new Map();
  61512. for ( const tableSlot of tableWalker ) {
  61513. const { row, cell } = tableSlot;
  61514. const tableRow = table.getChild( row );
  61515. const trElement = viewRows.get( row ) || createTr( tableElement, tableRow, row, tableAttributes, conversionApi );
  61516. viewRows.set( row, trElement );
  61517. // Consume table cell - it will be always consumed as we convert whole table at once.
  61518. conversionApi.consumable.consume( cell, 'insert' );
  61519. const insertPosition = conversionApi.writer.createPositionAt( trElement, 'end' );
  61520. createViewTableCellElement( tableSlot, tableAttributes, insertPosition, conversionApi, options );
  61521. }
  61522. // Insert empty TR elements if there are any rows without anchored cells. Since the model is always normalized
  61523. // this can happen only in the document fragment that only part of the table is down-casted.
  61524. for ( const tableRow of table.getChildren() ) {
  61525. const rowIndex = tableRow.index;
  61526. if ( !viewRows.has( rowIndex ) ) {
  61527. viewRows.set( rowIndex, createTr( tableElement, tableRow, rowIndex, tableAttributes, conversionApi ) );
  61528. }
  61529. }
  61530. const viewPosition = conversionApi.mapper.toViewPosition( data.range.start );
  61531. conversionApi.mapper.bindElements( table, asWidget ? tableWidget : figureElement );
  61532. conversionApi.writer.insert( viewPosition, asWidget ? tableWidget : figureElement );
  61533. } );
  61534. }
  61535. /**
  61536. * Model row element to view `<tr>` element conversion helper.
  61537. *
  61538. * This conversion helper creates the whole `<tr>` element with child elements.
  61539. *
  61540. * @returns {Function} Conversion helper.
  61541. */
  61542. function downcastInsertRow() {
  61543. return dispatcher => dispatcher.on( 'insert:tableRow', ( evt, data, conversionApi ) => {
  61544. const tableRow = data.item;
  61545. if ( !conversionApi.consumable.consume( tableRow, 'insert' ) ) {
  61546. return;
  61547. }
  61548. const table = tableRow.parent;
  61549. const figureElement = conversionApi.mapper.toViewElement( table );
  61550. const tableElement = getViewTable( figureElement );
  61551. const row = table.getChildIndex( tableRow );
  61552. const tableWalker = new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table, { row } );
  61553. const tableAttributes = {
  61554. headingRows: table.getAttribute( 'headingRows' ) || 0,
  61555. headingColumns: table.getAttribute( 'headingColumns' ) || 0
  61556. };
  61557. // Cache for created table rows.
  61558. const viewRows = new Map();
  61559. for ( const tableSlot of tableWalker ) {
  61560. const trElement = viewRows.get( row ) || createTr( tableElement, tableRow, row, tableAttributes, conversionApi );
  61561. viewRows.set( row, trElement );
  61562. // Consume table cell - it will be always consumed as we convert whole row at once.
  61563. conversionApi.consumable.consume( tableSlot.cell, 'insert' );
  61564. const insertPosition = conversionApi.writer.createPositionAt( trElement, 'end' );
  61565. createViewTableCellElement( tableSlot, tableAttributes, insertPosition, conversionApi, { asWidget: true } );
  61566. }
  61567. } );
  61568. }
  61569. /**
  61570. * Model table cell element to view `<td>` or `<th>` element conversion helper.
  61571. *
  61572. * This conversion helper will create proper `<th>` elements for table cells that are in the heading section (heading row or column)
  61573. * and `<td>` otherwise.
  61574. *
  61575. * @returns {Function} Conversion helper.
  61576. */
  61577. function downcastInsertCell() {
  61578. return dispatcher => dispatcher.on( 'insert:tableCell', ( evt, data, conversionApi ) => {
  61579. const tableCell = data.item;
  61580. if ( !conversionApi.consumable.consume( tableCell, 'insert' ) ) {
  61581. return;
  61582. }
  61583. const tableRow = tableCell.parent;
  61584. const table = tableRow.parent;
  61585. const rowIndex = table.getChildIndex( tableRow );
  61586. const tableWalker = new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table, { row: rowIndex } );
  61587. const tableAttributes = {
  61588. headingRows: table.getAttribute( 'headingRows' ) || 0,
  61589. headingColumns: table.getAttribute( 'headingColumns' ) || 0
  61590. };
  61591. // We need to iterate over a table in order to get proper row & column values from a walker
  61592. for ( const tableSlot of tableWalker ) {
  61593. if ( tableSlot.cell === tableCell ) {
  61594. const trElement = conversionApi.mapper.toViewElement( tableRow );
  61595. const insertPosition = conversionApi.writer.createPositionAt( trElement, tableRow.getChildIndex( tableCell ) );
  61596. createViewTableCellElement( tableSlot, tableAttributes, insertPosition, conversionApi, { asWidget: true } );
  61597. // No need to iterate further.
  61598. return;
  61599. }
  61600. }
  61601. } );
  61602. }
  61603. /**
  61604. * Conversion helper that acts on heading column table attribute change.
  61605. *
  61606. * Depending on changed attributes this converter will rename `<td` to `<th>` elements or vice versa depending on the cell column index.
  61607. *
  61608. * @returns {Function} Conversion helper.
  61609. */
  61610. function downcastTableHeadingColumnsChange() {
  61611. return dispatcher => dispatcher.on( 'attribute:headingColumns:table', ( evt, data, conversionApi ) => {
  61612. const table = data.item;
  61613. if ( !conversionApi.consumable.consume( data.item, evt.name ) ) {
  61614. return;
  61615. }
  61616. const tableAttributes = {
  61617. headingRows: table.getAttribute( 'headingRows' ) || 0,
  61618. headingColumns: table.getAttribute( 'headingColumns' ) || 0
  61619. };
  61620. const oldColumns = data.attributeOldValue;
  61621. const newColumns = data.attributeNewValue;
  61622. const lastColumnToCheck = ( oldColumns > newColumns ? oldColumns : newColumns ) - 1;
  61623. for ( const tableSlot of new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table, { endColumn: lastColumnToCheck } ) ) {
  61624. renameViewTableCellIfRequired( tableSlot, tableAttributes, conversionApi );
  61625. }
  61626. } );
  61627. }
  61628. /**
  61629. * Conversion helper that acts on a removed row.
  61630. *
  61631. * @returns {Function} Conversion helper.
  61632. */
  61633. function downcastRemoveRow() {
  61634. return dispatcher => dispatcher.on( 'remove:tableRow', ( evt, data, conversionApi ) => {
  61635. // Prevent default remove converter.
  61636. evt.stop();
  61637. const viewWriter = conversionApi.writer;
  61638. const mapper = conversionApi.mapper;
  61639. const viewStart = mapper.toViewPosition( data.position ).getLastMatchingPosition( value => !value.item.is( 'element', 'tr' ) );
  61640. const viewItem = viewStart.nodeAfter;
  61641. const tableSection = viewItem.parent;
  61642. const viewTable = tableSection.parent;
  61643. // Remove associated <tr> from the view.
  61644. const removeRange = viewWriter.createRangeOn( viewItem );
  61645. const removed = viewWriter.remove( removeRange );
  61646. for ( const child of viewWriter.createRangeIn( removed ).getItems() ) {
  61647. mapper.unbindViewElement( child );
  61648. }
  61649. // Cleanup: Ensure that thead & tbody sections are removed if left empty after removing rows. See #6437, #6391.
  61650. removeTableSectionIfEmpty( 'thead', viewTable, conversionApi );
  61651. removeTableSectionIfEmpty( 'tbody', viewTable, conversionApi );
  61652. }, { priority: 'higher' } );
  61653. }
  61654. /**
  61655. * Overrides paragraph inside table cell conversion.
  61656. *
  61657. * This converter:
  61658. * * should be used to override default paragraph conversion in the editing view.
  61659. * * It will only convert <paragraph> placed directly inside <tableCell>.
  61660. * * For a single paragraph without attributes it returns `<span>` to simulate data table.
  61661. * * For all other cases it returns `<p>` element.
  61662. *
  61663. * @param {module:engine/model/element~Element} modelElement
  61664. * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
  61665. * @returns {module:engine/view/containerelement~ContainerElement|undefined}
  61666. */
  61667. function convertParagraphInTableCell( modelElement, conversionApi ) {
  61668. const { writer } = conversionApi;
  61669. if ( !modelElement.parent.is( 'element', 'tableCell' ) ) {
  61670. return;
  61671. }
  61672. if ( isSingleParagraphWithoutAttributes( modelElement ) ) {
  61673. // Use display:inline-block to force Chrome/Safari to limit text mutations to this element.
  61674. // See #6062.
  61675. return writer.createContainerElement( 'span', { style: 'display:inline-block' } );
  61676. } else {
  61677. return writer.createContainerElement( 'p' );
  61678. }
  61679. }
  61680. /**
  61681. * Checks if given model `<paragraph>` is an only child of a parent (`<tableCell>`) and if it has any attribute set.
  61682. *
  61683. * The paragraph should be converted in the editing view to:
  61684. *
  61685. * * If returned `true` - to a `<span style="display:inline-block">`
  61686. * * If returned `false` - to a `<p>`
  61687. *
  61688. * @param {module:engine/model/element~Element} modelElement
  61689. * @returns {Boolean}
  61690. */
  61691. function isSingleParagraphWithoutAttributes( modelElement ) {
  61692. const tableCell = modelElement.parent;
  61693. const isSingleParagraph = tableCell.childCount === 1;
  61694. return isSingleParagraph && !hasAnyAttribute( modelElement );
  61695. }
  61696. // Converts a given {@link module:engine/view/element~Element} to a table widget:
  61697. // * Adds a {@link module:engine/view/element~Element#_setCustomProperty custom property} allowing to recognize the table widget element.
  61698. // * Calls the {@link module:widget/utils~toWidget} function with the proper element's label creator.
  61699. //
  61700. // @param {module:engine/view/element~Element} viewElement
  61701. // @param {module:engine/view/downcastwriter~DowncastWriter} writer An instance of the view writer.
  61702. // @param {String} label The element's label. It will be concatenated with the table `alt` attribute if one is present.
  61703. // @returns {module:engine/view/element~Element}
  61704. function toTableWidget( viewElement, writer ) {
  61705. writer.setCustomProperty( 'table', true, viewElement );
  61706. return Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_1__["toWidget"])( viewElement, writer, { hasSelectionHandle: true } );
  61707. }
  61708. // Renames an existing table cell in the view to a given element name.
  61709. //
  61710. // **Note** This method will not do anything if a view table cell has not been converted yet.
  61711. //
  61712. // @param {module:engine/model/element~Element} tableCell
  61713. // @param {String} desiredCellElementName
  61714. // @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
  61715. function renameViewTableCell( tableCell, desiredCellElementName, conversionApi ) {
  61716. const viewWriter = conversionApi.writer;
  61717. const viewCell = conversionApi.mapper.toViewElement( tableCell );
  61718. const editable = viewWriter.createEditableElement( desiredCellElementName, viewCell.getAttributes() );
  61719. const renamedCell = Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_1__["toWidgetEditable"])( editable, viewWriter );
  61720. Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_1__["setHighlightHandling"])(
  61721. renamedCell,
  61722. viewWriter,
  61723. ( element, descriptor, writer ) => writer.addClass( normalizeToArray( descriptor.classes ), element ),
  61724. ( element, descriptor, writer ) => writer.removeClass( normalizeToArray( descriptor.classes ), element )
  61725. );
  61726. viewWriter.insert( viewWriter.createPositionAfter( viewCell ), renamedCell );
  61727. viewWriter.move( viewWriter.createRangeIn( viewCell ), viewWriter.createPositionAt( renamedCell, 0 ) );
  61728. viewWriter.remove( viewWriter.createRangeOn( viewCell ) );
  61729. conversionApi.mapper.unbindViewElement( viewCell );
  61730. conversionApi.mapper.bindElements( tableCell, renamedCell );
  61731. }
  61732. // Renames a table cell element in the view according to its location in the table.
  61733. //
  61734. // @param {module:table/tablewalker~TableSlot} tableSlot
  61735. // @param {{headingColumns, headingRows}} tableAttributes
  61736. // @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
  61737. function renameViewTableCellIfRequired( tableSlot, tableAttributes, conversionApi ) {
  61738. const { cell } = tableSlot;
  61739. // Check whether current columnIndex is overlapped by table cells from previous rows.
  61740. const desiredCellElementName = getCellElementName( tableSlot, tableAttributes );
  61741. const viewCell = conversionApi.mapper.toViewElement( cell );
  61742. // If in single change we're converting attribute changes and inserting cell the table cell might not be inserted into view
  61743. // because of child conversion is done after parent.
  61744. if ( viewCell && viewCell.name !== desiredCellElementName ) {
  61745. renameViewTableCell( cell, desiredCellElementName, conversionApi );
  61746. }
  61747. }
  61748. // Creates a table cell element in the view.
  61749. //
  61750. // @param {module:table/tablewalker~TableSlot} tableSlot
  61751. // @param {module:engine/view/position~Position} insertPosition
  61752. // @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
  61753. function createViewTableCellElement( tableSlot, tableAttributes, insertPosition, conversionApi, options ) {
  61754. const asWidget = options && options.asWidget;
  61755. const cellElementName = getCellElementName( tableSlot, tableAttributes );
  61756. const cellElement = asWidget ?
  61757. Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_1__["toWidgetEditable"])( conversionApi.writer.createEditableElement( cellElementName ), conversionApi.writer ) :
  61758. conversionApi.writer.createContainerElement( cellElementName );
  61759. if ( asWidget ) {
  61760. Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_1__["setHighlightHandling"])(
  61761. cellElement,
  61762. conversionApi.writer,
  61763. ( element, descriptor, writer ) => writer.addClass( normalizeToArray( descriptor.classes ), element ),
  61764. ( element, descriptor, writer ) => writer.removeClass( normalizeToArray( descriptor.classes ), element )
  61765. );
  61766. }
  61767. const tableCell = tableSlot.cell;
  61768. const firstChild = tableCell.getChild( 0 );
  61769. const isSingleParagraph = tableCell.childCount === 1 && firstChild.name === 'paragraph';
  61770. conversionApi.writer.insert( insertPosition, cellElement );
  61771. conversionApi.mapper.bindElements( tableCell, cellElement );
  61772. // Additional requirement for data pipeline to have backward compatible data tables.
  61773. if ( !asWidget && !hasAnyAttribute( firstChild ) && isSingleParagraph ) {
  61774. const innerParagraph = tableCell.getChild( 0 );
  61775. conversionApi.consumable.consume( innerParagraph, 'insert' );
  61776. conversionApi.mapper.bindElements( innerParagraph, cellElement );
  61777. }
  61778. }
  61779. // Creates a `<tr>` view element.
  61780. //
  61781. // @param {module:engine/view/element~Element} tableElement
  61782. // @param {module:engine/model/element~Element} tableRow
  61783. // @param {Number} rowIndex
  61784. // @param {{headingColumns, headingRows}} tableAttributes
  61785. // @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
  61786. // @returns {module:engine/view/element~Element}
  61787. function createTr( tableElement, tableRow, rowIndex, tableAttributes, conversionApi ) {
  61788. // Will always consume since we're converting <tableRow> element from a parent <table>.
  61789. conversionApi.consumable.consume( tableRow, 'insert' );
  61790. const trElement = tableRow.isEmpty ?
  61791. conversionApi.writer.createEmptyElement( 'tr' ) :
  61792. conversionApi.writer.createContainerElement( 'tr' );
  61793. conversionApi.mapper.bindElements( tableRow, trElement );
  61794. const headingRows = tableAttributes.headingRows;
  61795. const tableSection = getOrCreateTableSection( getSectionName( rowIndex, tableAttributes ), tableElement, conversionApi );
  61796. const offset = headingRows > 0 && rowIndex >= headingRows ? rowIndex - headingRows : rowIndex;
  61797. const position = conversionApi.writer.createPositionAt( tableSection, offset );
  61798. conversionApi.writer.insert( position, trElement );
  61799. return trElement;
  61800. }
  61801. // Returns `th` for heading cells and `td` for other cells for the current table walker value.
  61802. //
  61803. // @param {module:table/tablewalker~TableSlot} tableSlot
  61804. // @param {{headingColumns, headingRows}} tableAttributes
  61805. // @returns {String}
  61806. function getCellElementName( tableSlot, tableAttributes ) {
  61807. const { row, column } = tableSlot;
  61808. const { headingColumns, headingRows } = tableAttributes;
  61809. // Column heading are all tableCells in the first `columnHeading` rows.
  61810. const isColumnHeading = headingRows && headingRows > row;
  61811. // So a whole row gets <th> element.
  61812. if ( isColumnHeading ) {
  61813. return 'th';
  61814. }
  61815. // Row heading are tableCells which columnIndex is lower then headingColumns.
  61816. const isRowHeading = headingColumns && headingColumns > column;
  61817. return isRowHeading ? 'th' : 'td';
  61818. }
  61819. // Returns the table section name for the current table walker value.
  61820. //
  61821. // @param {Number} row
  61822. // @param {{headingColumns, headingRows}} tableAttributes
  61823. // @returns {String}
  61824. function getSectionName( row, tableAttributes ) {
  61825. return row < tableAttributes.headingRows ? 'thead' : 'tbody';
  61826. }
  61827. // Creates or returns an existing `<tbody>` or `<thead>` element with caching.
  61828. //
  61829. // @param {String} sectionName
  61830. // @param {module:engine/view/element~Element} viewTable
  61831. // @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
  61832. // @param {Object} cachedTableSection An object that stores cached elements.
  61833. // @returns {module:engine/view/containerelement~ContainerElement}
  61834. function getOrCreateTableSection( sectionName, viewTable, conversionApi ) {
  61835. const viewTableSection = getExistingTableSectionElement( sectionName, viewTable );
  61836. return viewTableSection ? viewTableSection : createTableSection( sectionName, viewTable, conversionApi );
  61837. }
  61838. // Finds an existing `<tbody>` or `<thead>` element or returns undefined.
  61839. //
  61840. // @param {String} sectionName
  61841. // @param {module:engine/view/element~Element} tableElement
  61842. // @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
  61843. function getExistingTableSectionElement( sectionName, tableElement ) {
  61844. for ( const tableSection of tableElement.getChildren() ) {
  61845. if ( tableSection.name == sectionName ) {
  61846. return tableSection;
  61847. }
  61848. }
  61849. }
  61850. // Creates a table section at the end of the table.
  61851. //
  61852. // @param {String} sectionName
  61853. // @param {module:engine/view/element~Element} tableElement
  61854. // @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
  61855. // @returns {module:engine/view/containerelement~ContainerElement}
  61856. function createTableSection( sectionName, tableElement, conversionApi ) {
  61857. const tableChildElement = conversionApi.writer.createContainerElement( sectionName );
  61858. const insertPosition = conversionApi.writer.createPositionAt( tableElement, sectionName == 'tbody' ? 'end' : 0 );
  61859. conversionApi.writer.insert( insertPosition, tableChildElement );
  61860. return tableChildElement;
  61861. }
  61862. // Removes an existing `<tbody>` or `<thead>` element if it is empty.
  61863. //
  61864. // @param {String} sectionName
  61865. // @param {module:engine/view/element~Element} tableElement
  61866. // @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi
  61867. function removeTableSectionIfEmpty( sectionName, tableElement, conversionApi ) {
  61868. const tableSection = getExistingTableSectionElement( sectionName, tableElement );
  61869. if ( tableSection && tableSection.childCount === 0 ) {
  61870. conversionApi.writer.remove( conversionApi.writer.createRangeOn( tableSection ) );
  61871. }
  61872. }
  61873. // Finds a '<table>' element inside the `<figure>` widget.
  61874. //
  61875. // @param {module:engine/view/element~Element} viewFigure
  61876. function getViewTable( viewFigure ) {
  61877. for ( const child of viewFigure.getChildren() ) {
  61878. if ( child.name === 'table' ) {
  61879. return child;
  61880. }
  61881. }
  61882. }
  61883. // Checks if an element has any attributes set.
  61884. //
  61885. // @param {module:engine/model/element~Element element
  61886. // @returns {Boolean}
  61887. function hasAnyAttribute( element ) {
  61888. return !![ ...element.getAttributeKeys() ].length;
  61889. }
  61890. function normalizeToArray( classes ) {
  61891. return Array.isArray( classes ) ? classes : [ classes ];
  61892. }
  61893. /***/ }),
  61894. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/converters/table-cell-paragraph-post-fixer.js":
  61895. /*!**************************************************************************************************!*\
  61896. !*** ./node_modules/@ckeditor/ckeditor5-table/src/converters/table-cell-paragraph-post-fixer.js ***!
  61897. \**************************************************************************************************/
  61898. /*! exports provided: default */
  61899. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  61900. "use strict";
  61901. __webpack_require__.r(__webpack_exports__);
  61902. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return injectTableCellParagraphPostFixer; });
  61903. /**
  61904. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  61905. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  61906. */
  61907. /**
  61908. * @module table/converters/table-cell-paragraph-post-fixer
  61909. */
  61910. /**
  61911. * Injects a table cell post-fixer into the model which inserts a `paragraph` element into empty table cells.
  61912. *
  61913. * A table cell must contain at least one block element as a child. An empty table cell will have an empty `paragraph` as a child.
  61914. *
  61915. * <table>
  61916. * <tableRow>
  61917. * <tableCell></tableCell>
  61918. * </tableRow>
  61919. * </table>
  61920. *
  61921. * Will be fixed to:
  61922. *
  61923. * <table>
  61924. * <tableRow>
  61925. * <tableCell><paragraph></paragraph></tableCell>
  61926. * </tableRow>
  61927. * </table>
  61928. *
  61929. * @param {module:engine/model/model~Model} model
  61930. */
  61931. function injectTableCellParagraphPostFixer( model ) {
  61932. model.document.registerPostFixer( writer => tableCellContentsPostFixer( writer, model ) );
  61933. }
  61934. // The table cell contents post-fixer.
  61935. //
  61936. // @param {module:engine/model/writer~Writer} writer
  61937. // @param {module:engine/model/model~Model} model
  61938. function tableCellContentsPostFixer( writer, model ) {
  61939. const changes = model.document.differ.getChanges();
  61940. let wasFixed = false;
  61941. for ( const entry of changes ) {
  61942. if ( entry.type == 'insert' && entry.name == 'table' ) {
  61943. wasFixed = fixTable( entry.position.nodeAfter, writer ) || wasFixed;
  61944. }
  61945. if ( entry.type == 'insert' && entry.name == 'tableRow' ) {
  61946. wasFixed = fixTableRow( entry.position.nodeAfter, writer ) || wasFixed;
  61947. }
  61948. if ( entry.type == 'insert' && entry.name == 'tableCell' ) {
  61949. wasFixed = fixTableCellContent( entry.position.nodeAfter, writer ) || wasFixed;
  61950. }
  61951. if ( checkTableCellChange( entry ) ) {
  61952. wasFixed = fixTableCellContent( entry.position.parent, writer ) || wasFixed;
  61953. }
  61954. }
  61955. return wasFixed;
  61956. }
  61957. // Fixes all table cells in a table.
  61958. //
  61959. // @param {module:engine/model/element~Element} table
  61960. // @param {module:engine/model/writer~Writer} writer
  61961. function fixTable( table, writer ) {
  61962. let wasFixed = false;
  61963. for ( const row of table.getChildren() ) {
  61964. wasFixed = fixTableRow( row, writer ) || wasFixed;
  61965. }
  61966. return wasFixed;
  61967. }
  61968. // Fixes all table cells in a table row.
  61969. //
  61970. // @param {module:engine/model/element~Element} tableRow
  61971. // @param {module:engine/model/writer~Writer} writer
  61972. function fixTableRow( tableRow, writer ) {
  61973. let wasFixed = false;
  61974. for ( const tableCell of tableRow.getChildren() ) {
  61975. wasFixed = fixTableCellContent( tableCell, writer ) || wasFixed;
  61976. }
  61977. return wasFixed;
  61978. }
  61979. // Fixes all table cell content by:
  61980. // - Adding a paragraph to a table cell without any child.
  61981. // - Wrapping direct $text in a `<paragraph>`.
  61982. //
  61983. // @param {module:engine/model/element~Element} table
  61984. // @param {module:engine/model/writer~Writer} writer
  61985. // @returns {Boolean}
  61986. function fixTableCellContent( tableCell, writer ) {
  61987. // Insert paragraph to an empty table cell.
  61988. if ( tableCell.childCount == 0 ) {
  61989. // @if CK_DEBUG_TABLE // console.log( 'Post-fixing table: insert paragraph in empty cell.' );
  61990. writer.insertElement( 'paragraph', tableCell );
  61991. return true;
  61992. }
  61993. // Check table cell children for directly placed text nodes.
  61994. // Temporary solution. See https://github.com/ckeditor/ckeditor5/issues/1464.
  61995. const textNodes = Array.from( tableCell.getChildren() ).filter( child => child.is( '$text' ) );
  61996. // @if CK_DEBUG_TABLE // textNodes.length && console.log( 'Post-fixing table: wrap cell content with paragraph.' );
  61997. for ( const child of textNodes ) {
  61998. writer.wrap( writer.createRangeOn( child ), 'paragraph' );
  61999. }
  62000. // Return true when there were text nodes to fix.
  62001. return !!textNodes.length;
  62002. }
  62003. // Checks if a differ change should fix the table cell. This happens on:
  62004. // - Removing content from the table cell (i.e. `tableCell` can be left empty).
  62005. // - Adding a text node directly into a table cell.
  62006. //
  62007. // @param {Object} differ change entry
  62008. // @returns {Boolean}
  62009. function checkTableCellChange( entry ) {
  62010. if ( !entry.position || !entry.position.parent.is( 'element', 'tableCell' ) ) {
  62011. return false;
  62012. }
  62013. return entry.type == 'insert' && entry.name == '$text' || entry.type == 'remove';
  62014. }
  62015. /***/ }),
  62016. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/converters/table-cell-refresh-post-fixer.js":
  62017. /*!************************************************************************************************!*\
  62018. !*** ./node_modules/@ckeditor/ckeditor5-table/src/converters/table-cell-refresh-post-fixer.js ***!
  62019. \************************************************************************************************/
  62020. /*! exports provided: default */
  62021. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  62022. "use strict";
  62023. __webpack_require__.r(__webpack_exports__);
  62024. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return injectTableCellRefreshPostFixer; });
  62025. /* harmony import */ var _downcast__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./downcast */ "./node_modules/@ckeditor/ckeditor5-table/src/converters/downcast.js");
  62026. /**
  62027. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  62028. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  62029. */
  62030. /**
  62031. * @module table/converters/table-cell-refresh-post-fixer
  62032. */
  62033. /**
  62034. * Injects a table cell post-fixer into the model which marks the table cell in the differ to have it re-rendered.
  62035. *
  62036. * Model `paragraph` inside a table cell can be rendered as `<span>` or `<p>`. It is rendered as `<span>` if this is the only block
  62037. * element in that table cell and it does not have any attributes. It is rendered as `<p>` otherwise.
  62038. *
  62039. * When table cell content changes, for example a second `paragraph` element is added, we need to ensure that the first `paragraph` is
  62040. * re-rendered so it changes from `<span>` to `<p>`. The easiest way to do it is to re-render the entire table cell.
  62041. *
  62042. * @param {module:engine/model/model~Model} model
  62043. * @param {module:engine/conversion/mapper~Mapper} mapper
  62044. */
  62045. function injectTableCellRefreshPostFixer( model, mapper ) {
  62046. model.document.registerPostFixer( () => tableCellRefreshPostFixer( model.document.differ, mapper ) );
  62047. }
  62048. function tableCellRefreshPostFixer( differ, mapper ) {
  62049. // Stores cells to be refreshed, so the table cell will be refreshed once for multiple changes.
  62050. // 1. Gather all changes inside table cell.
  62051. const cellsToCheck = new Set();
  62052. for ( const change of differ.getChanges() ) {
  62053. const parent = change.type == 'attribute' ? change.range.start.parent : change.position.parent;
  62054. if ( parent.is( 'element', 'tableCell' ) ) {
  62055. cellsToCheck.add( parent );
  62056. }
  62057. }
  62058. // @if CK_DEBUG_TABLE // console.log( `Post-fixing table: Checking table cell to refresh (${ cellsToCheck.size }).` );
  62059. // @if CK_DEBUG_TABLE // let paragraphsRefreshed = 0;
  62060. for ( const tableCell of cellsToCheck.values() ) {
  62061. for ( const paragraph of [ ...tableCell.getChildren() ].filter( child => shouldRefresh( child, mapper ) ) ) {
  62062. // @if CK_DEBUG_TABLE // console.log( `Post-fixing table: refreshing paragraph in table cell (${++paragraphsRefreshed}).` );
  62063. differ.refreshItem( paragraph );
  62064. }
  62065. }
  62066. // Always return false to prevent the refresh post-fixer from re-running on the same set of changes and going into an infinite loop.
  62067. // This "post-fixer" does not change the model structure so there shouldn't be need to run other post-fixers again.
  62068. // See https://github.com/ckeditor/ckeditor5/issues/1936 & https://github.com/ckeditor/ckeditor5/issues/8200.
  62069. return false;
  62070. }
  62071. // Check if given model element needs refreshing.
  62072. //
  62073. // @param {module:engine/model/element~Element} modelElement
  62074. // @param {module:engine/conversion/mapper~Mapper} mapper
  62075. // @returns {Boolean}
  62076. function shouldRefresh( child, mapper ) {
  62077. if ( !child.is( 'element', 'paragraph' ) ) {
  62078. return false;
  62079. }
  62080. const viewElement = mapper.toViewElement( child );
  62081. if ( !viewElement ) {
  62082. return false;
  62083. }
  62084. return Object(_downcast__WEBPACK_IMPORTED_MODULE_0__["isSingleParagraphWithoutAttributes"])( child ) !== viewElement.is( 'element', 'span' );
  62085. }
  62086. /***/ }),
  62087. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/converters/table-heading-rows-refresh-post-fixer.js":
  62088. /*!********************************************************************************************************!*\
  62089. !*** ./node_modules/@ckeditor/ckeditor5-table/src/converters/table-heading-rows-refresh-post-fixer.js ***!
  62090. \********************************************************************************************************/
  62091. /*! exports provided: default */
  62092. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  62093. "use strict";
  62094. __webpack_require__.r(__webpack_exports__);
  62095. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return injectTableHeadingRowsRefreshPostFixer; });
  62096. /**
  62097. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  62098. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  62099. */
  62100. /**
  62101. * @module table/converters/table-heading-rows-refresh-post-fixer
  62102. */
  62103. /**
  62104. * Injects a table post-fixer into the model which marks the table in the differ to have it re-rendered.
  62105. *
  62106. * Table heading rows are represented in the model by a `headingRows` attribute. However, in the view, it's represented as separate
  62107. * sections of the table (`<thead>` or `<tbody>`) and changing `headingRows` attribute requires moving table rows between two sections.
  62108. * This causes problems with structural changes in a table (like adding and removing rows) thus atomic converters cannot be used.
  62109. *
  62110. * When table `headingRows` attribute changes, the entire table is re-rendered.
  62111. *
  62112. * @param {module:engine/model/model~Model} model
  62113. */
  62114. function injectTableHeadingRowsRefreshPostFixer( model ) {
  62115. model.document.registerPostFixer( () => tableHeadingRowsRefreshPostFixer( model ) );
  62116. }
  62117. function tableHeadingRowsRefreshPostFixer( model ) {
  62118. const differ = model.document.differ;
  62119. // Stores tables to be refreshed so the table will be refreshed once for multiple changes.
  62120. const tablesToRefresh = new Set();
  62121. for ( const change of differ.getChanges() ) {
  62122. if ( change.type != 'attribute' ) {
  62123. continue;
  62124. }
  62125. const element = change.range.start.nodeAfter;
  62126. if ( element && element.is( 'element', 'table' ) && change.attributeKey == 'headingRows' ) {
  62127. tablesToRefresh.add( element );
  62128. }
  62129. }
  62130. if ( tablesToRefresh.size ) {
  62131. // @if CK_DEBUG_TABLE // console.log( `Post-fixing table: refreshing heading rows (${ tablesToRefresh.size }).` );
  62132. for ( const table of tablesToRefresh.values() ) {
  62133. // Should be handled by a `triggerBy` configuration. See: https://github.com/ckeditor/ckeditor5/issues/8138.
  62134. differ.refreshItem( table );
  62135. }
  62136. return true;
  62137. }
  62138. return false;
  62139. }
  62140. /***/ }),
  62141. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/converters/table-layout-post-fixer.js":
  62142. /*!******************************************************************************************!*\
  62143. !*** ./node_modules/@ckeditor/ckeditor5-table/src/converters/table-layout-post-fixer.js ***!
  62144. \******************************************************************************************/
  62145. /*! exports provided: default */
  62146. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  62147. "use strict";
  62148. __webpack_require__.r(__webpack_exports__);
  62149. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return injectTableLayoutPostFixer; });
  62150. /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
  62151. /* harmony import */ var _utils_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/common */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js");
  62152. /**
  62153. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  62154. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  62155. */
  62156. /**
  62157. * @module table/converters/table-layout-post-fixer
  62158. */
  62159. /**
  62160. * Injects a table layout post-fixer into the model.
  62161. *
  62162. * The role of the table layout post-fixer is to ensure that the table rows have the correct structure
  62163. * after a {@link module:engine/model/model~Model#change `change()`} block was executed.
  62164. *
  62165. * The correct structure means that:
  62166. *
  62167. * * All table rows have the same size.
  62168. * * None of the table cells extend vertically beyond their section (either header or body).
  62169. * * A table cell has always at least one element as a child.
  62170. *
  62171. * If the table structure is not correct, the post-fixer will automatically correct it in two steps:
  62172. *
  62173. * 1. It will clip table cells that extend beyond their section.
  62174. * 2. It will add empty table cells to the rows that are narrower than the widest table row.
  62175. *
  62176. * ## Clipping overlapping table cells
  62177. *
  62178. * Such situation may occur when pasting a table (or a part of a table) to the editor from external sources.
  62179. *
  62180. * For example, see the following table which has a cell (FOO) with the rowspan attribute (2):
  62181. *
  62182. * <table headingRows="1">
  62183. * <tableRow>
  62184. * <tableCell rowspan="2"><paragraph>FOO</paragraph></tableCell>
  62185. * <tableCell colspan="2"><paragraph>BAR</paragraph></tableCell>
  62186. * </tableRow>
  62187. * <tableRow>
  62188. * <tableCell><paragraph>BAZ</paragraph></tableCell>
  62189. * <tableCell><paragraph>XYZ</paragraph></tableCell>
  62190. * </tableRow>
  62191. * </table>
  62192. *
  62193. * It will be rendered in the view as:
  62194. *
  62195. * <table>
  62196. * <thead>
  62197. * <tr>
  62198. * <td rowspan="2">FOO</td>
  62199. * <td colspan="2">BAR</td>
  62200. * </tr>
  62201. * </thead>
  62202. * <tbody>
  62203. * <tr>
  62204. * <td>BAZ</td>
  62205. * <td>XYZ</td>
  62206. * </tr>
  62207. * </tbody>
  62208. * </table>
  62209. *
  62210. * In the above example the table will be rendered as a table with two rows: one in the header and second one in the body.
  62211. * The table cell (FOO) cannot span over multiple rows as it would extend from the header to the body section.
  62212. * The `rowspan` attribute must be changed to (1). The value (1) is the default value of the `rowspan` attribute
  62213. * so the `rowspan` attribute will be removed from the model.
  62214. *
  62215. * The table cell with BAZ in the content will be in the first column of the table.
  62216. *
  62217. * ## Adding missing table cells
  62218. *
  62219. * The table post-fixer will insert empty table cells to equalize table row sizes (the number of columns).
  62220. * The size of a table row is calculated by counting column spans of table cells, both horizontal (from the same row) and
  62221. * vertical (from the rows above).
  62222. *
  62223. * In the above example, the table row in the body section of the table is narrower then the row from the header: it has two cells
  62224. * with the default colspan (1). The header row has one cell with colspan (1) and the second with colspan (2).
  62225. * The table cell (FOO) does not extend beyond the head section (and as such will be fixed in the first step of this post-fixer).
  62226. * The post-fixer will add a missing table cell to the row in the body section of the table.
  62227. *
  62228. * The table from the above example will be fixed and rendered to the view as below:
  62229. *
  62230. * <table>
  62231. * <thead>
  62232. * <tr>
  62233. * <td rowspan="2">FOO</td>
  62234. * <td colspan="2">BAR</td>
  62235. * </tr>
  62236. * </thead>
  62237. * <tbody>
  62238. * <tr>
  62239. * <td>BAZ</td>
  62240. * <td>XYZ</td>
  62241. * </tr>
  62242. * </tbody>
  62243. * </table>
  62244. *
  62245. * ## Collaboration and undo - Expectations vs post-fixer results
  62246. *
  62247. * The table post-fixer only ensures proper structure without a deeper analysis of the nature of the change. As such, it might lead
  62248. * to a structure which was not intended by the user. In particular, it will also fix undo steps (in conjunction with collaboration)
  62249. * in which the editor content might not return to the original state.
  62250. *
  62251. * This will usually happen when one or more users change the size of the table.
  62252. *
  62253. * As an example see the table below:
  62254. *
  62255. * <table>
  62256. * <tbody>
  62257. * <tr>
  62258. * <td>11</td>
  62259. * <td>12</td>
  62260. * </tr>
  62261. * <tr>
  62262. * <td>21</td>
  62263. * <td>22</td>
  62264. * </tr>
  62265. * </tbody>
  62266. * </table>
  62267. *
  62268. * and the user actions:
  62269. *
  62270. * 1. Both users have a table with two rows and two columns.
  62271. * 2. User A adds a column at the end of the table. This will insert empty table cells to two rows.
  62272. * 3. User B adds a row at the end of the table. This will insert a row with two empty table cells.
  62273. * 4. Both users will have a table as below:
  62274. *
  62275. *
  62276. * <table>
  62277. * <tbody>
  62278. * <tr>
  62279. * <td>11</td>
  62280. * <td>12</td>
  62281. * <td>(empty, inserted by A)</td>
  62282. * </tr>
  62283. * <tr>
  62284. * <td>21</td>
  62285. * <td>22</td>
  62286. * <td>(empty, inserted by A)</td>
  62287. * </tr>
  62288. * <tr>
  62289. * <td>(empty, inserted by B)</td>
  62290. * <td>(empty, inserted by B)</td>
  62291. * </tr>
  62292. * </tbody>
  62293. * </table>
  62294. *
  62295. * The last row is shorter then others so the table post-fixer will add an empty row to the last row:
  62296. *
  62297. * <table>
  62298. * <tbody>
  62299. * <tr>
  62300. * <td>11</td>
  62301. * <td>12</td>
  62302. * <td>(empty, inserted by A)</td>
  62303. * </tr>
  62304. * <tr>
  62305. * <td>21</td>
  62306. * <td>22</td>
  62307. * <td>(empty, inserted by A)</td>
  62308. * </tr>
  62309. * <tr>
  62310. * <td>(empty, inserted by B)</td>
  62311. * <td>(empty, inserted by B)</td>
  62312. * <td>(empty, inserted by the post-fixer)</td>
  62313. * </tr>
  62314. * </tbody>
  62315. * </table>
  62316. *
  62317. * Unfortunately undo does not know the nature of the changes and depending on which user applies the post-fixer changes, undoing them
  62318. * might lead to a broken table. If User B undoes inserting the column to the table, the undo engine will undo only the operations of
  62319. * inserting empty cells to rows from the initial table state (row 1 and 2) but the cell in the post-fixed row will remain:
  62320. *
  62321. * <table>
  62322. * <tbody>
  62323. * <tr>
  62324. * <td>11</td>
  62325. * <td>12</td>
  62326. * </tr>
  62327. * <tr>
  62328. * <td>21</td>
  62329. * <td>22</td>
  62330. * </tr>
  62331. * <tr>
  62332. * <td>(empty, inserted by B)</td>
  62333. * <td>(empty, inserted by B)</td>
  62334. * <td>(empty, inserted by a post-fixer)</td>
  62335. * </tr>
  62336. * </tbody>
  62337. * </table>
  62338. *
  62339. * After undo, the table post-fixer will detect that two rows are shorter than others and will fix the table to:
  62340. *
  62341. * <table>
  62342. * <tbody>
  62343. * <tr>
  62344. * <td>11</td>
  62345. * <td>12</td>
  62346. * <td>(empty, inserted by a post-fixer after undo)</td>
  62347. * </tr>
  62348. * <tr>
  62349. * <td>21</td>
  62350. * <td>22</td>
  62351. * <td>(empty, inserted by a post-fixer after undo)</td>
  62352. * </tr>
  62353. * <tr>
  62354. * <td>(empty, inserted by B)</td>
  62355. * <td>(empty, inserted by B)</td>
  62356. * <td>(empty, inserted by a post-fixer)</td>
  62357. * </tr>
  62358. * </tbody>
  62359. * </table>
  62360. * @param {module:engine/model/model~Model} model
  62361. */
  62362. function injectTableLayoutPostFixer( model ) {
  62363. model.document.registerPostFixer( writer => tableLayoutPostFixer( writer, model ) );
  62364. }
  62365. // The table layout post-fixer.
  62366. //
  62367. // @param {module:engine/model/writer~Writer} writer
  62368. // @param {module:engine/model/model~Model} model
  62369. function tableLayoutPostFixer( writer, model ) {
  62370. const changes = model.document.differ.getChanges();
  62371. let wasFixed = false;
  62372. // Do not analyze the same table more then once - may happen for multiple changes in the same table.
  62373. const analyzedTables = new Set();
  62374. for ( const entry of changes ) {
  62375. let table;
  62376. if ( entry.name == 'table' && entry.type == 'insert' ) {
  62377. table = entry.position.nodeAfter;
  62378. }
  62379. // Fix table on adding/removing table cells and rows.
  62380. if ( entry.name == 'tableRow' || entry.name == 'tableCell' ) {
  62381. table = entry.position.findAncestor( 'table' );
  62382. }
  62383. // Fix table on any table's attribute change - including attributes of table cells.
  62384. if ( isTableAttributeEntry( entry ) ) {
  62385. table = entry.range.start.findAncestor( 'table' );
  62386. }
  62387. if ( table && !analyzedTables.has( table ) ) {
  62388. // Step 1: correct rowspans of table cells if necessary.
  62389. // The wasFixed flag should be true if any of tables in batch was fixed - might be more then one.
  62390. wasFixed = fixTableCellsRowspan( table, writer ) || wasFixed;
  62391. // Step 2: fix table rows sizes.
  62392. wasFixed = fixTableRowsSizes( table, writer ) || wasFixed;
  62393. analyzedTables.add( table );
  62394. }
  62395. }
  62396. return wasFixed;
  62397. }
  62398. // Fixes the invalid value of the `rowspan` attribute because a table cell cannot vertically extend beyond the table section it belongs to.
  62399. //
  62400. // @param {module:engine/model/element~Element} table
  62401. // @param {module:engine/model/writer~Writer} writer
  62402. // @returns {Boolean} Returns `true` if the table was fixed.
  62403. function fixTableCellsRowspan( table, writer ) {
  62404. let wasFixed = false;
  62405. const cellsToTrim = findCellsToTrim( table );
  62406. if ( cellsToTrim.length ) {
  62407. // @if CK_DEBUG_TABLE // console.log( `Post-fixing table: trimming cells row-spans (${ cellsToTrim.length }).` );
  62408. wasFixed = true;
  62409. for ( const data of cellsToTrim ) {
  62410. Object(_utils_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'rowspan', data.rowspan, data.cell, writer, 1 );
  62411. }
  62412. }
  62413. return wasFixed;
  62414. }
  62415. // Makes all table rows in a table the same size.
  62416. //
  62417. // @param {module:engine/model/element~Element} table
  62418. // @param {module:engine/model/writer~Writer} writer
  62419. // @returns {Boolean} Returns `true` if the table was fixed.
  62420. function fixTableRowsSizes( table, writer ) {
  62421. let wasFixed = false;
  62422. const rowsLengths = getRowsLengths( table );
  62423. const rowsToRemove = [];
  62424. // Find empty rows.
  62425. for ( const [ rowIndex, size ] of rowsLengths.entries() ) {
  62426. if ( !size ) {
  62427. rowsToRemove.push( rowIndex );
  62428. }
  62429. }
  62430. // Remove empty rows.
  62431. if ( rowsToRemove.length ) {
  62432. // @if CK_DEBUG_TABLE // console.log( `Post-fixing table: remove empty rows (${ rowsToRemove.length }).` );
  62433. wasFixed = true;
  62434. for ( const rowIndex of rowsToRemove.reverse() ) {
  62435. writer.remove( table.getChild( rowIndex ) );
  62436. rowsLengths.splice( rowIndex, 1 );
  62437. }
  62438. }
  62439. // Verify if all the rows have the same number of columns.
  62440. const tableSize = rowsLengths[ 0 ];
  62441. const isValid = rowsLengths.every( length => length === tableSize );
  62442. if ( !isValid ) {
  62443. // @if CK_DEBUG_TABLE // console.log( 'Post-fixing table: adding missing cells.' );
  62444. // Find the maximum number of columns.
  62445. const maxColumns = rowsLengths.reduce( ( prev, current ) => current > prev ? current : prev, 0 );
  62446. for ( const [ rowIndex, size ] of rowsLengths.entries() ) {
  62447. const columnsToInsert = maxColumns - size;
  62448. if ( columnsToInsert ) {
  62449. for ( let i = 0; i < columnsToInsert; i++ ) {
  62450. Object(_utils_common__WEBPACK_IMPORTED_MODULE_1__["createEmptyTableCell"])( writer, writer.createPositionAt( table.getChild( rowIndex ), 'end' ) );
  62451. }
  62452. wasFixed = true;
  62453. }
  62454. }
  62455. }
  62456. return wasFixed;
  62457. }
  62458. // Searches for table cells that extend beyond the table section to which they belong to. It will return an array of objects
  62459. // that stores table cells to be trimmed and the correct value of the `rowspan` attribute to set.
  62460. //
  62461. // @param {module:engine/model/element~Element} table
  62462. // @returns {Array.<{{cell, rowspan}}>}
  62463. function findCellsToTrim( table ) {
  62464. const headingRows = parseInt( table.getAttribute( 'headingRows' ) || 0 );
  62465. const maxRows = table.childCount;
  62466. const cellsToTrim = [];
  62467. for ( const { row, cell, cellHeight } of new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table ) ) {
  62468. // Skip cells that do not expand over its row.
  62469. if ( cellHeight < 2 ) {
  62470. continue;
  62471. }
  62472. const isInHeader = row < headingRows;
  62473. // Row limit is either end of header section or whole table as table body is after the header.
  62474. const rowLimit = isInHeader ? headingRows : maxRows;
  62475. // If table cell expands over its limit reduce it height to proper value.
  62476. if ( row + cellHeight > rowLimit ) {
  62477. const newRowspan = rowLimit - row;
  62478. cellsToTrim.push( { cell, rowspan: newRowspan } );
  62479. }
  62480. }
  62481. return cellsToTrim;
  62482. }
  62483. // Returns an array with lengths of rows assigned to the corresponding row index.
  62484. //
  62485. // @param {module:engine/model/element~Element} table
  62486. // @returns {Array.<Number>}
  62487. function getRowsLengths( table ) {
  62488. // TableWalker will not provide items for the empty rows, we need to pre-fill this array.
  62489. const lengths = new Array( table.childCount ).fill( 0 );
  62490. for ( const { row } of new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table, { includeAllSlots: true } ) ) {
  62491. lengths[ row ]++;
  62492. }
  62493. return lengths;
  62494. }
  62495. // Checks if the differ entry for an attribute change is one of the table's attributes.
  62496. //
  62497. // @param entry
  62498. // @returns {Boolean}
  62499. function isTableAttributeEntry( entry ) {
  62500. const isAttributeType = entry.type === 'attribute';
  62501. const key = entry.attributeKey;
  62502. return isAttributeType && ( key === 'headingRows' || key === 'colspan' || key === 'rowspan' );
  62503. }
  62504. /***/ }),
  62505. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/converters/upcasttable.js":
  62506. /*!******************************************************************************!*\
  62507. !*** ./node_modules/@ckeditor/ckeditor5-table/src/converters/upcasttable.js ***!
  62508. \******************************************************************************/
  62509. /*! exports provided: default, skipEmptyTableRow */
  62510. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  62511. "use strict";
  62512. __webpack_require__.r(__webpack_exports__);
  62513. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return upcastTable; });
  62514. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "skipEmptyTableRow", function() { return skipEmptyTableRow; });
  62515. /* harmony import */ var _utils_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/common */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js");
  62516. /**
  62517. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  62518. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  62519. */
  62520. /**
  62521. * @module table/converters/upcasttable
  62522. */
  62523. /**
  62524. * View table element to model table element conversion helper.
  62525. *
  62526. * This conversion helper converts the table element as well as table rows.
  62527. *
  62528. * @returns {Function} Conversion helper.
  62529. */
  62530. function upcastTable() {
  62531. return dispatcher => {
  62532. dispatcher.on( 'element:table', ( evt, data, conversionApi ) => {
  62533. const viewTable = data.viewItem;
  62534. // When element was already consumed then skip it.
  62535. if ( !conversionApi.consumable.test( viewTable, { name: true } ) ) {
  62536. return;
  62537. }
  62538. const { rows, headingRows, headingColumns } = scanTable( viewTable );
  62539. // Only set attributes if values is greater then 0.
  62540. const attributes = {};
  62541. if ( headingColumns ) {
  62542. attributes.headingColumns = headingColumns;
  62543. }
  62544. if ( headingRows ) {
  62545. attributes.headingRows = headingRows;
  62546. }
  62547. const table = conversionApi.writer.createElement( 'table', attributes );
  62548. if ( !conversionApi.safeInsert( table, data.modelCursor ) ) {
  62549. return;
  62550. }
  62551. conversionApi.consumable.consume( viewTable, { name: true } );
  62552. // Upcast table rows in proper order (heading rows first).
  62553. rows.forEach( row => conversionApi.convertItem( row, conversionApi.writer.createPositionAt( table, 'end' ) ) );
  62554. // Create one row and one table cell for empty table.
  62555. if ( table.isEmpty ) {
  62556. const row = conversionApi.writer.createElement( 'tableRow' );
  62557. conversionApi.writer.insert( row, conversionApi.writer.createPositionAt( table, 'end' ) );
  62558. Object(_utils_common__WEBPACK_IMPORTED_MODULE_0__["createEmptyTableCell"])( conversionApi.writer, conversionApi.writer.createPositionAt( row, 'end' ) );
  62559. }
  62560. conversionApi.updateConversionResult( table, data );
  62561. } );
  62562. };
  62563. }
  62564. /**
  62565. * Conversion helper that skips empty <tr> from upcasting at the beginning of the table.
  62566. *
  62567. * Empty row is considered a table model error but when handling clipboard data there could be rows that contain only row-spanned cells
  62568. * and empty TR-s are used to maintain table structure (also {@link module:table/tablewalker~TableWalker} assumes that there are only rows
  62569. * that have related tableRow elements).
  62570. *
  62571. * *Note:* Only first empty rows are removed because those have no meaning and solves issue of improper table with all empty rows.
  62572. *
  62573. * @returns {Function} Conversion helper.
  62574. */
  62575. function skipEmptyTableRow() {
  62576. return dispatcher => {
  62577. dispatcher.on( 'element:tr', ( evt, data ) => {
  62578. if ( data.viewItem.isEmpty && data.modelCursor.index == 0 ) {
  62579. evt.stop();
  62580. }
  62581. }, { priority: 'high' } );
  62582. };
  62583. }
  62584. // Scans table rows and extracts required metadata from the table:
  62585. //
  62586. // headingRows - The number of rows that go as table headers.
  62587. // headingColumns - The maximum number of row headings.
  62588. // rows - Sorted `<tr>` elements as they should go into the model - ie. if `<thead>` is inserted after `<tbody>` in the view.
  62589. //
  62590. // @param {module:engine/view/element~Element} viewTable
  62591. // @returns {{headingRows, headingColumns, rows}}
  62592. function scanTable( viewTable ) {
  62593. const tableMeta = {
  62594. headingRows: 0,
  62595. headingColumns: 0
  62596. };
  62597. // The `<tbody>` and `<thead>` sections in the DOM do not have to be in order `<thead>` -> `<tbody>` and there might be more than one
  62598. // of them.
  62599. // As the model does not have these sections, rows from different sections must be sorted.
  62600. // For example, below is a valid HTML table:
  62601. //
  62602. // <table>
  62603. // <tbody><tr><td>2</td></tr></tbody>
  62604. // <thead><tr><td>1</td></tr></thead>
  62605. // <tbody><tr><td>3</td></tr></tbody>
  62606. // </table>
  62607. //
  62608. // But browsers will render rows in order as: 1 as heading and 2 and 3 as the body.
  62609. const headRows = [];
  62610. const bodyRows = [];
  62611. // Currently the editor does not support more then one <thead> section.
  62612. // Only the first <thead> from the view will be used as heading rows and others will be converted to body rows.
  62613. let firstTheadElement;
  62614. for ( const tableChild of Array.from( viewTable.getChildren() ) ) {
  62615. // Only <thead>, <tbody> & <tfoot> from allowed table children can have <tr>s.
  62616. // The else is for future purposes (mainly <caption>).
  62617. if ( tableChild.name === 'tbody' || tableChild.name === 'thead' || tableChild.name === 'tfoot' ) {
  62618. // Save the first <thead> in the table as table header - all other ones will be converted to table body rows.
  62619. if ( tableChild.name === 'thead' && !firstTheadElement ) {
  62620. firstTheadElement = tableChild;
  62621. }
  62622. // There might be some extra empty text nodes between the `tr`s.
  62623. // Make sure further code operates on `tr`s only. (#145)
  62624. const trs = Array.from( tableChild.getChildren() ).filter( el => el.is( 'element', 'tr' ) );
  62625. for ( const tr of trs ) {
  62626. // This <tr> is a child of a first <thead> element.
  62627. if ( tr.parent.name === 'thead' && tr.parent === firstTheadElement ) {
  62628. tableMeta.headingRows++;
  62629. headRows.push( tr );
  62630. } else {
  62631. bodyRows.push( tr );
  62632. // For other rows check how many column headings this row has.
  62633. const headingCols = scanRowForHeadingColumns( tr, tableMeta, firstTheadElement );
  62634. if ( headingCols > tableMeta.headingColumns ) {
  62635. tableMeta.headingColumns = headingCols;
  62636. }
  62637. }
  62638. }
  62639. }
  62640. }
  62641. tableMeta.rows = [ ...headRows, ...bodyRows ];
  62642. return tableMeta;
  62643. }
  62644. // Scans a `<tr>` element and its children for metadata:
  62645. // - For heading row:
  62646. // - Adds this row to either the heading or the body rows.
  62647. // - Updates the number of heading rows.
  62648. // - For body rows:
  62649. // - Calculates the number of column headings.
  62650. //
  62651. // @param {module:engine/view/element~Element} tr
  62652. // @returns {Number}
  62653. function scanRowForHeadingColumns( tr ) {
  62654. let headingColumns = 0;
  62655. let index = 0;
  62656. // Filter out empty text nodes from tr children.
  62657. const children = Array.from( tr.getChildren() )
  62658. .filter( child => child.name === 'th' || child.name === 'td' );
  62659. // Count starting adjacent <th> elements of a <tr>.
  62660. while ( index < children.length && children[ index ].name === 'th' ) {
  62661. const th = children[ index ];
  62662. // Adjust columns calculation by the number of spanned columns.
  62663. const colspan = parseInt( th.getAttribute( 'colspan' ) || 1 );
  62664. headingColumns = headingColumns + colspan;
  62665. index++;
  62666. }
  62667. return headingColumns;
  62668. }
  62669. /***/ }),
  62670. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/table.js":
  62671. /*!*************************************************************!*\
  62672. !*** ./node_modules/@ckeditor/ckeditor5-table/src/table.js ***!
  62673. \*************************************************************/
  62674. /*! exports provided: default */
  62675. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  62676. "use strict";
  62677. __webpack_require__.r(__webpack_exports__);
  62678. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Table; });
  62679. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  62680. /* harmony import */ var _tableediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tableediting */ "./node_modules/@ckeditor/ckeditor5-table/src/tableediting.js");
  62681. /* harmony import */ var _tableui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tableui */ "./node_modules/@ckeditor/ckeditor5-table/src/tableui.js");
  62682. /* harmony import */ var _tableselection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./tableselection */ "./node_modules/@ckeditor/ckeditor5-table/src/tableselection.js");
  62683. /* harmony import */ var _tableclipboard__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tableclipboard */ "./node_modules/@ckeditor/ckeditor5-table/src/tableclipboard.js");
  62684. /* harmony import */ var _tablekeyboard__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./tablekeyboard */ "./node_modules/@ckeditor/ckeditor5-table/src/tablekeyboard.js");
  62685. /* harmony import */ var _tablemouse__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./tablemouse */ "./node_modules/@ckeditor/ckeditor5-table/src/tablemouse.js");
  62686. /* harmony import */ var _ckeditor_ckeditor5_widget_src_widget__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-widget/src/widget */ "./node_modules/@ckeditor/ckeditor5-widget/src/widget.js");
  62687. /* harmony import */ var _theme_table_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../theme/table.css */ "./node_modules/@ckeditor/ckeditor5-table/theme/table.css");
  62688. /* harmony import */ var _theme_table_css__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_theme_table_css__WEBPACK_IMPORTED_MODULE_8__);
  62689. /**
  62690. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  62691. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  62692. */
  62693. /**
  62694. * @module table/table
  62695. */
  62696. /**
  62697. * The table plugin.
  62698. *
  62699. * For a detailed overview, check the {@glink features/table Table feature documentation}.
  62700. *
  62701. * This is a "glue" plugin that loads the following table features:
  62702. *
  62703. * * {@link module:table/tableediting~TableEditing editing feature},
  62704. * * {@link module:table/tableselection~TableSelection selection feature},
  62705. * * {@link module:table/tablekeyboard~TableKeyboard keyboard navigation feature},
  62706. * * {@link module:table/tablemouse~TableMouse mouse selection feature},
  62707. * * {@link module:table/tableclipboard~TableClipboard clipboard feature},
  62708. * * {@link module:table/tableui~TableUI UI feature}.
  62709. *
  62710. * @extends module:core/plugin~Plugin
  62711. */
  62712. class Table extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  62713. /**
  62714. * @inheritDoc
  62715. */
  62716. static get requires() {
  62717. return [ _tableediting__WEBPACK_IMPORTED_MODULE_1__["default"], _tableui__WEBPACK_IMPORTED_MODULE_2__["default"], _tableselection__WEBPACK_IMPORTED_MODULE_3__["default"], _tablemouse__WEBPACK_IMPORTED_MODULE_6__["default"], _tablekeyboard__WEBPACK_IMPORTED_MODULE_5__["default"], _tableclipboard__WEBPACK_IMPORTED_MODULE_4__["default"], _ckeditor_ckeditor5_widget_src_widget__WEBPACK_IMPORTED_MODULE_7__["default"] ];
  62718. }
  62719. /**
  62720. * @inheritDoc
  62721. */
  62722. static get pluginName() {
  62723. return 'Table';
  62724. }
  62725. }
  62726. /**
  62727. * The configuration of the table feature. Used by the table feature in the `@ckeditor/ckeditor5-table` package.
  62728. *
  62729. * ClassicEditor
  62730. * .create( editorElement, {
  62731. * table: ... // Table feature options.
  62732. * } )
  62733. * .then( ... )
  62734. * .catch( ... );
  62735. *
  62736. * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
  62737. *
  62738. * @interface TableConfig
  62739. */
  62740. /**
  62741. * The configuration of the {@link module:table/table~Table} feature.
  62742. *
  62743. * Read more in {@link module:table/table~TableConfig}.
  62744. *
  62745. * @member {module:table/table~TableConfig} module:core/editor/editorconfig~EditorConfig#table
  62746. */
  62747. /**
  62748. * An array of color definitions (either strings or objects).
  62749. *
  62750. * const colors = [
  62751. * {
  62752. * color: 'hsl(0, 0%, 60%)',
  62753. * label: 'Grey'
  62754. * },
  62755. * 'hsl(0, 0%, 80%)',
  62756. * {
  62757. * color: 'hsl(0, 0%, 90%)',
  62758. * label: 'Light grey'
  62759. * },
  62760. * {
  62761. * color: 'hsl(0, 0%, 100%)',
  62762. * label: 'White',
  62763. * hasBorder: true
  62764. * },
  62765. * '#FF0000'
  62766. * ]
  62767. *
  62768. * Usually used as a configuration parameter, for instance in
  62769. * {@link module:table/table~TableConfig#tableProperties `config.table.tableProperties`}
  62770. * or {@link module:table/table~TableConfig#tableCellProperties `config.table.tableCellProperties`}.
  62771. *
  62772. * @typedef {Array.<String|Object>} module:table/table~TableColorConfig
  62773. */
  62774. /***/ }),
  62775. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tableclipboard.js":
  62776. /*!**********************************************************************!*\
  62777. !*** ./node_modules/@ckeditor/ckeditor5-table/src/tableclipboard.js ***!
  62778. \**********************************************************************/
  62779. /*! exports provided: default, getTableIfOnlyTableInContent */
  62780. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  62781. "use strict";
  62782. __webpack_require__.r(__webpack_exports__);
  62783. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableClipboard; });
  62784. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTableIfOnlyTableInContent", function() { return getTableIfOnlyTableInContent; });
  62785. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  62786. /* harmony import */ var _tableselection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tableselection */ "./node_modules/@ckeditor/ckeditor5-table/src/tableselection.js");
  62787. /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
  62788. /* harmony import */ var _tableutils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./tableutils */ "./node_modules/@ckeditor/ckeditor5-table/src/tableutils.js");
  62789. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  62790. /* harmony import */ var _utils_structure__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/structure */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js");
  62791. /**
  62792. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  62793. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  62794. */
  62795. /**
  62796. * @module table/tableclipboard
  62797. */
  62798. /**
  62799. * This plugin adds support for copying/cutting/pasting fragments of tables.
  62800. * It is loaded automatically by the {@link module:table/table~Table} plugin.
  62801. *
  62802. * @extends module:core/plugin~Plugin
  62803. */
  62804. class TableClipboard extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  62805. /**
  62806. * @inheritDoc
  62807. */
  62808. static get pluginName() {
  62809. return 'TableClipboard';
  62810. }
  62811. /**
  62812. * @inheritDoc
  62813. */
  62814. static get requires() {
  62815. return [ _tableselection__WEBPACK_IMPORTED_MODULE_1__["default"], _tableutils__WEBPACK_IMPORTED_MODULE_3__["default"] ];
  62816. }
  62817. /**
  62818. * @inheritDoc
  62819. */
  62820. init() {
  62821. const editor = this.editor;
  62822. const viewDocument = editor.editing.view.document;
  62823. this.listenTo( viewDocument, 'copy', ( evt, data ) => this._onCopyCut( evt, data ) );
  62824. this.listenTo( viewDocument, 'cut', ( evt, data ) => this._onCopyCut( evt, data ) );
  62825. this.listenTo( editor.model, 'insertContent', ( evt, args ) => this._onInsertContent( evt, ...args ), { priority: 'high' } );
  62826. this.decorate( '_replaceTableSlotCell' );
  62827. }
  62828. /**
  62829. * Copies table content to a clipboard on "copy" & "cut" events.
  62830. *
  62831. * @private
  62832. * @param {module:utils/eventinfo~EventInfo} evt An object containing information about the handled event.
  62833. * @param {Object} data Clipboard event data.
  62834. */
  62835. _onCopyCut( evt, data ) {
  62836. const tableSelection = this.editor.plugins.get( _tableselection__WEBPACK_IMPORTED_MODULE_1__["default"] );
  62837. if ( !tableSelection.getSelectedTableCells() ) {
  62838. return;
  62839. }
  62840. if ( evt.name == 'cut' && this.editor.isReadOnly ) {
  62841. return;
  62842. }
  62843. data.preventDefault();
  62844. evt.stop();
  62845. const dataController = this.editor.data;
  62846. const viewDocument = this.editor.editing.view.document;
  62847. const content = dataController.toView( tableSelection.getSelectionAsFragment() );
  62848. viewDocument.fire( 'clipboardOutput', {
  62849. dataTransfer: data.dataTransfer,
  62850. content,
  62851. method: evt.name
  62852. } );
  62853. }
  62854. /**
  62855. * Overrides default {@link module:engine/model/model~Model#insertContent `model.insertContent()`} method to handle pasting table inside
  62856. * selected table fragment.
  62857. *
  62858. * Depending on selected table fragment:
  62859. * - If a selected table fragment is smaller than paste table it will crop pasted table to match dimensions.
  62860. * - If dimensions are equal it will replace selected table fragment with a pasted table contents.
  62861. *
  62862. * @private
  62863. * @param evt
  62864. * @param {module:engine/model/documentfragment~DocumentFragment|module:engine/model/item~Item} content The content to insert.
  62865. * @param {module:engine/model/selection~Selectable} [selectable=model.document.selection]
  62866. * The selection into which the content should be inserted. If not provided the current model document selection will be used.
  62867. */
  62868. _onInsertContent( evt, content, selectable ) {
  62869. if ( selectable && !selectable.is( 'documentSelection' ) ) {
  62870. return;
  62871. }
  62872. const model = this.editor.model;
  62873. const tableUtils = this.editor.plugins.get( _tableutils__WEBPACK_IMPORTED_MODULE_3__["default"] );
  62874. // We might need to crop table before inserting so reference might change.
  62875. let pastedTable = getTableIfOnlyTableInContent( content, model );
  62876. if ( !pastedTable ) {
  62877. return;
  62878. }
  62879. const selectedTableCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_4__["getSelectionAffectedTableCells"])( model.document.selection );
  62880. if ( !selectedTableCells.length ) {
  62881. Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["removeEmptyRowsColumns"])( pastedTable, tableUtils );
  62882. return;
  62883. }
  62884. // Override default model.insertContent() handling at this point.
  62885. evt.stop();
  62886. model.change( writer => {
  62887. const pastedDimensions = {
  62888. width: tableUtils.getColumns( pastedTable ),
  62889. height: tableUtils.getRows( pastedTable )
  62890. };
  62891. // Prepare the table for pasting.
  62892. const selection = prepareTableForPasting( selectedTableCells, pastedDimensions, writer, tableUtils );
  62893. // Beyond this point we operate on a fixed content table with rectangular selection and proper last row/column values.
  62894. const selectionHeight = selection.lastRow - selection.firstRow + 1;
  62895. const selectionWidth = selection.lastColumn - selection.firstColumn + 1;
  62896. // Crop pasted table if:
  62897. // - Pasted table dimensions exceeds selection area.
  62898. // - Pasted table has broken layout (ie some cells sticks out by the table dimensions established by the first and last row).
  62899. //
  62900. // Note: The table dimensions are established by the width of the first row and the total number of rows.
  62901. // It is possible to programmatically create a table that has rows which would have cells anchored beyond first row width but
  62902. // such table will not be created by other editing solutions.
  62903. const cropDimensions = {
  62904. startRow: 0,
  62905. startColumn: 0,
  62906. endRow: Math.min( selectionHeight, pastedDimensions.height ) - 1,
  62907. endColumn: Math.min( selectionWidth, pastedDimensions.width ) - 1
  62908. };
  62909. pastedTable = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["cropTableToDimensions"])( pastedTable, cropDimensions, writer );
  62910. // Content table to which we insert a pasted table.
  62911. const selectedTable = selectedTableCells[ 0 ].findAncestor( 'table' );
  62912. const cellsToSelect = this._replaceSelectedCellsWithPasted( pastedTable, pastedDimensions, selectedTable, selection, writer );
  62913. if ( this.editor.plugins.get( 'TableSelection' ).isEnabled ) {
  62914. // Selection ranges must be sorted because the first and last selection ranges are considered
  62915. // as anchor/focus cell ranges for multi-cell selection.
  62916. const selectionRanges = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_4__["sortRanges"])( cellsToSelect.map( cell => writer.createRangeOn( cell ) ) );
  62917. writer.setSelection( selectionRanges );
  62918. } else {
  62919. // Set selection inside first cell if multi-cell selection is disabled.
  62920. writer.setSelection( cellsToSelect[ 0 ], 0 );
  62921. }
  62922. } );
  62923. }
  62924. /**
  62925. * Replaces the part of selectedTable with pastedTable.
  62926. *
  62927. * @private
  62928. * @param {module:engine/model/element~Element} pastedTable
  62929. * @param {Object} pastedDimensions
  62930. * @param {Number} pastedDimensions.height
  62931. * @param {Number} pastedDimensions.width
  62932. * @param {module:engine/model/element~Element} selectedTable
  62933. * @param {Object} selection
  62934. * @param {Number} selection.firstColumn
  62935. * @param {Number} selection.firstRow
  62936. * @param {Number} selection.lastColumn
  62937. * @param {Number} selection.lastRow
  62938. * @param {module:engine/model/writer~Writer} writer
  62939. * @returns {Array.<module:engine/model/element~Element>}
  62940. */
  62941. _replaceSelectedCellsWithPasted( pastedTable, pastedDimensions, selectedTable, selection, writer ) {
  62942. const { width: pastedWidth, height: pastedHeight } = pastedDimensions;
  62943. // Holds two-dimensional array that is addressed by [ row ][ column ] that stores cells anchored at given location.
  62944. const pastedTableLocationMap = createLocationMap( pastedTable, pastedWidth, pastedHeight );
  62945. const selectedTableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( selectedTable, {
  62946. startRow: selection.firstRow,
  62947. endRow: selection.lastRow,
  62948. startColumn: selection.firstColumn,
  62949. endColumn: selection.lastColumn,
  62950. includeAllSlots: true
  62951. } ) ];
  62952. // Selection must be set to pasted cells (some might be removed or new created).
  62953. const cellsToSelect = [];
  62954. // Store next cell insert position.
  62955. let insertPosition;
  62956. // Content table replace cells algorithm iterates over a selected table fragment and:
  62957. //
  62958. // - Removes existing table cells at current slot (location).
  62959. // - Inserts cell from a pasted table for a matched slots.
  62960. //
  62961. // This ensures proper table geometry after the paste
  62962. for ( const tableSlot of selectedTableMap ) {
  62963. const { row, column } = tableSlot;
  62964. // Save the insert position for current row start.
  62965. if ( column === selection.firstColumn ) {
  62966. insertPosition = tableSlot.getPositionBefore();
  62967. }
  62968. // Map current table slot location to an pasted table slot location.
  62969. const pastedRow = row - selection.firstRow;
  62970. const pastedColumn = column - selection.firstColumn;
  62971. const pastedCell = pastedTableLocationMap[ pastedRow % pastedHeight ][ pastedColumn % pastedWidth ];
  62972. // Clone cell to insert (to duplicate its attributes and children).
  62973. // Cloning is required to support repeating pasted table content when inserting to a bigger selection.
  62974. const cellToInsert = pastedCell ? writer.cloneElement( pastedCell ) : null;
  62975. // Replace the cell from the current slot with new table cell.
  62976. const newTableCell = this._replaceTableSlotCell( tableSlot, cellToInsert, insertPosition, writer );
  62977. // The cell was only removed.
  62978. if ( !newTableCell ) {
  62979. continue;
  62980. }
  62981. // Trim the cell if it's row/col-spans would exceed selection area.
  62982. Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["trimTableCellIfNeeded"])( newTableCell, row, column, selection.lastRow, selection.lastColumn, writer );
  62983. cellsToSelect.push( newTableCell );
  62984. insertPosition = writer.createPositionAfter( newTableCell );
  62985. }
  62986. // If there are any headings, all the cells that overlap from heading must be splitted.
  62987. const headingRows = parseInt( selectedTable.getAttribute( 'headingRows' ) || 0 );
  62988. const headingColumns = parseInt( selectedTable.getAttribute( 'headingColumns' ) || 0 );
  62989. const areHeadingRowsIntersectingSelection = selection.firstRow < headingRows && headingRows <= selection.lastRow;
  62990. const areHeadingColumnsIntersectingSelection = selection.firstColumn < headingColumns && headingColumns <= selection.lastColumn;
  62991. if ( areHeadingRowsIntersectingSelection ) {
  62992. const columnsLimit = { first: selection.firstColumn, last: selection.lastColumn };
  62993. const newCells = doHorizontalSplit( selectedTable, headingRows, columnsLimit, writer, selection.firstRow );
  62994. cellsToSelect.push( ...newCells );
  62995. }
  62996. if ( areHeadingColumnsIntersectingSelection ) {
  62997. const rowsLimit = { first: selection.firstRow, last: selection.lastRow };
  62998. const newCells = doVerticalSplit( selectedTable, headingColumns, rowsLimit, writer );
  62999. cellsToSelect.push( ...newCells );
  63000. }
  63001. return cellsToSelect;
  63002. }
  63003. /**
  63004. * Replaces a single table slot.
  63005. *
  63006. * @private
  63007. * @param {module:table/tablewalker~TableSlot} tableSlot
  63008. * @param {module:engine/model/element~Element} cellToInsert
  63009. * @param {module:engine/model/position~Position} insertPosition
  63010. * @param {module:engine/model/writer~Writer} writer
  63011. * @returns {module:engine/model/element~Element|null} Inserted table cell or null if slot should remain empty.
  63012. */
  63013. _replaceTableSlotCell( tableSlot, cellToInsert, insertPosition, writer ) {
  63014. const { cell, isAnchor } = tableSlot;
  63015. // If the slot is occupied by a cell in a selected table - remove it.
  63016. // The slot of this cell will be either:
  63017. // - Replaced by a pasted table cell.
  63018. // - Spanned by a previously pasted table cell.
  63019. if ( isAnchor ) {
  63020. writer.remove( cell );
  63021. }
  63022. // There is no cell to insert (might be spanned by other cell in a pasted table) - advance to the next content table slot.
  63023. if ( !cellToInsert ) {
  63024. return null;
  63025. }
  63026. writer.insert( cellToInsert, insertPosition );
  63027. return cellToInsert;
  63028. }
  63029. }
  63030. /**
  63031. * Extract table for pasting into table.
  63032. *
  63033. * @private
  63034. * @param {module:engine/model/documentfragment~DocumentFragment|module:engine/model/item~Item} content The content to insert.
  63035. * @param {module:engine/model/model~Model} model The editor model.
  63036. * @returns {module:engine/model/element~Element|null}
  63037. */
  63038. function getTableIfOnlyTableInContent( content, model ) {
  63039. if ( !content.is( 'documentFragment' ) && !content.is( 'element' ) ) {
  63040. return null;
  63041. }
  63042. // Table passed directly.
  63043. if ( content.is( 'element', 'table' ) ) {
  63044. return content;
  63045. }
  63046. // We do not support mixed content when pasting table into table.
  63047. // See: https://github.com/ckeditor/ckeditor5/issues/6817.
  63048. if ( content.childCount == 1 && content.getChild( 0 ).is( 'element', 'table' ) ) {
  63049. return content.getChild( 0 );
  63050. }
  63051. // If there are only whitespaces around a table then use that table for pasting.
  63052. const contentRange = model.createRangeIn( content );
  63053. for ( const element of contentRange.getItems() ) {
  63054. if ( element.is( 'element', 'table' ) ) {
  63055. // Stop checking if there is some content before table.
  63056. const rangeBefore = model.createRange( contentRange.start, model.createPositionBefore( element ) );
  63057. if ( model.hasContent( rangeBefore, { ignoreWhitespaces: true } ) ) {
  63058. return null;
  63059. }
  63060. // Stop checking if there is some content after table.
  63061. const rangeAfter = model.createRange( model.createPositionAfter( element ), contentRange.end );
  63062. if ( model.hasContent( rangeAfter, { ignoreWhitespaces: true } ) ) {
  63063. return null;
  63064. }
  63065. // There wasn't any content neither before nor after.
  63066. return element;
  63067. }
  63068. }
  63069. return null;
  63070. }
  63071. // Prepares a table for pasting and returns adjusted selection dimensions.
  63072. //
  63073. // @param {Array.<module:engine/model/element~Element>} selectedTableCells
  63074. // @param {Object} pastedDimensions
  63075. // @param {Number} pastedDimensions.height
  63076. // @param {Number} pastedDimensions.width
  63077. // @param {module:engine/model/writer~Writer} writer
  63078. // @param {module:table/tableutils~TableUtils} tableUtils
  63079. // @returns {Object} selection
  63080. // @returns {Number} selection.firstColumn
  63081. // @returns {Number} selection.firstRow
  63082. // @returns {Number} selection.lastColumn
  63083. // @returns {Number} selection.lastRow
  63084. function prepareTableForPasting( selectedTableCells, pastedDimensions, writer, tableUtils ) {
  63085. const selectedTable = selectedTableCells[ 0 ].findAncestor( 'table' );
  63086. const columnIndexes = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_4__["getColumnIndexes"])( selectedTableCells );
  63087. const rowIndexes = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_4__["getRowIndexes"])( selectedTableCells );
  63088. const selection = {
  63089. firstColumn: columnIndexes.first,
  63090. lastColumn: columnIndexes.last,
  63091. firstRow: rowIndexes.first,
  63092. lastRow: rowIndexes.last
  63093. };
  63094. // Single cell selected - expand selection to pasted table dimensions.
  63095. const shouldExpandSelection = selectedTableCells.length === 1;
  63096. if ( shouldExpandSelection ) {
  63097. selection.lastRow += pastedDimensions.height - 1;
  63098. selection.lastColumn += pastedDimensions.width - 1;
  63099. expandTableSize( selectedTable, selection.lastRow + 1, selection.lastColumn + 1, tableUtils );
  63100. }
  63101. // In case of expanding selection we do not reset the selection so in this case we will always try to fix selection
  63102. // like in the case of a non-rectangular area. This might be fixed by re-setting selected cells array but this shortcut is safe.
  63103. if ( shouldExpandSelection || !Object(_utils_selection__WEBPACK_IMPORTED_MODULE_4__["isSelectionRectangular"])( selectedTableCells, tableUtils ) ) {
  63104. // For a non-rectangular selection (ie in which some cells sticks out from a virtual selection rectangle) we need to create
  63105. // a table layout that has a rectangular selection. This will split cells so the selection become rectangular.
  63106. // Beyond this point we will operate on fixed content table.
  63107. splitCellsToRectangularSelection( selectedTable, selection, writer );
  63108. }
  63109. // However a selected table fragment might be invalid if examined alone. Ie such table fragment:
  63110. //
  63111. // +---+---+---+---+
  63112. // 0 | a | b | c | d |
  63113. // + + +---+---+
  63114. // 1 | | e | f | g |
  63115. // + +---+ +---+
  63116. // 2 | | h | | i | <- last row, each cell has rowspan = 2,
  63117. // + + + + + so we need to return 3, not 2
  63118. // 3 | | | | |
  63119. // +---+---+---+---+
  63120. //
  63121. // is invalid as the cells "h" and "i" have rowspans.
  63122. // This case needs only adjusting the selection dimension as the rest of the algorithm operates on empty slots also.
  63123. else {
  63124. selection.lastRow = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["adjustLastRowIndex"])( selectedTable, selection );
  63125. selection.lastColumn = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["adjustLastColumnIndex"])( selectedTable, selection );
  63126. }
  63127. return selection;
  63128. }
  63129. // Expand table (in place) to expected size.
  63130. function expandTableSize( table, expectedHeight, expectedWidth, tableUtils ) {
  63131. const tableWidth = tableUtils.getColumns( table );
  63132. const tableHeight = tableUtils.getRows( table );
  63133. if ( expectedWidth > tableWidth ) {
  63134. tableUtils.insertColumns( table, {
  63135. at: tableWidth,
  63136. columns: expectedWidth - tableWidth
  63137. } );
  63138. }
  63139. if ( expectedHeight > tableHeight ) {
  63140. tableUtils.insertRows( table, {
  63141. at: tableHeight,
  63142. rows: expectedHeight - tableHeight
  63143. } );
  63144. }
  63145. }
  63146. // Returns two-dimensional array that is addressed by [ row ][ column ] that stores cells anchored at given location.
  63147. //
  63148. // At given row & column location it might be one of:
  63149. //
  63150. // * cell - cell from pasted table anchored at this location.
  63151. // * null - if no cell is anchored at this location.
  63152. //
  63153. // For instance, from a table below:
  63154. //
  63155. // +----+----+----+----+
  63156. // | 00 | 01 | 02 | 03 |
  63157. // + +----+----+----+
  63158. // | | 11 | 13 |
  63159. // +----+ +----+
  63160. // | 20 | | 23 |
  63161. // +----+----+----+----+
  63162. //
  63163. // The method will return an array (numbers represents cell element):
  63164. //
  63165. // const map = [
  63166. // [ '00', '01', '02', '03' ],
  63167. // [ null, '11', null, '13' ],
  63168. // [ '20', null, null, '23' ]
  63169. // ]
  63170. //
  63171. // This allows for a quick access to table at give row & column. For instance to access table cell "13" from pasted table call:
  63172. //
  63173. // const cell = map[ 1 ][ 3 ]
  63174. //
  63175. function createLocationMap( table, width, height ) {
  63176. // Create height x width (row x column) two-dimensional table to store cells.
  63177. const map = new Array( height ).fill( null )
  63178. .map( () => new Array( width ).fill( null ) );
  63179. for ( const { column, row, cell } of new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( table ) ) {
  63180. map[ row ][ column ] = cell;
  63181. }
  63182. return map;
  63183. }
  63184. // Make selected cells rectangular by splitting the cells that stand out from a rectangular selection.
  63185. //
  63186. // In the table below a selection is shown with "::" and slots with anchor cells are named.
  63187. //
  63188. // +----+----+----+----+----+ +----+----+----+----+----+
  63189. // | 00 | 01 | 02 | 03 | | 00 | 01 | 02 | 03 |
  63190. // + +----+ +----+----+ | ::::::::::::::::----+
  63191. // | | 11 | | 13 | 14 | | ::11 | | 13:: 14 | <- first row
  63192. // +----+----+ + +----+ +----::---| | ::----+
  63193. // | 20 | 21 | | | 24 | select cells: | 20 ::21 | | :: 24 |
  63194. // +----+----+ +----+----+ 11 -> 33 +----::---| |---::----+
  63195. // | 30 | | 33 | 34 | | 30 :: | | 33:: 34 | <- last row
  63196. // + + +----+ + | :::::::::::::::: +
  63197. // | | | 43 | | | | | 43 | |
  63198. // +----+----+----+----+----+ +----+----+----+----+----+
  63199. // ^ ^
  63200. // first & last columns
  63201. //
  63202. // Will update table to:
  63203. //
  63204. // +----+----+----+----+----+
  63205. // | 00 | 01 | 02 | 03 |
  63206. // + +----+----+----+----+
  63207. // | | 11 | | 13 | 14 |
  63208. // +----+----+ + +----+
  63209. // | 20 | 21 | | | 24 |
  63210. // +----+----+ +----+----+
  63211. // | 30 | | | 33 | 34 |
  63212. // + +----+----+----+ +
  63213. // | | | | 43 | |
  63214. // +----+----+----+----+----+
  63215. //
  63216. // In th example above:
  63217. // - Cell "02" which have `rowspan = 4` must be trimmed at first and at after last row.
  63218. // - Cell "03" which have `rowspan = 2` and `colspan = 2` must be trimmed at first column and after last row.
  63219. // - Cells "00", "03" & "30" which cannot be cut by this algorithm as they are outside the trimmed area.
  63220. // - Cell "13" cannot be cut as it is inside the trimmed area.
  63221. function splitCellsToRectangularSelection( table, dimensions, writer ) {
  63222. const { firstRow, lastRow, firstColumn, lastColumn } = dimensions;
  63223. const rowIndexes = { first: firstRow, last: lastRow };
  63224. const columnIndexes = { first: firstColumn, last: lastColumn };
  63225. // 1. Split cells vertically in two steps as first step might create cells that needs to split again.
  63226. doVerticalSplit( table, firstColumn, rowIndexes, writer );
  63227. doVerticalSplit( table, lastColumn + 1, rowIndexes, writer );
  63228. // 2. Split cells horizontally in two steps as first step might create cells that needs to split again.
  63229. doHorizontalSplit( table, firstRow, columnIndexes, writer );
  63230. doHorizontalSplit( table, lastRow + 1, columnIndexes, writer, firstRow );
  63231. }
  63232. function doHorizontalSplit( table, splitRow, limitColumns, writer, startRow = 0 ) {
  63233. // If selection starts at first row then no split is needed.
  63234. if ( splitRow < 1 ) {
  63235. return;
  63236. }
  63237. const overlappingCells = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["getVerticallyOverlappingCells"])( table, splitRow, startRow );
  63238. // Filter out cells that are not touching insides of the rectangular selection.
  63239. const cellsToSplit = overlappingCells.filter( ( { column, cellWidth } ) => isAffectedBySelection( column, cellWidth, limitColumns ) );
  63240. return cellsToSplit.map( ( { cell } ) => Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["splitHorizontally"])( cell, splitRow, writer ) );
  63241. }
  63242. function doVerticalSplit( table, splitColumn, limitRows, writer ) {
  63243. // If selection starts at first column then no split is needed.
  63244. if ( splitColumn < 1 ) {
  63245. return;
  63246. }
  63247. const overlappingCells = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["getHorizontallyOverlappingCells"])( table, splitColumn );
  63248. // Filter out cells that are not touching insides of the rectangular selection.
  63249. const cellsToSplit = overlappingCells.filter( ( { row, cellHeight } ) => isAffectedBySelection( row, cellHeight, limitRows ) );
  63250. return cellsToSplit.map( ( { cell, column } ) => Object(_utils_structure__WEBPACK_IMPORTED_MODULE_5__["splitVertically"])( cell, column, splitColumn, writer ) );
  63251. }
  63252. // Checks if cell at given row (column) is affected by a rectangular selection defined by first/last column (row).
  63253. //
  63254. // The same check is used for row as for column.
  63255. function isAffectedBySelection( index, span, limit ) {
  63256. const endIndex = index + span - 1;
  63257. const { first, last } = limit;
  63258. const isInsideSelection = index >= first && index <= last;
  63259. const overlapsSelectionFromOutside = index < first && endIndex >= first;
  63260. return isInsideSelection || overlapsSelectionFromOutside;
  63261. }
  63262. /***/ }),
  63263. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tableediting.js":
  63264. /*!********************************************************************!*\
  63265. !*** ./node_modules/@ckeditor/ckeditor5-table/src/tableediting.js ***!
  63266. \********************************************************************/
  63267. /*! exports provided: default */
  63268. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63269. "use strict";
  63270. __webpack_require__.r(__webpack_exports__);
  63271. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableEditing; });
  63272. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  63273. /* harmony import */ var _converters_upcasttable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./converters/upcasttable */ "./node_modules/@ckeditor/ckeditor5-table/src/converters/upcasttable.js");
  63274. /* harmony import */ var _converters_downcast__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./converters/downcast */ "./node_modules/@ckeditor/ckeditor5-table/src/converters/downcast.js");
  63275. /* harmony import */ var _commands_inserttablecommand__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./commands/inserttablecommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/inserttablecommand.js");
  63276. /* harmony import */ var _commands_insertrowcommand__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./commands/insertrowcommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/insertrowcommand.js");
  63277. /* harmony import */ var _commands_insertcolumncommand__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./commands/insertcolumncommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/insertcolumncommand.js");
  63278. /* harmony import */ var _commands_splitcellcommand__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./commands/splitcellcommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/splitcellcommand.js");
  63279. /* harmony import */ var _commands_mergecellcommand__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./commands/mergecellcommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/mergecellcommand.js");
  63280. /* harmony import */ var _commands_removerowcommand__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./commands/removerowcommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/removerowcommand.js");
  63281. /* harmony import */ var _commands_removecolumncommand__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./commands/removecolumncommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/removecolumncommand.js");
  63282. /* harmony import */ var _commands_setheaderrowcommand__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./commands/setheaderrowcommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/setheaderrowcommand.js");
  63283. /* harmony import */ var _commands_setheadercolumncommand__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./commands/setheadercolumncommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/setheadercolumncommand.js");
  63284. /* harmony import */ var _commands_mergecellscommand__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./commands/mergecellscommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/mergecellscommand.js");
  63285. /* harmony import */ var _commands_selectrowcommand__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./commands/selectrowcommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/selectrowcommand.js");
  63286. /* harmony import */ var _commands_selectcolumncommand__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./commands/selectcolumncommand */ "./node_modules/@ckeditor/ckeditor5-table/src/commands/selectcolumncommand.js");
  63287. /* harmony import */ var _src_tableutils__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../src/tableutils */ "./node_modules/@ckeditor/ckeditor5-table/src/tableutils.js");
  63288. /* harmony import */ var _converters_table_layout_post_fixer__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./converters/table-layout-post-fixer */ "./node_modules/@ckeditor/ckeditor5-table/src/converters/table-layout-post-fixer.js");
  63289. /* harmony import */ var _converters_table_cell_paragraph_post_fixer__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./converters/table-cell-paragraph-post-fixer */ "./node_modules/@ckeditor/ckeditor5-table/src/converters/table-cell-paragraph-post-fixer.js");
  63290. /* harmony import */ var _converters_table_cell_refresh_post_fixer__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./converters/table-cell-refresh-post-fixer */ "./node_modules/@ckeditor/ckeditor5-table/src/converters/table-cell-refresh-post-fixer.js");
  63291. /* harmony import */ var _converters_table_heading_rows_refresh_post_fixer__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./converters/table-heading-rows-refresh-post-fixer */ "./node_modules/@ckeditor/ckeditor5-table/src/converters/table-heading-rows-refresh-post-fixer.js");
  63292. /* harmony import */ var _theme_tableediting_css__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../theme/tableediting.css */ "./node_modules/@ckeditor/ckeditor5-table/theme/tableediting.css");
  63293. /* harmony import */ var _theme_tableediting_css__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(_theme_tableediting_css__WEBPACK_IMPORTED_MODULE_20__);
  63294. /**
  63295. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  63296. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  63297. */
  63298. /**
  63299. * @module table/tableediting
  63300. */
  63301. /**
  63302. * The table editing feature.
  63303. *
  63304. * @extends module:core/plugin~Plugin
  63305. */
  63306. class TableEditing extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  63307. /**
  63308. * @inheritDoc
  63309. */
  63310. static get pluginName() {
  63311. return 'TableEditing';
  63312. }
  63313. /**
  63314. * @inheritDoc
  63315. */
  63316. init() {
  63317. const editor = this.editor;
  63318. const model = editor.model;
  63319. const schema = model.schema;
  63320. const conversion = editor.conversion;
  63321. schema.register( 'table', {
  63322. allowWhere: '$block',
  63323. allowAttributes: [ 'headingRows', 'headingColumns' ],
  63324. isObject: true,
  63325. isBlock: true
  63326. } );
  63327. schema.register( 'tableRow', {
  63328. allowIn: 'table',
  63329. isLimit: true
  63330. } );
  63331. schema.register( 'tableCell', {
  63332. allowIn: 'tableRow',
  63333. allowAttributes: [ 'colspan', 'rowspan' ],
  63334. isLimit: true,
  63335. isSelectable: true
  63336. } );
  63337. // Allow all $block content inside table cell.
  63338. schema.extend( '$block', { allowIn: 'tableCell' } );
  63339. // Disallow table in table.
  63340. schema.addChildCheck( ( context, childDefinition ) => {
  63341. if ( childDefinition.name == 'table' && Array.from( context.getNames() ).includes( 'table' ) ) {
  63342. return false;
  63343. }
  63344. } );
  63345. // Table conversion.
  63346. conversion.for( 'upcast' ).add( Object(_converters_upcasttable__WEBPACK_IMPORTED_MODULE_1__["default"])() );
  63347. conversion.for( 'editingDowncast' ).add( Object(_converters_downcast__WEBPACK_IMPORTED_MODULE_2__["downcastInsertTable"])( { asWidget: true } ) );
  63348. conversion.for( 'dataDowncast' ).add( Object(_converters_downcast__WEBPACK_IMPORTED_MODULE_2__["downcastInsertTable"])() );
  63349. // Table row conversion.
  63350. conversion.for( 'upcast' ).elementToElement( { model: 'tableRow', view: 'tr' } );
  63351. conversion.for( 'upcast' ).add( Object(_converters_upcasttable__WEBPACK_IMPORTED_MODULE_1__["skipEmptyTableRow"])() );
  63352. conversion.for( 'editingDowncast' ).add( Object(_converters_downcast__WEBPACK_IMPORTED_MODULE_2__["downcastInsertRow"])() );
  63353. conversion.for( 'editingDowncast' ).add( Object(_converters_downcast__WEBPACK_IMPORTED_MODULE_2__["downcastRemoveRow"])() );
  63354. // Table cell conversion.
  63355. conversion.for( 'upcast' ).elementToElement( { model: 'tableCell', view: 'td' } );
  63356. conversion.for( 'upcast' ).elementToElement( { model: 'tableCell', view: 'th' } );
  63357. conversion.for( 'editingDowncast' ).add( Object(_converters_downcast__WEBPACK_IMPORTED_MODULE_2__["downcastInsertCell"])() );
  63358. // Duplicates code - needed to properly refresh paragraph inside table cell.
  63359. editor.conversion.for( 'editingDowncast' ).elementToElement( {
  63360. model: 'paragraph',
  63361. view: _converters_downcast__WEBPACK_IMPORTED_MODULE_2__["convertParagraphInTableCell"],
  63362. converterPriority: 'high'
  63363. } );
  63364. // Table attributes conversion.
  63365. conversion.attributeToAttribute( { model: 'colspan', view: 'colspan' } );
  63366. conversion.attributeToAttribute( { model: 'rowspan', view: 'rowspan' } );
  63367. // Table heading columns conversion (change of heading rows requires reconversion of the whole table).
  63368. conversion.for( 'editingDowncast' ).add( Object(_converters_downcast__WEBPACK_IMPORTED_MODULE_2__["downcastTableHeadingColumnsChange"])() );
  63369. // Define all the commands.
  63370. editor.commands.add( 'insertTable', new _commands_inserttablecommand__WEBPACK_IMPORTED_MODULE_3__["default"]( editor ) );
  63371. editor.commands.add( 'insertTableRowAbove', new _commands_insertrowcommand__WEBPACK_IMPORTED_MODULE_4__["default"]( editor, { order: 'above' } ) );
  63372. editor.commands.add( 'insertTableRowBelow', new _commands_insertrowcommand__WEBPACK_IMPORTED_MODULE_4__["default"]( editor, { order: 'below' } ) );
  63373. editor.commands.add( 'insertTableColumnLeft', new _commands_insertcolumncommand__WEBPACK_IMPORTED_MODULE_5__["default"]( editor, { order: 'left' } ) );
  63374. editor.commands.add( 'insertTableColumnRight', new _commands_insertcolumncommand__WEBPACK_IMPORTED_MODULE_5__["default"]( editor, { order: 'right' } ) );
  63375. editor.commands.add( 'removeTableRow', new _commands_removerowcommand__WEBPACK_IMPORTED_MODULE_8__["default"]( editor ) );
  63376. editor.commands.add( 'removeTableColumn', new _commands_removecolumncommand__WEBPACK_IMPORTED_MODULE_9__["default"]( editor ) );
  63377. editor.commands.add( 'splitTableCellVertically', new _commands_splitcellcommand__WEBPACK_IMPORTED_MODULE_6__["default"]( editor, { direction: 'vertically' } ) );
  63378. editor.commands.add( 'splitTableCellHorizontally', new _commands_splitcellcommand__WEBPACK_IMPORTED_MODULE_6__["default"]( editor, { direction: 'horizontally' } ) );
  63379. editor.commands.add( 'mergeTableCells', new _commands_mergecellscommand__WEBPACK_IMPORTED_MODULE_12__["default"]( editor ) );
  63380. editor.commands.add( 'mergeTableCellRight', new _commands_mergecellcommand__WEBPACK_IMPORTED_MODULE_7__["default"]( editor, { direction: 'right' } ) );
  63381. editor.commands.add( 'mergeTableCellLeft', new _commands_mergecellcommand__WEBPACK_IMPORTED_MODULE_7__["default"]( editor, { direction: 'left' } ) );
  63382. editor.commands.add( 'mergeTableCellDown', new _commands_mergecellcommand__WEBPACK_IMPORTED_MODULE_7__["default"]( editor, { direction: 'down' } ) );
  63383. editor.commands.add( 'mergeTableCellUp', new _commands_mergecellcommand__WEBPACK_IMPORTED_MODULE_7__["default"]( editor, { direction: 'up' } ) );
  63384. editor.commands.add( 'setTableColumnHeader', new _commands_setheadercolumncommand__WEBPACK_IMPORTED_MODULE_11__["default"]( editor ) );
  63385. editor.commands.add( 'setTableRowHeader', new _commands_setheaderrowcommand__WEBPACK_IMPORTED_MODULE_10__["default"]( editor ) );
  63386. editor.commands.add( 'selectTableRow', new _commands_selectrowcommand__WEBPACK_IMPORTED_MODULE_13__["default"]( editor ) );
  63387. editor.commands.add( 'selectTableColumn', new _commands_selectcolumncommand__WEBPACK_IMPORTED_MODULE_14__["default"]( editor ) );
  63388. Object(_converters_table_heading_rows_refresh_post_fixer__WEBPACK_IMPORTED_MODULE_19__["default"])( model );
  63389. Object(_converters_table_layout_post_fixer__WEBPACK_IMPORTED_MODULE_16__["default"])( model );
  63390. Object(_converters_table_cell_refresh_post_fixer__WEBPACK_IMPORTED_MODULE_18__["default"])( model, editor.editing.mapper );
  63391. Object(_converters_table_cell_paragraph_post_fixer__WEBPACK_IMPORTED_MODULE_17__["default"])( model );
  63392. }
  63393. /**
  63394. * @inheritDoc
  63395. */
  63396. static get requires() {
  63397. return [ _src_tableutils__WEBPACK_IMPORTED_MODULE_15__["default"] ];
  63398. }
  63399. }
  63400. /***/ }),
  63401. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tablekeyboard.js":
  63402. /*!*********************************************************************!*\
  63403. !*** ./node_modules/@ckeditor/ckeditor5-table/src/tablekeyboard.js ***!
  63404. \*********************************************************************/
  63405. /*! exports provided: default */
  63406. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63407. "use strict";
  63408. __webpack_require__.r(__webpack_exports__);
  63409. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableKeyboard; });
  63410. /* harmony import */ var _tableselection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./tableselection */ "./node_modules/@ckeditor/ckeditor5-table/src/tableselection.js");
  63411. /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
  63412. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  63413. /* harmony import */ var _ckeditor_ckeditor5_utils_src_priorities__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/priorities */ "./node_modules/@ckeditor/ckeditor5-utils/src/priorities.js");
  63414. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
  63415. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  63416. /**
  63417. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  63418. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  63419. */
  63420. /**
  63421. * @module table/tablekeyboard
  63422. */
  63423. /**
  63424. * This plugin enables keyboard navigation for tables.
  63425. * It is loaded automatically by the {@link module:table/table~Table} plugin.
  63426. *
  63427. * @extends module:core/plugin~Plugin
  63428. */
  63429. class TableKeyboard extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_2__["default"] {
  63430. /**
  63431. * @inheritDoc
  63432. */
  63433. static get pluginName() {
  63434. return 'TableKeyboard';
  63435. }
  63436. /**
  63437. * @inheritDoc
  63438. */
  63439. static get requires() {
  63440. return [ _tableselection__WEBPACK_IMPORTED_MODULE_0__["default"] ];
  63441. }
  63442. /**
  63443. * @inheritDoc
  63444. */
  63445. init() {
  63446. const view = this.editor.editing.view;
  63447. const viewDocument = view.document;
  63448. // Handle Tab key navigation.
  63449. this.editor.keystrokes.set( 'Tab', ( ...args ) => this._handleTabOnSelectedTable( ...args ), { priority: 'low' } );
  63450. this.editor.keystrokes.set( 'Tab', this._getTabHandler( true ), { priority: 'low' } );
  63451. this.editor.keystrokes.set( 'Shift+Tab', this._getTabHandler( false ), { priority: 'low' } );
  63452. // Note: This listener has the "high-10" priority because it should allow the Widget plugin to handle the default
  63453. // behavior first ("high") but it should not be "prevent–defaulted" by the Widget plugin ("high-20") because of
  63454. // the fake selection retention on the fully selected widget.
  63455. this.listenTo( viewDocument, 'keydown', ( ...args ) => this._onKeydown( ...args ), { priority: _ckeditor_ckeditor5_utils_src_priorities__WEBPACK_IMPORTED_MODULE_3__["default"].get( 'high' ) - 10 } );
  63456. }
  63457. /**
  63458. * Handles {@link module:engine/view/document~Document#event:keydown keydown} events for the <kbd>Tab</kbd> key executed
  63459. * when the table widget is selected.
  63460. *
  63461. * @private
  63462. * @param {module:engine/view/observer/keyobserver~KeyEventData} data Key event data.
  63463. * @param {Function} cancel The stop/stopPropagation/preventDefault function.
  63464. */
  63465. _handleTabOnSelectedTable( data, cancel ) {
  63466. const editor = this.editor;
  63467. const selection = editor.model.document.selection;
  63468. const selectedElement = selection.getSelectedElement();
  63469. if ( !selectedElement || !selectedElement.is( 'element', 'table' ) ) {
  63470. return;
  63471. }
  63472. cancel();
  63473. editor.model.change( writer => {
  63474. writer.setSelection( writer.createRangeIn( selectedElement.getChild( 0 ).getChild( 0 ) ) );
  63475. } );
  63476. }
  63477. /**
  63478. * Returns a handler for {@link module:engine/view/document~Document#event:keydown keydown} events for the <kbd>Tab</kbd> key executed
  63479. * inside table cells.
  63480. *
  63481. * @private
  63482. * @param {Boolean} isForward Whether this handler will move the selection to the next or the previous cell.
  63483. */
  63484. _getTabHandler( isForward ) {
  63485. const editor = this.editor;
  63486. return ( domEventData, cancel ) => {
  63487. const selection = editor.model.document.selection;
  63488. let tableCell = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_5__["getTableCellsContainingSelection"])( selection )[ 0 ];
  63489. if ( !tableCell ) {
  63490. tableCell = this.editor.plugins.get( 'TableSelection' ).getFocusCell();
  63491. }
  63492. if ( !tableCell ) {
  63493. return;
  63494. }
  63495. cancel();
  63496. const tableRow = tableCell.parent;
  63497. const table = tableRow.parent;
  63498. const currentRowIndex = table.getChildIndex( tableRow );
  63499. const currentCellIndex = tableRow.getChildIndex( tableCell );
  63500. const isFirstCellInRow = currentCellIndex === 0;
  63501. if ( !isForward && isFirstCellInRow && currentRowIndex === 0 ) {
  63502. // Set the selection over the whole table if the selection was in the first table cell.
  63503. editor.model.change( writer => {
  63504. writer.setSelection( writer.createRangeOn( table ) );
  63505. } );
  63506. return;
  63507. }
  63508. const isLastCellInRow = currentCellIndex === tableRow.childCount - 1;
  63509. const isLastRow = currentRowIndex === table.childCount - 1;
  63510. if ( isForward && isLastRow && isLastCellInRow ) {
  63511. editor.execute( 'insertTableRowBelow' );
  63512. // Check if the command actually added a row. If `insertTableRowBelow` execution didn't add a row (because it was disabled
  63513. // or it got overwritten) set the selection over the whole table to mirror the first cell case.
  63514. if ( currentRowIndex === table.childCount - 1 ) {
  63515. editor.model.change( writer => {
  63516. writer.setSelection( writer.createRangeOn( table ) );
  63517. } );
  63518. return;
  63519. }
  63520. }
  63521. let cellToFocus;
  63522. // Move to the first cell in the next row.
  63523. if ( isForward && isLastCellInRow ) {
  63524. const nextRow = table.getChild( currentRowIndex + 1 );
  63525. cellToFocus = nextRow.getChild( 0 );
  63526. }
  63527. // Move to the last cell in the previous row.
  63528. else if ( !isForward && isFirstCellInRow ) {
  63529. const previousRow = table.getChild( currentRowIndex - 1 );
  63530. cellToFocus = previousRow.getChild( previousRow.childCount - 1 );
  63531. }
  63532. // Move to the next/previous cell.
  63533. else {
  63534. cellToFocus = tableRow.getChild( currentCellIndex + ( isForward ? 1 : -1 ) );
  63535. }
  63536. editor.model.change( writer => {
  63537. writer.setSelection( writer.createRangeIn( cellToFocus ) );
  63538. } );
  63539. };
  63540. }
  63541. /**
  63542. * Handles {@link module:engine/view/document~Document#event:keydown keydown} events.
  63543. *
  63544. * @private
  63545. * @param {module:utils/eventinfo~EventInfo} eventInfo
  63546. * @param {module:engine/view/observer/domeventdata~DomEventData} domEventData
  63547. */
  63548. _onKeydown( eventInfo, domEventData ) {
  63549. const editor = this.editor;
  63550. const keyCode = domEventData.keyCode;
  63551. if ( !Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_4__["isArrowKeyCode"])( keyCode ) ) {
  63552. return;
  63553. }
  63554. const direction = Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_4__["getLocalizedArrowKeyCodeDirection"])( keyCode, editor.locale.contentLanguageDirection );
  63555. const wasHandled = this._handleArrowKeys( direction, domEventData.shiftKey );
  63556. if ( wasHandled ) {
  63557. domEventData.preventDefault();
  63558. domEventData.stopPropagation();
  63559. eventInfo.stop();
  63560. }
  63561. }
  63562. /**
  63563. * Handles arrow keys to move the selection around the table.
  63564. *
  63565. * @private
  63566. * @param {'left'|'up'|'right'|'down'} direction The direction of the arrow key.
  63567. * @param {Boolean} expandSelection If the current selection should be expanded.
  63568. * @returns {Boolean} Returns `true` if key was handled.
  63569. */
  63570. _handleArrowKeys( direction, expandSelection ) {
  63571. const model = this.editor.model;
  63572. const selection = model.document.selection;
  63573. const isForward = [ 'right', 'down' ].includes( direction );
  63574. // In case one or more table cells are selected (from outside),
  63575. // move the selection to a cell adjacent to the selected table fragment.
  63576. const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_5__["getSelectedTableCells"])( selection );
  63577. if ( selectedCells.length ) {
  63578. let focusCell;
  63579. if ( expandSelection ) {
  63580. focusCell = this.editor.plugins.get( 'TableSelection' ).getFocusCell();
  63581. } else {
  63582. focusCell = isForward ? selectedCells[ selectedCells.length - 1 ] : selectedCells[ 0 ];
  63583. }
  63584. this._navigateFromCellInDirection( focusCell, direction, expandSelection );
  63585. return true;
  63586. }
  63587. // Abort if we're not in a table cell.
  63588. const tableCell = selection.focus.findAncestor( 'tableCell' );
  63589. if ( !tableCell ) {
  63590. return false;
  63591. }
  63592. // Navigation is in the opposite direction than the selection direction so this is shrinking of the selection.
  63593. // Selection for sure will not approach cell edge.
  63594. if ( expandSelection && !selection.isCollapsed && selection.isBackward == isForward ) {
  63595. return false;
  63596. }
  63597. // Let's check if the selection is at the beginning/end of the cell.
  63598. if ( this._isSelectionAtCellEdge( selection, tableCell, isForward ) ) {
  63599. this._navigateFromCellInDirection( tableCell, direction, expandSelection );
  63600. return true;
  63601. }
  63602. return false;
  63603. }
  63604. /**
  63605. * Returns `true` if the selection is at the boundary of a table cell according to the navigation direction.
  63606. *
  63607. * @private
  63608. * @param {module:engine/model/selection~Selection} selection The current selection.
  63609. * @param {module:engine/model/element~Element} tableCell The current table cell element.
  63610. * @param {Boolean} isForward The expected navigation direction.
  63611. * @returns {Boolean}
  63612. */
  63613. _isSelectionAtCellEdge( selection, tableCell, isForward ) {
  63614. const model = this.editor.model;
  63615. const schema = this.editor.model.schema;
  63616. const focus = isForward ? selection.getLastPosition() : selection.getFirstPosition();
  63617. // If the current limit element is not table cell we are for sure not at the cell edge.
  63618. // Also `modifySelection` will not let us out of it.
  63619. if ( !schema.getLimitElement( focus ).is( 'element', 'tableCell' ) ) {
  63620. const boundaryPosition = model.createPositionAt( tableCell, isForward ? 'end' : 0 );
  63621. return boundaryPosition.isTouching( focus );
  63622. }
  63623. const probe = model.createSelection( focus );
  63624. model.modifySelection( probe, { direction: isForward ? 'forward' : 'backward' } );
  63625. // If there was no change in the focus position, then it's not possible to move the selection there.
  63626. return focus.isEqual( probe.focus );
  63627. }
  63628. /**
  63629. * Moves the selection from the given table cell in the specified direction.
  63630. *
  63631. * @protected
  63632. * @param {module:engine/model/element~Element} focusCell The table cell that is current multi-cell selection focus.
  63633. * @param {'left'|'up'|'right'|'down'} direction Direction in which selection should move.
  63634. * @param {Boolean} [expandSelection=false] If the current selection should be expanded.
  63635. */
  63636. _navigateFromCellInDirection( focusCell, direction, expandSelection = false ) {
  63637. const model = this.editor.model;
  63638. const table = focusCell.findAncestor( 'table' );
  63639. const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( table, { includeAllSlots: true } ) ];
  63640. const { row: lastRow, column: lastColumn } = tableMap[ tableMap.length - 1 ];
  63641. const currentCellInfo = tableMap.find( ( { cell } ) => cell == focusCell );
  63642. let { row, column } = currentCellInfo;
  63643. switch ( direction ) {
  63644. case 'left':
  63645. column--;
  63646. break;
  63647. case 'up':
  63648. row--;
  63649. break;
  63650. case 'right':
  63651. column += currentCellInfo.cellWidth;
  63652. break;
  63653. case 'down':
  63654. row += currentCellInfo.cellHeight;
  63655. break;
  63656. }
  63657. const isOutsideVertically = row < 0 || row > lastRow;
  63658. const isBeforeFirstCell = column < 0 && row <= 0;
  63659. const isAfterLastCell = column > lastColumn && row >= lastRow;
  63660. // Note that if the table cell at the end of a row is row-spanned then isAfterLastCell will never be true.
  63661. // However, we don't know if user was navigating on the last row or not, so let's stay in the table.
  63662. if ( isOutsideVertically || isBeforeFirstCell || isAfterLastCell ) {
  63663. model.change( writer => {
  63664. writer.setSelection( writer.createRangeOn( table ) );
  63665. } );
  63666. return;
  63667. }
  63668. if ( column < 0 ) {
  63669. column = expandSelection ? 0 : lastColumn;
  63670. row--;
  63671. } else if ( column > lastColumn ) {
  63672. column = expandSelection ? lastColumn : 0;
  63673. row++;
  63674. }
  63675. const cellToSelect = tableMap.find( cellInfo => cellInfo.row == row && cellInfo.column == column ).cell;
  63676. const isForward = [ 'right', 'down' ].includes( direction );
  63677. const tableSelection = this.editor.plugins.get( 'TableSelection' );
  63678. if ( expandSelection && tableSelection.isEnabled ) {
  63679. const anchorCell = tableSelection.getAnchorCell() || focusCell;
  63680. tableSelection.setCellSelection( anchorCell, cellToSelect );
  63681. } else {
  63682. const positionToSelect = model.createPositionAt( cellToSelect, isForward ? 0 : 'end' );
  63683. model.change( writer => {
  63684. writer.setSelection( positionToSelect );
  63685. } );
  63686. }
  63687. }
  63688. }
  63689. /***/ }),
  63690. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tablemouse.js":
  63691. /*!******************************************************************!*\
  63692. !*** ./node_modules/@ckeditor/ckeditor5-table/src/tablemouse.js ***!
  63693. \******************************************************************/
  63694. /*! exports provided: default */
  63695. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63696. "use strict";
  63697. __webpack_require__.r(__webpack_exports__);
  63698. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableMouse; });
  63699. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  63700. /* harmony import */ var _tableselection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tableselection */ "./node_modules/@ckeditor/ckeditor5-table/src/tableselection.js");
  63701. /* harmony import */ var _tablemouse_mouseeventsobserver__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tablemouse/mouseeventsobserver */ "./node_modules/@ckeditor/ckeditor5-table/src/tablemouse/mouseeventsobserver.js");
  63702. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  63703. /**
  63704. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  63705. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  63706. */
  63707. /**
  63708. * @module table/tablemouse
  63709. */
  63710. /**
  63711. * This plugin enables a table cells' selection with the mouse.
  63712. * It is loaded automatically by the {@link module:table/table~Table} plugin.
  63713. *
  63714. * @extends module:core/plugin~Plugin
  63715. */
  63716. class TableMouse extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  63717. /**
  63718. * @inheritDoc
  63719. */
  63720. static get pluginName() {
  63721. return 'TableMouse';
  63722. }
  63723. /**
  63724. * @inheritDoc
  63725. */
  63726. static get requires() {
  63727. return [ _tableselection__WEBPACK_IMPORTED_MODULE_1__["default"] ];
  63728. }
  63729. /**
  63730. * @inheritDoc
  63731. */
  63732. init() {
  63733. const editor = this.editor;
  63734. // Currently the MouseObserver only handles `mouseup` events.
  63735. // TODO move to the engine?
  63736. editor.editing.view.addObserver( _tablemouse_mouseeventsobserver__WEBPACK_IMPORTED_MODULE_2__["default"] );
  63737. this._enableShiftClickSelection();
  63738. this._enableMouseDragSelection();
  63739. }
  63740. /**
  63741. * Enables making cells selection by <kbd>Shift</kbd>+click. Creates a selection from the cell which previously held
  63742. * the selection to the cell which was clicked. It can be the same cell, in which case it selects a single cell.
  63743. *
  63744. * @private
  63745. */
  63746. _enableShiftClickSelection() {
  63747. const editor = this.editor;
  63748. let blockSelectionChange = false;
  63749. const tableSelection = editor.plugins.get( _tableselection__WEBPACK_IMPORTED_MODULE_1__["default"] );
  63750. this.listenTo( editor.editing.view.document, 'mousedown', ( evt, domEventData ) => {
  63751. if ( !this.isEnabled || !tableSelection.isEnabled ) {
  63752. return;
  63753. }
  63754. if ( !domEventData.domEvent.shiftKey ) {
  63755. return;
  63756. }
  63757. const anchorCell = tableSelection.getAnchorCell() || Object(_utils_selection__WEBPACK_IMPORTED_MODULE_3__["getTableCellsContainingSelection"])( editor.model.document.selection )[ 0 ];
  63758. if ( !anchorCell ) {
  63759. return;
  63760. }
  63761. const targetCell = this._getModelTableCellFromDomEvent( domEventData );
  63762. if ( targetCell && haveSameTableParent( anchorCell, targetCell ) ) {
  63763. blockSelectionChange = true;
  63764. tableSelection.setCellSelection( anchorCell, targetCell );
  63765. domEventData.preventDefault();
  63766. }
  63767. } );
  63768. this.listenTo( editor.editing.view.document, 'mouseup', () => {
  63769. blockSelectionChange = false;
  63770. } );
  63771. // We need to ignore a `selectionChange` event that is fired after we render our new table cells selection.
  63772. // When downcasting table cells selection to the view, we put the view selection in the last selected cell
  63773. // in a place that may not be natively a "correct" location. This is – we put it directly in the `<td>` element.
  63774. // All browsers fire the native `selectionchange` event.
  63775. // However, all browsers except Safari return the selection in the exact place where we put it
  63776. // (even though it's visually normalized). Safari returns `<td><p>^foo` that makes our selection observer
  63777. // fire our `selectionChange` event (because the view selection that we set in the first step differs from the DOM selection).
  63778. // Since `selectionChange` is fired, we automatically update the model selection that moves it that paragraph.
  63779. // This breaks our dear cells selection.
  63780. //
  63781. // Theoretically this issue concerns only Safari that is the only browser that do normalize the selection.
  63782. // However, to avoid code branching and to have a good coverage for this event blocker, I enabled it for all browsers.
  63783. //
  63784. // Note: I'm keeping the `blockSelectionChange` state separately for shift+click and mouse drag (exact same logic)
  63785. // so I don't have to try to analyze whether they don't overlap in some weird cases. Probably they don't.
  63786. // But I have other things to do, like writing this comment.
  63787. this.listenTo( editor.editing.view.document, 'selectionChange', evt => {
  63788. if ( blockSelectionChange ) {
  63789. // @if CK_DEBUG // console.log( 'Blocked selectionChange to avoid breaking table cells selection.' );
  63790. evt.stop();
  63791. }
  63792. }, { priority: 'highest' } );
  63793. }
  63794. /**
  63795. * Enables making cells selection by dragging.
  63796. *
  63797. * The selection is made only on mousemove. Mouse tracking is started on mousedown.
  63798. * However, the cells selection is enabled only after the mouse cursor left the anchor cell.
  63799. * Thanks to that normal text selection within one cell works just fine. However, you can still select
  63800. * just one cell by leaving the anchor cell and moving back to it.
  63801. *
  63802. * @private
  63803. */
  63804. _enableMouseDragSelection() {
  63805. const editor = this.editor;
  63806. let anchorCell, targetCell;
  63807. let beganCellSelection = false;
  63808. let blockSelectionChange = false;
  63809. const tableSelection = editor.plugins.get( _tableselection__WEBPACK_IMPORTED_MODULE_1__["default"] );
  63810. this.listenTo( editor.editing.view.document, 'mousedown', ( evt, domEventData ) => {
  63811. if ( !this.isEnabled || !tableSelection.isEnabled ) {
  63812. return;
  63813. }
  63814. // Make sure to not conflict with the shift+click listener and any other possible handler.
  63815. if ( domEventData.domEvent.shiftKey || domEventData.domEvent.ctrlKey || domEventData.domEvent.altKey ) {
  63816. return;
  63817. }
  63818. anchorCell = this._getModelTableCellFromDomEvent( domEventData );
  63819. } );
  63820. this.listenTo( editor.editing.view.document, 'mousemove', ( evt, domEventData ) => {
  63821. if ( !domEventData.domEvent.buttons ) {
  63822. return;
  63823. }
  63824. if ( !anchorCell ) {
  63825. return;
  63826. }
  63827. const newTargetCell = this._getModelTableCellFromDomEvent( domEventData );
  63828. if ( newTargetCell && haveSameTableParent( anchorCell, newTargetCell ) ) {
  63829. targetCell = newTargetCell;
  63830. // Switch to the cell selection mode after the mouse cursor left the anchor cell.
  63831. // Switch off only on mouseup (makes selecting a single cell possible).
  63832. if ( !beganCellSelection && targetCell != anchorCell ) {
  63833. beganCellSelection = true;
  63834. }
  63835. }
  63836. // Yep, not making a cell selection yet. See method docs.
  63837. if ( !beganCellSelection ) {
  63838. return;
  63839. }
  63840. blockSelectionChange = true;
  63841. tableSelection.setCellSelection( anchorCell, targetCell );
  63842. domEventData.preventDefault();
  63843. } );
  63844. this.listenTo( editor.editing.view.document, 'mouseup', () => {
  63845. beganCellSelection = false;
  63846. blockSelectionChange = false;
  63847. anchorCell = null;
  63848. targetCell = null;
  63849. } );
  63850. // See the explanation in `_enableShiftClickSelection()`.
  63851. this.listenTo( editor.editing.view.document, 'selectionChange', evt => {
  63852. if ( blockSelectionChange ) {
  63853. // @if CK_DEBUG // console.log( 'Blocked selectionChange to avoid breaking table cells selection.' );
  63854. evt.stop();
  63855. }
  63856. }, { priority: 'highest' } );
  63857. }
  63858. /**
  63859. * Returns the model table cell element based on the target element of the passed DOM event.
  63860. *
  63861. * @private
  63862. * @param {module:engine/view/observer/domeventdata~DomEventData} domEventData
  63863. * @returns {module:engine/model/element~Element|undefined} Returns the table cell or `undefined`.
  63864. */
  63865. _getModelTableCellFromDomEvent( domEventData ) {
  63866. // Note: Work with positions (not element mapping) because the target element can be an attribute or other non-mapped element.
  63867. const viewTargetElement = domEventData.target;
  63868. const viewPosition = this.editor.editing.view.createPositionAt( viewTargetElement, 0 );
  63869. const modelPosition = this.editor.editing.mapper.toModelPosition( viewPosition );
  63870. const modelElement = modelPosition.parent;
  63871. return modelElement.findAncestor( 'tableCell', { includeSelf: true } );
  63872. }
  63873. }
  63874. function haveSameTableParent( cellA, cellB ) {
  63875. return cellA.parent.parent == cellB.parent.parent;
  63876. }
  63877. /***/ }),
  63878. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tablemouse/mouseeventsobserver.js":
  63879. /*!**************************************************************************************!*\
  63880. !*** ./node_modules/@ckeditor/ckeditor5-table/src/tablemouse/mouseeventsobserver.js ***!
  63881. \**************************************************************************************/
  63882. /*! exports provided: default */
  63883. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63884. "use strict";
  63885. __webpack_require__.r(__webpack_exports__);
  63886. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MouseEventsObserver; });
  63887. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_observer_domeventobserver__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/observer/domeventobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js");
  63888. /**
  63889. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  63890. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  63891. */
  63892. /**
  63893. * @module table/tableselection/mouseeventsobserver
  63894. */
  63895. /**
  63896. * The mouse selection event observer.
  63897. *
  63898. * It registers listeners for the following DOM events:
  63899. *
  63900. * - `'mousemove'`
  63901. * - `'mouseup'`
  63902. * - `'mouseleave'`
  63903. *
  63904. * Note that this observer is disabled by default. To enable this observer, it needs to be added to
  63905. * {@link module:engine/view/view~View} using the {@link module:engine/view/view~View#addObserver} method.
  63906. *
  63907. * The observer is registered by the {@link module:table/tableselection~TableSelection} plugin.
  63908. *
  63909. * @extends module:engine/view/observer/domeventobserver~DomEventObserver
  63910. */
  63911. class MouseEventsObserver extends _ckeditor_ckeditor5_engine_src_view_observer_domeventobserver__WEBPACK_IMPORTED_MODULE_0__["default"] {
  63912. /**
  63913. * @inheritDoc
  63914. */
  63915. constructor( view ) {
  63916. super( view );
  63917. this.domEventType = [ 'mousemove', 'mouseup', 'mouseleave' ];
  63918. }
  63919. /**
  63920. * @inheritDoc
  63921. */
  63922. onDomEvent( domEvent ) {
  63923. this.fire( domEvent.type, domEvent );
  63924. }
  63925. }
  63926. /**
  63927. * Fired when the mouse button is released over one of the editables.
  63928. *
  63929. * Introduced by {@link module:table/tableselection/mouseeventsobserver~MouseEventsObserver}.
  63930. *
  63931. * Note that this event is not available by default. To make it available,
  63932. * {@link module:table/tableselection/mouseeventsobserver~MouseEventsObserver} needs to be added
  63933. * to {@link module:engine/view/view~View} using the {@link module:engine/view/view~View#addObserver} method.
  63934. *
  63935. * @see module:table/tableselection/mouseeventsobserver~MouseEventsObserver
  63936. * @event module:engine/view/document~Document#event:mouseup
  63937. * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
  63938. */
  63939. /**
  63940. * Fired when the mouse is moved over one of the editables.
  63941. *
  63942. * Introduced by {@link module:table/tableselection/mouseeventsobserver~MouseEventsObserver}.
  63943. *
  63944. * Note that this event is not available by default. To make it available,
  63945. * {@link module:table/tableselection/mouseeventsobserver~MouseEventsObserver} needs to be added
  63946. * to {@link module:engine/view/view~View} using the {@link module:engine/view/view~View#addObserver} method.
  63947. *
  63948. * @see module:table/tableselection/mouseeventsobserver~MouseEventsObserver
  63949. * @event module:engine/view/document~Document#event:mousemove
  63950. * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
  63951. */
  63952. /**
  63953. * Fired when the mouse is moved out of one of the editables.
  63954. *
  63955. * Introduced by {@link module:table/tableselection/mouseeventsobserver~MouseEventsObserver}.
  63956. *
  63957. * Note that this event is not available by default. To make it available,
  63958. * {@link module:table/tableselection/mouseeventsobserver~MouseEventsObserver} needs to be added
  63959. * to {@link module:engine/view/view~View} using the {@link module:engine/view/view~View#addObserver} method.
  63960. *
  63961. * @see module:table/tableselection/mouseeventsobserver~MouseEventsObserver
  63962. * @event module:engine/view/document~Document#event:mouseleave
  63963. * @param {module:engine/view/observer/domeventdata~DomEventData} data Event data.
  63964. */
  63965. /***/ }),
  63966. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tableselection.js":
  63967. /*!**********************************************************************!*\
  63968. !*** ./node_modules/@ckeditor/ckeditor5-table/src/tableselection.js ***!
  63969. \**********************************************************************/
  63970. /*! exports provided: default */
  63971. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63972. "use strict";
  63973. __webpack_require__.r(__webpack_exports__);
  63974. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableSelection; });
  63975. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  63976. /* harmony import */ var _ckeditor_ckeditor5_utils_src_first__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/first */ "./node_modules/@ckeditor/ckeditor5-utils/src/first.js");
  63977. /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
  63978. /* harmony import */ var _tableutils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./tableutils */ "./node_modules/@ckeditor/ckeditor5-table/src/tableutils.js");
  63979. /* harmony import */ var _utils_structure__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/structure */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js");
  63980. /* harmony import */ var _utils_selection__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/selection */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js");
  63981. /* harmony import */ var _theme_tableselection_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../theme/tableselection.css */ "./node_modules/@ckeditor/ckeditor5-table/theme/tableselection.css");
  63982. /* harmony import */ var _theme_tableselection_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_theme_tableselection_css__WEBPACK_IMPORTED_MODULE_6__);
  63983. /**
  63984. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  63985. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  63986. */
  63987. /**
  63988. * @module table/tableselection
  63989. */
  63990. /**
  63991. * This plugin enables the advanced table cells, rows and columns selection.
  63992. * It is loaded automatically by the {@link module:table/table~Table} plugin.
  63993. *
  63994. * @extends module:core/plugin~Plugin
  63995. */
  63996. class TableSelection extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  63997. /**
  63998. * @inheritDoc
  63999. */
  64000. static get pluginName() {
  64001. return 'TableSelection';
  64002. }
  64003. /**
  64004. * @inheritDoc
  64005. */
  64006. static get requires() {
  64007. return [ _tableutils__WEBPACK_IMPORTED_MODULE_3__["default"] ];
  64008. }
  64009. /**
  64010. * @inheritDoc
  64011. */
  64012. init() {
  64013. const editor = this.editor;
  64014. const model = editor.model;
  64015. this.listenTo( model, 'deleteContent', ( evt, args ) => this._handleDeleteContent( evt, args ), { priority: 'high' } );
  64016. this._defineSelectionConverter();
  64017. this._enablePluginDisabling(); // sic!
  64018. }
  64019. /**
  64020. * Returns the currently selected table cells or `null` if it is not a table cells selection.
  64021. *
  64022. * @returns {Array.<module:engine/model/element~Element>|null}
  64023. */
  64024. getSelectedTableCells() {
  64025. const selection = this.editor.model.document.selection;
  64026. const selectedCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_5__["getSelectedTableCells"])( selection );
  64027. if ( selectedCells.length == 0 ) {
  64028. return null;
  64029. }
  64030. // This should never happen, but let's know if it ever happens.
  64031. // @if CK_DEBUG // /* istanbul ignore next */
  64032. // @if CK_DEBUG // if ( selectedCells.length != selection.rangeCount ) {
  64033. // @if CK_DEBUG // console.warn( 'Mixed selection warning. The selection contains table cells and some other ranges.' );
  64034. // @if CK_DEBUG // }
  64035. return selectedCells;
  64036. }
  64037. /**
  64038. * Returns the selected table fragment as a document fragment.
  64039. *
  64040. * @returns {module:engine/model/documentfragment~DocumentFragment|null}
  64041. */
  64042. getSelectionAsFragment() {
  64043. const selectedCells = this.getSelectedTableCells();
  64044. if ( !selectedCells ) {
  64045. return null;
  64046. }
  64047. return this.editor.model.change( writer => {
  64048. const documentFragment = writer.createDocumentFragment();
  64049. const tableUtils = this.editor.plugins.get( 'TableUtils' );
  64050. const { first: firstColumn, last: lastColumn } = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_5__["getColumnIndexes"])( selectedCells );
  64051. const { first: firstRow, last: lastRow } = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_5__["getRowIndexes"])( selectedCells );
  64052. const sourceTable = selectedCells[ 0 ].findAncestor( 'table' );
  64053. let adjustedLastRow = lastRow;
  64054. let adjustedLastColumn = lastColumn;
  64055. // If the selection is rectangular there could be a case of all cells in the last row/column spanned over
  64056. // next row/column so the real lastRow/lastColumn should be updated.
  64057. if ( Object(_utils_selection__WEBPACK_IMPORTED_MODULE_5__["isSelectionRectangular"])( selectedCells, tableUtils ) ) {
  64058. const dimensions = {
  64059. firstColumn,
  64060. lastColumn,
  64061. firstRow,
  64062. lastRow
  64063. };
  64064. adjustedLastRow = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_4__["adjustLastRowIndex"])( sourceTable, dimensions );
  64065. adjustedLastColumn = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_4__["adjustLastColumnIndex"])( sourceTable, dimensions );
  64066. }
  64067. const cropDimensions = {
  64068. startRow: firstRow,
  64069. startColumn: firstColumn,
  64070. endRow: adjustedLastRow,
  64071. endColumn: adjustedLastColumn
  64072. };
  64073. const table = Object(_utils_structure__WEBPACK_IMPORTED_MODULE_4__["cropTableToDimensions"])( sourceTable, cropDimensions, writer );
  64074. writer.insert( table, documentFragment, 0 );
  64075. return documentFragment;
  64076. } );
  64077. }
  64078. /**
  64079. * Sets the model selection based on given anchor and target cells (can be the same cell).
  64080. * Takes care of setting the backward flag.
  64081. *
  64082. * const modelRoot = editor.model.document.getRoot();
  64083. * const firstCell = modelRoot.getNodeByPath( [ 0, 0, 0 ] );
  64084. * const lastCell = modelRoot.getNodeByPath( [ 0, 0, 1 ] );
  64085. *
  64086. * const tableSelection = editor.plugins.get( 'TableSelection' );
  64087. * tableSelection.setCellSelection( firstCell, lastCell );
  64088. *
  64089. * @param {module:engine/model/element~Element} anchorCell
  64090. * @param {module:engine/model/element~Element} targetCell
  64091. */
  64092. setCellSelection( anchorCell, targetCell ) {
  64093. const cellsToSelect = this._getCellsToSelect( anchorCell, targetCell );
  64094. this.editor.model.change( writer => {
  64095. writer.setSelection(
  64096. cellsToSelect.cells.map( cell => writer.createRangeOn( cell ) ),
  64097. { backward: cellsToSelect.backward }
  64098. );
  64099. } );
  64100. }
  64101. /**
  64102. * Returns the focus cell from the current selection.
  64103. *
  64104. * @returns {module:engine/model/element~Element}
  64105. */
  64106. getFocusCell() {
  64107. const selection = this.editor.model.document.selection;
  64108. const focusCellRange = [ ...selection.getRanges() ].pop();
  64109. const element = focusCellRange.getContainedElement();
  64110. if ( element && element.is( 'element', 'tableCell' ) ) {
  64111. return element;
  64112. }
  64113. return null;
  64114. }
  64115. /**
  64116. * Returns the anchor cell from the current selection.
  64117. *
  64118. * @returns {module:engine/model/element~Element} anchorCell
  64119. */
  64120. getAnchorCell() {
  64121. const selection = this.editor.model.document.selection;
  64122. const anchorCellRange = Object(_ckeditor_ckeditor5_utils_src_first__WEBPACK_IMPORTED_MODULE_1__["default"])( selection.getRanges() );
  64123. const element = anchorCellRange.getContainedElement();
  64124. if ( element && element.is( 'element', 'tableCell' ) ) {
  64125. return element;
  64126. }
  64127. return null;
  64128. }
  64129. /**
  64130. * Defines a selection converter which marks the selected cells with a specific class.
  64131. *
  64132. * The real DOM selection is put in the last cell. Since the order of ranges is dependent on whether the
  64133. * selection is backward or not, the last cell will usually be close to the "focus" end of the selection
  64134. * (a selection has anchor and focus).
  64135. *
  64136. * The real DOM selection is then hidden with CSS.
  64137. *
  64138. * @private
  64139. */
  64140. _defineSelectionConverter() {
  64141. const editor = this.editor;
  64142. const highlighted = new Set();
  64143. editor.conversion.for( 'editingDowncast' ).add( dispatcher => dispatcher.on( 'selection', ( evt, data, conversionApi ) => {
  64144. const viewWriter = conversionApi.writer;
  64145. clearHighlightedTableCells( viewWriter );
  64146. const selectedCells = this.getSelectedTableCells();
  64147. if ( !selectedCells ) {
  64148. return;
  64149. }
  64150. for ( const tableCell of selectedCells ) {
  64151. const viewElement = conversionApi.mapper.toViewElement( tableCell );
  64152. viewWriter.addClass( 'ck-editor__editable_selected', viewElement );
  64153. highlighted.add( viewElement );
  64154. }
  64155. const lastViewCell = conversionApi.mapper.toViewElement( selectedCells[ selectedCells.length - 1 ] );
  64156. viewWriter.setSelection( lastViewCell, 0 );
  64157. }, { priority: 'lowest' } ) );
  64158. function clearHighlightedTableCells( writer ) {
  64159. for ( const previouslyHighlighted of highlighted ) {
  64160. writer.removeClass( 'ck-editor__editable_selected', previouslyHighlighted );
  64161. }
  64162. highlighted.clear();
  64163. }
  64164. }
  64165. /**
  64166. * Creates a listener that reacts to changes in {@link #isEnabled} and, if the plugin was disabled,
  64167. * it collapses the multi-cell selection to a regular selection placed inside a table cell.
  64168. *
  64169. * This listener helps features that disable the table selection plugin bring the selection
  64170. * to a clear state they can work with (for instance, because they don't support multiple cell selection).
  64171. */
  64172. _enablePluginDisabling() {
  64173. const editor = this.editor;
  64174. this.on( 'change:isEnabled', () => {
  64175. if ( !this.isEnabled ) {
  64176. const selectedCells = this.getSelectedTableCells();
  64177. if ( !selectedCells ) {
  64178. return;
  64179. }
  64180. editor.model.change( writer => {
  64181. const position = writer.createPositionAt( selectedCells[ 0 ], 0 );
  64182. const range = editor.model.schema.getNearestSelectionRange( position );
  64183. writer.setSelection( range );
  64184. } );
  64185. }
  64186. } );
  64187. }
  64188. /**
  64189. * Overrides the default `model.deleteContent()` behavior over a selected table fragment.
  64190. *
  64191. * @private
  64192. * @param {module:utils/eventinfo~EventInfo} event
  64193. * @param {Array.<*>} args Delete content method arguments.
  64194. */
  64195. _handleDeleteContent( event, args ) {
  64196. const [ selection, options ] = args;
  64197. const model = this.editor.model;
  64198. const isBackward = !options || options.direction == 'backward';
  64199. const selectedTableCells = Object(_utils_selection__WEBPACK_IMPORTED_MODULE_5__["getSelectedTableCells"])( selection );
  64200. if ( !selectedTableCells.length ) {
  64201. return;
  64202. }
  64203. event.stop();
  64204. model.change( writer => {
  64205. const tableCellToSelect = selectedTableCells[ isBackward ? selectedTableCells.length - 1 : 0 ];
  64206. model.change( writer => {
  64207. for ( const tableCell of selectedTableCells ) {
  64208. model.deleteContent( writer.createSelection( tableCell, 'in' ) );
  64209. }
  64210. } );
  64211. const rangeToSelect = model.schema.getNearestSelectionRange( writer.createPositionAt( tableCellToSelect, 0 ) );
  64212. // Note: we ignore the case where rangeToSelect may be null because deleteContent() will always (unless someone broke it)
  64213. // create an empty paragraph to accommodate the selection.
  64214. if ( selection.is( 'documentSelection' ) ) {
  64215. writer.setSelection( rangeToSelect );
  64216. } else {
  64217. selection.setTo( rangeToSelect );
  64218. }
  64219. } );
  64220. }
  64221. /**
  64222. * Returns an array of table cells that should be selected based on the
  64223. * given anchor cell and target (focus) cell.
  64224. *
  64225. * The cells are returned in a reverse direction if the selection is backward.
  64226. *
  64227. * @private
  64228. * @param {module:engine/model/element~Element} anchorCell
  64229. * @param {module:engine/model/element~Element} targetCell
  64230. * @returns {Array.<module:engine/model/element~Element>}
  64231. */
  64232. _getCellsToSelect( anchorCell, targetCell ) {
  64233. const tableUtils = this.editor.plugins.get( 'TableUtils' );
  64234. const startLocation = tableUtils.getCellLocation( anchorCell );
  64235. const endLocation = tableUtils.getCellLocation( targetCell );
  64236. const startRow = Math.min( startLocation.row, endLocation.row );
  64237. const endRow = Math.max( startLocation.row, endLocation.row );
  64238. const startColumn = Math.min( startLocation.column, endLocation.column );
  64239. const endColumn = Math.max( startLocation.column, endLocation.column );
  64240. // 2-dimensional array of the selected cells to ease flipping the order of cells for backward selections.
  64241. const selectionMap = new Array( endRow - startRow + 1 ).fill( null ).map( () => [] );
  64242. const walkerOptions = {
  64243. startRow,
  64244. endRow,
  64245. startColumn,
  64246. endColumn
  64247. };
  64248. for ( const { row, cell } of new _tablewalker__WEBPACK_IMPORTED_MODULE_2__["default"]( anchorCell.findAncestor( 'table' ), walkerOptions ) ) {
  64249. selectionMap[ row - startRow ].push( cell );
  64250. }
  64251. const flipVertically = endLocation.row < startLocation.row;
  64252. const flipHorizontally = endLocation.column < startLocation.column;
  64253. if ( flipVertically ) {
  64254. selectionMap.reverse();
  64255. }
  64256. if ( flipHorizontally ) {
  64257. selectionMap.forEach( row => row.reverse() );
  64258. }
  64259. return {
  64260. cells: selectionMap.flat(),
  64261. backward: flipVertically || flipHorizontally
  64262. };
  64263. }
  64264. }
  64265. /***/ }),
  64266. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tabletoolbar.js":
  64267. /*!********************************************************************!*\
  64268. !*** ./node_modules/@ckeditor/ckeditor5-table/src/tabletoolbar.js ***!
  64269. \********************************************************************/
  64270. /*! exports provided: default */
  64271. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64272. "use strict";
  64273. __webpack_require__.r(__webpack_exports__);
  64274. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableToolbar; });
  64275. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  64276. /* harmony import */ var _ckeditor_ckeditor5_widget_src_widgettoolbarrepository__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-widget/src/widgettoolbarrepository */ "./node_modules/@ckeditor/ckeditor5-widget/src/widgettoolbarrepository.js");
  64277. /* harmony import */ var _utils_ui_widget__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/ui/widget */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/ui/widget.js");
  64278. /**
  64279. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  64280. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  64281. */
  64282. /**
  64283. * @module table/tabletoolbar
  64284. */
  64285. /**
  64286. * The table toolbar class. It creates toolbars for the table feature and its content (for now only for the table cell content).
  64287. *
  64288. * The table toolbar shows up when a table widget is selected. Its components (e.g. buttons) are created based on the
  64289. * {@link module:table/table~TableConfig#tableToolbar `table.tableToolbar` configuration option}.
  64290. *
  64291. * Table content toolbar shows up when the selection is inside the content of a table. It creates its component based on the
  64292. * {@link module:table/table~TableConfig#contentToolbar `table.contentToolbar` configuration option}.
  64293. *
  64294. * @extends module:core/plugin~Plugin
  64295. */
  64296. class TableToolbar extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  64297. /**
  64298. * @inheritDoc
  64299. */
  64300. static get requires() {
  64301. return [ _ckeditor_ckeditor5_widget_src_widgettoolbarrepository__WEBPACK_IMPORTED_MODULE_1__["default"] ];
  64302. }
  64303. /**
  64304. * @inheritDoc
  64305. */
  64306. static get pluginName() {
  64307. return 'TableToolbar';
  64308. }
  64309. /**
  64310. * @inheritDoc
  64311. */
  64312. afterInit() {
  64313. const editor = this.editor;
  64314. const t = editor.t;
  64315. const widgetToolbarRepository = editor.plugins.get( _ckeditor_ckeditor5_widget_src_widgettoolbarrepository__WEBPACK_IMPORTED_MODULE_1__["default"] );
  64316. const tableContentToolbarItems = editor.config.get( 'table.contentToolbar' );
  64317. const tableToolbarItems = editor.config.get( 'table.tableToolbar' );
  64318. if ( tableContentToolbarItems ) {
  64319. widgetToolbarRepository.register( 'tableContent', {
  64320. ariaLabel: t( 'Table toolbar' ),
  64321. items: tableContentToolbarItems,
  64322. getRelatedElement: _utils_ui_widget__WEBPACK_IMPORTED_MODULE_2__["getTableWidgetAncestor"]
  64323. } );
  64324. }
  64325. if ( tableToolbarItems ) {
  64326. widgetToolbarRepository.register( 'table', {
  64327. ariaLabel: t( 'Table toolbar' ),
  64328. items: tableToolbarItems,
  64329. getRelatedElement: _utils_ui_widget__WEBPACK_IMPORTED_MODULE_2__["getSelectedTableWidget"]
  64330. } );
  64331. }
  64332. }
  64333. }
  64334. /**
  64335. * Items to be placed in the table content toolbar.
  64336. * The {@link module:table/tabletoolbar~TableToolbar} plugin is required to make this toolbar work.
  64337. *
  64338. * Assuming that you use the {@link module:table/tableui~TableUI} feature, the following toolbar items will be available
  64339. * in {@link module:ui/componentfactory~ComponentFactory}:
  64340. *
  64341. * * `'tableRow'`,
  64342. * * `'tableColumn'`,
  64343. * * `'mergeTableCells'`.
  64344. *
  64345. * You can thus configure the toolbar like this:
  64346. *
  64347. * const tableConfig = {
  64348. * contentToolbar: [ 'tableRow', 'tableColumn', 'mergeTableCells' ]
  64349. * };
  64350. *
  64351. * Of course, the same buttons can also be used in the
  64352. * {@link module:core/editor/editorconfig~EditorConfig#toolbar main editor toolbar}.
  64353. *
  64354. * Read more about configuring the toolbar in {@link module:core/editor/editorconfig~EditorConfig#toolbar}.
  64355. *
  64356. * @member {Array.<String>} module:table/table~TableConfig#contentToolbar
  64357. */
  64358. /**
  64359. * Items to be placed in the table toolbar.
  64360. * The {@link module:table/tabletoolbar~TableToolbar} plugin is required to make this toolbar work.
  64361. *
  64362. * You can thus configure the toolbar like this:
  64363. *
  64364. * const tableConfig = {
  64365. * tableToolbar: [ 'blockQuote' ]
  64366. * };
  64367. *
  64368. * Of course, the same buttons can also be used in the
  64369. * {@link module:core/editor/editorconfig~EditorConfig#toolbar main editor toolbar}.
  64370. *
  64371. * Read more about configuring the toolbar in {@link module:core/editor/editorconfig~EditorConfig#toolbar}.
  64372. *
  64373. * @member {Array.<String>} module:table/table~TableConfig#tableToolbar
  64374. */
  64375. /***/ }),
  64376. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tableui.js":
  64377. /*!***************************************************************!*\
  64378. !*** ./node_modules/@ckeditor/ckeditor5-table/src/tableui.js ***!
  64379. \***************************************************************/
  64380. /*! exports provided: default */
  64381. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64382. "use strict";
  64383. __webpack_require__.r(__webpack_exports__);
  64384. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableUI; });
  64385. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  64386. /* harmony import */ var _ckeditor_ckeditor5_ui_src_dropdown_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/dropdown/utils */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/utils.js");
  64387. /* harmony import */ var _ckeditor_ckeditor5_ui_src_dropdown_button_splitbuttonview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/dropdown/button/splitbuttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/splitbuttonview.js");
  64388. /* harmony import */ var _ckeditor_ckeditor5_ui_src_model__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/model */ "./node_modules/@ckeditor/ckeditor5-ui/src/model.js");
  64389. /* harmony import */ var _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/collection */ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js");
  64390. /* harmony import */ var _ui_inserttableview__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ui/inserttableview */ "./node_modules/@ckeditor/ckeditor5-table/src/ui/inserttableview.js");
  64391. /* harmony import */ var _theme_icons_table_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../theme/icons/table.svg */ "./node_modules/@ckeditor/ckeditor5-table/theme/icons/table.svg");
  64392. /* harmony import */ var _theme_icons_table_column_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../theme/icons/table-column.svg */ "./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-column.svg");
  64393. /* harmony import */ var _theme_icons_table_row_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../theme/icons/table-row.svg */ "./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-row.svg");
  64394. /* harmony import */ var _theme_icons_table_merge_cell_svg__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../theme/icons/table-merge-cell.svg */ "./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-merge-cell.svg");
  64395. /**
  64396. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  64397. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  64398. */
  64399. /**
  64400. * @module table/tableui
  64401. */
  64402. /**
  64403. * The table UI plugin. It introduces:
  64404. *
  64405. * * The `'insertTable'` dropdown,
  64406. * * The `'tableColumn'` dropdown,
  64407. * * The `'tableRow'` dropdown,
  64408. * * The `'mergeTableCells'` split button.
  64409. *
  64410. * The `'tableColumn'`, `'tableRow'` and `'mergeTableCells'` dropdowns work best with {@link module:table/tabletoolbar~TableToolbar}.
  64411. *
  64412. * @extends module:core/plugin~Plugin
  64413. */
  64414. class TableUI extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  64415. /**
  64416. * @inheritDoc
  64417. */
  64418. init() {
  64419. const editor = this.editor;
  64420. const t = this.editor.t;
  64421. const contentLanguageDirection = editor.locale.contentLanguageDirection;
  64422. const isContentLtr = contentLanguageDirection === 'ltr';
  64423. editor.ui.componentFactory.add( 'insertTable', locale => {
  64424. const command = editor.commands.get( 'insertTable' );
  64425. const dropdownView = Object(_ckeditor_ckeditor5_ui_src_dropdown_utils__WEBPACK_IMPORTED_MODULE_1__["createDropdown"])( locale );
  64426. dropdownView.bind( 'isEnabled' ).to( command );
  64427. // Decorate dropdown's button.
  64428. dropdownView.buttonView.set( {
  64429. icon: _theme_icons_table_svg__WEBPACK_IMPORTED_MODULE_6__["default"],
  64430. label: t( 'Insert table' ),
  64431. tooltip: true
  64432. } );
  64433. let insertTableView;
  64434. dropdownView.on( 'change:isOpen', () => {
  64435. if ( insertTableView ) {
  64436. return;
  64437. }
  64438. // Prepare custom view for dropdown's panel.
  64439. insertTableView = new _ui_inserttableview__WEBPACK_IMPORTED_MODULE_5__["default"]( locale );
  64440. dropdownView.panelView.children.add( insertTableView );
  64441. insertTableView.delegate( 'execute' ).to( dropdownView );
  64442. dropdownView.buttonView.on( 'open', () => {
  64443. // Reset the chooser before showing it to the user.
  64444. insertTableView.rows = 0;
  64445. insertTableView.columns = 0;
  64446. } );
  64447. dropdownView.on( 'execute', () => {
  64448. editor.execute( 'insertTable', { rows: insertTableView.rows, columns: insertTableView.columns } );
  64449. editor.editing.view.focus();
  64450. } );
  64451. } );
  64452. return dropdownView;
  64453. } );
  64454. editor.ui.componentFactory.add( 'tableColumn', locale => {
  64455. const options = [
  64456. {
  64457. type: 'switchbutton',
  64458. model: {
  64459. commandName: 'setTableColumnHeader',
  64460. label: t( 'Header column' ),
  64461. bindIsOn: true
  64462. }
  64463. },
  64464. { type: 'separator' },
  64465. {
  64466. type: 'button',
  64467. model: {
  64468. commandName: isContentLtr ? 'insertTableColumnLeft' : 'insertTableColumnRight',
  64469. label: t( 'Insert column left' )
  64470. }
  64471. },
  64472. {
  64473. type: 'button',
  64474. model: {
  64475. commandName: isContentLtr ? 'insertTableColumnRight' : 'insertTableColumnLeft',
  64476. label: t( 'Insert column right' )
  64477. }
  64478. },
  64479. {
  64480. type: 'button',
  64481. model: {
  64482. commandName: 'removeTableColumn',
  64483. label: t( 'Delete column' )
  64484. }
  64485. },
  64486. {
  64487. type: 'button',
  64488. model: {
  64489. commandName: 'selectTableColumn',
  64490. label: t( 'Select column' )
  64491. }
  64492. }
  64493. ];
  64494. return this._prepareDropdown( t( 'Column' ), _theme_icons_table_column_svg__WEBPACK_IMPORTED_MODULE_7__["default"], options, locale );
  64495. } );
  64496. editor.ui.componentFactory.add( 'tableRow', locale => {
  64497. const options = [
  64498. {
  64499. type: 'switchbutton',
  64500. model: {
  64501. commandName: 'setTableRowHeader',
  64502. label: t( 'Header row' ),
  64503. bindIsOn: true
  64504. }
  64505. },
  64506. { type: 'separator' },
  64507. {
  64508. type: 'button',
  64509. model: {
  64510. commandName: 'insertTableRowAbove',
  64511. label: t( 'Insert row above' )
  64512. }
  64513. },
  64514. {
  64515. type: 'button',
  64516. model: {
  64517. commandName: 'insertTableRowBelow',
  64518. label: t( 'Insert row below' )
  64519. }
  64520. },
  64521. {
  64522. type: 'button',
  64523. model: {
  64524. commandName: 'removeTableRow',
  64525. label: t( 'Delete row' )
  64526. }
  64527. },
  64528. {
  64529. type: 'button',
  64530. model: {
  64531. commandName: 'selectTableRow',
  64532. label: t( 'Select row' )
  64533. }
  64534. }
  64535. ];
  64536. return this._prepareDropdown( t( 'Row' ), _theme_icons_table_row_svg__WEBPACK_IMPORTED_MODULE_8__["default"], options, locale );
  64537. } );
  64538. editor.ui.componentFactory.add( 'mergeTableCells', locale => {
  64539. const options = [
  64540. {
  64541. type: 'button',
  64542. model: {
  64543. commandName: 'mergeTableCellUp',
  64544. label: t( 'Merge cell up' )
  64545. }
  64546. },
  64547. {
  64548. type: 'button',
  64549. model: {
  64550. commandName: isContentLtr ? 'mergeTableCellRight' : 'mergeTableCellLeft',
  64551. label: t( 'Merge cell right' )
  64552. }
  64553. },
  64554. {
  64555. type: 'button',
  64556. model: {
  64557. commandName: 'mergeTableCellDown',
  64558. label: t( 'Merge cell down' )
  64559. }
  64560. },
  64561. {
  64562. type: 'button',
  64563. model: {
  64564. commandName: isContentLtr ? 'mergeTableCellLeft' : 'mergeTableCellRight',
  64565. label: t( 'Merge cell left' )
  64566. }
  64567. },
  64568. { type: 'separator' },
  64569. {
  64570. type: 'button',
  64571. model: {
  64572. commandName: 'splitTableCellVertically',
  64573. label: t( 'Split cell vertically' )
  64574. }
  64575. },
  64576. {
  64577. type: 'button',
  64578. model: {
  64579. commandName: 'splitTableCellHorizontally',
  64580. label: t( 'Split cell horizontally' )
  64581. }
  64582. }
  64583. ];
  64584. return this._prepareMergeSplitButtonDropdown( t( 'Merge cells' ), _theme_icons_table_merge_cell_svg__WEBPACK_IMPORTED_MODULE_9__["default"], options, locale );
  64585. } );
  64586. }
  64587. /**
  64588. * Creates a dropdown view from a set of options.
  64589. *
  64590. * @private
  64591. * @param {String} label The dropdown button label.
  64592. * @param {String} icon An icon for the dropdown button.
  64593. * @param {Array.<module:ui/dropdown/utils~ListDropdownItemDefinition>} options The list of options for the dropdown.
  64594. * @param {module:utils/locale~Locale} locale
  64595. * @returns {module:ui/dropdown/dropdownview~DropdownView}
  64596. */
  64597. _prepareDropdown( label, icon, options, locale ) {
  64598. const editor = this.editor;
  64599. const dropdownView = Object(_ckeditor_ckeditor5_ui_src_dropdown_utils__WEBPACK_IMPORTED_MODULE_1__["createDropdown"])( locale );
  64600. const commands = this._fillDropdownWithListOptions( dropdownView, options );
  64601. // Decorate dropdown's button.
  64602. dropdownView.buttonView.set( {
  64603. label,
  64604. icon,
  64605. tooltip: true
  64606. } );
  64607. // Make dropdown button disabled when all options are disabled.
  64608. dropdownView.bind( 'isEnabled' ).toMany( commands, 'isEnabled', ( ...areEnabled ) => {
  64609. return areEnabled.some( isEnabled => isEnabled );
  64610. } );
  64611. this.listenTo( dropdownView, 'execute', evt => {
  64612. editor.execute( evt.source.commandName );
  64613. editor.editing.view.focus();
  64614. } );
  64615. return dropdownView;
  64616. }
  64617. /**
  64618. * Creates a dropdown view with a {@link module:ui/dropdown/button/splitbuttonview~SplitButtonView} for
  64619. * merge (and split)–related commands.
  64620. *
  64621. * @private
  64622. * @param {String} label The dropdown button label.
  64623. * @param {String} icon An icon for the dropdown button.
  64624. * @param {Array.<module:ui/dropdown/utils~ListDropdownItemDefinition>} options The list of options for the dropdown.
  64625. * @param {module:utils/locale~Locale} locale
  64626. * @returns {module:ui/dropdown/dropdownview~DropdownView}
  64627. */
  64628. _prepareMergeSplitButtonDropdown( label, icon, options, locale ) {
  64629. const editor = this.editor;
  64630. const dropdownView = Object(_ckeditor_ckeditor5_ui_src_dropdown_utils__WEBPACK_IMPORTED_MODULE_1__["createDropdown"])( locale, _ckeditor_ckeditor5_ui_src_dropdown_button_splitbuttonview__WEBPACK_IMPORTED_MODULE_2__["default"] );
  64631. const mergeCommandName = 'mergeTableCells';
  64632. this._fillDropdownWithListOptions( dropdownView, options );
  64633. dropdownView.buttonView.set( {
  64634. label,
  64635. icon,
  64636. tooltip: true,
  64637. isEnabled: true
  64638. } );
  64639. // Merge selected table cells when the main part of the split button is clicked.
  64640. this.listenTo( dropdownView.buttonView, 'execute', () => {
  64641. editor.execute( mergeCommandName );
  64642. editor.editing.view.focus();
  64643. } );
  64644. // Execute commands for events coming from the list in the dropdown panel.
  64645. this.listenTo( dropdownView, 'execute', evt => {
  64646. editor.execute( evt.source.commandName );
  64647. editor.editing.view.focus();
  64648. } );
  64649. return dropdownView;
  64650. }
  64651. /**
  64652. * Injects a {@link module:ui/list/listview~ListView} into the passed dropdown with buttons
  64653. * which execute editor commands as configured in passed options.
  64654. *
  64655. * @private
  64656. * @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView
  64657. * @param {Array.<module:ui/dropdown/utils~ListDropdownItemDefinition>} options The list of options for the dropdown.
  64658. * @returns {Array.<module:core/command~Command>} Commands the list options are interacting with.
  64659. */
  64660. _fillDropdownWithListOptions( dropdownView, options ) {
  64661. const editor = this.editor;
  64662. const commands = [];
  64663. const itemDefinitions = new _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_4__["default"]();
  64664. for ( const option of options ) {
  64665. addListOption( option, editor, commands, itemDefinitions );
  64666. }
  64667. Object(_ckeditor_ckeditor5_ui_src_dropdown_utils__WEBPACK_IMPORTED_MODULE_1__["addListToDropdown"])( dropdownView, itemDefinitions, editor.ui.componentFactory );
  64668. return commands;
  64669. }
  64670. }
  64671. // Adds an option to a list view.
  64672. //
  64673. // @param {module:table/tableui~DropdownOption} option A configuration option.
  64674. // @param {module:core/editor/editor~Editor} editor
  64675. // @param {Array.<module:core/command~Command>} commands The list of commands to update.
  64676. // @param {Iterable.<module:ui/dropdown/utils~ListDropdownItemDefinition>} itemDefinitions
  64677. // A collection of dropdown items to update with the given option.
  64678. function addListOption( option, editor, commands, itemDefinitions ) {
  64679. const model = option.model = new _ckeditor_ckeditor5_ui_src_model__WEBPACK_IMPORTED_MODULE_3__["default"]( option.model );
  64680. const { commandName, bindIsOn } = option.model;
  64681. if ( option.type === 'button' || option.type === 'switchbutton' ) {
  64682. const command = editor.commands.get( commandName );
  64683. commands.push( command );
  64684. model.set( { commandName } );
  64685. model.bind( 'isEnabled' ).to( command );
  64686. if ( bindIsOn ) {
  64687. model.bind( 'isOn' ).to( command, 'value' );
  64688. }
  64689. }
  64690. model.set( {
  64691. withText: true
  64692. } );
  64693. itemDefinitions.add( option );
  64694. }
  64695. /***/ }),
  64696. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tableutils.js":
  64697. /*!******************************************************************!*\
  64698. !*** ./node_modules/@ckeditor/ckeditor5-table/src/tableutils.js ***!
  64699. \******************************************************************/
  64700. /*! exports provided: default */
  64701. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64702. "use strict";
  64703. __webpack_require__.r(__webpack_exports__);
  64704. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableUtils; });
  64705. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  64706. /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
  64707. /* harmony import */ var _utils_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/common */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js");
  64708. /* harmony import */ var _utils_structure__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/structure */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js");
  64709. /**
  64710. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  64711. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  64712. */
  64713. /**
  64714. * @module table/tableutils
  64715. */
  64716. /**
  64717. * The table utilities plugin.
  64718. *
  64719. * @extends module:core/plugin~Plugin
  64720. */
  64721. class TableUtils extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  64722. /**
  64723. * @inheritDoc
  64724. */
  64725. static get pluginName() {
  64726. return 'TableUtils';
  64727. }
  64728. /**
  64729. * @inheritDoc
  64730. */
  64731. init() {
  64732. this.decorate( 'insertColumns' );
  64733. this.decorate( 'insertRows' );
  64734. }
  64735. /**
  64736. * Returns the table cell location as an object with table row and table column indexes.
  64737. *
  64738. * For instance, in the table below:
  64739. *
  64740. * 0 1 2 3
  64741. * +---+---+---+---+
  64742. * 0 | a | b | c |
  64743. * + + +---+
  64744. * 1 | | | d |
  64745. * +---+---+ +---+
  64746. * 2 | e | | f |
  64747. * +---+---+---+---+
  64748. *
  64749. * the method will return:
  64750. *
  64751. * const cellA = table.getNodeByPath( [ 0, 0 ] );
  64752. * editor.plugins.get( 'TableUtils' ).getCellLocation( cellA );
  64753. * // will return { row: 0, column: 0 }
  64754. *
  64755. * const cellD = table.getNodeByPath( [ 1, 0 ] );
  64756. * editor.plugins.get( 'TableUtils' ).getCellLocation( cellD );
  64757. * // will return { row: 1, column: 3 }
  64758. *
  64759. * @param {module:engine/model/element~Element} tableCell
  64760. * @returns {Object} Returns a `{row, column}` object.
  64761. */
  64762. getCellLocation( tableCell ) {
  64763. const tableRow = tableCell.parent;
  64764. const table = tableRow.parent;
  64765. const rowIndex = table.getChildIndex( tableRow );
  64766. const tableWalker = new _tablewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( table, { row: rowIndex } );
  64767. for ( const { cell, row, column } of tableWalker ) {
  64768. if ( cell === tableCell ) {
  64769. return { row, column };
  64770. }
  64771. }
  64772. }
  64773. /**
  64774. * Creates an empty table with a proper structure. The table needs to be inserted into the model,
  64775. * for example, by using the {@link module:engine/model/model~Model#insertContent} function.
  64776. *
  64777. * model.change( ( writer ) => {
  64778. * // Create a table of 2 rows and 7 columns:
  64779. * const table = tableUtils.createTable( writer, { rows: 2, columns: 7 } );
  64780. *
  64781. * // Insert a table to the model at the best position taking the current selection:
  64782. * model.insertContent( table );
  64783. * }
  64784. *
  64785. * @param {module:engine/model/writer~Writer} writer The model writer.
  64786. * @param {Object} options
  64787. * @param {Number} [options.rows=2] The number of rows to create.
  64788. * @param {Number} [options.columns=2] The number of columns to create.
  64789. * @param {Number} [options.headingRows=0] The number of heading rows.
  64790. * @param {Number} [options.headingColumns=0] The number of heading columns.
  64791. * @returns {module:engine/model/element~Element} The created table element.
  64792. */
  64793. createTable( writer, options ) {
  64794. const table = writer.createElement( 'table' );
  64795. const rows = parseInt( options.rows ) || 2;
  64796. const columns = parseInt( options.columns ) || 2;
  64797. createEmptyRows( writer, table, 0, rows, columns );
  64798. if ( options.headingRows ) {
  64799. Object(_utils_common__WEBPACK_IMPORTED_MODULE_2__["updateNumericAttribute"])( 'headingRows', options.headingRows, table, writer, 0 );
  64800. }
  64801. if ( options.headingColumns ) {
  64802. Object(_utils_common__WEBPACK_IMPORTED_MODULE_2__["updateNumericAttribute"])( 'headingColumns', options.headingColumns, table, writer, 0 );
  64803. }
  64804. return table;
  64805. }
  64806. /**
  64807. * Inserts rows into a table.
  64808. *
  64809. * editor.plugins.get( 'TableUtils' ).insertRows( table, { at: 1, rows: 2 } );
  64810. *
  64811. * Assuming the table on the left, the above code will transform it to the table on the right:
  64812. *
  64813. * row index
  64814. * 0 +---+---+---+ `at` = 1, +---+---+---+ 0
  64815. * | a | b | c | `rows` = 2, | a | b | c |
  64816. * 1 + +---+---+ <-- insert here + +---+---+ 1
  64817. * | | d | e | | | | |
  64818. * 2 + +---+---+ will give: + +---+---+ 2
  64819. * | | f | g | | | | |
  64820. * 3 +---+---+---+ + +---+---+ 3
  64821. * | | d | e |
  64822. * + +---+---+ 4
  64823. * + + f | g |
  64824. * +---+---+---+ 5
  64825. *
  64826. * @param {module:engine/model/element~Element} table The table model element where the rows will be inserted.
  64827. * @param {Object} options
  64828. * @param {Number} [options.at=0] The row index at which the rows will be inserted.
  64829. * @param {Number} [options.rows=1] The number of rows to insert.
  64830. * @param {Boolean|undefined} [options.copyStructureFromAbove] The flag for copying row structure. Note that
  64831. * the row structure will not be copied if this option is not provided.
  64832. */
  64833. insertRows( table, options = {} ) {
  64834. const model = this.editor.model;
  64835. const insertAt = options.at || 0;
  64836. const rowsToInsert = options.rows || 1;
  64837. const isCopyStructure = options.copyStructureFromAbove !== undefined;
  64838. const copyStructureFrom = options.copyStructureFromAbove ? insertAt - 1 : insertAt;
  64839. const rows = this.getRows( table );
  64840. const columns = this.getColumns( table );
  64841. model.change( writer => {
  64842. const headingRows = table.getAttribute( 'headingRows' ) || 0;
  64843. // Inserting rows inside heading section requires to update `headingRows` attribute as the heading section will grow.
  64844. if ( headingRows > insertAt ) {
  64845. Object(_utils_common__WEBPACK_IMPORTED_MODULE_2__["updateNumericAttribute"])( 'headingRows', headingRows + rowsToInsert, table, writer, 0 );
  64846. }
  64847. // Inserting at the end or at the beginning of a table doesn't require to calculate anything special.
  64848. if ( !isCopyStructure && ( insertAt === 0 || insertAt === rows ) ) {
  64849. createEmptyRows( writer, table, insertAt, rowsToInsert, columns );
  64850. return;
  64851. }
  64852. // Iterate over all the rows above the inserted rows in order to check for the row-spanned cells.
  64853. const walkerEndRow = isCopyStructure ? Math.max( insertAt, copyStructureFrom ) : insertAt;
  64854. const tableIterator = new _tablewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( table, { endRow: walkerEndRow } );
  64855. // Store spans of the reference row to reproduce it's structure. This array is column number indexed.
  64856. const rowColSpansMap = new Array( columns ).fill( 1 );
  64857. for ( const { row, column, cellHeight, cellWidth, cell } of tableIterator ) {
  64858. const lastCellRow = row + cellHeight - 1;
  64859. const isOverlappingInsertedRow = row < insertAt && insertAt <= lastCellRow;
  64860. const isReferenceRow = row <= copyStructureFrom && copyStructureFrom <= lastCellRow;
  64861. // If the cell is row-spanned and overlaps the inserted row, then reserve space for it in the row map.
  64862. if ( isOverlappingInsertedRow ) {
  64863. // This cell overlaps the inserted rows so we need to expand it further.
  64864. writer.setAttribute( 'rowspan', cellHeight + rowsToInsert, cell );
  64865. // Mark this cell with negative number to indicate how many cells should be skipped when adding the new cells.
  64866. rowColSpansMap[ column ] = -cellWidth;
  64867. }
  64868. // Store the colspan from reference row.
  64869. else if ( isCopyStructure && isReferenceRow ) {
  64870. rowColSpansMap[ column ] = cellWidth;
  64871. }
  64872. }
  64873. for ( let rowIndex = 0; rowIndex < rowsToInsert; rowIndex++ ) {
  64874. const tableRow = writer.createElement( 'tableRow' );
  64875. writer.insert( tableRow, table, insertAt );
  64876. for ( let cellIndex = 0; cellIndex < rowColSpansMap.length; cellIndex++ ) {
  64877. const colspan = rowColSpansMap[ cellIndex ];
  64878. const insertPosition = writer.createPositionAt( tableRow, 'end' );
  64879. // Insert the empty cell only if this slot is not row-spanned from any other cell.
  64880. if ( colspan > 0 ) {
  64881. Object(_utils_common__WEBPACK_IMPORTED_MODULE_2__["createEmptyTableCell"])( writer, insertPosition, colspan > 1 ? { colspan } : null );
  64882. }
  64883. // Skip the col-spanned slots, there won't be any cells.
  64884. cellIndex += Math.abs( colspan ) - 1;
  64885. }
  64886. }
  64887. } );
  64888. }
  64889. /**
  64890. * Inserts columns into a table.
  64891. *
  64892. * editor.plugins.get( 'TableUtils' ).insertColumns( table, { at: 1, columns: 2 } );
  64893. *
  64894. * Assuming the table on the left, the above code will transform it to the table on the right:
  64895. *
  64896. * 0 1 2 3 0 1 2 3 4 5
  64897. * +---+---+---+ +---+---+---+---+---+
  64898. * | a | b | | a | b |
  64899. * + +---+ + +---+
  64900. * | | c | | | c |
  64901. * +---+---+---+ will give: +---+---+---+---+---+
  64902. * | d | e | f | | d | | | e | f |
  64903. * +---+ +---+ +---+---+---+ +---+
  64904. * | g | | h | | g | | | | h |
  64905. * +---+---+---+ +---+---+---+---+---+
  64906. * | i | | i |
  64907. * +---+---+---+ +---+---+---+---+---+
  64908. * ^---- insert here, `at` = 1, `columns` = 2
  64909. *
  64910. * @param {module:engine/model/element~Element} table The table model element where the columns will be inserted.
  64911. * @param {Object} options
  64912. * @param {Number} [options.at=0] The column index at which the columns will be inserted.
  64913. * @param {Number} [options.columns=1] The number of columns to insert.
  64914. */
  64915. insertColumns( table, options = {} ) {
  64916. const model = this.editor.model;
  64917. const insertAt = options.at || 0;
  64918. const columnsToInsert = options.columns || 1;
  64919. model.change( writer => {
  64920. const headingColumns = table.getAttribute( 'headingColumns' );
  64921. // Inserting columns inside heading section requires to update `headingColumns` attribute as the heading section will grow.
  64922. if ( insertAt < headingColumns ) {
  64923. writer.setAttribute( 'headingColumns', headingColumns + columnsToInsert, table );
  64924. }
  64925. const tableColumns = this.getColumns( table );
  64926. // Inserting at the end and at the beginning of a table doesn't require to calculate anything special.
  64927. if ( insertAt === 0 || tableColumns === insertAt ) {
  64928. for ( const tableRow of table.getChildren() ) {
  64929. createCells( columnsToInsert, writer, writer.createPositionAt( tableRow, insertAt ? 'end' : 0 ) );
  64930. }
  64931. return;
  64932. }
  64933. const tableWalker = new _tablewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( table, { column: insertAt, includeAllSlots: true } );
  64934. for ( const tableSlot of tableWalker ) {
  64935. const { row, cell, cellAnchorColumn, cellAnchorRow, cellWidth, cellHeight } = tableSlot;
  64936. // When iterating over column the table walker outputs either:
  64937. // - cells at given column index (cell "e" from method docs),
  64938. // - spanned columns (spanned cell from row between cells "g" and "h" - spanned by "e", only if `includeAllSlots: true`),
  64939. // - or a cell from the same row which spans over this column (cell "a").
  64940. if ( cellAnchorColumn < insertAt ) {
  64941. // If cell is anchored in previous column, it is a cell that spans over an inserted column (cell "a" & "i").
  64942. // For such cells expand them by a number of columns inserted.
  64943. writer.setAttribute( 'colspan', cellWidth + columnsToInsert, cell );
  64944. // This cell will overlap cells in rows below so skip them (because of `includeAllSlots` option) - (cell "a")
  64945. const lastCellRow = cellAnchorRow + cellHeight - 1;
  64946. for ( let i = row; i <= lastCellRow; i++ ) {
  64947. tableWalker.skipRow( i );
  64948. }
  64949. } else {
  64950. // It's either cell at this column index or spanned cell by a row-spanned cell from row above.
  64951. // In table above it's cell "e" and a spanned position from row below (empty cell between cells "g" and "h")
  64952. createCells( columnsToInsert, writer, tableSlot.getPositionBefore() );
  64953. }
  64954. }
  64955. } );
  64956. }
  64957. /**
  64958. * Removes rows from the given `table`.
  64959. *
  64960. * This method re-calculates the table geometry including `rowspan` attribute of table cells overlapping removed rows
  64961. * and table headings values.
  64962. *
  64963. * editor.plugins.get( 'TableUtils' ).removeRows( table, { at: 1, rows: 2 } );
  64964. *
  64965. * Executing the above code in the context of the table on the left will transform its structure as presented on the right:
  64966. *
  64967. * row index
  64968. * ┌───┬───┬───┐ `at` = 1 ┌───┬───┬───┐
  64969. * 0 │ a │ b │ c │ `rows` = 2 │ a │ b │ c │ 0
  64970. * │ ├───┼───┤ │ ├───┼───┤
  64971. * 1 │ │ d │ e │ <-- remove from here │ │ d │ g │ 1
  64972. * │ │ ├───┤ will give: ├───┼───┼───┤
  64973. * 2 │ │ │ f │ │ h │ i │ j │ 2
  64974. * │ │ ├───┤ └───┴───┴───┘
  64975. * 3 │ │ │ g │
  64976. * ├───┼───┼───┤
  64977. * 4 │ h │ i │ j │
  64978. * └───┴───┴───┘
  64979. *
  64980. * @param {module:engine/model/element~Element} table
  64981. * @param {Object} options
  64982. * @param {Number} options.at The row index at which the removing rows will start.
  64983. * @param {Number} [options.rows=1] The number of rows to remove.
  64984. */
  64985. removeRows( table, options ) {
  64986. const model = this.editor.model;
  64987. const rowsToRemove = options.rows || 1;
  64988. const first = options.at;
  64989. const last = first + rowsToRemove - 1;
  64990. model.change( writer => {
  64991. // Removing rows from the table require that most calculations to be done prior to changing table structure.
  64992. // Preparations must be done in the same enqueueChange callback to use the current table structure.
  64993. // 1. Preparation - get row-spanned cells that have to be modified after removing rows.
  64994. const { cellsToMove, cellsToTrim } = getCellsToMoveAndTrimOnRemoveRow( table, first, last );
  64995. // 2. Execution
  64996. // 2a. Move cells from removed rows that extends over a removed section - must be done before removing rows.
  64997. // This will fill any gaps in a rows below that previously were empty because of row-spanned cells.
  64998. if ( cellsToMove.size ) {
  64999. const rowAfterRemovedSection = last + 1;
  65000. moveCellsToRow( table, rowAfterRemovedSection, cellsToMove, writer );
  65001. }
  65002. // 2b. Remove all required rows.
  65003. for ( let i = last; i >= first; i-- ) {
  65004. writer.remove( table.getChild( i ) );
  65005. }
  65006. // 2c. Update cells from rows above that overlap removed section. Similar to step 2 but does not involve moving cells.
  65007. for ( const { rowspan, cell } of cellsToTrim ) {
  65008. Object(_utils_common__WEBPACK_IMPORTED_MODULE_2__["updateNumericAttribute"])( 'rowspan', rowspan, cell, writer );
  65009. }
  65010. // 2d. Adjust heading rows if removed rows were in a heading section.
  65011. updateHeadingRows( table, first, last, writer );
  65012. // 2e. Remove empty columns (without anchored cells) if there are any.
  65013. if ( !Object(_utils_structure__WEBPACK_IMPORTED_MODULE_3__["removeEmptyColumns"])( table, this ) ) {
  65014. // If there wasn't any empty columns then we still need to check if this wasn't called
  65015. // because of cleaning empty rows and we only removed one of them.
  65016. Object(_utils_structure__WEBPACK_IMPORTED_MODULE_3__["removeEmptyRows"])( table, this );
  65017. }
  65018. } );
  65019. }
  65020. /**
  65021. * Removes columns from the given `table`.
  65022. *
  65023. * This method re-calculates the table geometry including the `colspan` attribute of table cells overlapping removed columns
  65024. * and table headings values.
  65025. *
  65026. * editor.plugins.get( 'TableUtils' ).removeColumns( table, { at: 1, columns: 2 } );
  65027. *
  65028. * Executing the above code in the context of the table on the left will transform its structure as presented on the right:
  65029. *
  65030. * 0 1 2 3 4 0 1 2
  65031. * ┌───────────────┬───┐ ┌───────┬───┐
  65032. * │ a │ b │ │ a │ b │
  65033. * │ ├───┤ │ ├───┤
  65034. * │ │ c │ │ │ c │
  65035. * ├───┬───┬───┬───┼───┤ will give: ├───┬───┼───┤
  65036. * │ d │ e │ f │ g │ h │ │ d │ g │ h │
  65037. * ├───┼───┼───┤ ├───┤ ├───┤ ├───┤
  65038. * │ i │ j │ k │ │ l │ │ i │ │ l │
  65039. * ├───┴───┴───┴───┴───┤ ├───┴───┴───┤
  65040. * │ m │ │ m │
  65041. * └───────────────────┘ └───────────┘
  65042. * ^---- remove from here, `at` = 1, `columns` = 2
  65043. *
  65044. * @param {module:engine/model/element~Element} table
  65045. * @param {Object} options
  65046. * @param {Number} options.at The row index at which the removing columns will start.
  65047. * @param {Number} [options.columns=1] The number of columns to remove.
  65048. */
  65049. removeColumns( table, options ) {
  65050. const model = this.editor.model;
  65051. const first = options.at;
  65052. const columnsToRemove = options.columns || 1;
  65053. const last = options.at + columnsToRemove - 1;
  65054. model.change( writer => {
  65055. adjustHeadingColumns( table, { first, last }, writer );
  65056. for ( let removedColumnIndex = last; removedColumnIndex >= first; removedColumnIndex-- ) {
  65057. for ( const { cell, column, cellWidth } of [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( table ) ] ) {
  65058. // If colspaned cell overlaps removed column decrease its span.
  65059. if ( column <= removedColumnIndex && cellWidth > 1 && column + cellWidth > removedColumnIndex ) {
  65060. Object(_utils_common__WEBPACK_IMPORTED_MODULE_2__["updateNumericAttribute"])( 'colspan', cellWidth - 1, cell, writer );
  65061. } else if ( column === removedColumnIndex ) {
  65062. // The cell in removed column has colspan of 1.
  65063. writer.remove( cell );
  65064. }
  65065. }
  65066. }
  65067. // Remove empty rows that could appear after removing columns.
  65068. if ( !Object(_utils_structure__WEBPACK_IMPORTED_MODULE_3__["removeEmptyRows"])( table, this ) ) {
  65069. // If there wasn't any empty rows then we still need to check if this wasn't called
  65070. // because of cleaning empty columns and we only removed one of them.
  65071. Object(_utils_structure__WEBPACK_IMPORTED_MODULE_3__["removeEmptyColumns"])( table, this );
  65072. }
  65073. } );
  65074. }
  65075. /**
  65076. * Divides a table cell vertically into several ones.
  65077. *
  65078. * The cell will be visually split into more cells by updating colspans of other cells in a column
  65079. * and inserting cells (columns) after that cell.
  65080. *
  65081. * In the table below, if cell "a" is split into 3 cells:
  65082. *
  65083. * +---+---+---+
  65084. * | a | b | c |
  65085. * +---+---+---+
  65086. * | d | e | f |
  65087. * +---+---+---+
  65088. *
  65089. * it will result in the table below:
  65090. *
  65091. * +---+---+---+---+---+
  65092. * | a | | | b | c |
  65093. * +---+---+---+---+---+
  65094. * | d | e | f |
  65095. * +---+---+---+---+---+
  65096. *
  65097. * So cell "d" will get its `colspan` updated to `3` and 2 cells will be added (2 columns will be created).
  65098. *
  65099. * Splitting a cell that already has a `colspan` attribute set will distribute the cell `colspan` evenly and the remainder
  65100. * will be left to the original cell:
  65101. *
  65102. * +---+---+---+
  65103. * | a |
  65104. * +---+---+---+
  65105. * | b | c | d |
  65106. * +---+---+---+
  65107. *
  65108. * Splitting cell "a" with `colspan=3` into 2 cells will create 1 cell with a `colspan=a` and cell "a" that will have `colspan=2`:
  65109. *
  65110. * +---+---+---+
  65111. * | a | |
  65112. * +---+---+---+
  65113. * | b | c | d |
  65114. * +---+---+---+
  65115. *
  65116. * @param {module:engine/model/element~Element} tableCell
  65117. * @param {Number} numberOfCells
  65118. */
  65119. splitCellVertically( tableCell, numberOfCells = 2 ) {
  65120. const model = this.editor.model;
  65121. const tableRow = tableCell.parent;
  65122. const table = tableRow.parent;
  65123. const rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 );
  65124. const colspan = parseInt( tableCell.getAttribute( 'colspan' ) || 1 );
  65125. model.change( writer => {
  65126. // First check - the cell spans over multiple rows so before doing anything else just split this cell.
  65127. if ( colspan > 1 ) {
  65128. // Get spans of new (inserted) cells and span to update of split cell.
  65129. const { newCellsSpan, updatedSpan } = breakSpanEvenly( colspan, numberOfCells );
  65130. Object(_utils_common__WEBPACK_IMPORTED_MODULE_2__["updateNumericAttribute"])( 'colspan', updatedSpan, tableCell, writer );
  65131. // Each inserted cell will have the same attributes:
  65132. const newCellsAttributes = {};
  65133. // Do not store default value in the model.
  65134. if ( newCellsSpan > 1 ) {
  65135. newCellsAttributes.colspan = newCellsSpan;
  65136. }
  65137. // Copy rowspan of split cell.
  65138. if ( rowspan > 1 ) {
  65139. newCellsAttributes.rowspan = rowspan;
  65140. }
  65141. const cellsToInsert = colspan > numberOfCells ? numberOfCells - 1 : colspan - 1;
  65142. createCells( cellsToInsert, writer, writer.createPositionAfter( tableCell ), newCellsAttributes );
  65143. }
  65144. // Second check - the cell has colspan of 1 or we need to create more cells then the currently one spans over.
  65145. if ( colspan < numberOfCells ) {
  65146. const cellsToInsert = numberOfCells - colspan;
  65147. // First step: expand cells on the same column as split cell.
  65148. const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( table ) ];
  65149. // Get the column index of split cell.
  65150. const { column: splitCellColumn } = tableMap.find( ( { cell } ) => cell === tableCell );
  65151. // Find cells which needs to be expanded vertically - those on the same column or those that spans over split cell's column.
  65152. const cellsToUpdate = tableMap.filter( ( { cell, cellWidth, column } ) => {
  65153. const isOnSameColumn = cell !== tableCell && column === splitCellColumn;
  65154. const spansOverColumn = ( column < splitCellColumn && column + cellWidth > splitCellColumn );
  65155. return isOnSameColumn || spansOverColumn;
  65156. } );
  65157. // Expand cells vertically.
  65158. for ( const { cell, cellWidth } of cellsToUpdate ) {
  65159. writer.setAttribute( 'colspan', cellWidth + cellsToInsert, cell );
  65160. }
  65161. // Second step: create columns after split cell.
  65162. // Each inserted cell will have the same attributes:
  65163. const newCellsAttributes = {};
  65164. // Do not store default value in the model.
  65165. // Copy rowspan of split cell.
  65166. if ( rowspan > 1 ) {
  65167. newCellsAttributes.rowspan = rowspan;
  65168. }
  65169. createCells( cellsToInsert, writer, writer.createPositionAfter( tableCell ), newCellsAttributes );
  65170. const headingColumns = table.getAttribute( 'headingColumns' ) || 0;
  65171. // Update heading section if split cell is in heading section.
  65172. if ( headingColumns > splitCellColumn ) {
  65173. Object(_utils_common__WEBPACK_IMPORTED_MODULE_2__["updateNumericAttribute"])( 'headingColumns', headingColumns + cellsToInsert, table, writer );
  65174. }
  65175. }
  65176. } );
  65177. }
  65178. /**
  65179. * Divides a table cell horizontally into several ones.
  65180. *
  65181. * The cell will be visually split into more cells by updating rowspans of other cells in the row and inserting rows with a single cell
  65182. * below.
  65183. *
  65184. * If in the table below cell "b" is split into 3 cells:
  65185. *
  65186. * +---+---+---+
  65187. * | a | b | c |
  65188. * +---+---+---+
  65189. * | d | e | f |
  65190. * +---+---+---+
  65191. *
  65192. * It will result in the table below:
  65193. *
  65194. * +---+---+---+
  65195. * | a | b | c |
  65196. * + +---+ +
  65197. * | | | |
  65198. * + +---+ +
  65199. * | | | |
  65200. * +---+---+---+
  65201. * | d | e | f |
  65202. * +---+---+---+
  65203. *
  65204. * So cells "a" and "b" will get their `rowspan` updated to `3` and 2 rows with a single cell will be added.
  65205. *
  65206. * Splitting a cell that already has a `rowspan` attribute set will distribute the cell `rowspan` evenly and the remainder
  65207. * will be left to the original cell:
  65208. *
  65209. * +---+---+---+
  65210. * | a | b | c |
  65211. * + +---+---+
  65212. * | | d | e |
  65213. * + +---+---+
  65214. * | | f | g |
  65215. * + +---+---+
  65216. * | | h | i |
  65217. * +---+---+---+
  65218. *
  65219. * Splitting cell "a" with `rowspan=4` into 3 cells will create 2 cells with a `rowspan=1` and cell "a" will have `rowspan=2`:
  65220. *
  65221. * +---+---+---+
  65222. * | a | b | c |
  65223. * + +---+---+
  65224. * | | d | e |
  65225. * +---+---+---+
  65226. * | | f | g |
  65227. * +---+---+---+
  65228. * | | h | i |
  65229. * +---+---+---+
  65230. *
  65231. * @param {module:engine/model/element~Element} tableCell
  65232. * @param {Number} numberOfCells
  65233. */
  65234. splitCellHorizontally( tableCell, numberOfCells = 2 ) {
  65235. const model = this.editor.model;
  65236. const tableRow = tableCell.parent;
  65237. const table = tableRow.parent;
  65238. const splitCellRow = table.getChildIndex( tableRow );
  65239. const rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 );
  65240. const colspan = parseInt( tableCell.getAttribute( 'colspan' ) || 1 );
  65241. model.change( writer => {
  65242. // First check - the cell spans over multiple rows so before doing anything else just split this cell.
  65243. if ( rowspan > 1 ) {
  65244. // Cache table map before updating table.
  65245. const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( table, {
  65246. startRow: splitCellRow,
  65247. endRow: splitCellRow + rowspan - 1,
  65248. includeAllSlots: true
  65249. } ) ];
  65250. // Get spans of new (inserted) cells and span to update of split cell.
  65251. const { newCellsSpan, updatedSpan } = breakSpanEvenly( rowspan, numberOfCells );
  65252. Object(_utils_common__WEBPACK_IMPORTED_MODULE_2__["updateNumericAttribute"])( 'rowspan', updatedSpan, tableCell, writer );
  65253. const { column: cellColumn } = tableMap.find( ( { cell } ) => cell === tableCell );
  65254. // Each inserted cell will have the same attributes:
  65255. const newCellsAttributes = {};
  65256. // Do not store default value in the model.
  65257. if ( newCellsSpan > 1 ) {
  65258. newCellsAttributes.rowspan = newCellsSpan;
  65259. }
  65260. // Copy colspan of split cell.
  65261. if ( colspan > 1 ) {
  65262. newCellsAttributes.colspan = colspan;
  65263. }
  65264. for ( const tableSlot of tableMap ) {
  65265. const { column, row } = tableSlot;
  65266. // As both newly created cells and the split cell might have rowspan,
  65267. // the insertion of new cells must go to appropriate rows:
  65268. //
  65269. // 1. It's a row after split cell + it's height.
  65270. const isAfterSplitCell = row >= splitCellRow + updatedSpan;
  65271. // 2. Is on the same column.
  65272. const isOnSameColumn = column === cellColumn;
  65273. // 3. And it's row index is after previous cell height.
  65274. const isInEvenlySplitRow = ( row + splitCellRow + updatedSpan ) % newCellsSpan === 0;
  65275. if ( isAfterSplitCell && isOnSameColumn && isInEvenlySplitRow ) {
  65276. createCells( 1, writer, tableSlot.getPositionBefore(), newCellsAttributes );
  65277. }
  65278. }
  65279. }
  65280. // Second check - the cell has rowspan of 1 or we need to create more cells than the current cell spans over.
  65281. if ( rowspan < numberOfCells ) {
  65282. // We already split the cell in check one so here we split to the remaining number of cells only.
  65283. const cellsToInsert = numberOfCells - rowspan;
  65284. // This check is needed since we need to check if there are any cells from previous rows than spans over this cell's row.
  65285. const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( table, { startRow: 0, endRow: splitCellRow } ) ];
  65286. // First step: expand cells.
  65287. for ( const { cell, cellHeight, row } of tableMap ) {
  65288. // Expand rowspan of cells that are either:
  65289. // - on the same row as current cell,
  65290. // - or are below split cell row and overlaps that row.
  65291. if ( cell !== tableCell && row + cellHeight > splitCellRow ) {
  65292. const rowspanToSet = cellHeight + cellsToInsert;
  65293. writer.setAttribute( 'rowspan', rowspanToSet, cell );
  65294. }
  65295. }
  65296. // Second step: create rows with single cell below split cell.
  65297. const newCellsAttributes = {};
  65298. // Copy colspan of split cell.
  65299. if ( colspan > 1 ) {
  65300. newCellsAttributes.colspan = colspan;
  65301. }
  65302. createEmptyRows( writer, table, splitCellRow + 1, cellsToInsert, 1, newCellsAttributes );
  65303. // Update heading section if split cell is in heading section.
  65304. const headingRows = table.getAttribute( 'headingRows' ) || 0;
  65305. if ( headingRows > splitCellRow ) {
  65306. Object(_utils_common__WEBPACK_IMPORTED_MODULE_2__["updateNumericAttribute"])( 'headingRows', headingRows + cellsToInsert, table, writer );
  65307. }
  65308. }
  65309. } );
  65310. }
  65311. /**
  65312. * Returns the number of columns for a given table.
  65313. *
  65314. * editor.plugins.get( 'TableUtils' ).getColumns( table );
  65315. *
  65316. * @param {module:engine/model/element~Element} table The table to analyze.
  65317. * @returns {Number}
  65318. */
  65319. getColumns( table ) {
  65320. // Analyze first row only as all the rows should have the same width.
  65321. const row = table.getChild( 0 );
  65322. return [ ...row.getChildren() ].reduce( ( columns, row ) => {
  65323. const columnWidth = parseInt( row.getAttribute( 'colspan' ) || 1 );
  65324. return columns + columnWidth;
  65325. }, 0 );
  65326. }
  65327. /**
  65328. * Returns the number of rows for a given table.
  65329. *
  65330. * editor.plugins.get( 'TableUtils' ).getRows( table );
  65331. *
  65332. * @param {module:engine/model/element~Element} table The table to analyze.
  65333. * @returns {Number}
  65334. */
  65335. getRows( table ) {
  65336. // Simple row counting, not including rowspan due to #6427.
  65337. return table.childCount;
  65338. }
  65339. }
  65340. // Creates empty rows at the given index in an existing table.
  65341. //
  65342. // @param {module:engine/model/writer~Writer} writer
  65343. // @param {module:engine/model/element~Element} table
  65344. // @param {Number} insertAt The row index of row insertion.
  65345. // @param {Number} rows The number of rows to create.
  65346. // @param {Number} tableCellToInsert The number of cells to insert in each row.
  65347. function createEmptyRows( writer, table, insertAt, rows, tableCellToInsert, attributes = {} ) {
  65348. for ( let i = 0; i < rows; i++ ) {
  65349. const tableRow = writer.createElement( 'tableRow' );
  65350. writer.insert( tableRow, table, insertAt );
  65351. createCells( tableCellToInsert, writer, writer.createPositionAt( tableRow, 'end' ), attributes );
  65352. }
  65353. }
  65354. // Creates cells at a given position.
  65355. //
  65356. // @param {Number} columns The number of columns to create
  65357. // @param {module:engine/model/writer~Writer} writer
  65358. // @param {module:engine/model/position~Position} insertPosition
  65359. function createCells( cells, writer, insertPosition, attributes = {} ) {
  65360. for ( let i = 0; i < cells; i++ ) {
  65361. Object(_utils_common__WEBPACK_IMPORTED_MODULE_2__["createEmptyTableCell"])( writer, insertPosition, attributes );
  65362. }
  65363. }
  65364. // Evenly distributes the span of a cell to a number of provided cells.
  65365. // The resulting spans will always be integer values.
  65366. //
  65367. // For instance breaking a span of 7 into 3 cells will return:
  65368. //
  65369. // { newCellsSpan: 2, updatedSpan: 3 }
  65370. //
  65371. // as two cells will have a span of 2 and the remainder will go the first cell so its span will change to 3.
  65372. //
  65373. // @param {Number} span The span value do break.
  65374. // @param {Number} numberOfCells The number of resulting spans.
  65375. // @returns {{newCellsSpan: Number, updatedSpan: Number}}
  65376. function breakSpanEvenly( span, numberOfCells ) {
  65377. if ( span < numberOfCells ) {
  65378. return { newCellsSpan: 1, updatedSpan: 1 };
  65379. }
  65380. const newCellsSpan = Math.floor( span / numberOfCells );
  65381. const updatedSpan = ( span - newCellsSpan * numberOfCells ) + newCellsSpan;
  65382. return { newCellsSpan, updatedSpan };
  65383. }
  65384. // Updates heading columns attribute if removing a row from head section.
  65385. function adjustHeadingColumns( table, removedColumnIndexes, writer ) {
  65386. const headingColumns = table.getAttribute( 'headingColumns' ) || 0;
  65387. if ( headingColumns && removedColumnIndexes.first < headingColumns ) {
  65388. const headingsRemoved = Math.min( headingColumns - 1 /* Other numbers are 0-based */, removedColumnIndexes.last ) -
  65389. removedColumnIndexes.first + 1;
  65390. writer.setAttribute( 'headingColumns', headingColumns - headingsRemoved, table );
  65391. }
  65392. }
  65393. // Calculates a new heading rows value for removing rows from heading section.
  65394. function updateHeadingRows( table, first, last, writer ) {
  65395. const headingRows = table.getAttribute( 'headingRows' ) || 0;
  65396. if ( first < headingRows ) {
  65397. const newRows = last < headingRows ? headingRows - ( last - first + 1 ) : first;
  65398. Object(_utils_common__WEBPACK_IMPORTED_MODULE_2__["updateNumericAttribute"])( 'headingRows', newRows, table, writer, 0 );
  65399. }
  65400. }
  65401. // Finds cells that will be:
  65402. // - trimmed - Cells that are "above" removed rows sections and overlap the removed section - their rowspan must be trimmed.
  65403. // - moved - Cells from removed rows section might stick out of. These cells are moved to the next row after a removed section.
  65404. //
  65405. // Sample table with overlapping & sticking out cells:
  65406. //
  65407. // +----+----+----+----+----+
  65408. // | 00 | 01 | 02 | 03 | 04 |
  65409. // +----+ + + + +
  65410. // | 10 | | | | |
  65411. // +----+----+ + + +
  65412. // | 20 | 21 | | | | <-- removed row
  65413. // + + +----+ + +
  65414. // | | | 32 | | | <-- removed row
  65415. // +----+ + +----+ +
  65416. // | 40 | | | 43 | |
  65417. // +----+----+----+----+----+
  65418. //
  65419. // In a table above:
  65420. // - cells to trim: '02', '03' & '04'.
  65421. // - cells to move: '21' & '32'.
  65422. function getCellsToMoveAndTrimOnRemoveRow( table, first, last ) {
  65423. const cellsToMove = new Map();
  65424. const cellsToTrim = [];
  65425. for ( const { row, column, cellHeight, cell } of new _tablewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( table, { endRow: last } ) ) {
  65426. const lastRowOfCell = row + cellHeight - 1;
  65427. const isCellStickingOutFromRemovedRows = row >= first && row <= last && lastRowOfCell > last;
  65428. if ( isCellStickingOutFromRemovedRows ) {
  65429. const rowspanInRemovedSection = last - row + 1;
  65430. const rowSpanToSet = cellHeight - rowspanInRemovedSection;
  65431. cellsToMove.set( column, {
  65432. cell,
  65433. rowspan: rowSpanToSet
  65434. } );
  65435. }
  65436. const isCellOverlappingRemovedRows = row < first && lastRowOfCell >= first;
  65437. if ( isCellOverlappingRemovedRows ) {
  65438. let rowspanAdjustment;
  65439. // Cell fully covers removed section - trim it by removed rows count.
  65440. if ( lastRowOfCell >= last ) {
  65441. rowspanAdjustment = last - first + 1;
  65442. }
  65443. // Cell partially overlaps removed section - calculate cell's span that is in removed section.
  65444. else {
  65445. rowspanAdjustment = lastRowOfCell - first + 1;
  65446. }
  65447. cellsToTrim.push( {
  65448. cell,
  65449. rowspan: cellHeight - rowspanAdjustment
  65450. } );
  65451. }
  65452. }
  65453. return { cellsToMove, cellsToTrim };
  65454. }
  65455. function moveCellsToRow( table, targetRowIndex, cellsToMove, writer ) {
  65456. const tableWalker = new _tablewalker__WEBPACK_IMPORTED_MODULE_1__["default"]( table, {
  65457. includeAllSlots: true,
  65458. row: targetRowIndex
  65459. } );
  65460. const tableRowMap = [ ...tableWalker ];
  65461. const row = table.getChild( targetRowIndex );
  65462. let previousCell;
  65463. for ( const { column, cell, isAnchor } of tableRowMap ) {
  65464. if ( cellsToMove.has( column ) ) {
  65465. const { cell: cellToMove, rowspan } = cellsToMove.get( column );
  65466. const targetPosition = previousCell ?
  65467. writer.createPositionAfter( previousCell ) :
  65468. writer.createPositionAt( row, 0 );
  65469. writer.move( writer.createRangeOn( cellToMove ), targetPosition );
  65470. Object(_utils_common__WEBPACK_IMPORTED_MODULE_2__["updateNumericAttribute"])( 'rowspan', rowspan, cellToMove, writer );
  65471. previousCell = cellToMove;
  65472. } else if ( isAnchor ) {
  65473. // If cell is spanned then `cell` holds reference to overlapping cell. See ckeditor/ckeditor5#6502.
  65474. previousCell = cell;
  65475. }
  65476. }
  65477. }
  65478. /***/ }),
  65479. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js":
  65480. /*!*******************************************************************!*\
  65481. !*** ./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js ***!
  65482. \*******************************************************************/
  65483. /*! exports provided: default */
  65484. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  65485. "use strict";
  65486. __webpack_require__.r(__webpack_exports__);
  65487. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TableWalker; });
  65488. /**
  65489. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  65490. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  65491. */
  65492. /**
  65493. * @module table/tablewalker
  65494. */
  65495. // @if CK_DEBUG // import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
  65496. /**
  65497. * The table iterator class. It allows to iterate over table cells. For each cell the iterator yields
  65498. * {@link module:table/tablewalker~TableSlot} with proper table cell attributes.
  65499. */
  65500. class TableWalker {
  65501. /**
  65502. * Creates an instance of the table walker.
  65503. *
  65504. * The table walker iterates internally by traversing the table from row index = 0 and column index = 0.
  65505. * It walks row by row and column by column in order to output values defined in the constructor.
  65506. * By default it will output only the locations that are occupied by a cell. To include also spanned rows and columns,
  65507. * pass the `includeAllSlots` option to the constructor.
  65508. *
  65509. * The most important values of the iterator are column and row indexes of a cell.
  65510. *
  65511. * See {@link module:table/tablewalker~TableSlot} what values are returned by the table walker.
  65512. *
  65513. * To iterate over a given row:
  65514. *
  65515. * const tableWalker = new TableWalker( table, { startRow: 1, endRow: 2 } );
  65516. *
  65517. * for ( const tableSlot of tableWalker ) {
  65518. * console.log( 'A cell at row', tableSlot.row, 'and column', tableSlot.column );
  65519. * }
  65520. *
  65521. * For instance the code above for the following table:
  65522. *
  65523. * +----+----+----+----+----+----+
  65524. * | 00 | 02 | 03 | 04 | 05 |
  65525. * | +----+----+----+----+
  65526. * | | 12 | 14 | 15 |
  65527. * | +----+----+----+ +
  65528. * | | 22 | |
  65529. * |----+----+----+----+----+ +
  65530. * | 30 | 31 | 32 | 33 | 34 | |
  65531. * +----+----+----+----+----+----+
  65532. *
  65533. * will log in the console:
  65534. *
  65535. * 'A cell at row 1 and column 2'
  65536. * 'A cell at row 1 and column 4'
  65537. * 'A cell at row 1 and column 5'
  65538. * 'A cell at row 2 and column 2'
  65539. *
  65540. * To also iterate over spanned cells:
  65541. *
  65542. * const tableWalker = new TableWalker( table, { row: 1, includeAllSlots: true } );
  65543. *
  65544. * for ( const tableSlot of tableWalker ) {
  65545. * console.log( 'Slot at', tableSlot.row, 'x', tableSlot.column, ':', tableSlot.isAnchor ? 'is anchored' : 'is spanned' );
  65546. * }
  65547. *
  65548. * will log in the console for the table from the previous example:
  65549. *
  65550. * 'Cell at 1 x 0 : is spanned'
  65551. * 'Cell at 1 x 1 : is spanned'
  65552. * 'Cell at 1 x 2 : is anchored'
  65553. * 'Cell at 1 x 3 : is spanned'
  65554. * 'Cell at 1 x 4 : is anchored'
  65555. * 'Cell at 1 x 5 : is anchored'
  65556. *
  65557. * **Note**: Option `row` is a shortcut that sets both `startRow` and `endRow` to the same row.
  65558. * (Use either `row` or `startRow` and `endRow` but never together). Similarly the `column` option sets both `startColumn`
  65559. * and `endColumn` to the same column (Use either `column` or `startColumn` and `endColumn` but never together).
  65560. *
  65561. * @constructor
  65562. * @param {module:engine/model/element~Element} table A table over which the walker iterates.
  65563. * @param {Object} [options={}] An object with configuration.
  65564. * @param {Number} [options.row] A row index for which this iterator will output cells.
  65565. * Can't be used together with `startRow` and `endRow`.
  65566. * @param {Number} [options.startRow=0] A row index from which this iterator should start. Can't be used together with `row`.
  65567. * @param {Number} [options.endRow] A row index at which this iterator should end. Can't be used together with `row`.
  65568. * @param {Number} [options.column] A column index for which this iterator will output cells.
  65569. * Can't be used together with `startColumn` and `endColumn`.
  65570. * @param {Number} [options.startColumn=0] A column index from which this iterator should start. Can't be used together with `column`.
  65571. * @param {Number} [options.endColumn] A column index at which this iterator should end. Can't be used together with `column`.
  65572. * @param {Boolean} [options.includeAllSlots=false] Also return values for spanned cells.
  65573. */
  65574. constructor( table, options = {} ) {
  65575. /**
  65576. * The walker's table element.
  65577. *
  65578. * @readonly
  65579. * @member {module:engine/model/element~Element}
  65580. * @protected
  65581. */
  65582. this._table = table;
  65583. /**
  65584. * A row index from which this iterator will start.
  65585. *
  65586. * @readonly
  65587. * @member {Number}
  65588. * @private
  65589. */
  65590. this._startRow = options.row !== undefined ? options.row : options.startRow || 0;
  65591. /**
  65592. * A row index at which this iterator will end.
  65593. *
  65594. * @readonly
  65595. * @member {Number}
  65596. * @private
  65597. */
  65598. this._endRow = options.row !== undefined ? options.row : options.endRow;
  65599. /**
  65600. * If set, the table walker will only output cells from a given column and following ones or cells that overlap them.
  65601. *
  65602. * @readonly
  65603. * @member {Number}
  65604. * @private
  65605. */
  65606. this._startColumn = options.column !== undefined ? options.column : options.startColumn || 0;
  65607. /**
  65608. * If set, the table walker will only output cells up to a given column.
  65609. *
  65610. * @readonly
  65611. * @member {Number}
  65612. * @private
  65613. */
  65614. this._endColumn = options.column !== undefined ? options.column : options.endColumn;
  65615. /**
  65616. * Enables output of spanned cells that are normally not yielded.
  65617. *
  65618. * @readonly
  65619. * @member {Boolean}
  65620. * @private
  65621. */
  65622. this._includeAllSlots = !!options.includeAllSlots;
  65623. /**
  65624. * Row indexes to skip from the iteration.
  65625. *
  65626. * @readonly
  65627. * @member {Set<Number>}
  65628. * @private
  65629. */
  65630. this._skipRows = new Set();
  65631. /**
  65632. * The current row index.
  65633. *
  65634. * @member {Number}
  65635. * @protected
  65636. */
  65637. this._row = 0;
  65638. /**
  65639. * The current column index.
  65640. *
  65641. * @member {Number}
  65642. * @protected
  65643. */
  65644. this._column = 0;
  65645. /**
  65646. * The cell index in a parent row. For spanned cells when {@link #_includeAllSlots} is set to `true`,
  65647. * this represents the index of the next table cell.
  65648. *
  65649. * @member {Number}
  65650. * @protected
  65651. */
  65652. this._cellIndex = 0;
  65653. /**
  65654. * Holds a map of spanned cells in a table.
  65655. *
  65656. * @readonly
  65657. * @member {Map.<Number, Map.<Number, Object>>}
  65658. * @private
  65659. */
  65660. this._spannedCells = new Map();
  65661. /**
  65662. * Index of the next column where a cell is anchored.
  65663. *
  65664. * @member {Number}
  65665. * @private
  65666. */
  65667. this._nextCellAtColumn = -1;
  65668. }
  65669. /**
  65670. * Iterable interface.
  65671. *
  65672. * @returns {Iterable.<module:table/tablewalker~TableSlot>}
  65673. */
  65674. [ Symbol.iterator ]() {
  65675. return this;
  65676. }
  65677. /**
  65678. * Gets the next table walker's value.
  65679. *
  65680. * @returns {module:table/tablewalker~TableSlot} The next table walker's value.
  65681. */
  65682. next() {
  65683. const row = this._table.getChild( this._row );
  65684. // Iterator is done when there's no row (table ended) or the row is after `endRow` limit.
  65685. if ( !row || this._isOverEndRow() ) {
  65686. return { done: true };
  65687. }
  65688. if ( this._isOverEndColumn() ) {
  65689. return this._advanceToNextRow();
  65690. }
  65691. let outValue = null;
  65692. const spanData = this._getSpanned();
  65693. if ( spanData ) {
  65694. if ( this._includeAllSlots && !this._shouldSkipSlot() ) {
  65695. outValue = this._formatOutValue( spanData.cell, spanData.row, spanData.column );
  65696. }
  65697. } else {
  65698. const cell = row.getChild( this._cellIndex );
  65699. if ( !cell ) {
  65700. // If there are no more cells left in row advance to the next row.
  65701. return this._advanceToNextRow();
  65702. }
  65703. const colspan = parseInt( cell.getAttribute( 'colspan' ) || 1 );
  65704. const rowspan = parseInt( cell.getAttribute( 'rowspan' ) || 1 );
  65705. // Record this cell spans if it's not 1x1 cell.
  65706. if ( colspan > 1 || rowspan > 1 ) {
  65707. this._recordSpans( cell, rowspan, colspan );
  65708. }
  65709. if ( !this._shouldSkipSlot() ) {
  65710. outValue = this._formatOutValue( cell );
  65711. }
  65712. this._nextCellAtColumn = this._column + colspan;
  65713. }
  65714. // Advance to the next column before returning value.
  65715. this._column++;
  65716. if ( this._column == this._nextCellAtColumn ) {
  65717. this._cellIndex++;
  65718. }
  65719. // The current value will be returned only if current row and column are not skipped.
  65720. return outValue || this.next();
  65721. }
  65722. /**
  65723. * Marks a row to skip in the next iteration. It will also skip cells from the current row if there are any cells from the current row
  65724. * to output.
  65725. *
  65726. * @param {Number} row The row index to skip.
  65727. */
  65728. skipRow( row ) {
  65729. this._skipRows.add( row );
  65730. }
  65731. /**
  65732. * Advances internal cursor to the next row.
  65733. *
  65734. * @private
  65735. * @returns {module:table/tablewalker~TableSlot}
  65736. */
  65737. _advanceToNextRow() {
  65738. this._row++;
  65739. this._column = 0;
  65740. this._cellIndex = 0;
  65741. this._nextCellAtColumn = -1;
  65742. return this.next();
  65743. }
  65744. /**
  65745. * Checks if the current row is over {@link #_endRow}.
  65746. *
  65747. * @private
  65748. * @returns {Boolean}
  65749. */
  65750. _isOverEndRow() {
  65751. // If #_endRow is defined skip all rows after it.
  65752. return this._endRow !== undefined && this._row > this._endRow;
  65753. }
  65754. /**
  65755. * Checks if the current cell is over {@link #_endColumn}
  65756. *
  65757. * @private
  65758. * @returns {Boolean}
  65759. */
  65760. _isOverEndColumn() {
  65761. // If #_endColumn is defined skip all cells after it.
  65762. return this._endColumn !== undefined && this._column > this._endColumn;
  65763. }
  65764. /**
  65765. * A common method for formatting the iterator's output value.
  65766. *
  65767. * @private
  65768. * @param {module:engine/model/element~Element} cell The table cell to output.
  65769. * @param {Number} [anchorRow] The row index of a cell anchor slot.
  65770. * @param {Number} [anchorColumn] The column index of a cell anchor slot.
  65771. * @returns {{done: Boolean, value: {cell: *, row: Number, column: *, rowspan: *, colspan: *, cellIndex: Number}}}
  65772. */
  65773. _formatOutValue( cell, anchorRow = this._row, anchorColumn = this._column ) {
  65774. return {
  65775. done: false,
  65776. value: new TableSlot( this, cell, anchorRow, anchorColumn )
  65777. };
  65778. }
  65779. /**
  65780. * Checks if the current slot should be skipped.
  65781. *
  65782. * @private
  65783. * @returns {Boolean}
  65784. */
  65785. _shouldSkipSlot() {
  65786. const rowIsMarkedAsSkipped = this._skipRows.has( this._row );
  65787. const rowIsBeforeStartRow = this._row < this._startRow;
  65788. const columnIsBeforeStartColumn = this._column < this._startColumn;
  65789. const columnIsAfterEndColumn = this._endColumn !== undefined && this._column > this._endColumn;
  65790. return rowIsMarkedAsSkipped || rowIsBeforeStartRow || columnIsBeforeStartColumn || columnIsAfterEndColumn;
  65791. }
  65792. /**
  65793. * Returns the cell element that is spanned over the current cell location.
  65794. *
  65795. * @private
  65796. * @returns {module:engine/model/element~Element}
  65797. */
  65798. _getSpanned() {
  65799. const rowMap = this._spannedCells.get( this._row );
  65800. // No spans for given row.
  65801. if ( !rowMap ) {
  65802. return null;
  65803. }
  65804. // If spans for given rows has entry for column it means that this location if spanned by other cell.
  65805. return rowMap.get( this._column ) || null;
  65806. }
  65807. /**
  65808. * Updates spanned cells map relative to the current cell location and its span dimensions.
  65809. *
  65810. * @private
  65811. * @param {module:engine/model/element~Element} cell A cell that is spanned.
  65812. * @param {Number} rowspan Cell height.
  65813. * @param {Number} colspan Cell width.
  65814. */
  65815. _recordSpans( cell, rowspan, colspan ) {
  65816. const data = {
  65817. cell,
  65818. row: this._row,
  65819. column: this._column
  65820. };
  65821. for ( let rowToUpdate = this._row; rowToUpdate < this._row + rowspan; rowToUpdate++ ) {
  65822. for ( let columnToUpdate = this._column; columnToUpdate < this._column + colspan; columnToUpdate++ ) {
  65823. if ( rowToUpdate != this._row || columnToUpdate != this._column ) {
  65824. this._markSpannedCell( rowToUpdate, columnToUpdate, data );
  65825. }
  65826. }
  65827. }
  65828. }
  65829. /**
  65830. * Marks the cell location as spanned by another cell.
  65831. *
  65832. * @private
  65833. * @param {Number} row The row index of the cell location.
  65834. * @param {Number} column The column index of the cell location.
  65835. * @param {Object} data A spanned cell details (cell element, anchor row and column).
  65836. */
  65837. _markSpannedCell( row, column, data ) {
  65838. if ( !this._spannedCells.has( row ) ) {
  65839. this._spannedCells.set( row, new Map() );
  65840. }
  65841. const rowSpans = this._spannedCells.get( row );
  65842. rowSpans.set( column, data );
  65843. }
  65844. }
  65845. /**
  65846. * An object returned by {@link module:table/tablewalker~TableWalker} when traversing table cells.
  65847. */
  65848. class TableSlot {
  65849. /**
  65850. * Creates an instance of the table walker value.
  65851. *
  65852. * @protected
  65853. * @param {module:table/tablewalker~TableWalker} tableWalker The table walker instance.
  65854. * @param {module:engine/model/element~Element} cell The current table cell.
  65855. * @param {Number} anchorRow The row index of a cell anchor slot.
  65856. * @param {Number} anchorColumn The column index of a cell anchor slot.
  65857. */
  65858. constructor( tableWalker, cell, anchorRow, anchorColumn ) {
  65859. /**
  65860. * The current table cell.
  65861. *
  65862. * @readonly
  65863. * @member {module:engine/model/element~Element}
  65864. */
  65865. this.cell = cell;
  65866. /**
  65867. * The row index of a table slot.
  65868. *
  65869. * @readonly
  65870. * @member {Number}
  65871. */
  65872. this.row = tableWalker._row;
  65873. /**
  65874. * The column index of a table slot.
  65875. *
  65876. * @readonly
  65877. * @member {Number}
  65878. */
  65879. this.column = tableWalker._column;
  65880. /**
  65881. * The row index of a cell anchor slot.
  65882. *
  65883. * @readonly
  65884. * @member {Number}
  65885. */
  65886. this.cellAnchorRow = anchorRow;
  65887. /**
  65888. * The column index of a cell anchor slot.
  65889. *
  65890. * @readonly
  65891. * @member {Number}
  65892. */
  65893. this.cellAnchorColumn = anchorColumn;
  65894. /**
  65895. * The index of the current cell in the parent row.
  65896. *
  65897. * @readonly
  65898. * @member {Number}
  65899. * @private
  65900. */
  65901. this._cellIndex = tableWalker._cellIndex;
  65902. /**
  65903. * The table element.
  65904. *
  65905. * @readonly
  65906. * @member {module:engine/model/element~Element}
  65907. * @private
  65908. */
  65909. this._table = tableWalker._table;
  65910. }
  65911. /**
  65912. * Whether the cell is anchored in the current slot.
  65913. *
  65914. * @readonly
  65915. * @returns {Boolean}
  65916. */
  65917. get isAnchor() {
  65918. return this.row === this.cellAnchorRow && this.column === this.cellAnchorColumn;
  65919. }
  65920. /**
  65921. * The width of a cell defined by a `colspan` attribute. If the model attribute is not present, it is set to `1`.
  65922. *
  65923. * @readonly
  65924. * @returns {Number}
  65925. */
  65926. get cellWidth() {
  65927. return parseInt( this.cell.getAttribute( 'colspan' ) || 1 );
  65928. }
  65929. /**
  65930. * The height of a cell defined by a `rowspan` attribute. If the model attribute is not present, it is set to `1`.
  65931. *
  65932. * @readonly
  65933. * @returns {Number}
  65934. */
  65935. get cellHeight() {
  65936. return parseInt( this.cell.getAttribute( 'rowspan' ) || 1 );
  65937. }
  65938. /**
  65939. * Returns the {@link module:engine/model/position~Position} before the table slot.
  65940. *
  65941. * @returns {module:engine/model/position~Position}
  65942. */
  65943. getPositionBefore() {
  65944. const model = this._table.root.document.model;
  65945. return model.createPositionAt( this._table.getChild( this.row ), this._cellIndex );
  65946. }
  65947. // @if CK_DEBUG // get isSpanned() { throwMissingGetterError( 'isSpanned' ); }
  65948. // @if CK_DEBUG // get colspan() { throwMissingGetterError( 'colspan' ); }
  65949. // @if CK_DEBUG // get rowspan() { throwMissingGetterError( 'rowspan' ); }
  65950. // @if CK_DEBUG // get cellIndex() { throwMissingGetterError( 'cellIndex' ); }
  65951. }
  65952. /**
  65953. * This `TableSlot`'s getter (property) was removed in CKEditor 5 v20.0.0.
  65954. *
  65955. * Check out the new `TableWalker`'s API in the documentation.
  65956. *
  65957. * @error tableslot-getter-removed
  65958. * @param {String} getterName
  65959. */
  65960. // @if CK_DEBUG // function throwMissingGetterError( getterName ) {
  65961. // @if CK_DEBUG // throw new CKEditorError( 'tableslot-getter-removed', this, {
  65962. // @if CK_DEBUG // getterName
  65963. // @if CK_DEBUG // } );
  65964. // @if CK_DEBUG // }
  65965. /***/ }),
  65966. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/ui/inserttableview.js":
  65967. /*!**************************************************************************!*\
  65968. !*** ./node_modules/@ckeditor/ckeditor5-table/src/ui/inserttableview.js ***!
  65969. \**************************************************************************/
  65970. /*! exports provided: default */
  65971. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  65972. "use strict";
  65973. __webpack_require__.r(__webpack_exports__);
  65974. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InsertTableView; });
  65975. /* harmony import */ var _ckeditor_ckeditor5_ui_src_view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  65976. /* harmony import */ var _theme_inserttable_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../../theme/inserttable.css */ "./node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css");
  65977. /* harmony import */ var _theme_inserttable_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_theme_inserttable_css__WEBPACK_IMPORTED_MODULE_1__);
  65978. /**
  65979. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  65980. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  65981. */
  65982. /**
  65983. * @module table/ui/inserttableview
  65984. */
  65985. /**
  65986. * The table size view.
  65987. *
  65988. * It renders a 10x10 grid to choose the inserted table size.
  65989. *
  65990. * @extends module:ui/view~View
  65991. * @implements module:ui/dropdown/dropdownpanelfocusable~DropdownPanelFocusable
  65992. */
  65993. class InsertTableView extends _ckeditor_ckeditor5_ui_src_view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  65994. /**
  65995. * @inheritDoc
  65996. */
  65997. constructor( locale ) {
  65998. super( locale );
  65999. const bind = this.bindTemplate;
  66000. /**
  66001. * A collection of table size box items.
  66002. *
  66003. * @readonly
  66004. * @member {module:ui/viewcollection~ViewCollection}
  66005. */
  66006. this.items = this._createGridCollection();
  66007. /**
  66008. * The currently selected number of rows of the new table.
  66009. *
  66010. * @observable
  66011. * @member {Number} #rows
  66012. */
  66013. this.set( 'rows', 0 );
  66014. /**
  66015. * The currently selected number of columns of the new table.
  66016. *
  66017. * @observable
  66018. * @member {Number} #columns
  66019. */
  66020. this.set( 'columns', 0 );
  66021. /**
  66022. * The label text displayed under the boxes.
  66023. *
  66024. * @observable
  66025. * @member {String} #label
  66026. */
  66027. this.bind( 'label' )
  66028. .to( this, 'columns', this, 'rows', ( columns, rows ) => `${ rows } × ${ columns }` );
  66029. this.setTemplate( {
  66030. tag: 'div',
  66031. attributes: {
  66032. class: [ 'ck' ]
  66033. },
  66034. children: [
  66035. {
  66036. tag: 'div',
  66037. attributes: {
  66038. class: [ 'ck-insert-table-dropdown__grid' ]
  66039. },
  66040. on: {
  66041. 'mouseover@.ck-insert-table-dropdown-grid-box': bind.to( 'boxover' )
  66042. },
  66043. children: this.items
  66044. },
  66045. {
  66046. tag: 'div',
  66047. attributes: {
  66048. class: [ 'ck-insert-table-dropdown__label' ]
  66049. },
  66050. children: [
  66051. {
  66052. text: bind.to( 'label' )
  66053. }
  66054. ]
  66055. }
  66056. ],
  66057. on: {
  66058. mousedown: bind.to( evt => {
  66059. evt.preventDefault();
  66060. } ),
  66061. click: bind.to( () => {
  66062. this.fire( 'execute' );
  66063. } )
  66064. }
  66065. } );
  66066. this.on( 'boxover', ( evt, domEvt ) => {
  66067. const { row, column } = domEvt.target.dataset;
  66068. // As row & column indexes are zero-based transform it to number of selected rows & columns.
  66069. this.set( {
  66070. rows: parseInt( row ),
  66071. columns: parseInt( column )
  66072. } );
  66073. } );
  66074. this.on( 'change:columns', () => {
  66075. this._highlightGridBoxes();
  66076. } );
  66077. this.on( 'change:rows', () => {
  66078. this._highlightGridBoxes();
  66079. } );
  66080. }
  66081. /**
  66082. * @inheritDoc
  66083. */
  66084. focus() {
  66085. // The dropdown panel expects DropdownPanelFocusable interface on views passed to dropdown panel. See #30.
  66086. // The method should be implemented while working on keyboard support for this view. See #22.
  66087. }
  66088. /**
  66089. * @inheritDoc
  66090. */
  66091. focusLast() {
  66092. // The dropdown panel expects DropdownPanelFocusable interface on views passed to dropdown panel. See #30.
  66093. // The method should be implemented while working on keyboard support for this view. See #22.
  66094. }
  66095. /**
  66096. * Highlights grid boxes depending on rows and columns selected.
  66097. *
  66098. * @private
  66099. */
  66100. _highlightGridBoxes() {
  66101. const rows = this.rows;
  66102. const columns = this.columns;
  66103. this.items.map( ( boxView, index ) => {
  66104. // Translate box index to the row & column index.
  66105. const itemRow = Math.floor( index / 10 );
  66106. const itemColumn = index % 10;
  66107. // Grid box is highlighted when its row & column index belongs to selected number of rows & columns.
  66108. const isOn = itemRow < rows && itemColumn < columns;
  66109. boxView.set( 'isOn', isOn );
  66110. } );
  66111. }
  66112. /**
  66113. * @private
  66114. * @returns {module:ui/viewcollection~ViewCollection} A view collection containing boxes to be placed in a table grid.
  66115. */
  66116. _createGridCollection() {
  66117. const boxes = [];
  66118. // Add grid boxes to table selection view.
  66119. for ( let index = 0; index < 100; index++ ) {
  66120. const row = Math.floor( index / 10 );
  66121. const column = index % 10;
  66122. boxes.push( new TableSizeGridBoxView( this.locale, row + 1, column + 1 ) );
  66123. }
  66124. return this.createCollection( boxes );
  66125. }
  66126. /**
  66127. * Fired when the mouse hover over one of the {@link #items child grid boxes}.
  66128. *
  66129. * @event boxover
  66130. */
  66131. }
  66132. /**
  66133. * A single grid box view element.
  66134. *
  66135. * This class is used to render the table size selection grid in {@link module:table/ui/inserttableview~InsertTableView}.
  66136. *
  66137. * @private
  66138. */
  66139. class TableSizeGridBoxView extends _ckeditor_ckeditor5_ui_src_view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  66140. /**
  66141. * @inheritDoc
  66142. */
  66143. constructor( locale, row, column ) {
  66144. super( locale );
  66145. const bind = this.bindTemplate;
  66146. /**
  66147. * Controls whether the grid box view is "on".
  66148. *
  66149. * @observable
  66150. * @member {Boolean} #isOn
  66151. */
  66152. this.set( 'isOn', false );
  66153. this.setTemplate( {
  66154. tag: 'div',
  66155. attributes: {
  66156. class: [
  66157. 'ck-insert-table-dropdown-grid-box',
  66158. bind.if( 'isOn', 'ck-on' )
  66159. ],
  66160. 'data-row': row,
  66161. 'data-column': column
  66162. }
  66163. } );
  66164. }
  66165. }
  66166. /***/ }),
  66167. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js":
  66168. /*!********************************************************************!*\
  66169. !*** ./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js ***!
  66170. \********************************************************************/
  66171. /*! exports provided: updateNumericAttribute, createEmptyTableCell, isHeadingColumnCell */
  66172. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  66173. "use strict";
  66174. __webpack_require__.r(__webpack_exports__);
  66175. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateNumericAttribute", function() { return updateNumericAttribute; });
  66176. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createEmptyTableCell", function() { return createEmptyTableCell; });
  66177. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isHeadingColumnCell", function() { return isHeadingColumnCell; });
  66178. /**
  66179. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  66180. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  66181. */
  66182. /**
  66183. * @module table/utils/common
  66184. */
  66185. /**
  66186. * A common method to update the numeric value. If a value is the default one, it will be unset.
  66187. *
  66188. * @param {String} key An attribute key.
  66189. * @param {*} value The new attribute value.
  66190. * @param {module:engine/model/item~Item} item A model item on which the attribute will be set.
  66191. * @param {module:engine/model/writer~Writer} writer
  66192. * @param {*} defaultValue The default attribute value. If a value is lower or equal, it will be unset.
  66193. */
  66194. function updateNumericAttribute( key, value, item, writer, defaultValue = 1 ) {
  66195. if ( value > defaultValue ) {
  66196. writer.setAttribute( key, value, item );
  66197. } else {
  66198. writer.removeAttribute( key, item );
  66199. }
  66200. }
  66201. /**
  66202. * A common method to create an empty table cell. It creates a proper model structure as a table cell must have at least one block inside.
  66203. *
  66204. * @param {module:engine/model/writer~Writer} writer The model writer.
  66205. * @param {module:engine/model/position~Position} insertPosition The position at which the table cell should be inserted.
  66206. * @param {Object} attributes The element attributes.
  66207. * @returns {module:engine/model/element~Element} Created table cell.
  66208. */
  66209. function createEmptyTableCell( writer, insertPosition, attributes = {} ) {
  66210. const tableCell = writer.createElement( 'tableCell', attributes );
  66211. writer.insertElement( 'paragraph', tableCell );
  66212. writer.insert( tableCell, insertPosition );
  66213. return tableCell;
  66214. }
  66215. /**
  66216. * Checks if a table cell belongs to the heading column section.
  66217. *
  66218. * @param {module:table/tableutils~TableUtils} tableUtils
  66219. * @param {module:engine/model/element~Element} tableCell
  66220. * @returns {Boolean}
  66221. */
  66222. function isHeadingColumnCell( tableUtils, tableCell ) {
  66223. const table = tableCell.parent.parent;
  66224. const headingColumns = parseInt( table.getAttribute( 'headingColumns' ) || 0 );
  66225. const { column } = tableUtils.getCellLocation( tableCell );
  66226. return !!headingColumns && column < headingColumns;
  66227. }
  66228. /***/ }),
  66229. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js":
  66230. /*!***********************************************************************!*\
  66231. !*** ./node_modules/@ckeditor/ckeditor5-table/src/utils/selection.js ***!
  66232. \***********************************************************************/
  66233. /*! exports provided: getSelectedTableCells, getTableCellsContainingSelection, getSelectionAffectedTableCells, getRowIndexes, getColumnIndexes, isSelectionRectangular, sortRanges */
  66234. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  66235. "use strict";
  66236. __webpack_require__.r(__webpack_exports__);
  66237. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSelectedTableCells", function() { return getSelectedTableCells; });
  66238. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTableCellsContainingSelection", function() { return getTableCellsContainingSelection; });
  66239. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSelectionAffectedTableCells", function() { return getSelectionAffectedTableCells; });
  66240. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRowIndexes", function() { return getRowIndexes; });
  66241. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getColumnIndexes", function() { return getColumnIndexes; });
  66242. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSelectionRectangular", function() { return isSelectionRectangular; });
  66243. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sortRanges", function() { return sortRanges; });
  66244. /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
  66245. /**
  66246. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  66247. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  66248. */
  66249. /**
  66250. * @module table/utils/selection
  66251. */
  66252. /**
  66253. * Returns all model table cells that are fully selected (from the outside)
  66254. * within the provided model selection's ranges.
  66255. *
  66256. * To obtain the cells selected from the inside, use
  66257. * {@link module:table/utils/selection~getTableCellsContainingSelection}.
  66258. *
  66259. * @param {module:engine/model/selection~Selection} selection
  66260. * @returns {Array.<module:engine/model/element~Element>}
  66261. */
  66262. function getSelectedTableCells( selection ) {
  66263. const cells = [];
  66264. for ( const range of sortRanges( selection.getRanges() ) ) {
  66265. const element = range.getContainedElement();
  66266. if ( element && element.is( 'element', 'tableCell' ) ) {
  66267. cells.push( element );
  66268. }
  66269. }
  66270. return cells;
  66271. }
  66272. /**
  66273. * Returns all model table cells that the provided model selection's ranges
  66274. * {@link module:engine/model/range~Range#start} inside.
  66275. *
  66276. * To obtain the cells selected from the outside, use
  66277. * {@link module:table/utils/selection~getSelectedTableCells}.
  66278. *
  66279. * @param {module:engine/model/selection~Selection} selection
  66280. * @returns {Array.<module:engine/model/element~Element>}
  66281. */
  66282. function getTableCellsContainingSelection( selection ) {
  66283. const cells = [];
  66284. for ( const range of selection.getRanges() ) {
  66285. const cellWithSelection = range.start.findAncestor( 'tableCell' );
  66286. if ( cellWithSelection ) {
  66287. cells.push( cellWithSelection );
  66288. }
  66289. }
  66290. return cells;
  66291. }
  66292. /**
  66293. * Returns all model table cells that are either completely selected
  66294. * by selection ranges or host selection range
  66295. * {@link module:engine/model/range~Range#start start positions} inside them.
  66296. *
  66297. * Combines {@link module:table/utils/selection~getTableCellsContainingSelection} and
  66298. * {@link module:table/utils/selection~getSelectedTableCells}.
  66299. *
  66300. * @param {module:engine/model/selection~Selection} selection
  66301. * @returns {Array.<module:engine/model/element~Element>}
  66302. */
  66303. function getSelectionAffectedTableCells( selection ) {
  66304. const selectedCells = getSelectedTableCells( selection );
  66305. if ( selectedCells.length ) {
  66306. return selectedCells;
  66307. }
  66308. return getTableCellsContainingSelection( selection );
  66309. }
  66310. /**
  66311. * Returns an object with the `first` and `last` row index contained in the given `tableCells`.
  66312. *
  66313. * const selectedTableCells = getSelectedTableCells( editor.model.document.selection );
  66314. *
  66315. * const { first, last } = getRowIndexes( selectedTableCells );
  66316. *
  66317. * console.log( `Selected rows: ${ first } to ${ last }` );
  66318. *
  66319. * @param {Array.<module:engine/model/element~Element>} tableCells
  66320. * @returns {Object} Returns an object with the `first` and `last` table row indexes.
  66321. */
  66322. function getRowIndexes( tableCells ) {
  66323. const indexes = tableCells.map( cell => cell.parent.index );
  66324. return getFirstLastIndexesObject( indexes );
  66325. }
  66326. /**
  66327. * Returns an object with the `first` and `last` column index contained in the given `tableCells`.
  66328. *
  66329. * const selectedTableCells = getSelectedTableCells( editor.model.document.selection );
  66330. *
  66331. * const { first, last } = getColumnIndexes( selectedTableCells );
  66332. *
  66333. * console.log( `Selected columns: ${ first } to ${ last }` );
  66334. *
  66335. * @param {Array.<module:engine/model/element~Element>} tableCells
  66336. * @returns {Object} Returns an object with the `first` and `last` table column indexes.
  66337. */
  66338. function getColumnIndexes( tableCells ) {
  66339. const table = tableCells[ 0 ].findAncestor( 'table' );
  66340. const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table ) ];
  66341. const indexes = tableMap
  66342. .filter( entry => tableCells.includes( entry.cell ) )
  66343. .map( entry => entry.column );
  66344. return getFirstLastIndexesObject( indexes );
  66345. }
  66346. /**
  66347. * Checks if the selection contains cells that do not exceed rectangular selection.
  66348. *
  66349. * In a table below:
  66350. *
  66351. * ┌───┬───┬───┬───┐
  66352. * │ a │ b │ c │ d │
  66353. * ├───┴───┼───┤ │
  66354. * │ e │ f │ │
  66355. * │ ├───┼───┤
  66356. * │ │ g │ h │
  66357. * └───────┴───┴───┘
  66358. *
  66359. * Valid selections are these which create a solid rectangle (without gaps), such as:
  66360. * - a, b (two horizontal cells)
  66361. * - c, f (two vertical cells)
  66362. * - a, b, e (cell "e" spans over four cells)
  66363. * - c, d, f (cell d spans over a cell in the row below)
  66364. *
  66365. * While an invalid selection would be:
  66366. * - a, c (the unselected cell "b" creates a gap)
  66367. * - f, g, h (cell "d" spans over a cell from the row of "f" cell - thus creates a gap)
  66368. *
  66369. * @param {Array.<module:engine/model/element~Element>} selectedTableCells
  66370. * @param {module:table/tableutils~TableUtils} tableUtils
  66371. * @returns {Boolean}
  66372. */
  66373. function isSelectionRectangular( selectedTableCells, tableUtils ) {
  66374. if ( selectedTableCells.length < 2 || !areCellInTheSameTableSection( selectedTableCells ) ) {
  66375. return false;
  66376. }
  66377. // A valid selection is a fully occupied rectangle composed of table cells.
  66378. // Below we will calculate the area of a selected table cells and the area of valid selection.
  66379. // The area of a valid selection is defined by top-left and bottom-right cells.
  66380. const rows = new Set();
  66381. const columns = new Set();
  66382. let areaOfSelectedCells = 0;
  66383. for ( const tableCell of selectedTableCells ) {
  66384. const { row, column } = tableUtils.getCellLocation( tableCell );
  66385. const rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 );
  66386. const colspan = parseInt( tableCell.getAttribute( 'colspan' ) || 1 );
  66387. // Record row & column indexes of current cell.
  66388. rows.add( row );
  66389. columns.add( column );
  66390. // For cells that spans over multiple rows add also the last row that this cell spans over.
  66391. if ( rowspan > 1 ) {
  66392. rows.add( row + rowspan - 1 );
  66393. }
  66394. // For cells that spans over multiple columns add also the last column that this cell spans over.
  66395. if ( colspan > 1 ) {
  66396. columns.add( column + colspan - 1 );
  66397. }
  66398. areaOfSelectedCells += ( rowspan * colspan );
  66399. }
  66400. // We can only merge table cells that are in adjacent rows...
  66401. const areaOfValidSelection = getBiggestRectangleArea( rows, columns );
  66402. return areaOfValidSelection == areaOfSelectedCells;
  66403. }
  66404. /**
  66405. * Returns array of sorted ranges.
  66406. *
  66407. * @param {Iterable.<module:engine/model/range~Range>} ranges
  66408. * @return {Array.<module:engine/model/range~Range>}
  66409. */
  66410. function sortRanges( ranges ) {
  66411. return Array.from( ranges ).sort( compareRangeOrder );
  66412. }
  66413. // Helper method to get an object with `first` and `last` indexes from an unsorted array of indexes.
  66414. function getFirstLastIndexesObject( indexes ) {
  66415. const allIndexesSorted = indexes.sort( ( indexA, indexB ) => indexA - indexB );
  66416. const first = allIndexesSorted[ 0 ];
  66417. const last = allIndexesSorted[ allIndexesSorted.length - 1 ];
  66418. return { first, last };
  66419. }
  66420. function compareRangeOrder( rangeA, rangeB ) {
  66421. // Since table cell ranges are disjoint, it's enough to check their start positions.
  66422. const posA = rangeA.start;
  66423. const posB = rangeB.start;
  66424. // Checking for equal position (returning 0) is not needed because this would be either:
  66425. // a. Intersecting range (not allowed by model)
  66426. // b. Collapsed range on the same position (allowed by model but should not happen).
  66427. return posA.isBefore( posB ) ? -1 : 1;
  66428. }
  66429. // Calculates the area of a maximum rectangle that can span over the provided row & column indexes.
  66430. //
  66431. // @param {Array.<Number>} rows
  66432. // @param {Array.<Number>} columns
  66433. // @returns {Number}
  66434. function getBiggestRectangleArea( rows, columns ) {
  66435. const rowsIndexes = Array.from( rows.values() );
  66436. const columnIndexes = Array.from( columns.values() );
  66437. const lastRow = Math.max( ...rowsIndexes );
  66438. const firstRow = Math.min( ...rowsIndexes );
  66439. const lastColumn = Math.max( ...columnIndexes );
  66440. const firstColumn = Math.min( ...columnIndexes );
  66441. return ( lastRow - firstRow + 1 ) * ( lastColumn - firstColumn + 1 );
  66442. }
  66443. // Checks if the selection does not mix a header (column or row) with other cells.
  66444. //
  66445. // For instance, in the table below valid selections consist of cells with the same letter only.
  66446. // So, a-a (same heading row and column) or d-d (body cells) are valid while c-d or a-b are not.
  66447. //
  66448. // header columns
  66449. // ↓ ↓
  66450. // ┌───┬───┬───┬───┐
  66451. // │ a │ a │ b │ b │ ← header row
  66452. // ├───┼───┼───┼───┤
  66453. // │ c │ c │ d │ d │
  66454. // ├───┼───┼───┼───┤
  66455. // │ c │ c │ d │ d │
  66456. // └───┴───┴───┴───┘
  66457. function areCellInTheSameTableSection( tableCells ) {
  66458. const table = tableCells[ 0 ].findAncestor( 'table' );
  66459. const rowIndexes = getRowIndexes( tableCells );
  66460. const headingRows = parseInt( table.getAttribute( 'headingRows' ) || 0 );
  66461. // Calculating row indexes is a bit cheaper so if this check fails we can't merge.
  66462. if ( !areIndexesInSameSection( rowIndexes, headingRows ) ) {
  66463. return false;
  66464. }
  66465. const headingColumns = parseInt( table.getAttribute( 'headingColumns' ) || 0 );
  66466. const columnIndexes = getColumnIndexes( tableCells );
  66467. // Similarly cells must be in same column section.
  66468. return areIndexesInSameSection( columnIndexes, headingColumns );
  66469. }
  66470. // Unified check if table rows/columns indexes are in the same heading/body section.
  66471. function areIndexesInSameSection( { first, last }, headingSectionSize ) {
  66472. const firstCellIsInHeading = first < headingSectionSize;
  66473. const lastCellIsInHeading = last < headingSectionSize;
  66474. return firstCellIsInHeading === lastCellIsInHeading;
  66475. }
  66476. /***/ }),
  66477. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js":
  66478. /*!***********************************************************************!*\
  66479. !*** ./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js ***!
  66480. \***********************************************************************/
  66481. /*! exports provided: cropTableToDimensions, getVerticallyOverlappingCells, splitHorizontally, getHorizontallyOverlappingCells, splitVertically, trimTableCellIfNeeded, removeEmptyColumns, removeEmptyRows, removeEmptyRowsColumns, adjustLastRowIndex, adjustLastColumnIndex */
  66482. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  66483. "use strict";
  66484. __webpack_require__.r(__webpack_exports__);
  66485. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cropTableToDimensions", function() { return cropTableToDimensions; });
  66486. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getVerticallyOverlappingCells", function() { return getVerticallyOverlappingCells; });
  66487. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "splitHorizontally", function() { return splitHorizontally; });
  66488. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getHorizontallyOverlappingCells", function() { return getHorizontallyOverlappingCells; });
  66489. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "splitVertically", function() { return splitVertically; });
  66490. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "trimTableCellIfNeeded", function() { return trimTableCellIfNeeded; });
  66491. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeEmptyColumns", function() { return removeEmptyColumns; });
  66492. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeEmptyRows", function() { return removeEmptyRows; });
  66493. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeEmptyRowsColumns", function() { return removeEmptyRowsColumns; });
  66494. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "adjustLastRowIndex", function() { return adjustLastRowIndex; });
  66495. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "adjustLastColumnIndex", function() { return adjustLastColumnIndex; });
  66496. /* harmony import */ var _tablewalker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../tablewalker */ "./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js");
  66497. /* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./common */ "./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js");
  66498. /**
  66499. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  66500. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  66501. */
  66502. /**
  66503. * @module table/utils/structure
  66504. */
  66505. /**
  66506. * Returns a cropped table according to given dimensions.
  66507. * To return a cropped table that starts at first row and first column and end in third row and column:
  66508. *
  66509. * const croppedTable = cropTableToDimensions( table, {
  66510. * startRow: 1,
  66511. * endRow: 1,
  66512. * startColumn: 3,
  66513. * endColumn: 3
  66514. * }, writer );
  66515. *
  66516. * Calling the code above for the table below:
  66517. *
  66518. * 0 1 2 3 4 0 1 2
  66519. * ┌───┬───┬───┬───┬───┐
  66520. * 0 │ a │ b │ c │ d │ e │
  66521. * ├───┴───┤ ├───┴───┤ ┌───┬───┬───┐
  66522. * 1 │ f │ │ g │ │ │ │ g │ 0
  66523. * ├───┬───┴───┼───┬───┤ will return: ├───┴───┼───┤
  66524. * 2 │ h │ i │ j │ k │ │ i │ j │ 1
  66525. * ├───┤ ├───┤ │ │ ├───┤
  66526. * 3 │ l │ │ m │ │ │ │ m │ 2
  66527. * ├───┼───┬───┤ ├───┤ └───────┴───┘
  66528. * 4 │ n │ o │ p │ │ q │
  66529. * └───┴───┴───┴───┴───┘
  66530. *
  66531. * @param {module:engine/model/element~Element} sourceTable
  66532. * @param {Object} cropDimensions
  66533. * @param {Number} cropDimensions.startRow
  66534. * @param {Number} cropDimensions.startColumn
  66535. * @param {Number} cropDimensions.endRow
  66536. * @param {Number} cropDimensions.endColumn
  66537. * @param {module:engine/model/writer~Writer} writer
  66538. * @returns {module:engine/model/element~Element}
  66539. */
  66540. function cropTableToDimensions( sourceTable, cropDimensions, writer ) {
  66541. const { startRow, startColumn, endRow, endColumn } = cropDimensions;
  66542. // Create empty table with empty rows equal to crop height.
  66543. const croppedTable = writer.createElement( 'table' );
  66544. const cropHeight = endRow - startRow + 1;
  66545. for ( let i = 0; i < cropHeight; i++ ) {
  66546. writer.insertElement( 'tableRow', croppedTable, 'end' );
  66547. }
  66548. const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( sourceTable, { startRow, endRow, startColumn, endColumn, includeAllSlots: true } ) ];
  66549. // Iterate over source table slots (including empty - spanned - ones).
  66550. for ( const { row: sourceRow, column: sourceColumn, cell: tableCell, isAnchor, cellAnchorRow, cellAnchorColumn } of tableMap ) {
  66551. // Row index in cropped table.
  66552. const rowInCroppedTable = sourceRow - startRow;
  66553. const row = croppedTable.getChild( rowInCroppedTable );
  66554. // For empty slots: fill the gap with empty table cell.
  66555. if ( !isAnchor ) {
  66556. // But fill the gap only if the spanning cell is anchored outside cropped area.
  66557. // In the table from method jsdoc those cells are: "c" & "f".
  66558. if ( cellAnchorRow < startRow || cellAnchorColumn < startColumn ) {
  66559. Object(_common__WEBPACK_IMPORTED_MODULE_1__["createEmptyTableCell"])( writer, writer.createPositionAt( row, 'end' ) );
  66560. }
  66561. }
  66562. // Otherwise clone the cell with all children and trim if it exceeds cropped area.
  66563. else {
  66564. const tableCellCopy = writer.cloneElement( tableCell );
  66565. writer.append( tableCellCopy, row );
  66566. // Trim table if it exceeds cropped area.
  66567. // In the table from method jsdoc those cells are: "g" & "m".
  66568. trimTableCellIfNeeded( tableCellCopy, sourceRow, sourceColumn, endRow, endColumn, writer );
  66569. }
  66570. }
  66571. // Adjust heading rows & columns in cropped table if crop selection includes headings parts.
  66572. addHeadingsToCroppedTable( croppedTable, sourceTable, startRow, startColumn, writer );
  66573. return croppedTable;
  66574. }
  66575. /**
  66576. * Returns slot info of cells that starts above and overlaps a given row.
  66577. *
  66578. * In a table below, passing `overlapRow = 3`
  66579. *
  66580. * ┌───┬───┬───┬───┬───┐
  66581. * 0 │ a │ b │ c │ d │ e │
  66582. * │ ├───┼───┼───┼───┤
  66583. * 1 │ │ f │ g │ h │ i │
  66584. * ├───┤ ├───┼───┤ │
  66585. * 2 │ j │ │ k │ l │ │
  66586. * │ │ │ ├───┼───┤
  66587. * 3 │ │ │ │ m │ n │ <- overlap row to check
  66588. * ├───┼───┤ │ ├───│
  66589. * 4 │ o │ p │ │ │ q │
  66590. * └───┴───┴───┴───┴───┘
  66591. *
  66592. * will return slot info for cells: "j", "f", "k".
  66593. *
  66594. * @param {module:engine/model/element~Element} table The table to check.
  66595. * @param {Number} overlapRow The index of the row to check.
  66596. * @param {Number} [startRow=0] A row to start analysis. Use it when it is known that the cells above that row will not overlap.
  66597. * @returns {Array.<module:table/tablewalker~TableSlot>}
  66598. */
  66599. function getVerticallyOverlappingCells( table, overlapRow, startRow = 0 ) {
  66600. const cells = [];
  66601. const tableWalker = new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table, { startRow, endRow: overlapRow - 1 } );
  66602. for ( const slotInfo of tableWalker ) {
  66603. const { row, cellHeight } = slotInfo;
  66604. const cellEndRow = row + cellHeight - 1;
  66605. if ( row < overlapRow && overlapRow <= cellEndRow ) {
  66606. cells.push( slotInfo );
  66607. }
  66608. }
  66609. return cells;
  66610. }
  66611. /**
  66612. * Splits the table cell horizontally.
  66613. *
  66614. * @param {module:engine/model/element~Element} tableCell
  66615. * @param {Number} splitRow
  66616. * @param {module:engine/model/writer~Writer} writer
  66617. * @returns {module:engine/model/element~Element} Created table cell.
  66618. */
  66619. function splitHorizontally( tableCell, splitRow, writer ) {
  66620. const tableRow = tableCell.parent;
  66621. const table = tableRow.parent;
  66622. const rowIndex = tableRow.index;
  66623. const rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) );
  66624. const newRowspan = splitRow - rowIndex;
  66625. const newCellAttributes = {};
  66626. const newCellRowSpan = rowspan - newRowspan;
  66627. if ( newCellRowSpan > 1 ) {
  66628. newCellAttributes.rowspan = newCellRowSpan;
  66629. }
  66630. const colspan = parseInt( tableCell.getAttribute( 'colspan' ) || 1 );
  66631. if ( colspan > 1 ) {
  66632. newCellAttributes.colspan = colspan;
  66633. }
  66634. const startRow = rowIndex;
  66635. const endRow = startRow + newRowspan;
  66636. const tableMap = [ ...new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table, { startRow, endRow, includeAllSlots: true } ) ];
  66637. let newCell = null;
  66638. let columnIndex;
  66639. for ( const tableSlot of tableMap ) {
  66640. const { row, column, cell } = tableSlot;
  66641. if ( cell === tableCell && columnIndex === undefined ) {
  66642. columnIndex = column;
  66643. }
  66644. if ( columnIndex !== undefined && columnIndex === column && row === endRow ) {
  66645. newCell = Object(_common__WEBPACK_IMPORTED_MODULE_1__["createEmptyTableCell"])( writer, tableSlot.getPositionBefore(), newCellAttributes );
  66646. }
  66647. }
  66648. // Update the rowspan attribute after updating table.
  66649. Object(_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'rowspan', newRowspan, tableCell, writer );
  66650. return newCell;
  66651. }
  66652. /**
  66653. * Returns slot info of cells that starts before and overlaps a given column.
  66654. *
  66655. * In a table below, passing `overlapColumn = 3`
  66656. *
  66657. * 0 1 2 3 4
  66658. * ┌───────┬───────┬───┐
  66659. * │ a │ b │ c │
  66660. * │───┬───┴───────┼───┤
  66661. * │ d │ e │ f │
  66662. * ├───┼───┬───────┴───┤
  66663. * │ g │ h │ i │
  66664. * ├───┼───┼───┬───────┤
  66665. * │ j │ k │ l │ m │
  66666. * ├───┼───┴───┼───┬───┤
  66667. * │ n │ o │ p │ q │
  66668. * └───┴───────┴───┴───┘
  66669. * ^
  66670. * Overlap column to check
  66671. *
  66672. * will return slot info for cells: "b", "e", "i".
  66673. *
  66674. * @param {module:engine/model/element~Element} table The table to check.
  66675. * @param {Number} overlapColumn The index of the column to check.
  66676. * @returns {Array.<module:table/tablewalker~TableSlot>}
  66677. */
  66678. function getHorizontallyOverlappingCells( table, overlapColumn ) {
  66679. const cellsToSplit = [];
  66680. const tableWalker = new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table );
  66681. for ( const slotInfo of tableWalker ) {
  66682. const { column, cellWidth } = slotInfo;
  66683. const cellEndColumn = column + cellWidth - 1;
  66684. if ( column < overlapColumn && overlapColumn <= cellEndColumn ) {
  66685. cellsToSplit.push( slotInfo );
  66686. }
  66687. }
  66688. return cellsToSplit;
  66689. }
  66690. /**
  66691. * Splits the table cell vertically.
  66692. *
  66693. * @param {module:engine/model/element~Element} tableCell
  66694. * @param {Number} columnIndex The table cell column index.
  66695. * @param {Number} splitColumn The index of column to split cell on.
  66696. * @param {module:engine/model/writer~Writer} writer
  66697. * @returns {module:engine/model/element~Element} Created table cell.
  66698. */
  66699. function splitVertically( tableCell, columnIndex, splitColumn, writer ) {
  66700. const colspan = parseInt( tableCell.getAttribute( 'colspan' ) );
  66701. const newColspan = splitColumn - columnIndex;
  66702. const newCellAttributes = {};
  66703. const newCellColSpan = colspan - newColspan;
  66704. if ( newCellColSpan > 1 ) {
  66705. newCellAttributes.colspan = newCellColSpan;
  66706. }
  66707. const rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 );
  66708. if ( rowspan > 1 ) {
  66709. newCellAttributes.rowspan = rowspan;
  66710. }
  66711. const newCell = Object(_common__WEBPACK_IMPORTED_MODULE_1__["createEmptyTableCell"])( writer, writer.createPositionAfter( tableCell ), newCellAttributes );
  66712. // Update the colspan attribute after updating table.
  66713. Object(_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'colspan', newColspan, tableCell, writer );
  66714. return newCell;
  66715. }
  66716. /**
  66717. * Adjusts table cell dimensions to not exceed limit row and column.
  66718. *
  66719. * If table cell width (or height) covers a column (or row) that is after a limit column (or row)
  66720. * this method will trim "colspan" (or "rowspan") attribute so the table cell will fit in a defined limits.
  66721. *
  66722. * @param {module:engine/model/element~Element} tableCell
  66723. * @param {Number} cellRow
  66724. * @param {Number} cellColumn
  66725. * @param {Number} limitRow
  66726. * @param {Number} limitColumn
  66727. * @param {module:engine/model/writer~Writer} writer
  66728. */
  66729. function trimTableCellIfNeeded( tableCell, cellRow, cellColumn, limitRow, limitColumn, writer ) {
  66730. const colspan = parseInt( tableCell.getAttribute( 'colspan' ) || 1 );
  66731. const rowspan = parseInt( tableCell.getAttribute( 'rowspan' ) || 1 );
  66732. const endColumn = cellColumn + colspan - 1;
  66733. if ( endColumn > limitColumn ) {
  66734. const trimmedSpan = limitColumn - cellColumn + 1;
  66735. Object(_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'colspan', trimmedSpan, tableCell, writer, 1 );
  66736. }
  66737. const endRow = cellRow + rowspan - 1;
  66738. if ( endRow > limitRow ) {
  66739. const trimmedSpan = limitRow - cellRow + 1;
  66740. Object(_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'rowspan', trimmedSpan, tableCell, writer, 1 );
  66741. }
  66742. }
  66743. // Sets proper heading attributes to a cropped table.
  66744. function addHeadingsToCroppedTable( croppedTable, sourceTable, startRow, startColumn, writer ) {
  66745. const headingRows = parseInt( sourceTable.getAttribute( 'headingRows' ) || 0 );
  66746. if ( headingRows > 0 ) {
  66747. const headingRowsInCrop = headingRows - startRow;
  66748. Object(_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'headingRows', headingRowsInCrop, croppedTable, writer, 0 );
  66749. }
  66750. const headingColumns = parseInt( sourceTable.getAttribute( 'headingColumns' ) || 0 );
  66751. if ( headingColumns > 0 ) {
  66752. const headingColumnsInCrop = headingColumns - startColumn;
  66753. Object(_common__WEBPACK_IMPORTED_MODULE_1__["updateNumericAttribute"])( 'headingColumns', headingColumnsInCrop, croppedTable, writer, 0 );
  66754. }
  66755. }
  66756. /**
  66757. * Removes columns that have no cells anchored.
  66758. *
  66759. * In table below:
  66760. *
  66761. * +----+----+----+----+----+----+----+
  66762. * | 00 | 01 | 03 | 04 | 06 |
  66763. * +----+----+----+----+ +----+
  66764. * | 10 | 11 | 13 | | 16 |
  66765. * +----+----+----+----+----+----+----+
  66766. * | 20 | 21 | 23 | 24 | 26 |
  66767. * +----+----+----+----+----+----+----+
  66768. * ^--- empty ---^
  66769. *
  66770. * Will remove columns 2 and 5.
  66771. *
  66772. * **Note:** This is a low-level helper method for clearing invalid model state when doing table modifications.
  66773. * To remove a column from a table use {@link module:table/tableutils~TableUtils#removeColumns `TableUtils.removeColumns()`}.
  66774. *
  66775. * @protected
  66776. * @param {module:engine/model/element~Element} table
  66777. * @param {module:table/tableutils~TableUtils} tableUtils
  66778. * @returns {Boolean} True if removed some columns.
  66779. */
  66780. function removeEmptyColumns( table, tableUtils ) {
  66781. const width = tableUtils.getColumns( table );
  66782. const columnsMap = new Array( width ).fill( 0 );
  66783. for ( const { column } of new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table ) ) {
  66784. columnsMap[ column ]++;
  66785. }
  66786. const emptyColumns = columnsMap.reduce( ( result, cellsCount, column ) => {
  66787. return cellsCount ? result : [ ...result, column ];
  66788. }, [] );
  66789. if ( emptyColumns.length > 0 ) {
  66790. // Remove only last empty column because it will recurrently trigger removing empty rows.
  66791. const emptyColumn = emptyColumns[ emptyColumns.length - 1 ];
  66792. // @if CK_DEBUG_TABLE // console.log( `Removing empty column: ${ emptyColumn }.` );
  66793. tableUtils.removeColumns( table, { at: emptyColumn } );
  66794. return true;
  66795. }
  66796. return false;
  66797. }
  66798. /**
  66799. * Removes rows that have no cells anchored.
  66800. *
  66801. * In table below:
  66802. *
  66803. * +----+----+----+
  66804. * | 00 | 01 | 02 |
  66805. * +----+----+----+
  66806. * | 10 | 11 | 12 |
  66807. * + + + +
  66808. * | | | | <-- empty
  66809. * +----+----+----+
  66810. * | 30 | 31 | 32 |
  66811. * +----+----+----+
  66812. * | 40 | 42 |
  66813. * + + +
  66814. * | | | <-- empty
  66815. * +----+----+----+
  66816. * | 60 | 61 | 62 |
  66817. * +----+----+----+
  66818. *
  66819. * Will remove rows 2 and 5.
  66820. *
  66821. * **Note:** This is a low-level helper method for clearing invalid model state when doing table modifications.
  66822. * To remove a row from a table use {@link module:table/tableutils~TableUtils#removeRows `TableUtils.removeRows()`}.
  66823. *
  66824. * @protected
  66825. * @param {module:engine/model/element~Element} table
  66826. * @param {module:table/tableutils~TableUtils} tableUtils
  66827. * @returns {Boolean} True if removed some rows.
  66828. */
  66829. function removeEmptyRows( table, tableUtils ) {
  66830. const emptyRows = [];
  66831. for ( let rowIndex = 0; rowIndex < table.childCount; rowIndex++ ) {
  66832. const tableRow = table.getChild( rowIndex );
  66833. if ( tableRow.isEmpty ) {
  66834. emptyRows.push( rowIndex );
  66835. }
  66836. }
  66837. if ( emptyRows.length > 0 ) {
  66838. // Remove only last empty row because it will recurrently trigger removing empty columns.
  66839. const emptyRow = emptyRows[ emptyRows.length - 1 ];
  66840. // @if CK_DEBUG_TABLE // console.log( `Removing empty row: ${ emptyRow }.` );
  66841. tableUtils.removeRows( table, { at: emptyRow } );
  66842. return true;
  66843. }
  66844. return false;
  66845. }
  66846. /**
  66847. * Removes rows and columns that have no cells anchored.
  66848. *
  66849. * In table below:
  66850. *
  66851. * +----+----+----+----+
  66852. * | 00 | 02 |
  66853. * +----+----+ +
  66854. * | 10 | |
  66855. * +----+----+----+----+
  66856. * | 20 | 22 | 23 |
  66857. * + + + +
  66858. * | | | | <-- empty row
  66859. * +----+----+----+----+
  66860. * ^--- empty column
  66861. *
  66862. * Will remove row 3 and column 1.
  66863. *
  66864. * **Note:** This is a low-level helper method for clearing invalid model state when doing table modifications.
  66865. * To remove a rows from a table use {@link module:table/tableutils~TableUtils#removeRows `TableUtils.removeRows()`} and
  66866. * {@link module:table/tableutils~TableUtils#removeColumns `TableUtils.removeColumns()`} to remove a column.
  66867. *
  66868. * @protected
  66869. * @param {module:engine/model/element~Element} table
  66870. * @param {module:table/tableutils~TableUtils} tableUtils
  66871. */
  66872. function removeEmptyRowsColumns( table, tableUtils ) {
  66873. const removedColumns = removeEmptyColumns( table, tableUtils );
  66874. // If there was some columns removed then cleaning empty rows was already triggered.
  66875. if ( !removedColumns ) {
  66876. removeEmptyRows( table, tableUtils );
  66877. }
  66878. }
  66879. /**
  66880. * Returns adjusted last row index if selection covers part of a row with empty slots (spanned by other cells).
  66881. * The `dimensions.lastRow` is equal to last row index but selection might be bigger.
  66882. *
  66883. * This happens *only* on rectangular selection so we analyze a case like this:
  66884. *
  66885. * +---+---+---+---+
  66886. * 0 | a | b | c | d |
  66887. * + + +---+---+
  66888. * 1 | | e | f | g |
  66889. * + +---+ +---+
  66890. * 2 | | h | | i | <- last row, each cell has rowspan = 2,
  66891. * + + + + + so we need to return 3, not 2
  66892. * 3 | | | | |
  66893. * +---+---+---+---+
  66894. *
  66895. * @param {module:engine/model/element~Element} table
  66896. * @param {Object} dimensions
  66897. * @param {Number} dimensions.firstRow
  66898. * @param {Number} dimensions.firstColumn
  66899. * @param {Number} dimensions.lastRow
  66900. * @param {Number} dimensions.lastColumn
  66901. * @returns {Number} Adjusted last row index.
  66902. */
  66903. function adjustLastRowIndex( table, dimensions ) {
  66904. const lastRowMap = Array.from( new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table, {
  66905. startColumn: dimensions.firstColumn,
  66906. endColumn: dimensions.lastColumn,
  66907. row: dimensions.lastRow
  66908. } ) );
  66909. const everyCellHasSingleRowspan = lastRowMap.every( ( { cellHeight } ) => cellHeight === 1 );
  66910. // It is a "flat" row, so the last row index is OK.
  66911. if ( everyCellHasSingleRowspan ) {
  66912. return dimensions.lastRow;
  66913. }
  66914. // Otherwise get any cell's rowspan and adjust the last row index.
  66915. const rowspanAdjustment = lastRowMap[ 0 ].cellHeight - 1;
  66916. return dimensions.lastRow + rowspanAdjustment;
  66917. }
  66918. /**
  66919. * Returns adjusted last column index if selection covers part of a column with empty slots (spanned by other cells).
  66920. * The `dimensions.lastColumn` is equal to last column index but selection might be bigger.
  66921. *
  66922. * This happens *only* on rectangular selection so we analyze a case like this:
  66923. *
  66924. * 0 1 2 3
  66925. * +---+---+---+---+
  66926. * | a |
  66927. * +---+---+---+---+
  66928. * | b | c | d |
  66929. * +---+---+---+---+
  66930. * | e | f |
  66931. * +---+---+---+---+
  66932. * | g | h |
  66933. * +---+---+---+---+
  66934. * ^
  66935. * last column, each cell has colspan = 2, so we need to return 3, not 2
  66936. *
  66937. * @param {module:engine/model/element~Element} table
  66938. * @param {Object} dimensions
  66939. * @param {Number} dimensions.firstRow
  66940. * @param {Number} dimensions.firstColumn
  66941. * @param {Number} dimensions.lastRow
  66942. * @param {Number} dimensions.lastColumn
  66943. * @returns {Number} Adjusted last column index.
  66944. */
  66945. function adjustLastColumnIndex( table, dimensions ) {
  66946. const lastColumnMap = Array.from( new _tablewalker__WEBPACK_IMPORTED_MODULE_0__["default"]( table, {
  66947. startRow: dimensions.firstRow,
  66948. endRow: dimensions.lastRow,
  66949. column: dimensions.lastColumn
  66950. } ) );
  66951. const everyCellHasSingleColspan = lastColumnMap.every( ( { cellWidth } ) => cellWidth === 1 );
  66952. // It is a "flat" column, so the last column index is OK.
  66953. if ( everyCellHasSingleColspan ) {
  66954. return dimensions.lastColumn;
  66955. }
  66956. // Otherwise get any cell's colspan and adjust the last column index.
  66957. const colspanAdjustment = lastColumnMap[ 0 ].cellWidth - 1;
  66958. return dimensions.lastColumn + colspanAdjustment;
  66959. }
  66960. /***/ }),
  66961. /***/ "./node_modules/@ckeditor/ckeditor5-table/src/utils/ui/widget.js":
  66962. /*!***********************************************************************!*\
  66963. !*** ./node_modules/@ckeditor/ckeditor5-table/src/utils/ui/widget.js ***!
  66964. \***********************************************************************/
  66965. /*! exports provided: getSelectedTableWidget, getTableWidgetAncestor */
  66966. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  66967. "use strict";
  66968. __webpack_require__.r(__webpack_exports__);
  66969. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSelectedTableWidget", function() { return getSelectedTableWidget; });
  66970. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTableWidgetAncestor", function() { return getTableWidgetAncestor; });
  66971. /* harmony import */ var _ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-widget/src/utils */ "./node_modules/@ckeditor/ckeditor5-widget/src/utils.js");
  66972. /**
  66973. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  66974. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  66975. */
  66976. /**
  66977. * @module table/utils/ui/widget
  66978. */
  66979. /**
  66980. * Returns a table widget editing view element if one is selected.
  66981. *
  66982. * @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection} selection
  66983. * @returns {module:engine/view/element~Element|null}
  66984. */
  66985. function getSelectedTableWidget( selection ) {
  66986. const viewElement = selection.getSelectedElement();
  66987. if ( viewElement && isTableWidget( viewElement ) ) {
  66988. return viewElement;
  66989. }
  66990. return null;
  66991. }
  66992. /**
  66993. * Returns a table widget editing view element if one is among the selection's ancestors.
  66994. *
  66995. * @param {module:engine/view/selection~Selection|module:engine/view/documentselection~DocumentSelection} selection
  66996. * @returns {module:engine/view/element~Element|null}
  66997. */
  66998. function getTableWidgetAncestor( selection ) {
  66999. const parentTable = findAncestor( 'table', selection.getFirstPosition() );
  67000. if ( parentTable && isTableWidget( parentTable.parent ) ) {
  67001. return parentTable.parent;
  67002. }
  67003. return null;
  67004. }
  67005. // Checks if a given view element is a table widget.
  67006. //
  67007. // @param {module:engine/view/element~Element} viewElement
  67008. // @returns {Boolean}
  67009. function isTableWidget( viewElement ) {
  67010. return !!viewElement.getCustomProperty( 'table' ) && Object(_ckeditor_ckeditor5_widget_src_utils__WEBPACK_IMPORTED_MODULE_0__["isWidget"])( viewElement );
  67011. }
  67012. function findAncestor( parentName, positionOrElement ) {
  67013. let parent = positionOrElement.parent;
  67014. while ( parent ) {
  67015. if ( parent.name === parentName ) {
  67016. return parent;
  67017. }
  67018. parent = parent.parent;
  67019. }
  67020. }
  67021. /***/ }),
  67022. /***/ "./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-column.svg":
  67023. /*!*****************************************************************************!*\
  67024. !*** ./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-column.svg ***!
  67025. \*****************************************************************************/
  67026. /*! exports provided: default */
  67027. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67028. "use strict";
  67029. __webpack_require__.r(__webpack_exports__);
  67030. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z\" opacity=\".6\"/><path d=\"M18 7v1H2V7h16zm0 5v1H2v-1h16z\" opacity=\".6\"/><path d=\"M14 1v18a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V1a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1zm-2 1H8v4h4V2zm0 6H8v4h4V8zm0 6H8v4h4v-4z\"/></svg>");
  67031. /***/ }),
  67032. /***/ "./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-merge-cell.svg":
  67033. /*!*********************************************************************************!*\
  67034. !*** ./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-merge-cell.svg ***!
  67035. \*********************************************************************************/
  67036. /*! exports provided: default */
  67037. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67038. "use strict";
  67039. __webpack_require__.r(__webpack_exports__);
  67040. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z\" opacity=\".6\"/><path d=\"M7 2h1v16H7V2zm5 0h1v7h-1V2zm6 5v1H2V7h16zM8 12v1H2v-1h6z\" opacity=\".6\"/><path d=\"M7 7h12a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1zm1 2v9h10V9H8z\"/></svg>");
  67041. /***/ }),
  67042. /***/ "./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-row.svg":
  67043. /*!**************************************************************************!*\
  67044. !*** ./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-row.svg ***!
  67045. \**************************************************************************/
  67046. /*! exports provided: default */
  67047. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67048. "use strict";
  67049. __webpack_require__.r(__webpack_exports__);
  67050. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z\" opacity=\".6\"/><path d=\"M7 2h1v16H7V2zm5 0h1v16h-1V2z\" opacity=\".6\"/><path d=\"M1 6h18a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm1 2v4h4V8H2zm6 0v4h4V8H8zm6 0v4h4V8h-4z\"/></svg>");
  67051. /***/ }),
  67052. /***/ "./node_modules/@ckeditor/ckeditor5-table/theme/icons/table.svg":
  67053. /*!**********************************************************************!*\
  67054. !*** ./node_modules/@ckeditor/ckeditor5-table/theme/icons/table.svg ***!
  67055. \**********************************************************************/
  67056. /*! exports provided: default */
  67057. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67058. "use strict";
  67059. __webpack_require__.r(__webpack_exports__);
  67060. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M3 6v3h4V6H3zm0 4v3h4v-3H3zm0 4v3h4v-3H3zm5 3h4v-3H8v3zm5 0h4v-3h-4v3zm4-4v-3h-4v3h4zm0-4V6h-4v3h4zm1.5 8a1.5 1.5 0 0 1-1.5 1.5H3A1.5 1.5 0 0 1 1.5 17V4c.222-.863 1.068-1.5 2-1.5h13c.932 0 1.778.637 2 1.5v13zM12 13v-3H8v3h4zm0-4V6H8v3h4z\"/></svg>");
  67061. /***/ }),
  67062. /***/ "./node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css":
  67063. /*!**********************************************************************!*\
  67064. !*** ./node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css ***!
  67065. \**********************************************************************/
  67066. /*! no static exports found */
  67067. /***/ (function(module, exports, __webpack_require__) {
  67068. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  67069. var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./inserttable.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css");
  67070. content = content.__esModule ? content.default : content;
  67071. if (typeof content === 'string') {
  67072. content = [[module.i, content, '']];
  67073. }
  67074. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  67075. options.insert = "head";
  67076. options.singleton = true;
  67077. var update = api(content, options);
  67078. module.exports = content.locals || {};
  67079. /***/ }),
  67080. /***/ "./node_modules/@ckeditor/ckeditor5-table/theme/table.css":
  67081. /*!****************************************************************!*\
  67082. !*** ./node_modules/@ckeditor/ckeditor5-table/theme/table.css ***!
  67083. \****************************************************************/
  67084. /*! no static exports found */
  67085. /***/ (function(module, exports, __webpack_require__) {
  67086. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  67087. var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./table.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-table/theme/table.css");
  67088. content = content.__esModule ? content.default : content;
  67089. if (typeof content === 'string') {
  67090. content = [[module.i, content, '']];
  67091. }
  67092. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  67093. options.insert = "head";
  67094. options.singleton = true;
  67095. var update = api(content, options);
  67096. module.exports = content.locals || {};
  67097. /***/ }),
  67098. /***/ "./node_modules/@ckeditor/ckeditor5-table/theme/tableediting.css":
  67099. /*!***********************************************************************!*\
  67100. !*** ./node_modules/@ckeditor/ckeditor5-table/theme/tableediting.css ***!
  67101. \***********************************************************************/
  67102. /*! no static exports found */
  67103. /***/ (function(module, exports, __webpack_require__) {
  67104. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  67105. var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./tableediting.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-table/theme/tableediting.css");
  67106. content = content.__esModule ? content.default : content;
  67107. if (typeof content === 'string') {
  67108. content = [[module.i, content, '']];
  67109. }
  67110. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  67111. options.insert = "head";
  67112. options.singleton = true;
  67113. var update = api(content, options);
  67114. module.exports = content.locals || {};
  67115. /***/ }),
  67116. /***/ "./node_modules/@ckeditor/ckeditor5-table/theme/tableselection.css":
  67117. /*!*************************************************************************!*\
  67118. !*** ./node_modules/@ckeditor/ckeditor5-table/theme/tableselection.css ***!
  67119. \*************************************************************************/
  67120. /*! no static exports found */
  67121. /***/ (function(module, exports, __webpack_require__) {
  67122. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  67123. var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./tableselection.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-table/theme/tableselection.css");
  67124. content = content.__esModule ? content.default : content;
  67125. if (typeof content === 'string') {
  67126. content = [[module.i, content, '']];
  67127. }
  67128. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  67129. options.insert = "head";
  67130. options.singleton = true;
  67131. var update = api(content, options);
  67132. module.exports = content.locals || {};
  67133. /***/ }),
  67134. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/delete.js":
  67135. /*!***************************************************************!*\
  67136. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/delete.js ***!
  67137. \***************************************************************/
  67138. /*! exports provided: default */
  67139. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67140. "use strict";
  67141. __webpack_require__.r(__webpack_exports__);
  67142. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Delete; });
  67143. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  67144. /* harmony import */ var _deletecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./deletecommand */ "./node_modules/@ckeditor/ckeditor5-typing/src/deletecommand.js");
  67145. /* harmony import */ var _deleteobserver__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./deleteobserver */ "./node_modules/@ckeditor/ckeditor5-typing/src/deleteobserver.js");
  67146. /* harmony import */ var _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/env */ "./node_modules/@ckeditor/ckeditor5-utils/src/env.js");
  67147. /**
  67148. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  67149. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  67150. */
  67151. /**
  67152. * @module typing/delete
  67153. */
  67154. /**
  67155. * The delete and backspace feature. Handles the <kbd>Delete</kbd> and <kbd>Backspace</kbd> keys in the editor.
  67156. *
  67157. * @extends module:core/plugin~Plugin
  67158. */
  67159. class Delete extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  67160. /**
  67161. * @inheritDoc
  67162. */
  67163. static get pluginName() {
  67164. return 'Delete';
  67165. }
  67166. init() {
  67167. const editor = this.editor;
  67168. const view = editor.editing.view;
  67169. const viewDocument = view.document;
  67170. view.addObserver( _deleteobserver__WEBPACK_IMPORTED_MODULE_2__["default"] );
  67171. editor.commands.add( 'forwardDelete', new _deletecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, 'forward' ) );
  67172. editor.commands.add( 'delete', new _deletecommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, 'backward' ) );
  67173. this.listenTo( viewDocument, 'delete', ( evt, data ) => {
  67174. const deleteCommandParams = { unit: data.unit, sequence: data.sequence };
  67175. // If a specific (view) selection to remove was set, convert it to a model selection and set as a parameter for `DeleteCommand`.
  67176. if ( data.selectionToRemove ) {
  67177. const modelSelection = editor.model.createSelection();
  67178. const ranges = [];
  67179. for ( const viewRange of data.selectionToRemove.getRanges() ) {
  67180. ranges.push( editor.editing.mapper.toModelRange( viewRange ) );
  67181. }
  67182. modelSelection.setTo( ranges );
  67183. deleteCommandParams.selection = modelSelection;
  67184. }
  67185. editor.execute( data.direction == 'forward' ? 'forwardDelete' : 'delete', deleteCommandParams );
  67186. data.preventDefault();
  67187. view.scrollToTheSelection();
  67188. } );
  67189. // Android IMEs have a quirk - they change DOM selection after the input changes were performed by the browser.
  67190. // This happens on `keyup` event. Android doesn't know anything about our deletion and selection handling. Even if the selection
  67191. // was changed during input events, IME remembers the position where the selection "should" be placed and moves it there.
  67192. //
  67193. // To prevent incorrect selection, we save the selection after deleting here and then re-set it on `keyup`. This has to be done
  67194. // on DOM selection level, because on `keyup` the model selection is still the same as it was just after deletion, so it
  67195. // wouldn't be changed and the fix would do nothing.
  67196. //
  67197. if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_3__["default"].isAndroid ) {
  67198. let domSelectionAfterDeletion = null;
  67199. this.listenTo( viewDocument, 'delete', ( evt, data ) => {
  67200. const domSelection = data.domTarget.ownerDocument.defaultView.getSelection();
  67201. domSelectionAfterDeletion = {
  67202. anchorNode: domSelection.anchorNode,
  67203. anchorOffset: domSelection.anchorOffset,
  67204. focusNode: domSelection.focusNode,
  67205. focusOffset: domSelection.focusOffset
  67206. };
  67207. }, { priority: 'lowest' } );
  67208. this.listenTo( viewDocument, 'keyup', ( evt, data ) => {
  67209. if ( domSelectionAfterDeletion ) {
  67210. const domSelection = data.domTarget.ownerDocument.defaultView.getSelection();
  67211. domSelection.collapse( domSelectionAfterDeletion.anchorNode, domSelectionAfterDeletion.anchorOffset );
  67212. domSelection.extend( domSelectionAfterDeletion.focusNode, domSelectionAfterDeletion.focusOffset );
  67213. domSelectionAfterDeletion = null;
  67214. }
  67215. } );
  67216. }
  67217. }
  67218. }
  67219. /***/ }),
  67220. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/deletecommand.js":
  67221. /*!**********************************************************************!*\
  67222. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/deletecommand.js ***!
  67223. \**********************************************************************/
  67224. /*! exports provided: default */
  67225. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67226. "use strict";
  67227. __webpack_require__.r(__webpack_exports__);
  67228. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DeleteCommand; });
  67229. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  67230. /* harmony import */ var _ckeditor_ckeditor5_utils_src_count__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/count */ "./node_modules/@ckeditor/ckeditor5-utils/src/count.js");
  67231. /* harmony import */ var _utils_changebuffer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/changebuffer */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/changebuffer.js");
  67232. /**
  67233. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  67234. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  67235. */
  67236. /**
  67237. * @module typing/deletecommand
  67238. */
  67239. /**
  67240. * The delete command. Used by the {@link module:typing/delete~Delete delete feature} to handle the <kbd>Delete</kbd> and
  67241. * <kbd>Backspace</kbd> keys.
  67242. *
  67243. * @extends module:core/command~Command
  67244. */
  67245. class DeleteCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  67246. /**
  67247. * Creates an instance of the command.
  67248. *
  67249. * @param {module:core/editor/editor~Editor} editor
  67250. * @param {'forward'|'backward'} direction The directionality of the delete describing in what direction it
  67251. * should consume the content when the selection is collapsed.
  67252. */
  67253. constructor( editor, direction ) {
  67254. super( editor );
  67255. /**
  67256. * The directionality of the delete describing in what direction it should
  67257. * consume the content when the selection is collapsed.
  67258. *
  67259. * @readonly
  67260. * @member {'forward'|'backward'} #direction
  67261. */
  67262. this.direction = direction;
  67263. /**
  67264. * Delete's change buffer used to group subsequent changes into batches.
  67265. *
  67266. * @readonly
  67267. * @private
  67268. * @type {module:typing/utils/changebuffer~ChangeBuffer}
  67269. */
  67270. this._buffer = new _utils_changebuffer__WEBPACK_IMPORTED_MODULE_2__["default"]( editor.model, editor.config.get( 'typing.undoStep' ) );
  67271. }
  67272. /**
  67273. * The current change buffer.
  67274. *
  67275. * @type {module:typing/utils/changebuffer~ChangeBuffer}
  67276. */
  67277. get buffer() {
  67278. return this._buffer;
  67279. }
  67280. /**
  67281. * Executes the delete command. Depending on whether the selection is collapsed or not, deletes its content
  67282. * or a piece of content in the {@link #direction defined direction}.
  67283. *
  67284. * @fires execute
  67285. * @param {Object} [options] The command options.
  67286. * @param {'character'} [options.unit='character'] See {@link module:engine/model/utils/modifyselection~modifySelection}'s options.
  67287. * @param {Number} [options.sequence=1] A number describing which subsequent delete event it is without the key being released.
  67288. * See the {@link module:engine/view/document~Document#event:delete} event data.
  67289. * @param {module:engine/model/selection~Selection} [options.selection] Selection to remove. If not set, current model selection
  67290. * will be used.
  67291. */
  67292. execute( options = {} ) {
  67293. const model = this.editor.model;
  67294. const doc = model.document;
  67295. model.enqueueChange( this._buffer.batch, writer => {
  67296. this._buffer.lock();
  67297. const selection = writer.createSelection( options.selection || doc.selection );
  67298. // Do not replace the whole selected content if selection was collapsed.
  67299. // This prevents such situation:
  67300. //
  67301. // <h1></h1><p>[]</p> --> <h1>[</h1><p>]</p> --> <p></p>
  67302. // starting content --> after `modifySelection` --> after `deleteContent`.
  67303. const doNotResetEntireContent = selection.isCollapsed;
  67304. // Try to extend the selection in the specified direction.
  67305. if ( selection.isCollapsed ) {
  67306. model.modifySelection( selection, { direction: this.direction, unit: options.unit } );
  67307. }
  67308. // Check if deleting in an empty editor. See #61.
  67309. if ( this._shouldEntireContentBeReplacedWithParagraph( options.sequence || 1 ) ) {
  67310. this._replaceEntireContentWithParagraph( writer );
  67311. return;
  67312. }
  67313. // If selection is still collapsed, then there's nothing to delete.
  67314. if ( selection.isCollapsed ) {
  67315. return;
  67316. }
  67317. let changeCount = 0;
  67318. selection.getFirstRange().getMinimalFlatRanges().forEach( range => {
  67319. changeCount += Object(_ckeditor_ckeditor5_utils_src_count__WEBPACK_IMPORTED_MODULE_1__["default"])(
  67320. range.getWalker( { singleCharacters: true, ignoreElementEnd: true, shallow: true } )
  67321. );
  67322. } );
  67323. model.deleteContent( selection, {
  67324. doNotResetEntireContent,
  67325. direction: this.direction
  67326. } );
  67327. this._buffer.input( changeCount );
  67328. writer.setSelection( selection );
  67329. this._buffer.unlock();
  67330. } );
  67331. }
  67332. /**
  67333. * If the user keeps <kbd>Backspace</kbd> or <kbd>Delete</kbd> key pressed, the content of the current
  67334. * editable will be cleared. However, this will not yet lead to resetting the remaining block to a paragraph
  67335. * (which happens e.g. when the user does <kbd>Ctrl</kbd> + <kbd>A</kbd>, <kbd>Backspace</kbd>).
  67336. *
  67337. * But, if the user pressed the key in an empty editable for the first time,
  67338. * we want to replace the entire content with a paragraph if:
  67339. *
  67340. * * the current limit element is empty,
  67341. * * the paragraph is allowed in the limit element,
  67342. * * the limit doesn't already have a paragraph inside.
  67343. *
  67344. * See https://github.com/ckeditor/ckeditor5-typing/issues/61.
  67345. *
  67346. * @private
  67347. * @param {Number} sequence A number describing which subsequent delete event it is without the key being released.
  67348. * @returns {Boolean}
  67349. */
  67350. _shouldEntireContentBeReplacedWithParagraph( sequence ) {
  67351. // Does nothing if user pressed and held the "Backspace" or "Delete" key.
  67352. if ( sequence > 1 ) {
  67353. return false;
  67354. }
  67355. const model = this.editor.model;
  67356. const doc = model.document;
  67357. const selection = doc.selection;
  67358. const limitElement = model.schema.getLimitElement( selection );
  67359. // If a collapsed selection contains the whole content it means that the content is empty
  67360. // (from the user perspective).
  67361. const limitElementIsEmpty = selection.isCollapsed && selection.containsEntireContent( limitElement );
  67362. if ( !limitElementIsEmpty ) {
  67363. return false;
  67364. }
  67365. if ( !model.schema.checkChild( limitElement, 'paragraph' ) ) {
  67366. return false;
  67367. }
  67368. const limitElementFirstChild = limitElement.getChild( 0 );
  67369. // Does nothing if the limit element already contains only a paragraph.
  67370. // We ignore the case when paragraph might have some inline elements (<p><inlineWidget>[]</inlineWidget></p>)
  67371. // because we don't support such cases yet and it's unclear whether inlineWidget shouldn't be a limit itself.
  67372. if ( limitElementFirstChild && limitElementFirstChild.name === 'paragraph' ) {
  67373. return false;
  67374. }
  67375. return true;
  67376. }
  67377. /**
  67378. * The entire content is replaced with the paragraph. Selection is moved inside the paragraph.
  67379. *
  67380. * @private
  67381. */
  67382. _replaceEntireContentWithParagraph( writer ) {
  67383. const model = this.editor.model;
  67384. const doc = model.document;
  67385. const selection = doc.selection;
  67386. const limitElement = model.schema.getLimitElement( selection );
  67387. const paragraph = writer.createElement( 'paragraph' );
  67388. writer.remove( writer.createRangeIn( limitElement ) );
  67389. writer.insert( paragraph, limitElement );
  67390. writer.setSelection( paragraph, 0 );
  67391. }
  67392. }
  67393. /***/ }),
  67394. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/deleteobserver.js":
  67395. /*!***********************************************************************!*\
  67396. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/deleteobserver.js ***!
  67397. \***********************************************************************/
  67398. /*! exports provided: default */
  67399. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67400. "use strict";
  67401. __webpack_require__.r(__webpack_exports__);
  67402. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DeleteObserver; });
  67403. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_observer_observer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/observer/observer */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js");
  67404. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_observer_domeventdata__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/observer/domeventdata */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventdata.js");
  67405. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
  67406. /* harmony import */ var _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/env */ "./node_modules/@ckeditor/ckeditor5-utils/src/env.js");
  67407. /**
  67408. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  67409. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  67410. */
  67411. /**
  67412. * @module typing/deleteobserver
  67413. */
  67414. /**
  67415. * Delete observer introduces the {@link module:engine/view/document~Document#event:delete} event.
  67416. *
  67417. * @extends module:engine/view/observer/observer~Observer
  67418. */
  67419. class DeleteObserver extends _ckeditor_ckeditor5_engine_src_view_observer_observer__WEBPACK_IMPORTED_MODULE_0__["default"] {
  67420. constructor( view ) {
  67421. super( view );
  67422. const document = view.document;
  67423. let sequence = 0;
  67424. document.on( 'keyup', ( evt, data ) => {
  67425. if ( data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_2__["keyCodes"].delete || data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_2__["keyCodes"].backspace ) {
  67426. sequence = 0;
  67427. }
  67428. } );
  67429. document.on( 'keydown', ( evt, data ) => {
  67430. const deleteData = {};
  67431. if ( data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_2__["keyCodes"].delete ) {
  67432. deleteData.direction = 'forward';
  67433. deleteData.unit = 'character';
  67434. } else if ( data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_2__["keyCodes"].backspace ) {
  67435. deleteData.direction = 'backward';
  67436. deleteData.unit = 'codePoint';
  67437. } else {
  67438. return;
  67439. }
  67440. const hasWordModifier = _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_3__["default"].isMac ? data.altKey : data.ctrlKey;
  67441. deleteData.unit = hasWordModifier ? 'word' : deleteData.unit;
  67442. deleteData.sequence = ++sequence;
  67443. fireViewDeleteEvent( evt, data.domEvent, deleteData );
  67444. } );
  67445. // `beforeinput` is handled only for Android devices. Desktop Chrome and iOS are skipped because they are working fine now.
  67446. if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_3__["default"].isAndroid ) {
  67447. document.on( 'beforeinput', ( evt, data ) => {
  67448. // If event type is other than `deleteContentBackward` then this is not deleting.
  67449. if ( data.domEvent.inputType != 'deleteContentBackward' ) {
  67450. return;
  67451. }
  67452. const deleteData = {
  67453. unit: 'codepoint',
  67454. direction: 'backward',
  67455. sequence: 1
  67456. };
  67457. // Android IMEs may change the DOM selection on `beforeinput` event so that the selection contains all the text
  67458. // that the IME wants to remove. We will pass this information to `delete` event so proper part of the content is removed.
  67459. //
  67460. // Sometimes it is only expanding by a one character (in case of collapsed selection). In this case we don't need to
  67461. // set a different selection to remove, it will work just fine.
  67462. const domSelection = data.domTarget.ownerDocument.defaultView.getSelection();
  67463. if ( domSelection.anchorNode == domSelection.focusNode && domSelection.anchorOffset + 1 != domSelection.focusOffset ) {
  67464. deleteData.selectionToRemove = view.domConverter.domSelectionToView( domSelection );
  67465. }
  67466. fireViewDeleteEvent( evt, data.domEvent, deleteData );
  67467. } );
  67468. }
  67469. function fireViewDeleteEvent( originalEvent, domEvent, deleteData ) {
  67470. // Save the event object to check later if it was stopped or not.
  67471. let event;
  67472. document.once( 'delete', evt => ( event = evt ), { priority: Number.POSITIVE_INFINITY } );
  67473. document.fire( 'delete', new _ckeditor_ckeditor5_engine_src_view_observer_domeventdata__WEBPACK_IMPORTED_MODULE_1__["default"]( document, domEvent, deleteData ) );
  67474. // Stop the original event if `delete` event was stopped.
  67475. // https://github.com/ckeditor/ckeditor5/issues/753
  67476. if ( event && event.stop.called ) {
  67477. originalEvent.stop();
  67478. }
  67479. }
  67480. }
  67481. /**
  67482. * @inheritDoc
  67483. */
  67484. observe() {}
  67485. }
  67486. /**
  67487. * Event fired when the user tries to delete content (e.g. presses <kbd>Delete</kbd> or <kbd>Backspace</kbd>).
  67488. *
  67489. * Note: This event is fired by the {@link module:typing/deleteobserver~DeleteObserver observer}
  67490. * (usually registered by the {@link module:typing/delete~Delete delete feature}).
  67491. *
  67492. * @event module:engine/view/document~Document#event:delete
  67493. * @param {module:engine/view/observer/domeventdata~DomEventData} data
  67494. * @param {'forward'|'delete'} data.direction The direction in which the deletion should happen.
  67495. * @param {'character'|'word'} data.unit The "amount" of content that should be deleted.
  67496. * @param {Number} data.sequence A number describing which subsequent delete event it is without the key being released.
  67497. * If it's 2 or more it means that the key was pressed and hold.
  67498. * @param {module:engine/view/selection~Selection} [data.selectionToRemove] View selection which content should be removed. If not set,
  67499. * current selection should be used.
  67500. */
  67501. /***/ }),
  67502. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/input.js":
  67503. /*!**************************************************************!*\
  67504. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/input.js ***!
  67505. \**************************************************************/
  67506. /*! exports provided: default */
  67507. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67508. "use strict";
  67509. __webpack_require__.r(__webpack_exports__);
  67510. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Input; });
  67511. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  67512. /* harmony import */ var _inputcommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./inputcommand */ "./node_modules/@ckeditor/ckeditor5-typing/src/inputcommand.js");
  67513. /* harmony import */ var _utils_injectunsafekeystrokeshandling__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/injectunsafekeystrokeshandling */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/injectunsafekeystrokeshandling.js");
  67514. /* harmony import */ var _utils_injecttypingmutationshandling__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/injecttypingmutationshandling */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/injecttypingmutationshandling.js");
  67515. /**
  67516. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  67517. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  67518. */
  67519. /**
  67520. * @module typing/input
  67521. */
  67522. /**
  67523. * Handles text input coming from the keyboard or other input methods.
  67524. *
  67525. * @extends module:core/plugin~Plugin
  67526. */
  67527. class Input extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  67528. /**
  67529. * @inheritDoc
  67530. */
  67531. static get pluginName() {
  67532. return 'Input';
  67533. }
  67534. /**
  67535. * @inheritDoc
  67536. */
  67537. init() {
  67538. const editor = this.editor;
  67539. // TODO The above default configuration value should be defined using editor.config.define() once it's fixed.
  67540. const inputCommand = new _inputcommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor, editor.config.get( 'typing.undoStep' ) || 20 );
  67541. editor.commands.add( 'input', inputCommand );
  67542. Object(_utils_injectunsafekeystrokeshandling__WEBPACK_IMPORTED_MODULE_2__["default"])( editor );
  67543. Object(_utils_injecttypingmutationshandling__WEBPACK_IMPORTED_MODULE_3__["default"])( editor );
  67544. }
  67545. /**
  67546. * Checks batch if it is a result of user input - e.g. typing.
  67547. *
  67548. * const input = editor.plugins.get( 'Input' );
  67549. *
  67550. * editor.model.document.on( 'change:data', ( evt, batch ) => {
  67551. * if ( input.isInput( batch ) ) {
  67552. * console.log( 'The user typed something...' );
  67553. * }
  67554. * } );
  67555. *
  67556. * **Note:** This method checks if the batch was created using {@link module:typing/inputcommand~InputCommand 'input'}
  67557. * command as typing changes coming from user input are inserted to the document using that command.
  67558. *
  67559. * @param {module:engine/model/batch~Batch} batch A batch to check.
  67560. * @returns {Boolean}
  67561. */
  67562. isInput( batch ) {
  67563. const inputCommand = this.editor.commands.get( 'input' );
  67564. return inputCommand._batches.has( batch );
  67565. }
  67566. }
  67567. /***/ }),
  67568. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/inputcommand.js":
  67569. /*!*********************************************************************!*\
  67570. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/inputcommand.js ***!
  67571. \*********************************************************************/
  67572. /*! exports provided: default */
  67573. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67574. "use strict";
  67575. __webpack_require__.r(__webpack_exports__);
  67576. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InputCommand; });
  67577. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  67578. /* harmony import */ var _utils_changebuffer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/changebuffer */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/changebuffer.js");
  67579. /**
  67580. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  67581. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  67582. */
  67583. /**
  67584. * @module typing/inputcommand
  67585. */
  67586. /**
  67587. * The input command. Used by the {@link module:typing/input~Input input feature} to handle typing.
  67588. *
  67589. * @extends module:core/command~Command
  67590. */
  67591. class InputCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  67592. /**
  67593. * Creates an instance of the command.
  67594. *
  67595. * @param {module:core/editor/editor~Editor} editor
  67596. * @param {Number} undoStepSize The maximum number of atomic changes
  67597. * which can be contained in one batch in the command buffer.
  67598. */
  67599. constructor( editor, undoStepSize ) {
  67600. super( editor );
  67601. /**
  67602. * Typing's change buffer used to group subsequent changes into batches.
  67603. *
  67604. * @readonly
  67605. * @private
  67606. * @member {module:typing/utils/changebuffer~ChangeBuffer} #_buffer
  67607. */
  67608. this._buffer = new _utils_changebuffer__WEBPACK_IMPORTED_MODULE_1__["default"]( editor.model, undoStepSize );
  67609. /**
  67610. * Stores batches created by the input command. The batches are used to differentiate input batches from other batches using
  67611. * {@link module:typing/input~Input#isInput} method.
  67612. *
  67613. * @type {WeakSet<module:engine/model/batch~Batch>}
  67614. * @protected
  67615. */
  67616. this._batches = new WeakSet();
  67617. }
  67618. /**
  67619. * The current change buffer.
  67620. *
  67621. * @type {module:typing/utils/changebuffer~ChangeBuffer}
  67622. */
  67623. get buffer() {
  67624. return this._buffer;
  67625. }
  67626. /**
  67627. * @inheritDoc
  67628. */
  67629. destroy() {
  67630. super.destroy();
  67631. this._buffer.destroy();
  67632. }
  67633. /**
  67634. * Executes the input command. It replaces the content within the given range with the given text.
  67635. * Replacing is a two step process, first the content within the range is removed and then the new text is inserted
  67636. * at the beginning of the range (which after the removal is a collapsed range).
  67637. *
  67638. * @fires execute
  67639. * @param {Object} [options] The command options.
  67640. * @param {String} [options.text=''] The text to be inserted.
  67641. * @param {module:engine/model/range~Range} [options.range] The range in which the text is inserted. Defaults
  67642. * to the first range in the current selection.
  67643. * @param {module:engine/model/range~Range} [options.resultRange] The range where the selection
  67644. * should be placed after the insertion. If not specified, the selection will be placed right after
  67645. * the inserted text.
  67646. */
  67647. execute( options = {} ) {
  67648. const model = this.editor.model;
  67649. const doc = model.document;
  67650. const text = options.text || '';
  67651. const textInsertions = text.length;
  67652. const selection = options.range ? model.createSelection( options.range ) : doc.selection;
  67653. const resultRange = options.resultRange;
  67654. model.enqueueChange( this._buffer.batch, writer => {
  67655. this._buffer.lock();
  67656. // Store the batch as an 'input' batch for the Input.isInput( batch ) check.
  67657. this._batches.add( this._buffer.batch );
  67658. model.deleteContent( selection );
  67659. if ( text ) {
  67660. model.insertContent( writer.createText( text, doc.selection.getAttributes() ), selection );
  67661. }
  67662. if ( resultRange ) {
  67663. writer.setSelection( resultRange );
  67664. } else if ( !selection.is( 'documentSelection' ) ) {
  67665. writer.setSelection( selection );
  67666. }
  67667. this._buffer.unlock();
  67668. this._buffer.input( textInsertions );
  67669. } );
  67670. }
  67671. }
  67672. /***/ }),
  67673. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/texttransformation.js":
  67674. /*!***************************************************************************!*\
  67675. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/texttransformation.js ***!
  67676. \***************************************************************************/
  67677. /*! exports provided: default */
  67678. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  67679. "use strict";
  67680. __webpack_require__.r(__webpack_exports__);
  67681. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TextTransformation; });
  67682. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  67683. /* harmony import */ var _textwatcher__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./textwatcher */ "./node_modules/@ckeditor/ckeditor5-typing/src/textwatcher.js");
  67684. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  67685. /**
  67686. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  67687. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  67688. */
  67689. /**
  67690. * @module typing/texttransformation
  67691. */
  67692. // All named transformations.
  67693. const TRANSFORMATIONS = {
  67694. // Common symbols:
  67695. copyright: { from: '(c)', to: '©' },
  67696. registeredTrademark: { from: '(r)', to: '®' },
  67697. trademark: { from: '(tm)', to: '™' },
  67698. // Mathematical:
  67699. oneHalf: { from: '1/2', to: '½' },
  67700. oneThird: { from: '1/3', to: '⅓' },
  67701. twoThirds: { from: '2/3', to: '⅔' },
  67702. oneForth: { from: '1/4', to: '¼' },
  67703. threeQuarters: { from: '3/4', to: '¾' },
  67704. lessThanOrEqual: { from: '<=', to: '≤' },
  67705. greaterThanOrEqual: { from: '>=', to: '≥' },
  67706. notEqual: { from: '!=', to: '≠' },
  67707. arrowLeft: { from: '<-', to: '←' },
  67708. arrowRight: { from: '->', to: '→' },
  67709. // Typography:
  67710. horizontalEllipsis: { from: '...', to: '…' },
  67711. enDash: { from: /(^| )(--)( )$/, to: [ null, '–', null ] },
  67712. emDash: { from: /(^| )(---)( )$/, to: [ null, '—', null ] },
  67713. // Quotations:
  67714. // English, US
  67715. quotesPrimary: { from: buildQuotesRegExp( '"' ), to: [ null, '“', null, '”' ] },
  67716. quotesSecondary: { from: buildQuotesRegExp( '\'' ), to: [ null, '‘', null, '’' ] },
  67717. // English, UK
  67718. quotesPrimaryEnGb: { from: buildQuotesRegExp( '\'' ), to: [ null, '‘', null, '’' ] },
  67719. quotesSecondaryEnGb: { from: buildQuotesRegExp( '"' ), to: [ null, '“', null, '”' ] },
  67720. // Polish
  67721. quotesPrimaryPl: { from: buildQuotesRegExp( '"' ), to: [ null, '„', null, '”' ] },
  67722. quotesSecondaryPl: { from: buildQuotesRegExp( '\'' ), to: [ null, '‚', null, '’' ] }
  67723. };
  67724. // Transformation groups.
  67725. const TRANSFORMATION_GROUPS = {
  67726. symbols: [ 'copyright', 'registeredTrademark', 'trademark' ],
  67727. mathematical: [
  67728. 'oneHalf', 'oneThird', 'twoThirds', 'oneForth', 'threeQuarters',
  67729. 'lessThanOrEqual', 'greaterThanOrEqual', 'notEqual',
  67730. 'arrowLeft', 'arrowRight'
  67731. ],
  67732. typography: [ 'horizontalEllipsis', 'enDash', 'emDash' ],
  67733. quotes: [ 'quotesPrimary', 'quotesSecondary' ]
  67734. };
  67735. // A set of default transformations provided by the feature.
  67736. const DEFAULT_TRANSFORMATIONS = [
  67737. 'symbols',
  67738. 'mathematical',
  67739. 'typography',
  67740. 'quotes'
  67741. ];
  67742. /**
  67743. * The text transformation plugin.
  67744. *
  67745. * @extends module:core/plugin~Plugin
  67746. */
  67747. class TextTransformation extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  67748. /**
  67749. * @inheritDoc
  67750. */
  67751. static get pluginName() {
  67752. return 'TextTransformation';
  67753. }
  67754. /**
  67755. * @inheritDoc
  67756. */
  67757. constructor( editor ) {
  67758. super( editor );
  67759. editor.config.define( 'typing', {
  67760. transformations: {
  67761. include: DEFAULT_TRANSFORMATIONS
  67762. }
  67763. } );
  67764. }
  67765. /**
  67766. * @inheritDoc
  67767. */
  67768. init() {
  67769. const model = this.editor.model;
  67770. const modelSelection = model.document.selection;
  67771. modelSelection.on( 'change:range', () => {
  67772. // Disable plugin when selection is inside a code block.
  67773. this.isEnabled = !modelSelection.anchor.parent.is( 'element', 'codeBlock' );
  67774. } );
  67775. this._enableTransformationWatchers();
  67776. }
  67777. /**
  67778. * Create new TextWatcher listening to the editor for typing and selection events.
  67779. *
  67780. * @private
  67781. */
  67782. _enableTransformationWatchers() {
  67783. const editor = this.editor;
  67784. const model = editor.model;
  67785. const input = editor.plugins.get( 'Input' );
  67786. const normalizedTransformations = normalizeTransformations( editor.config.get( 'typing.transformations' ) );
  67787. const testCallback = text => {
  67788. for ( const normalizedTransformation of normalizedTransformations ) {
  67789. const from = normalizedTransformation.from;
  67790. const match = from.test( text );
  67791. if ( match ) {
  67792. return { normalizedTransformation };
  67793. }
  67794. }
  67795. };
  67796. const watcherCallback = ( evt, data ) => {
  67797. if ( !input.isInput( data.batch ) ) {
  67798. return;
  67799. }
  67800. const { from, to } = data.normalizedTransformation;
  67801. const matches = from.exec( data.text );
  67802. const replaces = to( matches.slice( 1 ) );
  67803. const matchedRange = data.range;
  67804. let changeIndex = matches.index;
  67805. model.enqueueChange( writer => {
  67806. for ( let i = 1; i < matches.length; i++ ) {
  67807. const match = matches[ i ];
  67808. const replaceWith = replaces[ i - 1 ];
  67809. if ( replaceWith == null ) {
  67810. changeIndex += match.length;
  67811. continue;
  67812. }
  67813. const replacePosition = matchedRange.start.getShiftedBy( changeIndex );
  67814. const replaceRange = model.createRange( replacePosition, replacePosition.getShiftedBy( match.length ) );
  67815. const attributes = getTextAttributesAfterPosition( replacePosition );
  67816. model.insertContent( writer.createText( replaceWith, attributes ), replaceRange );
  67817. changeIndex += replaceWith.length;
  67818. }
  67819. } );
  67820. };
  67821. const watcher = new _textwatcher__WEBPACK_IMPORTED_MODULE_1__["default"]( editor.model, testCallback );
  67822. watcher.on( 'matched:data', watcherCallback );
  67823. watcher.bind( 'isEnabled' ).to( this );
  67824. }
  67825. }
  67826. // Normalizes the configuration `from` parameter value.
  67827. // The normalized value for the `from` parameter is a RegExp instance. If the passed `from` is already a RegExp instance,
  67828. // it is returned unchanged.
  67829. //
  67830. // @param {String|RegExp} from
  67831. // @returns {RegExp}
  67832. function normalizeFrom( from ) {
  67833. if ( typeof from == 'string' ) {
  67834. return new RegExp( `(${ Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["escapeRegExp"])( from ) })$` );
  67835. }
  67836. // `from` is already a regular expression.
  67837. return from;
  67838. }
  67839. // Normalizes the configuration `to` parameter value.
  67840. // The normalized value for the `to` parameter is a function that takes an array and returns an array. See more in the
  67841. // configuration description. If the passed `to` is already a function, it is returned unchanged.
  67842. //
  67843. // @param {String|Array.<null|String>|Function} to
  67844. // @returns {Function}
  67845. function normalizeTo( to ) {
  67846. if ( typeof to == 'string' ) {
  67847. return () => [ to ];
  67848. } else if ( to instanceof Array ) {
  67849. return () => to;
  67850. }
  67851. // `to` is already a function.
  67852. return to;
  67853. }
  67854. // For given `position` returns attributes for the text that is after that position.
  67855. // The text can be in the same text node as the position (`foo[]bar`) or in the next text node (`foo[]<$text bold="true">bar</$text>`).
  67856. //
  67857. // @param {module:engine/model/position~Position} position
  67858. // @returns {Iterable.<*>}
  67859. function getTextAttributesAfterPosition( position ) {
  67860. const textNode = position.textNode ? position.textNode : position.nodeAfter;
  67861. return textNode.getAttributes();
  67862. }
  67863. // Returns a RegExp pattern string that detects a sentence inside a quote.
  67864. //
  67865. // @param {String} quoteCharacter The character to create a pattern for.
  67866. // @returns {String}
  67867. function buildQuotesRegExp( quoteCharacter ) {
  67868. return new RegExp( `(^|\\s)(${ quoteCharacter })([^${ quoteCharacter }]*)(${ quoteCharacter })$` );
  67869. }
  67870. // Reads text transformation config and returns normalized array of transformations objects.
  67871. //
  67872. // @param {module:typing/texttransformation~TextTransformationDescription} config
  67873. // @returns {Array.<{from:String,to:Function}>}
  67874. function normalizeTransformations( config ) {
  67875. const extra = config.extra || [];
  67876. const remove = config.remove || [];
  67877. const isNotRemoved = transformation => !remove.includes( transformation );
  67878. const configured = config.include.concat( extra ).filter( isNotRemoved );
  67879. return expandGroupsAndRemoveDuplicates( configured )
  67880. .filter( isNotRemoved ) // Filter out 'remove' transformations as they might be set in group
  67881. .map( transformation => TRANSFORMATIONS[ transformation ] || transformation )
  67882. .map( transformation => ( {
  67883. from: normalizeFrom( transformation.from ),
  67884. to: normalizeTo( transformation.to )
  67885. } ) );
  67886. }
  67887. // Reads definitions and expands named groups if needed to transformation names.
  67888. // This method also removes duplicated named transformations if any.
  67889. //
  67890. // @param {Array.<String|Object>} definitions
  67891. // @returns {Array.<String|Object>}
  67892. function expandGroupsAndRemoveDuplicates( definitions ) {
  67893. // Set is using to make sure that transformation names are not duplicated.
  67894. const definedTransformations = new Set();
  67895. for ( const transformationOrGroup of definitions ) {
  67896. if ( TRANSFORMATION_GROUPS[ transformationOrGroup ] ) {
  67897. for ( const transformation of TRANSFORMATION_GROUPS[ transformationOrGroup ] ) {
  67898. definedTransformations.add( transformation );
  67899. }
  67900. } else {
  67901. definedTransformations.add( transformationOrGroup );
  67902. }
  67903. }
  67904. return Array.from( definedTransformations );
  67905. }
  67906. /**
  67907. * The text transformation definition object. It describes what should be replaced with what.
  67908. *
  67909. * The input value (`from`) can be passed either as a string or as a regular expression.
  67910. *
  67911. * * If a string is passed, it will be simply checked if the end of the input matches it.
  67912. * * If a regular expression is passed, its entire length must be covered with capturing groups (e.g. `/(foo)(bar)$/`).
  67913. * Also, since it is compared against the end of the input, it has to end with `$` to be correctly matched.
  67914. * See examples below.
  67915. *
  67916. * The output value (`to`) can be passed as a string, as an array or as a function.
  67917. *
  67918. * * If a string is passed, it will be used as a replacement value as-is. Note that a string output value can be used only if
  67919. * the input value is a string, too.
  67920. * * If an array is passed, it has to have the same number of elements as there are capturing groups in the input value regular expression.
  67921. * Each capture group will be replaced with a corresponding string from the passed array. If a given capturing group should not be replaced,
  67922. * use `null` instead of passing a string.
  67923. * * If a function is used, it should return an array as described above. The function is passed one parameter &mdash; an array with matches
  67924. * by the regular expression. See the examples below.
  67925. *
  67926. * A simple string-to-string replacement:
  67927. *
  67928. * { from: '(c)', to: '©' }
  67929. *
  67930. * Change quote styles using a regular expression. Note how all the parts are in separate capturing groups and the space at the beginning
  67931. * and the text inside quotes are not replaced (`null` passed as the first and the third value in the `to` parameter):
  67932. *
  67933. * {
  67934. * from: /(^|\s)(")([^"]*)(")$/,
  67935. * to: [ null, '“', null, '”' ]
  67936. * }
  67937. *
  67938. * Automatic uppercase after a dot using a callback:
  67939. *
  67940. * {
  67941. * from: /(\. )([a-z])$/,
  67942. * to: matches => [ null, matches[ 1 ].toUpperCase() ]
  67943. * }
  67944. *
  67945. * @typedef {Object} module:typing/texttransformation~TextTransformationDescription
  67946. * @property {String|RegExp} from The string or regular expression to transform.
  67947. * @property {String} to The text to transform compatible with `String.replace()`.
  67948. */
  67949. /**
  67950. * The configuration of the {@link module:typing/texttransformation~TextTransformation} feature.
  67951. *
  67952. * Read more in {@link module:typing/texttransformation~TextTransformationConfig}.
  67953. *
  67954. * @member {module:typing/texttransformation~TextTransformationConfig} module:typing/typing~TypingConfig#transformations
  67955. */
  67956. /**
  67957. * The configuration of the text transformation feature.
  67958. *
  67959. * ClassicEditor
  67960. * .create( editorElement, {
  67961. * typing: {
  67962. * transformations: ... // Text transformation feature options.
  67963. * }
  67964. * } )
  67965. * .then( ... )
  67966. * .catch( ... );
  67967. *
  67968. * By default, the feature comes pre-configured
  67969. * (via {@link module:typing/texttransformation~TextTransformationConfig#include `config.typing.transformations.include`}) with the
  67970. * following groups of transformations:
  67971. *
  67972. * * Typography (group name: `typography`)
  67973. * - `ellipsis`: transforms `...` to `…`
  67974. * - `enDash`: transforms ` -- ` to ` – `
  67975. * - `emDash`: transforms ` --- ` to ` — `
  67976. * * Quotations (group name: `quotes`)
  67977. * - `quotesPrimary`: transforms `"Foo bar"` to `“Foo bar”`
  67978. * - `quotesSecondary`: transforms `'Foo bar'` to `‘Foo bar’`
  67979. * * Symbols (group name: `symbols`)
  67980. * - `trademark`: transforms `(tm)` to `™`
  67981. * - `registeredTrademark`: transforms `(r)` to `®`
  67982. * - `copyright`: transforms `(c)` to `©`
  67983. * * Mathematical (group name: `mathematical`)
  67984. * - `oneHalf`: transforms `1/2` to: `½`
  67985. * - `oneThird`: transforms `1/3` to: `⅓`
  67986. * - `twoThirds`: transforms `2/3` to: `⅔`
  67987. * - `oneForth`: transforms `1/4` to: `¼`
  67988. * - `threeQuarters`: transforms `3/4` to: `¾`
  67989. * - `lessThanOrEqual`: transforms `<=` to: `≤`
  67990. * - `greaterThanOrEqual`: transforms `>=` to: `≥`
  67991. * - `notEqual`: transforms `!=` to: `≠`
  67992. * - `arrowLeft`: transforms `<-` to: `←`
  67993. * - `arrowRight`: transforms `->` to: `→`
  67994. * * Misc:
  67995. * - `quotesPrimaryEnGb`: transforms `'Foo bar'` to `‘Foo bar’`
  67996. * - `quotesSecondaryEnGb`: transforms `"Foo bar"` to `“Foo bar”`
  67997. * - `quotesPrimaryPl`: transforms `"Foo bar"` to `„Foo bar”`
  67998. * - `quotesSecondaryPl`: transforms `'Foo bar'` to `‚Foo bar’`
  67999. *
  68000. * In order to load additional transformations, use the
  68001. * {@link module:typing/texttransformation~TextTransformationConfig#extra `transformations.extra` option}.
  68002. *
  68003. * In order to narrow down the list of transformations, use the
  68004. * {@link module:typing/texttransformation~TextTransformationConfig#remove `transformations.remove` option}.
  68005. *
  68006. * In order to completely override the supported transformations, use the
  68007. * {@link module:typing/texttransformation~TextTransformationConfig#include `transformations.include` option}.
  68008. *
  68009. * Examples:
  68010. *
  68011. * const transformationsConfig = {
  68012. * include: [
  68013. * // Use only the 'quotes' and 'typography' groups.
  68014. * 'quotes',
  68015. * 'typography',
  68016. *
  68017. * // Plus, some custom transformation.
  68018. * { from: 'CKE', to: 'CKEditor' }
  68019. * ]
  68020. * };
  68021. *
  68022. * const transformationsConfig = {
  68023. * // Remove the 'ellipsis' transformation loaded by the 'typography' group.
  68024. * remove: [ 'ellipsis' ]
  68025. * }
  68026. *
  68027. * @interface TextTransformationConfig
  68028. */
  68029. /* eslint-disable max-len */
  68030. /**
  68031. * The standard list of text transformations supported by the editor. By default it comes pre-configured with a couple dozen of them
  68032. * (see {@link module:typing/texttransformation~TextTransformationConfig} for the full list). You can override this list completely
  68033. * by setting this option or use the other two options
  68034. * ({@link module:typing/texttransformation~TextTransformationConfig#extra `transformations.extra`},
  68035. * {@link module:typing/texttransformation~TextTransformationConfig#remove `transformations.remove`}) to fine-tune the default list.
  68036. *
  68037. * @member {Array.<module:typing/texttransformation~TextTransformationDescription>} module:typing/texttransformation~TextTransformationConfig#include
  68038. */
  68039. /**
  68040. * Additional text transformations that are added to the transformations defined in
  68041. * {@link module:typing/texttransformation~TextTransformationConfig#include `transformations.include`}.
  68042. *
  68043. * const transformationsConfig = {
  68044. * extra: [
  68045. * { from: 'CKE', to: 'CKEditor' }
  68046. * ]
  68047. * };
  68048. *
  68049. * @member {Array.<module:typing/texttransformation~TextTransformationDescription>} module:typing/texttransformation~TextTransformationConfig#extra
  68050. */
  68051. /**
  68052. * The text transformation names that are removed from transformations defined in
  68053. * {@link module:typing/texttransformation~TextTransformationConfig#include `transformations.include`} or
  68054. * {@link module:typing/texttransformation~TextTransformationConfig#extra `transformations.extra`}.
  68055. *
  68056. * const transformationsConfig = {
  68057. * remove: [
  68058. * 'ellipsis', // Remove only 'ellipsis' from the 'typography' group.
  68059. * 'mathematical' // Remove all transformations from the 'mathematical' group.
  68060. * ]
  68061. * }
  68062. *
  68063. * @member {Array.<module:typing/texttransformation~TextTransformationDescription>} module:typing/texttransformation~TextTransformationConfig#remove
  68064. */
  68065. /* eslint-enable max-len */
  68066. /***/ }),
  68067. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/textwatcher.js":
  68068. /*!********************************************************************!*\
  68069. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/textwatcher.js ***!
  68070. \********************************************************************/
  68071. /*! exports provided: default */
  68072. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  68073. "use strict";
  68074. __webpack_require__.r(__webpack_exports__);
  68075. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TextWatcher; });
  68076. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  68077. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  68078. /* harmony import */ var _utils_getlasttextline__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/getlasttextline */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/getlasttextline.js");
  68079. /**
  68080. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  68081. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  68082. */
  68083. /**
  68084. * @module typing/textwatcher
  68085. */
  68086. /**
  68087. * The text watcher feature.
  68088. *
  68089. * Fires the {@link module:typing/textwatcher~TextWatcher#event:matched:data `matched:data`},
  68090. * {@link module:typing/textwatcher~TextWatcher#event:matched:selection `matched:selection`} and
  68091. * {@link module:typing/textwatcher~TextWatcher#event:unmatched `unmatched`} events on typing or selection changes.
  68092. *
  68093. * @private
  68094. * @mixes module:utils/observablemixin~ObservableMixin
  68095. */
  68096. class TextWatcher {
  68097. /**
  68098. * Creates a text watcher instance.
  68099. *
  68100. * @param {module:engine/model/model~Model} model
  68101. * @param {Function} testCallback See {@link module:typing/textwatcher~TextWatcher#testCallback}.
  68102. */
  68103. constructor( model, testCallback ) {
  68104. /**
  68105. * The editor's model.
  68106. *
  68107. * @readonly
  68108. * @member {module:engine/model/model~Model}
  68109. */
  68110. this.model = model;
  68111. /**
  68112. * The function used to match the text.
  68113. *
  68114. * The test callback can return 3 values:
  68115. *
  68116. * * `false` if there is no match,
  68117. * * `true` if there is a match,
  68118. * * an object if there is a match and we want to pass some additional information to the {@link #event:matched:data} event.
  68119. *
  68120. * @member {Function} #testCallback
  68121. * @returns {Object} testResult
  68122. */
  68123. this.testCallback = testCallback;
  68124. /**
  68125. * Whether there is a match currently.
  68126. *
  68127. * @readonly
  68128. * @member {Boolean}
  68129. */
  68130. this.hasMatch = false;
  68131. /**
  68132. * Flag indicating whether the `TextWatcher` instance is enabled or disabled.
  68133. * A disabled TextWatcher will not evaluate text.
  68134. *
  68135. * To disable TextWatcher:
  68136. *
  68137. * const watcher = new TextWatcher( editor.model, testCallback );
  68138. *
  68139. * // After this a testCallback will not be called.
  68140. * watcher.isEnabled = false;
  68141. *
  68142. * @observable
  68143. * @member {Boolean} #isEnabled
  68144. */
  68145. this.set( 'isEnabled', true );
  68146. // Toggle text watching on isEnabled state change.
  68147. this.on( 'change:isEnabled', () => {
  68148. if ( this.isEnabled ) {
  68149. this._startListening();
  68150. } else {
  68151. this.stopListening( model.document.selection );
  68152. this.stopListening( model.document );
  68153. }
  68154. } );
  68155. this._startListening();
  68156. }
  68157. /**
  68158. * Starts listening to the editor for typing and selection events.
  68159. *
  68160. * @private
  68161. */
  68162. _startListening() {
  68163. const model = this.model;
  68164. const document = model.document;
  68165. this.listenTo( document.selection, 'change:range', ( evt, { directChange } ) => {
  68166. // Indirect changes (i.e. when the user types or external changes are applied) are handled in the document's change event.
  68167. if ( !directChange ) {
  68168. return;
  68169. }
  68170. // Act only on collapsed selection.
  68171. if ( !document.selection.isCollapsed ) {
  68172. if ( this.hasMatch ) {
  68173. this.fire( 'unmatched' );
  68174. this.hasMatch = false;
  68175. }
  68176. return;
  68177. }
  68178. this._evaluateTextBeforeSelection( 'selection' );
  68179. } );
  68180. this.listenTo( document, 'change:data', ( evt, batch ) => {
  68181. if ( batch.type == 'transparent' ) {
  68182. return;
  68183. }
  68184. this._evaluateTextBeforeSelection( 'data', { batch } );
  68185. } );
  68186. }
  68187. /**
  68188. * Checks the editor content for matched text.
  68189. *
  68190. * @fires matched:data
  68191. * @fires matched:selection
  68192. * @fires unmatched
  68193. *
  68194. * @private
  68195. * @param {'data'|'selection'} suffix A suffix used for generating the event name.
  68196. * @param {Object} data Data object for event.
  68197. */
  68198. _evaluateTextBeforeSelection( suffix, data = {} ) {
  68199. const model = this.model;
  68200. const document = model.document;
  68201. const selection = document.selection;
  68202. const rangeBeforeSelection = model.createRange( model.createPositionAt( selection.focus.parent, 0 ), selection.focus );
  68203. const { text, range } = Object(_utils_getlasttextline__WEBPACK_IMPORTED_MODULE_2__["default"])( rangeBeforeSelection, model );
  68204. const testResult = this.testCallback( text );
  68205. if ( !testResult && this.hasMatch ) {
  68206. this.fire( 'unmatched' );
  68207. }
  68208. this.hasMatch = !!testResult;
  68209. if ( testResult ) {
  68210. const eventData = Object.assign( data, { text, range } );
  68211. // If the test callback returns an object with additional data, assign the data as well.
  68212. if ( typeof testResult == 'object' ) {
  68213. Object.assign( eventData, testResult );
  68214. }
  68215. this.fire( `matched:${ suffix }`, eventData );
  68216. }
  68217. }
  68218. }
  68219. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_0__["default"])( TextWatcher, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  68220. /**
  68221. * Fired whenever the text watcher found a match for data changes.
  68222. *
  68223. * @event matched:data
  68224. * @param {Object} data Event data.
  68225. * @param {String} data.text The full text before selection to which the regexp was applied.
  68226. * @param {module:engine/model/range~Range} data.range The range representing the position of the `data.text`.
  68227. * @param {Object} [data.testResult] The additional data returned from the {@link module:typing/textwatcher~TextWatcher#testCallback}.
  68228. */
  68229. /**
  68230. * Fired whenever the text watcher found a match for selection changes.
  68231. *
  68232. * @event matched:selection
  68233. * @param {Object} data Event data.
  68234. * @param {String} data.text The full text before selection.
  68235. * @param {module:engine/model/range~Range} data.range The range representing the position of the `data.text`.
  68236. * @param {Object} [data.testResult] The additional data returned from the {@link module:typing/textwatcher~TextWatcher#testCallback}.
  68237. */
  68238. /**
  68239. * Fired whenever the text does not match anymore. Fired only when the text watcher found a match.
  68240. *
  68241. * @event unmatched
  68242. */
  68243. /***/ }),
  68244. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/twostepcaretmovement.js":
  68245. /*!*****************************************************************************!*\
  68246. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/twostepcaretmovement.js ***!
  68247. \*****************************************************************************/
  68248. /*! exports provided: default */
  68249. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  68250. "use strict";
  68251. __webpack_require__.r(__webpack_exports__);
  68252. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TwoStepCaretMovement; });
  68253. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  68254. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
  68255. /* harmony import */ var _ckeditor_ckeditor5_utils_src_priorities__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/priorities */ "./node_modules/@ckeditor/ckeditor5-utils/src/priorities.js");
  68256. /**
  68257. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  68258. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  68259. */
  68260. /**
  68261. * @module typing/twostepcaretmovement
  68262. */
  68263. /**
  68264. * This plugin enables the two-step caret (phantom) movement behavior for
  68265. * {@link module:typing/twostepcaretmovement~TwoStepCaretMovement#registerAttribute registered attributes}
  68266. * on arrow right (<kbd>→</kbd>) and left (<kbd>←</kbd>) key press.
  68267. *
  68268. * Thanks to this (phantom) caret movement the user is able to type before/after as well as at the
  68269. * beginning/end of an attribute.
  68270. *
  68271. * **Note:** This plugin support right–to–left (Arabic, Hebrew, etc.) content by mirroring its behavior
  68272. * but for the sake of simplicity examples showcase only left–to–right use–cases.
  68273. *
  68274. * # Forward movement
  68275. *
  68276. * ## "Entering" an attribute:
  68277. *
  68278. * When this plugin is enabled and registered for the `a` attribute and the selection is right before it
  68279. * (at the attribute boundary), pressing the right arrow key will not move the selection but update its
  68280. * attributes accordingly:
  68281. *
  68282. * * When enabled:
  68283. *
  68284. * foo{}<$text a="true">bar</$text>
  68285. *
  68286. * <kbd>→</kbd>
  68287. *
  68288. * foo<$text a="true">{}bar</$text>
  68289. *
  68290. * * When disabled:
  68291. *
  68292. * foo{}<$text a="true">bar</$text>
  68293. *
  68294. * <kbd>→</kbd>
  68295. *
  68296. * foo<$text a="true">b{}ar</$text>
  68297. *
  68298. *
  68299. * ## "Leaving" an attribute:
  68300. *
  68301. * * When enabled:
  68302. *
  68303. * <$text a="true">bar{}</$text>baz
  68304. *
  68305. * <kbd>→</kbd>
  68306. *
  68307. * <$text a="true">bar</$text>{}baz
  68308. *
  68309. * * When disabled:
  68310. *
  68311. * <$text a="true">bar{}</$text>baz
  68312. *
  68313. * <kbd>→</kbd>
  68314. *
  68315. * <$text a="true">bar</$text>b{}az
  68316. *
  68317. * # Backward movement
  68318. *
  68319. * * When enabled:
  68320. *
  68321. * <$text a="true">bar</$text>{}baz
  68322. *
  68323. * <kbd>←</kbd>
  68324. *
  68325. * <$text a="true">bar{}</$text>baz
  68326. *
  68327. * * When disabled:
  68328. *
  68329. * <$text a="true">bar</$text>{}baz
  68330. *
  68331. * <kbd>←</kbd>
  68332. *
  68333. * <$text a="true">ba{}r</$text>b{}az
  68334. *
  68335. * # Multiple attributes
  68336. *
  68337. * * When enabled and many attributes starts or ends at the same position:
  68338. *
  68339. * <$text a="true" b="true">bar</$text>{}baz
  68340. *
  68341. * <kbd>←</kbd>
  68342. *
  68343. * <$text a="true" b="true">bar{}</$text>baz
  68344. *
  68345. * * When enabled and one procedes another:
  68346. *
  68347. * <$text a="true">bar</$text><$text b="true">{}bar</$text>
  68348. *
  68349. * <kbd>←</kbd>
  68350. *
  68351. * <$text a="true">bar{}</$text><$text b="true">bar</$text>
  68352. *
  68353. */
  68354. class TwoStepCaretMovement extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  68355. /**
  68356. * @inheritDoc
  68357. */
  68358. static get pluginName() {
  68359. return 'TwoStepCaretMovement';
  68360. }
  68361. /**
  68362. * @inheritDoc
  68363. */
  68364. constructor( editor ) {
  68365. super( editor );
  68366. /**
  68367. * A set of attributes to handle.
  68368. *
  68369. * @protected
  68370. * @property {module:typing/twostepcaretmovement~TwoStepCaretMovement}
  68371. */
  68372. this.attributes = new Set();
  68373. /**
  68374. * The current UID of the overridden gravity, as returned by
  68375. * {@link module:engine/model/writer~Writer#overrideSelectionGravity}.
  68376. *
  68377. * @private
  68378. * @member {String}
  68379. */
  68380. this._overrideUid = null;
  68381. }
  68382. /**
  68383. * @inheritDoc
  68384. */
  68385. init() {
  68386. const editor = this.editor;
  68387. const model = editor.model;
  68388. const view = editor.editing.view;
  68389. const locale = editor.locale;
  68390. const modelSelection = model.document.selection;
  68391. // Listen to keyboard events and handle the caret movement according to the 2-step caret logic.
  68392. //
  68393. // Note: This listener has the "high+1" priority:
  68394. // * "high" because of the filler logic implemented in the renderer which also engages on #keydown.
  68395. // When the gravity is overridden the attributes of the (model) selection attributes are reset.
  68396. // It may end up with the filler kicking in and breaking the selection.
  68397. // * "+1" because we would like to avoid collisions with other features (like Widgets), which
  68398. // take over the keydown events with the "high" priority. Two-step caret movement takes precedence
  68399. // over Widgets in that matter.
  68400. //
  68401. // Find out more in https://github.com/ckeditor/ckeditor5-engine/issues/1301.
  68402. this.listenTo( view.document, 'keydown', ( evt, data ) => {
  68403. // This implementation works only for collapsed selection.
  68404. if ( !modelSelection.isCollapsed ) {
  68405. return;
  68406. }
  68407. // When user tries to expand the selection or jump over the whole word or to the beginning/end then
  68408. // two-steps movement is not necessary.
  68409. if ( data.shiftKey || data.altKey || data.ctrlKey ) {
  68410. return;
  68411. }
  68412. const arrowRightPressed = data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_1__["keyCodes"].arrowright;
  68413. const arrowLeftPressed = data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_1__["keyCodes"].arrowleft;
  68414. // When neither left or right arrow has been pressed then do noting.
  68415. if ( !arrowRightPressed && !arrowLeftPressed ) {
  68416. return;
  68417. }
  68418. const contentDirection = locale.contentLanguageDirection;
  68419. let isMovementHandled = false;
  68420. if ( ( contentDirection === 'ltr' && arrowRightPressed ) || ( contentDirection === 'rtl' && arrowLeftPressed ) ) {
  68421. isMovementHandled = this._handleForwardMovement( data );
  68422. } else {
  68423. isMovementHandled = this._handleBackwardMovement( data );
  68424. }
  68425. // Stop the keydown event if the two-step caret movement handled it. Avoid collisions
  68426. // with other features which may also take over the caret movement (e.g. Widget).
  68427. if ( isMovementHandled === true ) {
  68428. evt.stop();
  68429. }
  68430. }, { priority: _ckeditor_ckeditor5_utils_src_priorities__WEBPACK_IMPORTED_MODULE_2__["default"].get( 'high' ) + 1 } );
  68431. /**
  68432. * A flag indicating that the automatic gravity restoration should not happen upon the next
  68433. * gravity restoration.
  68434. * {@link module:engine/model/selection~Selection#event:change:range} event.
  68435. *
  68436. * @private
  68437. * @member {String}
  68438. */
  68439. this._isNextGravityRestorationSkipped = false;
  68440. // The automatic gravity restoration logic.
  68441. this.listenTo( modelSelection, 'change:range', ( evt, data ) => {
  68442. // Skipping the automatic restoration is needed if the selection should change
  68443. // but the gravity must remain overridden afterwards. See the #handleBackwardMovement
  68444. // to learn more.
  68445. if ( this._isNextGravityRestorationSkipped ) {
  68446. this._isNextGravityRestorationSkipped = false;
  68447. return;
  68448. }
  68449. // Skip automatic restore when the gravity is not overridden — simply, there's nothing to restore
  68450. // at this moment.
  68451. if ( !this._isGravityOverridden ) {
  68452. return;
  68453. }
  68454. // Skip automatic restore when the change is indirect AND the selection is at the attribute boundary.
  68455. // It means that e.g. if the change was external (collaboration) and the user had their
  68456. // selection around the link, its gravity should remain intact in this change:range event.
  68457. if ( !data.directChange && isBetweenDifferentAttributes( modelSelection.getFirstPosition(), this.attributes ) ) {
  68458. return;
  68459. }
  68460. this._restoreGravity();
  68461. } );
  68462. }
  68463. /**
  68464. * Registers a given attribute for the two-step caret movement.
  68465. *
  68466. * @param {String} attribute Name of the attribute to handle.
  68467. */
  68468. registerAttribute( attribute ) {
  68469. this.attributes.add( attribute );
  68470. }
  68471. /**
  68472. * Updates the document selection and the view according to the two–step caret movement state
  68473. * when moving **forwards**. Executed upon `keypress` in the {@link module:engine/view/view~View}.
  68474. *
  68475. * @private
  68476. * @param {module:engine/view/observer/domeventdata~DomEventData} data Data of the key press.
  68477. * @returns {Boolean} `true` when the handler prevented caret movement
  68478. */
  68479. _handleForwardMovement( data ) {
  68480. const attributes = this.attributes;
  68481. const model = this.editor.model;
  68482. const selection = model.document.selection;
  68483. const position = selection.getFirstPosition();
  68484. // DON'T ENGAGE 2-SCM if gravity is already overridden. It means that we just entered
  68485. //
  68486. // <paragraph>foo<$text attribute>{}bar</$text>baz</paragraph>
  68487. //
  68488. // or left the attribute
  68489. //
  68490. // <paragraph>foo<$text attribute>bar</$text>{}baz</paragraph>
  68491. //
  68492. // and the gravity will be restored automatically.
  68493. if ( this._isGravityOverridden ) {
  68494. return false;
  68495. }
  68496. // DON'T ENGAGE 2-SCM when the selection is at the beginning of the block AND already has the
  68497. // attribute:
  68498. // * when the selection was initially set there using the mouse,
  68499. // * when the editor has just started
  68500. //
  68501. // <paragraph><$text attribute>{}bar</$text>baz</paragraph>
  68502. //
  68503. if ( position.isAtStart && hasAnyAttribute( selection, attributes ) ) {
  68504. return false;
  68505. }
  68506. // ENGAGE 2-SCM When at least one of the observed attributes changes its value (incl. starts, ends).
  68507. //
  68508. // <paragraph>foo<$text attribute>bar{}</$text>baz</paragraph>
  68509. // <paragraph>foo<$text attribute>bar{}</$text><$text otherAttribute>baz</$text></paragraph>
  68510. // <paragraph>foo<$text attribute=1>bar{}</$text><$text attribute=2>baz</$text></paragraph>
  68511. // <paragraph>foo{}<$text attribute>bar</$text>baz</paragraph>
  68512. //
  68513. if ( isBetweenDifferentAttributes( position, attributes ) ) {
  68514. preventCaretMovement( data );
  68515. this._overrideGravity();
  68516. return true;
  68517. }
  68518. }
  68519. /**
  68520. * Updates the document selection and the view according to the two–step caret movement state
  68521. * when moving **backwards**. Executed upon `keypress` in the {@link module:engine/view/view~View}.
  68522. *
  68523. * @private
  68524. * @param {module:engine/view/observer/domeventdata~DomEventData} data Data of the key press.
  68525. * @returns {Boolean} `true` when the handler prevented caret movement
  68526. */
  68527. _handleBackwardMovement( data ) {
  68528. const attributes = this.attributes;
  68529. const model = this.editor.model;
  68530. const selection = model.document.selection;
  68531. const position = selection.getFirstPosition();
  68532. // When the gravity is already overridden (by this plugin), it means we are on the two-step position.
  68533. // Prevent the movement, restore the gravity and update selection attributes.
  68534. //
  68535. // <paragraph>foo<$text attribute=1>bar</$text><$text attribute=2>{}baz</$text></paragraph>
  68536. // <paragraph>foo<$text attribute>bar</$text><$text otherAttribute>{}baz</$text></paragraph>
  68537. // <paragraph>foo<$text attribute>{}bar</$text>baz</paragraph>
  68538. // <paragraph>foo<$text attribute>bar</$text>{}baz</paragraph>
  68539. //
  68540. if ( this._isGravityOverridden ) {
  68541. preventCaretMovement( data );
  68542. this._restoreGravity();
  68543. setSelectionAttributesFromTheNodeBefore( model, attributes, position );
  68544. return true;
  68545. } else {
  68546. // REMOVE SELECTION ATTRIBUTE when restoring gravity towards a non-existent content at the
  68547. // beginning of the block.
  68548. //
  68549. // <paragraph>{}<$text attribute>bar</$text></paragraph>
  68550. //
  68551. if ( position.isAtStart ) {
  68552. if ( hasAnyAttribute( selection, attributes ) ) {
  68553. preventCaretMovement( data );
  68554. setSelectionAttributesFromTheNodeBefore( model, attributes, position );
  68555. return true;
  68556. }
  68557. return false;
  68558. }
  68559. // When we are moving from natural gravity, to the position of the 2SCM, we need to override the gravity,
  68560. // and make sure it won't be restored. Unless it's at the end of the block and an observed attribute.
  68561. // We need to check if the caret is a one position before the attribute boundary:
  68562. //
  68563. // <paragraph>foo<$text attribute=1>bar</$text><$text attribute=2>b{}az</$text></paragraph>
  68564. // <paragraph>foo<$text attribute>bar</$text><$text otherAttribute>b{}az</$text></paragraph>
  68565. // <paragraph>foo<$text attribute>b{}ar</$text>baz</paragraph>
  68566. // <paragraph>foo<$text attribute>bar</$text>b{}az</paragraph>
  68567. //
  68568. if ( isStepAfterAnyAttributeBoundary( position, attributes ) ) {
  68569. // ENGAGE 2-SCM if the selection has no attribute. This may happen when the user
  68570. // left the attribute using a FORWARD 2-SCM.
  68571. //
  68572. // <paragraph><$text attribute>bar</$text>{}</paragraph>
  68573. //
  68574. if (
  68575. position.isAtEnd &&
  68576. !hasAnyAttribute( selection, attributes ) &&
  68577. isBetweenDifferentAttributes( position, attributes )
  68578. ) {
  68579. preventCaretMovement( data );
  68580. setSelectionAttributesFromTheNodeBefore( model, attributes, position );
  68581. return true;
  68582. }
  68583. // Skip the automatic gravity restore upon the next selection#change:range event.
  68584. // If not skipped, it would automatically restore the gravity, which should remain
  68585. // overridden.
  68586. this._isNextGravityRestorationSkipped = true;
  68587. this._overrideGravity();
  68588. // Don't return "true" here because we didn't call _preventCaretMovement.
  68589. // Returning here will destabilize the filler logic, which also listens to
  68590. // keydown (and the event would be stopped).
  68591. return false;
  68592. }
  68593. }
  68594. }
  68595. /**
  68596. * `true` when the gravity is overridden for the plugin.
  68597. *
  68598. * @readonly
  68599. * @private
  68600. * @type {Boolean}
  68601. */
  68602. get _isGravityOverridden() {
  68603. return !!this._overrideUid;
  68604. }
  68605. /**
  68606. * Overrides the gravity using the {@link module:engine/model/writer~Writer model writer}
  68607. * and stores the information about this fact in the {@link #_overrideUid}.
  68608. *
  68609. * A shorthand for {@link module:engine/model/writer~Writer#overrideSelectionGravity}.
  68610. *
  68611. * @private
  68612. */
  68613. _overrideGravity() {
  68614. this._overrideUid = this.editor.model.change( writer => {
  68615. return writer.overrideSelectionGravity();
  68616. } );
  68617. }
  68618. /**
  68619. * Restores the gravity using the {@link module:engine/model/writer~Writer model writer}.
  68620. *
  68621. * A shorthand for {@link module:engine/model/writer~Writer#restoreSelectionGravity}.
  68622. *
  68623. * @private
  68624. */
  68625. _restoreGravity() {
  68626. this.editor.model.change( writer => {
  68627. writer.restoreSelectionGravity( this._overrideUid );
  68628. this._overrideUid = null;
  68629. } );
  68630. }
  68631. }
  68632. // Checks whether the selection has any of given attributes.
  68633. //
  68634. // @param {module:engine/model/documentselection~DocumentSelection} selection
  68635. // @param {Iterable.<String>} attributes
  68636. function hasAnyAttribute( selection, attributes ) {
  68637. for ( const observedAttribute of attributes ) {
  68638. if ( selection.hasAttribute( observedAttribute ) ) {
  68639. return true;
  68640. }
  68641. }
  68642. return false;
  68643. }
  68644. // Applies the given attributes to the current selection using using the
  68645. // values from the node before the current position. Uses
  68646. // the {@link module:engine/model/writer~Writer model writer}.
  68647. //
  68648. // @param {module:engine/model/model~Model}
  68649. // @param {Iterable.<String>} attributess
  68650. // @param {module:engine/model/position~Position} position
  68651. function setSelectionAttributesFromTheNodeBefore( model, attributes, position ) {
  68652. const nodeBefore = position.nodeBefore;
  68653. model.change( writer => {
  68654. if ( nodeBefore ) {
  68655. writer.setSelectionAttribute( nodeBefore.getAttributes() );
  68656. } else {
  68657. writer.removeSelectionAttribute( attributes );
  68658. }
  68659. } );
  68660. }
  68661. // Prevents the caret movement in the view by calling `preventDefault` on the event data.
  68662. //
  68663. // @alias data.preventDefault
  68664. function preventCaretMovement( data ) {
  68665. data.preventDefault();
  68666. }
  68667. // Checks whether the step before `isBetweenDifferentAttributes()`.
  68668. //
  68669. // @param {module:engine/model/position~Position} position
  68670. // @param {String} attribute
  68671. function isStepAfterAnyAttributeBoundary( position, attributes ) {
  68672. const positionBefore = position.getShiftedBy( -1 );
  68673. return isBetweenDifferentAttributes( positionBefore, attributes );
  68674. }
  68675. // Checks whether the given position is between different values of given attributes.
  68676. //
  68677. // @param {module:engine/model/position~Position} position
  68678. // @param {Iterable.<String>} attributes
  68679. function isBetweenDifferentAttributes( position, attributes ) {
  68680. const { nodeBefore, nodeAfter } = position;
  68681. for ( const observedAttribute of attributes ) {
  68682. const attrBefore = nodeBefore ? nodeBefore.getAttribute( observedAttribute ) : undefined;
  68683. const attrAfter = nodeAfter ? nodeAfter.getAttribute( observedAttribute ) : undefined;
  68684. if ( attrAfter !== attrBefore ) {
  68685. return true;
  68686. }
  68687. }
  68688. return false;
  68689. }
  68690. /***/ }),
  68691. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/typing.js":
  68692. /*!***************************************************************!*\
  68693. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/typing.js ***!
  68694. \***************************************************************/
  68695. /*! exports provided: default */
  68696. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  68697. "use strict";
  68698. __webpack_require__.r(__webpack_exports__);
  68699. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Typing; });
  68700. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  68701. /* harmony import */ var _input__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./input */ "./node_modules/@ckeditor/ckeditor5-typing/src/input.js");
  68702. /* harmony import */ var _delete__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./delete */ "./node_modules/@ckeditor/ckeditor5-typing/src/delete.js");
  68703. /**
  68704. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  68705. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  68706. */
  68707. /**
  68708. * @module typing/typing
  68709. */
  68710. /**
  68711. * The typing feature. It handles typing.
  68712. *
  68713. * This is a "glue" plugin which loads the {@link module:typing/input~Input} and {@link module:typing/delete~Delete}
  68714. * plugins.
  68715. *
  68716. * @extends module:core/plugin~Plugin
  68717. */
  68718. class Typing extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  68719. static get requires() {
  68720. return [ _input__WEBPACK_IMPORTED_MODULE_1__["default"], _delete__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  68721. }
  68722. /**
  68723. * @inheritDoc
  68724. */
  68725. static get pluginName() {
  68726. return 'Typing';
  68727. }
  68728. }
  68729. /**
  68730. * The configuration of the typing features. Used by the features from the `@ckeditor/ckeditor5-typing` package.
  68731. *
  68732. * Read more in {@link module:typing/typing~TypingConfig}.
  68733. *
  68734. * @member {module:typing/typing~TypingConfig} module:core/editor/editorconfig~EditorConfig#typing
  68735. */
  68736. /**
  68737. * The configuration of the typing features. Used by the typing features in `@ckeditor/ckeditor5-typing` package.
  68738. *
  68739. * ClassicEditor
  68740. * .create( editorElement, {
  68741. * typing: ... // Typing feature options.
  68742. * } )
  68743. * .then( ... )
  68744. * .catch( ... );
  68745. *
  68746. * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
  68747. *
  68748. * @interface TypingConfig
  68749. */
  68750. /**
  68751. * The granularity of undo/redo for typing and deleting. The value `20` means (more or less) that a new undo step
  68752. * is created every 20 characters are inserted or deleted.
  68753. *
  68754. * @member {Number} [module:typing/typing~TypingConfig#undoStep=20]
  68755. */
  68756. /***/ }),
  68757. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/changebuffer.js":
  68758. /*!***************************************************************************!*\
  68759. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/utils/changebuffer.js ***!
  68760. \***************************************************************************/
  68761. /*! exports provided: default */
  68762. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  68763. "use strict";
  68764. __webpack_require__.r(__webpack_exports__);
  68765. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ChangeBuffer; });
  68766. /**
  68767. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  68768. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  68769. */
  68770. /**
  68771. * @module typing/utils/changebuffer
  68772. */
  68773. /**
  68774. * Change buffer allows to group atomic changes (like characters that have been typed) into
  68775. * {@link module:engine/model/batch~Batch batches}.
  68776. *
  68777. * Batches represent single undo steps, hence changes added to one single batch are undone together.
  68778. *
  68779. * The buffer has a configurable limit of atomic changes that it can accommodate. After the limit was
  68780. * exceeded (see {@link ~ChangeBuffer#input}), a new batch is created in {@link ~ChangeBuffer#batch}.
  68781. *
  68782. * To use the change buffer you need to let it know about the number of changes that were added to the batch:
  68783. *
  68784. * const buffer = new ChangeBuffer( model, LIMIT );
  68785. *
  68786. * // Later on in your feature:
  68787. * buffer.batch.insert( pos, insertedCharacters );
  68788. * buffer.input( insertedCharacters.length );
  68789. *
  68790. */
  68791. class ChangeBuffer {
  68792. /**
  68793. * Creates a new instance of the change buffer.
  68794. *
  68795. * @param {module:engine/model/model~Model} model
  68796. * @param {Number} [limit=20] The maximum number of atomic changes which can be contained in one batch.
  68797. */
  68798. constructor( model, limit = 20 ) {
  68799. /**
  68800. * The model instance.
  68801. *
  68802. * @readonly
  68803. * @member {module:engine/model/model~Model} #model
  68804. */
  68805. this.model = model;
  68806. /**
  68807. * The number of atomic changes in the buffer. Once it exceeds the {@link #limit},
  68808. * the {@link #batch batch} is set to a new one.
  68809. *
  68810. * @readonly
  68811. * @member {Number} #size
  68812. */
  68813. this.size = 0;
  68814. /**
  68815. * The maximum number of atomic changes which can be contained in one batch.
  68816. *
  68817. * @readonly
  68818. * @member {Number} #limit
  68819. */
  68820. this.limit = limit;
  68821. /**
  68822. * Whether the buffer is locked. A locked buffer cannot be reset unless it gets unlocked.
  68823. *
  68824. * @readonly
  68825. * @member {Boolean} #isLocked
  68826. */
  68827. this.isLocked = false;
  68828. // The function to be called in order to notify the buffer about batches which appeared in the document.
  68829. // The callback will check whether it is a new batch and in that case the buffer will be flushed.
  68830. //
  68831. // The reason why the buffer needs to be flushed whenever a new batch appears is that the changes added afterwards
  68832. // should be added to a new batch. For instance, when the user types, then inserts an image, and then types again,
  68833. // the characters typed after inserting the image should be added to a different batch than the characters typed before.
  68834. this._changeCallback = ( evt, batch ) => {
  68835. if ( batch.type != 'transparent' && batch !== this._batch ) {
  68836. this._reset( true );
  68837. }
  68838. };
  68839. this._selectionChangeCallback = () => {
  68840. this._reset();
  68841. };
  68842. this.model.document.on( 'change', this._changeCallback );
  68843. this.model.document.selection.on( 'change:range', this._selectionChangeCallback );
  68844. this.model.document.selection.on( 'change:attribute', this._selectionChangeCallback );
  68845. /**
  68846. * The current batch instance.
  68847. *
  68848. * @private
  68849. * @member #_batch
  68850. */
  68851. /**
  68852. * The callback to document the change event which later needs to be removed.
  68853. *
  68854. * @private
  68855. * @member #_changeCallback
  68856. */
  68857. /**
  68858. * The callback to document selection `change:attribute` and `change:range` events which resets the buffer.
  68859. *
  68860. * @private
  68861. * @member #_selectionChangeCallback
  68862. */
  68863. }
  68864. /**
  68865. * The current batch to which a feature should add its operations. Once the {@link #size}
  68866. * is reached or exceeds the {@link #limit}, the batch is set to a new instance and the size is reset.
  68867. *
  68868. * @type {module:engine/model/batch~Batch}
  68869. */
  68870. get batch() {
  68871. if ( !this._batch ) {
  68872. this._batch = this.model.createBatch();
  68873. }
  68874. return this._batch;
  68875. }
  68876. /**
  68877. * The input number of changes into the buffer. Once the {@link #size} is
  68878. * reached or exceeds the {@link #limit}, the batch is set to a new instance and the size is reset.
  68879. *
  68880. * @param {Number} changeCount The number of atomic changes to input.
  68881. */
  68882. input( changeCount ) {
  68883. this.size += changeCount;
  68884. if ( this.size >= this.limit ) {
  68885. this._reset( true );
  68886. }
  68887. }
  68888. /**
  68889. * Locks the buffer.
  68890. */
  68891. lock() {
  68892. this.isLocked = true;
  68893. }
  68894. /**
  68895. * Unlocks the buffer.
  68896. */
  68897. unlock() {
  68898. this.isLocked = false;
  68899. }
  68900. /**
  68901. * Destroys the buffer.
  68902. */
  68903. destroy() {
  68904. this.model.document.off( 'change', this._changeCallback );
  68905. this.model.document.selection.off( 'change:range', this._selectionChangeCallback );
  68906. this.model.document.selection.off( 'change:attribute', this._selectionChangeCallback );
  68907. }
  68908. /**
  68909. * Resets the change buffer.
  68910. *
  68911. * @private
  68912. * @param {Boolean} [ignoreLock] Whether internal lock {@link #isLocked} should be ignored.
  68913. */
  68914. _reset( ignoreLock ) {
  68915. if ( !this.isLocked || ignoreLock ) {
  68916. this._batch = null;
  68917. this.size = 0;
  68918. }
  68919. }
  68920. }
  68921. /***/ }),
  68922. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/findattributerange.js":
  68923. /*!*********************************************************************************!*\
  68924. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/utils/findattributerange.js ***!
  68925. \*********************************************************************************/
  68926. /*! exports provided: default */
  68927. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  68928. "use strict";
  68929. __webpack_require__.r(__webpack_exports__);
  68930. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return findAttributeRange; });
  68931. /**
  68932. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  68933. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  68934. */
  68935. /**
  68936. * @module typing/utils/findattributerange
  68937. */
  68938. /**
  68939. * Returns a model range that covers all consecutive nodes with the same `attributeName` and its `value`
  68940. * that intersect the given `position`.
  68941. *
  68942. * It can be used e.g. to get the entire range on which the `linkHref` attribute needs to be changed when having a
  68943. * selection inside a link.
  68944. *
  68945. * @param {module:engine/model/position~Position} position The start position.
  68946. * @param {String} attributeName The attribute name.
  68947. * @param {String} value The attribute value.
  68948. * @param {module:engine/model/model~Model} model The model instance.
  68949. * @returns {module:engine/model/range~Range} The link range.
  68950. */
  68951. function findAttributeRange( position, attributeName, value, model ) {
  68952. return model.createRange(
  68953. _findBound( position, attributeName, value, true, model ),
  68954. _findBound( position, attributeName, value, false, model )
  68955. );
  68956. }
  68957. // Walks forward or backward (depends on the `lookBack` flag), node by node, as long as they have the same attribute value
  68958. // and returns a position just before or after (depends on the `lookBack` flag) the last matched node.
  68959. //
  68960. // @param {module:engine/model/position~Position} position The start position.
  68961. // @param {String} attributeName The attribute name.
  68962. // @param {String} value The attribute value.
  68963. // @param {Boolean} lookBack Whether the walk direction is forward (`false`) or backward (`true`).
  68964. // @returns {module:engine/model/position~Position} The position just before the last matched node.
  68965. function _findBound( position, attributeName, value, lookBack, model ) {
  68966. // Get node before or after position (depends on `lookBack` flag).
  68967. // When position is inside text node then start searching from text node.
  68968. let node = position.textNode || ( lookBack ? position.nodeBefore : position.nodeAfter );
  68969. let lastNode = null;
  68970. while ( node && node.getAttribute( attributeName ) == value ) {
  68971. lastNode = node;
  68972. node = lookBack ? node.previousSibling : node.nextSibling;
  68973. }
  68974. return lastNode ? model.createPositionAt( lastNode, lookBack ? 'before' : 'after' ) : position;
  68975. }
  68976. /***/ }),
  68977. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/getlasttextline.js":
  68978. /*!******************************************************************************!*\
  68979. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/utils/getlasttextline.js ***!
  68980. \******************************************************************************/
  68981. /*! exports provided: default */
  68982. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  68983. "use strict";
  68984. __webpack_require__.r(__webpack_exports__);
  68985. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getLastTextLine; });
  68986. /**
  68987. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  68988. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  68989. */
  68990. /**
  68991. * @module typing/utils/getlasttextline
  68992. */
  68993. /**
  68994. * Returns the last text line from the given range.
  68995. *
  68996. * "The last text line" is understood as text (from one or more text nodes) which is limited either by a parent block
  68997. * or by inline elements (e.g. `<softBreak>`).
  68998. *
  68999. * const rangeToCheck = model.createRange(
  69000. * model.createPositionAt( paragraph, 0 ),
  69001. * model.createPositionAt( paragraph, 'end' )
  69002. * );
  69003. *
  69004. * const { text, range } = getLastTextLine( rangeToCheck, model );
  69005. *
  69006. * For model below, the returned `text` will be "Foo bar baz" and `range` will be set on whole `<paragraph>` content:
  69007. *
  69008. * <paragraph>Foo bar baz<paragraph>
  69009. *
  69010. * However, in below case, `text` will be set to "baz" and `range` will be set only on "baz".
  69011. *
  69012. * <paragraph>Foo<softBreak></softBreak>bar<softBreak></softBreak>baz<paragraph>
  69013. *
  69014. * @protected
  69015. * @param {module:engine/model/range~Range} range
  69016. * @param {module:engine/model/model~Model} model
  69017. * @returns {module:typing/utils/getlasttextline~LastTextLineData}
  69018. */
  69019. function getLastTextLine( range, model ) {
  69020. let start = range.start;
  69021. const text = Array.from( range.getItems() ).reduce( ( rangeText, node ) => {
  69022. // Trim text to a last occurrence of an inline element and update range start.
  69023. if ( !( node.is( '$text' ) || node.is( '$textProxy' ) ) ) {
  69024. start = model.createPositionAfter( node );
  69025. return '';
  69026. }
  69027. return rangeText + node.data;
  69028. }, '' );
  69029. return { text, range: model.createRange( start, range.end ) };
  69030. }
  69031. /**
  69032. * The value returned by {@link module:typing/utils/getlasttextline~getLastTextLine}.
  69033. *
  69034. * @typedef {Object} module:typing/utils/getlasttextline~LastTextLineData
  69035. *
  69036. * @property {String} text The text from the text nodes in the last text line.
  69037. * @property {module:engine/model/range~Range} range The range set on the text nodes in the last text line.
  69038. */
  69039. /***/ }),
  69040. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/injecttypingmutationshandling.js":
  69041. /*!********************************************************************************************!*\
  69042. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/utils/injecttypingmutationshandling.js ***!
  69043. \********************************************************************************************/
  69044. /*! exports provided: default */
  69045. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  69046. "use strict";
  69047. __webpack_require__.r(__webpack_exports__);
  69048. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return injectTypingMutationsHandling; });
  69049. /* harmony import */ var _ckeditor_ckeditor5_utils_src_diff__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/diff */ "./node_modules/@ckeditor/ckeditor5-utils/src/diff.js");
  69050. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_domconverter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/domconverter */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/domconverter.js");
  69051. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/utils.js");
  69052. /**
  69053. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  69054. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  69055. */
  69056. /**
  69057. * @module typing/utils/injecttypingmutationshandling
  69058. */
  69059. /**
  69060. * Handles mutations caused by normal typing.
  69061. *
  69062. * @param {module:core/editor/editor~Editor} editor The editor instance.
  69063. */
  69064. function injectTypingMutationsHandling( editor ) {
  69065. editor.editing.view.document.on( 'mutations', ( evt, mutations, viewSelection ) => {
  69066. new MutationHandler( editor ).handle( mutations, viewSelection );
  69067. } );
  69068. }
  69069. /**
  69070. * Helper class for translating DOM mutations into model changes.
  69071. *
  69072. * @private
  69073. */
  69074. class MutationHandler {
  69075. /**
  69076. * Creates an instance of the mutation handler.
  69077. *
  69078. * @param {module:core/editor/editor~Editor} editor
  69079. */
  69080. constructor( editor ) {
  69081. /**
  69082. * Editor instance for which mutations are handled.
  69083. *
  69084. * @readonly
  69085. * @member {module:core/editor/editor~Editor} #editor
  69086. */
  69087. this.editor = editor;
  69088. /**
  69089. * The editing controller.
  69090. *
  69091. * @readonly
  69092. * @member {module:engine/controller/editingcontroller~EditingController} #editing
  69093. */
  69094. this.editing = this.editor.editing;
  69095. }
  69096. /**
  69097. * Handles given mutations.
  69098. *
  69099. * @param {Array.<module:engine/view/observer/mutationobserver~MutatedText|
  69100. * module:engine/view/observer/mutationobserver~MutatedChildren>} mutations
  69101. * @param {module:engine/view/selection~Selection|null} viewSelection
  69102. */
  69103. handle( mutations, viewSelection ) {
  69104. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_2__["containerChildrenMutated"])( mutations ) ) {
  69105. this._handleContainerChildrenMutations( mutations, viewSelection );
  69106. } else {
  69107. for ( const mutation of mutations ) {
  69108. // Fortunately it will never be both.
  69109. this._handleTextMutation( mutation, viewSelection );
  69110. this._handleTextNodeInsertion( mutation );
  69111. }
  69112. }
  69113. }
  69114. /**
  69115. * Handles situations when container's children mutated during input. This can happen when
  69116. * the browser is trying to "fix" DOM in certain situations. For example, when the user starts to type
  69117. * in `<p><a href=""><i>Link{}</i></a></p>`, the browser might change the order of elements
  69118. * to `<p><i><a href="">Link</a>x{}</i></p>`. A similar situation happens when the spell checker
  69119. * replaces a word wrapped with `<strong>` with a word wrapped with a `<b>` element.
  69120. *
  69121. * To handle such situations, the common DOM ancestor of all mutations is converted to the model representation
  69122. * and then compared with the current model to calculate the proper text change.
  69123. *
  69124. * Note: Single text node insertion is handled in {@link #_handleTextNodeInsertion} and text node mutation is handled
  69125. * in {@link #_handleTextMutation}).
  69126. *
  69127. * @private
  69128. * @param {Array.<module:engine/view/observer/mutationobserver~MutatedText|
  69129. * module:engine/view/observer/mutationobserver~MutatedChildren>} mutations
  69130. * @param {module:engine/view/selection~Selection|null} viewSelection
  69131. */
  69132. _handleContainerChildrenMutations( mutations, viewSelection ) {
  69133. // Get common ancestor of all mutations.
  69134. const mutationsCommonAncestor = getMutationsContainer( mutations );
  69135. // Quit if there is no common ancestor.
  69136. if ( !mutationsCommonAncestor ) {
  69137. return;
  69138. }
  69139. const domConverter = this.editor.editing.view.domConverter;
  69140. // Get common ancestor in DOM.
  69141. const domMutationCommonAncestor = domConverter.mapViewToDom( mutationsCommonAncestor );
  69142. // Create fresh DomConverter so it will not use existing mapping and convert current DOM to model.
  69143. // This wouldn't be needed if DomConverter would allow to create fresh view without checking any mappings.
  69144. const freshDomConverter = new _ckeditor_ckeditor5_engine_src_view_domconverter__WEBPACK_IMPORTED_MODULE_1__["default"]( this.editor.editing.view.document );
  69145. const modelFromCurrentDom = this.editor.data.toModel(
  69146. freshDomConverter.domToView( domMutationCommonAncestor )
  69147. ).getChild( 0 );
  69148. // Current model.
  69149. const currentModel = this.editor.editing.mapper.toModelElement( mutationsCommonAncestor );
  69150. // If common ancestor is not mapped, do not do anything. It probably is a parent of another view element.
  69151. // That means that we would need to diff model elements (see `if` below). Better return early instead of
  69152. // trying to get a reasonable model ancestor. It will fell into the `if` below anyway.
  69153. // This situation happens for example for lists. If `<ul>` is a common ancestor, `currentModel` is `undefined`
  69154. // because `<ul>` is not mapped (`<li>`s are).
  69155. // See https://github.com/ckeditor/ckeditor5/issues/718.
  69156. if ( !currentModel ) {
  69157. return;
  69158. }
  69159. // Get children from both ancestors.
  69160. const modelFromDomChildren = Array.from( modelFromCurrentDom.getChildren() );
  69161. const currentModelChildren = Array.from( currentModel.getChildren() );
  69162. // Remove the last `<softBreak>` from the end of `modelFromDomChildren` if there is no `<softBreak>` in current model.
  69163. // If the described scenario happened, it means that this is a bogus `<br />` added by a browser.
  69164. const lastDomChild = modelFromDomChildren[ modelFromDomChildren.length - 1 ];
  69165. const lastCurrentChild = currentModelChildren[ currentModelChildren.length - 1 ];
  69166. const isLastDomChildSoftBreak = lastDomChild && lastDomChild.is( 'element', 'softBreak' );
  69167. const isLastCurrentChildSoftBreak = lastCurrentChild && !lastCurrentChild.is( 'element', 'softBreak' );
  69168. if ( isLastDomChildSoftBreak && isLastCurrentChildSoftBreak ) {
  69169. modelFromDomChildren.pop();
  69170. }
  69171. const schema = this.editor.model.schema;
  69172. // Skip situations when common ancestor has any container elements.
  69173. if ( !isSafeForTextMutation( modelFromDomChildren, schema ) || !isSafeForTextMutation( currentModelChildren, schema ) ) {
  69174. return;
  69175. }
  69176. // Replace &nbsp; inserted by the browser with normal space. See comment in `_handleTextMutation`.
  69177. // Replace non-texts with any character. This is potentially dangerous but passes in manual tests. The thing is
  69178. // that we need to take care of proper indexes so we cannot simply remove non-text elements from the content.
  69179. // By inserting a character we keep all the real texts on their indexes.
  69180. const newText = modelFromDomChildren.map( item => item.is( '$text' ) ? item.data : '@' ).join( '' ).replace( /\u00A0/g, ' ' );
  69181. const oldText = currentModelChildren.map( item => item.is( '$text' ) ? item.data : '@' ).join( '' ).replace( /\u00A0/g, ' ' );
  69182. // Do nothing if mutations created same text.
  69183. if ( oldText === newText ) {
  69184. return;
  69185. }
  69186. const diffResult = Object(_ckeditor_ckeditor5_utils_src_diff__WEBPACK_IMPORTED_MODULE_0__["default"])( oldText, newText );
  69187. const { firstChangeAt, insertions, deletions } = calculateChanges( diffResult );
  69188. // Try setting new model selection according to passed view selection.
  69189. let modelSelectionRange = null;
  69190. if ( viewSelection ) {
  69191. modelSelectionRange = this.editing.mapper.toModelRange( viewSelection.getFirstRange() );
  69192. }
  69193. const insertText = newText.substr( firstChangeAt, insertions );
  69194. const removeRange = this.editor.model.createRange(
  69195. this.editor.model.createPositionAt( currentModel, firstChangeAt ),
  69196. this.editor.model.createPositionAt( currentModel, firstChangeAt + deletions )
  69197. );
  69198. this.editor.execute( 'input', {
  69199. text: insertText,
  69200. range: removeRange,
  69201. resultRange: modelSelectionRange
  69202. } );
  69203. }
  69204. /**
  69205. * @private
  69206. */
  69207. _handleTextMutation( mutation, viewSelection ) {
  69208. if ( mutation.type != 'text' ) {
  69209. return;
  69210. }
  69211. // Replace &nbsp; inserted by the browser with normal space.
  69212. // We want only normal spaces in the model and in the view. Renderer and DOM Converter will be then responsible
  69213. // for rendering consecutive spaces using &nbsp;, but the model and the view has to be clear.
  69214. // Other feature may introduce inserting non-breakable space on specific key stroke (for example shift + space).
  69215. // However then it will be handled outside of mutations, like enter key is.
  69216. // The replacing is here because it has to be done before `diff` and `diffToChanges` functions, as they
  69217. // take `newText` and compare it to (cleaned up) view.
  69218. // It could also be done in mutation observer too, however if any outside plugin would like to
  69219. // introduce additional events for mutations, they would get already cleaned up version (this may be good or not).
  69220. const newText = mutation.newText.replace( /\u00A0/g, ' ' );
  69221. // To have correct `diffResult`, we also compare view node text data with &nbsp; replaced by space.
  69222. const oldText = mutation.oldText.replace( /\u00A0/g, ' ' );
  69223. // Do nothing if mutations created same text.
  69224. if ( oldText === newText ) {
  69225. return;
  69226. }
  69227. const diffResult = Object(_ckeditor_ckeditor5_utils_src_diff__WEBPACK_IMPORTED_MODULE_0__["default"])( oldText, newText );
  69228. const { firstChangeAt, insertions, deletions } = calculateChanges( diffResult );
  69229. // Try setting new model selection according to passed view selection.
  69230. let modelSelectionRange = null;
  69231. if ( viewSelection ) {
  69232. modelSelectionRange = this.editing.mapper.toModelRange( viewSelection.getFirstRange() );
  69233. }
  69234. // Get the position in view and model where the changes will happen.
  69235. const viewPos = this.editing.view.createPositionAt( mutation.node, firstChangeAt );
  69236. const modelPos = this.editing.mapper.toModelPosition( viewPos );
  69237. const removeRange = this.editor.model.createRange( modelPos, modelPos.getShiftedBy( deletions ) );
  69238. const insertText = newText.substr( firstChangeAt, insertions );
  69239. this.editor.execute( 'input', {
  69240. text: insertText,
  69241. range: removeRange,
  69242. resultRange: modelSelectionRange
  69243. } );
  69244. }
  69245. /**
  69246. * @private
  69247. */
  69248. _handleTextNodeInsertion( mutation ) {
  69249. if ( mutation.type != 'children' ) {
  69250. return;
  69251. }
  69252. const change = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["getSingleTextNodeChange"])( mutation );
  69253. const viewPos = this.editing.view.createPositionAt( mutation.node, change.index );
  69254. const modelPos = this.editing.mapper.toModelPosition( viewPos );
  69255. const insertedText = change.values[ 0 ].data;
  69256. this.editor.execute( 'input', {
  69257. // Replace &nbsp; inserted by the browser with normal space.
  69258. // See comment in `_handleTextMutation`.
  69259. // In this case we don't need to do this before `diff` because we diff whole nodes.
  69260. // Just change &nbsp; in case there are some.
  69261. text: insertedText.replace( /\u00A0/g, ' ' ),
  69262. range: this.editor.model.createRange( modelPos )
  69263. } );
  69264. }
  69265. }
  69266. // Returns first common ancestor of all mutations that is either {@link module:engine/view/containerelement~ContainerElement}
  69267. // or {@link module:engine/view/rootelement~RootElement}.
  69268. //
  69269. // @private
  69270. // @param {Array.<module:engine/view/observer/mutationobserver~MutatedText|
  69271. // module:engine/view/observer/mutationobserver~MutatedChildren>} mutations
  69272. // @returns {module:engine/view/containerelement~ContainerElement|engine/view/rootelement~RootElement|undefined}
  69273. function getMutationsContainer( mutations ) {
  69274. const lca = mutations
  69275. .map( mutation => mutation.node )
  69276. .reduce( ( commonAncestor, node ) => {
  69277. return commonAncestor.getCommonAncestor( node, { includeSelf: true } );
  69278. } );
  69279. if ( !lca ) {
  69280. return;
  69281. }
  69282. // We need to look for container and root elements only, so check all LCA's
  69283. // ancestors (starting from itself).
  69284. return lca.getAncestors( { includeSelf: true, parentFirst: true } )
  69285. .find( element => element.is( 'containerElement' ) || element.is( 'rootElement' ) );
  69286. }
  69287. // Returns true if provided array contains content that won't be problematic during diffing and text mutation handling.
  69288. //
  69289. // @param {Array.<module:engine/model/node~Node>} children
  69290. // @param {module:engine/model/schema~Schema} schema
  69291. // @returns {Boolean}
  69292. function isSafeForTextMutation( children, schema ) {
  69293. return children.every( child => schema.isInline( child ) );
  69294. }
  69295. // Calculates first change index and number of characters that should be inserted and deleted starting from that index.
  69296. //
  69297. // @private
  69298. // @param diffResult
  69299. // @returns {{insertions: number, deletions: number, firstChangeAt: *}}
  69300. function calculateChanges( diffResult ) {
  69301. // Index where the first change happens. Used to set the position from which nodes will be removed and where will be inserted.
  69302. let firstChangeAt = null;
  69303. // Index where the last change happens. Used to properly count how many characters have to be removed and inserted.
  69304. let lastChangeAt = null;
  69305. // Get `firstChangeAt` and `lastChangeAt`.
  69306. for ( let i = 0; i < diffResult.length; i++ ) {
  69307. const change = diffResult[ i ];
  69308. if ( change != 'equal' ) {
  69309. firstChangeAt = firstChangeAt === null ? i : firstChangeAt;
  69310. lastChangeAt = i;
  69311. }
  69312. }
  69313. // How many characters, starting from `firstChangeAt`, should be removed.
  69314. let deletions = 0;
  69315. // How many characters, starting from `firstChangeAt`, should be inserted.
  69316. let insertions = 0;
  69317. for ( let i = firstChangeAt; i <= lastChangeAt; i++ ) {
  69318. // If there is no change (equal) or delete, the character is existing in `oldText`. We count it for removing.
  69319. if ( diffResult[ i ] != 'insert' ) {
  69320. deletions++;
  69321. }
  69322. // If there is no change (equal) or insert, the character is existing in `newText`. We count it for inserting.
  69323. if ( diffResult[ i ] != 'delete' ) {
  69324. insertions++;
  69325. }
  69326. }
  69327. return { insertions, deletions, firstChangeAt };
  69328. }
  69329. /***/ }),
  69330. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/injectunsafekeystrokeshandling.js":
  69331. /*!*********************************************************************************************!*\
  69332. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/utils/injectunsafekeystrokeshandling.js ***!
  69333. \*********************************************************************************************/
  69334. /*! exports provided: default, isNonTypingKeystroke */
  69335. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  69336. "use strict";
  69337. __webpack_require__.r(__webpack_exports__);
  69338. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return injectUnsafeKeystrokesHandling; });
  69339. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNonTypingKeystroke", function() { return isNonTypingKeystroke; });
  69340. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
  69341. /* harmony import */ var _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/env */ "./node_modules/@ckeditor/ckeditor5-utils/src/env.js");
  69342. /**
  69343. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  69344. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  69345. */
  69346. /**
  69347. * @module typing/utils/injectunsafekeystrokeshandling
  69348. */
  69349. /**
  69350. * Handles keystrokes which are unsafe for typing. This handler's logic is explained
  69351. * in https://github.com/ckeditor/ckeditor5-typing/issues/83#issuecomment-398690251.
  69352. *
  69353. * @param {module:core/editor/editor~Editor} editor The editor instance.
  69354. */
  69355. function injectUnsafeKeystrokesHandling( editor ) {
  69356. let latestCompositionSelection = null;
  69357. const model = editor.model;
  69358. const view = editor.editing.view;
  69359. const inputCommand = editor.commands.get( 'input' );
  69360. // For Android, we want to handle keystrokes on `beforeinput` to be sure that code in `DeleteObserver` already had a chance to be fired.
  69361. if ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_1__["default"].isAndroid ) {
  69362. view.document.on( 'beforeinput', ( evt, evtData ) => handleUnsafeKeystroke( evtData ), { priority: 'lowest' } );
  69363. } else {
  69364. view.document.on( 'keydown', ( evt, evtData ) => handleUnsafeKeystroke( evtData ), { priority: 'lowest' } );
  69365. }
  69366. view.document.on( 'compositionstart', handleCompositionStart, { priority: 'lowest' } );
  69367. view.document.on( 'compositionend', () => {
  69368. latestCompositionSelection = model.createSelection( model.document.selection );
  69369. }, { priority: 'lowest' } );
  69370. // Handles the keydown event. We need to guess whether such keystroke is going to result
  69371. // in typing. If so, then before character insertion happens, any selected content needs
  69372. // to be deleted. Otherwise the default browser deletion mechanism would be
  69373. // triggered, resulting in:
  69374. //
  69375. // * Hundreds of mutations which could not be handled.
  69376. // * But most importantly, loss of control over how the content is being deleted.
  69377. //
  69378. // The method is used in a low-priority listener, hence allowing other listeners (e.g. delete or enter features)
  69379. // to handle the event.
  69380. //
  69381. // @param {module:engine/view/observer/keyobserver~KeyEventData} evtData
  69382. function handleUnsafeKeystroke( evtData ) {
  69383. const doc = model.document;
  69384. const isComposing = view.document.isComposing;
  69385. const isSelectionUnchanged = latestCompositionSelection && latestCompositionSelection.isEqual( doc.selection );
  69386. // Reset stored composition selection.
  69387. latestCompositionSelection = null;
  69388. // By relying on the state of the input command we allow disabling the entire input easily
  69389. // by just disabling the input command. We could’ve used here the delete command but that
  69390. // would mean requiring the delete feature which would block loading one without the other.
  69391. // We could also check the editor.isReadOnly property, but that wouldn't allow to block
  69392. // the input without blocking other features.
  69393. if ( !inputCommand.isEnabled ) {
  69394. return;
  69395. }
  69396. if ( isNonTypingKeystroke( evtData ) || doc.selection.isCollapsed ) {
  69397. return;
  69398. }
  69399. // If during composition, deletion should be prevented as it may remove composed sequence (#83).
  69400. if ( isComposing && evtData.keyCode === 229 ) {
  69401. return;
  69402. }
  69403. // If there is a `keydown` event fired with '229' keycode it might be related
  69404. // to recent composition. Check if selection is the same as upon ending recent composition,
  69405. // if so do not remove selected content as it will remove composed sequence (#83).
  69406. if ( !isComposing && evtData.keyCode === 229 && isSelectionUnchanged ) {
  69407. return;
  69408. }
  69409. deleteSelectionContent();
  69410. }
  69411. // Handles the `compositionstart` event. It is used only in special cases to remove the contents
  69412. // of a non-collapsed selection so composition itself does not result in complex mutations.
  69413. //
  69414. // The special case mentioned above is a situation in which the `keydown` event is fired after
  69415. // `compositionstart` event. In such cases {@link #handleKeydown} cannot clear current selection
  69416. // contents (because it is too late and will break the composition) so the composition handler takes care of it.
  69417. function handleCompositionStart() {
  69418. const doc = model.document;
  69419. const isFlatSelection = doc.selection.rangeCount === 1 ? doc.selection.getFirstRange().isFlat : true;
  69420. // If on `compositionstart` there is a non-collapsed selection which start and end have different parents
  69421. // it means the `handleKeydown()` method did not remove its contents. It happens usually because
  69422. // of different order of events (`compositionstart` before `keydown` - in Safari). In such cases
  69423. // we need to remove selection contents on composition start (#83).
  69424. if ( doc.selection.isCollapsed || isFlatSelection ) {
  69425. return;
  69426. }
  69427. deleteSelectionContent();
  69428. }
  69429. function deleteSelectionContent() {
  69430. const buffer = inputCommand.buffer;
  69431. buffer.lock();
  69432. const batch = buffer.batch;
  69433. inputCommand._batches.add( batch );
  69434. model.enqueueChange( batch, () => {
  69435. model.deleteContent( model.document.selection );
  69436. } );
  69437. buffer.unlock();
  69438. }
  69439. }
  69440. const safeKeycodes = [
  69441. Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__["getCode"])( 'arrowUp' ),
  69442. Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__["getCode"])( 'arrowRight' ),
  69443. Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__["getCode"])( 'arrowDown' ),
  69444. Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__["getCode"])( 'arrowLeft' ),
  69445. 9, // Tab
  69446. 16, // Shift
  69447. 17, // Ctrl
  69448. 18, // Alt
  69449. 19, // Pause
  69450. 20, // CapsLock
  69451. 27, // Escape
  69452. 33, // PageUp
  69453. 34, // PageDown
  69454. 35, // Home
  69455. 36, // End,
  69456. 45, // Insert,
  69457. 91, // Windows,
  69458. 93, // Menu key,
  69459. 144, // NumLock
  69460. 145, // ScrollLock,
  69461. 173, // Mute/Unmute
  69462. 174, // Volume up
  69463. 175, // Volume down,
  69464. 176, // Next song,
  69465. 177, // Previous song,
  69466. 178, // Stop,
  69467. 179, // Play/Pause,
  69468. 255 // Display brightness (increase and decrease)
  69469. ];
  69470. // Function keys.
  69471. for ( let code = 112; code <= 135; code++ ) {
  69472. safeKeycodes.push( code );
  69473. }
  69474. /**
  69475. * Returns `true` if a keystroke will **not** result in "typing".
  69476. *
  69477. * For instance, keystrokes that result in typing are letters "a-zA-Z", numbers "0-9", delete, backspace, etc.
  69478. *
  69479. * Keystrokes that do not cause typing are, for instance, Fn keys (F5, F8, etc.), arrow keys (←, →, ↑, ↓),
  69480. * Tab (↹), "Windows logo key" (⊞ Win), etc.
  69481. *
  69482. * Note: This implementation is very simple and will need to be refined with time.
  69483. *
  69484. * @param {module:engine/view/observer/keyobserver~KeyEventData} keyData
  69485. * @returns {Boolean}
  69486. */
  69487. function isNonTypingKeystroke( keyData ) {
  69488. // Keystrokes which contain Ctrl don't represent typing.
  69489. if ( keyData.ctrlKey ) {
  69490. return true;
  69491. }
  69492. return safeKeycodes.includes( keyData.keyCode );
  69493. }
  69494. /***/ }),
  69495. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/inlinehighlight.js":
  69496. /*!******************************************************************************!*\
  69497. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/utils/inlinehighlight.js ***!
  69498. \******************************************************************************/
  69499. /*! exports provided: default */
  69500. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  69501. "use strict";
  69502. __webpack_require__.r(__webpack_exports__);
  69503. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return inlineHighlight; });
  69504. /* harmony import */ var _findattributerange__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./findattributerange */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/findattributerange.js");
  69505. /**
  69506. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  69507. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  69508. */
  69509. /**
  69510. * @module typing/utils/inlinehighlight
  69511. */
  69512. /**
  69513. * Adds a visual highlight style to an attribute element in which the selection is anchored.
  69514. * Together with two-step caret movement, they indicate that the user is typing inside the element.
  69515. *
  69516. * Highlight is turned on by adding the given class to the attribute element in the view:
  69517. *
  69518. * * The class is removed before the conversion has started, as callbacks added with the `'highest'` priority
  69519. * to {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher} events.
  69520. * * The class is added in the view post fixer, after other changes in the model tree were converted to the view.
  69521. *
  69522. * This way, adding and removing the highlight does not interfere with conversion.
  69523. *
  69524. * Usage:
  69525. *
  69526. * import inlineHighlight from '@ckeditor/ckeditor5-typing/src/utils/inlinehighlight';
  69527. *
  69528. * // Make `ck-link_selected` class be applied on an `a` element
  69529. * // whenever the corresponding `linkHref` attribute element is selected.
  69530. * inlineHighlight( editor, 'linkHref', 'a', 'ck-link_selected' );
  69531. *
  69532. * @param {module:core/editor/editor~Editor} editor The editor instance.
  69533. * @param {String} attributeName The attribute name to check.
  69534. * @param {String} tagName The tagName of a view item.
  69535. * @param {String} className The class name to apply in the view.
  69536. */
  69537. function inlineHighlight( editor, attributeName, tagName, className ) {
  69538. const view = editor.editing.view;
  69539. const highlightedElements = new Set();
  69540. // Adding the class.
  69541. view.document.registerPostFixer( writer => {
  69542. const selection = editor.model.document.selection;
  69543. let changed = false;
  69544. if ( selection.hasAttribute( attributeName ) ) {
  69545. const modelRange = Object(_findattributerange__WEBPACK_IMPORTED_MODULE_0__["default"])(
  69546. selection.getFirstPosition(),
  69547. attributeName,
  69548. selection.getAttribute( attributeName ),
  69549. editor.model
  69550. );
  69551. const viewRange = editor.editing.mapper.toViewRange( modelRange );
  69552. // There might be multiple view elements in the `viewRange`, for example, when the `a` element is
  69553. // broken by a UIElement.
  69554. for ( const item of viewRange.getItems() ) {
  69555. if ( item.is( 'element', tagName ) && !item.hasClass( className ) ) {
  69556. writer.addClass( className, item );
  69557. highlightedElements.add( item );
  69558. changed = true;
  69559. }
  69560. }
  69561. }
  69562. return changed;
  69563. } );
  69564. // Removing the class.
  69565. editor.conversion.for( 'editingDowncast' ).add( dispatcher => {
  69566. // Make sure the highlight is removed on every possible event, before conversion is started.
  69567. dispatcher.on( 'insert', removeHighlight, { priority: 'highest' } );
  69568. dispatcher.on( 'remove', removeHighlight, { priority: 'highest' } );
  69569. dispatcher.on( 'attribute', removeHighlight, { priority: 'highest' } );
  69570. dispatcher.on( 'selection', removeHighlight, { priority: 'highest' } );
  69571. function removeHighlight() {
  69572. view.change( writer => {
  69573. for ( const item of highlightedElements.values() ) {
  69574. writer.removeClass( className, item );
  69575. highlightedElements.delete( item );
  69576. }
  69577. } );
  69578. }
  69579. } );
  69580. }
  69581. /***/ }),
  69582. /***/ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/utils.js":
  69583. /*!********************************************************************!*\
  69584. !*** ./node_modules/@ckeditor/ckeditor5-typing/src/utils/utils.js ***!
  69585. \********************************************************************/
  69586. /*! exports provided: containerChildrenMutated, getSingleTextNodeChange, compareChildNodes */
  69587. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  69588. "use strict";
  69589. __webpack_require__.r(__webpack_exports__);
  69590. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containerChildrenMutated", function() { return containerChildrenMutated; });
  69591. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSingleTextNodeChange", function() { return getSingleTextNodeChange; });
  69592. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compareChildNodes", function() { return compareChildNodes; });
  69593. /* harmony import */ var _ckeditor_ckeditor5_utils_src_diff__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/diff */ "./node_modules/@ckeditor/ckeditor5-utils/src/diff.js");
  69594. /* harmony import */ var _ckeditor_ckeditor5_utils_src_difftochanges__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/difftochanges */ "./node_modules/@ckeditor/ckeditor5-utils/src/difftochanges.js");
  69595. /**
  69596. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  69597. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  69598. */
  69599. /**
  69600. * @module typing/utils/utils
  69601. */
  69602. /**
  69603. * Returns true if container children have mutated or more than a single text node was changed.
  69604. *
  69605. * @private
  69606. * @param {Array.<module:engine/view/observer/mutationobserver~MutatedText|
  69607. * module:engine/view/observer/mutationobserver~MutatedChildren>} mutations
  69608. * @returns {Boolean}
  69609. */
  69610. function containerChildrenMutated( mutations ) {
  69611. if ( mutations.length == 0 ) {
  69612. return false;
  69613. }
  69614. // Check if there is any mutation of `children` type or any mutation that changes more than one text node.
  69615. for ( const mutation of mutations ) {
  69616. if ( mutation.type === 'children' && !getSingleTextNodeChange( mutation ) ) {
  69617. return true;
  69618. }
  69619. }
  69620. return false;
  69621. }
  69622. /**
  69623. * Returns change made to a single text node.
  69624. *
  69625. * @private
  69626. * @param {module:engine/view/observer/mutationobserver~MutatedText|
  69627. * module:engine/view/observer/mutationobserver~MutatedChildren} mutation
  69628. * @returns {Object|undefined} Change object (see {@link module:utils/difftochanges~diffToChanges} output)
  69629. * or undefined if more than a single text node was changed.
  69630. */
  69631. function getSingleTextNodeChange( mutation ) {
  69632. // One new node.
  69633. if ( mutation.newChildren.length - mutation.oldChildren.length != 1 ) {
  69634. return;
  69635. }
  69636. // Which is text.
  69637. const diffResult = Object(_ckeditor_ckeditor5_utils_src_diff__WEBPACK_IMPORTED_MODULE_0__["default"])( mutation.oldChildren, mutation.newChildren, compareChildNodes );
  69638. const changes = Object(_ckeditor_ckeditor5_utils_src_difftochanges__WEBPACK_IMPORTED_MODULE_1__["default"])( diffResult, mutation.newChildren );
  69639. // In case of [ delete, insert, insert ] the previous check will not exit.
  69640. if ( changes.length > 1 ) {
  69641. return;
  69642. }
  69643. const change = changes[ 0 ];
  69644. // Which is text.
  69645. if ( !( !!change.values[ 0 ] && change.values[ 0 ].is( '$text' ) ) ) {
  69646. return;
  69647. }
  69648. return change;
  69649. }
  69650. /**
  69651. * Checks whether two view nodes are identical, which means they are the same object
  69652. * or contain exactly same data (in case of text nodes).
  69653. *
  69654. * @private
  69655. * @param {module:engine/view/node~Node} oldChild
  69656. * @param {module:engine/view/node~Node} newChild
  69657. * @returns {Boolean}
  69658. */
  69659. function compareChildNodes( oldChild, newChild ) {
  69660. if ( !!oldChild && oldChild.is( '$text' ) && !!newChild && newChild.is( '$text' ) ) {
  69661. return oldChild.data === newChild.data;
  69662. } else {
  69663. return oldChild === newChild;
  69664. }
  69665. }
  69666. /***/ }),
  69667. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler.js":
  69668. /*!*********************************************************************************!*\
  69669. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler.js ***!
  69670. \*********************************************************************************/
  69671. /*! exports provided: default */
  69672. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  69673. "use strict";
  69674. __webpack_require__.r(__webpack_exports__);
  69675. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return clickOutsideHandler; });
  69676. /**
  69677. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  69678. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  69679. */
  69680. /**
  69681. * @module ui/bindings/clickoutsidehandler
  69682. */
  69683. /* global document */
  69684. /**
  69685. * Handles clicking **outside** of a specified set of elements, then fires an action.
  69686. *
  69687. * **Note**: Actually, the action is executed upon `mousedown`, not `click`. It prevents
  69688. * certain issues when the user keeps holding the mouse button and the UI cannot react
  69689. * properly.
  69690. *
  69691. * @param {Object} options Configuration options.
  69692. * @param {module:utils/dom/emittermixin~Emitter} options.emitter The emitter to which this behavior
  69693. * should be added.
  69694. * @param {Function} options.activator Function returning a `Boolean`, to determine whether the handler is active.
  69695. * @param {Array.<HTMLElement>} options.contextElements HTML elements that determine the scope of the
  69696. * handler. Clicking any of them or their descendants will **not** fire the callback.
  69697. * @param {Function} options.callback An action executed by the handler.
  69698. */
  69699. function clickOutsideHandler( { emitter, activator, callback, contextElements } ) {
  69700. emitter.listenTo( document, 'mousedown', ( evt, domEvt ) => {
  69701. if ( !activator() ) {
  69702. return;
  69703. }
  69704. // Check if `composedPath` is `undefined` in case the browser does not support native shadow DOM.
  69705. // Can be removed when all supported browsers support native shadow DOM.
  69706. const path = typeof domEvt.composedPath == 'function' ? domEvt.composedPath() : [];
  69707. for ( const contextElement of contextElements ) {
  69708. if ( contextElement.contains( domEvt.target ) || path.includes( contextElement ) ) {
  69709. return;
  69710. }
  69711. }
  69712. callback();
  69713. } );
  69714. }
  69715. /***/ }),
  69716. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/preventdefault.js":
  69717. /*!****************************************************************************!*\
  69718. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/bindings/preventdefault.js ***!
  69719. \****************************************************************************/
  69720. /*! exports provided: default */
  69721. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  69722. "use strict";
  69723. __webpack_require__.r(__webpack_exports__);
  69724. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return preventDefault; });
  69725. /**
  69726. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  69727. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  69728. */
  69729. /**
  69730. * @module ui/bindings/preventdefault
  69731. */
  69732. /**
  69733. * A helper which executes a native `Event.preventDefault()` if the target of an event equals the
  69734. * {@link module:ui/view~View#element element of the view}. It shortens the definition of a
  69735. * {@link module:ui/view~View#template template}.
  69736. *
  69737. * // In a class extending View.
  69738. * import preventDefault from '@ckeditor/ckeditor5-ui/src/bindings/preventdefault';
  69739. *
  69740. * // ...
  69741. *
  69742. * this.setTemplate( {
  69743. * tag: 'div',
  69744. *
  69745. * on: {
  69746. * // Prevent the default mousedown action on this view.
  69747. * mousedown: preventDefault( this )
  69748. * }
  69749. * } );
  69750. *
  69751. * @param {module:ui/view~View} view View instance that defines the template.
  69752. * @returns {module:ui/template~TemplateToBinding}
  69753. */
  69754. function preventDefault( view ) {
  69755. return view.bindTemplate.to( evt => {
  69756. if ( evt.target === view.element ) {
  69757. evt.preventDefault();
  69758. }
  69759. } );
  69760. }
  69761. /***/ }),
  69762. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/submithandler.js":
  69763. /*!***************************************************************************!*\
  69764. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/bindings/submithandler.js ***!
  69765. \***************************************************************************/
  69766. /*! exports provided: default */
  69767. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  69768. "use strict";
  69769. __webpack_require__.r(__webpack_exports__);
  69770. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return submitHandler; });
  69771. /**
  69772. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  69773. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  69774. */
  69775. /**
  69776. * @module ui/bindings/submithandler
  69777. */
  69778. /**
  69779. * A handler useful for {@link module:ui/view~View views} working as HTML forms. It intercepts a native DOM
  69780. * `submit` event, prevents the default web browser behavior (navigation and page reload) and
  69781. * fires the `submit` event on a view instead. Such a custom event can be then used by any
  69782. * {@link module:utils/dom/emittermixin~Emitter emitter}, e.g. to serialize the form data.
  69783. *
  69784. * import submitHandler from '@ckeditor/ckeditor5-ui/src/bindings/submithandler';
  69785. *
  69786. * // ...
  69787. *
  69788. * class AnyFormView extends View {
  69789. * constructor() {
  69790. * super();
  69791. *
  69792. * // ...
  69793. *
  69794. * submitHandler( {
  69795. * view: this
  69796. * } );
  69797. * }
  69798. * }
  69799. *
  69800. * // ...
  69801. *
  69802. * const view = new AnyFormView();
  69803. *
  69804. * // A sample listener attached by an emitter working with the view.
  69805. * this.listenTo( view, 'submit', () => {
  69806. * saveTheFormData();
  69807. * hideTheForm();
  69808. * } );
  69809. *
  69810. * @param {Object} [options] Configuration options.
  69811. * @param {module:ui/view~View} options.view The view which DOM `submit` events should be handled.
  69812. */
  69813. function submitHandler( { view } ) {
  69814. view.listenTo( view.element, 'submit', ( evt, domEvt ) => {
  69815. domEvt.preventDefault();
  69816. view.fire( 'submit' );
  69817. }, { useCapture: true } );
  69818. }
  69819. /***/ }),
  69820. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js":
  69821. /*!**********************************************************************!*\
  69822. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js ***!
  69823. \**********************************************************************/
  69824. /*! exports provided: default */
  69825. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  69826. "use strict";
  69827. __webpack_require__.r(__webpack_exports__);
  69828. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ButtonView; });
  69829. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  69830. /* harmony import */ var _icon_iconview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../icon/iconview */ "./node_modules/@ckeditor/ckeditor5-ui/src/icon/iconview.js");
  69831. /* harmony import */ var _tooltip_tooltipview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../tooltip/tooltipview */ "./node_modules/@ckeditor/ckeditor5-ui/src/tooltip/tooltipview.js");
  69832. /* harmony import */ var _ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/uid */ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js");
  69833. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
  69834. /* harmony import */ var _theme_components_button_button_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../theme/components/button/button.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/button.css");
  69835. /* harmony import */ var _theme_components_button_button_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_theme_components_button_button_css__WEBPACK_IMPORTED_MODULE_5__);
  69836. /**
  69837. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  69838. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  69839. */
  69840. /**
  69841. * @module ui/button/buttonview
  69842. */
  69843. /**
  69844. * The button view class.
  69845. *
  69846. * const view = new ButtonView();
  69847. *
  69848. * view.set( {
  69849. * label: 'A button',
  69850. * keystroke: 'Ctrl+B',
  69851. * tooltip: true,
  69852. * withText: true
  69853. * } );
  69854. *
  69855. * view.render();
  69856. *
  69857. * document.body.append( view.element );
  69858. *
  69859. * @extends module:ui/view~View
  69860. * @implements module:ui/button/button~Button
  69861. */
  69862. class ButtonView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  69863. /**
  69864. * @inheritDoc
  69865. */
  69866. constructor( locale ) {
  69867. super( locale );
  69868. const bind = this.bindTemplate;
  69869. const ariaLabelUid = Object(_ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_3__["default"])();
  69870. // Implement the Button interface.
  69871. this.set( 'class' );
  69872. this.set( 'labelStyle' );
  69873. this.set( 'icon' );
  69874. this.set( 'isEnabled', true );
  69875. this.set( 'isOn', false );
  69876. this.set( 'isVisible', true );
  69877. this.set( 'isToggleable', false );
  69878. this.set( 'keystroke' );
  69879. this.set( 'label' );
  69880. this.set( 'tabindex', -1 );
  69881. this.set( 'tooltip' );
  69882. this.set( 'tooltipPosition', 's' );
  69883. this.set( 'type', 'button' );
  69884. this.set( 'withText', false );
  69885. this.set( 'withKeystroke', false );
  69886. /**
  69887. * Collection of the child views inside of the button {@link #element}.
  69888. *
  69889. * @readonly
  69890. * @member {module:ui/viewcollection~ViewCollection}
  69891. */
  69892. this.children = this.createCollection();
  69893. /**
  69894. * Tooltip of the button view. It is configurable using the {@link #tooltip tooltip attribute}.
  69895. *
  69896. * @readonly
  69897. * @member {module:ui/tooltip/tooltipview~TooltipView} #tooltipView
  69898. */
  69899. this.tooltipView = this._createTooltipView();
  69900. /**
  69901. * Label of the button view. It is configurable using the {@link #label label attribute}.
  69902. *
  69903. * @readonly
  69904. * @member {module:ui/view~View} #labelView
  69905. */
  69906. this.labelView = this._createLabelView( ariaLabelUid );
  69907. /**
  69908. * The icon view of the button. Will be added to {@link #children} when the
  69909. * {@link #icon icon attribute} is defined.
  69910. *
  69911. * @readonly
  69912. * @member {module:ui/icon/iconview~IconView} #iconView
  69913. */
  69914. this.iconView = new _icon_iconview__WEBPACK_IMPORTED_MODULE_1__["default"]();
  69915. this.iconView.extendTemplate( {
  69916. attributes: {
  69917. class: 'ck-button__icon'
  69918. }
  69919. } );
  69920. /**
  69921. * A view displaying the keystroke of the button next to the {@link #labelView label}.
  69922. * Added to {@link #children} when the {@link #withKeystroke `withKeystroke` attribute}
  69923. * is defined.
  69924. *
  69925. * @readonly
  69926. * @member {module:ui/view/view~View} #keystrokeView
  69927. */
  69928. this.keystrokeView = this._createKeystrokeView();
  69929. /**
  69930. * Tooltip of the button bound to the template.
  69931. *
  69932. * @see #tooltip
  69933. * @see #_getTooltipString
  69934. * @private
  69935. * @observable
  69936. * @member {Boolean} #_tooltipString
  69937. */
  69938. this.bind( '_tooltipString' ).to(
  69939. this, 'tooltip',
  69940. this, 'label',
  69941. this, 'keystroke',
  69942. this._getTooltipString.bind( this )
  69943. );
  69944. this.setTemplate( {
  69945. tag: 'button',
  69946. attributes: {
  69947. class: [
  69948. 'ck',
  69949. 'ck-button',
  69950. bind.to( 'class' ),
  69951. bind.if( 'isEnabled', 'ck-disabled', value => !value ),
  69952. bind.if( 'isVisible', 'ck-hidden', value => !value ),
  69953. bind.to( 'isOn', value => value ? 'ck-on' : 'ck-off' ),
  69954. bind.if( 'withText', 'ck-button_with-text' ),
  69955. bind.if( 'withKeystroke', 'ck-button_with-keystroke' )
  69956. ],
  69957. type: bind.to( 'type', value => value ? value : 'button' ),
  69958. tabindex: bind.to( 'tabindex' ),
  69959. 'aria-labelledby': `ck-editor__aria-label_${ ariaLabelUid }`,
  69960. 'aria-disabled': bind.if( 'isEnabled', true, value => !value ),
  69961. 'aria-pressed': bind.to( 'isOn', value => this.isToggleable ? String( value ) : false )
  69962. },
  69963. children: this.children,
  69964. on: {
  69965. mousedown: bind.to( evt => {
  69966. evt.preventDefault();
  69967. } ),
  69968. click: bind.to( evt => {
  69969. // We can't make the button disabled using the disabled attribute, because it won't be focusable.
  69970. // Though, shouldn't this condition be moved to the button controller?
  69971. if ( this.isEnabled ) {
  69972. this.fire( 'execute' );
  69973. } else {
  69974. // Prevent the default when button is disabled, to block e.g.
  69975. // automatic form submitting. See ckeditor/ckeditor5-link#74.
  69976. evt.preventDefault();
  69977. }
  69978. } )
  69979. }
  69980. } );
  69981. }
  69982. /**
  69983. * @inheritDoc
  69984. */
  69985. render() {
  69986. super.render();
  69987. if ( this.icon ) {
  69988. this.iconView.bind( 'content' ).to( this, 'icon' );
  69989. this.children.add( this.iconView );
  69990. }
  69991. this.children.add( this.tooltipView );
  69992. this.children.add( this.labelView );
  69993. if ( this.withKeystroke ) {
  69994. this.children.add( this.keystrokeView );
  69995. }
  69996. }
  69997. /**
  69998. * Focuses the {@link #element} of the button.
  69999. */
  70000. focus() {
  70001. this.element.focus();
  70002. }
  70003. /**
  70004. * Creates a {@link module:ui/tooltip/tooltipview~TooltipView} instance and binds it with button
  70005. * attributes.
  70006. *
  70007. * @private
  70008. * @returns {module:ui/tooltip/tooltipview~TooltipView}
  70009. */
  70010. _createTooltipView() {
  70011. const tooltipView = new _tooltip_tooltipview__WEBPACK_IMPORTED_MODULE_2__["default"]();
  70012. tooltipView.bind( 'text' ).to( this, '_tooltipString' );
  70013. tooltipView.bind( 'position' ).to( this, 'tooltipPosition' );
  70014. return tooltipView;
  70015. }
  70016. /**
  70017. * Creates a label view instance and binds it with button attributes.
  70018. *
  70019. * @private
  70020. * @param {String} ariaLabelUid The aria label UID.
  70021. * @returns {module:ui/view~View}
  70022. */
  70023. _createLabelView( ariaLabelUid ) {
  70024. const labelView = new _view__WEBPACK_IMPORTED_MODULE_0__["default"]();
  70025. const bind = this.bindTemplate;
  70026. labelView.setTemplate( {
  70027. tag: 'span',
  70028. attributes: {
  70029. class: [
  70030. 'ck',
  70031. 'ck-button__label'
  70032. ],
  70033. style: bind.to( 'labelStyle' ),
  70034. id: `ck-editor__aria-label_${ ariaLabelUid }`
  70035. },
  70036. children: [
  70037. {
  70038. text: this.bindTemplate.to( 'label' )
  70039. }
  70040. ]
  70041. } );
  70042. return labelView;
  70043. }
  70044. /**
  70045. * Creates a view that displays a keystroke next to a {@link #labelView label }
  70046. * and binds it with button attributes.
  70047. *
  70048. * @private
  70049. * @returns {module:ui/view~View}
  70050. */
  70051. _createKeystrokeView() {
  70052. const keystrokeView = new _view__WEBPACK_IMPORTED_MODULE_0__["default"]();
  70053. keystrokeView.setTemplate( {
  70054. tag: 'span',
  70055. attributes: {
  70056. class: [
  70057. 'ck',
  70058. 'ck-button__keystroke'
  70059. ]
  70060. },
  70061. children: [
  70062. {
  70063. text: this.bindTemplate.to( 'keystroke', text => Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_4__["getEnvKeystrokeText"])( text ) )
  70064. }
  70065. ]
  70066. } );
  70067. return keystrokeView;
  70068. }
  70069. /**
  70070. * Gets the text for the {@link #tooltipView} from the combination of
  70071. * {@link #tooltip}, {@link #label} and {@link #keystroke} attributes.
  70072. *
  70073. * @private
  70074. * @see #tooltip
  70075. * @see #_tooltipString
  70076. * @param {Boolean|String|Function} tooltip Button tooltip.
  70077. * @param {String} label Button label.
  70078. * @param {String} keystroke Button keystroke.
  70079. * @returns {String}
  70080. */
  70081. _getTooltipString( tooltip, label, keystroke ) {
  70082. if ( tooltip ) {
  70083. if ( typeof tooltip == 'string' ) {
  70084. return tooltip;
  70085. } else {
  70086. if ( keystroke ) {
  70087. keystroke = Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_4__["getEnvKeystrokeText"])( keystroke );
  70088. }
  70089. if ( tooltip instanceof Function ) {
  70090. return tooltip( label, keystroke );
  70091. } else {
  70092. return `${ label }${ keystroke ? ` (${ keystroke })` : '' }`;
  70093. }
  70094. }
  70095. }
  70096. return '';
  70097. }
  70098. }
  70099. /***/ }),
  70100. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/button/switchbuttonview.js":
  70101. /*!****************************************************************************!*\
  70102. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/button/switchbuttonview.js ***!
  70103. \****************************************************************************/
  70104. /*! exports provided: default */
  70105. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  70106. "use strict";
  70107. __webpack_require__.r(__webpack_exports__);
  70108. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SwitchButtonView; });
  70109. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  70110. /* harmony import */ var _buttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  70111. /* harmony import */ var _theme_components_button_switchbutton_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/components/button/switchbutton.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/switchbutton.css");
  70112. /* harmony import */ var _theme_components_button_switchbutton_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_theme_components_button_switchbutton_css__WEBPACK_IMPORTED_MODULE_2__);
  70113. /**
  70114. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  70115. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  70116. */
  70117. /**
  70118. * @module ui/button/switchbuttonview
  70119. */
  70120. /**
  70121. * The switch button view class.
  70122. *
  70123. * const view = new SwitchButtonView();
  70124. *
  70125. * view.set( {
  70126. * withText: true,
  70127. * label: 'Switch me!'
  70128. * } );
  70129. *
  70130. * view.render();
  70131. *
  70132. * document.body.append( view.element );
  70133. *
  70134. * @extends module:ui/button/buttonview~ButtonView
  70135. */
  70136. class SwitchButtonView extends _buttonview__WEBPACK_IMPORTED_MODULE_1__["default"] {
  70137. /**
  70138. * @inheritDoc
  70139. */
  70140. constructor( locale ) {
  70141. super( locale );
  70142. this.isToggleable = true;
  70143. /**
  70144. * The toggle switch of the button.
  70145. *
  70146. * @readonly
  70147. * @member {module:ui/view~View} #toggleSwitchView
  70148. */
  70149. this.toggleSwitchView = this._createToggleView();
  70150. this.extendTemplate( {
  70151. attributes: {
  70152. class: 'ck-switchbutton'
  70153. }
  70154. } );
  70155. }
  70156. /**
  70157. * @inheritDoc
  70158. */
  70159. render() {
  70160. super.render();
  70161. this.children.add( this.toggleSwitchView );
  70162. }
  70163. /**
  70164. * Creates a toggle child view.
  70165. *
  70166. * @private
  70167. * @returns {module:ui/view~View}
  70168. */
  70169. _createToggleView() {
  70170. const toggleSwitchView = new _view__WEBPACK_IMPORTED_MODULE_0__["default"]();
  70171. toggleSwitchView.setTemplate( {
  70172. tag: 'span',
  70173. attributes: {
  70174. class: [
  70175. 'ck',
  70176. 'ck-button__toggle'
  70177. ]
  70178. },
  70179. children: [
  70180. {
  70181. tag: 'span',
  70182. attributes: {
  70183. class: [
  70184. 'ck',
  70185. 'ck-button__toggle__inner'
  70186. ]
  70187. }
  70188. }
  70189. ]
  70190. } );
  70191. return toggleSwitchView;
  70192. }
  70193. }
  70194. /***/ }),
  70195. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colorgridview.js":
  70196. /*!****************************************************************************!*\
  70197. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colorgridview.js ***!
  70198. \****************************************************************************/
  70199. /*! exports provided: default */
  70200. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  70201. "use strict";
  70202. __webpack_require__.r(__webpack_exports__);
  70203. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ColorGridView; });
  70204. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  70205. /* harmony import */ var _colortileview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./colortileview */ "./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colortileview.js");
  70206. /* harmony import */ var _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/focustracker */ "./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js");
  70207. /* harmony import */ var _focuscycler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../focuscycler */ "./node_modules/@ckeditor/ckeditor5-ui/src/focuscycler.js");
  70208. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keystrokehandler */ "./node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js");
  70209. /* harmony import */ var _theme_components_colorgrid_colorgrid_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../theme/components/colorgrid/colorgrid.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorgrid/colorgrid.css");
  70210. /* harmony import */ var _theme_components_colorgrid_colorgrid_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_theme_components_colorgrid_colorgrid_css__WEBPACK_IMPORTED_MODULE_5__);
  70211. /**
  70212. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  70213. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  70214. */
  70215. /**
  70216. * @module ui/colorgrid/colorgrid
  70217. */
  70218. /**
  70219. * A grid of {@link module:ui/colorgrid/colortile~ColorTileView color tiles}.
  70220. *
  70221. * @extends module:ui/view~View
  70222. */
  70223. class ColorGridView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  70224. /**
  70225. * Creates an instance of a color grid containing {@link module:ui/colorgrid/colortile~ColorTileView tiles}.
  70226. *
  70227. * @param {module:utils/locale~Locale} [locale] The localization services instance.
  70228. * @param {Object} options Component configuration
  70229. * @param {Array.<module:ui/colorgrid/colorgrid~ColorDefinition>} [options.colorDefinitions] Array with definitions
  70230. * required to create the {@link module:ui/colorgrid/colortile~ColorTileView tiles}.
  70231. * @param {Number} options.columns A number of columns to display the tiles.
  70232. */
  70233. constructor( locale, options ) {
  70234. super( locale );
  70235. const colorDefinitions = options && options.colorDefinitions || [];
  70236. const viewStyleAttribute = {};
  70237. if ( options && options.columns ) {
  70238. viewStyleAttribute.gridTemplateColumns = `repeat( ${ options.columns }, 1fr)`;
  70239. }
  70240. /**
  70241. * The color of the currently selected color tile in {@link #items}.
  70242. *
  70243. * @observable
  70244. * @type {String}
  70245. */
  70246. this.set( 'selectedColor' );
  70247. /**
  70248. * Collection of the child tile views.
  70249. *
  70250. * @readonly
  70251. * @member {module:ui/viewcollection~ViewCollection}
  70252. */
  70253. this.items = this.createCollection();
  70254. /**
  70255. * Tracks information about DOM focus in the grid.
  70256. *
  70257. * @readonly
  70258. * @member {module:utils/focustracker~FocusTracker}
  70259. */
  70260. this.focusTracker = new _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_2__["default"]();
  70261. /**
  70262. * Instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
  70263. *
  70264. * @readonly
  70265. * @member {module:utils/keystrokehandler~KeystrokeHandler}
  70266. */
  70267. this.keystrokes = new _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_4__["default"]();
  70268. /**
  70269. * Helps cycling over focusable {@link #items} in the grid.
  70270. *
  70271. * @readonly
  70272. * @protected
  70273. * @member {module:ui/focuscycler~FocusCycler}
  70274. */
  70275. this._focusCycler = new _focuscycler__WEBPACK_IMPORTED_MODULE_3__["default"]( {
  70276. focusables: this.items,
  70277. focusTracker: this.focusTracker,
  70278. keystrokeHandler: this.keystrokes,
  70279. actions: {
  70280. // Navigate grid items backwards using the arrowup key.
  70281. focusPrevious: 'arrowleft',
  70282. // Navigate grid items forwards using the arrowdown key.
  70283. focusNext: 'arrowright'
  70284. }
  70285. } );
  70286. this.items.on( 'add', ( evt, colorTile ) => {
  70287. colorTile.isOn = colorTile.color === this.selectedColor;
  70288. } );
  70289. colorDefinitions.forEach( color => {
  70290. const colorTile = new _colortileview__WEBPACK_IMPORTED_MODULE_1__["default"]();
  70291. colorTile.set( {
  70292. color: color.color,
  70293. label: color.label,
  70294. tooltip: true,
  70295. hasBorder: color.options.hasBorder
  70296. } );
  70297. colorTile.on( 'execute', () => {
  70298. this.fire( 'execute', {
  70299. value: color.color,
  70300. hasBorder: color.options.hasBorder,
  70301. label: color.label
  70302. } );
  70303. } );
  70304. this.items.add( colorTile );
  70305. } );
  70306. this.setTemplate( {
  70307. tag: 'div',
  70308. children: this.items,
  70309. attributes: {
  70310. class: [
  70311. 'ck',
  70312. 'ck-color-grid'
  70313. ],
  70314. style: viewStyleAttribute
  70315. }
  70316. } );
  70317. this.on( 'change:selectedColor', ( evt, name, selectedColor ) => {
  70318. for ( const item of this.items ) {
  70319. item.isOn = item.color === selectedColor;
  70320. }
  70321. } );
  70322. }
  70323. /**
  70324. * Focuses the first focusable in {@link #items}.
  70325. */
  70326. focus() {
  70327. if ( this.items.length ) {
  70328. this.items.first.focus();
  70329. }
  70330. }
  70331. /**
  70332. * Focuses the last focusable in {@link #items}.
  70333. */
  70334. focusLast() {
  70335. if ( this.items.length ) {
  70336. this.items.last.focus();
  70337. }
  70338. }
  70339. /**
  70340. * @inheritDoc
  70341. */
  70342. render() {
  70343. super.render();
  70344. // Items added before rendering should be known to the #focusTracker.
  70345. for ( const item of this.items ) {
  70346. this.focusTracker.add( item.element );
  70347. }
  70348. this.items.on( 'add', ( evt, item ) => {
  70349. this.focusTracker.add( item.element );
  70350. } );
  70351. this.items.on( 'remove', ( evt, item ) => {
  70352. this.focusTracker.remove( item.element );
  70353. } );
  70354. // Start listening for the keystrokes coming from #element.
  70355. this.keystrokes.listenTo( this.element );
  70356. }
  70357. /**
  70358. * Fired when the `ColorTileView` for the picked item is executed.
  70359. *
  70360. * @event execute
  70361. * @param {Object} data Additional information about the event.
  70362. * @param {String} data.value The value of the selected color
  70363. * ({@link module:ui/colorgrid/colorgrid~ColorDefinition#color `color.color`}).
  70364. * @param {Boolean} data.hasBorder The `hasBorder` property of the selected color
  70365. * ({@link module:ui/colorgrid/colorgrid~ColorDefinition#options `color.options.hasBorder`}).
  70366. * @param {String} data.Label The label of the selected color
  70367. * ({@link module:ui/colorgrid/colorgrid~ColorDefinition#label `color.label`})
  70368. */
  70369. }
  70370. /**
  70371. * A color definition used to create a {@link module:ui/colorgrid/colortile~ColorTileView}.
  70372. *
  70373. * {
  70374. * color: 'hsl(0, 0%, 75%)',
  70375. * label: 'Light Grey',
  70376. * options: {
  70377. * hasBorder: true
  70378. * }
  70379. * }
  70380. *
  70381. * @typedef {Object} module:ui/colorgrid/colorgrid~ColorDefinition
  70382. * @type Object
  70383. *
  70384. * @property {String} color String representing a color.
  70385. * It is used as value of background-color style in {@link module:ui/colorgrid/colortile~ColorTileView}.
  70386. * @property {String} label String used as label for {@link module:ui/colorgrid/colortile~ColorTileView}.
  70387. * @property {Object} options Additional options passed to create a {@link module:ui/colorgrid/colortile~ColorTileView}.
  70388. * @property {Boolean} options.hasBorder A flag that indicates if special a CSS class should be added
  70389. * to {@link module:ui/colorgrid/colortile~ColorTileView}, which renders a border around it.
  70390. */
  70391. /***/ }),
  70392. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colortileview.js":
  70393. /*!****************************************************************************!*\
  70394. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colortileview.js ***!
  70395. \****************************************************************************/
  70396. /*! exports provided: default */
  70397. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  70398. "use strict";
  70399. __webpack_require__.r(__webpack_exports__);
  70400. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ColorTileView; });
  70401. /* harmony import */ var _button_buttonview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  70402. /* harmony import */ var _theme_icons_color_tile_check_svg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../theme/icons/color-tile-check.svg */ "./node_modules/@ckeditor/ckeditor5-ui/theme/icons/color-tile-check.svg");
  70403. /**
  70404. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  70405. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  70406. */
  70407. /**
  70408. * @module ui/colorgrid/colortile
  70409. */
  70410. /**
  70411. * This class represents a single color tile in the {@link module:ui/colorgrid/colorgrid~ColorGridView}.
  70412. *
  70413. * @extends module:ui/button/buttonview~ButtonView
  70414. */
  70415. class ColorTileView extends _button_buttonview__WEBPACK_IMPORTED_MODULE_0__["default"] {
  70416. constructor( locale ) {
  70417. super( locale );
  70418. const bind = this.bindTemplate;
  70419. /**
  70420. * String representing a color shown as tile's background.
  70421. *
  70422. * @type {String}
  70423. */
  70424. this.set( 'color' );
  70425. /**
  70426. * A flag that toggles a special CSS class responsible for displaying
  70427. * a border around the button.
  70428. *
  70429. * @type {Boolean}
  70430. */
  70431. this.set( 'hasBorder' );
  70432. this.icon = _theme_icons_color_tile_check_svg__WEBPACK_IMPORTED_MODULE_1__["default"];
  70433. this.extendTemplate( {
  70434. attributes: {
  70435. style: {
  70436. backgroundColor: bind.to( 'color' )
  70437. },
  70438. class: [
  70439. 'ck',
  70440. 'ck-color-grid__tile',
  70441. bind.if( 'hasBorder', 'ck-color-table__color-tile_bordered' )
  70442. ]
  70443. }
  70444. } );
  70445. }
  70446. /**
  70447. * @inheritDoc
  70448. */
  70449. render() {
  70450. super.render();
  70451. this.iconView.fillColor = 'hsl(0, 0%, 100%)';
  70452. }
  70453. }
  70454. /***/ }),
  70455. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/utils.js":
  70456. /*!********************************************************************!*\
  70457. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/utils.js ***!
  70458. \********************************************************************/
  70459. /*! exports provided: getLocalizedColorOptions, normalizeColorOptions, normalizeSingleColorDefinition */
  70460. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  70461. "use strict";
  70462. __webpack_require__.r(__webpack_exports__);
  70463. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocalizedColorOptions", function() { return getLocalizedColorOptions; });
  70464. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeColorOptions", function() { return normalizeColorOptions; });
  70465. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "normalizeSingleColorDefinition", function() { return normalizeSingleColorDefinition; });
  70466. /**
  70467. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  70468. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  70469. */
  70470. /**
  70471. * @module ui/colorgrid/utils
  70472. */
  70473. /**
  70474. * Returns color configuration options as defined in `editor.config.(fontColor|fontBackgroundColor).colors` or
  70475. * `editor.config.table.(tableProperties|tableCellProperties).(background|border).colors
  70476. * but processed to account for editor localization in the correct language.
  70477. *
  70478. * Note: The reason behind this method is that there is no way to use {@link module:utils/locale~Locale#t}
  70479. * when the user configuration is defined because the editor does not exist yet.
  70480. *
  70481. * @param {module:utils/locale~Locale} locale The {@link module:core/editor/editor~Editor#locale} instance.
  70482. * @param {Array.<module:ui/colorgrid/colorgrid~ColorDefinition>} options
  70483. * @returns {Array.<module:ui/colorgrid/colorgrid~ColorDefinition>}.
  70484. */
  70485. function getLocalizedColorOptions( locale, options ) {
  70486. const t = locale.t;
  70487. const localizedColorNames = {
  70488. Black: t( 'Black' ),
  70489. 'Dim grey': t( 'Dim grey' ),
  70490. Grey: t( 'Grey' ),
  70491. 'Light grey': t( 'Light grey' ),
  70492. White: t( 'White' ),
  70493. Red: t( 'Red' ),
  70494. Orange: t( 'Orange' ),
  70495. Yellow: t( 'Yellow' ),
  70496. 'Light green': t( 'Light green' ),
  70497. Green: t( 'Green' ),
  70498. Aquamarine: t( 'Aquamarine' ),
  70499. Turquoise: t( 'Turquoise' ),
  70500. 'Light blue': t( 'Light blue' ),
  70501. Blue: t( 'Blue' ),
  70502. Purple: t( 'Purple' )
  70503. };
  70504. return options.map( colorOption => {
  70505. const label = localizedColorNames[ colorOption.label ];
  70506. if ( label && label != colorOption.label ) {
  70507. colorOption.label = label;
  70508. }
  70509. return colorOption;
  70510. } );
  70511. }
  70512. /**
  70513. * Creates a unified color definition object from color configuration options.
  70514. * The object contains the information necessary to both render the UI and initialize the conversion.
  70515. *
  70516. * @param {module:ui/colorgrid/colorgrid~ColorDefinition} options
  70517. * @returns {Array.<module:ui/colorgrid/colorgrid~ColorDefinition>}
  70518. */
  70519. function normalizeColorOptions( options ) {
  70520. return options
  70521. .map( normalizeSingleColorDefinition )
  70522. .filter( option => !!option );
  70523. }
  70524. // Creates a normalized color definition from the user-defined configuration.
  70525. // The "normalization" means it will create full
  70526. // {@link module:ui/colorgrid/colorgrid~ColorDefinition `ColorDefinition-like`}
  70527. // object for string values, and add a `view` property, for each definition.
  70528. //
  70529. // @param {String|module:ui/colorgrid/colorgrid~ColorDefinition}
  70530. // @returns {module:ui/colorgrid/colorgrid~ColorDefinition}
  70531. function normalizeSingleColorDefinition( color ) {
  70532. if ( typeof color === 'string' ) {
  70533. return {
  70534. model: color,
  70535. label: color,
  70536. hasBorder: false,
  70537. view: {
  70538. name: 'span',
  70539. styles: {
  70540. color
  70541. }
  70542. }
  70543. };
  70544. } else {
  70545. return {
  70546. model: color.color,
  70547. label: color.label || color.color,
  70548. hasBorder: color.hasBorder === undefined ? false : color.hasBorder,
  70549. view: {
  70550. name: 'span',
  70551. styles: {
  70552. color: `${ color.color }`
  70553. }
  70554. }
  70555. };
  70556. }
  70557. }
  70558. /***/ }),
  70559. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/componentfactory.js":
  70560. /*!*********************************************************************!*\
  70561. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/componentfactory.js ***!
  70562. \*********************************************************************/
  70563. /*! exports provided: default */
  70564. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  70565. "use strict";
  70566. __webpack_require__.r(__webpack_exports__);
  70567. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ComponentFactory; });
  70568. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  70569. /**
  70570. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  70571. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  70572. */
  70573. /**
  70574. * @module ui/componentfactory
  70575. */
  70576. /**
  70577. * A helper class implementing the UI component ({@link module:ui/view~View view}) factory.
  70578. *
  70579. * It allows functions producing specific UI components to be registered under their unique names
  70580. * in the factory. A registered component can be then instantiated by providing its name.
  70581. * Note that names are case insensitive.
  70582. *
  70583. * // The editor provides localization tools for the factory.
  70584. * const factory = new ComponentFactory( editor );
  70585. *
  70586. * factory.add( 'foo', locale => new FooView( locale ) );
  70587. * factory.add( 'bar', locale => new BarView( locale ) );
  70588. *
  70589. * // An instance of FooView.
  70590. * const fooInstance = factory.create( 'foo' );
  70591. *
  70592. * // Names are case insensitive so this is also allowed:
  70593. * const barInstance = factory.create( 'Bar' );
  70594. *
  70595. * The {@link module:core/editor/editor~Editor#locale editor locale} is passed to the factory
  70596. * function when {@link module:ui/componentfactory~ComponentFactory#create} is called.
  70597. */
  70598. class ComponentFactory {
  70599. /**
  70600. * Creates an instance of the factory.
  70601. *
  70602. * @constructor
  70603. * @param {module:core/editor/editor~Editor} editor The editor instance.
  70604. */
  70605. constructor( editor ) {
  70606. /**
  70607. * The editor instance that the factory belongs to.
  70608. *
  70609. * @readonly
  70610. * @member {module:core/editor/editor~Editor}
  70611. */
  70612. this.editor = editor;
  70613. /**
  70614. * Registered component factories.
  70615. *
  70616. * @private
  70617. * @member {Map}
  70618. */
  70619. this._components = new Map();
  70620. }
  70621. /**
  70622. * Returns an iterator of registered component names. Names are returned in lower case.
  70623. *
  70624. * @returns {Iterable.<String>}
  70625. */
  70626. * names() {
  70627. for ( const value of this._components.values() ) {
  70628. yield value.originalName;
  70629. }
  70630. }
  70631. /**
  70632. * Registers a component factory function that will be used by the
  70633. * {@link #create create} method and called with the
  70634. * {@link module:core/editor/editor~Editor#locale editor locale} as an argument,
  70635. * allowing localization of the {@link module:ui/view~View view}.
  70636. *
  70637. * @param {String} name The name of the component.
  70638. * @param {Function} callback The callback that returns the component.
  70639. */
  70640. add( name, callback ) {
  70641. this._components.set( getNormalized( name ), { callback, originalName: name } );
  70642. }
  70643. /**
  70644. * Creates an instance of a component registered in the factory under a specific name.
  70645. *
  70646. * When called, the {@link module:core/editor/editor~Editor#locale editor locale} is passed to
  70647. * the previously {@link #add added} factory function, allowing localization of the
  70648. * {@link module:ui/view~View view}.
  70649. *
  70650. * @param {String} name The name of the component.
  70651. * @returns {module:ui/view~View} The instantiated component view.
  70652. */
  70653. create( name ) {
  70654. if ( !this.has( name ) ) {
  70655. /**
  70656. * The required component is not registered in the component factory. Please make sure
  70657. * the provided name is correct and the component has been correctly
  70658. * {@link #add added} to the factory.
  70659. *
  70660. * @error componentfactory-item-missing
  70661. * @param {String} name The name of the missing component.
  70662. */
  70663. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  70664. 'componentfactory-item-missing',
  70665. this,
  70666. { name }
  70667. );
  70668. }
  70669. return this._components.get( getNormalized( name ) ).callback( this.editor.locale );
  70670. }
  70671. /**
  70672. * Checks if a component of a given name is registered in the factory.
  70673. *
  70674. * @param {String} name The name of the component.
  70675. * @returns {Boolean}
  70676. */
  70677. has( name ) {
  70678. return this._components.has( getNormalized( name ) );
  70679. }
  70680. }
  70681. //
  70682. // Ensures that the component name used as the key in the internal map is in lower case.
  70683. //
  70684. // @private
  70685. // @param {String} name
  70686. // @returns {String}
  70687. function getNormalized( name ) {
  70688. return String( name ).toLowerCase();
  70689. }
  70690. /***/ }),
  70691. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/dropdownbuttonview.js":
  70692. /*!***************************************************************************************!*\
  70693. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/dropdownbuttonview.js ***!
  70694. \***************************************************************************************/
  70695. /*! exports provided: default */
  70696. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  70697. "use strict";
  70698. __webpack_require__.r(__webpack_exports__);
  70699. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DropdownButtonView; });
  70700. /* harmony import */ var _button_buttonview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  70701. /* harmony import */ var _theme_icons_dropdown_arrow_svg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../theme/icons/dropdown-arrow.svg */ "./node_modules/@ckeditor/ckeditor5-ui/theme/icons/dropdown-arrow.svg");
  70702. /* harmony import */ var _icon_iconview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../icon/iconview */ "./node_modules/@ckeditor/ckeditor5-ui/src/icon/iconview.js");
  70703. /**
  70704. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  70705. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  70706. */
  70707. /**
  70708. * @module ui/dropdown/button/dropdownbuttonview
  70709. */
  70710. /**
  70711. * The default dropdown button view class.
  70712. *
  70713. * const view = new DropdownButtonView();
  70714. *
  70715. * view.set( {
  70716. * label: 'A button',
  70717. * keystroke: 'Ctrl+B',
  70718. * tooltip: true
  70719. * } );
  70720. *
  70721. * view.render();
  70722. *
  70723. * document.body.append( view.element );
  70724. *
  70725. * Also see the {@link module:ui/dropdown/utils~createDropdown `createDropdown()` util}.
  70726. *
  70727. * @implements module:ui/dropdown/button/dropdownbutton~DropdownButton
  70728. * @extends module:ui/button/buttonview~ButtonView
  70729. */
  70730. class DropdownButtonView extends _button_buttonview__WEBPACK_IMPORTED_MODULE_0__["default"] {
  70731. /**
  70732. * @inheritDoc
  70733. */
  70734. constructor( locale ) {
  70735. super( locale );
  70736. /**
  70737. * An icon that displays arrow to indicate a dropdown button.
  70738. *
  70739. * @readonly
  70740. * @member {module:ui/icon/iconview~IconView}
  70741. */
  70742. this.arrowView = this._createArrowView();
  70743. this.extendTemplate( {
  70744. attributes: {
  70745. 'aria-haspopup': true
  70746. }
  70747. } );
  70748. // The DropdownButton interface expects the open event upon which will open the dropdown.
  70749. this.delegate( 'execute' ).to( this, 'open' );
  70750. }
  70751. /**
  70752. * @inheritDoc
  70753. */
  70754. render() {
  70755. super.render();
  70756. this.children.add( this.arrowView );
  70757. }
  70758. /**
  70759. * Creates a {@link module:ui/icon/iconview~IconView} instance as {@link #arrowView}.
  70760. *
  70761. * @private
  70762. * @returns {module:ui/icon/iconview~IconView}
  70763. */
  70764. _createArrowView() {
  70765. const arrowView = new _icon_iconview__WEBPACK_IMPORTED_MODULE_2__["default"]();
  70766. arrowView.content = _theme_icons_dropdown_arrow_svg__WEBPACK_IMPORTED_MODULE_1__["default"];
  70767. arrowView.extendTemplate( {
  70768. attributes: {
  70769. class: 'ck-dropdown__arrow'
  70770. }
  70771. } );
  70772. return arrowView;
  70773. }
  70774. }
  70775. /***/ }),
  70776. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/splitbuttonview.js":
  70777. /*!************************************************************************************!*\
  70778. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/splitbuttonview.js ***!
  70779. \************************************************************************************/
  70780. /*! exports provided: default */
  70781. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  70782. "use strict";
  70783. __webpack_require__.r(__webpack_exports__);
  70784. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SplitButtonView; });
  70785. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  70786. /* harmony import */ var _button_buttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  70787. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keystrokehandler */ "./node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js");
  70788. /* harmony import */ var _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/focustracker */ "./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js");
  70789. /* harmony import */ var _theme_icons_dropdown_arrow_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../theme/icons/dropdown-arrow.svg */ "./node_modules/@ckeditor/ckeditor5-ui/theme/icons/dropdown-arrow.svg");
  70790. /* harmony import */ var _theme_components_dropdown_splitbutton_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../theme/components/dropdown/splitbutton.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/splitbutton.css");
  70791. /* harmony import */ var _theme_components_dropdown_splitbutton_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_theme_components_dropdown_splitbutton_css__WEBPACK_IMPORTED_MODULE_5__);
  70792. /**
  70793. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  70794. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  70795. */
  70796. /**
  70797. * @module ui/dropdown/button/splitbuttonview
  70798. */
  70799. /**
  70800. * The split button view class.
  70801. *
  70802. * const view = new SplitButtonView();
  70803. *
  70804. * view.set( {
  70805. * label: 'A button',
  70806. * keystroke: 'Ctrl+B',
  70807. * tooltip: true
  70808. * } );
  70809. *
  70810. * view.render();
  70811. *
  70812. * document.body.append( view.element );
  70813. *
  70814. * Also see the {@link module:ui/dropdown/utils~createDropdown `createDropdown()` util}.
  70815. *
  70816. * @implements module:ui/dropdown/button/dropdownbutton~DropdownButton
  70817. * @extends module:ui/view~View
  70818. */
  70819. class SplitButtonView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  70820. /**
  70821. * @inheritDoc
  70822. */
  70823. constructor( locale ) {
  70824. super( locale );
  70825. const bind = this.bindTemplate;
  70826. // Implement the Button interface.
  70827. this.set( 'icon' );
  70828. this.set( 'isEnabled', true );
  70829. this.set( 'isOn', false );
  70830. this.set( 'isToggleable', false );
  70831. this.set( 'isVisible', true );
  70832. this.set( 'keystroke' );
  70833. this.set( 'label' );
  70834. this.set( 'tabindex', -1 );
  70835. this.set( 'tooltip' );
  70836. this.set( 'tooltipPosition', 's' );
  70837. this.set( 'type', 'button' );
  70838. this.set( 'withText', false );
  70839. /**
  70840. * Collection of the child views inside of the split button {@link #element}.
  70841. *
  70842. * @readonly
  70843. * @member {module:ui/viewcollection~ViewCollection}
  70844. */
  70845. this.children = this.createCollection();
  70846. /**
  70847. * A main button of split button.
  70848. *
  70849. * @readonly
  70850. * @member {module:ui/button/buttonview~ButtonView}
  70851. */
  70852. this.actionView = this._createActionView();
  70853. /**
  70854. * A secondary button of split button that opens dropdown.
  70855. *
  70856. * @readonly
  70857. * @member {module:ui/button/buttonview~ButtonView}
  70858. */
  70859. this.arrowView = this._createArrowView();
  70860. /**
  70861. * Instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}. It manages
  70862. * keystrokes of the split button:
  70863. *
  70864. * * <kbd>▶</kbd> moves focus to arrow view when action view is focused,
  70865. * * <kbd>◀</kbd> moves focus to action view when arrow view is focused.
  70866. *
  70867. * @readonly
  70868. * @member {module:utils/keystrokehandler~KeystrokeHandler}
  70869. */
  70870. this.keystrokes = new _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_2__["default"]();
  70871. /**
  70872. * Tracks information about DOM focus in the dropdown.
  70873. *
  70874. * @readonly
  70875. * @member {module:utils/focustracker~FocusTracker}
  70876. */
  70877. this.focusTracker = new _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_3__["default"]();
  70878. this.setTemplate( {
  70879. tag: 'div',
  70880. attributes: {
  70881. class: [
  70882. 'ck',
  70883. 'ck-splitbutton',
  70884. bind.if( 'isVisible', 'ck-hidden', value => !value ),
  70885. this.arrowView.bindTemplate.if( 'isOn', 'ck-splitbutton_open' )
  70886. ]
  70887. },
  70888. children: this.children
  70889. } );
  70890. }
  70891. /**
  70892. * @inheritDoc
  70893. */
  70894. render() {
  70895. super.render();
  70896. this.children.add( this.actionView );
  70897. this.children.add( this.arrowView );
  70898. this.focusTracker.add( this.actionView.element );
  70899. this.focusTracker.add( this.arrowView.element );
  70900. this.keystrokes.listenTo( this.element );
  70901. // Overrides toolbar focus cycling behavior.
  70902. this.keystrokes.set( 'arrowright', ( evt, cancel ) => {
  70903. if ( this.focusTracker.focusedElement === this.actionView.element ) {
  70904. this.arrowView.focus();
  70905. cancel();
  70906. }
  70907. } );
  70908. // Overrides toolbar focus cycling behavior.
  70909. this.keystrokes.set( 'arrowleft', ( evt, cancel ) => {
  70910. if ( this.focusTracker.focusedElement === this.arrowView.element ) {
  70911. this.actionView.focus();
  70912. cancel();
  70913. }
  70914. } );
  70915. }
  70916. /**
  70917. * Focuses the {@link #actionView#element} of the action part of split button.
  70918. */
  70919. focus() {
  70920. this.actionView.focus();
  70921. }
  70922. /**
  70923. * Creates a {@link module:ui/button/buttonview~ButtonView} instance as {@link #actionView} and binds it with main split button
  70924. * attributes.
  70925. *
  70926. * @private
  70927. * @returns {module:ui/button/buttonview~ButtonView}
  70928. */
  70929. _createActionView() {
  70930. const actionView = new _button_buttonview__WEBPACK_IMPORTED_MODULE_1__["default"]();
  70931. actionView.bind(
  70932. 'icon',
  70933. 'isEnabled',
  70934. 'isOn',
  70935. 'isToggleable',
  70936. 'keystroke',
  70937. 'label',
  70938. 'tabindex',
  70939. 'tooltip',
  70940. 'tooltipPosition',
  70941. 'type',
  70942. 'withText'
  70943. ).to( this );
  70944. actionView.extendTemplate( {
  70945. attributes: {
  70946. class: 'ck-splitbutton__action'
  70947. }
  70948. } );
  70949. actionView.delegate( 'execute' ).to( this );
  70950. return actionView;
  70951. }
  70952. /**
  70953. * Creates a {@link module:ui/button/buttonview~ButtonView} instance as {@link #arrowView} and binds it with main split button
  70954. * attributes.
  70955. *
  70956. * @private
  70957. * @returns {module:ui/button/buttonview~ButtonView}
  70958. */
  70959. _createArrowView() {
  70960. const arrowView = new _button_buttonview__WEBPACK_IMPORTED_MODULE_1__["default"]();
  70961. const bind = arrowView.bindTemplate;
  70962. arrowView.icon = _theme_icons_dropdown_arrow_svg__WEBPACK_IMPORTED_MODULE_4__["default"];
  70963. arrowView.extendTemplate( {
  70964. attributes: {
  70965. class: 'ck-splitbutton__arrow',
  70966. 'aria-haspopup': true,
  70967. 'aria-expanded': bind.to( 'isOn', value => String( value ) )
  70968. }
  70969. } );
  70970. arrowView.bind( 'isEnabled' ).to( this );
  70971. arrowView.delegate( 'execute' ).to( this, 'open' );
  70972. return arrowView;
  70973. }
  70974. }
  70975. /***/ }),
  70976. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/dropdownpanelview.js":
  70977. /*!*******************************************************************************!*\
  70978. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/dropdownpanelview.js ***!
  70979. \*******************************************************************************/
  70980. /*! exports provided: default */
  70981. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  70982. "use strict";
  70983. __webpack_require__.r(__webpack_exports__);
  70984. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DropdownPanelView; });
  70985. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  70986. /**
  70987. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  70988. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  70989. */
  70990. /**
  70991. * @module ui/dropdown/dropdownpanelview
  70992. */
  70993. /**
  70994. * The dropdown panel view class.
  70995. *
  70996. * See {@link module:ui/dropdown/dropdownview~DropdownView} to learn about the common usage.
  70997. *
  70998. * @extends module:ui/view~View
  70999. */
  71000. class DropdownPanelView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  71001. /**
  71002. * @inheritDoc
  71003. */
  71004. constructor( locale ) {
  71005. super( locale );
  71006. const bind = this.bindTemplate;
  71007. /**
  71008. * Controls whether the panel is visible.
  71009. *
  71010. * @observable
  71011. * @member {Boolean} #isVisible
  71012. */
  71013. this.set( 'isVisible', false );
  71014. /**
  71015. * The position of the panel, relative to the parent.
  71016. *
  71017. * This property is reflected in the CSS class set to {@link #element} that controls
  71018. * the position of the panel.
  71019. *
  71020. * @observable
  71021. * @default 'se'
  71022. * @member {'se'|'sw'|'ne'|'nw'} #position
  71023. */
  71024. this.set( 'position', 'se' );
  71025. /**
  71026. * Collection of the child views in this panel.
  71027. *
  71028. * A common child type is the {@link module:ui/list/listview~ListView} and {@link module:ui/toolbar/toolbarview~ToolbarView}.
  71029. * See {@link module:ui/dropdown/utils~addListToDropdown} and
  71030. * {@link module:ui/dropdown/utils~addToolbarToDropdown} to learn more about child views of dropdowns.
  71031. *
  71032. * @readonly
  71033. * @member {module:ui/viewcollection~ViewCollection}
  71034. */
  71035. this.children = this.createCollection();
  71036. this.setTemplate( {
  71037. tag: 'div',
  71038. attributes: {
  71039. class: [
  71040. 'ck',
  71041. 'ck-reset',
  71042. 'ck-dropdown__panel',
  71043. bind.to( 'position', value => `ck-dropdown__panel_${ value }` ),
  71044. bind.if( 'isVisible', 'ck-dropdown__panel-visible' )
  71045. ]
  71046. },
  71047. children: this.children,
  71048. on: {
  71049. // Drag and drop in the panel should not break the selection in the editor.
  71050. // https://github.com/ckeditor/ckeditor5-ui/issues/228
  71051. selectstart: bind.to( evt => evt.preventDefault() )
  71052. }
  71053. } );
  71054. }
  71055. /**
  71056. * Focuses the view element or first item in view collection on opening dropdown's panel.
  71057. *
  71058. * See also {@link module:ui/dropdown/dropdownpanelfocusable~DropdownPanelFocusable}.
  71059. */
  71060. focus() {
  71061. if ( this.children.length ) {
  71062. this.children.first.focus();
  71063. }
  71064. }
  71065. /**
  71066. * Focuses the view element or last item in view collection on opening dropdown's panel.
  71067. *
  71068. * See also {@link module:ui/dropdown/dropdownpanelfocusable~DropdownPanelFocusable}.
  71069. */
  71070. focusLast() {
  71071. if ( this.children.length ) {
  71072. const lastChild = this.children.last;
  71073. if ( typeof lastChild.focusLast === 'function' ) {
  71074. lastChild.focusLast();
  71075. } else {
  71076. lastChild.focus();
  71077. }
  71078. }
  71079. }
  71080. }
  71081. /***/ }),
  71082. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/dropdownview.js":
  71083. /*!**************************************************************************!*\
  71084. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/dropdownview.js ***!
  71085. \**************************************************************************/
  71086. /*! exports provided: default */
  71087. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  71088. "use strict";
  71089. __webpack_require__.r(__webpack_exports__);
  71090. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DropdownView; });
  71091. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  71092. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keystrokehandler */ "./node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js");
  71093. /* harmony import */ var _theme_components_dropdown_dropdown_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/components/dropdown/dropdown.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/dropdown.css");
  71094. /* harmony import */ var _theme_components_dropdown_dropdown_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_theme_components_dropdown_dropdown_css__WEBPACK_IMPORTED_MODULE_2__);
  71095. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_position__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/position */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/position.js");
  71096. /**
  71097. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  71098. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  71099. */
  71100. /**
  71101. * @module ui/dropdown/dropdownview
  71102. */
  71103. /**
  71104. * The dropdown view class. It manages the dropdown button and dropdown panel.
  71105. *
  71106. * In most cases, the easiest way to create a dropdown is by using the {@link module:ui/dropdown/utils~createDropdown}
  71107. * util:
  71108. *
  71109. * const dropdown = createDropdown( locale );
  71110. *
  71111. * // Configure dropdown's button properties:
  71112. * dropdown.buttonView.set( {
  71113. * label: 'A dropdown',
  71114. * withText: true
  71115. * } );
  71116. *
  71117. * dropdown.render();
  71118. *
  71119. * dropdown.panelView.element.textContent = 'Content of the panel';
  71120. *
  71121. * // Will render a dropdown with a panel containing a "Content of the panel" text.
  71122. * document.body.appendChild( dropdown.element );
  71123. *
  71124. * If you want to add a richer content to the dropdown panel, you can use the {@link module:ui/dropdown/utils~addListToDropdown}
  71125. * and {@link module:ui/dropdown/utils~addToolbarToDropdown} helpers. See more examples in
  71126. * {@link module:ui/dropdown/utils~createDropdown} documentation.
  71127. *
  71128. * If you want to create a completely custom dropdown, then you can compose it manually:
  71129. *
  71130. * const button = new DropdownButtonView( locale );
  71131. * const panel = new DropdownPanelView( locale );
  71132. * const dropdown = new DropdownView( locale, button, panel );
  71133. *
  71134. * button.set( {
  71135. * label: 'A dropdown',
  71136. * withText: true
  71137. * } );
  71138. *
  71139. * dropdown.render();
  71140. *
  71141. * panel.element.textContent = 'Content of the panel';
  71142. *
  71143. * // Will render a dropdown with a panel containing a "Content of the panel" text.
  71144. * document.body.appendChild( dropdown.element );
  71145. *
  71146. * However, dropdown created this way will contain little behavior. You will need to implement handlers for actions
  71147. * such as {@link module:ui/bindings/clickoutsidehandler~clickOutsideHandler clicking outside an open dropdown}
  71148. * (which should close it) and support for arrow keys inside the panel. Therefore, unless you really know what
  71149. * you do and you really need to do it, it is recommended to use the {@link module:ui/dropdown/utils~createDropdown} helper.
  71150. *
  71151. * @extends module:ui/view~View
  71152. */
  71153. class DropdownView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  71154. /**
  71155. * Creates an instance of the dropdown.
  71156. *
  71157. * Also see {@link #render}.
  71158. *
  71159. * @param {module:utils/locale~Locale} [locale] The localization services instance.
  71160. * @param {module:ui/dropdown/button/dropdownbutton~DropdownButton} buttonView
  71161. * @param {module:ui/dropdown/dropdownpanelview~DropdownPanelView} panelView
  71162. */
  71163. constructor( locale, buttonView, panelView ) {
  71164. super( locale );
  71165. const bind = this.bindTemplate;
  71166. /**
  71167. * Button of the dropdown view. Clicking the button opens the {@link #panelView}.
  71168. *
  71169. * @readonly
  71170. * @member {module:ui/button/buttonview~ButtonView} #buttonView
  71171. */
  71172. this.buttonView = buttonView;
  71173. /**
  71174. * Panel of the dropdown. It opens when the {@link #buttonView} is
  71175. * {@link module:ui/button/buttonview~ButtonView#event:execute executed} (i.e. clicked).
  71176. *
  71177. * Child views can be added to the panel's `children` collection:
  71178. *
  71179. * dropdown.panelView.children.add( childView );
  71180. *
  71181. * See {@link module:ui/dropdown/dropdownpanelview~DropdownPanelView#children} and
  71182. * {@link module:ui/viewcollection~ViewCollection#add}.
  71183. *
  71184. * @readonly
  71185. * @member {module:ui/dropdown/dropdownpanelview~DropdownPanelView} #panelView
  71186. */
  71187. this.panelView = panelView;
  71188. /**
  71189. * Controls whether the dropdown view is open, i.e. shows or hides the {@link #panelView panel}.
  71190. *
  71191. * @observable
  71192. * @member {Boolean} #isOpen
  71193. */
  71194. this.set( 'isOpen', false );
  71195. /**
  71196. * Controls whether the dropdown is enabled, i.e. it can be clicked and execute an action.
  71197. *
  71198. * See {@link module:ui/button/buttonview~ButtonView#isEnabled}.
  71199. *
  71200. * @observable
  71201. * @member {Boolean} #isEnabled
  71202. */
  71203. this.set( 'isEnabled', true );
  71204. /**
  71205. * (Optional) The additional CSS class set on the dropdown {@link #element}.
  71206. *
  71207. * @observable
  71208. * @member {String} #class
  71209. */
  71210. this.set( 'class' );
  71211. /**
  71212. * (Optional) The `id` attribute of the dropdown (i.e. to pair with a `<label>` element).
  71213. *
  71214. * @observable
  71215. * @member {String} #id
  71216. */
  71217. this.set( 'id' );
  71218. /**
  71219. * The position of the panel, relative to the dropdown.
  71220. *
  71221. * **Note**: When `'auto'`, the panel will use one of the remaining positions to stay
  71222. * in the viewport, visible to the user. The positions correspond directly to
  71223. * {@link module:ui/dropdown/dropdownview~DropdownView.defaultPanelPositions default panel positions}.
  71224. *
  71225. * **Note**: This value has an impact on the
  71226. * {@link module:ui/dropdown/dropdownpanelview~DropdownPanelView#position} property
  71227. * each time the panel becomes {@link #isOpen open}.
  71228. *
  71229. * @observable
  71230. * @default 'auto'
  71231. * @member {'auto'|'se'|'sw'|'ne'|'nw'} #panelPosition
  71232. */
  71233. this.set( 'panelPosition', 'auto' );
  71234. /**
  71235. * Instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}. It manages
  71236. * keystrokes of the dropdown:
  71237. *
  71238. * * <kbd>▼</kbd> opens the dropdown,
  71239. * * <kbd>◀</kbd> and <kbd>Esc</kbd> closes the dropdown.
  71240. *
  71241. * @readonly
  71242. * @member {module:utils/keystrokehandler~KeystrokeHandler}
  71243. */
  71244. this.keystrokes = new _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_1__["default"]();
  71245. this.setTemplate( {
  71246. tag: 'div',
  71247. attributes: {
  71248. class: [
  71249. 'ck',
  71250. 'ck-dropdown',
  71251. bind.to( 'class' ),
  71252. bind.if( 'isEnabled', 'ck-disabled', value => !value )
  71253. ],
  71254. id: bind.to( 'id' ),
  71255. 'aria-describedby': bind.to( 'ariaDescribedById' )
  71256. },
  71257. children: [
  71258. buttonView,
  71259. panelView
  71260. ]
  71261. } );
  71262. buttonView.extendTemplate( {
  71263. attributes: {
  71264. class: [
  71265. 'ck-dropdown__button'
  71266. ]
  71267. }
  71268. } );
  71269. /**
  71270. * A child {@link module:ui/list/listview~ListView list view} of the dropdown located
  71271. * in its {@link module:ui/dropdown/dropdownview~DropdownView#panelView panel}.
  71272. *
  71273. * **Note**: Only supported when dropdown has list view added using {@link module:ui/dropdown/utils~addListToDropdown}.
  71274. *
  71275. * @readonly
  71276. * @member {module:ui/list/listview~ListView} #listView
  71277. */
  71278. /**
  71279. * A child toolbar of the dropdown located in the
  71280. * {@link module:ui/dropdown/dropdownview~DropdownView#panelView panel}.
  71281. *
  71282. * **Note**: Only supported when dropdown has list view added using {@link module:ui/dropdown/utils~addToolbarToDropdown}.
  71283. *
  71284. * @readonly
  71285. * @member {module:ui/toolbar/toolbarview~ToolbarView} #toolbarView
  71286. */
  71287. /**
  71288. * Fired when the toolbar button or list item is executed.
  71289. *
  71290. * For {@link #listView} It fires when a child of some {@link module:ui/list/listitemview~ListItemView}
  71291. * fired `execute`.
  71292. *
  71293. * For {@link #toolbarView} It fires when one of the buttons has been
  71294. * {@link module:ui/button/buttonview~ButtonView#event:execute executed}.
  71295. *
  71296. * **Note**: Only supported when dropdown has list view added using {@link module:ui/dropdown/utils~addListToDropdown}
  71297. * or {@link module:ui/dropdown/utils~addToolbarToDropdown}.
  71298. *
  71299. * @event execute
  71300. */
  71301. }
  71302. /**
  71303. * @inheritDoc
  71304. */
  71305. render() {
  71306. super.render();
  71307. // Toggle the dropdown when its button has been clicked.
  71308. this.listenTo( this.buttonView, 'open', () => {
  71309. this.isOpen = !this.isOpen;
  71310. } );
  71311. // Toggle the visibility of the panel when the dropdown becomes open.
  71312. this.panelView.bind( 'isVisible' ).to( this, 'isOpen' );
  71313. // Let the dropdown control the position of the panel. The position must
  71314. // be updated every time the dropdown is open.
  71315. this.on( 'change:isOpen', () => {
  71316. if ( !this.isOpen ) {
  71317. return;
  71318. }
  71319. // If "auto", find the best position of the panel to fit into the viewport.
  71320. // Otherwise, simply assign the static position.
  71321. if ( this.panelPosition === 'auto' ) {
  71322. this.panelView.position = DropdownView._getOptimalPosition( {
  71323. element: this.panelView.element,
  71324. target: this.buttonView.element,
  71325. fitInViewport: true,
  71326. positions: this._panelPositions
  71327. } ).name;
  71328. } else {
  71329. this.panelView.position = this.panelPosition;
  71330. }
  71331. } );
  71332. // Listen for keystrokes coming from within #element.
  71333. this.keystrokes.listenTo( this.element );
  71334. const closeDropdown = ( data, cancel ) => {
  71335. if ( this.isOpen ) {
  71336. this.buttonView.focus();
  71337. this.isOpen = false;
  71338. cancel();
  71339. }
  71340. };
  71341. // Open the dropdown panel using the arrow down key, just like with return or space.
  71342. this.keystrokes.set( 'arrowdown', ( data, cancel ) => {
  71343. // Don't open if the dropdown is disabled or already open.
  71344. if ( this.buttonView.isEnabled && !this.isOpen ) {
  71345. this.isOpen = true;
  71346. cancel();
  71347. }
  71348. } );
  71349. // Block the right arrow key (until nested dropdowns are implemented).
  71350. this.keystrokes.set( 'arrowright', ( data, cancel ) => {
  71351. if ( this.isOpen ) {
  71352. cancel();
  71353. }
  71354. } );
  71355. // Close the dropdown using the arrow left/escape key.
  71356. this.keystrokes.set( 'arrowleft', closeDropdown );
  71357. this.keystrokes.set( 'esc', closeDropdown );
  71358. }
  71359. /**
  71360. * Focuses the {@link #buttonView}.
  71361. */
  71362. focus() {
  71363. this.buttonView.focus();
  71364. }
  71365. /**
  71366. * Returns {@link #panelView panel} positions to be used by the
  71367. * {@link module:utils/dom/position~getOptimalPosition `getOptimalPosition()`}
  71368. * utility considering the direction of the language the UI of the editor is displayed in.
  71369. *
  71370. * @type {module:utils/dom/position~Options#positions}
  71371. * @private
  71372. */
  71373. get _panelPositions() {
  71374. const { southEast, southWest, northEast, northWest } = DropdownView.defaultPanelPositions;
  71375. if ( this.locale.uiLanguageDirection === 'ltr' ) {
  71376. return [ southEast, southWest, northEast, northWest ];
  71377. } else {
  71378. return [ southWest, southEast, northWest, northEast ];
  71379. }
  71380. }
  71381. }
  71382. /**
  71383. * A set of positioning functions used by the dropdown view to determine
  71384. * the optimal position (i.e. fitting into the browser viewport) of its
  71385. * {@link module:ui/dropdown/dropdownview~DropdownView#panelView panel} when
  71386. * {@link module:ui/dropdown/dropdownview~DropdownView#panelPosition} is set to 'auto'`.
  71387. *
  71388. * The available positioning functions are as follow:
  71389. *
  71390. * **South**
  71391. *
  71392. * * `southEast`
  71393. *
  71394. * [ Button ]
  71395. * +-----------------+
  71396. * | Panel |
  71397. * +-----------------+
  71398. *
  71399. * * `southWest`
  71400. *
  71401. * [ Button ]
  71402. * +-----------------+
  71403. * | Panel |
  71404. * +-----------------+
  71405. *
  71406. * **North**
  71407. *
  71408. * * `northEast`
  71409. *
  71410. * +-----------------+
  71411. * | Panel |
  71412. * +-----------------+
  71413. * [ Button ]
  71414. *
  71415. * * `northWest`
  71416. *
  71417. * +-----------------+
  71418. * | Panel |
  71419. * +-----------------+
  71420. * [ Button ]
  71421. *
  71422. * Positioning functions are compatible with {@link module:utils/dom/position~Position}.
  71423. *
  71424. * The name that position function returns will be reflected in dropdown panel's class that
  71425. * controls its placement. See {@link module:ui/dropdown/dropdownview~DropdownView#panelPosition}
  71426. * to learn more.
  71427. *
  71428. * @member {Object} module:ui/dropdown/dropdownview~DropdownView.defaultPanelPositions
  71429. */
  71430. DropdownView.defaultPanelPositions = {
  71431. southEast: buttonRect => {
  71432. return {
  71433. top: buttonRect.bottom,
  71434. left: buttonRect.left,
  71435. name: 'se'
  71436. };
  71437. },
  71438. southWest: ( buttonRect, panelRect ) => {
  71439. return {
  71440. top: buttonRect.bottom,
  71441. left: buttonRect.left - panelRect.width + buttonRect.width,
  71442. name: 'sw'
  71443. };
  71444. },
  71445. northEast: ( buttonRect, panelRect ) => {
  71446. return {
  71447. top: buttonRect.top - panelRect.height,
  71448. left: buttonRect.left,
  71449. name: 'ne'
  71450. };
  71451. },
  71452. northWest: ( buttonRect, panelRect ) => {
  71453. return {
  71454. top: buttonRect.bottom - panelRect.height,
  71455. left: buttonRect.left - panelRect.width + buttonRect.width,
  71456. name: 'nw'
  71457. };
  71458. }
  71459. };
  71460. /**
  71461. * A function used to calculate the optimal position for the dropdown panel.
  71462. *
  71463. * @protected
  71464. * @member {Function} module:ui/dropdown/dropdownview~DropdownView._getOptimalPosition
  71465. */
  71466. DropdownView._getOptimalPosition = _ckeditor_ckeditor5_utils_src_dom_position__WEBPACK_IMPORTED_MODULE_3__["getOptimalPosition"];
  71467. /***/ }),
  71468. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/utils.js":
  71469. /*!*******************************************************************!*\
  71470. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/utils.js ***!
  71471. \*******************************************************************/
  71472. /*! exports provided: createDropdown, addToolbarToDropdown, addListToDropdown */
  71473. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  71474. "use strict";
  71475. __webpack_require__.r(__webpack_exports__);
  71476. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createDropdown", function() { return createDropdown; });
  71477. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addToolbarToDropdown", function() { return addToolbarToDropdown; });
  71478. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addListToDropdown", function() { return addListToDropdown; });
  71479. /* harmony import */ var _dropdownpanelview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dropdownpanelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/dropdownpanelview.js");
  71480. /* harmony import */ var _dropdownview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./dropdownview */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/dropdownview.js");
  71481. /* harmony import */ var _button_dropdownbuttonview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./button/dropdownbuttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/dropdownbuttonview.js");
  71482. /* harmony import */ var _toolbar_toolbarview__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../toolbar/toolbarview */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarview.js");
  71483. /* harmony import */ var _list_listview__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../list/listview */ "./node_modules/@ckeditor/ckeditor5-ui/src/list/listview.js");
  71484. /* harmony import */ var _list_listitemview__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../list/listitemview */ "./node_modules/@ckeditor/ckeditor5-ui/src/list/listitemview.js");
  71485. /* harmony import */ var _list_listseparatorview__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../list/listseparatorview */ "./node_modules/@ckeditor/ckeditor5-ui/src/list/listseparatorview.js");
  71486. /* harmony import */ var _button_buttonview__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  71487. /* harmony import */ var _button_switchbuttonview__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../button/switchbuttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/switchbuttonview.js");
  71488. /* harmony import */ var _bindings_clickoutsidehandler__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../bindings/clickoutsidehandler */ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler.js");
  71489. /* harmony import */ var _theme_components_dropdown_toolbardropdown_css__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../theme/components/dropdown/toolbardropdown.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css");
  71490. /* harmony import */ var _theme_components_dropdown_toolbardropdown_css__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_theme_components_dropdown_toolbardropdown_css__WEBPACK_IMPORTED_MODULE_10__);
  71491. /* harmony import */ var _theme_components_dropdown_listdropdown_css__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../theme/components/dropdown/listdropdown.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/listdropdown.css");
  71492. /* harmony import */ var _theme_components_dropdown_listdropdown_css__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_theme_components_dropdown_listdropdown_css__WEBPACK_IMPORTED_MODULE_11__);
  71493. /**
  71494. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  71495. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  71496. */
  71497. /**
  71498. * @module ui/dropdown/utils
  71499. */
  71500. /**
  71501. * A helper for creating dropdowns. It creates an instance of a {@link module:ui/dropdown/dropdownview~DropdownView dropdown},
  71502. * with a {@link module:ui/dropdown/button/dropdownbutton~DropdownButton button},
  71503. * {@link module:ui/dropdown/dropdownpanelview~DropdownPanelView panel} and all standard dropdown's behaviors.
  71504. *
  71505. * # Creating dropdowns
  71506. *
  71507. * By default, the default {@link module:ui/dropdown/button/dropdownbuttonview~DropdownButtonView} class is used as
  71508. * definition of the button:
  71509. *
  71510. * const dropdown = createDropdown( model );
  71511. *
  71512. * // Configure dropdown's button properties:
  71513. * dropdown.buttonView.set( {
  71514. * label: 'A dropdown',
  71515. * withText: true
  71516. * } );
  71517. *
  71518. * dropdown.render();
  71519. *
  71520. * // Will render a dropdown labeled "A dropdown" with an empty panel.
  71521. * document.body.appendChild( dropdown.element );
  71522. *
  71523. * You can also provide other button views (they need to implement the
  71524. * {@link module:ui/dropdown/button/dropdownbutton~DropdownButton} interface). For instance, you can use
  71525. * {@link module:ui/dropdown/button/splitbuttonview~SplitButtonView} to create a dropdown with a split button.
  71526. *
  71527. * const dropdown = createDropdown( model, SplitButtonView );
  71528. *
  71529. * // Configure dropdown's button properties:
  71530. * dropdown.buttonView.set( {
  71531. * label: 'A dropdown',
  71532. * withText: true
  71533. * } );
  71534. *
  71535. * dropdown.buttonView.on( 'execute', () => {
  71536. * // Add the behavior of the "action part" of the split button.
  71537. * // Split button consists of the "action part" and "arrow part".
  71538. * // The arrow opens the dropdown while the action part can have some other behavior.
  71539. * } );
  71540. *
  71541. * dropdown.render();
  71542. *
  71543. * // Will render a dropdown labeled "A dropdown" with an empty panel.
  71544. * document.body.appendChild( dropdown.element );
  71545. *
  71546. * # Adding content to the dropdown's panel
  71547. *
  71548. * The content of the panel can be inserted directly into the `dropdown.panelView.element`:
  71549. *
  71550. * dropdown.panelView.element.textContent = 'Content of the panel';
  71551. *
  71552. * However, most of the time you will want to add there either a {@link module:ui/list/listview~ListView list of options}
  71553. * or a list of buttons (i.e. a {@link module:ui/toolbar/toolbarview~ToolbarView toolbar}).
  71554. * To simplify the task, you can use, respectively, {@link module:ui/dropdown/utils~addListToDropdown} or
  71555. * {@link module:ui/dropdown/utils~addToolbarToDropdown} utils.
  71556. *
  71557. * @param {module:utils/locale~Locale} locale The locale instance.
  71558. * @param {Function} ButtonClass The dropdown button view class. Needs to implement the
  71559. * {@link module:ui/dropdown/button/dropdownbutton~DropdownButton} interface.
  71560. * @returns {module:ui/dropdown/dropdownview~DropdownView} The dropdown view instance.
  71561. */
  71562. function createDropdown( locale, ButtonClass = _button_dropdownbuttonview__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
  71563. const buttonView = new ButtonClass( locale );
  71564. const panelView = new _dropdownpanelview__WEBPACK_IMPORTED_MODULE_0__["default"]( locale );
  71565. const dropdownView = new _dropdownview__WEBPACK_IMPORTED_MODULE_1__["default"]( locale, buttonView, panelView );
  71566. buttonView.bind( 'isEnabled' ).to( dropdownView );
  71567. if ( buttonView instanceof _button_dropdownbuttonview__WEBPACK_IMPORTED_MODULE_2__["default"] ) {
  71568. buttonView.bind( 'isOn' ).to( dropdownView, 'isOpen' );
  71569. } else {
  71570. buttonView.arrowView.bind( 'isOn' ).to( dropdownView, 'isOpen' );
  71571. }
  71572. addDefaultBehavior( dropdownView );
  71573. return dropdownView;
  71574. }
  71575. /**
  71576. * Adds an instance of {@link module:ui/toolbar/toolbarview~ToolbarView} to a dropdown.
  71577. *
  71578. * const buttons = [];
  71579. *
  71580. * // Either create a new ButtonView instance or create existing.
  71581. * buttons.push( new ButtonView() );
  71582. * buttons.push( editor.ui.componentFactory.get( 'someButton' ) );
  71583. *
  71584. * const dropdown = createDropdown( locale );
  71585. *
  71586. * addToolbarToDropdown( dropdown, buttons );
  71587. *
  71588. * dropdown.toolbarView.isVertical = true;
  71589. *
  71590. * // Will render a vertical button dropdown labeled "A button dropdown"
  71591. * // with a button group in the panel containing two buttons.
  71592. * dropdown.render()
  71593. * document.body.appendChild( dropdown.element );
  71594. *
  71595. * See {@link module:ui/dropdown/utils~createDropdown} and {@link module:ui/toolbar/toolbarview~ToolbarView}.
  71596. *
  71597. * @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView A dropdown instance to which `ToolbarView` will be added.
  71598. * @param {Iterable.<module:ui/button/buttonview~ButtonView>} buttons
  71599. */
  71600. function addToolbarToDropdown( dropdownView, buttons ) {
  71601. const locale = dropdownView.locale;
  71602. const t = locale.t;
  71603. const toolbarView = dropdownView.toolbarView = new _toolbar_toolbarview__WEBPACK_IMPORTED_MODULE_3__["default"]( locale );
  71604. toolbarView.set( 'ariaLabel', t( 'Dropdown toolbar' ) );
  71605. dropdownView.extendTemplate( {
  71606. attributes: {
  71607. class: [ 'ck-toolbar-dropdown' ]
  71608. }
  71609. } );
  71610. buttons.map( view => toolbarView.items.add( view ) );
  71611. dropdownView.panelView.children.add( toolbarView );
  71612. toolbarView.items.delegate( 'execute' ).to( dropdownView );
  71613. }
  71614. /**
  71615. * Adds an instance of {@link module:ui/list/listview~ListView} to a dropdown.
  71616. *
  71617. * const items = new Collection();
  71618. *
  71619. * items.add( {
  71620. * type: 'button',
  71621. * model: new Model( {
  71622. * withText: true,
  71623. * label: 'First item',
  71624. * labelStyle: 'color: red'
  71625. * } )
  71626. * } );
  71627. *
  71628. * items.add( {
  71629. * type: 'button',
  71630. * model: new Model( {
  71631. * withText: true,
  71632. * label: 'Second item',
  71633. * labelStyle: 'color: green',
  71634. * class: 'foo'
  71635. * } )
  71636. * } );
  71637. *
  71638. * const dropdown = createDropdown( locale );
  71639. *
  71640. * addListToDropdown( dropdown, items );
  71641. *
  71642. * // Will render a dropdown with a list in the panel containing two items.
  71643. * dropdown.render()
  71644. * document.body.appendChild( dropdown.element );
  71645. *
  71646. * The `items` collection passed to this methods controls the presence and attributes of respective
  71647. * {@link module:ui/list/listitemview~ListItemView list items}.
  71648. *
  71649. *
  71650. * See {@link module:ui/dropdown/utils~createDropdown} and {@link module:list/list~List}.
  71651. *
  71652. * @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView A dropdown instance to which `ListVIew` will be added.
  71653. * @param {Iterable.<module:ui/dropdown/utils~ListDropdownItemDefinition>} items
  71654. * A collection of the list item definitions to populate the list.
  71655. */
  71656. function addListToDropdown( dropdownView, items ) {
  71657. const locale = dropdownView.locale;
  71658. const listView = dropdownView.listView = new _list_listview__WEBPACK_IMPORTED_MODULE_4__["default"]( locale );
  71659. listView.items.bindTo( items ).using( ( { type, model } ) => {
  71660. if ( type === 'separator' ) {
  71661. return new _list_listseparatorview__WEBPACK_IMPORTED_MODULE_6__["default"]( locale );
  71662. } else if ( type === 'button' || type === 'switchbutton' ) {
  71663. const listItemView = new _list_listitemview__WEBPACK_IMPORTED_MODULE_5__["default"]( locale );
  71664. let buttonView;
  71665. if ( type === 'button' ) {
  71666. buttonView = new _button_buttonview__WEBPACK_IMPORTED_MODULE_7__["default"]( locale );
  71667. } else {
  71668. buttonView = new _button_switchbuttonview__WEBPACK_IMPORTED_MODULE_8__["default"]( locale );
  71669. }
  71670. // Bind all model properties to the button view.
  71671. buttonView.bind( ...Object.keys( model ) ).to( model );
  71672. buttonView.delegate( 'execute' ).to( listItemView );
  71673. listItemView.children.add( buttonView );
  71674. return listItemView;
  71675. }
  71676. } );
  71677. dropdownView.panelView.children.add( listView );
  71678. listView.items.delegate( 'execute' ).to( dropdownView );
  71679. }
  71680. // Add a set of default behaviors to dropdown view.
  71681. //
  71682. // @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView
  71683. function addDefaultBehavior( dropdownView ) {
  71684. closeDropdownOnBlur( dropdownView );
  71685. closeDropdownOnExecute( dropdownView );
  71686. focusDropdownContentsOnArrows( dropdownView );
  71687. }
  71688. // Adds a behavior to a dropdownView that closes opened dropdown when user clicks outside the dropdown.
  71689. //
  71690. // @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView
  71691. function closeDropdownOnBlur( dropdownView ) {
  71692. dropdownView.on( 'render', () => {
  71693. Object(_bindings_clickoutsidehandler__WEBPACK_IMPORTED_MODULE_9__["default"])( {
  71694. emitter: dropdownView,
  71695. activator: () => dropdownView.isOpen,
  71696. callback: () => {
  71697. dropdownView.isOpen = false;
  71698. },
  71699. contextElements: [ dropdownView.element ]
  71700. } );
  71701. } );
  71702. }
  71703. // Adds a behavior to a dropdownView that closes the dropdown view on "execute" event.
  71704. //
  71705. // @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView
  71706. function closeDropdownOnExecute( dropdownView ) {
  71707. // Close the dropdown when one of the list items has been executed.
  71708. dropdownView.on( 'execute', evt => {
  71709. // Toggling a switch button view should not close the dropdown.
  71710. if ( evt.source instanceof _button_switchbuttonview__WEBPACK_IMPORTED_MODULE_8__["default"] ) {
  71711. return;
  71712. }
  71713. dropdownView.isOpen = false;
  71714. } );
  71715. }
  71716. // Adds a behavior to a dropdownView that focuses the dropdown's panel view contents on keystrokes.
  71717. //
  71718. // @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView
  71719. function focusDropdownContentsOnArrows( dropdownView ) {
  71720. // If the dropdown panel is already open, the arrow down key should focus the first child of the #panelView.
  71721. dropdownView.keystrokes.set( 'arrowdown', ( data, cancel ) => {
  71722. if ( dropdownView.isOpen ) {
  71723. dropdownView.panelView.focus();
  71724. cancel();
  71725. }
  71726. } );
  71727. // If the dropdown panel is already open, the arrow up key should focus the last child of the #panelView.
  71728. dropdownView.keystrokes.set( 'arrowup', ( data, cancel ) => {
  71729. if ( dropdownView.isOpen ) {
  71730. dropdownView.panelView.focusLast();
  71731. cancel();
  71732. }
  71733. } );
  71734. }
  71735. /**
  71736. * A definition of the list item used by the {@link module:ui/dropdown/utils~addListToDropdown}
  71737. * utility.
  71738. *
  71739. * @typedef {Object} module:ui/dropdown/utils~ListDropdownItemDefinition
  71740. *
  71741. * @property {String} type Either `'separator'`, `'button'` or `'switchbutton'`.
  71742. * @property {module:ui/model~Model} [model] Model of the item (when **not** `'separator'`).
  71743. * Its properties fuel the newly created list item (or its children, depending on the `type`).
  71744. */
  71745. /***/ }),
  71746. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/editableui/editableuiview.js":
  71747. /*!******************************************************************************!*\
  71748. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/editableui/editableuiview.js ***!
  71749. \******************************************************************************/
  71750. /*! exports provided: default */
  71751. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  71752. "use strict";
  71753. __webpack_require__.r(__webpack_exports__);
  71754. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EditableUIView; });
  71755. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  71756. /**
  71757. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  71758. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  71759. */
  71760. /**
  71761. * @module ui/editableui/editableuiview
  71762. */
  71763. /**
  71764. * The editable UI view class.
  71765. *
  71766. * @extends module:ui/view~View
  71767. */
  71768. class EditableUIView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  71769. /**
  71770. * Creates an instance of EditableUIView class.
  71771. *
  71772. * @param {module:utils/locale~Locale} [locale] The locale instance.
  71773. * @param {module:engine/view/view~View} editingView The editing view instance the editable is related to.
  71774. * @param {HTMLElement} [editableElement] The editable element. If not specified, this view
  71775. * should create it. Otherwise, the existing element should be used.
  71776. */
  71777. constructor( locale, editingView, editableElement ) {
  71778. super( locale );
  71779. this.setTemplate( {
  71780. tag: 'div',
  71781. attributes: {
  71782. class: [
  71783. 'ck',
  71784. 'ck-content',
  71785. 'ck-editor__editable',
  71786. 'ck-rounded-corners'
  71787. ],
  71788. lang: locale.contentLanguage,
  71789. dir: locale.contentLanguageDirection
  71790. }
  71791. } );
  71792. /**
  71793. * The name of the editable UI view.
  71794. *
  71795. * @member {String} #name
  71796. */
  71797. this.name = null;
  71798. /**
  71799. * Controls whether the editable is focused, i.e. the user is typing in it.
  71800. *
  71801. * @observable
  71802. * @member {Boolean} #isFocused
  71803. */
  71804. this.set( 'isFocused', false );
  71805. /**
  71806. * The element which is the main editable element (usually the one with `contentEditable="true"`).
  71807. *
  71808. * @private
  71809. * @type {HTMLElement}
  71810. */
  71811. this._editableElement = editableElement;
  71812. /**
  71813. * Whether an external {@link #_editableElement} was passed into the constructor, which also means
  71814. * the view will not render its {@link #template}.
  71815. *
  71816. * @private
  71817. * @type {Boolean}
  71818. */
  71819. this._hasExternalElement = !!this._editableElement;
  71820. /**
  71821. * The editing view instance the editable is related to. Editable uses the editing
  71822. * view to dynamically modify its certain DOM attributes after {@link #render rendering}.
  71823. *
  71824. * **Note**: The DOM attributes are performed by the editing view and not UI
  71825. * {@link module:ui/view~View#bindTemplate template bindings} because once rendered,
  71826. * the editable DOM element must remain under the full control of the engine to work properly.
  71827. *
  71828. * @protected
  71829. * @type {module:engine/view/view~View}
  71830. */
  71831. this._editingView = editingView;
  71832. }
  71833. /**
  71834. * Renders the view by either applying the {@link #template} to the existing
  71835. * {@link #_editableElement} or assigning {@link #element} as {@link #_editableElement}.
  71836. */
  71837. render() {
  71838. super.render();
  71839. if ( this._hasExternalElement ) {
  71840. this.template.apply( this.element = this._editableElement );
  71841. } else {
  71842. this._editableElement = this.element;
  71843. }
  71844. this.on( 'change:isFocused', () => this._updateIsFocusedClasses() );
  71845. this._updateIsFocusedClasses();
  71846. }
  71847. /**
  71848. * @inheritDoc
  71849. */
  71850. destroy() {
  71851. if ( this._hasExternalElement ) {
  71852. this.template.revert( this._editableElement );
  71853. }
  71854. super.destroy();
  71855. }
  71856. /**
  71857. * Updates the `ck-focused` and `ck-blurred` CSS classes on the {@link #element} according to
  71858. * the {@link #isFocused} property value using the {@link #_editingView editing view} API.
  71859. *
  71860. * @private
  71861. */
  71862. _updateIsFocusedClasses() {
  71863. const editingView = this._editingView;
  71864. if ( editingView.isRenderingInProgress ) {
  71865. updateAfterRender( this );
  71866. } else {
  71867. update( this );
  71868. }
  71869. function update( view ) {
  71870. editingView.change( writer => {
  71871. const viewRoot = editingView.document.getRoot( view.name );
  71872. writer.addClass( view.isFocused ? 'ck-focused' : 'ck-blurred', viewRoot );
  71873. writer.removeClass( view.isFocused ? 'ck-blurred' : 'ck-focused', viewRoot );
  71874. } );
  71875. }
  71876. // In a case of a multi-root editor, a callback will be attached more than once (one callback for each root).
  71877. // While executing one callback the `isRenderingInProgress` observable is changing what causes executing another
  71878. // callback and render is called inside the already pending render.
  71879. // We need to be sure that callback is executed only when the value has changed from `true` to `false`.
  71880. // See https://github.com/ckeditor/ckeditor5/issues/1676.
  71881. function updateAfterRender( view ) {
  71882. editingView.once( 'change:isRenderingInProgress', ( evt, name, value ) => {
  71883. if ( !value ) {
  71884. update( view );
  71885. } else {
  71886. updateAfterRender( view );
  71887. }
  71888. } );
  71889. }
  71890. }
  71891. }
  71892. /***/ }),
  71893. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/editableui/inline/inlineeditableuiview.js":
  71894. /*!*******************************************************************************************!*\
  71895. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/editableui/inline/inlineeditableuiview.js ***!
  71896. \*******************************************************************************************/
  71897. /*! exports provided: default */
  71898. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  71899. "use strict";
  71900. __webpack_require__.r(__webpack_exports__);
  71901. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InlineEditableUIView; });
  71902. /* harmony import */ var _editableui_editableuiview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../editableui/editableuiview */ "./node_modules/@ckeditor/ckeditor5-ui/src/editableui/editableuiview.js");
  71903. /**
  71904. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  71905. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  71906. */
  71907. /**
  71908. * @module ui/editableui/inline/inlineeditableuiview
  71909. */
  71910. /**
  71911. * The inline editable UI class implementing an inline {@link module:ui/editableui/editableuiview~EditableUIView}.
  71912. *
  71913. * @extends module:ui/editableui/editableuiview~EditableUIView
  71914. */
  71915. class InlineEditableUIView extends _editableui_editableuiview__WEBPACK_IMPORTED_MODULE_0__["default"] {
  71916. /**
  71917. * Creates an instance of the InlineEditableUIView class.
  71918. *
  71919. * @param {module:utils/locale~Locale} [locale] The locale instance.
  71920. * @param {module:engine/view/view~View} editingView The editing view instance the editable is related to.
  71921. * @param {HTMLElement} [editableElement] The editable element. If not specified, the
  71922. * {@link module:ui/editableui/editableuiview~EditableUIView}
  71923. * will create it. Otherwise, the existing element will be used.
  71924. */
  71925. constructor( locale, editingView, editableElement ) {
  71926. super( locale, editingView, editableElement );
  71927. this.extendTemplate( {
  71928. attributes: {
  71929. role: 'textbox',
  71930. class: 'ck-editor__editable_inline'
  71931. }
  71932. } );
  71933. }
  71934. /**
  71935. * @inheritDoc
  71936. */
  71937. render() {
  71938. super.render();
  71939. const editingView = this._editingView;
  71940. const t = this.t;
  71941. editingView.change( writer => {
  71942. const viewRoot = editingView.document.getRoot( this.name );
  71943. writer.setAttribute( 'aria-label', t( 'Rich Text Editor, %0', this.name ), viewRoot );
  71944. } );
  71945. }
  71946. }
  71947. /***/ }),
  71948. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/editorui/bodycollection.js":
  71949. /*!****************************************************************************!*\
  71950. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/editorui/bodycollection.js ***!
  71951. \****************************************************************************/
  71952. /*! exports provided: default */
  71953. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  71954. "use strict";
  71955. __webpack_require__.r(__webpack_exports__);
  71956. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BodyCollection; });
  71957. /* harmony import */ var _template__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../template */ "./node_modules/@ckeditor/ckeditor5-ui/src/template.js");
  71958. /* harmony import */ var _viewcollection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../viewcollection */ "./node_modules/@ckeditor/ckeditor5-ui/src/viewcollection.js");
  71959. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_createelement__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/createelement */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/createelement.js");
  71960. /**
  71961. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  71962. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  71963. */
  71964. /**
  71965. * @module ui/editorui/bodycollection
  71966. */
  71967. /* globals document */
  71968. /**
  71969. * This is a special {@link module:ui/viewcollection~ViewCollection} dedicated to elements that are detached
  71970. * from the DOM structure of the editor, like panels, icons, etc.
  71971. *
  71972. * The body collection is available in the {@link module:ui/editorui/editoruiview~EditorUIView#body `editor.ui.view.body`} property.
  71973. * Any plugin can add a {@link module:ui/view~View view} to this collection.
  71974. * These views will render in a container placed directly in the `<body>` element.
  71975. * The editor will detach and destroy this collection when the editor will be {@link module:core/editor/editor~Editor#destroy destroyed}.
  71976. *
  71977. * If you need to control the life cycle of the body collection on your own, you can create your own instance of this class.
  71978. *
  71979. * A body collection will render itself automatically in the DOM body element as soon as you call {@link ~BodyCollection#attachToDom}.
  71980. * If you create multiple body collections, this class will create a special wrapper element in the DOM to limit the number of
  71981. * elements created directly in the body and remove it when the last body collection will be
  71982. * {@link ~BodyCollection#detachFromDom detached}.
  71983. *
  71984. * @extends module:ui/viewcollection~ViewCollection
  71985. */
  71986. class BodyCollection extends _viewcollection__WEBPACK_IMPORTED_MODULE_1__["default"] {
  71987. /**
  71988. * Creates a new instance of the {@link module:ui/editorui/bodycollection~BodyCollection}.
  71989. *
  71990. * @param {module:utils/locale~Locale} locale The {@link module:core/editor/editor~Editor editor's locale} instance.
  71991. * @param {Iterable.<module:ui/view~View>} [initialItems] The initial items of the collection.
  71992. */
  71993. constructor( locale, initialItems = [] ) {
  71994. super( initialItems );
  71995. /**
  71996. * The {@link module:core/editor/editor~Editor#locale editor's locale} instance.
  71997. * See the view {@link module:ui/view~View#locale locale} property.
  71998. *
  71999. * @member {module:utils/locale~Locale}
  72000. */
  72001. this.locale = locale;
  72002. }
  72003. /**
  72004. * Attaches the body collection to the DOM body element. You need to execute this method to render the content of
  72005. * the body collection.
  72006. */
  72007. attachToDom() {
  72008. /**
  72009. * The element holding elements of the body region.
  72010. *
  72011. * @protected
  72012. * @member {HTMLElement} #_bodyCollectionContainer
  72013. */
  72014. this._bodyCollectionContainer = new _template__WEBPACK_IMPORTED_MODULE_0__["default"]( {
  72015. tag: 'div',
  72016. attributes: {
  72017. class: [
  72018. 'ck',
  72019. 'ck-reset_all',
  72020. 'ck-body',
  72021. 'ck-rounded-corners'
  72022. ],
  72023. dir: this.locale.uiLanguageDirection
  72024. },
  72025. children: this
  72026. } ).render();
  72027. let wrapper = document.querySelector( '.ck-body-wrapper' );
  72028. if ( !wrapper ) {
  72029. wrapper = Object(_ckeditor_ckeditor5_utils_src_dom_createelement__WEBPACK_IMPORTED_MODULE_2__["default"])( document, 'div', { class: 'ck-body-wrapper' } );
  72030. document.body.appendChild( wrapper );
  72031. }
  72032. wrapper.appendChild( this._bodyCollectionContainer );
  72033. }
  72034. /**
  72035. * Detaches the collection from the DOM structure. Use this method when you do not need to use the body collection
  72036. * anymore to clean-up the DOM structure.
  72037. */
  72038. detachFromDom() {
  72039. super.destroy();
  72040. if ( this._bodyCollectionContainer ) {
  72041. this._bodyCollectionContainer.remove();
  72042. }
  72043. const wrapper = document.querySelector( '.ck-body-wrapper' );
  72044. if ( wrapper && wrapper.childElementCount == 0 ) {
  72045. wrapper.remove();
  72046. }
  72047. }
  72048. }
  72049. /***/ }),
  72050. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/editorui/boxed/boxededitoruiview.js":
  72051. /*!*************************************************************************************!*\
  72052. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/editorui/boxed/boxededitoruiview.js ***!
  72053. \*************************************************************************************/
  72054. /*! exports provided: default */
  72055. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  72056. "use strict";
  72057. __webpack_require__.r(__webpack_exports__);
  72058. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BoxedEditorUIView; });
  72059. /* harmony import */ var _editorui_editoruiview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../editorui/editoruiview */ "./node_modules/@ckeditor/ckeditor5-ui/src/editorui/editoruiview.js");
  72060. /* harmony import */ var _label_labelview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../label/labelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/label/labelview.js");
  72061. /**
  72062. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  72063. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  72064. */
  72065. /**
  72066. * @module ui/editorui/boxed/boxededitoruiview
  72067. */
  72068. /**
  72069. * The boxed editor UI view class. This class represents an editor interface
  72070. * consisting of a toolbar and an editable area, enclosed within a box.
  72071. *
  72072. * @extends module:ui/editorui/editoruiview~EditorUIView
  72073. */
  72074. class BoxedEditorUIView extends _editorui_editoruiview__WEBPACK_IMPORTED_MODULE_0__["default"] {
  72075. /**
  72076. * Creates an instance of the boxed editor UI view class.
  72077. *
  72078. * @param {module:utils/locale~Locale} locale The locale instance..
  72079. */
  72080. constructor( locale ) {
  72081. super( locale );
  72082. /**
  72083. * Collection of the child views located in the top (`.ck-editor__top`)
  72084. * area of the UI.
  72085. *
  72086. * @readonly
  72087. * @member {module:ui/viewcollection~ViewCollection}
  72088. */
  72089. this.top = this.createCollection();
  72090. /**
  72091. * Collection of the child views located in the main (`.ck-editor__main`)
  72092. * area of the UI.
  72093. *
  72094. * @readonly
  72095. * @member {module:ui/viewcollection~ViewCollection}
  72096. */
  72097. this.main = this.createCollection();
  72098. /**
  72099. * Voice label of the UI.
  72100. *
  72101. * @protected
  72102. * @readonly
  72103. * @member {module:ui/view~View} #_voiceLabelView
  72104. */
  72105. this._voiceLabelView = this._createVoiceLabel();
  72106. this.setTemplate( {
  72107. tag: 'div',
  72108. attributes: {
  72109. class: [
  72110. 'ck',
  72111. 'ck-reset',
  72112. 'ck-editor',
  72113. 'ck-rounded-corners'
  72114. ],
  72115. role: 'application',
  72116. dir: locale.uiLanguageDirection,
  72117. lang: locale.uiLanguage,
  72118. 'aria-labelledby': this._voiceLabelView.id
  72119. },
  72120. children: [
  72121. this._voiceLabelView,
  72122. {
  72123. tag: 'div',
  72124. attributes: {
  72125. class: [
  72126. 'ck',
  72127. 'ck-editor__top',
  72128. 'ck-reset_all'
  72129. ],
  72130. role: 'presentation'
  72131. },
  72132. children: this.top
  72133. },
  72134. {
  72135. tag: 'div',
  72136. attributes: {
  72137. class: [
  72138. 'ck',
  72139. 'ck-editor__main'
  72140. ],
  72141. role: 'presentation'
  72142. },
  72143. children: this.main
  72144. }
  72145. ]
  72146. } );
  72147. }
  72148. /**
  72149. * Creates a voice label view instance.
  72150. *
  72151. * @private
  72152. * @returns {module:ui/label/labelview~LabelView}
  72153. */
  72154. _createVoiceLabel() {
  72155. const t = this.t;
  72156. const voiceLabel = new _label_labelview__WEBPACK_IMPORTED_MODULE_1__["default"]();
  72157. voiceLabel.text = t( 'Rich Text Editor' );
  72158. voiceLabel.extendTemplate( {
  72159. attributes: {
  72160. class: 'ck-voice-label'
  72161. }
  72162. } );
  72163. return voiceLabel;
  72164. }
  72165. }
  72166. /***/ }),
  72167. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/editorui/editoruiview.js":
  72168. /*!**************************************************************************!*\
  72169. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/editorui/editoruiview.js ***!
  72170. \**************************************************************************/
  72171. /*! exports provided: default */
  72172. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  72173. "use strict";
  72174. __webpack_require__.r(__webpack_exports__);
  72175. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EditorUIView; });
  72176. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  72177. /* harmony import */ var _bodycollection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bodycollection */ "./node_modules/@ckeditor/ckeditor5-ui/src/editorui/bodycollection.js");
  72178. /* harmony import */ var _theme_components_editorui_editorui_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/components/editorui/editorui.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/editorui/editorui.css");
  72179. /* harmony import */ var _theme_components_editorui_editorui_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_theme_components_editorui_editorui_css__WEBPACK_IMPORTED_MODULE_2__);
  72180. /**
  72181. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  72182. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  72183. */
  72184. /**
  72185. * @module ui/editorui/editoruiview
  72186. */
  72187. /**
  72188. * The editor UI view class. Base class for the editor main views.
  72189. *
  72190. * @extends module:ui/view~View
  72191. */
  72192. class EditorUIView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  72193. /**
  72194. * Creates an instance of the editor UI view class.
  72195. *
  72196. * @param {module:utils/locale~Locale} [locale] The locale instance.
  72197. */
  72198. constructor( locale ) {
  72199. super( locale );
  72200. /**
  72201. * Collection of the child views, detached from the DOM
  72202. * structure of the editor, like panels, icons etc.
  72203. *
  72204. * @readonly
  72205. * @member {module:ui/viewcollection~ViewCollection} #body
  72206. */
  72207. this.body = new _bodycollection__WEBPACK_IMPORTED_MODULE_1__["default"]( locale );
  72208. }
  72209. /**
  72210. * @inheritDoc
  72211. */
  72212. render() {
  72213. super.render();
  72214. this.body.attachToDom();
  72215. }
  72216. /**
  72217. * @inheritDoc
  72218. */
  72219. destroy() {
  72220. this.body.detachFromDom();
  72221. return super.destroy();
  72222. }
  72223. }
  72224. /***/ }),
  72225. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/focuscycler.js":
  72226. /*!****************************************************************!*\
  72227. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/focuscycler.js ***!
  72228. \****************************************************************/
  72229. /*! exports provided: default */
  72230. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  72231. "use strict";
  72232. __webpack_require__.r(__webpack_exports__);
  72233. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FocusCycler; });
  72234. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
  72235. /**
  72236. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  72237. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  72238. */
  72239. /**
  72240. * @module ui/focuscycler
  72241. */
  72242. /**
  72243. * A utility class that helps cycling over focusable {@link module:ui/view~View views} in a
  72244. * {@link module:ui/viewcollection~ViewCollection} when the focus is tracked by the
  72245. * {@link module:utils/focustracker~FocusTracker} instance. It helps implementing keyboard
  72246. * navigation in HTML forms, toolbars, lists and the like.
  72247. *
  72248. * To work properly it requires:
  72249. * * a collection of focusable (HTML `tabindex` attribute) views that implement the `focus()` method,
  72250. * * an associated focus tracker to determine which view is focused.
  72251. *
  72252. * A simple cycler setup can look like this:
  72253. *
  72254. * const focusables = new ViewCollection();
  72255. * const focusTracker = new FocusTracker();
  72256. *
  72257. * // Add focusable views to the focus tracker.
  72258. * focusTracker.add( ... );
  72259. *
  72260. * Then, the cycler can be used manually:
  72261. *
  72262. * const cycler = new FocusCycler( { focusables, focusTracker } );
  72263. *
  72264. * // Will focus the first focusable view in #focusables.
  72265. * cycler.focusFirst();
  72266. *
  72267. * // Will log the next focusable item in #focusables.
  72268. * console.log( cycler.next );
  72269. *
  72270. * Alternatively, it can work side by side with the {@link module:utils/keystrokehandler~KeystrokeHandler}:
  72271. *
  72272. * const keystrokeHandler = new KeystrokeHandler();
  72273. *
  72274. * // Activate the keystroke handler.
  72275. * keystrokeHandler.listenTo( sourceOfEvents );
  72276. *
  72277. * const cycler = new FocusCycler( {
  72278. * focusables, focusTracker, keystrokeHandler,
  72279. * actions: {
  72280. * // When arrowup of arrowleft is detected by the #keystrokeHandler,
  72281. * // focusPrevious() will be called on the cycler.
  72282. * focusPrevious: [ 'arrowup', 'arrowleft' ],
  72283. * }
  72284. * } );
  72285. *
  72286. * Check out the {@glink framework/guides/deep-dive/ui/focus-tracking "Deep dive into focus tracking" guide} to learn more.
  72287. */
  72288. class FocusCycler {
  72289. /**
  72290. * Creates an instance of the focus cycler utility.
  72291. *
  72292. * @param {Object} options Configuration options.
  72293. * @param {module:utils/collection~Collection|Object} options.focusables
  72294. * @param {module:utils/focustracker~FocusTracker} options.focusTracker
  72295. * @param {module:utils/keystrokehandler~KeystrokeHandler} [options.keystrokeHandler]
  72296. * @param {Object} [options.actions]
  72297. */
  72298. constructor( options ) {
  72299. Object.assign( this, options );
  72300. /**
  72301. * A {@link module:ui/view~View view} collection that the cycler operates on.
  72302. *
  72303. * @readonly
  72304. * @member {module:utils/collection~Collection} #focusables
  72305. */
  72306. /**
  72307. * A focus tracker instance that the cycler uses to determine the current focus
  72308. * state in {@link #focusables}.
  72309. *
  72310. * @readonly
  72311. * @member {module:utils/focustracker~FocusTracker} #focusTracker
  72312. */
  72313. /**
  72314. * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}
  72315. * which can respond to certain keystrokes and cycle the focus.
  72316. *
  72317. * @readonly
  72318. * @member {module:utils/keystrokehandler~KeystrokeHandler} #keystrokeHandler
  72319. */
  72320. /**
  72321. * Actions that the cycler can take when a keystroke is pressed. Requires
  72322. * `options.keystrokeHandler` to be passed and working. When an action is
  72323. * performed, `preventDefault` and `stopPropagation` will be called on the event
  72324. * the keystroke fired in the DOM.
  72325. *
  72326. * actions: {
  72327. * // Will call #focusPrevious() when arrowleft or arrowup is pressed.
  72328. * focusPrevious: [ 'arrowleft', 'arrowup' ],
  72329. *
  72330. * // Will call #focusNext() when arrowdown is pressed.
  72331. * focusNext: 'arrowdown'
  72332. * }
  72333. *
  72334. * @readonly
  72335. * @member {Object} #actions
  72336. */
  72337. if ( options.actions && options.keystrokeHandler ) {
  72338. for ( const methodName in options.actions ) {
  72339. let actions = options.actions[ methodName ];
  72340. if ( typeof actions == 'string' ) {
  72341. actions = [ actions ];
  72342. }
  72343. for ( const keystroke of actions ) {
  72344. options.keystrokeHandler.set( keystroke, ( data, cancel ) => {
  72345. this[ methodName ]();
  72346. cancel();
  72347. } );
  72348. }
  72349. }
  72350. }
  72351. }
  72352. /**
  72353. * Returns the first focusable view in {@link #focusables}.
  72354. * Returns `null` if there is none.
  72355. *
  72356. * @readonly
  72357. * @member {module:ui/view~View|null} #first
  72358. */
  72359. get first() {
  72360. return this.focusables.find( isFocusable ) || null;
  72361. }
  72362. /**
  72363. * Returns the last focusable view in {@link #focusables}.
  72364. * Returns `null` if there is none.
  72365. *
  72366. * @readonly
  72367. * @member {module:ui/view~View|null} #last
  72368. */
  72369. get last() {
  72370. return this.focusables.filter( isFocusable ).slice( -1 )[ 0 ] || null;
  72371. }
  72372. /**
  72373. * Returns the next focusable view in {@link #focusables} based on {@link #current}.
  72374. * Returns `null` if there is none.
  72375. *
  72376. * @readonly
  72377. * @member {module:ui/view~View|null} #next
  72378. */
  72379. get next() {
  72380. return this._getFocusableItem( 1 );
  72381. }
  72382. /**
  72383. * Returns the previous focusable view in {@link #focusables} based on {@link #current}.
  72384. * Returns `null` if there is none.
  72385. *
  72386. * @readonly
  72387. * @member {module:ui/view~View|null} #previous
  72388. */
  72389. get previous() {
  72390. return this._getFocusableItem( -1 );
  72391. }
  72392. /**
  72393. * An index of the view in the {@link #focusables} which is focused according
  72394. * to {@link #focusTracker}. Returns `null` when there is no such view.
  72395. *
  72396. * @readonly
  72397. * @member {Number|null} #current
  72398. */
  72399. get current() {
  72400. let index = null;
  72401. // There's no focused view in the focusables.
  72402. if ( this.focusTracker.focusedElement === null ) {
  72403. return null;
  72404. }
  72405. this.focusables.find( ( view, viewIndex ) => {
  72406. const focused = view.element === this.focusTracker.focusedElement;
  72407. if ( focused ) {
  72408. index = viewIndex;
  72409. }
  72410. return focused;
  72411. } );
  72412. return index;
  72413. }
  72414. /**
  72415. * Focuses the {@link #first} item in {@link #focusables}.
  72416. */
  72417. focusFirst() {
  72418. this._focus( this.first );
  72419. }
  72420. /**
  72421. * Focuses the {@link #last} item in {@link #focusables}.
  72422. */
  72423. focusLast() {
  72424. this._focus( this.last );
  72425. }
  72426. /**
  72427. * Focuses the {@link #next} item in {@link #focusables}.
  72428. */
  72429. focusNext() {
  72430. this._focus( this.next );
  72431. }
  72432. /**
  72433. * Focuses the {@link #previous} item in {@link #focusables}.
  72434. */
  72435. focusPrevious() {
  72436. this._focus( this.previous );
  72437. }
  72438. /**
  72439. * Focuses the given view if it exists.
  72440. *
  72441. * @protected
  72442. * @param {module:ui/view~View} view
  72443. */
  72444. _focus( view ) {
  72445. if ( view ) {
  72446. view.focus();
  72447. }
  72448. }
  72449. /**
  72450. * Returns the next or previous focusable view in {@link #focusables} with respect
  72451. * to {@link #current}.
  72452. *
  72453. * @protected
  72454. * @param {Number} step Either `1` for checking forward from {@link #current} or
  72455. * `-1` for checking backwards.
  72456. * @returns {module:ui/view~View|null}
  72457. */
  72458. _getFocusableItem( step ) {
  72459. // Cache for speed.
  72460. const current = this.current;
  72461. const collectionLength = this.focusables.length;
  72462. if ( !collectionLength ) {
  72463. return null;
  72464. }
  72465. // Start from the beginning if no view is focused.
  72466. // https://github.com/ckeditor/ckeditor5-ui/issues/206
  72467. if ( current === null ) {
  72468. return this[ step === 1 ? 'first' : 'last' ];
  72469. }
  72470. // Cycle in both directions.
  72471. let index = ( current + collectionLength + step ) % collectionLength;
  72472. do {
  72473. const view = this.focusables.get( index );
  72474. // TODO: Check if view is visible.
  72475. if ( isFocusable( view ) ) {
  72476. return view;
  72477. }
  72478. // Cycle in both directions.
  72479. index = ( index + collectionLength + step ) % collectionLength;
  72480. } while ( index !== current );
  72481. return null;
  72482. }
  72483. }
  72484. // Checks whether a view is focusable.
  72485. //
  72486. // @private
  72487. // @param {module:ui/view~View} view A view to be checked.
  72488. // @returns {Boolean}
  72489. function isFocusable( view ) {
  72490. return !!( view.focus && _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_0__["default"].window.getComputedStyle( view.element ).display != 'none' );
  72491. }
  72492. /***/ }),
  72493. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/icon/iconview.js":
  72494. /*!******************************************************************!*\
  72495. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/icon/iconview.js ***!
  72496. \******************************************************************/
  72497. /*! exports provided: default */
  72498. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  72499. "use strict";
  72500. __webpack_require__.r(__webpack_exports__);
  72501. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return IconView; });
  72502. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  72503. /* harmony import */ var _theme_components_icon_icon_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../theme/components/icon/icon.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/icon/icon.css");
  72504. /* harmony import */ var _theme_components_icon_icon_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_theme_components_icon_icon_css__WEBPACK_IMPORTED_MODULE_1__);
  72505. /**
  72506. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  72507. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  72508. */
  72509. /* global DOMParser */
  72510. /**
  72511. * @module ui/icon/iconview
  72512. */
  72513. /**
  72514. * The icon view class.
  72515. *
  72516. * @extends module:ui/view~View
  72517. */
  72518. class IconView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  72519. /**
  72520. * @inheritDoc
  72521. */
  72522. constructor() {
  72523. super();
  72524. const bind = this.bindTemplate;
  72525. /**
  72526. * The SVG source of the icon.
  72527. *
  72528. * @observable
  72529. * @member {String} #content
  72530. */
  72531. this.set( 'content', '' );
  72532. /**
  72533. * This attribute specifies the boundaries to which the
  72534. * icon content should stretch.
  72535. *
  72536. * @observable
  72537. * @default '0 0 20 20'
  72538. * @member {String} #viewBox
  72539. */
  72540. this.set( 'viewBox', '0 0 20 20' );
  72541. /**
  72542. * The fill color of the child `path.ck-icon__fill`.
  72543. *
  72544. * @observable
  72545. * @default ''
  72546. * @member {String} #fillColor
  72547. */
  72548. this.set( 'fillColor', '' );
  72549. this.setTemplate( {
  72550. tag: 'svg',
  72551. ns: 'http://www.w3.org/2000/svg',
  72552. attributes: {
  72553. class: [
  72554. 'ck',
  72555. 'ck-icon'
  72556. ],
  72557. viewBox: bind.to( 'viewBox' )
  72558. }
  72559. } );
  72560. }
  72561. /**
  72562. * @inheritDoc
  72563. */
  72564. render() {
  72565. super.render();
  72566. this._updateXMLContent();
  72567. this._colorFillPaths();
  72568. // This is a hack for lack of innerHTML binding.
  72569. // See: https://github.com/ckeditor/ckeditor5-ui/issues/99.
  72570. this.on( 'change:content', () => {
  72571. this._updateXMLContent();
  72572. this._colorFillPaths();
  72573. } );
  72574. this.on( 'change:fillColor', () => {
  72575. this._colorFillPaths();
  72576. } );
  72577. }
  72578. /**
  72579. * Updates the {@link #element} with the value of {@link #content}.
  72580. *
  72581. * @private
  72582. */
  72583. _updateXMLContent() {
  72584. if ( this.content ) {
  72585. const parsed = new DOMParser().parseFromString( this.content.trim(), 'image/svg+xml' );
  72586. const svg = parsed.querySelector( 'svg' );
  72587. const viewBox = svg.getAttribute( 'viewBox' );
  72588. if ( viewBox ) {
  72589. this.viewBox = viewBox;
  72590. }
  72591. this.element.innerHTML = '';
  72592. while ( svg.childNodes.length > 0 ) {
  72593. this.element.appendChild( svg.childNodes[ 0 ] );
  72594. }
  72595. }
  72596. }
  72597. /**
  72598. * Fills all child `path.ck-icon__fill` with the `#fillColor`.
  72599. *
  72600. * @private
  72601. */
  72602. _colorFillPaths() {
  72603. if ( this.fillColor ) {
  72604. this.element.querySelectorAll( '.ck-icon__fill' ).forEach( path => {
  72605. path.style.fill = this.fillColor;
  72606. } );
  72607. }
  72608. }
  72609. }
  72610. /***/ }),
  72611. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/inputtext/inputtextview.js":
  72612. /*!****************************************************************************!*\
  72613. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/inputtext/inputtextview.js ***!
  72614. \****************************************************************************/
  72615. /*! exports provided: default */
  72616. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  72617. "use strict";
  72618. __webpack_require__.r(__webpack_exports__);
  72619. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return InputTextView; });
  72620. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  72621. /* harmony import */ var _theme_components_inputtext_inputtext_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../theme/components/inputtext/inputtext.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/inputtext/inputtext.css");
  72622. /* harmony import */ var _theme_components_inputtext_inputtext_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_theme_components_inputtext_inputtext_css__WEBPACK_IMPORTED_MODULE_1__);
  72623. /**
  72624. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  72625. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  72626. */
  72627. /**
  72628. * @module ui/inputtext/inputtextview
  72629. */
  72630. /**
  72631. * The text input view class.
  72632. *
  72633. * @extends module:ui/view~View
  72634. */
  72635. class InputTextView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  72636. /**
  72637. * @inheritDoc
  72638. */
  72639. constructor( locale ) {
  72640. super( locale );
  72641. /**
  72642. * The value of the input.
  72643. *
  72644. * @observable
  72645. * @member {String} #value
  72646. */
  72647. this.set( 'value' );
  72648. /**
  72649. * The `id` attribute of the input (i.e. to pair with a `<label>` element).
  72650. *
  72651. * @observable
  72652. * @member {String} #id
  72653. */
  72654. this.set( 'id' );
  72655. /**
  72656. * The `placeholder` attribute of the input.
  72657. *
  72658. * @observable
  72659. * @member {String} #placeholder
  72660. */
  72661. this.set( 'placeholder' );
  72662. /**
  72663. * Controls whether the input view is in read-only mode.
  72664. *
  72665. * @observable
  72666. * @member {Boolean} #isReadOnly
  72667. */
  72668. this.set( 'isReadOnly', false );
  72669. /**
  72670. * Set to `true` when the field has some error. Usually controlled via
  72671. * {@link module:ui/labeledinput/labeledinputview~LabeledInputView#errorText}.
  72672. *
  72673. * @observable
  72674. * @member {Boolean} #hasError
  72675. */
  72676. this.set( 'hasError', false );
  72677. /**
  72678. * The `id` of the element describing this field, e.g. when it has
  72679. * some error, it helps screen readers read the error text.
  72680. *
  72681. * @observable
  72682. * @member {Boolean} #ariaDescribedById
  72683. */
  72684. this.set( 'ariaDescribedById' );
  72685. const bind = this.bindTemplate;
  72686. this.setTemplate( {
  72687. tag: 'input',
  72688. attributes: {
  72689. type: 'text',
  72690. class: [
  72691. 'ck',
  72692. 'ck-input',
  72693. 'ck-input-text',
  72694. bind.if( 'hasError', 'ck-error' )
  72695. ],
  72696. id: bind.to( 'id' ),
  72697. placeholder: bind.to( 'placeholder' ),
  72698. readonly: bind.to( 'isReadOnly' ),
  72699. 'aria-invalid': bind.if( 'hasError', true ),
  72700. 'aria-describedby': bind.to( 'ariaDescribedById' )
  72701. },
  72702. on: {
  72703. input: bind.to( 'input' )
  72704. }
  72705. } );
  72706. /**
  72707. * Fired when the user types in the input. Corresponds to the native
  72708. * DOM `input` event.
  72709. *
  72710. * @event input
  72711. */
  72712. }
  72713. /**
  72714. * @inheritDoc
  72715. */
  72716. render() {
  72717. super.render();
  72718. const setValue = value => {
  72719. this.element.value = ( !value && value !== 0 ) ? '' : value;
  72720. };
  72721. setValue( this.value );
  72722. // Bind `this.value` to the DOM element's value.
  72723. // We cannot use `value` DOM attribute because removing it on Edge does not clear the DOM element's value property.
  72724. this.on( 'change:value', ( evt, name, value ) => {
  72725. setValue( value );
  72726. } );
  72727. }
  72728. /**
  72729. * Moves the focus to the input and selects the value.
  72730. */
  72731. select() {
  72732. this.element.select();
  72733. }
  72734. /**
  72735. * Focuses the input.
  72736. */
  72737. focus() {
  72738. this.element.focus();
  72739. }
  72740. }
  72741. /***/ }),
  72742. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/label/labelview.js":
  72743. /*!********************************************************************!*\
  72744. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/label/labelview.js ***!
  72745. \********************************************************************/
  72746. /*! exports provided: default */
  72747. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  72748. "use strict";
  72749. __webpack_require__.r(__webpack_exports__);
  72750. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LabelView; });
  72751. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  72752. /* harmony import */ var _ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/uid */ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js");
  72753. /* harmony import */ var _theme_components_label_label_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/components/label/label.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/label/label.css");
  72754. /* harmony import */ var _theme_components_label_label_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_theme_components_label_label_css__WEBPACK_IMPORTED_MODULE_2__);
  72755. /**
  72756. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  72757. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  72758. */
  72759. /**
  72760. * @module ui/label/labelview
  72761. */
  72762. /**
  72763. * The label view class.
  72764. *
  72765. * @extends module:ui/view~View
  72766. */
  72767. class LabelView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  72768. /**
  72769. * @inheritDoc
  72770. */
  72771. constructor( locale ) {
  72772. super( locale );
  72773. /**
  72774. * The text of the label.
  72775. *
  72776. * @observable
  72777. * @member {String} #text
  72778. */
  72779. this.set( 'text' );
  72780. /**
  72781. * The `for` attribute of the label (i.e. to pair with an `<input>` element).
  72782. *
  72783. * @observable
  72784. * @member {String} #for
  72785. */
  72786. this.set( 'for' );
  72787. /**
  72788. * An unique id of the label. It can be used by other UI components to reference
  72789. * the label, for instance, using the `aria-describedby` DOM attribute.
  72790. *
  72791. * @member {String} #id
  72792. */
  72793. this.id = `ck-editor__label_${ Object(_ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_1__["default"])() }`;
  72794. const bind = this.bindTemplate;
  72795. this.setTemplate( {
  72796. tag: 'label',
  72797. attributes: {
  72798. class: [
  72799. 'ck',
  72800. 'ck-label'
  72801. ],
  72802. id: this.id,
  72803. for: bind.to( 'for' )
  72804. },
  72805. children: [
  72806. {
  72807. text: bind.to( 'text' )
  72808. }
  72809. ]
  72810. } );
  72811. }
  72812. }
  72813. /***/ }),
  72814. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/labeledfield/labeledfieldview.js":
  72815. /*!**********************************************************************************!*\
  72816. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/labeledfield/labeledfieldview.js ***!
  72817. \**********************************************************************************/
  72818. /*! exports provided: default */
  72819. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  72820. "use strict";
  72821. __webpack_require__.r(__webpack_exports__);
  72822. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return LabeledFieldView; });
  72823. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  72824. /* harmony import */ var _ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/uid */ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js");
  72825. /* harmony import */ var _label_labelview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../label/labelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/label/labelview.js");
  72826. /* harmony import */ var _theme_components_labeledfield_labeledfieldview_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/components/labeledfield/labeledfieldview.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css");
  72827. /* harmony import */ var _theme_components_labeledfield_labeledfieldview_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_theme_components_labeledfield_labeledfieldview_css__WEBPACK_IMPORTED_MODULE_3__);
  72828. /**
  72829. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  72830. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  72831. */
  72832. /**
  72833. * @module ui/labeledfield/labeledfieldview
  72834. */
  72835. /**
  72836. * The labeled field view class. It can be used to enhance any view with the following features:
  72837. *
  72838. * * a label,
  72839. * * (optional) an error message,
  72840. * * (optional) an info (status) text,
  72841. *
  72842. * all bound logically by proper DOM attributes for UX and accessibility. It also provides an interface
  72843. * (e.g. observable properties) that allows controlling those additional features.
  72844. *
  72845. * The constructor of this class requires a callback that returns a view to be labeled. The callback
  72846. * is called with unique ids that allow binding of DOM properties:
  72847. *
  72848. * const labeledInputView = new LabeledFieldView( locale, ( labeledFieldView, viewUid, statusUid ) => {
  72849. * const inputView = new InputTextView( labeledFieldView.locale );
  72850. *
  72851. * inputView.set( {
  72852. * id: viewUid,
  72853. * ariaDescribedById: statusUid
  72854. * } );
  72855. *
  72856. * inputView.bind( 'isReadOnly' ).to( labeledFieldView, 'isEnabled', value => !value );
  72857. * inputView.bind( 'hasError' ).to( labeledFieldView, 'errorText', value => !!value );
  72858. *
  72859. * return inputView;
  72860. * } );
  72861. *
  72862. * labeledInputView.label = 'User name';
  72863. * labeledInputView.infoText = 'Full name like for instance, John Doe.';
  72864. * labeledInputView.render();
  72865. *
  72866. * document.body.append( labeledInputView.element );
  72867. *
  72868. * See {@link module:ui/labeledfield/utils} to discover ready–to–use labeled input helpers for common
  72869. * UI components.
  72870. *
  72871. * @extends module:ui/view~View
  72872. */
  72873. class LabeledFieldView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  72874. /**
  72875. * Creates an instance of the labeled field view class using a provided creator function
  72876. * that provides the view to be labeled.
  72877. *
  72878. * @param {module:utils/locale~Locale} locale The locale instance.
  72879. * @param {Function} viewCreator A function that returns a {@link module:ui/view~View}
  72880. * that will be labeled. The following arguments are passed to the creator function:
  72881. *
  72882. * * an instance of the `LabeledFieldView` to allow binding observable properties,
  72883. * * an UID string that connects the {@link #labelView label} and the labeled field view in DOM,
  72884. * * an UID string that connects the {@link #statusView status} and the labeled field view in DOM.
  72885. */
  72886. constructor( locale, viewCreator ) {
  72887. super( locale );
  72888. const viewUid = `ck-labeled-field-view-${ Object(_ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_1__["default"])() }`;
  72889. const statusUid = `ck-labeled-field-view-status-${ Object(_ckeditor_ckeditor5_utils_src_uid__WEBPACK_IMPORTED_MODULE_1__["default"])() }`;
  72890. /**
  72891. * The field view that gets labeled.
  72892. *
  72893. * @member {module:ui/view~View} #fieldView
  72894. */
  72895. this.fieldView = viewCreator( this, viewUid, statusUid );
  72896. /**
  72897. * The text of the label.
  72898. *
  72899. * @observable
  72900. * @member {String} #label
  72901. */
  72902. this.set( 'label' );
  72903. /**
  72904. * Controls whether the component is in read-only mode.
  72905. *
  72906. * @observable
  72907. * @member {Boolean} #isEnabled
  72908. */
  72909. this.set( 'isEnabled', true );
  72910. /**
  72911. * The validation error text. When set, it will be displayed
  72912. * next to the {@link #fieldView} as a typical validation error message.
  72913. * Set it to `null` to hide the message.
  72914. *
  72915. * **Note:** Setting this property to anything but `null` will automatically
  72916. * make the `hasError` of the {@link #fieldView} `true`.
  72917. *
  72918. * @observable
  72919. * @member {String|null} #errorText
  72920. */
  72921. this.set( 'errorText', null );
  72922. /**
  72923. * The additional information text displayed next to the {@link #fieldView} which can
  72924. * be used to inform the user about its purpose, provide help or hints.
  72925. *
  72926. * Set it to `null` to hide the message.
  72927. *
  72928. * **Note:** This text will be displayed in the same place as {@link #errorText} but the
  72929. * latter always takes precedence: if the {@link #errorText} is set, it replaces
  72930. * {@link #infoText}.
  72931. *
  72932. * @observable
  72933. * @member {String|null} #infoText
  72934. */
  72935. this.set( 'infoText', null );
  72936. /**
  72937. * (Optional) The additional CSS class set on the dropdown {@link #element}.
  72938. *
  72939. * @observable
  72940. * @member {String} #class
  72941. */
  72942. this.set( 'class' );
  72943. /**
  72944. * The label view instance that describes the entire view.
  72945. *
  72946. * @member {module:ui/label/labelview~LabelView} #labelView
  72947. */
  72948. this.labelView = this._createLabelView( viewUid );
  72949. /**
  72950. * The status view for the {@link #fieldView}. It displays {@link #errorText} and
  72951. * {@link #infoText}.
  72952. *
  72953. * @member {module:ui/view~View} #statusView
  72954. */
  72955. this.statusView = this._createStatusView( statusUid );
  72956. /**
  72957. * The combined status text made of {@link #errorText} and {@link #infoText}.
  72958. * Note that when present, {@link #errorText} always takes precedence in the
  72959. * status.
  72960. *
  72961. * @see #errorText
  72962. * @see #infoText
  72963. * @see #statusView
  72964. * @private
  72965. * @observable
  72966. * @member {String|null} #_statusText
  72967. */
  72968. this.bind( '_statusText' ).to(
  72969. this, 'errorText',
  72970. this, 'infoText',
  72971. ( errorText, infoText ) => errorText || infoText
  72972. );
  72973. const bind = this.bindTemplate;
  72974. this.setTemplate( {
  72975. tag: 'div',
  72976. attributes: {
  72977. class: [
  72978. 'ck',
  72979. 'ck-labeled-field-view',
  72980. bind.to( 'class' ),
  72981. bind.if( 'isEnabled', 'ck-disabled', value => !value )
  72982. ]
  72983. },
  72984. children: [
  72985. this.labelView,
  72986. this.fieldView,
  72987. this.statusView
  72988. ]
  72989. } );
  72990. }
  72991. /**
  72992. * Creates label view class instance and bind with view.
  72993. *
  72994. * @private
  72995. * @param {String} id Unique id to set as labelView#for attribute.
  72996. * @returns {module:ui/label/labelview~LabelView}
  72997. */
  72998. _createLabelView( id ) {
  72999. const labelView = new _label_labelview__WEBPACK_IMPORTED_MODULE_2__["default"]( this.locale );
  73000. labelView.for = id;
  73001. labelView.bind( 'text' ).to( this, 'label' );
  73002. return labelView;
  73003. }
  73004. /**
  73005. * Creates the status view instance. It displays {@link #errorText} and {@link #infoText}
  73006. * next to the {@link #fieldView}. See {@link #_statusText}.
  73007. *
  73008. * @private
  73009. * @param {String} statusUid Unique id of the status, shared with the {@link #fieldView view's}
  73010. * `aria-describedby` attribute.
  73011. * @returns {module:ui/view~View}
  73012. */
  73013. _createStatusView( statusUid ) {
  73014. const statusView = new _view__WEBPACK_IMPORTED_MODULE_0__["default"]( this.locale );
  73015. const bind = this.bindTemplate;
  73016. statusView.setTemplate( {
  73017. tag: 'div',
  73018. attributes: {
  73019. class: [
  73020. 'ck',
  73021. 'ck-labeled-field-view__status',
  73022. bind.if( 'errorText', 'ck-labeled-field-view__status_error' ),
  73023. bind.if( '_statusText', 'ck-hidden', value => !value )
  73024. ],
  73025. id: statusUid,
  73026. role: bind.if( 'errorText', 'alert' )
  73027. },
  73028. children: [
  73029. {
  73030. text: bind.to( '_statusText' )
  73031. }
  73032. ]
  73033. } );
  73034. return statusView;
  73035. }
  73036. /**
  73037. * Focuses the {@link #fieldView}.
  73038. */
  73039. focus() {
  73040. this.fieldView.focus();
  73041. }
  73042. }
  73043. /***/ }),
  73044. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/labeledfield/utils.js":
  73045. /*!***********************************************************************!*\
  73046. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/labeledfield/utils.js ***!
  73047. \***********************************************************************/
  73048. /*! exports provided: createLabeledInputText, createLabeledDropdown */
  73049. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  73050. "use strict";
  73051. __webpack_require__.r(__webpack_exports__);
  73052. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLabeledInputText", function() { return createLabeledInputText; });
  73053. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLabeledDropdown", function() { return createLabeledDropdown; });
  73054. /* harmony import */ var _inputtext_inputtextview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../inputtext/inputtextview */ "./node_modules/@ckeditor/ckeditor5-ui/src/inputtext/inputtextview.js");
  73055. /* harmony import */ var _dropdown_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dropdown/utils */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/utils.js");
  73056. /**
  73057. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  73058. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  73059. */
  73060. /**
  73061. * @module ui/labeledfield/utils
  73062. */
  73063. /**
  73064. * A helper for creating labeled inputs.
  73065. *
  73066. * It creates an instance of a {@link module:ui/inputtext/inputtextview~InputTextView input text} that is
  73067. * logically related to a {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView labeled view} in DOM.
  73068. *
  73069. * The helper does the following:
  73070. *
  73071. * * It sets input's `id` and `ariaDescribedById` attributes.
  73072. * * It binds input's `isReadOnly` to the labeled view.
  73073. * * It binds input's `hasError` to the labeled view.
  73074. * * It enables a logic that cleans up the error when user starts typing in the input..
  73075. *
  73076. * Usage:
  73077. *
  73078. * const labeledInputView = new LabeledFieldView( locale, createLabeledDropdown );
  73079. * console.log( labeledInputView.view ); // An input instance.
  73080. *
  73081. * @param {module:ui/labeledfield/labeledfieldview~LabeledFieldView} labeledFieldView The instance of the labeled field view.
  73082. * @param {String} viewUid An UID string that allows DOM logical connection between the
  73083. * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#labelView labeled view's label} and the input.
  73084. * @param {String} statusUid An UID string that allows DOM logical connection between the
  73085. * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#statusView labeled view's status} and the input.
  73086. * @returns {module:ui/inputtext/inputtextview~InputTextView} The input text view instance.
  73087. */
  73088. function createLabeledInputText( labeledFieldView, viewUid, statusUid ) {
  73089. const inputView = new _inputtext_inputtextview__WEBPACK_IMPORTED_MODULE_0__["default"]( labeledFieldView.locale );
  73090. inputView.set( {
  73091. id: viewUid,
  73092. ariaDescribedById: statusUid
  73093. } );
  73094. inputView.bind( 'isReadOnly' ).to( labeledFieldView, 'isEnabled', value => !value );
  73095. inputView.bind( 'hasError' ).to( labeledFieldView, 'errorText', value => !!value );
  73096. inputView.on( 'input', () => {
  73097. // UX: Make the error text disappear and disable the error indicator as the user
  73098. // starts fixing the errors.
  73099. labeledFieldView.errorText = null;
  73100. } );
  73101. return inputView;
  73102. }
  73103. /**
  73104. * A helper for creating labeled dropdowns.
  73105. *
  73106. * It creates an instance of a {@link module:ui/dropdown/dropdownview~DropdownView dropdown} that is
  73107. * logically related to a {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView labeled field view}.
  73108. *
  73109. * The helper does the following:
  73110. *
  73111. * * It sets dropdown's `id` and `ariaDescribedById` attributes.
  73112. * * It binds input's `isEnabled` to the labeled view.
  73113. *
  73114. * Usage:
  73115. *
  73116. * const labeledInputView = new LabeledFieldView( locale, createLabeledDropdown );
  73117. * console.log( labeledInputView.view ); // A dropdown instance.
  73118. *
  73119. * @param {module:ui/labeledfield/labeledfieldview~LabeledFieldView} labeledFieldView The instance of the labeled field view.
  73120. * @param {String} viewUid An UID string that allows DOM logical connection between the
  73121. * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#labelView labeled view label} and the dropdown.
  73122. * @param {String} statusUid An UID string that allows DOM logical connection between the
  73123. * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#statusView labeled view status} and the dropdown.
  73124. * @returns {module:ui/dropdown/dropdownview~DropdownView} The dropdown view instance.
  73125. */
  73126. function createLabeledDropdown( labeledFieldView, viewUid, statusUid ) {
  73127. const dropdownView = Object(_dropdown_utils__WEBPACK_IMPORTED_MODULE_1__["createDropdown"])( labeledFieldView.locale );
  73128. dropdownView.set( {
  73129. id: viewUid,
  73130. ariaDescribedById: statusUid
  73131. } );
  73132. dropdownView.bind( 'isEnabled' ).to( labeledFieldView );
  73133. return dropdownView;
  73134. }
  73135. /***/ }),
  73136. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/list/listitemview.js":
  73137. /*!**********************************************************************!*\
  73138. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/list/listitemview.js ***!
  73139. \**********************************************************************/
  73140. /*! exports provided: default */
  73141. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  73142. "use strict";
  73143. __webpack_require__.r(__webpack_exports__);
  73144. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ListItemView; });
  73145. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  73146. /**
  73147. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  73148. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  73149. */
  73150. /**
  73151. * @module ui/list/listitemview
  73152. */
  73153. /**
  73154. * The list item view class.
  73155. *
  73156. * @extends module:ui/view~View
  73157. */
  73158. class ListItemView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  73159. /**
  73160. * @inheritDoc
  73161. */
  73162. constructor( locale ) {
  73163. super( locale );
  73164. /**
  73165. * Collection of the child views inside of the list item {@link #element}.
  73166. *
  73167. * @readonly
  73168. * @member {module:ui/viewcollection~ViewCollection}
  73169. */
  73170. this.children = this.createCollection();
  73171. this.setTemplate( {
  73172. tag: 'li',
  73173. attributes: {
  73174. class: [
  73175. 'ck',
  73176. 'ck-list__item'
  73177. ]
  73178. },
  73179. children: this.children
  73180. } );
  73181. }
  73182. /**
  73183. * Focuses the list item.
  73184. */
  73185. focus() {
  73186. this.children.first.focus();
  73187. }
  73188. }
  73189. /***/ }),
  73190. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/list/listseparatorview.js":
  73191. /*!***************************************************************************!*\
  73192. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/list/listseparatorview.js ***!
  73193. \***************************************************************************/
  73194. /*! exports provided: default */
  73195. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  73196. "use strict";
  73197. __webpack_require__.r(__webpack_exports__);
  73198. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ListSeparatorView; });
  73199. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  73200. /**
  73201. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  73202. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  73203. */
  73204. /**
  73205. * @module ui/list/listseparatorview
  73206. */
  73207. /**
  73208. * The list separator view class.
  73209. *
  73210. * @extends module:ui/view~View
  73211. */
  73212. class ListSeparatorView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  73213. /**
  73214. * @inheritDoc
  73215. */
  73216. constructor( locale ) {
  73217. super( locale );
  73218. this.setTemplate( {
  73219. tag: 'li',
  73220. attributes: {
  73221. class: [
  73222. 'ck',
  73223. 'ck-list__separator'
  73224. ]
  73225. }
  73226. } );
  73227. }
  73228. }
  73229. /***/ }),
  73230. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/list/listview.js":
  73231. /*!******************************************************************!*\
  73232. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/list/listview.js ***!
  73233. \******************************************************************/
  73234. /*! exports provided: default */
  73235. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  73236. "use strict";
  73237. __webpack_require__.r(__webpack_exports__);
  73238. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ListView; });
  73239. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  73240. /* harmony import */ var _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/focustracker */ "./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js");
  73241. /* harmony import */ var _focuscycler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../focuscycler */ "./node_modules/@ckeditor/ckeditor5-ui/src/focuscycler.js");
  73242. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keystrokehandler */ "./node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js");
  73243. /* harmony import */ var _theme_components_list_list_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../theme/components/list/list.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/list/list.css");
  73244. /* harmony import */ var _theme_components_list_list_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_theme_components_list_list_css__WEBPACK_IMPORTED_MODULE_4__);
  73245. /**
  73246. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  73247. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  73248. */
  73249. /**
  73250. * @module ui/list/listview
  73251. */
  73252. /**
  73253. * The list view class.
  73254. *
  73255. * @extends module:ui/view~View
  73256. * @implements module:ui/dropdown/dropdownpanelfocusable~DropdownPanelFocusable
  73257. */
  73258. class ListView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  73259. /**
  73260. * @inheritDoc
  73261. */
  73262. constructor() {
  73263. super();
  73264. /**
  73265. * Collection of the child list views.
  73266. *
  73267. * @readonly
  73268. * @member {module:ui/viewcollection~ViewCollection}
  73269. */
  73270. this.items = this.createCollection();
  73271. /**
  73272. * Tracks information about DOM focus in the list.
  73273. *
  73274. * @readonly
  73275. * @member {module:utils/focustracker~FocusTracker}
  73276. */
  73277. this.focusTracker = new _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_1__["default"]();
  73278. /**
  73279. * Instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
  73280. *
  73281. * @readonly
  73282. * @member {module:utils/keystrokehandler~KeystrokeHandler}
  73283. */
  73284. this.keystrokes = new _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_3__["default"]();
  73285. /**
  73286. * Helps cycling over focusable {@link #items} in the list.
  73287. *
  73288. * @readonly
  73289. * @protected
  73290. * @member {module:ui/focuscycler~FocusCycler}
  73291. */
  73292. this._focusCycler = new _focuscycler__WEBPACK_IMPORTED_MODULE_2__["default"]( {
  73293. focusables: this.items,
  73294. focusTracker: this.focusTracker,
  73295. keystrokeHandler: this.keystrokes,
  73296. actions: {
  73297. // Navigate list items backwards using the arrowup key.
  73298. focusPrevious: 'arrowup',
  73299. // Navigate toolbar items forwards using the arrowdown key.
  73300. focusNext: 'arrowdown'
  73301. }
  73302. } );
  73303. this.setTemplate( {
  73304. tag: 'ul',
  73305. attributes: {
  73306. class: [
  73307. 'ck',
  73308. 'ck-reset',
  73309. 'ck-list'
  73310. ]
  73311. },
  73312. children: this.items
  73313. } );
  73314. }
  73315. /**
  73316. * @inheritDoc
  73317. */
  73318. render() {
  73319. super.render();
  73320. // Items added before rendering should be known to the #focusTracker.
  73321. for ( const item of this.items ) {
  73322. this.focusTracker.add( item.element );
  73323. }
  73324. this.items.on( 'add', ( evt, item ) => {
  73325. this.focusTracker.add( item.element );
  73326. } );
  73327. this.items.on( 'remove', ( evt, item ) => {
  73328. this.focusTracker.remove( item.element );
  73329. } );
  73330. // Start listening for the keystrokes coming from #element.
  73331. this.keystrokes.listenTo( this.element );
  73332. }
  73333. /**
  73334. * Focuses the first focusable in {@link #items}.
  73335. */
  73336. focus() {
  73337. this._focusCycler.focusFirst();
  73338. }
  73339. /**
  73340. * Focuses the last focusable in {@link #items}.
  73341. */
  73342. focusLast() {
  73343. this._focusCycler.focusLast();
  73344. }
  73345. }
  73346. /***/ }),
  73347. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/model.js":
  73348. /*!**********************************************************!*\
  73349. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/model.js ***!
  73350. \**********************************************************/
  73351. /*! exports provided: default */
  73352. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  73353. "use strict";
  73354. __webpack_require__.r(__webpack_exports__);
  73355. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Model; });
  73356. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  73357. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  73358. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  73359. /**
  73360. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  73361. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  73362. */
  73363. /**
  73364. * @module ui/model
  73365. */
  73366. /**
  73367. * The base MVC model class.
  73368. *
  73369. * @mixes module:utils/observablemixin~ObservableMixin
  73370. */
  73371. class Model {
  73372. /**
  73373. * Creates a new Model instance.
  73374. *
  73375. * @param {Object} [attributes] The model state attributes to be defined during the instance creation.
  73376. * @param {Object} [properties] The (out of state) properties to be appended to the instance during creation.
  73377. */
  73378. constructor( attributes, properties ) {
  73379. // Extend this instance with the additional (out of state) properties.
  73380. if ( properties ) {
  73381. Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["extend"])( this, properties );
  73382. }
  73383. // Initialize the attributes.
  73384. if ( attributes ) {
  73385. this.set( attributes );
  73386. }
  73387. }
  73388. }
  73389. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_0__["default"])( Model, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  73390. /***/ }),
  73391. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/notification/notification.js":
  73392. /*!******************************************************************************!*\
  73393. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/notification/notification.js ***!
  73394. \******************************************************************************/
  73395. /*! exports provided: default */
  73396. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  73397. "use strict";
  73398. __webpack_require__.r(__webpack_exports__);
  73399. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Notification; });
  73400. /* harmony import */ var _ckeditor_ckeditor5_core_src_contextplugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/contextplugin */ "./node_modules/@ckeditor/ckeditor5-core/src/contextplugin.js");
  73401. /**
  73402. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  73403. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  73404. */
  73405. /**
  73406. * @module ui/notification/notification
  73407. */
  73408. /* globals window */
  73409. /**
  73410. * The Notification plugin.
  73411. *
  73412. * This plugin sends a few types of notifications: `success`, `info` and `warning`. The notifications need to be
  73413. * handled and displayed by a plugin responsible for showing the UI of the notifications. Using this plugin for dispatching
  73414. * notifications makes it possible to switch the notifications UI.
  73415. *
  73416. * Note that every unhandled and not stopped `warning` notification will be displayed as a system alert.
  73417. * See {@link module:ui/notification/notification~Notification#showWarning}.
  73418. *
  73419. * @extends module:core/contextplugin~ContextPlugin
  73420. */
  73421. class Notification extends _ckeditor_ckeditor5_core_src_contextplugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  73422. /**
  73423. * @inheritDoc
  73424. */
  73425. static get pluginName() {
  73426. return 'Notification';
  73427. }
  73428. /**
  73429. * @inheritDoc
  73430. */
  73431. init() {
  73432. // Each unhandled and not stopped `show:warning` event is displayed as a system alert.
  73433. this.on( 'show:warning', ( evt, data ) => {
  73434. window.alert( data.message ); // eslint-disable-line no-alert
  73435. }, { priority: 'lowest' } );
  73436. }
  73437. /**
  73438. * Shows a success notification.
  73439. *
  73440. * By default, it fires the {@link #event:show:success `show:success` event} with the given `data`. The event namespace can be extended
  73441. * using the `data.namespace` option. For example:
  73442. *
  73443. * showSuccess( 'Image is uploaded.', {
  73444. * namespace: 'upload:image'
  73445. * } );
  73446. *
  73447. * will fire the `show:success:upload:image` event.
  73448. *
  73449. * You can provide the title of the notification:
  73450. *
  73451. * showSuccess( 'Image is uploaded.', {
  73452. * title: 'Image upload success'
  73453. * } );
  73454. *
  73455. * @param {String} message The content of the notification.
  73456. * @param {Object} [data={}] Additional data.
  73457. * @param {String} [data.namespace] Additional event namespace.
  73458. * @param {String} [data.title] The title of the notification.
  73459. */
  73460. showSuccess( message, data = {} ) {
  73461. this._showNotification( {
  73462. message,
  73463. type: 'success',
  73464. namespace: data.namespace,
  73465. title: data.title
  73466. } );
  73467. }
  73468. /**
  73469. * Shows an information notification.
  73470. *
  73471. * By default, it fires the {@link #event:show:info `show:info` event} with the given `data`. The event namespace can be extended
  73472. * using the `data.namespace` option. For example:
  73473. *
  73474. * showInfo( 'Editor is offline.', {
  73475. * namespace: 'editor:status'
  73476. * } );
  73477. *
  73478. * will fire the `show:info:editor:status` event.
  73479. *
  73480. * You can provide the title of the notification:
  73481. *
  73482. * showInfo( 'Editor is offline.', {
  73483. * title: 'Network information'
  73484. * } );
  73485. *
  73486. * @param {String} message The content of the notification.
  73487. * @param {Object} [data={}] Additional data.
  73488. * @param {String} [data.namespace] Additional event namespace.
  73489. * @param {String} [data.title] The title of the notification.
  73490. */
  73491. showInfo( message, data = {} ) {
  73492. this._showNotification( {
  73493. message,
  73494. type: 'info',
  73495. namespace: data.namespace,
  73496. title: data.title
  73497. } );
  73498. }
  73499. /**
  73500. * Shows a warning notification.
  73501. *
  73502. * By default, it fires the {@link #event:show:warning `show:warning` event}
  73503. * with the given `data`. The event namespace can be extended using the `data.namespace` option. For example:
  73504. *
  73505. * showWarning( 'Image upload error.', {
  73506. * namespace: 'upload:image'
  73507. * } );
  73508. *
  73509. * will fire the `show:warning:upload:image` event.
  73510. *
  73511. * You can provide the title of the notification:
  73512. *
  73513. * showWarning( 'Image upload error.', {
  73514. * title: 'Upload failed'
  73515. * } );
  73516. *
  73517. * Note that each unhandled and not stopped `warning` notification will be displayed as a system alert.
  73518. * The plugin responsible for displaying warnings should `stop()` the event to prevent displaying it as an alert:
  73519. *
  73520. * notifications.on( 'show:warning', ( evt, data ) => {
  73521. * // Do something with the data.
  73522. *
  73523. * // Stop this event to prevent displaying it as an alert.
  73524. * evt.stop();
  73525. * } );
  73526. *
  73527. * You can attach many listeners to the same event and `stop()` this event in a listener with a low priority:
  73528. *
  73529. * notifications.on( 'show:warning', ( evt, data ) => {
  73530. * // Show the warning in the UI, but do not stop it.
  73531. * } );
  73532. *
  73533. * notifications.on( 'show:warning', ( evt, data ) => {
  73534. * // Log the warning to some error tracker.
  73535. *
  73536. * // Stop this event to prevent displaying it as an alert.
  73537. * evt.stop();
  73538. * }, { priority: 'low' } );
  73539. *
  73540. * @param {String} message The content of the notification.
  73541. * @param {Object} [data={}] Additional data.
  73542. * @param {String} [data.namespace] Additional event namespace.
  73543. * @param {String} [data.title] The title of the notification.
  73544. */
  73545. showWarning( message, data = {} ) {
  73546. this._showNotification( {
  73547. message,
  73548. type: 'warning',
  73549. namespace: data.namespace,
  73550. title: data.title
  73551. } );
  73552. }
  73553. /**
  73554. * Fires the `show` event with the specified type, namespace and message.
  73555. *
  73556. * @private
  73557. * @param {Object} data The message data.
  73558. * @param {String} data.message The content of the notification.
  73559. * @param {'success'|'info'|'warning'} data.type The type of the message.
  73560. * @param {String} [data.namespace] Additional event namespace.
  73561. * @param {String} [data.title=''] The title of the notification.
  73562. */
  73563. _showNotification( data ) {
  73564. const event = `show:${ data.type }` + ( data.namespace ? `:${ data.namespace }` : '' );
  73565. this.fire( event, {
  73566. message: data.message,
  73567. type: data.type,
  73568. title: data.title || ''
  73569. } );
  73570. }
  73571. /**
  73572. * Fired when one of the `showSuccess()`, `showInfo()`, `showWarning()` methods is called.
  73573. *
  73574. * @event show
  73575. * @param {Object} data The notification data.
  73576. * @param {String} data.message The content of the notification.
  73577. * @param {String} data.title The title of the notification.
  73578. * @param {'success'|'info'|'warning'} data.type The type of the notification.
  73579. */
  73580. /**
  73581. * Fired when the `showSuccess()` method is called.
  73582. *
  73583. * @event show:success
  73584. * @param {Object} data The notification data.
  73585. * @param {String} data.message The content of the notification.
  73586. * @param {String} data.title The title of the notification.
  73587. * @param {'success'} data.type The type of the notification.
  73588. */
  73589. /**
  73590. * Fired when the `showInfo()` method is called.
  73591. *
  73592. * @event show:info
  73593. * @param {Object} data The notification data.
  73594. * @param {String} data.message The content of the notification.
  73595. * @param {String} data.title The title of the notification.
  73596. * @param {'info'} data.type The type of the notification.
  73597. */
  73598. /**
  73599. * Fired when the `showWarning()` method is called.
  73600. *
  73601. * When this event is not handled or stopped by `event.stop()`, the `data.message` of this event will
  73602. * be automatically displayed as a system alert.
  73603. *
  73604. * @event show:warning
  73605. * @param {Object} data The notification data.
  73606. * @param {String} data.message The content of the notification.
  73607. * @param {String} data.title The title of the notification.
  73608. * @param {'warning'} data.type The type of the notification.
  73609. */
  73610. }
  73611. /***/ }),
  73612. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview.js":
  73613. /*!***********************************************************************************!*\
  73614. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview.js ***!
  73615. \***********************************************************************************/
  73616. /*! exports provided: default */
  73617. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  73618. "use strict";
  73619. __webpack_require__.r(__webpack_exports__);
  73620. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BalloonPanelView; });
  73621. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  73622. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_position__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/position */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/position.js");
  73623. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_isrange__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/isrange */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/isrange.js");
  73624. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/tounit */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/tounit.js");
  73625. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
  73626. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  73627. /* harmony import */ var _theme_components_panel_balloonpanel_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../theme/components/panel/balloonpanel.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonpanel.css");
  73628. /* harmony import */ var _theme_components_panel_balloonpanel_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_theme_components_panel_balloonpanel_css__WEBPACK_IMPORTED_MODULE_6__);
  73629. /**
  73630. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  73631. * For licensing, see LICENSE.md.
  73632. */
  73633. /**
  73634. * @module ui/panel/balloon/balloonpanelview
  73635. */
  73636. const toPx = Object(_ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_3__["default"])( 'px' );
  73637. const defaultLimiterElement = _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_4__["default"].document.body;
  73638. /**
  73639. * The balloon panel view class.
  73640. *
  73641. * A floating container which can
  73642. * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#pin pin} to any
  73643. * {@link module:utils/dom/position~Options#target target} in the DOM and remain in that position
  73644. * e.g. when the web page is scrolled.
  73645. *
  73646. * The balloon panel can be used to display contextual, non-blocking UI like forms, toolbars and
  73647. * the like in its {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#content} view
  73648. * collection.
  73649. *
  73650. * There is a number of {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}
  73651. * that the balloon can use, automatically switching from one to another when the viewport space becomes
  73652. * scarce to keep the balloon visible to the user as long as it is possible. The balloon will also
  73653. * accept any custom position set provided by the user compatible with the
  73654. * {@link module:utils/dom/position~Options options}.
  73655. *
  73656. * const panel = new BalloonPanelView( locale );
  73657. * const childView = new ChildView();
  73658. * const positions = BalloonPanelView.defaultPositions;
  73659. *
  73660. * panel.render();
  73661. *
  73662. * // Add a child view to the panel's content collection.
  73663. * panel.content.add( childView );
  73664. *
  73665. * // Start pinning the panel to an element with the "target" id DOM.
  73666. * // The balloon will remain pinned until unpin() is called.
  73667. * panel.pin( {
  73668. * target: document.querySelector( '#target' ),
  73669. * positions: [
  73670. * positions.northArrowSouth,
  73671. * positions.southArrowNorth
  73672. * ]
  73673. * } );
  73674. *
  73675. * @extends module:ui/view~View
  73676. */
  73677. class BalloonPanelView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  73678. /**
  73679. * @inheritDoc
  73680. */
  73681. constructor( locale ) {
  73682. super( locale );
  73683. const bind = this.bindTemplate;
  73684. /**
  73685. * The absolute top position of the balloon panel in pixels.
  73686. *
  73687. * @observable
  73688. * @default 0
  73689. * @member {Number} #top
  73690. */
  73691. this.set( 'top', 0 );
  73692. /**
  73693. * The absolute left position of the balloon panel in pixels.
  73694. *
  73695. * @observable
  73696. * @default 0
  73697. * @member {Number} #left
  73698. */
  73699. this.set( 'left', 0 );
  73700. /**
  73701. * The balloon panel's current position. The position name is reflected in the CSS class set
  73702. * to the balloon, i.e. `.ck-balloon-panel_arrow_nw` for the "arrow_nw" position. The class
  73703. * controls the minor aspects of the balloon's visual appearance like the placement
  73704. * of an {@link #withArrow arrow}. To support a new position, an additional CSS must be created.
  73705. *
  73706. * Default position names correspond with
  73707. * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}.
  73708. *
  73709. * See the {@link #attachTo} and {@link #pin} methods to learn about custom balloon positions.
  73710. *
  73711. * @observable
  73712. * @default 'arrow_nw'
  73713. * @member {'arrow_nw'|'arrow_ne'|'arrow_sw'|'arrow_se'} #position
  73714. */
  73715. this.set( 'position', 'arrow_nw' );
  73716. /**
  73717. * Controls whether the balloon panel is visible or not.
  73718. *
  73719. * @observable
  73720. * @default false
  73721. * @member {Boolean} #isVisible
  73722. */
  73723. this.set( 'isVisible', false );
  73724. /**
  73725. * Controls whether the balloon panel has an arrow. The presence of the arrow
  73726. * is reflected in the `ck-balloon-panel_with-arrow` CSS class.
  73727. *
  73728. * @observable
  73729. * @default true
  73730. * @member {Boolean} #withArrow
  73731. */
  73732. this.set( 'withArrow', true );
  73733. /**
  73734. * An additional CSS class added to the {@link #element}.
  73735. *
  73736. * @observable
  73737. * @member {String} #class
  73738. */
  73739. this.set( 'class' );
  73740. /**
  73741. * A callback that starts pinning the panel when {@link #isVisible} gets
  73742. * `true`. Used by {@link #pin}.
  73743. *
  73744. * @private
  73745. * @member {Function} #_pinWhenIsVisibleCallback
  73746. */
  73747. /**
  73748. * A collection of the child views that creates the balloon panel contents.
  73749. *
  73750. * @readonly
  73751. * @member {module:ui/viewcollection~ViewCollection}
  73752. */
  73753. this.content = this.createCollection();
  73754. this.setTemplate( {
  73755. tag: 'div',
  73756. attributes: {
  73757. class: [
  73758. 'ck',
  73759. 'ck-balloon-panel',
  73760. bind.to( 'position', value => `ck-balloon-panel_${ value }` ),
  73761. bind.if( 'isVisible', 'ck-balloon-panel_visible' ),
  73762. bind.if( 'withArrow', 'ck-balloon-panel_with-arrow' ),
  73763. bind.to( 'class' )
  73764. ],
  73765. style: {
  73766. top: bind.to( 'top', toPx ),
  73767. left: bind.to( 'left', toPx )
  73768. }
  73769. },
  73770. children: this.content
  73771. } );
  73772. }
  73773. /**
  73774. * Shows the panel.
  73775. *
  73776. * See {@link #isVisible}.
  73777. */
  73778. show() {
  73779. this.isVisible = true;
  73780. }
  73781. /**
  73782. * Hides the panel.
  73783. *
  73784. * See {@link #isVisible}.
  73785. */
  73786. hide() {
  73787. this.isVisible = false;
  73788. }
  73789. /**
  73790. * Attaches the panel to a specified {@link module:utils/dom/position~Options#target} with a
  73791. * smart positioning heuristics that chooses from available positions to make sure the panel
  73792. * is visible to the user i.e. within the limits of the viewport.
  73793. *
  73794. * This method accepts configuration {@link module:utils/dom/position~Options options}
  73795. * to set the `target`, optional `limiter` and `positions` the balloon should choose from.
  73796. *
  73797. * const panel = new BalloonPanelView( locale );
  73798. * const positions = BalloonPanelView.defaultPositions;
  73799. *
  73800. * panel.render();
  73801. *
  73802. * // Attach the panel to an element with the "target" id DOM.
  73803. * panel.attachTo( {
  73804. * target: document.querySelector( '#target' ),
  73805. * positions: [
  73806. * positions.northArrowSouth,
  73807. * positions.southArrowNorth
  73808. * ]
  73809. * } );
  73810. *
  73811. * **Note**: Attaching the panel will also automatically {@link #show} it.
  73812. *
  73813. * **Note**: An attached panel will not follow its target when the window is scrolled or resized.
  73814. * See the {@link #pin} method for a more permanent positioning strategy.
  73815. *
  73816. * @param {module:utils/dom/position~Options} options Positioning options compatible with
  73817. * {@link module:utils/dom/position~getOptimalPosition}. Default `positions` array is
  73818. * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}.
  73819. */
  73820. attachTo( options ) {
  73821. this.show();
  73822. const defaultPositions = BalloonPanelView.defaultPositions;
  73823. const positionOptions = Object.assign( {}, {
  73824. element: this.element,
  73825. positions: [
  73826. defaultPositions.southArrowNorth,
  73827. defaultPositions.southArrowNorthMiddleWest,
  73828. defaultPositions.southArrowNorthMiddleEast,
  73829. defaultPositions.southArrowNorthWest,
  73830. defaultPositions.southArrowNorthEast,
  73831. defaultPositions.northArrowSouth,
  73832. defaultPositions.northArrowSouthMiddleWest,
  73833. defaultPositions.northArrowSouthMiddleEast,
  73834. defaultPositions.northArrowSouthWest,
  73835. defaultPositions.northArrowSouthEast
  73836. ],
  73837. limiter: defaultLimiterElement,
  73838. fitInViewport: true
  73839. }, options );
  73840. const optimalPosition = BalloonPanelView._getOptimalPosition( positionOptions );
  73841. // Usually browsers make some problems with super accurate values like 104.345px
  73842. // so it is better to use int values.
  73843. const left = parseInt( optimalPosition.left );
  73844. const top = parseInt( optimalPosition.top );
  73845. const position = optimalPosition.name;
  73846. Object.assign( this, { top, left, position } );
  73847. }
  73848. /**
  73849. * Works the same way as the {@link #attachTo} method except that the position of the panel is
  73850. * continuously updated when:
  73851. *
  73852. * * any ancestor of the {@link module:utils/dom/position~Options#target}
  73853. * or {@link module:utils/dom/position~Options#limiter} is scrolled,
  73854. * * the browser window gets resized or scrolled.
  73855. *
  73856. * Thanks to that, the panel always sticks to the {@link module:utils/dom/position~Options#target}
  73857. * and is immune to the changing environment.
  73858. *
  73859. * const panel = new BalloonPanelView( locale );
  73860. * const positions = BalloonPanelView.defaultPositions;
  73861. *
  73862. * panel.render();
  73863. *
  73864. * // Pin the panel to an element with the "target" id DOM.
  73865. * panel.pin( {
  73866. * target: document.querySelector( '#target' ),
  73867. * positions: [
  73868. * positions.northArrowSouth,
  73869. * positions.southArrowNorth
  73870. * ]
  73871. * } );
  73872. *
  73873. * To leave the pinned state, use the {@link #unpin} method.
  73874. *
  73875. * **Note**: Pinning the panel will also automatically {@link #show} it.
  73876. *
  73877. * @param {module:utils/dom/position~Options} options Positioning options compatible with
  73878. * {@link module:utils/dom/position~getOptimalPosition}. Default `positions` array is
  73879. * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}.
  73880. */
  73881. pin( options ) {
  73882. this.unpin();
  73883. this._pinWhenIsVisibleCallback = () => {
  73884. if ( this.isVisible ) {
  73885. this._startPinning( options );
  73886. } else {
  73887. this._stopPinning();
  73888. }
  73889. };
  73890. this._startPinning( options );
  73891. // Control the state of the listeners depending on whether the panel is visible
  73892. // or not.
  73893. // TODO: Use on() (https://github.com/ckeditor/ckeditor5-utils/issues/144).
  73894. this.listenTo( this, 'change:isVisible', this._pinWhenIsVisibleCallback );
  73895. }
  73896. /**
  73897. * Stops pinning the panel, as set up by {@link #pin}.
  73898. */
  73899. unpin() {
  73900. if ( this._pinWhenIsVisibleCallback ) {
  73901. // Deactivate listeners attached by pin().
  73902. this._stopPinning();
  73903. // Deactivate the panel pin() control logic.
  73904. // TODO: Use off() (https://github.com/ckeditor/ckeditor5-utils/issues/144).
  73905. this.stopListening( this, 'change:isVisible', this._pinWhenIsVisibleCallback );
  73906. this._pinWhenIsVisibleCallback = null;
  73907. this.hide();
  73908. }
  73909. }
  73910. /**
  73911. * Starts managing the pinned state of the panel. See {@link #pin}.
  73912. *
  73913. * @private
  73914. * @param {module:utils/dom/position~Options} options Positioning options compatible with
  73915. * {@link module:utils/dom/position~getOptimalPosition}.
  73916. */
  73917. _startPinning( options ) {
  73918. this.attachTo( options );
  73919. const targetElement = getDomElement( options.target );
  73920. const limiterElement = options.limiter ? getDomElement( options.limiter ) : defaultLimiterElement;
  73921. // Then we need to listen on scroll event of eny element in the document.
  73922. this.listenTo( _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_4__["default"].document, 'scroll', ( evt, domEvt ) => {
  73923. const scrollTarget = domEvt.target;
  73924. // The position needs to be updated if the positioning target is within the scrolled element.
  73925. const isWithinScrollTarget = targetElement && scrollTarget.contains( targetElement );
  73926. // The position needs to be updated if the positioning limiter is within the scrolled element.
  73927. const isLimiterWithinScrollTarget = limiterElement && scrollTarget.contains( limiterElement );
  73928. // The positioning target and/or limiter can be a Rect, object etc..
  73929. // There's no way to optimize the listener then.
  73930. if ( isWithinScrollTarget || isLimiterWithinScrollTarget || !targetElement || !limiterElement ) {
  73931. this.attachTo( options );
  73932. }
  73933. }, { useCapture: true } );
  73934. // We need to listen on window resize event and update position.
  73935. this.listenTo( _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_4__["default"].window, 'resize', () => {
  73936. this.attachTo( options );
  73937. } );
  73938. }
  73939. /**
  73940. * Stops managing the pinned state of the panel. See {@link #pin}.
  73941. *
  73942. * @private
  73943. */
  73944. _stopPinning() {
  73945. this.stopListening( _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_4__["default"].document, 'scroll' );
  73946. this.stopListening( _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_4__["default"].window, 'resize' );
  73947. }
  73948. }
  73949. // Returns the DOM element for given object or null, if there is none,
  73950. // e.g. when the passed object is a Rect instance or so.
  73951. //
  73952. // @private
  73953. // @param {*} object
  73954. // @returns {HTMLElement|null}
  73955. function getDomElement( object ) {
  73956. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_5__["isElement"])( object ) ) {
  73957. return object;
  73958. }
  73959. if ( Object(_ckeditor_ckeditor5_utils_src_dom_isrange__WEBPACK_IMPORTED_MODULE_2__["default"])( object ) ) {
  73960. return object.commonAncestorContainer;
  73961. }
  73962. if ( typeof object == 'function' ) {
  73963. return getDomElement( object() );
  73964. }
  73965. return null;
  73966. }
  73967. /**
  73968. * A horizontal offset of the arrow tip from the edge of the balloon. Controlled by CSS.
  73969. *
  73970. * +-----|---------...
  73971. * | |
  73972. * | |
  73973. * | |
  73974. * | |
  73975. * +--+ | +------...
  73976. * \ | /
  73977. * \|/
  73978. * >|-----|<---------------- horizontal offset
  73979. *
  73980. * @default 30
  73981. * @member {Number} module:ui/panel/balloon/balloonpanelview~BalloonPanelView.arrowHorizontalOffset
  73982. */
  73983. BalloonPanelView.arrowHorizontalOffset = 25;
  73984. /**
  73985. * A vertical offset of the arrow from the edge of the balloon. Controlled by CSS.
  73986. *
  73987. * +-------------...
  73988. * |
  73989. * |
  73990. * | /-- vertical offset
  73991. * | V
  73992. * +--+ +-----... ---------
  73993. * \ / |
  73994. * \/ |
  73995. * -------------------------------
  73996. * ^
  73997. *
  73998. * @default 15
  73999. * @member {Number} module:ui/panel/balloon/balloonpanelview~BalloonPanelView.arrowVerticalOffset
  74000. */
  74001. BalloonPanelView.arrowVerticalOffset = 10;
  74002. /**
  74003. * Function used to calculate the optimal position for the balloon.
  74004. *
  74005. * @protected
  74006. * @member {Function} module:ui/panel/balloon/balloonpanelview~BalloonPanelView._getOptimalPosition
  74007. */
  74008. BalloonPanelView._getOptimalPosition = _ckeditor_ckeditor5_utils_src_dom_position__WEBPACK_IMPORTED_MODULE_1__["getOptimalPosition"];
  74009. /**
  74010. * A default set of positioning functions used by the balloon panel view
  74011. * when attaching using the {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#attachTo} method.
  74012. *
  74013. * The available positioning functions are as follows:
  74014. *
  74015. *
  74016. *
  74017. * **North west**
  74018. *
  74019. * * `northWestArrowSouthWest`
  74020. *
  74021. * +-----------------+
  74022. * | Balloon |
  74023. * +-----------------+
  74024. * V
  74025. * [ Target ]
  74026. *
  74027. * * `northWestArrowSouthMiddleWest`
  74028. *
  74029. * +-----------------+
  74030. * | Balloon |
  74031. * +-----------------+
  74032. * V
  74033. * [ Target ]
  74034. *
  74035. * * `northWestArrowSouth`
  74036. *
  74037. * +-----------------+
  74038. * | Balloon |
  74039. * +-----------------+
  74040. * V
  74041. * [ Target ]
  74042. *
  74043. * * `northWestArrowSouthMiddleEast`
  74044. *
  74045. * +-----------------+
  74046. * | Balloon |
  74047. * +-----------------+
  74048. * V
  74049. * [ Target ]
  74050. *
  74051. * * `northWestArrowSouthEast`
  74052. *
  74053. * +-----------------+
  74054. * | Balloon |
  74055. * +-----------------+
  74056. * V
  74057. * [ Target ]
  74058. *
  74059. *
  74060. *
  74061. * **North**
  74062. *
  74063. * * `northArrowSouthWest`
  74064. *
  74065. * +-----------------+
  74066. * | Balloon |
  74067. * +-----------------+
  74068. * V
  74069. * [ Target ]
  74070. *
  74071. * * `northArrowSouthMiddleWest`
  74072. *
  74073. * +-----------------+
  74074. * | Balloon |
  74075. * +-----------------+
  74076. * V
  74077. * [ Target ]
  74078. *
  74079. * * `northArrowSouth`
  74080. *
  74081. * +-----------------+
  74082. * | Balloon |
  74083. * +-----------------+
  74084. * V
  74085. * [ Target ]
  74086. *
  74087. * * `northArrowSouthMiddleEast`
  74088. *
  74089. * +-----------------+
  74090. * | Balloon |
  74091. * +-----------------+
  74092. * V
  74093. * [ Target ]
  74094. *
  74095. * * `northArrowSouthEast`
  74096. *
  74097. * +-----------------+
  74098. * | Balloon |
  74099. * +-----------------+
  74100. * V
  74101. * [ Target ]
  74102. *
  74103. * **North east**
  74104. *
  74105. * * `northEastArrowSouthWest`
  74106. *
  74107. * +-----------------+
  74108. * | Balloon |
  74109. * +-----------------+
  74110. * V
  74111. * [ Target ]
  74112. *
  74113. *
  74114. * * `northEastArrowSouthMiddleWest`
  74115. *
  74116. * +-----------------+
  74117. * | Balloon |
  74118. * +-----------------+
  74119. * V
  74120. * [ Target ]
  74121. *
  74122. * * `northEastArrowSouth`
  74123. *
  74124. * +-----------------+
  74125. * | Balloon |
  74126. * +-----------------+
  74127. * V
  74128. * [ Target ]
  74129. *
  74130. * * `northEastArrowSouthMiddleEast`
  74131. *
  74132. * +-----------------+
  74133. * | Balloon |
  74134. * +-----------------+
  74135. * V
  74136. * [ Target ]
  74137. *
  74138. * * `northEastArrowSouthEast`
  74139. *
  74140. * +-----------------+
  74141. * | Balloon |
  74142. * +-----------------+
  74143. * V
  74144. * [ Target ]
  74145. *
  74146. *
  74147. *
  74148. * **South**
  74149. *
  74150. *
  74151. * * `southArrowNorthWest`
  74152. *
  74153. * [ Target ]
  74154. * ^
  74155. * +-----------------+
  74156. * | Balloon |
  74157. * +-----------------+
  74158. *
  74159. * * `southArrowNorthMiddleWest`
  74160. *
  74161. * [ Target ]
  74162. * ^
  74163. * +-----------------+
  74164. * | Balloon |
  74165. * +-----------------+
  74166. *
  74167. * * `southArrowNorth`
  74168. *
  74169. * [ Target ]
  74170. * ^
  74171. * +-----------------+
  74172. * | Balloon |
  74173. * +-----------------+
  74174. *
  74175. * * `southArrowNorthMiddleEast`
  74176. *
  74177. * [ Target ]
  74178. * ^
  74179. * +-----------------+
  74180. * | Balloon |
  74181. * +-----------------+
  74182. *
  74183. * * `southArrowNorthEast`
  74184. *
  74185. * [ Target ]
  74186. * ^
  74187. * +-----------------+
  74188. * | Balloon |
  74189. * +-----------------+
  74190. *
  74191. *
  74192. *
  74193. * **South west**
  74194. *
  74195. * * `southWestArrowNorthWest`
  74196. *
  74197. * [ Target ]
  74198. * ^
  74199. * +-----------------+
  74200. * | Balloon |
  74201. * +-----------------+
  74202. *
  74203. * * `southWestArrowNorthMiddleWest`
  74204. *
  74205. * [ Target ]
  74206. * ^
  74207. * +-----------------+
  74208. * | Balloon |
  74209. * +-----------------+
  74210. *
  74211. * * `southWestArrowNorth`
  74212. *
  74213. * [ Target ]
  74214. * ^
  74215. * +-----------------+
  74216. * | Balloon |
  74217. * +-----------------+
  74218. *
  74219. * * `southWestArrowNorthMiddleEast`
  74220. *
  74221. * [ Target ]
  74222. * ^
  74223. * +-----------------+
  74224. * | Balloon |
  74225. * +-----------------+
  74226. *
  74227. * * `southWestArrowNorthEast`
  74228. *
  74229. * [ Target ]
  74230. * ^
  74231. * +-----------------+
  74232. * | Balloon |
  74233. * +-----------------+
  74234. *
  74235. *
  74236. *
  74237. * **South east**
  74238. *
  74239. * * `southEastArrowNorthWest`
  74240. *
  74241. * [ Target ]
  74242. * ^
  74243. * +-----------------+
  74244. * | Balloon |
  74245. * +-----------------+
  74246. * * `southEastArrowNorthMiddleWest`
  74247. *
  74248. * [ Target ]
  74249. * ^
  74250. * +-----------------+
  74251. * | Balloon |
  74252. * +-----------------+
  74253. *
  74254. * * `southEastArrowNorth`
  74255. *
  74256. * [ Target ]
  74257. * ^
  74258. * +-----------------+
  74259. * | Balloon |
  74260. * +-----------------+
  74261. *
  74262. * * `southEastArrowNorthMiddleEast`
  74263. *
  74264. * [ Target ]
  74265. * ^
  74266. * +-----------------+
  74267. * | Balloon |
  74268. * +-----------------+
  74269. *
  74270. * * `southEastArrowNorthEast`
  74271. *
  74272. * [ Target ]
  74273. * ^
  74274. * +-----------------+
  74275. * | Balloon |
  74276. * +-----------------+
  74277. *
  74278. *
  74279. * See {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#attachTo}.
  74280. *
  74281. * Positioning functions must be compatible with {@link module:utils/dom/position~Position}.
  74282. *
  74283. * The name that the position function returns will be reflected in the balloon panel's class that
  74284. * controls the placement of the "arrow". See {@link #position} to learn more.
  74285. *
  74286. * @member {Object} module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions
  74287. */
  74288. BalloonPanelView.defaultPositions = {
  74289. // ------- North west
  74290. northWestArrowSouthWest: ( targetRect, balloonRect ) => ( {
  74291. top: getNorthTop( targetRect, balloonRect ),
  74292. left: targetRect.left - BalloonPanelView.arrowHorizontalOffset,
  74293. name: 'arrow_sw'
  74294. } ),
  74295. northWestArrowSouthMiddleWest: ( targetRect, balloonRect ) => ( {
  74296. top: getNorthTop( targetRect, balloonRect ),
  74297. left: targetRect.left - ( balloonRect.width * .25 ) - BalloonPanelView.arrowHorizontalOffset,
  74298. name: 'arrow_smw'
  74299. } ),
  74300. northWestArrowSouth: ( targetRect, balloonRect ) => ( {
  74301. top: getNorthTop( targetRect, balloonRect ),
  74302. left: targetRect.left - balloonRect.width / 2,
  74303. name: 'arrow_s'
  74304. } ),
  74305. northWestArrowSouthMiddleEast: ( targetRect, balloonRect ) => ( {
  74306. top: getNorthTop( targetRect, balloonRect ),
  74307. left: targetRect.left - ( balloonRect.width * .75 ) + BalloonPanelView.arrowHorizontalOffset,
  74308. name: 'arrow_sme'
  74309. } ),
  74310. northWestArrowSouthEast: ( targetRect, balloonRect ) => ( {
  74311. top: getNorthTop( targetRect, balloonRect ),
  74312. left: targetRect.left - balloonRect.width + BalloonPanelView.arrowHorizontalOffset,
  74313. name: 'arrow_se'
  74314. } ),
  74315. // ------- North
  74316. northArrowSouthWest: ( targetRect, balloonRect ) => ( {
  74317. top: getNorthTop( targetRect, balloonRect ),
  74318. left: targetRect.left + targetRect.width / 2 - BalloonPanelView.arrowHorizontalOffset,
  74319. name: 'arrow_sw'
  74320. } ),
  74321. northArrowSouthMiddleWest: ( targetRect, balloonRect ) => ( {
  74322. top: getNorthTop( targetRect, balloonRect ),
  74323. left: targetRect.left + targetRect.width / 2 - ( balloonRect.width * .25 ) - BalloonPanelView.arrowHorizontalOffset,
  74324. name: 'arrow_smw'
  74325. } ),
  74326. northArrowSouth: ( targetRect, balloonRect ) => ( {
  74327. top: getNorthTop( targetRect, balloonRect ),
  74328. left: targetRect.left + targetRect.width / 2 - balloonRect.width / 2,
  74329. name: 'arrow_s'
  74330. } ),
  74331. northArrowSouthMiddleEast: ( targetRect, balloonRect ) => ( {
  74332. top: getNorthTop( targetRect, balloonRect ),
  74333. left: targetRect.left + targetRect.width / 2 - ( balloonRect.width * .75 ) + BalloonPanelView.arrowHorizontalOffset,
  74334. name: 'arrow_sme'
  74335. } ),
  74336. northArrowSouthEast: ( targetRect, balloonRect ) => ( {
  74337. top: getNorthTop( targetRect, balloonRect ),
  74338. left: targetRect.left + targetRect.width / 2 - balloonRect.width + BalloonPanelView.arrowHorizontalOffset,
  74339. name: 'arrow_se'
  74340. } ),
  74341. // ------- North east
  74342. northEastArrowSouthWest: ( targetRect, balloonRect ) => ( {
  74343. top: getNorthTop( targetRect, balloonRect ),
  74344. left: targetRect.right - BalloonPanelView.arrowHorizontalOffset,
  74345. name: 'arrow_sw'
  74346. } ),
  74347. northEastArrowSouthMiddleWest: ( targetRect, balloonRect ) => ( {
  74348. top: getNorthTop( targetRect, balloonRect ),
  74349. left: targetRect.right - ( balloonRect.width * .25 ) - BalloonPanelView.arrowHorizontalOffset,
  74350. name: 'arrow_smw'
  74351. } ),
  74352. northEastArrowSouth: ( targetRect, balloonRect ) => ( {
  74353. top: getNorthTop( targetRect, balloonRect ),
  74354. left: targetRect.right - balloonRect.width / 2,
  74355. name: 'arrow_s'
  74356. } ),
  74357. northEastArrowSouthMiddleEast: ( targetRect, balloonRect ) => ( {
  74358. top: getNorthTop( targetRect, balloonRect ),
  74359. left: targetRect.right - ( balloonRect.width * .75 ) + BalloonPanelView.arrowHorizontalOffset,
  74360. name: 'arrow_sme'
  74361. } ),
  74362. northEastArrowSouthEast: ( targetRect, balloonRect ) => ( {
  74363. top: getNorthTop( targetRect, balloonRect ),
  74364. left: targetRect.right - balloonRect.width + BalloonPanelView.arrowHorizontalOffset,
  74365. name: 'arrow_se'
  74366. } ),
  74367. // ------- South west
  74368. southWestArrowNorthWest: ( targetRect, balloonRect ) => ( {
  74369. top: getSouthTop( targetRect, balloonRect ),
  74370. left: targetRect.left - BalloonPanelView.arrowHorizontalOffset,
  74371. name: 'arrow_nw'
  74372. } ),
  74373. southWestArrowNorthMiddleWest: ( targetRect, balloonRect ) => ( {
  74374. top: getSouthTop( targetRect, balloonRect ),
  74375. left: targetRect.left - ( balloonRect.width * .25 ) - BalloonPanelView.arrowHorizontalOffset,
  74376. name: 'arrow_nmw'
  74377. } ),
  74378. southWestArrowNorth: ( targetRect, balloonRect ) => ( {
  74379. top: getSouthTop( targetRect, balloonRect ),
  74380. left: targetRect.left - balloonRect.width / 2,
  74381. name: 'arrow_n'
  74382. } ),
  74383. southWestArrowNorthMiddleEast: ( targetRect, balloonRect ) => ( {
  74384. top: getSouthTop( targetRect, balloonRect ),
  74385. left: targetRect.left - ( balloonRect.width * .75 ) + BalloonPanelView.arrowHorizontalOffset,
  74386. name: 'arrow_nme'
  74387. } ),
  74388. southWestArrowNorthEast: ( targetRect, balloonRect ) => ( {
  74389. top: getSouthTop( targetRect, balloonRect ),
  74390. left: targetRect.left - balloonRect.width + BalloonPanelView.arrowHorizontalOffset,
  74391. name: 'arrow_ne'
  74392. } ),
  74393. // ------- South
  74394. southArrowNorthWest: ( targetRect, balloonRect ) => ( {
  74395. top: getSouthTop( targetRect, balloonRect ),
  74396. left: targetRect.left + targetRect.width / 2 - BalloonPanelView.arrowHorizontalOffset,
  74397. name: 'arrow_nw'
  74398. } ),
  74399. southArrowNorthMiddleWest: ( targetRect, balloonRect ) => ( {
  74400. top: getSouthTop( targetRect, balloonRect ),
  74401. left: targetRect.left + targetRect.width / 2 - ( balloonRect.width * 0.25 ) - BalloonPanelView.arrowHorizontalOffset,
  74402. name: 'arrow_nmw'
  74403. } ),
  74404. southArrowNorth: ( targetRect, balloonRect ) => ( {
  74405. top: getSouthTop( targetRect, balloonRect ),
  74406. left: targetRect.left + targetRect.width / 2 - balloonRect.width / 2,
  74407. name: 'arrow_n'
  74408. } ),
  74409. southArrowNorthMiddleEast: ( targetRect, balloonRect ) => ( {
  74410. top: getSouthTop( targetRect, balloonRect ),
  74411. left: targetRect.left + targetRect.width / 2 - ( balloonRect.width * 0.75 ) + BalloonPanelView.arrowHorizontalOffset,
  74412. name: 'arrow_nme'
  74413. } ),
  74414. southArrowNorthEast: ( targetRect, balloonRect ) => ( {
  74415. top: getSouthTop( targetRect, balloonRect ),
  74416. left: targetRect.left + targetRect.width / 2 - balloonRect.width + BalloonPanelView.arrowHorizontalOffset,
  74417. name: 'arrow_ne'
  74418. } ),
  74419. // ------- South east
  74420. southEastArrowNorthWest: ( targetRect, balloonRect ) => ( {
  74421. top: getSouthTop( targetRect, balloonRect ),
  74422. left: targetRect.right - BalloonPanelView.arrowHorizontalOffset,
  74423. name: 'arrow_nw'
  74424. } ),
  74425. southEastArrowNorthMiddleWest: ( targetRect, balloonRect ) => ( {
  74426. top: getSouthTop( targetRect, balloonRect ),
  74427. left: targetRect.right - ( balloonRect.width * .25 ) - BalloonPanelView.arrowHorizontalOffset,
  74428. name: 'arrow_nmw'
  74429. } ),
  74430. southEastArrowNorth: ( targetRect, balloonRect ) => ( {
  74431. top: getSouthTop( targetRect, balloonRect ),
  74432. left: targetRect.right - balloonRect.width / 2,
  74433. name: 'arrow_n'
  74434. } ),
  74435. southEastArrowNorthMiddleEast: ( targetRect, balloonRect ) => ( {
  74436. top: getSouthTop( targetRect, balloonRect ),
  74437. left: targetRect.right - ( balloonRect.width * .75 ) + BalloonPanelView.arrowHorizontalOffset,
  74438. name: 'arrow_nme'
  74439. } ),
  74440. southEastArrowNorthEast: ( targetRect, balloonRect ) => ( {
  74441. top: getSouthTop( targetRect, balloonRect ),
  74442. left: targetRect.right - balloonRect.width + BalloonPanelView.arrowHorizontalOffset,
  74443. name: 'arrow_ne'
  74444. } )
  74445. };
  74446. // Returns the top coordinate for positions starting with `north*`.
  74447. //
  74448. // @private
  74449. // @param {utils/dom/rect~Rect} targetRect A rect of the target.
  74450. // @param {utils/dom/rect~Rect} elementRect A rect of the balloon.
  74451. // @returns {Number}
  74452. function getNorthTop( targetRect, balloonRect ) {
  74453. return targetRect.top - balloonRect.height - BalloonPanelView.arrowVerticalOffset;
  74454. }
  74455. // Returns the top coordinate for positions starting with `south*`.
  74456. //
  74457. // @private
  74458. // @param {utils/dom/rect~Rect} targetRect A rect of the target.
  74459. // @param {utils/dom/rect~Rect} elementRect A rect of the balloon.
  74460. // @returns {Number}
  74461. function getSouthTop( targetRect ) {
  74462. return targetRect.bottom + BalloonPanelView.arrowVerticalOffset;
  74463. }
  74464. /***/ }),
  74465. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon.js":
  74466. /*!************************************************************************************!*\
  74467. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon.js ***!
  74468. \************************************************************************************/
  74469. /*! exports provided: default */
  74470. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  74471. "use strict";
  74472. __webpack_require__.r(__webpack_exports__);
  74473. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ContextualBalloon; });
  74474. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  74475. /* harmony import */ var _balloonpanelview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./balloonpanelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview.js");
  74476. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  74477. /* harmony import */ var _button_buttonview__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  74478. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  74479. /* harmony import */ var _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/focustracker */ "./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js");
  74480. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/tounit */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/tounit.js");
  74481. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
  74482. /* harmony import */ var _theme_icons_previous_arrow_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../theme/icons/previous-arrow.svg */ "./node_modules/@ckeditor/ckeditor5-ui/theme/icons/previous-arrow.svg");
  74483. /* harmony import */ var _theme_icons_next_arrow_svg__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../theme/icons/next-arrow.svg */ "./node_modules/@ckeditor/ckeditor5-ui/theme/icons/next-arrow.svg");
  74484. /* harmony import */ var _theme_components_panel_balloonrotator_css__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../theme/components/panel/balloonrotator.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonrotator.css");
  74485. /* harmony import */ var _theme_components_panel_balloonrotator_css__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_theme_components_panel_balloonrotator_css__WEBPACK_IMPORTED_MODULE_10__);
  74486. /* harmony import */ var _theme_components_panel_fakepanel_css__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../theme/components/panel/fakepanel.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/fakepanel.css");
  74487. /* harmony import */ var _theme_components_panel_fakepanel_css__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_theme_components_panel_fakepanel_css__WEBPACK_IMPORTED_MODULE_11__);
  74488. /**
  74489. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  74490. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  74491. */
  74492. /**
  74493. * @module ui/panel/balloon/contextualballoon
  74494. */
  74495. const toPx = Object(_ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_6__["default"])( 'px' );
  74496. /**
  74497. * Provides the common contextual balloon for the editor.
  74498. *
  74499. * The role of this plugin is to unify the contextual balloons logic, simplify views management and help
  74500. * avoid the unnecessary complexity of handling multiple {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView}
  74501. * instances in the editor.
  74502. *
  74503. * This plugin allows for creating single or multiple panel stacks.
  74504. *
  74505. * Each stack may have multiple views, with the one on the top being visible. When the visible view is removed from the stack,
  74506. * the previous view becomes visible.
  74507. *
  74508. * It might be useful to implement nested navigation in a balloon. For instance, a toolbar view may contain a link button.
  74509. * When you click it, a link view (which lets you set the URL) is created and put on top of the toolbar view, so the link panel
  74510. * is displayed. When you finish editing the link and close (remove) the link view, the toolbar view is visible again.
  74511. *
  74512. * However, there are cases when there are multiple independent balloons to be displayed, for instance, if the selection
  74513. * is inside two inline comments at the same time. For such cases, you can create two independent panel stacks.
  74514. * The contextual balloon plugin will create a navigation bar to let the users switch between these panel stacks using the "Next"
  74515. * and "Previous" buttons.
  74516. *
  74517. * If there are no views in the current stack, the balloon panel will try to switch to the next stack. If there are no
  74518. * panels in any stack, the balloon panel will be hidden.
  74519. *
  74520. * **Note**: To force the balloon panel to show only one view, even if there are other stacks, use the `singleViewMode=true` option
  74521. * when {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon#add adding} a view to a panel.
  74522. *
  74523. * From the implementation point of view, the contextual ballon plugin is reusing a single
  74524. * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView} instance to display multiple contextual balloon
  74525. * panels in the editor. It also creates a special {@link module:ui/panel/balloon/contextualballoon~RotatorView rotator view},
  74526. * used to manage multiple panel stacks. Rotator view is a child of the balloon panel view and the parent of the specific
  74527. * view you want to display. If there is more than one panel stack to be displayed, the rotator view will add a
  74528. * navigation bar. If there is only one stack, the rotator view is transparent (it does not add any UI elements).
  74529. *
  74530. * @extends module:core/plugin~Plugin
  74531. */
  74532. class ContextualBalloon extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  74533. /**
  74534. * @inheritDoc
  74535. */
  74536. static get pluginName() {
  74537. return 'ContextualBalloon';
  74538. }
  74539. /**
  74540. * @inheritDoc
  74541. */
  74542. constructor( editor ) {
  74543. super( editor );
  74544. /**
  74545. * The {@link module:utils/dom/position~Options#limiter position limiter}
  74546. * for the {@link #view balloon}, used when no `limiter` has been passed into {@link #add}
  74547. * or {@link #updatePosition}.
  74548. *
  74549. * By default, a function that obtains the farthest DOM
  74550. * {@link module:engine/view/rooteditableelement~RootEditableElement}
  74551. * of the {@link module:engine/view/document~Document#selection}.
  74552. *
  74553. * @member {module:utils/dom/position~Options#limiter} #positionLimiter
  74554. */
  74555. this.positionLimiter = () => {
  74556. const view = this.editor.editing.view;
  74557. const viewDocument = view.document;
  74558. const editableElement = viewDocument.selection.editableElement;
  74559. if ( editableElement ) {
  74560. return view.domConverter.mapViewToDom( editableElement.root );
  74561. }
  74562. return null;
  74563. };
  74564. /**
  74565. * The currently visible view or `null` when there are no views in any stack.
  74566. *
  74567. * @readonly
  74568. * @observable
  74569. * @member {module:ui/view~View|null} #visibleView
  74570. */
  74571. this.set( 'visibleView', null );
  74572. /**
  74573. * The common balloon panel view.
  74574. *
  74575. * @readonly
  74576. * @member {module:ui/panel/balloon/balloonpanelview~BalloonPanelView} #view
  74577. */
  74578. this.view = new _balloonpanelview__WEBPACK_IMPORTED_MODULE_1__["default"]( editor.locale );
  74579. editor.ui.view.body.add( this.view );
  74580. editor.ui.focusTracker.add( this.view.element );
  74581. /**
  74582. * The map of views and their stacks.
  74583. *
  74584. * @private
  74585. * @type {Map.<module:ui/view~View,Set>}
  74586. */
  74587. this._viewToStack = new Map();
  74588. /**
  74589. * The map of IDs and stacks.
  74590. *
  74591. * @private
  74592. * @type {Map.<String,Set>}
  74593. */
  74594. this._idToStack = new Map();
  74595. /**
  74596. * A total number of all stacks in the balloon.
  74597. *
  74598. * @private
  74599. * @readonly
  74600. * @observable
  74601. * @member {Number} #_numberOfStacks
  74602. */
  74603. this.set( '_numberOfStacks', 0 );
  74604. /**
  74605. * A flag that controls the single view mode.
  74606. *
  74607. * @private
  74608. * @readonly
  74609. * @observable
  74610. * @member {Boolean} #_singleViewMode
  74611. */
  74612. this.set( '_singleViewMode', false );
  74613. /**
  74614. * Rotator view embedded in the contextual balloon.
  74615. * Displays the currently visible view in the balloon and provides navigation for switching stacks.
  74616. *
  74617. * @private
  74618. * @type {module:ui/panel/balloon/contextualballoon~RotatorView}
  74619. */
  74620. this._rotatorView = this._createRotatorView();
  74621. /**
  74622. * Displays fake panels under the balloon panel view when multiple stacks are added to the balloon.
  74623. *
  74624. * @private
  74625. * @type {module:ui/view~View}
  74626. */
  74627. this._fakePanelsView = this._createFakePanelsView();
  74628. }
  74629. /**
  74630. * Returns `true` when the given view is in one of the stacks. Otherwise returns `false`.
  74631. *
  74632. * @param {module:ui/view~View} view
  74633. * @returns {Boolean}
  74634. */
  74635. hasView( view ) {
  74636. return Array.from( this._viewToStack.keys() ).includes( view );
  74637. }
  74638. /**
  74639. * Adds a new view to the stack and makes it visible if the current stack is visible
  74640. * or it is the first view in the balloon.
  74641. *
  74642. * @param {Object} data The configuration of the view.
  74643. * @param {String} [data.stackId='main'] The ID of the stack that the view is added to.
  74644. * @param {module:ui/view~View} [data.view] The content of the balloon.
  74645. * @param {module:utils/dom/position~Options} [data.position] Positioning options.
  74646. * @param {String} [data.balloonClassName] An additional CSS class added to the {@link #view balloon} when visible.
  74647. * @param {Boolean} [data.withArrow=true] Whether the {@link #view balloon} should be rendered with an arrow.
  74648. * @param {Boolean} [data.singleViewMode=false] Whether the view should be the only visible view even if other stacks were added.
  74649. */
  74650. add( data ) {
  74651. if ( this.hasView( data.view ) ) {
  74652. /**
  74653. * Trying to add configuration of the same view more than once.
  74654. *
  74655. * @error contextualballoon-add-view-exist
  74656. */
  74657. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
  74658. 'contextualballoon-add-view-exist',
  74659. [ this, data ]
  74660. );
  74661. }
  74662. const stackId = data.stackId || 'main';
  74663. // If new stack is added, creates it and show view from this stack.
  74664. if ( !this._idToStack.has( stackId ) ) {
  74665. this._idToStack.set( stackId, new Map( [ [ data.view, data ] ] ) );
  74666. this._viewToStack.set( data.view, this._idToStack.get( stackId ) );
  74667. this._numberOfStacks = this._idToStack.size;
  74668. if ( !this._visibleStack || data.singleViewMode ) {
  74669. this.showStack( stackId );
  74670. }
  74671. return;
  74672. }
  74673. const stack = this._idToStack.get( stackId );
  74674. if ( data.singleViewMode ) {
  74675. this.showStack( stackId );
  74676. }
  74677. // Add new view to the stack.
  74678. stack.set( data.view, data );
  74679. this._viewToStack.set( data.view, stack );
  74680. // And display it if is added to the currently visible stack.
  74681. if ( stack === this._visibleStack ) {
  74682. this._showView( data );
  74683. }
  74684. }
  74685. /**
  74686. * Removes the given view from the stack. If the removed view was visible,
  74687. * the view preceding it in the stack will become visible instead.
  74688. * When there is no view in the stack, the next stack will be displayed.
  74689. * When there are no more stacks, the balloon will hide.
  74690. *
  74691. * @param {module:ui/view~View} view A view to be removed from the balloon.
  74692. */
  74693. remove( view ) {
  74694. if ( !this.hasView( view ) ) {
  74695. /**
  74696. * Trying to remove the configuration of the view not defined in the stack.
  74697. *
  74698. * @error contextualballoon-remove-view-not-exist
  74699. */
  74700. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
  74701. 'contextualballoon-remove-view-not-exist',
  74702. [ this, view ]
  74703. );
  74704. }
  74705. const stack = this._viewToStack.get( view );
  74706. if ( this._singleViewMode && this.visibleView === view ) {
  74707. this._singleViewMode = false;
  74708. }
  74709. // When visible view will be removed we need to show a preceding view or next stack
  74710. // if a view is the only view in the stack.
  74711. if ( this.visibleView === view ) {
  74712. if ( stack.size === 1 ) {
  74713. if ( this._idToStack.size > 1 ) {
  74714. this._showNextStack();
  74715. } else {
  74716. this.view.hide();
  74717. this.visibleView = null;
  74718. this._rotatorView.hideView();
  74719. }
  74720. } else {
  74721. this._showView( Array.from( stack.values() )[ stack.size - 2 ] );
  74722. }
  74723. }
  74724. if ( stack.size === 1 ) {
  74725. this._idToStack.delete( this._getStackId( stack ) );
  74726. this._numberOfStacks = this._idToStack.size;
  74727. } else {
  74728. stack.delete( view );
  74729. }
  74730. this._viewToStack.delete( view );
  74731. }
  74732. /**
  74733. * Updates the position of the balloon using the position data of the first visible view in the stack.
  74734. * When new position data is given, the position data of the currently visible view will be updated.
  74735. *
  74736. * @param {module:utils/dom/position~Options} [position] position options.
  74737. */
  74738. updatePosition( position ) {
  74739. if ( position ) {
  74740. this._visibleStack.get( this.visibleView ).position = position;
  74741. }
  74742. this.view.pin( this._getBalloonPosition() );
  74743. this._fakePanelsView.updatePosition();
  74744. }
  74745. /**
  74746. * Shows the last view from the stack of a given ID.
  74747. *
  74748. * @param {String} id
  74749. */
  74750. showStack( id ) {
  74751. this.visibleStack = id;
  74752. const stack = this._idToStack.get( id );
  74753. if ( !stack ) {
  74754. /**
  74755. * Trying to show a stack that does not exist.
  74756. *
  74757. * @error contextualballoon-showstack-stack-not-exist
  74758. */
  74759. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"](
  74760. 'contextualballoon-showstack-stack-not-exist',
  74761. this
  74762. );
  74763. }
  74764. if ( this._visibleStack === stack ) {
  74765. return;
  74766. }
  74767. this._showView( Array.from( stack.values() ).pop() );
  74768. }
  74769. /**
  74770. * Returns the stack of the currently visible view.
  74771. *
  74772. * @private
  74773. * @type {Set}
  74774. */
  74775. get _visibleStack() {
  74776. return this._viewToStack.get( this.visibleView );
  74777. }
  74778. /**
  74779. * Returns the ID of the given stack.
  74780. *
  74781. * @private
  74782. * @param {Set} stack
  74783. * @returns {String}
  74784. */
  74785. _getStackId( stack ) {
  74786. const entry = Array.from( this._idToStack.entries() ).find( entry => entry[ 1 ] === stack );
  74787. return entry[ 0 ];
  74788. }
  74789. /**
  74790. * Shows the last view from the next stack.
  74791. *
  74792. * @private
  74793. */
  74794. _showNextStack() {
  74795. const stacks = Array.from( this._idToStack.values() );
  74796. let nextIndex = stacks.indexOf( this._visibleStack ) + 1;
  74797. if ( !stacks[ nextIndex ] ) {
  74798. nextIndex = 0;
  74799. }
  74800. this.showStack( this._getStackId( stacks[ nextIndex ] ) );
  74801. }
  74802. /**
  74803. * Shows the last view from the previous stack.
  74804. *
  74805. * @private
  74806. */
  74807. _showPrevStack() {
  74808. const stacks = Array.from( this._idToStack.values() );
  74809. let nextIndex = stacks.indexOf( this._visibleStack ) - 1;
  74810. if ( !stacks[ nextIndex ] ) {
  74811. nextIndex = stacks.length - 1;
  74812. }
  74813. this.showStack( this._getStackId( stacks[ nextIndex ] ) );
  74814. }
  74815. /**
  74816. * Creates a rotator view.
  74817. *
  74818. * @private
  74819. * @returns {module:ui/panel/balloon/contextualballoon~RotatorView}
  74820. */
  74821. _createRotatorView() {
  74822. const view = new RotatorView( this.editor.locale );
  74823. const t = this.editor.locale.t;
  74824. this.view.content.add( view );
  74825. // Hide navigation when there is only a one stack & not in single view mode.
  74826. view.bind( 'isNavigationVisible' ).to( this, '_numberOfStacks', this, '_singleViewMode', ( value, isSingleViewMode ) => {
  74827. return !isSingleViewMode && value > 1;
  74828. } );
  74829. // Update balloon position after toggling navigation.
  74830. view.on( 'change:isNavigationVisible', () => ( this.updatePosition() ), { priority: 'low' } );
  74831. // Update stacks counter value.
  74832. view.bind( 'counter' ).to( this, 'visibleView', this, '_numberOfStacks', ( visibleView, numberOfStacks ) => {
  74833. if ( numberOfStacks < 2 ) {
  74834. return '';
  74835. }
  74836. const current = Array.from( this._idToStack.values() ).indexOf( this._visibleStack ) + 1;
  74837. return t( '%0 of %1', [ current, numberOfStacks ] );
  74838. } );
  74839. view.buttonNextView.on( 'execute', () => {
  74840. // When current view has a focus then move focus to the editable before removing it,
  74841. // otherwise editor will lost focus.
  74842. if ( view.focusTracker.isFocused ) {
  74843. this.editor.editing.view.focus();
  74844. }
  74845. this._showNextStack();
  74846. } );
  74847. view.buttonPrevView.on( 'execute', () => {
  74848. // When current view has a focus then move focus to the editable before removing it,
  74849. // otherwise editor will lost focus.
  74850. if ( view.focusTracker.isFocused ) {
  74851. this.editor.editing.view.focus();
  74852. }
  74853. this._showPrevStack();
  74854. } );
  74855. return view;
  74856. }
  74857. /**
  74858. * @private
  74859. * @returns {module:ui/view~View}
  74860. */
  74861. _createFakePanelsView() {
  74862. const view = new FakePanelsView( this.editor.locale, this.view );
  74863. view.bind( 'numberOfPanels' ).to( this, '_numberOfStacks', this, '_singleViewMode', ( number, isSingleViewMode ) => {
  74864. const showPanels = !isSingleViewMode && number >= 2;
  74865. return showPanels ? Math.min( number - 1, 2 ) : 0;
  74866. } );
  74867. view.listenTo( this.view, 'change:top', () => view.updatePosition() );
  74868. view.listenTo( this.view, 'change:left', () => view.updatePosition() );
  74869. this.editor.ui.view.body.add( view );
  74870. return view;
  74871. }
  74872. /**
  74873. * Sets the view as the content of the balloon and attaches the balloon using position
  74874. * options of the first view.
  74875. *
  74876. * @private
  74877. * @param {Object} data Configuration.
  74878. * @param {module:ui/view~View} [data.view] The view to show in the balloon.
  74879. * @param {String} [data.balloonClassName=''] Additional class name which will be added to the {@link #view balloon}.
  74880. * @param {Boolean} [data.withArrow=true] Whether the {@link #view balloon} should be rendered with an arrow.
  74881. */
  74882. _showView( { view, balloonClassName = '', withArrow = true, singleViewMode = false } ) {
  74883. this.view.class = balloonClassName;
  74884. this.view.withArrow = withArrow;
  74885. this._rotatorView.showView( view );
  74886. this.visibleView = view;
  74887. this.view.pin( this._getBalloonPosition() );
  74888. this._fakePanelsView.updatePosition();
  74889. if ( singleViewMode ) {
  74890. this._singleViewMode = true;
  74891. }
  74892. }
  74893. /**
  74894. * Returns position options of the last view in the stack.
  74895. * This keeps the balloon in the same position when the view is changed.
  74896. *
  74897. * @private
  74898. * @returns {module:utils/dom/position~Options}
  74899. */
  74900. _getBalloonPosition() {
  74901. let position = Array.from( this._visibleStack.values() ).pop().position;
  74902. // Use the default limiter if none has been specified.
  74903. if ( position && !position.limiter ) {
  74904. // Don't modify the original options object.
  74905. position = Object.assign( {}, position, {
  74906. limiter: this.positionLimiter
  74907. } );
  74908. }
  74909. return position;
  74910. }
  74911. }
  74912. /**
  74913. * Rotator view is a helper class for the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon ContextualBalloon}.
  74914. * It is used for displaying the last view from the current stack and providing navigation buttons for switching stacks.
  74915. * See the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon ContextualBalloon} documentation to learn more.
  74916. *
  74917. * @extends module:ui/view~View
  74918. */
  74919. class RotatorView extends _view__WEBPACK_IMPORTED_MODULE_2__["default"] {
  74920. /**
  74921. * @inheritDoc
  74922. */
  74923. constructor( locale ) {
  74924. super( locale );
  74925. const t = locale.t;
  74926. const bind = this.bindTemplate;
  74927. /**
  74928. * Defines whether navigation is visible or not.
  74929. *
  74930. * @member {Boolean} #isNavigationVisible
  74931. */
  74932. this.set( 'isNavigationVisible', true );
  74933. /**
  74934. * Used for checking if a view is focused or not.
  74935. *
  74936. * @type {module:utils/focustracker~FocusTracker}
  74937. */
  74938. this.focusTracker = new _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_5__["default"]();
  74939. /**
  74940. * Navigation button for switching the stack to the previous one.
  74941. *
  74942. * @type {module:ui/button/buttonview~ButtonView}
  74943. */
  74944. this.buttonPrevView = this._createButtonView( t( 'Previous' ), _theme_icons_previous_arrow_svg__WEBPACK_IMPORTED_MODULE_8__["default"] );
  74945. /**
  74946. * Navigation button for switching the stack to the next one.
  74947. *
  74948. * @type {module:ui/button/buttonview~ButtonView}
  74949. */
  74950. this.buttonNextView = this._createButtonView( t( 'Next' ), _theme_icons_next_arrow_svg__WEBPACK_IMPORTED_MODULE_9__["default"] );
  74951. /**
  74952. * A collection of the child views that creates the rotator content.
  74953. *
  74954. * @readonly
  74955. * @type {module:ui/viewcollection~ViewCollection}
  74956. */
  74957. this.content = this.createCollection();
  74958. this.setTemplate( {
  74959. tag: 'div',
  74960. attributes: {
  74961. class: [
  74962. 'ck',
  74963. 'ck-balloon-rotator'
  74964. ],
  74965. 'z-index': '-1'
  74966. },
  74967. children: [
  74968. {
  74969. tag: 'div',
  74970. attributes: {
  74971. class: [
  74972. 'ck-balloon-rotator__navigation',
  74973. bind.to( 'isNavigationVisible', value => value ? '' : 'ck-hidden' )
  74974. ]
  74975. },
  74976. children: [
  74977. this.buttonPrevView,
  74978. {
  74979. tag: 'span',
  74980. attributes: {
  74981. class: [
  74982. 'ck-balloon-rotator__counter'
  74983. ]
  74984. },
  74985. children: [
  74986. {
  74987. text: bind.to( 'counter' )
  74988. }
  74989. ]
  74990. },
  74991. this.buttonNextView
  74992. ]
  74993. },
  74994. {
  74995. tag: 'div',
  74996. attributes: {
  74997. class: 'ck-balloon-rotator__content'
  74998. },
  74999. children: this.content
  75000. }
  75001. ]
  75002. } );
  75003. }
  75004. /**
  75005. * @inheritDoc
  75006. */
  75007. render() {
  75008. super.render();
  75009. this.focusTracker.add( this.element );
  75010. }
  75011. /**
  75012. * Shows a given view.
  75013. *
  75014. * @param {module:ui/view~View} view The view to show.
  75015. */
  75016. showView( view ) {
  75017. this.hideView();
  75018. this.content.add( view );
  75019. }
  75020. /**
  75021. * Hides the currently displayed view.
  75022. */
  75023. hideView() {
  75024. this.content.clear();
  75025. }
  75026. /**
  75027. * Creates a navigation button view.
  75028. *
  75029. * @private
  75030. * @param {String} label The button label.
  75031. * @param {String} icon The button icon.
  75032. * @returns {module:ui/button/buttonview~ButtonView}
  75033. */
  75034. _createButtonView( label, icon ) {
  75035. const view = new _button_buttonview__WEBPACK_IMPORTED_MODULE_3__["default"]( this.locale );
  75036. view.set( {
  75037. label,
  75038. icon,
  75039. tooltip: true
  75040. } );
  75041. return view;
  75042. }
  75043. }
  75044. // Displays additional layers under the balloon when multiple stacks are added to the balloon.
  75045. //
  75046. // @private
  75047. // @extends module:ui/view~View
  75048. class FakePanelsView extends _view__WEBPACK_IMPORTED_MODULE_2__["default"] {
  75049. // @inheritDoc
  75050. constructor( locale, balloonPanelView ) {
  75051. super( locale );
  75052. const bind = this.bindTemplate;
  75053. // Fake panels top offset.
  75054. //
  75055. // @observable
  75056. // @member {Number} #top
  75057. this.set( 'top', 0 );
  75058. // Fake panels left offset.
  75059. //
  75060. // @observable
  75061. // @member {Number} #left
  75062. this.set( 'left', 0 );
  75063. // Fake panels height.
  75064. //
  75065. // @observable
  75066. // @member {Number} #height
  75067. this.set( 'height', 0 );
  75068. // Fake panels width.
  75069. //
  75070. // @observable
  75071. // @member {Number} #width
  75072. this.set( 'width', 0 );
  75073. // Number of rendered fake panels.
  75074. //
  75075. // @observable
  75076. // @member {Number} #numberOfPanels
  75077. this.set( 'numberOfPanels', 0 );
  75078. // Collection of the child views which creates fake panel content.
  75079. //
  75080. // @readonly
  75081. // @type {module:ui/viewcollection~ViewCollection}
  75082. this.content = this.createCollection();
  75083. // Context.
  75084. //
  75085. // @private
  75086. // @type {module:ui/panel/balloon/balloonpanelview~BalloonPanelView}
  75087. this._balloonPanelView = balloonPanelView;
  75088. this.setTemplate( {
  75089. tag: 'div',
  75090. attributes: {
  75091. class: [
  75092. 'ck-fake-panel',
  75093. bind.to( 'numberOfPanels', number => number ? '' : 'ck-hidden' )
  75094. ],
  75095. style: {
  75096. top: bind.to( 'top', toPx ),
  75097. left: bind.to( 'left', toPx ),
  75098. width: bind.to( 'width', toPx ),
  75099. height: bind.to( 'height', toPx )
  75100. }
  75101. },
  75102. children: this.content
  75103. } );
  75104. this.on( 'change:numberOfPanels', ( evt, name, next, prev ) => {
  75105. if ( next > prev ) {
  75106. this._addPanels( next - prev );
  75107. } else {
  75108. this._removePanels( prev - next );
  75109. }
  75110. this.updatePosition();
  75111. } );
  75112. }
  75113. // @private
  75114. // @param {Number} number
  75115. _addPanels( number ) {
  75116. while ( number-- ) {
  75117. const view = new _view__WEBPACK_IMPORTED_MODULE_2__["default"]();
  75118. view.setTemplate( { tag: 'div' } );
  75119. this.content.add( view );
  75120. this.registerChild( view );
  75121. }
  75122. }
  75123. // @private
  75124. // @param {Number} number
  75125. _removePanels( number ) {
  75126. while ( number-- ) {
  75127. const view = this.content.last;
  75128. this.content.remove( view );
  75129. this.deregisterChild( view );
  75130. view.destroy();
  75131. }
  75132. }
  75133. // Updates coordinates of fake panels.
  75134. updatePosition() {
  75135. if ( this.numberOfPanels ) {
  75136. const { top, left } = this._balloonPanelView;
  75137. const { width, height } = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_7__["default"]( this._balloonPanelView.element );
  75138. Object.assign( this, { top, left, width, height } );
  75139. }
  75140. }
  75141. }
  75142. /***/ }),
  75143. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/sticky/stickypanelview.js":
  75144. /*!*********************************************************************************!*\
  75145. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/panel/sticky/stickypanelview.js ***!
  75146. \*********************************************************************************/
  75147. /*! exports provided: default */
  75148. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  75149. "use strict";
  75150. __webpack_require__.r(__webpack_exports__);
  75151. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return StickyPanelView; });
  75152. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
  75153. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  75154. /* harmony import */ var _template__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../template */ "./node_modules/@ckeditor/ckeditor5-ui/src/template.js");
  75155. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/tounit */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/tounit.js");
  75156. /* harmony import */ var _theme_components_panel_stickypanel_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../theme/components/panel/stickypanel.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/stickypanel.css");
  75157. /* harmony import */ var _theme_components_panel_stickypanel_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_theme_components_panel_stickypanel_css__WEBPACK_IMPORTED_MODULE_4__);
  75158. /**
  75159. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  75160. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  75161. */
  75162. /**
  75163. * @module ui/panel/sticky/stickypanelview
  75164. */
  75165. const toPx = Object(_ckeditor_ckeditor5_utils_src_dom_tounit__WEBPACK_IMPORTED_MODULE_3__["default"])( 'px' );
  75166. /**
  75167. * The sticky panel view class.
  75168. */
  75169. class StickyPanelView extends _view__WEBPACK_IMPORTED_MODULE_1__["default"] {
  75170. /**
  75171. * @inheritDoc
  75172. */
  75173. constructor( locale ) {
  75174. super( locale );
  75175. const bind = this.bindTemplate;
  75176. /**
  75177. * Controls whether the sticky panel should be active.
  75178. *
  75179. * @readonly
  75180. * @observable
  75181. * @member {Boolean} #isActive
  75182. */
  75183. this.set( 'isActive', false );
  75184. /**
  75185. * Controls whether the sticky panel is in the "sticky" state.
  75186. *
  75187. * @readonly
  75188. * @observable
  75189. * @member {Boolean} #isSticky
  75190. */
  75191. this.set( 'isSticky', false );
  75192. /**
  75193. * The limiter element for the sticky panel instance. Its bounding rect limits
  75194. * the "stickyness" of the panel, i.e. when the panel reaches the bottom
  75195. * edge of the limiter, it becomes sticky to that edge and does not float
  75196. * off the limiter. It is mandatory for the panel to work properly and once
  75197. * set, it cannot be changed.
  75198. *
  75199. * @readonly
  75200. * @observable
  75201. * @member {HTMLElement} #limiterElement
  75202. */
  75203. this.set( 'limiterElement', null );
  75204. /**
  75205. * The offset from the bottom edge of {@link #limiterElement}
  75206. * which stops the panel from stickying any further to prevent limiter's content
  75207. * from being completely covered.
  75208. *
  75209. * @readonly
  75210. * @observable
  75211. * @default 50
  75212. * @member {Number} #limiterBottomOffset
  75213. */
  75214. this.set( 'limiterBottomOffset', 50 );
  75215. /**
  75216. * The offset from the top edge of the web browser's viewport which makes the
  75217. * panel become sticky. The default value is `0`, which means the panel becomes
  75218. * sticky when it's upper edge touches the top of the page viewport.
  75219. *
  75220. * This attribute is useful when the web page has UI elements positioned to the top
  75221. * either using `position: fixed` or `position: sticky`, which would cover the
  75222. * sticky panel or vice–versa (depending on the `z-index` hierarchy).
  75223. *
  75224. * @readonly
  75225. * @observable
  75226. * @default 0
  75227. * @member {Number} #viewportTopOffset
  75228. */
  75229. this.set( 'viewportTopOffset', 0 );
  75230. /**
  75231. * Controls the `margin-left` CSS style of the panel.
  75232. *
  75233. * @protected
  75234. * @readonly
  75235. * @observable
  75236. * @member {String} #_marginLeft
  75237. */
  75238. this.set( '_marginLeft', null );
  75239. /**
  75240. * Set `true` if the sticky panel reached the bottom edge of the
  75241. * {@link #limiterElement}.
  75242. *
  75243. * @protected
  75244. * @readonly
  75245. * @observable
  75246. * @member {Boolean} #_isStickyToTheLimiter
  75247. */
  75248. this.set( '_isStickyToTheLimiter', false );
  75249. /**
  75250. * Set `true` if the sticky panel uses the {@link #viewportTopOffset},
  75251. * i.e. not {@link #_isStickyToTheLimiter} and the {@link #viewportTopOffset}
  75252. * is not `0`.
  75253. *
  75254. * @protected
  75255. * @readonly
  75256. * @observable
  75257. * @member {Boolean} #_hasViewportTopOffset
  75258. */
  75259. this.set( '_hasViewportTopOffset', false );
  75260. /**
  75261. * Collection of the child views which creates balloon panel contents.
  75262. *
  75263. * @readonly
  75264. * @member {module:ui/viewcollection~ViewCollection}
  75265. */
  75266. this.content = this.createCollection();
  75267. /**
  75268. * The DOM bounding client rect of the {@link module:ui/view~View#element} of the panel.
  75269. *
  75270. * @protected
  75271. * @member {Object} #_panelRect
  75272. */
  75273. /**
  75274. * The DOM bounding client rect of the {@link #limiterElement}
  75275. * of the panel.
  75276. *
  75277. * @protected
  75278. * @member {Object} #_limiterRect
  75279. */
  75280. /**
  75281. * A dummy element which visually fills the space as long as the
  75282. * actual panel is sticky. It prevents flickering of the UI.
  75283. *
  75284. * @protected
  75285. * @property {HTMLElement}
  75286. */
  75287. this._contentPanelPlaceholder = new _template__WEBPACK_IMPORTED_MODULE_2__["default"]( {
  75288. tag: 'div',
  75289. attributes: {
  75290. class: [
  75291. 'ck',
  75292. 'ck-sticky-panel__placeholder'
  75293. ],
  75294. style: {
  75295. display: bind.to( 'isSticky', isSticky => isSticky ? 'block' : 'none' ),
  75296. height: bind.to( 'isSticky', isSticky => {
  75297. return isSticky ? toPx( this._panelRect.height ) : null;
  75298. } )
  75299. }
  75300. }
  75301. } ).render();
  75302. /**
  75303. * The panel which accepts children into {@link #content} collection.
  75304. * Also an element which is positioned when {@link #isSticky}.
  75305. *
  75306. * @protected
  75307. * @property {HTMLElement}
  75308. */
  75309. this._contentPanel = new _template__WEBPACK_IMPORTED_MODULE_2__["default"]( {
  75310. tag: 'div',
  75311. attributes: {
  75312. class: [
  75313. 'ck',
  75314. 'ck-sticky-panel__content',
  75315. // Toggle class of the panel when "sticky" state changes in the view.
  75316. bind.if( 'isSticky', 'ck-sticky-panel__content_sticky' ),
  75317. bind.if( '_isStickyToTheLimiter', 'ck-sticky-panel__content_sticky_bottom-limit' )
  75318. ],
  75319. style: {
  75320. width: bind.to( 'isSticky', isSticky => {
  75321. return isSticky ? toPx( this._contentPanelPlaceholder.getBoundingClientRect().width ) : null;
  75322. } ),
  75323. top: bind.to( '_hasViewportTopOffset', _hasViewportTopOffset => {
  75324. return _hasViewportTopOffset ? toPx( this.viewportTopOffset ) : null;
  75325. } ),
  75326. bottom: bind.to( '_isStickyToTheLimiter', _isStickyToTheLimiter => {
  75327. return _isStickyToTheLimiter ? toPx( this.limiterBottomOffset ) : null;
  75328. } ),
  75329. marginLeft: bind.to( '_marginLeft' )
  75330. }
  75331. },
  75332. children: this.content
  75333. } ).render();
  75334. this.setTemplate( {
  75335. tag: 'div',
  75336. attributes: {
  75337. class: [
  75338. 'ck',
  75339. 'ck-sticky-panel'
  75340. ]
  75341. },
  75342. children: [
  75343. this._contentPanelPlaceholder,
  75344. this._contentPanel
  75345. ]
  75346. } );
  75347. }
  75348. /**
  75349. * @inheritDoc
  75350. */
  75351. render() {
  75352. super.render();
  75353. // Check if the panel should go into the sticky state immediately.
  75354. this._checkIfShouldBeSticky();
  75355. // Update sticky state of the panel as the window is being scrolled.
  75356. this.listenTo( _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_0__["default"].window, 'scroll', () => {
  75357. this._checkIfShouldBeSticky();
  75358. } );
  75359. // Synchronize with `model.isActive` because sticking an inactive panel is pointless.
  75360. this.listenTo( this, 'change:isActive', () => {
  75361. this._checkIfShouldBeSticky();
  75362. } );
  75363. }
  75364. /**
  75365. * Analyzes the environment to decide whether the panel should
  75366. * be sticky or not.
  75367. *
  75368. * @protected
  75369. */
  75370. _checkIfShouldBeSticky() {
  75371. const panelRect = this._panelRect = this._contentPanel.getBoundingClientRect();
  75372. let limiterRect;
  75373. if ( !this.limiterElement ) {
  75374. this.isSticky = false;
  75375. } else {
  75376. limiterRect = this._limiterRect = this.limiterElement.getBoundingClientRect();
  75377. // The panel must be active to become sticky.
  75378. this.isSticky = this.isActive &&
  75379. // The limiter's top edge must be beyond the upper edge of the visible viewport (+the viewportTopOffset).
  75380. limiterRect.top < this.viewportTopOffset &&
  75381. // The model#limiterElement's height mustn't be smaller than the panel's height and model#limiterBottomOffset.
  75382. // There's no point in entering the sticky mode if the model#limiterElement is very, very small, because
  75383. // it would immediately set model#_isStickyToTheLimiter true and, given model#limiterBottomOffset, the panel
  75384. // would be positioned before the model#limiterElement.
  75385. this._panelRect.height + this.limiterBottomOffset < limiterRect.height;
  75386. }
  75387. // Stick the panel to the top edge of the viewport simulating CSS position:sticky.
  75388. // TODO: Possibly replaced by CSS in the future http://caniuse.com/#feat=css-sticky
  75389. if ( this.isSticky ) {
  75390. this._isStickyToTheLimiter =
  75391. limiterRect.bottom < panelRect.height + this.limiterBottomOffset + this.viewportTopOffset;
  75392. this._hasViewportTopOffset = !this._isStickyToTheLimiter && !!this.viewportTopOffset;
  75393. this._marginLeft = this._isStickyToTheLimiter ? null : toPx( -_ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_0__["default"].window.scrollX );
  75394. }
  75395. // Detach the panel from the top edge of the viewport.
  75396. else {
  75397. this._isStickyToTheLimiter = false;
  75398. this._hasViewportTopOffset = false;
  75399. this._marginLeft = null;
  75400. }
  75401. }
  75402. }
  75403. /***/ }),
  75404. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/template.js":
  75405. /*!*************************************************************!*\
  75406. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/template.js ***!
  75407. \*************************************************************/
  75408. /*! exports provided: default, TemplateBinding, TemplateToBinding, TemplateIfBinding */
  75409. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  75410. "use strict";
  75411. __webpack_require__.r(__webpack_exports__);
  75412. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Template; });
  75413. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TemplateBinding", function() { return TemplateBinding; });
  75414. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TemplateToBinding", function() { return TemplateToBinding; });
  75415. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TemplateIfBinding", function() { return TemplateIfBinding; });
  75416. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  75417. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  75418. /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  75419. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  75420. /* harmony import */ var _viewcollection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./viewcollection */ "./node_modules/@ckeditor/ckeditor5-ui/src/viewcollection.js");
  75421. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_isnode__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/isnode */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/isnode.js");
  75422. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  75423. /**
  75424. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  75425. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  75426. */
  75427. /**
  75428. * @module ui/template
  75429. */
  75430. /* global document */
  75431. const xhtmlNs = 'http://www.w3.org/1999/xhtml';
  75432. /**
  75433. * A basic Template class. It renders a DOM HTML element or text from a
  75434. * {@link module:ui/template~TemplateDefinition definition} and supports element attributes, children,
  75435. * bindings to {@link module:utils/observablemixin~Observable observables} and DOM event propagation.
  75436. *
  75437. * A simple template can look like this:
  75438. *
  75439. * const bind = Template.bind( observable, emitter );
  75440. *
  75441. * new Template( {
  75442. * tag: 'p',
  75443. * attributes: {
  75444. * class: 'foo',
  75445. * style: {
  75446. * backgroundColor: 'yellow'
  75447. * }
  75448. * },
  75449. * on: {
  75450. * click: bind.to( 'clicked' )
  75451. * },
  75452. * children: [
  75453. * 'A paragraph.'
  75454. * ]
  75455. * } ).render();
  75456. *
  75457. * and it will render the following HTML element:
  75458. *
  75459. * <p class="foo" style="background-color: yellow;">A paragraph.</p>
  75460. *
  75461. * Additionally, the `observable` will always fire `clicked` upon clicking `<p>` in the DOM.
  75462. *
  75463. * See {@link module:ui/template~TemplateDefinition} to know more about templates and complex
  75464. * template definitions.
  75465. *
  75466. * @mixes module:utils/emittermixin~EmitterMixin
  75467. */
  75468. class Template {
  75469. /**
  75470. * Creates an instance of the {@link ~Template} class.
  75471. *
  75472. * @param {module:ui/template~TemplateDefinition} def The definition of the template.
  75473. */
  75474. constructor( def ) {
  75475. Object.assign( this, normalize( clone( def ) ) );
  75476. /**
  75477. * Indicates whether this particular Template instance has been
  75478. * {@link #render rendered}.
  75479. *
  75480. * @readonly
  75481. * @protected
  75482. * @member {Boolean}
  75483. */
  75484. this._isRendered = false;
  75485. /**
  75486. * The tag (`tagName`) of this template, e.g. `div`. It also indicates that the template
  75487. * renders to an HTML element.
  75488. *
  75489. * @member {String} #tag
  75490. */
  75491. /**
  75492. * The text of the template. It also indicates that the template renders to a DOM text node.
  75493. *
  75494. * @member {Array.<String|module:ui/template~TemplateValueSchema>} #text
  75495. */
  75496. /**
  75497. * The attributes of the template, e.g. `{ id: [ 'ck-id' ] }`, corresponding with
  75498. * the attributes of an HTML element.
  75499. *
  75500. * **Note**: This property only makes sense when {@link #tag} is defined.
  75501. *
  75502. * @member {Object} #attributes
  75503. */
  75504. /**
  75505. * The children of the template. They can be either:
  75506. * * independent instances of {@link ~Template} (sub–templates),
  75507. * * native DOM Nodes.
  75508. *
  75509. * **Note**: This property only makes sense when {@link #tag} is defined.
  75510. *
  75511. * @member {Array.<module:ui/template~Template|Node>} #children
  75512. */
  75513. /**
  75514. * The DOM event listeners of the template.
  75515. *
  75516. * @member {Object} #eventListeners
  75517. */
  75518. /**
  75519. * The data used by the {@link #revert} method to restore a node to its original state.
  75520. *
  75521. * See: {@link #apply}.
  75522. *
  75523. * @readonly
  75524. * @protected
  75525. * @member {module:ui/template~RenderData}
  75526. */
  75527. this._revertData = null;
  75528. }
  75529. /**
  75530. * Renders a DOM Node (an HTML element or text) out of the template.
  75531. *
  75532. * const domNode = new Template( { ... } ).render();
  75533. *
  75534. * See: {@link #apply}.
  75535. *
  75536. * @returns {HTMLElement|Text}
  75537. */
  75538. render() {
  75539. const node = this._renderNode( {
  75540. intoFragment: true
  75541. } );
  75542. this._isRendered = true;
  75543. return node;
  75544. }
  75545. /**
  75546. * Applies the template to an existing DOM Node, either HTML element or text.
  75547. *
  75548. * **Note:** No new DOM nodes will be created. Applying extends:
  75549. *
  75550. * {@link module:ui/template~TemplateDefinition attributes},
  75551. * {@link module:ui/template~TemplateDefinition event listeners}, and
  75552. * `textContent` of {@link module:ui/template~TemplateDefinition children} only.
  75553. *
  75554. * **Note:** Existing `class` and `style` attributes are extended when a template
  75555. * is applied to an HTML element, while other attributes and `textContent` are overridden.
  75556. *
  75557. * **Note:** The process of applying a template can be easily reverted using the
  75558. * {@link module:ui/template~Template#revert} method.
  75559. *
  75560. * const element = document.createElement( 'div' );
  75561. * const observable = new Model( { divClass: 'my-div' } );
  75562. * const emitter = Object.create( EmitterMixin );
  75563. * const bind = Template.bind( observable, emitter );
  75564. *
  75565. * new Template( {
  75566. * attributes: {
  75567. * id: 'first-div',
  75568. * class: bind.to( 'divClass' )
  75569. * },
  75570. * on: {
  75571. * click: bind( 'elementClicked' ) // Will be fired by the observable.
  75572. * },
  75573. * children: [
  75574. * 'Div text.'
  75575. * ]
  75576. * } ).apply( element );
  75577. *
  75578. * console.log( element.outerHTML ); // -> '<div id="first-div" class="my-div"></div>'
  75579. *
  75580. * @see module:ui/template~Template#render
  75581. * @see module:ui/template~Template#revert
  75582. * @param {Node} node Root node for the template to apply.
  75583. */
  75584. apply( node ) {
  75585. this._revertData = getEmptyRevertData();
  75586. this._renderNode( {
  75587. node,
  75588. isApplying: true,
  75589. revertData: this._revertData
  75590. } );
  75591. return node;
  75592. }
  75593. /**
  75594. * Reverts a template {@link module:ui/template~Template#apply applied} to a DOM node.
  75595. *
  75596. * @param {Node} node The root node for the template to revert. In most of the cases, it is the
  75597. * same node used by {@link module:ui/template~Template#apply}.
  75598. */
  75599. revert( node ) {
  75600. if ( !this._revertData ) {
  75601. /**
  75602. * Attempting to revert a template which has not been applied yet.
  75603. *
  75604. * @error ui-template-revert-not-applied
  75605. */
  75606. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  75607. 'ui-template-revert-not-applied',
  75608. [ this, node ]
  75609. );
  75610. }
  75611. this._revertTemplateFromNode( node, this._revertData );
  75612. }
  75613. /**
  75614. * Returns an iterator which traverses the template in search of {@link module:ui/view~View}
  75615. * instances and returns them one by one.
  75616. *
  75617. * const viewFoo = new View();
  75618. * const viewBar = new View();
  75619. * const viewBaz = new View();
  75620. * const template = new Template( {
  75621. * tag: 'div',
  75622. * children: [
  75623. * viewFoo,
  75624. * {
  75625. * tag: 'div',
  75626. * children: [
  75627. * viewBar
  75628. * ]
  75629. * },
  75630. * viewBaz
  75631. * ]
  75632. * } );
  75633. *
  75634. * // Logs: viewFoo, viewBar, viewBaz
  75635. * for ( const view of template.getViews() ) {
  75636. * console.log( view );
  75637. * }
  75638. *
  75639. * @returns {Iterable.<module:ui/view~View>}
  75640. */
  75641. * getViews() {
  75642. function* search( def ) {
  75643. if ( def.children ) {
  75644. for ( const child of def.children ) {
  75645. if ( isView( child ) ) {
  75646. yield child;
  75647. } else if ( isTemplate( child ) ) {
  75648. yield* search( child );
  75649. }
  75650. }
  75651. }
  75652. }
  75653. yield* search( this );
  75654. }
  75655. /**
  75656. * An entry point to the interface which binds DOM nodes to
  75657. * {@link module:utils/observablemixin~Observable observables}.
  75658. * There are two types of bindings:
  75659. *
  75660. * * HTML element attributes or text `textContent` synchronized with attributes of an
  75661. * {@link module:utils/observablemixin~Observable}. Learn more about {@link module:ui/template~BindChain#to}
  75662. * and {@link module:ui/template~BindChain#if}.
  75663. *
  75664. * const bind = Template.bind( observable, emitter );
  75665. *
  75666. * new Template( {
  75667. * attributes: {
  75668. * // Binds the element "class" attribute to observable#classAttribute.
  75669. * class: bind.to( 'classAttribute' )
  75670. * }
  75671. * } ).render();
  75672. *
  75673. * * DOM events fired on HTML element propagated through
  75674. * {@link module:utils/observablemixin~Observable}. Learn more about {@link module:ui/template~BindChain#to}.
  75675. *
  75676. * const bind = Template.bind( observable, emitter );
  75677. *
  75678. * new Template( {
  75679. * on: {
  75680. * // Will be fired by the observable.
  75681. * click: bind( 'elementClicked' )
  75682. * }
  75683. * } ).render();
  75684. *
  75685. * Also see {@link module:ui/view~View#bindTemplate}.
  75686. *
  75687. * @param {module:utils/observablemixin~Observable} observable An observable which provides boundable attributes.
  75688. * @param {module:utils/emittermixin~Emitter} emitter An emitter that listens to observable attribute
  75689. * changes or DOM Events (depending on the kind of the binding). Usually, a {@link module:ui/view~View} instance.
  75690. * @returns {module:ui/template~BindChain}
  75691. */
  75692. static bind( observable, emitter ) {
  75693. return {
  75694. to( eventNameOrFunctionOrAttribute, callback ) {
  75695. return new TemplateToBinding( {
  75696. eventNameOrFunction: eventNameOrFunctionOrAttribute,
  75697. attribute: eventNameOrFunctionOrAttribute,
  75698. observable, emitter, callback
  75699. } );
  75700. },
  75701. if( attribute, valueIfTrue, callback ) {
  75702. return new TemplateIfBinding( {
  75703. observable, emitter, attribute, valueIfTrue, callback
  75704. } );
  75705. }
  75706. };
  75707. }
  75708. /**
  75709. * Extends an existing {@link module:ui/template~Template} instance with some additional content
  75710. * from another {@link module:ui/template~TemplateDefinition}.
  75711. *
  75712. * const bind = Template.bind( observable, emitter );
  75713. *
  75714. * const template = new Template( {
  75715. * tag: 'p',
  75716. * attributes: {
  75717. * class: 'a',
  75718. * data-x: bind.to( 'foo' )
  75719. * },
  75720. * children: [
  75721. * {
  75722. * tag: 'span',
  75723. * attributes: {
  75724. * class: 'b'
  75725. * },
  75726. * children: [
  75727. * 'Span'
  75728. * ]
  75729. * }
  75730. * ]
  75731. * } );
  75732. *
  75733. * // Instance-level extension.
  75734. * Template.extend( template, {
  75735. * attributes: {
  75736. * class: 'b',
  75737. * data-x: bind.to( 'bar' )
  75738. * },
  75739. * children: [
  75740. * {
  75741. * attributes: {
  75742. * class: 'c'
  75743. * }
  75744. * }
  75745. * ]
  75746. * } );
  75747. *
  75748. * // Child extension.
  75749. * Template.extend( template.children[ 0 ], {
  75750. * attributes: {
  75751. * class: 'd'
  75752. * }
  75753. * } );
  75754. *
  75755. * the `outerHTML` of `template.render()` is:
  75756. *
  75757. * <p class="a b" data-x="{ observable.foo } { observable.bar }">
  75758. * <span class="b c d">Span</span>
  75759. * </p>
  75760. *
  75761. * @param {module:ui/template~Template} template An existing template instance to be extended.
  75762. * @param {module:ui/template~TemplateDefinition} def Additional definition to be applied to a template.
  75763. */
  75764. static extend( template, def ) {
  75765. if ( template._isRendered ) {
  75766. /**
  75767. * Extending a template after rendering may not work as expected. To make sure
  75768. * the {@link module:ui/template~Template.extend extending} works for an element,
  75769. * make sure it happens before {@link #render} is called.
  75770. *
  75771. * @error template-extend-render
  75772. */
  75773. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  75774. 'template-extend-render',
  75775. [ this, template ]
  75776. );
  75777. }
  75778. extendTemplate( template, normalize( clone( def ) ) );
  75779. }
  75780. /**
  75781. * Renders a DOM Node (either an HTML element or text) out of the template.
  75782. *
  75783. * @protected
  75784. * @param {module:ui/template~RenderData} data Rendering data.
  75785. */
  75786. _renderNode( data ) {
  75787. let isInvalid;
  75788. if ( data.node ) {
  75789. // When applying, a definition cannot have "tag" and "text" at the same time.
  75790. isInvalid = this.tag && this.text;
  75791. } else {
  75792. // When rendering, a definition must have either "tag" or "text": XOR( this.tag, this.text ).
  75793. isInvalid = this.tag ? this.text : !this.text;
  75794. }
  75795. if ( isInvalid ) {
  75796. /**
  75797. * Node definition cannot have the "tag" and "text" properties at the same time.
  75798. * Node definition must have either "tag" or "text" when rendering a new Node.
  75799. *
  75800. * @error ui-template-wrong-syntax
  75801. */
  75802. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  75803. 'ui-template-wrong-syntax',
  75804. this
  75805. );
  75806. }
  75807. if ( this.text ) {
  75808. return this._renderText( data );
  75809. } else {
  75810. return this._renderElement( data );
  75811. }
  75812. }
  75813. /**
  75814. * Renders an HTML element out of the template.
  75815. *
  75816. * @protected
  75817. * @param {module:ui/template~RenderData} data Rendering data.
  75818. */
  75819. _renderElement( data ) {
  75820. let node = data.node;
  75821. if ( !node ) {
  75822. node = data.node = document.createElementNS( this.ns || xhtmlNs, this.tag );
  75823. }
  75824. this._renderAttributes( data );
  75825. this._renderElementChildren( data );
  75826. this._setUpListeners( data );
  75827. return node;
  75828. }
  75829. /**
  75830. * Renders a text node out of {@link module:ui/template~Template#text}.
  75831. *
  75832. * @protected
  75833. * @param {module:ui/template~RenderData} data Rendering data.
  75834. */
  75835. _renderText( data ) {
  75836. let node = data.node;
  75837. // Save the original textContent to revert it in #revert().
  75838. if ( node ) {
  75839. data.revertData.text = node.textContent;
  75840. } else {
  75841. node = data.node = document.createTextNode( '' );
  75842. }
  75843. // Check if this Text Node is bound to Observable. Cases:
  75844. //
  75845. // text: [ Template.bind( ... ).to( ... ) ]
  75846. //
  75847. // text: [
  75848. // 'foo',
  75849. // Template.bind( ... ).to( ... ),
  75850. // ...
  75851. // ]
  75852. //
  75853. if ( hasTemplateBinding( this.text ) ) {
  75854. this._bindToObservable( {
  75855. schema: this.text,
  75856. updater: getTextUpdater( node ),
  75857. data
  75858. } );
  75859. }
  75860. // Simply set text. Cases:
  75861. //
  75862. // text: [ 'all', 'are', 'static' ]
  75863. //
  75864. // text: [ 'foo' ]
  75865. //
  75866. else {
  75867. node.textContent = this.text.join( '' );
  75868. }
  75869. return node;
  75870. }
  75871. /**
  75872. * Renders HTML element attributes out of {@link module:ui/template~Template#attributes}.
  75873. *
  75874. * @protected
  75875. * @param {module:ui/template~RenderData} data Rendering data.
  75876. */
  75877. _renderAttributes( data ) {
  75878. let attrName, attrValue, domAttrValue, attrNs;
  75879. if ( !this.attributes ) {
  75880. return;
  75881. }
  75882. const node = data.node;
  75883. const revertData = data.revertData;
  75884. for ( attrName in this.attributes ) {
  75885. // Current attribute value in DOM.
  75886. domAttrValue = node.getAttribute( attrName );
  75887. // The value to be set.
  75888. attrValue = this.attributes[ attrName ];
  75889. // Save revert data.
  75890. if ( revertData ) {
  75891. revertData.attributes[ attrName ] = domAttrValue;
  75892. }
  75893. // Detect custom namespace:
  75894. //
  75895. // class: {
  75896. // ns: 'abc',
  75897. // value: Template.bind( ... ).to( ... )
  75898. // }
  75899. //
  75900. attrNs = ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_6__["isObject"])( attrValue[ 0 ] ) && attrValue[ 0 ].ns ) ? attrValue[ 0 ].ns : null;
  75901. // Activate binding if one is found. Cases:
  75902. //
  75903. // class: [
  75904. // Template.bind( ... ).to( ... )
  75905. // ]
  75906. //
  75907. // class: [
  75908. // 'bar',
  75909. // Template.bind( ... ).to( ... ),
  75910. // 'baz'
  75911. // ]
  75912. //
  75913. // class: {
  75914. // ns: 'abc',
  75915. // value: Template.bind( ... ).to( ... )
  75916. // }
  75917. //
  75918. if ( hasTemplateBinding( attrValue ) ) {
  75919. // Normalize attributes with additional data like namespace:
  75920. //
  75921. // class: {
  75922. // ns: 'abc',
  75923. // value: [ ... ]
  75924. // }
  75925. //
  75926. const valueToBind = attrNs ? attrValue[ 0 ].value : attrValue;
  75927. // Extend the original value of attributes like "style" and "class",
  75928. // don't override them.
  75929. if ( revertData && shouldExtend( attrName ) ) {
  75930. valueToBind.unshift( domAttrValue );
  75931. }
  75932. this._bindToObservable( {
  75933. schema: valueToBind,
  75934. updater: getAttributeUpdater( node, attrName, attrNs ),
  75935. data
  75936. } );
  75937. }
  75938. // Style attribute could be an Object so it needs to be parsed in a specific way.
  75939. //
  75940. // style: {
  75941. // width: '100px',
  75942. // height: Template.bind( ... ).to( ... )
  75943. // }
  75944. //
  75945. else if ( attrName == 'style' && typeof attrValue[ 0 ] !== 'string' ) {
  75946. this._renderStyleAttribute( attrValue[ 0 ], data );
  75947. }
  75948. // Otherwise simply set the static attribute:
  75949. //
  75950. // class: [ 'foo' ]
  75951. //
  75952. // class: [ 'all', 'are', 'static' ]
  75953. //
  75954. // class: [
  75955. // {
  75956. // ns: 'abc',
  75957. // value: [ 'foo' ]
  75958. // }
  75959. // ]
  75960. //
  75961. else {
  75962. // Extend the original value of attributes like "style" and "class",
  75963. // don't override them.
  75964. if ( revertData && domAttrValue && shouldExtend( attrName ) ) {
  75965. attrValue.unshift( domAttrValue );
  75966. }
  75967. attrValue = attrValue
  75968. // Retrieve "values" from:
  75969. //
  75970. // class: [
  75971. // {
  75972. // ns: 'abc',
  75973. // value: [ ... ]
  75974. // }
  75975. // ]
  75976. //
  75977. .map( val => val ? ( val.value || val ) : val )
  75978. // Flatten the array.
  75979. .reduce( ( prev, next ) => prev.concat( next ), [] )
  75980. // Convert into string.
  75981. .reduce( arrayValueReducer, '' );
  75982. if ( !isFalsy( attrValue ) ) {
  75983. node.setAttributeNS( attrNs, attrName, attrValue );
  75984. }
  75985. }
  75986. }
  75987. }
  75988. /**
  75989. * Renders the `style` attribute of an HTML element based on
  75990. * {@link module:ui/template~Template#attributes}.
  75991. *
  75992. * A style attribute is an {Object} with static values:
  75993. *
  75994. * attributes: {
  75995. * style: {
  75996. * color: 'red'
  75997. * }
  75998. * }
  75999. *
  76000. * or values bound to {@link module:ui/model~Model} properties:
  76001. *
  76002. * attributes: {
  76003. * style: {
  76004. * color: bind.to( ... )
  76005. * }
  76006. * }
  76007. *
  76008. * Note: The `style` attribute is rendered without setting the namespace. It does not seem to be
  76009. * needed.
  76010. *
  76011. * @private
  76012. * @param {Object} styles Styles located in `attributes.style` of {@link module:ui/template~TemplateDefinition}.
  76013. * @param {module:ui/template~RenderData} data Rendering data.
  76014. */
  76015. _renderStyleAttribute( styles, data ) {
  76016. const node = data.node;
  76017. for ( const styleName in styles ) {
  76018. const styleValue = styles[ styleName ];
  76019. // Cases:
  76020. //
  76021. // style: {
  76022. // color: bind.to( 'attribute' )
  76023. // }
  76024. //
  76025. if ( hasTemplateBinding( styleValue ) ) {
  76026. this._bindToObservable( {
  76027. schema: [ styleValue ],
  76028. updater: getStyleUpdater( node, styleName ),
  76029. data
  76030. } );
  76031. }
  76032. // Cases:
  76033. //
  76034. // style: {
  76035. // color: 'red'
  76036. // }
  76037. //
  76038. else {
  76039. node.style[ styleName ] = styleValue;
  76040. }
  76041. }
  76042. }
  76043. /**
  76044. * Recursively renders HTML element's children from {@link module:ui/template~Template#children}.
  76045. *
  76046. * @protected
  76047. * @param {module:ui/template~RenderData} data Rendering data.
  76048. */
  76049. _renderElementChildren( data ) {
  76050. const node = data.node;
  76051. const container = data.intoFragment ? document.createDocumentFragment() : node;
  76052. const isApplying = data.isApplying;
  76053. let childIndex = 0;
  76054. for ( const child of this.children ) {
  76055. if ( isViewCollection( child ) ) {
  76056. if ( !isApplying ) {
  76057. child.setParent( node );
  76058. // Note: ViewCollection renders its children.
  76059. for ( const view of child ) {
  76060. container.appendChild( view.element );
  76061. }
  76062. }
  76063. } else if ( isView( child ) ) {
  76064. if ( !isApplying ) {
  76065. if ( !child.isRendered ) {
  76066. child.render();
  76067. }
  76068. container.appendChild( child.element );
  76069. }
  76070. } else if ( Object(_ckeditor_ckeditor5_utils_src_dom_isnode__WEBPACK_IMPORTED_MODULE_5__["default"])( child ) ) {
  76071. container.appendChild( child );
  76072. } else {
  76073. if ( isApplying ) {
  76074. const revertData = data.revertData;
  76075. const childRevertData = getEmptyRevertData();
  76076. revertData.children.push( childRevertData );
  76077. child._renderNode( {
  76078. node: container.childNodes[ childIndex++ ],
  76079. isApplying: true,
  76080. revertData: childRevertData
  76081. } );
  76082. } else {
  76083. container.appendChild( child.render() );
  76084. }
  76085. }
  76086. }
  76087. if ( data.intoFragment ) {
  76088. node.appendChild( container );
  76089. }
  76090. }
  76091. /**
  76092. * Activates `on` event listeners from the {@link module:ui/template~TemplateDefinition}
  76093. * on an HTML element.
  76094. *
  76095. * @protected
  76096. * @param {module:ui/template~RenderData} data Rendering data.
  76097. */
  76098. _setUpListeners( data ) {
  76099. if ( !this.eventListeners ) {
  76100. return;
  76101. }
  76102. for ( const key in this.eventListeners ) {
  76103. const revertBindings = this.eventListeners[ key ].map( schemaItem => {
  76104. const [ domEvtName, domSelector ] = key.split( '@' );
  76105. return schemaItem.activateDomEventListener( domEvtName, domSelector, data );
  76106. } );
  76107. if ( data.revertData ) {
  76108. data.revertData.bindings.push( revertBindings );
  76109. }
  76110. }
  76111. }
  76112. /**
  76113. * For a given {@link module:ui/template~TemplateValueSchema} containing {@link module:ui/template~TemplateBinding}
  76114. * activates the binding and sets its initial value.
  76115. *
  76116. * Note: {@link module:ui/template~TemplateValueSchema} can be for HTML element attributes or
  76117. * text node `textContent`.
  76118. *
  76119. * @protected
  76120. * @param {Object} options Binding options.
  76121. * @param {module:ui/template~TemplateValueSchema} options.schema
  76122. * @param {Function} options.updater A function which updates the DOM (like attribute or text).
  76123. * @param {module:ui/template~RenderData} options.data Rendering data.
  76124. */
  76125. _bindToObservable( { schema, updater, data } ) {
  76126. const revertData = data.revertData;
  76127. // Set initial values.
  76128. syncValueSchemaValue( schema, updater, data );
  76129. const revertBindings = schema
  76130. // Filter "falsy" (false, undefined, null, '') value schema components out.
  76131. .filter( item => !isFalsy( item ) )
  76132. // Filter inactive bindings from schema, like static strings ('foo'), numbers (42), etc.
  76133. .filter( item => item.observable )
  76134. // Once only the actual binding are left, let the emitter listen to observable change:attribute event.
  76135. // TODO: Reduce the number of listeners attached as many bindings may listen
  76136. // to the same observable attribute.
  76137. .map( templateBinding => templateBinding.activateAttributeListener( schema, updater, data ) );
  76138. if ( revertData ) {
  76139. revertData.bindings.push( revertBindings );
  76140. }
  76141. }
  76142. /**
  76143. * Reverts {@link module:ui/template~RenderData#revertData template data} from a node to
  76144. * return it to the original state.
  76145. *
  76146. * @protected
  76147. * @param {HTMLElement|Text} node A node to be reverted.
  76148. * @param {Object} revertData An object that stores information about what changes have been made by
  76149. * {@link #apply} to the node. See {@link module:ui/template~RenderData#revertData} for more information.
  76150. */
  76151. _revertTemplateFromNode( node, revertData ) {
  76152. for ( const binding of revertData.bindings ) {
  76153. // Each binding may consist of several observable+observable#attribute.
  76154. // like the following has 2:
  76155. //
  76156. // class: [
  76157. // 'x',
  76158. // bind.to( 'foo' ),
  76159. // 'y',
  76160. // bind.to( 'bar' )
  76161. // ]
  76162. //
  76163. for ( const revertBinding of binding ) {
  76164. revertBinding();
  76165. }
  76166. }
  76167. if ( revertData.text ) {
  76168. node.textContent = revertData.text;
  76169. return;
  76170. }
  76171. for ( const attrName in revertData.attributes ) {
  76172. const attrValue = revertData.attributes[ attrName ];
  76173. // When the attribute has **not** been set before #apply().
  76174. if ( attrValue === null ) {
  76175. node.removeAttribute( attrName );
  76176. } else {
  76177. node.setAttribute( attrName, attrValue );
  76178. }
  76179. }
  76180. for ( let i = 0; i < revertData.children.length; ++i ) {
  76181. this._revertTemplateFromNode( node.childNodes[ i ], revertData.children[ i ] );
  76182. }
  76183. }
  76184. }
  76185. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( Template, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_2__["default"] );
  76186. /**
  76187. * Describes a binding created by the {@link module:ui/template~Template.bind} interface.
  76188. *
  76189. * @protected
  76190. */
  76191. class TemplateBinding {
  76192. /**
  76193. * Creates an instance of the {@link module:ui/template~TemplateBinding} class.
  76194. *
  76195. * @param {module:ui/template~TemplateDefinition} def The definition of the binding.
  76196. */
  76197. constructor( def ) {
  76198. Object.assign( this, def );
  76199. /**
  76200. * An observable instance of the binding. It either:
  76201. *
  76202. * * provides the attribute with the value,
  76203. * * or passes the event when a corresponding DOM event is fired.
  76204. *
  76205. * @member {module:utils/observablemixin~ObservableMixin} module:ui/template~TemplateBinding#observable
  76206. */
  76207. /**
  76208. * An {@link module:utils/emittermixin~Emitter} used by the binding to:
  76209. *
  76210. * * listen to the attribute change in the {@link module:ui/template~TemplateBinding#observable},
  76211. * * or listen to the event in the DOM.
  76212. *
  76213. * @member {module:utils/emittermixin~EmitterMixin} module:ui/template~TemplateBinding#emitter
  76214. */
  76215. /**
  76216. * The name of the {@link module:ui/template~TemplateBinding#observable observed attribute}.
  76217. *
  76218. * @member {String} module:ui/template~TemplateBinding#attribute
  76219. */
  76220. /**
  76221. * A custom function to process the value of the {@link module:ui/template~TemplateBinding#attribute}.
  76222. *
  76223. * @member {Function} [module:ui/template~TemplateBinding#callback]
  76224. */
  76225. }
  76226. /**
  76227. * Returns the value of the binding. It is the value of the {@link module:ui/template~TemplateBinding#attribute} in
  76228. * {@link module:ui/template~TemplateBinding#observable}. The value may be processed by the
  76229. * {@link module:ui/template~TemplateBinding#callback}, if such has been passed to the binding.
  76230. *
  76231. * @param {Node} [node] A native DOM node, passed to the custom {@link module:ui/template~TemplateBinding#callback}.
  76232. * @returns {*} The value of {@link module:ui/template~TemplateBinding#attribute} in
  76233. * {@link module:ui/template~TemplateBinding#observable}.
  76234. */
  76235. getValue( node ) {
  76236. const value = this.observable[ this.attribute ];
  76237. return this.callback ? this.callback( value, node ) : value;
  76238. }
  76239. /**
  76240. * Activates the listener which waits for changes of the {@link module:ui/template~TemplateBinding#attribute} in
  76241. * {@link module:ui/template~TemplateBinding#observable}, then updates the DOM with the aggregated
  76242. * value of {@link module:ui/template~TemplateValueSchema}.
  76243. *
  76244. * @param {module:ui/template~TemplateValueSchema} schema A full schema to generate an attribute or text in the DOM.
  76245. * @param {Function} updater A DOM updater function used to update the native DOM attribute or text.
  76246. * @param {module:ui/template~RenderData} data Rendering data.
  76247. * @returns {Function} A function to sever the listener binding.
  76248. */
  76249. activateAttributeListener( schema, updater, data ) {
  76250. const callback = () => syncValueSchemaValue( schema, updater, data );
  76251. this.emitter.listenTo( this.observable, 'change:' + this.attribute, callback );
  76252. // Allows revert of the listener.
  76253. return () => {
  76254. this.emitter.stopListening( this.observable, 'change:' + this.attribute, callback );
  76255. };
  76256. }
  76257. }
  76258. /**
  76259. * Describes either:
  76260. *
  76261. * * a binding to an {@link module:utils/observablemixin~Observable},
  76262. * * or a native DOM event binding.
  76263. *
  76264. * It is created by the {@link module:ui/template~BindChain#to} method.
  76265. *
  76266. * @protected
  76267. */
  76268. class TemplateToBinding extends TemplateBinding {
  76269. /**
  76270. * Activates the listener for the native DOM event, which when fired, is propagated by
  76271. * the {@link module:ui/template~TemplateBinding#emitter}.
  76272. *
  76273. * @param {String} domEvtName The name of the native DOM event.
  76274. * @param {String} domSelector The selector in the DOM to filter delegated events.
  76275. * @param {module:ui/template~RenderData} data Rendering data.
  76276. * @returns {Function} A function to sever the listener binding.
  76277. */
  76278. activateDomEventListener( domEvtName, domSelector, data ) {
  76279. const callback = ( evt, domEvt ) => {
  76280. if ( !domSelector || domEvt.target.matches( domSelector ) ) {
  76281. if ( typeof this.eventNameOrFunction == 'function' ) {
  76282. this.eventNameOrFunction( domEvt );
  76283. } else {
  76284. this.observable.fire( this.eventNameOrFunction, domEvt );
  76285. }
  76286. }
  76287. };
  76288. this.emitter.listenTo( data.node, domEvtName, callback );
  76289. // Allows revert of the listener.
  76290. return () => {
  76291. this.emitter.stopListening( data.node, domEvtName, callback );
  76292. };
  76293. }
  76294. }
  76295. /**
  76296. * Describes a binding to {@link module:utils/observablemixin~ObservableMixin} created by the {@link module:ui/template~BindChain#if}
  76297. * method.
  76298. *
  76299. * @protected
  76300. */
  76301. class TemplateIfBinding extends TemplateBinding {
  76302. /**
  76303. * @inheritDoc
  76304. */
  76305. getValue( node ) {
  76306. const value = super.getValue( node );
  76307. return isFalsy( value ) ? false : ( this.valueIfTrue || true );
  76308. }
  76309. /**
  76310. * The value of the DOM attribute or text to be set if the {@link module:ui/template~TemplateBinding#attribute} in
  76311. * {@link module:ui/template~TemplateBinding#observable} is `true`.
  76312. *
  76313. * @member {String} [module:ui/template~TemplateIfBinding#valueIfTrue]
  76314. */
  76315. }
  76316. // Checks whether given {@link module:ui/template~TemplateValueSchema} contains a
  76317. // {@link module:ui/template~TemplateBinding}.
  76318. //
  76319. // @param {module:ui/template~TemplateValueSchema} schema
  76320. // @returns {Boolean}
  76321. function hasTemplateBinding( schema ) {
  76322. if ( !schema ) {
  76323. return false;
  76324. }
  76325. // Normalize attributes with additional data like namespace:
  76326. //
  76327. // class: {
  76328. // ns: 'abc',
  76329. // value: [ ... ]
  76330. // }
  76331. //
  76332. if ( schema.value ) {
  76333. schema = schema.value;
  76334. }
  76335. if ( Array.isArray( schema ) ) {
  76336. return schema.some( hasTemplateBinding );
  76337. } else if ( schema instanceof TemplateBinding ) {
  76338. return true;
  76339. }
  76340. return false;
  76341. }
  76342. // Assembles the value using {@link module:ui/template~TemplateValueSchema} and stores it in a form of
  76343. // an Array. Each entry of the Array corresponds to one of {@link module:ui/template~TemplateValueSchema}
  76344. // items.
  76345. //
  76346. // @param {module:ui/template~TemplateValueSchema} schema
  76347. // @param {Node} node DOM Node updated when {@link module:utils/observablemixin~ObservableMixin} changes.
  76348. // @returns {Array}
  76349. function getValueSchemaValue( schema, node ) {
  76350. return schema.map( schemaItem => {
  76351. // Process {@link module:ui/template~TemplateBinding} bindings.
  76352. if ( schemaItem instanceof TemplateBinding ) {
  76353. return schemaItem.getValue( node );
  76354. }
  76355. // All static values like strings, numbers, and "falsy" values (false, null, undefined, '', etc.) just pass.
  76356. return schemaItem;
  76357. } );
  76358. }
  76359. // A function executed each time the bound Observable attribute changes, which updates the DOM with a value
  76360. // constructed from {@link module:ui/template~TemplateValueSchema}.
  76361. //
  76362. // @param {module:ui/template~TemplateValueSchema} schema
  76363. // @param {Function} updater A function which updates the DOM (like attribute or text).
  76364. // @param {Node} node DOM Node updated when {@link module:utils/observablemixin~ObservableMixin} changes.
  76365. function syncValueSchemaValue( schema, updater, { node } ) {
  76366. let value = getValueSchemaValue( schema, node );
  76367. // Check if schema is a single Template.bind.if, like:
  76368. //
  76369. // class: Template.bind.if( 'foo' )
  76370. //
  76371. if ( schema.length == 1 && schema[ 0 ] instanceof TemplateIfBinding ) {
  76372. value = value[ 0 ];
  76373. } else {
  76374. value = value.reduce( arrayValueReducer, '' );
  76375. }
  76376. if ( isFalsy( value ) ) {
  76377. updater.remove();
  76378. } else {
  76379. updater.set( value );
  76380. }
  76381. }
  76382. // Returns an object consisting of `set` and `remove` functions, which
  76383. // can be used in the context of DOM Node to set or reset `textContent`.
  76384. // @see module:ui/view~View#_bindToObservable
  76385. //
  76386. // @param {Node} node DOM Node to be modified.
  76387. // @returns {Object}
  76388. function getTextUpdater( node ) {
  76389. return {
  76390. set( value ) {
  76391. node.textContent = value;
  76392. },
  76393. remove() {
  76394. node.textContent = '';
  76395. }
  76396. };
  76397. }
  76398. // Returns an object consisting of `set` and `remove` functions, which
  76399. // can be used in the context of DOM Node to set or reset an attribute.
  76400. // @see module:ui/view~View#_bindToObservable
  76401. //
  76402. // @param {Node} node DOM Node to be modified.
  76403. // @param {String} attrName Name of the attribute to be modified.
  76404. // @param {String} [ns=null] Namespace to use.
  76405. // @returns {Object}
  76406. function getAttributeUpdater( el, attrName, ns ) {
  76407. return {
  76408. set( value ) {
  76409. el.setAttributeNS( ns, attrName, value );
  76410. },
  76411. remove() {
  76412. el.removeAttributeNS( ns, attrName );
  76413. }
  76414. };
  76415. }
  76416. // Returns an object consisting of `set` and `remove` functions, which
  76417. // can be used in the context of CSSStyleDeclaration to set or remove a style.
  76418. // @see module:ui/view~View#_bindToObservable
  76419. //
  76420. // @param {Node} node DOM Node to be modified.
  76421. // @param {String} styleName Name of the style to be modified.
  76422. // @returns {Object}
  76423. function getStyleUpdater( el, styleName ) {
  76424. return {
  76425. set( value ) {
  76426. el.style[ styleName ] = value;
  76427. },
  76428. remove() {
  76429. el.style[ styleName ] = null;
  76430. }
  76431. };
  76432. }
  76433. // Clones definition of the template.
  76434. //
  76435. // @param {module:ui/template~TemplateDefinition} def
  76436. // @returns {module:ui/template~TemplateDefinition}
  76437. function clone( def ) {
  76438. const clone = Object(lodash_es__WEBPACK_IMPORTED_MODULE_6__["cloneDeepWith"])( def, value => {
  76439. // Don't clone the `Template.bind`* bindings because of the references to Observable
  76440. // and DomEmitterMixin instances inside, which would also be traversed and cloned by greedy
  76441. // cloneDeepWith algorithm. There's no point in cloning Observable/DomEmitterMixins
  76442. // along with the definition.
  76443. //
  76444. // Don't clone Template instances if provided as a child. They're simply #render()ed
  76445. // and nothing should interfere.
  76446. //
  76447. // Also don't clone View instances if provided as a child of the Template. The template
  76448. // instance will be extracted from the View during the normalization and there's no need
  76449. // to clone it.
  76450. if ( value && ( value instanceof TemplateBinding || isTemplate( value ) || isView( value ) || isViewCollection( value ) ) ) {
  76451. return value;
  76452. }
  76453. } );
  76454. return clone;
  76455. }
  76456. // Normalizes given {@link module:ui/template~TemplateDefinition}.
  76457. //
  76458. // See:
  76459. // * {@link normalizeAttributes}
  76460. // * {@link normalizeListeners}
  76461. // * {@link normalizePlainTextDefinition}
  76462. // * {@link normalizeTextDefinition}
  76463. //
  76464. // @param {module:ui/template~TemplateDefinition} def
  76465. // @returns {module:ui/template~TemplateDefinition} Normalized definition.
  76466. function normalize( def ) {
  76467. if ( typeof def == 'string' ) {
  76468. def = normalizePlainTextDefinition( def );
  76469. } else if ( def.text ) {
  76470. normalizeTextDefinition( def );
  76471. }
  76472. if ( def.on ) {
  76473. def.eventListeners = normalizeListeners( def.on );
  76474. // Template mixes EmitterMixin, so delete #on to avoid collision.
  76475. delete def.on;
  76476. }
  76477. if ( !def.text ) {
  76478. if ( def.attributes ) {
  76479. normalizeAttributes( def.attributes );
  76480. }
  76481. const children = [];
  76482. if ( def.children ) {
  76483. if ( isViewCollection( def.children ) ) {
  76484. children.push( def.children );
  76485. } else {
  76486. for ( const child of def.children ) {
  76487. if ( isTemplate( child ) || isView( child ) || Object(_ckeditor_ckeditor5_utils_src_dom_isnode__WEBPACK_IMPORTED_MODULE_5__["default"])( child ) ) {
  76488. children.push( child );
  76489. } else {
  76490. children.push( new Template( child ) );
  76491. }
  76492. }
  76493. }
  76494. }
  76495. def.children = children;
  76496. }
  76497. return def;
  76498. }
  76499. // Normalizes "attributes" section of {@link module:ui/template~TemplateDefinition}.
  76500. //
  76501. // attributes: {
  76502. // a: 'bar',
  76503. // b: {@link module:ui/template~TemplateBinding},
  76504. // c: {
  76505. // value: 'bar'
  76506. // }
  76507. // }
  76508. //
  76509. // becomes
  76510. //
  76511. // attributes: {
  76512. // a: [ 'bar' ],
  76513. // b: [ {@link module:ui/template~TemplateBinding} ],
  76514. // c: {
  76515. // value: [ 'bar' ]
  76516. // }
  76517. // }
  76518. //
  76519. // @param {Object} attributes
  76520. function normalizeAttributes( attributes ) {
  76521. for ( const a in attributes ) {
  76522. if ( attributes[ a ].value ) {
  76523. attributes[ a ].value = [].concat( attributes[ a ].value );
  76524. }
  76525. arrayify( attributes, a );
  76526. }
  76527. }
  76528. // Normalizes "on" section of {@link module:ui/template~TemplateDefinition}.
  76529. //
  76530. // on: {
  76531. // a: 'bar',
  76532. // b: {@link module:ui/template~TemplateBinding},
  76533. // c: [ {@link module:ui/template~TemplateBinding}, () => { ... } ]
  76534. // }
  76535. //
  76536. // becomes
  76537. //
  76538. // on: {
  76539. // a: [ 'bar' ],
  76540. // b: [ {@link module:ui/template~TemplateBinding} ],
  76541. // c: [ {@link module:ui/template~TemplateBinding}, () => { ... } ]
  76542. // }
  76543. //
  76544. // @param {Object} listeners
  76545. // @returns {Object} Object containing normalized listeners.
  76546. function normalizeListeners( listeners ) {
  76547. for ( const l in listeners ) {
  76548. arrayify( listeners, l );
  76549. }
  76550. return listeners;
  76551. }
  76552. // Normalizes "string" {@link module:ui/template~TemplateDefinition}.
  76553. //
  76554. // "foo"
  76555. //
  76556. // becomes
  76557. //
  76558. // { text: [ 'foo' ] },
  76559. //
  76560. // @param {String} def
  76561. // @returns {module:ui/template~TemplateDefinition} Normalized template definition.
  76562. function normalizePlainTextDefinition( def ) {
  76563. return {
  76564. text: [ def ]
  76565. };
  76566. }
  76567. // Normalizes text {@link module:ui/template~TemplateDefinition}.
  76568. //
  76569. // children: [
  76570. // { text: 'def' },
  76571. // { text: {@link module:ui/template~TemplateBinding} }
  76572. // ]
  76573. //
  76574. // becomes
  76575. //
  76576. // children: [
  76577. // { text: [ 'def' ] },
  76578. // { text: [ {@link module:ui/template~TemplateBinding} ] }
  76579. // ]
  76580. //
  76581. // @param {module:ui/template~TemplateDefinition} def
  76582. function normalizeTextDefinition( def ) {
  76583. if ( !Array.isArray( def.text ) ) {
  76584. def.text = [ def.text ];
  76585. }
  76586. }
  76587. // Wraps an entry in Object in an Array, if not already one.
  76588. //
  76589. // {
  76590. // x: 'y',
  76591. // a: [ 'b' ]
  76592. // }
  76593. //
  76594. // becomes
  76595. //
  76596. // {
  76597. // x: [ 'y' ],
  76598. // a: [ 'b' ]
  76599. // }
  76600. //
  76601. // @param {Object} obj
  76602. // @param {String} key
  76603. function arrayify( obj, key ) {
  76604. if ( !Array.isArray( obj[ key ] ) ) {
  76605. obj[ key ] = [ obj[ key ] ];
  76606. }
  76607. }
  76608. // A helper which concatenates the value avoiding unwanted
  76609. // leading white spaces.
  76610. //
  76611. // @param {String} prev
  76612. // @param {String} cur
  76613. // @returns {String}
  76614. function arrayValueReducer( prev, cur ) {
  76615. if ( isFalsy( cur ) ) {
  76616. return prev;
  76617. } else if ( isFalsy( prev ) ) {
  76618. return cur;
  76619. } else {
  76620. return `${ prev } ${ cur }`;
  76621. }
  76622. }
  76623. // Extends one object defined in the following format:
  76624. //
  76625. // {
  76626. // key1: [Array1],
  76627. // key2: [Array2],
  76628. // ...
  76629. // keyN: [ArrayN]
  76630. // }
  76631. //
  76632. // with another object of the same data format.
  76633. //
  76634. // @param {Object} obj Base object.
  76635. // @param {Object} ext Object extending base.
  76636. // @returns {String}
  76637. function extendObjectValueArray( obj, ext ) {
  76638. for ( const a in ext ) {
  76639. if ( obj[ a ] ) {
  76640. obj[ a ].push( ...ext[ a ] );
  76641. } else {
  76642. obj[ a ] = ext[ a ];
  76643. }
  76644. }
  76645. }
  76646. // A helper for {@link module:ui/template~Template#extend}. Recursively extends {@link module:ui/template~Template} instance
  76647. // with content from {@link module:ui/template~TemplateDefinition}. See {@link module:ui/template~Template#extend} to learn more.
  76648. //
  76649. // @param {module:ui/template~Template} def A template instance to be extended.
  76650. // @param {module:ui/template~TemplateDefinition} def A definition which is to extend the template instance.
  76651. // @param {Object} Error context.
  76652. function extendTemplate( template, def ) {
  76653. if ( def.attributes ) {
  76654. if ( !template.attributes ) {
  76655. template.attributes = {};
  76656. }
  76657. extendObjectValueArray( template.attributes, def.attributes );
  76658. }
  76659. if ( def.eventListeners ) {
  76660. if ( !template.eventListeners ) {
  76661. template.eventListeners = {};
  76662. }
  76663. extendObjectValueArray( template.eventListeners, def.eventListeners );
  76664. }
  76665. if ( def.text ) {
  76666. template.text.push( ...def.text );
  76667. }
  76668. if ( def.children && def.children.length ) {
  76669. if ( template.children.length != def.children.length ) {
  76670. /**
  76671. * The number of children in extended definition does not match.
  76672. *
  76673. * @error ui-template-extend-children-mismatch
  76674. */
  76675. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  76676. 'ui-template-extend-children-mismatch',
  76677. template
  76678. );
  76679. }
  76680. let childIndex = 0;
  76681. for ( const childDef of def.children ) {
  76682. extendTemplate( template.children[ childIndex++ ], childDef );
  76683. }
  76684. }
  76685. }
  76686. // Checks if value is "falsy".
  76687. // Note: 0 (Number) is not "falsy" in this context.
  76688. //
  76689. // @private
  76690. // @param {*} value Value to be checked.
  76691. function isFalsy( value ) {
  76692. return !value && value !== 0;
  76693. }
  76694. // Checks if the item is an instance of {@link module:ui/view~View}
  76695. //
  76696. // @private
  76697. // @param {*} value Value to be checked.
  76698. function isView( item ) {
  76699. return item instanceof _view__WEBPACK_IMPORTED_MODULE_3__["default"];
  76700. }
  76701. // Checks if the item is an instance of {@link module:ui/template~Template}
  76702. //
  76703. // @private
  76704. // @param {*} value Value to be checked.
  76705. function isTemplate( item ) {
  76706. return item instanceof Template;
  76707. }
  76708. // Checks if the item is an instance of {@link module:ui/viewcollection~ViewCollection}
  76709. //
  76710. // @private
  76711. // @param {*} value Value to be checked.
  76712. function isViewCollection( item ) {
  76713. return item instanceof _viewcollection__WEBPACK_IMPORTED_MODULE_4__["default"];
  76714. }
  76715. // Creates an empty skeleton for {@link module:ui/template~Template#revert}
  76716. // data.
  76717. //
  76718. // @private
  76719. function getEmptyRevertData() {
  76720. return {
  76721. children: [],
  76722. bindings: [],
  76723. attributes: {}
  76724. };
  76725. }
  76726. // Checks whether an attribute should be extended when
  76727. // {@link module:ui/template~Template#apply} is called.
  76728. //
  76729. // @private
  76730. // @param {String} attrName Attribute name to check.
  76731. function shouldExtend( attrName ) {
  76732. return attrName == 'class' || attrName == 'style';
  76733. }
  76734. /**
  76735. * A definition of the {@link module:ui/template~Template}. It describes what kind of
  76736. * node a template will render (HTML element or text), attributes of an element, DOM event
  76737. * listeners and children.
  76738. *
  76739. * Also see:
  76740. * * {@link module:ui/template~TemplateValueSchema} to learn about HTML element attributes,
  76741. * * {@link module:ui/template~TemplateListenerSchema} to learn about DOM event listeners.
  76742. *
  76743. * A sample definition on an HTML element can look like this:
  76744. *
  76745. * new Template( {
  76746. * tag: 'p',
  76747. * children: [
  76748. * {
  76749. * tag: 'span',
  76750. * attributes: { ... },
  76751. * children: [ ... ],
  76752. * },
  76753. * {
  76754. * text: 'static–text'
  76755. * },
  76756. * 'also-static–text',
  76757. * ],
  76758. * attributes: {
  76759. * class: {@link module:ui/template~TemplateValueSchema},
  76760. * id: {@link module:ui/template~TemplateValueSchema},
  76761. * style: {@link module:ui/template~TemplateValueSchema}
  76762. *
  76763. * // ...
  76764. * },
  76765. * on: {
  76766. * 'click': {@link module:ui/template~TemplateListenerSchema}
  76767. *
  76768. * // Document.querySelector format is also accepted.
  76769. * 'keyup@a.some-class': {@link module:ui/template~TemplateListenerSchema}
  76770. *
  76771. * // ...
  76772. * }
  76773. * } );
  76774. *
  76775. * A {@link module:ui/view~View}, another {@link module:ui/template~Template} or a native DOM node
  76776. * can also become a child of a template. When a view is passed, its {@link module:ui/view~View#element} is used:
  76777. *
  76778. * const view = new SomeView();
  76779. * const childTemplate = new Template( { ... } );
  76780. * const childNode = document.createElement( 'b' );
  76781. *
  76782. * new Template( {
  76783. * tag: 'p',
  76784. *
  76785. * children: [
  76786. * // view#element will be added as a child of this <p>.
  76787. * view,
  76788. *
  76789. * // The output of childTemplate.render() will be added here.
  76790. * childTemplate,
  76791. *
  76792. * // Native DOM nodes are included directly in the rendered output.
  76793. * childNode
  76794. * ]
  76795. * } );
  76796. *
  76797. * An entire {@link module:ui/viewcollection~ViewCollection} can be used as a child in the definition:
  76798. *
  76799. * const collection = new ViewCollection();
  76800. * collection.add( someView );
  76801. *
  76802. * new Template( {
  76803. * tag: 'p',
  76804. *
  76805. * children: collection
  76806. * } );
  76807. *
  76808. * @typedef module:ui/template~TemplateDefinition
  76809. * @type Object
  76810. *
  76811. * @property {String} tag See the template {@link module:ui/template~Template#tag} property.
  76812. *
  76813. * @property {Array.<module:ui/template~TemplateDefinition>} [children]
  76814. * See the template {@link module:ui/template~Template#children} property.
  76815. *
  76816. * @property {Object.<String, module:ui/template~TemplateValueSchema>} [attributes]
  76817. * See the template {@link module:ui/template~Template#attributes} property.
  76818. *
  76819. * @property {String|module:ui/template~TemplateValueSchema|Array.<String|module:ui/template~TemplateValueSchema>} [text]
  76820. * See the template {@link module:ui/template~Template#text} property.
  76821. *
  76822. * @property {Object.<String, module:ui/template~TemplateListenerSchema>} [on]
  76823. * See the template {@link module:ui/template~Template#eventListeners} property.
  76824. */
  76825. /**
  76826. * Describes a value of an HTML element attribute or `textContent`. It allows combining multiple
  76827. * data sources like static values and {@link module:utils/observablemixin~Observable} attributes.
  76828. *
  76829. * Also see:
  76830. * * {@link module:ui/template~TemplateDefinition} to learn where to use it,
  76831. * * {@link module:ui/template~Template.bind} to learn how to configure
  76832. * {@link module:utils/observablemixin~Observable} attribute bindings,
  76833. * * {@link module:ui/template~Template#render} to learn how to render a template,
  76834. * * {@link module:ui/template~BindChain#to `to()`} and {@link module:ui/template~BindChain#if `if()`}
  76835. * methods to learn more about bindings.
  76836. *
  76837. * Attribute values can be described in many different ways:
  76838. *
  76839. * // Bind helper will create bindings to attributes of the observable.
  76840. * const bind = Template.bind( observable, emitter );
  76841. *
  76842. * new Template( {
  76843. * tag: 'p',
  76844. * attributes: {
  76845. * // A plain string schema.
  76846. * 'class': 'static-text',
  76847. *
  76848. * // An object schema, binds to the "foo" attribute of the
  76849. * // observable and follows its value.
  76850. * 'class': bind.to( 'foo' ),
  76851. *
  76852. * // An array schema, combines the above.
  76853. * 'class': [
  76854. * 'static-text',
  76855. * bind.to( 'bar', () => { ... } ),
  76856. *
  76857. * // Bindings can also be conditional.
  76858. * bind.if( 'baz', 'class-when-baz-is-true' )
  76859. * ],
  76860. *
  76861. * // An array schema, with a custom namespace, e.g. useful for creating SVGs.
  76862. * 'class': {
  76863. * ns: 'http://ns.url',
  76864. * value: [
  76865. * bind.if( 'baz', 'value-when-true' ),
  76866. * 'static-text'
  76867. * ]
  76868. * },
  76869. *
  76870. * // An object schema, specific for styles.
  76871. * style: {
  76872. * color: 'red',
  76873. * backgroundColor: bind.to( 'qux', () => { ... } )
  76874. * }
  76875. * }
  76876. * } );
  76877. *
  76878. * Text nodes can also have complex values:
  76879. *
  76880. * const bind = Template.bind( observable, emitter );
  76881. *
  76882. * // Will render a "foo" text node.
  76883. * new Template( {
  76884. * text: 'foo'
  76885. * } );
  76886. *
  76887. * // Will render a "static text: {observable.foo}" text node.
  76888. * // The text of the node will be updated as the "foo" attribute changes.
  76889. * new Template( {
  76890. * text: [
  76891. * 'static text: ',
  76892. * bind.to( 'foo', () => { ... } )
  76893. * ]
  76894. * } );
  76895. *
  76896. * @typedef module:ui/template~TemplateValueSchema
  76897. * @type {Object|String|Array}
  76898. */
  76899. /**
  76900. * Describes an event listener attached to an HTML element. Such listener can propagate DOM events
  76901. * through an {@link module:utils/observablemixin~Observable} instance, execute custom callbacks
  76902. * or both, if necessary.
  76903. *
  76904. * Also see:
  76905. * * {@link module:ui/template~TemplateDefinition} to learn more about template definitions,
  76906. * * {@link module:ui/template~BindChain#to `to()`} method to learn more about bindings.
  76907. *
  76908. * Check out different ways of attaching event listeners below:
  76909. *
  76910. * // Bind helper will propagate events through the observable.
  76911. * const bind = Template.bind( observable, emitter );
  76912. *
  76913. * new Template( {
  76914. * tag: 'p',
  76915. * on: {
  76916. * // An object schema. The observable will fire the "clicked" event upon DOM "click".
  76917. * click: bind.to( 'clicked' )
  76918. *
  76919. * // An object schema. It will work for "click" event on "a.foo" children only.
  76920. * 'click@a.foo': bind.to( 'clicked' )
  76921. *
  76922. * // An array schema, makes the observable propagate multiple events.
  76923. * click: [
  76924. * bind.to( 'clicked' ),
  76925. * bind.to( 'executed' )
  76926. * ],
  76927. *
  76928. * // An array schema with a custom callback.
  76929. * 'click@a.foo': {
  76930. * bind.to( 'clicked' ),
  76931. * bind.to( evt => {
  76932. * console.log( `${ evt.target } has been clicked!` );
  76933. * } }
  76934. * }
  76935. * }
  76936. * } );
  76937. *
  76938. * @typedef module:ui/template~TemplateListenerSchema
  76939. * @type {Object|String|Array}
  76940. */
  76941. /**
  76942. * The return value of {@link ~Template.bind `Template.bind()`}. It provides `to()` and `if()`
  76943. * methods to create the {@link module:utils/observablemixin~Observable observable} attribute and event bindings.
  76944. *
  76945. * @interface module:ui/template~BindChain
  76946. */
  76947. /**
  76948. * Binds an {@link module:utils/observablemixin~Observable observable} to either:
  76949. *
  76950. * * an HTML element attribute or a text node `textContent`, so it remains in sync with the observable
  76951. * attribute as it changes,
  76952. * * or an HTML element DOM event, so the DOM events are propagated through an observable.
  76953. *
  76954. * Some common use cases of `to()` bindings are presented below:
  76955. *
  76956. * const bind = Template.bind( observable, emitter );
  76957. *
  76958. * new Template( {
  76959. * tag: 'p',
  76960. * attributes: {
  76961. * // class="..." attribute gets bound to `observable#a`
  76962. * class: bind.to( 'a' )
  76963. * },
  76964. * children: [
  76965. * // <p>...</p> gets bound to observable#b; always `toUpperCase()`.
  76966. * {
  76967. * text: bind.to( 'b', ( value, node ) => value.toUpperCase() )
  76968. * }
  76969. * ],
  76970. * on: {
  76971. * click: [
  76972. * // An observable will fire "clicked" upon "click" in the DOM.
  76973. * bind.to( 'clicked' ),
  76974. *
  76975. * // A custom callback will be executed upon "click" in the DOM.
  76976. * bind.to( () => {
  76977. * ...
  76978. * } )
  76979. * ]
  76980. * }
  76981. * } ).render();
  76982. *
  76983. * Learn more about using `to()` in the {@link module:ui/template~TemplateValueSchema} and
  76984. * {@link module:ui/template~TemplateListenerSchema}.
  76985. *
  76986. * @method #to
  76987. * @param {String|Function} eventNameOrFunctionOrAttribute An attribute name of
  76988. * {@link module:utils/observablemixin~Observable} or a DOM event name or an event callback.
  76989. * @param {Function} [callback] Allows for processing of the value. Accepts `Node` and `value` as arguments.
  76990. * @returns {module:ui/template~TemplateBinding}
  76991. */
  76992. /**
  76993. * Binds an {@link module:utils/observablemixin~Observable observable} to an HTML element attribute or a text
  76994. * node `textContent` so it remains in sync with the observable attribute as it changes.
  76995. *
  76996. * Unlike {@link module:ui/template~BindChain#to}, it controls the presence of the attribute or `textContent`
  76997. * depending on the "falseness" of an {@link module:utils/observablemixin~Observable} attribute.
  76998. *
  76999. * const bind = Template.bind( observable, emitter );
  77000. *
  77001. * new Template( {
  77002. * tag: 'input',
  77003. * attributes: {
  77004. * // <input checked> when `observable#a` is not undefined/null/false/''
  77005. * // <input> when `observable#a` is undefined/null/false
  77006. * checked: bind.if( 'a' )
  77007. * },
  77008. * children: [
  77009. * {
  77010. * // <input>"b-is-not-set"</input> when `observable#b` is undefined/null/false/''
  77011. * // <input></input> when `observable#b` is not "falsy"
  77012. * text: bind.if( 'b', 'b-is-not-set', ( value, node ) => !value )
  77013. * }
  77014. * ]
  77015. * } ).render();
  77016. *
  77017. * Learn more about using `if()` in the {@link module:ui/template~TemplateValueSchema}.
  77018. *
  77019. * @method #if
  77020. * @param {String} attribute An attribute name of {@link module:utils/observablemixin~Observable} used in the binding.
  77021. * @param {String} [valueIfTrue] Value set when the {@link module:utils/observablemixin~Observable} attribute is not
  77022. * undefined/null/false/'' (empty string).
  77023. * @param {Function} [callback] Allows for processing of the value. Accepts `Node` and `value` as arguments.
  77024. * @returns {module:ui/template~TemplateBinding}
  77025. */
  77026. /**
  77027. * The {@link module:ui/template~Template#_renderNode} configuration.
  77028. *
  77029. * @private
  77030. * @interface module:ui/template~RenderData
  77031. */
  77032. /**
  77033. * Tells {@link module:ui/template~Template#_renderNode} to render
  77034. * children into `DocumentFragment` first and then append the fragment
  77035. * to the parent element. It is a speed optimization.
  77036. *
  77037. * @member {Boolean} #intoFragment
  77038. */
  77039. /**
  77040. * A node which is being rendered.
  77041. *
  77042. * @member {HTMLElement|Text} #node
  77043. */
  77044. /**
  77045. * Indicates whether the {@module:ui/template~RenderNodeOptions#node} has
  77046. * been provided by {@module:ui/template~Template#apply}.
  77047. *
  77048. * @member {Boolean} #isApplying
  77049. */
  77050. /**
  77051. * An object storing the data that helps {@module:ui/template~Template#revert}
  77052. * bringing back an element to its initial state, i.e. before
  77053. * {@module:ui/template~Template#apply} was called.
  77054. *
  77055. * @member {Object} #revertData
  77056. */
  77057. /***/ }),
  77058. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/enabletoolbarkeyboardfocus.js":
  77059. /*!***************************************************************************************!*\
  77060. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/enabletoolbarkeyboardfocus.js ***!
  77061. \***************************************************************************************/
  77062. /*! exports provided: default */
  77063. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  77064. "use strict";
  77065. __webpack_require__.r(__webpack_exports__);
  77066. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return enableToolbarKeyboardFocus; });
  77067. /**
  77068. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  77069. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  77070. */
  77071. /**
  77072. * @module ui/toolbar/enabletoolbarkeyboardfocus
  77073. */
  77074. /**
  77075. * Enables focus/blur toolbar navigation using `Alt+F10` and `Esc` keystrokes.
  77076. *
  77077. * @param {Object} options Options of the utility.
  77078. * @param {*} options.origin A view to which the focus will return when `Esc` is pressed and
  77079. * `options.toolbar` is focused.
  77080. * @param {module:utils/keystrokehandler~KeystrokeHandler} options.originKeystrokeHandler A keystroke
  77081. * handler to register `Alt+F10` keystroke.
  77082. * @param {module:utils/focustracker~FocusTracker} options.originFocusTracker A focus tracker
  77083. * for `options.origin`.
  77084. * @param {module:ui/toolbar/toolbarview~ToolbarView} options.toolbar A toolbar which is to gain
  77085. * focus when `Alt+F10` is pressed.
  77086. * @param {Function} [options.beforeFocus] A callback executed before the `options.toolbar` gains focus
  77087. * upon the `Alt+F10` keystroke.
  77088. * @param {Function} [options.afterBlur] A callback executed after `options.toolbar` loses focus upon
  77089. * `Esc` keystroke but before the focus goes back to `options.origin`.
  77090. */
  77091. function enableToolbarKeyboardFocus( {
  77092. origin,
  77093. originKeystrokeHandler,
  77094. originFocusTracker,
  77095. toolbar,
  77096. beforeFocus,
  77097. afterBlur
  77098. } ) {
  77099. // Because toolbar items can get focus, the overall state of the toolbar must
  77100. // also be tracked.
  77101. originFocusTracker.add( toolbar.element );
  77102. // Focus the toolbar on the keystroke, if not already focused.
  77103. originKeystrokeHandler.set( 'Alt+F10', ( data, cancel ) => {
  77104. if ( originFocusTracker.isFocused && !toolbar.focusTracker.isFocused ) {
  77105. if ( beforeFocus ) {
  77106. beforeFocus();
  77107. }
  77108. toolbar.focus();
  77109. cancel();
  77110. }
  77111. } );
  77112. // Blur the toolbar and bring the focus back to origin.
  77113. toolbar.keystrokes.set( 'Esc', ( data, cancel ) => {
  77114. if ( toolbar.focusTracker.isFocused ) {
  77115. origin.focus();
  77116. if ( afterBlur ) {
  77117. afterBlur();
  77118. }
  77119. cancel();
  77120. }
  77121. } );
  77122. }
  77123. /***/ }),
  77124. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/normalizetoolbarconfig.js":
  77125. /*!***********************************************************************************!*\
  77126. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/normalizetoolbarconfig.js ***!
  77127. \***********************************************************************************/
  77128. /*! exports provided: default */
  77129. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  77130. "use strict";
  77131. __webpack_require__.r(__webpack_exports__);
  77132. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeToolbarConfig; });
  77133. /**
  77134. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  77135. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  77136. */
  77137. /**
  77138. * @module ui/toolbar/normalizetoolbarconfig
  77139. */
  77140. /**
  77141. * Normalizes the toolbar configuration (`config.toolbar`), which:
  77142. *
  77143. * * may be defined as an `Array`:
  77144. *
  77145. * toolbar: [ 'heading', 'bold', 'italic', 'link', ... ]
  77146. *
  77147. * * or an `Object`:
  77148. *
  77149. * toolbar: {
  77150. * items: [ 'heading', 'bold', 'italic', 'link', ... ],
  77151. * ...
  77152. * }
  77153. *
  77154. * * or may not be defined at all (`undefined`)
  77155. *
  77156. * and returns it in the object form.
  77157. *
  77158. * @param {Array|Object|undefined} config The value of `config.toolbar`.
  77159. * @returns {Object} A normalized toolbar config object.
  77160. */
  77161. function normalizeToolbarConfig( config ) {
  77162. if ( Array.isArray( config ) ) {
  77163. return {
  77164. items: config
  77165. };
  77166. }
  77167. if ( !config ) {
  77168. return {
  77169. items: []
  77170. };
  77171. }
  77172. return Object.assign( {
  77173. items: []
  77174. }, config );
  77175. }
  77176. /***/ }),
  77177. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarseparatorview.js":
  77178. /*!*********************************************************************************!*\
  77179. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarseparatorview.js ***!
  77180. \*********************************************************************************/
  77181. /*! exports provided: default */
  77182. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  77183. "use strict";
  77184. __webpack_require__.r(__webpack_exports__);
  77185. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ToolbarSeparatorView; });
  77186. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  77187. /**
  77188. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  77189. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  77190. */
  77191. /**
  77192. * @module ui/toolbar/toolbarseparatorview
  77193. */
  77194. /**
  77195. * The toolbar separator view class.
  77196. *
  77197. * @extends module:ui/view~View
  77198. */
  77199. class ToolbarSeparatorView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  77200. /**
  77201. * @inheritDoc
  77202. */
  77203. constructor( locale ) {
  77204. super( locale );
  77205. this.setTemplate( {
  77206. tag: 'span',
  77207. attributes: {
  77208. class: [
  77209. 'ck',
  77210. 'ck-toolbar__separator'
  77211. ]
  77212. }
  77213. } );
  77214. }
  77215. }
  77216. /***/ }),
  77217. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarview.js":
  77218. /*!************************************************************************!*\
  77219. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarview.js ***!
  77220. \************************************************************************/
  77221. /*! exports provided: default */
  77222. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  77223. "use strict";
  77224. __webpack_require__.r(__webpack_exports__);
  77225. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ToolbarView; });
  77226. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  77227. /* harmony import */ var _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/focustracker */ "./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js");
  77228. /* harmony import */ var _focuscycler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../focuscycler */ "./node_modules/@ckeditor/ckeditor5-ui/src/focuscycler.js");
  77229. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keystrokehandler */ "./node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js");
  77230. /* harmony import */ var _toolbarseparatorview__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./toolbarseparatorview */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarseparatorview.js");
  77231. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_resizeobserver__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/resizeobserver */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/resizeobserver.js");
  77232. /* harmony import */ var _bindings_preventdefault_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../bindings/preventdefault.js */ "./node_modules/@ckeditor/ckeditor5-ui/src/bindings/preventdefault.js");
  77233. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
  77234. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
  77235. /* harmony import */ var _dropdown_utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../dropdown/utils */ "./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/utils.js");
  77236. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  77237. /* harmony import */ var _ckeditor_ckeditor5_core_theme_icons_three_vertical_dots_svg__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/theme/icons/three-vertical-dots.svg */ "./node_modules/@ckeditor/ckeditor5-core/theme/icons/three-vertical-dots.svg");
  77238. /* harmony import */ var _theme_components_toolbar_toolbar_css__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../theme/components/toolbar/toolbar.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css");
  77239. /* harmony import */ var _theme_components_toolbar_toolbar_css__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_theme_components_toolbar_toolbar_css__WEBPACK_IMPORTED_MODULE_12__);
  77240. /**
  77241. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  77242. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  77243. */
  77244. /**
  77245. * @module ui/toolbar/toolbarview
  77246. */
  77247. /**
  77248. * The toolbar view class.
  77249. *
  77250. * @extends module:ui/view~View
  77251. * @implements module:ui/dropdown/dropdownpanelfocusable~DropdownPanelFocusable
  77252. */
  77253. class ToolbarView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  77254. /**
  77255. * Creates an instance of the {@link module:ui/toolbar/toolbarview~ToolbarView} class.
  77256. *
  77257. * Also see {@link #render}.
  77258. *
  77259. * @param {module:utils/locale~Locale} locale The localization services instance.
  77260. * @param {module:ui/toolbar/toolbarview~ToolbarOptions} [options] Configuration options of the toolbar.
  77261. */
  77262. constructor( locale, options ) {
  77263. super( locale );
  77264. const bind = this.bindTemplate;
  77265. const t = this.t;
  77266. /**
  77267. * A reference to the options object passed to the constructor.
  77268. *
  77269. * @readonly
  77270. * @member {module:ui/toolbar/toolbarview~ToolbarOptions}
  77271. */
  77272. this.options = options || {};
  77273. /**
  77274. * Label used by assistive technologies to describe this toolbar element.
  77275. *
  77276. * @default 'Editor toolbar'
  77277. * @member {String} #ariaLabel
  77278. */
  77279. this.set( 'ariaLabel', t( 'Editor toolbar' ) );
  77280. /**
  77281. * The maximum width of the toolbar element.
  77282. *
  77283. * **Note**: When set to a specific value (e.g. `'200px'`), the value will affect the behavior of the
  77284. * {@link module:ui/toolbar/toolbarview~ToolbarOptions#shouldGroupWhenFull}
  77285. * option by changing the number of {@link #items} that will be displayed in the toolbar at a time.
  77286. *
  77287. * @observable
  77288. * @default 'auto'
  77289. * @member {String} #maxWidth
  77290. */
  77291. this.set( 'maxWidth', 'auto' );
  77292. /**
  77293. * A collection of toolbar items (buttons, dropdowns, etc.).
  77294. *
  77295. * @readonly
  77296. * @member {module:ui/viewcollection~ViewCollection}
  77297. */
  77298. this.items = this.createCollection();
  77299. /**
  77300. * Tracks information about the DOM focus in the toolbar.
  77301. *
  77302. * @readonly
  77303. * @member {module:utils/focustracker~FocusTracker}
  77304. */
  77305. this.focusTracker = new _ckeditor_ckeditor5_utils_src_focustracker__WEBPACK_IMPORTED_MODULE_1__["default"]();
  77306. /**
  77307. * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}
  77308. * to handle keyboard navigation in the toolbar.
  77309. *
  77310. * @readonly
  77311. * @member {module:utils/keystrokehandler~KeystrokeHandler}
  77312. */
  77313. this.keystrokes = new _ckeditor_ckeditor5_utils_src_keystrokehandler__WEBPACK_IMPORTED_MODULE_3__["default"]();
  77314. /**
  77315. * An additional CSS class added to the {@link #element}.
  77316. *
  77317. * @observable
  77318. * @member {String} #class
  77319. */
  77320. this.set( 'class' );
  77321. /**
  77322. * When set true, makes the toolbar look compact with {@link #element}.
  77323. *
  77324. * @observable
  77325. * @default false
  77326. * @member {String} #isCompact
  77327. */
  77328. this.set( 'isCompact', false );
  77329. /**
  77330. * A (child) view containing {@link #items toolbar items}.
  77331. *
  77332. * @readonly
  77333. * @member {module:ui/toolbar/toolbarview~ItemsView}
  77334. */
  77335. this.itemsView = new ItemsView( locale );
  77336. /**
  77337. * A top–level collection aggregating building blocks of the toolbar.
  77338. *
  77339. * ┌───────────────── ToolbarView ─────────────────┐
  77340. * | ┌──────────────── #children ────────────────┐ |
  77341. * | | ┌──────────── #itemsView ───────────┐ | |
  77342. * | | | [ item1 ] [ item2 ] ... [ itemN ] | | |
  77343. * | | └──────────────────────────────────-┘ | |
  77344. * | └───────────────────────────────────────────┘ |
  77345. * └───────────────────────────────────────────────┘
  77346. *
  77347. * By default, it contains the {@link #itemsView} but it can be extended with additional
  77348. * UI elements when necessary.
  77349. *
  77350. * @readonly
  77351. * @member {module:ui/viewcollection~ViewCollection}
  77352. */
  77353. this.children = this.createCollection();
  77354. this.children.add( this.itemsView );
  77355. /**
  77356. * A collection of {@link #items} that take part in the focus cycling
  77357. * (i.e. navigation using the keyboard). Usually, it contains a subset of {@link #items} with
  77358. * some optional UI elements that also belong to the toolbar and should be focusable
  77359. * by the user.
  77360. *
  77361. * @readonly
  77362. * @member {module:ui/viewcollection~ViewCollection}
  77363. */
  77364. this.focusables = this.createCollection();
  77365. /**
  77366. * Controls the orientation of toolbar items. Only available when
  77367. * {@link module:ui/toolbar/toolbarview~ToolbarOptions#shouldGroupWhenFull dynamic items grouping}
  77368. * is **disabled**.
  77369. *
  77370. * @observable
  77371. * @member {Boolean} #isVertical
  77372. */
  77373. /**
  77374. * Helps cycling over {@link #focusables focusable items} in the toolbar.
  77375. *
  77376. * @readonly
  77377. * @protected
  77378. * @member {module:ui/focuscycler~FocusCycler}
  77379. */
  77380. this._focusCycler = new _focuscycler__WEBPACK_IMPORTED_MODULE_2__["default"]( {
  77381. focusables: this.focusables,
  77382. focusTracker: this.focusTracker,
  77383. keystrokeHandler: this.keystrokes,
  77384. actions: {
  77385. // Navigate toolbar items backwards using the arrow[left,up] keys.
  77386. focusPrevious: [ 'arrowleft', 'arrowup' ],
  77387. // Navigate toolbar items forwards using the arrow[right,down] keys.
  77388. focusNext: [ 'arrowright', 'arrowdown' ]
  77389. }
  77390. } );
  77391. this.setTemplate( {
  77392. tag: 'div',
  77393. attributes: {
  77394. class: [
  77395. 'ck',
  77396. 'ck-toolbar',
  77397. bind.to( 'class' ),
  77398. bind.if( 'isCompact', 'ck-toolbar_compact' )
  77399. ],
  77400. role: 'toolbar',
  77401. 'aria-label': bind.to( 'ariaLabel' ),
  77402. style: {
  77403. maxWidth: bind.to( 'maxWidth' )
  77404. }
  77405. },
  77406. children: this.children,
  77407. on: {
  77408. // https://github.com/ckeditor/ckeditor5-ui/issues/206
  77409. mousedown: Object(_bindings_preventdefault_js__WEBPACK_IMPORTED_MODULE_6__["default"])( this )
  77410. }
  77411. } );
  77412. /**
  77413. * An instance of the active toolbar behavior that shapes its look and functionality.
  77414. *
  77415. * See {@link module:ui/toolbar/toolbarview~ToolbarBehavior} to learn more.
  77416. *
  77417. * @protected
  77418. * @readonly
  77419. * @member {module:ui/toolbar/toolbarview~ToolbarBehavior}
  77420. */
  77421. this._behavior = this.options.shouldGroupWhenFull ? new DynamicGrouping( this ) : new StaticLayout( this );
  77422. }
  77423. /**
  77424. * @inheritDoc
  77425. */
  77426. render() {
  77427. super.render();
  77428. // Children added before rendering should be known to the #focusTracker.
  77429. for ( const item of this.items ) {
  77430. this.focusTracker.add( item.element );
  77431. }
  77432. this.items.on( 'add', ( evt, item ) => {
  77433. this.focusTracker.add( item.element );
  77434. } );
  77435. this.items.on( 'remove', ( evt, item ) => {
  77436. this.focusTracker.remove( item.element );
  77437. } );
  77438. // Start listening for the keystrokes coming from #element.
  77439. this.keystrokes.listenTo( this.element );
  77440. this._behavior.render( this );
  77441. }
  77442. /**
  77443. * @inheritDoc
  77444. */
  77445. destroy() {
  77446. this._behavior.destroy();
  77447. return super.destroy();
  77448. }
  77449. /**
  77450. * Focuses the first focusable in {@link #focusables}.
  77451. */
  77452. focus() {
  77453. this._focusCycler.focusFirst();
  77454. }
  77455. /**
  77456. * Focuses the last focusable in {@link #focusables}.
  77457. */
  77458. focusLast() {
  77459. this._focusCycler.focusLast();
  77460. }
  77461. /**
  77462. * A utility that expands the plain toolbar configuration into
  77463. * {@link module:ui/toolbar/toolbarview~ToolbarView#items} using a given component factory.
  77464. *
  77465. * @param {Array.<String>} config The toolbar items configuration.
  77466. * @param {module:ui/componentfactory~ComponentFactory} factory A factory producing toolbar items.
  77467. */
  77468. fillFromConfig( config, factory ) {
  77469. this.items.addMany( config.map( name => {
  77470. if ( name == '|' ) {
  77471. return new _toolbarseparatorview__WEBPACK_IMPORTED_MODULE_4__["default"]();
  77472. } else if ( factory.has( name ) ) {
  77473. return factory.create( name );
  77474. } else {
  77475. /**
  77476. * There was a problem processing the configuration of the toolbar. The item with the given
  77477. * name does not exist so it was omitted when rendering the toolbar.
  77478. *
  77479. * This warning usually shows up when the {@link module:core/plugin~Plugin} which is supposed
  77480. * to provide a toolbar item has not been loaded or there is a typo in the configuration.
  77481. *
  77482. * Make sure the plugin responsible for this toolbar item is loaded and the toolbar configuration
  77483. * is correct, e.g. {@link module:basic-styles/bold~Bold} is loaded for the `'bold'` toolbar item.
  77484. *
  77485. * You can use the following snippet to retrieve all available toolbar items:
  77486. *
  77487. * Array.from( editor.ui.componentFactory.names() );
  77488. *
  77489. * @error toolbarview-item-unavailable
  77490. * @param {String} name The name of the component.
  77491. */
  77492. Object(_ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_10__["logWarning"])( 'toolbarview-item-unavailable', { name } );
  77493. }
  77494. } ).filter( item => item !== undefined ) );
  77495. }
  77496. /**
  77497. * Fired when some toolbar {@link #items} were grouped or ungrouped as a result of some change
  77498. * in the toolbar geometry.
  77499. *
  77500. * **Note**: This event is always fired **once** regardless of the number of items that were be
  77501. * grouped or ungrouped at a time.
  77502. *
  77503. * **Note**: This event is fired only if the items grouping functionality was enabled in
  77504. * the first place (see {@link module:ui/toolbar/toolbarview~ToolbarOptions#shouldGroupWhenFull}).
  77505. *
  77506. * @event groupedItemsUpdate
  77507. */
  77508. }
  77509. /**
  77510. * An inner block of the {@link module:ui/toolbar/toolbarview~ToolbarView} hosting its
  77511. * {@link module:ui/toolbar/toolbarview~ToolbarView#items}.
  77512. *
  77513. * @private
  77514. * @extends module:ui/view~View
  77515. */
  77516. class ItemsView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  77517. /**
  77518. * @inheritDoc
  77519. */
  77520. constructor( locale ) {
  77521. super( locale );
  77522. /**
  77523. * A collection of items (buttons, dropdowns, etc.).
  77524. *
  77525. * @readonly
  77526. * @member {module:ui/viewcollection~ViewCollection}
  77527. */
  77528. this.children = this.createCollection();
  77529. this.setTemplate( {
  77530. tag: 'div',
  77531. attributes: {
  77532. class: [
  77533. 'ck',
  77534. 'ck-toolbar__items'
  77535. ]
  77536. },
  77537. children: this.children
  77538. } );
  77539. }
  77540. }
  77541. /**
  77542. * A toolbar behavior that makes it static and unresponsive to the changes of the environment.
  77543. * At the same time, it also makes it possible to display a toolbar with a vertical layout
  77544. * using the {@link module:ui/toolbar/toolbarview~ToolbarView#isVertical} property.
  77545. *
  77546. * @private
  77547. * @implements module:ui/toolbar/toolbarview~ToolbarBehavior
  77548. */
  77549. class StaticLayout {
  77550. /**
  77551. * Creates an instance of the {@link module:ui/toolbar/toolbarview~StaticLayout} toolbar
  77552. * behavior.
  77553. *
  77554. * @param {module:ui/toolbar/toolbarview~ToolbarView} view An instance of the toolbar that this behavior
  77555. * is added to.
  77556. */
  77557. constructor( view ) {
  77558. const bind = view.bindTemplate;
  77559. // Static toolbar can be vertical when needed.
  77560. view.set( 'isVertical', false );
  77561. // 1:1 pass–through binding, all ToolbarView#items are visible.
  77562. view.itemsView.children.bindTo( view.items ).using( item => item );
  77563. // 1:1 pass–through binding, all ToolbarView#items are focusable.
  77564. view.focusables.bindTo( view.items ).using( item => item );
  77565. view.extendTemplate( {
  77566. attributes: {
  77567. class: [
  77568. // When vertical, the toolbar has an additional CSS class.
  77569. bind.if( 'isVertical', 'ck-toolbar_vertical' )
  77570. ]
  77571. }
  77572. } );
  77573. }
  77574. /**
  77575. * @inheritDoc
  77576. */
  77577. render() {}
  77578. /**
  77579. * @inheritDoc
  77580. */
  77581. destroy() {}
  77582. }
  77583. /**
  77584. * A toolbar behavior that makes the items respond to changes in the geometry.
  77585. *
  77586. * In a nutshell, it groups {@link module:ui/toolbar/toolbarview~ToolbarView#items}
  77587. * that do not fit visually into a single row of the toolbar (due to limited space).
  77588. * Items that do not fit are aggregated in a dropdown displayed at the end of the toolbar.
  77589. *
  77590. * ┌──────────────────────────────────────── ToolbarView ──────────────────────────────────────────┐
  77591. * | ┌─────────────────────────────────────── #children ─────────────────────────────────────────┐ |
  77592. * | | ┌─────── #itemsView ────────┐ ┌──────────────────────┐ ┌── #groupedItemsDropdown ───┐ | |
  77593. * | | | #ungroupedItems | | ToolbarSeparatorView | | #groupedItems | | |
  77594. * | | └──────────────────────────-┘ └──────────────────────┘ └────────────────────────────┘ | |
  77595. * | | \---------- only when toolbar items overflow --------/ | |
  77596. * | └───────────────────────────────────────────────────────────────────────────────────────────┘ |
  77597. * └───────────────────────────────────────────────────────────────────────────────────────────────┘
  77598. *
  77599. * @private
  77600. * @implements module:ui/toolbar/toolbarview~ToolbarBehavior
  77601. */
  77602. class DynamicGrouping {
  77603. /**
  77604. * Creates an instance of the {@link module:ui/toolbar/toolbarview~DynamicGrouping} toolbar
  77605. * behavior.
  77606. *
  77607. * @param {module:ui/toolbar/toolbarview~ToolbarView} view An instance of the toolbar that this behavior
  77608. * is added to.
  77609. */
  77610. constructor( view ) {
  77611. /**
  77612. * A toolbar view this behavior belongs to.
  77613. *
  77614. * @readonly
  77615. * @member {module:ui/toolbar~ToolbarView}
  77616. */
  77617. this.view = view;
  77618. /**
  77619. * A collection of toolbar children.
  77620. *
  77621. * @readonly
  77622. * @member {module:ui/viewcollection~ViewCollection}
  77623. */
  77624. this.viewChildren = view.children;
  77625. /**
  77626. * A collection of focusable toolbar elements.
  77627. *
  77628. * @readonly
  77629. * @member {module:ui/viewcollection~ViewCollection}
  77630. */
  77631. this.viewFocusables = view.focusables;
  77632. /**
  77633. * A view containing toolbar items.
  77634. *
  77635. * @readonly
  77636. * @member {module:ui/toolbar/toolbarview~ItemsView}
  77637. */
  77638. this.viewItemsView = view.itemsView;
  77639. /**
  77640. * Toolbar focus tracker.
  77641. *
  77642. * @readonly
  77643. * @member {module:utils/focustracker~FocusTracker}
  77644. */
  77645. this.viewFocusTracker = view.focusTracker;
  77646. /**
  77647. * Toolbar locale.
  77648. *
  77649. * @readonly
  77650. * @member {module:utils/locale~Locale}
  77651. */
  77652. this.viewLocale = view.locale;
  77653. /**
  77654. * Toolbar element.
  77655. *
  77656. * @readonly
  77657. * @member {HTMLElement} #viewElement
  77658. */
  77659. /**
  77660. * A subset of toolbar {@link module:ui/toolbar/toolbarview~ToolbarView#items}.
  77661. * Aggregates items that fit into a single row of the toolbar and were not {@link #groupedItems grouped}
  77662. * into a {@link #groupedItemsDropdown dropdown}. Items of this collection are displayed in the
  77663. * {@link module:ui/toolbar/toolbarview~ToolbarView#itemsView}.
  77664. *
  77665. * When none of the {@link module:ui/toolbar/toolbarview~ToolbarView#items} were grouped, it
  77666. * matches the {@link module:ui/toolbar/toolbarview~ToolbarView#items} collection in size and order.
  77667. *
  77668. * @readonly
  77669. * @member {module:ui/viewcollection~ViewCollection}
  77670. */
  77671. this.ungroupedItems = view.createCollection();
  77672. /**
  77673. * A subset of toolbar {@link module:ui/toolbar/toolbarview~ToolbarView#items}.
  77674. * A collection of the toolbar items that do not fit into a single row of the toolbar.
  77675. * Grouped items are displayed in a dedicated {@link #groupedItemsDropdown dropdown}.
  77676. *
  77677. * When none of the {@link module:ui/toolbar/toolbarview~ToolbarView#items} were grouped,
  77678. * this collection is empty.
  77679. *
  77680. * @readonly
  77681. * @member {module:ui/viewcollection~ViewCollection}
  77682. */
  77683. this.groupedItems = view.createCollection();
  77684. /**
  77685. * The dropdown that aggregates {@link #groupedItems grouped items} that do not fit into a single
  77686. * row of the toolbar. It is displayed on demand as the last of
  77687. * {@link module:ui/toolbar/toolbarview~ToolbarView#children toolbar children} and offers another
  77688. * (nested) toolbar which displays items that would normally overflow.
  77689. *
  77690. * @readonly
  77691. * @member {module:ui/dropdown/dropdownview~DropdownView}
  77692. */
  77693. this.groupedItemsDropdown = this._createGroupedItemsDropdown();
  77694. /**
  77695. * An instance of the resize observer that helps dynamically determine the geometry of the toolbar
  77696. * and manage items that do not fit into a single row.
  77697. *
  77698. * **Note:** Created in {@link #_enableGroupingOnResize}.
  77699. *
  77700. * @readonly
  77701. * @member {module:utils/dom/resizeobserver~ResizeObserver}
  77702. */
  77703. this.resizeObserver = null;
  77704. /**
  77705. * A cached value of the horizontal padding style used by {@link #_updateGrouping}
  77706. * to manage the {@link module:ui/toolbar/toolbarview~ToolbarView#items} that do not fit into
  77707. * a single toolbar line. This value can be reused between updates because it is unlikely that
  77708. * the padding will change and re–using `Window.getComputedStyle()` is expensive.
  77709. *
  77710. * @readonly
  77711. * @member {Number}
  77712. */
  77713. this.cachedPadding = null;
  77714. /**
  77715. * A flag indicating that an items grouping update has been queued (e.g. due to the toolbar being visible)
  77716. * and should be executed immediately the next time the toolbar shows up.
  77717. *
  77718. * @readonly
  77719. * @member {Boolean}
  77720. */
  77721. this.shouldUpdateGroupingOnNextResize = false;
  77722. // Only those items that were not grouped are visible to the user.
  77723. view.itemsView.children.bindTo( this.ungroupedItems ).using( item => item );
  77724. // Make sure all #items visible in the main space of the toolbar are "focuscycleable".
  77725. this.ungroupedItems.on( 'add', this._updateFocusCycleableItems.bind( this ) );
  77726. this.ungroupedItems.on( 'remove', this._updateFocusCycleableItems.bind( this ) );
  77727. // Make sure the #groupedItemsDropdown is also included in cycling when it appears.
  77728. view.children.on( 'add', this._updateFocusCycleableItems.bind( this ) );
  77729. view.children.on( 'remove', this._updateFocusCycleableItems.bind( this ) );
  77730. // ToolbarView#items is dynamic. When an item is added or removed, it should be automatically
  77731. // represented in either grouped or ungrouped items at the right index.
  77732. // In other words #items == concat( #ungroupedItems, #groupedItems )
  77733. // (in length and order).
  77734. view.items.on( 'change', ( evt, changeData ) => {
  77735. const index = changeData.index;
  77736. // Removing.
  77737. for ( const removedItem of changeData.removed ) {
  77738. if ( index >= this.ungroupedItems.length ) {
  77739. this.groupedItems.remove( removedItem );
  77740. } else {
  77741. this.ungroupedItems.remove( removedItem );
  77742. }
  77743. }
  77744. // Adding.
  77745. for ( let currentIndex = index; currentIndex < index + changeData.added.length; currentIndex++ ) {
  77746. const addedItem = changeData.added[ currentIndex - index ];
  77747. if ( currentIndex > this.ungroupedItems.length ) {
  77748. this.groupedItems.add( addedItem, currentIndex - this.ungroupedItems.length );
  77749. } else {
  77750. this.ungroupedItems.add( addedItem, currentIndex );
  77751. }
  77752. }
  77753. // When new ungrouped items join in and land in #ungroupedItems, there's a chance it causes
  77754. // the toolbar to overflow.
  77755. // Consequently if removed from grouped or ungrouped items, there is a chance
  77756. // some new space is available and we could do some ungrouping.
  77757. this._updateGrouping();
  77758. } );
  77759. view.extendTemplate( {
  77760. attributes: {
  77761. class: [
  77762. // To group items dynamically, the toolbar needs a dedicated CSS class.
  77763. 'ck-toolbar_grouping'
  77764. ]
  77765. }
  77766. } );
  77767. }
  77768. /**
  77769. * Enables dynamic items grouping based on the dimensions of the toolbar.
  77770. *
  77771. * @param {module:ui/toolbar/toolbarview~ToolbarView} view An instance of the toolbar that this behavior
  77772. * is added to.
  77773. */
  77774. render( view ) {
  77775. this.viewElement = view.element;
  77776. this._enableGroupingOnResize();
  77777. this._enableGroupingOnMaxWidthChange( view );
  77778. }
  77779. /**
  77780. * Cleans up the internals used by this behavior.
  77781. */
  77782. destroy() {
  77783. // The dropdown may not be in ToolbarView#children at the moment of toolbar destruction
  77784. // so let's make sure it's actually destroyed along with the toolbar.
  77785. this.groupedItemsDropdown.destroy();
  77786. this.resizeObserver.destroy();
  77787. }
  77788. /**
  77789. * When called, it will check if any of the {@link #ungroupedItems} do not fit into a single row of the toolbar,
  77790. * and it will move them to the {@link #groupedItems} when it happens.
  77791. *
  77792. * At the same time, it will also check if there is enough space in the toolbar for the first of the
  77793. * {@link #groupedItems} to be returned back to {@link #ungroupedItems} and still fit into a single row
  77794. * without the toolbar wrapping.
  77795. *
  77796. * @protected
  77797. */
  77798. _updateGrouping() {
  77799. // Do no grouping–related geometry analysis when the toolbar is detached from visible DOM,
  77800. // for instance before #render(), or after render but without a parent or a parent detached
  77801. // from DOM. DOMRects won't work anyway and there will be tons of warning in the console and
  77802. // nothing else. This happens, for instance, when the toolbar is detached from DOM and
  77803. // some logic adds or removes its #items.
  77804. if ( !this.viewElement.ownerDocument.body.contains( this.viewElement ) ) {
  77805. return;
  77806. }
  77807. // Do not update grouping when the element is invisible. Such toolbar has DOMRect filled with zeros
  77808. // and that would cause all items to be grouped. Instead, queue the grouping so it runs next time
  77809. // the toolbar is visible (the next ResizeObserver callback execution). This is handy because
  77810. // the grouping could be caused by increasing the #maxWidth when the toolbar was invisible and the next
  77811. // time it shows up, some items could actually be ungrouped (https://github.com/ckeditor/ckeditor5/issues/6575).
  77812. if ( !this.viewElement.offsetParent ) {
  77813. this.shouldUpdateGroupingOnNextResize = true;
  77814. return;
  77815. }
  77816. // Remember how many items were initially grouped so at the it is possible to figure out if the number
  77817. // of grouped items has changed. If the number has changed, geometry of the toolbar has also changed.
  77818. const initialGroupedItemsCount = this.groupedItems.length;
  77819. let wereItemsGrouped;
  77820. // Group #items as long as some wrap to the next row. This will happen, for instance,
  77821. // when the toolbar is getting narrow and there is not enough space to display all items in
  77822. // a single row.
  77823. while ( this._areItemsOverflowing ) {
  77824. this._groupLastItem();
  77825. wereItemsGrouped = true;
  77826. }
  77827. // If none were grouped now but there were some items already grouped before,
  77828. // then, what the hell, maybe let's see if some of them can be ungrouped. This happens when,
  77829. // for instance, the toolbar is stretching and there's more space in it than before.
  77830. if ( !wereItemsGrouped && this.groupedItems.length ) {
  77831. // Ungroup items as long as none are overflowing or there are none to ungroup left.
  77832. while ( this.groupedItems.length && !this._areItemsOverflowing ) {
  77833. this._ungroupFirstItem();
  77834. }
  77835. // If the ungrouping ended up with some item wrapping to the next row,
  77836. // put it back to the group toolbar ("undo the last ungroup"). We don't know whether
  77837. // an item will wrap or not until we ungroup it (that's a DOM/CSS thing) so this
  77838. // clean–up is vital for the algorithm.
  77839. if ( this._areItemsOverflowing ) {
  77840. this._groupLastItem();
  77841. }
  77842. }
  77843. if ( this.groupedItems.length !== initialGroupedItemsCount ) {
  77844. this.view.fire( 'groupedItemsUpdate' );
  77845. }
  77846. }
  77847. /**
  77848. * Returns `true` when {@link module:ui/toolbar/toolbarview~ToolbarView#element} children visually overflow,
  77849. * for instance if the toolbar is narrower than its members. Returns `false` otherwise.
  77850. *
  77851. * @private
  77852. * @type {Boolean}
  77853. */
  77854. get _areItemsOverflowing() {
  77855. // An empty toolbar cannot overflow.
  77856. if ( !this.ungroupedItems.length ) {
  77857. return false;
  77858. }
  77859. const element = this.viewElement;
  77860. const uiLanguageDirection = this.viewLocale.uiLanguageDirection;
  77861. const lastChildRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_7__["default"]( element.lastChild );
  77862. const toolbarRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_7__["default"]( element );
  77863. if ( !this.cachedPadding ) {
  77864. const computedStyle = _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_8__["default"].window.getComputedStyle( element );
  77865. const paddingProperty = uiLanguageDirection === 'ltr' ? 'paddingRight' : 'paddingLeft';
  77866. // parseInt() is essential because of quirky floating point numbers logic and DOM.
  77867. // If the padding turned out too big because of that, the grouped items dropdown would
  77868. // always look (from the Rect perspective) like it overflows (while it's not).
  77869. this.cachedPadding = Number.parseInt( computedStyle[ paddingProperty ] );
  77870. }
  77871. if ( uiLanguageDirection === 'ltr' ) {
  77872. return lastChildRect.right > toolbarRect.right - this.cachedPadding;
  77873. } else {
  77874. return lastChildRect.left < toolbarRect.left + this.cachedPadding;
  77875. }
  77876. }
  77877. /**
  77878. * Enables the functionality that prevents {@link #ungroupedItems} from overflowing (wrapping to the next row)
  77879. * upon resize when there is little space available. Instead, the toolbar items are moved to the
  77880. * {@link #groupedItems} collection and displayed in a dropdown at the end of the row (which has its own nested toolbar).
  77881. *
  77882. * When called, the toolbar will automatically analyze the location of its {@link #ungroupedItems} and "group"
  77883. * them in the dropdown if necessary. It will also observe the browser window for size changes in
  77884. * the future and respond to them by grouping more items or reverting already grouped back, depending
  77885. * on the visual space available.
  77886. *
  77887. * @private
  77888. */
  77889. _enableGroupingOnResize() {
  77890. let previousWidth;
  77891. // TODO: Consider debounce.
  77892. this.resizeObserver = new _ckeditor_ckeditor5_utils_src_dom_resizeobserver__WEBPACK_IMPORTED_MODULE_5__["default"]( this.viewElement, entry => {
  77893. if ( !previousWidth || previousWidth !== entry.contentRect.width || this.shouldUpdateGroupingOnNextResize ) {
  77894. this.shouldUpdateGroupingOnNextResize = false;
  77895. this._updateGrouping();
  77896. previousWidth = entry.contentRect.width;
  77897. }
  77898. } );
  77899. this._updateGrouping();
  77900. }
  77901. /**
  77902. * Enables the grouping functionality, just like {@link #_enableGroupingOnResize} but the difference is that
  77903. * it listens to the changes of {@link module:ui/toolbar/toolbarview~ToolbarView#maxWidth} instead.
  77904. *
  77905. * @private
  77906. */
  77907. _enableGroupingOnMaxWidthChange( view ) {
  77908. view.on( 'change:maxWidth', () => {
  77909. this._updateGrouping();
  77910. } );
  77911. }
  77912. /**
  77913. * When called, it will remove the last item from {@link #ungroupedItems} and move it back
  77914. * to the {@link #groupedItems} collection.
  77915. *
  77916. * The opposite of {@link #_ungroupFirstItem}.
  77917. *
  77918. * @private
  77919. */
  77920. _groupLastItem() {
  77921. if ( !this.groupedItems.length ) {
  77922. this.viewChildren.add( new _toolbarseparatorview__WEBPACK_IMPORTED_MODULE_4__["default"]() );
  77923. this.viewChildren.add( this.groupedItemsDropdown );
  77924. this.viewFocusTracker.add( this.groupedItemsDropdown.element );
  77925. }
  77926. this.groupedItems.add( this.ungroupedItems.remove( this.ungroupedItems.last ), 0 );
  77927. }
  77928. /**
  77929. * Moves the very first item belonging to {@link #groupedItems} back
  77930. * to the {@link #ungroupedItems} collection.
  77931. *
  77932. * The opposite of {@link #_groupLastItem}.
  77933. *
  77934. * @private
  77935. */
  77936. _ungroupFirstItem() {
  77937. this.ungroupedItems.add( this.groupedItems.remove( this.groupedItems.first ) );
  77938. if ( !this.groupedItems.length ) {
  77939. this.viewChildren.remove( this.groupedItemsDropdown );
  77940. this.viewChildren.remove( this.viewChildren.last );
  77941. this.viewFocusTracker.remove( this.groupedItemsDropdown.element );
  77942. }
  77943. }
  77944. /**
  77945. * Creates the {@link #groupedItemsDropdown} that hosts the members of the {@link #groupedItems}
  77946. * collection when there is not enough space in the toolbar to display all items in a single row.
  77947. *
  77948. * @private
  77949. * @returns {module:ui/dropdown/dropdownview~DropdownView}
  77950. */
  77951. _createGroupedItemsDropdown() {
  77952. const locale = this.viewLocale;
  77953. const t = locale.t;
  77954. const dropdown = Object(_dropdown_utils__WEBPACK_IMPORTED_MODULE_9__["createDropdown"])( locale );
  77955. dropdown.class = 'ck-toolbar__grouped-dropdown';
  77956. // Make sure the dropdown never sticks out to the left/right. It should be under the main toolbar.
  77957. // (https://github.com/ckeditor/ckeditor5/issues/5608)
  77958. dropdown.panelPosition = locale.uiLanguageDirection === 'ltr' ? 'sw' : 'se';
  77959. Object(_dropdown_utils__WEBPACK_IMPORTED_MODULE_9__["addToolbarToDropdown"])( dropdown, [] );
  77960. dropdown.buttonView.set( {
  77961. label: t( 'Show more items' ),
  77962. tooltip: true,
  77963. icon: _ckeditor_ckeditor5_core_theme_icons_three_vertical_dots_svg__WEBPACK_IMPORTED_MODULE_11__["default"]
  77964. } );
  77965. // 1:1 pass–through binding.
  77966. dropdown.toolbarView.items.bindTo( this.groupedItems ).using( item => item );
  77967. return dropdown;
  77968. }
  77969. /**
  77970. * Updates the {@link module:ui/toolbar/toolbarview~ToolbarView#focusables focus–cycleable items}
  77971. * collection so it represents the up–to–date state of the UI from the perspective of the user.
  77972. *
  77973. * For instance, the {@link #groupedItemsDropdown} can show up and hide but when it is visible,
  77974. * it must be subject to focus cycling in the toolbar.
  77975. *
  77976. * See the {@link module:ui/toolbar/toolbarview~ToolbarView#focusables collection} documentation
  77977. * to learn more about the purpose of this method.
  77978. *
  77979. * @private
  77980. */
  77981. _updateFocusCycleableItems() {
  77982. this.viewFocusables.clear();
  77983. this.ungroupedItems.map( item => {
  77984. this.viewFocusables.add( item );
  77985. } );
  77986. if ( this.groupedItems.length ) {
  77987. this.viewFocusables.add( this.groupedItemsDropdown );
  77988. }
  77989. }
  77990. }
  77991. /**
  77992. * Options passed to the {@link module:ui/toolbar/toolbarview~ToolbarView#constructor} of the toolbar.
  77993. *
  77994. * @interface module:ui/toolbar/toolbarview~ToolbarOptions
  77995. */
  77996. /**
  77997. * When set to `true`, the toolbar will automatically group {@link module:ui/toolbar/toolbarview~ToolbarView#items} that
  77998. * would normally wrap to the next line when there is not enough space to display them in a single row, for
  77999. * instance, if the parent container of the toolbar is narrow.
  78000. *
  78001. * Also see: {@link module:ui/toolbar/toolbarview~ToolbarView#maxWidth}.
  78002. *
  78003. * @member {Boolean} module:ui/toolbar/toolbarview~ToolbarOptions#shouldGroupWhenFull
  78004. */
  78005. /**
  78006. * A class interface defining the behavior of the {@link module:ui/toolbar/toolbarview~ToolbarView}.
  78007. *
  78008. * Toolbar behaviors extend its look and functionality and have an impact on the
  78009. * {@link module:ui/toolbar/toolbarview~ToolbarView#element} template or
  78010. * {@link module:ui/toolbar/toolbarview~ToolbarView#render rendering}. They can be enabled
  78011. * conditionally, e.g. depending on the configuration of the toolbar.
  78012. *
  78013. * @private
  78014. * @interface module:ui/toolbar/toolbarview~ToolbarBehavior
  78015. */
  78016. /**
  78017. * Creates a new toolbar behavior instance.
  78018. *
  78019. * The instance is created in the {@link module:ui/toolbar/toolbarview~ToolbarView#constructor} of the toolbar.
  78020. * This is the right place to extend the {@link module:ui/toolbar/toolbarview~ToolbarView#template} of
  78021. * the toolbar, define extra toolbar properties, etc.
  78022. *
  78023. * @method #constructor
  78024. * @param {module:ui/toolbar/toolbarview~ToolbarView} view An instance of the toolbar that this behavior is added to.
  78025. */
  78026. /**
  78027. * A method called after the toolbar has been {@link module:ui/toolbar/toolbarview~ToolbarView#render rendered}.
  78028. * It can be used to, for example, customize the behavior of the toolbar when its {@link module:ui/toolbar/toolbarview~ToolbarView#element}
  78029. * is available.
  78030. *
  78031. * @readonly
  78032. * @member {Function} #render
  78033. * @param {module:ui/toolbar/toolbarview~ToolbarView} view An instance of the toolbar being rendered.
  78034. */
  78035. /**
  78036. * A method called after the toolbar has been {@link module:ui/toolbar/toolbarview~ToolbarView#destroy destroyed}.
  78037. * It allows cleaning up after the toolbar behavior, for instance, this is the right place to detach
  78038. * event listeners, free up references, etc.
  78039. *
  78040. * @readonly
  78041. * @member {Function} #destroy
  78042. */
  78043. /***/ }),
  78044. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/tooltip/tooltipview.js":
  78045. /*!************************************************************************!*\
  78046. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/tooltip/tooltipview.js ***!
  78047. \************************************************************************/
  78048. /*! exports provided: default */
  78049. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  78050. "use strict";
  78051. __webpack_require__.r(__webpack_exports__);
  78052. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return TooltipView; });
  78053. /* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  78054. /* harmony import */ var _theme_components_tooltip_tooltip_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../theme/components/tooltip/tooltip.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/tooltip.css");
  78055. /* harmony import */ var _theme_components_tooltip_tooltip_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_theme_components_tooltip_tooltip_css__WEBPACK_IMPORTED_MODULE_1__);
  78056. /**
  78057. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  78058. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  78059. */
  78060. /**
  78061. * @module ui/tooltip/tooltipview
  78062. */
  78063. /**
  78064. * The tooltip view class.
  78065. *
  78066. * @extends module:ui/view~View
  78067. */
  78068. class TooltipView extends _view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  78069. /**
  78070. * @inheritDoc
  78071. */
  78072. constructor( locale ) {
  78073. super( locale );
  78074. /**
  78075. * The text of the tooltip visible to the user.
  78076. *
  78077. * @observable
  78078. * @member {String} #text
  78079. */
  78080. this.set( 'text', '' );
  78081. /**
  78082. * The position of the tooltip (south, south-west, or north).
  78083. *
  78084. * +-----------+
  78085. * | north |
  78086. * +-----------+
  78087. * V
  78088. * [element]
  78089. *
  78090. * [element]
  78091. * ^
  78092. * +-----------+
  78093. * | south |
  78094. * +-----------+
  78095. *
  78096. * [element]
  78097. * ^
  78098. * +--------------+
  78099. * | south west |
  78100. * +--------------+
  78101. *
  78102. * @observable
  78103. * @default 's'
  78104. * @member {'s'|'sw'|'n'} #position
  78105. */
  78106. this.set( 'position', 's' );
  78107. const bind = this.bindTemplate;
  78108. this.setTemplate( {
  78109. tag: 'span',
  78110. attributes: {
  78111. class: [
  78112. 'ck',
  78113. 'ck-tooltip',
  78114. bind.to( 'position', position => 'ck-tooltip_' + position ),
  78115. bind.if( 'text', 'ck-hidden', value => !value.trim() )
  78116. ]
  78117. },
  78118. children: [
  78119. {
  78120. tag: 'span',
  78121. attributes: {
  78122. class: [
  78123. 'ck',
  78124. 'ck-tooltip__text'
  78125. ]
  78126. },
  78127. children: [
  78128. {
  78129. text: bind.to( 'text' )
  78130. }
  78131. ]
  78132. }
  78133. ]
  78134. } );
  78135. }
  78136. }
  78137. /***/ }),
  78138. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js":
  78139. /*!*********************************************************!*\
  78140. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/view.js ***!
  78141. \*********************************************************/
  78142. /*! exports provided: default */
  78143. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  78144. "use strict";
  78145. __webpack_require__.r(__webpack_exports__);
  78146. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return View; });
  78147. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  78148. /* harmony import */ var _viewcollection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./viewcollection */ "./node_modules/@ckeditor/ckeditor5-ui/src/viewcollection.js");
  78149. /* harmony import */ var _template__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./template */ "./node_modules/@ckeditor/ckeditor5-ui/src/template.js");
  78150. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_emittermixin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js");
  78151. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  78152. /* harmony import */ var _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/collection */ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js");
  78153. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  78154. /* harmony import */ var _ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
  78155. /* harmony import */ var _theme_globals_globals_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../theme/globals/globals.css */ "./node_modules/@ckeditor/ckeditor5-ui/theme/globals/globals.css");
  78156. /* harmony import */ var _theme_globals_globals_css__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_theme_globals_globals_css__WEBPACK_IMPORTED_MODULE_8__);
  78157. /**
  78158. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  78159. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  78160. */
  78161. /**
  78162. * @module ui/view
  78163. */
  78164. /**
  78165. * The basic view class, which represents an HTML element created out of a
  78166. * {@link module:ui/view~View#template}. Views are building blocks of the user interface and handle
  78167. * interaction
  78168. *
  78169. * Views {@link module:ui/view~View#registerChild aggregate} children in
  78170. * {@link module:ui/view~View#createCollection collections} and manage the life cycle of DOM
  78171. * listeners e.g. by handling rendering and destruction.
  78172. *
  78173. * See the {@link module:ui/template~TemplateDefinition} syntax to learn more about shaping view
  78174. * elements, attributes and listeners.
  78175. *
  78176. * class SampleView extends View {
  78177. * constructor( locale ) {
  78178. * super( locale );
  78179. *
  78180. * const bind = this.bindTemplate;
  78181. *
  78182. * // Views define their interface (state) using observable attributes.
  78183. * this.set( 'elementClass', 'bar' );
  78184. *
  78185. * this.setTemplate( {
  78186. * tag: 'p',
  78187. *
  78188. * // The element of the view can be defined with its children.
  78189. * children: [
  78190. * 'Hello',
  78191. * {
  78192. * tag: 'b',
  78193. * children: [ 'world!' ]
  78194. * }
  78195. * ],
  78196. * attributes: {
  78197. * class: [
  78198. * 'foo',
  78199. *
  78200. * // Observable attributes control the state of the view in DOM.
  78201. * bind.to( 'elementClass' )
  78202. * ]
  78203. * },
  78204. * on: {
  78205. * // Views listen to DOM events and propagate them.
  78206. * click: bind.to( 'clicked' )
  78207. * }
  78208. * } );
  78209. * }
  78210. * }
  78211. *
  78212. * const view = new SampleView( locale );
  78213. *
  78214. * view.render();
  78215. *
  78216. * // Append <p class="foo bar">Hello<b>world</b></p> to the <body>
  78217. * document.body.appendChild( view.element );
  78218. *
  78219. * // Change the class attribute to <p class="foo baz">Hello<b>world</b></p>
  78220. * view.elementClass = 'baz';
  78221. *
  78222. * // Respond to the "click" event in DOM by executing a custom action.
  78223. * view.on( 'clicked', () => {
  78224. * console.log( 'The view has been clicked!' );
  78225. * } );
  78226. *
  78227. * @mixes module:utils/observablemixin~ObservableMixin
  78228. */
  78229. class View {
  78230. /**
  78231. * Creates an instance of the {@link module:ui/view~View} class.
  78232. *
  78233. * Also see {@link #render}.
  78234. *
  78235. * @param {module:utils/locale~Locale} [locale] The localization services instance.
  78236. */
  78237. constructor( locale ) {
  78238. /**
  78239. * An HTML element of the view. `null` until {@link #render rendered}
  78240. * from the {@link #template}.
  78241. *
  78242. * class SampleView extends View {
  78243. * constructor() {
  78244. * super();
  78245. *
  78246. * // A template instance the #element will be created from.
  78247. * this.setTemplate( {
  78248. * tag: 'p'
  78249. *
  78250. * // ...
  78251. * } );
  78252. * }
  78253. * }
  78254. *
  78255. * const view = new SampleView();
  78256. *
  78257. * // Renders the #template.
  78258. * view.render();
  78259. *
  78260. * // Append the HTML element of the view to <body>.
  78261. * document.body.appendChild( view.element );
  78262. *
  78263. * **Note**: The element of the view can also be assigned directly:
  78264. *
  78265. * view.element = document.querySelector( '#my-container' );
  78266. *
  78267. * @member {HTMLElement}
  78268. */
  78269. this.element = null;
  78270. /**
  78271. * Set `true` when the view has already been {@link module:ui/view~View#render rendered}.
  78272. *
  78273. * @readonly
  78274. * @member {Boolean} #isRendered
  78275. */
  78276. this.isRendered = false;
  78277. /**
  78278. * A set of tools to localize the user interface.
  78279. *
  78280. * Also see {@link module:core/editor/editor~Editor#locale}.
  78281. *
  78282. * @readonly
  78283. * @member {module:utils/locale~Locale}
  78284. */
  78285. this.locale = locale;
  78286. /**
  78287. * Shorthand for {@link module:utils/locale~Locale#t}.
  78288. *
  78289. * Note: If {@link #locale} instance hasn't been passed to the view this method may not
  78290. * be available.
  78291. *
  78292. * @see module:utils/locale~Locale#t
  78293. * @method
  78294. */
  78295. this.t = locale && locale.t;
  78296. /**
  78297. * Collections registered with {@link #createCollection}.
  78298. *
  78299. * @protected
  78300. * @member {Set.<module:ui/viewcollection~ViewCollection>}
  78301. */
  78302. this._viewCollections = new _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_5__["default"]();
  78303. /**
  78304. * A collection of view instances, which have been added directly
  78305. * into the {@link module:ui/template~Template#children}.
  78306. *
  78307. * @protected
  78308. * @member {module:ui/viewcollection~ViewCollection}
  78309. */
  78310. this._unboundChildren = this.createCollection();
  78311. // Pass parent locale to its children.
  78312. this._viewCollections.on( 'add', ( evt, collection ) => {
  78313. collection.locale = locale;
  78314. } );
  78315. /**
  78316. * Template of this view. It provides the {@link #element} representing
  78317. * the view in DOM, which is {@link #render rendered}.
  78318. *
  78319. * @member {module:ui/template~Template} #template
  78320. */
  78321. /**
  78322. * Cached {@link module:ui/template~BindChain bind chain} object created by the
  78323. * {@link #template}. See {@link #bindTemplate}.
  78324. *
  78325. * @private
  78326. * @member {Object} #_bindTemplate
  78327. */
  78328. this.decorate( 'render' );
  78329. }
  78330. /**
  78331. * Shorthand for {@link module:ui/template~Template.bind}, a binding
  78332. * {@link module:ui/template~BindChain interface} pre–configured for the view instance.
  78333. *
  78334. * It provides {@link module:ui/template~BindChain#to `to()`} and
  78335. * {@link module:ui/template~BindChain#if `if()`} methods that initialize bindings with
  78336. * observable attributes and attach DOM listeners.
  78337. *
  78338. * class SampleView extends View {
  78339. * constructor( locale ) {
  78340. * super( locale );
  78341. *
  78342. * const bind = this.bindTemplate;
  78343. *
  78344. * // These {@link module:utils/observablemixin~Observable observable} attributes will control
  78345. * // the state of the view in DOM.
  78346. * this.set( {
  78347. * elementClass: 'foo',
  78348. * isEnabled: true
  78349. * } );
  78350. *
  78351. * this.setTemplate( {
  78352. * tag: 'p',
  78353. *
  78354. * attributes: {
  78355. * // The class HTML attribute will follow elementClass
  78356. * // and isEnabled view attributes.
  78357. * class: [
  78358. * bind.to( 'elementClass' )
  78359. * bind.if( 'isEnabled', 'present-when-enabled' )
  78360. * ]
  78361. * },
  78362. *
  78363. * on: {
  78364. * // The view will fire the "clicked" event upon clicking <p> in DOM.
  78365. * click: bind.to( 'clicked' )
  78366. * }
  78367. * } );
  78368. * }
  78369. * }
  78370. *
  78371. * @method #bindTemplate
  78372. */
  78373. get bindTemplate() {
  78374. if ( this._bindTemplate ) {
  78375. return this._bindTemplate;
  78376. }
  78377. return ( this._bindTemplate = _template__WEBPACK_IMPORTED_MODULE_2__["default"].bind( this, this ) );
  78378. }
  78379. /**
  78380. * Creates a new collection of views, which can be used as
  78381. * {@link module:ui/template~Template#children} of this view.
  78382. *
  78383. * class SampleView extends View {
  78384. * constructor( locale ) {
  78385. * super( locale );
  78386. *
  78387. * const child = new ChildView( locale );
  78388. * this.items = this.createCollection( [ child ] );
  78389. *
  78390. * this.setTemplate( {
  78391. * tag: 'p',
  78392. *
  78393. * // `items` collection will render here.
  78394. * children: this.items
  78395. * } );
  78396. * }
  78397. * }
  78398. *
  78399. * const view = new SampleView( locale );
  78400. * view.render();
  78401. *
  78402. * // It will append <p><child#element></p> to the <body>.
  78403. * document.body.appendChild( view.element );
  78404. *
  78405. * @param {Iterable.<module:ui/view~View>} [views] Initial views of the collection.
  78406. * @returns {module:ui/viewcollection~ViewCollection} A new collection of view instances.
  78407. */
  78408. createCollection( views ) {
  78409. const collection = new _viewcollection__WEBPACK_IMPORTED_MODULE_1__["default"]( views );
  78410. this._viewCollections.add( collection );
  78411. return collection;
  78412. }
  78413. /**
  78414. * Registers a new child view under the view instance. Once registered, a child
  78415. * view is managed by its parent, including {@link #render rendering}
  78416. * and {@link #destroy destruction}.
  78417. *
  78418. * To revert this, use {@link #deregisterChild}.
  78419. *
  78420. * class SampleView extends View {
  78421. * constructor( locale ) {
  78422. * super( locale );
  78423. *
  78424. * this.childA = new SomeChildView( locale );
  78425. * this.childB = new SomeChildView( locale );
  78426. *
  78427. * this.setTemplate( { tag: 'p' } );
  78428. *
  78429. * // Register the children.
  78430. * this.registerChild( [ this.childA, this.childB ] );
  78431. * }
  78432. *
  78433. * render() {
  78434. * super.render();
  78435. *
  78436. * this.element.appendChild( this.childA.element );
  78437. * this.element.appendChild( this.childB.element );
  78438. * }
  78439. * }
  78440. *
  78441. * const view = new SampleView( locale );
  78442. *
  78443. * view.render();
  78444. *
  78445. * // Will append <p><childA#element><b></b><childB#element></p>.
  78446. * document.body.appendChild( view.element );
  78447. *
  78448. * **Note**: There's no need to add child views if they're already referenced in the
  78449. * {@link #template}:
  78450. *
  78451. * class SampleView extends View {
  78452. * constructor( locale ) {
  78453. * super( locale );
  78454. *
  78455. * this.childA = new SomeChildView( locale );
  78456. * this.childB = new SomeChildView( locale );
  78457. *
  78458. * this.setTemplate( {
  78459. * tag: 'p',
  78460. *
  78461. * // These children will be added automatically. There's no
  78462. * // need to call {@link #registerChild} for any of them.
  78463. * children: [ this.childA, this.childB ]
  78464. * } );
  78465. * }
  78466. *
  78467. * // ...
  78468. * }
  78469. *
  78470. * @param {module:ui/view~View|Iterable.<module:ui/view~View>} children Children views to be registered.
  78471. */
  78472. registerChild( children ) {
  78473. if ( !Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_7__["default"])( children ) ) {
  78474. children = [ children ];
  78475. }
  78476. for ( const child of children ) {
  78477. this._unboundChildren.add( child );
  78478. }
  78479. }
  78480. /**
  78481. * The opposite of {@link #registerChild}. Removes a child view from this view instance.
  78482. * Once removed, the child is no longer managed by its parent, e.g. it can safely
  78483. * become a child of another parent view.
  78484. *
  78485. * @see #registerChild
  78486. * @param {module:ui/view~View|Iterable.<module:ui/view~View>} children Child views to be removed.
  78487. */
  78488. deregisterChild( children ) {
  78489. if ( !Object(_ckeditor_ckeditor5_utils_src_isiterable__WEBPACK_IMPORTED_MODULE_7__["default"])( children ) ) {
  78490. children = [ children ];
  78491. }
  78492. for ( const child of children ) {
  78493. this._unboundChildren.remove( child );
  78494. }
  78495. }
  78496. /**
  78497. * Sets the {@link #template} of the view with with given definition.
  78498. *
  78499. * A shorthand for:
  78500. *
  78501. * view.setTemplate( definition );
  78502. *
  78503. * @param {module:ui/template~TemplateDefinition} definition Definition of view's template.
  78504. */
  78505. setTemplate( definition ) {
  78506. this.template = new _template__WEBPACK_IMPORTED_MODULE_2__["default"]( definition );
  78507. }
  78508. /**
  78509. * {@link module:ui/template~Template.extend Extends} the {@link #template} of the view with
  78510. * with given definition.
  78511. *
  78512. * A shorthand for:
  78513. *
  78514. * Template.extend( view.template, definition );
  78515. *
  78516. * **Note**: Is requires the {@link #template} to be already set. See {@link #setTemplate}.
  78517. *
  78518. * @param {module:ui/template~TemplateDefinition} definition Definition which
  78519. * extends the {@link #template}.
  78520. */
  78521. extendTemplate( definition ) {
  78522. _template__WEBPACK_IMPORTED_MODULE_2__["default"].extend( this.template, definition );
  78523. }
  78524. /**
  78525. * Recursively renders the view.
  78526. *
  78527. * Once the view is rendered:
  78528. * * the {@link #element} becomes an HTML element out of {@link #template},
  78529. * * the {@link #isRendered} flag is set `true`.
  78530. *
  78531. * **Note**: The children of the view:
  78532. * * defined directly in the {@link #template}
  78533. * * residing in collections created by the {@link #createCollection} method,
  78534. * * and added by {@link #registerChild}
  78535. * are also rendered in the process.
  78536. *
  78537. * In general, `render()` method is the right place to keep the code which refers to the
  78538. * {@link #element} and should be executed at the very beginning of the view's life cycle.
  78539. *
  78540. * It is possible to {@link module:ui/template~Template.extend} the {@link #template} before
  78541. * the view is rendered. To allow an early customization of the view (e.g. by its parent),
  78542. * such references should be done in `render()`.
  78543. *
  78544. * class SampleView extends View {
  78545. * constructor() {
  78546. * this.setTemplate( {
  78547. * // ...
  78548. * } );
  78549. * },
  78550. *
  78551. * render() {
  78552. * // View#element becomes available.
  78553. * super.render();
  78554. *
  78555. * // The "scroll" listener depends on #element.
  78556. * this.listenTo( window, 'scroll', () => {
  78557. * // A reference to #element would render the #template and make it non-extendable.
  78558. * if ( window.scrollY > 0 ) {
  78559. * this.element.scrollLeft = 100;
  78560. * } else {
  78561. * this.element.scrollLeft = 0;
  78562. * }
  78563. * } );
  78564. * }
  78565. * }
  78566. *
  78567. * const view = new SampleView();
  78568. *
  78569. * // Let's customize the view before it gets rendered.
  78570. * view.extendTemplate( {
  78571. * attributes: {
  78572. * class: [
  78573. * 'additional-class'
  78574. * ]
  78575. * }
  78576. * } );
  78577. *
  78578. * // Late rendering allows customization of the view.
  78579. * view.render();
  78580. */
  78581. render() {
  78582. if ( this.isRendered ) {
  78583. /**
  78584. * This View has already been rendered.
  78585. *
  78586. * @error ui-view-render-already-rendered
  78587. */
  78588. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'ui-view-render-already-rendered', this );
  78589. }
  78590. // Render #element of the view.
  78591. if ( this.template ) {
  78592. this.element = this.template.render();
  78593. // Auto–register view children from #template.
  78594. this.registerChild( this.template.getViews() );
  78595. }
  78596. this.isRendered = true;
  78597. }
  78598. /**
  78599. * Recursively destroys the view instance and child views added by {@link #registerChild} and
  78600. * residing in collections created by the {@link #createCollection}.
  78601. *
  78602. * Destruction disables all event listeners:
  78603. * * created on the view, e.g. `view.on( 'event', () => {} )`,
  78604. * * defined in the {@link #template} for DOM events.
  78605. */
  78606. destroy() {
  78607. this.stopListening();
  78608. this._viewCollections.map( c => c.destroy() );
  78609. // Template isn't obligatory for views.
  78610. if ( this.template && this.template._revertData ) {
  78611. this.template.revert( this.element );
  78612. }
  78613. }
  78614. /**
  78615. * Event fired by the {@link #render} method. Actual rendering is executed as a listener to
  78616. * this event with the default priority.
  78617. *
  78618. * See {@link module:utils/observablemixin~ObservableMixin#decorate} for more information and samples.
  78619. *
  78620. * @event render
  78621. */
  78622. }
  78623. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__["default"])( View, _ckeditor_ckeditor5_utils_src_dom_emittermixin__WEBPACK_IMPORTED_MODULE_3__["default"] );
  78624. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__["default"])( View, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_4__["default"] );
  78625. /***/ }),
  78626. /***/ "./node_modules/@ckeditor/ckeditor5-ui/src/viewcollection.js":
  78627. /*!*******************************************************************!*\
  78628. !*** ./node_modules/@ckeditor/ckeditor5-ui/src/viewcollection.js ***!
  78629. \*******************************************************************/
  78630. /*! exports provided: default */
  78631. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  78632. "use strict";
  78633. __webpack_require__.r(__webpack_exports__);
  78634. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ViewCollection; });
  78635. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  78636. /* harmony import */ var _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/collection */ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js");
  78637. /**
  78638. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  78639. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  78640. */
  78641. /**
  78642. * @module ui/viewcollection
  78643. */
  78644. /**
  78645. * Collects {@link module:ui/view~View} instances.
  78646. *
  78647. * const parentView = new ParentView( locale );
  78648. * const collection = new ViewCollection( locale );
  78649. *
  78650. * collection.setParent( parentView.element );
  78651. *
  78652. * const viewA = new ChildView( locale );
  78653. * const viewB = new ChildView( locale );
  78654. *
  78655. * View collection renders and manages view {@link module:ui/view~View#element elements}:
  78656. *
  78657. * collection.add( viewA );
  78658. * collection.add( viewB );
  78659. *
  78660. * console.log( parentView.element.firsChild ); // -> viewA.element
  78661. * console.log( parentView.element.lastChild ); // -> viewB.element
  78662. *
  78663. * It {@link module:ui/viewcollection~ViewCollection#delegate propagates} DOM events too:
  78664. *
  78665. * // Delegate #click and #keydown events from viewA and viewB to the parentView.
  78666. * collection.delegate( 'click' ).to( parentView );
  78667. *
  78668. * parentView.on( 'click', ( evt ) => {
  78669. * console.log( `${ evt.source } has been clicked.` );
  78670. * } );
  78671. *
  78672. * // This event will be delegated to the parentView.
  78673. * viewB.fire( 'click' );
  78674. *
  78675. * **Note**: A view collection can be used directly in the {@link module:ui/template~TemplateDefinition definition}
  78676. * of a {@link module:ui/template~Template template}.
  78677. *
  78678. * @extends module:utils/collection~Collection
  78679. * @mixes module:utils/observablemixin~ObservableMixin
  78680. */
  78681. class ViewCollection extends _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_1__["default"] {
  78682. /**
  78683. * Creates a new instance of the {@link module:ui/viewcollection~ViewCollection}.
  78684. *
  78685. * @param {Iterable.<module:ui/view~View>} [initialItems] The initial items of the collection.
  78686. */
  78687. constructor( initialItems = [] ) {
  78688. super( initialItems, {
  78689. // An #id Number attribute should be legal and not break the `ViewCollection` instance.
  78690. // https://github.com/ckeditor/ckeditor5-ui/issues/93
  78691. idProperty: 'viewUid'
  78692. } );
  78693. // Handle {@link module:ui/view~View#element} in DOM when a new view is added to the collection.
  78694. this.on( 'add', ( evt, view, index ) => {
  78695. this._renderViewIntoCollectionParent( view, index );
  78696. } );
  78697. // Handle {@link module:ui/view~View#element} in DOM when a view is removed from the collection.
  78698. this.on( 'remove', ( evt, view ) => {
  78699. if ( view.element && this._parentElement ) {
  78700. view.element.remove();
  78701. }
  78702. } );
  78703. /**
  78704. * A parent element within which child views are rendered and managed in DOM.
  78705. *
  78706. * @protected
  78707. * @member {HTMLElement}
  78708. */
  78709. this._parentElement = null;
  78710. }
  78711. /**
  78712. * Destroys the view collection along with child views.
  78713. * See the view {@link module:ui/view~View#destroy} method.
  78714. */
  78715. destroy() {
  78716. this.map( view => view.destroy() );
  78717. }
  78718. /**
  78719. * Sets the parent HTML element of this collection. When parent is set, {@link #add adding} and
  78720. * {@link #remove removing} views in the collection synchronizes their
  78721. * {@link module:ui/view~View#element elements} in the parent element.
  78722. *
  78723. * @param {HTMLElement} element A new parent element.
  78724. */
  78725. setParent( elementOrDocFragment ) {
  78726. this._parentElement = elementOrDocFragment;
  78727. // Take care of the initial collection items passed to the constructor.
  78728. for ( const view of this ) {
  78729. this._renderViewIntoCollectionParent( view );
  78730. }
  78731. }
  78732. /**
  78733. * Delegates selected events coming from within views in the collection to any
  78734. * {@link module:utils/emittermixin~Emitter}.
  78735. *
  78736. * For the following views and collection:
  78737. *
  78738. * const viewA = new View();
  78739. * const viewB = new View();
  78740. * const viewC = new View();
  78741. *
  78742. * const views = parentView.createCollection();
  78743. *
  78744. * views.delegate( 'eventX' ).to( viewB );
  78745. * views.delegate( 'eventX', 'eventY' ).to( viewC );
  78746. *
  78747. * views.add( viewA );
  78748. *
  78749. * the `eventX` is delegated (fired by) `viewB` and `viewC` along with `customData`:
  78750. *
  78751. * viewA.fire( 'eventX', customData );
  78752. *
  78753. * and `eventY` is delegated (fired by) `viewC` along with `customData`:
  78754. *
  78755. * viewA.fire( 'eventY', customData );
  78756. *
  78757. * See {@link module:utils/emittermixin~Emitter#delegate}.
  78758. *
  78759. * @param {...String} events {@link module:ui/view~View} event names to be delegated to another
  78760. * {@link module:utils/emittermixin~Emitter}.
  78761. * @returns {Object}
  78762. * @returns {Function} return.to A function which accepts the destination of
  78763. * {@link module:utils/emittermixin~Emitter#delegate delegated} events.
  78764. */
  78765. delegate( ...events ) {
  78766. if ( !events.length || !isStringArray( events ) ) {
  78767. /**
  78768. * All event names must be strings.
  78769. *
  78770. * @error ui-viewcollection-delegate-wrong-events
  78771. */
  78772. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  78773. 'ui-viewcollection-delegate-wrong-events',
  78774. this
  78775. );
  78776. }
  78777. return {
  78778. /**
  78779. * Selects destination for {@link module:utils/emittermixin~Emitter#delegate} events.
  78780. *
  78781. * @memberOf module:ui/viewcollection~ViewCollection#delegate
  78782. * @function module:ui/viewcollection~ViewCollection#delegate.to
  78783. * @param {module:utils/emittermixin~Emitter} dest An `Emitter` instance which is
  78784. * the destination for delegated events.
  78785. */
  78786. to: dest => {
  78787. // Activate delegating on existing views in this collection.
  78788. for ( const view of this ) {
  78789. for ( const evtName of events ) {
  78790. view.delegate( evtName ).to( dest );
  78791. }
  78792. }
  78793. // Activate delegating on future views in this collection.
  78794. this.on( 'add', ( evt, view ) => {
  78795. for ( const evtName of events ) {
  78796. view.delegate( evtName ).to( dest );
  78797. }
  78798. } );
  78799. // Deactivate delegating when view is removed from this collection.
  78800. this.on( 'remove', ( evt, view ) => {
  78801. for ( const evtName of events ) {
  78802. view.stopDelegating( evtName, dest );
  78803. }
  78804. } );
  78805. }
  78806. };
  78807. }
  78808. /**
  78809. * This method {@link module:ui/view~View#render renders} a new view added to the collection.
  78810. *
  78811. * If the {@link #_parentElement parent element} of the collection is set, this method also adds
  78812. * the view's {@link module:ui/view~View#element} as a child of the parent in DOM at a specified index.
  78813. *
  78814. * **Note**: If index is not specified, the view's element is pushed as the last child
  78815. * of the parent element.
  78816. *
  78817. * @private
  78818. * @param {module:ui/view~View} view A new view added to the collection.
  78819. * @param {Number} [index] An index the view holds in the collection. When not specified,
  78820. * the view is added at the end.
  78821. */
  78822. _renderViewIntoCollectionParent( view, index ) {
  78823. if ( !view.isRendered ) {
  78824. view.render();
  78825. }
  78826. if ( view.element && this._parentElement ) {
  78827. this._parentElement.insertBefore( view.element, this._parentElement.children[ index ] );
  78828. }
  78829. }
  78830. /**
  78831. * Removes a child view from the collection. If the {@link #setParent parent element} of the
  78832. * collection has been set, the {@link module:ui/view~View#element element} of the view is also removed
  78833. * in DOM, reflecting the order of the collection.
  78834. *
  78835. * See the {@link #add} method.
  78836. *
  78837. * @method #remove
  78838. * @param {module:ui/view~View|Number|String} subject The view to remove, its id or index in the collection.
  78839. * @returns {Object} The removed view.
  78840. */
  78841. }
  78842. // Check if all entries of the array are of `String` type.
  78843. //
  78844. // @private
  78845. // @param {Array} arr An array to be checked.
  78846. // @returns {Boolean}
  78847. function isStringArray( arr ) {
  78848. return arr.every( a => typeof a == 'string' );
  78849. }
  78850. /***/ }),
  78851. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/button.css":
  78852. /*!********************************************************************************!*\
  78853. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/button.css ***!
  78854. \********************************************************************************/
  78855. /*! no static exports found */
  78856. /***/ (function(module, exports, __webpack_require__) {
  78857. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  78858. var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./button.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/button.css");
  78859. content = content.__esModule ? content.default : content;
  78860. if (typeof content === 'string') {
  78861. content = [[module.i, content, '']];
  78862. }
  78863. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  78864. options.insert = "head";
  78865. options.singleton = true;
  78866. var update = api(content, options);
  78867. module.exports = content.locals || {};
  78868. /***/ }),
  78869. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/switchbutton.css":
  78870. /*!**************************************************************************************!*\
  78871. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/switchbutton.css ***!
  78872. \**************************************************************************************/
  78873. /*! no static exports found */
  78874. /***/ (function(module, exports, __webpack_require__) {
  78875. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  78876. var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./switchbutton.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/switchbutton.css");
  78877. content = content.__esModule ? content.default : content;
  78878. if (typeof content === 'string') {
  78879. content = [[module.i, content, '']];
  78880. }
  78881. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  78882. options.insert = "head";
  78883. options.singleton = true;
  78884. var update = api(content, options);
  78885. module.exports = content.locals || {};
  78886. /***/ }),
  78887. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorgrid/colorgrid.css":
  78888. /*!**************************************************************************************!*\
  78889. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorgrid/colorgrid.css ***!
  78890. \**************************************************************************************/
  78891. /*! no static exports found */
  78892. /***/ (function(module, exports, __webpack_require__) {
  78893. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  78894. var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./colorgrid.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorgrid/colorgrid.css");
  78895. content = content.__esModule ? content.default : content;
  78896. if (typeof content === 'string') {
  78897. content = [[module.i, content, '']];
  78898. }
  78899. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  78900. options.insert = "head";
  78901. options.singleton = true;
  78902. var update = api(content, options);
  78903. module.exports = content.locals || {};
  78904. /***/ }),
  78905. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/dropdown.css":
  78906. /*!************************************************************************************!*\
  78907. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/dropdown.css ***!
  78908. \************************************************************************************/
  78909. /*! no static exports found */
  78910. /***/ (function(module, exports, __webpack_require__) {
  78911. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  78912. var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./dropdown.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/dropdown.css");
  78913. content = content.__esModule ? content.default : content;
  78914. if (typeof content === 'string') {
  78915. content = [[module.i, content, '']];
  78916. }
  78917. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  78918. options.insert = "head";
  78919. options.singleton = true;
  78920. var update = api(content, options);
  78921. module.exports = content.locals || {};
  78922. /***/ }),
  78923. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/listdropdown.css":
  78924. /*!****************************************************************************************!*\
  78925. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/listdropdown.css ***!
  78926. \****************************************************************************************/
  78927. /*! no static exports found */
  78928. /***/ (function(module, exports, __webpack_require__) {
  78929. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  78930. var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./listdropdown.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/listdropdown.css");
  78931. content = content.__esModule ? content.default : content;
  78932. if (typeof content === 'string') {
  78933. content = [[module.i, content, '']];
  78934. }
  78935. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  78936. options.insert = "head";
  78937. options.singleton = true;
  78938. var update = api(content, options);
  78939. module.exports = content.locals || {};
  78940. /***/ }),
  78941. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/splitbutton.css":
  78942. /*!***************************************************************************************!*\
  78943. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/splitbutton.css ***!
  78944. \***************************************************************************************/
  78945. /*! no static exports found */
  78946. /***/ (function(module, exports, __webpack_require__) {
  78947. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  78948. var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./splitbutton.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/splitbutton.css");
  78949. content = content.__esModule ? content.default : content;
  78950. if (typeof content === 'string') {
  78951. content = [[module.i, content, '']];
  78952. }
  78953. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  78954. options.insert = "head";
  78955. options.singleton = true;
  78956. var update = api(content, options);
  78957. module.exports = content.locals || {};
  78958. /***/ }),
  78959. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css":
  78960. /*!*******************************************************************************************!*\
  78961. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css ***!
  78962. \*******************************************************************************************/
  78963. /*! no static exports found */
  78964. /***/ (function(module, exports, __webpack_require__) {
  78965. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  78966. var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./toolbardropdown.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css");
  78967. content = content.__esModule ? content.default : content;
  78968. if (typeof content === 'string') {
  78969. content = [[module.i, content, '']];
  78970. }
  78971. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  78972. options.insert = "head";
  78973. options.singleton = true;
  78974. var update = api(content, options);
  78975. module.exports = content.locals || {};
  78976. /***/ }),
  78977. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/editorui/editorui.css":
  78978. /*!************************************************************************************!*\
  78979. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/editorui/editorui.css ***!
  78980. \************************************************************************************/
  78981. /*! no static exports found */
  78982. /***/ (function(module, exports, __webpack_require__) {
  78983. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  78984. var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./editorui.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/editorui/editorui.css");
  78985. content = content.__esModule ? content.default : content;
  78986. if (typeof content === 'string') {
  78987. content = [[module.i, content, '']];
  78988. }
  78989. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  78990. options.insert = "head";
  78991. options.singleton = true;
  78992. var update = api(content, options);
  78993. module.exports = content.locals || {};
  78994. /***/ }),
  78995. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/icon/icon.css":
  78996. /*!****************************************************************************!*\
  78997. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/icon/icon.css ***!
  78998. \****************************************************************************/
  78999. /*! no static exports found */
  79000. /***/ (function(module, exports, __webpack_require__) {
  79001. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  79002. var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./icon.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/icon/icon.css");
  79003. content = content.__esModule ? content.default : content;
  79004. if (typeof content === 'string') {
  79005. content = [[module.i, content, '']];
  79006. }
  79007. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  79008. options.insert = "head";
  79009. options.singleton = true;
  79010. var update = api(content, options);
  79011. module.exports = content.locals || {};
  79012. /***/ }),
  79013. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/inputtext/inputtext.css":
  79014. /*!**************************************************************************************!*\
  79015. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/inputtext/inputtext.css ***!
  79016. \**************************************************************************************/
  79017. /*! no static exports found */
  79018. /***/ (function(module, exports, __webpack_require__) {
  79019. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  79020. var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./inputtext.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/inputtext/inputtext.css");
  79021. content = content.__esModule ? content.default : content;
  79022. if (typeof content === 'string') {
  79023. content = [[module.i, content, '']];
  79024. }
  79025. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  79026. options.insert = "head";
  79027. options.singleton = true;
  79028. var update = api(content, options);
  79029. module.exports = content.locals || {};
  79030. /***/ }),
  79031. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/label/label.css":
  79032. /*!******************************************************************************!*\
  79033. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/label/label.css ***!
  79034. \******************************************************************************/
  79035. /*! no static exports found */
  79036. /***/ (function(module, exports, __webpack_require__) {
  79037. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  79038. var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./label.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/label/label.css");
  79039. content = content.__esModule ? content.default : content;
  79040. if (typeof content === 'string') {
  79041. content = [[module.i, content, '']];
  79042. }
  79043. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  79044. options.insert = "head";
  79045. options.singleton = true;
  79046. var update = api(content, options);
  79047. module.exports = content.locals || {};
  79048. /***/ }),
  79049. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css":
  79050. /*!************************************************************************************************!*\
  79051. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css ***!
  79052. \************************************************************************************************/
  79053. /*! no static exports found */
  79054. /***/ (function(module, exports, __webpack_require__) {
  79055. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  79056. var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./labeledfieldview.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css");
  79057. content = content.__esModule ? content.default : content;
  79058. if (typeof content === 'string') {
  79059. content = [[module.i, content, '']];
  79060. }
  79061. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  79062. options.insert = "head";
  79063. options.singleton = true;
  79064. var update = api(content, options);
  79065. module.exports = content.locals || {};
  79066. /***/ }),
  79067. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/list/list.css":
  79068. /*!****************************************************************************!*\
  79069. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/list/list.css ***!
  79070. \****************************************************************************/
  79071. /*! no static exports found */
  79072. /***/ (function(module, exports, __webpack_require__) {
  79073. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  79074. var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./list.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/list/list.css");
  79075. content = content.__esModule ? content.default : content;
  79076. if (typeof content === 'string') {
  79077. content = [[module.i, content, '']];
  79078. }
  79079. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  79080. options.insert = "head";
  79081. options.singleton = true;
  79082. var update = api(content, options);
  79083. module.exports = content.locals || {};
  79084. /***/ }),
  79085. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonpanel.css":
  79086. /*!*************************************************************************************!*\
  79087. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonpanel.css ***!
  79088. \*************************************************************************************/
  79089. /*! no static exports found */
  79090. /***/ (function(module, exports, __webpack_require__) {
  79091. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  79092. var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./balloonpanel.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonpanel.css");
  79093. content = content.__esModule ? content.default : content;
  79094. if (typeof content === 'string') {
  79095. content = [[module.i, content, '']];
  79096. }
  79097. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  79098. options.insert = "head";
  79099. options.singleton = true;
  79100. var update = api(content, options);
  79101. module.exports = content.locals || {};
  79102. /***/ }),
  79103. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonrotator.css":
  79104. /*!***************************************************************************************!*\
  79105. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonrotator.css ***!
  79106. \***************************************************************************************/
  79107. /*! no static exports found */
  79108. /***/ (function(module, exports, __webpack_require__) {
  79109. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  79110. var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./balloonrotator.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonrotator.css");
  79111. content = content.__esModule ? content.default : content;
  79112. if (typeof content === 'string') {
  79113. content = [[module.i, content, '']];
  79114. }
  79115. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  79116. options.insert = "head";
  79117. options.singleton = true;
  79118. var update = api(content, options);
  79119. module.exports = content.locals || {};
  79120. /***/ }),
  79121. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/fakepanel.css":
  79122. /*!**********************************************************************************!*\
  79123. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/fakepanel.css ***!
  79124. \**********************************************************************************/
  79125. /*! no static exports found */
  79126. /***/ (function(module, exports, __webpack_require__) {
  79127. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  79128. var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./fakepanel.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/fakepanel.css");
  79129. content = content.__esModule ? content.default : content;
  79130. if (typeof content === 'string') {
  79131. content = [[module.i, content, '']];
  79132. }
  79133. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  79134. options.insert = "head";
  79135. options.singleton = true;
  79136. var update = api(content, options);
  79137. module.exports = content.locals || {};
  79138. /***/ }),
  79139. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/stickypanel.css":
  79140. /*!************************************************************************************!*\
  79141. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/stickypanel.css ***!
  79142. \************************************************************************************/
  79143. /*! no static exports found */
  79144. /***/ (function(module, exports, __webpack_require__) {
  79145. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  79146. var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./stickypanel.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/stickypanel.css");
  79147. content = content.__esModule ? content.default : content;
  79148. if (typeof content === 'string') {
  79149. content = [[module.i, content, '']];
  79150. }
  79151. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  79152. options.insert = "head";
  79153. options.singleton = true;
  79154. var update = api(content, options);
  79155. module.exports = content.locals || {};
  79156. /***/ }),
  79157. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css":
  79158. /*!*************************************************************************************************!*\
  79159. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css ***!
  79160. \*************************************************************************************************/
  79161. /*! no static exports found */
  79162. /***/ (function(module, exports, __webpack_require__) {
  79163. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  79164. var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./responsiveform.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css");
  79165. content = content.__esModule ? content.default : content;
  79166. if (typeof content === 'string') {
  79167. content = [[module.i, content, '']];
  79168. }
  79169. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  79170. options.insert = "head";
  79171. options.singleton = true;
  79172. var update = api(content, options);
  79173. module.exports = content.locals || {};
  79174. /***/ }),
  79175. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css":
  79176. /*!**********************************************************************************!*\
  79177. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css ***!
  79178. \**********************************************************************************/
  79179. /*! no static exports found */
  79180. /***/ (function(module, exports, __webpack_require__) {
  79181. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  79182. var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./toolbar.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css");
  79183. content = content.__esModule ? content.default : content;
  79184. if (typeof content === 'string') {
  79185. content = [[module.i, content, '']];
  79186. }
  79187. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  79188. options.insert = "head";
  79189. options.singleton = true;
  79190. var update = api(content, options);
  79191. module.exports = content.locals || {};
  79192. /***/ }),
  79193. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/tooltip.css":
  79194. /*!**********************************************************************************!*\
  79195. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/tooltip.css ***!
  79196. \**********************************************************************************/
  79197. /*! no static exports found */
  79198. /***/ (function(module, exports, __webpack_require__) {
  79199. var api = __webpack_require__(/*! ../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  79200. var content = __webpack_require__(/*! !../../../../../postcss-loader/src??ref--5-1!./tooltip.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/tooltip.css");
  79201. content = content.__esModule ? content.default : content;
  79202. if (typeof content === 'string') {
  79203. content = [[module.i, content, '']];
  79204. }
  79205. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  79206. options.insert = "head";
  79207. options.singleton = true;
  79208. var update = api(content, options);
  79209. module.exports = content.locals || {};
  79210. /***/ }),
  79211. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/globals/globals.css":
  79212. /*!***********************************************************************!*\
  79213. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/globals/globals.css ***!
  79214. \***********************************************************************/
  79215. /*! no static exports found */
  79216. /***/ (function(module, exports, __webpack_require__) {
  79217. var api = __webpack_require__(/*! ../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  79218. var content = __webpack_require__(/*! !../../../../postcss-loader/src??ref--5-1!./globals.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/globals/globals.css");
  79219. content = content.__esModule ? content.default : content;
  79220. if (typeof content === 'string') {
  79221. content = [[module.i, content, '']];
  79222. }
  79223. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  79224. options.insert = "head";
  79225. options.singleton = true;
  79226. var update = api(content, options);
  79227. module.exports = content.locals || {};
  79228. /***/ }),
  79229. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/icons/color-tile-check.svg":
  79230. /*!******************************************************************************!*\
  79231. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/icons/color-tile-check.svg ***!
  79232. \******************************************************************************/
  79233. /*! exports provided: default */
  79234. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  79235. "use strict";
  79236. __webpack_require__.r(__webpack_exports__);
  79237. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path class=\"ck-icon__fill\" d=\"M16.935 5.328a2 2 0 0 1 0 2.829l-7.778 7.778a2 2 0 0 1-2.829 0L3.5 13.107a1.999 1.999 0 1 1 2.828-2.829l.707.707a1 1 0 0 0 1.414 0l5.658-5.657a2 2 0 0 1 2.828 0z\"/><path d=\"M14.814 6.035L8.448 12.4a1 1 0 0 1-1.414 0l-1.413-1.415A1 1 0 1 0 4.207 12.4l2.829 2.829a1 1 0 0 0 1.414 0l7.778-7.778a1 1 0 1 0-1.414-1.415z\"/></svg>");
  79238. /***/ }),
  79239. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/icons/dropdown-arrow.svg":
  79240. /*!****************************************************************************!*\
  79241. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/icons/dropdown-arrow.svg ***!
  79242. \****************************************************************************/
  79243. /*! exports provided: default */
  79244. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  79245. "use strict";
  79246. __webpack_require__.r(__webpack_exports__);
  79247. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 10 10\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M.941 4.523a.75.75 0 1 1 1.06-1.06l3.006 3.005 3.005-3.005a.75.75 0 1 1 1.06 1.06l-3.549 3.55a.75.75 0 0 1-1.168-.136L.941 4.523z\"/></svg>");
  79248. /***/ }),
  79249. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/icons/next-arrow.svg":
  79250. /*!************************************************************************!*\
  79251. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/icons/next-arrow.svg ***!
  79252. \************************************************************************/
  79253. /*! exports provided: default */
  79254. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  79255. "use strict";
  79256. __webpack_require__.r(__webpack_exports__);
  79257. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M8.537 14.813a.888.888 0 1 1-1.254-1.255L10.84 10 7.283 6.442a.888.888 0 1 1 1.254-1.255L12.74 9.39a.888.888 0 0 1-.16 1.382l-4.043 4.042z\"/></svg>");
  79258. /***/ }),
  79259. /***/ "./node_modules/@ckeditor/ckeditor5-ui/theme/icons/previous-arrow.svg":
  79260. /*!****************************************************************************!*\
  79261. !*** ./node_modules/@ckeditor/ckeditor5-ui/theme/icons/previous-arrow.svg ***!
  79262. \****************************************************************************/
  79263. /*! exports provided: default */
  79264. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  79265. "use strict";
  79266. __webpack_require__.r(__webpack_exports__);
  79267. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M11.463 5.187a.888.888 0 1 1 1.254 1.255L9.16 10l3.557 3.557a.888.888 0 1 1-1.254 1.255L7.26 10.61a.888.888 0 0 1 .16-1.382l4.043-4.042z\"/></svg>");
  79268. /***/ }),
  79269. /***/ "./node_modules/@ckeditor/ckeditor5-undo/src/basecommand.js":
  79270. /*!******************************************************************!*\
  79271. !*** ./node_modules/@ckeditor/ckeditor5-undo/src/basecommand.js ***!
  79272. \******************************************************************/
  79273. /*! exports provided: default */
  79274. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  79275. "use strict";
  79276. __webpack_require__.r(__webpack_exports__);
  79277. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BaseCommand; });
  79278. /* harmony import */ var _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/command */ "./node_modules/@ckeditor/ckeditor5-core/src/command.js");
  79279. /* harmony import */ var _ckeditor_ckeditor5_engine_src_model_operation_transform__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/model/operation/transform */ "./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/transform.js");
  79280. /**
  79281. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  79282. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  79283. */
  79284. /**
  79285. * @module undo/basecommand
  79286. */
  79287. /**
  79288. * Base class for undo feature commands: {@link module:undo/undocommand~UndoCommand} and {@link module:undo/redocommand~RedoCommand}.
  79289. *
  79290. * @protected
  79291. * @extends module:core/command~Command
  79292. */
  79293. class BaseCommand extends _ckeditor_ckeditor5_core_src_command__WEBPACK_IMPORTED_MODULE_0__["default"] {
  79294. constructor( editor ) {
  79295. super( editor );
  79296. /**
  79297. * Stack of items stored by the command. These are pairs of:
  79298. *
  79299. * * {@link module:engine/model/batch~Batch batch} saved by the command,
  79300. * * {@link module:engine/model/selection~Selection selection} state at the moment of saving the batch.
  79301. *
  79302. * @protected
  79303. * @member {Array} #_stack
  79304. */
  79305. this._stack = [];
  79306. /**
  79307. * Stores all batches that were created by this command.
  79308. *
  79309. * @protected
  79310. * @member {WeakSet.<module:engine/model/batch~Batch>} #_createdBatches
  79311. */
  79312. this._createdBatches = new WeakSet();
  79313. // Refresh state, so the command is inactive right after initialization.
  79314. this.refresh();
  79315. this.listenTo( editor.data, 'set', () => this.clearStack() );
  79316. }
  79317. /**
  79318. * @inheritDoc
  79319. */
  79320. refresh() {
  79321. this.isEnabled = this._stack.length > 0;
  79322. }
  79323. /**
  79324. * Stores a batch in the command, together with the selection state of the {@link module:engine/model/document~Document document}
  79325. * created by the editor which this command is registered to.
  79326. *
  79327. * @param {module:engine/model/batch~Batch} batch The batch to add.
  79328. */
  79329. addBatch( batch ) {
  79330. const docSelection = this.editor.model.document.selection;
  79331. const selection = {
  79332. ranges: docSelection.hasOwnRange ? Array.from( docSelection.getRanges() ) : [],
  79333. isBackward: docSelection.isBackward
  79334. };
  79335. this._stack.push( { batch, selection } );
  79336. this.refresh();
  79337. }
  79338. /**
  79339. * Removes all items from the stack.
  79340. */
  79341. clearStack() {
  79342. this._stack = [];
  79343. this.refresh();
  79344. }
  79345. /**
  79346. * Restores the {@link module:engine/model/document~Document#selection document selection} state after a batch was undone.
  79347. *
  79348. * @protected
  79349. * @param {Array.<module:engine/model/range~Range>} ranges Ranges to be restored.
  79350. * @param {Boolean} isBackward A flag describing whether the restored range was selected forward or backward.
  79351. * @param {Array.<module:engine/model/operation/operation~Operation>} operations Operations which has been applied
  79352. * since selection has been stored.
  79353. */
  79354. _restoreSelection( ranges, isBackward, operations ) {
  79355. const model = this.editor.model;
  79356. const document = model.document;
  79357. // This will keep the transformed selection ranges.
  79358. const selectionRanges = [];
  79359. // Transform all ranges from the restored selection.
  79360. const transformedRangeGroups = ranges.map( range => range.getTransformedByOperations( operations ) );
  79361. const allRanges = transformedRangeGroups.flat();
  79362. for ( const rangeGroup of transformedRangeGroups ) {
  79363. // While transforming there could appear ranges that are contained by other ranges, we shall ignore them.
  79364. const transformed = rangeGroup.filter( range => !isRangeContainedByAnyOtherRange( range, allRanges ) );
  79365. // After the range got transformed, we have an array of ranges. Some of those
  79366. // ranges may be "touching" -- they can be next to each other and could be merged.
  79367. normalizeRanges( transformed );
  79368. // For each `range` from `ranges`, we take only one transformed range.
  79369. // This is because we want to prevent situation where single-range selection
  79370. // got transformed to multi-range selection. We will take the first range that
  79371. // is not in the graveyard.
  79372. const newRange = transformed.find(
  79373. range => range.root != document.graveyard
  79374. );
  79375. // `transformedRange` might be `undefined` if transformed range ended up in graveyard.
  79376. if ( newRange ) {
  79377. selectionRanges.push( newRange );
  79378. }
  79379. }
  79380. // @if CK_DEBUG_ENGINE // console.log( `Restored selection by undo: ${ selectionRanges.join( ', ' ) }` );
  79381. // `selectionRanges` may be empty if all ranges ended up in graveyard. If that is the case, do not restore selection.
  79382. if ( selectionRanges.length ) {
  79383. model.change( writer => {
  79384. writer.setSelection( selectionRanges, { backward: isBackward } );
  79385. } );
  79386. }
  79387. }
  79388. /**
  79389. * Undoes a batch by reversing that batch, transforming reversed batch and finally applying it.
  79390. * This is a helper method for {@link #execute}.
  79391. *
  79392. * @protected
  79393. * @param {module:engine/model/batch~Batch} batchToUndo The batch to be undone.
  79394. * @param {module:engine/model/batch~Batch} undoingBatch The batch that will contain undoing changes.
  79395. */
  79396. _undo( batchToUndo, undoingBatch ) {
  79397. const model = this.editor.model;
  79398. const document = model.document;
  79399. // All changes done by the command execution will be saved as one batch.
  79400. this._createdBatches.add( undoingBatch );
  79401. const operationsToUndo = batchToUndo.operations.slice().filter( operation => operation.isDocumentOperation );
  79402. operationsToUndo.reverse();
  79403. // We will process each operation from `batchToUndo`, in reverse order. If there were operations A, B and C in undone batch,
  79404. // we need to revert them in reverse order, so first C' (reversed C), then B', then A'.
  79405. for ( const operationToUndo of operationsToUndo ) {
  79406. const nextBaseVersion = operationToUndo.baseVersion + 1;
  79407. const historyOperations = Array.from( document.history.getOperations( nextBaseVersion ) );
  79408. const transformedSets = Object(_ckeditor_ckeditor5_engine_src_model_operation_transform__WEBPACK_IMPORTED_MODULE_1__["transformSets"])(
  79409. [ operationToUndo.getReversed() ],
  79410. historyOperations,
  79411. {
  79412. useRelations: true,
  79413. document: this.editor.model.document,
  79414. padWithNoOps: false,
  79415. forceWeakRemove: true
  79416. }
  79417. );
  79418. const reversedOperations = transformedSets.operationsA;
  79419. // After reversed operation has been transformed by all history operations, apply it.
  79420. for ( const operation of reversedOperations ) {
  79421. // Before applying, add the operation to the `undoingBatch`.
  79422. undoingBatch.addOperation( operation );
  79423. model.applyOperation( operation );
  79424. document.history.setOperationAsUndone( operationToUndo, operation );
  79425. }
  79426. }
  79427. }
  79428. }
  79429. // Normalizes list of ranges by joining intersecting or "touching" ranges.
  79430. //
  79431. // @param {Array.<module:engine/model/range~Range>} ranges
  79432. //
  79433. function normalizeRanges( ranges ) {
  79434. ranges.sort( ( a, b ) => a.start.isBefore( b.start ) ? -1 : 1 );
  79435. for ( let i = 1; i < ranges.length; i++ ) {
  79436. const previousRange = ranges[ i - 1 ];
  79437. const joinedRange = previousRange.getJoined( ranges[ i ], true );
  79438. if ( joinedRange ) {
  79439. // Replace the ranges on the list with the new joined range.
  79440. i--;
  79441. ranges.splice( i, 2, joinedRange );
  79442. }
  79443. }
  79444. }
  79445. function isRangeContainedByAnyOtherRange( range, ranges ) {
  79446. return ranges.some( otherRange => otherRange !== range && otherRange.containsRange( range, true ) );
  79447. }
  79448. /***/ }),
  79449. /***/ "./node_modules/@ckeditor/ckeditor5-undo/src/redocommand.js":
  79450. /*!******************************************************************!*\
  79451. !*** ./node_modules/@ckeditor/ckeditor5-undo/src/redocommand.js ***!
  79452. \******************************************************************/
  79453. /*! exports provided: default */
  79454. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  79455. "use strict";
  79456. __webpack_require__.r(__webpack_exports__);
  79457. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RedoCommand; });
  79458. /* harmony import */ var _basecommand__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./basecommand */ "./node_modules/@ckeditor/ckeditor5-undo/src/basecommand.js");
  79459. /**
  79460. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  79461. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  79462. */
  79463. /**
  79464. * @module undo/redocommand
  79465. */
  79466. /**
  79467. * The redo command stores {@link module:engine/model/batch~Batch batches} that were used to undo a batch by
  79468. * {@link module:undo/undocommand~UndoCommand}. It is able to redo a previously undone batch by reversing the undoing
  79469. * batches created by `UndoCommand`. The reversed batch is transformed by all the batches from
  79470. * {@link module:engine/model/document~Document#history history} that happened after the reversed undo batch.
  79471. *
  79472. * The redo command also takes care of restoring the {@link module:engine/model/document~Document#selection document selection}.
  79473. *
  79474. * @extends module:undo/basecommand~BaseCommand
  79475. */
  79476. class RedoCommand extends _basecommand__WEBPACK_IMPORTED_MODULE_0__["default"] {
  79477. /**
  79478. * Executes the command. This method reverts the last {@link module:engine/model/batch~Batch batch} added to
  79479. * the command's stack, applies the reverted and transformed version on the
  79480. * {@link module:engine/model/document~Document document} and removes the batch from the stack.
  79481. * Then, it restores the {@link module:engine/model/document~Document#selection document selection}.
  79482. *
  79483. * @fires execute
  79484. */
  79485. execute() {
  79486. const item = this._stack.pop();
  79487. const redoingBatch = this.editor.model.createBatch( 'transparent' );
  79488. // All changes have to be done in one `enqueueChange` callback so other listeners will not step between consecutive
  79489. // operations, or won't do changes to the document before selection is properly restored.
  79490. this.editor.model.enqueueChange( redoingBatch, () => {
  79491. const lastOperation = item.batch.operations[ item.batch.operations.length - 1 ];
  79492. const nextBaseVersion = lastOperation.baseVersion + 1;
  79493. const operations = this.editor.model.document.history.getOperations( nextBaseVersion );
  79494. this._restoreSelection( item.selection.ranges, item.selection.isBackward, operations );
  79495. this._undo( item.batch, redoingBatch );
  79496. } );
  79497. this.refresh();
  79498. }
  79499. }
  79500. /***/ }),
  79501. /***/ "./node_modules/@ckeditor/ckeditor5-undo/src/undo.js":
  79502. /*!***********************************************************!*\
  79503. !*** ./node_modules/@ckeditor/ckeditor5-undo/src/undo.js ***!
  79504. \***********************************************************/
  79505. /*! exports provided: default */
  79506. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  79507. "use strict";
  79508. __webpack_require__.r(__webpack_exports__);
  79509. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Undo; });
  79510. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  79511. /* harmony import */ var _undoediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./undoediting */ "./node_modules/@ckeditor/ckeditor5-undo/src/undoediting.js");
  79512. /* harmony import */ var _undoui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./undoui */ "./node_modules/@ckeditor/ckeditor5-undo/src/undoui.js");
  79513. /**
  79514. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  79515. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  79516. */
  79517. /**
  79518. * @module undo/undo
  79519. */
  79520. /**
  79521. * The undo feature.
  79522. *
  79523. * This is a "glue" plugin which loads the {@link module:undo/undoediting~UndoEditing undo editing feature}
  79524. * and {@link module:undo/undoui~UndoUI undo UI feature}.
  79525. *
  79526. * Below is the explanation of the undo mechanism working together with {@link module:engine/model/history~History History}:
  79527. *
  79528. * Whenever a {@link module:engine/model/operation/operation~Operation operation} is applied to the
  79529. * {@link module:engine/model/document~Document document}, it is saved to `History` as is.
  79530. * The {@link module:engine/model/batch~Batch batch} that owns that operation is also saved, in
  79531. * {@link module:undo/undocommand~UndoCommand}, together with the selection that was present in the document before the
  79532. * operation was applied. A batch is saved instead of the operation because changes are undone batch-by-batch, not operation-by-operation
  79533. * and a batch is seen as one undo step.
  79534. *
  79535. * After some changes happen to the document, the `History` and `UndoCommand` stack can be represented as follows:
  79536. *
  79537. * History Undo stack
  79538. * ============== ==================================
  79539. * [operation A1] [batch A]
  79540. * [operation B1] [batch B]
  79541. * [operation B2] [batch C]
  79542. * [operation C1]
  79543. * [operation C2]
  79544. * [operation B3]
  79545. * [operation C3]
  79546. *
  79547. * Where operations starting with the same letter are from same batch.
  79548. *
  79549. * Undoing a batch means that a set of operations which will reverse the effects of that batch needs to be generated.
  79550. * For example, if a batch added several letters, undoing the batch should remove them. It is important to apply undoing
  79551. * operations in the reversed order, so if a batch has operation `X`, `Y`, `Z`, reversed operations `Zr`, `Yr` and `Xr`
  79552. * need to be applied. Otherwise reversed operation `Xr` would operate on a wrong document state, because operation `X`
  79553. * does not know that operations `Y` and `Z` happened.
  79554. *
  79555. * After operations from an undone batch got {@link module:engine/model/operation/operation~Operation#getReversed reversed},
  79556. * one needs to make sure if they are ready to be applied. In the scenario above, operation `C3` is the last operation and `C3r`
  79557. * bases on up-to-date document state, so it can be applied to the document.
  79558. *
  79559. * History Undo stack
  79560. * ================= ==================================
  79561. * [ operation A1 ] [ batch A ]
  79562. * [ operation B1 ] [ batch B ]
  79563. * [ operation B2 ] [ processing undoing batch C ]
  79564. * [ operation C1 ]
  79565. * [ operation C2 ]
  79566. * [ operation B3 ]
  79567. * [ operation C3 ]
  79568. * [ operation C3r ]
  79569. *
  79570. * Next is operation `C2`, reversed to `C2r`. `C2r` bases on `C2`, so it bases on the wrong document state. It needs to be
  79571. * transformed by operations from history that happened after it, so it "knows" about them. Let us assume that `C2' = C2r * B3 * C3 * C3r`,
  79572. * where `*` means "transformed by". Rest of operations from that batch are processed in the same fashion.
  79573. *
  79574. * History Undo stack Redo stack
  79575. * ================= ================================== ==================================
  79576. * [ operation A1 ] [ batch A ] [ batch Cr ]
  79577. * [ operation B1 ] [ batch B ]
  79578. * [ operation B2 ]
  79579. * [ operation C1 ]
  79580. * [ operation C2 ]
  79581. * [ operation B3 ]
  79582. * [ operation C3 ]
  79583. * [ operation C3r ]
  79584. * [ operation C2' ]
  79585. * [ operation C1' ]
  79586. *
  79587. * Selective undo works on the same basis, however, instead of undoing the last batch in the undo stack, any batch can be undone.
  79588. * The same algorithm applies: operations from a batch (i.e. `A1`) are reversed and then transformed by operations stored in history.
  79589. *
  79590. * Redo also is very similar to undo. It has its own stack that is filled with undoing (reversed batches). Operations from
  79591. * batch that is re-done are reversed-back, transformed in proper order and applied to the document.
  79592. *
  79593. * History Undo stack Redo stack
  79594. * ================= ================================== ==================================
  79595. * [ operation A1 ] [ batch A ]
  79596. * [ operation B1 ] [ batch B ]
  79597. * [ operation B2 ] [ batch Crr ]
  79598. * [ operation C1 ]
  79599. * [ operation C2 ]
  79600. * [ operation B3 ]
  79601. * [ operation C3 ]
  79602. * [ operation C3r ]
  79603. * [ operation C2' ]
  79604. * [ operation C1' ]
  79605. * [ operation C1'r]
  79606. * [ operation C2'r]
  79607. * [ operation C3rr]
  79608. *
  79609. * @extends module:core/plugin~Plugin
  79610. */
  79611. class Undo extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  79612. /**
  79613. * @inheritDoc
  79614. */
  79615. static get requires() {
  79616. return [ _undoediting__WEBPACK_IMPORTED_MODULE_1__["default"], _undoui__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  79617. }
  79618. /**
  79619. * @inheritDoc
  79620. */
  79621. static get pluginName() {
  79622. return 'Undo';
  79623. }
  79624. }
  79625. /***/ }),
  79626. /***/ "./node_modules/@ckeditor/ckeditor5-undo/src/undocommand.js":
  79627. /*!******************************************************************!*\
  79628. !*** ./node_modules/@ckeditor/ckeditor5-undo/src/undocommand.js ***!
  79629. \******************************************************************/
  79630. /*! exports provided: default */
  79631. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  79632. "use strict";
  79633. __webpack_require__.r(__webpack_exports__);
  79634. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UndoCommand; });
  79635. /* harmony import */ var _basecommand__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./basecommand */ "./node_modules/@ckeditor/ckeditor5-undo/src/basecommand.js");
  79636. /**
  79637. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  79638. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  79639. */
  79640. /**
  79641. * @module undo/undocommand
  79642. */
  79643. /**
  79644. * The undo command stores {@link module:engine/model/batch~Batch batches} applied to the
  79645. * {@link module:engine/model/document~Document document} and is able to undo a batch by reversing it and transforming by
  79646. * batches from {@link module:engine/model/document~Document#history history} that happened after the reversed batch.
  79647. *
  79648. * The undo command also takes care of restoring the {@link module:engine/model/document~Document#selection document selection}.
  79649. *
  79650. * @extends module:undo/basecommand~BaseCommand
  79651. */
  79652. class UndoCommand extends _basecommand__WEBPACK_IMPORTED_MODULE_0__["default"] {
  79653. /**
  79654. * Executes the command. This method reverts a {@link module:engine/model/batch~Batch batch} added to the command's stack, transforms
  79655. * and applies the reverted version on the {@link module:engine/model/document~Document document} and removes the batch from the stack.
  79656. * Then, it restores the {@link module:engine/model/document~Document#selection document selection}.
  79657. *
  79658. * @fires execute
  79659. * @fires revert
  79660. * @param {module:engine/model/batch~Batch} [batch] A batch that should be undone. If not set, the last added batch will be undone.
  79661. */
  79662. execute( batch = null ) {
  79663. // If batch is not given, set `batchIndex` to the last index in command stack.
  79664. const batchIndex = batch ? this._stack.findIndex( a => a.batch == batch ) : this._stack.length - 1;
  79665. const item = this._stack.splice( batchIndex, 1 )[ 0 ];
  79666. const undoingBatch = this.editor.model.createBatch( 'transparent' );
  79667. // All changes has to be done in one `enqueueChange` callback so other listeners will not
  79668. // step between consecutive operations, or won't do changes to the document before selection is properly restored.
  79669. this.editor.model.enqueueChange( undoingBatch, () => {
  79670. this._undo( item.batch, undoingBatch );
  79671. const operations = this.editor.model.document.history.getOperations( item.batch.baseVersion );
  79672. this._restoreSelection( item.selection.ranges, item.selection.isBackward, operations );
  79673. this.fire( 'revert', item.batch, undoingBatch );
  79674. } );
  79675. this.refresh();
  79676. }
  79677. }
  79678. /**
  79679. * Fired when execution of the command reverts some batch.
  79680. *
  79681. * @event revert
  79682. */
  79683. /***/ }),
  79684. /***/ "./node_modules/@ckeditor/ckeditor5-undo/src/undoediting.js":
  79685. /*!******************************************************************!*\
  79686. !*** ./node_modules/@ckeditor/ckeditor5-undo/src/undoediting.js ***!
  79687. \******************************************************************/
  79688. /*! exports provided: default */
  79689. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  79690. "use strict";
  79691. __webpack_require__.r(__webpack_exports__);
  79692. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UndoEditing; });
  79693. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  79694. /* harmony import */ var _undocommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./undocommand */ "./node_modules/@ckeditor/ckeditor5-undo/src/undocommand.js");
  79695. /* harmony import */ var _redocommand__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./redocommand */ "./node_modules/@ckeditor/ckeditor5-undo/src/redocommand.js");
  79696. /**
  79697. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  79698. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  79699. */
  79700. /**
  79701. * @module undo/undoediting
  79702. */
  79703. /**
  79704. * The undo engine feature.
  79705. *
  79706. * It introduces the `'undo'` and `'redo'` commands to the editor.
  79707. *
  79708. * @extends module:core/plugin~Plugin
  79709. */
  79710. class UndoEditing extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  79711. /**
  79712. * @inheritDoc
  79713. */
  79714. static get pluginName() {
  79715. return 'UndoEditing';
  79716. }
  79717. /**
  79718. * @inheritDoc
  79719. */
  79720. constructor( editor ) {
  79721. super( editor );
  79722. /**
  79723. * The command that manages undo {@link module:engine/model/batch~Batch batches} stack (history).
  79724. * Created and registered during the {@link #init feature initialization}.
  79725. *
  79726. * @private
  79727. * @member {module:undo/undocommand~UndoCommand} #_undoCommand
  79728. */
  79729. /**
  79730. * The command that manages redo {@link module:engine/model/batch~Batch batches} stack (history).
  79731. * Created and registered during the {@link #init feature initialization}.
  79732. *
  79733. * @private
  79734. * @member {module:undo/undocommand~UndoCommand} #_redoCommand
  79735. */
  79736. /**
  79737. * Keeps track of which batches were registered in undo.
  79738. *
  79739. * @private
  79740. * @member {WeakSet.<module:engine/model/batch~Batch>}
  79741. */
  79742. this._batchRegistry = new WeakSet();
  79743. }
  79744. /**
  79745. * @inheritDoc
  79746. */
  79747. init() {
  79748. const editor = this.editor;
  79749. // Create commands.
  79750. this._undoCommand = new _undocommand__WEBPACK_IMPORTED_MODULE_1__["default"]( editor );
  79751. this._redoCommand = new _redocommand__WEBPACK_IMPORTED_MODULE_2__["default"]( editor );
  79752. // Register command to the editor.
  79753. editor.commands.add( 'undo', this._undoCommand );
  79754. editor.commands.add( 'redo', this._redoCommand );
  79755. this.listenTo( editor.model, 'applyOperation', ( evt, args ) => {
  79756. const operation = args[ 0 ];
  79757. // Do not register batch if the operation is not a document operation.
  79758. // This prevents from creating empty undo steps, where all operations where non-document operations.
  79759. // Non-document operations creates and alters content in detached tree fragments (for example, document fragments).
  79760. // Most of time this is preparing data before it is inserted into actual tree (for example during copy & paste).
  79761. // Such operations should not be reversed.
  79762. if ( !operation.isDocumentOperation ) {
  79763. return;
  79764. }
  79765. const batch = operation.batch;
  79766. const isRedoBatch = this._redoCommand._createdBatches.has( batch );
  79767. const isUndoBatch = this._undoCommand._createdBatches.has( batch );
  79768. const isRegisteredBatch = this._batchRegistry.has( batch );
  79769. // If changes are not a part of a batch or this is not a new batch, omit those changes.
  79770. if ( isRegisteredBatch || ( batch.type == 'transparent' && !isRedoBatch && !isUndoBatch ) ) {
  79771. return;
  79772. } else {
  79773. if ( isRedoBatch ) {
  79774. // If this batch comes from `redoCommand`, add it to `undoCommand` stack.
  79775. this._undoCommand.addBatch( batch );
  79776. } else if ( !isUndoBatch ) {
  79777. // A default batch - these are new changes in the document, not introduced by undo feature.
  79778. // Add them to `undoCommand` stack and clear `redoCommand` stack.
  79779. this._undoCommand.addBatch( batch );
  79780. this._redoCommand.clearStack();
  79781. }
  79782. }
  79783. // Add the batch to the registry so it will not be processed again.
  79784. this._batchRegistry.add( batch );
  79785. }, { priority: 'highest' } );
  79786. this.listenTo( this._undoCommand, 'revert', ( evt, undoneBatch, undoingBatch ) => {
  79787. this._redoCommand.addBatch( undoingBatch );
  79788. } );
  79789. editor.keystrokes.set( 'CTRL+Z', 'undo' );
  79790. editor.keystrokes.set( 'CTRL+Y', 'redo' );
  79791. editor.keystrokes.set( 'CTRL+SHIFT+Z', 'redo' );
  79792. }
  79793. }
  79794. /***/ }),
  79795. /***/ "./node_modules/@ckeditor/ckeditor5-undo/src/undoui.js":
  79796. /*!*************************************************************!*\
  79797. !*** ./node_modules/@ckeditor/ckeditor5-undo/src/undoui.js ***!
  79798. \*************************************************************/
  79799. /*! exports provided: default */
  79800. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  79801. "use strict";
  79802. __webpack_require__.r(__webpack_exports__);
  79803. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return UndoUI; });
  79804. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  79805. /* harmony import */ var _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  79806. /* harmony import */ var _theme_icons_undo_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../theme/icons/undo.svg */ "./node_modules/@ckeditor/ckeditor5-undo/theme/icons/undo.svg");
  79807. /* harmony import */ var _theme_icons_redo_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../theme/icons/redo.svg */ "./node_modules/@ckeditor/ckeditor5-undo/theme/icons/redo.svg");
  79808. /**
  79809. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  79810. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  79811. */
  79812. /**
  79813. * @module undo/undoui
  79814. */
  79815. /**
  79816. * The undo UI feature. It introduces the `'undo'` and `'redo'` buttons to the editor.
  79817. *
  79818. * @extends module:core/plugin~Plugin
  79819. */
  79820. class UndoUI extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  79821. /**
  79822. * @inheritDoc
  79823. */
  79824. init() {
  79825. const editor = this.editor;
  79826. const locale = editor.locale;
  79827. const t = editor.t;
  79828. const localizedUndoIcon = locale.uiLanguageDirection == 'ltr' ? _theme_icons_undo_svg__WEBPACK_IMPORTED_MODULE_2__["default"] : _theme_icons_redo_svg__WEBPACK_IMPORTED_MODULE_3__["default"];
  79829. const localizedRedoIcon = locale.uiLanguageDirection == 'ltr' ? _theme_icons_redo_svg__WEBPACK_IMPORTED_MODULE_3__["default"] : _theme_icons_undo_svg__WEBPACK_IMPORTED_MODULE_2__["default"];
  79830. this._addButton( 'undo', t( 'Undo' ), 'CTRL+Z', localizedUndoIcon );
  79831. this._addButton( 'redo', t( 'Redo' ), 'CTRL+Y', localizedRedoIcon );
  79832. }
  79833. /**
  79834. * Creates a button for the specified command.
  79835. *
  79836. * @private
  79837. * @param {String} name Command name.
  79838. * @param {String} label Button label.
  79839. * @param {String} keystroke Command keystroke.
  79840. * @param {String} Icon Source of the icon.
  79841. */
  79842. _addButton( name, label, keystroke, Icon ) {
  79843. const editor = this.editor;
  79844. editor.ui.componentFactory.add( name, locale => {
  79845. const command = editor.commands.get( name );
  79846. const view = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_1__["default"]( locale );
  79847. view.set( {
  79848. label,
  79849. icon: Icon,
  79850. keystroke,
  79851. tooltip: true
  79852. } );
  79853. view.bind( 'isEnabled' ).to( command, 'isEnabled' );
  79854. this.listenTo( view, 'execute', () => {
  79855. editor.execute( name );
  79856. editor.editing.view.focus();
  79857. } );
  79858. return view;
  79859. } );
  79860. }
  79861. }
  79862. /***/ }),
  79863. /***/ "./node_modules/@ckeditor/ckeditor5-undo/theme/icons/redo.svg":
  79864. /*!********************************************************************!*\
  79865. !*** ./node_modules/@ckeditor/ckeditor5-undo/theme/icons/redo.svg ***!
  79866. \********************************************************************/
  79867. /*! exports provided: default */
  79868. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  79869. "use strict";
  79870. __webpack_require__.r(__webpack_exports__);
  79871. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M14.958 9.367l-2.189 1.837a.75.75 0 0 0 .965 1.149l3.788-3.18a.747.747 0 0 0 .21-.284.75.75 0 0 0-.17-.945L13.77 4.762a.75.75 0 1 0-.964 1.15l2.331 1.955H6.22A.75.75 0 0 0 6 7.9a4 4 0 1 0 1.477 7.718l-.344-1.489A2.5 2.5 0 1 1 6.039 9.4l-.008-.032h8.927z\"/></svg>");
  79872. /***/ }),
  79873. /***/ "./node_modules/@ckeditor/ckeditor5-undo/theme/icons/undo.svg":
  79874. /*!********************************************************************!*\
  79875. !*** ./node_modules/@ckeditor/ckeditor5-undo/theme/icons/undo.svg ***!
  79876. \********************************************************************/
  79877. /*! exports provided: default */
  79878. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  79879. "use strict";
  79880. __webpack_require__.r(__webpack_exports__);
  79881. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M5.042 9.367l2.189 1.837a.75.75 0 0 1-.965 1.149l-3.788-3.18a.747.747 0 0 1-.21-.284.75.75 0 0 1 .17-.945L6.23 4.762a.75.75 0 1 1 .964 1.15L4.863 7.866h8.917A.75.75 0 0 1 14 7.9a4 4 0 1 1-1.477 7.718l.344-1.489a2.5 2.5 0 1 0 1.094-4.73l.008-.032H5.042z\"/></svg>");
  79882. /***/ }),
  79883. /***/ "./node_modules/@ckeditor/ckeditor5-upload/src/filereader.js":
  79884. /*!*******************************************************************!*\
  79885. !*** ./node_modules/@ckeditor/ckeditor5-upload/src/filereader.js ***!
  79886. \*******************************************************************/
  79887. /*! exports provided: default */
  79888. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  79889. "use strict";
  79890. __webpack_require__.r(__webpack_exports__);
  79891. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FileReader; });
  79892. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  79893. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  79894. /**
  79895. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  79896. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  79897. */
  79898. /**
  79899. * @module upload/filereader
  79900. */
  79901. /* globals window */
  79902. /**
  79903. * Wrapper over the native `FileReader`.
  79904. */
  79905. class FileReader {
  79906. /**
  79907. * Creates an instance of the FileReader.
  79908. */
  79909. constructor() {
  79910. const reader = new window.FileReader();
  79911. /**
  79912. * Instance of native FileReader.
  79913. *
  79914. * @private
  79915. * @member {FileReader} #_reader
  79916. */
  79917. this._reader = reader;
  79918. this._data = undefined;
  79919. /**
  79920. * Number of bytes loaded.
  79921. *
  79922. * @readonly
  79923. * @observable
  79924. * @member {Number} #loaded
  79925. */
  79926. this.set( 'loaded', 0 );
  79927. reader.onprogress = evt => {
  79928. this.loaded = evt.loaded;
  79929. };
  79930. }
  79931. /**
  79932. * Returns error that occurred during file reading.
  79933. *
  79934. * @returns {Error}
  79935. */
  79936. get error() {
  79937. return this._reader.error;
  79938. }
  79939. /**
  79940. * Holds the data of an already loaded file. The file must be first loaded
  79941. * by using {@link module:upload/filereader~FileReader#read `read()`}.
  79942. *
  79943. * @type {File|undefined}
  79944. */
  79945. get data() {
  79946. return this._data;
  79947. }
  79948. /**
  79949. * Reads the provided file.
  79950. *
  79951. * @param {File} file Native File object.
  79952. * @returns {Promise.<String>} Returns a promise that will be resolved with file's content.
  79953. * The promise will be rejected in case of an error or when the reading process is aborted.
  79954. */
  79955. read( file ) {
  79956. const reader = this._reader;
  79957. this.total = file.size;
  79958. return new Promise( ( resolve, reject ) => {
  79959. reader.onload = () => {
  79960. const result = reader.result;
  79961. this._data = result;
  79962. resolve( result );
  79963. };
  79964. reader.onerror = () => {
  79965. reject( 'error' );
  79966. };
  79967. reader.onabort = () => {
  79968. reject( 'aborted' );
  79969. };
  79970. this._reader.readAsDataURL( file );
  79971. } );
  79972. }
  79973. /**
  79974. * Aborts file reader.
  79975. */
  79976. abort() {
  79977. this._reader.abort();
  79978. }
  79979. }
  79980. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( FileReader, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
  79981. /***/ }),
  79982. /***/ "./node_modules/@ckeditor/ckeditor5-upload/src/filerepository.js":
  79983. /*!***********************************************************************!*\
  79984. !*** ./node_modules/@ckeditor/ckeditor5-upload/src/filerepository.js ***!
  79985. \***********************************************************************/
  79986. /*! exports provided: default */
  79987. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  79988. "use strict";
  79989. __webpack_require__.r(__webpack_exports__);
  79990. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FileRepository; });
  79991. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  79992. /* harmony import */ var _ckeditor_ckeditor5_core_src_pendingactions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/pendingactions */ "./node_modules/@ckeditor/ckeditor5-core/src/pendingactions.js");
  79993. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  79994. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  79995. /* harmony import */ var _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/collection */ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js");
  79996. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  79997. /* harmony import */ var _filereader_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./filereader.js */ "./node_modules/@ckeditor/ckeditor5-upload/src/filereader.js");
  79998. /* harmony import */ var _ckeditor_ckeditor5_utils_src_uid_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/uid.js */ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js");
  79999. /**
  80000. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  80001. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  80002. */
  80003. /**
  80004. * @module upload/filerepository
  80005. */
  80006. /**
  80007. * File repository plugin. A central point for managing file upload.
  80008. *
  80009. * To use it, first you need an upload adapter. Upload adapter's job is to handle communication with the server
  80010. * (sending the file and handling server's response). You can use one of the existing plugins introducing upload adapters
  80011. * (e.g. {@link module:easy-image/cloudservicesuploadadapter~CloudServicesUploadAdapter} or
  80012. * {@link module:adapter-ckfinder/uploadadapter~CKFinderUploadAdapter}) or write your own one – see
  80013. * the {@glink framework/guides/deep-dive/upload-adapter "Custom image upload adapter" deep dive guide}.
  80014. *
  80015. * Then, you can use {@link module:upload/filerepository~FileRepository#createLoader `createLoader()`} and the returned
  80016. * {@link module:upload/filerepository~FileLoader} instance to load and upload files.
  80017. *
  80018. * @extends module:core/plugin~Plugin
  80019. */
  80020. class FileRepository extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  80021. /**
  80022. * @inheritDoc
  80023. */
  80024. static get pluginName() {
  80025. return 'FileRepository';
  80026. }
  80027. /**
  80028. * @inheritDoc
  80029. */
  80030. static get requires() {
  80031. return [ _ckeditor_ckeditor5_core_src_pendingactions__WEBPACK_IMPORTED_MODULE_1__["default"] ];
  80032. }
  80033. /**
  80034. * @inheritDoc
  80035. */
  80036. init() {
  80037. /**
  80038. * Collection of loaders associated with this repository.
  80039. *
  80040. * @member {module:utils/collection~Collection} #loaders
  80041. */
  80042. this.loaders = new _ckeditor_ckeditor5_utils_src_collection__WEBPACK_IMPORTED_MODULE_4__["default"]();
  80043. // Keeps upload in a sync with pending actions.
  80044. this.loaders.on( 'add', () => this._updatePendingAction() );
  80045. this.loaders.on( 'remove', () => this._updatePendingAction() );
  80046. /**
  80047. * Loaders mappings used to retrieve loaders references.
  80048. *
  80049. * @private
  80050. * @member {Map<File|Promise, FileLoader>} #_loadersMap
  80051. */
  80052. this._loadersMap = new Map();
  80053. /**
  80054. * Reference to a pending action registered in a {@link module:core/pendingactions~PendingActions} plugin
  80055. * while upload is in progress. When there is no upload then value is `null`.
  80056. *
  80057. * @private
  80058. * @member {Object} #_pendingAction
  80059. */
  80060. this._pendingAction = null;
  80061. /**
  80062. * A factory function which should be defined before using `FileRepository`.
  80063. *
  80064. * It should return a new instance of {@link module:upload/filerepository~UploadAdapter} that will be used to upload files.
  80065. * {@link module:upload/filerepository~FileLoader} instance associated with the adapter
  80066. * will be passed to that function.
  80067. *
  80068. * For more information and example see {@link module:upload/filerepository~UploadAdapter}.
  80069. *
  80070. * @member {Function} #createUploadAdapter
  80071. */
  80072. /**
  80073. * Number of bytes uploaded.
  80074. *
  80075. * @readonly
  80076. * @observable
  80077. * @member {Number} #uploaded
  80078. */
  80079. this.set( 'uploaded', 0 );
  80080. /**
  80081. * Number of total bytes to upload.
  80082. *
  80083. * It might be different than the file size because of headers and additional data.
  80084. * It contains `null` if value is not available yet, so it's better to use {@link #uploadedPercent} to monitor
  80085. * the progress.
  80086. *
  80087. * @readonly
  80088. * @observable
  80089. * @member {Number|null} #uploadTotal
  80090. */
  80091. this.set( 'uploadTotal', null );
  80092. /**
  80093. * Upload progress in percents.
  80094. *
  80095. * @readonly
  80096. * @observable
  80097. * @member {Number} #uploadedPercent
  80098. */
  80099. this.bind( 'uploadedPercent' ).to( this, 'uploaded', this, 'uploadTotal', ( uploaded, total ) => {
  80100. return total ? ( uploaded / total * 100 ) : 0;
  80101. } );
  80102. }
  80103. /**
  80104. * Returns the loader associated with specified file or promise.
  80105. *
  80106. * To get loader by id use `fileRepository.loaders.get( id )`.
  80107. *
  80108. * @param {File|Promise.<File>} fileOrPromise Native file or promise handle.
  80109. * @returns {module:upload/filerepository~FileLoader|null}
  80110. */
  80111. getLoader( fileOrPromise ) {
  80112. return this._loadersMap.get( fileOrPromise ) || null;
  80113. }
  80114. /**
  80115. * Creates a loader instance for the given file.
  80116. *
  80117. * Requires {@link #createUploadAdapter} factory to be defined.
  80118. *
  80119. * @param {File|Promise.<File>} fileOrPromise Native File object or native Promise object which resolves to a File.
  80120. * @returns {module:upload/filerepository~FileLoader|null}
  80121. */
  80122. createLoader( fileOrPromise ) {
  80123. if ( !this.createUploadAdapter ) {
  80124. /**
  80125. * You need to enable an upload adapter in order to be able to upload files.
  80126. *
  80127. * This warning shows up when {@link module:upload/filerepository~FileRepository} is being used
  80128. * without {@link #createUploadAdapter definining an upload adapter}.
  80129. *
  80130. * **If you see this warning when using one of the {@glink builds/index CKEditor 5 Builds}**
  80131. * it means that you did not configure any of the upload adapters available by default in those builds.
  80132. *
  80133. * See the {@glink features/image-upload/image-upload comprehensive "Image upload overview"} to learn which upload
  80134. * adapters are available in the builds and how to configure them.
  80135. *
  80136. * **If you see this warning when using a custom build** there is a chance that you enabled
  80137. * a feature like {@link module:image/imageupload~ImageUpload},
  80138. * or {@link module:image/imageupload/imageuploadui~ImageUploadUI} but you did not enable any upload adapter.
  80139. * You can choose one of the existing upload adapters listed in the
  80140. * {@glink features/image-upload/image-upload "Image upload overview"}.
  80141. *
  80142. * You can also implement your {@glink framework/guides/deep-dive/upload-adapter own image upload adapter}.
  80143. *
  80144. * @error filerepository-no-upload-adapter
  80145. */
  80146. Object(_ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["logWarning"])( 'filerepository-no-upload-adapter' );
  80147. return null;
  80148. }
  80149. const loader = new FileLoader( Promise.resolve( fileOrPromise ), this.createUploadAdapter );
  80150. this.loaders.add( loader );
  80151. this._loadersMap.set( fileOrPromise, loader );
  80152. // Store also file => loader mapping so loader can be retrieved by file instance returned upon Promise resolution.
  80153. if ( fileOrPromise instanceof Promise ) {
  80154. loader.file
  80155. .then( file => {
  80156. this._loadersMap.set( file, loader );
  80157. } )
  80158. // Every then() must have a catch().
  80159. // File loader state (and rejections) are handled in read() and upload().
  80160. // Also, see the "does not swallow the file promise rejection" test.
  80161. .catch( () => {} );
  80162. }
  80163. loader.on( 'change:uploaded', () => {
  80164. let aggregatedUploaded = 0;
  80165. for ( const loader of this.loaders ) {
  80166. aggregatedUploaded += loader.uploaded;
  80167. }
  80168. this.uploaded = aggregatedUploaded;
  80169. } );
  80170. loader.on( 'change:uploadTotal', () => {
  80171. let aggregatedTotal = 0;
  80172. for ( const loader of this.loaders ) {
  80173. if ( loader.uploadTotal ) {
  80174. aggregatedTotal += loader.uploadTotal;
  80175. }
  80176. }
  80177. this.uploadTotal = aggregatedTotal;
  80178. } );
  80179. return loader;
  80180. }
  80181. /**
  80182. * Destroys the given loader.
  80183. *
  80184. * @param {File|Promise|module:upload/filerepository~FileLoader} fileOrPromiseOrLoader File or Promise associated
  80185. * with that loader or loader itself.
  80186. */
  80187. destroyLoader( fileOrPromiseOrLoader ) {
  80188. const loader = fileOrPromiseOrLoader instanceof FileLoader ? fileOrPromiseOrLoader : this.getLoader( fileOrPromiseOrLoader );
  80189. loader._destroy();
  80190. this.loaders.remove( loader );
  80191. this._loadersMap.forEach( ( value, key ) => {
  80192. if ( value === loader ) {
  80193. this._loadersMap.delete( key );
  80194. }
  80195. } );
  80196. }
  80197. /**
  80198. * Registers or deregisters pending action bound with upload progress.
  80199. *
  80200. * @private
  80201. */
  80202. _updatePendingAction() {
  80203. const pendingActions = this.editor.plugins.get( _ckeditor_ckeditor5_core_src_pendingactions__WEBPACK_IMPORTED_MODULE_1__["default"] );
  80204. if ( this.loaders.length ) {
  80205. if ( !this._pendingAction ) {
  80206. const t = this.editor.t;
  80207. const getMessage = value => `${ t( 'Upload in progress' ) } ${ parseInt( value ) }%.`;
  80208. this._pendingAction = pendingActions.add( getMessage( this.uploadedPercent ) );
  80209. this._pendingAction.bind( 'message' ).to( this, 'uploadedPercent', getMessage );
  80210. }
  80211. } else {
  80212. pendingActions.remove( this._pendingAction );
  80213. this._pendingAction = null;
  80214. }
  80215. }
  80216. }
  80217. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_5__["default"])( FileRepository, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_3__["default"] );
  80218. /**
  80219. * File loader class.
  80220. *
  80221. * It is used to control the process of reading the file and uploading it using the specified upload adapter.
  80222. */
  80223. class FileLoader {
  80224. /**
  80225. * Creates a new instance of `FileLoader`.
  80226. *
  80227. * @param {Promise.<File>} filePromise A promise which resolves to a file instance.
  80228. * @param {Function} uploadAdapterCreator The function which returns {@link module:upload/filerepository~UploadAdapter} instance.
  80229. */
  80230. constructor( filePromise, uploadAdapterCreator ) {
  80231. /**
  80232. * Unique id of FileLoader instance.
  80233. *
  80234. * @readonly
  80235. * @member {Number}
  80236. */
  80237. this.id = Object(_ckeditor_ckeditor5_utils_src_uid_js__WEBPACK_IMPORTED_MODULE_7__["default"])();
  80238. /**
  80239. * Additional wrapper over the initial file promise passed to this loader.
  80240. *
  80241. * @protected
  80242. * @member {module:upload/filerepository~FilePromiseWrapper}
  80243. */
  80244. this._filePromiseWrapper = this._createFilePromiseWrapper( filePromise );
  80245. /**
  80246. * Adapter instance associated with this file loader.
  80247. *
  80248. * @private
  80249. * @member {module:upload/filerepository~UploadAdapter}
  80250. */
  80251. this._adapter = uploadAdapterCreator( this );
  80252. /**
  80253. * FileReader used by FileLoader.
  80254. *
  80255. * @protected
  80256. * @member {module:upload/filereader~FileReader}
  80257. */
  80258. this._reader = new _filereader_js__WEBPACK_IMPORTED_MODULE_6__["default"]();
  80259. /**
  80260. * Current status of FileLoader. It can be one of the following:
  80261. *
  80262. * * 'idle',
  80263. * * 'reading',
  80264. * * 'uploading',
  80265. * * 'aborted',
  80266. * * 'error'.
  80267. *
  80268. * When reading status can change in a following way:
  80269. *
  80270. * `idle` -> `reading` -> `idle`
  80271. * `idle` -> `reading -> `aborted`
  80272. * `idle` -> `reading -> `error`
  80273. *
  80274. * When uploading status can change in a following way:
  80275. *
  80276. * `idle` -> `uploading` -> `idle`
  80277. * `idle` -> `uploading` -> `aborted`
  80278. * `idle` -> `uploading` -> `error`
  80279. *
  80280. * @readonly
  80281. * @observable
  80282. * @member {String} #status
  80283. */
  80284. this.set( 'status', 'idle' );
  80285. /**
  80286. * Number of bytes uploaded.
  80287. *
  80288. * @readonly
  80289. * @observable
  80290. * @member {Number} #uploaded
  80291. */
  80292. this.set( 'uploaded', 0 );
  80293. /**
  80294. * Number of total bytes to upload.
  80295. *
  80296. * @readonly
  80297. * @observable
  80298. * @member {Number|null} #uploadTotal
  80299. */
  80300. this.set( 'uploadTotal', null );
  80301. /**
  80302. * Upload progress in percents.
  80303. *
  80304. * @readonly
  80305. * @observable
  80306. * @member {Number} #uploadedPercent
  80307. */
  80308. this.bind( 'uploadedPercent' ).to( this, 'uploaded', this, 'uploadTotal', ( uploaded, total ) => {
  80309. return total ? ( uploaded / total * 100 ) : 0;
  80310. } );
  80311. /**
  80312. * Response of the upload.
  80313. *
  80314. * @readonly
  80315. * @observable
  80316. * @member {Object|null} #uploadResponse
  80317. */
  80318. this.set( 'uploadResponse', null );
  80319. }
  80320. /**
  80321. * A `Promise` which resolves to a `File` instance associated with this file loader.
  80322. *
  80323. * @type {Promise.<File|null>}
  80324. */
  80325. get file() {
  80326. if ( !this._filePromiseWrapper ) {
  80327. // Loader was destroyed, return promise which resolves to null.
  80328. return Promise.resolve( null );
  80329. } else {
  80330. // The `this._filePromiseWrapper.promise` is chained and not simply returned to handle a case when:
  80331. //
  80332. // * The `loader.file.then( ... )` is called by external code (returned promise is pending).
  80333. // * Then `loader._destroy()` is called (call is synchronous) which destroys the `loader`.
  80334. // * Promise returned by the first `loader.file.then( ... )` call is resolved.
  80335. //
  80336. // Returning `this._filePromiseWrapper.promise` will still resolve to a `File` instance so there
  80337. // is an additional check needed in the chain to see if `loader` was destroyed in the meantime.
  80338. return this._filePromiseWrapper.promise.then( file => this._filePromiseWrapper ? file : null );
  80339. }
  80340. }
  80341. /**
  80342. * Returns the file data. To read its data, you need for first load the file
  80343. * by using the {@link module:upload/filerepository~FileLoader#read `read()`} method.
  80344. *
  80345. * @type {File|undefined}
  80346. */
  80347. get data() {
  80348. return this._reader.data;
  80349. }
  80350. /**
  80351. * Reads file using {@link module:upload/filereader~FileReader}.
  80352. *
  80353. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `filerepository-read-wrong-status` when status
  80354. * is different than `idle`.
  80355. *
  80356. * Example usage:
  80357. *
  80358. * fileLoader.read()
  80359. * .then( data => { ... } )
  80360. * .catch( err => {
  80361. * if ( err === 'aborted' ) {
  80362. * console.log( 'Reading aborted.' );
  80363. * } else {
  80364. * console.log( 'Reading error.', err );
  80365. * }
  80366. * } );
  80367. *
  80368. * @returns {Promise.<String>} Returns promise that will be resolved with read data. Promise will be rejected if error
  80369. * occurs or if read process is aborted.
  80370. */
  80371. read() {
  80372. if ( this.status != 'idle' ) {
  80373. /**
  80374. * You cannot call read if the status is different than idle.
  80375. *
  80376. * @error filerepository-read-wrong-status
  80377. */
  80378. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'filerepository-read-wrong-status', this );
  80379. }
  80380. this.status = 'reading';
  80381. return this.file
  80382. .then( file => this._reader.read( file ) )
  80383. .then( data => {
  80384. // Edge case: reader was aborted after file was read - double check for proper status.
  80385. // It can happen when image was deleted during its upload.
  80386. if ( this.status !== 'reading' ) {
  80387. throw this.status;
  80388. }
  80389. this.status = 'idle';
  80390. return data;
  80391. } )
  80392. .catch( err => {
  80393. if ( err === 'aborted' ) {
  80394. this.status = 'aborted';
  80395. throw 'aborted';
  80396. }
  80397. this.status = 'error';
  80398. throw this._reader.error ? this._reader.error : err;
  80399. } );
  80400. }
  80401. /**
  80402. * Reads file using the provided {@link module:upload/filerepository~UploadAdapter}.
  80403. *
  80404. * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `filerepository-upload-wrong-status` when status
  80405. * is different than `idle`.
  80406. * Example usage:
  80407. *
  80408. * fileLoader.upload()
  80409. * .then( data => { ... } )
  80410. * .catch( e => {
  80411. * if ( e === 'aborted' ) {
  80412. * console.log( 'Uploading aborted.' );
  80413. * } else {
  80414. * console.log( 'Uploading error.', e );
  80415. * }
  80416. * } );
  80417. *
  80418. * @returns {Promise.<Object>} Returns promise that will be resolved with response data. Promise will be rejected if error
  80419. * occurs or if read process is aborted.
  80420. */
  80421. upload() {
  80422. if ( this.status != 'idle' ) {
  80423. /**
  80424. * You cannot call upload if the status is different than idle.
  80425. *
  80426. * @error filerepository-upload-wrong-status
  80427. */
  80428. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'filerepository-upload-wrong-status', this );
  80429. }
  80430. this.status = 'uploading';
  80431. return this.file
  80432. .then( () => this._adapter.upload() )
  80433. .then( data => {
  80434. this.uploadResponse = data;
  80435. this.status = 'idle';
  80436. return data;
  80437. } )
  80438. .catch( err => {
  80439. if ( this.status === 'aborted' ) {
  80440. throw 'aborted';
  80441. }
  80442. this.status = 'error';
  80443. throw err;
  80444. } );
  80445. }
  80446. /**
  80447. * Aborts loading process.
  80448. */
  80449. abort() {
  80450. const status = this.status;
  80451. this.status = 'aborted';
  80452. if ( !this._filePromiseWrapper.isFulfilled ) {
  80453. // Edge case: file loader is aborted before read() is called
  80454. // so it might happen that no one handled the rejection of this promise.
  80455. // See https://github.com/ckeditor/ckeditor5-upload/pull/100
  80456. this._filePromiseWrapper.promise.catch( () => {} );
  80457. this._filePromiseWrapper.rejecter( 'aborted' );
  80458. } else if ( status == 'reading' ) {
  80459. this._reader.abort();
  80460. } else if ( status == 'uploading' && this._adapter.abort ) {
  80461. this._adapter.abort();
  80462. }
  80463. this._destroy();
  80464. }
  80465. /**
  80466. * Performs cleanup.
  80467. *
  80468. * @private
  80469. */
  80470. _destroy() {
  80471. this._filePromiseWrapper = undefined;
  80472. this._reader = undefined;
  80473. this._adapter = undefined;
  80474. this.uploadResponse = undefined;
  80475. }
  80476. /**
  80477. * Wraps a given file promise into another promise giving additional
  80478. * control (resolving, rejecting, checking if fulfilled) over it.
  80479. *
  80480. * @private
  80481. * @param filePromise The initial file promise to be wrapped.
  80482. * @returns {module:upload/filerepository~FilePromiseWrapper}
  80483. */
  80484. _createFilePromiseWrapper( filePromise ) {
  80485. const wrapper = {};
  80486. wrapper.promise = new Promise( ( resolve, reject ) => {
  80487. wrapper.rejecter = reject;
  80488. wrapper.isFulfilled = false;
  80489. filePromise
  80490. .then( file => {
  80491. wrapper.isFulfilled = true;
  80492. resolve( file );
  80493. } )
  80494. .catch( err => {
  80495. wrapper.isFulfilled = true;
  80496. reject( err );
  80497. } );
  80498. } );
  80499. return wrapper;
  80500. }
  80501. }
  80502. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_5__["default"])( FileLoader, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_3__["default"] );
  80503. /**
  80504. * Upload adapter interface used by the {@link module:upload/filerepository~FileRepository file repository}
  80505. * to handle file upload. An upload adapter is a bridge between the editor and server that handles file uploads.
  80506. * It should contain a logic necessary to initiate an upload process and monitor its progress.
  80507. *
  80508. * Learn how to develop your own upload adapter for CKEditor 5 in the
  80509. * {@glink framework/guides/deep-dive/upload-adapter "Custom upload adapter" guide}.
  80510. *
  80511. * @interface UploadAdapter
  80512. */
  80513. /**
  80514. * Executes the upload process.
  80515. * This method should return a promise that will resolve when data will be uploaded to server. Promise should be
  80516. * resolved with an object containing information about uploaded file:
  80517. *
  80518. * {
  80519. * default: 'http://server/default-size.image.png'
  80520. * }
  80521. *
  80522. * Additionally, other image sizes can be provided:
  80523. *
  80524. * {
  80525. * default: 'http://server/default-size.image.png',
  80526. * '160': 'http://server/size-160.image.png',
  80527. * '500': 'http://server/size-500.image.png',
  80528. * '1000': 'http://server/size-1000.image.png',
  80529. * '1052': 'http://server/default-size.image.png'
  80530. * }
  80531. *
  80532. * NOTE: When returning multiple images, the widest returned one should equal the default one. It is essential to
  80533. * correctly set `width` attribute of the image. See this discussion:
  80534. * https://github.com/ckeditor/ckeditor5-easy-image/issues/4 for more information.
  80535. *
  80536. * Take a look at {@link module:upload/filerepository~UploadAdapter example Adapter implementation} and
  80537. * {@link module:upload/filerepository~FileRepository#createUploadAdapter createUploadAdapter method}.
  80538. *
  80539. * @method module:upload/filerepository~UploadAdapter#upload
  80540. * @returns {Promise.<Object>} Promise that should be resolved when data is uploaded.
  80541. */
  80542. /**
  80543. * Aborts the upload process.
  80544. * After aborting it should reject promise returned from {@link #upload upload()}.
  80545. *
  80546. * Take a look at {@link module:upload/filerepository~UploadAdapter example Adapter implementation} and
  80547. * {@link module:upload/filerepository~FileRepository#createUploadAdapter createUploadAdapter method}.
  80548. *
  80549. * @method module:upload/filerepository~UploadAdapter#abort
  80550. */
  80551. /**
  80552. * Object returned by {@link module:upload/filerepository~FileLoader#_createFilePromiseWrapper} method
  80553. * to add more control over the initial file promise passed to {@link module:upload/filerepository~FileLoader}.
  80554. *
  80555. * @protected
  80556. * @typedef {Object} module:upload/filerepository~FilePromiseWrapper
  80557. * @property {Promise.<File>} promise Wrapper promise which can be chained for further processing.
  80558. * @property {Function} rejecter Rejects the promise when called.
  80559. * @property {Boolean} isFulfilled Whether original promise is already fulfilled.
  80560. */
  80561. /***/ }),
  80562. /***/ "./node_modules/@ckeditor/ckeditor5-upload/src/ui/filedialogbuttonview.js":
  80563. /*!********************************************************************************!*\
  80564. !*** ./node_modules/@ckeditor/ckeditor5-upload/src/ui/filedialogbuttonview.js ***!
  80565. \********************************************************************************/
  80566. /*! exports provided: default */
  80567. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  80568. "use strict";
  80569. __webpack_require__.r(__webpack_exports__);
  80570. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FileDialogButtonView; });
  80571. /* harmony import */ var _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/button/buttonview */ "./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js");
  80572. /* harmony import */ var _ckeditor_ckeditor5_ui_src_view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  80573. /**
  80574. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  80575. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  80576. */
  80577. /**
  80578. * @module upload/ui/filedialogbuttonview
  80579. */
  80580. /**
  80581. * The file dialog button view.
  80582. *
  80583. * This component provides a button that opens the native file selection dialog.
  80584. * It can be used to implement the UI of a file upload feature.
  80585. *
  80586. * const view = new FileDialogButtonView( locale );
  80587. *
  80588. * view.set( {
  80589. * acceptedType: 'image/*',
  80590. * allowMultipleFiles: true
  80591. * } );
  80592. *
  80593. * view.buttonView.set( {
  80594. * label: t( 'Insert image' ),
  80595. * icon: imageIcon,
  80596. * tooltip: true
  80597. * } );
  80598. *
  80599. * view.on( 'done', ( evt, files ) => {
  80600. * for ( const file of Array.from( files ) ) {
  80601. * console.log( 'Selected file', file );
  80602. * }
  80603. * } );
  80604. *
  80605. * @extends module:ui/view~View
  80606. */
  80607. class FileDialogButtonView extends _ckeditor_ckeditor5_ui_src_view__WEBPACK_IMPORTED_MODULE_1__["default"] {
  80608. /**
  80609. * @inheritDoc
  80610. */
  80611. constructor( locale ) {
  80612. super( locale );
  80613. /**
  80614. * The button view of the component.
  80615. *
  80616. * @member {module:ui/button/buttonview~ButtonView}
  80617. */
  80618. this.buttonView = new _ckeditor_ckeditor5_ui_src_button_buttonview__WEBPACK_IMPORTED_MODULE_0__["default"]( locale );
  80619. /**
  80620. * A hidden `<input>` view used to execute file dialog.
  80621. *
  80622. * @protected
  80623. * @member {module:upload/ui/filedialogbuttonview~FileInputView}
  80624. */
  80625. this._fileInputView = new FileInputView( locale );
  80626. /**
  80627. * Accepted file types. Can be provided in form of file extensions, media type or one of:
  80628. * * `audio/*`,
  80629. * * `video/*`,
  80630. * * `image/*`.
  80631. *
  80632. * @observable
  80633. * @member {String} #acceptedType
  80634. */
  80635. this._fileInputView.bind( 'acceptedType' ).to( this );
  80636. /**
  80637. * Indicates if multiple files can be selected. Defaults to `true`.
  80638. *
  80639. * @observable
  80640. * @member {Boolean} #allowMultipleFiles
  80641. */
  80642. this._fileInputView.bind( 'allowMultipleFiles' ).to( this );
  80643. /**
  80644. * Fired when file dialog is closed with file selected.
  80645. *
  80646. * view.on( 'done', ( evt, files ) => {
  80647. * for ( const file of files ) {
  80648. * console.log( 'Selected file', file );
  80649. * }
  80650. * }
  80651. *
  80652. * @event done
  80653. * @param {Array.<File>} files Array of selected files.
  80654. */
  80655. this._fileInputView.delegate( 'done' ).to( this );
  80656. this.setTemplate( {
  80657. tag: 'span',
  80658. attributes: {
  80659. class: 'ck-file-dialog-button'
  80660. },
  80661. children: [
  80662. this.buttonView,
  80663. this._fileInputView
  80664. ]
  80665. } );
  80666. this.buttonView.on( 'execute', () => {
  80667. this._fileInputView.open();
  80668. } );
  80669. }
  80670. /**
  80671. * Focuses the {@link #buttonView}.
  80672. */
  80673. focus() {
  80674. this.buttonView.focus();
  80675. }
  80676. }
  80677. /**
  80678. * The hidden file input view class.
  80679. *
  80680. * @private
  80681. * @extends module:ui/view~View
  80682. */
  80683. class FileInputView extends _ckeditor_ckeditor5_ui_src_view__WEBPACK_IMPORTED_MODULE_1__["default"] {
  80684. /**
  80685. * @inheritDoc
  80686. */
  80687. constructor( locale ) {
  80688. super( locale );
  80689. /**
  80690. * Accepted file types. Can be provided in form of file extensions, media type or one of:
  80691. * * `audio/*`,
  80692. * * `video/*`,
  80693. * * `image/*`.
  80694. *
  80695. * @observable
  80696. * @member {String} #acceptedType
  80697. */
  80698. this.set( 'acceptedType' );
  80699. /**
  80700. * Indicates if multiple files can be selected. Defaults to `false`.
  80701. *
  80702. * @observable
  80703. * @member {Boolean} #allowMultipleFiles
  80704. */
  80705. this.set( 'allowMultipleFiles', false );
  80706. const bind = this.bindTemplate;
  80707. this.setTemplate( {
  80708. tag: 'input',
  80709. attributes: {
  80710. class: [
  80711. 'ck-hidden'
  80712. ],
  80713. type: 'file',
  80714. tabindex: '-1',
  80715. accept: bind.to( 'acceptedType' ),
  80716. multiple: bind.to( 'allowMultipleFiles' )
  80717. },
  80718. on: {
  80719. // Removing from code coverage since we cannot programmatically set input element files.
  80720. change: bind.to( /* istanbul ignore next */ () => {
  80721. if ( this.element && this.element.files && this.element.files.length ) {
  80722. this.fire( 'done', this.element.files );
  80723. }
  80724. this.element.value = '';
  80725. } )
  80726. }
  80727. } );
  80728. }
  80729. /**
  80730. * Opens file dialog.
  80731. */
  80732. open() {
  80733. this.element.click();
  80734. }
  80735. }
  80736. /***/ }),
  80737. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js":
  80738. /*!*********************************************************************!*\
  80739. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js ***!
  80740. \*********************************************************************/
  80741. /*! exports provided: DOCUMENTATION_URL, default, logWarning, logError */
  80742. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  80743. "use strict";
  80744. __webpack_require__.r(__webpack_exports__);
  80745. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DOCUMENTATION_URL", function() { return DOCUMENTATION_URL; });
  80746. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CKEditorError; });
  80747. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logWarning", function() { return logWarning; });
  80748. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logError", function() { return logError; });
  80749. /**
  80750. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  80751. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  80752. */
  80753. /**
  80754. * @module utils/ckeditorerror
  80755. */
  80756. /* globals console */
  80757. /**
  80758. * URL to the documentation with error codes.
  80759. */
  80760. const DOCUMENTATION_URL =
  80761. 'https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html';
  80762. /**
  80763. * The CKEditor error class.
  80764. *
  80765. * You should throw `CKEditorError` when:
  80766. *
  80767. * * An unexpected situation occurred and the editor (most probably) will not work properly. Such exception will be handled
  80768. * by the {@link module:watchdog/watchdog~Watchdog watchdog} (if it is integrated),
  80769. * * If the editor is incorrectly integrated or the editor API is used in the wrong way. This way you will give
  80770. * feedback to the developer as soon as possible. Keep in mind that for common integration issues which should not
  80771. * stop editor initialization (like missing upload adapter, wrong name of a toolbar component) we use
  80772. * {@link module:utils/ckeditorerror~logWarning `logWarning()`} and
  80773. * {@link module:utils/ckeditorerror~logError `logError()`}
  80774. * to improve developers experience and let them see the a working editor as soon as possible.
  80775. *
  80776. * /**
  80777. * * Error thrown when a plugin cannot be loaded due to JavaScript errors, lack of plugins with a given name, etc.
  80778. * *
  80779. * * @error plugin-load
  80780. * * @param pluginName The name of the plugin that could not be loaded.
  80781. * * @param moduleName The name of the module which tried to load this plugin.
  80782. * * /
  80783. * throw new CKEditorError( 'plugin-load', {
  80784. * pluginName: 'foo',
  80785. * moduleName: 'bar'
  80786. * } );
  80787. *
  80788. * @extends Error
  80789. */
  80790. class CKEditorError extends Error {
  80791. /**
  80792. * Creates an instance of the CKEditorError class.
  80793. *
  80794. * @param {String} errorName The error id in an `error-name` format. A link to this error documentation page will be added
  80795. * to the thrown error's `message`.
  80796. * @param {Object|null} context A context of the error by which the {@link module:watchdog/watchdog~Watchdog watchdog}
  80797. * is able to determine which editor crashed. It should be an editor instance or a property connected to it. It can be also
  80798. * a `null` value if the editor should not be restarted in case of the error (e.g. during the editor initialization).
  80799. * The error context should be checked using the `areConnectedThroughProperties( editor, context )` utility
  80800. * to check if the object works as the context.
  80801. * @param {Object} [data] Additional data describing the error. A stringified version of this object
  80802. * will be appended to the error message, so the data are quickly visible in the console. The original
  80803. * data object will also be later available under the {@link #data} property.
  80804. */
  80805. constructor( errorName, context, data ) {
  80806. const message = `${ errorName }${ ( data ? ` ${ JSON.stringify( data ) }` : '' ) }${ getLinkToDocumentationMessage( errorName ) }`;
  80807. super( message );
  80808. /**
  80809. * @type {String}
  80810. */
  80811. this.name = 'CKEditorError';
  80812. /**
  80813. * A context of the error by which the Watchdog is able to determine which editor crashed.
  80814. *
  80815. * @type {Object|null}
  80816. */
  80817. this.context = context;
  80818. /**
  80819. * The additional error data passed to the constructor. Undefined if none was passed.
  80820. *
  80821. * @type {Object|undefined}
  80822. */
  80823. this.data = data;
  80824. }
  80825. /**
  80826. * Checks if the error is of the `CKEditorError` type.
  80827. */
  80828. is( type ) {
  80829. return type === 'CKEditorError';
  80830. }
  80831. /**
  80832. * A utility that ensures that the thrown error is a {@link module:utils/ckeditorerror~CKEditorError} one.
  80833. * It is useful when combined with the {@link module:watchdog/watchdog~Watchdog} feature, which can restart the editor in case
  80834. * of a {@link module:utils/ckeditorerror~CKEditorError} error.
  80835. *
  80836. * @static
  80837. * @param {Error} err The error to rethrow.
  80838. * @param {Object} context An object connected through properties with the editor instance. This context will be used
  80839. * by the watchdog to verify which editor should be restarted.
  80840. */
  80841. static rethrowUnexpectedError( err, context ) {
  80842. if ( err.is && err.is( 'CKEditorError' ) ) {
  80843. throw err;
  80844. }
  80845. /**
  80846. * An unexpected error occurred inside the CKEditor 5 codebase. This error will look like the original one
  80847. * to make the debugging easier.
  80848. *
  80849. * This error is only useful when the editor is initialized using the {@link module:watchdog/watchdog~Watchdog} feature.
  80850. * In case of such error (or any {@link module:utils/ckeditorerror~CKEditorError} error) the watchdog should restart the editor.
  80851. *
  80852. * @error unexpected-error
  80853. */
  80854. const error = new CKEditorError( err.message, context );
  80855. // Restore the original stack trace to make the error look like the original one.
  80856. // See https://github.com/ckeditor/ckeditor5/issues/5595 for more details.
  80857. error.stack = err.stack;
  80858. throw error;
  80859. }
  80860. }
  80861. /**
  80862. * Logs a warning to the console with a properly formatted message and adds a link to the documentation.
  80863. * Use whenever you want to log a warning to the console.
  80864. *
  80865. * /**
  80866. * * There was a problem processing the configuration of the toolbar. The item with the given
  80867. * * name does not exist, so it was omitted when rendering the toolbar.
  80868. * *
  80869. * * @error toolbarview-item-unavailable
  80870. * * @param {String} name The name of the component.
  80871. * * /
  80872. * logWarning( 'toolbarview-item-unavailable', { name } );
  80873. *
  80874. * See also {@link module:utils/ckeditorerror~CKEditorError} for an explanation when to throw an error and when to log
  80875. * a warning or an error to the console.
  80876. *
  80877. * @param {String} errorName Error name to be logged.
  80878. * @param {Object} [data] Additional data to be logged.
  80879. * @returns {String}
  80880. */
  80881. function logWarning( errorName, data ) {
  80882. console.warn( ...formatConsoleArguments( errorName, data ) );
  80883. }
  80884. /**
  80885. * Logs an error to the console with properly formatted message and adds a link to the documentation.
  80886. * Use whenever you want to log a error to the console.
  80887. *
  80888. * /**
  80889. * * There was a problem processing the configuration of the toolbar. The item with the given
  80890. * * name does not exist, so it was omitted when rendering the toolbar.
  80891. * *
  80892. * * @error toolbarview-item-unavailable
  80893. * * @param {String} name The name of the component.
  80894. * * /
  80895. * logError( 'toolbarview-item-unavailable', { name } );
  80896. *
  80897. * **Note**: In most cases logging a warning using {@link module:utils/ckeditorerror~logWarning} is enough.
  80898. *
  80899. * See also {@link module:utils/ckeditorerror~CKEditorError} for an explanation when to use each method.
  80900. *
  80901. * @param {String} errorName Error name to be logged.
  80902. * @param {Object} [data] Additional data to be logged.
  80903. * @returns {String}
  80904. */
  80905. function logError( errorName, data ) {
  80906. console.error( ...formatConsoleArguments( errorName, data ) );
  80907. }
  80908. function getLinkToDocumentationMessage( errorName ) {
  80909. return `\nRead more: ${ DOCUMENTATION_URL }#error-${ errorName }`;
  80910. }
  80911. function formatConsoleArguments( errorName, data ) {
  80912. const documentationMessage = getLinkToDocumentationMessage( errorName );
  80913. return data ? [ errorName, data, documentationMessage ] : [ errorName, documentationMessage ];
  80914. }
  80915. /***/ }),
  80916. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/collection.js":
  80917. /*!******************************************************************!*\
  80918. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/collection.js ***!
  80919. \******************************************************************/
  80920. /*! exports provided: default */
  80921. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  80922. "use strict";
  80923. __webpack_require__.r(__webpack_exports__);
  80924. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Collection; });
  80925. /* harmony import */ var _emittermixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  80926. /* harmony import */ var _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  80927. /* harmony import */ var _uid__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./uid */ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js");
  80928. /* harmony import */ var _isiterable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
  80929. /* harmony import */ var _mix__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  80930. /**
  80931. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  80932. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  80933. */
  80934. /**
  80935. * @module utils/collection
  80936. */
  80937. /**
  80938. * Collections are ordered sets of objects. Items in the collection can be retrieved by their indexes
  80939. * in the collection (like in an array) or by their ids.
  80940. *
  80941. * If an object without an `id` property is being added to the collection, the `id` property will be generated
  80942. * automatically. Note that the automatically generated id is unique only within this single collection instance.
  80943. *
  80944. * By default an item in the collection is identified by its `id` property. The name of the identifier can be
  80945. * configured through the constructor of the collection.
  80946. *
  80947. * @mixes module:utils/emittermixin~EmitterMixin
  80948. */
  80949. class Collection {
  80950. /**
  80951. * Creates a new Collection instance.
  80952. *
  80953. * You can provide an iterable of initial items the collection will be created with:
  80954. *
  80955. * const collection = new Collection( [ { id: 'John' }, { id: 'Mike' } ] );
  80956. *
  80957. * console.log( collection.get( 0 ) ); // -> { id: 'John' }
  80958. * console.log( collection.get( 1 ) ); // -> { id: 'Mike' }
  80959. * console.log( collection.get( 'Mike' ) ); // -> { id: 'Mike' }
  80960. *
  80961. * Or you can first create a collection and then add new items using the {@link #add} method:
  80962. *
  80963. * const collection = new Collection();
  80964. *
  80965. * collection.add( { id: 'John' } );
  80966. * console.log( collection.get( 0 ) ); // -> { id: 'John' }
  80967. *
  80968. * Whatever option you choose, you can always pass a configuration object as the last argument
  80969. * of the constructor:
  80970. *
  80971. * const emptyCollection = new Collection( { idProperty: 'name' } );
  80972. * emptyCollection.add( { name: 'John' } );
  80973. * console.log( collection.get( 'John' ) ); // -> { name: 'John' }
  80974. *
  80975. * const nonEmptyCollection = new Collection( [ { name: 'John' } ], { idProperty: 'name' } );
  80976. * nonEmptyCollection.add( { name: 'George' } );
  80977. * console.log( collection.get( 'George' ) ); // -> { name: 'George' }
  80978. * console.log( collection.get( 'John' ) ); // -> { name: 'John' }
  80979. *
  80980. * @param {Iterable.<Object>|Object} initialItemsOrOptions The initial items of the collection or
  80981. * the options object.
  80982. * @param {Object} [options={}] The options object, when the first argument is an array of initial items.
  80983. * @param {String} [options.idProperty='id'] The name of the property which is used to identify an item.
  80984. * Items that do not have such a property will be assigned one when added to the collection.
  80985. */
  80986. constructor( initialItemsOrOptions = {}, options = {} ) {
  80987. const hasInitialItems = Object(_isiterable__WEBPACK_IMPORTED_MODULE_3__["default"])( initialItemsOrOptions );
  80988. if ( !hasInitialItems ) {
  80989. options = initialItemsOrOptions;
  80990. }
  80991. /**
  80992. * The internal list of items in the collection.
  80993. *
  80994. * @private
  80995. * @member {Object[]}
  80996. */
  80997. this._items = [];
  80998. /**
  80999. * The internal map of items in the collection.
  81000. *
  81001. * @private
  81002. * @member {Map}
  81003. */
  81004. this._itemMap = new Map();
  81005. /**
  81006. * The name of the property which is considered to identify an item.
  81007. *
  81008. * @private
  81009. * @member {String}
  81010. */
  81011. this._idProperty = options.idProperty || 'id';
  81012. /**
  81013. * A helper mapping external items of a bound collection ({@link #bindTo})
  81014. * and actual items of this collection. It provides information
  81015. * necessary to properly remove items bound to another collection.
  81016. *
  81017. * See {@link #_bindToInternalToExternalMap}.
  81018. *
  81019. * @protected
  81020. * @member {WeakMap}
  81021. */
  81022. this._bindToExternalToInternalMap = new WeakMap();
  81023. /**
  81024. * A helper mapping items of this collection to external items of a bound collection
  81025. * ({@link #bindTo}). It provides information necessary to manage the bindings, e.g.
  81026. * to avoid loops in two–way bindings.
  81027. *
  81028. * See {@link #_bindToExternalToInternalMap}.
  81029. *
  81030. * @protected
  81031. * @member {WeakMap}
  81032. */
  81033. this._bindToInternalToExternalMap = new WeakMap();
  81034. /**
  81035. * Stores indexes of skipped items from bound external collection.
  81036. *
  81037. * @private
  81038. * @member {Array}
  81039. */
  81040. this._skippedIndexesFromExternal = [];
  81041. // Set the initial content of the collection (if provided in the constructor).
  81042. if ( hasInitialItems ) {
  81043. for ( const item of initialItemsOrOptions ) {
  81044. this._items.push( item );
  81045. this._itemMap.set( this._getItemIdBeforeAdding( item ), item );
  81046. }
  81047. }
  81048. /**
  81049. * A collection instance this collection is bound to as a result
  81050. * of calling {@link #bindTo} method.
  81051. *
  81052. * @protected
  81053. * @member {module:utils/collection~Collection} #_bindToCollection
  81054. */
  81055. }
  81056. /**
  81057. * The number of items available in the collection.
  81058. *
  81059. * @member {Number} #length
  81060. */
  81061. get length() {
  81062. return this._items.length;
  81063. }
  81064. /**
  81065. * Returns the first item from the collection or null when collection is empty.
  81066. *
  81067. * @returns {Object|null} The first item or `null` if collection is empty.
  81068. */
  81069. get first() {
  81070. return this._items[ 0 ] || null;
  81071. }
  81072. /**
  81073. * Returns the last item from the collection or null when collection is empty.
  81074. *
  81075. * @returns {Object|null} The last item or `null` if collection is empty.
  81076. */
  81077. get last() {
  81078. return this._items[ this.length - 1 ] || null;
  81079. }
  81080. /**
  81081. * Adds an item into the collection.
  81082. *
  81083. * If the item does not have an id, then it will be automatically generated and set on the item.
  81084. *
  81085. * @chainable
  81086. * @param {Object} item
  81087. * @param {Number} [index] The position of the item in the collection. The item
  81088. * is pushed to the collection when `index` not specified.
  81089. * @fires add
  81090. * @fires change
  81091. */
  81092. add( item, index ) {
  81093. return this.addMany( [ item ], index );
  81094. }
  81095. /**
  81096. * Adds multiple items into the collection.
  81097. *
  81098. * Any item not containing an id will get an automatically generated one.
  81099. *
  81100. * @chainable
  81101. * @param {Iterable.<Object>} item
  81102. * @param {Number} [index] The position of the insertion. Items will be appended if no `index` is specified.
  81103. * @fires add
  81104. * @fires change
  81105. */
  81106. addMany( items, index ) {
  81107. if ( index === undefined ) {
  81108. index = this._items.length;
  81109. } else if ( index > this._items.length || index < 0 ) {
  81110. /**
  81111. * The `index` passed to {@link module:utils/collection~Collection#addMany `Collection#addMany()`}
  81112. * is invalid. It must be a number between 0 and the collection's length.
  81113. *
  81114. * @error collection-add-item-invalid-index
  81115. */
  81116. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'collection-add-item-invalid-index', this );
  81117. }
  81118. for ( let offset = 0; offset < items.length; offset++ ) {
  81119. const item = items[ offset ];
  81120. const itemId = this._getItemIdBeforeAdding( item );
  81121. const currentItemIndex = index + offset;
  81122. this._items.splice( currentItemIndex, 0, item );
  81123. this._itemMap.set( itemId, item );
  81124. this.fire( 'add', item, currentItemIndex );
  81125. }
  81126. this.fire( 'change', {
  81127. added: items,
  81128. removed: [],
  81129. index
  81130. } );
  81131. return this;
  81132. }
  81133. /**
  81134. * Gets an item by its ID or index.
  81135. *
  81136. * @param {String|Number} idOrIndex The item ID or index in the collection.
  81137. * @returns {Object|null} The requested item or `null` if such item does not exist.
  81138. */
  81139. get( idOrIndex ) {
  81140. let item;
  81141. if ( typeof idOrIndex == 'string' ) {
  81142. item = this._itemMap.get( idOrIndex );
  81143. } else if ( typeof idOrIndex == 'number' ) {
  81144. item = this._items[ idOrIndex ];
  81145. } else {
  81146. /**
  81147. * An index or ID must be given.
  81148. *
  81149. * @error collection-get-invalid-arg
  81150. */
  81151. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'collection-get-invalid-arg', this );
  81152. }
  81153. return item || null;
  81154. }
  81155. /**
  81156. * Returns a Boolean indicating whether the collection contains an item.
  81157. *
  81158. * @param {Object|String} itemOrId The item or its ID in the collection.
  81159. * @returns {Boolean} `true` if the collection contains the item, `false` otherwise.
  81160. */
  81161. has( itemOrId ) {
  81162. if ( typeof itemOrId == 'string' ) {
  81163. return this._itemMap.has( itemOrId );
  81164. } else { // Object
  81165. const idProperty = this._idProperty;
  81166. const id = itemOrId[ idProperty ];
  81167. return this._itemMap.has( id );
  81168. }
  81169. }
  81170. /**
  81171. * Gets an index of an item in the collection.
  81172. * When an item is not defined in the collection, the index will equal -1.
  81173. *
  81174. * @param {Object|String} itemOrId The item or its ID in the collection.
  81175. * @returns {Number} The index of a given item.
  81176. */
  81177. getIndex( itemOrId ) {
  81178. let item;
  81179. if ( typeof itemOrId == 'string' ) {
  81180. item = this._itemMap.get( itemOrId );
  81181. } else {
  81182. item = itemOrId;
  81183. }
  81184. return this._items.indexOf( item );
  81185. }
  81186. /**
  81187. * Removes an item from the collection.
  81188. *
  81189. * @param {Object|Number|String} subject The item to remove, its ID or index in the collection.
  81190. * @returns {Object} The removed item.
  81191. * @fires remove
  81192. * @fires change
  81193. */
  81194. remove( subject ) {
  81195. const [ item, index ] = this._remove( subject );
  81196. this.fire( 'change', {
  81197. added: [],
  81198. removed: [ item ],
  81199. index
  81200. } );
  81201. return item;
  81202. }
  81203. /**
  81204. * Executes the callback for each item in the collection and composes an array or values returned by this callback.
  81205. *
  81206. * @param {Function} callback
  81207. * @param {Object} callback.item
  81208. * @param {Number} callback.index
  81209. * @param {Object} ctx Context in which the `callback` will be called.
  81210. * @returns {Array} The result of mapping.
  81211. */
  81212. map( callback, ctx ) {
  81213. return this._items.map( callback, ctx );
  81214. }
  81215. /**
  81216. * Finds the first item in the collection for which the `callback` returns a true value.
  81217. *
  81218. * @param {Function} callback
  81219. * @param {Object} callback.item
  81220. * @param {Number} callback.index
  81221. * @param {Object} ctx Context in which the `callback` will be called.
  81222. * @returns {Object} The item for which `callback` returned a true value.
  81223. */
  81224. find( callback, ctx ) {
  81225. return this._items.find( callback, ctx );
  81226. }
  81227. /**
  81228. * Returns an array with items for which the `callback` returned a true value.
  81229. *
  81230. * @param {Function} callback
  81231. * @param {Object} callback.item
  81232. * @param {Number} callback.index
  81233. * @param {Object} ctx Context in which the `callback` will be called.
  81234. * @returns {Object[]} The array with matching items.
  81235. */
  81236. filter( callback, ctx ) {
  81237. return this._items.filter( callback, ctx );
  81238. }
  81239. /**
  81240. * Removes all items from the collection and destroys the binding created using
  81241. * {@link #bindTo}.
  81242. *
  81243. * @fires remove
  81244. * @fires change
  81245. */
  81246. clear() {
  81247. if ( this._bindToCollection ) {
  81248. this.stopListening( this._bindToCollection );
  81249. this._bindToCollection = null;
  81250. }
  81251. const removedItems = Array.from( this._items );
  81252. while ( this.length ) {
  81253. this._remove( 0 );
  81254. }
  81255. this.fire( 'change', {
  81256. added: [],
  81257. removed: removedItems,
  81258. index: 0
  81259. } );
  81260. }
  81261. /**
  81262. * Binds and synchronizes the collection with another one.
  81263. *
  81264. * The binding can be a simple factory:
  81265. *
  81266. * class FactoryClass {
  81267. * constructor( data ) {
  81268. * this.label = data.label;
  81269. * }
  81270. * }
  81271. *
  81272. * const source = new Collection( { idProperty: 'label' } );
  81273. * const target = new Collection();
  81274. *
  81275. * target.bindTo( source ).as( FactoryClass );
  81276. *
  81277. * source.add( { label: 'foo' } );
  81278. * source.add( { label: 'bar' } );
  81279. *
  81280. * console.log( target.length ); // 2
  81281. * console.log( target.get( 1 ).label ); // 'bar'
  81282. *
  81283. * source.remove( 0 );
  81284. * console.log( target.length ); // 1
  81285. * console.log( target.get( 0 ).label ); // 'bar'
  81286. *
  81287. * or the factory driven by a custom callback:
  81288. *
  81289. * class FooClass {
  81290. * constructor( data ) {
  81291. * this.label = data.label;
  81292. * }
  81293. * }
  81294. *
  81295. * class BarClass {
  81296. * constructor( data ) {
  81297. * this.label = data.label;
  81298. * }
  81299. * }
  81300. *
  81301. * const source = new Collection( { idProperty: 'label' } );
  81302. * const target = new Collection();
  81303. *
  81304. * target.bindTo( source ).using( ( item ) => {
  81305. * if ( item.label == 'foo' ) {
  81306. * return new FooClass( item );
  81307. * } else {
  81308. * return new BarClass( item );
  81309. * }
  81310. * } );
  81311. *
  81312. * source.add( { label: 'foo' } );
  81313. * source.add( { label: 'bar' } );
  81314. *
  81315. * console.log( target.length ); // 2
  81316. * console.log( target.get( 0 ) instanceof FooClass ); // true
  81317. * console.log( target.get( 1 ) instanceof BarClass ); // true
  81318. *
  81319. * or the factory out of property name:
  81320. *
  81321. * const source = new Collection( { idProperty: 'label' } );
  81322. * const target = new Collection();
  81323. *
  81324. * target.bindTo( source ).using( 'label' );
  81325. *
  81326. * source.add( { label: { value: 'foo' } } );
  81327. * source.add( { label: { value: 'bar' } } );
  81328. *
  81329. * console.log( target.length ); // 2
  81330. * console.log( target.get( 0 ).value ); // 'foo'
  81331. * console.log( target.get( 1 ).value ); // 'bar'
  81332. *
  81333. * It's possible to skip specified items by returning falsy value:
  81334. *
  81335. * const source = new Collection();
  81336. * const target = new Collection();
  81337. *
  81338. * target.bindTo( source ).using( item => {
  81339. * if ( item.hidden ) {
  81340. * return null;
  81341. * }
  81342. *
  81343. * return item;
  81344. * } );
  81345. *
  81346. * source.add( { hidden: true } );
  81347. * source.add( { hidden: false } );
  81348. *
  81349. * console.log( source.length ); // 2
  81350. * console.log( target.length ); // 1
  81351. *
  81352. * **Note**: {@link #clear} can be used to break the binding.
  81353. *
  81354. * @param {module:utils/collection~Collection} externalCollection A collection to be bound.
  81355. * @returns {Object}
  81356. * @returns {module:utils/collection~CollectionBindToChain} The binding chain object.
  81357. */
  81358. bindTo( externalCollection ) {
  81359. if ( this._bindToCollection ) {
  81360. /**
  81361. * The collection cannot be bound more than once.
  81362. *
  81363. * @error collection-bind-to-rebind
  81364. */
  81365. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'collection-bind-to-rebind', this );
  81366. }
  81367. this._bindToCollection = externalCollection;
  81368. return {
  81369. as: Class => {
  81370. this._setUpBindToBinding( item => new Class( item ) );
  81371. },
  81372. using: callbackOrProperty => {
  81373. if ( typeof callbackOrProperty == 'function' ) {
  81374. this._setUpBindToBinding( item => callbackOrProperty( item ) );
  81375. } else {
  81376. this._setUpBindToBinding( item => item[ callbackOrProperty ] );
  81377. }
  81378. }
  81379. };
  81380. }
  81381. /**
  81382. * Finalizes and activates a binding initiated by {#bindTo}.
  81383. *
  81384. * @protected
  81385. * @param {Function} factory A function which produces collection items.
  81386. */
  81387. _setUpBindToBinding( factory ) {
  81388. const externalCollection = this._bindToCollection;
  81389. // Adds the item to the collection once a change has been done to the external collection.
  81390. //
  81391. // @private
  81392. const addItem = ( evt, externalItem, index ) => {
  81393. const isExternalBoundToThis = externalCollection._bindToCollection == this;
  81394. const externalItemBound = externalCollection._bindToInternalToExternalMap.get( externalItem );
  81395. // If an external collection is bound to this collection, which makes it a 2–way binding,
  81396. // and the particular external collection item is already bound, don't add it here.
  81397. // The external item has been created **out of this collection's item** and (re)adding it will
  81398. // cause a loop.
  81399. if ( isExternalBoundToThis && externalItemBound ) {
  81400. this._bindToExternalToInternalMap.set( externalItem, externalItemBound );
  81401. this._bindToInternalToExternalMap.set( externalItemBound, externalItem );
  81402. } else {
  81403. const item = factory( externalItem );
  81404. // When there is no item we need to remember skipped index first and then we can skip this item.
  81405. if ( !item ) {
  81406. this._skippedIndexesFromExternal.push( index );
  81407. return;
  81408. }
  81409. // Lets try to put item at the same index as index in external collection
  81410. // but when there are a skipped items in one or both collections we need to recalculate this index.
  81411. let finalIndex = index;
  81412. // When we try to insert item after some skipped items from external collection we need
  81413. // to include this skipped items and decrease index.
  81414. //
  81415. // For the following example:
  81416. // external -> [ 'A', 'B - skipped for internal', 'C - skipped for internal' ]
  81417. // internal -> [ A ]
  81418. //
  81419. // Another item is been added at the end of external collection:
  81420. // external.add( 'D' )
  81421. // external -> [ 'A', 'B - skipped for internal', 'C - skipped for internal', 'D' ]
  81422. //
  81423. // We can't just add 'D' to internal at the same index as index in external because
  81424. // this will produce empty indexes what is invalid:
  81425. // internal -> [ 'A', empty, empty, 'D' ]
  81426. //
  81427. // So we need to include skipped items and decrease index
  81428. // internal -> [ 'A', 'D' ]
  81429. for ( const skipped of this._skippedIndexesFromExternal ) {
  81430. if ( index > skipped ) {
  81431. finalIndex--;
  81432. }
  81433. }
  81434. // We need to take into consideration that external collection could skip some items from
  81435. // internal collection.
  81436. //
  81437. // For the following example:
  81438. // internal -> [ 'A', 'B - skipped for external', 'C - skipped for external' ]
  81439. // external -> [ A ]
  81440. //
  81441. // Another item is been added at the end of external collection:
  81442. // external.add( 'D' )
  81443. // external -> [ 'A', 'D' ]
  81444. //
  81445. // We need to include skipped items and place new item after them:
  81446. // internal -> [ 'A', 'B - skipped for external', 'C - skipped for external', 'D' ]
  81447. for ( const skipped of externalCollection._skippedIndexesFromExternal ) {
  81448. if ( finalIndex >= skipped ) {
  81449. finalIndex++;
  81450. }
  81451. }
  81452. this._bindToExternalToInternalMap.set( externalItem, item );
  81453. this._bindToInternalToExternalMap.set( item, externalItem );
  81454. this.add( item, finalIndex );
  81455. // After adding new element to internal collection we need update indexes
  81456. // of skipped items in external collection.
  81457. for ( let i = 0; i < externalCollection._skippedIndexesFromExternal.length; i++ ) {
  81458. if ( finalIndex <= externalCollection._skippedIndexesFromExternal[ i ] ) {
  81459. externalCollection._skippedIndexesFromExternal[ i ]++;
  81460. }
  81461. }
  81462. }
  81463. };
  81464. // Load the initial content of the collection.
  81465. for ( const externalItem of externalCollection ) {
  81466. addItem( null, externalItem, externalCollection.getIndex( externalItem ) );
  81467. }
  81468. // Synchronize the with collection as new items are added.
  81469. this.listenTo( externalCollection, 'add', addItem );
  81470. // Synchronize the with collection as new items are removed.
  81471. this.listenTo( externalCollection, 'remove', ( evt, externalItem, index ) => {
  81472. const item = this._bindToExternalToInternalMap.get( externalItem );
  81473. if ( item ) {
  81474. this.remove( item );
  81475. }
  81476. // After removing element from external collection we need update/remove indexes
  81477. // of skipped items in internal collection.
  81478. this._skippedIndexesFromExternal = this._skippedIndexesFromExternal.reduce( ( result, skipped ) => {
  81479. if ( index < skipped ) {
  81480. result.push( skipped - 1 );
  81481. }
  81482. if ( index > skipped ) {
  81483. result.push( skipped );
  81484. }
  81485. return result;
  81486. }, [] );
  81487. } );
  81488. }
  81489. /**
  81490. * Returns an unique id property for a given `item`.
  81491. *
  81492. * The method will generate new id and assign it to the `item` if it doesn't have any.
  81493. *
  81494. * @private
  81495. * @param {Object} item Item to be added.
  81496. * @returns {String}
  81497. */
  81498. _getItemIdBeforeAdding( item ) {
  81499. const idProperty = this._idProperty;
  81500. let itemId;
  81501. if ( ( idProperty in item ) ) {
  81502. itemId = item[ idProperty ];
  81503. if ( typeof itemId != 'string' ) {
  81504. /**
  81505. * This item's ID should be a string.
  81506. *
  81507. * @error collection-add-invalid-id
  81508. */
  81509. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'collection-add-invalid-id', this );
  81510. }
  81511. if ( this.get( itemId ) ) {
  81512. /**
  81513. * This item already exists in the collection.
  81514. *
  81515. * @error collection-add-item-already-exists
  81516. */
  81517. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'collection-add-item-already-exists', this );
  81518. }
  81519. } else {
  81520. item[ idProperty ] = itemId = Object(_uid__WEBPACK_IMPORTED_MODULE_2__["default"])();
  81521. }
  81522. return itemId;
  81523. }
  81524. /**
  81525. * Core {@link #remove} method implementation shared in other functions.
  81526. *
  81527. * In contrast this method **does not** fire the {@link #event:change} event.
  81528. *
  81529. * @private
  81530. * @param {Object} subject The item to remove, its id or index in the collection.
  81531. * @returns {Array} Returns an array with the removed item and its index.
  81532. * @fires remove
  81533. */
  81534. _remove( subject ) {
  81535. let index, id, item;
  81536. let itemDoesNotExist = false;
  81537. const idProperty = this._idProperty;
  81538. if ( typeof subject == 'string' ) {
  81539. id = subject;
  81540. item = this._itemMap.get( id );
  81541. itemDoesNotExist = !item;
  81542. if ( item ) {
  81543. index = this._items.indexOf( item );
  81544. }
  81545. } else if ( typeof subject == 'number' ) {
  81546. index = subject;
  81547. item = this._items[ index ];
  81548. itemDoesNotExist = !item;
  81549. if ( item ) {
  81550. id = item[ idProperty ];
  81551. }
  81552. } else {
  81553. item = subject;
  81554. id = item[ idProperty ];
  81555. index = this._items.indexOf( item );
  81556. itemDoesNotExist = ( index == -1 || !this._itemMap.get( id ) );
  81557. }
  81558. if ( itemDoesNotExist ) {
  81559. /**
  81560. * Item not found.
  81561. *
  81562. * @error collection-remove-404
  81563. */
  81564. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'collection-remove-404', this );
  81565. }
  81566. this._items.splice( index, 1 );
  81567. this._itemMap.delete( id );
  81568. const externalItem = this._bindToInternalToExternalMap.get( item );
  81569. this._bindToInternalToExternalMap.delete( item );
  81570. this._bindToExternalToInternalMap.delete( externalItem );
  81571. this.fire( 'remove', item, index );
  81572. return [ item, index ];
  81573. }
  81574. /**
  81575. * Iterable interface.
  81576. *
  81577. * @returns {Iterable.<*>}
  81578. */
  81579. [ Symbol.iterator ]() {
  81580. return this._items[ Symbol.iterator ]();
  81581. }
  81582. /**
  81583. * Fired when an item is added to the collection.
  81584. *
  81585. * @event add
  81586. * @param {Object} item The added item.
  81587. */
  81588. /**
  81589. * Fired when the collection was changed due to adding or removing items.
  81590. *
  81591. * @event change
  81592. * @param {Iterable.<Object>} added A list of added items.
  81593. * @param {Iterable.<Object>} removed A list of removed items.
  81594. * @param {Number} index An index where the addition or removal occurred.
  81595. */
  81596. /**
  81597. * Fired when an item is removed from the collection.
  81598. *
  81599. * @event remove
  81600. * @param {Object} item The removed item.
  81601. * @param {Number} index Index from which item was removed.
  81602. */
  81603. }
  81604. Object(_mix__WEBPACK_IMPORTED_MODULE_4__["default"])( Collection, _emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
  81605. /**
  81606. * An object returned by the {@link module:utils/collection~Collection#bindTo `bindTo()`} method
  81607. * providing functions that specify the type of the binding.
  81608. *
  81609. * See the {@link module:utils/collection~Collection#bindTo `bindTo()`} documentation for examples.
  81610. *
  81611. * @interface module:utils/collection~CollectionBindToChain
  81612. */
  81613. /**
  81614. * Creates a callback or a property binding.
  81615. *
  81616. * @method #using
  81617. * @param {Function|String} callbackOrProperty When the function is passed, it should return
  81618. * the collection items. When the string is provided, the property value is used to create the bound collection items.
  81619. */
  81620. /**
  81621. * Creates the class factory binding in which items of the source collection are passed to
  81622. * the constructor of the specified class.
  81623. *
  81624. * @method #as
  81625. * @param {Function} Class The class constructor used to create instances in the factory.
  81626. */
  81627. /***/ }),
  81628. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.js":
  81629. /*!*********************************************************************!*\
  81630. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.js ***!
  81631. \*********************************************************************/
  81632. /*! exports provided: default */
  81633. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  81634. "use strict";
  81635. __webpack_require__.r(__webpack_exports__);
  81636. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return compareArrays; });
  81637. /**
  81638. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  81639. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  81640. */
  81641. /**
  81642. * @module utils/comparearrays
  81643. */
  81644. /**
  81645. * Compares how given arrays relate to each other. One array can be: same as another array, prefix of another array
  81646. * or completely different. If arrays are different, first index at which they differ is returned. Otherwise,
  81647. * a flag specifying the relation is returned. Flags are negative numbers, so whenever a number >= 0 is returned
  81648. * it means that arrays differ.
  81649. *
  81650. * compareArrays( [ 0, 2 ], [ 0, 2 ] ); // 'same'
  81651. * compareArrays( [ 0, 2 ], [ 0, 2, 1 ] ); // 'prefix'
  81652. * compareArrays( [ 0, 2 ], [ 0 ] ); // 'extension'
  81653. * compareArrays( [ 0, 2 ], [ 1, 2 ] ); // 0
  81654. * compareArrays( [ 0, 2 ], [ 0, 1 ] ); // 1
  81655. *
  81656. * @param {Array} a Array that is compared.
  81657. * @param {Array} b Array to compare with.
  81658. * @returns {module:utils/comparearrays~ArrayRelation} How array `a` is related to `b`.
  81659. */
  81660. function compareArrays( a, b ) {
  81661. const minLen = Math.min( a.length, b.length );
  81662. for ( let i = 0; i < minLen; i++ ) {
  81663. if ( a[ i ] != b[ i ] ) {
  81664. // The arrays are different.
  81665. return i;
  81666. }
  81667. }
  81668. // Both arrays were same at all points.
  81669. if ( a.length == b.length ) {
  81670. // If their length is also same, they are the same.
  81671. return 'same';
  81672. } else if ( a.length < b.length ) {
  81673. // Compared array is shorter so it is a prefix of the other array.
  81674. return 'prefix';
  81675. } else {
  81676. // Compared array is longer so it is an extension of the other array.
  81677. return 'extension';
  81678. }
  81679. }
  81680. /**
  81681. * @typedef {'extension'|'same'|'prefix'} module:utils/comparearrays~ArrayRelation
  81682. */
  81683. /***/ }),
  81684. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/config.js":
  81685. /*!**************************************************************!*\
  81686. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/config.js ***!
  81687. \**************************************************************/
  81688. /*! exports provided: default */
  81689. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  81690. "use strict";
  81691. __webpack_require__.r(__webpack_exports__);
  81692. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Config; });
  81693. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  81694. /**
  81695. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  81696. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  81697. */
  81698. /**
  81699. * @module utils/config
  81700. */
  81701. /**
  81702. * Handles a configuration dictionary.
  81703. */
  81704. class Config {
  81705. /**
  81706. * Creates an instance of the {@link ~Config} class.
  81707. *
  81708. * @param {Object} [configurations] The initial configurations to be set. Usually, provided by the user.
  81709. * @param {Object} [defaultConfigurations] The default configurations. Usually, provided by the system.
  81710. */
  81711. constructor( configurations, defaultConfigurations ) {
  81712. /**
  81713. * Store for the whole configuration.
  81714. *
  81715. * @private
  81716. * @member {Object}
  81717. */
  81718. this._config = {};
  81719. // Set default configuration.
  81720. if ( defaultConfigurations ) {
  81721. // Clone the configuration to make sure that the properties will not be shared
  81722. // between editors and make the watchdog feature work correctly.
  81723. this.define( cloneConfig( defaultConfigurations ) );
  81724. }
  81725. // Set initial configuration.
  81726. if ( configurations ) {
  81727. this._setObjectToTarget( this._config, configurations );
  81728. }
  81729. }
  81730. /**
  81731. * Set configuration values.
  81732. *
  81733. * It accepts both a name/value pair or an object, which properties and values will be used to set
  81734. * configurations.
  81735. *
  81736. * It also accepts setting a "deep configuration" by using dots in the name. For example, `'resize.width'` sets
  81737. * the value for the `width` configuration in the `resize` subset.
  81738. *
  81739. * config.set( 'width', 500 );
  81740. * config.set( 'toolbar.collapsed', true );
  81741. *
  81742. * // Equivalent to:
  81743. * config.set( {
  81744. * width: 500
  81745. * toolbar: {
  81746. * collapsed: true
  81747. * }
  81748. * } );
  81749. *
  81750. * Passing an object as the value will amend the configuration, not replace it.
  81751. *
  81752. * config.set( 'toolbar', {
  81753. * collapsed: true,
  81754. * } );
  81755. *
  81756. * config.set( 'toolbar', {
  81757. * color: 'red',
  81758. * } );
  81759. *
  81760. * config.get( 'toolbar.collapsed' ); // true
  81761. * config.get( 'toolbar.color' ); // 'red'
  81762. *
  81763. * @param {String|Object} name The configuration name or an object from which take properties as
  81764. * configuration entries. Configuration names are case-sensitive.
  81765. * @param {*} value The configuration value. Used if a name is passed.
  81766. */
  81767. set( name, value ) {
  81768. this._setToTarget( this._config, name, value );
  81769. }
  81770. /**
  81771. * Does exactly the same as {@link #set} with one exception – passed configuration extends
  81772. * existing one, but does not overwrite already defined values.
  81773. *
  81774. * This method is supposed to be called by plugin developers to setup plugin's configurations. It would be
  81775. * rarely used for other needs.
  81776. *
  81777. * @param {String|Object} name The configuration name or an object from which take properties as
  81778. * configuration entries. Configuration names are case-sensitive.
  81779. * @param {*} value The configuration value. Used if a name is passed.
  81780. */
  81781. define( name, value ) {
  81782. const isDefine = true;
  81783. this._setToTarget( this._config, name, value, isDefine );
  81784. }
  81785. /**
  81786. * Gets the value for a configuration entry.
  81787. *
  81788. * config.get( 'name' );
  81789. *
  81790. * Deep configurations can be retrieved by separating each part with a dot.
  81791. *
  81792. * config.get( 'toolbar.collapsed' );
  81793. *
  81794. * @param {String} name The configuration name. Configuration names are case-sensitive.
  81795. * @returns {*} The configuration value or `undefined` if the configuration entry was not found.
  81796. */
  81797. get( name ) {
  81798. return this._getFromSource( this._config, name );
  81799. }
  81800. /**
  81801. * Iterates over all top level configuration names.
  81802. *
  81803. * @returns {Iterable.<String>}
  81804. */
  81805. * names() {
  81806. for ( const name of Object.keys( this._config ) ) {
  81807. yield name;
  81808. }
  81809. }
  81810. /**
  81811. * Saves passed configuration to the specified target (nested object).
  81812. *
  81813. * @private
  81814. * @param {Object} target Nested config object.
  81815. * @param {String|Object} name The configuration name or an object from which take properties as
  81816. * configuration entries. Configuration names are case-sensitive.
  81817. * @param {*} value The configuration value. Used if a name is passed.
  81818. * @param {Boolean} [isDefine=false] Define if passed configuration should overwrite existing one.
  81819. */
  81820. _setToTarget( target, name, value, isDefine = false ) {
  81821. // In case of an object, iterate through it and call `_setToTarget` again for each property.
  81822. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isPlainObject"])( name ) ) {
  81823. this._setObjectToTarget( target, name, isDefine );
  81824. return;
  81825. }
  81826. // The configuration name should be split into parts if it has dots. E.g. `resize.width` -> [`resize`, `width`].
  81827. const parts = name.split( '.' );
  81828. // Take the name of the configuration out of the parts. E.g. `resize.width` -> `width`.
  81829. name = parts.pop();
  81830. // Iterate over parts to check if currently stored configuration has proper structure.
  81831. for ( const part of parts ) {
  81832. // If there is no object for specified part then create one.
  81833. if ( !Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isPlainObject"])( target[ part ] ) ) {
  81834. target[ part ] = {};
  81835. }
  81836. // Nested object becomes a target.
  81837. target = target[ part ];
  81838. }
  81839. // In case of value is an object.
  81840. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isPlainObject"])( value ) ) {
  81841. // We take care of proper config structure.
  81842. if ( !Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isPlainObject"])( target[ name ] ) ) {
  81843. target[ name ] = {};
  81844. }
  81845. target = target[ name ];
  81846. // And iterate through this object calling `_setToTarget` again for each property.
  81847. this._setObjectToTarget( target, value, isDefine );
  81848. return;
  81849. }
  81850. // Do nothing if we are defining configuration for non empty name.
  81851. if ( isDefine && typeof target[ name ] != 'undefined' ) {
  81852. return;
  81853. }
  81854. target[ name ] = value;
  81855. }
  81856. /**
  81857. * Get specified configuration from specified source (nested object).
  81858. *
  81859. * @private
  81860. * @param {Object} source level of nested object.
  81861. * @param {String} name The configuration name. Configuration names are case-sensitive.
  81862. * @returns {*} The configuration value or `undefined` if the configuration entry was not found.
  81863. */
  81864. _getFromSource( source, name ) {
  81865. // The configuration name should be split into parts if it has dots. E.g. `resize.width` -> [`resize`, `width`].
  81866. const parts = name.split( '.' );
  81867. // Take the name of the configuration out of the parts. E.g. `resize.width` -> `width`.
  81868. name = parts.pop();
  81869. // Iterate over parts to check if currently stored configuration has proper structure.
  81870. for ( const part of parts ) {
  81871. if ( !Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isPlainObject"])( source[ part ] ) ) {
  81872. source = null;
  81873. break;
  81874. }
  81875. // Nested object becomes a source.
  81876. source = source[ part ];
  81877. }
  81878. // Always returns undefined for non existing configuration.
  81879. return source ? cloneConfig( source[ name ] ) : undefined;
  81880. }
  81881. /**
  81882. * Iterates through passed object and calls {@link #_setToTarget} method with object key and value for each property.
  81883. *
  81884. * @private
  81885. * @param {Object} target Nested config object.
  81886. * @param {Object} configuration Configuration data set
  81887. * @param {Boolean} [isDefine] Defines if passed configuration is default configuration or not.
  81888. */
  81889. _setObjectToTarget( target, configuration, isDefine ) {
  81890. Object.keys( configuration ).forEach( key => {
  81891. this._setToTarget( target, key, configuration[ key ], isDefine );
  81892. } );
  81893. }
  81894. }
  81895. // Clones configuration object or value.
  81896. // @param {*} source Source configuration
  81897. // @returns {*} Cloned configuration value.
  81898. function cloneConfig( source ) {
  81899. return Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["cloneDeepWith"])( source, leaveDOMReferences );
  81900. }
  81901. // A customized function for cloneDeepWith.
  81902. // It will leave references to DOM Elements instead of cloning them.
  81903. //
  81904. // @param {*} value
  81905. // @returns {Element|undefined}
  81906. function leaveDOMReferences( value ) {
  81907. return Object(lodash_es__WEBPACK_IMPORTED_MODULE_0__["isElement"])( value ) ? value : undefined;
  81908. }
  81909. /***/ }),
  81910. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/count.js":
  81911. /*!*************************************************************!*\
  81912. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/count.js ***!
  81913. \*************************************************************/
  81914. /*! exports provided: default */
  81915. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  81916. "use strict";
  81917. __webpack_require__.r(__webpack_exports__);
  81918. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return count; });
  81919. /**
  81920. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  81921. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  81922. */
  81923. /**
  81924. * @module utils/count
  81925. */
  81926. /**
  81927. * Returns the number of items return by the iterator.
  81928. *
  81929. * count( [ 1, 2, 3, 4, 5 ] ); // 5;
  81930. *
  81931. * @param {Iterable.<*>} iterator Any iterator.
  81932. * @returns {Number} Number of items returned by that iterator.
  81933. */
  81934. function count( iterator ) {
  81935. let count = 0;
  81936. for ( const _ of iterator ) { // eslint-disable-line no-unused-vars
  81937. count++;
  81938. }
  81939. return count;
  81940. }
  81941. /***/ }),
  81942. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/diff.js":
  81943. /*!************************************************************!*\
  81944. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/diff.js ***!
  81945. \************************************************************/
  81946. /*! exports provided: default */
  81947. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  81948. "use strict";
  81949. __webpack_require__.r(__webpack_exports__);
  81950. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return diff; });
  81951. /* harmony import */ var _src_fastdiff__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../src/fastdiff */ "./node_modules/@ckeditor/ckeditor5-utils/src/fastdiff.js");
  81952. /**
  81953. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  81954. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  81955. */
  81956. /**
  81957. * @module utils/diff
  81958. */
  81959. // The following code is based on the "O(NP) Sequence Comparison Algorithm"
  81960. // by Sun Wu, Udi Manber, Gene Myers, Webb Miller.
  81961. /**
  81962. * Calculates the difference between two arrays or strings producing an array containing a list of changes
  81963. * necessary to transform input into output.
  81964. *
  81965. * diff( 'aba', 'acca' ); // [ 'equal', 'insert', 'insert', 'delete', 'equal' ]
  81966. *
  81967. * This function is based on the "O(NP) Sequence Comparison Algorithm" by Sun Wu, Udi Manber, Gene Myers, Webb Miller.
  81968. * Unfortunately, while it gives the most precise results, its to complex for longer strings/arrow (above 200 items).
  81969. * Therefore, `diff()` automatically switches to {@link module:utils/fastdiff~fastDiff `fastDiff()`} when detecting
  81970. * such a scenario. The return formats of both functions are identical.
  81971. *
  81972. * @param {Array|String} a Input array or string.
  81973. * @param {Array|String} b Output array or string.
  81974. * @param {Function} [cmp] Optional function used to compare array values, by default === is used.
  81975. * @returns {Array} Array of changes.
  81976. */
  81977. function diff( a, b, cmp ) {
  81978. // Set the comparator function.
  81979. cmp = cmp || function( a, b ) {
  81980. return a === b;
  81981. };
  81982. const aLength = a.length;
  81983. const bLength = b.length;
  81984. // Perform `fastDiff` for longer strings/arrays (see #269).
  81985. if ( aLength > 200 || bLength > 200 || aLength + bLength > 300 ) {
  81986. return diff.fastDiff( a, b, cmp, true );
  81987. }
  81988. // Temporary action type statics.
  81989. let _insert, _delete;
  81990. // Swapped the arrays to use the shorter one as the first one.
  81991. if ( bLength < aLength ) {
  81992. const tmp = a;
  81993. a = b;
  81994. b = tmp;
  81995. // We swap the action types as well.
  81996. _insert = 'delete';
  81997. _delete = 'insert';
  81998. } else {
  81999. _insert = 'insert';
  82000. _delete = 'delete';
  82001. }
  82002. const m = a.length;
  82003. const n = b.length;
  82004. const delta = n - m;
  82005. // Edit scripts, for each diagonal.
  82006. const es = {};
  82007. // Furthest points, the furthest y we can get on each diagonal.
  82008. const fp = {};
  82009. function snake( k ) {
  82010. // We use -1 as an alternative below to handle initial values ( instead of filling the fp with -1 first ).
  82011. // Furthest points (y) on the diagonal below k.
  82012. const y1 = ( fp[ k - 1 ] !== undefined ? fp[ k - 1 ] : -1 ) + 1;
  82013. // Furthest points (y) on the diagonal above k.
  82014. const y2 = fp[ k + 1 ] !== undefined ? fp[ k + 1 ] : -1;
  82015. // The way we should go to get further.
  82016. const dir = y1 > y2 ? -1 : 1;
  82017. // Clone previous changes array (if any).
  82018. if ( es[ k + dir ] ) {
  82019. es[ k ] = es[ k + dir ].slice( 0 );
  82020. }
  82021. // Create changes array.
  82022. if ( !es[ k ] ) {
  82023. es[ k ] = [];
  82024. }
  82025. // Push the action.
  82026. es[ k ].push( y1 > y2 ? _insert : _delete );
  82027. // Set the beginning coordinates.
  82028. let y = Math.max( y1, y2 );
  82029. let x = y - k;
  82030. // Traverse the diagonal as long as the values match.
  82031. while ( x < m && y < n && cmp( a[ x ], b[ y ] ) ) {
  82032. x++;
  82033. y++;
  82034. // Push no change action.
  82035. es[ k ].push( 'equal' );
  82036. }
  82037. return y;
  82038. }
  82039. let p = 0;
  82040. let k;
  82041. // Traverse the graph until we reach the end of the longer string.
  82042. do {
  82043. // Updates furthest points and edit scripts for diagonals below delta.
  82044. for ( k = -p; k < delta; k++ ) {
  82045. fp[ k ] = snake( k );
  82046. }
  82047. // Updates furthest points and edit scripts for diagonals above delta.
  82048. for ( k = delta + p; k > delta; k-- ) {
  82049. fp[ k ] = snake( k );
  82050. }
  82051. // Updates furthest point and edit script for the delta diagonal.
  82052. // note that the delta diagonal is the one which goes through the sink (m, n).
  82053. fp[ delta ] = snake( delta );
  82054. p++;
  82055. } while ( fp[ delta ] !== n );
  82056. // Return the final list of edit changes.
  82057. // We remove the first item that represents the action for the injected nulls.
  82058. return es[ delta ].slice( 1 );
  82059. }
  82060. // Store the API in static property to easily overwrite it in tests.
  82061. // Too bad dependency injection does not work in Webpack + ES 6 (const) + Babel.
  82062. diff.fastDiff = _src_fastdiff__WEBPACK_IMPORTED_MODULE_0__["default"];
  82063. /***/ }),
  82064. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/difftochanges.js":
  82065. /*!*********************************************************************!*\
  82066. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/difftochanges.js ***!
  82067. \*********************************************************************/
  82068. /*! exports provided: default */
  82069. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  82070. "use strict";
  82071. __webpack_require__.r(__webpack_exports__);
  82072. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return diffToChanges; });
  82073. /**
  82074. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  82075. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  82076. */
  82077. /**
  82078. * @module utils/difftochanges
  82079. */
  82080. /**
  82081. * Creates a set of changes which need to be applied to the input in order to transform
  82082. * it into the output. This function can be used with strings or arrays.
  82083. *
  82084. * const input = Array.from( 'abc' );
  82085. * const output = Array.from( 'xaby' );
  82086. * const changes = diffToChanges( diff( input, output ), output );
  82087. *
  82088. * changes.forEach( change => {
  82089. * if ( change.type == 'insert' ) {
  82090. * input.splice( change.index, 0, ...change.values );
  82091. * } else if ( change.type == 'delete' ) {
  82092. * input.splice( change.index, change.howMany );
  82093. * }
  82094. * } );
  82095. *
  82096. * input.join( '' ) == output.join( '' ); // -> true
  82097. *
  82098. * @param {Array.<'equal'|'insert'|'delete'>} diff Result of {@link module:utils/diff~diff}.
  82099. * @param {String|Array} output The string or array which was passed as diff's output.
  82100. * @returns {Array.<Object>} Set of changes (insert or delete) which need to be applied to the input
  82101. * in order to transform it into the output.
  82102. */
  82103. function diffToChanges( diff, output ) {
  82104. const changes = [];
  82105. let index = 0;
  82106. let lastOperation;
  82107. diff.forEach( change => {
  82108. if ( change == 'equal' ) {
  82109. pushLast();
  82110. index++;
  82111. } else if ( change == 'insert' ) {
  82112. if ( isContinuationOf( 'insert' ) ) {
  82113. lastOperation.values.push( output[ index ] );
  82114. } else {
  82115. pushLast();
  82116. lastOperation = {
  82117. type: 'insert',
  82118. index,
  82119. values: [ output[ index ] ]
  82120. };
  82121. }
  82122. index++;
  82123. } else /* if ( change == 'delete' ) */ {
  82124. if ( isContinuationOf( 'delete' ) ) {
  82125. lastOperation.howMany++;
  82126. } else {
  82127. pushLast();
  82128. lastOperation = {
  82129. type: 'delete',
  82130. index,
  82131. howMany: 1
  82132. };
  82133. }
  82134. }
  82135. } );
  82136. pushLast();
  82137. return changes;
  82138. function pushLast() {
  82139. if ( lastOperation ) {
  82140. changes.push( lastOperation );
  82141. lastOperation = null;
  82142. }
  82143. }
  82144. function isContinuationOf( expected ) {
  82145. return lastOperation && lastOperation.type == expected;
  82146. }
  82147. }
  82148. /***/ }),
  82149. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/createelement.js":
  82150. /*!*************************************************************************!*\
  82151. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/createelement.js ***!
  82152. \*************************************************************************/
  82153. /*! exports provided: default */
  82154. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  82155. "use strict";
  82156. __webpack_require__.r(__webpack_exports__);
  82157. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return createElement; });
  82158. /* harmony import */ var _isiterable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
  82159. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  82160. /**
  82161. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  82162. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  82163. */
  82164. /**
  82165. * @module utils/dom/createelement
  82166. */
  82167. /**
  82168. * Creates element with attributes and children.
  82169. *
  82170. * createElement( document, 'p' ); // <p>
  82171. * createElement( document, 'p', { class: 'foo' } ); // <p class="foo">
  82172. * createElement( document, 'p', null, 'foo' ); // <p>foo</p>
  82173. * createElement( document, 'p', null, [ 'foo', createElement( document, 'img' ) ] ); // <p>foo<img></p>
  82174. *
  82175. * @param {Document} doc Document used to create element.
  82176. * @param {String} name Name of the element.
  82177. * @param {Object} [attributes] Object keys will become attributes keys and object values will became attributes values.
  82178. * @param {Node|String|Array.<Node|String>} [children] Child or array of children. Strings will be automatically turned
  82179. * into Text nodes.
  82180. * @returns {Element} Created element.
  82181. */
  82182. function createElement( doc, name, attributes = {}, children = [] ) {
  82183. const namespace = attributes && attributes.xmlns;
  82184. const element = namespace ? doc.createElementNS( namespace, name ) : doc.createElement( name );
  82185. for ( const key in attributes ) {
  82186. element.setAttribute( key, attributes[ key ] );
  82187. }
  82188. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_1__["isString"])( children ) || !Object(_isiterable__WEBPACK_IMPORTED_MODULE_0__["default"])( children ) ) {
  82189. children = [ children ];
  82190. }
  82191. for ( let child of children ) {
  82192. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_1__["isString"])( child ) ) {
  82193. child = doc.createTextNode( child );
  82194. }
  82195. element.appendChild( child );
  82196. }
  82197. return element;
  82198. }
  82199. /***/ }),
  82200. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js":
  82201. /*!************************************************************************!*\
  82202. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js ***!
  82203. \************************************************************************/
  82204. /*! exports provided: default */
  82205. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  82206. "use strict";
  82207. __webpack_require__.r(__webpack_exports__);
  82208. /* harmony import */ var _emittermixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  82209. /* harmony import */ var _uid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../uid */ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js");
  82210. /* harmony import */ var _isnode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isnode */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/isnode.js");
  82211. /* harmony import */ var _iswindow__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./iswindow */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/iswindow.js");
  82212. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  82213. /**
  82214. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  82215. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  82216. */
  82217. /**
  82218. * @module utils/dom/emittermixin
  82219. */
  82220. /**
  82221. * Mixin that injects the DOM events API into its host. It provides the API
  82222. * compatible with {@link module:utils/emittermixin~EmitterMixin}.
  82223. *
  82224. * DOM emitter mixin is by default available in the {@link module:ui/view~View} class,
  82225. * but it can also be mixed into any other class:
  82226. *
  82227. * import mix from '../utils/mix.js';
  82228. * import DomEmitterMixin from '../utils/dom/emittermixin.js';
  82229. *
  82230. * class SomeView {}
  82231. * mix( SomeView, DomEmitterMixin );
  82232. *
  82233. * const view = new SomeView();
  82234. * view.listenTo( domElement, ( evt, domEvt ) => {
  82235. * console.log( evt, domEvt );
  82236. * } );
  82237. *
  82238. * @mixin EmitterMixin
  82239. * @mixes module:utils/emittermixin~EmitterMixin
  82240. * @implements module:utils/dom/emittermixin~Emitter
  82241. */
  82242. const DomEmitterMixin = Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["extend"])( {}, _emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"], {
  82243. /**
  82244. * Registers a callback function to be executed when an event is fired in a specific Emitter or DOM Node.
  82245. * It is backwards compatible with {@link module:utils/emittermixin~EmitterMixin#listenTo}.
  82246. *
  82247. * @param {module:utils/emittermixin~Emitter|Node} emitter The object that fires the event.
  82248. * @param {String} event The name of the event.
  82249. * @param {Function} callback The function to be called on event.
  82250. * @param {Object} [options={}] Additional options.
  82251. * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of this event callback. The higher
  82252. * the priority value the sooner the callback will be fired. Events having the same priority are called in the
  82253. * order they were added.
  82254. * @param {Boolean} [options.useCapture=false] Indicates that events of this type will be dispatched to the registered
  82255. * listener before being dispatched to any EventTarget beneath it in the DOM tree.
  82256. * @param {Boolean} [options.usePassive=false] Indicates that the function specified by listener will never call preventDefault()
  82257. * and prevents blocking browser's main thread by this event handler.
  82258. */
  82259. listenTo( emitter, ...rest ) {
  82260. // Check if emitter is an instance of DOM Node. If so, replace the argument with
  82261. // corresponding ProxyEmitter (or create one if not existing).
  82262. if ( Object(_isnode__WEBPACK_IMPORTED_MODULE_2__["default"])( emitter ) || Object(_iswindow__WEBPACK_IMPORTED_MODULE_3__["default"])( emitter ) ) {
  82263. const proxy = this._getProxyEmitter( emitter ) || new ProxyEmitter( emitter );
  82264. proxy.attach( ...rest );
  82265. emitter = proxy;
  82266. }
  82267. // Execute parent class method with Emitter (or ProxyEmitter) instance.
  82268. _emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"].listenTo.call( this, emitter, ...rest );
  82269. },
  82270. /**
  82271. * Stops listening for events. It can be used at different levels:
  82272. * It is backwards compatible with {@link module:utils/emittermixin~EmitterMixin#listenTo}.
  82273. *
  82274. * * To stop listening to a specific callback.
  82275. * * To stop listening to a specific event.
  82276. * * To stop listening to all events fired by a specific object.
  82277. * * To stop listening to all events fired by all object.
  82278. *
  82279. * @param {module:utils/emittermixin~Emitter|Node} [emitter] The object to stop listening to. If omitted, stops it for all objects.
  82280. * @param {String} [event] (Requires the `emitter`) The name of the event to stop listening to. If omitted, stops it
  82281. * for all events from `emitter`.
  82282. * @param {Function} [callback] (Requires the `event`) The function to be removed from the call list for the given
  82283. * `event`.
  82284. */
  82285. stopListening( emitter, event, callback ) {
  82286. // Check if emitter is an instance of DOM Node. If so, replace the argument with corresponding ProxyEmitter.
  82287. if ( Object(_isnode__WEBPACK_IMPORTED_MODULE_2__["default"])( emitter ) || Object(_iswindow__WEBPACK_IMPORTED_MODULE_3__["default"])( emitter ) ) {
  82288. const proxy = this._getProxyEmitter( emitter );
  82289. // Element has no listeners.
  82290. if ( !proxy ) {
  82291. return;
  82292. }
  82293. emitter = proxy;
  82294. }
  82295. // Execute parent class method with Emitter (or ProxyEmitter) instance.
  82296. _emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"].stopListening.call( this, emitter, event, callback );
  82297. if ( emitter instanceof ProxyEmitter ) {
  82298. emitter.detach( event );
  82299. }
  82300. },
  82301. /**
  82302. * Retrieves ProxyEmitter instance for given DOM Node residing in this Host.
  82303. *
  82304. * @private
  82305. * @param {Node} node DOM Node of the ProxyEmitter.
  82306. * @returns {module:utils/dom/emittermixin~ProxyEmitter} ProxyEmitter instance or null.
  82307. */
  82308. _getProxyEmitter( node ) {
  82309. return Object(_emittermixin__WEBPACK_IMPORTED_MODULE_0__["_getEmitterListenedTo"])( this, getNodeUID( node ) );
  82310. }
  82311. } );
  82312. /* harmony default export */ __webpack_exports__["default"] = (DomEmitterMixin);
  82313. /**
  82314. * Creates a ProxyEmitter instance. Such an instance is a bridge between a DOM Node firing events
  82315. * and any Host listening to them. It is backwards compatible with {@link module:utils/emittermixin~EmitterMixin#on}.
  82316. *
  82317. * listenTo( click, ... )
  82318. * +-----------------------------------------+
  82319. * | stopListening( ... ) |
  82320. * +----------------------------+ | addEventListener( click, ... )
  82321. * | Host | | +---------------------------------------------+
  82322. * +----------------------------+ | | removeEventListener( click, ... ) |
  82323. * | _listeningTo: { | +----------v-------------+ |
  82324. * | UID: { | | ProxyEmitter | |
  82325. * | emitter: ProxyEmitter, | +------------------------+ +------------v----------+
  82326. * | callbacks: { | | events: { | | Node (HTMLElement) |
  82327. * | click: [ callbacks ] | | click: [ callbacks ] | +-----------------------+
  82328. * | } | | }, | | data-ck-expando: UID |
  82329. * | } | | _domNode: Node, | +-----------------------+
  82330. * | } | | _domListeners: {}, | |
  82331. * | +------------------------+ | | _emitterId: UID | |
  82332. * | | DomEmitterMixin | | +--------------^---------+ |
  82333. * | +------------------------+ | | | |
  82334. * +--------------^-------------+ | +---------------------------------------------+
  82335. * | | click (DOM Event)
  82336. * +-----------------------------------------+
  82337. * fire( click, DOM Event )
  82338. *
  82339. * @mixes module:utils/emittermixin~EmitterMixin
  82340. * @implements module:utils/dom/emittermixin~Emitter
  82341. * @private
  82342. */
  82343. class ProxyEmitter {
  82344. /**
  82345. * @param {Node} node DOM Node that fires events.
  82346. * @returns {Object} ProxyEmitter instance bound to the DOM Node.
  82347. */
  82348. constructor( node ) {
  82349. // Set emitter ID to match DOM Node "expando" property.
  82350. Object(_emittermixin__WEBPACK_IMPORTED_MODULE_0__["_setEmitterId"])( this, getNodeUID( node ) );
  82351. // Remember the DOM Node this ProxyEmitter is bound to.
  82352. this._domNode = node;
  82353. }
  82354. }
  82355. Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["extend"])( ProxyEmitter.prototype, _emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"], {
  82356. /**
  82357. * Collection of native DOM listeners.
  82358. *
  82359. * @private
  82360. * @member {Object} module:utils/dom/emittermixin~ProxyEmitter#_domListeners
  82361. */
  82362. /**
  82363. * Registers a callback function to be executed when an event is fired.
  82364. *
  82365. * It attaches a native DOM listener to the DOM Node. When fired,
  82366. * a corresponding Emitter event will also fire with DOM Event object as an argument.
  82367. *
  82368. * @method module:utils/dom/emittermixin~ProxyEmitter#attach
  82369. * @param {String} event The name of the event.
  82370. * @param {Function} callback The function to be called on event.
  82371. * @param {Object} [options={}] Additional options.
  82372. * @param {Boolean} [options.useCapture=false] Indicates that events of this type will be dispatched to the registered
  82373. * listener before being dispatched to any EventTarget beneath it in the DOM tree.
  82374. * @param {Boolean} [options.usePassive=false] Indicates that the function specified by listener will never call preventDefault()
  82375. * and prevents blocking browser's main thread by this event handler.
  82376. */
  82377. attach( event, callback, options = {} ) {
  82378. // If the DOM Listener for given event already exist it is pointless
  82379. // to attach another one.
  82380. if ( this._domListeners && this._domListeners[ event ] ) {
  82381. return;
  82382. }
  82383. const listenerOptions = {
  82384. capture: !!options.useCapture,
  82385. passive: !!options.usePassive
  82386. };
  82387. const domListener = this._createDomListener( event, listenerOptions );
  82388. // Attach the native DOM listener to DOM Node.
  82389. this._domNode.addEventListener( event, domListener, listenerOptions );
  82390. if ( !this._domListeners ) {
  82391. this._domListeners = {};
  82392. }
  82393. // Store the native DOM listener in this ProxyEmitter. It will be helpful
  82394. // when stopping listening to the event.
  82395. this._domListeners[ event ] = domListener;
  82396. },
  82397. /**
  82398. * Stops executing the callback on the given event.
  82399. *
  82400. * @method module:utils/dom/emittermixin~ProxyEmitter#detach
  82401. * @param {String} event The name of the event.
  82402. */
  82403. detach( event ) {
  82404. let events;
  82405. // Remove native DOM listeners which are orphans. If no callbacks
  82406. // are awaiting given event, detach native DOM listener from DOM Node.
  82407. // See: {@link attach}.
  82408. if ( this._domListeners[ event ] && ( !( events = this._events[ event ] ) || !events.callbacks.length ) ) {
  82409. this._domListeners[ event ].removeListener();
  82410. }
  82411. },
  82412. /**
  82413. * Creates a native DOM listener callback. When the native DOM event
  82414. * is fired it will fire corresponding event on this ProxyEmitter.
  82415. * Note: A native DOM Event is passed as an argument.
  82416. *
  82417. * @private
  82418. * @method module:utils/dom/emittermixin~ProxyEmitter#_createDomListener
  82419. * @param {String} event The name of the event.
  82420. * @param {Object} [options] Additional options.
  82421. * @param {Boolean} [options.capture=false] Indicates whether the listener was created for capturing event.
  82422. * @param {Boolean} [options.passive=false] Indicates that the function specified by listener will never call preventDefault()
  82423. * and prevents blocking browser's main thread by this event handler.
  82424. * @returns {Function} The DOM listener callback.
  82425. */
  82426. _createDomListener( event, options ) {
  82427. const domListener = domEvt => {
  82428. this.fire( event, domEvt );
  82429. };
  82430. // Supply the DOM listener callback with a function that will help
  82431. // detach it from the DOM Node, when it is no longer necessary.
  82432. // See: {@link detach}.
  82433. domListener.removeListener = () => {
  82434. this._domNode.removeEventListener( event, domListener, options );
  82435. delete this._domListeners[ event ];
  82436. };
  82437. return domListener;
  82438. }
  82439. } );
  82440. // Gets an unique DOM Node identifier. The identifier will be set if not defined.
  82441. //
  82442. // @private
  82443. // @param {Node} node
  82444. // @returns {String} UID for given DOM Node.
  82445. function getNodeUID( node ) {
  82446. return node[ 'data-ck-expando' ] || ( node[ 'data-ck-expando' ] = Object(_uid__WEBPACK_IMPORTED_MODULE_1__["default"])() );
  82447. }
  82448. /**
  82449. * Interface representing classes which mix in {@link module:utils/dom/emittermixin~EmitterMixin}.
  82450. *
  82451. * @interface Emitter
  82452. */
  82453. /***/ }),
  82454. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getancestors.js":
  82455. /*!************************************************************************!*\
  82456. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/getancestors.js ***!
  82457. \************************************************************************/
  82458. /*! exports provided: default */
  82459. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  82460. "use strict";
  82461. __webpack_require__.r(__webpack_exports__);
  82462. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getAncestors; });
  82463. /**
  82464. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  82465. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  82466. */
  82467. /* globals Node */
  82468. /**
  82469. * @module utils/dom/getancestors
  82470. */
  82471. /**
  82472. * Returns all ancestors of given DOM node, starting from the top-most (root). Includes the given node itself. If the
  82473. * node is a part of `DocumentFragment` that `DocumentFragment` will be returned. In contrary, if the node is
  82474. * appended to a `Document`, that `Document` will not be returned (algorithms operating on DOM tree care for `Document#documentElement`
  82475. * at most, which will be returned).
  82476. *
  82477. * @param {Node} node DOM node.
  82478. * @returns {Array.<Node|DocumentFragment>} Array of given `node` parents.
  82479. */
  82480. function getAncestors( node ) {
  82481. const nodes = [];
  82482. // We are interested in `Node`s `DocumentFragment`s only.
  82483. while ( node && node.nodeType != Node.DOCUMENT_NODE ) {
  82484. nodes.unshift( node );
  82485. node = node.parentNode;
  82486. }
  82487. return nodes;
  82488. }
  82489. /***/ }),
  82490. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getborderwidths.js":
  82491. /*!***************************************************************************!*\
  82492. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/getborderwidths.js ***!
  82493. \***************************************************************************/
  82494. /*! exports provided: default */
  82495. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  82496. "use strict";
  82497. __webpack_require__.r(__webpack_exports__);
  82498. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getBorderWidths; });
  82499. /**
  82500. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  82501. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  82502. */
  82503. /**
  82504. * @module utils/dom/getborderwidths
  82505. */
  82506. /**
  82507. * Returns an object containing CSS border widths of a specified HTML element.
  82508. *
  82509. * @param {HTMLElement} element An element which has CSS borders.
  82510. * @returns {Object} An object containing `top`, `left`, `right` and `bottom` properties
  82511. * with numerical values of the `border-[top,left,right,bottom]-width` CSS styles.
  82512. */
  82513. function getBorderWidths( element ) {
  82514. // Call getComputedStyle on the window the element document belongs to.
  82515. const style = element.ownerDocument.defaultView.getComputedStyle( element );
  82516. return {
  82517. top: parseInt( style.borderTopWidth, 10 ),
  82518. right: parseInt( style.borderRightWidth, 10 ),
  82519. bottom: parseInt( style.borderBottomWidth, 10 ),
  82520. left: parseInt( style.borderLeftWidth, 10 )
  82521. };
  82522. }
  82523. /***/ }),
  82524. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getcommonancestor.js":
  82525. /*!*****************************************************************************!*\
  82526. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/getcommonancestor.js ***!
  82527. \*****************************************************************************/
  82528. /*! exports provided: default */
  82529. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  82530. "use strict";
  82531. __webpack_require__.r(__webpack_exports__);
  82532. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getCommonAncestor; });
  82533. /* harmony import */ var _getancestors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getancestors */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getancestors.js");
  82534. /**
  82535. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  82536. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  82537. */
  82538. /**
  82539. * @module utils/dom/getcommonancestor
  82540. */
  82541. /**
  82542. * Searches and returns the lowest common ancestor of two given nodes.
  82543. *
  82544. * @param {Node} nodeA First node.
  82545. * @param {Node} nodeB Second node.
  82546. * @returns {Node|DocumentFragment|Document|null} Lowest common ancestor of both nodes or `null` if nodes do not have a common ancestor.
  82547. */
  82548. function getCommonAncestor( nodeA, nodeB ) {
  82549. const ancestorsA = Object(_getancestors__WEBPACK_IMPORTED_MODULE_0__["default"])( nodeA );
  82550. const ancestorsB = Object(_getancestors__WEBPACK_IMPORTED_MODULE_0__["default"])( nodeB );
  82551. let i = 0;
  82552. // It does not matter which array is shorter.
  82553. while ( ancestorsA[ i ] == ancestorsB[ i ] && ancestorsA[ i ] ) {
  82554. i++;
  82555. }
  82556. return i === 0 ? null : ancestorsA[ i - 1 ];
  82557. }
  82558. /***/ }),
  82559. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getdatafromelement.js":
  82560. /*!******************************************************************************!*\
  82561. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/getdatafromelement.js ***!
  82562. \******************************************************************************/
  82563. /*! exports provided: default */
  82564. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  82565. "use strict";
  82566. __webpack_require__.r(__webpack_exports__);
  82567. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getDataFromElement; });
  82568. /**
  82569. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  82570. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  82571. */
  82572. /* globals HTMLTextAreaElement */
  82573. /**
  82574. * @module utils/dom/getdatafromelement
  82575. */
  82576. /**
  82577. * Gets data from a given source element.
  82578. *
  82579. * @param {HTMLElement} el The element from which the data will be retrieved.
  82580. * @returns {String} The data string.
  82581. */
  82582. function getDataFromElement( el ) {
  82583. if ( el instanceof HTMLTextAreaElement ) {
  82584. return el.value;
  82585. }
  82586. return el.innerHTML;
  82587. }
  82588. /***/ }),
  82589. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getpositionedancestor.js":
  82590. /*!*********************************************************************************!*\
  82591. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/getpositionedancestor.js ***!
  82592. \*********************************************************************************/
  82593. /*! exports provided: default */
  82594. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  82595. "use strict";
  82596. __webpack_require__.r(__webpack_exports__);
  82597. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getPositionedAncestor; });
  82598. /* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
  82599. /**
  82600. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  82601. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  82602. */
  82603. /**
  82604. * @module utils/dom/getpositionedancestor
  82605. */
  82606. /**
  82607. * For a given element, returns the nearest ancestor element which CSS position is not "static".
  82608. *
  82609. * @param {HTMLElement} element The native DOM element to be checked.
  82610. * @returns {HTMLElement|null}
  82611. */
  82612. function getPositionedAncestor( element ) {
  82613. if ( !element || !element.parentNode ) {
  82614. return null;
  82615. }
  82616. if ( element.offsetParent === _global__WEBPACK_IMPORTED_MODULE_0__["default"].document.body ) {
  82617. return null;
  82618. }
  82619. return element.offsetParent;
  82620. }
  82621. /***/ }),
  82622. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js":
  82623. /*!******************************************************************!*\
  82624. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js ***!
  82625. \******************************************************************/
  82626. /*! exports provided: default */
  82627. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  82628. "use strict";
  82629. __webpack_require__.r(__webpack_exports__);
  82630. /**
  82631. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  82632. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  82633. */
  82634. /* globals window, document */
  82635. /**
  82636. * @module utils/dom/global
  82637. */
  82638. /**
  82639. * A helper (module) giving an access to the global DOM objects such as `window` and
  82640. * `document`. Accessing these objects using this helper allows easy and bulletproof
  82641. * testing, i.e. stubbing native properties:
  82642. *
  82643. * import global from 'ckeditor5/utils/dom/global.js';
  82644. *
  82645. * // This stub will work for any code using global module.
  82646. * testUtils.sinon.stub( global, 'window', {
  82647. * innerWidth: 10000
  82648. * } );
  82649. *
  82650. * console.log( global.window.innerWidth );
  82651. */
  82652. /* harmony default export */ __webpack_exports__["default"] = ({ window, document });
  82653. /***/ }),
  82654. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/indexof.js":
  82655. /*!*******************************************************************!*\
  82656. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/indexof.js ***!
  82657. \*******************************************************************/
  82658. /*! exports provided: default */
  82659. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  82660. "use strict";
  82661. __webpack_require__.r(__webpack_exports__);
  82662. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return indexOf; });
  82663. /**
  82664. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  82665. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  82666. */
  82667. /**
  82668. * @module utils/dom/indexof
  82669. */
  82670. /**
  82671. * Returns index of the node in the parent element.
  82672. *
  82673. * @param {Node} node Node which index is tested.
  82674. * @returns {Number} Index of the node in the parent element. Returns 0 if node has no parent.
  82675. */
  82676. function indexOf( node ) {
  82677. let index = 0;
  82678. while ( node.previousSibling ) {
  82679. node = node.previousSibling;
  82680. index++;
  82681. }
  82682. return index;
  82683. }
  82684. /***/ }),
  82685. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/insertat.js":
  82686. /*!********************************************************************!*\
  82687. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/insertat.js ***!
  82688. \********************************************************************/
  82689. /*! exports provided: default */
  82690. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  82691. "use strict";
  82692. __webpack_require__.r(__webpack_exports__);
  82693. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return insertAt; });
  82694. /**
  82695. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  82696. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  82697. */
  82698. /**
  82699. * @module utils/dom/insertat
  82700. */
  82701. /**
  82702. * Inserts node to the parent at given index.
  82703. *
  82704. * @param {Element} parentElement Parent element.
  82705. * @param {Number} index Insertions index.
  82706. * @param {Node} nodeToInsert Node to insert.
  82707. */
  82708. function insertAt( parentElement, index, nodeToInsert ) {
  82709. parentElement.insertBefore( nodeToInsert, parentElement.childNodes[ index ] || null );
  82710. }
  82711. /***/ }),
  82712. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/isnode.js":
  82713. /*!******************************************************************!*\
  82714. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/isnode.js ***!
  82715. \******************************************************************/
  82716. /*! exports provided: default */
  82717. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  82718. "use strict";
  82719. __webpack_require__.r(__webpack_exports__);
  82720. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isNode; });
  82721. /**
  82722. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  82723. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  82724. */
  82725. /**
  82726. * @module utils/dom/isnode
  82727. */
  82728. /**
  82729. * Checks if the object is a native DOM Node.
  82730. *
  82731. * @param {*} obj
  82732. * @returns {Boolean}
  82733. */
  82734. function isNode( obj ) {
  82735. if ( obj ) {
  82736. if ( obj.defaultView ) {
  82737. return obj instanceof obj.defaultView.Document;
  82738. } else if ( obj.ownerDocument && obj.ownerDocument.defaultView ) {
  82739. return obj instanceof obj.ownerDocument.defaultView.Node;
  82740. }
  82741. }
  82742. return false;
  82743. }
  82744. /***/ }),
  82745. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/isrange.js":
  82746. /*!*******************************************************************!*\
  82747. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/isrange.js ***!
  82748. \*******************************************************************/
  82749. /*! exports provided: default */
  82750. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  82751. "use strict";
  82752. __webpack_require__.r(__webpack_exports__);
  82753. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isRange; });
  82754. /**
  82755. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  82756. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  82757. */
  82758. /**
  82759. * @module utils/dom/isrange
  82760. */
  82761. /**
  82762. * Checks if the object is a native DOM Range.
  82763. *
  82764. * @param {*} obj
  82765. * @returns {Boolean}
  82766. */
  82767. function isRange( obj ) {
  82768. return Object.prototype.toString.apply( obj ) == '[object Range]';
  82769. }
  82770. /***/ }),
  82771. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/istext.js":
  82772. /*!******************************************************************!*\
  82773. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/istext.js ***!
  82774. \******************************************************************/
  82775. /*! exports provided: default */
  82776. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  82777. "use strict";
  82778. __webpack_require__.r(__webpack_exports__);
  82779. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isText; });
  82780. /**
  82781. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  82782. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  82783. */
  82784. /**
  82785. * @module utils/dom/istext
  82786. */
  82787. /**
  82788. * Checks if the object is a native DOM Text node.
  82789. *
  82790. * @param {*} obj
  82791. * @returns {Boolean}
  82792. */
  82793. function isText( obj ) {
  82794. return Object.prototype.toString.call( obj ) == '[object Text]';
  82795. }
  82796. /***/ }),
  82797. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/iswindow.js":
  82798. /*!********************************************************************!*\
  82799. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/iswindow.js ***!
  82800. \********************************************************************/
  82801. /*! exports provided: default */
  82802. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  82803. "use strict";
  82804. __webpack_require__.r(__webpack_exports__);
  82805. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isWindow; });
  82806. /**
  82807. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  82808. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  82809. */
  82810. /**
  82811. * @module utils/dom/iswindow
  82812. */
  82813. /**
  82814. * Checks if the object is a native DOM Window.
  82815. *
  82816. * @param {*} obj
  82817. * @returns {Boolean}
  82818. */
  82819. function isWindow( obj ) {
  82820. const stringifiedObject = Object.prototype.toString.apply( obj );
  82821. // Returns `true` for the `window` object in browser environments.
  82822. if ( stringifiedObject == '[object Window]' ) {
  82823. return true;
  82824. }
  82825. // Returns `true` for the `window` object in the Electron environment.
  82826. if ( stringifiedObject == '[object global]' ) {
  82827. return true;
  82828. }
  82829. return false;
  82830. }
  82831. /***/ }),
  82832. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/position.js":
  82833. /*!********************************************************************!*\
  82834. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/position.js ***!
  82835. \********************************************************************/
  82836. /*! exports provided: getOptimalPosition */
  82837. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  82838. "use strict";
  82839. __webpack_require__.r(__webpack_exports__);
  82840. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getOptimalPosition", function() { return getOptimalPosition; });
  82841. /* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
  82842. /* harmony import */ var _rect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
  82843. /* harmony import */ var _getpositionedancestor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getpositionedancestor */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getpositionedancestor.js");
  82844. /* harmony import */ var _getborderwidths__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getborderwidths */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getborderwidths.js");
  82845. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  82846. /**
  82847. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  82848. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  82849. */
  82850. /**
  82851. * @module utils/dom/position
  82852. */
  82853. /**
  82854. * Calculates the `position: absolute` coordinates of a given element so it can be positioned with respect to the
  82855. * target in the visually most efficient way, taking various restrictions like viewport or limiter geometry
  82856. * into consideration.
  82857. *
  82858. * // The element which is to be positioned.
  82859. * const element = document.body.querySelector( '#toolbar' );
  82860. *
  82861. * // A target to which the element is positioned relatively.
  82862. * const target = document.body.querySelector( '#container' );
  82863. *
  82864. * // Finding the optimal coordinates for the positioning.
  82865. * const { left, top, name } = getOptimalPosition( {
  82866. * element: element,
  82867. * target: target,
  82868. *
  82869. * // The algorithm will chose among these positions to meet the requirements such
  82870. * // as "limiter" element or "fitInViewport", set below. The positions are considered
  82871. * // in the order of the array.
  82872. * positions: [
  82873. * //
  82874. * // [ Target ]
  82875. * // +-----------------+
  82876. * // | Element |
  82877. * // +-----------------+
  82878. * //
  82879. * targetRect => ( {
  82880. * top: targetRect.bottom,
  82881. * left: targetRect.left,
  82882. * name: 'mySouthEastPosition'
  82883. * } ),
  82884. *
  82885. * //
  82886. * // +-----------------+
  82887. * // | Element |
  82888. * // +-----------------+
  82889. * // [ Target ]
  82890. * //
  82891. * ( targetRect, elementRect ) => ( {
  82892. * top: targetRect.top - elementRect.height,
  82893. * left: targetRect.left,
  82894. * name: 'myNorthEastPosition'
  82895. * } )
  82896. * ],
  82897. *
  82898. * // Find a position such guarantees the element remains within visible boundaries of <body>.
  82899. * limiter: document.body,
  82900. *
  82901. * // Find a position such guarantees the element remains within visible boundaries of the browser viewport.
  82902. * fitInViewport: true
  82903. * } );
  82904. *
  82905. * // The best position which fits into document.body and the viewport. May be useful
  82906. * // to set proper class on the `element`.
  82907. * console.log( name ); // -> "myNorthEastPosition"
  82908. *
  82909. * // Using the absolute coordinates which has been found to position the element
  82910. * // as in the diagram depicting the "myNorthEastPosition" position.
  82911. * element.style.top = top;
  82912. * element.style.left = left;
  82913. *
  82914. * @param {module:utils/dom/position~Options} options Positioning options object.
  82915. * @returns {module:utils/dom/position~Position}
  82916. */
  82917. function getOptimalPosition( { element, target, positions, limiter, fitInViewport } ) {
  82918. // If the {@link module:utils/dom/position~Options#target} is a function, use what it returns.
  82919. // https://github.com/ckeditor/ckeditor5-utils/issues/157
  82920. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["isFunction"])( target ) ) {
  82921. target = target();
  82922. }
  82923. // If the {@link module:utils/dom/position~Options#limiter} is a function, use what it returns.
  82924. // https://github.com/ckeditor/ckeditor5-ui/issues/260
  82925. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["isFunction"])( limiter ) ) {
  82926. limiter = limiter();
  82927. }
  82928. const positionedElementAncestor = Object(_getpositionedancestor__WEBPACK_IMPORTED_MODULE_2__["default"])( element );
  82929. const elementRect = new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( element );
  82930. const targetRect = new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( target );
  82931. let bestPositionRect;
  82932. let bestPositionName;
  82933. // If there are no limits, just grab the very first position and be done with that drama.
  82934. if ( !limiter && !fitInViewport ) {
  82935. [ bestPositionName, bestPositionRect ] = getPositionNameAndRect( positions[ 0 ], targetRect, elementRect );
  82936. } else {
  82937. const limiterRect = limiter && new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( limiter ).getVisible();
  82938. const viewportRect = fitInViewport && new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( _global__WEBPACK_IMPORTED_MODULE_0__["default"].window );
  82939. const bestPosition = getBestPositionNameAndRect( positions, { targetRect, elementRect, limiterRect, viewportRect } );
  82940. // If there's no best position found, i.e. when all intersections have no area because
  82941. // rects have no width or height, then just use the first available position.
  82942. [ bestPositionName, bestPositionRect ] = bestPosition || getPositionNameAndRect( positions[ 0 ], targetRect, elementRect );
  82943. }
  82944. let absoluteRectCoordinates = getAbsoluteRectCoordinates( bestPositionRect );
  82945. if ( positionedElementAncestor ) {
  82946. absoluteRectCoordinates = shiftRectCoordinatesDueToPositionedAncestor( absoluteRectCoordinates, positionedElementAncestor );
  82947. }
  82948. return {
  82949. left: absoluteRectCoordinates.left,
  82950. top: absoluteRectCoordinates.top,
  82951. name: bestPositionName
  82952. };
  82953. }
  82954. // For given position function, returns a corresponding `Rect` instance.
  82955. //
  82956. // @private
  82957. // @param {Function} position A function returning {@link module:utils/dom/position~Position}.
  82958. // @param {utils/dom/rect~Rect} targetRect A rect of the target.
  82959. // @param {utils/dom/rect~Rect} elementRect A rect of positioned element.
  82960. // @returns {Array|null} An array containing position name and its Rect (or null if position should be ignored).
  82961. function getPositionNameAndRect( position, targetRect, elementRect ) {
  82962. const positionData = position( targetRect, elementRect );
  82963. if ( !positionData ) {
  82964. return null;
  82965. }
  82966. const { left, top, name } = positionData;
  82967. return [ name, elementRect.clone().moveTo( left, top ) ];
  82968. }
  82969. // For a given array of positioning functions, returns such that provides the best
  82970. // fit of the `elementRect` into the `limiterRect` and `viewportRect`.
  82971. //
  82972. // @private
  82973. //
  82974. // @param {Object} options
  82975. // @param {module:utils/dom/position~Options#positions} positions Functions returning {@link module:utils/dom/position~Position}
  82976. // to be checked, in the order of preference.
  82977. // @param {Object} options
  82978. // @param {utils/dom/rect~Rect} options.targetRect A rect of the {@link module:utils/dom/position~Options#target}.
  82979. // @param {utils/dom/rect~Rect} options.elementRect A rect of positioned {@link module:utils/dom/position~Options#element}.
  82980. // @param {utils/dom/rect~Rect} options.limiterRect A rect of the {@link module:utils/dom/position~Options#limiter}.
  82981. // @param {utils/dom/rect~Rect} options.viewportRect A rect of the viewport.
  82982. //
  82983. // @returns {Array} An array containing the name of the position and it's rect.
  82984. function getBestPositionNameAndRect( positions, options ) {
  82985. const { elementRect, viewportRect } = options;
  82986. // This is when element is fully visible.
  82987. const elementRectArea = elementRect.getArea();
  82988. // Let's calculate intersection areas for positions. It will end early if best match is found.
  82989. const processedPositions = processPositionsToAreas( positions, options );
  82990. // First let's check all positions that fully fit in the viewport.
  82991. if ( viewportRect ) {
  82992. const processedPositionsInViewport = processedPositions.filter( ( { viewportIntersectArea } ) => {
  82993. return viewportIntersectArea === elementRectArea;
  82994. } );
  82995. // Try to find best position from those which fit completely in viewport.
  82996. const bestPositionData = getBestOfProcessedPositions( processedPositionsInViewport, elementRectArea );
  82997. if ( bestPositionData ) {
  82998. return bestPositionData;
  82999. }
  83000. }
  83001. // Either there is no viewportRect or there is no position that fits completely in the viewport.
  83002. return getBestOfProcessedPositions( processedPositions, elementRectArea );
  83003. }
  83004. // For a given array of positioning functions, calculates intersection areas for them.
  83005. //
  83006. // Note: If some position fully fits into the `limiterRect`, it will be returned early, without further consideration
  83007. // of other positions.
  83008. //
  83009. // @private
  83010. //
  83011. // @param {module:utils/dom/position~Options#positions} positions Functions returning {@link module:utils/dom/position~Position}
  83012. // to be checked, in the order of preference.
  83013. // @param {Object} options
  83014. // @param {utils/dom/rect~Rect} options.targetRect A rect of the {@link module:utils/dom/position~Options#target}.
  83015. // @param {utils/dom/rect~Rect} options.elementRect A rect of positioned {@link module:utils/dom/position~Options#element}.
  83016. // @param {utils/dom/rect~Rect} options.limiterRect A rect of the {@link module:utils/dom/position~Options#limiter}.
  83017. // @param {utils/dom/rect~Rect} options.viewportRect A rect of the viewport.
  83018. //
  83019. // @returns {Array.<Object>} Array of positions with calculated intersection areas. Each item is an object containing:
  83020. // * {String} positionName Name of position.
  83021. // * {utils/dom/rect~Rect} positionRect Rect of position.
  83022. // * {Number} limiterIntersectArea Area of intersection of the position with limiter part that is in the viewport.
  83023. // * {Number} viewportIntersectArea Area of intersection of the position with viewport.
  83024. function processPositionsToAreas( positions, { targetRect, elementRect, limiterRect, viewportRect } ) {
  83025. const processedPositions = [];
  83026. // This is when element is fully visible.
  83027. const elementRectArea = elementRect.getArea();
  83028. for ( const position of positions ) {
  83029. const positionData = getPositionNameAndRect( position, targetRect, elementRect );
  83030. if ( !positionData ) {
  83031. continue;
  83032. }
  83033. const [ positionName, positionRect ] = positionData;
  83034. let limiterIntersectArea = 0;
  83035. let viewportIntersectArea = 0;
  83036. if ( limiterRect ) {
  83037. if ( viewportRect ) {
  83038. // Consider only the part of the limiter which is visible in the viewport. So the limiter is getting limited.
  83039. const limiterViewportIntersectRect = limiterRect.getIntersection( viewportRect );
  83040. if ( limiterViewportIntersectRect ) {
  83041. // If the limiter is within the viewport, then check the intersection between that part of the
  83042. // limiter and actual position.
  83043. limiterIntersectArea = limiterViewportIntersectRect.getIntersectionArea( positionRect );
  83044. }
  83045. } else {
  83046. limiterIntersectArea = limiterRect.getIntersectionArea( positionRect );
  83047. }
  83048. }
  83049. if ( viewportRect ) {
  83050. viewportIntersectArea = viewportRect.getIntersectionArea( positionRect );
  83051. }
  83052. const processedPosition = {
  83053. positionName,
  83054. positionRect,
  83055. limiterIntersectArea,
  83056. viewportIntersectArea
  83057. };
  83058. // If a such position is found that element is fully contained by the limiter then, obviously,
  83059. // there will be no better one, so finishing.
  83060. if ( limiterIntersectArea === elementRectArea ) {
  83061. return [ processedPosition ];
  83062. }
  83063. processedPositions.push( processedPosition );
  83064. }
  83065. return processedPositions;
  83066. }
  83067. // For a given array of processed position data (with calculated Rects for positions and intersection areas)
  83068. // returns such that provides the best fit of the `elementRect` into the `limiterRect` and `viewportRect` at the same time.
  83069. //
  83070. // **Note**: It will return early if some position fully fits into the `limiterRect`.
  83071. //
  83072. // @private
  83073. // @param {Array.<Object>} Array of positions with calculated intersection areas (in order of preference).
  83074. // Each item is an object containing:
  83075. //
  83076. // * {String} positionName Name of position.
  83077. // * {utils/dom/rect~Rect} positionRect Rect of position.
  83078. // * {Number} limiterIntersectArea Area of intersection of the position with limiter part that is in the viewport.
  83079. // * {Number} viewportIntersectArea Area of intersection of the position with viewport.
  83080. //
  83081. // @param {Number} elementRectArea Area of positioned {@link module:utils/dom/position~Options#element}.
  83082. // @returns {Array|null} An array containing the name of the position and it's rect, or null if not found.
  83083. function getBestOfProcessedPositions( processedPositions, elementRectArea ) {
  83084. let maxFitFactor = 0;
  83085. let bestPositionRect;
  83086. let bestPositionName;
  83087. for ( const { positionName, positionRect, limiterIntersectArea, viewportIntersectArea } of processedPositions ) {
  83088. // If a such position is found that element is fully container by the limiter then, obviously,
  83089. // there will be no better one, so finishing.
  83090. if ( limiterIntersectArea === elementRectArea ) {
  83091. return [ positionName, positionRect ];
  83092. }
  83093. // To maximize both viewport and limiter intersection areas we use distance on viewportIntersectArea
  83094. // and limiterIntersectArea plane (without sqrt because we are looking for max value).
  83095. const fitFactor = viewportIntersectArea ** 2 + limiterIntersectArea ** 2;
  83096. if ( fitFactor > maxFitFactor ) {
  83097. maxFitFactor = fitFactor;
  83098. bestPositionRect = positionRect;
  83099. bestPositionName = positionName;
  83100. }
  83101. }
  83102. return bestPositionRect ? [ bestPositionName, bestPositionRect ] : null;
  83103. }
  83104. // For a given absolute Rect coordinates object and a positioned element ancestor, it returns an object with
  83105. // new Rect coordinates that make up for the position and the scroll of the ancestor.
  83106. //
  83107. // This is necessary because while Rects (and DOMRects) are relative to the browser's viewport, their coordinates
  83108. // are used in real–life to position elements with `position: absolute`, which are scoped by any positioned
  83109. // (and scrollable) ancestors.
  83110. //
  83111. // @private
  83112. //
  83113. // @param {Object} absoluteRectCoordinates An object with absolute rect coordinates.
  83114. // @param {Object} absoluteRectCoordinates.top
  83115. // @param {Object} absoluteRectCoordinates.left
  83116. // @param {HTMLElement} positionedElementAncestor An ancestor element that should be considered.
  83117. //
  83118. // @returns {Object} An object corresponding to `absoluteRectCoordinates` input but with values shifted
  83119. // to make up for the positioned element ancestor.
  83120. function shiftRectCoordinatesDueToPositionedAncestor( { left, top }, positionedElementAncestor ) {
  83121. const ancestorPosition = getAbsoluteRectCoordinates( new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( positionedElementAncestor ) );
  83122. const ancestorBorderWidths = Object(_getborderwidths__WEBPACK_IMPORTED_MODULE_3__["default"])( positionedElementAncestor );
  83123. // (https://github.com/ckeditor/ckeditor5-ui-default/issues/126)
  83124. // If there's some positioned ancestor of the panel, then its `Rect` must be taken into
  83125. // consideration. `Rect` is always relative to the viewport while `position: absolute` works
  83126. // with respect to that positioned ancestor.
  83127. left -= ancestorPosition.left;
  83128. top -= ancestorPosition.top;
  83129. // (https://github.com/ckeditor/ckeditor5-utils/issues/139)
  83130. // If there's some positioned ancestor of the panel, not only its position must be taken into
  83131. // consideration (see above) but also its internal scrolls. Scroll have an impact here because `Rect`
  83132. // is relative to the viewport (it doesn't care about scrolling), while `position: absolute`
  83133. // must compensate that scrolling.
  83134. left += positionedElementAncestor.scrollLeft;
  83135. top += positionedElementAncestor.scrollTop;
  83136. // (https://github.com/ckeditor/ckeditor5-utils/issues/139)
  83137. // If there's some positioned ancestor of the panel, then its `Rect` includes its CSS `borderWidth`
  83138. // while `position: absolute` positioning does not consider it.
  83139. // E.g. `{ position: absolute, top: 0, left: 0 }` means upper left corner of the element,
  83140. // not upper-left corner of its border.
  83141. left -= ancestorBorderWidths.left;
  83142. top -= ancestorBorderWidths.top;
  83143. return { left, top };
  83144. }
  83145. // DOMRect (also Rect) works in a scroll–independent geometry but `position: absolute` doesn't.
  83146. // This function converts Rect to `position: absolute` coordinates.
  83147. //
  83148. // @private
  83149. // @param {utils/dom/rect~Rect} rect A rect to be converted.
  83150. // @returns {Object} Object containing `left` and `top` properties, in absolute coordinates.
  83151. function getAbsoluteRectCoordinates( { left, top } ) {
  83152. const { scrollX, scrollY } = _global__WEBPACK_IMPORTED_MODULE_0__["default"].window;
  83153. return {
  83154. left: left + scrollX,
  83155. top: top + scrollY
  83156. };
  83157. }
  83158. /**
  83159. * The `getOptimalPosition()` helper options.
  83160. *
  83161. * @interface module:utils/dom/position~Options
  83162. */
  83163. /**
  83164. * Element that is to be positioned.
  83165. *
  83166. * @member {HTMLElement} #element
  83167. */
  83168. /**
  83169. * Target with respect to which the `element` is to be positioned.
  83170. *
  83171. * @member {HTMLElement|Range|ClientRect|Rect|Function} #target
  83172. */
  83173. /**
  83174. * An array of functions which return {@link module:utils/dom/position~Position} relative
  83175. * to the `target`, in the order of preference.
  83176. *
  83177. * **Note**: If a function returns `null`, it is ignored by the `getOptimalPosition()`.
  83178. *
  83179. * @member {Array.<Function>} #positions
  83180. */
  83181. /**
  83182. * When set, the algorithm will chose position which fits the most in the
  83183. * limiter's bounding rect.
  83184. *
  83185. * @member {HTMLElement|Range|ClientRect|Rect|Function} #limiter
  83186. */
  83187. /**
  83188. * When set, the algorithm will chose such a position which fits `element`
  83189. * the most inside visible viewport.
  83190. *
  83191. * @member {Boolean} #fitInViewport
  83192. */
  83193. /**
  83194. * An object describing a position in `position: absolute` coordinate
  83195. * system, along with position name.
  83196. *
  83197. * @typedef {Object} module:utils/dom/position~Position
  83198. *
  83199. * @property {Number} top Top position offset.
  83200. * @property {Number} left Left position offset.
  83201. * @property {String} name Name of the position.
  83202. */
  83203. /***/ }),
  83204. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js":
  83205. /*!****************************************************************!*\
  83206. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js ***!
  83207. \****************************************************************/
  83208. /*! exports provided: default */
  83209. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  83210. "use strict";
  83211. __webpack_require__.r(__webpack_exports__);
  83212. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Rect; });
  83213. /* harmony import */ var _isrange__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isrange */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/isrange.js");
  83214. /* harmony import */ var _iswindow__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./iswindow */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/iswindow.js");
  83215. /* harmony import */ var _getborderwidths__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getborderwidths */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/getborderwidths.js");
  83216. /* harmony import */ var _istext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./istext */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/istext.js");
  83217. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  83218. /**
  83219. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  83220. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  83221. */
  83222. /**
  83223. * @module utils/dom/rect
  83224. */
  83225. const rectProperties = [ 'top', 'right', 'bottom', 'left', 'width', 'height' ];
  83226. /**
  83227. * A helper class representing a `ClientRect` object, e.g. value returned by
  83228. * the native `object.getBoundingClientRect()` method. Provides a set of methods
  83229. * to manipulate the rect and compare it against other rect instances.
  83230. */
  83231. class Rect {
  83232. /**
  83233. * Creates an instance of rect.
  83234. *
  83235. * // Rect of an HTMLElement.
  83236. * const rectA = new Rect( document.body );
  83237. *
  83238. * // Rect of a DOM Range.
  83239. * const rectB = new Rect( document.getSelection().getRangeAt( 0 ) );
  83240. *
  83241. * // Rect of a window (web browser viewport).
  83242. * const rectC = new Rect( window );
  83243. *
  83244. * // Rect out of an object.
  83245. * const rectD = new Rect( { top: 0, right: 10, bottom: 10, left: 0, width: 10, height: 10 } );
  83246. *
  83247. * // Rect out of another Rect instance.
  83248. * const rectE = new Rect( rectD );
  83249. *
  83250. * // Rect out of a ClientRect.
  83251. * const rectF = new Rect( document.body.getClientRects().item( 0 ) );
  83252. *
  83253. * **Note**: By default a rect of an HTML element includes its CSS borders and scrollbars (if any)
  83254. * ant the rect of a `window` includes scrollbars too. Use {@link #excludeScrollbarsAndBorders}
  83255. * to get the inner part of the rect.
  83256. *
  83257. * @param {HTMLElement|Range|Window|ClientRect|module:utils/dom/rect~Rect|Object} source A source object to create the rect.
  83258. */
  83259. constructor( source ) {
  83260. const isSourceRange = Object(_isrange__WEBPACK_IMPORTED_MODULE_0__["default"])( source );
  83261. /**
  83262. * The object this rect is for.
  83263. *
  83264. * @protected
  83265. * @readonly
  83266. * @member {HTMLElement|Range|ClientRect|module:utils/dom/rect~Rect|Object} #_source
  83267. */
  83268. Object.defineProperty( this, '_source', {
  83269. // If the source is a Rect instance, copy it's #_source.
  83270. value: source._source || source,
  83271. writable: true,
  83272. enumerable: false
  83273. } );
  83274. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["isElement"])( source ) || isSourceRange ) {
  83275. // The `Rect` class depends on `getBoundingClientRect` and `getClientRects` DOM methods. If the source
  83276. // of a rect in an HTML element or a DOM range but it does not belong to any rendered DOM tree, these methods
  83277. // will fail to obtain the geometry and the rect instance makes little sense to the features using it.
  83278. // To get rid of this warning make sure the source passed to the constructor is a descendant of `window.document.body`.
  83279. // @if CK_DEBUG // const sourceNode = isSourceRange ? source.startContainer : source;
  83280. // @if CK_DEBUG // if ( !sourceNode.ownerDocument || !sourceNode.ownerDocument.body.contains( sourceNode ) ) {
  83281. // @if CK_DEBUG // console.warn(
  83282. // @if CK_DEBUG // 'rect-source-not-in-dom: The source of this rect does not belong to any rendered DOM tree.',
  83283. // @if CK_DEBUG // { source } );
  83284. // @if CK_DEBUG // }
  83285. if ( isSourceRange ) {
  83286. const rangeRects = Rect.getDomRangeRects( source );
  83287. copyRectProperties( this, Rect.getBoundingRect( rangeRects ) );
  83288. } else {
  83289. copyRectProperties( this, source.getBoundingClientRect() );
  83290. }
  83291. } else if ( Object(_iswindow__WEBPACK_IMPORTED_MODULE_1__["default"])( source ) ) {
  83292. const { innerWidth, innerHeight } = source;
  83293. copyRectProperties( this, {
  83294. top: 0,
  83295. right: innerWidth,
  83296. bottom: innerHeight,
  83297. left: 0,
  83298. width: innerWidth,
  83299. height: innerHeight
  83300. } );
  83301. } else {
  83302. copyRectProperties( this, source );
  83303. }
  83304. /**
  83305. * The "top" value of the rect.
  83306. *
  83307. * @readonly
  83308. * @member {Number} #top
  83309. */
  83310. /**
  83311. * The "right" value of the rect.
  83312. *
  83313. * @readonly
  83314. * @member {Number} #right
  83315. */
  83316. /**
  83317. * The "bottom" value of the rect.
  83318. *
  83319. * @readonly
  83320. * @member {Number} #bottom
  83321. */
  83322. /**
  83323. * The "left" value of the rect.
  83324. *
  83325. * @readonly
  83326. * @member {Number} #left
  83327. */
  83328. /**
  83329. * The "width" value of the rect.
  83330. *
  83331. * @readonly
  83332. * @member {Number} #width
  83333. */
  83334. /**
  83335. * The "height" value of the rect.
  83336. *
  83337. * @readonly
  83338. * @member {Number} #height
  83339. */
  83340. }
  83341. /**
  83342. * Returns a clone of the rect.
  83343. *
  83344. * @returns {module:utils/dom/rect~Rect} A cloned rect.
  83345. */
  83346. clone() {
  83347. return new Rect( this );
  83348. }
  83349. /**
  83350. * Moves the rect so that its upper–left corner lands in desired `[ x, y ]` location.
  83351. *
  83352. * @param {Number} x Desired horizontal location.
  83353. * @param {Number} y Desired vertical location.
  83354. * @returns {module:utils/dom/rect~Rect} A rect which has been moved.
  83355. */
  83356. moveTo( x, y ) {
  83357. this.top = y;
  83358. this.right = x + this.width;
  83359. this.bottom = y + this.height;
  83360. this.left = x;
  83361. return this;
  83362. }
  83363. /**
  83364. * Moves the rect in–place by a dedicated offset.
  83365. *
  83366. * @param {Number} x A horizontal offset.
  83367. * @param {Number} y A vertical offset
  83368. * @returns {module:utils/dom/rect~Rect} A rect which has been moved.
  83369. */
  83370. moveBy( x, y ) {
  83371. this.top += y;
  83372. this.right += x;
  83373. this.left += x;
  83374. this.bottom += y;
  83375. return this;
  83376. }
  83377. /**
  83378. * Returns a new rect a a result of intersection with another rect.
  83379. *
  83380. * @param {module:utils/dom/rect~Rect} anotherRect
  83381. * @returns {module:utils/dom/rect~Rect}
  83382. */
  83383. getIntersection( anotherRect ) {
  83384. const rect = {
  83385. top: Math.max( this.top, anotherRect.top ),
  83386. right: Math.min( this.right, anotherRect.right ),
  83387. bottom: Math.min( this.bottom, anotherRect.bottom ),
  83388. left: Math.max( this.left, anotherRect.left )
  83389. };
  83390. rect.width = rect.right - rect.left;
  83391. rect.height = rect.bottom - rect.top;
  83392. if ( rect.width < 0 || rect.height < 0 ) {
  83393. return null;
  83394. } else {
  83395. return new Rect( rect );
  83396. }
  83397. }
  83398. /**
  83399. * Returns the area of intersection with another rect.
  83400. *
  83401. * @param {module:utils/dom/rect~Rect} anotherRect [description]
  83402. * @returns {Number} Area of intersection.
  83403. */
  83404. getIntersectionArea( anotherRect ) {
  83405. const rect = this.getIntersection( anotherRect );
  83406. if ( rect ) {
  83407. return rect.getArea();
  83408. } else {
  83409. return 0;
  83410. }
  83411. }
  83412. /**
  83413. * Returns the area of the rect.
  83414. *
  83415. * @returns {Number}
  83416. */
  83417. getArea() {
  83418. return this.width * this.height;
  83419. }
  83420. /**
  83421. * Returns a new rect, a part of the original rect, which is actually visible to the user,
  83422. * e.g. an original rect cropped by parent element rects which have `overflow` set in CSS
  83423. * other than `"visible"`.
  83424. *
  83425. * If there's no such visible rect, which is when the rect is limited by one or many of
  83426. * the ancestors, `null` is returned.
  83427. *
  83428. * @returns {module:utils/dom/rect~Rect|null} A visible rect instance or `null`, if there's none.
  83429. */
  83430. getVisible() {
  83431. const source = this._source;
  83432. let visibleRect = this.clone();
  83433. // There's no ancestor to crop <body> with the overflow.
  83434. if ( !isBody( source ) ) {
  83435. let parent = source.parentNode || source.commonAncestorContainer;
  83436. // Check the ancestors all the way up to the <body>.
  83437. while ( parent && !isBody( parent ) ) {
  83438. const parentRect = new Rect( parent );
  83439. const intersectionRect = visibleRect.getIntersection( parentRect );
  83440. if ( intersectionRect ) {
  83441. if ( intersectionRect.getArea() < visibleRect.getArea() ) {
  83442. // Reduce the visible rect to the intersection.
  83443. visibleRect = intersectionRect;
  83444. }
  83445. } else {
  83446. // There's no intersection, the rect is completely invisible.
  83447. return null;
  83448. }
  83449. parent = parent.parentNode;
  83450. }
  83451. }
  83452. return visibleRect;
  83453. }
  83454. /**
  83455. * Checks if all property values ({@link #top}, {@link #left}, {@link #right},
  83456. * {@link #bottom}, {@link #width} and {@link #height}) are the equal in both rect
  83457. * instances.
  83458. *
  83459. * @param {module:utils/dom/rect~Rect} rect A rect instance to compare with.
  83460. * @returns {Boolean} `true` when Rects are equal. `false` otherwise.
  83461. */
  83462. isEqual( anotherRect ) {
  83463. for ( const prop of rectProperties ) {
  83464. if ( this[ prop ] !== anotherRect[ prop ] ) {
  83465. return false;
  83466. }
  83467. }
  83468. return true;
  83469. }
  83470. /**
  83471. * Checks whether a rect fully contains another rect instance.
  83472. *
  83473. * @param {module:utils/dom/rect~Rect} anotherRect
  83474. * @returns {Boolean} `true` if contains, `false` otherwise.
  83475. */
  83476. contains( anotherRect ) {
  83477. const intersectRect = this.getIntersection( anotherRect );
  83478. return !!( intersectRect && intersectRect.isEqual( anotherRect ) );
  83479. }
  83480. /**
  83481. * Excludes scrollbars and CSS borders from the rect.
  83482. *
  83483. * * Borders are removed when {@link #_source} is an HTML element.
  83484. * * Scrollbars are excluded from HTML elements and the `window`.
  83485. *
  83486. * @returns {module:utils/dom/rect~Rect} A rect which has been updated.
  83487. */
  83488. excludeScrollbarsAndBorders() {
  83489. const source = this._source;
  83490. let scrollBarWidth, scrollBarHeight, direction;
  83491. if ( Object(_iswindow__WEBPACK_IMPORTED_MODULE_1__["default"])( source ) ) {
  83492. scrollBarWidth = source.innerWidth - source.document.documentElement.clientWidth;
  83493. scrollBarHeight = source.innerHeight - source.document.documentElement.clientHeight;
  83494. direction = source.getComputedStyle( source.document.documentElement ).direction;
  83495. } else {
  83496. const borderWidths = Object(_getborderwidths__WEBPACK_IMPORTED_MODULE_2__["default"])( this._source );
  83497. scrollBarWidth = source.offsetWidth - source.clientWidth - borderWidths.left - borderWidths.right;
  83498. scrollBarHeight = source.offsetHeight - source.clientHeight - borderWidths.top - borderWidths.bottom;
  83499. direction = source.ownerDocument.defaultView.getComputedStyle( source ).direction;
  83500. this.left += borderWidths.left;
  83501. this.top += borderWidths.top;
  83502. this.right -= borderWidths.right;
  83503. this.bottom -= borderWidths.bottom;
  83504. this.width = this.right - this.left;
  83505. this.height = this.bottom - this.top;
  83506. }
  83507. this.width -= scrollBarWidth;
  83508. if ( direction === 'ltr' ) {
  83509. this.right -= scrollBarWidth;
  83510. } else {
  83511. this.left += scrollBarWidth;
  83512. }
  83513. this.height -= scrollBarHeight;
  83514. this.bottom -= scrollBarHeight;
  83515. return this;
  83516. }
  83517. /**
  83518. * Returns an array of rects of the given native DOM Range.
  83519. *
  83520. * @param {Range} range A native DOM range.
  83521. * @returns {Array.<module:utils/dom/rect~Rect>} DOM Range rects.
  83522. */
  83523. static getDomRangeRects( range ) {
  83524. const rects = [];
  83525. // Safari does not iterate over ClientRectList using for...of loop.
  83526. const clientRects = Array.from( range.getClientRects() );
  83527. if ( clientRects.length ) {
  83528. for ( const rect of clientRects ) {
  83529. rects.push( new Rect( rect ) );
  83530. }
  83531. }
  83532. // If there's no client rects for the Range, use parent container's bounding rect
  83533. // instead and adjust rect's width to simulate the actual geometry of such range.
  83534. // https://github.com/ckeditor/ckeditor5-utils/issues/153
  83535. // https://github.com/ckeditor/ckeditor5-ui/issues/317
  83536. else {
  83537. let startContainer = range.startContainer;
  83538. if ( Object(_istext__WEBPACK_IMPORTED_MODULE_3__["default"])( startContainer ) ) {
  83539. startContainer = startContainer.parentNode;
  83540. }
  83541. const rect = new Rect( startContainer.getBoundingClientRect() );
  83542. rect.right = rect.left;
  83543. rect.width = 0;
  83544. rects.push( rect );
  83545. }
  83546. return rects;
  83547. }
  83548. /**
  83549. * Returns a bounding rectangle that contains all the given `rects`.
  83550. *
  83551. * @param {Iterable.<module:utils/dom/rect~Rect>} rects A list of rectangles that should be contained in the result rectangle.
  83552. * @returns {module:utils/dom/rect~Rect|null} Bounding rectangle or `null` if no `rects` were given.
  83553. */
  83554. static getBoundingRect( rects ) {
  83555. const boundingRectData = {
  83556. left: Number.POSITIVE_INFINITY,
  83557. top: Number.POSITIVE_INFINITY,
  83558. right: Number.NEGATIVE_INFINITY,
  83559. bottom: Number.NEGATIVE_INFINITY
  83560. };
  83561. let rectangleCount = 0;
  83562. for ( const rect of rects ) {
  83563. rectangleCount++;
  83564. boundingRectData.left = Math.min( boundingRectData.left, rect.left );
  83565. boundingRectData.top = Math.min( boundingRectData.top, rect.top );
  83566. boundingRectData.right = Math.max( boundingRectData.right, rect.right );
  83567. boundingRectData.bottom = Math.max( boundingRectData.bottom, rect.bottom );
  83568. }
  83569. if ( rectangleCount == 0 ) {
  83570. return null;
  83571. }
  83572. boundingRectData.width = boundingRectData.right - boundingRectData.left;
  83573. boundingRectData.height = boundingRectData.bottom - boundingRectData.top;
  83574. return new Rect( boundingRectData );
  83575. }
  83576. }
  83577. // Acquires all the rect properties from the passed source.
  83578. //
  83579. // @private
  83580. // @param {module:utils/dom/rect~Rect} rect
  83581. // @param {ClientRect|module:utils/dom/rect~Rect|Object} source
  83582. function copyRectProperties( rect, source ) {
  83583. for ( const p of rectProperties ) {
  83584. rect[ p ] = source[ p ];
  83585. }
  83586. }
  83587. // Checks if provided object is a <body> HTML element.
  83588. //
  83589. // @private
  83590. // @param {HTMLElement|Range} elementOrRange
  83591. // @returns {Boolean}
  83592. function isBody( elementOrRange ) {
  83593. if ( !Object(lodash_es__WEBPACK_IMPORTED_MODULE_4__["isElement"])( elementOrRange ) ) {
  83594. return false;
  83595. }
  83596. return elementOrRange === elementOrRange.ownerDocument.body;
  83597. }
  83598. /***/ }),
  83599. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/remove.js":
  83600. /*!******************************************************************!*\
  83601. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/remove.js ***!
  83602. \******************************************************************/
  83603. /*! exports provided: default */
  83604. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  83605. "use strict";
  83606. __webpack_require__.r(__webpack_exports__);
  83607. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return remove; });
  83608. /**
  83609. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  83610. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  83611. */
  83612. /**
  83613. * @module utils/dom/remove
  83614. */
  83615. /**
  83616. * Removes given node from parent.
  83617. *
  83618. * @param {Node} node Node to remove.
  83619. */
  83620. function remove( node ) {
  83621. const parent = node.parentNode;
  83622. if ( parent ) {
  83623. parent.removeChild( node );
  83624. }
  83625. }
  83626. /***/ }),
  83627. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/resizeobserver.js":
  83628. /*!**************************************************************************!*\
  83629. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/resizeobserver.js ***!
  83630. \**************************************************************************/
  83631. /*! exports provided: default */
  83632. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  83633. "use strict";
  83634. __webpack_require__.r(__webpack_exports__);
  83635. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ResizeObserver; });
  83636. /* harmony import */ var _mix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  83637. /* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
  83638. /* harmony import */ var _rect__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
  83639. /* harmony import */ var _emittermixin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js");
  83640. /**
  83641. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  83642. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  83643. */
  83644. /**
  83645. * @module utils/dom/resizeobserver
  83646. */
  83647. /* globals setTimeout, clearTimeout */
  83648. const RESIZE_CHECK_INTERVAL = 100;
  83649. /**
  83650. * A helper class which instances allow performing custom actions when native DOM elements are resized.
  83651. *
  83652. * const editableElement = editor.editing.view.getDomRoot();
  83653. *
  83654. * const observer = new ResizeObserver( editableElement, entry => {
  83655. * console.log( 'The editable element has been resized in DOM.' );
  83656. * console.log( entry.target ); // -> editableElement
  83657. * console.log( entry.contentRect.width ); // -> e.g. '423px'
  83658. * } );
  83659. *
  83660. * By default, it uses the [native DOM resize observer](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver)
  83661. * under the hood and in browsers that do not support the native API yet, a polyfilled observer is
  83662. * used instead.
  83663. */
  83664. class ResizeObserver {
  83665. /**
  83666. * Creates an instance of the `ResizeObserver` class.
  83667. *
  83668. * @param {HTMLElement} element A DOM element that is to be observed for resizing. Note that
  83669. * the element must be visible (i.e. not detached from DOM) for the observer to work.
  83670. * @param {Function} callback A function called when the observed element was resized. It passes
  83671. * the [`ResizeObserverEntry`](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry)
  83672. * object with information about the resize event.
  83673. */
  83674. constructor( element, callback ) {
  83675. // **Note**: For the maximum performance, this class ensures only a single instance of the native
  83676. // (or polyfilled) observer is used no matter how many instances of this class were created.
  83677. if ( !ResizeObserver._observerInstance ) {
  83678. ResizeObserver._createObserver();
  83679. }
  83680. /**
  83681. * The element observer by this observer.
  83682. *
  83683. * @readonly
  83684. * @private
  83685. * @member {HTMLElement}
  83686. */
  83687. this._element = element;
  83688. /**
  83689. * The callback executed each time {@link #_element} is resized.
  83690. *
  83691. * @readonly
  83692. * @private
  83693. * @member {Function}
  83694. */
  83695. this._callback = callback;
  83696. ResizeObserver._addElementCallback( element, callback );
  83697. ResizeObserver._observerInstance.observe( element );
  83698. }
  83699. /**
  83700. * Destroys the observer which disables the `callback` passed to the {@link #constructor}.
  83701. */
  83702. destroy() {
  83703. ResizeObserver._deleteElementCallback( this._element, this._callback );
  83704. }
  83705. /**
  83706. * Registers a new resize callback for the DOM element.
  83707. *
  83708. * @private
  83709. * @static
  83710. * @param {HTMLElement} element
  83711. * @param {Function} callback
  83712. */
  83713. static _addElementCallback( element, callback ) {
  83714. if ( !ResizeObserver._elementCallbacks ) {
  83715. ResizeObserver._elementCallbacks = new Map();
  83716. }
  83717. let callbacks = ResizeObserver._elementCallbacks.get( element );
  83718. if ( !callbacks ) {
  83719. callbacks = new Set();
  83720. ResizeObserver._elementCallbacks.set( element, callbacks );
  83721. }
  83722. callbacks.add( callback );
  83723. }
  83724. /**
  83725. * Removes a resize callback from the DOM element. If no callbacks are left
  83726. * for the element, it removes the element from the native observer.
  83727. *
  83728. * @private
  83729. * @static
  83730. * @param {HTMLElement} element
  83731. * @param {Function} callback
  83732. */
  83733. static _deleteElementCallback( element, callback ) {
  83734. const callbacks = ResizeObserver._getElementCallbacks( element );
  83735. // Remove the element callback. Check if exist first in case someone
  83736. // called destroy() twice.
  83737. if ( callbacks ) {
  83738. callbacks.delete( callback );
  83739. // If no callbacks left for the element, also remove the element.
  83740. if ( !callbacks.size ) {
  83741. ResizeObserver._elementCallbacks.delete( element );
  83742. ResizeObserver._observerInstance.unobserve( element );
  83743. }
  83744. }
  83745. if ( ResizeObserver._elementCallbacks && !ResizeObserver._elementCallbacks.size ) {
  83746. ResizeObserver._observerInstance = null;
  83747. ResizeObserver._elementCallbacks = null;
  83748. }
  83749. }
  83750. /**
  83751. * Returns are registered resize callbacks for the DOM element.
  83752. *
  83753. * @private
  83754. * @static
  83755. * @param {HTMLElement} element
  83756. * @returns {Set.<HTMLElement>|null}
  83757. */
  83758. static _getElementCallbacks( element ) {
  83759. if ( !ResizeObserver._elementCallbacks ) {
  83760. return null;
  83761. }
  83762. return ResizeObserver._elementCallbacks.get( element );
  83763. }
  83764. /**
  83765. * Creates the single native observer shared across all `ResizeObserver` instances.
  83766. * If the browser does not support the native API, it creates a polyfill.
  83767. *
  83768. * @private
  83769. * @static
  83770. */
  83771. static _createObserver() {
  83772. let ObserverConstructor;
  83773. // TODO: One day, the `ResizeObserver` API will be supported in all modern web browsers.
  83774. // When it happens, this module will no longer make sense and should be removed and
  83775. // the native implementation should be used across the project to save bytes.
  83776. // Check out https://caniuse.com/#feat=resizeobserver.
  83777. if ( typeof _global__WEBPACK_IMPORTED_MODULE_1__["default"].window.ResizeObserver === 'function' ) {
  83778. ObserverConstructor = _global__WEBPACK_IMPORTED_MODULE_1__["default"].window.ResizeObserver;
  83779. } else {
  83780. ObserverConstructor = ResizeObserverPolyfill;
  83781. }
  83782. ResizeObserver._observerInstance = new ObserverConstructor( entries => {
  83783. for ( const entry of entries ) {
  83784. const callbacks = ResizeObserver._getElementCallbacks( entry.target );
  83785. if ( callbacks ) {
  83786. for ( const callback of callbacks ) {
  83787. callback( entry );
  83788. }
  83789. }
  83790. }
  83791. } );
  83792. }
  83793. }
  83794. /**
  83795. * The single native observer instance (or polyfill in browsers that do not support the API)
  83796. * shared across all {@link module:utils/dom/resizeobserver~ResizeObserver} instances.
  83797. *
  83798. * @static
  83799. * @protected
  83800. * @readonly
  83801. * @property {Object|null} module:utils/dom/resizeobserver~ResizeObserver#_observerInstance
  83802. */
  83803. ResizeObserver._observerInstance = null;
  83804. /**
  83805. * A mapping of native DOM elements and their callbacks shared across all
  83806. * {@link module:utils/dom/resizeobserver~ResizeObserver} instances.
  83807. *
  83808. * @static
  83809. * @private
  83810. * @readonly
  83811. * @property {Map.<HTMLElement,Set>|null} module:utils/dom/resizeobserver~ResizeObserver#_elementCallbacks
  83812. */
  83813. ResizeObserver._elementCallbacks = null;
  83814. /**
  83815. * A polyfill class for the native [`ResizeObserver`](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver).
  83816. *
  83817. * @private
  83818. * @mixes module:utils/domemittermixin~DomEmitterMixin
  83819. */
  83820. class ResizeObserverPolyfill {
  83821. /**
  83822. * Creates an instance of the {@link module:utils/dom/resizeobserver~ResizeObserverPolyfill} class.
  83823. *
  83824. * It synchronously reacts to resize of the window to check if observed elements' geometry changed.
  83825. *
  83826. * Additionally, the polyfilled observer uses a timeout to check if observed elements' geometry has changed
  83827. * in some other way (dynamic layouts, scrollbars showing up, etc.), so its response can also be asynchronous.
  83828. *
  83829. * @param {Function} callback A function called when any observed element was resized. Refer to the
  83830. * native [`ResizeObserver`](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver) API to
  83831. * learn more.
  83832. */
  83833. constructor( callback ) {
  83834. /**
  83835. * A function called when any observed {@link #_elements element} was resized.
  83836. *
  83837. * @readonly
  83838. * @protected
  83839. * @member {Function}
  83840. */
  83841. this._callback = callback;
  83842. /**
  83843. * DOM elements currently observed by the observer instance.
  83844. *
  83845. * @readonly
  83846. * @protected
  83847. * @member {Set}
  83848. */
  83849. this._elements = new Set();
  83850. /**
  83851. * Cached DOM {@link #_elements elements} bounding rects to compare to upon the next check.
  83852. *
  83853. * @readonly
  83854. * @protected
  83855. * @member {Map.<HTMLElement,module:utils/dom/rect~Rect>}
  83856. */
  83857. this._previousRects = new Map();
  83858. /**
  83859. * An UID of the current timeout upon which the observed elements rects
  83860. * will be compared to the {@link #_previousRects previous rects} from the past.
  83861. *
  83862. * @readonly
  83863. * @protected
  83864. * @member {Map.<HTMLElement,module:utils/dom/rect~Rect>}
  83865. */
  83866. this._periodicCheckTimeout = null;
  83867. }
  83868. /**
  83869. * Starts observing a DOM element.
  83870. *
  83871. * Learn more in the
  83872. * [native method documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/observe).
  83873. *
  83874. * @param {HTMLElement} element
  83875. */
  83876. observe( element ) {
  83877. this._elements.add( element );
  83878. this._checkElementRectsAndExecuteCallback();
  83879. if ( this._elements.size === 1 ) {
  83880. this._startPeriodicCheck();
  83881. }
  83882. }
  83883. /**
  83884. * Stops observing a DOM element.
  83885. *
  83886. * Learn more in the
  83887. * [native method documentation](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/unobserve).
  83888. *
  83889. * @param {HTMLElement} element
  83890. */
  83891. unobserve( element ) {
  83892. this._elements.delete( element );
  83893. this._previousRects.delete( element );
  83894. if ( !this._elements.size ) {
  83895. this._stopPeriodicCheck();
  83896. }
  83897. }
  83898. /**
  83899. * When called, the observer calls the {@link #_callback resize callback} for all observed
  83900. * {@link #_elements elements} but also starts checking periodically for changes in the elements' geometry.
  83901. * If some are detected, {@link #_callback resize callback} is called for relevant elements that were resized.
  83902. *
  83903. * @protected
  83904. */
  83905. _startPeriodicCheck() {
  83906. const periodicCheck = () => {
  83907. this._checkElementRectsAndExecuteCallback();
  83908. this._periodicCheckTimeout = setTimeout( periodicCheck, RESIZE_CHECK_INTERVAL );
  83909. };
  83910. this.listenTo( _global__WEBPACK_IMPORTED_MODULE_1__["default"].window, 'resize', () => {
  83911. this._checkElementRectsAndExecuteCallback();
  83912. } );
  83913. this._periodicCheckTimeout = setTimeout( periodicCheck, RESIZE_CHECK_INTERVAL );
  83914. }
  83915. /**
  83916. * Stops checking for changes in all observed {@link #_elements elements} geometry.
  83917. *
  83918. * @protected
  83919. */
  83920. _stopPeriodicCheck() {
  83921. clearTimeout( this._periodicCheckTimeout );
  83922. this.stopListening();
  83923. this._previousRects.clear();
  83924. }
  83925. /**
  83926. * Checks if the geometry of any of the {@link #_elements element} has changed. If so, executes
  83927. * the {@link #_callback resize callback} with element geometry data.
  83928. *
  83929. * @protected
  83930. */
  83931. _checkElementRectsAndExecuteCallback() {
  83932. const entries = [];
  83933. for ( const element of this._elements ) {
  83934. if ( this._hasRectChanged( element ) ) {
  83935. entries.push( {
  83936. target: element,
  83937. contentRect: this._previousRects.get( element )
  83938. } );
  83939. }
  83940. }
  83941. if ( entries.length ) {
  83942. this._callback( entries );
  83943. }
  83944. }
  83945. /**
  83946. * Compares the DOM element geometry to the {@link #_previousRects cached geometry} from the past.
  83947. * Returns `true` if geometry has changed or the element is checked for the first time.
  83948. *
  83949. * @protected
  83950. * @param {HTMLElement} element
  83951. * @returns {Boolean}
  83952. */
  83953. _hasRectChanged( element ) {
  83954. if ( !element.ownerDocument.body.contains( element ) ) {
  83955. return false;
  83956. }
  83957. const currentRect = new _rect__WEBPACK_IMPORTED_MODULE_2__["default"]( element );
  83958. const previousRect = this._previousRects.get( element );
  83959. // The first check should always yield true despite no Previous rect to compare to.
  83960. // The native ResizeObserver does that and... that makes sense. Sort of.
  83961. const hasChanged = !previousRect || !previousRect.isEqual( currentRect );
  83962. this._previousRects.set( element, currentRect );
  83963. return hasChanged;
  83964. }
  83965. }
  83966. Object(_mix__WEBPACK_IMPORTED_MODULE_0__["default"])( ResizeObserverPolyfill, _emittermixin__WEBPACK_IMPORTED_MODULE_3__["default"] );
  83967. /***/ }),
  83968. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/scroll.js":
  83969. /*!******************************************************************!*\
  83970. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/scroll.js ***!
  83971. \******************************************************************/
  83972. /*! exports provided: scrollViewportToShowTarget, scrollAncestorsToShowTarget */
  83973. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  83974. "use strict";
  83975. __webpack_require__.r(__webpack_exports__);
  83976. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scrollViewportToShowTarget", function() { return scrollViewportToShowTarget; });
  83977. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scrollAncestorsToShowTarget", function() { return scrollAncestorsToShowTarget; });
  83978. /* harmony import */ var _isrange__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isrange */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/isrange.js");
  83979. /* harmony import */ var _rect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
  83980. /* harmony import */ var _istext__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./istext */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/istext.js");
  83981. /**
  83982. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  83983. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  83984. */
  83985. /**
  83986. * @module utils/dom/scroll
  83987. */
  83988. const utils = {};
  83989. /**
  83990. * Makes any page `HTMLElement` or `Range` (`target`) visible inside the browser viewport.
  83991. * This helper will scroll all `target` ancestors and the web browser viewport to reveal the target to
  83992. * the user. If the `target` is already visible, nothing will happen.
  83993. *
  83994. * @param {HTMLElement|Range} options.target A target, which supposed to become visible to the user.
  83995. * @param {Number} [options.viewportOffset] An offset from the edge of the viewport (in pixels)
  83996. * the `target` will be moved by when the viewport is scrolled. It enhances the user experience
  83997. * by keeping the `target` some distance from the edge of the viewport and thus making it easier to
  83998. * read or edit by the user.
  83999. */
  84000. function scrollViewportToShowTarget( { target, viewportOffset = 0 } ) {
  84001. const targetWindow = getWindow( target );
  84002. let currentWindow = targetWindow;
  84003. let currentFrame = null;
  84004. // Iterate over all windows, starting from target's parent window up to window#top.
  84005. while ( currentWindow ) {
  84006. let firstAncestorToScroll;
  84007. // Let's scroll target's ancestors first to reveal it. Then, once the ancestor scrolls
  84008. // settled down, the algorithm can eventually scroll the viewport of the current window.
  84009. //
  84010. // Note: If the current window is target's **original** window (e.g. the first one),
  84011. // start scrolling the closest parent of the target. If not, scroll the closest parent
  84012. // of an iframe that resides in the current window.
  84013. if ( currentWindow == targetWindow ) {
  84014. firstAncestorToScroll = getParentElement( target );
  84015. } else {
  84016. firstAncestorToScroll = getParentElement( currentFrame );
  84017. }
  84018. // Scroll the target's ancestors first. Once done, scrolling the viewport is easy.
  84019. scrollAncestorsToShowRect( firstAncestorToScroll, () => {
  84020. // Note: If the target does not belong to the current window **directly**,
  84021. // i.e. it resides in an iframe belonging to the window, obtain the target's rect
  84022. // in the coordinates of the current window. By default, a Rect returns geometry
  84023. // relative to the current window's viewport. To make it work in a parent window,
  84024. // it must be shifted.
  84025. return getRectRelativeToWindow( target, currentWindow );
  84026. } );
  84027. // Obtain the rect of the target after it has been scrolled within its ancestors.
  84028. // It's time to scroll the viewport.
  84029. const targetRect = getRectRelativeToWindow( target, currentWindow );
  84030. scrollWindowToShowRect( currentWindow, targetRect, viewportOffset );
  84031. if ( currentWindow.parent != currentWindow ) {
  84032. // Keep the reference to the <iframe> element the "previous current window" was
  84033. // rendered within. It will be useful to re–calculate the rect of the target
  84034. // in the parent window's relative geometry. The target's rect must be shifted
  84035. // by it's iframe's position.
  84036. currentFrame = currentWindow.frameElement;
  84037. currentWindow = currentWindow.parent;
  84038. // If the current window has some parent but frameElement is inaccessible, then they have
  84039. // different domains/ports and, due to security reasons, accessing and scrolling
  84040. // the parent window won't be possible.
  84041. // See https://github.com/ckeditor/ckeditor5/issues/930.
  84042. if ( !currentFrame ) {
  84043. return;
  84044. }
  84045. } else {
  84046. currentWindow = null;
  84047. }
  84048. }
  84049. }
  84050. /**
  84051. * Makes any page `HTMLElement` or `Range` (target) visible within its scrollable ancestors,
  84052. * e.g. if they have `overflow: scroll` CSS style.
  84053. *
  84054. * @param {HTMLElement|Range} target A target, which supposed to become visible to the user.
  84055. */
  84056. function scrollAncestorsToShowTarget( target ) {
  84057. const targetParent = getParentElement( target );
  84058. scrollAncestorsToShowRect( targetParent, () => {
  84059. return new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( target );
  84060. } );
  84061. }
  84062. // TODO: Using a property value shorthand in the top of the file
  84063. // causes JSDoc to throw errors. See https://github.com/cksource/docs-builder/issues/75.
  84064. Object.assign( utils, {
  84065. scrollViewportToShowTarget,
  84066. scrollAncestorsToShowTarget
  84067. } );
  84068. // Makes a given rect visible within its parent window.
  84069. //
  84070. // Note: Avoid the situation where the caret is still in the viewport, but totally
  84071. // at the edge of it. In such situation, if it moved beyond the viewport in the next
  84072. // action e.g. after paste, the scrolling would move it to the viewportOffset level
  84073. // and it all would look like the caret visually moved up/down:
  84074. //
  84075. // 1.
  84076. // | foo[]
  84077. // | <--- N px of space below the caret
  84078. // +---------------------------------...
  84079. //
  84080. // 2. *paste*
  84081. // 3.
  84082. // |
  84083. // |
  84084. // +-foo-----------------------------...
  84085. // bar[] <--- caret below viewport, scrolling...
  84086. //
  84087. // 4. *scrolling*
  84088. // 5.
  84089. // |
  84090. // | foo
  84091. // | bar[] <--- caret precisely at the edge
  84092. // +---------------------------------...
  84093. //
  84094. // To prevent this, this method checks the rects moved by the viewportOffset to cover
  84095. // the upper/lower edge of the viewport. It makes sure if the action repeats, there's
  84096. // no twitching – it's a purely visual improvement:
  84097. //
  84098. // 5. (after fix)
  84099. // |
  84100. // | foo
  84101. // | bar[]
  84102. // | <--- N px of space below the caret
  84103. // +---------------------------------...
  84104. //
  84105. // @private
  84106. // @param {Window} window A window which is scrolled to reveal the rect.
  84107. // @param {module:utils/dom/rect~Rect} rect A rect which is to be revealed.
  84108. // @param {Number} viewportOffset See scrollViewportToShowTarget.
  84109. function scrollWindowToShowRect( window, rect, viewportOffset ) {
  84110. const targetShiftedDownRect = rect.clone().moveBy( 0, viewportOffset );
  84111. const targetShiftedUpRect = rect.clone().moveBy( 0, -viewportOffset );
  84112. const viewportRect = new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( window ).excludeScrollbarsAndBorders();
  84113. const rects = [ targetShiftedUpRect, targetShiftedDownRect ];
  84114. if ( !rects.every( rect => viewportRect.contains( rect ) ) ) {
  84115. let { scrollX, scrollY } = window;
  84116. if ( isAbove( targetShiftedUpRect, viewportRect ) ) {
  84117. scrollY -= viewportRect.top - rect.top + viewportOffset;
  84118. } else if ( isBelow( targetShiftedDownRect, viewportRect ) ) {
  84119. scrollY += rect.bottom - viewportRect.bottom + viewportOffset;
  84120. }
  84121. // TODO: Web browsers scroll natively to place the target in the middle
  84122. // of the viewport. It's not a very popular case, though.
  84123. if ( isLeftOf( rect, viewportRect ) ) {
  84124. scrollX -= viewportRect.left - rect.left + viewportOffset;
  84125. } else if ( isRightOf( rect, viewportRect ) ) {
  84126. scrollX += rect.right - viewportRect.right + viewportOffset;
  84127. }
  84128. window.scrollTo( scrollX, scrollY );
  84129. }
  84130. }
  84131. // Recursively scrolls element ancestors to visually reveal a rect.
  84132. //
  84133. // @private
  84134. // @param {HTMLElement} A parent The first ancestors to start scrolling.
  84135. // @param {Function} getRect A function which returns the Rect, which is to be revealed.
  84136. function scrollAncestorsToShowRect( parent, getRect ) {
  84137. const parentWindow = getWindow( parent );
  84138. let parentRect, targetRect;
  84139. while ( parent != parentWindow.document.body ) {
  84140. targetRect = getRect();
  84141. parentRect = new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( parent ).excludeScrollbarsAndBorders();
  84142. if ( !parentRect.contains( targetRect ) ) {
  84143. if ( isAbove( targetRect, parentRect ) ) {
  84144. parent.scrollTop -= parentRect.top - targetRect.top;
  84145. } else if ( isBelow( targetRect, parentRect ) ) {
  84146. parent.scrollTop += targetRect.bottom - parentRect.bottom;
  84147. }
  84148. if ( isLeftOf( targetRect, parentRect ) ) {
  84149. parent.scrollLeft -= parentRect.left - targetRect.left;
  84150. } else if ( isRightOf( targetRect, parentRect ) ) {
  84151. parent.scrollLeft += targetRect.right - parentRect.right;
  84152. }
  84153. }
  84154. parent = parent.parentNode;
  84155. }
  84156. }
  84157. // Determines if a given `Rect` extends beyond the bottom edge of the second `Rect`.
  84158. //
  84159. // @private
  84160. // @param {module:utils/dom/rect~Rect} firstRect
  84161. // @param {module:utils/dom/rect~Rect} secondRect
  84162. function isBelow( firstRect, secondRect ) {
  84163. return firstRect.bottom > secondRect.bottom;
  84164. }
  84165. // Determines if a given `Rect` extends beyond the top edge of the second `Rect`.
  84166. //
  84167. // @private
  84168. // @param {module:utils/dom/rect~Rect} firstRect
  84169. // @param {module:utils/dom/rect~Rect} secondRect
  84170. function isAbove( firstRect, secondRect ) {
  84171. return firstRect.top < secondRect.top;
  84172. }
  84173. // Determines if a given `Rect` extends beyond the left edge of the second `Rect`.
  84174. //
  84175. // @private
  84176. // @param {module:utils/dom/rect~Rect} firstRect
  84177. // @param {module:utils/dom/rect~Rect} secondRect
  84178. function isLeftOf( firstRect, secondRect ) {
  84179. return firstRect.left < secondRect.left;
  84180. }
  84181. // Determines if a given `Rect` extends beyond the right edge of the second `Rect`.
  84182. //
  84183. // @private
  84184. // @param {module:utils/dom/rect~Rect} firstRect
  84185. // @param {module:utils/dom/rect~Rect} secondRect
  84186. function isRightOf( firstRect, secondRect ) {
  84187. return firstRect.right > secondRect.right;
  84188. }
  84189. // Returns the closest window of an element or range.
  84190. //
  84191. // @private
  84192. // @param {HTMLElement|Range} firstRect
  84193. // @returns {Window}
  84194. function getWindow( elementOrRange ) {
  84195. if ( Object(_isrange__WEBPACK_IMPORTED_MODULE_0__["default"])( elementOrRange ) ) {
  84196. return elementOrRange.startContainer.ownerDocument.defaultView;
  84197. } else {
  84198. return elementOrRange.ownerDocument.defaultView;
  84199. }
  84200. }
  84201. // Returns the closest parent of an element or DOM range.
  84202. //
  84203. // @private
  84204. // @param {HTMLElement|Range} firstRect
  84205. // @returns {HTMLelement}
  84206. function getParentElement( elementOrRange ) {
  84207. if ( Object(_isrange__WEBPACK_IMPORTED_MODULE_0__["default"])( elementOrRange ) ) {
  84208. let parent = elementOrRange.commonAncestorContainer;
  84209. // If a Range is attached to the Text, use the closest element ancestor.
  84210. if ( Object(_istext__WEBPACK_IMPORTED_MODULE_2__["default"])( parent ) ) {
  84211. parent = parent.parentNode;
  84212. }
  84213. return parent;
  84214. } else {
  84215. return elementOrRange.parentNode;
  84216. }
  84217. }
  84218. // Returns the rect of an element or range residing in an iframe.
  84219. // The result rect is relative to the geometry of the passed window instance.
  84220. //
  84221. // @private
  84222. // @param {HTMLElement|Range} target Element or range which rect should be returned.
  84223. // @param {Window} relativeWindow A window the rect should be relative to.
  84224. // @returns {module:utils/dom/rect~Rect}
  84225. function getRectRelativeToWindow( target, relativeWindow ) {
  84226. const targetWindow = getWindow( target );
  84227. const rect = new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( target );
  84228. if ( targetWindow === relativeWindow ) {
  84229. return rect;
  84230. } else {
  84231. let currentWindow = targetWindow;
  84232. while ( currentWindow != relativeWindow ) {
  84233. const frame = currentWindow.frameElement;
  84234. const frameRect = new _rect__WEBPACK_IMPORTED_MODULE_1__["default"]( frame ).excludeScrollbarsAndBorders();
  84235. rect.moveBy( frameRect.left, frameRect.top );
  84236. currentWindow = currentWindow.parent;
  84237. }
  84238. }
  84239. return rect;
  84240. }
  84241. /***/ }),
  84242. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/setdatainelement.js":
  84243. /*!****************************************************************************!*\
  84244. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/setdatainelement.js ***!
  84245. \****************************************************************************/
  84246. /*! exports provided: default */
  84247. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  84248. "use strict";
  84249. __webpack_require__.r(__webpack_exports__);
  84250. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return setDataInElement; });
  84251. /**
  84252. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  84253. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  84254. */
  84255. /**
  84256. * @module utils/dom/setdatainelement
  84257. */
  84258. /* globals HTMLTextAreaElement */
  84259. /**
  84260. * Sets data in a given element.
  84261. *
  84262. * @param {HTMLElement} el The element in which the data will be set.
  84263. * @param {String} data The data string.
  84264. */
  84265. function setDataInElement( el, data ) {
  84266. if ( el instanceof HTMLTextAreaElement ) {
  84267. el.value = data;
  84268. }
  84269. el.innerHTML = data;
  84270. }
  84271. /***/ }),
  84272. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/tounit.js":
  84273. /*!******************************************************************!*\
  84274. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/dom/tounit.js ***!
  84275. \******************************************************************/
  84276. /*! exports provided: default */
  84277. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  84278. "use strict";
  84279. __webpack_require__.r(__webpack_exports__);
  84280. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return toUnit; });
  84281. /**
  84282. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  84283. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  84284. */
  84285. /**
  84286. * @module utils/dom/tounit
  84287. */
  84288. /**
  84289. * Returns a helper function, which adds a desired trailing
  84290. * `unit` to the passed value.
  84291. *
  84292. * @param {String} unit An unit like "px" or "em".
  84293. * @returns {module:utils/dom/tounit~helper}
  84294. */
  84295. function toUnit( unit ) {
  84296. /**
  84297. * A function, which adds a pre–defined trailing `unit`
  84298. * to the passed `value`.
  84299. *
  84300. * @function helper
  84301. * @param {*} value A value to be given the unit.
  84302. * @returns {String} A value with the trailing unit.
  84303. */
  84304. return value => value + unit;
  84305. }
  84306. /***/ }),
  84307. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/elementreplacer.js":
  84308. /*!***********************************************************************!*\
  84309. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/elementreplacer.js ***!
  84310. \***********************************************************************/
  84311. /*! exports provided: default */
  84312. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  84313. "use strict";
  84314. __webpack_require__.r(__webpack_exports__);
  84315. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ElementReplacer; });
  84316. /**
  84317. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  84318. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  84319. */
  84320. /**
  84321. * @module utils/elementreplacer
  84322. */
  84323. /**
  84324. * Utility class allowing to hide existing HTML elements or replace them with given ones in a way that doesn't remove
  84325. * the original elements from the DOM.
  84326. */
  84327. class ElementReplacer {
  84328. constructor() {
  84329. /**
  84330. * The elements replaced by {@link #replace} and their replacements.
  84331. *
  84332. * @private
  84333. * @member {Array.<Object>}
  84334. */
  84335. this._replacedElements = [];
  84336. }
  84337. /**
  84338. * Hides the `element` and, if specified, inserts the the given element next to it.
  84339. *
  84340. * The effect of this method can be reverted by {@link #restore}.
  84341. *
  84342. * @param {HTMLElement} element The element to replace.
  84343. * @param {HTMLElement} [newElement] The replacement element. If not passed, then the `element` will just be hidden.
  84344. */
  84345. replace( element, newElement ) {
  84346. this._replacedElements.push( { element, newElement } );
  84347. element.style.display = 'none';
  84348. if ( newElement ) {
  84349. element.parentNode.insertBefore( newElement, element.nextSibling );
  84350. }
  84351. }
  84352. /**
  84353. * Restores what {@link #replace} did.
  84354. */
  84355. restore() {
  84356. this._replacedElements.forEach( ( { element, newElement } ) => {
  84357. element.style.display = '';
  84358. if ( newElement ) {
  84359. newElement.remove();
  84360. }
  84361. } );
  84362. this._replacedElements = [];
  84363. }
  84364. }
  84365. /***/ }),
  84366. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js":
  84367. /*!********************************************************************!*\
  84368. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js ***!
  84369. \********************************************************************/
  84370. /*! exports provided: default, _getEmitterListenedTo, _setEmitterId, _getEmitterId */
  84371. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  84372. "use strict";
  84373. __webpack_require__.r(__webpack_exports__);
  84374. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_getEmitterListenedTo", function() { return _getEmitterListenedTo; });
  84375. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_setEmitterId", function() { return _setEmitterId; });
  84376. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_getEmitterId", function() { return _getEmitterId; });
  84377. /* harmony import */ var _eventinfo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./eventinfo */ "./node_modules/@ckeditor/ckeditor5-utils/src/eventinfo.js");
  84378. /* harmony import */ var _uid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./uid */ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js");
  84379. /* harmony import */ var _priorities__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./priorities */ "./node_modules/@ckeditor/ckeditor5-utils/src/priorities.js");
  84380. /* harmony import */ var _version__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./version */ "./node_modules/@ckeditor/ckeditor5-utils/src/version.js");
  84381. /* harmony import */ var _ckeditorerror__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  84382. /**
  84383. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  84384. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  84385. */
  84386. /**
  84387. * @module utils/emittermixin
  84388. */
  84389. // To check if component is loaded more than once.
  84390. const _listeningTo = Symbol( 'listeningTo' );
  84391. const _emitterId = Symbol( 'emitterId' );
  84392. /**
  84393. * Mixin that injects the {@link ~Emitter events API} into its host.
  84394. *
  84395. * @mixin EmitterMixin
  84396. * @implements module:utils/emittermixin~Emitter
  84397. */
  84398. const EmitterMixin = {
  84399. /**
  84400. * @inheritDoc
  84401. */
  84402. on( event, callback, options = {} ) {
  84403. this.listenTo( this, event, callback, options );
  84404. },
  84405. /**
  84406. * @inheritDoc
  84407. */
  84408. once( event, callback, options ) {
  84409. let wasFired = false;
  84410. const onceCallback = function( event, ...args ) {
  84411. // Ensure the callback is called only once even if the callback itself leads to re-firing the event
  84412. // (which would call the callback again).
  84413. if ( !wasFired ) {
  84414. wasFired = true;
  84415. // Go off() at the first call.
  84416. event.off();
  84417. // Go with the original callback.
  84418. callback.call( this, event, ...args );
  84419. }
  84420. };
  84421. // Make a similar on() call, simply replacing the callback.
  84422. this.listenTo( this, event, onceCallback, options );
  84423. },
  84424. /**
  84425. * @inheritDoc
  84426. */
  84427. off( event, callback ) {
  84428. this.stopListening( this, event, callback );
  84429. },
  84430. /**
  84431. * @inheritDoc
  84432. */
  84433. listenTo( emitter, event, callback, options = {} ) {
  84434. let emitterInfo, eventCallbacks;
  84435. // _listeningTo contains a list of emitters that this object is listening to.
  84436. // This list has the following format:
  84437. //
  84438. // _listeningTo: {
  84439. // emitterId: {
  84440. // emitter: emitter,
  84441. // callbacks: {
  84442. // event1: [ callback1, callback2, ... ]
  84443. // ....
  84444. // }
  84445. // },
  84446. // ...
  84447. // }
  84448. if ( !this[ _listeningTo ] ) {
  84449. this[ _listeningTo ] = {};
  84450. }
  84451. const emitters = this[ _listeningTo ];
  84452. if ( !_getEmitterId( emitter ) ) {
  84453. _setEmitterId( emitter );
  84454. }
  84455. const emitterId = _getEmitterId( emitter );
  84456. if ( !( emitterInfo = emitters[ emitterId ] ) ) {
  84457. emitterInfo = emitters[ emitterId ] = {
  84458. emitter,
  84459. callbacks: {}
  84460. };
  84461. }
  84462. if ( !( eventCallbacks = emitterInfo.callbacks[ event ] ) ) {
  84463. eventCallbacks = emitterInfo.callbacks[ event ] = [];
  84464. }
  84465. eventCallbacks.push( callback );
  84466. // Finally register the callback to the event.
  84467. createEventNamespace( emitter, event );
  84468. const lists = getCallbacksListsForNamespace( emitter, event );
  84469. const priority = _priorities__WEBPACK_IMPORTED_MODULE_2__["default"].get( options.priority );
  84470. const callbackDefinition = {
  84471. callback,
  84472. priority
  84473. };
  84474. // Add the callback to all callbacks list.
  84475. for ( const callbacks of lists ) {
  84476. // Add the callback to the list in the right priority position.
  84477. let added = false;
  84478. for ( let i = 0; i < callbacks.length; i++ ) {
  84479. if ( callbacks[ i ].priority < priority ) {
  84480. callbacks.splice( i, 0, callbackDefinition );
  84481. added = true;
  84482. break;
  84483. }
  84484. }
  84485. // Add at the end, if right place was not found.
  84486. if ( !added ) {
  84487. callbacks.push( callbackDefinition );
  84488. }
  84489. }
  84490. },
  84491. /**
  84492. * @inheritDoc
  84493. */
  84494. stopListening( emitter, event, callback ) {
  84495. const emitters = this[ _listeningTo ];
  84496. let emitterId = emitter && _getEmitterId( emitter );
  84497. const emitterInfo = emitters && emitterId && emitters[ emitterId ];
  84498. const eventCallbacks = emitterInfo && event && emitterInfo.callbacks[ event ];
  84499. // Stop if nothing has been listened.
  84500. if ( !emitters || ( emitter && !emitterInfo ) || ( event && !eventCallbacks ) ) {
  84501. return;
  84502. }
  84503. // All params provided. off() that single callback.
  84504. if ( callback ) {
  84505. removeCallback( emitter, event, callback );
  84506. }
  84507. // Only `emitter` and `event` provided. off() all callbacks for that event.
  84508. else if ( eventCallbacks ) {
  84509. while ( ( callback = eventCallbacks.pop() ) ) {
  84510. removeCallback( emitter, event, callback );
  84511. }
  84512. delete emitterInfo.callbacks[ event ];
  84513. }
  84514. // Only `emitter` provided. off() all events for that emitter.
  84515. else if ( emitterInfo ) {
  84516. for ( event in emitterInfo.callbacks ) {
  84517. this.stopListening( emitter, event );
  84518. }
  84519. delete emitters[ emitterId ];
  84520. }
  84521. // No params provided. off() all emitters.
  84522. else {
  84523. for ( emitterId in emitters ) {
  84524. this.stopListening( emitters[ emitterId ].emitter );
  84525. }
  84526. delete this[ _listeningTo ];
  84527. }
  84528. },
  84529. /**
  84530. * @inheritDoc
  84531. */
  84532. fire( eventOrInfo, ...args ) {
  84533. try {
  84534. const eventInfo = eventOrInfo instanceof _eventinfo__WEBPACK_IMPORTED_MODULE_0__["default"] ? eventOrInfo : new _eventinfo__WEBPACK_IMPORTED_MODULE_0__["default"]( this, eventOrInfo );
  84535. const event = eventInfo.name;
  84536. let callbacks = getCallbacksForEvent( this, event );
  84537. // Record that the event passed this emitter on its path.
  84538. eventInfo.path.push( this );
  84539. // Handle event listener callbacks first.
  84540. if ( callbacks ) {
  84541. // Arguments passed to each callback.
  84542. const callbackArgs = [ eventInfo, ...args ];
  84543. // Copying callbacks array is the easiest and most secure way of preventing infinite loops, when event callbacks
  84544. // are added while processing other callbacks. Previous solution involved adding counters (unique ids) but
  84545. // failed if callbacks were added to the queue before currently processed callback.
  84546. // If this proves to be too inefficient, another method is to change `.on()` so callbacks are stored if same
  84547. // event is currently processed. Then, `.fire()` at the end, would have to add all stored events.
  84548. callbacks = Array.from( callbacks );
  84549. for ( let i = 0; i < callbacks.length; i++ ) {
  84550. callbacks[ i ].callback.apply( this, callbackArgs );
  84551. // Remove the callback from future requests if off() has been called.
  84552. if ( eventInfo.off.called ) {
  84553. // Remove the called mark for the next calls.
  84554. delete eventInfo.off.called;
  84555. removeCallback( this, event, callbacks[ i ].callback );
  84556. }
  84557. // Do not execute next callbacks if stop() was called.
  84558. if ( eventInfo.stop.called ) {
  84559. break;
  84560. }
  84561. }
  84562. }
  84563. // Delegate event to other emitters if needed.
  84564. if ( this._delegations ) {
  84565. const destinations = this._delegations.get( event );
  84566. const passAllDestinations = this._delegations.get( '*' );
  84567. if ( destinations ) {
  84568. fireDelegatedEvents( destinations, eventInfo, args );
  84569. }
  84570. if ( passAllDestinations ) {
  84571. fireDelegatedEvents( passAllDestinations, eventInfo, args );
  84572. }
  84573. }
  84574. return eventInfo.return;
  84575. } catch ( err ) {
  84576. // @if CK_DEBUG // throw err;
  84577. /* istanbul ignore next */
  84578. _ckeditorerror__WEBPACK_IMPORTED_MODULE_4__["default"].rethrowUnexpectedError( err, this );
  84579. }
  84580. },
  84581. /**
  84582. * @inheritDoc
  84583. */
  84584. delegate( ...events ) {
  84585. return {
  84586. to: ( emitter, nameOrFunction ) => {
  84587. if ( !this._delegations ) {
  84588. this._delegations = new Map();
  84589. }
  84590. // Originally there was a for..of loop which unfortunately caused an error in Babel that didn't allow
  84591. // build an application. See: https://github.com/ckeditor/ckeditor5-react/issues/40.
  84592. events.forEach( eventName => {
  84593. const destinations = this._delegations.get( eventName );
  84594. if ( !destinations ) {
  84595. this._delegations.set( eventName, new Map( [ [ emitter, nameOrFunction ] ] ) );
  84596. } else {
  84597. destinations.set( emitter, nameOrFunction );
  84598. }
  84599. } );
  84600. }
  84601. };
  84602. },
  84603. /**
  84604. * @inheritDoc
  84605. */
  84606. stopDelegating( event, emitter ) {
  84607. if ( !this._delegations ) {
  84608. return;
  84609. }
  84610. if ( !event ) {
  84611. this._delegations.clear();
  84612. } else if ( !emitter ) {
  84613. this._delegations.delete( event );
  84614. } else {
  84615. const destinations = this._delegations.get( event );
  84616. if ( destinations ) {
  84617. destinations.delete( emitter );
  84618. }
  84619. }
  84620. }
  84621. };
  84622. /* harmony default export */ __webpack_exports__["default"] = (EmitterMixin);
  84623. /**
  84624. * Emitter/listener interface.
  84625. *
  84626. * Can be easily implemented by a class by mixing the {@link module:utils/emittermixin~EmitterMixin} mixin.
  84627. *
  84628. * @interface Emitter
  84629. */
  84630. /**
  84631. * Registers a callback function to be executed when an event is fired.
  84632. *
  84633. * Shorthand for {@link #listenTo `this.listenTo( this, event, callback, options )`} (it makes the emitter
  84634. * listen on itself).
  84635. *
  84636. * @method #on
  84637. * @param {String} event The name of the event.
  84638. * @param {Function} callback The function to be called on event.
  84639. * @param {Object} [options={}] Additional options.
  84640. * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of this event callback. The higher
  84641. * the priority value the sooner the callback will be fired. Events having the same priority are called in the
  84642. * order they were added.
  84643. */
  84644. /**
  84645. * Registers a callback function to be executed on the next time the event is fired only. This is similar to
  84646. * calling {@link #on} followed by {@link #off} in the callback.
  84647. *
  84648. * @method #once
  84649. * @param {String} event The name of the event.
  84650. * @param {Function} callback The function to be called on event.
  84651. * @param {Object} [options={}] Additional options.
  84652. * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of this event callback. The higher
  84653. * the priority value the sooner the callback will be fired. Events having the same priority are called in the
  84654. * order they were added.
  84655. */
  84656. /**
  84657. * Stops executing the callback on the given event.
  84658. * Shorthand for {@link #stopListening `this.stopListening( this, event, callback )`}.
  84659. *
  84660. * @method #off
  84661. * @param {String} event The name of the event.
  84662. * @param {Function} callback The function to stop being called.
  84663. */
  84664. /**
  84665. * Registers a callback function to be executed when an event is fired in a specific (emitter) object.
  84666. *
  84667. * Events can be grouped in namespaces using `:`.
  84668. * When namespaced event is fired, it additionally fires all callbacks for that namespace.
  84669. *
  84670. * // myEmitter.on( ... ) is a shorthand for myEmitter.listenTo( myEmitter, ... ).
  84671. * myEmitter.on( 'myGroup', genericCallback );
  84672. * myEmitter.on( 'myGroup:myEvent', specificCallback );
  84673. *
  84674. * // genericCallback is fired.
  84675. * myEmitter.fire( 'myGroup' );
  84676. * // both genericCallback and specificCallback are fired.
  84677. * myEmitter.fire( 'myGroup:myEvent' );
  84678. * // genericCallback is fired even though there are no callbacks for "foo".
  84679. * myEmitter.fire( 'myGroup:foo' );
  84680. *
  84681. * An event callback can {@link module:utils/eventinfo~EventInfo#stop stop the event} and
  84682. * set the {@link module:utils/eventinfo~EventInfo#return return value} of the {@link #fire} method.
  84683. *
  84684. * @method #listenTo
  84685. * @param {module:utils/emittermixin~Emitter} emitter The object that fires the event.
  84686. * @param {String} event The name of the event.
  84687. * @param {Function} callback The function to be called on event.
  84688. * @param {Object} [options={}] Additional options.
  84689. * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of this event callback. The higher
  84690. * the priority value the sooner the callback will be fired. Events having the same priority are called in the
  84691. * order they were added.
  84692. */
  84693. /**
  84694. * Stops listening for events. It can be used at different levels:
  84695. *
  84696. * * To stop listening to a specific callback.
  84697. * * To stop listening to a specific event.
  84698. * * To stop listening to all events fired by a specific object.
  84699. * * To stop listening to all events fired by all objects.
  84700. *
  84701. * @method #stopListening
  84702. * @param {module:utils/emittermixin~Emitter} [emitter] The object to stop listening to. If omitted, stops it for all objects.
  84703. * @param {String} [event] (Requires the `emitter`) The name of the event to stop listening to. If omitted, stops it
  84704. * for all events from `emitter`.
  84705. * @param {Function} [callback] (Requires the `event`) The function to be removed from the call list for the given
  84706. * `event`.
  84707. */
  84708. /**
  84709. * Fires an event, executing all callbacks registered for it.
  84710. *
  84711. * The first parameter passed to callbacks is an {@link module:utils/eventinfo~EventInfo} object,
  84712. * followed by the optional `args` provided in the `fire()` method call.
  84713. *
  84714. * @method #fire
  84715. * @param {String|module:utils/eventinfo~EventInfo} eventOrInfo The name of the event or `EventInfo` object if event is delegated.
  84716. * @param {...*} [args] Additional arguments to be passed to the callbacks.
  84717. * @returns {*} By default the method returns `undefined`. However, the return value can be changed by listeners
  84718. * through modification of the {@link module:utils/eventinfo~EventInfo#return `evt.return`}'s property (the event info
  84719. * is the first param of every callback).
  84720. */
  84721. /**
  84722. * Delegates selected events to another {@link module:utils/emittermixin~Emitter}. For instance:
  84723. *
  84724. * emitterA.delegate( 'eventX' ).to( emitterB );
  84725. * emitterA.delegate( 'eventX', 'eventY' ).to( emitterC );
  84726. *
  84727. * then `eventX` is delegated (fired by) `emitterB` and `emitterC` along with `data`:
  84728. *
  84729. * emitterA.fire( 'eventX', data );
  84730. *
  84731. * and `eventY` is delegated (fired by) `emitterC` along with `data`:
  84732. *
  84733. * emitterA.fire( 'eventY', data );
  84734. *
  84735. * @method #delegate
  84736. * @param {...String} events Event names that will be delegated to another emitter.
  84737. * @returns {module:utils/emittermixin~EmitterMixinDelegateChain}
  84738. */
  84739. /**
  84740. * Stops delegating events. It can be used at different levels:
  84741. *
  84742. * * To stop delegating all events.
  84743. * * To stop delegating a specific event to all emitters.
  84744. * * To stop delegating a specific event to a specific emitter.
  84745. *
  84746. * @method #stopDelegating
  84747. * @param {String} [event] The name of the event to stop delegating. If omitted, stops it all delegations.
  84748. * @param {module:utils/emittermixin~Emitter} [emitter] (requires `event`) The object to stop delegating a particular event to.
  84749. * If omitted, stops delegation of `event` to all emitters.
  84750. */
  84751. /**
  84752. * Checks if `listeningEmitter` listens to an emitter with given `listenedToEmitterId` and if so, returns that emitter.
  84753. * If not, returns `null`.
  84754. *
  84755. * @protected
  84756. * @param {module:utils/emittermixin~Emitter} listeningEmitter An emitter that listens.
  84757. * @param {String} listenedToEmitterId Unique emitter id of emitter listened to.
  84758. * @returns {module:utils/emittermixin~Emitter|null}
  84759. */
  84760. function _getEmitterListenedTo( listeningEmitter, listenedToEmitterId ) {
  84761. if ( listeningEmitter[ _listeningTo ] && listeningEmitter[ _listeningTo ][ listenedToEmitterId ] ) {
  84762. return listeningEmitter[ _listeningTo ][ listenedToEmitterId ].emitter;
  84763. }
  84764. return null;
  84765. }
  84766. /**
  84767. * Sets emitter's unique id.
  84768. *
  84769. * **Note:** `_emitterId` can be set only once.
  84770. *
  84771. * @protected
  84772. * @param {module:utils/emittermixin~Emitter} emitter An emitter for which id will be set.
  84773. * @param {String} [id] Unique id to set. If not passed, random unique id will be set.
  84774. */
  84775. function _setEmitterId( emitter, id ) {
  84776. if ( !emitter[ _emitterId ] ) {
  84777. emitter[ _emitterId ] = id || Object(_uid__WEBPACK_IMPORTED_MODULE_1__["default"])();
  84778. }
  84779. }
  84780. /**
  84781. * Returns emitter's unique id.
  84782. *
  84783. * @protected
  84784. * @param {module:utils/emittermixin~Emitter} emitter An emitter which id will be returned.
  84785. */
  84786. function _getEmitterId( emitter ) {
  84787. return emitter[ _emitterId ];
  84788. }
  84789. // Gets the internal `_events` property of the given object.
  84790. // `_events` property store all lists with callbacks for registered event names.
  84791. // If there were no events registered on the object, empty `_events` object is created.
  84792. function getEvents( source ) {
  84793. if ( !source._events ) {
  84794. Object.defineProperty( source, '_events', {
  84795. value: {}
  84796. } );
  84797. }
  84798. return source._events;
  84799. }
  84800. // Creates event node for generic-specific events relation architecture.
  84801. function makeEventNode() {
  84802. return {
  84803. callbacks: [],
  84804. childEvents: []
  84805. };
  84806. }
  84807. // Creates an architecture for generic-specific events relation.
  84808. // If needed, creates all events for given eventName, i.e. if the first registered event
  84809. // is foo:bar:abc, it will create foo:bar:abc, foo:bar and foo event and tie them together.
  84810. // It also copies callbacks from more generic events to more specific events when
  84811. // specific events are created.
  84812. function createEventNamespace( source, eventName ) {
  84813. const events = getEvents( source );
  84814. // First, check if the event we want to add to the structure already exists.
  84815. if ( events[ eventName ] ) {
  84816. // If it exists, we don't have to do anything.
  84817. return;
  84818. }
  84819. // In other case, we have to create the structure for the event.
  84820. // Note, that we might need to create intermediate events too.
  84821. // I.e. if foo:bar:abc is being registered and we only have foo in the structure,
  84822. // we need to also register foo:bar.
  84823. // Currently processed event name.
  84824. let name = eventName;
  84825. // Name of the event that is a child event for currently processed event.
  84826. let childEventName = null;
  84827. // Array containing all newly created specific events.
  84828. const newEventNodes = [];
  84829. // While loop can't check for ':' index because we have to handle generic events too.
  84830. // In each loop, we truncate event name, going from the most specific name to the generic one.
  84831. // I.e. foo:bar:abc -> foo:bar -> foo.
  84832. while ( name !== '' ) {
  84833. if ( events[ name ] ) {
  84834. // If the currently processed event name is already registered, we can be sure
  84835. // that it already has all the structure created, so we can break the loop here
  84836. // as no more events need to be registered.
  84837. break;
  84838. }
  84839. // If this event is not yet registered, create a new object for it.
  84840. events[ name ] = makeEventNode();
  84841. // Add it to the array with newly created events.
  84842. newEventNodes.push( events[ name ] );
  84843. // Add previously processed event name as a child of this event.
  84844. if ( childEventName ) {
  84845. events[ name ].childEvents.push( childEventName );
  84846. }
  84847. childEventName = name;
  84848. // If `.lastIndexOf()` returns -1, `.substr()` will return '' which will break the loop.
  84849. name = name.substr( 0, name.lastIndexOf( ':' ) );
  84850. }
  84851. if ( name !== '' ) {
  84852. // If name is not empty, we found an already registered event that was a parent of the
  84853. // event we wanted to register.
  84854. // Copy that event's callbacks to newly registered events.
  84855. for ( const node of newEventNodes ) {
  84856. node.callbacks = events[ name ].callbacks.slice();
  84857. }
  84858. // Add last newly created event to the already registered event.
  84859. events[ name ].childEvents.push( childEventName );
  84860. }
  84861. }
  84862. // Gets an array containing callbacks list for a given event and it's more specific events.
  84863. // I.e. if given event is foo:bar and there is also foo:bar:abc event registered, this will
  84864. // return callback list of foo:bar and foo:bar:abc (but not foo).
  84865. function getCallbacksListsForNamespace( source, eventName ) {
  84866. const eventNode = getEvents( source )[ eventName ];
  84867. if ( !eventNode ) {
  84868. return [];
  84869. }
  84870. let callbacksLists = [ eventNode.callbacks ];
  84871. for ( let i = 0; i < eventNode.childEvents.length; i++ ) {
  84872. const childCallbacksLists = getCallbacksListsForNamespace( source, eventNode.childEvents[ i ] );
  84873. callbacksLists = callbacksLists.concat( childCallbacksLists );
  84874. }
  84875. return callbacksLists;
  84876. }
  84877. // Get the list of callbacks for a given event, but only if there any callbacks have been registered.
  84878. // If there are no callbacks registered for given event, it checks if this is a specific event and looks
  84879. // for callbacks for it's more generic version.
  84880. function getCallbacksForEvent( source, eventName ) {
  84881. let event;
  84882. if ( !source._events || !( event = source._events[ eventName ] ) || !event.callbacks.length ) {
  84883. // There are no callbacks registered for specified eventName.
  84884. // But this could be a specific-type event that is in a namespace.
  84885. if ( eventName.indexOf( ':' ) > -1 ) {
  84886. // If the eventName is specific, try to find callback lists for more generic event.
  84887. return getCallbacksForEvent( source, eventName.substr( 0, eventName.lastIndexOf( ':' ) ) );
  84888. } else {
  84889. // If this is a top-level generic event, return null;
  84890. return null;
  84891. }
  84892. }
  84893. return event.callbacks;
  84894. }
  84895. // Fires delegated events for given map of destinations.
  84896. //
  84897. // @private
  84898. // * @param {Map.<utils.Emitter>} destinations A map containing
  84899. // `[ {@link module:utils/emittermixin~Emitter}, "event name" ]` pair destinations.
  84900. // * @param {utils.EventInfo} eventInfo The original event info object.
  84901. // * @param {Array.<*>} fireArgs Arguments the original event was fired with.
  84902. function fireDelegatedEvents( destinations, eventInfo, fireArgs ) {
  84903. for ( let [ emitter, name ] of destinations ) {
  84904. if ( !name ) {
  84905. name = eventInfo.name;
  84906. } else if ( typeof name == 'function' ) {
  84907. name = name( eventInfo.name );
  84908. }
  84909. const delegatedInfo = new _eventinfo__WEBPACK_IMPORTED_MODULE_0__["default"]( eventInfo.source, name );
  84910. delegatedInfo.path = [ ...eventInfo.path ];
  84911. emitter.fire( delegatedInfo, ...fireArgs );
  84912. }
  84913. }
  84914. // Removes callback from emitter for given event.
  84915. //
  84916. // @param {module:utils/emittermixin~Emitter} emitter
  84917. // @param {String} event
  84918. // @param {Function} callback
  84919. function removeCallback( emitter, event, callback ) {
  84920. const lists = getCallbacksListsForNamespace( emitter, event );
  84921. for ( const callbacks of lists ) {
  84922. for ( let i = 0; i < callbacks.length; i++ ) {
  84923. if ( callbacks[ i ].callback == callback ) {
  84924. // Remove the callback from the list (fixing the next index).
  84925. callbacks.splice( i, 1 );
  84926. i--;
  84927. }
  84928. }
  84929. }
  84930. }
  84931. /**
  84932. * The return value of {@link ~EmitterMixin#delegate}.
  84933. *
  84934. * @interface module:utils/emittermixin~EmitterMixinDelegateChain
  84935. */
  84936. /**
  84937. * Selects destination for {@link module:utils/emittermixin~EmitterMixin#delegate} events.
  84938. *
  84939. * @method #to
  84940. * @param {module:utils/emittermixin~Emitter} emitter An `EmitterMixin` instance which is the destination for delegated events.
  84941. * @param {String|Function} [nameOrFunction] A custom event name or function which converts the original name string.
  84942. */
  84943. /***/ }),
  84944. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/env.js":
  84945. /*!***********************************************************!*\
  84946. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/env.js ***!
  84947. \***********************************************************/
  84948. /*! exports provided: default, isMac, isGecko, isSafari, isAndroid, isBlink, isRegExpUnicodePropertySupported */
  84949. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  84950. "use strict";
  84951. __webpack_require__.r(__webpack_exports__);
  84952. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isMac", function() { return isMac; });
  84953. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isGecko", function() { return isGecko; });
  84954. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSafari", function() { return isSafari; });
  84955. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isAndroid", function() { return isAndroid; });
  84956. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBlink", function() { return isBlink; });
  84957. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isRegExpUnicodePropertySupported", function() { return isRegExpUnicodePropertySupported; });
  84958. /**
  84959. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  84960. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  84961. */
  84962. /* globals navigator:false */
  84963. /**
  84964. * @module utils/env
  84965. */
  84966. const userAgent = navigator.userAgent.toLowerCase();
  84967. /**
  84968. * A namespace containing environment and browser information.
  84969. *
  84970. * @namespace
  84971. */
  84972. const env = {
  84973. /**
  84974. * Indicates that the application is running on Macintosh.
  84975. *
  84976. * @static
  84977. * @type {Boolean}
  84978. */
  84979. isMac: isMac( userAgent ),
  84980. /**
  84981. * Indicates that the application is running in Firefox (Gecko).
  84982. *
  84983. * @static
  84984. * @type {Boolean}
  84985. */
  84986. isGecko: isGecko( userAgent ),
  84987. /**
  84988. * Indicates that the application is running in Safari.
  84989. *
  84990. * @static
  84991. * @type {Boolean}
  84992. */
  84993. isSafari: isSafari( userAgent ),
  84994. /**
  84995. * Indicates that the application is running on Android mobile device.
  84996. *
  84997. * @static
  84998. * @type {Boolean}
  84999. */
  85000. isAndroid: isAndroid( userAgent ),
  85001. /**
  85002. * Indicates that the application is running in a browser using the Blink engine.
  85003. *
  85004. * @static
  85005. * @type {Boolean}
  85006. */
  85007. isBlink: isBlink( userAgent ),
  85008. /**
  85009. * Environment features information.
  85010. *
  85011. * @memberOf module:utils/env~env
  85012. * @namespace
  85013. */
  85014. features: {
  85015. /**
  85016. * Indicates that the environment supports ES2018 Unicode property escapes — like `\p{P}` or `\p{L}`.
  85017. * More information about unicode properties might be found
  85018. * [in Unicode Standard Annex #44](https://www.unicode.org/reports/tr44/#GC_Values_Table).
  85019. *
  85020. * @type {Boolean}
  85021. */
  85022. isRegExpUnicodePropertySupported: isRegExpUnicodePropertySupported()
  85023. }
  85024. };
  85025. /* harmony default export */ __webpack_exports__["default"] = (env);
  85026. /**
  85027. * Checks if User Agent represented by the string is running on Macintosh.
  85028. *
  85029. * @param {String} userAgent **Lowercase** `navigator.userAgent` string.
  85030. * @returns {Boolean} Whether User Agent is running on Macintosh or not.
  85031. */
  85032. function isMac( userAgent ) {
  85033. return userAgent.indexOf( 'macintosh' ) > -1;
  85034. }
  85035. /**
  85036. * Checks if User Agent represented by the string is Firefox (Gecko).
  85037. *
  85038. * @param {String} userAgent **Lowercase** `navigator.userAgent` string.
  85039. * @returns {Boolean} Whether User Agent is Firefox or not.
  85040. */
  85041. function isGecko( userAgent ) {
  85042. return !!userAgent.match( /gecko\/\d+/ );
  85043. }
  85044. /**
  85045. * Checks if User Agent represented by the string is Safari.
  85046. *
  85047. * @param {String} userAgent **Lowercase** `navigator.userAgent` string.
  85048. * @returns {Boolean} Whether User Agent is Safari or not.
  85049. */
  85050. function isSafari( userAgent ) {
  85051. return userAgent.indexOf( ' applewebkit/' ) > -1 && userAgent.indexOf( 'chrome' ) === -1;
  85052. }
  85053. /**
  85054. * Checks if User Agent represented by the string is Android mobile device.
  85055. *
  85056. * @param {String} userAgent **Lowercase** `navigator.userAgent` string.
  85057. * @returns {Boolean} Whether User Agent is Safari or not.
  85058. */
  85059. function isAndroid( userAgent ) {
  85060. return userAgent.indexOf( 'android' ) > -1;
  85061. }
  85062. /**
  85063. * Checks if User Agent represented by the string is Blink engine.
  85064. *
  85065. * @param {String} userAgent **Lowercase** `navigator.userAgent` string.
  85066. * @returns {Boolean} Whether User Agent is Blink engine or not.
  85067. */
  85068. function isBlink( userAgent ) {
  85069. // The Edge browser before switching to the Blink engine used to report itself as Chrome (and "Edge/")
  85070. // but after switching to the Blink it replaced "Edge/" with "Edg/".
  85071. return userAgent.indexOf( 'chrome/' ) > -1 && userAgent.indexOf( 'edge/' ) < 0;
  85072. }
  85073. /**
  85074. * Checks if the current environment supports ES2018 Unicode properties like `\p{P}` or `\p{L}`.
  85075. * More information about unicode properties might be found
  85076. * [in Unicode Standard Annex #44](https://www.unicode.org/reports/tr44/#GC_Values_Table).
  85077. *
  85078. * @returns {Boolean}
  85079. */
  85080. function isRegExpUnicodePropertySupported() {
  85081. let isSupported = false;
  85082. // Feature detection for Unicode properties. Added in ES2018. Currently Firefox does not support it.
  85083. // See https://github.com/ckeditor/ckeditor5-mention/issues/44#issuecomment-487002174.
  85084. try {
  85085. // Usage of regular expression literal cause error during build (ckeditor/ckeditor5-dev#534).
  85086. isSupported = 'ć'.search( new RegExp( '[\\p{L}]', 'u' ) ) === 0;
  85087. } catch ( error ) {
  85088. // Firefox throws a SyntaxError when the group is unsupported.
  85089. }
  85090. return isSupported;
  85091. }
  85092. /***/ }),
  85093. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/eventinfo.js":
  85094. /*!*****************************************************************!*\
  85095. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/eventinfo.js ***!
  85096. \*****************************************************************/
  85097. /*! exports provided: default */
  85098. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  85099. "use strict";
  85100. __webpack_require__.r(__webpack_exports__);
  85101. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return EventInfo; });
  85102. /* harmony import */ var _spy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./spy */ "./node_modules/@ckeditor/ckeditor5-utils/src/spy.js");
  85103. /**
  85104. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  85105. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  85106. */
  85107. /**
  85108. * @module utils/eventinfo
  85109. */
  85110. /**
  85111. * The event object passed to event callbacks. It is used to provide information about the event as well as a tool to
  85112. * manipulate it.
  85113. */
  85114. class EventInfo {
  85115. /**
  85116. * @param {Object} source The emitter.
  85117. * @param {String} name The event name.
  85118. */
  85119. constructor( source, name ) {
  85120. /**
  85121. * The object that fired the event.
  85122. *
  85123. * @readonly
  85124. * @member {Object}
  85125. */
  85126. this.source = source;
  85127. /**
  85128. * The event name.
  85129. *
  85130. * @readonly
  85131. * @member {String}
  85132. */
  85133. this.name = name;
  85134. /**
  85135. * Path this event has followed. See {@link module:utils/emittermixin~EmitterMixin#delegate}.
  85136. *
  85137. * @readonly
  85138. * @member {Array.<Object>}
  85139. */
  85140. this.path = [];
  85141. // The following methods are defined in the constructor because they must be re-created per instance.
  85142. /**
  85143. * Stops the event emitter to call further callbacks for this event interaction.
  85144. *
  85145. * @method #stop
  85146. */
  85147. this.stop = Object(_spy__WEBPACK_IMPORTED_MODULE_0__["default"])();
  85148. /**
  85149. * Removes the current callback from future interactions of this event.
  85150. *
  85151. * @method #off
  85152. */
  85153. this.off = Object(_spy__WEBPACK_IMPORTED_MODULE_0__["default"])();
  85154. /**
  85155. * The value which will be returned by {@link module:utils/emittermixin~EmitterMixin#fire}.
  85156. *
  85157. * It's `undefined` by default and can be changed by an event listener:
  85158. *
  85159. * dataController.fire( 'getSelectedContent', ( evt ) => {
  85160. * // This listener will make `dataController.fire( 'getSelectedContent' )`
  85161. * // always return an empty DocumentFragment.
  85162. * evt.return = new DocumentFragment();
  85163. *
  85164. * // Make sure no other listeners are executed.
  85165. * evt.stop();
  85166. * } );
  85167. *
  85168. * @member #return
  85169. */
  85170. }
  85171. }
  85172. /***/ }),
  85173. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/fastdiff.js":
  85174. /*!****************************************************************!*\
  85175. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/fastdiff.js ***!
  85176. \****************************************************************/
  85177. /*! exports provided: default */
  85178. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  85179. "use strict";
  85180. __webpack_require__.r(__webpack_exports__);
  85181. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return fastDiff; });
  85182. /**
  85183. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  85184. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  85185. */
  85186. /**
  85187. * @module utils/fastdiff
  85188. */
  85189. /**
  85190. * Finds positions of the first and last change in the given string/array and generates a set of changes:
  85191. *
  85192. * fastDiff( '12a', '12xyza' );
  85193. * // [ { index: 2, type: 'insert', values: [ 'x', 'y', 'z' ] } ]
  85194. *
  85195. * fastDiff( '12a', '12aa' );
  85196. * // [ { index: 3, type: 'insert', values: [ 'a' ] } ]
  85197. *
  85198. * fastDiff( '12xyza', '12a' );
  85199. * // [ { index: 2, type: 'delete', howMany: 3 } ]
  85200. *
  85201. * fastDiff( [ '1', '2', 'a', 'a' ], [ '1', '2', 'a' ] );
  85202. * // [ { index: 3, type: 'delete', howMany: 1 } ]
  85203. *
  85204. * fastDiff( [ '1', '2', 'a', 'b', 'c', '3' ], [ '2', 'a', 'b' ] );
  85205. * // [ { index: 0, type: 'insert', values: [ '2', 'a', 'b' ] }, { index: 3, type: 'delete', howMany: 6 } ]
  85206. *
  85207. * Passed arrays can contain any type of data, however to compare them correctly custom comparator function
  85208. * should be passed as a third parameter:
  85209. *
  85210. * fastDiff( [ { value: 1 }, { value: 2 } ], [ { value: 1 }, { value: 3 } ], ( a, b ) => {
  85211. * return a.value === b.value;
  85212. * } );
  85213. * // [ { index: 1, type: 'insert', values: [ { value: 3 } ] }, { index: 2, type: 'delete', howMany: 1 } ]
  85214. *
  85215. * The resulted set of changes can be applied to the input in order to transform it into the output, for example:
  85216. *
  85217. * let input = '12abc3';
  85218. * const output = '2ab';
  85219. * const changes = fastDiff( input, output );
  85220. *
  85221. * changes.forEach( change => {
  85222. * if ( change.type == 'insert' ) {
  85223. * input = input.substring( 0, change.index ) + change.values.join( '' ) + input.substring( change.index );
  85224. * } else if ( change.type == 'delete' ) {
  85225. * input = input.substring( 0, change.index ) + input.substring( change.index + change.howMany );
  85226. * }
  85227. * } );
  85228. *
  85229. * // input equals output now
  85230. *
  85231. * or in case of arrays:
  85232. *
  85233. * let input = [ '1', '2', 'a', 'b', 'c', '3' ];
  85234. * const output = [ '2', 'a', 'b' ];
  85235. * const changes = fastDiff( input, output );
  85236. *
  85237. * changes.forEach( change => {
  85238. * if ( change.type == 'insert' ) {
  85239. * input = input.slice( 0, change.index ).concat( change.values, input.slice( change.index ) );
  85240. * } else if ( change.type == 'delete' ) {
  85241. * input = input.slice( 0, change.index ).concat( input.slice( change.index + change.howMany ) );
  85242. * }
  85243. * } );
  85244. *
  85245. * // input equals output now
  85246. *
  85247. * By passing `true` as the fourth parameter (`atomicChanges`) the output of this function will become compatible with
  85248. * the {@link module:utils/diff~diff `diff()`} function:
  85249. *
  85250. * fastDiff( '12a', '12xyza' );
  85251. * // [ 'equal', 'equal', 'insert', 'insert', 'insert', 'equal' ]
  85252. *
  85253. * The default output format of this function is compatible with the output format of
  85254. * {@link module:utils/difftochanges~diffToChanges `diffToChanges()`}. The `diffToChanges()` input format is, in turn,
  85255. * compatible with the output of {@link module:utils/diff~diff `diff()`}:
  85256. *
  85257. * const a = '1234';
  85258. * const b = '12xyz34';
  85259. *
  85260. * // Both calls will return the same results (grouped changes format).
  85261. * fastDiff( a, b );
  85262. * diffToChanges( diff( a, b ) );
  85263. *
  85264. * // Again, both calls will return the same results (atomic changes format).
  85265. * fastDiff( a, b, null, true );
  85266. * diff( a, b );
  85267. *
  85268. *
  85269. * @param {Array|String} a Input array or string.
  85270. * @param {Array|String} b Input array or string.
  85271. * @param {Function} [cmp] Optional function used to compare array values, by default `===` (strict equal operator) is used.
  85272. * @param {Boolean} [atomicChanges=false] Whether an array of `inset|delete|equal` operations should
  85273. * be returned instead of changes set. This makes this function compatible with {@link module:utils/diff~diff `diff()`}.
  85274. * @returns {Array} Array of changes.
  85275. */
  85276. function fastDiff( a, b, cmp, atomicChanges = false ) {
  85277. // Set the comparator function.
  85278. cmp = cmp || function( a, b ) {
  85279. return a === b;
  85280. };
  85281. // Convert the string (or any array-like object - eg. NodeList) to an array by using the slice() method because,
  85282. // unlike Array.from(), it returns array of UTF-16 code units instead of the code points of a string.
  85283. // One code point might be a surrogate pair of two code units. All text offsets are expected to be in code units.
  85284. // See ckeditor/ckeditor5#3147.
  85285. //
  85286. // We need to make sure here that fastDiff() works identical to diff().
  85287. if ( !Array.isArray( a ) ) {
  85288. a = Array.prototype.slice.call( a );
  85289. }
  85290. if ( !Array.isArray( b ) ) {
  85291. b = Array.prototype.slice.call( b );
  85292. }
  85293. // Find first and last change.
  85294. const changeIndexes = findChangeBoundaryIndexes( a, b, cmp );
  85295. // Transform into changes array.
  85296. return atomicChanges ? changeIndexesToAtomicChanges( changeIndexes, b.length ) : changeIndexesToChanges( b, changeIndexes );
  85297. }
  85298. // Finds position of the first and last change in the given arrays. For example:
  85299. //
  85300. // const indexes = findChangeBoundaryIndexes( [ '1', '2', '3', '4' ], [ '1', '3', '4', '2', '4' ] );
  85301. // console.log( indexes ); // { firstIndex: 1, lastIndexOld: 3, lastIndexNew: 4 }
  85302. //
  85303. // The above indexes means that in the first array the modified part is `1[23]4` and in the second array it is `1[342]4`.
  85304. // Based on such indexes, array with `insert`/`delete` operations which allows transforming first value into the second one
  85305. // can be generated.
  85306. //
  85307. // @param {Array} arr1
  85308. // @param {Array} arr2
  85309. // @param {Function} cmp Comparator function.
  85310. // @returns {Object}
  85311. // @returns {Number} return.firstIndex Index of the first change in both values (always the same for both).
  85312. // @returns {Number} result.lastIndexOld Index of the last common value in `arr1`.
  85313. // @returns {Number} result.lastIndexNew Index of the last common value in `arr2`.
  85314. function findChangeBoundaryIndexes( arr1, arr2, cmp ) {
  85315. // Find the first difference between passed values.
  85316. const firstIndex = findFirstDifferenceIndex( arr1, arr2, cmp );
  85317. // If arrays are equal return -1 indexes object.
  85318. if ( firstIndex === -1 ) {
  85319. return { firstIndex: -1, lastIndexOld: -1, lastIndexNew: -1 };
  85320. }
  85321. // Remove the common part of each value and reverse them to make it simpler to find the last difference between them.
  85322. const oldArrayReversed = cutAndReverse( arr1, firstIndex );
  85323. const newArrayReversed = cutAndReverse( arr2, firstIndex );
  85324. // Find the first difference between reversed values.
  85325. // It should be treated as "how many elements from the end the last difference occurred".
  85326. //
  85327. // For example:
  85328. //
  85329. // initial -> after cut -> reversed:
  85330. // oldValue: '321ba' -> '21ba' -> 'ab12'
  85331. // newValue: '31xba' -> '1xba' -> 'abx1'
  85332. // lastIndex: -> 2
  85333. //
  85334. // So the last change occurred two characters from the end of the arrays.
  85335. const lastIndex = findFirstDifferenceIndex( oldArrayReversed, newArrayReversed, cmp );
  85336. // Use `lastIndex` to calculate proper offset, starting from the beginning (`lastIndex` kind of starts from the end).
  85337. const lastIndexOld = arr1.length - lastIndex;
  85338. const lastIndexNew = arr2.length - lastIndex;
  85339. return { firstIndex, lastIndexOld, lastIndexNew };
  85340. }
  85341. // Returns a first index on which given arrays differ. If both arrays are the same, -1 is returned.
  85342. //
  85343. // @param {Array} arr1
  85344. // @param {Array} arr2
  85345. // @param {Function} cmp Comparator function.
  85346. // @returns {Number}
  85347. function findFirstDifferenceIndex( arr1, arr2, cmp ) {
  85348. for ( let i = 0; i < Math.max( arr1.length, arr2.length ); i++ ) {
  85349. if ( arr1[ i ] === undefined || arr2[ i ] === undefined || !cmp( arr1[ i ], arr2[ i ] ) ) {
  85350. return i;
  85351. }
  85352. }
  85353. return -1; // Return -1 if arrays are equal.
  85354. }
  85355. // Returns a copy of the given array with `howMany` elements removed starting from the beginning and in reversed order.
  85356. //
  85357. // @param {Array} arr Array to be processed.
  85358. // @param {Number} howMany How many elements from array beginning to remove.
  85359. // @returns {Array} Shortened and reversed array.
  85360. function cutAndReverse( arr, howMany ) {
  85361. return arr.slice( howMany ).reverse();
  85362. }
  85363. // Generates changes array based on change indexes from `findChangeBoundaryIndexes` function. This function will
  85364. // generate array with 0 (no changes), 1 (deletion or insertion) or 2 records (insertion and deletion).
  85365. //
  85366. // @param {Array} newArray New array for which change indexes were calculated.
  85367. // @param {Object} changeIndexes Change indexes object from `findChangeBoundaryIndexes` function.
  85368. // @returns {Array.<Object>} Array of changes compatible with {@link module:utils/difftochanges~diffToChanges} format.
  85369. function changeIndexesToChanges( newArray, changeIndexes ) {
  85370. const result = [];
  85371. const { firstIndex, lastIndexOld, lastIndexNew } = changeIndexes;
  85372. // Order operations as 'insert', 'delete' array to keep compatibility with {@link module:utils/difftochanges~diffToChanges}
  85373. // in most cases. However, 'diffToChanges' does not stick to any order so in some cases
  85374. // (for example replacing '12345' with 'abcd') it will generate 'delete', 'insert' order.
  85375. if ( lastIndexNew - firstIndex > 0 ) {
  85376. result.push( {
  85377. index: firstIndex,
  85378. type: 'insert',
  85379. values: newArray.slice( firstIndex, lastIndexNew )
  85380. } );
  85381. }
  85382. if ( lastIndexOld - firstIndex > 0 ) {
  85383. result.push( {
  85384. index: firstIndex + ( lastIndexNew - firstIndex ), // Increase index of what was inserted.
  85385. type: 'delete',
  85386. howMany: lastIndexOld - firstIndex
  85387. } );
  85388. }
  85389. return result;
  85390. }
  85391. // Generates array with set `equal|insert|delete` operations based on change indexes from `findChangeBoundaryIndexes` function.
  85392. //
  85393. // @param {Object} changeIndexes Change indexes object from `findChangeBoundaryIndexes` function.
  85394. // @param {Number} newLength Length of the new array on which `findChangeBoundaryIndexes` calculated change indexes.
  85395. // @returns {Array.<String>} Array of changes compatible with {@link module:utils/diff~diff} format.
  85396. function changeIndexesToAtomicChanges( changeIndexes, newLength ) {
  85397. const { firstIndex, lastIndexOld, lastIndexNew } = changeIndexes;
  85398. // No changes.
  85399. if ( firstIndex === -1 ) {
  85400. return Array( newLength ).fill( 'equal' );
  85401. }
  85402. let result = [];
  85403. if ( firstIndex > 0 ) {
  85404. result = result.concat( Array( firstIndex ).fill( 'equal' ) );
  85405. }
  85406. if ( lastIndexNew - firstIndex > 0 ) {
  85407. result = result.concat( Array( lastIndexNew - firstIndex ).fill( 'insert' ) );
  85408. }
  85409. if ( lastIndexOld - firstIndex > 0 ) {
  85410. result = result.concat( Array( lastIndexOld - firstIndex ).fill( 'delete' ) );
  85411. }
  85412. if ( lastIndexNew < newLength ) {
  85413. result = result.concat( Array( newLength - lastIndexNew ).fill( 'equal' ) );
  85414. }
  85415. return result;
  85416. }
  85417. /***/ }),
  85418. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/first.js":
  85419. /*!*************************************************************!*\
  85420. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/first.js ***!
  85421. \*************************************************************/
  85422. /*! exports provided: default */
  85423. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  85424. "use strict";
  85425. __webpack_require__.r(__webpack_exports__);
  85426. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return first; });
  85427. /**
  85428. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  85429. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  85430. */
  85431. /**
  85432. * @module utils/first
  85433. */
  85434. /**
  85435. * Returns first item of the given `iterable`.
  85436. *
  85437. * @param {Iterable.<*>} iterable
  85438. * @returns {*}
  85439. */
  85440. function first( iterable ) {
  85441. const iteratorItem = iterable.next();
  85442. if ( iteratorItem.done ) {
  85443. return null;
  85444. }
  85445. return iteratorItem.value;
  85446. }
  85447. /***/ }),
  85448. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js":
  85449. /*!********************************************************************!*\
  85450. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js ***!
  85451. \********************************************************************/
  85452. /*! exports provided: default */
  85453. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  85454. "use strict";
  85455. __webpack_require__.r(__webpack_exports__);
  85456. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return FocusTracker; });
  85457. /* harmony import */ var _dom_emittermixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dom/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js");
  85458. /* harmony import */ var _observablemixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  85459. /* harmony import */ var _ckeditorerror__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  85460. /* harmony import */ var _mix__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  85461. /**
  85462. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  85463. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  85464. */
  85465. /* global setTimeout, clearTimeout */
  85466. /**
  85467. * @module utils/focustracker
  85468. */
  85469. /**
  85470. * Allows observing a group of `HTMLElement`s whether at least one of them is focused.
  85471. *
  85472. * Used by the {@link module:core/editor/editor~Editor} in order to track whether the focus is still within the application,
  85473. * or were used outside of its UI.
  85474. *
  85475. * **Note** `focus` and `blur` listeners use event capturing, so it is only needed to register wrapper `HTMLElement`
  85476. * which contain other `focusable` elements. But note that this wrapper element has to be focusable too
  85477. * (have e.g. `tabindex="-1"`).
  85478. *
  85479. * Check out the {@glink framework/guides/deep-dive/ui/focus-tracking "Deep dive into focus tracking" guide} to learn more.
  85480. *
  85481. * @mixes module:utils/dom/emittermixin~EmitterMixin
  85482. * @mixes module:utils/observablemixin~ObservableMixin
  85483. */
  85484. class FocusTracker {
  85485. constructor() {
  85486. /**
  85487. * True when one of the registered elements is focused.
  85488. *
  85489. * @readonly
  85490. * @observable
  85491. * @member {Boolean} #isFocused
  85492. */
  85493. this.set( 'isFocused', false );
  85494. /**
  85495. * The currently focused element.
  85496. *
  85497. * While {@link #isFocused `isFocused`} remains `true`, the focus can
  85498. * move between different UI elements. This property tracks those
  85499. * elements and tells which one is currently focused.
  85500. *
  85501. * @readonly
  85502. * @observable
  85503. * @member {HTMLElement|null} #focusedElement
  85504. */
  85505. this.set( 'focusedElement', null );
  85506. /**
  85507. * List of registered elements.
  85508. *
  85509. * @private
  85510. * @member {Set.<HTMLElement>}
  85511. */
  85512. this._elements = new Set();
  85513. /**
  85514. * Event loop timeout.
  85515. *
  85516. * @private
  85517. * @member {Number}
  85518. */
  85519. this._nextEventLoopTimeout = null;
  85520. }
  85521. /**
  85522. * Starts tracking the specified element.
  85523. *
  85524. * @param {HTMLElement} element
  85525. */
  85526. add( element ) {
  85527. if ( this._elements.has( element ) ) {
  85528. /**
  85529. * This element is already tracked by {@link module:utils/focustracker~FocusTracker}.
  85530. *
  85531. * @error focustracker-add-element-already-exist
  85532. */
  85533. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_2__["default"]( 'focustracker-add-element-already-exist', this );
  85534. }
  85535. this.listenTo( element, 'focus', () => this._focus( element ), { useCapture: true } );
  85536. this.listenTo( element, 'blur', () => this._blur(), { useCapture: true } );
  85537. this._elements.add( element );
  85538. }
  85539. /**
  85540. * Stops tracking the specified element and stops listening on this element.
  85541. *
  85542. * @param {HTMLElement} element
  85543. */
  85544. remove( element ) {
  85545. if ( element === this.focusedElement ) {
  85546. this._blur( element );
  85547. }
  85548. if ( this._elements.has( element ) ) {
  85549. this.stopListening( element );
  85550. this._elements.delete( element );
  85551. }
  85552. }
  85553. /**
  85554. * Destroys the focus tracker by:
  85555. * - Disabling all event listeners attached to tracked elements.
  85556. * - Removing all tracked elements that were previously added.
  85557. */
  85558. destroy() {
  85559. this.stopListening();
  85560. }
  85561. /**
  85562. * Stores currently focused element and set {#isFocused} as `true`.
  85563. *
  85564. * @private
  85565. * @param {HTMLElement} element Element which has been focused.
  85566. */
  85567. _focus( element ) {
  85568. clearTimeout( this._nextEventLoopTimeout );
  85569. this.focusedElement = element;
  85570. this.isFocused = true;
  85571. }
  85572. /**
  85573. * Clears currently focused element and set {@link #isFocused} as `false`.
  85574. * This method uses `setTimeout` to change order of fires `blur` and `focus` events.
  85575. *
  85576. * @private
  85577. * @fires blur
  85578. */
  85579. _blur() {
  85580. clearTimeout( this._nextEventLoopTimeout );
  85581. this._nextEventLoopTimeout = setTimeout( () => {
  85582. this.focusedElement = null;
  85583. this.isFocused = false;
  85584. }, 0 );
  85585. }
  85586. /**
  85587. * @event focus
  85588. */
  85589. /**
  85590. * @event blur
  85591. */
  85592. }
  85593. Object(_mix__WEBPACK_IMPORTED_MODULE_3__["default"])( FocusTracker, _dom_emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
  85594. Object(_mix__WEBPACK_IMPORTED_MODULE_3__["default"])( FocusTracker, _observablemixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  85595. /***/ }),
  85596. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js":
  85597. /*!******************************************************************!*\
  85598. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js ***!
  85599. \******************************************************************/
  85600. /*! exports provided: default */
  85601. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  85602. "use strict";
  85603. __webpack_require__.r(__webpack_exports__);
  85604. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isIterable; });
  85605. /**
  85606. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  85607. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  85608. */
  85609. /**
  85610. * @module utils/isiterable
  85611. */
  85612. /**
  85613. * Checks if value implements iterator interface.
  85614. *
  85615. * @param {*} value The value to check.
  85616. * @returns {Boolean} True if value implements iterator interface.
  85617. */
  85618. function isIterable( value ) {
  85619. return !!( value && value[ Symbol.iterator ] );
  85620. }
  85621. /***/ }),
  85622. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js":
  85623. /*!****************************************************************!*\
  85624. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js ***!
  85625. \****************************************************************/
  85626. /*! exports provided: keyCodes, getCode, parseKeystroke, getEnvKeystrokeText, isArrowKeyCode, getLocalizedArrowKeyCodeDirection, isForwardArrowKeyCode */
  85627. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  85628. "use strict";
  85629. __webpack_require__.r(__webpack_exports__);
  85630. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "keyCodes", function() { return keyCodes; });
  85631. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCode", function() { return getCode; });
  85632. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseKeystroke", function() { return parseKeystroke; });
  85633. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEnvKeystrokeText", function() { return getEnvKeystrokeText; });
  85634. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isArrowKeyCode", function() { return isArrowKeyCode; });
  85635. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocalizedArrowKeyCodeDirection", function() { return getLocalizedArrowKeyCodeDirection; });
  85636. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isForwardArrowKeyCode", function() { return isForwardArrowKeyCode; });
  85637. /* harmony import */ var _ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  85638. /* harmony import */ var _env__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./env */ "./node_modules/@ckeditor/ckeditor5-utils/src/env.js");
  85639. /**
  85640. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  85641. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  85642. */
  85643. /**
  85644. * Set of utils related to keyboard support.
  85645. *
  85646. * @module utils/keyboard
  85647. */
  85648. const macGlyphsToModifiers = {
  85649. '⌘': 'ctrl',
  85650. '⇧': 'shift',
  85651. '⌥': 'alt'
  85652. };
  85653. const modifiersToMacGlyphs = {
  85654. 'ctrl': '⌘',
  85655. 'shift': '⇧',
  85656. 'alt': '⌥'
  85657. };
  85658. /**
  85659. * Object with `keyName => keyCode` pairs for a set of known keys.
  85660. *
  85661. * Contains:
  85662. *
  85663. * * `a-z`,
  85664. * * `0-9`,
  85665. * * `f1-f12`,
  85666. * * `arrow(left|up|right|bottom)`,
  85667. * * `backspace`, `delete`, `enter`, `esc`, `tab`,
  85668. * * `ctrl`, `cmd`, `shift`, `alt`.
  85669. */
  85670. const keyCodes = generateKnownKeyCodes();
  85671. /**
  85672. * Converts a key name or a {@link module:utils/keyboard~KeystrokeInfo keystroke info} into a key code.
  85673. *
  85674. * Note: Key names are matched with {@link module:utils/keyboard~keyCodes} in a case-insensitive way.
  85675. *
  85676. * @param {String|module:utils/keyboard~KeystrokeInfo} Key name (see {@link module:utils/keyboard~keyCodes})
  85677. * or a keystroke data object.
  85678. * @returns {Number} Key or keystroke code.
  85679. */
  85680. function getCode( key ) {
  85681. let keyCode;
  85682. if ( typeof key == 'string' ) {
  85683. keyCode = keyCodes[ key.toLowerCase() ];
  85684. if ( !keyCode ) {
  85685. /**
  85686. * Unknown key name. Only key names contained by the {@link module:utils/keyboard~keyCodes} can be used.
  85687. *
  85688. * @error keyboard-unknown-key
  85689. * @param {String} key
  85690. */
  85691. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'keyboard-unknown-key', null, { key } );
  85692. }
  85693. } else {
  85694. keyCode = key.keyCode +
  85695. ( key.altKey ? keyCodes.alt : 0 ) +
  85696. ( key.ctrlKey ? keyCodes.ctrl : 0 ) +
  85697. ( key.shiftKey ? keyCodes.shift : 0 );
  85698. }
  85699. return keyCode;
  85700. }
  85701. /**
  85702. * Parses keystroke and returns a keystroke code that will match the code returned by
  85703. * link {@link module:utils/keyboard~getCode} for a corresponding {@link module:utils/keyboard~KeystrokeInfo keystroke info}.
  85704. *
  85705. * The keystroke can be passed in two formats:
  85706. *
  85707. * * as a single string – e.g. `ctrl + A`,
  85708. * * as an array of {@link module:utils/keyboard~keyCodes known key names} and key codes – e.g.:
  85709. * * `[ 'ctrl', 32 ]` (ctrl + space),
  85710. * * `[ 'ctrl', 'a' ]` (ctrl + A).
  85711. *
  85712. * Note: Key names are matched with {@link module:utils/keyboard~keyCodes} in a case-insensitive way.
  85713. *
  85714. * Note: Only keystrokes with a single non-modifier key are supported (e.g. `ctrl+A` is OK, but `ctrl+A+B` is not).
  85715. *
  85716. * @param {String|Array.<Number|String>} keystroke Keystroke definition.
  85717. * @returns {Number} Keystroke code.
  85718. */
  85719. function parseKeystroke( keystroke ) {
  85720. if ( typeof keystroke == 'string' ) {
  85721. keystroke = splitKeystrokeText( keystroke );
  85722. }
  85723. return keystroke
  85724. .map( key => ( typeof key == 'string' ) ? getCode( key ) : key )
  85725. .reduce( ( key, sum ) => sum + key, 0 );
  85726. }
  85727. /**
  85728. * It translates any keystroke string text like `"CTRL+A"` to an
  85729. * environment–specific keystroke, i.e. `"⌘A"` on Mac OSX.
  85730. *
  85731. * @param {String} keystroke Keystroke text.
  85732. * @returns {String} Keystroke text specific for the environment.
  85733. */
  85734. function getEnvKeystrokeText( keystroke ) {
  85735. if ( !_env__WEBPACK_IMPORTED_MODULE_1__["default"].isMac ) {
  85736. return keystroke;
  85737. }
  85738. return splitKeystrokeText( keystroke )
  85739. // Replace modifiers (e.g. "ctrl") with Mac glyphs (e.g. "⌘") first.
  85740. .map( key => modifiersToMacGlyphs[ key.toLowerCase() ] || key )
  85741. // Decide whether to put "+" between keys in the keystroke or not.
  85742. .reduce( ( value, key ) => {
  85743. if ( value.slice( -1 ) in macGlyphsToModifiers ) {
  85744. return value + key;
  85745. } else {
  85746. return value + '+' + key;
  85747. }
  85748. } );
  85749. }
  85750. /**
  85751. * Returns `true` if the provided key code represents one of the arrow keys.
  85752. *
  85753. * @param {Number} keyCode A key code as in {@link module:utils/keyboard~KeystrokeInfo#keyCode}.
  85754. * @returns {Boolean}
  85755. */
  85756. function isArrowKeyCode( keyCode ) {
  85757. return keyCode == keyCodes.arrowright ||
  85758. keyCode == keyCodes.arrowleft ||
  85759. keyCode == keyCodes.arrowup ||
  85760. keyCode == keyCodes.arrowdown;
  85761. }
  85762. /**
  85763. * Returns the direction in which the {@link module:engine/model/documentselection~DocumentSelection selection}
  85764. * will move when a provided arrow key code is pressed considering the language direction of the editor content.
  85765. *
  85766. * For instance, in right–to–left (RTL) content languages, pressing the left arrow means moving selection right (forward)
  85767. * in the model structure. Similarly, pressing the right arrow moves the selection left (backward).
  85768. *
  85769. * @param {Number} keyCode A key code as in {@link module:utils/keyboard~KeystrokeInfo#keyCode}.
  85770. * @param {'ltr'|'rtl'} contentLanguageDirection The content language direction, corresponding to
  85771. * {@link module:utils/locale~Locale#contentLanguageDirection}.
  85772. * @returns {'left'|'up'|'right'|'down'} Localized arrow direction.
  85773. */
  85774. function getLocalizedArrowKeyCodeDirection( keyCode, contentLanguageDirection ) {
  85775. const isLtrContent = contentLanguageDirection === 'ltr';
  85776. switch ( keyCode ) {
  85777. case keyCodes.arrowleft:
  85778. return isLtrContent ? 'left' : 'right';
  85779. case keyCodes.arrowright:
  85780. return isLtrContent ? 'right' : 'left';
  85781. case keyCodes.arrowup:
  85782. return 'up';
  85783. case keyCodes.arrowdown:
  85784. return 'down';
  85785. }
  85786. }
  85787. /**
  85788. * Determines if the provided key code moves the {@link module:engine/model/documentselection~DocumentSelection selection}
  85789. * forward or backward considering the language direction of the editor content.
  85790. *
  85791. * For instance, in right–to–left (RTL) languages, pressing the left arrow means moving forward
  85792. * in the model structure. Similarly, pressing the right arrow moves the selection backward.
  85793. *
  85794. * @param {Number} keyCode A key code as in {@link module:utils/keyboard~KeystrokeInfo#keyCode}.
  85795. * @param {'ltr'|'rtl'} contentLanguageDirection The content language direction, corresponding to
  85796. * {@link module:utils/locale~Locale#contentLanguageDirection}.
  85797. * @returns {Boolean}
  85798. */
  85799. function isForwardArrowKeyCode( keyCode, contentLanguageDirection ) {
  85800. const localizedKeyCodeDirection = getLocalizedArrowKeyCodeDirection( keyCode, contentLanguageDirection );
  85801. return localizedKeyCodeDirection === 'down' || localizedKeyCodeDirection === 'right';
  85802. }
  85803. function generateKnownKeyCodes() {
  85804. const keyCodes = {
  85805. arrowleft: 37,
  85806. arrowup: 38,
  85807. arrowright: 39,
  85808. arrowdown: 40,
  85809. backspace: 8,
  85810. delete: 46,
  85811. enter: 13,
  85812. space: 32,
  85813. esc: 27,
  85814. tab: 9,
  85815. // The idea about these numbers is that they do not collide with any real key codes, so we can use them
  85816. // like bit masks.
  85817. ctrl: 0x110000,
  85818. // Has the same code as ctrl, because their behaviour should be unified across the editor.
  85819. // See http://ckeditor.github.io/editor-recommendations/general-policies#ctrl-vs-cmd
  85820. cmd: 0x110000,
  85821. shift: 0x220000,
  85822. alt: 0x440000
  85823. };
  85824. // a-z
  85825. for ( let code = 65; code <= 90; code++ ) {
  85826. const letter = String.fromCharCode( code );
  85827. keyCodes[ letter.toLowerCase() ] = code;
  85828. }
  85829. // 0-9
  85830. for ( let code = 48; code <= 57; code++ ) {
  85831. keyCodes[ code - 48 ] = code;
  85832. }
  85833. // F1-F12
  85834. for ( let code = 112; code <= 123; code++ ) {
  85835. keyCodes[ 'f' + ( code - 111 ) ] = code;
  85836. }
  85837. return keyCodes;
  85838. }
  85839. function splitKeystrokeText( keystroke ) {
  85840. return keystroke.split( /\s*\+\s*/ );
  85841. }
  85842. /**
  85843. * Information about a keystroke.
  85844. *
  85845. * @interface module:utils/keyboard~KeystrokeInfo
  85846. */
  85847. /**
  85848. * The [key code](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode).
  85849. *
  85850. * @member {Number} module:utils/keyboard~KeystrokeInfo#keyCode
  85851. */
  85852. /**
  85853. * Whether the <kbd>Alt</kbd> modifier was pressed.
  85854. *
  85855. * @member {Bolean} module:utils/keyboard~KeystrokeInfo#altKey
  85856. */
  85857. /**
  85858. * Whether the <kbd>Ctrl</kbd> or <kbd>Cmd</kbd> modifier was pressed.
  85859. *
  85860. * @member {Bolean} module:utils/keyboard~KeystrokeInfo#ctrlKey
  85861. */
  85862. /**
  85863. * Whether the <kbd>Shift</kbd> modifier was pressed.
  85864. *
  85865. * @member {Bolean} module:utils/keyboard~KeystrokeInfo#shiftKey
  85866. */
  85867. /***/ }),
  85868. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js":
  85869. /*!************************************************************************!*\
  85870. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js ***!
  85871. \************************************************************************/
  85872. /*! exports provided: default */
  85873. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  85874. "use strict";
  85875. __webpack_require__.r(__webpack_exports__);
  85876. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return KeystrokeHandler; });
  85877. /* harmony import */ var _dom_emittermixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dom/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js");
  85878. /* harmony import */ var _keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
  85879. /**
  85880. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  85881. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  85882. */
  85883. /**
  85884. * @module utils/keystrokehandler
  85885. */
  85886. /**
  85887. * Keystroke handler allows registering callbacks for given keystrokes.
  85888. *
  85889. * The most frequent use of this class is through the {@link module:core/editor/editor~Editor#keystrokes `editor.keystrokes`}
  85890. * property. It allows listening to keystrokes executed in the editing view:
  85891. *
  85892. * editor.keystrokes.set( 'Ctrl+A', ( keyEvtData, cancel ) => {
  85893. * console.log( 'Ctrl+A has been pressed' );
  85894. * cancel();
  85895. * } );
  85896. *
  85897. * However, this utility class can be used in various part of the UI. For instance, a certain {@link module:ui/view~View}
  85898. * can use it like this:
  85899. *
  85900. * class MyView extends View {
  85901. * constructor() {
  85902. * this.keystrokes = new KeystrokeHandler();
  85903. *
  85904. * this.keystrokes.set( 'tab', handleTabKey );
  85905. * }
  85906. *
  85907. * render() {
  85908. * super.render();
  85909. *
  85910. * this.keystrokes.listenTo( this.element );
  85911. * }
  85912. * }
  85913. *
  85914. * That keystroke handler will listen to `keydown` events fired in this view's main element.
  85915. *
  85916. */
  85917. class KeystrokeHandler {
  85918. /**
  85919. * Creates an instance of the keystroke handler.
  85920. */
  85921. constructor() {
  85922. /**
  85923. * Listener used to listen to events for easier keystroke handler destruction.
  85924. *
  85925. * @protected
  85926. * @member {module:utils/dom/emittermixin~Emitter}
  85927. */
  85928. this._listener = Object.create( _dom_emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
  85929. }
  85930. /**
  85931. * Starts listening for `keydown` events from a given emitter.
  85932. *
  85933. * @param {module:utils/emittermixin~Emitter} emitter
  85934. */
  85935. listenTo( emitter ) {
  85936. // The #_listener works here as a kind of dispatcher. It groups the events coming from the same
  85937. // keystroke so the listeners can be attached to them with different priorities.
  85938. //
  85939. // E.g. all the keystrokes with the `keyCode` of 42 coming from the `emitter` are propagated
  85940. // as a `_keydown:42` event by the `_listener`. If there's a callback created by the `set`
  85941. // method for this 42 keystroke, it listens to the `_listener#_keydown:42` event only and interacts
  85942. // only with other listeners of this particular event, thus making it possible to prioritize
  85943. // the listeners and safely cancel execution, when needed. Instead of duplicating the Emitter logic,
  85944. // the KeystrokeHandler re–uses it to do its job.
  85945. this._listener.listenTo( emitter, 'keydown', ( evt, keyEvtData ) => {
  85946. this._listener.fire( '_keydown:' + Object(_keyboard__WEBPACK_IMPORTED_MODULE_1__["getCode"])( keyEvtData ), keyEvtData );
  85947. } );
  85948. }
  85949. /**
  85950. * Registers a handler for the specified keystroke.
  85951. *
  85952. * @param {String|Array.<String|Number>} keystroke Keystroke defined in a format accepted by
  85953. * the {@link module:utils/keyboard~parseKeystroke} function.
  85954. * @param {Function} callback A function called with the
  85955. * {@link module:engine/view/observer/keyobserver~KeyEventData key event data} object and
  85956. * a helper funcion to call both `preventDefault()` and `stopPropagation()` on the underlying event.
  85957. * @param {Object} [options={}] Additional options.
  85958. * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of the keystroke
  85959. * callback. The higher the priority value the sooner the callback will be executed. Keystrokes having the same priority
  85960. * are called in the order they were added.
  85961. */
  85962. set( keystroke, callback, options = {} ) {
  85963. const keyCode = Object(_keyboard__WEBPACK_IMPORTED_MODULE_1__["parseKeystroke"])( keystroke );
  85964. const priority = options.priority;
  85965. // Execute the passed callback on KeystrokeHandler#_keydown.
  85966. // TODO: https://github.com/ckeditor/ckeditor5-utils/issues/144
  85967. this._listener.listenTo( this._listener, '_keydown:' + keyCode, ( evt, keyEvtData ) => {
  85968. callback( keyEvtData, () => {
  85969. // Stop the event in the DOM: no listener in the web page
  85970. // will be triggered by this event.
  85971. keyEvtData.preventDefault();
  85972. keyEvtData.stopPropagation();
  85973. // Stop the event in the KeystrokeHandler: no more callbacks
  85974. // will be executed for this keystroke.
  85975. evt.stop();
  85976. } );
  85977. // Mark this keystroke as handled by the callback. See: #press.
  85978. evt.return = true;
  85979. }, { priority } );
  85980. }
  85981. /**
  85982. * Triggers a keystroke handler for a specified key combination, if such a keystroke was {@link #set defined}.
  85983. *
  85984. * @param {module:engine/view/observer/keyobserver~KeyEventData} keyEvtData Key event data.
  85985. * @returns {Boolean} Whether the keystroke was handled.
  85986. */
  85987. press( keyEvtData ) {
  85988. return !!this._listener.fire( '_keydown:' + Object(_keyboard__WEBPACK_IMPORTED_MODULE_1__["getCode"])( keyEvtData ), keyEvtData );
  85989. }
  85990. /**
  85991. * Destroys the keystroke handler.
  85992. */
  85993. destroy() {
  85994. this._listener.stopListening();
  85995. }
  85996. }
  85997. /***/ }),
  85998. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/locale.js":
  85999. /*!**************************************************************!*\
  86000. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/locale.js ***!
  86001. \**************************************************************/
  86002. /*! exports provided: default */
  86003. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  86004. "use strict";
  86005. __webpack_require__.r(__webpack_exports__);
  86006. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Locale; });
  86007. /* harmony import */ var _translation_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./translation-service */ "./node_modules/@ckeditor/ckeditor5-utils/src/translation-service.js");
  86008. /**
  86009. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  86010. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  86011. */
  86012. /**
  86013. * @module utils/locale
  86014. */
  86015. /* globals console */
  86016. const RTL_LANGUAGE_CODES = [ 'ar', 'fa', 'he', 'ku', 'ug' ];
  86017. /**
  86018. * Represents the localization services.
  86019. */
  86020. class Locale {
  86021. /**
  86022. * Creates a new instance of the locale class. Learn more about
  86023. * {@glink features/ui-language configuring the language of the editor}.
  86024. *
  86025. * @param {Object} [options] Locale configuration.
  86026. * @param {String} [options.uiLanguage='en'] The editor UI language code in the
  86027. * [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format. See {@link #uiLanguage}.
  86028. * @param {String} [options.contentLanguage] The editor content language code in the
  86029. * [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format. If not specified, the same as `options.language`.
  86030. * See {@link #contentLanguage}.
  86031. */
  86032. constructor( options = {} ) {
  86033. /**
  86034. * The editor UI language code in the [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format.
  86035. *
  86036. * If the {@link #contentLanguage content language} was not specified in the `Locale` constructor,
  86037. * it also defines the language of the content.
  86038. *
  86039. * @readonly
  86040. * @member {String}
  86041. */
  86042. this.uiLanguage = options.uiLanguage || 'en';
  86043. /**
  86044. * The editor content language code in the [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format.
  86045. *
  86046. * Usually the same as the {@link #uiLanguage editor language}, it can be customized by passing an optional
  86047. * argument to the `Locale` constructor.
  86048. *
  86049. * @readonly
  86050. * @member {String}
  86051. */
  86052. this.contentLanguage = options.contentLanguage || this.uiLanguage;
  86053. /**
  86054. * Text direction of the {@link #uiLanguage editor UI language}. Either `'ltr'` or `'rtl'`.
  86055. *
  86056. * @readonly
  86057. * @member {String}
  86058. */
  86059. this.uiLanguageDirection = getLanguageDirection( this.uiLanguage );
  86060. /**
  86061. * Text direction of the {@link #contentLanguage editor content language}.
  86062. *
  86063. * If the content language was passed directly to the `Locale` constructor, this property represents the
  86064. * direction of that language.
  86065. *
  86066. * If the {@link #contentLanguage editor content language} was derived from the {@link #uiLanguage editor language},
  86067. * the content language direction is the same as the {@link #uiLanguageDirection UI language direction}.
  86068. *
  86069. * The value is either `'ltr'` or `'rtl'`.
  86070. *
  86071. * @readonly
  86072. * @member {String}
  86073. */
  86074. this.contentLanguageDirection = getLanguageDirection( this.contentLanguage );
  86075. /**
  86076. * Translates the given message to the {@link #uiLanguage}. This method is also available in
  86077. * {@link module:core/editor/editor~Editor#t `Editor`} and {@link module:ui/view~View#t `View`}.
  86078. *
  86079. * This method's context is statically bound to the `Locale` instance and **should always be called as a function**:
  86080. *
  86081. * const t = locale.t;
  86082. * t( 'Label' );
  86083. *
  86084. * The message can be either a string or an object implementing the {@link module:utils/translation-service~Message} interface.
  86085. *
  86086. * The message may contain placeholders (`%<index>`) for value(s) that are passed as a `values` parameter.
  86087. * For an array of values, the `%<index>` will be changed to an element of that array at the given index.
  86088. * For a single value passed as the second argument, only the `%0` placeholders will be changed to the provided value.
  86089. *
  86090. * t( 'Created file "%0" in %1ms.', [ fileName, timeTaken ] );
  86091. * t( 'Created file "%0", fileName );
  86092. *
  86093. * The message supports plural forms. To specify the plural form, use the `plural` property. Singular or plural form
  86094. * will be chosen depending on the first value from the passed `values`. The value of the `plural` property is used
  86095. * as a default plural translation when the translation for the target language is missing.
  86096. *
  86097. * t( { string: 'Add a space', plural: 'Add %0 spaces' }, 1 ); // 'Add a space' for the English language.
  86098. * t( { string: 'Add a space', plural: 'Add %0 spaces' }, 5 ); // 'Add 5 spaces' for the English language.
  86099. * t( { string: '%1 a space', plural: '%1 %0 spaces' }, [ 2, 'Add' ] ); // 'Add 2 spaces' for the English language.
  86100. *
  86101. * t( { string: 'Add a space', plural: 'Add %0 spaces' }, 1 ); // 'Dodaj spację' for the Polish language.
  86102. * t( { string: 'Add a space', plural: 'Add %0 spaces' }, 5 ); // 'Dodaj 5 spacji' for the Polish language.
  86103. * t( { string: '%1 a space', plural: '%1 %0 spaces' }, [ 2, 'Add' ] ); // 'Dodaj 2 spacje' for the Polish language.
  86104. *
  86105. * * The message should provide an ID using the `id` property when the message strings are not unique and their
  86106. * translations should be different.
  86107. *
  86108. * translate( 'en', { string: 'image', id: 'ADD_IMAGE' } );
  86109. * translate( 'en', { string: 'image', id: 'AN_IMAGE' } );
  86110. *
  86111. * @method #t
  86112. * @param {String|module:utils/translation-service~Message} message A message that will be localized (translated).
  86113. * @param {String|Number|Array.<String|Number>} [values] A value or an array of values that will fill message placeholders.
  86114. * For messages supporting plural forms the first value will determine the plural form.
  86115. * @returns {String}
  86116. */
  86117. this.t = ( message, values ) => this._t( message, values );
  86118. }
  86119. /**
  86120. * The editor UI language code in the [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format.
  86121. *
  86122. * **Note**: This property was deprecated. Please use {@link #uiLanguage} and {@link #contentLanguage}
  86123. * properties instead.
  86124. *
  86125. * @deprecated
  86126. * @member {String}
  86127. */
  86128. get language() {
  86129. /**
  86130. * The {@link module:utils/locale~Locale#language `Locale#language`} property was deprecated and will
  86131. * be removed in the near future. Please use the {@link #uiLanguage} and {@link #contentLanguage} properties instead.
  86132. *
  86133. * @error locale-deprecated-language-property
  86134. */
  86135. console.warn(
  86136. 'locale-deprecated-language-property: ' +
  86137. 'The Locale#language property has been deprecated and will be removed in the near future. ' +
  86138. 'Please use #uiLanguage and #contentLanguage properties instead.' );
  86139. return this.uiLanguage;
  86140. }
  86141. /**
  86142. * An unbound version of the {@link #t} method.
  86143. *
  86144. * @private
  86145. * @param {String|module:utils/translation-service~Message} message
  86146. * @param {Number|String|Array.<Number|String>} [values]
  86147. * @returns {String}
  86148. */
  86149. _t( message, values = [] ) {
  86150. if ( !Array.isArray( values ) ) {
  86151. values = [ values ];
  86152. }
  86153. if ( typeof message === 'string' ) {
  86154. message = { string: message };
  86155. }
  86156. const hasPluralForm = !!message.plural;
  86157. const quantity = hasPluralForm ? values[ 0 ] : 1;
  86158. const translatedString = Object(_translation_service__WEBPACK_IMPORTED_MODULE_0__["_translate"])( this.uiLanguage, message, quantity );
  86159. return interpolateString( translatedString, values );
  86160. }
  86161. }
  86162. // Fills the `%0, %1, ...` string placeholders with values.
  86163. function interpolateString( string, values ) {
  86164. return string.replace( /%(\d+)/g, ( match, index ) => {
  86165. return ( index < values.length ) ? values[ index ] : match;
  86166. } );
  86167. }
  86168. // Helps determine whether a language is LTR or RTL.
  86169. //
  86170. // @param {String} language The ISO 639-1 language code.
  86171. // @returns {String} 'ltr' or 'rtl
  86172. function getLanguageDirection( languageCode ) {
  86173. return RTL_LANGUAGE_CODES.includes( languageCode ) ? 'rtl' : 'ltr';
  86174. }
  86175. /***/ }),
  86176. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js":
  86177. /*!***********************************************************!*\
  86178. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/mix.js ***!
  86179. \***********************************************************/
  86180. /*! exports provided: default */
  86181. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  86182. "use strict";
  86183. __webpack_require__.r(__webpack_exports__);
  86184. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return mix; });
  86185. /**
  86186. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  86187. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  86188. */
  86189. /**
  86190. * @module utils/mix
  86191. */
  86192. /**
  86193. * Copies enumerable properties and symbols from the objects given as 2nd+ parameters to the
  86194. * prototype of first object (a constructor).
  86195. *
  86196. * class Editor {
  86197. * ...
  86198. * }
  86199. *
  86200. * const SomeMixin = {
  86201. * a() {
  86202. * return 'a';
  86203. * }
  86204. * };
  86205. *
  86206. * mix( Editor, SomeMixin, ... );
  86207. *
  86208. * new Editor().a(); // -> 'a'
  86209. *
  86210. * Note: Properties which already exist in the base class will not be overriden.
  86211. *
  86212. * @param {Function} [baseClass] Class which prototype will be extended.
  86213. * @param {Object} [...mixins] Objects from which to get properties.
  86214. */
  86215. function mix( baseClass, ...mixins ) {
  86216. mixins.forEach( mixin => {
  86217. Object.getOwnPropertyNames( mixin ).concat( Object.getOwnPropertySymbols( mixin ) )
  86218. .forEach( key => {
  86219. if ( key in baseClass.prototype ) {
  86220. return;
  86221. }
  86222. const sourceDescriptor = Object.getOwnPropertyDescriptor( mixin, key );
  86223. sourceDescriptor.enumerable = false;
  86224. Object.defineProperty( baseClass.prototype, key, sourceDescriptor );
  86225. } );
  86226. } );
  86227. }
  86228. /***/ }),
  86229. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/objecttomap.js":
  86230. /*!*******************************************************************!*\
  86231. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/objecttomap.js ***!
  86232. \*******************************************************************/
  86233. /*! exports provided: default */
  86234. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  86235. "use strict";
  86236. __webpack_require__.r(__webpack_exports__);
  86237. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return objectToMap; });
  86238. /**
  86239. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  86240. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  86241. */
  86242. /**
  86243. * @module utils/objecttomap
  86244. */
  86245. /**
  86246. * Transforms object to map.
  86247. *
  86248. * const map = objectToMap( { 'foo': 1, 'bar': 2 } );
  86249. * map.get( 'foo' ); // 1
  86250. *
  86251. * **Note**: For mixed data (`Object` or `Iterable`) there's a dedicated {@link module:utils/tomap~toMap} function.
  86252. *
  86253. * @param {Object} obj Object to transform.
  86254. * @returns {Map} Map created from object.
  86255. */
  86256. function objectToMap( obj ) {
  86257. const map = new Map();
  86258. for ( const key in obj ) {
  86259. map.set( key, obj[ key ] );
  86260. }
  86261. return map;
  86262. }
  86263. /***/ }),
  86264. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js":
  86265. /*!***********************************************************************!*\
  86266. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js ***!
  86267. \***********************************************************************/
  86268. /*! exports provided: default */
  86269. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  86270. "use strict";
  86271. __webpack_require__.r(__webpack_exports__);
  86272. /* harmony import */ var _emittermixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  86273. /* harmony import */ var _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  86274. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  86275. /**
  86276. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  86277. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  86278. */
  86279. /**
  86280. * @module utils/observablemixin
  86281. */
  86282. const observablePropertiesSymbol = Symbol( 'observableProperties' );
  86283. const boundObservablesSymbol = Symbol( 'boundObservables' );
  86284. const boundPropertiesSymbol = Symbol( 'boundProperties' );
  86285. /**
  86286. * A mixin that injects the "observable properties" and data binding functionality described in the
  86287. * {@link ~Observable} interface.
  86288. *
  86289. * Read more about the concept of observables in the:
  86290. * * {@glink framework/guides/architecture/core-editor-architecture#event-system-and-observables "Event system and observables"}
  86291. * section of the {@glink framework/guides/architecture/core-editor-architecture "Core editor architecture"} guide,
  86292. * * {@glink framework/guides/deep-dive/observables "Observables" deep dive} guide.
  86293. *
  86294. * @mixin ObservableMixin
  86295. * @mixes module:utils/emittermixin~EmitterMixin
  86296. * @implements module:utils/observablemixin~Observable
  86297. */
  86298. const ObservableMixin = {
  86299. /**
  86300. * @inheritDoc
  86301. */
  86302. set( name, value ) {
  86303. // If the first parameter is an Object, iterate over its properties.
  86304. if ( Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["isObject"])( name ) ) {
  86305. Object.keys( name ).forEach( property => {
  86306. this.set( property, name[ property ] );
  86307. }, this );
  86308. return;
  86309. }
  86310. initObservable( this );
  86311. const properties = this[ observablePropertiesSymbol ];
  86312. if ( ( name in this ) && !properties.has( name ) ) {
  86313. /**
  86314. * Cannot override an existing property.
  86315. *
  86316. * This error is thrown when trying to {@link ~Observable#set set} a property with
  86317. * a name of an already existing property. For example:
  86318. *
  86319. * let observable = new Model();
  86320. * observable.property = 1;
  86321. * observable.set( 'property', 2 ); // throws
  86322. *
  86323. * observable.set( 'property', 1 );
  86324. * observable.set( 'property', 2 ); // ok, because this is an existing property.
  86325. *
  86326. * @error observable-set-cannot-override
  86327. */
  86328. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-set-cannot-override', this );
  86329. }
  86330. Object.defineProperty( this, name, {
  86331. enumerable: true,
  86332. configurable: true,
  86333. get() {
  86334. return properties.get( name );
  86335. },
  86336. set( value ) {
  86337. const oldValue = properties.get( name );
  86338. // Fire `set` event before the new value will be set to make it possible
  86339. // to override observable property without affecting `change` event.
  86340. // See https://github.com/ckeditor/ckeditor5-utils/issues/171.
  86341. let newValue = this.fire( 'set:' + name, name, value, oldValue );
  86342. if ( newValue === undefined ) {
  86343. newValue = value;
  86344. }
  86345. // Allow undefined as an initial value like A.define( 'x', undefined ) (#132).
  86346. // Note: When properties map has no such own property, then its value is undefined.
  86347. if ( oldValue !== newValue || !properties.has( name ) ) {
  86348. properties.set( name, newValue );
  86349. this.fire( 'change:' + name, name, newValue, oldValue );
  86350. }
  86351. }
  86352. } );
  86353. this[ name ] = value;
  86354. },
  86355. /**
  86356. * @inheritDoc
  86357. */
  86358. bind( ...bindProperties ) {
  86359. if ( !bindProperties.length || !isStringArray( bindProperties ) ) {
  86360. /**
  86361. * All properties must be strings.
  86362. *
  86363. * @error observable-bind-wrong-properties
  86364. */
  86365. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-bind-wrong-properties', this );
  86366. }
  86367. if ( ( new Set( bindProperties ) ).size !== bindProperties.length ) {
  86368. /**
  86369. * Properties must be unique.
  86370. *
  86371. * @error observable-bind-duplicate-properties
  86372. */
  86373. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-bind-duplicate-properties', this );
  86374. }
  86375. initObservable( this );
  86376. const boundProperties = this[ boundPropertiesSymbol ];
  86377. bindProperties.forEach( propertyName => {
  86378. if ( boundProperties.has( propertyName ) ) {
  86379. /**
  86380. * Cannot bind the same property more than once.
  86381. *
  86382. * @error observable-bind-rebind
  86383. */
  86384. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-bind-rebind', this );
  86385. }
  86386. } );
  86387. const bindings = new Map();
  86388. // @typedef {Object} Binding
  86389. // @property {Array} property Property which is bound.
  86390. // @property {Array} to Array of observable–property components of the binding (`{ observable: ..., property: .. }`).
  86391. // @property {Array} callback A function which processes `to` components.
  86392. bindProperties.forEach( a => {
  86393. const binding = { property: a, to: [] };
  86394. boundProperties.set( a, binding );
  86395. bindings.set( a, binding );
  86396. } );
  86397. // @typedef {Object} BindChain
  86398. // @property {Function} to See {@link ~ObservableMixin#_bindTo}.
  86399. // @property {Function} toMany See {@link ~ObservableMixin#_bindToMany}.
  86400. // @property {module:utils/observablemixin~Observable} _observable The observable which initializes the binding.
  86401. // @property {Array} _bindProperties Array of `_observable` properties to be bound.
  86402. // @property {Array} _to Array of `to()` observable–properties (`{ observable: toObservable, properties: ...toProperties }`).
  86403. // @property {Map} _bindings Stores bindings to be kept in
  86404. // {@link ~ObservableMixin#_boundProperties}/{@link ~ObservableMixin#_boundObservables}
  86405. // initiated in this binding chain.
  86406. return {
  86407. to: bindTo,
  86408. toMany: bindToMany,
  86409. _observable: this,
  86410. _bindProperties: bindProperties,
  86411. _to: [],
  86412. _bindings: bindings
  86413. };
  86414. },
  86415. /**
  86416. * @inheritDoc
  86417. */
  86418. unbind( ...unbindProperties ) {
  86419. // Nothing to do here if not inited yet.
  86420. if ( !( this[ observablePropertiesSymbol ] ) ) {
  86421. return;
  86422. }
  86423. const boundProperties = this[ boundPropertiesSymbol ];
  86424. const boundObservables = this[ boundObservablesSymbol ];
  86425. if ( unbindProperties.length ) {
  86426. if ( !isStringArray( unbindProperties ) ) {
  86427. /**
  86428. * Properties must be strings.
  86429. *
  86430. * @error observable-unbind-wrong-properties
  86431. */
  86432. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-unbind-wrong-properties', this );
  86433. }
  86434. unbindProperties.forEach( propertyName => {
  86435. const binding = boundProperties.get( propertyName );
  86436. // Nothing to do if the binding is not defined
  86437. if ( !binding ) {
  86438. return;
  86439. }
  86440. let toObservable, toProperty, toProperties, toPropertyBindings;
  86441. binding.to.forEach( to => {
  86442. // TODO: ES6 destructuring.
  86443. toObservable = to[ 0 ];
  86444. toProperty = to[ 1 ];
  86445. toProperties = boundObservables.get( toObservable );
  86446. toPropertyBindings = toProperties[ toProperty ];
  86447. toPropertyBindings.delete( binding );
  86448. if ( !toPropertyBindings.size ) {
  86449. delete toProperties[ toProperty ];
  86450. }
  86451. if ( !Object.keys( toProperties ).length ) {
  86452. boundObservables.delete( toObservable );
  86453. this.stopListening( toObservable, 'change' );
  86454. }
  86455. } );
  86456. boundProperties.delete( propertyName );
  86457. } );
  86458. } else {
  86459. boundObservables.forEach( ( bindings, boundObservable ) => {
  86460. this.stopListening( boundObservable, 'change' );
  86461. } );
  86462. boundObservables.clear();
  86463. boundProperties.clear();
  86464. }
  86465. },
  86466. /**
  86467. * @inheritDoc
  86468. */
  86469. decorate( methodName ) {
  86470. const originalMethod = this[ methodName ];
  86471. if ( !originalMethod ) {
  86472. /**
  86473. * Cannot decorate an undefined method.
  86474. *
  86475. * @error observablemixin-cannot-decorate-undefined
  86476. * @param {Object} object The object which method should be decorated.
  86477. * @param {String} methodName Name of the method which does not exist.
  86478. */
  86479. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
  86480. 'observablemixin-cannot-decorate-undefined',
  86481. this,
  86482. { object: this, methodName }
  86483. );
  86484. }
  86485. this.on( methodName, ( evt, args ) => {
  86486. evt.return = originalMethod.apply( this, args );
  86487. } );
  86488. this[ methodName ] = function( ...args ) {
  86489. return this.fire( methodName, args );
  86490. };
  86491. }
  86492. };
  86493. Object(lodash_es__WEBPACK_IMPORTED_MODULE_2__["extend"])( ObservableMixin, _emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
  86494. /* harmony default export */ __webpack_exports__["default"] = (ObservableMixin);
  86495. // Init symbol properties needed for the observable mechanism to work.
  86496. //
  86497. // @private
  86498. // @param {module:utils/observablemixin~ObservableMixin} observable
  86499. function initObservable( observable ) {
  86500. // Do nothing if already inited.
  86501. if ( observable[ observablePropertiesSymbol ] ) {
  86502. return;
  86503. }
  86504. // The internal hash containing the observable's state.
  86505. //
  86506. // @private
  86507. // @type {Map}
  86508. Object.defineProperty( observable, observablePropertiesSymbol, {
  86509. value: new Map()
  86510. } );
  86511. // Map containing bindings to external observables. It shares the binding objects
  86512. // (`{ observable: A, property: 'a', to: ... }`) with {@link module:utils/observablemixin~ObservableMixin#_boundProperties} and
  86513. // it is used to observe external observables to update own properties accordingly.
  86514. // See {@link module:utils/observablemixin~ObservableMixin#bind}.
  86515. //
  86516. // A.bind( 'a', 'b', 'c' ).to( B, 'x', 'y', 'x' );
  86517. // console.log( A._boundObservables );
  86518. //
  86519. // Map( {
  86520. // B: {
  86521. // x: Set( [
  86522. // { observable: A, property: 'a', to: [ [ B, 'x' ] ] },
  86523. // { observable: A, property: 'c', to: [ [ B, 'x' ] ] }
  86524. // ] ),
  86525. // y: Set( [
  86526. // { observable: A, property: 'b', to: [ [ B, 'y' ] ] },
  86527. // ] )
  86528. // }
  86529. // } )
  86530. //
  86531. // A.bind( 'd' ).to( B, 'z' ).to( C, 'w' ).as( callback );
  86532. // console.log( A._boundObservables );
  86533. //
  86534. // Map( {
  86535. // B: {
  86536. // x: Set( [
  86537. // { observable: A, property: 'a', to: [ [ B, 'x' ] ] },
  86538. // { observable: A, property: 'c', to: [ [ B, 'x' ] ] }
  86539. // ] ),
  86540. // y: Set( [
  86541. // { observable: A, property: 'b', to: [ [ B, 'y' ] ] },
  86542. // ] ),
  86543. // z: Set( [
  86544. // { observable: A, property: 'd', to: [ [ B, 'z' ], [ C, 'w' ] ], callback: callback }
  86545. // ] )
  86546. // },
  86547. // C: {
  86548. // w: Set( [
  86549. // { observable: A, property: 'd', to: [ [ B, 'z' ], [ C, 'w' ] ], callback: callback }
  86550. // ] )
  86551. // }
  86552. // } )
  86553. //
  86554. // @private
  86555. // @type {Map}
  86556. Object.defineProperty( observable, boundObservablesSymbol, {
  86557. value: new Map()
  86558. } );
  86559. // Object that stores which properties of this observable are bound and how. It shares
  86560. // the binding objects (`{ observable: A, property: 'a', to: ... }`) with
  86561. // {@link module:utils/observablemixin~ObservableMixin#_boundObservables}. This data structure is
  86562. // a reverse of {@link module:utils/observablemixin~ObservableMixin#_boundObservables} and it is helpful for
  86563. // {@link module:utils/observablemixin~ObservableMixin#unbind}.
  86564. //
  86565. // See {@link module:utils/observablemixin~ObservableMixin#bind}.
  86566. //
  86567. // A.bind( 'a', 'b', 'c' ).to( B, 'x', 'y', 'x' );
  86568. // console.log( A._boundProperties );
  86569. //
  86570. // Map( {
  86571. // a: { observable: A, property: 'a', to: [ [ B, 'x' ] ] },
  86572. // b: { observable: A, property: 'b', to: [ [ B, 'y' ] ] },
  86573. // c: { observable: A, property: 'c', to: [ [ B, 'x' ] ] }
  86574. // } )
  86575. //
  86576. // A.bind( 'd' ).to( B, 'z' ).to( C, 'w' ).as( callback );
  86577. // console.log( A._boundProperties );
  86578. //
  86579. // Map( {
  86580. // a: { observable: A, property: 'a', to: [ [ B, 'x' ] ] },
  86581. // b: { observable: A, property: 'b', to: [ [ B, 'y' ] ] },
  86582. // c: { observable: A, property: 'c', to: [ [ B, 'x' ] ] },
  86583. // d: { observable: A, property: 'd', to: [ [ B, 'z' ], [ C, 'w' ] ], callback: callback }
  86584. // } )
  86585. //
  86586. // @private
  86587. // @type {Map}
  86588. Object.defineProperty( observable, boundPropertiesSymbol, {
  86589. value: new Map()
  86590. } );
  86591. }
  86592. // A chaining for {@link module:utils/observablemixin~ObservableMixin#bind} providing `.to()` interface.
  86593. //
  86594. // @private
  86595. // @param {...[Observable|String|Function]} args Arguments of the `.to( args )` binding.
  86596. function bindTo( ...args ) {
  86597. const parsedArgs = parseBindToArgs( ...args );
  86598. const bindingsKeys = Array.from( this._bindings.keys() );
  86599. const numberOfBindings = bindingsKeys.length;
  86600. // Eliminate A.bind( 'x' ).to( B, C )
  86601. if ( !parsedArgs.callback && parsedArgs.to.length > 1 ) {
  86602. /**
  86603. * Binding multiple observables only possible with callback.
  86604. *
  86605. * @error observable-bind-to-no-callback
  86606. */
  86607. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-bind-to-no-callback', this );
  86608. }
  86609. // Eliminate A.bind( 'x', 'y' ).to( B, callback )
  86610. if ( numberOfBindings > 1 && parsedArgs.callback ) {
  86611. /**
  86612. * Cannot bind multiple properties and use a callback in one binding.
  86613. *
  86614. * @error observable-bind-to-extra-callback
  86615. */
  86616. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"](
  86617. 'observable-bind-to-extra-callback',
  86618. this
  86619. );
  86620. }
  86621. parsedArgs.to.forEach( to => {
  86622. // Eliminate A.bind( 'x', 'y' ).to( B, 'a' )
  86623. if ( to.properties.length && to.properties.length !== numberOfBindings ) {
  86624. /**
  86625. * The number of properties must match.
  86626. *
  86627. * @error observable-bind-to-properties-length
  86628. */
  86629. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-bind-to-properties-length', this );
  86630. }
  86631. // When no to.properties specified, observing source properties instead i.e.
  86632. // A.bind( 'x', 'y' ).to( B ) -> Observe B.x and B.y
  86633. if ( !to.properties.length ) {
  86634. to.properties = this._bindProperties;
  86635. }
  86636. } );
  86637. this._to = parsedArgs.to;
  86638. // Fill {@link BindChain#_bindings} with callback. When the callback is set there's only one binding.
  86639. if ( parsedArgs.callback ) {
  86640. this._bindings.get( bindingsKeys[ 0 ] ).callback = parsedArgs.callback;
  86641. }
  86642. attachBindToListeners( this._observable, this._to );
  86643. // Update observable._boundProperties and observable._boundObservables.
  86644. updateBindToBound( this );
  86645. // Set initial values of bound properties.
  86646. this._bindProperties.forEach( propertyName => {
  86647. updateBoundObservableProperty( this._observable, propertyName );
  86648. } );
  86649. }
  86650. // Binds to an attribute in a set of iterable observables.
  86651. //
  86652. // @private
  86653. // @param {Array.<Observable>} observables
  86654. // @param {String} attribute
  86655. // @param {Function} callback
  86656. function bindToMany( observables, attribute, callback ) {
  86657. if ( this._bindings.size > 1 ) {
  86658. /**
  86659. * Binding one attribute to many observables only possible with one attribute.
  86660. *
  86661. * @error observable-bind-to-many-not-one-binding
  86662. */
  86663. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-bind-to-many-not-one-binding', this );
  86664. }
  86665. this.to(
  86666. // Bind to #attribute of each observable...
  86667. ...getBindingTargets( observables, attribute ),
  86668. // ...using given callback to parse attribute values.
  86669. callback
  86670. );
  86671. }
  86672. // Returns an array of binding components for
  86673. // {@link Observable#bind} from a set of iterable observables.
  86674. //
  86675. // @param {Array.<Observable>} observables
  86676. // @param {String} attribute
  86677. // @returns {Array.<String|Observable>}
  86678. function getBindingTargets( observables, attribute ) {
  86679. const observableAndAttributePairs = observables.map( observable => [ observable, attribute ] );
  86680. // Merge pairs to one-dimension array of observables and attributes.
  86681. return Array.prototype.concat.apply( [], observableAndAttributePairs );
  86682. }
  86683. // Check if all entries of the array are of `String` type.
  86684. //
  86685. // @private
  86686. // @param {Array} arr An array to be checked.
  86687. // @returns {Boolean}
  86688. function isStringArray( arr ) {
  86689. return arr.every( a => typeof a == 'string' );
  86690. }
  86691. // Parses and validates {@link Observable#bind}`.to( args )` arguments and returns
  86692. // an object with a parsed structure. For example
  86693. //
  86694. // A.bind( 'x' ).to( B, 'a', C, 'b', call );
  86695. //
  86696. // becomes
  86697. //
  86698. // {
  86699. // to: [
  86700. // { observable: B, properties: [ 'a' ] },
  86701. // { observable: C, properties: [ 'b' ] },
  86702. // ],
  86703. // callback: call
  86704. // }
  86705. //
  86706. // @private
  86707. // @param {...*} args Arguments of {@link Observable#bind}`.to( args )`.
  86708. // @returns {Object}
  86709. function parseBindToArgs( ...args ) {
  86710. // Eliminate A.bind( 'x' ).to()
  86711. if ( !args.length ) {
  86712. /**
  86713. * Invalid argument syntax in `to()`.
  86714. *
  86715. * @error observable-bind-to-parse-error
  86716. */
  86717. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-bind-to-parse-error', null );
  86718. }
  86719. const parsed = { to: [] };
  86720. let lastObservable;
  86721. if ( typeof args[ args.length - 1 ] == 'function' ) {
  86722. parsed.callback = args.pop();
  86723. }
  86724. args.forEach( a => {
  86725. if ( typeof a == 'string' ) {
  86726. lastObservable.properties.push( a );
  86727. } else if ( typeof a == 'object' ) {
  86728. lastObservable = { observable: a, properties: [] };
  86729. parsed.to.push( lastObservable );
  86730. } else {
  86731. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_1__["default"]( 'observable-bind-to-parse-error', null );
  86732. }
  86733. } );
  86734. return parsed;
  86735. }
  86736. // Synchronizes {@link module:utils/observablemixin#_boundObservables} with {@link Binding}.
  86737. //
  86738. // @private
  86739. // @param {Binding} binding A binding to store in {@link Observable#_boundObservables}.
  86740. // @param {Observable} toObservable A observable, which is a new component of `binding`.
  86741. // @param {String} toPropertyName A name of `toObservable`'s property, a new component of the `binding`.
  86742. function updateBoundObservables( observable, binding, toObservable, toPropertyName ) {
  86743. const boundObservables = observable[ boundObservablesSymbol ];
  86744. const bindingsToObservable = boundObservables.get( toObservable );
  86745. const bindings = bindingsToObservable || {};
  86746. if ( !bindings[ toPropertyName ] ) {
  86747. bindings[ toPropertyName ] = new Set();
  86748. }
  86749. // Pass the binding to a corresponding Set in `observable._boundObservables`.
  86750. bindings[ toPropertyName ].add( binding );
  86751. if ( !bindingsToObservable ) {
  86752. boundObservables.set( toObservable, bindings );
  86753. }
  86754. }
  86755. // Synchronizes {@link Observable#_boundProperties} and {@link Observable#_boundObservables}
  86756. // with {@link BindChain}.
  86757. //
  86758. // Assuming the following binding being created
  86759. //
  86760. // A.bind( 'a', 'b' ).to( B, 'x', 'y' );
  86761. //
  86762. // the following bindings were initialized by {@link Observable#bind} in {@link BindChain#_bindings}:
  86763. //
  86764. // {
  86765. // a: { observable: A, property: 'a', to: [] },
  86766. // b: { observable: A, property: 'b', to: [] },
  86767. // }
  86768. //
  86769. // Iterate over all bindings in this chain and fill their `to` properties with
  86770. // corresponding to( ... ) arguments (components of the binding), so
  86771. //
  86772. // {
  86773. // a: { observable: A, property: 'a', to: [ B, 'x' ] },
  86774. // b: { observable: A, property: 'b', to: [ B, 'y' ] },
  86775. // }
  86776. //
  86777. // Then update the structure of {@link Observable#_boundObservables} with updated
  86778. // binding, so it becomes:
  86779. //
  86780. // Map( {
  86781. // B: {
  86782. // x: Set( [
  86783. // { observable: A, property: 'a', to: [ [ B, 'x' ] ] }
  86784. // ] ),
  86785. // y: Set( [
  86786. // { observable: A, property: 'b', to: [ [ B, 'y' ] ] },
  86787. // ] )
  86788. // }
  86789. // } )
  86790. //
  86791. // @private
  86792. // @param {BindChain} chain The binding initialized by {@link Observable#bind}.
  86793. function updateBindToBound( chain ) {
  86794. let toProperty;
  86795. chain._bindings.forEach( ( binding, propertyName ) => {
  86796. // Note: For a binding without a callback, this will run only once
  86797. // like in A.bind( 'x', 'y' ).to( B, 'a', 'b' )
  86798. // TODO: ES6 destructuring.
  86799. chain._to.forEach( to => {
  86800. toProperty = to.properties[ binding.callback ? 0 : chain._bindProperties.indexOf( propertyName ) ];
  86801. binding.to.push( [ to.observable, toProperty ] );
  86802. updateBoundObservables( chain._observable, binding, to.observable, toProperty );
  86803. } );
  86804. } );
  86805. }
  86806. // Updates an property of a {@link Observable} with a value
  86807. // determined by an entry in {@link Observable#_boundProperties}.
  86808. //
  86809. // @private
  86810. // @param {Observable} observable A observable which property is to be updated.
  86811. // @param {String} propertyName An property to be updated.
  86812. function updateBoundObservableProperty( observable, propertyName ) {
  86813. const boundProperties = observable[ boundPropertiesSymbol ];
  86814. const binding = boundProperties.get( propertyName );
  86815. let propertyValue;
  86816. // When a binding with callback is created like
  86817. //
  86818. // A.bind( 'a' ).to( B, 'b', C, 'c', callback );
  86819. //
  86820. // collect B.b and C.c, then pass them to callback to set A.a.
  86821. if ( binding.callback ) {
  86822. propertyValue = binding.callback.apply( observable, binding.to.map( to => to[ 0 ][ to[ 1 ] ] ) );
  86823. } else {
  86824. propertyValue = binding.to[ 0 ];
  86825. propertyValue = propertyValue[ 0 ][ propertyValue[ 1 ] ];
  86826. }
  86827. if ( Object.prototype.hasOwnProperty.call( observable, propertyName ) ) {
  86828. observable[ propertyName ] = propertyValue;
  86829. } else {
  86830. observable.set( propertyName, propertyValue );
  86831. }
  86832. }
  86833. // Starts listening to changes in {@link BindChain._to} observables to update
  86834. // {@link BindChain._observable} {@link BindChain._bindProperties}. Also sets the
  86835. // initial state of {@link BindChain._observable}.
  86836. //
  86837. // @private
  86838. // @param {BindChain} chain The chain initialized by {@link Observable#bind}.
  86839. function attachBindToListeners( observable, toBindings ) {
  86840. toBindings.forEach( to => {
  86841. const boundObservables = observable[ boundObservablesSymbol ];
  86842. let bindings;
  86843. // If there's already a chain between the observables (`observable` listens to
  86844. // `to.observable`), there's no need to create another `change` event listener.
  86845. if ( !boundObservables.get( to.observable ) ) {
  86846. observable.listenTo( to.observable, 'change', ( evt, propertyName ) => {
  86847. bindings = boundObservables.get( to.observable )[ propertyName ];
  86848. // Note: to.observable will fire for any property change, react
  86849. // to changes of properties which are bound only.
  86850. if ( bindings ) {
  86851. bindings.forEach( binding => {
  86852. updateBoundObservableProperty( observable, binding.property );
  86853. } );
  86854. }
  86855. } );
  86856. }
  86857. } );
  86858. }
  86859. /**
  86860. * An interface which adds "observable properties" and data binding functionality.
  86861. *
  86862. * Can be easily implemented by a class by mixing the {@link module:utils/observablemixin~ObservableMixin} mixin.
  86863. *
  86864. * Read more about the usage of this interface in the:
  86865. * * {@glink framework/guides/architecture/core-editor-architecture#event-system-and-observables "Event system and observables"}
  86866. * section of the {@glink framework/guides/architecture/core-editor-architecture "Core editor architecture"} guide,
  86867. * * {@glink framework/guides/deep-dive/observables "Observables" deep dive} guide.
  86868. *
  86869. * @interface Observable
  86870. * @extends module:utils/emittermixin~Emitter
  86871. */
  86872. /**
  86873. * Fired when a property changed value.
  86874. *
  86875. * observable.set( 'prop', 1 );
  86876. *
  86877. * observable.on( 'change:prop', ( evt, propertyName, newValue, oldValue ) => {
  86878. * console.log( `${ propertyName } has changed from ${ oldValue } to ${ newValue }` );
  86879. * } );
  86880. *
  86881. * observable.prop = 2; // -> 'prop has changed from 1 to 2'
  86882. *
  86883. * @event change:{property}
  86884. * @param {String} name The property name.
  86885. * @param {*} value The new property value.
  86886. * @param {*} oldValue The previous property value.
  86887. */
  86888. /**
  86889. * Fired when a property value is going to be set but is not set yet (before the `change` event is fired).
  86890. *
  86891. * You can control the final value of the property by using
  86892. * the {@link module:utils/eventinfo~EventInfo#return event's `return` property}.
  86893. *
  86894. * observable.set( 'prop', 1 );
  86895. *
  86896. * observable.on( 'set:prop', ( evt, propertyName, newValue, oldValue ) => {
  86897. * console.log( `Value is going to be changed from ${ oldValue } to ${ newValue }` );
  86898. * console.log( `Current property value is ${ observable[ propertyName ] }` );
  86899. *
  86900. * // Let's override the value.
  86901. * evt.return = 3;
  86902. * } );
  86903. *
  86904. * observable.on( 'change:prop', ( evt, propertyName, newValue, oldValue ) => {
  86905. * console.log( `Value has changed from ${ oldValue } to ${ newValue }` );
  86906. * } );
  86907. *
  86908. * observable.prop = 2; // -> 'Value is going to be changed from 1 to 2'
  86909. * // -> 'Current property value is 1'
  86910. * // -> 'Value has changed from 1 to 3'
  86911. *
  86912. * **Note:** The event is fired even when the new value is the same as the old value.
  86913. *
  86914. * @event set:{property}
  86915. * @param {String} name The property name.
  86916. * @param {*} value The new property value.
  86917. * @param {*} oldValue The previous property value.
  86918. */
  86919. /**
  86920. * Creates and sets the value of an observable property of this object. Such a property becomes a part
  86921. * of the state and is observable.
  86922. *
  86923. * It accepts also a single object literal containing key/value pairs with properties to be set.
  86924. *
  86925. * This method throws the `observable-set-cannot-override` error if the observable instance already
  86926. * has a property with the given property name. This prevents from mistakenly overriding existing
  86927. * properties and methods, but means that `foo.set( 'bar', 1 )` may be slightly slower than `foo.bar = 1`.
  86928. *
  86929. * @method #set
  86930. * @param {String|Object} name The property's name or object with `name=>value` pairs.
  86931. * @param {*} [value] The property's value (if `name` was passed in the first parameter).
  86932. */
  86933. /**
  86934. * Binds {@link #set observable properties} to other objects implementing the
  86935. * {@link module:utils/observablemixin~Observable} interface.
  86936. *
  86937. * Read more in the {@glink framework/guides/deep-dive/observables#property-bindings dedicated guide}
  86938. * covering the topic of property bindings with some additional examples.
  86939. *
  86940. * Consider two objects: a `button` and an associated `command` (both `Observable`).
  86941. *
  86942. * A simple property binding could be as follows:
  86943. *
  86944. * button.bind( 'isEnabled' ).to( command, 'isEnabled' );
  86945. *
  86946. * or even shorter:
  86947. *
  86948. * button.bind( 'isEnabled' ).to( command );
  86949. *
  86950. * which works in the following way:
  86951. *
  86952. * * `button.isEnabled` **instantly equals** `command.isEnabled`,
  86953. * * whenever `command.isEnabled` changes, `button.isEnabled` will immediately reflect its value.
  86954. *
  86955. * **Note**: To release the binding, use {@link module:utils/observablemixin~Observable#unbind}.
  86956. *
  86957. * You can also "rename" the property in the binding by specifying the new name in the `to()` chain:
  86958. *
  86959. * button.bind( 'isEnabled' ).to( command, 'isWorking' );
  86960. *
  86961. * It is possible to bind more than one property at a time to shorten the code:
  86962. *
  86963. * button.bind( 'isEnabled', 'value' ).to( command );
  86964. *
  86965. * which corresponds to:
  86966. *
  86967. * button.bind( 'isEnabled' ).to( command );
  86968. * button.bind( 'value' ).to( command );
  86969. *
  86970. * The binding can include more than one observable, combining multiple data sources in a custom callback:
  86971. *
  86972. * button.bind( 'isEnabled' ).to( command, 'isEnabled', ui, 'isVisible',
  86973. * ( isCommandEnabled, isUIVisible ) => isCommandEnabled && isUIVisible );
  86974. *
  86975. * Using a custom callback allows processing the value before passing it to the target property:
  86976. *
  86977. * button.bind( 'isEnabled' ).to( command, 'value', value => value === 'heading1' );
  86978. *
  86979. * It is also possible to bind to the same property in an array of observables.
  86980. * To bind a `button` to multiple commands (also `Observables`) so that each and every one of them
  86981. * must be enabled for the button to become enabled, use the following code:
  86982. *
  86983. * button.bind( 'isEnabled' ).toMany( [ commandA, commandB, commandC ], 'isEnabled',
  86984. * ( isAEnabled, isBEnabled, isCEnabled ) => isAEnabled && isBEnabled && isCEnabled );
  86985. *
  86986. * @method #bind
  86987. * @param {...String} bindProperties Observable properties that will be bound to other observable(s).
  86988. * @returns {Object} The bind chain with the `to()` and `toMany()` methods.
  86989. */
  86990. /**
  86991. * Removes the binding created with {@link #bind}.
  86992. *
  86993. * // Removes the binding for the 'a' property.
  86994. * A.unbind( 'a' );
  86995. *
  86996. * // Removes bindings for all properties.
  86997. * A.unbind();
  86998. *
  86999. * @method #unbind
  87000. * @param {...String} [unbindProperties] Observable properties to be unbound. All the bindings will
  87001. * be released if no properties are provided.
  87002. */
  87003. /**
  87004. * Turns the given methods of this object into event-based ones. This means that the new method will fire an event
  87005. * (named after the method) and the original action will be plugged as a listener to that event.
  87006. *
  87007. * Read more in the {@glink framework/guides/deep-dive/observables#decorating-object-methods dedicated guide}
  87008. * covering the topic of decorating methods with some additional examples.
  87009. *
  87010. * Decorating the method does not change its behavior (it only adds an event),
  87011. * but it allows to modify it later on by listening to the method's event.
  87012. *
  87013. * For example, to cancel the method execution the event can be {@link module:utils/eventinfo~EventInfo#stop stopped}:
  87014. *
  87015. * class Foo {
  87016. * constructor() {
  87017. * this.decorate( 'method' );
  87018. * }
  87019. *
  87020. * method() {
  87021. * console.log( 'called!' );
  87022. * }
  87023. * }
  87024. *
  87025. * const foo = new Foo();
  87026. * foo.on( 'method', ( evt ) => {
  87027. * evt.stop();
  87028. * }, { priority: 'high' } );
  87029. *
  87030. * foo.method(); // Nothing is logged.
  87031. *
  87032. *
  87033. * **Note**: The high {@link module:utils/priorities~PriorityString priority} listener
  87034. * has been used to execute this particular callback before the one which calls the original method
  87035. * (which uses the "normal" priority).
  87036. *
  87037. * It is also possible to change the returned value:
  87038. *
  87039. * foo.on( 'method', ( evt ) => {
  87040. * evt.return = 'Foo!';
  87041. * } );
  87042. *
  87043. * foo.method(); // -> 'Foo'
  87044. *
  87045. * Finally, it is possible to access and modify the arguments the method is called with:
  87046. *
  87047. * method( a, b ) {
  87048. * console.log( `${ a }, ${ b }` );
  87049. * }
  87050. *
  87051. * // ...
  87052. *
  87053. * foo.on( 'method', ( evt, args ) => {
  87054. * args[ 0 ] = 3;
  87055. *
  87056. * console.log( args[ 1 ] ); // -> 2
  87057. * }, { priority: 'high' } );
  87058. *
  87059. * foo.method( 1, 2 ); // -> '3, 2'
  87060. *
  87061. * @method #decorate
  87062. * @param {String} methodName Name of the method to decorate.
  87063. */
  87064. /***/ }),
  87065. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/priorities.js":
  87066. /*!******************************************************************!*\
  87067. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/priorities.js ***!
  87068. \******************************************************************/
  87069. /*! exports provided: default */
  87070. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  87071. "use strict";
  87072. __webpack_require__.r(__webpack_exports__);
  87073. /**
  87074. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  87075. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  87076. */
  87077. /**
  87078. * @module utils/priorities
  87079. */
  87080. /**
  87081. * String representing a priority value.
  87082. *
  87083. * @typedef {'highest'|'high'|'normal'|'low'|'lowest'} module:utils/priorities~PriorityString
  87084. */
  87085. /**
  87086. * Provides group of constants to use instead of hardcoding numeric priority values.
  87087. *
  87088. * @namespace
  87089. */
  87090. const priorities = {
  87091. /**
  87092. * Converts a string with priority name to it's numeric value. If `Number` is given, it just returns it.
  87093. *
  87094. * @static
  87095. * @param {module:utils/priorities~PriorityString|Number} priority Priority to convert.
  87096. * @returns {Number} Converted priority.
  87097. */
  87098. get( priority ) {
  87099. if ( typeof priority != 'number' ) {
  87100. return this[ priority ] || this.normal;
  87101. } else {
  87102. return priority;
  87103. }
  87104. },
  87105. highest: 100000,
  87106. high: 1000,
  87107. normal: 0,
  87108. low: -1000,
  87109. lowest: -100000
  87110. };
  87111. /* harmony default export */ __webpack_exports__["default"] = (priorities);
  87112. /***/ }),
  87113. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/spy.js":
  87114. /*!***********************************************************!*\
  87115. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/spy.js ***!
  87116. \***********************************************************/
  87117. /*! exports provided: default */
  87118. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  87119. "use strict";
  87120. __webpack_require__.r(__webpack_exports__);
  87121. /**
  87122. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  87123. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  87124. */
  87125. /**
  87126. * @module utils/spy
  87127. */
  87128. /**
  87129. * Creates a spy function (ala Sinon.js) that can be used to inspect call to it.
  87130. *
  87131. * The following are the present features:
  87132. *
  87133. * * spy.called: property set to `true` if the function has been called at least once.
  87134. *
  87135. * @returns {Function} The spy function.
  87136. */
  87137. function spy() {
  87138. return function spy() {
  87139. spy.called = true;
  87140. };
  87141. }
  87142. /* harmony default export */ __webpack_exports__["default"] = (spy);
  87143. /***/ }),
  87144. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/tomap.js":
  87145. /*!*************************************************************!*\
  87146. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/tomap.js ***!
  87147. \*************************************************************/
  87148. /*! exports provided: default */
  87149. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  87150. "use strict";
  87151. __webpack_require__.r(__webpack_exports__);
  87152. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return toMap; });
  87153. /* harmony import */ var _objecttomap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./objecttomap */ "./node_modules/@ckeditor/ckeditor5-utils/src/objecttomap.js");
  87154. /* harmony import */ var _isiterable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isiterable */ "./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js");
  87155. /**
  87156. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  87157. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  87158. */
  87159. /**
  87160. * @module utils/tomap
  87161. */
  87162. /**
  87163. * Transforms object or iterable to map. Iterable needs to be in the format acceptable by the `Map` constructor.
  87164. *
  87165. * map = toMap( { 'foo': 1, 'bar': 2 } );
  87166. * map = toMap( [ [ 'foo', 1 ], [ 'bar', 2 ] ] );
  87167. * map = toMap( anotherMap );
  87168. *
  87169. * @param {Object|Iterable} data Object or iterable to transform.
  87170. * @returns {Map} Map created from data.
  87171. */
  87172. function toMap( data ) {
  87173. if ( Object(_isiterable__WEBPACK_IMPORTED_MODULE_1__["default"])( data ) ) {
  87174. return new Map( data );
  87175. } else {
  87176. return Object(_objecttomap__WEBPACK_IMPORTED_MODULE_0__["default"])( data );
  87177. }
  87178. }
  87179. /***/ }),
  87180. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/translation-service.js":
  87181. /*!***************************************************************************!*\
  87182. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/translation-service.js ***!
  87183. \***************************************************************************/
  87184. /*! exports provided: add, _translate, _clear */
  87185. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  87186. "use strict";
  87187. __webpack_require__.r(__webpack_exports__);
  87188. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "add", function() { return add; });
  87189. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_translate", function() { return _translate; });
  87190. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_clear", function() { return _clear; });
  87191. /* harmony import */ var _ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  87192. /**
  87193. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  87194. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  87195. */
  87196. /* globals window */
  87197. /**
  87198. * @module utils/translation-service
  87199. */
  87200. /* istanbul ignore else */
  87201. if ( !window.CKEDITOR_TRANSLATIONS ) {
  87202. window.CKEDITOR_TRANSLATIONS = {};
  87203. }
  87204. /**
  87205. * Adds translations to existing ones or overrides the existing translations. These translations will later
  87206. * be available for the {@link module:utils/locale~Locale#t `t()`} function.
  87207. *
  87208. * The `translations` is an object which consists of `messageId: translation` pairs. Note that the message ID can be
  87209. * either constructed from the message string or from the message ID if it was passed
  87210. * (this happens rarely and mostly for short messages or messages with placeholders).
  87211. * Since the editor displays only the message string, the message ID can be found either in the source code or in the
  87212. * built translations for another language.
  87213. *
  87214. * add( 'pl', {
  87215. * 'Cancel': 'Anuluj',
  87216. * 'IMAGE': 'obraz', // Note that the `IMAGE` comes from the message ID, while the string can be `image`.
  87217. * } );
  87218. *
  87219. * If the message is supposed to support various plural forms, make sure to provide an array with the singular form and all plural forms:
  87220. *
  87221. * add( 'pl', {
  87222. * 'Add space': [ 'Dodaj spację', 'Dodaj %0 spacje', 'Dodaj %0 spacji' ]
  87223. * } );
  87224. *
  87225. * You should also specify the third argument (the `getPluralForm()` function) that will be used to determine the plural form if no
  87226. * language file was loaded for that language. All language files coming from CKEditor 5 sources will have this option set, so
  87227. * these plural form rules will be reused by other translations added to the registered languages. The `getPluralForm()` function
  87228. * can return either a Boolean or a number.
  87229. *
  87230. * add( 'en', {
  87231. * // ... Translations.
  87232. * }, n => n !== 1 );
  87233. * add( 'pl', {
  87234. * // ... Translations.
  87235. * }, n => n == 1 ? 0 : n % 10 >= 2 && n % 10 <= 4 && ( n % 100 < 10 || n % 100 >= 20 ) ? 1 : 2 );
  87236. *
  87237. * All translations extend the global `window.CKEDITOR_TRANSLATIONS` object. An example of this object can be found below:
  87238. *
  87239. * {
  87240. * pl: {
  87241. * dictionary: {
  87242. * 'Cancel': 'Anuluj',
  87243. * 'Add space': [ 'Dodaj spację', 'Dodaj %0 spacje', 'Dodaj %0 spacji' ]
  87244. * },
  87245. * // A function that returns the plural form index.
  87246. * getPluralForm: n => n !==1
  87247. * }
  87248. * // Other languages.
  87249. * }
  87250. *
  87251. * If you cannot import this function from this module (e.g. because you use a CKEditor 5 build), you can
  87252. * still add translations by extending the global `window.CKEDITOR_TRANSLATIONS` object by using a function like
  87253. * the one below:
  87254. *
  87255. * function addTranslations( language, translations, getPluralForm ) {
  87256. * if ( !window.CKEDITOR_TRANSLATIONS ) {
  87257. * window.CKEDITOR_TRANSLATIONS = {};
  87258. * }
  87259. * if ( !window.CKEDITOR_TRANSLATIONS[ language ] ) {
  87260. * window.CKEDITOR_TRANSLATIONS[ language ] = {};
  87261. * }
  87262. *
  87263. * const languageTranslations = window.CKEDITOR_TRANSLATIONS[ language ];
  87264. *
  87265. * languageTranslations.dictionary = languageTranslations.dictionary || {};
  87266. * languageTranslations.getPluralForm = getPluralForm || languageTranslations.getPluralForm;
  87267. *
  87268. * // Extend the dictionary for the given language.
  87269. * Object.assign( languageTranslations.dictionary, translations );
  87270. * }
  87271. *
  87272. * @param {String} language Target language.
  87273. * @param {Object.<String,*>} translations An object with translations which will be added to the dictionary.
  87274. * For each message ID the value should be either a translation or an array of translations if the message
  87275. * should support plural forms.
  87276. * @param {Function} getPluralForm A function that returns the plural form index (a number).
  87277. */
  87278. function add( language, translations, getPluralForm ) {
  87279. if ( !window.CKEDITOR_TRANSLATIONS[ language ] ) {
  87280. window.CKEDITOR_TRANSLATIONS[ language ] = {};
  87281. }
  87282. const languageTranslations = window.CKEDITOR_TRANSLATIONS[ language ];
  87283. languageTranslations.dictionary = languageTranslations.dictionary || {};
  87284. languageTranslations.getPluralForm = getPluralForm || languageTranslations.getPluralForm;
  87285. Object.assign( languageTranslations.dictionary, translations );
  87286. }
  87287. /**
  87288. * **Note:** This method is internal, use {@link module:utils/locale~Locale#t the `t()` function} instead to translate
  87289. * the editor UI parts.
  87290. *
  87291. * This function is responsible for translating messages to the specified language. It uses translations added perviously
  87292. * by {@link module:utils/translation-service~add} (a translations dictionary and the `getPluralForm()` function
  87293. * to provide accurate translations of plural forms).
  87294. *
  87295. * When no translation is defined in the dictionary or the dictionary does not exist, this function returns
  87296. * the original message string or the message plural depending on the number of elements.
  87297. *
  87298. * translate( 'pl', { string: 'Cancel' } ); // 'Cancel'
  87299. *
  87300. * The third optional argument is the number of elements, based on which the single form or one of the plural forms
  87301. * should be picked when the message is supposed to support various plural forms.
  87302. *
  87303. * translate( 'en', { string: 'Add a space', plural: 'Add %0 spaces' }, 1 ); // 'Add a space'
  87304. * translate( 'en', { string: 'Add a space', plural: 'Add %0 spaces' }, 3 ); // 'Add %0 spaces'
  87305. *
  87306. * The message should provide an ID using the `id` property when the message strings are not unique and their
  87307. * translations should be different.
  87308. *
  87309. * translate( 'en', { string: 'image', id: 'ADD_IMAGE' } );
  87310. * translate( 'en', { string: 'image', id: 'AN_IMAGE' } );
  87311. *
  87312. * @protected
  87313. * @param {String} language Target language.
  87314. * @param {module:utils/translation-service~Message|String} message A message that will be translated.
  87315. * @param {Number} [quantity] The number of elements for which a plural form should be picked from the target language dictionary.
  87316. * @returns {String} Translated sentence.
  87317. */
  87318. function _translate( language, message, quantity = 1 ) {
  87319. if ( typeof quantity !== 'number' ) {
  87320. /**
  87321. * An incorrect value was passed to the translation function. This was probably caused
  87322. * by an incorrect message interpolation of a plural form. Note that for messages supporting plural forms
  87323. * the second argument of the `t()` function should always be a number or an array with a number as the first element.
  87324. *
  87325. * @error translation-service-quantity-not-a-number
  87326. */
  87327. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"]( 'translation-service-quantity-not-a-number', null, { quantity } );
  87328. }
  87329. const numberOfLanguages = getNumberOfLanguages();
  87330. if ( numberOfLanguages === 1 ) {
  87331. // Override the language to the only supported one.
  87332. // This can't be done in the `Locale` class, because the translations comes after the `Locale` class initialization.
  87333. language = Object.keys( window.CKEDITOR_TRANSLATIONS )[ 0 ];
  87334. }
  87335. const messageId = message.id || message.string;
  87336. if ( numberOfLanguages === 0 || !hasTranslation( language, messageId ) ) {
  87337. if ( quantity !== 1 ) {
  87338. // Return the default plural form that was passed in the `message.plural` parameter.
  87339. return message.plural;
  87340. }
  87341. return message.string;
  87342. }
  87343. const dictionary = window.CKEDITOR_TRANSLATIONS[ language ].dictionary;
  87344. const getPluralForm = window.CKEDITOR_TRANSLATIONS[ language ].getPluralForm || ( n => n === 1 ? 0 : 1 );
  87345. if ( typeof dictionary[ messageId ] === 'string' ) {
  87346. return dictionary[ messageId ];
  87347. }
  87348. const pluralFormIndex = Number( getPluralForm( quantity ) );
  87349. // Note: The `translate` function is not responsible for replacing `%0, %1, ...` with values.
  87350. return dictionary[ messageId ][ pluralFormIndex ];
  87351. }
  87352. /**
  87353. * Clears dictionaries for test purposes.
  87354. *
  87355. * @protected
  87356. */
  87357. function _clear() {
  87358. window.CKEDITOR_TRANSLATIONS = {};
  87359. }
  87360. // Checks whether the dictionary exists and translation in that dictionary exists.
  87361. function hasTranslation( language, messageId ) {
  87362. return (
  87363. !!window.CKEDITOR_TRANSLATIONS[ language ] &&
  87364. !!window.CKEDITOR_TRANSLATIONS[ language ].dictionary[ messageId ]
  87365. );
  87366. }
  87367. function getNumberOfLanguages() {
  87368. return Object.keys( window.CKEDITOR_TRANSLATIONS ).length;
  87369. }
  87370. /**
  87371. * The internationalization message interface. A message that implements this interface can be passed to the `t()` function
  87372. * to be translated to the target UI language.
  87373. *
  87374. * @typedef {Object} module:utils/translation-service~Message
  87375. *
  87376. * @property {String} string The message string to translate. Acts as a default translation if the translation for a given language
  87377. * is not defined. When the message is supposed to support plural forms, the string should be the English singular form of the message.
  87378. * @property {String} [id] The message ID. If passed, the message ID is taken from this property instead of the `message.string`.
  87379. * This property is useful when various messages share the same message string, for example, the `editor` string in `in the editor`
  87380. * and `my editor` sentences.
  87381. * @property {String} [plural] The plural form of the message. This property should be skipped when a message is not supposed
  87382. * to support plural forms. Otherwise it should always be set to a string with the English plural form of the message.
  87383. */
  87384. /***/ }),
  87385. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/uid.js":
  87386. /*!***********************************************************!*\
  87387. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/uid.js ***!
  87388. \***********************************************************/
  87389. /*! exports provided: default */
  87390. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  87391. "use strict";
  87392. __webpack_require__.r(__webpack_exports__);
  87393. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return uid; });
  87394. /**
  87395. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  87396. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  87397. */
  87398. /**
  87399. * @module utils/uid
  87400. */
  87401. // A hash table of hex numbers to avoid using toString() in uid() which is costly.
  87402. // [ '00', '01', '02', ..., 'fe', 'ff' ]
  87403. const HEX_NUMBERS = new Array( 256 ).fill()
  87404. .map( ( val, index ) => ( '0' + ( index ).toString( 16 ) ).slice( -2 ) );
  87405. /**
  87406. * Returns a unique id. The id starts with an "e" character and a randomly generated string of
  87407. * 32 alphanumeric characters.
  87408. *
  87409. * **Note**: The characters the unique id is built from correspond to the hex number notation
  87410. * (from "0" to "9", from "a" to "f"). In other words, each id corresponds to an "e" followed
  87411. * by 16 8-bit numbers next to each other.
  87412. *
  87413. * @returns {String} An unique id string.
  87414. */
  87415. function uid() {
  87416. // Let's create some positive random 32bit integers first.
  87417. //
  87418. // 1. Math.random() is a float between 0 and 1.
  87419. // 2. 0x100000000 is 2^32 = 4294967296.
  87420. // 3. >>> 0 enforces integer (in JS all numbers are floating point).
  87421. //
  87422. // For instance:
  87423. // Math.random() * 0x100000000 = 3366450031.853859
  87424. // but
  87425. // Math.random() * 0x100000000 >>> 0 = 3366450031.
  87426. const r1 = Math.random() * 0x100000000 >>> 0;
  87427. const r2 = Math.random() * 0x100000000 >>> 0;
  87428. const r3 = Math.random() * 0x100000000 >>> 0;
  87429. const r4 = Math.random() * 0x100000000 >>> 0;
  87430. // Make sure that id does not start with number.
  87431. return 'e' +
  87432. HEX_NUMBERS[ r1 >> 0 & 0xFF ] +
  87433. HEX_NUMBERS[ r1 >> 8 & 0xFF ] +
  87434. HEX_NUMBERS[ r1 >> 16 & 0xFF ] +
  87435. HEX_NUMBERS[ r1 >> 24 & 0xFF ] +
  87436. HEX_NUMBERS[ r2 >> 0 & 0xFF ] +
  87437. HEX_NUMBERS[ r2 >> 8 & 0xFF ] +
  87438. HEX_NUMBERS[ r2 >> 16 & 0xFF ] +
  87439. HEX_NUMBERS[ r2 >> 24 & 0xFF ] +
  87440. HEX_NUMBERS[ r3 >> 0 & 0xFF ] +
  87441. HEX_NUMBERS[ r3 >> 8 & 0xFF ] +
  87442. HEX_NUMBERS[ r3 >> 16 & 0xFF ] +
  87443. HEX_NUMBERS[ r3 >> 24 & 0xFF ] +
  87444. HEX_NUMBERS[ r4 >> 0 & 0xFF ] +
  87445. HEX_NUMBERS[ r4 >> 8 & 0xFF ] +
  87446. HEX_NUMBERS[ r4 >> 16 & 0xFF ] +
  87447. HEX_NUMBERS[ r4 >> 24 & 0xFF ];
  87448. }
  87449. /***/ }),
  87450. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/unicode.js":
  87451. /*!***************************************************************!*\
  87452. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/unicode.js ***!
  87453. \***************************************************************/
  87454. /*! exports provided: isCombiningMark, isHighSurrogateHalf, isLowSurrogateHalf, isInsideSurrogatePair, isInsideCombinedSymbol */
  87455. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  87456. "use strict";
  87457. __webpack_require__.r(__webpack_exports__);
  87458. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isCombiningMark", function() { return isCombiningMark; });
  87459. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isHighSurrogateHalf", function() { return isHighSurrogateHalf; });
  87460. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLowSurrogateHalf", function() { return isLowSurrogateHalf; });
  87461. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isInsideSurrogatePair", function() { return isInsideSurrogatePair; });
  87462. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isInsideCombinedSymbol", function() { return isInsideCombinedSymbol; });
  87463. /**
  87464. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  87465. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  87466. */
  87467. /**
  87468. * Set of utils to handle unicode characters.
  87469. *
  87470. * @module utils/unicode
  87471. */
  87472. /**
  87473. * Checks whether given `character` is a combining mark.
  87474. *
  87475. * @param {String} character Character to check.
  87476. * @returns {Boolean}
  87477. */
  87478. function isCombiningMark( character ) {
  87479. // eslint-disable-next-line no-misleading-character-class
  87480. return !!character && character.length == 1 && /[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test( character );
  87481. }
  87482. /**
  87483. * Checks whether given `character` is a high half of surrogate pair.
  87484. *
  87485. * Using UTF-16 terminology, a surrogate pair denotes UTF-16 character using two UTF-8 characters. The surrogate pair
  87486. * consist of high surrogate pair character followed by low surrogate pair character.
  87487. *
  87488. * @param {String} character Character to check.
  87489. * @returns {Boolean}
  87490. */
  87491. function isHighSurrogateHalf( character ) {
  87492. return !!character && character.length == 1 && /[\ud800-\udbff]/.test( character );
  87493. }
  87494. /**
  87495. * Checks whether given `character` is a low half of surrogate pair.
  87496. *
  87497. * Using UTF-16 terminology, a surrogate pair denotes UTF-16 character using two UTF-8 characters. The surrogate pair
  87498. * consist of high surrogate pair character followed by low surrogate pair character.
  87499. *
  87500. * @param {String} character Character to check.
  87501. * @returns {Boolean}
  87502. */
  87503. function isLowSurrogateHalf( character ) {
  87504. return !!character && character.length == 1 && /[\udc00-\udfff]/.test( character );
  87505. }
  87506. /**
  87507. * Checks whether given offset in a string is inside a surrogate pair (between two surrogate halves).
  87508. *
  87509. * @param {String} string String to check.
  87510. * @param {Number} offset Offset to check.
  87511. * @returns {Boolean}
  87512. */
  87513. function isInsideSurrogatePair( string, offset ) {
  87514. return isHighSurrogateHalf( string.charAt( offset - 1 ) ) && isLowSurrogateHalf( string.charAt( offset ) );
  87515. }
  87516. /**
  87517. * Checks whether given offset in a string is between base character and combining mark or between two combining marks.
  87518. *
  87519. * @param {String} string String to check.
  87520. * @param {Number} offset Offset to check.
  87521. * @returns {Boolean}
  87522. */
  87523. function isInsideCombinedSymbol( string, offset ) {
  87524. return isCombiningMark( string.charAt( offset ) );
  87525. }
  87526. /***/ }),
  87527. /***/ "./node_modules/@ckeditor/ckeditor5-utils/src/version.js":
  87528. /*!***************************************************************!*\
  87529. !*** ./node_modules/@ckeditor/ckeditor5-utils/src/version.js ***!
  87530. \***************************************************************/
  87531. /*! no exports provided */
  87532. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  87533. "use strict";
  87534. __webpack_require__.r(__webpack_exports__);
  87535. /* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var _ckeditorerror__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  87536. /**
  87537. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  87538. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  87539. */
  87540. /**
  87541. * @module utils/version
  87542. */
  87543. /* globals window, global */
  87544. const version = '23.1.0';
  87545. /* istanbul ignore next */
  87546. const windowOrGlobal = typeof window === 'object' ? window : global;
  87547. /* istanbul ignore next */
  87548. if ( windowOrGlobal.CKEDITOR_VERSION ) {
  87549. /**
  87550. * This error is thrown when due to a mistake in how CKEditor 5 was installed or initialized, some
  87551. * of its modules were duplicated (evaluated and executed twice). Module duplication leads to inevitable runtime
  87552. * errors.
  87553. *
  87554. * There are many situations in which some modules can be loaded twice. In the worst case scenario,
  87555. * you may need to check your project for each of these issues and fix them all.
  87556. *
  87557. * # Trying to add a plugin to an existing build
  87558. *
  87559. * If you import an existing CKEditor 5 build and a plugin like this:
  87560. *
  87561. * import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
  87562. * import Highlight from '@ckeditor/ckeditor5-highlight/src/highlight';
  87563. *
  87564. * Then your project loads some CKEditor 5 packages twice. How does it happen?
  87565. *
  87566. * The build package contains a file which is already compiled with webpack. This means
  87567. * that it contains all the necessary code from e.g. `@ckeditor/ckeditor5-engine` and `@ckeditor/ckeditor5-utils`.
  87568. *
  87569. * However, the `Highlight` plugin imports some of the modules from these packages, too. If you ask webpack to
  87570. * build such a project, you will end up with the modules being included (and run) twice &mdash; first, because they are
  87571. * included inside the build package, and second, because they are required by the `Highlight` plugin.
  87572. *
  87573. * Therefore, **you must never add plugins to an existing build** unless your plugin has no dependencies.
  87574. *
  87575. * Adding plugins to a build is done by taking the source version of this build (so, before it was built with webpack)
  87576. * and adding plugins there. In this situation, webpack will know that it only needs to load each plugin once.
  87577. *
  87578. * Read more in the {@glink builds/guides/integration/installing-plugins "Installing plugins"} guide.
  87579. *
  87580. * # Confused an editor build with an editor implementation
  87581. *
  87582. * This scenario is very similar to the previous one, but has a different origin.
  87583. *
  87584. * Let's assume that you wanted to use CKEditor 5 from source, as explained in the
  87585. * {@glink builds/guides/integration/advanced-setup#scenario-2-building-from-source "Building from source"} section
  87586. * or in the {@glink framework/guides/quick-start "Quick start"} guide of CKEditor 5 Framework.
  87587. *
  87588. * The correct way to do so is to import an editor and plugins and run them together like this:
  87589. *
  87590. * import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
  87591. * import Essentials from '@ckeditor/ckeditor5-essentials/src/essentials';
  87592. * import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
  87593. * import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
  87594. * import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';
  87595. *
  87596. * ClassicEditor
  87597. * .create( document.querySelector( '#editor' ), {
  87598. * plugins: [ Essentials, Paragraph, Bold, Italic ],
  87599. * toolbar: [ 'bold', 'italic' ]
  87600. * } )
  87601. * .then( editor => {
  87602. * console.log( 'Editor was initialized', editor );
  87603. * } )
  87604. * .catch( error => {
  87605. * console.error( error.stack );
  87606. * } );
  87607. *
  87608. * However, you might have mistakenly imported a build instead of the source `ClassicEditor`. In this case
  87609. * your imports will look like this:
  87610. *
  87611. * import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
  87612. * import Essentials from '@ckeditor/ckeditor5-essentials/src/essentials';
  87613. * import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
  87614. * import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
  87615. * import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';
  87616. *
  87617. * This creates the same situation as in the previous section because you use a build together with source plugins.
  87618. *
  87619. * Remember: `@ckeditor/ckeditor5-build-*` packages contain editor builds and `@ckeditor/ckeditor5-editor-*` contain source editors.
  87620. *
  87621. * # Loading two or more builds on one page
  87622. *
  87623. * If you use CKEditor 5 builds, you might have loaded two (or more) `ckeditor.js` files on one web page.
  87624. * Check your web page for duplicated `<script>` elements or make sure your page builder/bundler includes CKEditor only once.
  87625. *
  87626. * If you want to use two different types of editors at once, see the
  87627. * {@glink builds/guides/integration/advanced-setup#scenario-3-using-two-different-editors "Using two different editors"}
  87628. * section.
  87629. *
  87630. * # Using outdated packages
  87631. *
  87632. * Building CKEditor 5 from source requires using multiple npm packages. These packages have their dependencies
  87633. * to other packages. If you use the latest version of, for example, `@ckeditor/ckeditor5-editor-classic` with
  87634. * an outdated version of `@ckeditor/ckeditor5-image`, npm or yarn will need to install two different versions of
  87635. * `@ckeditor/ckeditor5-core` because `@ckeditor/ckeditor5-editor-classic` and `@ckeditor/ckeditor5-image` may require
  87636. * different versions of the core package.
  87637. *
  87638. * The solution to this issue is to update all packages to their latest version. We recommend
  87639. * using tools like [`npm-check-updates`](https://www.npmjs.com/package/npm-check-updates) which simplify this process.
  87640. *
  87641. * # Conflicting version of dependencies
  87642. *
  87643. * This is a special case of the previous scenario. If you use CKEditor 5 with some third-party plugins,
  87644. * it may happen that even if you use the latest versions of the official packages and the latest version of
  87645. * these third-party packages, there will be a conflict between some of their dependencies.
  87646. *
  87647. * Such a problem can be resolved by either downgrading CKEditor 5 packages (which we do not recommend) or
  87648. * asking the author of the third-party package to upgrade its depdendencies (or forking their project and doing this yourself).
  87649. *
  87650. * **Note:** All official CKEditor 5 packages (excluding integrations and `ckeditor5-dev-*` packages) are released in the
  87651. * same major version. This is &mdash; in the `x.y.z`, the `x` is the same for all packages. This is the simplest way to check
  87652. * whether you use packages coming from the same CKEditor 5 version. You can read more about versioning in the
  87653. * {@glink framework/guides/support/versioning-policy Versioning policy} guide.
  87654. *
  87655. * # Packages were duplicated in `node_modules`
  87656. *
  87657. * In some situations, especially when calling `npm install` multiple times, it may happen
  87658. * that npm will not correctly "deduplicate" packages.
  87659. *
  87660. * Normally, npm deduplicates all packages so, for example, `@ckeditor/ckeditor5-core` is installed only once in `node_modules/`.
  87661. * However, it is known to fail to do so from time to time.
  87662. *
  87663. * We recommend checking if any of the steps listed below help:
  87664. *
  87665. * * `rm -rf node_modules && npm install` to make sure you have a clean `node_modules/` directory. This step
  87666. * is known to help in most cases.
  87667. * * If you use `yarn.lock` or `package-lock.json`, remove it before `npm install`.
  87668. * * Check whether all CKEditor 5 packages are up to date and reinstall them
  87669. * if you changed anything (`rm -rf node_modules && npm install`).
  87670. *
  87671. * If all packages are correct and compatible with each other, the steps above are known to help. If not, you may
  87672. * try to check with `npm ls` how many times packages like `@ckeditor/ckeditor5-core`, `@ckeditor/ckeditor5-engine` and
  87673. *`@ckeditor/ckeditor5-utils` are installed. If more than once, verify which package causes that.
  87674. *
  87675. * @error ckeditor-duplicated-modules
  87676. */
  87677. throw new _ckeditorerror__WEBPACK_IMPORTED_MODULE_0__["default"](
  87678. 'ckeditor-duplicated-modules',
  87679. null
  87680. );
  87681. } else {
  87682. windowOrGlobal.CKEDITOR_VERSION = version;
  87683. }
  87684. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  87685. /***/ }),
  87686. /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/highlightstack.js":
  87687. /*!***********************************************************************!*\
  87688. !*** ./node_modules/@ckeditor/ckeditor5-widget/src/highlightstack.js ***!
  87689. \***********************************************************************/
  87690. /*! exports provided: default */
  87691. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  87692. "use strict";
  87693. __webpack_require__.r(__webpack_exports__);
  87694. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return HighlightStack; });
  87695. /* harmony import */ var _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js");
  87696. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  87697. /**
  87698. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  87699. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  87700. */
  87701. /**
  87702. * @module widget/highlightstack
  87703. */
  87704. /**
  87705. * Class used to handle correct order of highlights on elements.
  87706. *
  87707. * When different highlights are applied to same element correct order should be preserved:
  87708. *
  87709. * * highlight with highest priority should be applied,
  87710. * * if two highlights have same priority - sort by CSS class provided in
  87711. * {@link module:engine/conversion/downcasthelpers~HighlightDescriptor}.
  87712. *
  87713. * This way, highlight will be applied with the same rules it is applied on texts.
  87714. */
  87715. class HighlightStack {
  87716. /**
  87717. * Creates class instance.
  87718. */
  87719. constructor() {
  87720. this._stack = [];
  87721. }
  87722. /**
  87723. * Adds highlight descriptor to the stack.
  87724. *
  87725. * @fires change:top
  87726. * @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} descriptor
  87727. * @param {module:engine/view/downcastwriter~DowncastWriter} writer
  87728. */
  87729. add( descriptor, writer ) {
  87730. const stack = this._stack;
  87731. // Save top descriptor and insert new one. If top is changed - fire event.
  87732. const oldTop = stack[ 0 ];
  87733. this._insertDescriptor( descriptor );
  87734. const newTop = stack[ 0 ];
  87735. // When new object is at the top and stores different information.
  87736. if ( oldTop !== newTop && !compareDescriptors( oldTop, newTop ) ) {
  87737. this.fire( 'change:top', {
  87738. oldDescriptor: oldTop,
  87739. newDescriptor: newTop,
  87740. writer
  87741. } );
  87742. }
  87743. }
  87744. /**
  87745. * Removes highlight descriptor from the stack.
  87746. *
  87747. * @fires change:top
  87748. * @param {String} id Id of the descriptor to remove.
  87749. * @param {module:engine/view/downcastwriter~DowncastWriter} writer
  87750. */
  87751. remove( id, writer ) {
  87752. const stack = this._stack;
  87753. const oldTop = stack[ 0 ];
  87754. this._removeDescriptor( id );
  87755. const newTop = stack[ 0 ];
  87756. // When new object is at the top and stores different information.
  87757. if ( oldTop !== newTop && !compareDescriptors( oldTop, newTop ) ) {
  87758. this.fire( 'change:top', {
  87759. oldDescriptor: oldTop,
  87760. newDescriptor: newTop,
  87761. writer
  87762. } );
  87763. }
  87764. }
  87765. /**
  87766. * Inserts given descriptor in correct place in the stack. It also takes care about updating information when
  87767. * descriptor with same id is already present.
  87768. *
  87769. * @private
  87770. * @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} descriptor
  87771. */
  87772. _insertDescriptor( descriptor ) {
  87773. const stack = this._stack;
  87774. const index = stack.findIndex( item => item.id === descriptor.id );
  87775. // Inserting exact same descriptor - do nothing.
  87776. if ( compareDescriptors( descriptor, stack[ index ] ) ) {
  87777. return;
  87778. }
  87779. // If descriptor with same id but with different information is on the stack - remove it.
  87780. if ( index > -1 ) {
  87781. stack.splice( index, 1 );
  87782. }
  87783. // Find correct place to insert descriptor in the stack.
  87784. // It have different information (for example priority) so it must be re-inserted in correct place.
  87785. let i = 0;
  87786. while ( stack[ i ] && shouldABeBeforeB( stack[ i ], descriptor ) ) {
  87787. i++;
  87788. }
  87789. stack.splice( i, 0, descriptor );
  87790. }
  87791. /**
  87792. * Removes descriptor with given id from the stack.
  87793. *
  87794. * @private
  87795. * @param {String} id Descriptor's id.
  87796. */
  87797. _removeDescriptor( id ) {
  87798. const stack = this._stack;
  87799. const index = stack.findIndex( item => item.id === id );
  87800. // If descriptor with same id is on the list - remove it.
  87801. if ( index > -1 ) {
  87802. stack.splice( index, 1 );
  87803. }
  87804. }
  87805. }
  87806. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_1__["default"])( HighlightStack, _ckeditor_ckeditor5_utils_src_emittermixin__WEBPACK_IMPORTED_MODULE_0__["default"] );
  87807. // Compares two descriptors by checking their priority and class list.
  87808. //
  87809. // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} a
  87810. // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} b
  87811. // @returns {Boolean} Returns true if both descriptors are defined and have same priority and classes.
  87812. function compareDescriptors( a, b ) {
  87813. return a && b && a.priority == b.priority && classesToString( a.classes ) == classesToString( b.classes );
  87814. }
  87815. // Checks whenever first descriptor should be placed in the stack before second one.
  87816. //
  87817. // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} a
  87818. // @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} b
  87819. // @returns {Boolean}
  87820. function shouldABeBeforeB( a, b ) {
  87821. if ( a.priority > b.priority ) {
  87822. return true;
  87823. } else if ( a.priority < b.priority ) {
  87824. return false;
  87825. }
  87826. // When priorities are equal and names are different - use classes to compare.
  87827. return classesToString( a.classes ) > classesToString( b.classes );
  87828. }
  87829. // Converts CSS classes passed with {@link module:engine/conversion/downcasthelpers~HighlightDescriptor} to
  87830. // sorted string.
  87831. //
  87832. // @param {String|Array<String>} descriptor
  87833. // @returns {String}
  87834. function classesToString( classes ) {
  87835. return Array.isArray( classes ) ? classes.sort().join( ',' ) : classes;
  87836. }
  87837. /**
  87838. * Fired when top element on {@link module:widget/highlightstack~HighlightStack} has been changed
  87839. *
  87840. * @event change:top
  87841. * @param {Object} data Additional information about the change.
  87842. * @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} [data.newDescriptor] New highlight
  87843. * descriptor. It will be `undefined` when last descriptor is removed from the stack.
  87844. * @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} [data.oldDescriptor] Old highlight
  87845. * descriptor. It will be `undefined` when first descriptor is added to the stack.
  87846. * @param {module:engine/view/downcastwriter~DowncastWriter} writer View writer that can be used to modify element.
  87847. */
  87848. /***/ }),
  87849. /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/utils.js":
  87850. /*!**************************************************************!*\
  87851. !*** ./node_modules/@ckeditor/ckeditor5-widget/src/utils.js ***!
  87852. \**************************************************************/
  87853. /*! exports provided: WIDGET_CLASS_NAME, WIDGET_SELECTED_CLASS_NAME, isWidget, toWidget, setHighlightHandling, setLabel, getLabel, toWidgetEditable, findOptimalInsertionPosition, viewToModelPositionOutsideModelElement, centeredBalloonPositionForLongWidgets */
  87854. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  87855. "use strict";
  87856. __webpack_require__.r(__webpack_exports__);
  87857. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WIDGET_CLASS_NAME", function() { return WIDGET_CLASS_NAME; });
  87858. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WIDGET_SELECTED_CLASS_NAME", function() { return WIDGET_SELECTED_CLASS_NAME; });
  87859. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isWidget", function() { return isWidget; });
  87860. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toWidget", function() { return toWidget; });
  87861. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setHighlightHandling", function() { return setHighlightHandling; });
  87862. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setLabel", function() { return setLabel; });
  87863. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLabel", function() { return getLabel; });
  87864. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toWidgetEditable", function() { return toWidgetEditable; });
  87865. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findOptimalInsertionPosition", function() { return findOptimalInsertionPosition; });
  87866. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "viewToModelPositionOutsideModelElement", function() { return viewToModelPositionOutsideModelElement; });
  87867. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "centeredBalloonPositionForLongWidgets", function() { return centeredBalloonPositionForLongWidgets; });
  87868. /* harmony import */ var _highlightstack__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./highlightstack */ "./node_modules/@ckeditor/ckeditor5-widget/src/highlightstack.js");
  87869. /* harmony import */ var _ckeditor_ckeditor5_ui_src_icon_iconview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/icon/iconview */ "./node_modules/@ckeditor/ckeditor5-ui/src/icon/iconview.js");
  87870. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
  87871. /* harmony import */ var _ckeditor_ckeditor5_ui_src_panel_balloon_balloonpanelview__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview.js");
  87872. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
  87873. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  87874. /* harmony import */ var _theme_icons_drag_handle_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../theme/icons/drag-handle.svg */ "./node_modules/@ckeditor/ckeditor5-widget/theme/icons/drag-handle.svg");
  87875. /* harmony import */ var _widgettypearound_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./widgettypearound/utils */ "./node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/utils.js");
  87876. /**
  87877. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  87878. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  87879. */
  87880. /**
  87881. * @module widget/utils
  87882. */
  87883. /**
  87884. * CSS class added to each widget element.
  87885. *
  87886. * @const {String}
  87887. */
  87888. const WIDGET_CLASS_NAME = 'ck-widget';
  87889. /**
  87890. * CSS class added to currently selected widget element.
  87891. *
  87892. * @const {String}
  87893. */
  87894. const WIDGET_SELECTED_CLASS_NAME = 'ck-widget_selected';
  87895. /**
  87896. * Returns `true` if given {@link module:engine/view/node~Node} is an {@link module:engine/view/element~Element} and a widget.
  87897. *
  87898. * @param {module:engine/view/node~Node} node
  87899. * @returns {Boolean}
  87900. */
  87901. function isWidget( node ) {
  87902. if ( !node.is( 'element' ) ) {
  87903. return false;
  87904. }
  87905. return !!node.getCustomProperty( 'widget' );
  87906. }
  87907. /**
  87908. * Converts the given {@link module:engine/view/element~Element} to a widget in the following way:
  87909. *
  87910. * * sets the `contenteditable` attribute to `"false"`,
  87911. * * adds the `ck-widget` CSS class,
  87912. * * adds a custom {@link module:engine/view/element~Element#getFillerOffset `getFillerOffset()`} method returning `null`,
  87913. * * adds a custom property allowing to recognize widget elements by using {@link ~isWidget `isWidget()`},
  87914. * * implements the {@link ~setHighlightHandling view highlight on widgets}.
  87915. *
  87916. * This function needs to be used in conjunction with
  87917. * {@link module:engine/conversion/downcasthelpers~DowncastHelpers downcast conversion helpers}
  87918. * like {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`}.
  87919. * Moreover, typically you will want to use `toWidget()` only for `editingDowncast`, while keeping the `dataDowncast` clean.
  87920. *
  87921. * For example, in order to convert a `<widget>` model element to `<div class="widget">` in the view, you can define
  87922. * such converters:
  87923. *
  87924. * editor.conversion.for( 'editingDowncast' )
  87925. * .elementToElement( {
  87926. * model: 'widget',
  87927. * view: ( modelItem, { writer } ) => {
  87928. * const div = writer.createContainerElement( 'div', { class: 'widget' } );
  87929. *
  87930. * return toWidget( div, writer, { label: 'some widget' } );
  87931. * }
  87932. * } );
  87933. *
  87934. * editor.conversion.for( 'dataDowncast' )
  87935. * .elementToElement( {
  87936. * model: 'widget',
  87937. * view: ( modelItem, { writer } ) => {
  87938. * return writer.createContainerElement( 'div', { class: 'widget' } );
  87939. * }
  87940. * } );
  87941. *
  87942. * See the full source code of the widget (with a nested editable) schema definition and converters in
  87943. * [this sample](https://github.com/ckeditor/ckeditor5-widget/blob/master/tests/manual/widget-with-nestededitable.js).
  87944. *
  87945. * @param {module:engine/view/element~Element} element
  87946. * @param {module:engine/view/downcastwriter~DowncastWriter} writer
  87947. * @param {Object} [options={}]
  87948. * @param {String|Function} [options.label] Element's label provided to the {@link ~setLabel} function. It can be passed as
  87949. * a plain string or a function returning a string. It represents the widget for assistive technologies (like screen readers).
  87950. * @param {Boolean} [options.hasSelectionHandle=false] If `true`, the widget will have a selection handle added.
  87951. * @returns {module:engine/view/element~Element} Returns the same element.
  87952. */
  87953. function toWidget( element, writer, options = {} ) {
  87954. if ( !element.is( 'containerElement' ) ) {
  87955. /**
  87956. * The element passed to `toWidget()` must be a {@link module:engine/view/containerelement~ContainerElement}
  87957. * instance.
  87958. *
  87959. * @error widget-to-widget-wrong-element-type
  87960. * @param {String} element The view element passed to `toWidget()`.
  87961. */
  87962. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"](
  87963. 'widget-to-widget-wrong-element-type',
  87964. null,
  87965. { element }
  87966. );
  87967. }
  87968. writer.setAttribute( 'contenteditable', 'false', element );
  87969. writer.addClass( WIDGET_CLASS_NAME, element );
  87970. writer.setCustomProperty( 'widget', true, element );
  87971. element.getFillerOffset = getFillerOffset;
  87972. if ( options.label ) {
  87973. setLabel( element, options.label, writer );
  87974. }
  87975. if ( options.hasSelectionHandle ) {
  87976. addSelectionHandle( element, writer );
  87977. }
  87978. setHighlightHandling(
  87979. element,
  87980. writer,
  87981. ( element, descriptor, writer ) => writer.addClass( normalizeToArray( descriptor.classes ), element ),
  87982. ( element, descriptor, writer ) => writer.removeClass( normalizeToArray( descriptor.classes ), element )
  87983. );
  87984. return element;
  87985. // Normalizes CSS class in descriptor that can be provided in form of an array or a string.
  87986. function normalizeToArray( classes ) {
  87987. return Array.isArray( classes ) ? classes : [ classes ];
  87988. }
  87989. }
  87990. /**
  87991. * Sets highlight handling methods. Uses {@link module:widget/highlightstack~HighlightStack} to
  87992. * properly determine which highlight descriptor should be used at given time.
  87993. *
  87994. * @param {module:engine/view/element~Element} element
  87995. * @param {module:engine/view/downcastwriter~DowncastWriter} writer
  87996. * @param {Function} add
  87997. * @param {Function} remove
  87998. */
  87999. function setHighlightHandling( element, writer, add, remove ) {
  88000. const stack = new _highlightstack__WEBPACK_IMPORTED_MODULE_0__["default"]();
  88001. stack.on( 'change:top', ( evt, data ) => {
  88002. if ( data.oldDescriptor ) {
  88003. remove( element, data.oldDescriptor, data.writer );
  88004. }
  88005. if ( data.newDescriptor ) {
  88006. add( element, data.newDescriptor, data.writer );
  88007. }
  88008. } );
  88009. writer.setCustomProperty( 'addHighlight', ( element, descriptor, writer ) => stack.add( descriptor, writer ), element );
  88010. writer.setCustomProperty( 'removeHighlight', ( element, id, writer ) => stack.remove( id, writer ), element );
  88011. }
  88012. /**
  88013. * Sets label for given element.
  88014. * It can be passed as a plain string or a function returning a string. Function will be called each time label is retrieved by
  88015. * {@link ~getLabel `getLabel()`}.
  88016. *
  88017. * @param {module:engine/view/element~Element} element
  88018. * @param {String|Function} labelOrCreator
  88019. * @param {module:engine/view/downcastwriter~DowncastWriter} writer
  88020. */
  88021. function setLabel( element, labelOrCreator, writer ) {
  88022. writer.setCustomProperty( 'widgetLabel', labelOrCreator, element );
  88023. }
  88024. /**
  88025. * Returns the label of the provided element.
  88026. *
  88027. * @param {module:engine/view/element~Element} element
  88028. * @returns {String}
  88029. */
  88030. function getLabel( element ) {
  88031. const labelCreator = element.getCustomProperty( 'widgetLabel' );
  88032. if ( !labelCreator ) {
  88033. return '';
  88034. }
  88035. return typeof labelCreator == 'function' ? labelCreator() : labelCreator;
  88036. }
  88037. /**
  88038. * Adds functionality to the provided {@link module:engine/view/editableelement~EditableElement} to act as a widget's editable:
  88039. *
  88040. * * sets the `contenteditable` attribute to `true` when {@link module:engine/view/editableelement~EditableElement#isReadOnly} is `false`,
  88041. * otherwise sets it to `false`,
  88042. * * adds the `ck-editor__editable` and `ck-editor__nested-editable` CSS classes,
  88043. * * adds the `ck-editor__nested-editable_focused` CSS class when the editable is focused and removes it when it is blurred.
  88044. *
  88045. * Similarly to {@link ~toWidget `toWidget()`} this function should be used in `editingDowncast` only and it is usually
  88046. * used together with {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`}.
  88047. *
  88048. * For example, in order to convert a `<nested>` model element to `<div class="nested">` in the view, you can define
  88049. * such converters:
  88050. *
  88051. * editor.conversion.for( 'editingDowncast' )
  88052. * .elementToElement( {
  88053. * model: 'nested',
  88054. * view: ( modelItem, { writer } ) => {
  88055. * const div = writer.createEditableElement( 'div', { class: 'nested' } );
  88056. *
  88057. * return toWidgetEditable( nested, writer );
  88058. * }
  88059. * } );
  88060. *
  88061. * editor.conversion.for( 'dataDowncast' )
  88062. * .elementToElement( {
  88063. * model: 'nested',
  88064. * view: ( modelItem, { writer } ) => {
  88065. * return writer.createContainerElement( 'div', { class: 'nested' } );
  88066. * }
  88067. * } );
  88068. *
  88069. * See the full source code of the widget (with nested editable) schema definition and converters in
  88070. * [this sample](https://github.com/ckeditor/ckeditor5-widget/blob/master/tests/manual/widget-with-nestededitable.js).
  88071. *
  88072. * @param {module:engine/view/editableelement~EditableElement} editable
  88073. * @param {module:engine/view/downcastwriter~DowncastWriter} writer
  88074. * @returns {module:engine/view/editableelement~EditableElement} Returns the same element that was provided in the `editable` parameter
  88075. */
  88076. function toWidgetEditable( editable, writer ) {
  88077. writer.addClass( [ 'ck-editor__editable', 'ck-editor__nested-editable' ], editable );
  88078. // Set initial contenteditable value.
  88079. writer.setAttribute( 'contenteditable', editable.isReadOnly ? 'false' : 'true', editable );
  88080. // Bind the contenteditable property to element#isReadOnly.
  88081. editable.on( 'change:isReadOnly', ( evt, property, is ) => {
  88082. writer.setAttribute( 'contenteditable', is ? 'false' : 'true', editable );
  88083. } );
  88084. editable.on( 'change:isFocused', ( evt, property, is ) => {
  88085. if ( is ) {
  88086. writer.addClass( 'ck-editor__nested-editable_focused', editable );
  88087. } else {
  88088. writer.removeClass( 'ck-editor__nested-editable_focused', editable );
  88089. }
  88090. } );
  88091. return editable;
  88092. }
  88093. /**
  88094. * Returns a model position which is optimal (in terms of UX) for inserting a widget block.
  88095. *
  88096. * For instance, if a selection is in the middle of a paragraph, the position before this paragraph
  88097. * will be returned so that it is not split. If the selection is at the end of a paragraph,
  88098. * the position after this paragraph will be returned.
  88099. *
  88100. * Note: If the selection is placed in an empty block, that block will be returned. If that position
  88101. * is then passed to {@link module:engine/model/model~Model#insertContent},
  88102. * the block will be fully replaced by the image.
  88103. *
  88104. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  88105. * The selection based on which the insertion position should be calculated.
  88106. * @param {module:engine/model/model~Model} model Model instance.
  88107. * @returns {module:engine/model/position~Position} The optimal position.
  88108. */
  88109. function findOptimalInsertionPosition( selection, model ) {
  88110. const selectedElement = selection.getSelectedElement();
  88111. if ( selectedElement ) {
  88112. const typeAroundFakeCaretPosition = Object(_widgettypearound_utils__WEBPACK_IMPORTED_MODULE_7__["getTypeAroundFakeCaretPosition"])( selection );
  88113. // If the WidgetTypeAround "fake caret" is displayed, use its position for the insertion
  88114. // to provide the most predictable UX (https://github.com/ckeditor/ckeditor5/issues/7438).
  88115. if ( typeAroundFakeCaretPosition ) {
  88116. return model.createPositionAt( selectedElement, typeAroundFakeCaretPosition );
  88117. }
  88118. if ( model.schema.isBlock( selectedElement ) ) {
  88119. return model.createPositionAfter( selectedElement );
  88120. }
  88121. }
  88122. const firstBlock = selection.getSelectedBlocks().next().value;
  88123. if ( firstBlock ) {
  88124. // If inserting into an empty block – return position in that block. It will get
  88125. // replaced with the image by insertContent(). #42.
  88126. if ( firstBlock.isEmpty ) {
  88127. return model.createPositionAt( firstBlock, 0 );
  88128. }
  88129. const positionAfter = model.createPositionAfter( firstBlock );
  88130. // If selection is at the end of the block - return position after the block.
  88131. if ( selection.focus.isTouching( positionAfter ) ) {
  88132. return positionAfter;
  88133. }
  88134. // Otherwise return position before the block.
  88135. return model.createPositionBefore( firstBlock );
  88136. }
  88137. return selection.focus;
  88138. }
  88139. /**
  88140. * A util to be used in order to map view positions to correct model positions when implementing a widget
  88141. * which renders non-empty view element for an empty model element.
  88142. *
  88143. * For example:
  88144. *
  88145. * // Model:
  88146. * <placeholder type="name"></placeholder>
  88147. *
  88148. * // View:
  88149. * <span class="placeholder">name</span>
  88150. *
  88151. * In such case, view positions inside `<span>` cannot be correct mapped to the model (because the model element is empty).
  88152. * To handle mapping positions inside `<span class="placeholder">` to the model use this util as follows:
  88153. *
  88154. * editor.editing.mapper.on(
  88155. * 'viewToModelPosition',
  88156. * viewToModelPositionOutsideModelElement( model, viewElement => viewElement.hasClass( 'placeholder' ) )
  88157. * );
  88158. *
  88159. * The callback will try to map the view offset of selection to an expected model position.
  88160. *
  88161. * 1. When the position is at the end (or in the middle) of the inline widget:
  88162. *
  88163. * // View:
  88164. * <p>foo <span class="placeholder">name|</span> bar</p>
  88165. *
  88166. * // Model:
  88167. * <paragraph>foo <placeholder type="name"></placeholder>| bar</paragraph>
  88168. *
  88169. * 2. When the position is at the beginning of the inline widget:
  88170. *
  88171. * // View:
  88172. * <p>foo <span class="placeholder">|name</span> bar</p>
  88173. *
  88174. * // Model:
  88175. * <paragraph>foo |<placeholder type="name"></placeholder> bar</paragraph>
  88176. *
  88177. * @param {module:engine/model/model~Model} model Model instance on which the callback operates.
  88178. * @param {Function} viewElementMatcher Function that is passed a view element and should return `true` if the custom mapping
  88179. * should be applied to the given view element.
  88180. * @return {Function}
  88181. */
  88182. function viewToModelPositionOutsideModelElement( model, viewElementMatcher ) {
  88183. return ( evt, data ) => {
  88184. const { mapper, viewPosition } = data;
  88185. const viewParent = mapper.findMappedViewAncestor( viewPosition );
  88186. if ( !viewElementMatcher( viewParent ) ) {
  88187. return;
  88188. }
  88189. const modelParent = mapper.toModelElement( viewParent );
  88190. data.modelPosition = model.createPositionAt( modelParent, viewPosition.isAtStart ? 'before' : 'after' );
  88191. };
  88192. }
  88193. /**
  88194. * A positioning function passed to the {@link module:utils/dom/position~getOptimalPosition} helper as a last resort
  88195. * when attaching {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView balloon UI} to widgets.
  88196. * It comes in handy when a widget is longer than the visual viewport of the web browser and/or upper/lower boundaries
  88197. * of a widget are off screen because of the web page scroll.
  88198. *
  88199. * ┌─┄┄┄┄┄┄┄┄┄Widget┄┄┄┄┄┄┄┄┄┐
  88200. * ┊ ┊
  88201. * ┌────────────Viewport───────────┐ ┌──╁─────────Viewport────────╁──┐
  88202. * │ ┏━━━━━━━━━━Widget━━━━━━━━━┓ │ │ ┃ ^ ┃ │
  88203. * │ ┃ ^ ┃ │ │ ┃ ╭───────/ \───────╮ ┃ │
  88204. * │ ┃ ╭───────/ \───────╮ ┃ │ │ ┃ │ Balloon │ ┃ │
  88205. * │ ┃ │ Balloon │ ┃ │ │ ┃ ╰─────────────────╯ ┃ │
  88206. * │ ┃ ╰─────────────────╯ ┃ │ │ ┃ ┃ │
  88207. * │ ┃ ┃ │ │ ┃ ┃ │
  88208. * │ ┃ ┃ │ │ ┃ ┃ │
  88209. * │ ┃ ┃ │ │ ┃ ┃ │
  88210. * │ ┃ ┃ │ │ ┃ ┃ │
  88211. * │ ┃ ┃ │ │ ┃ ┃ │
  88212. * │ ┃ ┃ │ │ ┃ ┃ │
  88213. * └──╀─────────────────────────╀──┘ └──╀─────────────────────────╀──┘
  88214. * ┊ ┊ ┊ ┊
  88215. * ┊ ┊ └┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┘
  88216. * ┊ ┊
  88217. * └┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┘
  88218. *
  88219. * **Note**: Works best if used together with
  88220. * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions default `BalloonPanelView` positions}
  88221. * like `northArrowSouth` and `southArrowNorth`; the transition between these two and this position is smooth.
  88222. *
  88223. * @param {module:utils/dom/rect~Rect} widgetRect A rect of the widget.
  88224. * @param {module:utils/dom/rect~Rect} balloonRect A rect of the balloon.
  88225. * @returns {module:utils/dom/position~Position|null}
  88226. */
  88227. function centeredBalloonPositionForLongWidgets( widgetRect, balloonRect ) {
  88228. const viewportRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_2__["default"]( _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_4__["default"].window );
  88229. const viewportWidgetInsersectionRect = viewportRect.getIntersection( widgetRect );
  88230. const balloonTotalHeight = balloonRect.height + _ckeditor_ckeditor5_ui_src_panel_balloon_balloonpanelview__WEBPACK_IMPORTED_MODULE_3__["default"].arrowVerticalOffset;
  88231. // If there is enough space above or below the widget then this position should not be used.
  88232. if ( widgetRect.top - balloonTotalHeight > viewportRect.top || widgetRect.bottom + balloonTotalHeight < viewportRect.bottom ) {
  88233. return null;
  88234. }
  88235. // Because this is a last resort positioning, to keep things simple we're not playing with positions of the arrow
  88236. // like, for instance, "south west" or whatever. Just try to keep the balloon in the middle of the visible area of
  88237. // the widget for as long as it is possible. If the widgets becomes invisible (because cropped by the viewport),
  88238. // just... place the balloon in the middle of it (because why not?).
  88239. const targetRect = viewportWidgetInsersectionRect || widgetRect;
  88240. const left = targetRect.left + targetRect.width / 2 - balloonRect.width / 2;
  88241. return {
  88242. top: Math.max( widgetRect.top, 0 ) + _ckeditor_ckeditor5_ui_src_panel_balloon_balloonpanelview__WEBPACK_IMPORTED_MODULE_3__["default"].arrowVerticalOffset,
  88243. left,
  88244. name: 'arrow_n'
  88245. };
  88246. }
  88247. // Default filler offset function applied to all widget elements.
  88248. //
  88249. // @returns {null}
  88250. function getFillerOffset() {
  88251. return null;
  88252. }
  88253. // Adds a drag handle to the widget.
  88254. //
  88255. // @param {module:engine/view/containerelement~ContainerElement}
  88256. // @param {module:engine/view/downcastwriter~DowncastWriter} writer
  88257. function addSelectionHandle( widgetElement, writer ) {
  88258. const selectionHandle = writer.createUIElement( 'div', { class: 'ck ck-widget__selection-handle' }, function( domDocument ) {
  88259. const domElement = this.toDomElement( domDocument );
  88260. // Use the IconView from the ui library.
  88261. const icon = new _ckeditor_ckeditor5_ui_src_icon_iconview__WEBPACK_IMPORTED_MODULE_1__["default"]();
  88262. icon.set( 'content', _theme_icons_drag_handle_svg__WEBPACK_IMPORTED_MODULE_6__["default"] );
  88263. // Render the icon view right away to append its #element to the selectionHandle DOM element.
  88264. icon.render();
  88265. domElement.appendChild( icon.element );
  88266. return domElement;
  88267. } );
  88268. // Append the selection handle into the widget wrapper.
  88269. writer.insert( writer.createPositionAt( widgetElement, 0 ), selectionHandle );
  88270. writer.addClass( [ 'ck-widget_with-selection-handle' ], widgetElement );
  88271. }
  88272. /***/ }),
  88273. /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/verticalnavigation.js":
  88274. /*!***************************************************************************!*\
  88275. !*** ./node_modules/@ckeditor/ckeditor5-widget/src/verticalnavigation.js ***!
  88276. \***************************************************************************/
  88277. /*! exports provided: default */
  88278. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88279. "use strict";
  88280. __webpack_require__.r(__webpack_exports__);
  88281. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return verticalNavigationHandler; });
  88282. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
  88283. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
  88284. /**
  88285. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  88286. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  88287. */
  88288. /**
  88289. * @module widget/verticalnavigationhandler
  88290. */
  88291. /**
  88292. * Returns 'keydown' handler for up/down arrow keys that modifies the caret movement if it's in a text line next to an object.
  88293. *
  88294. * @param {module:engine/controller/editingcontroller~EditingController} editing The editing controller.
  88295. * @returns {Function}
  88296. */
  88297. function verticalNavigationHandler( editing ) {
  88298. const model = editing.model;
  88299. return ( evt, data ) => {
  88300. const arrowUpPressed = data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__["keyCodes"].arrowup;
  88301. const arrowDownPressed = data.keyCode == _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_0__["keyCodes"].arrowdown;
  88302. const expandSelection = data.shiftKey;
  88303. const selection = model.document.selection;
  88304. if ( !arrowUpPressed && !arrowDownPressed ) {
  88305. return;
  88306. }
  88307. const isForward = arrowDownPressed;
  88308. // Navigation is in the opposite direction than the selection direction so this is shrinking of the selection.
  88309. // Selection for sure will not approach any object.
  88310. if ( expandSelection && selectionWillShrink( selection, isForward ) ) {
  88311. return;
  88312. }
  88313. // Find a range between selection and closest limit element.
  88314. const range = findTextRangeFromSelection( editing, selection, isForward );
  88315. if ( !range || range.isCollapsed ) {
  88316. return;
  88317. }
  88318. // If the range is a single line (there is no word wrapping) then move the selection to the position closest to the limit element.
  88319. //
  88320. // We can't move the selection directly to the isObject element (eg. table cell) because of dual position at the end/beginning
  88321. // of wrapped line (it's at the same time at the end of one line and at the start of the next line).
  88322. if ( isSingleLineRange( editing, range, isForward ) ) {
  88323. model.change( writer => {
  88324. const newPosition = isForward ? range.end : range.start;
  88325. if ( expandSelection ) {
  88326. const newSelection = model.createSelection( selection.anchor );
  88327. newSelection.setFocus( newPosition );
  88328. writer.setSelection( newSelection );
  88329. } else {
  88330. writer.setSelection( newPosition );
  88331. }
  88332. } );
  88333. evt.stop();
  88334. data.preventDefault();
  88335. data.stopPropagation();
  88336. }
  88337. };
  88338. }
  88339. // Finds the range between selection and closest limit element (in the direction of navigation).
  88340. // The position next to limit element is adjusted to the closest allowed `$text` position.
  88341. //
  88342. // Returns `null` if, according to the schema, the resulting range cannot contain a `$text` element.
  88343. //
  88344. // @param {module:engine/controller/editingcontroller~EditingController} editing The editing controller.
  88345. // @param {module:engine/model/selection~Selection} selection The current selection.
  88346. // @param {Boolean} isForward The expected navigation direction.
  88347. // @returns {module:engine/model/range~Range|null}
  88348. //
  88349. function findTextRangeFromSelection( editing, selection, isForward ) {
  88350. const model = editing.model;
  88351. if ( isForward ) {
  88352. const startPosition = selection.isCollapsed ? selection.focus : selection.getLastPosition();
  88353. const endPosition = getNearestNonInlineLimit( model, startPosition, 'forward' );
  88354. // There is no limit element, browser should handle this.
  88355. if ( !endPosition ) {
  88356. return null;
  88357. }
  88358. const range = model.createRange( startPosition, endPosition );
  88359. const lastRangePosition = getNearestTextPosition( model.schema, range, 'backward' );
  88360. if ( lastRangePosition && startPosition.isBefore( lastRangePosition ) ) {
  88361. return model.createRange( startPosition, lastRangePosition );
  88362. }
  88363. return null;
  88364. } else {
  88365. const endPosition = selection.isCollapsed ? selection.focus : selection.getFirstPosition();
  88366. const startPosition = getNearestNonInlineLimit( model, endPosition, 'backward' );
  88367. // There is no limit element, browser should handle this.
  88368. if ( !startPosition ) {
  88369. return null;
  88370. }
  88371. const range = model.createRange( startPosition, endPosition );
  88372. const firstRangePosition = getNearestTextPosition( model.schema, range, 'forward' );
  88373. if ( firstRangePosition && endPosition.isAfter( firstRangePosition ) ) {
  88374. return model.createRange( firstRangePosition, endPosition );
  88375. }
  88376. return null;
  88377. }
  88378. }
  88379. // Finds the limit element position that is closest to startPosition.
  88380. //
  88381. // @param {module:engine/model/model~Model} model
  88382. // @param {<module:engine/model/position~Position>} startPosition
  88383. // @param {'forward'|'backward'} direction Search direction.
  88384. // @returns {<module:engine/model/position~Position>|null}
  88385. //
  88386. function getNearestNonInlineLimit( model, startPosition, direction ) {
  88387. const schema = model.schema;
  88388. const range = model.createRangeIn( startPosition.root );
  88389. const walkerValueType = direction == 'forward' ? 'elementStart' : 'elementEnd';
  88390. for ( const { previousPosition, item, type } of range.getWalker( { startPosition, direction } ) ) {
  88391. if ( schema.isLimit( item ) && !schema.isInline( item ) ) {
  88392. return previousPosition;
  88393. }
  88394. // Stop looking for isLimit element if the next element is a block element (it is for sure not single line).
  88395. if ( type == walkerValueType && schema.isBlock( item ) ) {
  88396. return null;
  88397. }
  88398. }
  88399. return null;
  88400. }
  88401. // Basing on the provided range, finds the first or last (depending on `direction`) position inside the range
  88402. // that can contain `$text` (according to schema).
  88403. //
  88404. // @param {module:engine/model/schema~Schema} schema The schema.
  88405. // @param {module:engine/model/range~Range} range The range to find the position in.
  88406. // @param {'forward'|'backward'} direction Search direction.
  88407. // @returns {module:engine/model/position~Position} The nearest selection range.
  88408. //
  88409. function getNearestTextPosition( schema, range, direction ) {
  88410. const position = direction == 'backward' ? range.end : range.start;
  88411. if ( schema.checkChild( position, '$text' ) ) {
  88412. return position;
  88413. }
  88414. for ( const { nextPosition } of range.getWalker( { direction } ) ) {
  88415. if ( schema.checkChild( nextPosition, '$text' ) ) {
  88416. return nextPosition;
  88417. }
  88418. }
  88419. }
  88420. // Checks if the DOM range corresponding to the provided model range renders as a single line by analyzing DOMRects
  88421. // (verifying if they visually wrap content to the next line).
  88422. //
  88423. // @param {module:engine/controller/editingcontroller~EditingController} editing The editing controller.
  88424. // @param {module:engine/model/range~Range} modelRange The current table cell content range.
  88425. // @param {Boolean} isForward The expected navigation direction.
  88426. // @returns {Boolean}
  88427. //
  88428. function isSingleLineRange( editing, modelRange, isForward ) {
  88429. const model = editing.model;
  88430. const domConverter = editing.view.domConverter;
  88431. // Wrapped lines contain exactly the same position at the end of current line
  88432. // and at the beginning of next line. That position's client rect is at the end
  88433. // of current line. In case of caret at first position of the last line that 'dual'
  88434. // position would be detected as it's not the last line.
  88435. if ( isForward ) {
  88436. const probe = model.createSelection( modelRange.start );
  88437. model.modifySelection( probe );
  88438. // If the new position is at the end of the container then we can't use this position
  88439. // because it would provide incorrect result for eg caption of image and selection
  88440. // just before end of it. Also in this case there is no "dual" position.
  88441. if ( !probe.focus.isAtEnd && !modelRange.start.isEqual( probe.focus ) ) {
  88442. modelRange = model.createRange( probe.focus, modelRange.end );
  88443. }
  88444. }
  88445. const viewRange = editing.mapper.toViewRange( modelRange );
  88446. const domRange = domConverter.viewRangeToDom( viewRange );
  88447. const rects = _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_1__["default"].getDomRangeRects( domRange );
  88448. let boundaryVerticalPosition;
  88449. for ( const rect of rects ) {
  88450. if ( boundaryVerticalPosition === undefined ) {
  88451. boundaryVerticalPosition = Math.round( rect.bottom );
  88452. continue;
  88453. }
  88454. // Let's check if this rect is in new line.
  88455. if ( Math.round( rect.top ) >= boundaryVerticalPosition ) {
  88456. return false;
  88457. }
  88458. boundaryVerticalPosition = Math.max( boundaryVerticalPosition, Math.round( rect.bottom ) );
  88459. }
  88460. return true;
  88461. }
  88462. function selectionWillShrink( selection, isForward ) {
  88463. return !selection.isCollapsed && selection.isBackward == isForward;
  88464. }
  88465. /***/ }),
  88466. /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/widget.js":
  88467. /*!***************************************************************!*\
  88468. !*** ./node_modules/@ckeditor/ckeditor5-widget/src/widget.js ***!
  88469. \***************************************************************/
  88470. /*! exports provided: default */
  88471. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88472. "use strict";
  88473. __webpack_require__.r(__webpack_exports__);
  88474. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Widget; });
  88475. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  88476. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_observer_mouseobserver__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/observer/mouseobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mouseobserver.js");
  88477. /* harmony import */ var _widgettypearound_widgettypearound__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./widgettypearound/widgettypearound */ "./node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/widgettypearound.js");
  88478. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-widget/src/utils.js");
  88479. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
  88480. /* harmony import */ var _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/env */ "./node_modules/@ckeditor/ckeditor5-utils/src/env.js");
  88481. /* harmony import */ var _theme_widget_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../theme/widget.css */ "./node_modules/@ckeditor/ckeditor5-widget/theme/widget.css");
  88482. /* harmony import */ var _theme_widget_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_theme_widget_css__WEBPACK_IMPORTED_MODULE_6__);
  88483. /* harmony import */ var _ckeditor_ckeditor5_utils_src_priorities__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/priorities */ "./node_modules/@ckeditor/ckeditor5-utils/src/priorities.js");
  88484. /* harmony import */ var _verticalnavigation__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./verticalnavigation */ "./node_modules/@ckeditor/ckeditor5-widget/src/verticalnavigation.js");
  88485. /**
  88486. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  88487. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  88488. */
  88489. /**
  88490. * @module widget/widget
  88491. */
  88492. /**
  88493. * The widget plugin. It enables base support for widgets.
  88494. *
  88495. * See {@glink api/widget package page} for more details and documentation.
  88496. *
  88497. * This plugin enables multiple behaviors required by widgets:
  88498. *
  88499. * * The model to view selection converter for the editing pipeline (it handles widget custom selection rendering).
  88500. * If a converted selection wraps around a widget element, that selection is marked as
  88501. * {@link module:engine/view/selection~Selection#isFake fake}. Additionally, the `ck-widget_selected` CSS class
  88502. * is added to indicate that widget has been selected.
  88503. * * The mouse and keyboard events handling on and around widget elements.
  88504. *
  88505. * @extends module:core/plugin~Plugin
  88506. */
  88507. class Widget extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  88508. /**
  88509. * @inheritDoc
  88510. */
  88511. static get pluginName() {
  88512. return 'Widget';
  88513. }
  88514. /**
  88515. * @inheritDoc
  88516. */
  88517. static get requires() {
  88518. return [ _widgettypearound_widgettypearound__WEBPACK_IMPORTED_MODULE_2__["default"] ];
  88519. }
  88520. /**
  88521. * @inheritDoc
  88522. */
  88523. init() {
  88524. const view = this.editor.editing.view;
  88525. const viewDocument = view.document;
  88526. /**
  88527. * Holds previously selected widgets.
  88528. *
  88529. * @private
  88530. * @type {Set.<module:engine/view/element~Element>}
  88531. */
  88532. this._previouslySelected = new Set();
  88533. // Model to view selection converter.
  88534. // Converts selection placed over widget element to fake selection
  88535. this.editor.editing.downcastDispatcher.on( 'selection', ( evt, data, conversionApi ) => {
  88536. // Remove selected class from previously selected widgets.
  88537. this._clearPreviouslySelectedWidgets( conversionApi.writer );
  88538. const viewWriter = conversionApi.writer;
  88539. const viewSelection = viewWriter.document.selection;
  88540. const selectedElement = viewSelection.getSelectedElement();
  88541. let lastMarked = null;
  88542. for ( const range of viewSelection.getRanges() ) {
  88543. for ( const value of range ) {
  88544. const node = value.item;
  88545. // Do not mark nested widgets in selected one. See: #57.
  88546. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_3__["isWidget"])( node ) && !isChild( node, lastMarked ) ) {
  88547. viewWriter.addClass( _utils__WEBPACK_IMPORTED_MODULE_3__["WIDGET_SELECTED_CLASS_NAME"], node );
  88548. this._previouslySelected.add( node );
  88549. lastMarked = node;
  88550. // Check if widget is a single element selected.
  88551. if ( node == selectedElement ) {
  88552. viewWriter.setSelection( viewSelection.getRanges(), { fake: true, label: Object(_utils__WEBPACK_IMPORTED_MODULE_3__["getLabel"])( selectedElement ) } );
  88553. }
  88554. }
  88555. }
  88556. }
  88557. }, { priority: 'low' } );
  88558. // If mouse down is pressed on widget - create selection over whole widget.
  88559. view.addObserver( _ckeditor_ckeditor5_engine_src_view_observer_mouseobserver__WEBPACK_IMPORTED_MODULE_1__["default"] );
  88560. this.listenTo( viewDocument, 'mousedown', ( ...args ) => this._onMousedown( ...args ) );
  88561. // There are two keydown listeners working on different priorities. This allows other
  88562. // features such as WidgetTypeAround or TableKeyboard to attach their listeners in between
  88563. // and customize the behavior even further in different content/selection scenarios.
  88564. //
  88565. // * The first listener handles changing the selection on arrow key press
  88566. // if the widget is selected or if the selection is next to a widget and the widget
  88567. // should become selected upon the arrow key press.
  88568. //
  88569. // * The second (late) listener makes sure the default browser action on arrow key press is
  88570. // prevented when a widget is selected. This prevents the selection from being moved
  88571. // from a fake selection container.
  88572. this.listenTo( viewDocument, 'keydown', ( ...args ) => {
  88573. this._handleSelectionChangeOnArrowKeyPress( ...args );
  88574. }, { priority: 'high' } );
  88575. this.listenTo( viewDocument, 'keydown', ( ...args ) => {
  88576. this._preventDefaultOnArrowKeyPress( ...args );
  88577. }, { priority: _ckeditor_ckeditor5_utils_src_priorities__WEBPACK_IMPORTED_MODULE_7__["default"].get( 'high' ) - 20 } );
  88578. this.listenTo( viewDocument, 'keydown', Object(_verticalnavigation__WEBPACK_IMPORTED_MODULE_8__["default"])( this.editor.editing ) );
  88579. // Handle custom delete behaviour.
  88580. this.listenTo( viewDocument, 'delete', ( evt, data ) => {
  88581. if ( this._handleDelete( data.direction == 'forward' ) ) {
  88582. data.preventDefault();
  88583. evt.stop();
  88584. }
  88585. }, { priority: 'high' } );
  88586. }
  88587. /**
  88588. * Handles {@link module:engine/view/document~Document#event:mousedown mousedown} events on widget elements.
  88589. *
  88590. * @private
  88591. * @param {module:utils/eventinfo~EventInfo} eventInfo
  88592. * @param {module:engine/view/observer/domeventdata~DomEventData} domEventData
  88593. */
  88594. _onMousedown( eventInfo, domEventData ) {
  88595. const editor = this.editor;
  88596. const view = editor.editing.view;
  88597. const viewDocument = view.document;
  88598. let element = domEventData.target;
  88599. // Do nothing for single or double click inside nested editable.
  88600. if ( isInsideNestedEditable( element ) ) {
  88601. // But at least triple click inside nested editable causes broken selection in Safari.
  88602. // For such event, we select the entire nested editable element.
  88603. // See: https://github.com/ckeditor/ckeditor5/issues/1463.
  88604. if ( ( _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_5__["default"].isSafari || _ckeditor_ckeditor5_utils_src_env__WEBPACK_IMPORTED_MODULE_5__["default"].isGecko ) && domEventData.domEvent.detail >= 3 ) {
  88605. const mapper = editor.editing.mapper;
  88606. const viewElement = element.is( 'attributeElement' ) ?
  88607. element.findAncestor( element => !element.is( 'attributeElement' ) ) : element;
  88608. const modelElement = mapper.toModelElement( viewElement );
  88609. domEventData.preventDefault();
  88610. this.editor.model.change( writer => {
  88611. writer.setSelection( modelElement, 'in' );
  88612. } );
  88613. }
  88614. return;
  88615. }
  88616. // If target is not a widget element - check if one of the ancestors is.
  88617. if ( !Object(_utils__WEBPACK_IMPORTED_MODULE_3__["isWidget"])( element ) ) {
  88618. element = element.findAncestor( _utils__WEBPACK_IMPORTED_MODULE_3__["isWidget"] );
  88619. if ( !element ) {
  88620. return;
  88621. }
  88622. }
  88623. domEventData.preventDefault();
  88624. // Focus editor if is not focused already.
  88625. if ( !viewDocument.isFocused ) {
  88626. view.focus();
  88627. }
  88628. // Create model selection over widget.
  88629. const modelElement = editor.editing.mapper.toModelElement( element );
  88630. this._setSelectionOverElement( modelElement );
  88631. }
  88632. /**
  88633. * Handles {@link module:engine/view/document~Document#event:keydown keydown} events and changes
  88634. * the model selection when:
  88635. *
  88636. * * arrow key is pressed when the widget is selected,
  88637. * * the selection is next to a widget and the widget should become selected upon the arrow key press.
  88638. *
  88639. * See {@link #_preventDefaultOnArrowKeyPress}.
  88640. *
  88641. * @private
  88642. * @param {module:utils/eventinfo~EventInfo} eventInfo
  88643. * @param {module:engine/view/observer/domeventdata~DomEventData} domEventData
  88644. */
  88645. _handleSelectionChangeOnArrowKeyPress( eventInfo, domEventData ) {
  88646. const keyCode = domEventData.keyCode;
  88647. // Checks if the keys were handled and then prevents the default event behaviour and stops
  88648. // the propagation.
  88649. if ( !Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_4__["isArrowKeyCode"])( keyCode ) ) {
  88650. return;
  88651. }
  88652. const model = this.editor.model;
  88653. const schema = model.schema;
  88654. const modelSelection = model.document.selection;
  88655. const objectElement = modelSelection.getSelectedElement();
  88656. const isForward = Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_4__["isForwardArrowKeyCode"])( keyCode, this.editor.locale.contentLanguageDirection );
  88657. // If object element is selected.
  88658. if ( objectElement && schema.isObject( objectElement ) ) {
  88659. const position = isForward ? modelSelection.getLastPosition() : modelSelection.getFirstPosition();
  88660. const newRange = schema.getNearestSelectionRange( position, isForward ? 'forward' : 'backward' );
  88661. if ( newRange ) {
  88662. model.change( writer => {
  88663. writer.setSelection( newRange );
  88664. } );
  88665. domEventData.preventDefault();
  88666. eventInfo.stop();
  88667. }
  88668. return;
  88669. }
  88670. // If selection is next to object element.
  88671. // Return if not collapsed.
  88672. if ( !modelSelection.isCollapsed ) {
  88673. return;
  88674. }
  88675. const objectElementNextToSelection = this._getObjectElementNextToSelection( isForward );
  88676. if ( objectElementNextToSelection && schema.isObject( objectElementNextToSelection ) ) {
  88677. this._setSelectionOverElement( objectElementNextToSelection );
  88678. domEventData.preventDefault();
  88679. eventInfo.stop();
  88680. }
  88681. }
  88682. /**
  88683. * Handles {@link module:engine/view/document~Document#event:keydown keydown} events and prevents
  88684. * the default browser behavior to make sure the fake selection is not being moved from a fake selection
  88685. * container.
  88686. *
  88687. * See {@link #_handleSelectionChangeOnArrowKeyPress}.
  88688. *
  88689. * @private
  88690. * @param {module:utils/eventinfo~EventInfo} eventInfo
  88691. * @param {module:engine/view/observer/domeventdata~DomEventData} domEventData
  88692. */
  88693. _preventDefaultOnArrowKeyPress( eventInfo, domEventData ) {
  88694. const keyCode = domEventData.keyCode;
  88695. // Checks if the keys were handled and then prevents the default event behaviour and stops
  88696. // the propagation.
  88697. if ( !Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_4__["isArrowKeyCode"])( keyCode ) ) {
  88698. return;
  88699. }
  88700. const model = this.editor.model;
  88701. const schema = model.schema;
  88702. const objectElement = model.document.selection.getSelectedElement();
  88703. // If object element is selected.
  88704. if ( objectElement && schema.isObject( objectElement ) ) {
  88705. domEventData.preventDefault();
  88706. eventInfo.stop();
  88707. }
  88708. }
  88709. /**
  88710. * Handles delete keys: backspace and delete.
  88711. *
  88712. * @private
  88713. * @param {Boolean} isForward Set to true if delete was performed in forward direction.
  88714. * @returns {Boolean|undefined} Returns `true` if keys were handled correctly.
  88715. */
  88716. _handleDelete( isForward ) {
  88717. // Do nothing when the read only mode is enabled.
  88718. if ( this.editor.isReadOnly ) {
  88719. return;
  88720. }
  88721. const modelDocument = this.editor.model.document;
  88722. const modelSelection = modelDocument.selection;
  88723. // Do nothing on non-collapsed selection.
  88724. if ( !modelSelection.isCollapsed ) {
  88725. return;
  88726. }
  88727. const objectElement = this._getObjectElementNextToSelection( isForward );
  88728. if ( objectElement ) {
  88729. this.editor.model.change( writer => {
  88730. let previousNode = modelSelection.anchor.parent;
  88731. // Remove previous element if empty.
  88732. while ( previousNode.isEmpty ) {
  88733. const nodeToRemove = previousNode;
  88734. previousNode = nodeToRemove.parent;
  88735. writer.remove( nodeToRemove );
  88736. }
  88737. this._setSelectionOverElement( objectElement );
  88738. } );
  88739. return true;
  88740. }
  88741. }
  88742. /**
  88743. * Sets {@link module:engine/model/selection~Selection document's selection} over given element.
  88744. *
  88745. * @protected
  88746. * @param {module:engine/model/element~Element} element
  88747. */
  88748. _setSelectionOverElement( element ) {
  88749. this.editor.model.change( writer => {
  88750. writer.setSelection( writer.createRangeOn( element ) );
  88751. } );
  88752. }
  88753. /**
  88754. * Checks if {@link module:engine/model/element~Element element} placed next to the current
  88755. * {@link module:engine/model/selection~Selection model selection} exists and is marked in
  88756. * {@link module:engine/model/schema~Schema schema} as `object`.
  88757. *
  88758. * @protected
  88759. * @param {Boolean} forward Direction of checking.
  88760. * @returns {module:engine/model/element~Element|null}
  88761. */
  88762. _getObjectElementNextToSelection( forward ) {
  88763. const model = this.editor.model;
  88764. const schema = model.schema;
  88765. const modelSelection = model.document.selection;
  88766. // Clone current selection to use it as a probe. We must leave default selection as it is so it can return
  88767. // to its current state after undo.
  88768. const probe = model.createSelection( modelSelection );
  88769. model.modifySelection( probe, { direction: forward ? 'forward' : 'backward' } );
  88770. const objectElement = forward ? probe.focus.nodeBefore : probe.focus.nodeAfter;
  88771. if ( !!objectElement && schema.isObject( objectElement ) ) {
  88772. return objectElement;
  88773. }
  88774. return null;
  88775. }
  88776. /**
  88777. * Removes CSS class from previously selected widgets.
  88778. *
  88779. * @private
  88780. * @param {module:engine/view/downcastwriter~DowncastWriter} writer
  88781. */
  88782. _clearPreviouslySelectedWidgets( writer ) {
  88783. for ( const widget of this._previouslySelected ) {
  88784. writer.removeClass( _utils__WEBPACK_IMPORTED_MODULE_3__["WIDGET_SELECTED_CLASS_NAME"], widget );
  88785. }
  88786. this._previouslySelected.clear();
  88787. }
  88788. }
  88789. // Returns `true` when element is a nested editable or is placed inside one.
  88790. //
  88791. // @param {module:engine/view/element~Element}
  88792. // @returns {Boolean}
  88793. function isInsideNestedEditable( element ) {
  88794. while ( element ) {
  88795. if ( element.is( 'editableElement' ) && !element.is( 'rootElement' ) ) {
  88796. return true;
  88797. }
  88798. // Click on nested widget should select it.
  88799. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_3__["isWidget"])( element ) ) {
  88800. return false;
  88801. }
  88802. element = element.parent;
  88803. }
  88804. return false;
  88805. }
  88806. // Checks whether the specified `element` is a child of the `parent` element.
  88807. //
  88808. // @param {module:engine/view/element~Element} element An element to check.
  88809. // @param {module:engine/view/element~Element|null} parent A parent for the element.
  88810. // @returns {Boolean}
  88811. function isChild( element, parent ) {
  88812. if ( !parent ) {
  88813. return false;
  88814. }
  88815. return Array.from( element.getAncestors() ).includes( parent );
  88816. }
  88817. /***/ }),
  88818. /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize.js":
  88819. /*!*********************************************************************!*\
  88820. !*** ./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize.js ***!
  88821. \*********************************************************************/
  88822. /*! exports provided: default */
  88823. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  88824. "use strict";
  88825. __webpack_require__.r(__webpack_exports__);
  88826. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return WidgetResize; });
  88827. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  88828. /* harmony import */ var _widgetresize_resizer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./widgetresize/resizer */ "./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/resizer.js");
  88829. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_emittermixin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/emittermixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js");
  88830. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/global */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js");
  88831. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  88832. /* harmony import */ var _ckeditor_ckeditor5_engine_src_view_observer_mouseobserver__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine/src/view/observer/mouseobserver */ "./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mouseobserver.js");
  88833. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  88834. /* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash-es */ "./node_modules/lodash-es/lodash.js");
  88835. /* harmony import */ var _theme_widgetresize_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../theme/widgetresize.css */ "./node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css");
  88836. /* harmony import */ var _theme_widgetresize_css__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_theme_widgetresize_css__WEBPACK_IMPORTED_MODULE_8__);
  88837. /**
  88838. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  88839. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  88840. */
  88841. /**
  88842. * @module widget/widgetresize
  88843. */
  88844. /**
  88845. * The widget resize feature plugin.
  88846. *
  88847. * Use the {@link module:widget/widgetresize~WidgetResize#attachTo} method to create a resizer for the specified widget.
  88848. *
  88849. * @extends module:core/plugin~Plugin
  88850. * @mixes module:utils/observablemixin~ObservableMixin
  88851. */
  88852. class WidgetResize extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  88853. /**
  88854. * @inheritDoc
  88855. */
  88856. static get pluginName() {
  88857. return 'WidgetResize';
  88858. }
  88859. /**
  88860. * @inheritDoc
  88861. */
  88862. init() {
  88863. /**
  88864. * The currently visible resizer.
  88865. *
  88866. * @protected
  88867. * @observable
  88868. * @member {module:widget/widgetresize/resizer~Resizer|null} #_visibleResizer
  88869. */
  88870. this.set( '_visibleResizer', null );
  88871. /**
  88872. * References an active resizer.
  88873. *
  88874. * Active resizer means a resizer which handle is actively used by the end user.
  88875. *
  88876. * @protected
  88877. * @observable
  88878. * @member {module:widget/widgetresize/resizer~Resizer|null} #_activeResizer
  88879. */
  88880. this.set( '_activeResizer', null );
  88881. /**
  88882. * A map of resizers created using this plugin instance.
  88883. *
  88884. * @private
  88885. * @type {Map.<module:engine/view/containerelement~ContainerElement, module:widget/widgetresize/resizer~Resizer>}
  88886. */
  88887. this._resizers = new Map();
  88888. const domDocument = _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_3__["default"].window.document;
  88889. this.editor.model.schema.setAttributeProperties( 'width', {
  88890. isFormatting: true
  88891. } );
  88892. this.editor.editing.view.addObserver( _ckeditor_ckeditor5_engine_src_view_observer_mouseobserver__WEBPACK_IMPORTED_MODULE_5__["default"] );
  88893. this._observer = Object.create( _ckeditor_ckeditor5_utils_src_dom_emittermixin__WEBPACK_IMPORTED_MODULE_2__["default"] );
  88894. this.listenTo( this.editor.editing.view.document, 'mousedown', this._mouseDownListener.bind( this ), { priority: 'high' } );
  88895. this._observer.listenTo( domDocument, 'mousemove', this._mouseMoveListener.bind( this ) );
  88896. this._observer.listenTo( domDocument, 'mouseup', this._mouseUpListener.bind( this ) );
  88897. const redrawFocusedResizer = () => {
  88898. if ( this._visibleResizer ) {
  88899. this._visibleResizer.redraw();
  88900. }
  88901. };
  88902. const redrawFocusedResizerThrottled = Object(lodash_es__WEBPACK_IMPORTED_MODULE_7__["throttle"])( redrawFocusedResizer, 200 );
  88903. // Redraws occurring upon a change of visible resizer must not be throttled, as it is crucial for the initial
  88904. // render. Without it the resizer frame would be misaligned with resizing host for a fraction of second.
  88905. this.on( 'change:_visibleResizer', redrawFocusedResizer );
  88906. // Redrawing on any change of the UI of the editor (including content changes).
  88907. this.editor.ui.on( 'update', redrawFocusedResizerThrottled );
  88908. // Resizers need to be redrawn upon window resize, because new window might shrink resize host.
  88909. this._observer.listenTo( _ckeditor_ckeditor5_utils_src_dom_global__WEBPACK_IMPORTED_MODULE_3__["default"].window, 'resize', redrawFocusedResizerThrottled );
  88910. const viewSelection = this.editor.editing.view.document.selection;
  88911. viewSelection.on( 'change', () => {
  88912. const selectedElement = viewSelection.getSelectedElement();
  88913. this._visibleResizer = this._getResizerByViewElement( selectedElement ) || null;
  88914. } );
  88915. }
  88916. /**
  88917. * @inheritDoc
  88918. */
  88919. destroy() {
  88920. this._observer.stopListening();
  88921. for ( const resizer of this._resizers.values() ) {
  88922. resizer.destroy();
  88923. }
  88924. }
  88925. /**
  88926. * @param {module:widget/widgetresize~ResizerOptions} [options] Resizer options.
  88927. * @returns {module:widget/widgetresize/resizer~Resizer}
  88928. */
  88929. attachTo( options ) {
  88930. const resizer = new _widgetresize_resizer__WEBPACK_IMPORTED_MODULE_1__["default"]( options );
  88931. const plugins = this.editor.plugins;
  88932. resizer.attach();
  88933. if ( plugins.has( 'WidgetToolbarRepository' ) ) {
  88934. // Hiding widget toolbar to improve the performance
  88935. // (https://github.com/ckeditor/ckeditor5-widget/pull/112#issuecomment-564528765).
  88936. const widgetToolbarRepository = plugins.get( 'WidgetToolbarRepository' );
  88937. resizer.on( 'begin', () => {
  88938. widgetToolbarRepository.forceDisabled( 'resize' );
  88939. }, { priority: 'lowest' } );
  88940. resizer.on( 'cancel', () => {
  88941. widgetToolbarRepository.clearForceDisabled( 'resize' );
  88942. }, { priority: 'highest' } );
  88943. resizer.on( 'commit', () => {
  88944. widgetToolbarRepository.clearForceDisabled( 'resize' );
  88945. }, { priority: 'highest' } );
  88946. }
  88947. this._resizers.set( options.viewElement, resizer );
  88948. return resizer;
  88949. }
  88950. /**
  88951. * Returns a resizer that contains a given resize handle.
  88952. *
  88953. * @protected
  88954. * @param {HTMLElement} domResizeHandle
  88955. * @returns {module:widget/widgetresize/resizer~Resizer}
  88956. */
  88957. _getResizerByHandle( domResizeHandle ) {
  88958. for ( const resizer of this._resizers.values() ) {
  88959. if ( resizer.containsHandle( domResizeHandle ) ) {
  88960. return resizer;
  88961. }
  88962. }
  88963. }
  88964. /**
  88965. * Returns a resizer created for a given view element (widget element).
  88966. *
  88967. * @protected
  88968. * @param {module:engine/view/containerelement~ContainerElement} viewElement
  88969. * @returns {module:widget/widgetresize/resizer~Resizer}
  88970. */
  88971. _getResizerByViewElement( viewElement ) {
  88972. return this._resizers.get( viewElement );
  88973. }
  88974. /**
  88975. * @protected
  88976. * @param {module:utils/eventinfo~EventInfo} event
  88977. * @param {Event} domEventData Native DOM event.
  88978. */
  88979. _mouseDownListener( event, domEventData ) {
  88980. const resizeHandle = domEventData.domTarget;
  88981. if ( !_widgetresize_resizer__WEBPACK_IMPORTED_MODULE_1__["default"].isResizeHandle( resizeHandle ) ) {
  88982. return;
  88983. }
  88984. this._activeResizer = this._getResizerByHandle( resizeHandle );
  88985. if ( this._activeResizer ) {
  88986. this._activeResizer.begin( resizeHandle );
  88987. // Do not call other events when resizing. See: #6755.
  88988. event.stop();
  88989. domEventData.preventDefault();
  88990. }
  88991. }
  88992. /**
  88993. * @protected
  88994. * @param {module:utils/eventinfo~EventInfo} event
  88995. * @param {Event} domEventData Native DOM event.
  88996. */
  88997. _mouseMoveListener( event, domEventData ) {
  88998. if ( this._activeResizer ) {
  88999. this._activeResizer.updateSize( domEventData );
  89000. }
  89001. }
  89002. /**
  89003. * @protected
  89004. */
  89005. _mouseUpListener() {
  89006. if ( this._activeResizer ) {
  89007. this._activeResizer.commit();
  89008. this._activeResizer = null;
  89009. }
  89010. }
  89011. }
  89012. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_6__["default"])( WidgetResize, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_4__["default"] );
  89013. /**
  89014. * Interface describing a resizer. It allows to specify the resizing host, custom logic for calculating aspect ratio, etc.
  89015. *
  89016. * @interface ResizerOptions
  89017. */
  89018. /**
  89019. * Editor instance associated with the resizer.
  89020. *
  89021. * @member {module:core/editor/editor~Editor} module:widget/widgetresize~ResizerOptions#editor
  89022. */
  89023. /**
  89024. * @member {module:engine/model/element~Element} module:widget/widgetresize~ResizerOptions#modelElement
  89025. */
  89026. /**
  89027. * A view of an element to be resized. Typically it's the main widget's view instance.
  89028. *
  89029. * @member {module:engine/view/containerelement~ContainerElement} module:widget/widgetresize~ResizerOptions#viewElement
  89030. */
  89031. /**
  89032. * A callback to be executed once the resizing process is done.
  89033. *
  89034. * It receives a `Number` (`newValue`) as a parameter.
  89035. *
  89036. * For example, {@link module:image/imageresize~ImageResize} uses it to execute the image resize command
  89037. * which puts the new value into the model.
  89038. *
  89039. * ```js
  89040. * {
  89041. * editor,
  89042. * modelElement: data.item,
  89043. * viewElement: widget,
  89044. *
  89045. * onCommit( newValue ) {
  89046. * editor.execute( 'imageResize', { width: newValue } );
  89047. * }
  89048. * };
  89049. * ```
  89050. *
  89051. *
  89052. * @member {Function} module:widget/widgetresize~ResizerOptions#onCommit
  89053. */
  89054. /**
  89055. * @member {Function} module:widget/widgetresize~ResizerOptions#getResizeHost
  89056. */
  89057. /**
  89058. * @member {Function} module:widget/widgetresize~ResizerOptions#isCentered
  89059. */
  89060. /***/ }),
  89061. /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/resizer.js":
  89062. /*!*****************************************************************************!*\
  89063. !*** ./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/resizer.js ***!
  89064. \*****************************************************************************/
  89065. /*! exports provided: default */
  89066. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  89067. "use strict";
  89068. __webpack_require__.r(__webpack_exports__);
  89069. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Resizer; });
  89070. /* harmony import */ var _ckeditor_ckeditor5_ui_src_view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/view */ "./node_modules/@ckeditor/ckeditor5-ui/src/view.js");
  89071. /* harmony import */ var _ckeditor_ckeditor5_ui_src_template__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/template */ "./node_modules/@ckeditor/ckeditor5-ui/src/template.js");
  89072. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
  89073. /* harmony import */ var _ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/comparearrays */ "./node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.js");
  89074. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  89075. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  89076. /* harmony import */ var _resizerstate__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./resizerstate */ "./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/resizerstate.js");
  89077. /**
  89078. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  89079. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  89080. */
  89081. /**
  89082. * @module widget/widgetresize/resizer
  89083. */
  89084. /**
  89085. * Represents a resizer for a single resizable object.
  89086. *
  89087. * @mixes module:utils/observablemixin~ObservableMixin
  89088. */
  89089. class Resizer {
  89090. /**
  89091. * @param {module:widget/widgetresize~ResizerOptions} options Resizer options.
  89092. */
  89093. constructor( options ) {
  89094. /**
  89095. * Stores the state of the resizable host geometry, such as the original width, the currently proposed height, etc.
  89096. *
  89097. * Note that a new state is created for each resize transaction.
  89098. *
  89099. * @readonly
  89100. * @member {module:widget/widgetresize/resizerstate~ResizerState} #state
  89101. */
  89102. /**
  89103. * A view displaying the proposed new element size during the resizing.
  89104. *
  89105. * @protected
  89106. * @readonly
  89107. * @member {module:widget/widgetresize/resizer~SizeView} #_sizeUI
  89108. */
  89109. /**
  89110. * Options passed to the {@link #constructor}.
  89111. *
  89112. * @private
  89113. * @type {module:widget/widgetresize~ResizerOptions}
  89114. */
  89115. this._options = options;
  89116. /**
  89117. * Container of the entire resize UI.
  89118. *
  89119. * Note that this property is initialized only after the element bound with the resizer is drawn
  89120. * so it will be a `null` when uninitialized.
  89121. *
  89122. * @private
  89123. * @type {HTMLElement|null}
  89124. */
  89125. this._domResizerWrapper = null;
  89126. /**
  89127. * A wrapper that is controlled by the resizer. This is usually a widget element.
  89128. *
  89129. * @private
  89130. * @type {module:engine/view/element~Element|null}
  89131. */
  89132. this._viewResizerWrapper = null;
  89133. /**
  89134. * The width of the resized {@link module:widget/widgetresize~ResizerOptions#viewElement viewElement} before the resizing started.
  89135. *
  89136. * @private
  89137. * @member {Number|String|undefined} #_initialViewWidth
  89138. */
  89139. /**
  89140. * @observable
  89141. */
  89142. this.set( 'isEnabled', true );
  89143. this.decorate( 'begin' );
  89144. this.decorate( 'cancel' );
  89145. this.decorate( 'commit' );
  89146. this.decorate( 'updateSize' );
  89147. this.on( 'commit', event => {
  89148. // State might not be initialized yet. In this case, prevent further handling and make sure that the resizer is
  89149. // cleaned up (#5195).
  89150. if ( !this.state.proposedWidth && !this.state.proposedWidthPercents ) {
  89151. this._cleanup();
  89152. event.stop();
  89153. }
  89154. }, { priority: 'high' } );
  89155. this.on( 'change:isEnabled', () => {
  89156. // We should redraw the resize handles when the plugin is enabled again.
  89157. // Otherwise they won't show up.
  89158. if ( this.isEnabled ) {
  89159. this.redraw();
  89160. }
  89161. } );
  89162. }
  89163. /**
  89164. * Attaches the resizer to the DOM.
  89165. */
  89166. attach() {
  89167. const that = this;
  89168. const widgetElement = this._options.viewElement;
  89169. const editingView = this._options.editor.editing.view;
  89170. editingView.change( writer => {
  89171. const viewResizerWrapper = writer.createUIElement( 'div', {
  89172. class: 'ck ck-reset_all ck-widget__resizer'
  89173. }, function( domDocument ) {
  89174. const domElement = this.toDomElement( domDocument );
  89175. that._appendHandles( domElement );
  89176. that._appendSizeUI( domElement );
  89177. that._domResizerWrapper = domElement;
  89178. that.on( 'change:isEnabled', ( evt, propName, newValue ) => {
  89179. domElement.style.display = newValue ? '' : 'none';
  89180. } );
  89181. domElement.style.display = that.isEnabled ? '' : 'none';
  89182. return domElement;
  89183. } );
  89184. // Append the resizer wrapper to the widget's wrapper.
  89185. writer.insert( writer.createPositionAt( widgetElement, 'end' ), viewResizerWrapper );
  89186. writer.addClass( 'ck-widget_with-resizer', widgetElement );
  89187. this._viewResizerWrapper = viewResizerWrapper;
  89188. } );
  89189. }
  89190. /**
  89191. * Starts the resizing process.
  89192. *
  89193. * Creates a new {@link #state} for the current process.
  89194. *
  89195. * @fires begin
  89196. * @param {HTMLElement} domResizeHandle Clicked handle.
  89197. */
  89198. begin( domResizeHandle ) {
  89199. this.state = new _resizerstate__WEBPACK_IMPORTED_MODULE_6__["default"]( this._options );
  89200. this._sizeUI.bindToState( this._options, this.state );
  89201. this._initialViewWidth = this._options.viewElement.getStyle( 'width' );
  89202. this.state.begin( domResizeHandle, this._getHandleHost(), this._getResizeHost() );
  89203. }
  89204. /**
  89205. * Updates the proposed size based on `domEventData`.
  89206. *
  89207. * @fires updateSize
  89208. * @param {Event} domEventData
  89209. */
  89210. updateSize( domEventData ) {
  89211. const newSize = this._proposeNewSize( domEventData );
  89212. const editingView = this._options.editor.editing.view;
  89213. editingView.change( writer => {
  89214. const unit = this._options.unit || '%';
  89215. const newWidth = ( unit === '%' ? newSize.widthPercents : newSize.width ) + unit;
  89216. writer.setStyle( 'width', newWidth, this._options.viewElement );
  89217. } );
  89218. // Get an actual image width, and:
  89219. // * reflect this size to the resize wrapper
  89220. // * apply this **real** size to the state
  89221. const domHandleHost = this._getHandleHost();
  89222. const domHandleHostRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_2__["default"]( domHandleHost );
  89223. newSize.handleHostWidth = Math.round( domHandleHostRect.width );
  89224. newSize.handleHostHeight = Math.round( domHandleHostRect.height );
  89225. // Handle max-width limitation.
  89226. const domResizeHostRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_2__["default"]( domHandleHost );
  89227. newSize.width = Math.round( domResizeHostRect.width );
  89228. newSize.height = Math.round( domResizeHostRect.height );
  89229. this.redraw( domHandleHostRect );
  89230. this.state.update( newSize );
  89231. }
  89232. /**
  89233. * Applies the geometry proposed with the resizer.
  89234. *
  89235. * @fires commit
  89236. */
  89237. commit() {
  89238. const unit = this._options.unit || '%';
  89239. const newValue = ( unit === '%' ? this.state.proposedWidthPercents : this.state.proposedWidth ) + unit;
  89240. // Both cleanup and onCommit callback are very likely to make view changes. Ensure that it is made in a single step.
  89241. this._options.editor.editing.view.change( () => {
  89242. this._cleanup();
  89243. this._options.onCommit( newValue );
  89244. } );
  89245. }
  89246. /**
  89247. * Cancels and rejects the proposed resize dimensions, hiding the UI.
  89248. *
  89249. * @fires cancel
  89250. */
  89251. cancel() {
  89252. this._cleanup();
  89253. }
  89254. /**
  89255. * Destroys the resizer.
  89256. */
  89257. destroy() {
  89258. this.cancel();
  89259. }
  89260. /**
  89261. * Redraws the resizer.
  89262. *
  89263. * @param {module:utils/dom/rect~Rect} [handleHostRect] Handle host rectangle might be given to improve performance.
  89264. */
  89265. redraw( handleHostRect ) {
  89266. const domWrapper = this._domResizerWrapper;
  89267. // Refresh only if resizer exists in the DOM.
  89268. if ( !existsInDom( domWrapper ) ) {
  89269. return;
  89270. }
  89271. const widgetWrapper = domWrapper.parentElement;
  89272. const handleHost = this._getHandleHost();
  89273. const resizerWrapper = this._viewResizerWrapper;
  89274. const currentDimensions = [
  89275. resizerWrapper.getStyle( 'width' ),
  89276. resizerWrapper.getStyle( 'height' ),
  89277. resizerWrapper.getStyle( 'left' ),
  89278. resizerWrapper.getStyle( 'top' )
  89279. ];
  89280. let newDimensions;
  89281. if ( widgetWrapper.isSameNode( handleHost ) ) {
  89282. const clientRect = handleHostRect || new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_2__["default"]( handleHost );
  89283. newDimensions = [
  89284. clientRect.width + 'px',
  89285. clientRect.height + 'px',
  89286. undefined,
  89287. undefined
  89288. ];
  89289. }
  89290. // In case a resizing host is not a widget wrapper, we need to compensate
  89291. // for any additional offsets the resize host might have. E.g. wrapper padding
  89292. // or simply another editable. By doing that the border and resizers are shown
  89293. // only around the resize host.
  89294. else {
  89295. newDimensions = [
  89296. handleHost.offsetWidth + 'px',
  89297. handleHost.offsetHeight + 'px',
  89298. handleHost.offsetLeft + 'px',
  89299. handleHost.offsetTop + 'px'
  89300. ];
  89301. }
  89302. // Make changes to the view only if the resizer should actually get new dimensions.
  89303. // Otherwise, if View#change() was always called, this would cause EditorUI#update
  89304. // loops because the WidgetResize plugin listens to EditorUI#update and updates
  89305. // the resizer.
  89306. // https://github.com/ckeditor/ckeditor5/issues/7633
  89307. if ( Object(_ckeditor_ckeditor5_utils_src_comparearrays__WEBPACK_IMPORTED_MODULE_3__["default"])( currentDimensions, newDimensions ) !== 'same' ) {
  89308. this._options.editor.editing.view.change( writer => {
  89309. writer.setStyle( {
  89310. width: newDimensions[ 0 ],
  89311. height: newDimensions[ 1 ],
  89312. left: newDimensions[ 2 ],
  89313. top: newDimensions[ 3 ]
  89314. }, resizerWrapper );
  89315. } );
  89316. }
  89317. }
  89318. containsHandle( domElement ) {
  89319. return this._domResizerWrapper.contains( domElement );
  89320. }
  89321. static isResizeHandle( domElement ) {
  89322. return domElement.classList.contains( 'ck-widget__resizer__handle' );
  89323. }
  89324. /**
  89325. * Cleans up the context state.
  89326. *
  89327. * @protected
  89328. */
  89329. _cleanup() {
  89330. this._sizeUI.dismiss();
  89331. this._sizeUI.isVisible = false;
  89332. const editingView = this._options.editor.editing.view;
  89333. editingView.change( writer => {
  89334. writer.setStyle( 'width', this._initialViewWidth, this._options.viewElement );
  89335. } );
  89336. }
  89337. /**
  89338. * Calculates the proposed size as the resize handles are dragged.
  89339. *
  89340. * @private
  89341. * @param {Event} domEventData Event data that caused the size update request. It should be used to calculate the proposed size.
  89342. * @returns {Object} return
  89343. * @returns {Number} return.width Proposed width.
  89344. * @returns {Number} return.height Proposed height.
  89345. */
  89346. _proposeNewSize( domEventData ) {
  89347. const state = this.state;
  89348. const currentCoordinates = extractCoordinates( domEventData );
  89349. const isCentered = this._options.isCentered ? this._options.isCentered( this ) : true;
  89350. // Enlargement defines how much the resize host has changed in a given axis. Naturally it could be a negative number
  89351. // meaning that it has been shrunk.
  89352. //
  89353. // +----------------+--+
  89354. // | | |
  89355. // | img | |
  89356. // | /handle host | |
  89357. // +----------------+ | ^
  89358. // | | | - enlarge y
  89359. // +-------------------+ v
  89360. // <-->
  89361. // enlarge x
  89362. const enlargement = {
  89363. x: state._referenceCoordinates.x - ( currentCoordinates.x + state.originalWidth ),
  89364. y: ( currentCoordinates.y - state.originalHeight ) - state._referenceCoordinates.y
  89365. };
  89366. if ( isCentered && state.activeHandlePosition.endsWith( '-right' ) ) {
  89367. enlargement.x = currentCoordinates.x - ( state._referenceCoordinates.x + state.originalWidth );
  89368. }
  89369. // Objects needs to be resized twice as much in horizontal axis if centered, since enlargement is counted from
  89370. // one resized corner to your cursor. It needs to be duplicated to compensate for the other side too.
  89371. if ( isCentered ) {
  89372. enlargement.x *= 2;
  89373. }
  89374. // const resizeHost = this._getResizeHost();
  89375. // The size proposed by the user. It does not consider the aspect ratio.
  89376. const proposedSize = {
  89377. width: Math.abs( state.originalWidth + enlargement.x ),
  89378. height: Math.abs( state.originalHeight + enlargement.y )
  89379. };
  89380. // Dominant determination must take the ratio into account.
  89381. proposedSize.dominant = proposedSize.width / state.aspectRatio > proposedSize.height ? 'width' : 'height';
  89382. proposedSize.max = proposedSize[ proposedSize.dominant ];
  89383. // Proposed size, respecting the aspect ratio.
  89384. const targetSize = {
  89385. width: proposedSize.width,
  89386. height: proposedSize.height
  89387. };
  89388. if ( proposedSize.dominant == 'width' ) {
  89389. targetSize.height = targetSize.width / state.aspectRatio;
  89390. } else {
  89391. targetSize.width = targetSize.height * state.aspectRatio;
  89392. }
  89393. return {
  89394. width: Math.round( targetSize.width ),
  89395. height: Math.round( targetSize.height ),
  89396. widthPercents: Math.min( Math.round( state.originalWidthPercents / state.originalWidth * targetSize.width * 100 ) / 100, 100 )
  89397. };
  89398. }
  89399. /**
  89400. * Obtains the resize host.
  89401. *
  89402. * Resize host is an object that receives dimensions which are the result of resizing.
  89403. *
  89404. * @protected
  89405. * @returns {HTMLElement}
  89406. */
  89407. _getResizeHost() {
  89408. const widgetWrapper = this._domResizerWrapper.parentElement;
  89409. return this._options.getResizeHost( widgetWrapper );
  89410. }
  89411. /**
  89412. * Obtains the handle host.
  89413. *
  89414. * Handle host is an object that the handles are aligned to.
  89415. *
  89416. * Handle host will not always be an entire widget itself. Take an image as an example. The image widget
  89417. * contains an image and a caption. Only the image should be surrounded with handles.
  89418. *
  89419. * @protected
  89420. * @returns {HTMLElement}
  89421. */
  89422. _getHandleHost() {
  89423. const widgetWrapper = this._domResizerWrapper.parentElement;
  89424. return this._options.getHandleHost( widgetWrapper );
  89425. }
  89426. /**
  89427. * Renders the resize handles in the DOM.
  89428. *
  89429. * @private
  89430. * @param {HTMLElement} domElement The resizer wrapper.
  89431. */
  89432. _appendHandles( domElement ) {
  89433. const resizerPositions = [ 'top-left', 'top-right', 'bottom-right', 'bottom-left' ];
  89434. for ( const currentPosition of resizerPositions ) {
  89435. domElement.appendChild( ( new _ckeditor_ckeditor5_ui_src_template__WEBPACK_IMPORTED_MODULE_1__["default"]( {
  89436. tag: 'div',
  89437. attributes: {
  89438. class: `ck-widget__resizer__handle ${ getResizerClass( currentPosition ) }`
  89439. }
  89440. } ).render() ) );
  89441. }
  89442. }
  89443. /**
  89444. * Sets up the {@link #_sizeUI} property and adds it to the passed `domElement`.
  89445. *
  89446. * @private
  89447. * @param {HTMLElement} domElement
  89448. */
  89449. _appendSizeUI( domElement ) {
  89450. const sizeUI = new SizeView();
  89451. // Make sure icon#element is rendered before passing to appendChild().
  89452. sizeUI.render();
  89453. this._sizeUI = sizeUI;
  89454. domElement.appendChild( sizeUI.element );
  89455. }
  89456. /**
  89457. * @event begin
  89458. */
  89459. /**
  89460. * @event updateSize
  89461. */
  89462. /**
  89463. * @event commit
  89464. */
  89465. /**
  89466. * @event cancel
  89467. */
  89468. }
  89469. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_5__["default"])( Resizer, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_4__["default"] );
  89470. /**
  89471. * A view displaying the proposed new element size during the resizing.
  89472. *
  89473. * @extends {module:ui/view~View}
  89474. */
  89475. class SizeView extends _ckeditor_ckeditor5_ui_src_view__WEBPACK_IMPORTED_MODULE_0__["default"] {
  89476. constructor() {
  89477. super();
  89478. const bind = this.bindTemplate;
  89479. this.setTemplate( {
  89480. tag: 'div',
  89481. attributes: {
  89482. class: [
  89483. 'ck',
  89484. 'ck-size-view',
  89485. bind.to( 'activeHandlePosition', value => value ? `ck-orientation-${ value }` : '' )
  89486. ],
  89487. style: {
  89488. display: bind.if( 'isVisible', 'none', visible => !visible )
  89489. }
  89490. },
  89491. children: [ {
  89492. text: bind.to( 'label' )
  89493. } ]
  89494. } );
  89495. }
  89496. bindToState( options, resizerState ) {
  89497. this.bind( 'isVisible' ).to( resizerState, 'proposedWidth', resizerState, 'proposedHeight', ( width, height ) =>
  89498. width !== null && height !== null );
  89499. this.bind( 'label' ).to(
  89500. resizerState, 'proposedHandleHostWidth',
  89501. resizerState, 'proposedHandleHostHeight',
  89502. resizerState, 'proposedWidthPercents',
  89503. ( width, height, widthPercents ) => {
  89504. if ( options.unit === 'px' ) {
  89505. return `${ width }×${ height }`;
  89506. } else {
  89507. return `${ widthPercents }%`;
  89508. }
  89509. }
  89510. );
  89511. this.bind( 'activeHandlePosition' ).to( resizerState );
  89512. }
  89513. dismiss() {
  89514. this.unbind();
  89515. this.isVisible = false;
  89516. }
  89517. }
  89518. // @private
  89519. // @param {String} resizerPosition Expected resizer position like `"top-left"`, `"bottom-right"`.
  89520. // @returns {String} A prefixed HTML class name for the resizer element
  89521. function getResizerClass( resizerPosition ) {
  89522. return `ck-widget__resizer__handle-${ resizerPosition }`;
  89523. }
  89524. function extractCoordinates( event ) {
  89525. return {
  89526. x: event.pageX,
  89527. y: event.pageY
  89528. };
  89529. }
  89530. function existsInDom( element ) {
  89531. return element && element.ownerDocument && element.ownerDocument.contains( element );
  89532. }
  89533. /***/ }),
  89534. /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/resizerstate.js":
  89535. /*!**********************************************************************************!*\
  89536. !*** ./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/resizerstate.js ***!
  89537. \**********************************************************************************/
  89538. /*! exports provided: default */
  89539. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  89540. "use strict";
  89541. __webpack_require__.r(__webpack_exports__);
  89542. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ResizeState; });
  89543. /* harmony import */ var _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/dom/rect */ "./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js");
  89544. /* harmony import */ var _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/observablemixin */ "./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js");
  89545. /* harmony import */ var _ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/mix */ "./node_modules/@ckeditor/ckeditor5-utils/src/mix.js");
  89546. /**
  89547. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  89548. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  89549. */
  89550. /**
  89551. * @module widget/widgetresize/resizerstate
  89552. */
  89553. /**
  89554. * Stores the internal state of a single resizable object.
  89555. *
  89556. */
  89557. class ResizeState {
  89558. /**
  89559. * @param {module:widget/widgetresize~ResizerOptions} options Resizer options.
  89560. */
  89561. constructor( options ) {
  89562. /**
  89563. * The original width (pixels) of the resized object when the resize process was started.
  89564. *
  89565. * @readonly
  89566. * @member {Number} #originalWidth
  89567. */
  89568. /**
  89569. * The original height (pixels) of the resized object when the resize process was started.
  89570. *
  89571. * @readonly
  89572. * @member {Number} #originalHeight
  89573. */
  89574. /**
  89575. * The original width (percents) of the resized object when the resize process was started.
  89576. *
  89577. * @readonly
  89578. * @member {Number} #originalWidthPercents
  89579. */
  89580. /**
  89581. * The position of the handle that initiated the resizing. E.g. `"top-left"`, `"bottom-right"` etc. or `null`
  89582. * if unknown.
  89583. *
  89584. * @readonly
  89585. * @observable
  89586. * @member {String|null} #activeHandlePosition
  89587. */
  89588. this.set( 'activeHandlePosition', null );
  89589. /**
  89590. * The width (percents) proposed, but not committed yet, in the current resize process.
  89591. *
  89592. * @readonly
  89593. * @observable
  89594. * @member {Number|null} #proposedWidthPercents
  89595. */
  89596. this.set( 'proposedWidthPercents', null );
  89597. /**
  89598. * The width (pixels) proposed, but not committed yet, in the current resize process.
  89599. *
  89600. * @readonly
  89601. * @observable
  89602. * @member {Number|null} #proposedWidthPixels
  89603. */
  89604. this.set( 'proposedWidth', null );
  89605. /**
  89606. * The height (pixels) proposed, but not committed yet, in the current resize process.
  89607. *
  89608. * @readonly
  89609. * @observable
  89610. * @member {Number|null} #proposedHeightPixels
  89611. */
  89612. this.set( 'proposedHeight', null );
  89613. this.set( 'proposedHandleHostWidth', null );
  89614. this.set( 'proposedHandleHostHeight', null );
  89615. /**
  89616. * A width to height ratio of the resized image.
  89617. *
  89618. * @readonly
  89619. * @member {Number} #aspectRatio
  89620. */
  89621. /**
  89622. * @private
  89623. * @type {module:widget/widgetresize~ResizerOptions}
  89624. */
  89625. this._options = options;
  89626. /**
  89627. * The reference point of the resizer where the dragging started. It is used to measure the distance the user cursor
  89628. * traveled, so how much the image should be enlarged.
  89629. * This information is only known after the DOM was rendered, so it will be updated later.
  89630. *
  89631. * @private
  89632. * @type {Object}
  89633. */
  89634. this._referenceCoordinates = null;
  89635. }
  89636. /**
  89637. *
  89638. * @param {HTMLElement} domResizeHandle The handle used to calculate the reference point.
  89639. * @param {HTMLElement} domHandleHost
  89640. * @param {HTMLElement} domResizeHost
  89641. */
  89642. begin( domResizeHandle, domHandleHost, domResizeHost ) {
  89643. const clientRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_0__["default"]( domHandleHost );
  89644. this.activeHandlePosition = getHandlePosition( domResizeHandle );
  89645. this._referenceCoordinates = getAbsoluteBoundaryPoint( domHandleHost, getOppositePosition( this.activeHandlePosition ) );
  89646. this.originalWidth = clientRect.width;
  89647. this.originalHeight = clientRect.height;
  89648. this.aspectRatio = clientRect.width / clientRect.height;
  89649. const widthStyle = domResizeHost.style.width;
  89650. if ( widthStyle && widthStyle.match( /^\d+\.?\d*%$/ ) ) {
  89651. this.originalWidthPercents = parseFloat( widthStyle );
  89652. } else {
  89653. this.originalWidthPercents = calculateHostPercentageWidth( domResizeHost, clientRect );
  89654. }
  89655. }
  89656. update( newSize ) {
  89657. this.proposedWidth = newSize.width;
  89658. this.proposedHeight = newSize.height;
  89659. this.proposedWidthPercents = newSize.widthPercents;
  89660. this.proposedHandleHostWidth = newSize.handleHostWidth;
  89661. this.proposedHandleHostHeight = newSize.handleHostHeight;
  89662. }
  89663. }
  89664. Object(_ckeditor_ckeditor5_utils_src_mix__WEBPACK_IMPORTED_MODULE_2__["default"])( ResizeState, _ckeditor_ckeditor5_utils_src_observablemixin__WEBPACK_IMPORTED_MODULE_1__["default"] );
  89665. // Calculates a relative width of a `domResizeHost` compared to it's parent in percents.
  89666. //
  89667. // @private
  89668. // @param {HTMLElement} domResizeHost
  89669. // @param {module:utils/dom/rect~Rect} resizeHostRect
  89670. // @returns {Number}
  89671. function calculateHostPercentageWidth( domResizeHost, resizeHostRect ) {
  89672. const domResizeHostParent = domResizeHost.parentElement;
  89673. // Need to use computed style as it properly excludes parent's paddings from the returned value.
  89674. const parentWidth = parseFloat( domResizeHostParent.ownerDocument.defaultView.getComputedStyle( domResizeHostParent ).width );
  89675. return resizeHostRect.width / parentWidth * 100;
  89676. }
  89677. // Returns coordinates of the top-left corner of an element, relative to the document's top-left corner.
  89678. //
  89679. // @private
  89680. // @param {HTMLElement} element
  89681. // @param {String} resizerPosition The position of the resize handle, e.g. `"top-left"`, `"bottom-right"`.
  89682. // @returns {Object} return
  89683. // @returns {Number} return.x
  89684. // @returns {Number} return.y
  89685. function getAbsoluteBoundaryPoint( element, resizerPosition ) {
  89686. const elementRect = new _ckeditor_ckeditor5_utils_src_dom_rect__WEBPACK_IMPORTED_MODULE_0__["default"]( element );
  89687. const positionParts = resizerPosition.split( '-' );
  89688. const ret = {
  89689. x: positionParts[ 1 ] == 'right' ? elementRect.right : elementRect.left,
  89690. y: positionParts[ 0 ] == 'bottom' ? elementRect.bottom : elementRect.top
  89691. };
  89692. ret.x += element.ownerDocument.defaultView.scrollX;
  89693. ret.y += element.ownerDocument.defaultView.scrollY;
  89694. return ret;
  89695. }
  89696. // @private
  89697. // @param {String} resizerPosition The expected resizer position, like `"top-left"`, `"bottom-right"`.
  89698. // @returns {String} A prefixed HTML class name for the resizer element.
  89699. function getResizerHandleClass( resizerPosition ) {
  89700. return `ck-widget__resizer__handle-${ resizerPosition }`;
  89701. }
  89702. // Determines the position of a given resize handle.
  89703. //
  89704. // @private
  89705. // @param {HTMLElement} domHandle Handle used to calculate the reference point.
  89706. // @returns {String|undefined} Returns a string like `"top-left"` or `undefined` if not matched.
  89707. function getHandlePosition( domHandle ) {
  89708. const resizerPositions = [ 'top-left', 'top-right', 'bottom-right', 'bottom-left' ];
  89709. for ( const position of resizerPositions ) {
  89710. if ( domHandle.classList.contains( getResizerHandleClass( position ) ) ) {
  89711. return position;
  89712. }
  89713. }
  89714. }
  89715. // @private
  89716. // @param {String} position Like `"top-left"`.
  89717. // @returns {String} Inverted `position`, e.g. it returns `"bottom-right"` if `"top-left"` was given as `position`.
  89718. function getOppositePosition( position ) {
  89719. const parts = position.split( '-' );
  89720. const replacements = {
  89721. top: 'bottom',
  89722. bottom: 'top',
  89723. left: 'right',
  89724. right: 'left'
  89725. };
  89726. return `${ replacements[ parts[ 0 ] ] }-${ replacements[ parts[ 1 ] ] }`;
  89727. }
  89728. /***/ }),
  89729. /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/widgettoolbarrepository.js":
  89730. /*!********************************************************************************!*\
  89731. !*** ./node_modules/@ckeditor/ckeditor5-widget/src/widgettoolbarrepository.js ***!
  89732. \********************************************************************************/
  89733. /*! exports provided: default */
  89734. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  89735. "use strict";
  89736. __webpack_require__.r(__webpack_exports__);
  89737. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return WidgetToolbarRepository; });
  89738. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  89739. /* harmony import */ var _ckeditor_ckeditor5_ui_src_panel_balloon_contextualballoon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon */ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon.js");
  89740. /* harmony import */ var _ckeditor_ckeditor5_ui_src_toolbar_toolbarview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/toolbar/toolbarview */ "./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarview.js");
  89741. /* harmony import */ var _ckeditor_ckeditor5_ui_src_panel_balloon_balloonpanelview__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview */ "./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview.js");
  89742. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-widget/src/utils.js");
  89743. /* harmony import */ var _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/ckeditorerror */ "./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js");
  89744. /**
  89745. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  89746. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  89747. */
  89748. /**
  89749. * @module widget/widgettoolbarrepository
  89750. */
  89751. /**
  89752. * Widget toolbar repository plugin. A central point for registering widget toolbars. This plugin handles the whole
  89753. * toolbar rendering process and exposes a concise API.
  89754. *
  89755. * To add a toolbar for your widget use the {@link ~WidgetToolbarRepository#register `WidgetToolbarRepository#register()`} method.
  89756. *
  89757. * The following example comes from the {@link module:image/imagetoolbar~ImageToolbar} plugin:
  89758. *
  89759. * class ImageToolbar extends Plugin {
  89760. * static get requires() {
  89761. * return [ WidgetToolbarRepository ];
  89762. * }
  89763. *
  89764. * afterInit() {
  89765. * const editor = this.editor;
  89766. * const widgetToolbarRepository = editor.plugins.get( WidgetToolbarRepository );
  89767. *
  89768. * widgetToolbarRepository.register( 'image', {
  89769. * items: editor.config.get( 'image.toolbar' ),
  89770. * getRelatedElement: getSelectedImageWidget
  89771. * } );
  89772. * }
  89773. * }
  89774. */
  89775. class WidgetToolbarRepository extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  89776. /**
  89777. * @inheritDoc
  89778. */
  89779. static get requires() {
  89780. return [ _ckeditor_ckeditor5_ui_src_panel_balloon_contextualballoon__WEBPACK_IMPORTED_MODULE_1__["default"] ];
  89781. }
  89782. /**
  89783. * @inheritDoc
  89784. */
  89785. static get pluginName() {
  89786. return 'WidgetToolbarRepository';
  89787. }
  89788. /**
  89789. * @inheritDoc
  89790. */
  89791. init() {
  89792. const editor = this.editor;
  89793. // Disables the default balloon toolbar for all widgets.
  89794. if ( editor.plugins.has( 'BalloonToolbar' ) ) {
  89795. const balloonToolbar = editor.plugins.get( 'BalloonToolbar' );
  89796. this.listenTo( balloonToolbar, 'show', evt => {
  89797. if ( isWidgetSelected( editor.editing.view.document.selection ) ) {
  89798. evt.stop();
  89799. }
  89800. }, { priority: 'high' } );
  89801. }
  89802. /**
  89803. * A map of toolbar definitions.
  89804. *
  89805. * @protected
  89806. * @member {Map.<String,module:widget/widgettoolbarrepository~WidgetRepositoryToolbarDefinition>} #_toolbarDefinitions
  89807. */
  89808. this._toolbarDefinitions = new Map();
  89809. /**
  89810. * @private
  89811. */
  89812. this._balloon = this.editor.plugins.get( 'ContextualBalloon' );
  89813. this.on( 'change:isEnabled', () => {
  89814. this._updateToolbarsVisibility();
  89815. } );
  89816. this.listenTo( editor.ui, 'update', () => {
  89817. this._updateToolbarsVisibility();
  89818. } );
  89819. // UI#update is not fired after focus is back in editor, we need to check if balloon panel should be visible.
  89820. this.listenTo( editor.ui.focusTracker, 'change:isFocused', () => {
  89821. this._updateToolbarsVisibility();
  89822. }, { priority: 'low' } );
  89823. }
  89824. destroy() {
  89825. super.destroy();
  89826. for ( const toolbarConfig of this._toolbarDefinitions.values() ) {
  89827. toolbarConfig.view.destroy();
  89828. }
  89829. }
  89830. /**
  89831. * Registers toolbar in the WidgetToolbarRepository. It renders it in the `ContextualBalloon` based on the value of the invoked
  89832. * `getRelatedElement` function. Toolbar items are gathered from `items` array.
  89833. * The balloon's CSS class is by default `ck-toolbar-container` and may be override with the `balloonClassName` option.
  89834. *
  89835. * Note: This method should be called in the {@link module:core/plugin~PluginInterface#afterInit `Plugin#afterInit()`}
  89836. * callback (or later) to make sure that the given toolbar items were already registered by other plugins.
  89837. *
  89838. * @param {String} toolbarId An id for the toolbar. Used to
  89839. * @param {Object} options
  89840. * @param {String} [options.ariaLabel] Label used by assistive technologies to describe this toolbar element.
  89841. * @param {Array.<String>} options.items Array of toolbar items.
  89842. * @param {Function} options.getRelatedElement Callback which returns an element the toolbar should be attached to.
  89843. * @param {String} [options.balloonClassName='ck-toolbar-container'] CSS class for the widget balloon.
  89844. */
  89845. register( toolbarId, { ariaLabel, items, getRelatedElement, balloonClassName = 'ck-toolbar-container' } ) {
  89846. // Trying to register a toolbar without any item.
  89847. if ( !items.length ) {
  89848. /**
  89849. * When {@link #register} a new toolbar, you need to provide a non-empty array with
  89850. * the items that will be inserted into the toolbar.
  89851. *
  89852. * @error widget-toolbar-no-items
  89853. */
  89854. Object(_ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["logWarning"])( 'widget-toolbar-no-items', { toolbarId } );
  89855. return;
  89856. }
  89857. const editor = this.editor;
  89858. const t = editor.t;
  89859. const toolbarView = new _ckeditor_ckeditor5_ui_src_toolbar_toolbarview__WEBPACK_IMPORTED_MODULE_2__["default"]( editor.locale );
  89860. toolbarView.ariaLabel = ariaLabel || t( 'Widget toolbar' );
  89861. if ( this._toolbarDefinitions.has( toolbarId ) ) {
  89862. /**
  89863. * Toolbar with the given id was already added.
  89864. *
  89865. * @error widget-toolbar-duplicated
  89866. * @param toolbarId Toolbar id.
  89867. */
  89868. throw new _ckeditor_ckeditor5_utils_src_ckeditorerror__WEBPACK_IMPORTED_MODULE_5__["default"]( 'widget-toolbar-duplicated', this, { toolbarId } );
  89869. }
  89870. toolbarView.fillFromConfig( items, editor.ui.componentFactory );
  89871. this._toolbarDefinitions.set( toolbarId, {
  89872. view: toolbarView,
  89873. getRelatedElement,
  89874. balloonClassName
  89875. } );
  89876. }
  89877. /**
  89878. * Iterates over stored toolbars and makes them visible or hidden.
  89879. *
  89880. * @private
  89881. */
  89882. _updateToolbarsVisibility() {
  89883. let maxRelatedElementDepth = 0;
  89884. let deepestRelatedElement = null;
  89885. let deepestToolbarDefinition = null;
  89886. for ( const definition of this._toolbarDefinitions.values() ) {
  89887. const relatedElement = definition.getRelatedElement( this.editor.editing.view.document.selection );
  89888. if ( !this.isEnabled || !relatedElement ) {
  89889. if ( this._isToolbarInBalloon( definition ) ) {
  89890. this._hideToolbar( definition );
  89891. }
  89892. } else if ( !this.editor.ui.focusTracker.isFocused ) {
  89893. if ( this._isToolbarVisible( definition ) ) {
  89894. this._hideToolbar( definition );
  89895. }
  89896. } else {
  89897. const relatedElementDepth = relatedElement.getAncestors().length;
  89898. // Many toolbars can express willingness to be displayed but they do not know about
  89899. // each other. Figure out which toolbar is deepest in the view tree to decide which
  89900. // should be displayed. For instance, if a selected image is inside a table cell, display
  89901. // the ImageToolbar rather than the TableToolbar (#60).
  89902. if ( relatedElementDepth > maxRelatedElementDepth ) {
  89903. maxRelatedElementDepth = relatedElementDepth;
  89904. deepestRelatedElement = relatedElement;
  89905. deepestToolbarDefinition = definition;
  89906. }
  89907. }
  89908. }
  89909. if ( deepestToolbarDefinition ) {
  89910. this._showToolbar( deepestToolbarDefinition, deepestRelatedElement );
  89911. }
  89912. }
  89913. /**
  89914. * Hides the given toolbar.
  89915. *
  89916. * @private
  89917. * @param {module:widget/widgettoolbarrepository~WidgetRepositoryToolbarDefinition} toolbarDefinition
  89918. */
  89919. _hideToolbar( toolbarDefinition ) {
  89920. this._balloon.remove( toolbarDefinition.view );
  89921. this.stopListening( this._balloon, 'change:visibleView' );
  89922. }
  89923. /**
  89924. * Shows up the toolbar if the toolbar is not visible.
  89925. * Otherwise, repositions the toolbar's balloon when toolbar's view is the most top view in balloon stack.
  89926. *
  89927. * It might happen here that the toolbar's view is under another view. Then do nothing as the other toolbar view
  89928. * should be still visible after the {@link module:core/editor/editorui~EditorUI#event:update}.
  89929. *
  89930. * @private
  89931. * @param {module:widget/widgettoolbarrepository~WidgetRepositoryToolbarDefinition} toolbarDefinition
  89932. * @param {module:engine/view/element~Element} relatedElement
  89933. */
  89934. _showToolbar( toolbarDefinition, relatedElement ) {
  89935. if ( this._isToolbarVisible( toolbarDefinition ) ) {
  89936. repositionContextualBalloon( this.editor, relatedElement );
  89937. } else if ( !this._isToolbarInBalloon( toolbarDefinition ) ) {
  89938. this._balloon.add( {
  89939. view: toolbarDefinition.view,
  89940. position: getBalloonPositionData( this.editor, relatedElement ),
  89941. balloonClassName: toolbarDefinition.balloonClassName
  89942. } );
  89943. // Update toolbar position each time stack with toolbar view is switched to visible.
  89944. // This is in a case target element has changed when toolbar was in invisible stack
  89945. // e.g. target image was wrapped by a block quote.
  89946. // See https://github.com/ckeditor/ckeditor5-widget/issues/92.
  89947. this.listenTo( this._balloon, 'change:visibleView', () => {
  89948. for ( const definition of this._toolbarDefinitions.values() ) {
  89949. if ( this._isToolbarVisible( definition ) ) {
  89950. const relatedElement = definition.getRelatedElement( this.editor.editing.view.document.selection );
  89951. repositionContextualBalloon( this.editor, relatedElement );
  89952. }
  89953. }
  89954. } );
  89955. }
  89956. }
  89957. /**
  89958. * @private
  89959. * @param {Object} toolbar
  89960. * @returns {Boolean}
  89961. */
  89962. _isToolbarVisible( toolbar ) {
  89963. return this._balloon.visibleView === toolbar.view;
  89964. }
  89965. /**
  89966. * @private
  89967. * @param {Object} toolbar
  89968. * @returns {Boolean}
  89969. */
  89970. _isToolbarInBalloon( toolbar ) {
  89971. return this._balloon.hasView( toolbar.view );
  89972. }
  89973. }
  89974. function repositionContextualBalloon( editor, relatedElement ) {
  89975. const balloon = editor.plugins.get( 'ContextualBalloon' );
  89976. const position = getBalloonPositionData( editor, relatedElement );
  89977. balloon.updatePosition( position );
  89978. }
  89979. function getBalloonPositionData( editor, relatedElement ) {
  89980. const editingView = editor.editing.view;
  89981. const defaultPositions = _ckeditor_ckeditor5_ui_src_panel_balloon_balloonpanelview__WEBPACK_IMPORTED_MODULE_3__["default"].defaultPositions;
  89982. return {
  89983. target: editingView.domConverter.mapViewToDom( relatedElement ),
  89984. positions: [
  89985. defaultPositions.northArrowSouth,
  89986. defaultPositions.northArrowSouthWest,
  89987. defaultPositions.northArrowSouthEast,
  89988. defaultPositions.southArrowNorth,
  89989. defaultPositions.southArrowNorthWest,
  89990. defaultPositions.southArrowNorthEast,
  89991. _utils__WEBPACK_IMPORTED_MODULE_4__["centeredBalloonPositionForLongWidgets"]
  89992. ]
  89993. };
  89994. }
  89995. function isWidgetSelected( selection ) {
  89996. const viewElement = selection.getSelectedElement();
  89997. return !!( viewElement && Object(_utils__WEBPACK_IMPORTED_MODULE_4__["isWidget"])( viewElement ) );
  89998. }
  89999. /**
  90000. * The toolbar definition object used by the toolbar repository to manage toolbars.
  90001. * It contains information necessary to display the toolbar in the
  90002. * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} and
  90003. * update it during its life (display) cycle.
  90004. *
  90005. * @typedef {Object} module:widget/widgettoolbarrepository~WidgetRepositoryToolbarDefinition
  90006. *
  90007. * @property {module:ui/view~View} view The UI view of the toolbar.
  90008. * @property {Function} getRelatedElement A function that returns an engine {@link module:engine/view/view~View}
  90009. * element the toolbar is to be attached to. For instance, an image widget or a table widget (or `null` when
  90010. * there is no such element). The function accepts an instance of {@link module:engine/view/selection~Selection}.
  90011. * @property {String} balloonClassName CSS class for the widget balloon when a toolbar is displayed.
  90012. */
  90013. /***/ }),
  90014. /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/utils.js":
  90015. /*!*******************************************************************************!*\
  90016. !*** ./node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/utils.js ***!
  90017. \*******************************************************************************/
  90018. /*! exports provided: TYPE_AROUND_SELECTION_ATTRIBUTE, isTypeAroundWidget, getClosestTypeAroundDomButton, getTypeAroundButtonPosition, getClosestWidgetViewElement, getTypeAroundFakeCaretPosition */
  90019. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90020. "use strict";
  90021. __webpack_require__.r(__webpack_exports__);
  90022. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TYPE_AROUND_SELECTION_ATTRIBUTE", function() { return TYPE_AROUND_SELECTION_ATTRIBUTE; });
  90023. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isTypeAroundWidget", function() { return isTypeAroundWidget; });
  90024. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getClosestTypeAroundDomButton", function() { return getClosestTypeAroundDomButton; });
  90025. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTypeAroundButtonPosition", function() { return getTypeAroundButtonPosition; });
  90026. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getClosestWidgetViewElement", function() { return getClosestWidgetViewElement; });
  90027. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTypeAroundFakeCaretPosition", function() { return getTypeAroundFakeCaretPosition; });
  90028. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "./node_modules/@ckeditor/ckeditor5-widget/src/utils.js");
  90029. /**
  90030. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  90031. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  90032. */
  90033. /**
  90034. * @module widget/widgettypearound/utils
  90035. */
  90036. /**
  90037. * The name of the type around model selection attribute responsible for
  90038. * displaying a fake caret next to a selected widget.
  90039. */
  90040. const TYPE_AROUND_SELECTION_ATTRIBUTE = 'widget-type-around';
  90041. /**
  90042. * Checks if an element is a widget that qualifies to get the widget type around UI.
  90043. *
  90044. * @param {module:engine/view/element~Element} viewElement
  90045. * @param {module:engine/model/element~Element} modelElement
  90046. * @param {module:engine/model/schema~Schema} schema
  90047. * @returns {Boolean}
  90048. */
  90049. function isTypeAroundWidget( viewElement, modelElement, schema ) {
  90050. return viewElement && Object(_utils__WEBPACK_IMPORTED_MODULE_0__["isWidget"])( viewElement ) && !schema.isInline( modelElement );
  90051. }
  90052. /**
  90053. * For the passed HTML element, this helper finds the closest widget type around button ancestor.
  90054. *
  90055. * @param {HTMLElement} domElement
  90056. * @returns {HTMLElement|null}
  90057. */
  90058. function getClosestTypeAroundDomButton( domElement ) {
  90059. return domElement.closest( '.ck-widget__type-around__button' );
  90060. }
  90061. /**
  90062. * For the passed widget type around button element, this helper determines at which position
  90063. * the paragraph would be inserted into the content if, for instance, the button was
  90064. * clicked by the user.
  90065. *
  90066. * @param {HTMLElement} domElement
  90067. * @returns {'before'|'after'} The position of the button.
  90068. */
  90069. function getTypeAroundButtonPosition( domElement ) {
  90070. return domElement.classList.contains( 'ck-widget__type-around__button_before' ) ? 'before' : 'after';
  90071. }
  90072. /**
  90073. * For the passed HTML element, this helper returns the closest view widget ancestor.
  90074. *
  90075. * @param {HTMLElement} domElement
  90076. * @param {module:engine/view/domconverter~DomConverter} domConverter
  90077. * @returns {module:engine/view/element~Element}
  90078. */
  90079. function getClosestWidgetViewElement( domElement, domConverter ) {
  90080. const widgetDomElement = domElement.closest( '.ck-widget' );
  90081. return domConverter.mapDomToView( widgetDomElement );
  90082. }
  90083. /**
  90084. * For the passed selection instance, it returns the position of the fake caret displayed next to a widget.
  90085. *
  90086. * **Note**: If the fake caret is not currently displayed, `null` is returned.
  90087. *
  90088. * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
  90089. * @returns {'before'|'after'|null} The position of the fake caret or `null` when none is present.
  90090. */
  90091. function getTypeAroundFakeCaretPosition( selection ) {
  90092. return selection.getAttribute( TYPE_AROUND_SELECTION_ATTRIBUTE );
  90093. }
  90094. /***/ }),
  90095. /***/ "./node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/widgettypearound.js":
  90096. /*!******************************************************************************************!*\
  90097. !*** ./node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/widgettypearound.js ***!
  90098. \******************************************************************************************/
  90099. /*! exports provided: default */
  90100. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90101. "use strict";
  90102. __webpack_require__.r(__webpack_exports__);
  90103. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return WidgetTypeAround; });
  90104. /* harmony import */ var _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core/src/plugin */ "./node_modules/@ckeditor/ckeditor5-core/src/plugin.js");
  90105. /* harmony import */ var _ckeditor_ckeditor5_ui_src_template__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-ui/src/template */ "./node_modules/@ckeditor/ckeditor5-ui/src/template.js");
  90106. /* harmony import */ var _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/keyboard */ "./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js");
  90107. /* harmony import */ var _ckeditor_ckeditor5_utils_src_priorities__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils/src/priorities */ "./node_modules/@ckeditor/ckeditor5-utils/src/priorities.js");
  90108. /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/utils.js");
  90109. /* harmony import */ var _ckeditor_ckeditor5_typing_src_utils_injectunsafekeystrokeshandling__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-typing/src/utils/injectunsafekeystrokeshandling */ "./node_modules/@ckeditor/ckeditor5-typing/src/utils/injectunsafekeystrokeshandling.js");
  90110. /* harmony import */ var _theme_icons_return_arrow_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../theme/icons/return-arrow.svg */ "./node_modules/@ckeditor/ckeditor5-widget/theme/icons/return-arrow.svg");
  90111. /* harmony import */ var _theme_widgettypearound_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../theme/widgettypearound.css */ "./node_modules/@ckeditor/ckeditor5-widget/theme/widgettypearound.css");
  90112. /* harmony import */ var _theme_widgettypearound_css__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_theme_widgettypearound_css__WEBPACK_IMPORTED_MODULE_7__);
  90113. /**
  90114. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  90115. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  90116. */
  90117. /* global DOMParser */
  90118. /**
  90119. * @module widget/widgettypearound
  90120. */
  90121. const POSSIBLE_INSERTION_POSITIONS = [ 'before', 'after' ];
  90122. // Do the SVG parsing once and then clone the result <svg> DOM element for each new button.
  90123. const RETURN_ARROW_ICON_ELEMENT = new DOMParser().parseFromString( _theme_icons_return_arrow_svg__WEBPACK_IMPORTED_MODULE_6__["default"], 'image/svg+xml' ).firstChild;
  90124. const PLUGIN_DISABLED_EDITING_ROOT_CLASS = 'ck-widget__type-around_disabled';
  90125. /**
  90126. * A plugin that allows users to type around widgets where normally it is impossible to place the caret due
  90127. * to limitations of web browsers. These "tight spots" occur, for instance, before (or after) a widget being
  90128. * the first (or last) child of its parent or between two block widgets.
  90129. *
  90130. * This plugin extends the {@link module:widget/widget~Widget `Widget`} plugin and injects the user interface
  90131. * with two buttons into each widget instance in the editor. Each of the buttons can be clicked by the
  90132. * user if the widget is next to the "tight spot". Once clicked, a paragraph is created with the selection anchored
  90133. * in it so that users can type (or insert content, paste, etc.) straight away.
  90134. *
  90135. * @extends module:core/plugin~Plugin
  90136. */
  90137. class WidgetTypeAround extends _ckeditor_ckeditor5_core_src_plugin__WEBPACK_IMPORTED_MODULE_0__["default"] {
  90138. /**
  90139. * @inheritDoc
  90140. */
  90141. static get pluginName() {
  90142. return 'WidgetTypeAround';
  90143. }
  90144. /**
  90145. * @inheritDoc
  90146. */
  90147. constructor( editor ) {
  90148. super( editor );
  90149. /**
  90150. * A reference to the model widget element that has the fake caret active
  90151. * on either side of it. It is later used to remove CSS classes associated with the fake caret
  90152. * when the widget no longer needs it.
  90153. *
  90154. * @private
  90155. * @member {module:engine/model/element~Element|null}
  90156. */
  90157. this._currentFakeCaretModelElement = null;
  90158. }
  90159. /**
  90160. * @inheritDoc
  90161. */
  90162. init() {
  90163. const editor = this.editor;
  90164. const editingView = editor.editing.view;
  90165. // Set a CSS class on the view editing root when the plugin is disabled so all the buttons
  90166. // and lines visually disappear. All the interactions are disabled in individual plugin methods.
  90167. this.on( 'change:isEnabled', ( evt, data, isEnabled ) => {
  90168. editingView.change( writer => {
  90169. for ( const root of editingView.document.roots ) {
  90170. if ( isEnabled ) {
  90171. writer.removeClass( PLUGIN_DISABLED_EDITING_ROOT_CLASS, root );
  90172. } else {
  90173. writer.addClass( PLUGIN_DISABLED_EDITING_ROOT_CLASS, root );
  90174. }
  90175. }
  90176. } );
  90177. if ( !isEnabled ) {
  90178. editor.model.change( writer => {
  90179. writer.removeSelectionAttribute( _utils__WEBPACK_IMPORTED_MODULE_4__["TYPE_AROUND_SELECTION_ATTRIBUTE"] );
  90180. } );
  90181. }
  90182. } );
  90183. this._enableTypeAroundUIInjection();
  90184. this._enableInsertingParagraphsOnButtonClick();
  90185. this._enableInsertingParagraphsOnEnterKeypress();
  90186. this._enableInsertingParagraphsOnTypingKeystroke();
  90187. this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows();
  90188. this._enableDeleteIntegration();
  90189. this._enableInsertContentIntegration();
  90190. }
  90191. /**
  90192. * @inheritDoc
  90193. */
  90194. destroy() {
  90195. this._currentFakeCaretModelElement = null;
  90196. }
  90197. /**
  90198. * Inserts a new paragraph next to a widget element with the selection anchored in it.
  90199. *
  90200. * **Note**: This method is heavily user-oriented and will both focus the editing view and scroll
  90201. * the viewport to the selection in the inserted paragraph.
  90202. *
  90203. * @protected
  90204. * @param {module:engine/model/element~Element} widgetModelElement The model widget element next to which a paragraph is inserted.
  90205. * @param {'before'|'after'} position The position where the paragraph is inserted. Either `'before'` or `'after'` the widget.
  90206. */
  90207. _insertParagraph( widgetModelElement, position ) {
  90208. const editor = this.editor;
  90209. const editingView = editor.editing.view;
  90210. editor.execute( 'insertParagraph', {
  90211. position: editor.model.createPositionAt( widgetModelElement, position )
  90212. } );
  90213. editingView.focus();
  90214. editingView.scrollToTheSelection();
  90215. }
  90216. /**
  90217. * A wrapper for the {@link module:utils/emittermixin~EmitterMixin#listenTo} method that executes the callbacks only
  90218. * when the plugin {@link #isEnabled is enabled}.
  90219. *
  90220. * @private
  90221. * @param {module:utils/emittermixin~Emitter} emitter The object that fires the event.
  90222. * @param {String} event The name of the event.
  90223. * @param {Function} callback The function to be called on event.
  90224. * @param {Object} [options={}] Additional options.
  90225. * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of this event callback. The higher
  90226. * the priority value the sooner the callback will be fired. Events having the same priority are called in the
  90227. * order they were added.
  90228. */
  90229. _listenToIfEnabled( emitter, event, callback, options ) {
  90230. this.listenTo( emitter, event, ( ...args ) => {
  90231. // Do not respond if the plugin is disabled.
  90232. if ( this.isEnabled ) {
  90233. callback( ...args );
  90234. }
  90235. }, options );
  90236. }
  90237. /**
  90238. * Similar to {@link #_insertParagraph}, this method inserts a paragraph except that it
  90239. * does not expect a position. Instead, it performs the insertion next to a selected widget
  90240. * according to the `widget-type-around` model selection attribute value (fake caret position).
  90241. *
  90242. * Because this method requires the `widget-type-around` attribute to be set,
  90243. * the insertion can only happen when the widget's fake caret is active (e.g. activated
  90244. * using the keyboard).
  90245. *
  90246. * @private
  90247. * @returns {Boolean} Returns `true` when the paragraph was inserted (the attribute was present) and `false` otherwise.
  90248. */
  90249. _insertParagraphAccordingToFakeCaretPosition() {
  90250. const editor = this.editor;
  90251. const model = editor.model;
  90252. const modelSelection = model.document.selection;
  90253. const typeAroundFakeCaretPosition = Object(_utils__WEBPACK_IMPORTED_MODULE_4__["getTypeAroundFakeCaretPosition"])( modelSelection );
  90254. if ( !typeAroundFakeCaretPosition ) {
  90255. return false;
  90256. }
  90257. const selectedModelElement = modelSelection.getSelectedElement();
  90258. this._insertParagraph( selectedModelElement, typeAroundFakeCaretPosition );
  90259. return true;
  90260. }
  90261. /**
  90262. * Creates a listener in the editing conversion pipeline that injects the widget type around
  90263. * UI into every single widget instance created in the editor.
  90264. *
  90265. * The UI is delivered as a {@link module:engine/view/uielement~UIElement}
  90266. * wrapper which renders DOM buttons that users can use to insert paragraphs.
  90267. *
  90268. * @private
  90269. */
  90270. _enableTypeAroundUIInjection() {
  90271. const editor = this.editor;
  90272. const schema = editor.model.schema;
  90273. const t = editor.locale.t;
  90274. const buttonTitles = {
  90275. before: t( 'Insert paragraph before block' ),
  90276. after: t( 'Insert paragraph after block' )
  90277. };
  90278. editor.editing.downcastDispatcher.on( 'insert', ( evt, data, conversionApi ) => {
  90279. const viewElement = conversionApi.mapper.toViewElement( data.item );
  90280. // Filter out non-widgets and inline widgets.
  90281. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_4__["isTypeAroundWidget"])( viewElement, data.item, schema ) ) {
  90282. injectUIIntoWidget( conversionApi.writer, buttonTitles, viewElement );
  90283. }
  90284. }, { priority: 'low' } );
  90285. }
  90286. /**
  90287. * Brings support for the fake caret that appears when either:
  90288. *
  90289. * * the selection moves to a widget from a position next to it using arrow keys,
  90290. * * the arrow key is pressed when the widget is already selected.
  90291. *
  90292. * The fake caret lets the user know that they can start typing or just press
  90293. * <kbd>Enter</kbd> to insert a paragraph at the position next to a widget as suggested by the fake caret.
  90294. *
  90295. * The fake caret disappears when the user changes the selection or the editor
  90296. * gets blurred.
  90297. *
  90298. * The whole idea is as follows:
  90299. *
  90300. * 1. A user does one of the 2 scenarios described at the beginning.
  90301. * 2. The "keydown" listener is executed and the decision is made whether to show or hide the fake caret.
  90302. * 3. If it should show up, the `widget-type-around` model selection attribute is set indicating
  90303. * on which side of the widget it should appear.
  90304. * 4. The selection dispatcher reacts to the selection attribute and sets CSS classes responsible for the
  90305. * fake caret on the view widget.
  90306. * 5. If the fake caret should disappear, the selection attribute is removed and the dispatcher
  90307. * does the CSS class clean-up in the view.
  90308. * 6. Additionally, `change:range` and `FocusTracker#isFocused` listeners also remove the selection
  90309. * attribute (the former also removes widget CSS classes).
  90310. *
  90311. * @private
  90312. */
  90313. _enableTypeAroundFakeCaretActivationUsingKeyboardArrows() {
  90314. const editor = this.editor;
  90315. const model = editor.model;
  90316. const modelSelection = model.document.selection;
  90317. const schema = model.schema;
  90318. const editingView = editor.editing.view;
  90319. // This is the main listener responsible for the fake caret.
  90320. // Note: The priority must precede the default Widget class keydown handler ("high") and the
  90321. // TableKeyboard keydown handler ("high-10").
  90322. this._listenToIfEnabled( editingView.document, 'keydown', ( evt, domEventData ) => {
  90323. if ( Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_2__["isArrowKeyCode"])( domEventData.keyCode ) ) {
  90324. this._handleArrowKeyPress( evt, domEventData );
  90325. }
  90326. }, { priority: _ckeditor_ckeditor5_utils_src_priorities__WEBPACK_IMPORTED_MODULE_3__["default"].get( 'high' ) + 10 } );
  90327. // This listener makes sure the widget type around selection attribute will be gone from the model
  90328. // selection as soon as the model range changes. This attribute only makes sense when a widget is selected
  90329. // (and the "fake horizontal caret" is visible) so whenever the range changes (e.g. selection moved somewhere else),
  90330. // let's get rid of the attribute so that the selection downcast dispatcher isn't even bothered.
  90331. this._listenToIfEnabled( modelSelection, 'change:range', ( evt, data ) => {
  90332. // Do not reset the selection attribute when the change was indirect.
  90333. if ( !data.directChange ) {
  90334. return;
  90335. }
  90336. // Get rid of the widget type around attribute of the selection on every change:range.
  90337. // If the range changes, it means for sure, the user is no longer in the active ("fake horizontal caret") mode.
  90338. editor.model.change( writer => {
  90339. writer.removeSelectionAttribute( _utils__WEBPACK_IMPORTED_MODULE_4__["TYPE_AROUND_SELECTION_ATTRIBUTE"] );
  90340. } );
  90341. } );
  90342. // Get rid of the widget type around attribute of the selection on every document change
  90343. // that makes widget not selected any more (i.e. widget was removed).
  90344. this._listenToIfEnabled( model.document, 'change:data', () => {
  90345. const selectedModelElement = modelSelection.getSelectedElement();
  90346. if ( selectedModelElement ) {
  90347. const selectedViewElement = editor.editing.mapper.toViewElement( selectedModelElement );
  90348. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_4__["isTypeAroundWidget"])( selectedViewElement, selectedModelElement, schema ) ) {
  90349. return;
  90350. }
  90351. }
  90352. editor.model.change( writer => {
  90353. writer.removeSelectionAttribute( _utils__WEBPACK_IMPORTED_MODULE_4__["TYPE_AROUND_SELECTION_ATTRIBUTE"] );
  90354. } );
  90355. } );
  90356. // React to changes of the model selection attribute made by the arrow keys listener.
  90357. // If the block widget is selected and the attribute changes, downcast the attribute to special
  90358. // CSS classes associated with the active ("fake horizontal caret") mode of the widget.
  90359. this._listenToIfEnabled( editor.editing.downcastDispatcher, 'selection', ( evt, data, conversionApi ) => {
  90360. const writer = conversionApi.writer;
  90361. if ( this._currentFakeCaretModelElement ) {
  90362. const selectedViewElement = conversionApi.mapper.toViewElement( this._currentFakeCaretModelElement );
  90363. if ( selectedViewElement ) {
  90364. // Get rid of CSS classes associated with the active ("fake horizontal caret") mode from the view widget.
  90365. writer.removeClass( POSSIBLE_INSERTION_POSITIONS.map( positionToWidgetCssClass ), selectedViewElement );
  90366. this._currentFakeCaretModelElement = null;
  90367. }
  90368. }
  90369. const selectedModelElement = data.selection.getSelectedElement();
  90370. if ( !selectedModelElement ) {
  90371. return;
  90372. }
  90373. const selectedViewElement = conversionApi.mapper.toViewElement( selectedModelElement );
  90374. if ( !Object(_utils__WEBPACK_IMPORTED_MODULE_4__["isTypeAroundWidget"])( selectedViewElement, selectedModelElement, schema ) ) {
  90375. return;
  90376. }
  90377. const typeAroundFakeCaretPosition = Object(_utils__WEBPACK_IMPORTED_MODULE_4__["getTypeAroundFakeCaretPosition"])( data.selection );
  90378. if ( !typeAroundFakeCaretPosition ) {
  90379. return;
  90380. }
  90381. writer.addClass( positionToWidgetCssClass( typeAroundFakeCaretPosition ), selectedViewElement );
  90382. // Remember the view widget that got the "fake-caret" CSS class. This class should be removed ASAP when the
  90383. // selection changes
  90384. this._currentFakeCaretModelElement = selectedModelElement;
  90385. } );
  90386. this._listenToIfEnabled( editor.ui.focusTracker, 'change:isFocused', ( evt, name, isFocused ) => {
  90387. if ( !isFocused ) {
  90388. editor.model.change( writer => {
  90389. writer.removeSelectionAttribute( _utils__WEBPACK_IMPORTED_MODULE_4__["TYPE_AROUND_SELECTION_ATTRIBUTE"] );
  90390. } );
  90391. }
  90392. } );
  90393. function positionToWidgetCssClass( position ) {
  90394. return `ck-widget_type-around_show-fake-caret_${ position }`;
  90395. }
  90396. }
  90397. /**
  90398. * A listener executed on each "keydown" in the view document, a part of
  90399. * {@link #_enableTypeAroundFakeCaretActivationUsingKeyboardArrows}.
  90400. *
  90401. * It decides whether the arrow keypress should activate the fake caret or not (also whether it should
  90402. * be deactivated).
  90403. *
  90404. * The fake caret activation is done by setting the `widget-type-around` model selection attribute
  90405. * in this listener, and stopping and preventing the event that would normally be handled by the widget
  90406. * plugin that is responsible for the regular keyboard navigation near/across all widgets (that
  90407. * includes inline widgets, which are ignored by the widget type around plugin).
  90408. *
  90409. * @private
  90410. */
  90411. _handleArrowKeyPress( evt, domEventData ) {
  90412. const editor = this.editor;
  90413. const model = editor.model;
  90414. const modelSelection = model.document.selection;
  90415. const schema = model.schema;
  90416. const editingView = editor.editing.view;
  90417. const keyCode = domEventData.keyCode;
  90418. const isForward = Object(_ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_2__["isForwardArrowKeyCode"])( keyCode, editor.locale.contentLanguageDirection );
  90419. const selectedViewElement = editingView.document.selection.getSelectedElement();
  90420. const selectedModelElement = editor.editing.mapper.toModelElement( selectedViewElement );
  90421. let shouldStopAndPreventDefault;
  90422. // Handle keyboard navigation when a type-around-compatible widget is currently selected.
  90423. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_4__["isTypeAroundWidget"])( selectedViewElement, selectedModelElement, schema ) ) {
  90424. shouldStopAndPreventDefault = this._handleArrowKeyPressOnSelectedWidget( isForward );
  90425. }
  90426. // Handle keyboard arrow navigation when the selection is next to a type-around-compatible widget
  90427. // and the widget is about to be selected.
  90428. else if ( modelSelection.isCollapsed ) {
  90429. shouldStopAndPreventDefault = this._handleArrowKeyPressWhenSelectionNextToAWidget( isForward );
  90430. }
  90431. if ( shouldStopAndPreventDefault ) {
  90432. domEventData.preventDefault();
  90433. evt.stop();
  90434. }
  90435. }
  90436. /**
  90437. * Handles the keyboard navigation on "keydown" when a widget is currently selected and activates or deactivates
  90438. * the fake caret for that widget, depending on the current value of the `widget-type-around` model
  90439. * selection attribute and the direction of the pressed arrow key.
  90440. *
  90441. * @private
  90442. * @param {Boolean} isForward `true` when the pressed arrow key was responsible for the forward model selection movement
  90443. * as in {@link module:utils/keyboard~isForwardArrowKeyCode}.
  90444. * @returns {Boolean} Returns `true` when the keypress was handled and no other keydown listener of the editor should
  90445. * process the event any further. Returns `false` otherwise.
  90446. */
  90447. _handleArrowKeyPressOnSelectedWidget( isForward ) {
  90448. const editor = this.editor;
  90449. const model = editor.model;
  90450. const modelSelection = model.document.selection;
  90451. const typeAroundFakeCaretPosition = Object(_utils__WEBPACK_IMPORTED_MODULE_4__["getTypeAroundFakeCaretPosition"])( modelSelection );
  90452. return model.change( writer => {
  90453. // If the fake caret is displayed...
  90454. if ( typeAroundFakeCaretPosition ) {
  90455. const isLeavingWidget = typeAroundFakeCaretPosition === ( isForward ? 'after' : 'before' );
  90456. // If the keyboard arrow works against the value of the selection attribute...
  90457. // then remove the selection attribute but prevent default DOM actions
  90458. // and do not let the Widget plugin listener move the selection. This brings
  90459. // the widget back to the state, for instance, like if was selected using the mouse.
  90460. //
  90461. // **Note**: If leaving the widget when the fake caret is active, then the default
  90462. // Widget handler will change the selection and, in turn, this will automatically discard
  90463. // the selection attribute.
  90464. if ( !isLeavingWidget ) {
  90465. writer.removeSelectionAttribute( _utils__WEBPACK_IMPORTED_MODULE_4__["TYPE_AROUND_SELECTION_ATTRIBUTE"] );
  90466. return true;
  90467. }
  90468. }
  90469. // If the fake caret wasn't displayed, let's set it now according to the direction of the arrow
  90470. // key press. This also means we cannot let the Widget plugin listener move the selection.
  90471. else {
  90472. writer.setSelectionAttribute( _utils__WEBPACK_IMPORTED_MODULE_4__["TYPE_AROUND_SELECTION_ATTRIBUTE"], isForward ? 'after' : 'before' );
  90473. return true;
  90474. }
  90475. return false;
  90476. } );
  90477. }
  90478. /**
  90479. * Handles the keyboard navigation on "keydown" when **no** widget is selected but the selection is **directly** next
  90480. * to one and upon the fake caret should become active for this widget upon arrow keypress
  90481. * (AKA entering/selecting the widget).
  90482. *
  90483. * **Note**: This code mirrors the implementation from the widget plugin but also adds the selection attribute.
  90484. * Unfortunately, there is no safe way to let the widget plugin do the selection part first and then just set the
  90485. * selection attribute here in the widget type around plugin. This is why this code must duplicate some from the widget plugin.
  90486. *
  90487. * @private
  90488. * @param {Boolean} isForward `true` when the pressed arrow key was responsible for the forward model selection movement
  90489. * as in {@link module:utils/keyboard~isForwardArrowKeyCode}.
  90490. * @returns {Boolean} Returns `true` when the keypress was handled and no other keydown listener of the editor should
  90491. * process the event any further. Returns `false` otherwise.
  90492. */
  90493. _handleArrowKeyPressWhenSelectionNextToAWidget( isForward ) {
  90494. const editor = this.editor;
  90495. const model = editor.model;
  90496. const schema = model.schema;
  90497. const widgetPlugin = editor.plugins.get( 'Widget' );
  90498. // This is the widget the selection is about to be set on.
  90499. const modelElementNextToSelection = widgetPlugin._getObjectElementNextToSelection( isForward );
  90500. const viewElementNextToSelection = editor.editing.mapper.toViewElement( modelElementNextToSelection );
  90501. if ( Object(_utils__WEBPACK_IMPORTED_MODULE_4__["isTypeAroundWidget"])( viewElementNextToSelection, modelElementNextToSelection, schema ) ) {
  90502. model.change( writer => {
  90503. widgetPlugin._setSelectionOverElement( modelElementNextToSelection );
  90504. writer.setSelectionAttribute( _utils__WEBPACK_IMPORTED_MODULE_4__["TYPE_AROUND_SELECTION_ATTRIBUTE"], isForward ? 'before' : 'after' );
  90505. } );
  90506. // The change() block above does the same job as the Widget plugin. The event can
  90507. // be safely canceled.
  90508. return true;
  90509. }
  90510. return false;
  90511. }
  90512. /**
  90513. * Registers a `mousedown` listener for the view document which intercepts events
  90514. * coming from the widget type around UI, which happens when a user clicks one of the buttons
  90515. * that insert a paragraph next to a widget.
  90516. *
  90517. * @private
  90518. */
  90519. _enableInsertingParagraphsOnButtonClick() {
  90520. const editor = this.editor;
  90521. const editingView = editor.editing.view;
  90522. this._listenToIfEnabled( editingView.document, 'mousedown', ( evt, domEventData ) => {
  90523. const button = Object(_utils__WEBPACK_IMPORTED_MODULE_4__["getClosestTypeAroundDomButton"])( domEventData.domTarget );
  90524. if ( !button ) {
  90525. return;
  90526. }
  90527. const buttonPosition = Object(_utils__WEBPACK_IMPORTED_MODULE_4__["getTypeAroundButtonPosition"])( button );
  90528. const widgetViewElement = Object(_utils__WEBPACK_IMPORTED_MODULE_4__["getClosestWidgetViewElement"])( button, editingView.domConverter );
  90529. const widgetModelElement = editor.editing.mapper.toModelElement( widgetViewElement );
  90530. this._insertParagraph( widgetModelElement, buttonPosition );
  90531. domEventData.preventDefault();
  90532. evt.stop();
  90533. } );
  90534. }
  90535. /**
  90536. * Creates the <kbd>Enter</kbd> key listener on the view document that allows the user to insert a paragraph
  90537. * near the widget when either:
  90538. *
  90539. * * The fake caret was first activated using the arrow keys,
  90540. * * The entire widget is selected in the model.
  90541. *
  90542. * In the first case, the new paragraph is inserted according to the `widget-type-around` selection
  90543. * attribute (see {@link #_handleArrowKeyPress}).
  90544. *
  90545. * In the second case, the new paragraph is inserted based on whether a soft (<kbd>Shift</kbd>+<kbd>Enter</kbd>) keystroke
  90546. * was pressed or not.
  90547. *
  90548. * @private
  90549. */
  90550. _enableInsertingParagraphsOnEnterKeypress() {
  90551. const editor = this.editor;
  90552. const editingView = editor.editing.view;
  90553. this._listenToIfEnabled( editingView.document, 'enter', ( evt, domEventData ) => {
  90554. const selectedViewElement = editingView.document.selection.getSelectedElement();
  90555. const selectedModelElement = editor.editing.mapper.toModelElement( selectedViewElement );
  90556. const schema = editor.model.schema;
  90557. let wasHandled;
  90558. // First check if the widget is selected and there's a type around selection attribute associated
  90559. // with the fake caret that would tell where to insert a new paragraph.
  90560. if ( this._insertParagraphAccordingToFakeCaretPosition() ) {
  90561. wasHandled = true;
  90562. }
  90563. // Then, if there is no selection attribute associated with the fake caret, check if the widget
  90564. // simply is selected and create a new paragraph according to the keystroke (Shift+)Enter.
  90565. else if ( Object(_utils__WEBPACK_IMPORTED_MODULE_4__["isTypeAroundWidget"])( selectedViewElement, selectedModelElement, schema ) ) {
  90566. this._insertParagraph( selectedModelElement, domEventData.isSoft ? 'before' : 'after' );
  90567. wasHandled = true;
  90568. }
  90569. if ( wasHandled ) {
  90570. domEventData.preventDefault();
  90571. evt.stop();
  90572. }
  90573. } );
  90574. }
  90575. /**
  90576. * Similar to the {@link #_enableInsertingParagraphsOnEnterKeypress}, it allows the user
  90577. * to insert a paragraph next to a widget when the fake caret was activated using arrow
  90578. * keys but it responds to typing keystrokes instead of <kbd>Enter</kbd>.
  90579. *
  90580. * "Typing keystrokes" are keystrokes that insert new content into the document,
  90581. * for instance, letters ("a") or numbers ("4"). The "keydown" listener enabled by this method
  90582. * will insert a new paragraph according to the `widget-type-around` model selection attribute
  90583. * as the user simply starts typing, which creates the impression that the fake caret
  90584. * behaves like a real one rendered by the browser (AKA your text appears where the caret was).
  90585. *
  90586. * **Note**: At the moment this listener creates 2 undo steps: one for the `insertParagraph` command
  90587. * and another one for actual typing. It is not a disaster but this may need to be fixed
  90588. * sooner or later.
  90589. *
  90590. * Learn more in {@link module:typing/utils/injectunsafekeystrokeshandling}.
  90591. *
  90592. * @private
  90593. */
  90594. _enableInsertingParagraphsOnTypingKeystroke() {
  90595. const editor = this.editor;
  90596. const editingView = editor.editing.view;
  90597. const keyCodesHandledSomewhereElse = [
  90598. _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_2__["keyCodes"].enter,
  90599. _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_2__["keyCodes"].delete,
  90600. _ckeditor_ckeditor5_utils_src_keyboard__WEBPACK_IMPORTED_MODULE_2__["keyCodes"].backspace
  90601. ];
  90602. // Note: The priority must precede the default Widget class keydown handler ("high") and the
  90603. // TableKeyboard keydown handler ("high + 1").
  90604. this._listenToIfEnabled( editingView.document, 'keydown', ( evt, domEventData ) => {
  90605. // Don't handle enter/backspace/delete here. They are handled in dedicated listeners.
  90606. if ( !keyCodesHandledSomewhereElse.includes( domEventData.keyCode ) && !Object(_ckeditor_ckeditor5_typing_src_utils_injectunsafekeystrokeshandling__WEBPACK_IMPORTED_MODULE_5__["isNonTypingKeystroke"])( domEventData ) ) {
  90607. this._insertParagraphAccordingToFakeCaretPosition();
  90608. }
  90609. }, { priority: _ckeditor_ckeditor5_utils_src_priorities__WEBPACK_IMPORTED_MODULE_3__["default"].get( 'high' ) + 1 } );
  90610. }
  90611. /**
  90612. * It creates a "delete" event listener on the view document to handle cases when the <kbd>Delete</kbd> or <kbd>Backspace</kbd>
  90613. * is pressed and the fake caret is currently active.
  90614. *
  90615. * The fake caret should create an illusion of a real browser caret so that when it appears before or after
  90616. * a widget, pressing <kbd>Delete</kbd> or <kbd>Backspace</kbd> should remove a widget or delete the content
  90617. * before or after a widget (depending on the content surrounding the widget).
  90618. *
  90619. * @private
  90620. */
  90621. _enableDeleteIntegration() {
  90622. const editor = this.editor;
  90623. const editingView = editor.editing.view;
  90624. const model = editor.model;
  90625. const schema = model.schema;
  90626. // Note: The priority must precede the default Widget class delete handler.
  90627. this._listenToIfEnabled( editingView.document, 'delete', ( evt, domEventData ) => {
  90628. const typeAroundFakeCaretPosition = Object(_utils__WEBPACK_IMPORTED_MODULE_4__["getTypeAroundFakeCaretPosition"])( model.document.selection );
  90629. // This listener handles only these cases when the fake caret is active.
  90630. if ( !typeAroundFakeCaretPosition ) {
  90631. return;
  90632. }
  90633. const direction = domEventData.direction;
  90634. const selectedModelWidget = model.document.selection.getSelectedElement();
  90635. const isFakeCaretBefore = typeAroundFakeCaretPosition === 'before';
  90636. const isForwardDelete = direction == 'forward';
  90637. const shouldDeleteEntireWidget = isFakeCaretBefore === isForwardDelete;
  90638. if ( shouldDeleteEntireWidget ) {
  90639. editor.execute( 'delete', {
  90640. selection: model.createSelection( selectedModelWidget, 'on' )
  90641. } );
  90642. } else {
  90643. const range = schema.getNearestSelectionRange(
  90644. model.createPositionAt( selectedModelWidget, typeAroundFakeCaretPosition ),
  90645. direction
  90646. );
  90647. // If there is somewhere to move selection to, then there will be something to delete.
  90648. if ( range ) {
  90649. // If the range is NOT collapsed, then we know that the range contains an object (see getNearestSelectionRange() docs).
  90650. if ( !range.isCollapsed ) {
  90651. model.change( writer => {
  90652. writer.setSelection( range );
  90653. editor.execute( isForwardDelete ? 'forwardDelete' : 'delete' );
  90654. } );
  90655. } else {
  90656. const probe = model.createSelection( range.start );
  90657. model.modifySelection( probe, { direction } );
  90658. // If the range is collapsed, let's see if a non-collapsed range exists that can could be deleted.
  90659. // If such range exists, use the editor command because it it safe for collaboration (it merges where it can).
  90660. if ( !probe.focus.isEqual( range.start ) ) {
  90661. model.change( writer => {
  90662. writer.setSelection( range );
  90663. editor.execute( isForwardDelete ? 'forwardDelete' : 'delete' );
  90664. } );
  90665. }
  90666. // If there is no non-collapsed range to be deleted then we are sure that there is an empty element
  90667. // next to a widget that should be removed. "delete" and "forwardDelete" commands cannot get rid of it
  90668. // so calling Model#deleteContent here manually.
  90669. else {
  90670. const deepestEmptyRangeAncestor = getDeepestEmptyElementAncestor( schema, range.start.parent );
  90671. model.deleteContent( model.createSelection( deepestEmptyRangeAncestor, 'on' ), {
  90672. doNotAutoparagraph: true
  90673. } );
  90674. }
  90675. }
  90676. }
  90677. }
  90678. // If some content was deleted, don't let the handler from the Widget plugin kick in.
  90679. // If nothing was deleted, then the default handler will have nothing to do anyway.
  90680. domEventData.preventDefault();
  90681. evt.stop();
  90682. }, { priority: _ckeditor_ckeditor5_utils_src_priorities__WEBPACK_IMPORTED_MODULE_3__["default"].get( 'high' ) + 1 } );
  90683. }
  90684. /**
  90685. * Attaches the {@link module:engine/model/model~Model#event:insertContent} event listener that, for instance, allows the user to paste
  90686. * content near a widget when the fake caret is first activated using the arrow keys.
  90687. *
  90688. * The content is inserted according to the `widget-type-around` selection attribute (see {@link #_handleArrowKeyPress}).
  90689. *
  90690. * @private
  90691. */
  90692. _enableInsertContentIntegration() {
  90693. const editor = this.editor;
  90694. const model = this.editor.model;
  90695. const documentSelection = model.document.selection;
  90696. this._listenToIfEnabled( editor.model, 'insertContent', ( evt, [ content, selectable ] ) => {
  90697. if ( selectable && !selectable.is( 'documentSelection' ) ) {
  90698. return;
  90699. }
  90700. const typeAroundFakeCaretPosition = Object(_utils__WEBPACK_IMPORTED_MODULE_4__["getTypeAroundFakeCaretPosition"])( documentSelection );
  90701. if ( !typeAroundFakeCaretPosition ) {
  90702. return;
  90703. }
  90704. evt.stop();
  90705. return model.change( writer => {
  90706. const selectedElement = documentSelection.getSelectedElement();
  90707. const position = model.createPositionAt( selectedElement, typeAroundFakeCaretPosition );
  90708. const selection = writer.createSelection( position );
  90709. const result = model.insertContent( content, selection );
  90710. writer.setSelection( selection );
  90711. return result;
  90712. } );
  90713. }, { priority: 'high' } );
  90714. }
  90715. }
  90716. // Injects the type around UI into a view widget instance.
  90717. //
  90718. // @param {module:engine/view/downcastwriter~DowncastWriter} viewWriter
  90719. // @param {Object.<String,String>} buttonTitles
  90720. // @param {module:engine/view/element~Element} widgetViewElement
  90721. function injectUIIntoWidget( viewWriter, buttonTitles, widgetViewElement ) {
  90722. const typeAroundWrapper = viewWriter.createUIElement( 'div', {
  90723. class: 'ck ck-reset_all ck-widget__type-around'
  90724. }, function( domDocument ) {
  90725. const wrapperDomElement = this.toDomElement( domDocument );
  90726. injectButtons( wrapperDomElement, buttonTitles );
  90727. injectFakeCaret( wrapperDomElement );
  90728. return wrapperDomElement;
  90729. } );
  90730. // Inject the type around wrapper into the widget's wrapper.
  90731. viewWriter.insert( viewWriter.createPositionAt( widgetViewElement, 'end' ), typeAroundWrapper );
  90732. }
  90733. // FYI: Not using the IconView class because each instance would need to be destroyed to avoid memory leaks
  90734. // and it's pretty hard to figure out when a view (widget) is gone for good so it's cheaper to use raw
  90735. // <svg> here.
  90736. //
  90737. // @param {HTMLElement} wrapperDomElement
  90738. // @param {Object.<String,String>} buttonTitles
  90739. function injectButtons( wrapperDomElement, buttonTitles ) {
  90740. for ( const position of POSSIBLE_INSERTION_POSITIONS ) {
  90741. const buttonTemplate = new _ckeditor_ckeditor5_ui_src_template__WEBPACK_IMPORTED_MODULE_1__["default"]( {
  90742. tag: 'div',
  90743. attributes: {
  90744. class: [
  90745. 'ck',
  90746. 'ck-widget__type-around__button',
  90747. `ck-widget__type-around__button_${ position }`
  90748. ],
  90749. title: buttonTitles[ position ]
  90750. },
  90751. children: [
  90752. wrapperDomElement.ownerDocument.importNode( RETURN_ARROW_ICON_ELEMENT, true )
  90753. ]
  90754. } );
  90755. wrapperDomElement.appendChild( buttonTemplate.render() );
  90756. }
  90757. }
  90758. // @param {HTMLElement} wrapperDomElement
  90759. function injectFakeCaret( wrapperDomElement ) {
  90760. const caretTemplate = new _ckeditor_ckeditor5_ui_src_template__WEBPACK_IMPORTED_MODULE_1__["default"]( {
  90761. tag: 'div',
  90762. attributes: {
  90763. class: [
  90764. 'ck',
  90765. 'ck-widget__type-around__fake-caret'
  90766. ]
  90767. }
  90768. } );
  90769. wrapperDomElement.appendChild( caretTemplate.render() );
  90770. }
  90771. // Returns the ancestor of an element closest to the root which is empty. For instance,
  90772. // for `<baz>`:
  90773. //
  90774. // <foo>abc<bar><baz></baz></bar></foo>
  90775. //
  90776. // it returns `<bar>`.
  90777. //
  90778. // @param {module:engine/model/schema~Schema} schema
  90779. // @param {module:engine/model/element~Element} element
  90780. // @returns {module:engine/model/element~Element|null}
  90781. function getDeepestEmptyElementAncestor( schema, element ) {
  90782. let deepestEmptyAncestor = element;
  90783. for ( const ancestor of element.getAncestors( { parentFirst: true } ) ) {
  90784. if ( ancestor.childCount > 1 || schema.isLimit( ancestor ) ) {
  90785. break;
  90786. }
  90787. deepestEmptyAncestor = ancestor;
  90788. }
  90789. return deepestEmptyAncestor;
  90790. }
  90791. /***/ }),
  90792. /***/ "./node_modules/@ckeditor/ckeditor5-widget/theme/icons/drag-handle.svg":
  90793. /*!*****************************************************************************!*\
  90794. !*** ./node_modules/@ckeditor/ckeditor5-widget/theme/icons/drag-handle.svg ***!
  90795. \*****************************************************************************/
  90796. /*! exports provided: default */
  90797. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90798. "use strict";
  90799. __webpack_require__.r(__webpack_exports__);
  90800. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M4 0v1H1v3H0V.5A.5.5 0 0 1 .5 0H4zm8 0h3.5a.5.5 0 0 1 .5.5V4h-1V1h-3V0zM4 16H.5a.5.5 0 0 1-.5-.5V12h1v3h3v1zm8 0v-1h3v-3h1v3.5a.5.5 0 0 1-.5.5H12z\"/><path fill-opacity=\".256\" d=\"M1 1h14v14H1z\"/><g class=\"ck-icon__selected-indicator\"><path d=\"M7 0h2v1H7V0zM0 7h1v2H0V7zm15 0h1v2h-1V7zm-8 8h2v1H7v-1z\"/><path fill-opacity=\".254\" d=\"M1 1h14v14H1z\"/></g></svg>");
  90801. /***/ }),
  90802. /***/ "./node_modules/@ckeditor/ckeditor5-widget/theme/icons/return-arrow.svg":
  90803. /*!******************************************************************************!*\
  90804. !*** ./node_modules/@ckeditor/ckeditor5-widget/theme/icons/return-arrow.svg ***!
  90805. \******************************************************************************/
  90806. /*! exports provided: default */
  90807. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90808. "use strict";
  90809. __webpack_require__.r(__webpack_exports__);
  90810. /* harmony default export */ __webpack_exports__["default"] = ("<svg viewBox=\"0 0 10 8\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M9.055.263v3.972h-6.77M1 4.216l2-2.038M1 4.178l2 2.038\"/></svg>");
  90811. /***/ }),
  90812. /***/ "./node_modules/@ckeditor/ckeditor5-widget/theme/widget.css":
  90813. /*!******************************************************************!*\
  90814. !*** ./node_modules/@ckeditor/ckeditor5-widget/theme/widget.css ***!
  90815. \******************************************************************/
  90816. /*! no static exports found */
  90817. /***/ (function(module, exports, __webpack_require__) {
  90818. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  90819. var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./widget.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-widget/theme/widget.css");
  90820. content = content.__esModule ? content.default : content;
  90821. if (typeof content === 'string') {
  90822. content = [[module.i, content, '']];
  90823. }
  90824. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  90825. options.insert = "head";
  90826. options.singleton = true;
  90827. var update = api(content, options);
  90828. module.exports = content.locals || {};
  90829. /***/ }),
  90830. /***/ "./node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css":
  90831. /*!************************************************************************!*\
  90832. !*** ./node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css ***!
  90833. \************************************************************************/
  90834. /*! no static exports found */
  90835. /***/ (function(module, exports, __webpack_require__) {
  90836. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  90837. var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./widgetresize.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css");
  90838. content = content.__esModule ? content.default : content;
  90839. if (typeof content === 'string') {
  90840. content = [[module.i, content, '']];
  90841. }
  90842. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  90843. options.insert = "head";
  90844. options.singleton = true;
  90845. var update = api(content, options);
  90846. module.exports = content.locals || {};
  90847. /***/ }),
  90848. /***/ "./node_modules/@ckeditor/ckeditor5-widget/theme/widgettypearound.css":
  90849. /*!****************************************************************************!*\
  90850. !*** ./node_modules/@ckeditor/ckeditor5-widget/theme/widgettypearound.css ***!
  90851. \****************************************************************************/
  90852. /*! no static exports found */
  90853. /***/ (function(module, exports, __webpack_require__) {
  90854. var api = __webpack_require__(/*! ../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  90855. var content = __webpack_require__(/*! !../../../postcss-loader/src??ref--5-1!./widgettypearound.css */ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-widget/theme/widgettypearound.css");
  90856. content = content.__esModule ? content.default : content;
  90857. if (typeof content === 'string') {
  90858. content = [[module.i, content, '']];
  90859. }
  90860. var options = {"injectType":"singletonStyleTag","attributes":{"data-cke":true}};
  90861. options.insert = "head";
  90862. options.singleton = true;
  90863. var update = api(content, options);
  90864. module.exports = content.locals || {};
  90865. /***/ }),
  90866. /***/ "./node_modules/lodash-es/_DataView.js":
  90867. /*!*********************************************!*\
  90868. !*** ./node_modules/lodash-es/_DataView.js ***!
  90869. \*********************************************/
  90870. /*! exports provided: default */
  90871. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90872. "use strict";
  90873. __webpack_require__.r(__webpack_exports__);
  90874. /* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getNative.js */ "./node_modules/lodash-es/_getNative.js");
  90875. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  90876. /* Built-in method references that are verified to be native. */
  90877. var DataView = Object(_getNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_root_js__WEBPACK_IMPORTED_MODULE_1__["default"], 'DataView');
  90878. /* harmony default export */ __webpack_exports__["default"] = (DataView);
  90879. /***/ }),
  90880. /***/ "./node_modules/lodash-es/_Hash.js":
  90881. /*!*****************************************!*\
  90882. !*** ./node_modules/lodash-es/_Hash.js ***!
  90883. \*****************************************/
  90884. /*! exports provided: default */
  90885. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90886. "use strict";
  90887. __webpack_require__.r(__webpack_exports__);
  90888. /* harmony import */ var _hashClear_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_hashClear.js */ "./node_modules/lodash-es/_hashClear.js");
  90889. /* harmony import */ var _hashDelete_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_hashDelete.js */ "./node_modules/lodash-es/_hashDelete.js");
  90890. /* harmony import */ var _hashGet_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_hashGet.js */ "./node_modules/lodash-es/_hashGet.js");
  90891. /* harmony import */ var _hashHas_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_hashHas.js */ "./node_modules/lodash-es/_hashHas.js");
  90892. /* harmony import */ var _hashSet_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_hashSet.js */ "./node_modules/lodash-es/_hashSet.js");
  90893. /**
  90894. * Creates a hash object.
  90895. *
  90896. * @private
  90897. * @constructor
  90898. * @param {Array} [entries] The key-value pairs to cache.
  90899. */
  90900. function Hash(entries) {
  90901. var index = -1,
  90902. length = entries == null ? 0 : entries.length;
  90903. this.clear();
  90904. while (++index < length) {
  90905. var entry = entries[index];
  90906. this.set(entry[0], entry[1]);
  90907. }
  90908. }
  90909. // Add methods to `Hash`.
  90910. Hash.prototype.clear = _hashClear_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  90911. Hash.prototype['delete'] = _hashDelete_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  90912. Hash.prototype.get = _hashGet_js__WEBPACK_IMPORTED_MODULE_2__["default"];
  90913. Hash.prototype.has = _hashHas_js__WEBPACK_IMPORTED_MODULE_3__["default"];
  90914. Hash.prototype.set = _hashSet_js__WEBPACK_IMPORTED_MODULE_4__["default"];
  90915. /* harmony default export */ __webpack_exports__["default"] = (Hash);
  90916. /***/ }),
  90917. /***/ "./node_modules/lodash-es/_LazyWrapper.js":
  90918. /*!************************************************!*\
  90919. !*** ./node_modules/lodash-es/_LazyWrapper.js ***!
  90920. \************************************************/
  90921. /*! exports provided: default */
  90922. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90923. "use strict";
  90924. __webpack_require__.r(__webpack_exports__);
  90925. /* harmony import */ var _baseCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseCreate.js */ "./node_modules/lodash-es/_baseCreate.js");
  90926. /* harmony import */ var _baseLodash_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseLodash.js */ "./node_modules/lodash-es/_baseLodash.js");
  90927. /** Used as references for the maximum length and index of an array. */
  90928. var MAX_ARRAY_LENGTH = 4294967295;
  90929. /**
  90930. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  90931. *
  90932. * @private
  90933. * @constructor
  90934. * @param {*} value The value to wrap.
  90935. */
  90936. function LazyWrapper(value) {
  90937. this.__wrapped__ = value;
  90938. this.__actions__ = [];
  90939. this.__dir__ = 1;
  90940. this.__filtered__ = false;
  90941. this.__iteratees__ = [];
  90942. this.__takeCount__ = MAX_ARRAY_LENGTH;
  90943. this.__views__ = [];
  90944. }
  90945. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  90946. LazyWrapper.prototype = Object(_baseCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_baseLodash_js__WEBPACK_IMPORTED_MODULE_1__["default"].prototype);
  90947. LazyWrapper.prototype.constructor = LazyWrapper;
  90948. /* harmony default export */ __webpack_exports__["default"] = (LazyWrapper);
  90949. /***/ }),
  90950. /***/ "./node_modules/lodash-es/_ListCache.js":
  90951. /*!**********************************************!*\
  90952. !*** ./node_modules/lodash-es/_ListCache.js ***!
  90953. \**********************************************/
  90954. /*! exports provided: default */
  90955. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90956. "use strict";
  90957. __webpack_require__.r(__webpack_exports__);
  90958. /* harmony import */ var _listCacheClear_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_listCacheClear.js */ "./node_modules/lodash-es/_listCacheClear.js");
  90959. /* harmony import */ var _listCacheDelete_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_listCacheDelete.js */ "./node_modules/lodash-es/_listCacheDelete.js");
  90960. /* harmony import */ var _listCacheGet_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_listCacheGet.js */ "./node_modules/lodash-es/_listCacheGet.js");
  90961. /* harmony import */ var _listCacheHas_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_listCacheHas.js */ "./node_modules/lodash-es/_listCacheHas.js");
  90962. /* harmony import */ var _listCacheSet_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_listCacheSet.js */ "./node_modules/lodash-es/_listCacheSet.js");
  90963. /**
  90964. * Creates an list cache object.
  90965. *
  90966. * @private
  90967. * @constructor
  90968. * @param {Array} [entries] The key-value pairs to cache.
  90969. */
  90970. function ListCache(entries) {
  90971. var index = -1,
  90972. length = entries == null ? 0 : entries.length;
  90973. this.clear();
  90974. while (++index < length) {
  90975. var entry = entries[index];
  90976. this.set(entry[0], entry[1]);
  90977. }
  90978. }
  90979. // Add methods to `ListCache`.
  90980. ListCache.prototype.clear = _listCacheClear_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  90981. ListCache.prototype['delete'] = _listCacheDelete_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  90982. ListCache.prototype.get = _listCacheGet_js__WEBPACK_IMPORTED_MODULE_2__["default"];
  90983. ListCache.prototype.has = _listCacheHas_js__WEBPACK_IMPORTED_MODULE_3__["default"];
  90984. ListCache.prototype.set = _listCacheSet_js__WEBPACK_IMPORTED_MODULE_4__["default"];
  90985. /* harmony default export */ __webpack_exports__["default"] = (ListCache);
  90986. /***/ }),
  90987. /***/ "./node_modules/lodash-es/_LodashWrapper.js":
  90988. /*!**************************************************!*\
  90989. !*** ./node_modules/lodash-es/_LodashWrapper.js ***!
  90990. \**************************************************/
  90991. /*! exports provided: default */
  90992. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90993. "use strict";
  90994. __webpack_require__.r(__webpack_exports__);
  90995. /* harmony import */ var _baseCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseCreate.js */ "./node_modules/lodash-es/_baseCreate.js");
  90996. /* harmony import */ var _baseLodash_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseLodash.js */ "./node_modules/lodash-es/_baseLodash.js");
  90997. /**
  90998. * The base constructor for creating `lodash` wrapper objects.
  90999. *
  91000. * @private
  91001. * @param {*} value The value to wrap.
  91002. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  91003. */
  91004. function LodashWrapper(value, chainAll) {
  91005. this.__wrapped__ = value;
  91006. this.__actions__ = [];
  91007. this.__chain__ = !!chainAll;
  91008. this.__index__ = 0;
  91009. this.__values__ = undefined;
  91010. }
  91011. LodashWrapper.prototype = Object(_baseCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_baseLodash_js__WEBPACK_IMPORTED_MODULE_1__["default"].prototype);
  91012. LodashWrapper.prototype.constructor = LodashWrapper;
  91013. /* harmony default export */ __webpack_exports__["default"] = (LodashWrapper);
  91014. /***/ }),
  91015. /***/ "./node_modules/lodash-es/_Map.js":
  91016. /*!****************************************!*\
  91017. !*** ./node_modules/lodash-es/_Map.js ***!
  91018. \****************************************/
  91019. /*! exports provided: default */
  91020. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91021. "use strict";
  91022. __webpack_require__.r(__webpack_exports__);
  91023. /* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getNative.js */ "./node_modules/lodash-es/_getNative.js");
  91024. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  91025. /* Built-in method references that are verified to be native. */
  91026. var Map = Object(_getNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_root_js__WEBPACK_IMPORTED_MODULE_1__["default"], 'Map');
  91027. /* harmony default export */ __webpack_exports__["default"] = (Map);
  91028. /***/ }),
  91029. /***/ "./node_modules/lodash-es/_MapCache.js":
  91030. /*!*********************************************!*\
  91031. !*** ./node_modules/lodash-es/_MapCache.js ***!
  91032. \*********************************************/
  91033. /*! exports provided: default */
  91034. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91035. "use strict";
  91036. __webpack_require__.r(__webpack_exports__);
  91037. /* harmony import */ var _mapCacheClear_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_mapCacheClear.js */ "./node_modules/lodash-es/_mapCacheClear.js");
  91038. /* harmony import */ var _mapCacheDelete_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_mapCacheDelete.js */ "./node_modules/lodash-es/_mapCacheDelete.js");
  91039. /* harmony import */ var _mapCacheGet_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_mapCacheGet.js */ "./node_modules/lodash-es/_mapCacheGet.js");
  91040. /* harmony import */ var _mapCacheHas_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_mapCacheHas.js */ "./node_modules/lodash-es/_mapCacheHas.js");
  91041. /* harmony import */ var _mapCacheSet_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_mapCacheSet.js */ "./node_modules/lodash-es/_mapCacheSet.js");
  91042. /**
  91043. * Creates a map cache object to store key-value pairs.
  91044. *
  91045. * @private
  91046. * @constructor
  91047. * @param {Array} [entries] The key-value pairs to cache.
  91048. */
  91049. function MapCache(entries) {
  91050. var index = -1,
  91051. length = entries == null ? 0 : entries.length;
  91052. this.clear();
  91053. while (++index < length) {
  91054. var entry = entries[index];
  91055. this.set(entry[0], entry[1]);
  91056. }
  91057. }
  91058. // Add methods to `MapCache`.
  91059. MapCache.prototype.clear = _mapCacheClear_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  91060. MapCache.prototype['delete'] = _mapCacheDelete_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  91061. MapCache.prototype.get = _mapCacheGet_js__WEBPACK_IMPORTED_MODULE_2__["default"];
  91062. MapCache.prototype.has = _mapCacheHas_js__WEBPACK_IMPORTED_MODULE_3__["default"];
  91063. MapCache.prototype.set = _mapCacheSet_js__WEBPACK_IMPORTED_MODULE_4__["default"];
  91064. /* harmony default export */ __webpack_exports__["default"] = (MapCache);
  91065. /***/ }),
  91066. /***/ "./node_modules/lodash-es/_Promise.js":
  91067. /*!********************************************!*\
  91068. !*** ./node_modules/lodash-es/_Promise.js ***!
  91069. \********************************************/
  91070. /*! exports provided: default */
  91071. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91072. "use strict";
  91073. __webpack_require__.r(__webpack_exports__);
  91074. /* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getNative.js */ "./node_modules/lodash-es/_getNative.js");
  91075. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  91076. /* Built-in method references that are verified to be native. */
  91077. var Promise = Object(_getNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_root_js__WEBPACK_IMPORTED_MODULE_1__["default"], 'Promise');
  91078. /* harmony default export */ __webpack_exports__["default"] = (Promise);
  91079. /***/ }),
  91080. /***/ "./node_modules/lodash-es/_Set.js":
  91081. /*!****************************************!*\
  91082. !*** ./node_modules/lodash-es/_Set.js ***!
  91083. \****************************************/
  91084. /*! exports provided: default */
  91085. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91086. "use strict";
  91087. __webpack_require__.r(__webpack_exports__);
  91088. /* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getNative.js */ "./node_modules/lodash-es/_getNative.js");
  91089. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  91090. /* Built-in method references that are verified to be native. */
  91091. var Set = Object(_getNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_root_js__WEBPACK_IMPORTED_MODULE_1__["default"], 'Set');
  91092. /* harmony default export */ __webpack_exports__["default"] = (Set);
  91093. /***/ }),
  91094. /***/ "./node_modules/lodash-es/_SetCache.js":
  91095. /*!*********************************************!*\
  91096. !*** ./node_modules/lodash-es/_SetCache.js ***!
  91097. \*********************************************/
  91098. /*! exports provided: default */
  91099. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91100. "use strict";
  91101. __webpack_require__.r(__webpack_exports__);
  91102. /* harmony import */ var _MapCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_MapCache.js */ "./node_modules/lodash-es/_MapCache.js");
  91103. /* harmony import */ var _setCacheAdd_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_setCacheAdd.js */ "./node_modules/lodash-es/_setCacheAdd.js");
  91104. /* harmony import */ var _setCacheHas_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_setCacheHas.js */ "./node_modules/lodash-es/_setCacheHas.js");
  91105. /**
  91106. *
  91107. * Creates an array cache object to store unique values.
  91108. *
  91109. * @private
  91110. * @constructor
  91111. * @param {Array} [values] The values to cache.
  91112. */
  91113. function SetCache(values) {
  91114. var index = -1,
  91115. length = values == null ? 0 : values.length;
  91116. this.__data__ = new _MapCache_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  91117. while (++index < length) {
  91118. this.add(values[index]);
  91119. }
  91120. }
  91121. // Add methods to `SetCache`.
  91122. SetCache.prototype.add = SetCache.prototype.push = _setCacheAdd_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  91123. SetCache.prototype.has = _setCacheHas_js__WEBPACK_IMPORTED_MODULE_2__["default"];
  91124. /* harmony default export */ __webpack_exports__["default"] = (SetCache);
  91125. /***/ }),
  91126. /***/ "./node_modules/lodash-es/_Stack.js":
  91127. /*!******************************************!*\
  91128. !*** ./node_modules/lodash-es/_Stack.js ***!
  91129. \******************************************/
  91130. /*! exports provided: default */
  91131. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91132. "use strict";
  91133. __webpack_require__.r(__webpack_exports__);
  91134. /* harmony import */ var _ListCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_ListCache.js */ "./node_modules/lodash-es/_ListCache.js");
  91135. /* harmony import */ var _stackClear_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_stackClear.js */ "./node_modules/lodash-es/_stackClear.js");
  91136. /* harmony import */ var _stackDelete_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_stackDelete.js */ "./node_modules/lodash-es/_stackDelete.js");
  91137. /* harmony import */ var _stackGet_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_stackGet.js */ "./node_modules/lodash-es/_stackGet.js");
  91138. /* harmony import */ var _stackHas_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_stackHas.js */ "./node_modules/lodash-es/_stackHas.js");
  91139. /* harmony import */ var _stackSet_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_stackSet.js */ "./node_modules/lodash-es/_stackSet.js");
  91140. /**
  91141. * Creates a stack cache object to store key-value pairs.
  91142. *
  91143. * @private
  91144. * @constructor
  91145. * @param {Array} [entries] The key-value pairs to cache.
  91146. */
  91147. function Stack(entries) {
  91148. var data = this.__data__ = new _ListCache_js__WEBPACK_IMPORTED_MODULE_0__["default"](entries);
  91149. this.size = data.size;
  91150. }
  91151. // Add methods to `Stack`.
  91152. Stack.prototype.clear = _stackClear_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  91153. Stack.prototype['delete'] = _stackDelete_js__WEBPACK_IMPORTED_MODULE_2__["default"];
  91154. Stack.prototype.get = _stackGet_js__WEBPACK_IMPORTED_MODULE_3__["default"];
  91155. Stack.prototype.has = _stackHas_js__WEBPACK_IMPORTED_MODULE_4__["default"];
  91156. Stack.prototype.set = _stackSet_js__WEBPACK_IMPORTED_MODULE_5__["default"];
  91157. /* harmony default export */ __webpack_exports__["default"] = (Stack);
  91158. /***/ }),
  91159. /***/ "./node_modules/lodash-es/_Symbol.js":
  91160. /*!*******************************************!*\
  91161. !*** ./node_modules/lodash-es/_Symbol.js ***!
  91162. \*******************************************/
  91163. /*! exports provided: default */
  91164. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91165. "use strict";
  91166. __webpack_require__.r(__webpack_exports__);
  91167. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  91168. /** Built-in value references. */
  91169. var Symbol = _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].Symbol;
  91170. /* harmony default export */ __webpack_exports__["default"] = (Symbol);
  91171. /***/ }),
  91172. /***/ "./node_modules/lodash-es/_Uint8Array.js":
  91173. /*!***********************************************!*\
  91174. !*** ./node_modules/lodash-es/_Uint8Array.js ***!
  91175. \***********************************************/
  91176. /*! exports provided: default */
  91177. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91178. "use strict";
  91179. __webpack_require__.r(__webpack_exports__);
  91180. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  91181. /** Built-in value references. */
  91182. var Uint8Array = _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].Uint8Array;
  91183. /* harmony default export */ __webpack_exports__["default"] = (Uint8Array);
  91184. /***/ }),
  91185. /***/ "./node_modules/lodash-es/_WeakMap.js":
  91186. /*!********************************************!*\
  91187. !*** ./node_modules/lodash-es/_WeakMap.js ***!
  91188. \********************************************/
  91189. /*! exports provided: default */
  91190. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91191. "use strict";
  91192. __webpack_require__.r(__webpack_exports__);
  91193. /* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getNative.js */ "./node_modules/lodash-es/_getNative.js");
  91194. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  91195. /* Built-in method references that are verified to be native. */
  91196. var WeakMap = Object(_getNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_root_js__WEBPACK_IMPORTED_MODULE_1__["default"], 'WeakMap');
  91197. /* harmony default export */ __webpack_exports__["default"] = (WeakMap);
  91198. /***/ }),
  91199. /***/ "./node_modules/lodash-es/_apply.js":
  91200. /*!******************************************!*\
  91201. !*** ./node_modules/lodash-es/_apply.js ***!
  91202. \******************************************/
  91203. /*! exports provided: default */
  91204. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91205. "use strict";
  91206. __webpack_require__.r(__webpack_exports__);
  91207. /**
  91208. * A faster alternative to `Function#apply`, this function invokes `func`
  91209. * with the `this` binding of `thisArg` and the arguments of `args`.
  91210. *
  91211. * @private
  91212. * @param {Function} func The function to invoke.
  91213. * @param {*} thisArg The `this` binding of `func`.
  91214. * @param {Array} args The arguments to invoke `func` with.
  91215. * @returns {*} Returns the result of `func`.
  91216. */
  91217. function apply(func, thisArg, args) {
  91218. switch (args.length) {
  91219. case 0: return func.call(thisArg);
  91220. case 1: return func.call(thisArg, args[0]);
  91221. case 2: return func.call(thisArg, args[0], args[1]);
  91222. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  91223. }
  91224. return func.apply(thisArg, args);
  91225. }
  91226. /* harmony default export */ __webpack_exports__["default"] = (apply);
  91227. /***/ }),
  91228. /***/ "./node_modules/lodash-es/_arrayAggregator.js":
  91229. /*!****************************************************!*\
  91230. !*** ./node_modules/lodash-es/_arrayAggregator.js ***!
  91231. \****************************************************/
  91232. /*! exports provided: default */
  91233. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91234. "use strict";
  91235. __webpack_require__.r(__webpack_exports__);
  91236. /**
  91237. * A specialized version of `baseAggregator` for arrays.
  91238. *
  91239. * @private
  91240. * @param {Array} [array] The array to iterate over.
  91241. * @param {Function} setter The function to set `accumulator` values.
  91242. * @param {Function} iteratee The iteratee to transform keys.
  91243. * @param {Object} accumulator The initial aggregated object.
  91244. * @returns {Function} Returns `accumulator`.
  91245. */
  91246. function arrayAggregator(array, setter, iteratee, accumulator) {
  91247. var index = -1,
  91248. length = array == null ? 0 : array.length;
  91249. while (++index < length) {
  91250. var value = array[index];
  91251. setter(accumulator, value, iteratee(value), array);
  91252. }
  91253. return accumulator;
  91254. }
  91255. /* harmony default export */ __webpack_exports__["default"] = (arrayAggregator);
  91256. /***/ }),
  91257. /***/ "./node_modules/lodash-es/_arrayEach.js":
  91258. /*!**********************************************!*\
  91259. !*** ./node_modules/lodash-es/_arrayEach.js ***!
  91260. \**********************************************/
  91261. /*! exports provided: default */
  91262. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91263. "use strict";
  91264. __webpack_require__.r(__webpack_exports__);
  91265. /**
  91266. * A specialized version of `_.forEach` for arrays without support for
  91267. * iteratee shorthands.
  91268. *
  91269. * @private
  91270. * @param {Array} [array] The array to iterate over.
  91271. * @param {Function} iteratee The function invoked per iteration.
  91272. * @returns {Array} Returns `array`.
  91273. */
  91274. function arrayEach(array, iteratee) {
  91275. var index = -1,
  91276. length = array == null ? 0 : array.length;
  91277. while (++index < length) {
  91278. if (iteratee(array[index], index, array) === false) {
  91279. break;
  91280. }
  91281. }
  91282. return array;
  91283. }
  91284. /* harmony default export */ __webpack_exports__["default"] = (arrayEach);
  91285. /***/ }),
  91286. /***/ "./node_modules/lodash-es/_arrayEachRight.js":
  91287. /*!***************************************************!*\
  91288. !*** ./node_modules/lodash-es/_arrayEachRight.js ***!
  91289. \***************************************************/
  91290. /*! exports provided: default */
  91291. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91292. "use strict";
  91293. __webpack_require__.r(__webpack_exports__);
  91294. /**
  91295. * A specialized version of `_.forEachRight` for arrays without support for
  91296. * iteratee shorthands.
  91297. *
  91298. * @private
  91299. * @param {Array} [array] The array to iterate over.
  91300. * @param {Function} iteratee The function invoked per iteration.
  91301. * @returns {Array} Returns `array`.
  91302. */
  91303. function arrayEachRight(array, iteratee) {
  91304. var length = array == null ? 0 : array.length;
  91305. while (length--) {
  91306. if (iteratee(array[length], length, array) === false) {
  91307. break;
  91308. }
  91309. }
  91310. return array;
  91311. }
  91312. /* harmony default export */ __webpack_exports__["default"] = (arrayEachRight);
  91313. /***/ }),
  91314. /***/ "./node_modules/lodash-es/_arrayEvery.js":
  91315. /*!***********************************************!*\
  91316. !*** ./node_modules/lodash-es/_arrayEvery.js ***!
  91317. \***********************************************/
  91318. /*! exports provided: default */
  91319. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91320. "use strict";
  91321. __webpack_require__.r(__webpack_exports__);
  91322. /**
  91323. * A specialized version of `_.every` for arrays without support for
  91324. * iteratee shorthands.
  91325. *
  91326. * @private
  91327. * @param {Array} [array] The array to iterate over.
  91328. * @param {Function} predicate The function invoked per iteration.
  91329. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  91330. * else `false`.
  91331. */
  91332. function arrayEvery(array, predicate) {
  91333. var index = -1,
  91334. length = array == null ? 0 : array.length;
  91335. while (++index < length) {
  91336. if (!predicate(array[index], index, array)) {
  91337. return false;
  91338. }
  91339. }
  91340. return true;
  91341. }
  91342. /* harmony default export */ __webpack_exports__["default"] = (arrayEvery);
  91343. /***/ }),
  91344. /***/ "./node_modules/lodash-es/_arrayFilter.js":
  91345. /*!************************************************!*\
  91346. !*** ./node_modules/lodash-es/_arrayFilter.js ***!
  91347. \************************************************/
  91348. /*! exports provided: default */
  91349. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91350. "use strict";
  91351. __webpack_require__.r(__webpack_exports__);
  91352. /**
  91353. * A specialized version of `_.filter` for arrays without support for
  91354. * iteratee shorthands.
  91355. *
  91356. * @private
  91357. * @param {Array} [array] The array to iterate over.
  91358. * @param {Function} predicate The function invoked per iteration.
  91359. * @returns {Array} Returns the new filtered array.
  91360. */
  91361. function arrayFilter(array, predicate) {
  91362. var index = -1,
  91363. length = array == null ? 0 : array.length,
  91364. resIndex = 0,
  91365. result = [];
  91366. while (++index < length) {
  91367. var value = array[index];
  91368. if (predicate(value, index, array)) {
  91369. result[resIndex++] = value;
  91370. }
  91371. }
  91372. return result;
  91373. }
  91374. /* harmony default export */ __webpack_exports__["default"] = (arrayFilter);
  91375. /***/ }),
  91376. /***/ "./node_modules/lodash-es/_arrayIncludes.js":
  91377. /*!**************************************************!*\
  91378. !*** ./node_modules/lodash-es/_arrayIncludes.js ***!
  91379. \**************************************************/
  91380. /*! exports provided: default */
  91381. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91382. "use strict";
  91383. __webpack_require__.r(__webpack_exports__);
  91384. /* harmony import */ var _baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIndexOf.js */ "./node_modules/lodash-es/_baseIndexOf.js");
  91385. /**
  91386. * A specialized version of `_.includes` for arrays without support for
  91387. * specifying an index to search from.
  91388. *
  91389. * @private
  91390. * @param {Array} [array] The array to inspect.
  91391. * @param {*} target The value to search for.
  91392. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  91393. */
  91394. function arrayIncludes(array, value) {
  91395. var length = array == null ? 0 : array.length;
  91396. return !!length && Object(_baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, value, 0) > -1;
  91397. }
  91398. /* harmony default export */ __webpack_exports__["default"] = (arrayIncludes);
  91399. /***/ }),
  91400. /***/ "./node_modules/lodash-es/_arrayIncludesWith.js":
  91401. /*!******************************************************!*\
  91402. !*** ./node_modules/lodash-es/_arrayIncludesWith.js ***!
  91403. \******************************************************/
  91404. /*! exports provided: default */
  91405. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91406. "use strict";
  91407. __webpack_require__.r(__webpack_exports__);
  91408. /**
  91409. * This function is like `arrayIncludes` except that it accepts a comparator.
  91410. *
  91411. * @private
  91412. * @param {Array} [array] The array to inspect.
  91413. * @param {*} target The value to search for.
  91414. * @param {Function} comparator The comparator invoked per element.
  91415. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  91416. */
  91417. function arrayIncludesWith(array, value, comparator) {
  91418. var index = -1,
  91419. length = array == null ? 0 : array.length;
  91420. while (++index < length) {
  91421. if (comparator(value, array[index])) {
  91422. return true;
  91423. }
  91424. }
  91425. return false;
  91426. }
  91427. /* harmony default export */ __webpack_exports__["default"] = (arrayIncludesWith);
  91428. /***/ }),
  91429. /***/ "./node_modules/lodash-es/_arrayLikeKeys.js":
  91430. /*!**************************************************!*\
  91431. !*** ./node_modules/lodash-es/_arrayLikeKeys.js ***!
  91432. \**************************************************/
  91433. /*! exports provided: default */
  91434. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91435. "use strict";
  91436. __webpack_require__.r(__webpack_exports__);
  91437. /* harmony import */ var _baseTimes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseTimes.js */ "./node_modules/lodash-es/_baseTimes.js");
  91438. /* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
  91439. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  91440. /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
  91441. /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
  91442. /* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/lodash-es/isTypedArray.js");
  91443. /** Used for built-in method references. */
  91444. var objectProto = Object.prototype;
  91445. /** Used to check objects for own properties. */
  91446. var hasOwnProperty = objectProto.hasOwnProperty;
  91447. /**
  91448. * Creates an array of the enumerable property names of the array-like `value`.
  91449. *
  91450. * @private
  91451. * @param {*} value The value to query.
  91452. * @param {boolean} inherited Specify returning inherited property names.
  91453. * @returns {Array} Returns the array of property names.
  91454. */
  91455. function arrayLikeKeys(value, inherited) {
  91456. var isArr = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value),
  91457. isArg = !isArr && Object(_isArguments_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value),
  91458. isBuff = !isArr && !isArg && Object(_isBuffer_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value),
  91459. isType = !isArr && !isArg && !isBuff && Object(_isTypedArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(value),
  91460. skipIndexes = isArr || isArg || isBuff || isType,
  91461. result = skipIndexes ? Object(_baseTimes_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value.length, String) : [],
  91462. length = result.length;
  91463. for (var key in value) {
  91464. if ((inherited || hasOwnProperty.call(value, key)) &&
  91465. !(skipIndexes && (
  91466. // Safari 9 has enumerable `arguments.length` in strict mode.
  91467. key == 'length' ||
  91468. // Node.js 0.10 has enumerable non-index properties on buffers.
  91469. (isBuff && (key == 'offset' || key == 'parent')) ||
  91470. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  91471. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  91472. // Skip index properties.
  91473. Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_4__["default"])(key, length)
  91474. ))) {
  91475. result.push(key);
  91476. }
  91477. }
  91478. return result;
  91479. }
  91480. /* harmony default export */ __webpack_exports__["default"] = (arrayLikeKeys);
  91481. /***/ }),
  91482. /***/ "./node_modules/lodash-es/_arrayMap.js":
  91483. /*!*********************************************!*\
  91484. !*** ./node_modules/lodash-es/_arrayMap.js ***!
  91485. \*********************************************/
  91486. /*! exports provided: default */
  91487. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91488. "use strict";
  91489. __webpack_require__.r(__webpack_exports__);
  91490. /**
  91491. * A specialized version of `_.map` for arrays without support for iteratee
  91492. * shorthands.
  91493. *
  91494. * @private
  91495. * @param {Array} [array] The array to iterate over.
  91496. * @param {Function} iteratee The function invoked per iteration.
  91497. * @returns {Array} Returns the new mapped array.
  91498. */
  91499. function arrayMap(array, iteratee) {
  91500. var index = -1,
  91501. length = array == null ? 0 : array.length,
  91502. result = Array(length);
  91503. while (++index < length) {
  91504. result[index] = iteratee(array[index], index, array);
  91505. }
  91506. return result;
  91507. }
  91508. /* harmony default export */ __webpack_exports__["default"] = (arrayMap);
  91509. /***/ }),
  91510. /***/ "./node_modules/lodash-es/_arrayPush.js":
  91511. /*!**********************************************!*\
  91512. !*** ./node_modules/lodash-es/_arrayPush.js ***!
  91513. \**********************************************/
  91514. /*! exports provided: default */
  91515. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91516. "use strict";
  91517. __webpack_require__.r(__webpack_exports__);
  91518. /**
  91519. * Appends the elements of `values` to `array`.
  91520. *
  91521. * @private
  91522. * @param {Array} array The array to modify.
  91523. * @param {Array} values The values to append.
  91524. * @returns {Array} Returns `array`.
  91525. */
  91526. function arrayPush(array, values) {
  91527. var index = -1,
  91528. length = values.length,
  91529. offset = array.length;
  91530. while (++index < length) {
  91531. array[offset + index] = values[index];
  91532. }
  91533. return array;
  91534. }
  91535. /* harmony default export */ __webpack_exports__["default"] = (arrayPush);
  91536. /***/ }),
  91537. /***/ "./node_modules/lodash-es/_arrayReduce.js":
  91538. /*!************************************************!*\
  91539. !*** ./node_modules/lodash-es/_arrayReduce.js ***!
  91540. \************************************************/
  91541. /*! exports provided: default */
  91542. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91543. "use strict";
  91544. __webpack_require__.r(__webpack_exports__);
  91545. /**
  91546. * A specialized version of `_.reduce` for arrays without support for
  91547. * iteratee shorthands.
  91548. *
  91549. * @private
  91550. * @param {Array} [array] The array to iterate over.
  91551. * @param {Function} iteratee The function invoked per iteration.
  91552. * @param {*} [accumulator] The initial value.
  91553. * @param {boolean} [initAccum] Specify using the first element of `array` as
  91554. * the initial value.
  91555. * @returns {*} Returns the accumulated value.
  91556. */
  91557. function arrayReduce(array, iteratee, accumulator, initAccum) {
  91558. var index = -1,
  91559. length = array == null ? 0 : array.length;
  91560. if (initAccum && length) {
  91561. accumulator = array[++index];
  91562. }
  91563. while (++index < length) {
  91564. accumulator = iteratee(accumulator, array[index], index, array);
  91565. }
  91566. return accumulator;
  91567. }
  91568. /* harmony default export */ __webpack_exports__["default"] = (arrayReduce);
  91569. /***/ }),
  91570. /***/ "./node_modules/lodash-es/_arrayReduceRight.js":
  91571. /*!*****************************************************!*\
  91572. !*** ./node_modules/lodash-es/_arrayReduceRight.js ***!
  91573. \*****************************************************/
  91574. /*! exports provided: default */
  91575. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91576. "use strict";
  91577. __webpack_require__.r(__webpack_exports__);
  91578. /**
  91579. * A specialized version of `_.reduceRight` for arrays without support for
  91580. * iteratee shorthands.
  91581. *
  91582. * @private
  91583. * @param {Array} [array] The array to iterate over.
  91584. * @param {Function} iteratee The function invoked per iteration.
  91585. * @param {*} [accumulator] The initial value.
  91586. * @param {boolean} [initAccum] Specify using the last element of `array` as
  91587. * the initial value.
  91588. * @returns {*} Returns the accumulated value.
  91589. */
  91590. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  91591. var length = array == null ? 0 : array.length;
  91592. if (initAccum && length) {
  91593. accumulator = array[--length];
  91594. }
  91595. while (length--) {
  91596. accumulator = iteratee(accumulator, array[length], length, array);
  91597. }
  91598. return accumulator;
  91599. }
  91600. /* harmony default export */ __webpack_exports__["default"] = (arrayReduceRight);
  91601. /***/ }),
  91602. /***/ "./node_modules/lodash-es/_arraySample.js":
  91603. /*!************************************************!*\
  91604. !*** ./node_modules/lodash-es/_arraySample.js ***!
  91605. \************************************************/
  91606. /*! exports provided: default */
  91607. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91608. "use strict";
  91609. __webpack_require__.r(__webpack_exports__);
  91610. /* harmony import */ var _baseRandom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRandom.js */ "./node_modules/lodash-es/_baseRandom.js");
  91611. /**
  91612. * A specialized version of `_.sample` for arrays.
  91613. *
  91614. * @private
  91615. * @param {Array} array The array to sample.
  91616. * @returns {*} Returns the random element.
  91617. */
  91618. function arraySample(array) {
  91619. var length = array.length;
  91620. return length ? array[Object(_baseRandom_js__WEBPACK_IMPORTED_MODULE_0__["default"])(0, length - 1)] : undefined;
  91621. }
  91622. /* harmony default export */ __webpack_exports__["default"] = (arraySample);
  91623. /***/ }),
  91624. /***/ "./node_modules/lodash-es/_arraySampleSize.js":
  91625. /*!****************************************************!*\
  91626. !*** ./node_modules/lodash-es/_arraySampleSize.js ***!
  91627. \****************************************************/
  91628. /*! exports provided: default */
  91629. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91630. "use strict";
  91631. __webpack_require__.r(__webpack_exports__);
  91632. /* harmony import */ var _baseClamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClamp.js */ "./node_modules/lodash-es/_baseClamp.js");
  91633. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  91634. /* harmony import */ var _shuffleSelf_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_shuffleSelf.js */ "./node_modules/lodash-es/_shuffleSelf.js");
  91635. /**
  91636. * A specialized version of `_.sampleSize` for arrays.
  91637. *
  91638. * @private
  91639. * @param {Array} array The array to sample.
  91640. * @param {number} n The number of elements to sample.
  91641. * @returns {Array} Returns the random elements.
  91642. */
  91643. function arraySampleSize(array, n) {
  91644. return Object(_shuffleSelf_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array), Object(_baseClamp_js__WEBPACK_IMPORTED_MODULE_0__["default"])(n, 0, array.length));
  91645. }
  91646. /* harmony default export */ __webpack_exports__["default"] = (arraySampleSize);
  91647. /***/ }),
  91648. /***/ "./node_modules/lodash-es/_arrayShuffle.js":
  91649. /*!*************************************************!*\
  91650. !*** ./node_modules/lodash-es/_arrayShuffle.js ***!
  91651. \*************************************************/
  91652. /*! exports provided: default */
  91653. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91654. "use strict";
  91655. __webpack_require__.r(__webpack_exports__);
  91656. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  91657. /* harmony import */ var _shuffleSelf_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_shuffleSelf.js */ "./node_modules/lodash-es/_shuffleSelf.js");
  91658. /**
  91659. * A specialized version of `_.shuffle` for arrays.
  91660. *
  91661. * @private
  91662. * @param {Array} array The array to shuffle.
  91663. * @returns {Array} Returns the new shuffled array.
  91664. */
  91665. function arrayShuffle(array) {
  91666. return Object(_shuffleSelf_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array));
  91667. }
  91668. /* harmony default export */ __webpack_exports__["default"] = (arrayShuffle);
  91669. /***/ }),
  91670. /***/ "./node_modules/lodash-es/_arraySome.js":
  91671. /*!**********************************************!*\
  91672. !*** ./node_modules/lodash-es/_arraySome.js ***!
  91673. \**********************************************/
  91674. /*! exports provided: default */
  91675. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91676. "use strict";
  91677. __webpack_require__.r(__webpack_exports__);
  91678. /**
  91679. * A specialized version of `_.some` for arrays without support for iteratee
  91680. * shorthands.
  91681. *
  91682. * @private
  91683. * @param {Array} [array] The array to iterate over.
  91684. * @param {Function} predicate The function invoked per iteration.
  91685. * @returns {boolean} Returns `true` if any element passes the predicate check,
  91686. * else `false`.
  91687. */
  91688. function arraySome(array, predicate) {
  91689. var index = -1,
  91690. length = array == null ? 0 : array.length;
  91691. while (++index < length) {
  91692. if (predicate(array[index], index, array)) {
  91693. return true;
  91694. }
  91695. }
  91696. return false;
  91697. }
  91698. /* harmony default export */ __webpack_exports__["default"] = (arraySome);
  91699. /***/ }),
  91700. /***/ "./node_modules/lodash-es/_asciiSize.js":
  91701. /*!**********************************************!*\
  91702. !*** ./node_modules/lodash-es/_asciiSize.js ***!
  91703. \**********************************************/
  91704. /*! exports provided: default */
  91705. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91706. "use strict";
  91707. __webpack_require__.r(__webpack_exports__);
  91708. /* harmony import */ var _baseProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseProperty.js */ "./node_modules/lodash-es/_baseProperty.js");
  91709. /**
  91710. * Gets the size of an ASCII `string`.
  91711. *
  91712. * @private
  91713. * @param {string} string The string inspect.
  91714. * @returns {number} Returns the string size.
  91715. */
  91716. var asciiSize = Object(_baseProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])('length');
  91717. /* harmony default export */ __webpack_exports__["default"] = (asciiSize);
  91718. /***/ }),
  91719. /***/ "./node_modules/lodash-es/_asciiToArray.js":
  91720. /*!*************************************************!*\
  91721. !*** ./node_modules/lodash-es/_asciiToArray.js ***!
  91722. \*************************************************/
  91723. /*! exports provided: default */
  91724. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91725. "use strict";
  91726. __webpack_require__.r(__webpack_exports__);
  91727. /**
  91728. * Converts an ASCII `string` to an array.
  91729. *
  91730. * @private
  91731. * @param {string} string The string to convert.
  91732. * @returns {Array} Returns the converted array.
  91733. */
  91734. function asciiToArray(string) {
  91735. return string.split('');
  91736. }
  91737. /* harmony default export */ __webpack_exports__["default"] = (asciiToArray);
  91738. /***/ }),
  91739. /***/ "./node_modules/lodash-es/_asciiWords.js":
  91740. /*!***********************************************!*\
  91741. !*** ./node_modules/lodash-es/_asciiWords.js ***!
  91742. \***********************************************/
  91743. /*! exports provided: default */
  91744. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91745. "use strict";
  91746. __webpack_require__.r(__webpack_exports__);
  91747. /** Used to match words composed of alphanumeric characters. */
  91748. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  91749. /**
  91750. * Splits an ASCII `string` into an array of its words.
  91751. *
  91752. * @private
  91753. * @param {string} The string to inspect.
  91754. * @returns {Array} Returns the words of `string`.
  91755. */
  91756. function asciiWords(string) {
  91757. return string.match(reAsciiWord) || [];
  91758. }
  91759. /* harmony default export */ __webpack_exports__["default"] = (asciiWords);
  91760. /***/ }),
  91761. /***/ "./node_modules/lodash-es/_assignMergeValue.js":
  91762. /*!*****************************************************!*\
  91763. !*** ./node_modules/lodash-es/_assignMergeValue.js ***!
  91764. \*****************************************************/
  91765. /*! exports provided: default */
  91766. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91767. "use strict";
  91768. __webpack_require__.r(__webpack_exports__);
  91769. /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
  91770. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  91771. /**
  91772. * This function is like `assignValue` except that it doesn't assign
  91773. * `undefined` values.
  91774. *
  91775. * @private
  91776. * @param {Object} object The object to modify.
  91777. * @param {string} key The key of the property to assign.
  91778. * @param {*} value The value to assign.
  91779. */
  91780. function assignMergeValue(object, key, value) {
  91781. if ((value !== undefined && !Object(_eq_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object[key], value)) ||
  91782. (value === undefined && !(key in object))) {
  91783. Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, key, value);
  91784. }
  91785. }
  91786. /* harmony default export */ __webpack_exports__["default"] = (assignMergeValue);
  91787. /***/ }),
  91788. /***/ "./node_modules/lodash-es/_assignValue.js":
  91789. /*!************************************************!*\
  91790. !*** ./node_modules/lodash-es/_assignValue.js ***!
  91791. \************************************************/
  91792. /*! exports provided: default */
  91793. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91794. "use strict";
  91795. __webpack_require__.r(__webpack_exports__);
  91796. /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
  91797. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  91798. /** Used for built-in method references. */
  91799. var objectProto = Object.prototype;
  91800. /** Used to check objects for own properties. */
  91801. var hasOwnProperty = objectProto.hasOwnProperty;
  91802. /**
  91803. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  91804. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  91805. * for equality comparisons.
  91806. *
  91807. * @private
  91808. * @param {Object} object The object to modify.
  91809. * @param {string} key The key of the property to assign.
  91810. * @param {*} value The value to assign.
  91811. */
  91812. function assignValue(object, key, value) {
  91813. var objValue = object[key];
  91814. if (!(hasOwnProperty.call(object, key) && Object(_eq_js__WEBPACK_IMPORTED_MODULE_1__["default"])(objValue, value)) ||
  91815. (value === undefined && !(key in object))) {
  91816. Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, key, value);
  91817. }
  91818. }
  91819. /* harmony default export */ __webpack_exports__["default"] = (assignValue);
  91820. /***/ }),
  91821. /***/ "./node_modules/lodash-es/_assocIndexOf.js":
  91822. /*!*************************************************!*\
  91823. !*** ./node_modules/lodash-es/_assocIndexOf.js ***!
  91824. \*************************************************/
  91825. /*! exports provided: default */
  91826. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91827. "use strict";
  91828. __webpack_require__.r(__webpack_exports__);
  91829. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  91830. /**
  91831. * Gets the index at which the `key` is found in `array` of key-value pairs.
  91832. *
  91833. * @private
  91834. * @param {Array} array The array to inspect.
  91835. * @param {*} key The key to search for.
  91836. * @returns {number} Returns the index of the matched value, else `-1`.
  91837. */
  91838. function assocIndexOf(array, key) {
  91839. var length = array.length;
  91840. while (length--) {
  91841. if (Object(_eq_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array[length][0], key)) {
  91842. return length;
  91843. }
  91844. }
  91845. return -1;
  91846. }
  91847. /* harmony default export */ __webpack_exports__["default"] = (assocIndexOf);
  91848. /***/ }),
  91849. /***/ "./node_modules/lodash-es/_baseAggregator.js":
  91850. /*!***************************************************!*\
  91851. !*** ./node_modules/lodash-es/_baseAggregator.js ***!
  91852. \***************************************************/
  91853. /*! exports provided: default */
  91854. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91855. "use strict";
  91856. __webpack_require__.r(__webpack_exports__);
  91857. /* harmony import */ var _baseEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseEach.js */ "./node_modules/lodash-es/_baseEach.js");
  91858. /**
  91859. * Aggregates elements of `collection` on `accumulator` with keys transformed
  91860. * by `iteratee` and values set by `setter`.
  91861. *
  91862. * @private
  91863. * @param {Array|Object} collection The collection to iterate over.
  91864. * @param {Function} setter The function to set `accumulator` values.
  91865. * @param {Function} iteratee The iteratee to transform keys.
  91866. * @param {Object} accumulator The initial aggregated object.
  91867. * @returns {Function} Returns `accumulator`.
  91868. */
  91869. function baseAggregator(collection, setter, iteratee, accumulator) {
  91870. Object(_baseEach_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection, function(value, key, collection) {
  91871. setter(accumulator, value, iteratee(value), collection);
  91872. });
  91873. return accumulator;
  91874. }
  91875. /* harmony default export */ __webpack_exports__["default"] = (baseAggregator);
  91876. /***/ }),
  91877. /***/ "./node_modules/lodash-es/_baseAssign.js":
  91878. /*!***********************************************!*\
  91879. !*** ./node_modules/lodash-es/_baseAssign.js ***!
  91880. \***********************************************/
  91881. /*! exports provided: default */
  91882. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91883. "use strict";
  91884. __webpack_require__.r(__webpack_exports__);
  91885. /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
  91886. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  91887. /**
  91888. * The base implementation of `_.assign` without support for multiple sources
  91889. * or `customizer` functions.
  91890. *
  91891. * @private
  91892. * @param {Object} object The destination object.
  91893. * @param {Object} source The source object.
  91894. * @returns {Object} Returns `object`.
  91895. */
  91896. function baseAssign(object, source) {
  91897. return object && Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, Object(_keys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source), object);
  91898. }
  91899. /* harmony default export */ __webpack_exports__["default"] = (baseAssign);
  91900. /***/ }),
  91901. /***/ "./node_modules/lodash-es/_baseAssignIn.js":
  91902. /*!*************************************************!*\
  91903. !*** ./node_modules/lodash-es/_baseAssignIn.js ***!
  91904. \*************************************************/
  91905. /*! exports provided: default */
  91906. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91907. "use strict";
  91908. __webpack_require__.r(__webpack_exports__);
  91909. /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
  91910. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  91911. /**
  91912. * The base implementation of `_.assignIn` without support for multiple sources
  91913. * or `customizer` functions.
  91914. *
  91915. * @private
  91916. * @param {Object} object The destination object.
  91917. * @param {Object} source The source object.
  91918. * @returns {Object} Returns `object`.
  91919. */
  91920. function baseAssignIn(object, source) {
  91921. return object && Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, Object(_keysIn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source), object);
  91922. }
  91923. /* harmony default export */ __webpack_exports__["default"] = (baseAssignIn);
  91924. /***/ }),
  91925. /***/ "./node_modules/lodash-es/_baseAssignValue.js":
  91926. /*!****************************************************!*\
  91927. !*** ./node_modules/lodash-es/_baseAssignValue.js ***!
  91928. \****************************************************/
  91929. /*! exports provided: default */
  91930. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91931. "use strict";
  91932. __webpack_require__.r(__webpack_exports__);
  91933. /* harmony import */ var _defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_defineProperty.js */ "./node_modules/lodash-es/_defineProperty.js");
  91934. /**
  91935. * The base implementation of `assignValue` and `assignMergeValue` without
  91936. * value checks.
  91937. *
  91938. * @private
  91939. * @param {Object} object The object to modify.
  91940. * @param {string} key The key of the property to assign.
  91941. * @param {*} value The value to assign.
  91942. */
  91943. function baseAssignValue(object, key, value) {
  91944. if (key == '__proto__' && _defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"]) {
  91945. Object(_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, key, {
  91946. 'configurable': true,
  91947. 'enumerable': true,
  91948. 'value': value,
  91949. 'writable': true
  91950. });
  91951. } else {
  91952. object[key] = value;
  91953. }
  91954. }
  91955. /* harmony default export */ __webpack_exports__["default"] = (baseAssignValue);
  91956. /***/ }),
  91957. /***/ "./node_modules/lodash-es/_baseAt.js":
  91958. /*!*******************************************!*\
  91959. !*** ./node_modules/lodash-es/_baseAt.js ***!
  91960. \*******************************************/
  91961. /*! exports provided: default */
  91962. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91963. "use strict";
  91964. __webpack_require__.r(__webpack_exports__);
  91965. /* harmony import */ var _get_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./get.js */ "./node_modules/lodash-es/get.js");
  91966. /**
  91967. * The base implementation of `_.at` without support for individual paths.
  91968. *
  91969. * @private
  91970. * @param {Object} object The object to iterate over.
  91971. * @param {string[]} paths The property paths to pick.
  91972. * @returns {Array} Returns the picked elements.
  91973. */
  91974. function baseAt(object, paths) {
  91975. var index = -1,
  91976. length = paths.length,
  91977. result = Array(length),
  91978. skip = object == null;
  91979. while (++index < length) {
  91980. result[index] = skip ? undefined : Object(_get_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, paths[index]);
  91981. }
  91982. return result;
  91983. }
  91984. /* harmony default export */ __webpack_exports__["default"] = (baseAt);
  91985. /***/ }),
  91986. /***/ "./node_modules/lodash-es/_baseClamp.js":
  91987. /*!**********************************************!*\
  91988. !*** ./node_modules/lodash-es/_baseClamp.js ***!
  91989. \**********************************************/
  91990. /*! exports provided: default */
  91991. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91992. "use strict";
  91993. __webpack_require__.r(__webpack_exports__);
  91994. /**
  91995. * The base implementation of `_.clamp` which doesn't coerce arguments.
  91996. *
  91997. * @private
  91998. * @param {number} number The number to clamp.
  91999. * @param {number} [lower] The lower bound.
  92000. * @param {number} upper The upper bound.
  92001. * @returns {number} Returns the clamped number.
  92002. */
  92003. function baseClamp(number, lower, upper) {
  92004. if (number === number) {
  92005. if (upper !== undefined) {
  92006. number = number <= upper ? number : upper;
  92007. }
  92008. if (lower !== undefined) {
  92009. number = number >= lower ? number : lower;
  92010. }
  92011. }
  92012. return number;
  92013. }
  92014. /* harmony default export */ __webpack_exports__["default"] = (baseClamp);
  92015. /***/ }),
  92016. /***/ "./node_modules/lodash-es/_baseClone.js":
  92017. /*!**********************************************!*\
  92018. !*** ./node_modules/lodash-es/_baseClone.js ***!
  92019. \**********************************************/
  92020. /*! exports provided: default */
  92021. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92022. "use strict";
  92023. __webpack_require__.r(__webpack_exports__);
  92024. /* harmony import */ var _Stack_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Stack.js */ "./node_modules/lodash-es/_Stack.js");
  92025. /* harmony import */ var _arrayEach_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayEach.js */ "./node_modules/lodash-es/_arrayEach.js");
  92026. /* harmony import */ var _assignValue_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_assignValue.js */ "./node_modules/lodash-es/_assignValue.js");
  92027. /* harmony import */ var _baseAssign_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseAssign.js */ "./node_modules/lodash-es/_baseAssign.js");
  92028. /* harmony import */ var _baseAssignIn_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_baseAssignIn.js */ "./node_modules/lodash-es/_baseAssignIn.js");
  92029. /* harmony import */ var _cloneBuffer_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_cloneBuffer.js */ "./node_modules/lodash-es/_cloneBuffer.js");
  92030. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  92031. /* harmony import */ var _copySymbols_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./_copySymbols.js */ "./node_modules/lodash-es/_copySymbols.js");
  92032. /* harmony import */ var _copySymbolsIn_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./_copySymbolsIn.js */ "./node_modules/lodash-es/_copySymbolsIn.js");
  92033. /* harmony import */ var _getAllKeys_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./_getAllKeys.js */ "./node_modules/lodash-es/_getAllKeys.js");
  92034. /* harmony import */ var _getAllKeysIn_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./_getAllKeysIn.js */ "./node_modules/lodash-es/_getAllKeysIn.js");
  92035. /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
  92036. /* harmony import */ var _initCloneArray_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./_initCloneArray.js */ "./node_modules/lodash-es/_initCloneArray.js");
  92037. /* harmony import */ var _initCloneByTag_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./_initCloneByTag.js */ "./node_modules/lodash-es/_initCloneByTag.js");
  92038. /* harmony import */ var _initCloneObject_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./_initCloneObject.js */ "./node_modules/lodash-es/_initCloneObject.js");
  92039. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  92040. /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
  92041. /* harmony import */ var _isMap_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./isMap.js */ "./node_modules/lodash-es/isMap.js");
  92042. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  92043. /* harmony import */ var _isSet_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./isSet.js */ "./node_modules/lodash-es/isSet.js");
  92044. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  92045. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  92046. /** Used to compose bitmasks for cloning. */
  92047. var CLONE_DEEP_FLAG = 1,
  92048. CLONE_FLAT_FLAG = 2,
  92049. CLONE_SYMBOLS_FLAG = 4;
  92050. /** `Object#toString` result references. */
  92051. var argsTag = '[object Arguments]',
  92052. arrayTag = '[object Array]',
  92053. boolTag = '[object Boolean]',
  92054. dateTag = '[object Date]',
  92055. errorTag = '[object Error]',
  92056. funcTag = '[object Function]',
  92057. genTag = '[object GeneratorFunction]',
  92058. mapTag = '[object Map]',
  92059. numberTag = '[object Number]',
  92060. objectTag = '[object Object]',
  92061. regexpTag = '[object RegExp]',
  92062. setTag = '[object Set]',
  92063. stringTag = '[object String]',
  92064. symbolTag = '[object Symbol]',
  92065. weakMapTag = '[object WeakMap]';
  92066. var arrayBufferTag = '[object ArrayBuffer]',
  92067. dataViewTag = '[object DataView]',
  92068. float32Tag = '[object Float32Array]',
  92069. float64Tag = '[object Float64Array]',
  92070. int8Tag = '[object Int8Array]',
  92071. int16Tag = '[object Int16Array]',
  92072. int32Tag = '[object Int32Array]',
  92073. uint8Tag = '[object Uint8Array]',
  92074. uint8ClampedTag = '[object Uint8ClampedArray]',
  92075. uint16Tag = '[object Uint16Array]',
  92076. uint32Tag = '[object Uint32Array]';
  92077. /** Used to identify `toStringTag` values supported by `_.clone`. */
  92078. var cloneableTags = {};
  92079. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  92080. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  92081. cloneableTags[boolTag] = cloneableTags[dateTag] =
  92082. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  92083. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  92084. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  92085. cloneableTags[numberTag] = cloneableTags[objectTag] =
  92086. cloneableTags[regexpTag] = cloneableTags[setTag] =
  92087. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  92088. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  92089. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  92090. cloneableTags[errorTag] = cloneableTags[funcTag] =
  92091. cloneableTags[weakMapTag] = false;
  92092. /**
  92093. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  92094. * traversed objects.
  92095. *
  92096. * @private
  92097. * @param {*} value The value to clone.
  92098. * @param {boolean} bitmask The bitmask flags.
  92099. * 1 - Deep clone
  92100. * 2 - Flatten inherited properties
  92101. * 4 - Clone symbols
  92102. * @param {Function} [customizer] The function to customize cloning.
  92103. * @param {string} [key] The key of `value`.
  92104. * @param {Object} [object] The parent object of `value`.
  92105. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  92106. * @returns {*} Returns the cloned value.
  92107. */
  92108. function baseClone(value, bitmask, customizer, key, object, stack) {
  92109. var result,
  92110. isDeep = bitmask & CLONE_DEEP_FLAG,
  92111. isFlat = bitmask & CLONE_FLAT_FLAG,
  92112. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  92113. if (customizer) {
  92114. result = object ? customizer(value, key, object, stack) : customizer(value);
  92115. }
  92116. if (result !== undefined) {
  92117. return result;
  92118. }
  92119. if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_18__["default"])(value)) {
  92120. return value;
  92121. }
  92122. var isArr = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_15__["default"])(value);
  92123. if (isArr) {
  92124. result = Object(_initCloneArray_js__WEBPACK_IMPORTED_MODULE_12__["default"])(value);
  92125. if (!isDeep) {
  92126. return Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_6__["default"])(value, result);
  92127. }
  92128. } else {
  92129. var tag = Object(_getTag_js__WEBPACK_IMPORTED_MODULE_11__["default"])(value),
  92130. isFunc = tag == funcTag || tag == genTag;
  92131. if (Object(_isBuffer_js__WEBPACK_IMPORTED_MODULE_16__["default"])(value)) {
  92132. return Object(_cloneBuffer_js__WEBPACK_IMPORTED_MODULE_5__["default"])(value, isDeep);
  92133. }
  92134. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  92135. result = (isFlat || isFunc) ? {} : Object(_initCloneObject_js__WEBPACK_IMPORTED_MODULE_14__["default"])(value);
  92136. if (!isDeep) {
  92137. return isFlat
  92138. ? Object(_copySymbolsIn_js__WEBPACK_IMPORTED_MODULE_8__["default"])(value, Object(_baseAssignIn_js__WEBPACK_IMPORTED_MODULE_4__["default"])(result, value))
  92139. : Object(_copySymbols_js__WEBPACK_IMPORTED_MODULE_7__["default"])(value, Object(_baseAssign_js__WEBPACK_IMPORTED_MODULE_3__["default"])(result, value));
  92140. }
  92141. } else {
  92142. if (!cloneableTags[tag]) {
  92143. return object ? value : {};
  92144. }
  92145. result = Object(_initCloneByTag_js__WEBPACK_IMPORTED_MODULE_13__["default"])(value, tag, isDeep);
  92146. }
  92147. }
  92148. // Check for circular references and return its corresponding clone.
  92149. stack || (stack = new _Stack_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  92150. var stacked = stack.get(value);
  92151. if (stacked) {
  92152. return stacked;
  92153. }
  92154. stack.set(value, result);
  92155. if (Object(_isSet_js__WEBPACK_IMPORTED_MODULE_19__["default"])(value)) {
  92156. value.forEach(function(subValue) {
  92157. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  92158. });
  92159. } else if (Object(_isMap_js__WEBPACK_IMPORTED_MODULE_17__["default"])(value)) {
  92160. value.forEach(function(subValue, key) {
  92161. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  92162. });
  92163. }
  92164. var keysFunc = isFull
  92165. ? (isFlat ? _getAllKeysIn_js__WEBPACK_IMPORTED_MODULE_10__["default"] : _getAllKeys_js__WEBPACK_IMPORTED_MODULE_9__["default"])
  92166. : (isFlat ? _keysIn_js__WEBPACK_IMPORTED_MODULE_21__["default"] : _keys_js__WEBPACK_IMPORTED_MODULE_20__["default"]);
  92167. var props = isArr ? undefined : keysFunc(value);
  92168. Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_1__["default"])(props || value, function(subValue, key) {
  92169. if (props) {
  92170. key = subValue;
  92171. subValue = value[key];
  92172. }
  92173. // Recursively populate clone (susceptible to call stack limits).
  92174. Object(_assignValue_js__WEBPACK_IMPORTED_MODULE_2__["default"])(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  92175. });
  92176. return result;
  92177. }
  92178. /* harmony default export */ __webpack_exports__["default"] = (baseClone);
  92179. /***/ }),
  92180. /***/ "./node_modules/lodash-es/_baseConforms.js":
  92181. /*!*************************************************!*\
  92182. !*** ./node_modules/lodash-es/_baseConforms.js ***!
  92183. \*************************************************/
  92184. /*! exports provided: default */
  92185. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92186. "use strict";
  92187. __webpack_require__.r(__webpack_exports__);
  92188. /* harmony import */ var _baseConformsTo_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseConformsTo.js */ "./node_modules/lodash-es/_baseConformsTo.js");
  92189. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  92190. /**
  92191. * The base implementation of `_.conforms` which doesn't clone `source`.
  92192. *
  92193. * @private
  92194. * @param {Object} source The object of property predicates to conform to.
  92195. * @returns {Function} Returns the new spec function.
  92196. */
  92197. function baseConforms(source) {
  92198. var props = Object(_keys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source);
  92199. return function(object) {
  92200. return Object(_baseConformsTo_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, source, props);
  92201. };
  92202. }
  92203. /* harmony default export */ __webpack_exports__["default"] = (baseConforms);
  92204. /***/ }),
  92205. /***/ "./node_modules/lodash-es/_baseConformsTo.js":
  92206. /*!***************************************************!*\
  92207. !*** ./node_modules/lodash-es/_baseConformsTo.js ***!
  92208. \***************************************************/
  92209. /*! exports provided: default */
  92210. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92211. "use strict";
  92212. __webpack_require__.r(__webpack_exports__);
  92213. /**
  92214. * The base implementation of `_.conformsTo` which accepts `props` to check.
  92215. *
  92216. * @private
  92217. * @param {Object} object The object to inspect.
  92218. * @param {Object} source The object of property predicates to conform to.
  92219. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  92220. */
  92221. function baseConformsTo(object, source, props) {
  92222. var length = props.length;
  92223. if (object == null) {
  92224. return !length;
  92225. }
  92226. object = Object(object);
  92227. while (length--) {
  92228. var key = props[length],
  92229. predicate = source[key],
  92230. value = object[key];
  92231. if ((value === undefined && !(key in object)) || !predicate(value)) {
  92232. return false;
  92233. }
  92234. }
  92235. return true;
  92236. }
  92237. /* harmony default export */ __webpack_exports__["default"] = (baseConformsTo);
  92238. /***/ }),
  92239. /***/ "./node_modules/lodash-es/_baseCreate.js":
  92240. /*!***********************************************!*\
  92241. !*** ./node_modules/lodash-es/_baseCreate.js ***!
  92242. \***********************************************/
  92243. /*! exports provided: default */
  92244. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92245. "use strict";
  92246. __webpack_require__.r(__webpack_exports__);
  92247. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  92248. /** Built-in value references. */
  92249. var objectCreate = Object.create;
  92250. /**
  92251. * The base implementation of `_.create` without support for assigning
  92252. * properties to the created object.
  92253. *
  92254. * @private
  92255. * @param {Object} proto The object to inherit from.
  92256. * @returns {Object} Returns the new object.
  92257. */
  92258. var baseCreate = (function() {
  92259. function object() {}
  92260. return function(proto) {
  92261. if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(proto)) {
  92262. return {};
  92263. }
  92264. if (objectCreate) {
  92265. return objectCreate(proto);
  92266. }
  92267. object.prototype = proto;
  92268. var result = new object;
  92269. object.prototype = undefined;
  92270. return result;
  92271. };
  92272. }());
  92273. /* harmony default export */ __webpack_exports__["default"] = (baseCreate);
  92274. /***/ }),
  92275. /***/ "./node_modules/lodash-es/_baseDelay.js":
  92276. /*!**********************************************!*\
  92277. !*** ./node_modules/lodash-es/_baseDelay.js ***!
  92278. \**********************************************/
  92279. /*! exports provided: default */
  92280. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92281. "use strict";
  92282. __webpack_require__.r(__webpack_exports__);
  92283. /** Error message constants. */
  92284. var FUNC_ERROR_TEXT = 'Expected a function';
  92285. /**
  92286. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  92287. * to provide to `func`.
  92288. *
  92289. * @private
  92290. * @param {Function} func The function to delay.
  92291. * @param {number} wait The number of milliseconds to delay invocation.
  92292. * @param {Array} args The arguments to provide to `func`.
  92293. * @returns {number|Object} Returns the timer id or timeout object.
  92294. */
  92295. function baseDelay(func, wait, args) {
  92296. if (typeof func != 'function') {
  92297. throw new TypeError(FUNC_ERROR_TEXT);
  92298. }
  92299. return setTimeout(function() { func.apply(undefined, args); }, wait);
  92300. }
  92301. /* harmony default export */ __webpack_exports__["default"] = (baseDelay);
  92302. /***/ }),
  92303. /***/ "./node_modules/lodash-es/_baseDifference.js":
  92304. /*!***************************************************!*\
  92305. !*** ./node_modules/lodash-es/_baseDifference.js ***!
  92306. \***************************************************/
  92307. /*! exports provided: default */
  92308. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92309. "use strict";
  92310. __webpack_require__.r(__webpack_exports__);
  92311. /* harmony import */ var _SetCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_SetCache.js */ "./node_modules/lodash-es/_SetCache.js");
  92312. /* harmony import */ var _arrayIncludes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayIncludes.js */ "./node_modules/lodash-es/_arrayIncludes.js");
  92313. /* harmony import */ var _arrayIncludesWith_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_arrayIncludesWith.js */ "./node_modules/lodash-es/_arrayIncludesWith.js");
  92314. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  92315. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  92316. /* harmony import */ var _cacheHas_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_cacheHas.js */ "./node_modules/lodash-es/_cacheHas.js");
  92317. /** Used as the size to enable large array optimizations. */
  92318. var LARGE_ARRAY_SIZE = 200;
  92319. /**
  92320. * The base implementation of methods like `_.difference` without support
  92321. * for excluding multiple arrays or iteratee shorthands.
  92322. *
  92323. * @private
  92324. * @param {Array} array The array to inspect.
  92325. * @param {Array} values The values to exclude.
  92326. * @param {Function} [iteratee] The iteratee invoked per element.
  92327. * @param {Function} [comparator] The comparator invoked per element.
  92328. * @returns {Array} Returns the new array of filtered values.
  92329. */
  92330. function baseDifference(array, values, iteratee, comparator) {
  92331. var index = -1,
  92332. includes = _arrayIncludes_js__WEBPACK_IMPORTED_MODULE_1__["default"],
  92333. isCommon = true,
  92334. length = array.length,
  92335. result = [],
  92336. valuesLength = values.length;
  92337. if (!length) {
  92338. return result;
  92339. }
  92340. if (iteratee) {
  92341. values = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_3__["default"])(values, Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_4__["default"])(iteratee));
  92342. }
  92343. if (comparator) {
  92344. includes = _arrayIncludesWith_js__WEBPACK_IMPORTED_MODULE_2__["default"];
  92345. isCommon = false;
  92346. }
  92347. else if (values.length >= LARGE_ARRAY_SIZE) {
  92348. includes = _cacheHas_js__WEBPACK_IMPORTED_MODULE_5__["default"];
  92349. isCommon = false;
  92350. values = new _SetCache_js__WEBPACK_IMPORTED_MODULE_0__["default"](values);
  92351. }
  92352. outer:
  92353. while (++index < length) {
  92354. var value = array[index],
  92355. computed = iteratee == null ? value : iteratee(value);
  92356. value = (comparator || value !== 0) ? value : 0;
  92357. if (isCommon && computed === computed) {
  92358. var valuesIndex = valuesLength;
  92359. while (valuesIndex--) {
  92360. if (values[valuesIndex] === computed) {
  92361. continue outer;
  92362. }
  92363. }
  92364. result.push(value);
  92365. }
  92366. else if (!includes(values, computed, comparator)) {
  92367. result.push(value);
  92368. }
  92369. }
  92370. return result;
  92371. }
  92372. /* harmony default export */ __webpack_exports__["default"] = (baseDifference);
  92373. /***/ }),
  92374. /***/ "./node_modules/lodash-es/_baseEach.js":
  92375. /*!*********************************************!*\
  92376. !*** ./node_modules/lodash-es/_baseEach.js ***!
  92377. \*********************************************/
  92378. /*! exports provided: default */
  92379. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92380. "use strict";
  92381. __webpack_require__.r(__webpack_exports__);
  92382. /* harmony import */ var _baseForOwn_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseForOwn.js */ "./node_modules/lodash-es/_baseForOwn.js");
  92383. /* harmony import */ var _createBaseEach_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createBaseEach.js */ "./node_modules/lodash-es/_createBaseEach.js");
  92384. /**
  92385. * The base implementation of `_.forEach` without support for iteratee shorthands.
  92386. *
  92387. * @private
  92388. * @param {Array|Object} collection The collection to iterate over.
  92389. * @param {Function} iteratee The function invoked per iteration.
  92390. * @returns {Array|Object} Returns `collection`.
  92391. */
  92392. var baseEach = Object(_createBaseEach_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_baseForOwn_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  92393. /* harmony default export */ __webpack_exports__["default"] = (baseEach);
  92394. /***/ }),
  92395. /***/ "./node_modules/lodash-es/_baseEachRight.js":
  92396. /*!**************************************************!*\
  92397. !*** ./node_modules/lodash-es/_baseEachRight.js ***!
  92398. \**************************************************/
  92399. /*! exports provided: default */
  92400. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92401. "use strict";
  92402. __webpack_require__.r(__webpack_exports__);
  92403. /* harmony import */ var _baseForOwnRight_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseForOwnRight.js */ "./node_modules/lodash-es/_baseForOwnRight.js");
  92404. /* harmony import */ var _createBaseEach_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createBaseEach.js */ "./node_modules/lodash-es/_createBaseEach.js");
  92405. /**
  92406. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  92407. *
  92408. * @private
  92409. * @param {Array|Object} collection The collection to iterate over.
  92410. * @param {Function} iteratee The function invoked per iteration.
  92411. * @returns {Array|Object} Returns `collection`.
  92412. */
  92413. var baseEachRight = Object(_createBaseEach_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_baseForOwnRight_js__WEBPACK_IMPORTED_MODULE_0__["default"], true);
  92414. /* harmony default export */ __webpack_exports__["default"] = (baseEachRight);
  92415. /***/ }),
  92416. /***/ "./node_modules/lodash-es/_baseEvery.js":
  92417. /*!**********************************************!*\
  92418. !*** ./node_modules/lodash-es/_baseEvery.js ***!
  92419. \**********************************************/
  92420. /*! exports provided: default */
  92421. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92422. "use strict";
  92423. __webpack_require__.r(__webpack_exports__);
  92424. /* harmony import */ var _baseEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseEach.js */ "./node_modules/lodash-es/_baseEach.js");
  92425. /**
  92426. * The base implementation of `_.every` without support for iteratee shorthands.
  92427. *
  92428. * @private
  92429. * @param {Array|Object} collection The collection to iterate over.
  92430. * @param {Function} predicate The function invoked per iteration.
  92431. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  92432. * else `false`
  92433. */
  92434. function baseEvery(collection, predicate) {
  92435. var result = true;
  92436. Object(_baseEach_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection, function(value, index, collection) {
  92437. result = !!predicate(value, index, collection);
  92438. return result;
  92439. });
  92440. return result;
  92441. }
  92442. /* harmony default export */ __webpack_exports__["default"] = (baseEvery);
  92443. /***/ }),
  92444. /***/ "./node_modules/lodash-es/_baseExtremum.js":
  92445. /*!*************************************************!*\
  92446. !*** ./node_modules/lodash-es/_baseExtremum.js ***!
  92447. \*************************************************/
  92448. /*! exports provided: default */
  92449. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92450. "use strict";
  92451. __webpack_require__.r(__webpack_exports__);
  92452. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  92453. /**
  92454. * The base implementation of methods like `_.max` and `_.min` which accepts a
  92455. * `comparator` to determine the extremum value.
  92456. *
  92457. * @private
  92458. * @param {Array} array The array to iterate over.
  92459. * @param {Function} iteratee The iteratee invoked per iteration.
  92460. * @param {Function} comparator The comparator used to compare values.
  92461. * @returns {*} Returns the extremum value.
  92462. */
  92463. function baseExtremum(array, iteratee, comparator) {
  92464. var index = -1,
  92465. length = array.length;
  92466. while (++index < length) {
  92467. var value = array[index],
  92468. current = iteratee(value);
  92469. if (current != null && (computed === undefined
  92470. ? (current === current && !Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_0__["default"])(current))
  92471. : comparator(current, computed)
  92472. )) {
  92473. var computed = current,
  92474. result = value;
  92475. }
  92476. }
  92477. return result;
  92478. }
  92479. /* harmony default export */ __webpack_exports__["default"] = (baseExtremum);
  92480. /***/ }),
  92481. /***/ "./node_modules/lodash-es/_baseFill.js":
  92482. /*!*********************************************!*\
  92483. !*** ./node_modules/lodash-es/_baseFill.js ***!
  92484. \*********************************************/
  92485. /*! exports provided: default */
  92486. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92487. "use strict";
  92488. __webpack_require__.r(__webpack_exports__);
  92489. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  92490. /* harmony import */ var _toLength_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toLength.js */ "./node_modules/lodash-es/toLength.js");
  92491. /**
  92492. * The base implementation of `_.fill` without an iteratee call guard.
  92493. *
  92494. * @private
  92495. * @param {Array} array The array to fill.
  92496. * @param {*} value The value to fill `array` with.
  92497. * @param {number} [start=0] The start position.
  92498. * @param {number} [end=array.length] The end position.
  92499. * @returns {Array} Returns `array`.
  92500. */
  92501. function baseFill(array, value, start, end) {
  92502. var length = array.length;
  92503. start = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_0__["default"])(start);
  92504. if (start < 0) {
  92505. start = -start > length ? 0 : (length + start);
  92506. }
  92507. end = (end === undefined || end > length) ? length : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_0__["default"])(end);
  92508. if (end < 0) {
  92509. end += length;
  92510. }
  92511. end = start > end ? 0 : Object(_toLength_js__WEBPACK_IMPORTED_MODULE_1__["default"])(end);
  92512. while (start < end) {
  92513. array[start++] = value;
  92514. }
  92515. return array;
  92516. }
  92517. /* harmony default export */ __webpack_exports__["default"] = (baseFill);
  92518. /***/ }),
  92519. /***/ "./node_modules/lodash-es/_baseFilter.js":
  92520. /*!***********************************************!*\
  92521. !*** ./node_modules/lodash-es/_baseFilter.js ***!
  92522. \***********************************************/
  92523. /*! exports provided: default */
  92524. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92525. "use strict";
  92526. __webpack_require__.r(__webpack_exports__);
  92527. /* harmony import */ var _baseEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseEach.js */ "./node_modules/lodash-es/_baseEach.js");
  92528. /**
  92529. * The base implementation of `_.filter` without support for iteratee shorthands.
  92530. *
  92531. * @private
  92532. * @param {Array|Object} collection The collection to iterate over.
  92533. * @param {Function} predicate The function invoked per iteration.
  92534. * @returns {Array} Returns the new filtered array.
  92535. */
  92536. function baseFilter(collection, predicate) {
  92537. var result = [];
  92538. Object(_baseEach_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection, function(value, index, collection) {
  92539. if (predicate(value, index, collection)) {
  92540. result.push(value);
  92541. }
  92542. });
  92543. return result;
  92544. }
  92545. /* harmony default export */ __webpack_exports__["default"] = (baseFilter);
  92546. /***/ }),
  92547. /***/ "./node_modules/lodash-es/_baseFindIndex.js":
  92548. /*!**************************************************!*\
  92549. !*** ./node_modules/lodash-es/_baseFindIndex.js ***!
  92550. \**************************************************/
  92551. /*! exports provided: default */
  92552. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92553. "use strict";
  92554. __webpack_require__.r(__webpack_exports__);
  92555. /**
  92556. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  92557. * support for iteratee shorthands.
  92558. *
  92559. * @private
  92560. * @param {Array} array The array to inspect.
  92561. * @param {Function} predicate The function invoked per iteration.
  92562. * @param {number} fromIndex The index to search from.
  92563. * @param {boolean} [fromRight] Specify iterating from right to left.
  92564. * @returns {number} Returns the index of the matched value, else `-1`.
  92565. */
  92566. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  92567. var length = array.length,
  92568. index = fromIndex + (fromRight ? 1 : -1);
  92569. while ((fromRight ? index-- : ++index < length)) {
  92570. if (predicate(array[index], index, array)) {
  92571. return index;
  92572. }
  92573. }
  92574. return -1;
  92575. }
  92576. /* harmony default export */ __webpack_exports__["default"] = (baseFindIndex);
  92577. /***/ }),
  92578. /***/ "./node_modules/lodash-es/_baseFindKey.js":
  92579. /*!************************************************!*\
  92580. !*** ./node_modules/lodash-es/_baseFindKey.js ***!
  92581. \************************************************/
  92582. /*! exports provided: default */
  92583. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92584. "use strict";
  92585. __webpack_require__.r(__webpack_exports__);
  92586. /**
  92587. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  92588. * without support for iteratee shorthands, which iterates over `collection`
  92589. * using `eachFunc`.
  92590. *
  92591. * @private
  92592. * @param {Array|Object} collection The collection to inspect.
  92593. * @param {Function} predicate The function invoked per iteration.
  92594. * @param {Function} eachFunc The function to iterate over `collection`.
  92595. * @returns {*} Returns the found element or its key, else `undefined`.
  92596. */
  92597. function baseFindKey(collection, predicate, eachFunc) {
  92598. var result;
  92599. eachFunc(collection, function(value, key, collection) {
  92600. if (predicate(value, key, collection)) {
  92601. result = key;
  92602. return false;
  92603. }
  92604. });
  92605. return result;
  92606. }
  92607. /* harmony default export */ __webpack_exports__["default"] = (baseFindKey);
  92608. /***/ }),
  92609. /***/ "./node_modules/lodash-es/_baseFlatten.js":
  92610. /*!************************************************!*\
  92611. !*** ./node_modules/lodash-es/_baseFlatten.js ***!
  92612. \************************************************/
  92613. /*! exports provided: default */
  92614. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92615. "use strict";
  92616. __webpack_require__.r(__webpack_exports__);
  92617. /* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayPush.js */ "./node_modules/lodash-es/_arrayPush.js");
  92618. /* harmony import */ var _isFlattenable_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isFlattenable.js */ "./node_modules/lodash-es/_isFlattenable.js");
  92619. /**
  92620. * The base implementation of `_.flatten` with support for restricting flattening.
  92621. *
  92622. * @private
  92623. * @param {Array} array The array to flatten.
  92624. * @param {number} depth The maximum recursion depth.
  92625. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  92626. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  92627. * @param {Array} [result=[]] The initial result value.
  92628. * @returns {Array} Returns the new flattened array.
  92629. */
  92630. function baseFlatten(array, depth, predicate, isStrict, result) {
  92631. var index = -1,
  92632. length = array.length;
  92633. predicate || (predicate = _isFlattenable_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  92634. result || (result = []);
  92635. while (++index < length) {
  92636. var value = array[index];
  92637. if (depth > 0 && predicate(value)) {
  92638. if (depth > 1) {
  92639. // Recursively flatten arrays (susceptible to call stack limits).
  92640. baseFlatten(value, depth - 1, predicate, isStrict, result);
  92641. } else {
  92642. Object(_arrayPush_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, value);
  92643. }
  92644. } else if (!isStrict) {
  92645. result[result.length] = value;
  92646. }
  92647. }
  92648. return result;
  92649. }
  92650. /* harmony default export */ __webpack_exports__["default"] = (baseFlatten);
  92651. /***/ }),
  92652. /***/ "./node_modules/lodash-es/_baseFor.js":
  92653. /*!********************************************!*\
  92654. !*** ./node_modules/lodash-es/_baseFor.js ***!
  92655. \********************************************/
  92656. /*! exports provided: default */
  92657. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92658. "use strict";
  92659. __webpack_require__.r(__webpack_exports__);
  92660. /* harmony import */ var _createBaseFor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createBaseFor.js */ "./node_modules/lodash-es/_createBaseFor.js");
  92661. /**
  92662. * The base implementation of `baseForOwn` which iterates over `object`
  92663. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  92664. * Iteratee functions may exit iteration early by explicitly returning `false`.
  92665. *
  92666. * @private
  92667. * @param {Object} object The object to iterate over.
  92668. * @param {Function} iteratee The function invoked per iteration.
  92669. * @param {Function} keysFunc The function to get the keys of `object`.
  92670. * @returns {Object} Returns `object`.
  92671. */
  92672. var baseFor = Object(_createBaseFor_js__WEBPACK_IMPORTED_MODULE_0__["default"])();
  92673. /* harmony default export */ __webpack_exports__["default"] = (baseFor);
  92674. /***/ }),
  92675. /***/ "./node_modules/lodash-es/_baseForOwn.js":
  92676. /*!***********************************************!*\
  92677. !*** ./node_modules/lodash-es/_baseForOwn.js ***!
  92678. \***********************************************/
  92679. /*! exports provided: default */
  92680. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92681. "use strict";
  92682. __webpack_require__.r(__webpack_exports__);
  92683. /* harmony import */ var _baseFor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFor.js */ "./node_modules/lodash-es/_baseFor.js");
  92684. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  92685. /**
  92686. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  92687. *
  92688. * @private
  92689. * @param {Object} object The object to iterate over.
  92690. * @param {Function} iteratee The function invoked per iteration.
  92691. * @returns {Object} Returns `object`.
  92692. */
  92693. function baseForOwn(object, iteratee) {
  92694. return object && Object(_baseFor_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, iteratee, _keys_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  92695. }
  92696. /* harmony default export */ __webpack_exports__["default"] = (baseForOwn);
  92697. /***/ }),
  92698. /***/ "./node_modules/lodash-es/_baseForOwnRight.js":
  92699. /*!****************************************************!*\
  92700. !*** ./node_modules/lodash-es/_baseForOwnRight.js ***!
  92701. \****************************************************/
  92702. /*! exports provided: default */
  92703. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92704. "use strict";
  92705. __webpack_require__.r(__webpack_exports__);
  92706. /* harmony import */ var _baseForRight_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseForRight.js */ "./node_modules/lodash-es/_baseForRight.js");
  92707. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  92708. /**
  92709. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  92710. *
  92711. * @private
  92712. * @param {Object} object The object to iterate over.
  92713. * @param {Function} iteratee The function invoked per iteration.
  92714. * @returns {Object} Returns `object`.
  92715. */
  92716. function baseForOwnRight(object, iteratee) {
  92717. return object && Object(_baseForRight_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, iteratee, _keys_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  92718. }
  92719. /* harmony default export */ __webpack_exports__["default"] = (baseForOwnRight);
  92720. /***/ }),
  92721. /***/ "./node_modules/lodash-es/_baseForRight.js":
  92722. /*!*************************************************!*\
  92723. !*** ./node_modules/lodash-es/_baseForRight.js ***!
  92724. \*************************************************/
  92725. /*! exports provided: default */
  92726. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92727. "use strict";
  92728. __webpack_require__.r(__webpack_exports__);
  92729. /* harmony import */ var _createBaseFor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createBaseFor.js */ "./node_modules/lodash-es/_createBaseFor.js");
  92730. /**
  92731. * This function is like `baseFor` except that it iterates over properties
  92732. * in the opposite order.
  92733. *
  92734. * @private
  92735. * @param {Object} object The object to iterate over.
  92736. * @param {Function} iteratee The function invoked per iteration.
  92737. * @param {Function} keysFunc The function to get the keys of `object`.
  92738. * @returns {Object} Returns `object`.
  92739. */
  92740. var baseForRight = Object(_createBaseFor_js__WEBPACK_IMPORTED_MODULE_0__["default"])(true);
  92741. /* harmony default export */ __webpack_exports__["default"] = (baseForRight);
  92742. /***/ }),
  92743. /***/ "./node_modules/lodash-es/_baseFunctions.js":
  92744. /*!**************************************************!*\
  92745. !*** ./node_modules/lodash-es/_baseFunctions.js ***!
  92746. \**************************************************/
  92747. /*! exports provided: default */
  92748. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92749. "use strict";
  92750. __webpack_require__.r(__webpack_exports__);
  92751. /* harmony import */ var _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayFilter.js */ "./node_modules/lodash-es/_arrayFilter.js");
  92752. /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
  92753. /**
  92754. * The base implementation of `_.functions` which creates an array of
  92755. * `object` function property names filtered from `props`.
  92756. *
  92757. * @private
  92758. * @param {Object} object The object to inspect.
  92759. * @param {Array} props The property names to filter.
  92760. * @returns {Array} Returns the function names.
  92761. */
  92762. function baseFunctions(object, props) {
  92763. return Object(_arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__["default"])(props, function(key) {
  92764. return Object(_isFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object[key]);
  92765. });
  92766. }
  92767. /* harmony default export */ __webpack_exports__["default"] = (baseFunctions);
  92768. /***/ }),
  92769. /***/ "./node_modules/lodash-es/_baseGet.js":
  92770. /*!********************************************!*\
  92771. !*** ./node_modules/lodash-es/_baseGet.js ***!
  92772. \********************************************/
  92773. /*! exports provided: default */
  92774. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92775. "use strict";
  92776. __webpack_require__.r(__webpack_exports__);
  92777. /* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
  92778. /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
  92779. /**
  92780. * The base implementation of `_.get` without support for default values.
  92781. *
  92782. * @private
  92783. * @param {Object} object The object to query.
  92784. * @param {Array|string} path The path of the property to get.
  92785. * @returns {*} Returns the resolved value.
  92786. */
  92787. function baseGet(object, path) {
  92788. path = Object(_castPath_js__WEBPACK_IMPORTED_MODULE_0__["default"])(path, object);
  92789. var index = 0,
  92790. length = path.length;
  92791. while (object != null && index < length) {
  92792. object = object[Object(_toKey_js__WEBPACK_IMPORTED_MODULE_1__["default"])(path[index++])];
  92793. }
  92794. return (index && index == length) ? object : undefined;
  92795. }
  92796. /* harmony default export */ __webpack_exports__["default"] = (baseGet);
  92797. /***/ }),
  92798. /***/ "./node_modules/lodash-es/_baseGetAllKeys.js":
  92799. /*!***************************************************!*\
  92800. !*** ./node_modules/lodash-es/_baseGetAllKeys.js ***!
  92801. \***************************************************/
  92802. /*! exports provided: default */
  92803. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92804. "use strict";
  92805. __webpack_require__.r(__webpack_exports__);
  92806. /* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayPush.js */ "./node_modules/lodash-es/_arrayPush.js");
  92807. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  92808. /**
  92809. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  92810. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  92811. * symbols of `object`.
  92812. *
  92813. * @private
  92814. * @param {Object} object The object to query.
  92815. * @param {Function} keysFunc The function to get the keys of `object`.
  92816. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  92817. * @returns {Array} Returns the array of property names and symbols.
  92818. */
  92819. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  92820. var result = keysFunc(object);
  92821. return Object(_isArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object) ? result : Object(_arrayPush_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, symbolsFunc(object));
  92822. }
  92823. /* harmony default export */ __webpack_exports__["default"] = (baseGetAllKeys);
  92824. /***/ }),
  92825. /***/ "./node_modules/lodash-es/_baseGetTag.js":
  92826. /*!***********************************************!*\
  92827. !*** ./node_modules/lodash-es/_baseGetTag.js ***!
  92828. \***********************************************/
  92829. /*! exports provided: default */
  92830. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92831. "use strict";
  92832. __webpack_require__.r(__webpack_exports__);
  92833. /* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
  92834. /* harmony import */ var _getRawTag_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getRawTag.js */ "./node_modules/lodash-es/_getRawTag.js");
  92835. /* harmony import */ var _objectToString_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_objectToString.js */ "./node_modules/lodash-es/_objectToString.js");
  92836. /** `Object#toString` result references. */
  92837. var nullTag = '[object Null]',
  92838. undefinedTag = '[object Undefined]';
  92839. /** Built-in value references. */
  92840. var symToStringTag = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].toStringTag : undefined;
  92841. /**
  92842. * The base implementation of `getTag` without fallbacks for buggy environments.
  92843. *
  92844. * @private
  92845. * @param {*} value The value to query.
  92846. * @returns {string} Returns the `toStringTag`.
  92847. */
  92848. function baseGetTag(value) {
  92849. if (value == null) {
  92850. return value === undefined ? undefinedTag : nullTag;
  92851. }
  92852. return (symToStringTag && symToStringTag in Object(value))
  92853. ? Object(_getRawTag_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)
  92854. : Object(_objectToString_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value);
  92855. }
  92856. /* harmony default export */ __webpack_exports__["default"] = (baseGetTag);
  92857. /***/ }),
  92858. /***/ "./node_modules/lodash-es/_baseGt.js":
  92859. /*!*******************************************!*\
  92860. !*** ./node_modules/lodash-es/_baseGt.js ***!
  92861. \*******************************************/
  92862. /*! exports provided: default */
  92863. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92864. "use strict";
  92865. __webpack_require__.r(__webpack_exports__);
  92866. /**
  92867. * The base implementation of `_.gt` which doesn't coerce arguments.
  92868. *
  92869. * @private
  92870. * @param {*} value The value to compare.
  92871. * @param {*} other The other value to compare.
  92872. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  92873. * else `false`.
  92874. */
  92875. function baseGt(value, other) {
  92876. return value > other;
  92877. }
  92878. /* harmony default export */ __webpack_exports__["default"] = (baseGt);
  92879. /***/ }),
  92880. /***/ "./node_modules/lodash-es/_baseHas.js":
  92881. /*!********************************************!*\
  92882. !*** ./node_modules/lodash-es/_baseHas.js ***!
  92883. \********************************************/
  92884. /*! exports provided: default */
  92885. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92886. "use strict";
  92887. __webpack_require__.r(__webpack_exports__);
  92888. /** Used for built-in method references. */
  92889. var objectProto = Object.prototype;
  92890. /** Used to check objects for own properties. */
  92891. var hasOwnProperty = objectProto.hasOwnProperty;
  92892. /**
  92893. * The base implementation of `_.has` without support for deep paths.
  92894. *
  92895. * @private
  92896. * @param {Object} [object] The object to query.
  92897. * @param {Array|string} key The key to check.
  92898. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  92899. */
  92900. function baseHas(object, key) {
  92901. return object != null && hasOwnProperty.call(object, key);
  92902. }
  92903. /* harmony default export */ __webpack_exports__["default"] = (baseHas);
  92904. /***/ }),
  92905. /***/ "./node_modules/lodash-es/_baseHasIn.js":
  92906. /*!**********************************************!*\
  92907. !*** ./node_modules/lodash-es/_baseHasIn.js ***!
  92908. \**********************************************/
  92909. /*! exports provided: default */
  92910. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92911. "use strict";
  92912. __webpack_require__.r(__webpack_exports__);
  92913. /**
  92914. * The base implementation of `_.hasIn` without support for deep paths.
  92915. *
  92916. * @private
  92917. * @param {Object} [object] The object to query.
  92918. * @param {Array|string} key The key to check.
  92919. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  92920. */
  92921. function baseHasIn(object, key) {
  92922. return object != null && key in Object(object);
  92923. }
  92924. /* harmony default export */ __webpack_exports__["default"] = (baseHasIn);
  92925. /***/ }),
  92926. /***/ "./node_modules/lodash-es/_baseInRange.js":
  92927. /*!************************************************!*\
  92928. !*** ./node_modules/lodash-es/_baseInRange.js ***!
  92929. \************************************************/
  92930. /*! exports provided: default */
  92931. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92932. "use strict";
  92933. __webpack_require__.r(__webpack_exports__);
  92934. /* Built-in method references for those with the same name as other `lodash` methods. */
  92935. var nativeMax = Math.max,
  92936. nativeMin = Math.min;
  92937. /**
  92938. * The base implementation of `_.inRange` which doesn't coerce arguments.
  92939. *
  92940. * @private
  92941. * @param {number} number The number to check.
  92942. * @param {number} start The start of the range.
  92943. * @param {number} end The end of the range.
  92944. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  92945. */
  92946. function baseInRange(number, start, end) {
  92947. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  92948. }
  92949. /* harmony default export */ __webpack_exports__["default"] = (baseInRange);
  92950. /***/ }),
  92951. /***/ "./node_modules/lodash-es/_baseIndexOf.js":
  92952. /*!************************************************!*\
  92953. !*** ./node_modules/lodash-es/_baseIndexOf.js ***!
  92954. \************************************************/
  92955. /*! exports provided: default */
  92956. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92957. "use strict";
  92958. __webpack_require__.r(__webpack_exports__);
  92959. /* harmony import */ var _baseFindIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFindIndex.js */ "./node_modules/lodash-es/_baseFindIndex.js");
  92960. /* harmony import */ var _baseIsNaN_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIsNaN.js */ "./node_modules/lodash-es/_baseIsNaN.js");
  92961. /* harmony import */ var _strictIndexOf_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_strictIndexOf.js */ "./node_modules/lodash-es/_strictIndexOf.js");
  92962. /**
  92963. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  92964. *
  92965. * @private
  92966. * @param {Array} array The array to inspect.
  92967. * @param {*} value The value to search for.
  92968. * @param {number} fromIndex The index to search from.
  92969. * @returns {number} Returns the index of the matched value, else `-1`.
  92970. */
  92971. function baseIndexOf(array, value, fromIndex) {
  92972. return value === value
  92973. ? Object(_strictIndexOf_js__WEBPACK_IMPORTED_MODULE_2__["default"])(array, value, fromIndex)
  92974. : Object(_baseFindIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, _baseIsNaN_js__WEBPACK_IMPORTED_MODULE_1__["default"], fromIndex);
  92975. }
  92976. /* harmony default export */ __webpack_exports__["default"] = (baseIndexOf);
  92977. /***/ }),
  92978. /***/ "./node_modules/lodash-es/_baseIndexOfWith.js":
  92979. /*!****************************************************!*\
  92980. !*** ./node_modules/lodash-es/_baseIndexOfWith.js ***!
  92981. \****************************************************/
  92982. /*! exports provided: default */
  92983. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92984. "use strict";
  92985. __webpack_require__.r(__webpack_exports__);
  92986. /**
  92987. * This function is like `baseIndexOf` except that it accepts a comparator.
  92988. *
  92989. * @private
  92990. * @param {Array} array The array to inspect.
  92991. * @param {*} value The value to search for.
  92992. * @param {number} fromIndex The index to search from.
  92993. * @param {Function} comparator The comparator invoked per element.
  92994. * @returns {number} Returns the index of the matched value, else `-1`.
  92995. */
  92996. function baseIndexOfWith(array, value, fromIndex, comparator) {
  92997. var index = fromIndex - 1,
  92998. length = array.length;
  92999. while (++index < length) {
  93000. if (comparator(array[index], value)) {
  93001. return index;
  93002. }
  93003. }
  93004. return -1;
  93005. }
  93006. /* harmony default export */ __webpack_exports__["default"] = (baseIndexOfWith);
  93007. /***/ }),
  93008. /***/ "./node_modules/lodash-es/_baseIntersection.js":
  93009. /*!*****************************************************!*\
  93010. !*** ./node_modules/lodash-es/_baseIntersection.js ***!
  93011. \*****************************************************/
  93012. /*! exports provided: default */
  93013. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93014. "use strict";
  93015. __webpack_require__.r(__webpack_exports__);
  93016. /* harmony import */ var _SetCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_SetCache.js */ "./node_modules/lodash-es/_SetCache.js");
  93017. /* harmony import */ var _arrayIncludes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayIncludes.js */ "./node_modules/lodash-es/_arrayIncludes.js");
  93018. /* harmony import */ var _arrayIncludesWith_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_arrayIncludesWith.js */ "./node_modules/lodash-es/_arrayIncludesWith.js");
  93019. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  93020. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  93021. /* harmony import */ var _cacheHas_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_cacheHas.js */ "./node_modules/lodash-es/_cacheHas.js");
  93022. /* Built-in method references for those with the same name as other `lodash` methods. */
  93023. var nativeMin = Math.min;
  93024. /**
  93025. * The base implementation of methods like `_.intersection`, without support
  93026. * for iteratee shorthands, that accepts an array of arrays to inspect.
  93027. *
  93028. * @private
  93029. * @param {Array} arrays The arrays to inspect.
  93030. * @param {Function} [iteratee] The iteratee invoked per element.
  93031. * @param {Function} [comparator] The comparator invoked per element.
  93032. * @returns {Array} Returns the new array of shared values.
  93033. */
  93034. function baseIntersection(arrays, iteratee, comparator) {
  93035. var includes = comparator ? _arrayIncludesWith_js__WEBPACK_IMPORTED_MODULE_2__["default"] : _arrayIncludes_js__WEBPACK_IMPORTED_MODULE_1__["default"],
  93036. length = arrays[0].length,
  93037. othLength = arrays.length,
  93038. othIndex = othLength,
  93039. caches = Array(othLength),
  93040. maxLength = Infinity,
  93041. result = [];
  93042. while (othIndex--) {
  93043. var array = arrays[othIndex];
  93044. if (othIndex && iteratee) {
  93045. array = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_3__["default"])(array, Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_4__["default"])(iteratee));
  93046. }
  93047. maxLength = nativeMin(array.length, maxLength);
  93048. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  93049. ? new _SetCache_js__WEBPACK_IMPORTED_MODULE_0__["default"](othIndex && array)
  93050. : undefined;
  93051. }
  93052. array = arrays[0];
  93053. var index = -1,
  93054. seen = caches[0];
  93055. outer:
  93056. while (++index < length && result.length < maxLength) {
  93057. var value = array[index],
  93058. computed = iteratee ? iteratee(value) : value;
  93059. value = (comparator || value !== 0) ? value : 0;
  93060. if (!(seen
  93061. ? Object(_cacheHas_js__WEBPACK_IMPORTED_MODULE_5__["default"])(seen, computed)
  93062. : includes(result, computed, comparator)
  93063. )) {
  93064. othIndex = othLength;
  93065. while (--othIndex) {
  93066. var cache = caches[othIndex];
  93067. if (!(cache
  93068. ? Object(_cacheHas_js__WEBPACK_IMPORTED_MODULE_5__["default"])(cache, computed)
  93069. : includes(arrays[othIndex], computed, comparator))
  93070. ) {
  93071. continue outer;
  93072. }
  93073. }
  93074. if (seen) {
  93075. seen.push(computed);
  93076. }
  93077. result.push(value);
  93078. }
  93079. }
  93080. return result;
  93081. }
  93082. /* harmony default export */ __webpack_exports__["default"] = (baseIntersection);
  93083. /***/ }),
  93084. /***/ "./node_modules/lodash-es/_baseInverter.js":
  93085. /*!*************************************************!*\
  93086. !*** ./node_modules/lodash-es/_baseInverter.js ***!
  93087. \*************************************************/
  93088. /*! exports provided: default */
  93089. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93090. "use strict";
  93091. __webpack_require__.r(__webpack_exports__);
  93092. /* harmony import */ var _baseForOwn_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseForOwn.js */ "./node_modules/lodash-es/_baseForOwn.js");
  93093. /**
  93094. * The base implementation of `_.invert` and `_.invertBy` which inverts
  93095. * `object` with values transformed by `iteratee` and set by `setter`.
  93096. *
  93097. * @private
  93098. * @param {Object} object The object to iterate over.
  93099. * @param {Function} setter The function to set `accumulator` values.
  93100. * @param {Function} iteratee The iteratee to transform values.
  93101. * @param {Object} accumulator The initial inverted object.
  93102. * @returns {Function} Returns `accumulator`.
  93103. */
  93104. function baseInverter(object, setter, iteratee, accumulator) {
  93105. Object(_baseForOwn_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, function(value, key, object) {
  93106. setter(accumulator, iteratee(value), key, object);
  93107. });
  93108. return accumulator;
  93109. }
  93110. /* harmony default export */ __webpack_exports__["default"] = (baseInverter);
  93111. /***/ }),
  93112. /***/ "./node_modules/lodash-es/_baseInvoke.js":
  93113. /*!***********************************************!*\
  93114. !*** ./node_modules/lodash-es/_baseInvoke.js ***!
  93115. \***********************************************/
  93116. /*! exports provided: default */
  93117. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93118. "use strict";
  93119. __webpack_require__.r(__webpack_exports__);
  93120. /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  93121. /* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
  93122. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  93123. /* harmony import */ var _parent_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_parent.js */ "./node_modules/lodash-es/_parent.js");
  93124. /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
  93125. /**
  93126. * The base implementation of `_.invoke` without support for individual
  93127. * method arguments.
  93128. *
  93129. * @private
  93130. * @param {Object} object The object to query.
  93131. * @param {Array|string} path The path of the method to invoke.
  93132. * @param {Array} args The arguments to invoke the method with.
  93133. * @returns {*} Returns the result of the invoked method.
  93134. */
  93135. function baseInvoke(object, path, args) {
  93136. path = Object(_castPath_js__WEBPACK_IMPORTED_MODULE_1__["default"])(path, object);
  93137. object = Object(_parent_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object, path);
  93138. var func = object == null ? object : object[Object(_toKey_js__WEBPACK_IMPORTED_MODULE_4__["default"])(Object(_last_js__WEBPACK_IMPORTED_MODULE_2__["default"])(path))];
  93139. return func == null ? undefined : Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, object, args);
  93140. }
  93141. /* harmony default export */ __webpack_exports__["default"] = (baseInvoke);
  93142. /***/ }),
  93143. /***/ "./node_modules/lodash-es/_baseIsArguments.js":
  93144. /*!****************************************************!*\
  93145. !*** ./node_modules/lodash-es/_baseIsArguments.js ***!
  93146. \****************************************************/
  93147. /*! exports provided: default */
  93148. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93149. "use strict";
  93150. __webpack_require__.r(__webpack_exports__);
  93151. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  93152. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  93153. /** `Object#toString` result references. */
  93154. var argsTag = '[object Arguments]';
  93155. /**
  93156. * The base implementation of `_.isArguments`.
  93157. *
  93158. * @private
  93159. * @param {*} value The value to check.
  93160. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  93161. */
  93162. function baseIsArguments(value) {
  93163. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == argsTag;
  93164. }
  93165. /* harmony default export */ __webpack_exports__["default"] = (baseIsArguments);
  93166. /***/ }),
  93167. /***/ "./node_modules/lodash-es/_baseIsArrayBuffer.js":
  93168. /*!******************************************************!*\
  93169. !*** ./node_modules/lodash-es/_baseIsArrayBuffer.js ***!
  93170. \******************************************************/
  93171. /*! exports provided: default */
  93172. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93173. "use strict";
  93174. __webpack_require__.r(__webpack_exports__);
  93175. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  93176. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  93177. var arrayBufferTag = '[object ArrayBuffer]';
  93178. /**
  93179. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  93180. *
  93181. * @private
  93182. * @param {*} value The value to check.
  93183. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  93184. */
  93185. function baseIsArrayBuffer(value) {
  93186. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == arrayBufferTag;
  93187. }
  93188. /* harmony default export */ __webpack_exports__["default"] = (baseIsArrayBuffer);
  93189. /***/ }),
  93190. /***/ "./node_modules/lodash-es/_baseIsDate.js":
  93191. /*!***********************************************!*\
  93192. !*** ./node_modules/lodash-es/_baseIsDate.js ***!
  93193. \***********************************************/
  93194. /*! exports provided: default */
  93195. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93196. "use strict";
  93197. __webpack_require__.r(__webpack_exports__);
  93198. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  93199. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  93200. /** `Object#toString` result references. */
  93201. var dateTag = '[object Date]';
  93202. /**
  93203. * The base implementation of `_.isDate` without Node.js optimizations.
  93204. *
  93205. * @private
  93206. * @param {*} value The value to check.
  93207. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  93208. */
  93209. function baseIsDate(value) {
  93210. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == dateTag;
  93211. }
  93212. /* harmony default export */ __webpack_exports__["default"] = (baseIsDate);
  93213. /***/ }),
  93214. /***/ "./node_modules/lodash-es/_baseIsEqual.js":
  93215. /*!************************************************!*\
  93216. !*** ./node_modules/lodash-es/_baseIsEqual.js ***!
  93217. \************************************************/
  93218. /*! exports provided: default */
  93219. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93220. "use strict";
  93221. __webpack_require__.r(__webpack_exports__);
  93222. /* harmony import */ var _baseIsEqualDeep_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsEqualDeep.js */ "./node_modules/lodash-es/_baseIsEqualDeep.js");
  93223. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  93224. /**
  93225. * The base implementation of `_.isEqual` which supports partial comparisons
  93226. * and tracks traversed objects.
  93227. *
  93228. * @private
  93229. * @param {*} value The value to compare.
  93230. * @param {*} other The other value to compare.
  93231. * @param {boolean} bitmask The bitmask flags.
  93232. * 1 - Unordered comparison
  93233. * 2 - Partial comparison
  93234. * @param {Function} [customizer] The function to customize comparisons.
  93235. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  93236. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  93237. */
  93238. function baseIsEqual(value, other, bitmask, customizer, stack) {
  93239. if (value === other) {
  93240. return true;
  93241. }
  93242. if (value == null || other == null || (!Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && !Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(other))) {
  93243. return value !== value && other !== other;
  93244. }
  93245. return Object(_baseIsEqualDeep_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, other, bitmask, customizer, baseIsEqual, stack);
  93246. }
  93247. /* harmony default export */ __webpack_exports__["default"] = (baseIsEqual);
  93248. /***/ }),
  93249. /***/ "./node_modules/lodash-es/_baseIsEqualDeep.js":
  93250. /*!****************************************************!*\
  93251. !*** ./node_modules/lodash-es/_baseIsEqualDeep.js ***!
  93252. \****************************************************/
  93253. /*! exports provided: default */
  93254. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93255. "use strict";
  93256. __webpack_require__.r(__webpack_exports__);
  93257. /* harmony import */ var _Stack_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Stack.js */ "./node_modules/lodash-es/_Stack.js");
  93258. /* harmony import */ var _equalArrays_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_equalArrays.js */ "./node_modules/lodash-es/_equalArrays.js");
  93259. /* harmony import */ var _equalByTag_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_equalByTag.js */ "./node_modules/lodash-es/_equalByTag.js");
  93260. /* harmony import */ var _equalObjects_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_equalObjects.js */ "./node_modules/lodash-es/_equalObjects.js");
  93261. /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
  93262. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  93263. /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
  93264. /* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/lodash-es/isTypedArray.js");
  93265. /** Used to compose bitmasks for value comparisons. */
  93266. var COMPARE_PARTIAL_FLAG = 1;
  93267. /** `Object#toString` result references. */
  93268. var argsTag = '[object Arguments]',
  93269. arrayTag = '[object Array]',
  93270. objectTag = '[object Object]';
  93271. /** Used for built-in method references. */
  93272. var objectProto = Object.prototype;
  93273. /** Used to check objects for own properties. */
  93274. var hasOwnProperty = objectProto.hasOwnProperty;
  93275. /**
  93276. * A specialized version of `baseIsEqual` for arrays and objects which performs
  93277. * deep comparisons and tracks traversed objects enabling objects with circular
  93278. * references to be compared.
  93279. *
  93280. * @private
  93281. * @param {Object} object The object to compare.
  93282. * @param {Object} other The other object to compare.
  93283. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  93284. * @param {Function} customizer The function to customize comparisons.
  93285. * @param {Function} equalFunc The function to determine equivalents of values.
  93286. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  93287. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  93288. */
  93289. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  93290. var objIsArr = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(object),
  93291. othIsArr = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(other),
  93292. objTag = objIsArr ? arrayTag : Object(_getTag_js__WEBPACK_IMPORTED_MODULE_4__["default"])(object),
  93293. othTag = othIsArr ? arrayTag : Object(_getTag_js__WEBPACK_IMPORTED_MODULE_4__["default"])(other);
  93294. objTag = objTag == argsTag ? objectTag : objTag;
  93295. othTag = othTag == argsTag ? objectTag : othTag;
  93296. var objIsObj = objTag == objectTag,
  93297. othIsObj = othTag == objectTag,
  93298. isSameTag = objTag == othTag;
  93299. if (isSameTag && Object(_isBuffer_js__WEBPACK_IMPORTED_MODULE_6__["default"])(object)) {
  93300. if (!Object(_isBuffer_js__WEBPACK_IMPORTED_MODULE_6__["default"])(other)) {
  93301. return false;
  93302. }
  93303. objIsArr = true;
  93304. objIsObj = false;
  93305. }
  93306. if (isSameTag && !objIsObj) {
  93307. stack || (stack = new _Stack_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  93308. return (objIsArr || Object(_isTypedArray_js__WEBPACK_IMPORTED_MODULE_7__["default"])(object))
  93309. ? Object(_equalArrays_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, other, bitmask, customizer, equalFunc, stack)
  93310. : Object(_equalByTag_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object, other, objTag, bitmask, customizer, equalFunc, stack);
  93311. }
  93312. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  93313. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  93314. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  93315. if (objIsWrapped || othIsWrapped) {
  93316. var objUnwrapped = objIsWrapped ? object.value() : object,
  93317. othUnwrapped = othIsWrapped ? other.value() : other;
  93318. stack || (stack = new _Stack_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  93319. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  93320. }
  93321. }
  93322. if (!isSameTag) {
  93323. return false;
  93324. }
  93325. stack || (stack = new _Stack_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  93326. return Object(_equalObjects_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object, other, bitmask, customizer, equalFunc, stack);
  93327. }
  93328. /* harmony default export */ __webpack_exports__["default"] = (baseIsEqualDeep);
  93329. /***/ }),
  93330. /***/ "./node_modules/lodash-es/_baseIsMap.js":
  93331. /*!**********************************************!*\
  93332. !*** ./node_modules/lodash-es/_baseIsMap.js ***!
  93333. \**********************************************/
  93334. /*! exports provided: default */
  93335. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93336. "use strict";
  93337. __webpack_require__.r(__webpack_exports__);
  93338. /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
  93339. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  93340. /** `Object#toString` result references. */
  93341. var mapTag = '[object Map]';
  93342. /**
  93343. * The base implementation of `_.isMap` without Node.js optimizations.
  93344. *
  93345. * @private
  93346. * @param {*} value The value to check.
  93347. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  93348. */
  93349. function baseIsMap(value) {
  93350. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_getTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == mapTag;
  93351. }
  93352. /* harmony default export */ __webpack_exports__["default"] = (baseIsMap);
  93353. /***/ }),
  93354. /***/ "./node_modules/lodash-es/_baseIsMatch.js":
  93355. /*!************************************************!*\
  93356. !*** ./node_modules/lodash-es/_baseIsMatch.js ***!
  93357. \************************************************/
  93358. /*! exports provided: default */
  93359. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93360. "use strict";
  93361. __webpack_require__.r(__webpack_exports__);
  93362. /* harmony import */ var _Stack_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Stack.js */ "./node_modules/lodash-es/_Stack.js");
  93363. /* harmony import */ var _baseIsEqual_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIsEqual.js */ "./node_modules/lodash-es/_baseIsEqual.js");
  93364. /** Used to compose bitmasks for value comparisons. */
  93365. var COMPARE_PARTIAL_FLAG = 1,
  93366. COMPARE_UNORDERED_FLAG = 2;
  93367. /**
  93368. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  93369. *
  93370. * @private
  93371. * @param {Object} object The object to inspect.
  93372. * @param {Object} source The object of property values to match.
  93373. * @param {Array} matchData The property names, values, and compare flags to match.
  93374. * @param {Function} [customizer] The function to customize comparisons.
  93375. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  93376. */
  93377. function baseIsMatch(object, source, matchData, customizer) {
  93378. var index = matchData.length,
  93379. length = index,
  93380. noCustomizer = !customizer;
  93381. if (object == null) {
  93382. return !length;
  93383. }
  93384. object = Object(object);
  93385. while (index--) {
  93386. var data = matchData[index];
  93387. if ((noCustomizer && data[2])
  93388. ? data[1] !== object[data[0]]
  93389. : !(data[0] in object)
  93390. ) {
  93391. return false;
  93392. }
  93393. }
  93394. while (++index < length) {
  93395. data = matchData[index];
  93396. var key = data[0],
  93397. objValue = object[key],
  93398. srcValue = data[1];
  93399. if (noCustomizer && data[2]) {
  93400. if (objValue === undefined && !(key in object)) {
  93401. return false;
  93402. }
  93403. } else {
  93404. var stack = new _Stack_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  93405. if (customizer) {
  93406. var result = customizer(objValue, srcValue, key, object, source, stack);
  93407. }
  93408. if (!(result === undefined
  93409. ? Object(_baseIsEqual_js__WEBPACK_IMPORTED_MODULE_1__["default"])(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  93410. : result
  93411. )) {
  93412. return false;
  93413. }
  93414. }
  93415. }
  93416. return true;
  93417. }
  93418. /* harmony default export */ __webpack_exports__["default"] = (baseIsMatch);
  93419. /***/ }),
  93420. /***/ "./node_modules/lodash-es/_baseIsNaN.js":
  93421. /*!**********************************************!*\
  93422. !*** ./node_modules/lodash-es/_baseIsNaN.js ***!
  93423. \**********************************************/
  93424. /*! exports provided: default */
  93425. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93426. "use strict";
  93427. __webpack_require__.r(__webpack_exports__);
  93428. /**
  93429. * The base implementation of `_.isNaN` without support for number objects.
  93430. *
  93431. * @private
  93432. * @param {*} value The value to check.
  93433. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  93434. */
  93435. function baseIsNaN(value) {
  93436. return value !== value;
  93437. }
  93438. /* harmony default export */ __webpack_exports__["default"] = (baseIsNaN);
  93439. /***/ }),
  93440. /***/ "./node_modules/lodash-es/_baseIsNative.js":
  93441. /*!*************************************************!*\
  93442. !*** ./node_modules/lodash-es/_baseIsNative.js ***!
  93443. \*************************************************/
  93444. /*! exports provided: default */
  93445. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93446. "use strict";
  93447. __webpack_require__.r(__webpack_exports__);
  93448. /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
  93449. /* harmony import */ var _isMasked_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isMasked.js */ "./node_modules/lodash-es/_isMasked.js");
  93450. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  93451. /* harmony import */ var _toSource_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_toSource.js */ "./node_modules/lodash-es/_toSource.js");
  93452. /**
  93453. * Used to match `RegExp`
  93454. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  93455. */
  93456. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  93457. /** Used to detect host constructors (Safari). */
  93458. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  93459. /** Used for built-in method references. */
  93460. var funcProto = Function.prototype,
  93461. objectProto = Object.prototype;
  93462. /** Used to resolve the decompiled source of functions. */
  93463. var funcToString = funcProto.toString;
  93464. /** Used to check objects for own properties. */
  93465. var hasOwnProperty = objectProto.hasOwnProperty;
  93466. /** Used to detect if a method is native. */
  93467. var reIsNative = RegExp('^' +
  93468. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  93469. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  93470. );
  93471. /**
  93472. * The base implementation of `_.isNative` without bad shim checks.
  93473. *
  93474. * @private
  93475. * @param {*} value The value to check.
  93476. * @returns {boolean} Returns `true` if `value` is a native function,
  93477. * else `false`.
  93478. */
  93479. function baseIsNative(value) {
  93480. if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value) || Object(_isMasked_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
  93481. return false;
  93482. }
  93483. var pattern = Object(_isFunction_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) ? reIsNative : reIsHostCtor;
  93484. return pattern.test(Object(_toSource_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value));
  93485. }
  93486. /* harmony default export */ __webpack_exports__["default"] = (baseIsNative);
  93487. /***/ }),
  93488. /***/ "./node_modules/lodash-es/_baseIsRegExp.js":
  93489. /*!*************************************************!*\
  93490. !*** ./node_modules/lodash-es/_baseIsRegExp.js ***!
  93491. \*************************************************/
  93492. /*! exports provided: default */
  93493. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93494. "use strict";
  93495. __webpack_require__.r(__webpack_exports__);
  93496. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  93497. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  93498. /** `Object#toString` result references. */
  93499. var regexpTag = '[object RegExp]';
  93500. /**
  93501. * The base implementation of `_.isRegExp` without Node.js optimizations.
  93502. *
  93503. * @private
  93504. * @param {*} value The value to check.
  93505. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  93506. */
  93507. function baseIsRegExp(value) {
  93508. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == regexpTag;
  93509. }
  93510. /* harmony default export */ __webpack_exports__["default"] = (baseIsRegExp);
  93511. /***/ }),
  93512. /***/ "./node_modules/lodash-es/_baseIsSet.js":
  93513. /*!**********************************************!*\
  93514. !*** ./node_modules/lodash-es/_baseIsSet.js ***!
  93515. \**********************************************/
  93516. /*! exports provided: default */
  93517. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93518. "use strict";
  93519. __webpack_require__.r(__webpack_exports__);
  93520. /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
  93521. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  93522. /** `Object#toString` result references. */
  93523. var setTag = '[object Set]';
  93524. /**
  93525. * The base implementation of `_.isSet` without Node.js optimizations.
  93526. *
  93527. * @private
  93528. * @param {*} value The value to check.
  93529. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  93530. */
  93531. function baseIsSet(value) {
  93532. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_getTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == setTag;
  93533. }
  93534. /* harmony default export */ __webpack_exports__["default"] = (baseIsSet);
  93535. /***/ }),
  93536. /***/ "./node_modules/lodash-es/_baseIsTypedArray.js":
  93537. /*!*****************************************************!*\
  93538. !*** ./node_modules/lodash-es/_baseIsTypedArray.js ***!
  93539. \*****************************************************/
  93540. /*! exports provided: default */
  93541. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93542. "use strict";
  93543. __webpack_require__.r(__webpack_exports__);
  93544. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  93545. /* harmony import */ var _isLength_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isLength.js */ "./node_modules/lodash-es/isLength.js");
  93546. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  93547. /** `Object#toString` result references. */
  93548. var argsTag = '[object Arguments]',
  93549. arrayTag = '[object Array]',
  93550. boolTag = '[object Boolean]',
  93551. dateTag = '[object Date]',
  93552. errorTag = '[object Error]',
  93553. funcTag = '[object Function]',
  93554. mapTag = '[object Map]',
  93555. numberTag = '[object Number]',
  93556. objectTag = '[object Object]',
  93557. regexpTag = '[object RegExp]',
  93558. setTag = '[object Set]',
  93559. stringTag = '[object String]',
  93560. weakMapTag = '[object WeakMap]';
  93561. var arrayBufferTag = '[object ArrayBuffer]',
  93562. dataViewTag = '[object DataView]',
  93563. float32Tag = '[object Float32Array]',
  93564. float64Tag = '[object Float64Array]',
  93565. int8Tag = '[object Int8Array]',
  93566. int16Tag = '[object Int16Array]',
  93567. int32Tag = '[object Int32Array]',
  93568. uint8Tag = '[object Uint8Array]',
  93569. uint8ClampedTag = '[object Uint8ClampedArray]',
  93570. uint16Tag = '[object Uint16Array]',
  93571. uint32Tag = '[object Uint32Array]';
  93572. /** Used to identify `toStringTag` values of typed arrays. */
  93573. var typedArrayTags = {};
  93574. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  93575. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  93576. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  93577. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  93578. typedArrayTags[uint32Tag] = true;
  93579. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  93580. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  93581. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  93582. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  93583. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  93584. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  93585. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  93586. typedArrayTags[weakMapTag] = false;
  93587. /**
  93588. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  93589. *
  93590. * @private
  93591. * @param {*} value The value to check.
  93592. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  93593. */
  93594. function baseIsTypedArray(value) {
  93595. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value) &&
  93596. Object(_isLength_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value.length) && !!typedArrayTags[Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value)];
  93597. }
  93598. /* harmony default export */ __webpack_exports__["default"] = (baseIsTypedArray);
  93599. /***/ }),
  93600. /***/ "./node_modules/lodash-es/_baseIteratee.js":
  93601. /*!*************************************************!*\
  93602. !*** ./node_modules/lodash-es/_baseIteratee.js ***!
  93603. \*************************************************/
  93604. /*! exports provided: default */
  93605. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93606. "use strict";
  93607. __webpack_require__.r(__webpack_exports__);
  93608. /* harmony import */ var _baseMatches_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseMatches.js */ "./node_modules/lodash-es/_baseMatches.js");
  93609. /* harmony import */ var _baseMatchesProperty_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseMatchesProperty.js */ "./node_modules/lodash-es/_baseMatchesProperty.js");
  93610. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  93611. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  93612. /* harmony import */ var _property_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./property.js */ "./node_modules/lodash-es/property.js");
  93613. /**
  93614. * The base implementation of `_.iteratee`.
  93615. *
  93616. * @private
  93617. * @param {*} [value=_.identity] The value to convert to an iteratee.
  93618. * @returns {Function} Returns the iteratee.
  93619. */
  93620. function baseIteratee(value) {
  93621. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  93622. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  93623. if (typeof value == 'function') {
  93624. return value;
  93625. }
  93626. if (value == null) {
  93627. return _identity_js__WEBPACK_IMPORTED_MODULE_2__["default"];
  93628. }
  93629. if (typeof value == 'object') {
  93630. return Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value)
  93631. ? Object(_baseMatchesProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value[0], value[1])
  93632. : Object(_baseMatches_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  93633. }
  93634. return Object(_property_js__WEBPACK_IMPORTED_MODULE_4__["default"])(value);
  93635. }
  93636. /* harmony default export */ __webpack_exports__["default"] = (baseIteratee);
  93637. /***/ }),
  93638. /***/ "./node_modules/lodash-es/_baseKeys.js":
  93639. /*!*********************************************!*\
  93640. !*** ./node_modules/lodash-es/_baseKeys.js ***!
  93641. \*********************************************/
  93642. /*! exports provided: default */
  93643. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93644. "use strict";
  93645. __webpack_require__.r(__webpack_exports__);
  93646. /* harmony import */ var _isPrototype_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_isPrototype.js */ "./node_modules/lodash-es/_isPrototype.js");
  93647. /* harmony import */ var _nativeKeys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_nativeKeys.js */ "./node_modules/lodash-es/_nativeKeys.js");
  93648. /** Used for built-in method references. */
  93649. var objectProto = Object.prototype;
  93650. /** Used to check objects for own properties. */
  93651. var hasOwnProperty = objectProto.hasOwnProperty;
  93652. /**
  93653. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  93654. *
  93655. * @private
  93656. * @param {Object} object The object to query.
  93657. * @returns {Array} Returns the array of property names.
  93658. */
  93659. function baseKeys(object) {
  93660. if (!Object(_isPrototype_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object)) {
  93661. return Object(_nativeKeys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object);
  93662. }
  93663. var result = [];
  93664. for (var key in Object(object)) {
  93665. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  93666. result.push(key);
  93667. }
  93668. }
  93669. return result;
  93670. }
  93671. /* harmony default export */ __webpack_exports__["default"] = (baseKeys);
  93672. /***/ }),
  93673. /***/ "./node_modules/lodash-es/_baseKeysIn.js":
  93674. /*!***********************************************!*\
  93675. !*** ./node_modules/lodash-es/_baseKeysIn.js ***!
  93676. \***********************************************/
  93677. /*! exports provided: default */
  93678. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93679. "use strict";
  93680. __webpack_require__.r(__webpack_exports__);
  93681. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  93682. /* harmony import */ var _isPrototype_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isPrototype.js */ "./node_modules/lodash-es/_isPrototype.js");
  93683. /* harmony import */ var _nativeKeysIn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_nativeKeysIn.js */ "./node_modules/lodash-es/_nativeKeysIn.js");
  93684. /** Used for built-in method references. */
  93685. var objectProto = Object.prototype;
  93686. /** Used to check objects for own properties. */
  93687. var hasOwnProperty = objectProto.hasOwnProperty;
  93688. /**
  93689. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  93690. *
  93691. * @private
  93692. * @param {Object} object The object to query.
  93693. * @returns {Array} Returns the array of property names.
  93694. */
  93695. function baseKeysIn(object) {
  93696. if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object)) {
  93697. return Object(_nativeKeysIn_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object);
  93698. }
  93699. var isProto = Object(_isPrototype_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object),
  93700. result = [];
  93701. for (var key in object) {
  93702. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  93703. result.push(key);
  93704. }
  93705. }
  93706. return result;
  93707. }
  93708. /* harmony default export */ __webpack_exports__["default"] = (baseKeysIn);
  93709. /***/ }),
  93710. /***/ "./node_modules/lodash-es/_baseLodash.js":
  93711. /*!***********************************************!*\
  93712. !*** ./node_modules/lodash-es/_baseLodash.js ***!
  93713. \***********************************************/
  93714. /*! exports provided: default */
  93715. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93716. "use strict";
  93717. __webpack_require__.r(__webpack_exports__);
  93718. /**
  93719. * The function whose prototype chain sequence wrappers inherit from.
  93720. *
  93721. * @private
  93722. */
  93723. function baseLodash() {
  93724. // No operation performed.
  93725. }
  93726. /* harmony default export */ __webpack_exports__["default"] = (baseLodash);
  93727. /***/ }),
  93728. /***/ "./node_modules/lodash-es/_baseLt.js":
  93729. /*!*******************************************!*\
  93730. !*** ./node_modules/lodash-es/_baseLt.js ***!
  93731. \*******************************************/
  93732. /*! exports provided: default */
  93733. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93734. "use strict";
  93735. __webpack_require__.r(__webpack_exports__);
  93736. /**
  93737. * The base implementation of `_.lt` which doesn't coerce arguments.
  93738. *
  93739. * @private
  93740. * @param {*} value The value to compare.
  93741. * @param {*} other The other value to compare.
  93742. * @returns {boolean} Returns `true` if `value` is less than `other`,
  93743. * else `false`.
  93744. */
  93745. function baseLt(value, other) {
  93746. return value < other;
  93747. }
  93748. /* harmony default export */ __webpack_exports__["default"] = (baseLt);
  93749. /***/ }),
  93750. /***/ "./node_modules/lodash-es/_baseMap.js":
  93751. /*!********************************************!*\
  93752. !*** ./node_modules/lodash-es/_baseMap.js ***!
  93753. \********************************************/
  93754. /*! exports provided: default */
  93755. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93756. "use strict";
  93757. __webpack_require__.r(__webpack_exports__);
  93758. /* harmony import */ var _baseEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseEach.js */ "./node_modules/lodash-es/_baseEach.js");
  93759. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  93760. /**
  93761. * The base implementation of `_.map` without support for iteratee shorthands.
  93762. *
  93763. * @private
  93764. * @param {Array|Object} collection The collection to iterate over.
  93765. * @param {Function} iteratee The function invoked per iteration.
  93766. * @returns {Array} Returns the new mapped array.
  93767. */
  93768. function baseMap(collection, iteratee) {
  93769. var index = -1,
  93770. result = Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection) ? Array(collection.length) : [];
  93771. Object(_baseEach_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection, function(value, key, collection) {
  93772. result[++index] = iteratee(value, key, collection);
  93773. });
  93774. return result;
  93775. }
  93776. /* harmony default export */ __webpack_exports__["default"] = (baseMap);
  93777. /***/ }),
  93778. /***/ "./node_modules/lodash-es/_baseMatches.js":
  93779. /*!************************************************!*\
  93780. !*** ./node_modules/lodash-es/_baseMatches.js ***!
  93781. \************************************************/
  93782. /*! exports provided: default */
  93783. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93784. "use strict";
  93785. __webpack_require__.r(__webpack_exports__);
  93786. /* harmony import */ var _baseIsMatch_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsMatch.js */ "./node_modules/lodash-es/_baseIsMatch.js");
  93787. /* harmony import */ var _getMatchData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getMatchData.js */ "./node_modules/lodash-es/_getMatchData.js");
  93788. /* harmony import */ var _matchesStrictComparable_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_matchesStrictComparable.js */ "./node_modules/lodash-es/_matchesStrictComparable.js");
  93789. /**
  93790. * The base implementation of `_.matches` which doesn't clone `source`.
  93791. *
  93792. * @private
  93793. * @param {Object} source The object of property values to match.
  93794. * @returns {Function} Returns the new spec function.
  93795. */
  93796. function baseMatches(source) {
  93797. var matchData = Object(_getMatchData_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source);
  93798. if (matchData.length == 1 && matchData[0][2]) {
  93799. return Object(_matchesStrictComparable_js__WEBPACK_IMPORTED_MODULE_2__["default"])(matchData[0][0], matchData[0][1]);
  93800. }
  93801. return function(object) {
  93802. return object === source || Object(_baseIsMatch_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, source, matchData);
  93803. };
  93804. }
  93805. /* harmony default export */ __webpack_exports__["default"] = (baseMatches);
  93806. /***/ }),
  93807. /***/ "./node_modules/lodash-es/_baseMatchesProperty.js":
  93808. /*!********************************************************!*\
  93809. !*** ./node_modules/lodash-es/_baseMatchesProperty.js ***!
  93810. \********************************************************/
  93811. /*! exports provided: default */
  93812. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93813. "use strict";
  93814. __webpack_require__.r(__webpack_exports__);
  93815. /* harmony import */ var _baseIsEqual_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsEqual.js */ "./node_modules/lodash-es/_baseIsEqual.js");
  93816. /* harmony import */ var _get_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./get.js */ "./node_modules/lodash-es/get.js");
  93817. /* harmony import */ var _hasIn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./hasIn.js */ "./node_modules/lodash-es/hasIn.js");
  93818. /* harmony import */ var _isKey_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_isKey.js */ "./node_modules/lodash-es/_isKey.js");
  93819. /* harmony import */ var _isStrictComparable_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_isStrictComparable.js */ "./node_modules/lodash-es/_isStrictComparable.js");
  93820. /* harmony import */ var _matchesStrictComparable_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_matchesStrictComparable.js */ "./node_modules/lodash-es/_matchesStrictComparable.js");
  93821. /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
  93822. /** Used to compose bitmasks for value comparisons. */
  93823. var COMPARE_PARTIAL_FLAG = 1,
  93824. COMPARE_UNORDERED_FLAG = 2;
  93825. /**
  93826. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  93827. *
  93828. * @private
  93829. * @param {string} path The path of the property to get.
  93830. * @param {*} srcValue The value to match.
  93831. * @returns {Function} Returns the new spec function.
  93832. */
  93833. function baseMatchesProperty(path, srcValue) {
  93834. if (Object(_isKey_js__WEBPACK_IMPORTED_MODULE_3__["default"])(path) && Object(_isStrictComparable_js__WEBPACK_IMPORTED_MODULE_4__["default"])(srcValue)) {
  93835. return Object(_matchesStrictComparable_js__WEBPACK_IMPORTED_MODULE_5__["default"])(Object(_toKey_js__WEBPACK_IMPORTED_MODULE_6__["default"])(path), srcValue);
  93836. }
  93837. return function(object) {
  93838. var objValue = Object(_get_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, path);
  93839. return (objValue === undefined && objValue === srcValue)
  93840. ? Object(_hasIn_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object, path)
  93841. : Object(_baseIsEqual_js__WEBPACK_IMPORTED_MODULE_0__["default"])(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  93842. };
  93843. }
  93844. /* harmony default export */ __webpack_exports__["default"] = (baseMatchesProperty);
  93845. /***/ }),
  93846. /***/ "./node_modules/lodash-es/_baseMean.js":
  93847. /*!*********************************************!*\
  93848. !*** ./node_modules/lodash-es/_baseMean.js ***!
  93849. \*********************************************/
  93850. /*! exports provided: default */
  93851. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93852. "use strict";
  93853. __webpack_require__.r(__webpack_exports__);
  93854. /* harmony import */ var _baseSum_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSum.js */ "./node_modules/lodash-es/_baseSum.js");
  93855. /** Used as references for various `Number` constants. */
  93856. var NAN = 0 / 0;
  93857. /**
  93858. * The base implementation of `_.mean` and `_.meanBy` without support for
  93859. * iteratee shorthands.
  93860. *
  93861. * @private
  93862. * @param {Array} array The array to iterate over.
  93863. * @param {Function} iteratee The function invoked per iteration.
  93864. * @returns {number} Returns the mean.
  93865. */
  93866. function baseMean(array, iteratee) {
  93867. var length = array == null ? 0 : array.length;
  93868. return length ? (Object(_baseSum_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, iteratee) / length) : NAN;
  93869. }
  93870. /* harmony default export */ __webpack_exports__["default"] = (baseMean);
  93871. /***/ }),
  93872. /***/ "./node_modules/lodash-es/_baseMerge.js":
  93873. /*!**********************************************!*\
  93874. !*** ./node_modules/lodash-es/_baseMerge.js ***!
  93875. \**********************************************/
  93876. /*! exports provided: default */
  93877. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93878. "use strict";
  93879. __webpack_require__.r(__webpack_exports__);
  93880. /* harmony import */ var _Stack_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Stack.js */ "./node_modules/lodash-es/_Stack.js");
  93881. /* harmony import */ var _assignMergeValue_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_assignMergeValue.js */ "./node_modules/lodash-es/_assignMergeValue.js");
  93882. /* harmony import */ var _baseFor_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseFor.js */ "./node_modules/lodash-es/_baseFor.js");
  93883. /* harmony import */ var _baseMergeDeep_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseMergeDeep.js */ "./node_modules/lodash-es/_baseMergeDeep.js");
  93884. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  93885. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  93886. /* harmony import */ var _safeGet_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_safeGet.js */ "./node_modules/lodash-es/_safeGet.js");
  93887. /**
  93888. * The base implementation of `_.merge` without support for multiple sources.
  93889. *
  93890. * @private
  93891. * @param {Object} object The destination object.
  93892. * @param {Object} source The source object.
  93893. * @param {number} srcIndex The index of `source`.
  93894. * @param {Function} [customizer] The function to customize merged values.
  93895. * @param {Object} [stack] Tracks traversed source values and their merged
  93896. * counterparts.
  93897. */
  93898. function baseMerge(object, source, srcIndex, customizer, stack) {
  93899. if (object === source) {
  93900. return;
  93901. }
  93902. Object(_baseFor_js__WEBPACK_IMPORTED_MODULE_2__["default"])(source, function(srcValue, key) {
  93903. stack || (stack = new _Stack_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  93904. if (Object(_isObject_js__WEBPACK_IMPORTED_MODULE_4__["default"])(srcValue)) {
  93905. Object(_baseMergeDeep_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object, source, key, srcIndex, baseMerge, customizer, stack);
  93906. }
  93907. else {
  93908. var newValue = customizer
  93909. ? customizer(Object(_safeGet_js__WEBPACK_IMPORTED_MODULE_6__["default"])(object, key), srcValue, (key + ''), object, source, stack)
  93910. : undefined;
  93911. if (newValue === undefined) {
  93912. newValue = srcValue;
  93913. }
  93914. Object(_assignMergeValue_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, key, newValue);
  93915. }
  93916. }, _keysIn_js__WEBPACK_IMPORTED_MODULE_5__["default"]);
  93917. }
  93918. /* harmony default export */ __webpack_exports__["default"] = (baseMerge);
  93919. /***/ }),
  93920. /***/ "./node_modules/lodash-es/_baseMergeDeep.js":
  93921. /*!**************************************************!*\
  93922. !*** ./node_modules/lodash-es/_baseMergeDeep.js ***!
  93923. \**************************************************/
  93924. /*! exports provided: default */
  93925. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93926. "use strict";
  93927. __webpack_require__.r(__webpack_exports__);
  93928. /* harmony import */ var _assignMergeValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assignMergeValue.js */ "./node_modules/lodash-es/_assignMergeValue.js");
  93929. /* harmony import */ var _cloneBuffer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_cloneBuffer.js */ "./node_modules/lodash-es/_cloneBuffer.js");
  93930. /* harmony import */ var _cloneTypedArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_cloneTypedArray.js */ "./node_modules/lodash-es/_cloneTypedArray.js");
  93931. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  93932. /* harmony import */ var _initCloneObject_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_initCloneObject.js */ "./node_modules/lodash-es/_initCloneObject.js");
  93933. /* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
  93934. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  93935. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  93936. /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
  93937. /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
  93938. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  93939. /* harmony import */ var _isPlainObject_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./isPlainObject.js */ "./node_modules/lodash-es/isPlainObject.js");
  93940. /* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/lodash-es/isTypedArray.js");
  93941. /* harmony import */ var _safeGet_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./_safeGet.js */ "./node_modules/lodash-es/_safeGet.js");
  93942. /* harmony import */ var _toPlainObject_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./toPlainObject.js */ "./node_modules/lodash-es/toPlainObject.js");
  93943. /**
  93944. * A specialized version of `baseMerge` for arrays and objects which performs
  93945. * deep merges and tracks traversed objects enabling objects with circular
  93946. * references to be merged.
  93947. *
  93948. * @private
  93949. * @param {Object} object The destination object.
  93950. * @param {Object} source The source object.
  93951. * @param {string} key The key of the value to merge.
  93952. * @param {number} srcIndex The index of `source`.
  93953. * @param {Function} mergeFunc The function to merge values.
  93954. * @param {Function} [customizer] The function to customize assigned values.
  93955. * @param {Object} [stack] Tracks traversed source values and their merged
  93956. * counterparts.
  93957. */
  93958. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  93959. var objValue = Object(_safeGet_js__WEBPACK_IMPORTED_MODULE_13__["default"])(object, key),
  93960. srcValue = Object(_safeGet_js__WEBPACK_IMPORTED_MODULE_13__["default"])(source, key),
  93961. stacked = stack.get(srcValue);
  93962. if (stacked) {
  93963. Object(_assignMergeValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, key, stacked);
  93964. return;
  93965. }
  93966. var newValue = customizer
  93967. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  93968. : undefined;
  93969. var isCommon = newValue === undefined;
  93970. if (isCommon) {
  93971. var isArr = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_6__["default"])(srcValue),
  93972. isBuff = !isArr && Object(_isBuffer_js__WEBPACK_IMPORTED_MODULE_8__["default"])(srcValue),
  93973. isTyped = !isArr && !isBuff && Object(_isTypedArray_js__WEBPACK_IMPORTED_MODULE_12__["default"])(srcValue);
  93974. newValue = srcValue;
  93975. if (isArr || isBuff || isTyped) {
  93976. if (Object(_isArray_js__WEBPACK_IMPORTED_MODULE_6__["default"])(objValue)) {
  93977. newValue = objValue;
  93978. }
  93979. else if (Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_7__["default"])(objValue)) {
  93980. newValue = Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(objValue);
  93981. }
  93982. else if (isBuff) {
  93983. isCommon = false;
  93984. newValue = Object(_cloneBuffer_js__WEBPACK_IMPORTED_MODULE_1__["default"])(srcValue, true);
  93985. }
  93986. else if (isTyped) {
  93987. isCommon = false;
  93988. newValue = Object(_cloneTypedArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(srcValue, true);
  93989. }
  93990. else {
  93991. newValue = [];
  93992. }
  93993. }
  93994. else if (Object(_isPlainObject_js__WEBPACK_IMPORTED_MODULE_11__["default"])(srcValue) || Object(_isArguments_js__WEBPACK_IMPORTED_MODULE_5__["default"])(srcValue)) {
  93995. newValue = objValue;
  93996. if (Object(_isArguments_js__WEBPACK_IMPORTED_MODULE_5__["default"])(objValue)) {
  93997. newValue = Object(_toPlainObject_js__WEBPACK_IMPORTED_MODULE_14__["default"])(objValue);
  93998. }
  93999. else if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_10__["default"])(objValue) || Object(_isFunction_js__WEBPACK_IMPORTED_MODULE_9__["default"])(objValue)) {
  94000. newValue = Object(_initCloneObject_js__WEBPACK_IMPORTED_MODULE_4__["default"])(srcValue);
  94001. }
  94002. }
  94003. else {
  94004. isCommon = false;
  94005. }
  94006. }
  94007. if (isCommon) {
  94008. // Recursively merge objects and arrays (susceptible to call stack limits).
  94009. stack.set(srcValue, newValue);
  94010. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  94011. stack['delete'](srcValue);
  94012. }
  94013. Object(_assignMergeValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, key, newValue);
  94014. }
  94015. /* harmony default export */ __webpack_exports__["default"] = (baseMergeDeep);
  94016. /***/ }),
  94017. /***/ "./node_modules/lodash-es/_baseNth.js":
  94018. /*!********************************************!*\
  94019. !*** ./node_modules/lodash-es/_baseNth.js ***!
  94020. \********************************************/
  94021. /*! exports provided: default */
  94022. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94023. "use strict";
  94024. __webpack_require__.r(__webpack_exports__);
  94025. /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
  94026. /**
  94027. * The base implementation of `_.nth` which doesn't coerce arguments.
  94028. *
  94029. * @private
  94030. * @param {Array} array The array to query.
  94031. * @param {number} n The index of the element to return.
  94032. * @returns {*} Returns the nth element of `array`.
  94033. */
  94034. function baseNth(array, n) {
  94035. var length = array.length;
  94036. if (!length) {
  94037. return;
  94038. }
  94039. n += n < 0 ? length : 0;
  94040. return Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(n, length) ? array[n] : undefined;
  94041. }
  94042. /* harmony default export */ __webpack_exports__["default"] = (baseNth);
  94043. /***/ }),
  94044. /***/ "./node_modules/lodash-es/_baseOrderBy.js":
  94045. /*!************************************************!*\
  94046. !*** ./node_modules/lodash-es/_baseOrderBy.js ***!
  94047. \************************************************/
  94048. /*! exports provided: default */
  94049. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94050. "use strict";
  94051. __webpack_require__.r(__webpack_exports__);
  94052. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  94053. /* harmony import */ var _baseGet_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseGet.js */ "./node_modules/lodash-es/_baseGet.js");
  94054. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  94055. /* harmony import */ var _baseMap_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseMap.js */ "./node_modules/lodash-es/_baseMap.js");
  94056. /* harmony import */ var _baseSortBy_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_baseSortBy.js */ "./node_modules/lodash-es/_baseSortBy.js");
  94057. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  94058. /* harmony import */ var _compareMultiple_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_compareMultiple.js */ "./node_modules/lodash-es/_compareMultiple.js");
  94059. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  94060. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  94061. /**
  94062. * The base implementation of `_.orderBy` without param guards.
  94063. *
  94064. * @private
  94065. * @param {Array|Object} collection The collection to iterate over.
  94066. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  94067. * @param {string[]} orders The sort orders of `iteratees`.
  94068. * @returns {Array} Returns the new sorted array.
  94069. */
  94070. function baseOrderBy(collection, iteratees, orders) {
  94071. if (iteratees.length) {
  94072. iteratees = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratees, function(iteratee) {
  94073. if (Object(_isArray_js__WEBPACK_IMPORTED_MODULE_8__["default"])(iteratee)) {
  94074. return function(value) {
  94075. return Object(_baseGet_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  94076. }
  94077. }
  94078. return iteratee;
  94079. });
  94080. } else {
  94081. iteratees = [_identity_js__WEBPACK_IMPORTED_MODULE_7__["default"]];
  94082. }
  94083. var index = -1;
  94084. iteratees = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratees, Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_5__["default"])(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"]));
  94085. var result = Object(_baseMap_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection, function(value, key, collection) {
  94086. var criteria = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratees, function(iteratee) {
  94087. return iteratee(value);
  94088. });
  94089. return { 'criteria': criteria, 'index': ++index, 'value': value };
  94090. });
  94091. return Object(_baseSortBy_js__WEBPACK_IMPORTED_MODULE_4__["default"])(result, function(object, other) {
  94092. return Object(_compareMultiple_js__WEBPACK_IMPORTED_MODULE_6__["default"])(object, other, orders);
  94093. });
  94094. }
  94095. /* harmony default export */ __webpack_exports__["default"] = (baseOrderBy);
  94096. /***/ }),
  94097. /***/ "./node_modules/lodash-es/_basePick.js":
  94098. /*!*********************************************!*\
  94099. !*** ./node_modules/lodash-es/_basePick.js ***!
  94100. \*********************************************/
  94101. /*! exports provided: default */
  94102. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94103. "use strict";
  94104. __webpack_require__.r(__webpack_exports__);
  94105. /* harmony import */ var _basePickBy_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_basePickBy.js */ "./node_modules/lodash-es/_basePickBy.js");
  94106. /* harmony import */ var _hasIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./hasIn.js */ "./node_modules/lodash-es/hasIn.js");
  94107. /**
  94108. * The base implementation of `_.pick` without support for individual
  94109. * property identifiers.
  94110. *
  94111. * @private
  94112. * @param {Object} object The source object.
  94113. * @param {string[]} paths The property paths to pick.
  94114. * @returns {Object} Returns the new object.
  94115. */
  94116. function basePick(object, paths) {
  94117. return Object(_basePickBy_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, paths, function(value, path) {
  94118. return Object(_hasIn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, path);
  94119. });
  94120. }
  94121. /* harmony default export */ __webpack_exports__["default"] = (basePick);
  94122. /***/ }),
  94123. /***/ "./node_modules/lodash-es/_basePickBy.js":
  94124. /*!***********************************************!*\
  94125. !*** ./node_modules/lodash-es/_basePickBy.js ***!
  94126. \***********************************************/
  94127. /*! exports provided: default */
  94128. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94129. "use strict";
  94130. __webpack_require__.r(__webpack_exports__);
  94131. /* harmony import */ var _baseGet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGet.js */ "./node_modules/lodash-es/_baseGet.js");
  94132. /* harmony import */ var _baseSet_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSet.js */ "./node_modules/lodash-es/_baseSet.js");
  94133. /* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
  94134. /**
  94135. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  94136. *
  94137. * @private
  94138. * @param {Object} object The source object.
  94139. * @param {string[]} paths The property paths to pick.
  94140. * @param {Function} predicate The function invoked per property.
  94141. * @returns {Object} Returns the new object.
  94142. */
  94143. function basePickBy(object, paths, predicate) {
  94144. var index = -1,
  94145. length = paths.length,
  94146. result = {};
  94147. while (++index < length) {
  94148. var path = paths[index],
  94149. value = Object(_baseGet_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path);
  94150. if (predicate(value, path)) {
  94151. Object(_baseSet_js__WEBPACK_IMPORTED_MODULE_1__["default"])(result, Object(_castPath_js__WEBPACK_IMPORTED_MODULE_2__["default"])(path, object), value);
  94152. }
  94153. }
  94154. return result;
  94155. }
  94156. /* harmony default export */ __webpack_exports__["default"] = (basePickBy);
  94157. /***/ }),
  94158. /***/ "./node_modules/lodash-es/_baseProperty.js":
  94159. /*!*************************************************!*\
  94160. !*** ./node_modules/lodash-es/_baseProperty.js ***!
  94161. \*************************************************/
  94162. /*! exports provided: default */
  94163. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94164. "use strict";
  94165. __webpack_require__.r(__webpack_exports__);
  94166. /**
  94167. * The base implementation of `_.property` without support for deep paths.
  94168. *
  94169. * @private
  94170. * @param {string} key The key of the property to get.
  94171. * @returns {Function} Returns the new accessor function.
  94172. */
  94173. function baseProperty(key) {
  94174. return function(object) {
  94175. return object == null ? undefined : object[key];
  94176. };
  94177. }
  94178. /* harmony default export */ __webpack_exports__["default"] = (baseProperty);
  94179. /***/ }),
  94180. /***/ "./node_modules/lodash-es/_basePropertyDeep.js":
  94181. /*!*****************************************************!*\
  94182. !*** ./node_modules/lodash-es/_basePropertyDeep.js ***!
  94183. \*****************************************************/
  94184. /*! exports provided: default */
  94185. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94186. "use strict";
  94187. __webpack_require__.r(__webpack_exports__);
  94188. /* harmony import */ var _baseGet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGet.js */ "./node_modules/lodash-es/_baseGet.js");
  94189. /**
  94190. * A specialized version of `baseProperty` which supports deep paths.
  94191. *
  94192. * @private
  94193. * @param {Array|string} path The path of the property to get.
  94194. * @returns {Function} Returns the new accessor function.
  94195. */
  94196. function basePropertyDeep(path) {
  94197. return function(object) {
  94198. return Object(_baseGet_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path);
  94199. };
  94200. }
  94201. /* harmony default export */ __webpack_exports__["default"] = (basePropertyDeep);
  94202. /***/ }),
  94203. /***/ "./node_modules/lodash-es/_basePropertyOf.js":
  94204. /*!***************************************************!*\
  94205. !*** ./node_modules/lodash-es/_basePropertyOf.js ***!
  94206. \***************************************************/
  94207. /*! exports provided: default */
  94208. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94209. "use strict";
  94210. __webpack_require__.r(__webpack_exports__);
  94211. /**
  94212. * The base implementation of `_.propertyOf` without support for deep paths.
  94213. *
  94214. * @private
  94215. * @param {Object} object The object to query.
  94216. * @returns {Function} Returns the new accessor function.
  94217. */
  94218. function basePropertyOf(object) {
  94219. return function(key) {
  94220. return object == null ? undefined : object[key];
  94221. };
  94222. }
  94223. /* harmony default export */ __webpack_exports__["default"] = (basePropertyOf);
  94224. /***/ }),
  94225. /***/ "./node_modules/lodash-es/_basePullAll.js":
  94226. /*!************************************************!*\
  94227. !*** ./node_modules/lodash-es/_basePullAll.js ***!
  94228. \************************************************/
  94229. /*! exports provided: default */
  94230. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94231. "use strict";
  94232. __webpack_require__.r(__webpack_exports__);
  94233. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  94234. /* harmony import */ var _baseIndexOf_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIndexOf.js */ "./node_modules/lodash-es/_baseIndexOf.js");
  94235. /* harmony import */ var _baseIndexOfWith_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIndexOfWith.js */ "./node_modules/lodash-es/_baseIndexOfWith.js");
  94236. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  94237. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  94238. /** Used for built-in method references. */
  94239. var arrayProto = Array.prototype;
  94240. /** Built-in value references. */
  94241. var splice = arrayProto.splice;
  94242. /**
  94243. * The base implementation of `_.pullAllBy` without support for iteratee
  94244. * shorthands.
  94245. *
  94246. * @private
  94247. * @param {Array} array The array to modify.
  94248. * @param {Array} values The values to remove.
  94249. * @param {Function} [iteratee] The iteratee invoked per element.
  94250. * @param {Function} [comparator] The comparator invoked per element.
  94251. * @returns {Array} Returns `array`.
  94252. */
  94253. function basePullAll(array, values, iteratee, comparator) {
  94254. var indexOf = comparator ? _baseIndexOfWith_js__WEBPACK_IMPORTED_MODULE_2__["default"] : _baseIndexOf_js__WEBPACK_IMPORTED_MODULE_1__["default"],
  94255. index = -1,
  94256. length = values.length,
  94257. seen = array;
  94258. if (array === values) {
  94259. values = Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_4__["default"])(values);
  94260. }
  94261. if (iteratee) {
  94262. seen = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_3__["default"])(iteratee));
  94263. }
  94264. while (++index < length) {
  94265. var fromIndex = 0,
  94266. value = values[index],
  94267. computed = iteratee ? iteratee(value) : value;
  94268. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  94269. if (seen !== array) {
  94270. splice.call(seen, fromIndex, 1);
  94271. }
  94272. splice.call(array, fromIndex, 1);
  94273. }
  94274. }
  94275. return array;
  94276. }
  94277. /* harmony default export */ __webpack_exports__["default"] = (basePullAll);
  94278. /***/ }),
  94279. /***/ "./node_modules/lodash-es/_basePullAt.js":
  94280. /*!***********************************************!*\
  94281. !*** ./node_modules/lodash-es/_basePullAt.js ***!
  94282. \***********************************************/
  94283. /*! exports provided: default */
  94284. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94285. "use strict";
  94286. __webpack_require__.r(__webpack_exports__);
  94287. /* harmony import */ var _baseUnset_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseUnset.js */ "./node_modules/lodash-es/_baseUnset.js");
  94288. /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
  94289. /** Used for built-in method references. */
  94290. var arrayProto = Array.prototype;
  94291. /** Built-in value references. */
  94292. var splice = arrayProto.splice;
  94293. /**
  94294. * The base implementation of `_.pullAt` without support for individual
  94295. * indexes or capturing the removed elements.
  94296. *
  94297. * @private
  94298. * @param {Array} array The array to modify.
  94299. * @param {number[]} indexes The indexes of elements to remove.
  94300. * @returns {Array} Returns `array`.
  94301. */
  94302. function basePullAt(array, indexes) {
  94303. var length = array ? indexes.length : 0,
  94304. lastIndex = length - 1;
  94305. while (length--) {
  94306. var index = indexes[length];
  94307. if (length == lastIndex || index !== previous) {
  94308. var previous = index;
  94309. if (Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_1__["default"])(index)) {
  94310. splice.call(array, index, 1);
  94311. } else {
  94312. Object(_baseUnset_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, index);
  94313. }
  94314. }
  94315. }
  94316. return array;
  94317. }
  94318. /* harmony default export */ __webpack_exports__["default"] = (basePullAt);
  94319. /***/ }),
  94320. /***/ "./node_modules/lodash-es/_baseRandom.js":
  94321. /*!***********************************************!*\
  94322. !*** ./node_modules/lodash-es/_baseRandom.js ***!
  94323. \***********************************************/
  94324. /*! exports provided: default */
  94325. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94326. "use strict";
  94327. __webpack_require__.r(__webpack_exports__);
  94328. /* Built-in method references for those with the same name as other `lodash` methods. */
  94329. var nativeFloor = Math.floor,
  94330. nativeRandom = Math.random;
  94331. /**
  94332. * The base implementation of `_.random` without support for returning
  94333. * floating-point numbers.
  94334. *
  94335. * @private
  94336. * @param {number} lower The lower bound.
  94337. * @param {number} upper The upper bound.
  94338. * @returns {number} Returns the random number.
  94339. */
  94340. function baseRandom(lower, upper) {
  94341. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  94342. }
  94343. /* harmony default export */ __webpack_exports__["default"] = (baseRandom);
  94344. /***/ }),
  94345. /***/ "./node_modules/lodash-es/_baseRange.js":
  94346. /*!**********************************************!*\
  94347. !*** ./node_modules/lodash-es/_baseRange.js ***!
  94348. \**********************************************/
  94349. /*! exports provided: default */
  94350. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94351. "use strict";
  94352. __webpack_require__.r(__webpack_exports__);
  94353. /* Built-in method references for those with the same name as other `lodash` methods. */
  94354. var nativeCeil = Math.ceil,
  94355. nativeMax = Math.max;
  94356. /**
  94357. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  94358. * coerce arguments.
  94359. *
  94360. * @private
  94361. * @param {number} start The start of the range.
  94362. * @param {number} end The end of the range.
  94363. * @param {number} step The value to increment or decrement by.
  94364. * @param {boolean} [fromRight] Specify iterating from right to left.
  94365. * @returns {Array} Returns the range of numbers.
  94366. */
  94367. function baseRange(start, end, step, fromRight) {
  94368. var index = -1,
  94369. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  94370. result = Array(length);
  94371. while (length--) {
  94372. result[fromRight ? length : ++index] = start;
  94373. start += step;
  94374. }
  94375. return result;
  94376. }
  94377. /* harmony default export */ __webpack_exports__["default"] = (baseRange);
  94378. /***/ }),
  94379. /***/ "./node_modules/lodash-es/_baseReduce.js":
  94380. /*!***********************************************!*\
  94381. !*** ./node_modules/lodash-es/_baseReduce.js ***!
  94382. \***********************************************/
  94383. /*! exports provided: default */
  94384. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94385. "use strict";
  94386. __webpack_require__.r(__webpack_exports__);
  94387. /**
  94388. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  94389. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  94390. *
  94391. * @private
  94392. * @param {Array|Object} collection The collection to iterate over.
  94393. * @param {Function} iteratee The function invoked per iteration.
  94394. * @param {*} accumulator The initial value.
  94395. * @param {boolean} initAccum Specify using the first or last element of
  94396. * `collection` as the initial value.
  94397. * @param {Function} eachFunc The function to iterate over `collection`.
  94398. * @returns {*} Returns the accumulated value.
  94399. */
  94400. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  94401. eachFunc(collection, function(value, index, collection) {
  94402. accumulator = initAccum
  94403. ? (initAccum = false, value)
  94404. : iteratee(accumulator, value, index, collection);
  94405. });
  94406. return accumulator;
  94407. }
  94408. /* harmony default export */ __webpack_exports__["default"] = (baseReduce);
  94409. /***/ }),
  94410. /***/ "./node_modules/lodash-es/_baseRepeat.js":
  94411. /*!***********************************************!*\
  94412. !*** ./node_modules/lodash-es/_baseRepeat.js ***!
  94413. \***********************************************/
  94414. /*! exports provided: default */
  94415. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94416. "use strict";
  94417. __webpack_require__.r(__webpack_exports__);
  94418. /** Used as references for various `Number` constants. */
  94419. var MAX_SAFE_INTEGER = 9007199254740991;
  94420. /* Built-in method references for those with the same name as other `lodash` methods. */
  94421. var nativeFloor = Math.floor;
  94422. /**
  94423. * The base implementation of `_.repeat` which doesn't coerce arguments.
  94424. *
  94425. * @private
  94426. * @param {string} string The string to repeat.
  94427. * @param {number} n The number of times to repeat the string.
  94428. * @returns {string} Returns the repeated string.
  94429. */
  94430. function baseRepeat(string, n) {
  94431. var result = '';
  94432. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  94433. return result;
  94434. }
  94435. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  94436. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  94437. do {
  94438. if (n % 2) {
  94439. result += string;
  94440. }
  94441. n = nativeFloor(n / 2);
  94442. if (n) {
  94443. string += string;
  94444. }
  94445. } while (n);
  94446. return result;
  94447. }
  94448. /* harmony default export */ __webpack_exports__["default"] = (baseRepeat);
  94449. /***/ }),
  94450. /***/ "./node_modules/lodash-es/_baseRest.js":
  94451. /*!*********************************************!*\
  94452. !*** ./node_modules/lodash-es/_baseRest.js ***!
  94453. \*********************************************/
  94454. /*! exports provided: default */
  94455. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94456. "use strict";
  94457. __webpack_require__.r(__webpack_exports__);
  94458. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  94459. /* harmony import */ var _overRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_overRest.js */ "./node_modules/lodash-es/_overRest.js");
  94460. /* harmony import */ var _setToString_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_setToString.js */ "./node_modules/lodash-es/_setToString.js");
  94461. /**
  94462. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  94463. *
  94464. * @private
  94465. * @param {Function} func The function to apply a rest parameter to.
  94466. * @param {number} [start=func.length-1] The start position of the rest parameter.
  94467. * @returns {Function} Returns the new function.
  94468. */
  94469. function baseRest(func, start) {
  94470. return Object(_setToString_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_overRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func, start, _identity_js__WEBPACK_IMPORTED_MODULE_0__["default"]), func + '');
  94471. }
  94472. /* harmony default export */ __webpack_exports__["default"] = (baseRest);
  94473. /***/ }),
  94474. /***/ "./node_modules/lodash-es/_baseSample.js":
  94475. /*!***********************************************!*\
  94476. !*** ./node_modules/lodash-es/_baseSample.js ***!
  94477. \***********************************************/
  94478. /*! exports provided: default */
  94479. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94480. "use strict";
  94481. __webpack_require__.r(__webpack_exports__);
  94482. /* harmony import */ var _arraySample_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arraySample.js */ "./node_modules/lodash-es/_arraySample.js");
  94483. /* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./values.js */ "./node_modules/lodash-es/values.js");
  94484. /**
  94485. * The base implementation of `_.sample`.
  94486. *
  94487. * @private
  94488. * @param {Array|Object} collection The collection to sample.
  94489. * @returns {*} Returns the random element.
  94490. */
  94491. function baseSample(collection) {
  94492. return Object(_arraySample_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_values_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection));
  94493. }
  94494. /* harmony default export */ __webpack_exports__["default"] = (baseSample);
  94495. /***/ }),
  94496. /***/ "./node_modules/lodash-es/_baseSampleSize.js":
  94497. /*!***************************************************!*\
  94498. !*** ./node_modules/lodash-es/_baseSampleSize.js ***!
  94499. \***************************************************/
  94500. /*! exports provided: default */
  94501. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94502. "use strict";
  94503. __webpack_require__.r(__webpack_exports__);
  94504. /* harmony import */ var _baseClamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClamp.js */ "./node_modules/lodash-es/_baseClamp.js");
  94505. /* harmony import */ var _shuffleSelf_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_shuffleSelf.js */ "./node_modules/lodash-es/_shuffleSelf.js");
  94506. /* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./values.js */ "./node_modules/lodash-es/values.js");
  94507. /**
  94508. * The base implementation of `_.sampleSize` without param guards.
  94509. *
  94510. * @private
  94511. * @param {Array|Object} collection The collection to sample.
  94512. * @param {number} n The number of elements to sample.
  94513. * @returns {Array} Returns the random elements.
  94514. */
  94515. function baseSampleSize(collection, n) {
  94516. var array = Object(_values_js__WEBPACK_IMPORTED_MODULE_2__["default"])(collection);
  94517. return Object(_shuffleSelf_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseClamp_js__WEBPACK_IMPORTED_MODULE_0__["default"])(n, 0, array.length));
  94518. }
  94519. /* harmony default export */ __webpack_exports__["default"] = (baseSampleSize);
  94520. /***/ }),
  94521. /***/ "./node_modules/lodash-es/_baseSet.js":
  94522. /*!********************************************!*\
  94523. !*** ./node_modules/lodash-es/_baseSet.js ***!
  94524. \********************************************/
  94525. /*! exports provided: default */
  94526. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94527. "use strict";
  94528. __webpack_require__.r(__webpack_exports__);
  94529. /* harmony import */ var _assignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assignValue.js */ "./node_modules/lodash-es/_assignValue.js");
  94530. /* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
  94531. /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
  94532. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  94533. /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
  94534. /**
  94535. * The base implementation of `_.set`.
  94536. *
  94537. * @private
  94538. * @param {Object} object The object to modify.
  94539. * @param {Array|string} path The path of the property to set.
  94540. * @param {*} value The value to set.
  94541. * @param {Function} [customizer] The function to customize path creation.
  94542. * @returns {Object} Returns `object`.
  94543. */
  94544. function baseSet(object, path, value, customizer) {
  94545. if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object)) {
  94546. return object;
  94547. }
  94548. path = Object(_castPath_js__WEBPACK_IMPORTED_MODULE_1__["default"])(path, object);
  94549. var index = -1,
  94550. length = path.length,
  94551. lastIndex = length - 1,
  94552. nested = object;
  94553. while (nested != null && ++index < length) {
  94554. var key = Object(_toKey_js__WEBPACK_IMPORTED_MODULE_4__["default"])(path[index]),
  94555. newValue = value;
  94556. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  94557. return object;
  94558. }
  94559. if (index != lastIndex) {
  94560. var objValue = nested[key];
  94561. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  94562. if (newValue === undefined) {
  94563. newValue = Object(_isObject_js__WEBPACK_IMPORTED_MODULE_3__["default"])(objValue)
  94564. ? objValue
  94565. : (Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_2__["default"])(path[index + 1]) ? [] : {});
  94566. }
  94567. }
  94568. Object(_assignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(nested, key, newValue);
  94569. nested = nested[key];
  94570. }
  94571. return object;
  94572. }
  94573. /* harmony default export */ __webpack_exports__["default"] = (baseSet);
  94574. /***/ }),
  94575. /***/ "./node_modules/lodash-es/_baseSetData.js":
  94576. /*!************************************************!*\
  94577. !*** ./node_modules/lodash-es/_baseSetData.js ***!
  94578. \************************************************/
  94579. /*! exports provided: default */
  94580. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94581. "use strict";
  94582. __webpack_require__.r(__webpack_exports__);
  94583. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  94584. /* harmony import */ var _metaMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_metaMap.js */ "./node_modules/lodash-es/_metaMap.js");
  94585. /**
  94586. * The base implementation of `setData` without support for hot loop shorting.
  94587. *
  94588. * @private
  94589. * @param {Function} func The function to associate metadata with.
  94590. * @param {*} data The metadata.
  94591. * @returns {Function} Returns `func`.
  94592. */
  94593. var baseSetData = !_metaMap_js__WEBPACK_IMPORTED_MODULE_1__["default"] ? _identity_js__WEBPACK_IMPORTED_MODULE_0__["default"] : function(func, data) {
  94594. _metaMap_js__WEBPACK_IMPORTED_MODULE_1__["default"].set(func, data);
  94595. return func;
  94596. };
  94597. /* harmony default export */ __webpack_exports__["default"] = (baseSetData);
  94598. /***/ }),
  94599. /***/ "./node_modules/lodash-es/_baseSetToString.js":
  94600. /*!****************************************************!*\
  94601. !*** ./node_modules/lodash-es/_baseSetToString.js ***!
  94602. \****************************************************/
  94603. /*! exports provided: default */
  94604. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94605. "use strict";
  94606. __webpack_require__.r(__webpack_exports__);
  94607. /* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constant.js */ "./node_modules/lodash-es/constant.js");
  94608. /* harmony import */ var _defineProperty_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_defineProperty.js */ "./node_modules/lodash-es/_defineProperty.js");
  94609. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  94610. /**
  94611. * The base implementation of `setToString` without support for hot loop shorting.
  94612. *
  94613. * @private
  94614. * @param {Function} func The function to modify.
  94615. * @param {Function} string The `toString` result.
  94616. * @returns {Function} Returns `func`.
  94617. */
  94618. var baseSetToString = !_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"] ? _identity_js__WEBPACK_IMPORTED_MODULE_2__["default"] : function(func, string) {
  94619. return Object(_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func, 'toString', {
  94620. 'configurable': true,
  94621. 'enumerable': false,
  94622. 'value': Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__["default"])(string),
  94623. 'writable': true
  94624. });
  94625. };
  94626. /* harmony default export */ __webpack_exports__["default"] = (baseSetToString);
  94627. /***/ }),
  94628. /***/ "./node_modules/lodash-es/_baseShuffle.js":
  94629. /*!************************************************!*\
  94630. !*** ./node_modules/lodash-es/_baseShuffle.js ***!
  94631. \************************************************/
  94632. /*! exports provided: default */
  94633. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94634. "use strict";
  94635. __webpack_require__.r(__webpack_exports__);
  94636. /* harmony import */ var _shuffleSelf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_shuffleSelf.js */ "./node_modules/lodash-es/_shuffleSelf.js");
  94637. /* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./values.js */ "./node_modules/lodash-es/values.js");
  94638. /**
  94639. * The base implementation of `_.shuffle`.
  94640. *
  94641. * @private
  94642. * @param {Array|Object} collection The collection to shuffle.
  94643. * @returns {Array} Returns the new shuffled array.
  94644. */
  94645. function baseShuffle(collection) {
  94646. return Object(_shuffleSelf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_values_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection));
  94647. }
  94648. /* harmony default export */ __webpack_exports__["default"] = (baseShuffle);
  94649. /***/ }),
  94650. /***/ "./node_modules/lodash-es/_baseSlice.js":
  94651. /*!**********************************************!*\
  94652. !*** ./node_modules/lodash-es/_baseSlice.js ***!
  94653. \**********************************************/
  94654. /*! exports provided: default */
  94655. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94656. "use strict";
  94657. __webpack_require__.r(__webpack_exports__);
  94658. /**
  94659. * The base implementation of `_.slice` without an iteratee call guard.
  94660. *
  94661. * @private
  94662. * @param {Array} array The array to slice.
  94663. * @param {number} [start=0] The start position.
  94664. * @param {number} [end=array.length] The end position.
  94665. * @returns {Array} Returns the slice of `array`.
  94666. */
  94667. function baseSlice(array, start, end) {
  94668. var index = -1,
  94669. length = array.length;
  94670. if (start < 0) {
  94671. start = -start > length ? 0 : (length + start);
  94672. }
  94673. end = end > length ? length : end;
  94674. if (end < 0) {
  94675. end += length;
  94676. }
  94677. length = start > end ? 0 : ((end - start) >>> 0);
  94678. start >>>= 0;
  94679. var result = Array(length);
  94680. while (++index < length) {
  94681. result[index] = array[index + start];
  94682. }
  94683. return result;
  94684. }
  94685. /* harmony default export */ __webpack_exports__["default"] = (baseSlice);
  94686. /***/ }),
  94687. /***/ "./node_modules/lodash-es/_baseSome.js":
  94688. /*!*********************************************!*\
  94689. !*** ./node_modules/lodash-es/_baseSome.js ***!
  94690. \*********************************************/
  94691. /*! exports provided: default */
  94692. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94693. "use strict";
  94694. __webpack_require__.r(__webpack_exports__);
  94695. /* harmony import */ var _baseEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseEach.js */ "./node_modules/lodash-es/_baseEach.js");
  94696. /**
  94697. * The base implementation of `_.some` without support for iteratee shorthands.
  94698. *
  94699. * @private
  94700. * @param {Array|Object} collection The collection to iterate over.
  94701. * @param {Function} predicate The function invoked per iteration.
  94702. * @returns {boolean} Returns `true` if any element passes the predicate check,
  94703. * else `false`.
  94704. */
  94705. function baseSome(collection, predicate) {
  94706. var result;
  94707. Object(_baseEach_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection, function(value, index, collection) {
  94708. result = predicate(value, index, collection);
  94709. return !result;
  94710. });
  94711. return !!result;
  94712. }
  94713. /* harmony default export */ __webpack_exports__["default"] = (baseSome);
  94714. /***/ }),
  94715. /***/ "./node_modules/lodash-es/_baseSortBy.js":
  94716. /*!***********************************************!*\
  94717. !*** ./node_modules/lodash-es/_baseSortBy.js ***!
  94718. \***********************************************/
  94719. /*! exports provided: default */
  94720. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94721. "use strict";
  94722. __webpack_require__.r(__webpack_exports__);
  94723. /**
  94724. * The base implementation of `_.sortBy` which uses `comparer` to define the
  94725. * sort order of `array` and replaces criteria objects with their corresponding
  94726. * values.
  94727. *
  94728. * @private
  94729. * @param {Array} array The array to sort.
  94730. * @param {Function} comparer The function to define sort order.
  94731. * @returns {Array} Returns `array`.
  94732. */
  94733. function baseSortBy(array, comparer) {
  94734. var length = array.length;
  94735. array.sort(comparer);
  94736. while (length--) {
  94737. array[length] = array[length].value;
  94738. }
  94739. return array;
  94740. }
  94741. /* harmony default export */ __webpack_exports__["default"] = (baseSortBy);
  94742. /***/ }),
  94743. /***/ "./node_modules/lodash-es/_baseSortedIndex.js":
  94744. /*!****************************************************!*\
  94745. !*** ./node_modules/lodash-es/_baseSortedIndex.js ***!
  94746. \****************************************************/
  94747. /*! exports provided: default */
  94748. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94749. "use strict";
  94750. __webpack_require__.r(__webpack_exports__);
  94751. /* harmony import */ var _baseSortedIndexBy_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSortedIndexBy.js */ "./node_modules/lodash-es/_baseSortedIndexBy.js");
  94752. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  94753. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  94754. /** Used as references for the maximum length and index of an array. */
  94755. var MAX_ARRAY_LENGTH = 4294967295,
  94756. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  94757. /**
  94758. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  94759. * performs a binary search of `array` to determine the index at which `value`
  94760. * should be inserted into `array` in order to maintain its sort order.
  94761. *
  94762. * @private
  94763. * @param {Array} array The sorted array to inspect.
  94764. * @param {*} value The value to evaluate.
  94765. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  94766. * @returns {number} Returns the index at which `value` should be inserted
  94767. * into `array`.
  94768. */
  94769. function baseSortedIndex(array, value, retHighest) {
  94770. var low = 0,
  94771. high = array == null ? low : array.length;
  94772. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  94773. while (low < high) {
  94774. var mid = (low + high) >>> 1,
  94775. computed = array[mid];
  94776. if (computed !== null && !Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_2__["default"])(computed) &&
  94777. (retHighest ? (computed <= value) : (computed < value))) {
  94778. low = mid + 1;
  94779. } else {
  94780. high = mid;
  94781. }
  94782. }
  94783. return high;
  94784. }
  94785. return Object(_baseSortedIndexBy_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, value, _identity_js__WEBPACK_IMPORTED_MODULE_1__["default"], retHighest);
  94786. }
  94787. /* harmony default export */ __webpack_exports__["default"] = (baseSortedIndex);
  94788. /***/ }),
  94789. /***/ "./node_modules/lodash-es/_baseSortedIndexBy.js":
  94790. /*!******************************************************!*\
  94791. !*** ./node_modules/lodash-es/_baseSortedIndexBy.js ***!
  94792. \******************************************************/
  94793. /*! exports provided: default */
  94794. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94795. "use strict";
  94796. __webpack_require__.r(__webpack_exports__);
  94797. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  94798. /** Used as references for the maximum length and index of an array. */
  94799. var MAX_ARRAY_LENGTH = 4294967295,
  94800. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1;
  94801. /* Built-in method references for those with the same name as other `lodash` methods. */
  94802. var nativeFloor = Math.floor,
  94803. nativeMin = Math.min;
  94804. /**
  94805. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  94806. * which invokes `iteratee` for `value` and each element of `array` to compute
  94807. * their sort ranking. The iteratee is invoked with one argument; (value).
  94808. *
  94809. * @private
  94810. * @param {Array} array The sorted array to inspect.
  94811. * @param {*} value The value to evaluate.
  94812. * @param {Function} iteratee The iteratee invoked per element.
  94813. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  94814. * @returns {number} Returns the index at which `value` should be inserted
  94815. * into `array`.
  94816. */
  94817. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  94818. var low = 0,
  94819. high = array == null ? 0 : array.length;
  94820. if (high === 0) {
  94821. return 0;
  94822. }
  94823. value = iteratee(value);
  94824. var valIsNaN = value !== value,
  94825. valIsNull = value === null,
  94826. valIsSymbol = Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value),
  94827. valIsUndefined = value === undefined;
  94828. while (low < high) {
  94829. var mid = nativeFloor((low + high) / 2),
  94830. computed = iteratee(array[mid]),
  94831. othIsDefined = computed !== undefined,
  94832. othIsNull = computed === null,
  94833. othIsReflexive = computed === computed,
  94834. othIsSymbol = Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_0__["default"])(computed);
  94835. if (valIsNaN) {
  94836. var setLow = retHighest || othIsReflexive;
  94837. } else if (valIsUndefined) {
  94838. setLow = othIsReflexive && (retHighest || othIsDefined);
  94839. } else if (valIsNull) {
  94840. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  94841. } else if (valIsSymbol) {
  94842. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  94843. } else if (othIsNull || othIsSymbol) {
  94844. setLow = false;
  94845. } else {
  94846. setLow = retHighest ? (computed <= value) : (computed < value);
  94847. }
  94848. if (setLow) {
  94849. low = mid + 1;
  94850. } else {
  94851. high = mid;
  94852. }
  94853. }
  94854. return nativeMin(high, MAX_ARRAY_INDEX);
  94855. }
  94856. /* harmony default export */ __webpack_exports__["default"] = (baseSortedIndexBy);
  94857. /***/ }),
  94858. /***/ "./node_modules/lodash-es/_baseSortedUniq.js":
  94859. /*!***************************************************!*\
  94860. !*** ./node_modules/lodash-es/_baseSortedUniq.js ***!
  94861. \***************************************************/
  94862. /*! exports provided: default */
  94863. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94864. "use strict";
  94865. __webpack_require__.r(__webpack_exports__);
  94866. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  94867. /**
  94868. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  94869. * support for iteratee shorthands.
  94870. *
  94871. * @private
  94872. * @param {Array} array The array to inspect.
  94873. * @param {Function} [iteratee] The iteratee invoked per element.
  94874. * @returns {Array} Returns the new duplicate free array.
  94875. */
  94876. function baseSortedUniq(array, iteratee) {
  94877. var index = -1,
  94878. length = array.length,
  94879. resIndex = 0,
  94880. result = [];
  94881. while (++index < length) {
  94882. var value = array[index],
  94883. computed = iteratee ? iteratee(value) : value;
  94884. if (!index || !Object(_eq_js__WEBPACK_IMPORTED_MODULE_0__["default"])(computed, seen)) {
  94885. var seen = computed;
  94886. result[resIndex++] = value === 0 ? 0 : value;
  94887. }
  94888. }
  94889. return result;
  94890. }
  94891. /* harmony default export */ __webpack_exports__["default"] = (baseSortedUniq);
  94892. /***/ }),
  94893. /***/ "./node_modules/lodash-es/_baseSum.js":
  94894. /*!********************************************!*\
  94895. !*** ./node_modules/lodash-es/_baseSum.js ***!
  94896. \********************************************/
  94897. /*! exports provided: default */
  94898. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94899. "use strict";
  94900. __webpack_require__.r(__webpack_exports__);
  94901. /**
  94902. * The base implementation of `_.sum` and `_.sumBy` without support for
  94903. * iteratee shorthands.
  94904. *
  94905. * @private
  94906. * @param {Array} array The array to iterate over.
  94907. * @param {Function} iteratee The function invoked per iteration.
  94908. * @returns {number} Returns the sum.
  94909. */
  94910. function baseSum(array, iteratee) {
  94911. var result,
  94912. index = -1,
  94913. length = array.length;
  94914. while (++index < length) {
  94915. var current = iteratee(array[index]);
  94916. if (current !== undefined) {
  94917. result = result === undefined ? current : (result + current);
  94918. }
  94919. }
  94920. return result;
  94921. }
  94922. /* harmony default export */ __webpack_exports__["default"] = (baseSum);
  94923. /***/ }),
  94924. /***/ "./node_modules/lodash-es/_baseTimes.js":
  94925. /*!**********************************************!*\
  94926. !*** ./node_modules/lodash-es/_baseTimes.js ***!
  94927. \**********************************************/
  94928. /*! exports provided: default */
  94929. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94930. "use strict";
  94931. __webpack_require__.r(__webpack_exports__);
  94932. /**
  94933. * The base implementation of `_.times` without support for iteratee shorthands
  94934. * or max array length checks.
  94935. *
  94936. * @private
  94937. * @param {number} n The number of times to invoke `iteratee`.
  94938. * @param {Function} iteratee The function invoked per iteration.
  94939. * @returns {Array} Returns the array of results.
  94940. */
  94941. function baseTimes(n, iteratee) {
  94942. var index = -1,
  94943. result = Array(n);
  94944. while (++index < n) {
  94945. result[index] = iteratee(index);
  94946. }
  94947. return result;
  94948. }
  94949. /* harmony default export */ __webpack_exports__["default"] = (baseTimes);
  94950. /***/ }),
  94951. /***/ "./node_modules/lodash-es/_baseToNumber.js":
  94952. /*!*************************************************!*\
  94953. !*** ./node_modules/lodash-es/_baseToNumber.js ***!
  94954. \*************************************************/
  94955. /*! exports provided: default */
  94956. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94957. "use strict";
  94958. __webpack_require__.r(__webpack_exports__);
  94959. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  94960. /** Used as references for various `Number` constants. */
  94961. var NAN = 0 / 0;
  94962. /**
  94963. * The base implementation of `_.toNumber` which doesn't ensure correct
  94964. * conversions of binary, hexadecimal, or octal string values.
  94965. *
  94966. * @private
  94967. * @param {*} value The value to process.
  94968. * @returns {number} Returns the number.
  94969. */
  94970. function baseToNumber(value) {
  94971. if (typeof value == 'number') {
  94972. return value;
  94973. }
  94974. if (Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value)) {
  94975. return NAN;
  94976. }
  94977. return +value;
  94978. }
  94979. /* harmony default export */ __webpack_exports__["default"] = (baseToNumber);
  94980. /***/ }),
  94981. /***/ "./node_modules/lodash-es/_baseToPairs.js":
  94982. /*!************************************************!*\
  94983. !*** ./node_modules/lodash-es/_baseToPairs.js ***!
  94984. \************************************************/
  94985. /*! exports provided: default */
  94986. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94987. "use strict";
  94988. __webpack_require__.r(__webpack_exports__);
  94989. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  94990. /**
  94991. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  94992. * of key-value pairs for `object` corresponding to the property names of `props`.
  94993. *
  94994. * @private
  94995. * @param {Object} object The object to query.
  94996. * @param {Array} props The property names to get values for.
  94997. * @returns {Object} Returns the key-value pairs.
  94998. */
  94999. function baseToPairs(object, props) {
  95000. return Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(props, function(key) {
  95001. return [key, object[key]];
  95002. });
  95003. }
  95004. /* harmony default export */ __webpack_exports__["default"] = (baseToPairs);
  95005. /***/ }),
  95006. /***/ "./node_modules/lodash-es/_baseToString.js":
  95007. /*!*************************************************!*\
  95008. !*** ./node_modules/lodash-es/_baseToString.js ***!
  95009. \*************************************************/
  95010. /*! exports provided: default */
  95011. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95012. "use strict";
  95013. __webpack_require__.r(__webpack_exports__);
  95014. /* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
  95015. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  95016. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  95017. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  95018. /** Used as references for various `Number` constants. */
  95019. var INFINITY = 1 / 0;
  95020. /** Used to convert symbols to primitives and strings. */
  95021. var symbolProto = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype : undefined,
  95022. symbolToString = symbolProto ? symbolProto.toString : undefined;
  95023. /**
  95024. * The base implementation of `_.toString` which doesn't convert nullish
  95025. * values to empty strings.
  95026. *
  95027. * @private
  95028. * @param {*} value The value to process.
  95029. * @returns {string} Returns the string.
  95030. */
  95031. function baseToString(value) {
  95032. // Exit early for strings to avoid a performance hit in some environments.
  95033. if (typeof value == 'string') {
  95034. return value;
  95035. }
  95036. if (Object(_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value)) {
  95037. // Recursively convert values (susceptible to call stack limits).
  95038. return Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value, baseToString) + '';
  95039. }
  95040. if (Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value)) {
  95041. return symbolToString ? symbolToString.call(value) : '';
  95042. }
  95043. var result = (value + '');
  95044. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  95045. }
  95046. /* harmony default export */ __webpack_exports__["default"] = (baseToString);
  95047. /***/ }),
  95048. /***/ "./node_modules/lodash-es/_baseTrim.js":
  95049. /*!*********************************************!*\
  95050. !*** ./node_modules/lodash-es/_baseTrim.js ***!
  95051. \*********************************************/
  95052. /*! exports provided: default */
  95053. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95054. "use strict";
  95055. __webpack_require__.r(__webpack_exports__);
  95056. /* harmony import */ var _trimmedEndIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_trimmedEndIndex.js */ "./node_modules/lodash-es/_trimmedEndIndex.js");
  95057. /** Used to match leading whitespace. */
  95058. var reTrimStart = /^\s+/;
  95059. /**
  95060. * The base implementation of `_.trim`.
  95061. *
  95062. * @private
  95063. * @param {string} string The string to trim.
  95064. * @returns {string} Returns the trimmed string.
  95065. */
  95066. function baseTrim(string) {
  95067. return string
  95068. ? string.slice(0, Object(_trimmedEndIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(string) + 1).replace(reTrimStart, '')
  95069. : string;
  95070. }
  95071. /* harmony default export */ __webpack_exports__["default"] = (baseTrim);
  95072. /***/ }),
  95073. /***/ "./node_modules/lodash-es/_baseUnary.js":
  95074. /*!**********************************************!*\
  95075. !*** ./node_modules/lodash-es/_baseUnary.js ***!
  95076. \**********************************************/
  95077. /*! exports provided: default */
  95078. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95079. "use strict";
  95080. __webpack_require__.r(__webpack_exports__);
  95081. /**
  95082. * The base implementation of `_.unary` without support for storing metadata.
  95083. *
  95084. * @private
  95085. * @param {Function} func The function to cap arguments for.
  95086. * @returns {Function} Returns the new capped function.
  95087. */
  95088. function baseUnary(func) {
  95089. return function(value) {
  95090. return func(value);
  95091. };
  95092. }
  95093. /* harmony default export */ __webpack_exports__["default"] = (baseUnary);
  95094. /***/ }),
  95095. /***/ "./node_modules/lodash-es/_baseUniq.js":
  95096. /*!*********************************************!*\
  95097. !*** ./node_modules/lodash-es/_baseUniq.js ***!
  95098. \*********************************************/
  95099. /*! exports provided: default */
  95100. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95101. "use strict";
  95102. __webpack_require__.r(__webpack_exports__);
  95103. /* harmony import */ var _SetCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_SetCache.js */ "./node_modules/lodash-es/_SetCache.js");
  95104. /* harmony import */ var _arrayIncludes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayIncludes.js */ "./node_modules/lodash-es/_arrayIncludes.js");
  95105. /* harmony import */ var _arrayIncludesWith_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_arrayIncludesWith.js */ "./node_modules/lodash-es/_arrayIncludesWith.js");
  95106. /* harmony import */ var _cacheHas_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_cacheHas.js */ "./node_modules/lodash-es/_cacheHas.js");
  95107. /* harmony import */ var _createSet_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_createSet.js */ "./node_modules/lodash-es/_createSet.js");
  95108. /* harmony import */ var _setToArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_setToArray.js */ "./node_modules/lodash-es/_setToArray.js");
  95109. /** Used as the size to enable large array optimizations. */
  95110. var LARGE_ARRAY_SIZE = 200;
  95111. /**
  95112. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  95113. *
  95114. * @private
  95115. * @param {Array} array The array to inspect.
  95116. * @param {Function} [iteratee] The iteratee invoked per element.
  95117. * @param {Function} [comparator] The comparator invoked per element.
  95118. * @returns {Array} Returns the new duplicate free array.
  95119. */
  95120. function baseUniq(array, iteratee, comparator) {
  95121. var index = -1,
  95122. includes = _arrayIncludes_js__WEBPACK_IMPORTED_MODULE_1__["default"],
  95123. length = array.length,
  95124. isCommon = true,
  95125. result = [],
  95126. seen = result;
  95127. if (comparator) {
  95128. isCommon = false;
  95129. includes = _arrayIncludesWith_js__WEBPACK_IMPORTED_MODULE_2__["default"];
  95130. }
  95131. else if (length >= LARGE_ARRAY_SIZE) {
  95132. var set = iteratee ? null : Object(_createSet_js__WEBPACK_IMPORTED_MODULE_4__["default"])(array);
  95133. if (set) {
  95134. return Object(_setToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(set);
  95135. }
  95136. isCommon = false;
  95137. includes = _cacheHas_js__WEBPACK_IMPORTED_MODULE_3__["default"];
  95138. seen = new _SetCache_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  95139. }
  95140. else {
  95141. seen = iteratee ? [] : result;
  95142. }
  95143. outer:
  95144. while (++index < length) {
  95145. var value = array[index],
  95146. computed = iteratee ? iteratee(value) : value;
  95147. value = (comparator || value !== 0) ? value : 0;
  95148. if (isCommon && computed === computed) {
  95149. var seenIndex = seen.length;
  95150. while (seenIndex--) {
  95151. if (seen[seenIndex] === computed) {
  95152. continue outer;
  95153. }
  95154. }
  95155. if (iteratee) {
  95156. seen.push(computed);
  95157. }
  95158. result.push(value);
  95159. }
  95160. else if (!includes(seen, computed, comparator)) {
  95161. if (seen !== result) {
  95162. seen.push(computed);
  95163. }
  95164. result.push(value);
  95165. }
  95166. }
  95167. return result;
  95168. }
  95169. /* harmony default export */ __webpack_exports__["default"] = (baseUniq);
  95170. /***/ }),
  95171. /***/ "./node_modules/lodash-es/_baseUnset.js":
  95172. /*!**********************************************!*\
  95173. !*** ./node_modules/lodash-es/_baseUnset.js ***!
  95174. \**********************************************/
  95175. /*! exports provided: default */
  95176. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95177. "use strict";
  95178. __webpack_require__.r(__webpack_exports__);
  95179. /* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
  95180. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  95181. /* harmony import */ var _parent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_parent.js */ "./node_modules/lodash-es/_parent.js");
  95182. /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
  95183. /**
  95184. * The base implementation of `_.unset`.
  95185. *
  95186. * @private
  95187. * @param {Object} object The object to modify.
  95188. * @param {Array|string} path The property path to unset.
  95189. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  95190. */
  95191. function baseUnset(object, path) {
  95192. path = Object(_castPath_js__WEBPACK_IMPORTED_MODULE_0__["default"])(path, object);
  95193. object = Object(_parent_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object, path);
  95194. return object == null || delete object[Object(_toKey_js__WEBPACK_IMPORTED_MODULE_3__["default"])(Object(_last_js__WEBPACK_IMPORTED_MODULE_1__["default"])(path))];
  95195. }
  95196. /* harmony default export */ __webpack_exports__["default"] = (baseUnset);
  95197. /***/ }),
  95198. /***/ "./node_modules/lodash-es/_baseUpdate.js":
  95199. /*!***********************************************!*\
  95200. !*** ./node_modules/lodash-es/_baseUpdate.js ***!
  95201. \***********************************************/
  95202. /*! exports provided: default */
  95203. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95204. "use strict";
  95205. __webpack_require__.r(__webpack_exports__);
  95206. /* harmony import */ var _baseGet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGet.js */ "./node_modules/lodash-es/_baseGet.js");
  95207. /* harmony import */ var _baseSet_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSet.js */ "./node_modules/lodash-es/_baseSet.js");
  95208. /**
  95209. * The base implementation of `_.update`.
  95210. *
  95211. * @private
  95212. * @param {Object} object The object to modify.
  95213. * @param {Array|string} path The path of the property to update.
  95214. * @param {Function} updater The function to produce the updated value.
  95215. * @param {Function} [customizer] The function to customize path creation.
  95216. * @returns {Object} Returns `object`.
  95217. */
  95218. function baseUpdate(object, path, updater, customizer) {
  95219. return Object(_baseSet_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, path, updater(Object(_baseGet_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path)), customizer);
  95220. }
  95221. /* harmony default export */ __webpack_exports__["default"] = (baseUpdate);
  95222. /***/ }),
  95223. /***/ "./node_modules/lodash-es/_baseValues.js":
  95224. /*!***********************************************!*\
  95225. !*** ./node_modules/lodash-es/_baseValues.js ***!
  95226. \***********************************************/
  95227. /*! exports provided: default */
  95228. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95229. "use strict";
  95230. __webpack_require__.r(__webpack_exports__);
  95231. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  95232. /**
  95233. * The base implementation of `_.values` and `_.valuesIn` which creates an
  95234. * array of `object` property values corresponding to the property names
  95235. * of `props`.
  95236. *
  95237. * @private
  95238. * @param {Object} object The object to query.
  95239. * @param {Array} props The property names to get values for.
  95240. * @returns {Object} Returns the array of property values.
  95241. */
  95242. function baseValues(object, props) {
  95243. return Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(props, function(key) {
  95244. return object[key];
  95245. });
  95246. }
  95247. /* harmony default export */ __webpack_exports__["default"] = (baseValues);
  95248. /***/ }),
  95249. /***/ "./node_modules/lodash-es/_baseWhile.js":
  95250. /*!**********************************************!*\
  95251. !*** ./node_modules/lodash-es/_baseWhile.js ***!
  95252. \**********************************************/
  95253. /*! exports provided: default */
  95254. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95255. "use strict";
  95256. __webpack_require__.r(__webpack_exports__);
  95257. /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
  95258. /**
  95259. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  95260. * without support for iteratee shorthands.
  95261. *
  95262. * @private
  95263. * @param {Array} array The array to query.
  95264. * @param {Function} predicate The function invoked per iteration.
  95265. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  95266. * @param {boolean} [fromRight] Specify iterating from right to left.
  95267. * @returns {Array} Returns the slice of `array`.
  95268. */
  95269. function baseWhile(array, predicate, isDrop, fromRight) {
  95270. var length = array.length,
  95271. index = fromRight ? length : -1;
  95272. while ((fromRight ? index-- : ++index < length) &&
  95273. predicate(array[index], index, array)) {}
  95274. return isDrop
  95275. ? Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  95276. : Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  95277. }
  95278. /* harmony default export */ __webpack_exports__["default"] = (baseWhile);
  95279. /***/ }),
  95280. /***/ "./node_modules/lodash-es/_baseWrapperValue.js":
  95281. /*!*****************************************************!*\
  95282. !*** ./node_modules/lodash-es/_baseWrapperValue.js ***!
  95283. \*****************************************************/
  95284. /*! exports provided: default */
  95285. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95286. "use strict";
  95287. __webpack_require__.r(__webpack_exports__);
  95288. /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
  95289. /* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayPush.js */ "./node_modules/lodash-es/_arrayPush.js");
  95290. /* harmony import */ var _arrayReduce_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_arrayReduce.js */ "./node_modules/lodash-es/_arrayReduce.js");
  95291. /**
  95292. * The base implementation of `wrapperValue` which returns the result of
  95293. * performing a sequence of actions on the unwrapped `value`, where each
  95294. * successive action is supplied the return value of the previous.
  95295. *
  95296. * @private
  95297. * @param {*} value The unwrapped value.
  95298. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  95299. * @returns {*} Returns the resolved value.
  95300. */
  95301. function baseWrapperValue(value, actions) {
  95302. var result = value;
  95303. if (result instanceof _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"]) {
  95304. result = result.value();
  95305. }
  95306. return Object(_arrayReduce_js__WEBPACK_IMPORTED_MODULE_2__["default"])(actions, function(result, action) {
  95307. return action.func.apply(action.thisArg, Object(_arrayPush_js__WEBPACK_IMPORTED_MODULE_1__["default"])([result], action.args));
  95308. }, result);
  95309. }
  95310. /* harmony default export */ __webpack_exports__["default"] = (baseWrapperValue);
  95311. /***/ }),
  95312. /***/ "./node_modules/lodash-es/_baseXor.js":
  95313. /*!********************************************!*\
  95314. !*** ./node_modules/lodash-es/_baseXor.js ***!
  95315. \********************************************/
  95316. /*! exports provided: default */
  95317. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95318. "use strict";
  95319. __webpack_require__.r(__webpack_exports__);
  95320. /* harmony import */ var _baseDifference_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseDifference.js */ "./node_modules/lodash-es/_baseDifference.js");
  95321. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  95322. /* harmony import */ var _baseUniq_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseUniq.js */ "./node_modules/lodash-es/_baseUniq.js");
  95323. /**
  95324. * The base implementation of methods like `_.xor`, without support for
  95325. * iteratee shorthands, that accepts an array of arrays to inspect.
  95326. *
  95327. * @private
  95328. * @param {Array} arrays The arrays to inspect.
  95329. * @param {Function} [iteratee] The iteratee invoked per element.
  95330. * @param {Function} [comparator] The comparator invoked per element.
  95331. * @returns {Array} Returns the new array of values.
  95332. */
  95333. function baseXor(arrays, iteratee, comparator) {
  95334. var length = arrays.length;
  95335. if (length < 2) {
  95336. return length ? Object(_baseUniq_js__WEBPACK_IMPORTED_MODULE_2__["default"])(arrays[0]) : [];
  95337. }
  95338. var index = -1,
  95339. result = Array(length);
  95340. while (++index < length) {
  95341. var array = arrays[index],
  95342. othIndex = -1;
  95343. while (++othIndex < length) {
  95344. if (othIndex != index) {
  95345. result[index] = Object(_baseDifference_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result[index] || array, arrays[othIndex], iteratee, comparator);
  95346. }
  95347. }
  95348. }
  95349. return Object(_baseUniq_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__["default"])(result, 1), iteratee, comparator);
  95350. }
  95351. /* harmony default export */ __webpack_exports__["default"] = (baseXor);
  95352. /***/ }),
  95353. /***/ "./node_modules/lodash-es/_baseZipObject.js":
  95354. /*!**************************************************!*\
  95355. !*** ./node_modules/lodash-es/_baseZipObject.js ***!
  95356. \**************************************************/
  95357. /*! exports provided: default */
  95358. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95359. "use strict";
  95360. __webpack_require__.r(__webpack_exports__);
  95361. /**
  95362. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  95363. *
  95364. * @private
  95365. * @param {Array} props The property identifiers.
  95366. * @param {Array} values The property values.
  95367. * @param {Function} assignFunc The function to assign values.
  95368. * @returns {Object} Returns the new object.
  95369. */
  95370. function baseZipObject(props, values, assignFunc) {
  95371. var index = -1,
  95372. length = props.length,
  95373. valsLength = values.length,
  95374. result = {};
  95375. while (++index < length) {
  95376. var value = index < valsLength ? values[index] : undefined;
  95377. assignFunc(result, props[index], value);
  95378. }
  95379. return result;
  95380. }
  95381. /* harmony default export */ __webpack_exports__["default"] = (baseZipObject);
  95382. /***/ }),
  95383. /***/ "./node_modules/lodash-es/_cacheHas.js":
  95384. /*!*********************************************!*\
  95385. !*** ./node_modules/lodash-es/_cacheHas.js ***!
  95386. \*********************************************/
  95387. /*! exports provided: default */
  95388. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95389. "use strict";
  95390. __webpack_require__.r(__webpack_exports__);
  95391. /**
  95392. * Checks if a `cache` value for `key` exists.
  95393. *
  95394. * @private
  95395. * @param {Object} cache The cache to query.
  95396. * @param {string} key The key of the entry to check.
  95397. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  95398. */
  95399. function cacheHas(cache, key) {
  95400. return cache.has(key);
  95401. }
  95402. /* harmony default export */ __webpack_exports__["default"] = (cacheHas);
  95403. /***/ }),
  95404. /***/ "./node_modules/lodash-es/_castArrayLikeObject.js":
  95405. /*!********************************************************!*\
  95406. !*** ./node_modules/lodash-es/_castArrayLikeObject.js ***!
  95407. \********************************************************/
  95408. /*! exports provided: default */
  95409. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95410. "use strict";
  95411. __webpack_require__.r(__webpack_exports__);
  95412. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  95413. /**
  95414. * Casts `value` to an empty array if it's not an array like object.
  95415. *
  95416. * @private
  95417. * @param {*} value The value to inspect.
  95418. * @returns {Array|Object} Returns the cast array-like object.
  95419. */
  95420. function castArrayLikeObject(value) {
  95421. return Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) ? value : [];
  95422. }
  95423. /* harmony default export */ __webpack_exports__["default"] = (castArrayLikeObject);
  95424. /***/ }),
  95425. /***/ "./node_modules/lodash-es/_castFunction.js":
  95426. /*!*************************************************!*\
  95427. !*** ./node_modules/lodash-es/_castFunction.js ***!
  95428. \*************************************************/
  95429. /*! exports provided: default */
  95430. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95431. "use strict";
  95432. __webpack_require__.r(__webpack_exports__);
  95433. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  95434. /**
  95435. * Casts `value` to `identity` if it's not a function.
  95436. *
  95437. * @private
  95438. * @param {*} value The value to inspect.
  95439. * @returns {Function} Returns cast function.
  95440. */
  95441. function castFunction(value) {
  95442. return typeof value == 'function' ? value : _identity_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  95443. }
  95444. /* harmony default export */ __webpack_exports__["default"] = (castFunction);
  95445. /***/ }),
  95446. /***/ "./node_modules/lodash-es/_castPath.js":
  95447. /*!*********************************************!*\
  95448. !*** ./node_modules/lodash-es/_castPath.js ***!
  95449. \*********************************************/
  95450. /*! exports provided: default */
  95451. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95452. "use strict";
  95453. __webpack_require__.r(__webpack_exports__);
  95454. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  95455. /* harmony import */ var _isKey_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isKey.js */ "./node_modules/lodash-es/_isKey.js");
  95456. /* harmony import */ var _stringToPath_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_stringToPath.js */ "./node_modules/lodash-es/_stringToPath.js");
  95457. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  95458. /**
  95459. * Casts `value` to a path array if it's not one.
  95460. *
  95461. * @private
  95462. * @param {*} value The value to inspect.
  95463. * @param {Object} [object] The object to query keys on.
  95464. * @returns {Array} Returns the cast property path array.
  95465. */
  95466. function castPath(value, object) {
  95467. if (Object(_isArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value)) {
  95468. return value;
  95469. }
  95470. return Object(_isKey_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value, object) ? [value] : Object(_stringToPath_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value));
  95471. }
  95472. /* harmony default export */ __webpack_exports__["default"] = (castPath);
  95473. /***/ }),
  95474. /***/ "./node_modules/lodash-es/_castRest.js":
  95475. /*!*********************************************!*\
  95476. !*** ./node_modules/lodash-es/_castRest.js ***!
  95477. \*********************************************/
  95478. /*! exports provided: default */
  95479. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95480. "use strict";
  95481. __webpack_require__.r(__webpack_exports__);
  95482. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  95483. /**
  95484. * A `baseRest` alias which can be replaced with `identity` by module
  95485. * replacement plugins.
  95486. *
  95487. * @private
  95488. * @type {Function}
  95489. * @param {Function} func The function to apply a rest parameter to.
  95490. * @returns {Function} Returns the new function.
  95491. */
  95492. var castRest = _baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  95493. /* harmony default export */ __webpack_exports__["default"] = (castRest);
  95494. /***/ }),
  95495. /***/ "./node_modules/lodash-es/_castSlice.js":
  95496. /*!**********************************************!*\
  95497. !*** ./node_modules/lodash-es/_castSlice.js ***!
  95498. \**********************************************/
  95499. /*! exports provided: default */
  95500. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95501. "use strict";
  95502. __webpack_require__.r(__webpack_exports__);
  95503. /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
  95504. /**
  95505. * Casts `array` to a slice if it's needed.
  95506. *
  95507. * @private
  95508. * @param {Array} array The array to inspect.
  95509. * @param {number} start The start position.
  95510. * @param {number} [end=array.length] The end position.
  95511. * @returns {Array} Returns the cast slice.
  95512. */
  95513. function castSlice(array, start, end) {
  95514. var length = array.length;
  95515. end = end === undefined ? length : end;
  95516. return (!start && end >= length) ? array : Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, start, end);
  95517. }
  95518. /* harmony default export */ __webpack_exports__["default"] = (castSlice);
  95519. /***/ }),
  95520. /***/ "./node_modules/lodash-es/_charsEndIndex.js":
  95521. /*!**************************************************!*\
  95522. !*** ./node_modules/lodash-es/_charsEndIndex.js ***!
  95523. \**************************************************/
  95524. /*! exports provided: default */
  95525. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95526. "use strict";
  95527. __webpack_require__.r(__webpack_exports__);
  95528. /* harmony import */ var _baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIndexOf.js */ "./node_modules/lodash-es/_baseIndexOf.js");
  95529. /**
  95530. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  95531. * that is not found in the character symbols.
  95532. *
  95533. * @private
  95534. * @param {Array} strSymbols The string symbols to inspect.
  95535. * @param {Array} chrSymbols The character symbols to find.
  95536. * @returns {number} Returns the index of the last unmatched string symbol.
  95537. */
  95538. function charsEndIndex(strSymbols, chrSymbols) {
  95539. var index = strSymbols.length;
  95540. while (index-- && Object(_baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(chrSymbols, strSymbols[index], 0) > -1) {}
  95541. return index;
  95542. }
  95543. /* harmony default export */ __webpack_exports__["default"] = (charsEndIndex);
  95544. /***/ }),
  95545. /***/ "./node_modules/lodash-es/_charsStartIndex.js":
  95546. /*!****************************************************!*\
  95547. !*** ./node_modules/lodash-es/_charsStartIndex.js ***!
  95548. \****************************************************/
  95549. /*! exports provided: default */
  95550. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95551. "use strict";
  95552. __webpack_require__.r(__webpack_exports__);
  95553. /* harmony import */ var _baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIndexOf.js */ "./node_modules/lodash-es/_baseIndexOf.js");
  95554. /**
  95555. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  95556. * that is not found in the character symbols.
  95557. *
  95558. * @private
  95559. * @param {Array} strSymbols The string symbols to inspect.
  95560. * @param {Array} chrSymbols The character symbols to find.
  95561. * @returns {number} Returns the index of the first unmatched string symbol.
  95562. */
  95563. function charsStartIndex(strSymbols, chrSymbols) {
  95564. var index = -1,
  95565. length = strSymbols.length;
  95566. while (++index < length && Object(_baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(chrSymbols, strSymbols[index], 0) > -1) {}
  95567. return index;
  95568. }
  95569. /* harmony default export */ __webpack_exports__["default"] = (charsStartIndex);
  95570. /***/ }),
  95571. /***/ "./node_modules/lodash-es/_cloneArrayBuffer.js":
  95572. /*!*****************************************************!*\
  95573. !*** ./node_modules/lodash-es/_cloneArrayBuffer.js ***!
  95574. \*****************************************************/
  95575. /*! exports provided: default */
  95576. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95577. "use strict";
  95578. __webpack_require__.r(__webpack_exports__);
  95579. /* harmony import */ var _Uint8Array_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Uint8Array.js */ "./node_modules/lodash-es/_Uint8Array.js");
  95580. /**
  95581. * Creates a clone of `arrayBuffer`.
  95582. *
  95583. * @private
  95584. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  95585. * @returns {ArrayBuffer} Returns the cloned array buffer.
  95586. */
  95587. function cloneArrayBuffer(arrayBuffer) {
  95588. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  95589. new _Uint8Array_js__WEBPACK_IMPORTED_MODULE_0__["default"](result).set(new _Uint8Array_js__WEBPACK_IMPORTED_MODULE_0__["default"](arrayBuffer));
  95590. return result;
  95591. }
  95592. /* harmony default export */ __webpack_exports__["default"] = (cloneArrayBuffer);
  95593. /***/ }),
  95594. /***/ "./node_modules/lodash-es/_cloneBuffer.js":
  95595. /*!************************************************!*\
  95596. !*** ./node_modules/lodash-es/_cloneBuffer.js ***!
  95597. \************************************************/
  95598. /*! exports provided: default */
  95599. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95600. "use strict";
  95601. __webpack_require__.r(__webpack_exports__);
  95602. /* WEBPACK VAR INJECTION */(function(module) {/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  95603. /** Detect free variable `exports`. */
  95604. var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
  95605. /** Detect free variable `module`. */
  95606. var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
  95607. /** Detect the popular CommonJS extension `module.exports`. */
  95608. var moduleExports = freeModule && freeModule.exports === freeExports;
  95609. /** Built-in value references. */
  95610. var Buffer = moduleExports ? _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].Buffer : undefined,
  95611. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
  95612. /**
  95613. * Creates a clone of `buffer`.
  95614. *
  95615. * @private
  95616. * @param {Buffer} buffer The buffer to clone.
  95617. * @param {boolean} [isDeep] Specify a deep clone.
  95618. * @returns {Buffer} Returns the cloned buffer.
  95619. */
  95620. function cloneBuffer(buffer, isDeep) {
  95621. if (isDeep) {
  95622. return buffer.slice();
  95623. }
  95624. var length = buffer.length,
  95625. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  95626. buffer.copy(result);
  95627. return result;
  95628. }
  95629. /* harmony default export */ __webpack_exports__["default"] = (cloneBuffer);
  95630. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/harmony-module.js */ "./node_modules/webpack/buildin/harmony-module.js")(module)))
  95631. /***/ }),
  95632. /***/ "./node_modules/lodash-es/_cloneDataView.js":
  95633. /*!**************************************************!*\
  95634. !*** ./node_modules/lodash-es/_cloneDataView.js ***!
  95635. \**************************************************/
  95636. /*! exports provided: default */
  95637. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95638. "use strict";
  95639. __webpack_require__.r(__webpack_exports__);
  95640. /* harmony import */ var _cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_cloneArrayBuffer.js */ "./node_modules/lodash-es/_cloneArrayBuffer.js");
  95641. /**
  95642. * Creates a clone of `dataView`.
  95643. *
  95644. * @private
  95645. * @param {Object} dataView The data view to clone.
  95646. * @param {boolean} [isDeep] Specify a deep clone.
  95647. * @returns {Object} Returns the cloned data view.
  95648. */
  95649. function cloneDataView(dataView, isDeep) {
  95650. var buffer = isDeep ? Object(_cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__["default"])(dataView.buffer) : dataView.buffer;
  95651. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  95652. }
  95653. /* harmony default export */ __webpack_exports__["default"] = (cloneDataView);
  95654. /***/ }),
  95655. /***/ "./node_modules/lodash-es/_cloneRegExp.js":
  95656. /*!************************************************!*\
  95657. !*** ./node_modules/lodash-es/_cloneRegExp.js ***!
  95658. \************************************************/
  95659. /*! exports provided: default */
  95660. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95661. "use strict";
  95662. __webpack_require__.r(__webpack_exports__);
  95663. /** Used to match `RegExp` flags from their coerced string values. */
  95664. var reFlags = /\w*$/;
  95665. /**
  95666. * Creates a clone of `regexp`.
  95667. *
  95668. * @private
  95669. * @param {Object} regexp The regexp to clone.
  95670. * @returns {Object} Returns the cloned regexp.
  95671. */
  95672. function cloneRegExp(regexp) {
  95673. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  95674. result.lastIndex = regexp.lastIndex;
  95675. return result;
  95676. }
  95677. /* harmony default export */ __webpack_exports__["default"] = (cloneRegExp);
  95678. /***/ }),
  95679. /***/ "./node_modules/lodash-es/_cloneSymbol.js":
  95680. /*!************************************************!*\
  95681. !*** ./node_modules/lodash-es/_cloneSymbol.js ***!
  95682. \************************************************/
  95683. /*! exports provided: default */
  95684. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95685. "use strict";
  95686. __webpack_require__.r(__webpack_exports__);
  95687. /* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
  95688. /** Used to convert symbols to primitives and strings. */
  95689. var symbolProto = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype : undefined,
  95690. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
  95691. /**
  95692. * Creates a clone of the `symbol` object.
  95693. *
  95694. * @private
  95695. * @param {Object} symbol The symbol object to clone.
  95696. * @returns {Object} Returns the cloned symbol object.
  95697. */
  95698. function cloneSymbol(symbol) {
  95699. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  95700. }
  95701. /* harmony default export */ __webpack_exports__["default"] = (cloneSymbol);
  95702. /***/ }),
  95703. /***/ "./node_modules/lodash-es/_cloneTypedArray.js":
  95704. /*!****************************************************!*\
  95705. !*** ./node_modules/lodash-es/_cloneTypedArray.js ***!
  95706. \****************************************************/
  95707. /*! exports provided: default */
  95708. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95709. "use strict";
  95710. __webpack_require__.r(__webpack_exports__);
  95711. /* harmony import */ var _cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_cloneArrayBuffer.js */ "./node_modules/lodash-es/_cloneArrayBuffer.js");
  95712. /**
  95713. * Creates a clone of `typedArray`.
  95714. *
  95715. * @private
  95716. * @param {Object} typedArray The typed array to clone.
  95717. * @param {boolean} [isDeep] Specify a deep clone.
  95718. * @returns {Object} Returns the cloned typed array.
  95719. */
  95720. function cloneTypedArray(typedArray, isDeep) {
  95721. var buffer = isDeep ? Object(_cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__["default"])(typedArray.buffer) : typedArray.buffer;
  95722. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  95723. }
  95724. /* harmony default export */ __webpack_exports__["default"] = (cloneTypedArray);
  95725. /***/ }),
  95726. /***/ "./node_modules/lodash-es/_compareAscending.js":
  95727. /*!*****************************************************!*\
  95728. !*** ./node_modules/lodash-es/_compareAscending.js ***!
  95729. \*****************************************************/
  95730. /*! exports provided: default */
  95731. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95732. "use strict";
  95733. __webpack_require__.r(__webpack_exports__);
  95734. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  95735. /**
  95736. * Compares values to sort them in ascending order.
  95737. *
  95738. * @private
  95739. * @param {*} value The value to compare.
  95740. * @param {*} other The other value to compare.
  95741. * @returns {number} Returns the sort order indicator for `value`.
  95742. */
  95743. function compareAscending(value, other) {
  95744. if (value !== other) {
  95745. var valIsDefined = value !== undefined,
  95746. valIsNull = value === null,
  95747. valIsReflexive = value === value,
  95748. valIsSymbol = Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  95749. var othIsDefined = other !== undefined,
  95750. othIsNull = other === null,
  95751. othIsReflexive = other === other,
  95752. othIsSymbol = Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_0__["default"])(other);
  95753. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  95754. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  95755. (valIsNull && othIsDefined && othIsReflexive) ||
  95756. (!valIsDefined && othIsReflexive) ||
  95757. !valIsReflexive) {
  95758. return 1;
  95759. }
  95760. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  95761. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  95762. (othIsNull && valIsDefined && valIsReflexive) ||
  95763. (!othIsDefined && valIsReflexive) ||
  95764. !othIsReflexive) {
  95765. return -1;
  95766. }
  95767. }
  95768. return 0;
  95769. }
  95770. /* harmony default export */ __webpack_exports__["default"] = (compareAscending);
  95771. /***/ }),
  95772. /***/ "./node_modules/lodash-es/_compareMultiple.js":
  95773. /*!****************************************************!*\
  95774. !*** ./node_modules/lodash-es/_compareMultiple.js ***!
  95775. \****************************************************/
  95776. /*! exports provided: default */
  95777. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95778. "use strict";
  95779. __webpack_require__.r(__webpack_exports__);
  95780. /* harmony import */ var _compareAscending_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_compareAscending.js */ "./node_modules/lodash-es/_compareAscending.js");
  95781. /**
  95782. * Used by `_.orderBy` to compare multiple properties of a value to another
  95783. * and stable sort them.
  95784. *
  95785. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  95786. * specify an order of "desc" for descending or "asc" for ascending sort order
  95787. * of corresponding values.
  95788. *
  95789. * @private
  95790. * @param {Object} object The object to compare.
  95791. * @param {Object} other The other object to compare.
  95792. * @param {boolean[]|string[]} orders The order to sort by for each property.
  95793. * @returns {number} Returns the sort order indicator for `object`.
  95794. */
  95795. function compareMultiple(object, other, orders) {
  95796. var index = -1,
  95797. objCriteria = object.criteria,
  95798. othCriteria = other.criteria,
  95799. length = objCriteria.length,
  95800. ordersLength = orders.length;
  95801. while (++index < length) {
  95802. var result = Object(_compareAscending_js__WEBPACK_IMPORTED_MODULE_0__["default"])(objCriteria[index], othCriteria[index]);
  95803. if (result) {
  95804. if (index >= ordersLength) {
  95805. return result;
  95806. }
  95807. var order = orders[index];
  95808. return result * (order == 'desc' ? -1 : 1);
  95809. }
  95810. }
  95811. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  95812. // that causes it, under certain circumstances, to provide the same value for
  95813. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  95814. // for more details.
  95815. //
  95816. // This also ensures a stable sort in V8 and other engines.
  95817. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  95818. return object.index - other.index;
  95819. }
  95820. /* harmony default export */ __webpack_exports__["default"] = (compareMultiple);
  95821. /***/ }),
  95822. /***/ "./node_modules/lodash-es/_composeArgs.js":
  95823. /*!************************************************!*\
  95824. !*** ./node_modules/lodash-es/_composeArgs.js ***!
  95825. \************************************************/
  95826. /*! exports provided: default */
  95827. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95828. "use strict";
  95829. __webpack_require__.r(__webpack_exports__);
  95830. /* Built-in method references for those with the same name as other `lodash` methods. */
  95831. var nativeMax = Math.max;
  95832. /**
  95833. * Creates an array that is the composition of partially applied arguments,
  95834. * placeholders, and provided arguments into a single array of arguments.
  95835. *
  95836. * @private
  95837. * @param {Array} args The provided arguments.
  95838. * @param {Array} partials The arguments to prepend to those provided.
  95839. * @param {Array} holders The `partials` placeholder indexes.
  95840. * @params {boolean} [isCurried] Specify composing for a curried function.
  95841. * @returns {Array} Returns the new array of composed arguments.
  95842. */
  95843. function composeArgs(args, partials, holders, isCurried) {
  95844. var argsIndex = -1,
  95845. argsLength = args.length,
  95846. holdersLength = holders.length,
  95847. leftIndex = -1,
  95848. leftLength = partials.length,
  95849. rangeLength = nativeMax(argsLength - holdersLength, 0),
  95850. result = Array(leftLength + rangeLength),
  95851. isUncurried = !isCurried;
  95852. while (++leftIndex < leftLength) {
  95853. result[leftIndex] = partials[leftIndex];
  95854. }
  95855. while (++argsIndex < holdersLength) {
  95856. if (isUncurried || argsIndex < argsLength) {
  95857. result[holders[argsIndex]] = args[argsIndex];
  95858. }
  95859. }
  95860. while (rangeLength--) {
  95861. result[leftIndex++] = args[argsIndex++];
  95862. }
  95863. return result;
  95864. }
  95865. /* harmony default export */ __webpack_exports__["default"] = (composeArgs);
  95866. /***/ }),
  95867. /***/ "./node_modules/lodash-es/_composeArgsRight.js":
  95868. /*!*****************************************************!*\
  95869. !*** ./node_modules/lodash-es/_composeArgsRight.js ***!
  95870. \*****************************************************/
  95871. /*! exports provided: default */
  95872. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95873. "use strict";
  95874. __webpack_require__.r(__webpack_exports__);
  95875. /* Built-in method references for those with the same name as other `lodash` methods. */
  95876. var nativeMax = Math.max;
  95877. /**
  95878. * This function is like `composeArgs` except that the arguments composition
  95879. * is tailored for `_.partialRight`.
  95880. *
  95881. * @private
  95882. * @param {Array} args The provided arguments.
  95883. * @param {Array} partials The arguments to append to those provided.
  95884. * @param {Array} holders The `partials` placeholder indexes.
  95885. * @params {boolean} [isCurried] Specify composing for a curried function.
  95886. * @returns {Array} Returns the new array of composed arguments.
  95887. */
  95888. function composeArgsRight(args, partials, holders, isCurried) {
  95889. var argsIndex = -1,
  95890. argsLength = args.length,
  95891. holdersIndex = -1,
  95892. holdersLength = holders.length,
  95893. rightIndex = -1,
  95894. rightLength = partials.length,
  95895. rangeLength = nativeMax(argsLength - holdersLength, 0),
  95896. result = Array(rangeLength + rightLength),
  95897. isUncurried = !isCurried;
  95898. while (++argsIndex < rangeLength) {
  95899. result[argsIndex] = args[argsIndex];
  95900. }
  95901. var offset = argsIndex;
  95902. while (++rightIndex < rightLength) {
  95903. result[offset + rightIndex] = partials[rightIndex];
  95904. }
  95905. while (++holdersIndex < holdersLength) {
  95906. if (isUncurried || argsIndex < argsLength) {
  95907. result[offset + holders[holdersIndex]] = args[argsIndex++];
  95908. }
  95909. }
  95910. return result;
  95911. }
  95912. /* harmony default export */ __webpack_exports__["default"] = (composeArgsRight);
  95913. /***/ }),
  95914. /***/ "./node_modules/lodash-es/_copyArray.js":
  95915. /*!**********************************************!*\
  95916. !*** ./node_modules/lodash-es/_copyArray.js ***!
  95917. \**********************************************/
  95918. /*! exports provided: default */
  95919. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95920. "use strict";
  95921. __webpack_require__.r(__webpack_exports__);
  95922. /**
  95923. * Copies the values of `source` to `array`.
  95924. *
  95925. * @private
  95926. * @param {Array} source The array to copy values from.
  95927. * @param {Array} [array=[]] The array to copy values to.
  95928. * @returns {Array} Returns `array`.
  95929. */
  95930. function copyArray(source, array) {
  95931. var index = -1,
  95932. length = source.length;
  95933. array || (array = Array(length));
  95934. while (++index < length) {
  95935. array[index] = source[index];
  95936. }
  95937. return array;
  95938. }
  95939. /* harmony default export */ __webpack_exports__["default"] = (copyArray);
  95940. /***/ }),
  95941. /***/ "./node_modules/lodash-es/_copyObject.js":
  95942. /*!***********************************************!*\
  95943. !*** ./node_modules/lodash-es/_copyObject.js ***!
  95944. \***********************************************/
  95945. /*! exports provided: default */
  95946. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95947. "use strict";
  95948. __webpack_require__.r(__webpack_exports__);
  95949. /* harmony import */ var _assignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assignValue.js */ "./node_modules/lodash-es/_assignValue.js");
  95950. /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
  95951. /**
  95952. * Copies properties of `source` to `object`.
  95953. *
  95954. * @private
  95955. * @param {Object} source The object to copy properties from.
  95956. * @param {Array} props The property identifiers to copy.
  95957. * @param {Object} [object={}] The object to copy properties to.
  95958. * @param {Function} [customizer] The function to customize copied values.
  95959. * @returns {Object} Returns `object`.
  95960. */
  95961. function copyObject(source, props, object, customizer) {
  95962. var isNew = !object;
  95963. object || (object = {});
  95964. var index = -1,
  95965. length = props.length;
  95966. while (++index < length) {
  95967. var key = props[index];
  95968. var newValue = customizer
  95969. ? customizer(object[key], source[key], key, object, source)
  95970. : undefined;
  95971. if (newValue === undefined) {
  95972. newValue = source[key];
  95973. }
  95974. if (isNew) {
  95975. Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, key, newValue);
  95976. } else {
  95977. Object(_assignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, key, newValue);
  95978. }
  95979. }
  95980. return object;
  95981. }
  95982. /* harmony default export */ __webpack_exports__["default"] = (copyObject);
  95983. /***/ }),
  95984. /***/ "./node_modules/lodash-es/_copySymbols.js":
  95985. /*!************************************************!*\
  95986. !*** ./node_modules/lodash-es/_copySymbols.js ***!
  95987. \************************************************/
  95988. /*! exports provided: default */
  95989. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95990. "use strict";
  95991. __webpack_require__.r(__webpack_exports__);
  95992. /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
  95993. /* harmony import */ var _getSymbols_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getSymbols.js */ "./node_modules/lodash-es/_getSymbols.js");
  95994. /**
  95995. * Copies own symbols of `source` to `object`.
  95996. *
  95997. * @private
  95998. * @param {Object} source The object to copy symbols from.
  95999. * @param {Object} [object={}] The object to copy symbols to.
  96000. * @returns {Object} Returns `object`.
  96001. */
  96002. function copySymbols(source, object) {
  96003. return Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, Object(_getSymbols_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source), object);
  96004. }
  96005. /* harmony default export */ __webpack_exports__["default"] = (copySymbols);
  96006. /***/ }),
  96007. /***/ "./node_modules/lodash-es/_copySymbolsIn.js":
  96008. /*!**************************************************!*\
  96009. !*** ./node_modules/lodash-es/_copySymbolsIn.js ***!
  96010. \**************************************************/
  96011. /*! exports provided: default */
  96012. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96013. "use strict";
  96014. __webpack_require__.r(__webpack_exports__);
  96015. /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
  96016. /* harmony import */ var _getSymbolsIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getSymbolsIn.js */ "./node_modules/lodash-es/_getSymbolsIn.js");
  96017. /**
  96018. * Copies own and inherited symbols of `source` to `object`.
  96019. *
  96020. * @private
  96021. * @param {Object} source The object to copy symbols from.
  96022. * @param {Object} [object={}] The object to copy symbols to.
  96023. * @returns {Object} Returns `object`.
  96024. */
  96025. function copySymbolsIn(source, object) {
  96026. return Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, Object(_getSymbolsIn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source), object);
  96027. }
  96028. /* harmony default export */ __webpack_exports__["default"] = (copySymbolsIn);
  96029. /***/ }),
  96030. /***/ "./node_modules/lodash-es/_coreJsData.js":
  96031. /*!***********************************************!*\
  96032. !*** ./node_modules/lodash-es/_coreJsData.js ***!
  96033. \***********************************************/
  96034. /*! exports provided: default */
  96035. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96036. "use strict";
  96037. __webpack_require__.r(__webpack_exports__);
  96038. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  96039. /** Used to detect overreaching core-js shims. */
  96040. var coreJsData = _root_js__WEBPACK_IMPORTED_MODULE_0__["default"]['__core-js_shared__'];
  96041. /* harmony default export */ __webpack_exports__["default"] = (coreJsData);
  96042. /***/ }),
  96043. /***/ "./node_modules/lodash-es/_countHolders.js":
  96044. /*!*************************************************!*\
  96045. !*** ./node_modules/lodash-es/_countHolders.js ***!
  96046. \*************************************************/
  96047. /*! exports provided: default */
  96048. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96049. "use strict";
  96050. __webpack_require__.r(__webpack_exports__);
  96051. /**
  96052. * Gets the number of `placeholder` occurrences in `array`.
  96053. *
  96054. * @private
  96055. * @param {Array} array The array to inspect.
  96056. * @param {*} placeholder The placeholder to search for.
  96057. * @returns {number} Returns the placeholder count.
  96058. */
  96059. function countHolders(array, placeholder) {
  96060. var length = array.length,
  96061. result = 0;
  96062. while (length--) {
  96063. if (array[length] === placeholder) {
  96064. ++result;
  96065. }
  96066. }
  96067. return result;
  96068. }
  96069. /* harmony default export */ __webpack_exports__["default"] = (countHolders);
  96070. /***/ }),
  96071. /***/ "./node_modules/lodash-es/_createAggregator.js":
  96072. /*!*****************************************************!*\
  96073. !*** ./node_modules/lodash-es/_createAggregator.js ***!
  96074. \*****************************************************/
  96075. /*! exports provided: default */
  96076. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96077. "use strict";
  96078. __webpack_require__.r(__webpack_exports__);
  96079. /* harmony import */ var _arrayAggregator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayAggregator.js */ "./node_modules/lodash-es/_arrayAggregator.js");
  96080. /* harmony import */ var _baseAggregator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseAggregator.js */ "./node_modules/lodash-es/_baseAggregator.js");
  96081. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  96082. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  96083. /**
  96084. * Creates a function like `_.groupBy`.
  96085. *
  96086. * @private
  96087. * @param {Function} setter The function to set accumulator values.
  96088. * @param {Function} [initializer] The accumulator object initializer.
  96089. * @returns {Function} Returns the new aggregator function.
  96090. */
  96091. function createAggregator(setter, initializer) {
  96092. return function(collection, iteratee) {
  96093. var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection) ? _arrayAggregator_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseAggregator_js__WEBPACK_IMPORTED_MODULE_1__["default"],
  96094. accumulator = initializer ? initializer() : {};
  96095. return func(collection, setter, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee, 2), accumulator);
  96096. };
  96097. }
  96098. /* harmony default export */ __webpack_exports__["default"] = (createAggregator);
  96099. /***/ }),
  96100. /***/ "./node_modules/lodash-es/_createAssigner.js":
  96101. /*!***************************************************!*\
  96102. !*** ./node_modules/lodash-es/_createAssigner.js ***!
  96103. \***************************************************/
  96104. /*! exports provided: default */
  96105. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96106. "use strict";
  96107. __webpack_require__.r(__webpack_exports__);
  96108. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  96109. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  96110. /**
  96111. * Creates a function like `_.assign`.
  96112. *
  96113. * @private
  96114. * @param {Function} assigner The function to assign values.
  96115. * @returns {Function} Returns the new assigner function.
  96116. */
  96117. function createAssigner(assigner) {
  96118. return Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(object, sources) {
  96119. var index = -1,
  96120. length = sources.length,
  96121. customizer = length > 1 ? sources[length - 1] : undefined,
  96122. guard = length > 2 ? sources[2] : undefined;
  96123. customizer = (assigner.length > 3 && typeof customizer == 'function')
  96124. ? (length--, customizer)
  96125. : undefined;
  96126. if (guard && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__["default"])(sources[0], sources[1], guard)) {
  96127. customizer = length < 3 ? undefined : customizer;
  96128. length = 1;
  96129. }
  96130. object = Object(object);
  96131. while (++index < length) {
  96132. var source = sources[index];
  96133. if (source) {
  96134. assigner(object, source, index, customizer);
  96135. }
  96136. }
  96137. return object;
  96138. });
  96139. }
  96140. /* harmony default export */ __webpack_exports__["default"] = (createAssigner);
  96141. /***/ }),
  96142. /***/ "./node_modules/lodash-es/_createBaseEach.js":
  96143. /*!***************************************************!*\
  96144. !*** ./node_modules/lodash-es/_createBaseEach.js ***!
  96145. \***************************************************/
  96146. /*! exports provided: default */
  96147. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96148. "use strict";
  96149. __webpack_require__.r(__webpack_exports__);
  96150. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  96151. /**
  96152. * Creates a `baseEach` or `baseEachRight` function.
  96153. *
  96154. * @private
  96155. * @param {Function} eachFunc The function to iterate over a collection.
  96156. * @param {boolean} [fromRight] Specify iterating from right to left.
  96157. * @returns {Function} Returns the new base function.
  96158. */
  96159. function createBaseEach(eachFunc, fromRight) {
  96160. return function(collection, iteratee) {
  96161. if (collection == null) {
  96162. return collection;
  96163. }
  96164. if (!Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection)) {
  96165. return eachFunc(collection, iteratee);
  96166. }
  96167. var length = collection.length,
  96168. index = fromRight ? length : -1,
  96169. iterable = Object(collection);
  96170. while ((fromRight ? index-- : ++index < length)) {
  96171. if (iteratee(iterable[index], index, iterable) === false) {
  96172. break;
  96173. }
  96174. }
  96175. return collection;
  96176. };
  96177. }
  96178. /* harmony default export */ __webpack_exports__["default"] = (createBaseEach);
  96179. /***/ }),
  96180. /***/ "./node_modules/lodash-es/_createBaseFor.js":
  96181. /*!**************************************************!*\
  96182. !*** ./node_modules/lodash-es/_createBaseFor.js ***!
  96183. \**************************************************/
  96184. /*! exports provided: default */
  96185. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96186. "use strict";
  96187. __webpack_require__.r(__webpack_exports__);
  96188. /**
  96189. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  96190. *
  96191. * @private
  96192. * @param {boolean} [fromRight] Specify iterating from right to left.
  96193. * @returns {Function} Returns the new base function.
  96194. */
  96195. function createBaseFor(fromRight) {
  96196. return function(object, iteratee, keysFunc) {
  96197. var index = -1,
  96198. iterable = Object(object),
  96199. props = keysFunc(object),
  96200. length = props.length;
  96201. while (length--) {
  96202. var key = props[fromRight ? length : ++index];
  96203. if (iteratee(iterable[key], key, iterable) === false) {
  96204. break;
  96205. }
  96206. }
  96207. return object;
  96208. };
  96209. }
  96210. /* harmony default export */ __webpack_exports__["default"] = (createBaseFor);
  96211. /***/ }),
  96212. /***/ "./node_modules/lodash-es/_createBind.js":
  96213. /*!***********************************************!*\
  96214. !*** ./node_modules/lodash-es/_createBind.js ***!
  96215. \***********************************************/
  96216. /*! exports provided: default */
  96217. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96218. "use strict";
  96219. __webpack_require__.r(__webpack_exports__);
  96220. /* harmony import */ var _createCtor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createCtor.js */ "./node_modules/lodash-es/_createCtor.js");
  96221. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  96222. /** Used to compose bitmasks for function metadata. */
  96223. var WRAP_BIND_FLAG = 1;
  96224. /**
  96225. * Creates a function that wraps `func` to invoke it with the optional `this`
  96226. * binding of `thisArg`.
  96227. *
  96228. * @private
  96229. * @param {Function} func The function to wrap.
  96230. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  96231. * @param {*} [thisArg] The `this` binding of `func`.
  96232. * @returns {Function} Returns the new wrapped function.
  96233. */
  96234. function createBind(func, bitmask, thisArg) {
  96235. var isBind = bitmask & WRAP_BIND_FLAG,
  96236. Ctor = Object(_createCtor_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func);
  96237. function wrapper() {
  96238. var fn = (this && this !== _root_js__WEBPACK_IMPORTED_MODULE_1__["default"] && this instanceof wrapper) ? Ctor : func;
  96239. return fn.apply(isBind ? thisArg : this, arguments);
  96240. }
  96241. return wrapper;
  96242. }
  96243. /* harmony default export */ __webpack_exports__["default"] = (createBind);
  96244. /***/ }),
  96245. /***/ "./node_modules/lodash-es/_createCaseFirst.js":
  96246. /*!****************************************************!*\
  96247. !*** ./node_modules/lodash-es/_createCaseFirst.js ***!
  96248. \****************************************************/
  96249. /*! exports provided: default */
  96250. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96251. "use strict";
  96252. __webpack_require__.r(__webpack_exports__);
  96253. /* harmony import */ var _castSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_castSlice.js */ "./node_modules/lodash-es/_castSlice.js");
  96254. /* harmony import */ var _hasUnicode_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_hasUnicode.js */ "./node_modules/lodash-es/_hasUnicode.js");
  96255. /* harmony import */ var _stringToArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_stringToArray.js */ "./node_modules/lodash-es/_stringToArray.js");
  96256. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  96257. /**
  96258. * Creates a function like `_.lowerFirst`.
  96259. *
  96260. * @private
  96261. * @param {string} methodName The name of the `String` case method to use.
  96262. * @returns {Function} Returns the new case function.
  96263. */
  96264. function createCaseFirst(methodName) {
  96265. return function(string) {
  96266. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string);
  96267. var strSymbols = Object(_hasUnicode_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string)
  96268. ? Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(string)
  96269. : undefined;
  96270. var chr = strSymbols
  96271. ? strSymbols[0]
  96272. : string.charAt(0);
  96273. var trailing = strSymbols
  96274. ? Object(_castSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(strSymbols, 1).join('')
  96275. : string.slice(1);
  96276. return chr[methodName]() + trailing;
  96277. };
  96278. }
  96279. /* harmony default export */ __webpack_exports__["default"] = (createCaseFirst);
  96280. /***/ }),
  96281. /***/ "./node_modules/lodash-es/_createCompounder.js":
  96282. /*!*****************************************************!*\
  96283. !*** ./node_modules/lodash-es/_createCompounder.js ***!
  96284. \*****************************************************/
  96285. /*! exports provided: default */
  96286. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96287. "use strict";
  96288. __webpack_require__.r(__webpack_exports__);
  96289. /* harmony import */ var _arrayReduce_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayReduce.js */ "./node_modules/lodash-es/_arrayReduce.js");
  96290. /* harmony import */ var _deburr_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./deburr.js */ "./node_modules/lodash-es/deburr.js");
  96291. /* harmony import */ var _words_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./words.js */ "./node_modules/lodash-es/words.js");
  96292. /** Used to compose unicode capture groups. */
  96293. var rsApos = "['\u2019]";
  96294. /** Used to match apostrophes. */
  96295. var reApos = RegExp(rsApos, 'g');
  96296. /**
  96297. * Creates a function like `_.camelCase`.
  96298. *
  96299. * @private
  96300. * @param {Function} callback The function to combine each word.
  96301. * @returns {Function} Returns the new compounder function.
  96302. */
  96303. function createCompounder(callback) {
  96304. return function(string) {
  96305. return Object(_arrayReduce_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_words_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_deburr_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string).replace(reApos, '')), callback, '');
  96306. };
  96307. }
  96308. /* harmony default export */ __webpack_exports__["default"] = (createCompounder);
  96309. /***/ }),
  96310. /***/ "./node_modules/lodash-es/_createCtor.js":
  96311. /*!***********************************************!*\
  96312. !*** ./node_modules/lodash-es/_createCtor.js ***!
  96313. \***********************************************/
  96314. /*! exports provided: default */
  96315. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96316. "use strict";
  96317. __webpack_require__.r(__webpack_exports__);
  96318. /* harmony import */ var _baseCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseCreate.js */ "./node_modules/lodash-es/_baseCreate.js");
  96319. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  96320. /**
  96321. * Creates a function that produces an instance of `Ctor` regardless of
  96322. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  96323. *
  96324. * @private
  96325. * @param {Function} Ctor The constructor to wrap.
  96326. * @returns {Function} Returns the new wrapped function.
  96327. */
  96328. function createCtor(Ctor) {
  96329. return function() {
  96330. // Use a `switch` statement to work with class constructors. See
  96331. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  96332. // for more details.
  96333. var args = arguments;
  96334. switch (args.length) {
  96335. case 0: return new Ctor;
  96336. case 1: return new Ctor(args[0]);
  96337. case 2: return new Ctor(args[0], args[1]);
  96338. case 3: return new Ctor(args[0], args[1], args[2]);
  96339. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  96340. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  96341. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  96342. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  96343. }
  96344. var thisBinding = Object(_baseCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Ctor.prototype),
  96345. result = Ctor.apply(thisBinding, args);
  96346. // Mimic the constructor's `return` behavior.
  96347. // See https://es5.github.io/#x13.2.2 for more details.
  96348. return Object(_isObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(result) ? result : thisBinding;
  96349. };
  96350. }
  96351. /* harmony default export */ __webpack_exports__["default"] = (createCtor);
  96352. /***/ }),
  96353. /***/ "./node_modules/lodash-es/_createCurry.js":
  96354. /*!************************************************!*\
  96355. !*** ./node_modules/lodash-es/_createCurry.js ***!
  96356. \************************************************/
  96357. /*! exports provided: default */
  96358. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96359. "use strict";
  96360. __webpack_require__.r(__webpack_exports__);
  96361. /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  96362. /* harmony import */ var _createCtor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createCtor.js */ "./node_modules/lodash-es/_createCtor.js");
  96363. /* harmony import */ var _createHybrid_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_createHybrid.js */ "./node_modules/lodash-es/_createHybrid.js");
  96364. /* harmony import */ var _createRecurry_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_createRecurry.js */ "./node_modules/lodash-es/_createRecurry.js");
  96365. /* harmony import */ var _getHolder_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_getHolder.js */ "./node_modules/lodash-es/_getHolder.js");
  96366. /* harmony import */ var _replaceHolders_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_replaceHolders.js */ "./node_modules/lodash-es/_replaceHolders.js");
  96367. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  96368. /**
  96369. * Creates a function that wraps `func` to enable currying.
  96370. *
  96371. * @private
  96372. * @param {Function} func The function to wrap.
  96373. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  96374. * @param {number} arity The arity of `func`.
  96375. * @returns {Function} Returns the new wrapped function.
  96376. */
  96377. function createCurry(func, bitmask, arity) {
  96378. var Ctor = Object(_createCtor_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func);
  96379. function wrapper() {
  96380. var length = arguments.length,
  96381. args = Array(length),
  96382. index = length,
  96383. placeholder = Object(_getHolder_js__WEBPACK_IMPORTED_MODULE_4__["default"])(wrapper);
  96384. while (index--) {
  96385. args[index] = arguments[index];
  96386. }
  96387. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  96388. ? []
  96389. : Object(_replaceHolders_js__WEBPACK_IMPORTED_MODULE_5__["default"])(args, placeholder);
  96390. length -= holders.length;
  96391. if (length < arity) {
  96392. return Object(_createRecurry_js__WEBPACK_IMPORTED_MODULE_3__["default"])(
  96393. func, bitmask, _createHybrid_js__WEBPACK_IMPORTED_MODULE_2__["default"], wrapper.placeholder, undefined,
  96394. args, holders, undefined, undefined, arity - length);
  96395. }
  96396. var fn = (this && this !== _root_js__WEBPACK_IMPORTED_MODULE_6__["default"] && this instanceof wrapper) ? Ctor : func;
  96397. return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(fn, this, args);
  96398. }
  96399. return wrapper;
  96400. }
  96401. /* harmony default export */ __webpack_exports__["default"] = (createCurry);
  96402. /***/ }),
  96403. /***/ "./node_modules/lodash-es/_createFind.js":
  96404. /*!***********************************************!*\
  96405. !*** ./node_modules/lodash-es/_createFind.js ***!
  96406. \***********************************************/
  96407. /*! exports provided: default */
  96408. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96409. "use strict";
  96410. __webpack_require__.r(__webpack_exports__);
  96411. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  96412. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  96413. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  96414. /**
  96415. * Creates a `_.find` or `_.findLast` function.
  96416. *
  96417. * @private
  96418. * @param {Function} findIndexFunc The function to find the collection index.
  96419. * @returns {Function} Returns the new find function.
  96420. */
  96421. function createFind(findIndexFunc) {
  96422. return function(collection, predicate, fromIndex) {
  96423. var iterable = Object(collection);
  96424. if (!Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection)) {
  96425. var iteratee = Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(predicate, 3);
  96426. collection = Object(_keys_js__WEBPACK_IMPORTED_MODULE_2__["default"])(collection);
  96427. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  96428. }
  96429. var index = findIndexFunc(collection, predicate, fromIndex);
  96430. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  96431. };
  96432. }
  96433. /* harmony default export */ __webpack_exports__["default"] = (createFind);
  96434. /***/ }),
  96435. /***/ "./node_modules/lodash-es/_createFlow.js":
  96436. /*!***********************************************!*\
  96437. !*** ./node_modules/lodash-es/_createFlow.js ***!
  96438. \***********************************************/
  96439. /*! exports provided: default */
  96440. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96441. "use strict";
  96442. __webpack_require__.r(__webpack_exports__);
  96443. /* harmony import */ var _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LodashWrapper.js */ "./node_modules/lodash-es/_LodashWrapper.js");
  96444. /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
  96445. /* harmony import */ var _getData_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getData.js */ "./node_modules/lodash-es/_getData.js");
  96446. /* harmony import */ var _getFuncName_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_getFuncName.js */ "./node_modules/lodash-es/_getFuncName.js");
  96447. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  96448. /* harmony import */ var _isLaziable_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_isLaziable.js */ "./node_modules/lodash-es/_isLaziable.js");
  96449. /** Error message constants. */
  96450. var FUNC_ERROR_TEXT = 'Expected a function';
  96451. /** Used to compose bitmasks for function metadata. */
  96452. var WRAP_CURRY_FLAG = 8,
  96453. WRAP_PARTIAL_FLAG = 32,
  96454. WRAP_ARY_FLAG = 128,
  96455. WRAP_REARG_FLAG = 256;
  96456. /**
  96457. * Creates a `_.flow` or `_.flowRight` function.
  96458. *
  96459. * @private
  96460. * @param {boolean} [fromRight] Specify iterating from right to left.
  96461. * @returns {Function} Returns the new flow function.
  96462. */
  96463. function createFlow(fromRight) {
  96464. return Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(funcs) {
  96465. var length = funcs.length,
  96466. index = length,
  96467. prereq = _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype.thru;
  96468. if (fromRight) {
  96469. funcs.reverse();
  96470. }
  96471. while (index--) {
  96472. var func = funcs[index];
  96473. if (typeof func != 'function') {
  96474. throw new TypeError(FUNC_ERROR_TEXT);
  96475. }
  96476. if (prereq && !wrapper && Object(_getFuncName_js__WEBPACK_IMPORTED_MODULE_3__["default"])(func) == 'wrapper') {
  96477. var wrapper = new _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"]([], true);
  96478. }
  96479. }
  96480. index = wrapper ? index : length;
  96481. while (++index < length) {
  96482. func = funcs[index];
  96483. var funcName = Object(_getFuncName_js__WEBPACK_IMPORTED_MODULE_3__["default"])(func),
  96484. data = funcName == 'wrapper' ? Object(_getData_js__WEBPACK_IMPORTED_MODULE_2__["default"])(func) : undefined;
  96485. if (data && Object(_isLaziable_js__WEBPACK_IMPORTED_MODULE_5__["default"])(data[0]) &&
  96486. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  96487. !data[4].length && data[9] == 1
  96488. ) {
  96489. wrapper = wrapper[Object(_getFuncName_js__WEBPACK_IMPORTED_MODULE_3__["default"])(data[0])].apply(wrapper, data[3]);
  96490. } else {
  96491. wrapper = (func.length == 1 && Object(_isLaziable_js__WEBPACK_IMPORTED_MODULE_5__["default"])(func))
  96492. ? wrapper[funcName]()
  96493. : wrapper.thru(func);
  96494. }
  96495. }
  96496. return function() {
  96497. var args = arguments,
  96498. value = args[0];
  96499. if (wrapper && args.length == 1 && Object(_isArray_js__WEBPACK_IMPORTED_MODULE_4__["default"])(value)) {
  96500. return wrapper.plant(value).value();
  96501. }
  96502. var index = 0,
  96503. result = length ? funcs[index].apply(this, args) : value;
  96504. while (++index < length) {
  96505. result = funcs[index].call(this, result);
  96506. }
  96507. return result;
  96508. };
  96509. });
  96510. }
  96511. /* harmony default export */ __webpack_exports__["default"] = (createFlow);
  96512. /***/ }),
  96513. /***/ "./node_modules/lodash-es/_createHybrid.js":
  96514. /*!*************************************************!*\
  96515. !*** ./node_modules/lodash-es/_createHybrid.js ***!
  96516. \*************************************************/
  96517. /*! exports provided: default */
  96518. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96519. "use strict";
  96520. __webpack_require__.r(__webpack_exports__);
  96521. /* harmony import */ var _composeArgs_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_composeArgs.js */ "./node_modules/lodash-es/_composeArgs.js");
  96522. /* harmony import */ var _composeArgsRight_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_composeArgsRight.js */ "./node_modules/lodash-es/_composeArgsRight.js");
  96523. /* harmony import */ var _countHolders_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_countHolders.js */ "./node_modules/lodash-es/_countHolders.js");
  96524. /* harmony import */ var _createCtor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_createCtor.js */ "./node_modules/lodash-es/_createCtor.js");
  96525. /* harmony import */ var _createRecurry_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_createRecurry.js */ "./node_modules/lodash-es/_createRecurry.js");
  96526. /* harmony import */ var _getHolder_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_getHolder.js */ "./node_modules/lodash-es/_getHolder.js");
  96527. /* harmony import */ var _reorder_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_reorder.js */ "./node_modules/lodash-es/_reorder.js");
  96528. /* harmony import */ var _replaceHolders_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./_replaceHolders.js */ "./node_modules/lodash-es/_replaceHolders.js");
  96529. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  96530. /** Used to compose bitmasks for function metadata. */
  96531. var WRAP_BIND_FLAG = 1,
  96532. WRAP_BIND_KEY_FLAG = 2,
  96533. WRAP_CURRY_FLAG = 8,
  96534. WRAP_CURRY_RIGHT_FLAG = 16,
  96535. WRAP_ARY_FLAG = 128,
  96536. WRAP_FLIP_FLAG = 512;
  96537. /**
  96538. * Creates a function that wraps `func` to invoke it with optional `this`
  96539. * binding of `thisArg`, partial application, and currying.
  96540. *
  96541. * @private
  96542. * @param {Function|string} func The function or method name to wrap.
  96543. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  96544. * @param {*} [thisArg] The `this` binding of `func`.
  96545. * @param {Array} [partials] The arguments to prepend to those provided to
  96546. * the new function.
  96547. * @param {Array} [holders] The `partials` placeholder indexes.
  96548. * @param {Array} [partialsRight] The arguments to append to those provided
  96549. * to the new function.
  96550. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  96551. * @param {Array} [argPos] The argument positions of the new function.
  96552. * @param {number} [ary] The arity cap of `func`.
  96553. * @param {number} [arity] The arity of `func`.
  96554. * @returns {Function} Returns the new wrapped function.
  96555. */
  96556. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  96557. var isAry = bitmask & WRAP_ARY_FLAG,
  96558. isBind = bitmask & WRAP_BIND_FLAG,
  96559. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  96560. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  96561. isFlip = bitmask & WRAP_FLIP_FLAG,
  96562. Ctor = isBindKey ? undefined : Object(_createCtor_js__WEBPACK_IMPORTED_MODULE_3__["default"])(func);
  96563. function wrapper() {
  96564. var length = arguments.length,
  96565. args = Array(length),
  96566. index = length;
  96567. while (index--) {
  96568. args[index] = arguments[index];
  96569. }
  96570. if (isCurried) {
  96571. var placeholder = Object(_getHolder_js__WEBPACK_IMPORTED_MODULE_5__["default"])(wrapper),
  96572. holdersCount = Object(_countHolders_js__WEBPACK_IMPORTED_MODULE_2__["default"])(args, placeholder);
  96573. }
  96574. if (partials) {
  96575. args = Object(_composeArgs_js__WEBPACK_IMPORTED_MODULE_0__["default"])(args, partials, holders, isCurried);
  96576. }
  96577. if (partialsRight) {
  96578. args = Object(_composeArgsRight_js__WEBPACK_IMPORTED_MODULE_1__["default"])(args, partialsRight, holdersRight, isCurried);
  96579. }
  96580. length -= holdersCount;
  96581. if (isCurried && length < arity) {
  96582. var newHolders = Object(_replaceHolders_js__WEBPACK_IMPORTED_MODULE_7__["default"])(args, placeholder);
  96583. return Object(_createRecurry_js__WEBPACK_IMPORTED_MODULE_4__["default"])(
  96584. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  96585. args, newHolders, argPos, ary, arity - length
  96586. );
  96587. }
  96588. var thisBinding = isBind ? thisArg : this,
  96589. fn = isBindKey ? thisBinding[func] : func;
  96590. length = args.length;
  96591. if (argPos) {
  96592. args = Object(_reorder_js__WEBPACK_IMPORTED_MODULE_6__["default"])(args, argPos);
  96593. } else if (isFlip && length > 1) {
  96594. args.reverse();
  96595. }
  96596. if (isAry && ary < length) {
  96597. args.length = ary;
  96598. }
  96599. if (this && this !== _root_js__WEBPACK_IMPORTED_MODULE_8__["default"] && this instanceof wrapper) {
  96600. fn = Ctor || Object(_createCtor_js__WEBPACK_IMPORTED_MODULE_3__["default"])(fn);
  96601. }
  96602. return fn.apply(thisBinding, args);
  96603. }
  96604. return wrapper;
  96605. }
  96606. /* harmony default export */ __webpack_exports__["default"] = (createHybrid);
  96607. /***/ }),
  96608. /***/ "./node_modules/lodash-es/_createInverter.js":
  96609. /*!***************************************************!*\
  96610. !*** ./node_modules/lodash-es/_createInverter.js ***!
  96611. \***************************************************/
  96612. /*! exports provided: default */
  96613. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96614. "use strict";
  96615. __webpack_require__.r(__webpack_exports__);
  96616. /* harmony import */ var _baseInverter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseInverter.js */ "./node_modules/lodash-es/_baseInverter.js");
  96617. /**
  96618. * Creates a function like `_.invertBy`.
  96619. *
  96620. * @private
  96621. * @param {Function} setter The function to set accumulator values.
  96622. * @param {Function} toIteratee The function to resolve iteratees.
  96623. * @returns {Function} Returns the new inverter function.
  96624. */
  96625. function createInverter(setter, toIteratee) {
  96626. return function(object, iteratee) {
  96627. return Object(_baseInverter_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, setter, toIteratee(iteratee), {});
  96628. };
  96629. }
  96630. /* harmony default export */ __webpack_exports__["default"] = (createInverter);
  96631. /***/ }),
  96632. /***/ "./node_modules/lodash-es/_createMathOperation.js":
  96633. /*!********************************************************!*\
  96634. !*** ./node_modules/lodash-es/_createMathOperation.js ***!
  96635. \********************************************************/
  96636. /*! exports provided: default */
  96637. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96638. "use strict";
  96639. __webpack_require__.r(__webpack_exports__);
  96640. /* harmony import */ var _baseToNumber_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseToNumber.js */ "./node_modules/lodash-es/_baseToNumber.js");
  96641. /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
  96642. /**
  96643. * Creates a function that performs a mathematical operation on two values.
  96644. *
  96645. * @private
  96646. * @param {Function} operator The function to perform the operation.
  96647. * @param {number} [defaultValue] The value used for `undefined` arguments.
  96648. * @returns {Function} Returns the new mathematical operation function.
  96649. */
  96650. function createMathOperation(operator, defaultValue) {
  96651. return function(value, other) {
  96652. var result;
  96653. if (value === undefined && other === undefined) {
  96654. return defaultValue;
  96655. }
  96656. if (value !== undefined) {
  96657. result = value;
  96658. }
  96659. if (other !== undefined) {
  96660. if (result === undefined) {
  96661. return other;
  96662. }
  96663. if (typeof value == 'string' || typeof other == 'string') {
  96664. value = Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value);
  96665. other = Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_1__["default"])(other);
  96666. } else {
  96667. value = Object(_baseToNumber_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  96668. other = Object(_baseToNumber_js__WEBPACK_IMPORTED_MODULE_0__["default"])(other);
  96669. }
  96670. result = operator(value, other);
  96671. }
  96672. return result;
  96673. };
  96674. }
  96675. /* harmony default export */ __webpack_exports__["default"] = (createMathOperation);
  96676. /***/ }),
  96677. /***/ "./node_modules/lodash-es/_createOver.js":
  96678. /*!***********************************************!*\
  96679. !*** ./node_modules/lodash-es/_createOver.js ***!
  96680. \***********************************************/
  96681. /*! exports provided: default */
  96682. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96683. "use strict";
  96684. __webpack_require__.r(__webpack_exports__);
  96685. /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  96686. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  96687. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  96688. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  96689. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  96690. /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
  96691. /**
  96692. * Creates a function like `_.over`.
  96693. *
  96694. * @private
  96695. * @param {Function} arrayFunc The function to iterate over iteratees.
  96696. * @returns {Function} Returns the new over function.
  96697. */
  96698. function createOver(arrayFunc) {
  96699. return Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_5__["default"])(function(iteratees) {
  96700. iteratees = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratees, Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_4__["default"])(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"]));
  96701. return Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_3__["default"])(function(args) {
  96702. var thisArg = this;
  96703. return arrayFunc(iteratees, function(iteratee) {
  96704. return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, thisArg, args);
  96705. });
  96706. });
  96707. });
  96708. }
  96709. /* harmony default export */ __webpack_exports__["default"] = (createOver);
  96710. /***/ }),
  96711. /***/ "./node_modules/lodash-es/_createPadding.js":
  96712. /*!**************************************************!*\
  96713. !*** ./node_modules/lodash-es/_createPadding.js ***!
  96714. \**************************************************/
  96715. /*! exports provided: default */
  96716. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96717. "use strict";
  96718. __webpack_require__.r(__webpack_exports__);
  96719. /* harmony import */ var _baseRepeat_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRepeat.js */ "./node_modules/lodash-es/_baseRepeat.js");
  96720. /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
  96721. /* harmony import */ var _castSlice_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_castSlice.js */ "./node_modules/lodash-es/_castSlice.js");
  96722. /* harmony import */ var _hasUnicode_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_hasUnicode.js */ "./node_modules/lodash-es/_hasUnicode.js");
  96723. /* harmony import */ var _stringSize_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_stringSize.js */ "./node_modules/lodash-es/_stringSize.js");
  96724. /* harmony import */ var _stringToArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_stringToArray.js */ "./node_modules/lodash-es/_stringToArray.js");
  96725. /* Built-in method references for those with the same name as other `lodash` methods. */
  96726. var nativeCeil = Math.ceil;
  96727. /**
  96728. * Creates the padding for `string` based on `length`. The `chars` string
  96729. * is truncated if the number of characters exceeds `length`.
  96730. *
  96731. * @private
  96732. * @param {number} length The padding length.
  96733. * @param {string} [chars=' '] The string used as padding.
  96734. * @returns {string} Returns the padding for `string`.
  96735. */
  96736. function createPadding(length, chars) {
  96737. chars = chars === undefined ? ' ' : Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_1__["default"])(chars);
  96738. var charsLength = chars.length;
  96739. if (charsLength < 2) {
  96740. return charsLength ? Object(_baseRepeat_js__WEBPACK_IMPORTED_MODULE_0__["default"])(chars, length) : chars;
  96741. }
  96742. var result = Object(_baseRepeat_js__WEBPACK_IMPORTED_MODULE_0__["default"])(chars, nativeCeil(length / Object(_stringSize_js__WEBPACK_IMPORTED_MODULE_4__["default"])(chars)));
  96743. return Object(_hasUnicode_js__WEBPACK_IMPORTED_MODULE_3__["default"])(chars)
  96744. ? Object(_castSlice_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(result), 0, length).join('')
  96745. : result.slice(0, length);
  96746. }
  96747. /* harmony default export */ __webpack_exports__["default"] = (createPadding);
  96748. /***/ }),
  96749. /***/ "./node_modules/lodash-es/_createPartial.js":
  96750. /*!**************************************************!*\
  96751. !*** ./node_modules/lodash-es/_createPartial.js ***!
  96752. \**************************************************/
  96753. /*! exports provided: default */
  96754. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96755. "use strict";
  96756. __webpack_require__.r(__webpack_exports__);
  96757. /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  96758. /* harmony import */ var _createCtor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createCtor.js */ "./node_modules/lodash-es/_createCtor.js");
  96759. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  96760. /** Used to compose bitmasks for function metadata. */
  96761. var WRAP_BIND_FLAG = 1;
  96762. /**
  96763. * Creates a function that wraps `func` to invoke it with the `this` binding
  96764. * of `thisArg` and `partials` prepended to the arguments it receives.
  96765. *
  96766. * @private
  96767. * @param {Function} func The function to wrap.
  96768. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  96769. * @param {*} thisArg The `this` binding of `func`.
  96770. * @param {Array} partials The arguments to prepend to those provided to
  96771. * the new function.
  96772. * @returns {Function} Returns the new wrapped function.
  96773. */
  96774. function createPartial(func, bitmask, thisArg, partials) {
  96775. var isBind = bitmask & WRAP_BIND_FLAG,
  96776. Ctor = Object(_createCtor_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func);
  96777. function wrapper() {
  96778. var argsIndex = -1,
  96779. argsLength = arguments.length,
  96780. leftIndex = -1,
  96781. leftLength = partials.length,
  96782. args = Array(leftLength + argsLength),
  96783. fn = (this && this !== _root_js__WEBPACK_IMPORTED_MODULE_2__["default"] && this instanceof wrapper) ? Ctor : func;
  96784. while (++leftIndex < leftLength) {
  96785. args[leftIndex] = partials[leftIndex];
  96786. }
  96787. while (argsLength--) {
  96788. args[leftIndex++] = arguments[++argsIndex];
  96789. }
  96790. return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(fn, isBind ? thisArg : this, args);
  96791. }
  96792. return wrapper;
  96793. }
  96794. /* harmony default export */ __webpack_exports__["default"] = (createPartial);
  96795. /***/ }),
  96796. /***/ "./node_modules/lodash-es/_createRange.js":
  96797. /*!************************************************!*\
  96798. !*** ./node_modules/lodash-es/_createRange.js ***!
  96799. \************************************************/
  96800. /*! exports provided: default */
  96801. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96802. "use strict";
  96803. __webpack_require__.r(__webpack_exports__);
  96804. /* harmony import */ var _baseRange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRange.js */ "./node_modules/lodash-es/_baseRange.js");
  96805. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  96806. /* harmony import */ var _toFinite_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toFinite.js */ "./node_modules/lodash-es/toFinite.js");
  96807. /**
  96808. * Creates a `_.range` or `_.rangeRight` function.
  96809. *
  96810. * @private
  96811. * @param {boolean} [fromRight] Specify iterating from right to left.
  96812. * @returns {Function} Returns the new range function.
  96813. */
  96814. function createRange(fromRight) {
  96815. return function(start, end, step) {
  96816. if (step && typeof step != 'number' && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start, end, step)) {
  96817. end = step = undefined;
  96818. }
  96819. // Ensure the sign of `-0` is preserved.
  96820. start = Object(_toFinite_js__WEBPACK_IMPORTED_MODULE_2__["default"])(start);
  96821. if (end === undefined) {
  96822. end = start;
  96823. start = 0;
  96824. } else {
  96825. end = Object(_toFinite_js__WEBPACK_IMPORTED_MODULE_2__["default"])(end);
  96826. }
  96827. step = step === undefined ? (start < end ? 1 : -1) : Object(_toFinite_js__WEBPACK_IMPORTED_MODULE_2__["default"])(step);
  96828. return Object(_baseRange_js__WEBPACK_IMPORTED_MODULE_0__["default"])(start, end, step, fromRight);
  96829. };
  96830. }
  96831. /* harmony default export */ __webpack_exports__["default"] = (createRange);
  96832. /***/ }),
  96833. /***/ "./node_modules/lodash-es/_createRecurry.js":
  96834. /*!**************************************************!*\
  96835. !*** ./node_modules/lodash-es/_createRecurry.js ***!
  96836. \**************************************************/
  96837. /*! exports provided: default */
  96838. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96839. "use strict";
  96840. __webpack_require__.r(__webpack_exports__);
  96841. /* harmony import */ var _isLaziable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_isLaziable.js */ "./node_modules/lodash-es/_isLaziable.js");
  96842. /* harmony import */ var _setData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_setData.js */ "./node_modules/lodash-es/_setData.js");
  96843. /* harmony import */ var _setWrapToString_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_setWrapToString.js */ "./node_modules/lodash-es/_setWrapToString.js");
  96844. /** Used to compose bitmasks for function metadata. */
  96845. var WRAP_BIND_FLAG = 1,
  96846. WRAP_BIND_KEY_FLAG = 2,
  96847. WRAP_CURRY_BOUND_FLAG = 4,
  96848. WRAP_CURRY_FLAG = 8,
  96849. WRAP_PARTIAL_FLAG = 32,
  96850. WRAP_PARTIAL_RIGHT_FLAG = 64;
  96851. /**
  96852. * Creates a function that wraps `func` to continue currying.
  96853. *
  96854. * @private
  96855. * @param {Function} func The function to wrap.
  96856. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  96857. * @param {Function} wrapFunc The function to create the `func` wrapper.
  96858. * @param {*} placeholder The placeholder value.
  96859. * @param {*} [thisArg] The `this` binding of `func`.
  96860. * @param {Array} [partials] The arguments to prepend to those provided to
  96861. * the new function.
  96862. * @param {Array} [holders] The `partials` placeholder indexes.
  96863. * @param {Array} [argPos] The argument positions of the new function.
  96864. * @param {number} [ary] The arity cap of `func`.
  96865. * @param {number} [arity] The arity of `func`.
  96866. * @returns {Function} Returns the new wrapped function.
  96867. */
  96868. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  96869. var isCurry = bitmask & WRAP_CURRY_FLAG,
  96870. newHolders = isCurry ? holders : undefined,
  96871. newHoldersRight = isCurry ? undefined : holders,
  96872. newPartials = isCurry ? partials : undefined,
  96873. newPartialsRight = isCurry ? undefined : partials;
  96874. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  96875. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  96876. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  96877. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  96878. }
  96879. var newData = [
  96880. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  96881. newHoldersRight, argPos, ary, arity
  96882. ];
  96883. var result = wrapFunc.apply(undefined, newData);
  96884. if (Object(_isLaziable_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func)) {
  96885. Object(_setData_js__WEBPACK_IMPORTED_MODULE_1__["default"])(result, newData);
  96886. }
  96887. result.placeholder = placeholder;
  96888. return Object(_setWrapToString_js__WEBPACK_IMPORTED_MODULE_2__["default"])(result, func, bitmask);
  96889. }
  96890. /* harmony default export */ __webpack_exports__["default"] = (createRecurry);
  96891. /***/ }),
  96892. /***/ "./node_modules/lodash-es/_createRelationalOperation.js":
  96893. /*!**************************************************************!*\
  96894. !*** ./node_modules/lodash-es/_createRelationalOperation.js ***!
  96895. \**************************************************************/
  96896. /*! exports provided: default */
  96897. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96898. "use strict";
  96899. __webpack_require__.r(__webpack_exports__);
  96900. /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
  96901. /**
  96902. * Creates a function that performs a relational operation on two values.
  96903. *
  96904. * @private
  96905. * @param {Function} operator The function to perform the operation.
  96906. * @returns {Function} Returns the new relational operation function.
  96907. */
  96908. function createRelationalOperation(operator) {
  96909. return function(value, other) {
  96910. if (!(typeof value == 'string' && typeof other == 'string')) {
  96911. value = Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  96912. other = Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_0__["default"])(other);
  96913. }
  96914. return operator(value, other);
  96915. };
  96916. }
  96917. /* harmony default export */ __webpack_exports__["default"] = (createRelationalOperation);
  96918. /***/ }),
  96919. /***/ "./node_modules/lodash-es/_createRound.js":
  96920. /*!************************************************!*\
  96921. !*** ./node_modules/lodash-es/_createRound.js ***!
  96922. \************************************************/
  96923. /*! exports provided: default */
  96924. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96925. "use strict";
  96926. __webpack_require__.r(__webpack_exports__);
  96927. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  96928. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  96929. /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
  96930. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  96931. /* Built-in method references for those with the same name as other `lodash` methods. */
  96932. var nativeIsFinite = _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFinite,
  96933. nativeMin = Math.min;
  96934. /**
  96935. * Creates a function like `_.round`.
  96936. *
  96937. * @private
  96938. * @param {string} methodName The name of the `Math` method to use when rounding.
  96939. * @returns {Function} Returns the new round function.
  96940. */
  96941. function createRound(methodName) {
  96942. var func = Math[methodName];
  96943. return function(number, precision) {
  96944. number = Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_2__["default"])(number);
  96945. precision = precision == null ? 0 : nativeMin(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(precision), 292);
  96946. if (precision && nativeIsFinite(number)) {
  96947. // Shift with exponential notation to avoid floating-point issues.
  96948. // See [MDN](https://mdn.io/round#Examples) for more details.
  96949. var pair = (Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(number) + 'e').split('e'),
  96950. value = func(pair[0] + 'e' + (+pair[1] + precision));
  96951. pair = (Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value) + 'e').split('e');
  96952. return +(pair[0] + 'e' + (+pair[1] - precision));
  96953. }
  96954. return func(number);
  96955. };
  96956. }
  96957. /* harmony default export */ __webpack_exports__["default"] = (createRound);
  96958. /***/ }),
  96959. /***/ "./node_modules/lodash-es/_createSet.js":
  96960. /*!**********************************************!*\
  96961. !*** ./node_modules/lodash-es/_createSet.js ***!
  96962. \**********************************************/
  96963. /*! exports provided: default */
  96964. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96965. "use strict";
  96966. __webpack_require__.r(__webpack_exports__);
  96967. /* harmony import */ var _Set_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Set.js */ "./node_modules/lodash-es/_Set.js");
  96968. /* harmony import */ var _noop_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./noop.js */ "./node_modules/lodash-es/noop.js");
  96969. /* harmony import */ var _setToArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_setToArray.js */ "./node_modules/lodash-es/_setToArray.js");
  96970. /** Used as references for various `Number` constants. */
  96971. var INFINITY = 1 / 0;
  96972. /**
  96973. * Creates a set object of `values`.
  96974. *
  96975. * @private
  96976. * @param {Array} values The values to add to the set.
  96977. * @returns {Object} Returns the new set.
  96978. */
  96979. var createSet = !(_Set_js__WEBPACK_IMPORTED_MODULE_0__["default"] && (1 / Object(_setToArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(new _Set_js__WEBPACK_IMPORTED_MODULE_0__["default"]([,-0]))[1]) == INFINITY) ? _noop_js__WEBPACK_IMPORTED_MODULE_1__["default"] : function(values) {
  96980. return new _Set_js__WEBPACK_IMPORTED_MODULE_0__["default"](values);
  96981. };
  96982. /* harmony default export */ __webpack_exports__["default"] = (createSet);
  96983. /***/ }),
  96984. /***/ "./node_modules/lodash-es/_createToPairs.js":
  96985. /*!**************************************************!*\
  96986. !*** ./node_modules/lodash-es/_createToPairs.js ***!
  96987. \**************************************************/
  96988. /*! exports provided: default */
  96989. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96990. "use strict";
  96991. __webpack_require__.r(__webpack_exports__);
  96992. /* harmony import */ var _baseToPairs_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseToPairs.js */ "./node_modules/lodash-es/_baseToPairs.js");
  96993. /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
  96994. /* harmony import */ var _mapToArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_mapToArray.js */ "./node_modules/lodash-es/_mapToArray.js");
  96995. /* harmony import */ var _setToPairs_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_setToPairs.js */ "./node_modules/lodash-es/_setToPairs.js");
  96996. /** `Object#toString` result references. */
  96997. var mapTag = '[object Map]',
  96998. setTag = '[object Set]';
  96999. /**
  97000. * Creates a `_.toPairs` or `_.toPairsIn` function.
  97001. *
  97002. * @private
  97003. * @param {Function} keysFunc The function to get the keys of a given object.
  97004. * @returns {Function} Returns the new pairs function.
  97005. */
  97006. function createToPairs(keysFunc) {
  97007. return function(object) {
  97008. var tag = Object(_getTag_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object);
  97009. if (tag == mapTag) {
  97010. return Object(_mapToArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object);
  97011. }
  97012. if (tag == setTag) {
  97013. return Object(_setToPairs_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object);
  97014. }
  97015. return Object(_baseToPairs_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, keysFunc(object));
  97016. };
  97017. }
  97018. /* harmony default export */ __webpack_exports__["default"] = (createToPairs);
  97019. /***/ }),
  97020. /***/ "./node_modules/lodash-es/_createWrap.js":
  97021. /*!***********************************************!*\
  97022. !*** ./node_modules/lodash-es/_createWrap.js ***!
  97023. \***********************************************/
  97024. /*! exports provided: default */
  97025. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97026. "use strict";
  97027. __webpack_require__.r(__webpack_exports__);
  97028. /* harmony import */ var _baseSetData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSetData.js */ "./node_modules/lodash-es/_baseSetData.js");
  97029. /* harmony import */ var _createBind_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createBind.js */ "./node_modules/lodash-es/_createBind.js");
  97030. /* harmony import */ var _createCurry_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_createCurry.js */ "./node_modules/lodash-es/_createCurry.js");
  97031. /* harmony import */ var _createHybrid_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_createHybrid.js */ "./node_modules/lodash-es/_createHybrid.js");
  97032. /* harmony import */ var _createPartial_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_createPartial.js */ "./node_modules/lodash-es/_createPartial.js");
  97033. /* harmony import */ var _getData_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_getData.js */ "./node_modules/lodash-es/_getData.js");
  97034. /* harmony import */ var _mergeData_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_mergeData.js */ "./node_modules/lodash-es/_mergeData.js");
  97035. /* harmony import */ var _setData_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./_setData.js */ "./node_modules/lodash-es/_setData.js");
  97036. /* harmony import */ var _setWrapToString_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./_setWrapToString.js */ "./node_modules/lodash-es/_setWrapToString.js");
  97037. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  97038. /** Error message constants. */
  97039. var FUNC_ERROR_TEXT = 'Expected a function';
  97040. /** Used to compose bitmasks for function metadata. */
  97041. var WRAP_BIND_FLAG = 1,
  97042. WRAP_BIND_KEY_FLAG = 2,
  97043. WRAP_CURRY_FLAG = 8,
  97044. WRAP_CURRY_RIGHT_FLAG = 16,
  97045. WRAP_PARTIAL_FLAG = 32,
  97046. WRAP_PARTIAL_RIGHT_FLAG = 64;
  97047. /* Built-in method references for those with the same name as other `lodash` methods. */
  97048. var nativeMax = Math.max;
  97049. /**
  97050. * Creates a function that either curries or invokes `func` with optional
  97051. * `this` binding and partially applied arguments.
  97052. *
  97053. * @private
  97054. * @param {Function|string} func The function or method name to wrap.
  97055. * @param {number} bitmask The bitmask flags.
  97056. * 1 - `_.bind`
  97057. * 2 - `_.bindKey`
  97058. * 4 - `_.curry` or `_.curryRight` of a bound function
  97059. * 8 - `_.curry`
  97060. * 16 - `_.curryRight`
  97061. * 32 - `_.partial`
  97062. * 64 - `_.partialRight`
  97063. * 128 - `_.rearg`
  97064. * 256 - `_.ary`
  97065. * 512 - `_.flip`
  97066. * @param {*} [thisArg] The `this` binding of `func`.
  97067. * @param {Array} [partials] The arguments to be partially applied.
  97068. * @param {Array} [holders] The `partials` placeholder indexes.
  97069. * @param {Array} [argPos] The argument positions of the new function.
  97070. * @param {number} [ary] The arity cap of `func`.
  97071. * @param {number} [arity] The arity of `func`.
  97072. * @returns {Function} Returns the new wrapped function.
  97073. */
  97074. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  97075. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  97076. if (!isBindKey && typeof func != 'function') {
  97077. throw new TypeError(FUNC_ERROR_TEXT);
  97078. }
  97079. var length = partials ? partials.length : 0;
  97080. if (!length) {
  97081. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  97082. partials = holders = undefined;
  97083. }
  97084. ary = ary === undefined ? ary : nativeMax(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_9__["default"])(ary), 0);
  97085. arity = arity === undefined ? arity : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_9__["default"])(arity);
  97086. length -= holders ? holders.length : 0;
  97087. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  97088. var partialsRight = partials,
  97089. holdersRight = holders;
  97090. partials = holders = undefined;
  97091. }
  97092. var data = isBindKey ? undefined : Object(_getData_js__WEBPACK_IMPORTED_MODULE_5__["default"])(func);
  97093. var newData = [
  97094. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  97095. argPos, ary, arity
  97096. ];
  97097. if (data) {
  97098. Object(_mergeData_js__WEBPACK_IMPORTED_MODULE_6__["default"])(newData, data);
  97099. }
  97100. func = newData[0];
  97101. bitmask = newData[1];
  97102. thisArg = newData[2];
  97103. partials = newData[3];
  97104. holders = newData[4];
  97105. arity = newData[9] = newData[9] === undefined
  97106. ? (isBindKey ? 0 : func.length)
  97107. : nativeMax(newData[9] - length, 0);
  97108. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  97109. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  97110. }
  97111. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  97112. var result = Object(_createBind_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func, bitmask, thisArg);
  97113. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  97114. result = Object(_createCurry_js__WEBPACK_IMPORTED_MODULE_2__["default"])(func, bitmask, arity);
  97115. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  97116. result = Object(_createPartial_js__WEBPACK_IMPORTED_MODULE_4__["default"])(func, bitmask, thisArg, partials);
  97117. } else {
  97118. result = _createHybrid_js__WEBPACK_IMPORTED_MODULE_3__["default"].apply(undefined, newData);
  97119. }
  97120. var setter = data ? _baseSetData_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _setData_js__WEBPACK_IMPORTED_MODULE_7__["default"];
  97121. return Object(_setWrapToString_js__WEBPACK_IMPORTED_MODULE_8__["default"])(setter(result, newData), func, bitmask);
  97122. }
  97123. /* harmony default export */ __webpack_exports__["default"] = (createWrap);
  97124. /***/ }),
  97125. /***/ "./node_modules/lodash-es/_customDefaultsAssignIn.js":
  97126. /*!***********************************************************!*\
  97127. !*** ./node_modules/lodash-es/_customDefaultsAssignIn.js ***!
  97128. \***********************************************************/
  97129. /*! exports provided: default */
  97130. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97131. "use strict";
  97132. __webpack_require__.r(__webpack_exports__);
  97133. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  97134. /** Used for built-in method references. */
  97135. var objectProto = Object.prototype;
  97136. /** Used to check objects for own properties. */
  97137. var hasOwnProperty = objectProto.hasOwnProperty;
  97138. /**
  97139. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  97140. * of source objects to the destination object for all destination properties
  97141. * that resolve to `undefined`.
  97142. *
  97143. * @private
  97144. * @param {*} objValue The destination value.
  97145. * @param {*} srcValue The source value.
  97146. * @param {string} key The key of the property to assign.
  97147. * @param {Object} object The parent object of `objValue`.
  97148. * @returns {*} Returns the value to assign.
  97149. */
  97150. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  97151. if (objValue === undefined ||
  97152. (Object(_eq_js__WEBPACK_IMPORTED_MODULE_0__["default"])(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  97153. return srcValue;
  97154. }
  97155. return objValue;
  97156. }
  97157. /* harmony default export */ __webpack_exports__["default"] = (customDefaultsAssignIn);
  97158. /***/ }),
  97159. /***/ "./node_modules/lodash-es/_customDefaultsMerge.js":
  97160. /*!********************************************************!*\
  97161. !*** ./node_modules/lodash-es/_customDefaultsMerge.js ***!
  97162. \********************************************************/
  97163. /*! exports provided: default */
  97164. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97165. "use strict";
  97166. __webpack_require__.r(__webpack_exports__);
  97167. /* harmony import */ var _baseMerge_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseMerge.js */ "./node_modules/lodash-es/_baseMerge.js");
  97168. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  97169. /**
  97170. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  97171. * objects into destination objects that are passed thru.
  97172. *
  97173. * @private
  97174. * @param {*} objValue The destination value.
  97175. * @param {*} srcValue The source value.
  97176. * @param {string} key The key of the property to merge.
  97177. * @param {Object} object The parent object of `objValue`.
  97178. * @param {Object} source The parent object of `srcValue`.
  97179. * @param {Object} [stack] Tracks traversed source values and their merged
  97180. * counterparts.
  97181. * @returns {*} Returns the value to assign.
  97182. */
  97183. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  97184. if (Object(_isObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(objValue) && Object(_isObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(srcValue)) {
  97185. // Recursively merge objects and arrays (susceptible to call stack limits).
  97186. stack.set(srcValue, objValue);
  97187. Object(_baseMerge_js__WEBPACK_IMPORTED_MODULE_0__["default"])(objValue, srcValue, undefined, customDefaultsMerge, stack);
  97188. stack['delete'](srcValue);
  97189. }
  97190. return objValue;
  97191. }
  97192. /* harmony default export */ __webpack_exports__["default"] = (customDefaultsMerge);
  97193. /***/ }),
  97194. /***/ "./node_modules/lodash-es/_customOmitClone.js":
  97195. /*!****************************************************!*\
  97196. !*** ./node_modules/lodash-es/_customOmitClone.js ***!
  97197. \****************************************************/
  97198. /*! exports provided: default */
  97199. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97200. "use strict";
  97201. __webpack_require__.r(__webpack_exports__);
  97202. /* harmony import */ var _isPlainObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isPlainObject.js */ "./node_modules/lodash-es/isPlainObject.js");
  97203. /**
  97204. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  97205. * objects.
  97206. *
  97207. * @private
  97208. * @param {*} value The value to inspect.
  97209. * @param {string} key The key of the property to inspect.
  97210. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  97211. */
  97212. function customOmitClone(value) {
  97213. return Object(_isPlainObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) ? undefined : value;
  97214. }
  97215. /* harmony default export */ __webpack_exports__["default"] = (customOmitClone);
  97216. /***/ }),
  97217. /***/ "./node_modules/lodash-es/_deburrLetter.js":
  97218. /*!*************************************************!*\
  97219. !*** ./node_modules/lodash-es/_deburrLetter.js ***!
  97220. \*************************************************/
  97221. /*! exports provided: default */
  97222. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97223. "use strict";
  97224. __webpack_require__.r(__webpack_exports__);
  97225. /* harmony import */ var _basePropertyOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_basePropertyOf.js */ "./node_modules/lodash-es/_basePropertyOf.js");
  97226. /** Used to map Latin Unicode letters to basic Latin letters. */
  97227. var deburredLetters = {
  97228. // Latin-1 Supplement block.
  97229. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  97230. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  97231. '\xc7': 'C', '\xe7': 'c',
  97232. '\xd0': 'D', '\xf0': 'd',
  97233. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  97234. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  97235. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  97236. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  97237. '\xd1': 'N', '\xf1': 'n',
  97238. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  97239. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  97240. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  97241. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  97242. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  97243. '\xc6': 'Ae', '\xe6': 'ae',
  97244. '\xde': 'Th', '\xfe': 'th',
  97245. '\xdf': 'ss',
  97246. // Latin Extended-A block.
  97247. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  97248. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  97249. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  97250. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  97251. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  97252. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  97253. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  97254. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  97255. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  97256. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  97257. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  97258. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  97259. '\u0134': 'J', '\u0135': 'j',
  97260. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  97261. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  97262. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  97263. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  97264. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  97265. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  97266. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  97267. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  97268. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  97269. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  97270. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  97271. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  97272. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  97273. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  97274. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  97275. '\u0174': 'W', '\u0175': 'w',
  97276. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  97277. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  97278. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  97279. '\u0132': 'IJ', '\u0133': 'ij',
  97280. '\u0152': 'Oe', '\u0153': 'oe',
  97281. '\u0149': "'n", '\u017f': 's'
  97282. };
  97283. /**
  97284. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  97285. * letters to basic Latin letters.
  97286. *
  97287. * @private
  97288. * @param {string} letter The matched letter to deburr.
  97289. * @returns {string} Returns the deburred letter.
  97290. */
  97291. var deburrLetter = Object(_basePropertyOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(deburredLetters);
  97292. /* harmony default export */ __webpack_exports__["default"] = (deburrLetter);
  97293. /***/ }),
  97294. /***/ "./node_modules/lodash-es/_defineProperty.js":
  97295. /*!***************************************************!*\
  97296. !*** ./node_modules/lodash-es/_defineProperty.js ***!
  97297. \***************************************************/
  97298. /*! exports provided: default */
  97299. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97300. "use strict";
  97301. __webpack_require__.r(__webpack_exports__);
  97302. /* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getNative.js */ "./node_modules/lodash-es/_getNative.js");
  97303. var defineProperty = (function() {
  97304. try {
  97305. var func = Object(_getNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object, 'defineProperty');
  97306. func({}, '', {});
  97307. return func;
  97308. } catch (e) {}
  97309. }());
  97310. /* harmony default export */ __webpack_exports__["default"] = (defineProperty);
  97311. /***/ }),
  97312. /***/ "./node_modules/lodash-es/_equalArrays.js":
  97313. /*!************************************************!*\
  97314. !*** ./node_modules/lodash-es/_equalArrays.js ***!
  97315. \************************************************/
  97316. /*! exports provided: default */
  97317. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97318. "use strict";
  97319. __webpack_require__.r(__webpack_exports__);
  97320. /* harmony import */ var _SetCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_SetCache.js */ "./node_modules/lodash-es/_SetCache.js");
  97321. /* harmony import */ var _arraySome_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arraySome.js */ "./node_modules/lodash-es/_arraySome.js");
  97322. /* harmony import */ var _cacheHas_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_cacheHas.js */ "./node_modules/lodash-es/_cacheHas.js");
  97323. /** Used to compose bitmasks for value comparisons. */
  97324. var COMPARE_PARTIAL_FLAG = 1,
  97325. COMPARE_UNORDERED_FLAG = 2;
  97326. /**
  97327. * A specialized version of `baseIsEqualDeep` for arrays with support for
  97328. * partial deep comparisons.
  97329. *
  97330. * @private
  97331. * @param {Array} array The array to compare.
  97332. * @param {Array} other The other array to compare.
  97333. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  97334. * @param {Function} customizer The function to customize comparisons.
  97335. * @param {Function} equalFunc The function to determine equivalents of values.
  97336. * @param {Object} stack Tracks traversed `array` and `other` objects.
  97337. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  97338. */
  97339. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  97340. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  97341. arrLength = array.length,
  97342. othLength = other.length;
  97343. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  97344. return false;
  97345. }
  97346. // Check that cyclic values are equal.
  97347. var arrStacked = stack.get(array);
  97348. var othStacked = stack.get(other);
  97349. if (arrStacked && othStacked) {
  97350. return arrStacked == other && othStacked == array;
  97351. }
  97352. var index = -1,
  97353. result = true,
  97354. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new _SetCache_js__WEBPACK_IMPORTED_MODULE_0__["default"] : undefined;
  97355. stack.set(array, other);
  97356. stack.set(other, array);
  97357. // Ignore non-index properties.
  97358. while (++index < arrLength) {
  97359. var arrValue = array[index],
  97360. othValue = other[index];
  97361. if (customizer) {
  97362. var compared = isPartial
  97363. ? customizer(othValue, arrValue, index, other, array, stack)
  97364. : customizer(arrValue, othValue, index, array, other, stack);
  97365. }
  97366. if (compared !== undefined) {
  97367. if (compared) {
  97368. continue;
  97369. }
  97370. result = false;
  97371. break;
  97372. }
  97373. // Recursively compare arrays (susceptible to call stack limits).
  97374. if (seen) {
  97375. if (!Object(_arraySome_js__WEBPACK_IMPORTED_MODULE_1__["default"])(other, function(othValue, othIndex) {
  97376. if (!Object(_cacheHas_js__WEBPACK_IMPORTED_MODULE_2__["default"])(seen, othIndex) &&
  97377. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  97378. return seen.push(othIndex);
  97379. }
  97380. })) {
  97381. result = false;
  97382. break;
  97383. }
  97384. } else if (!(
  97385. arrValue === othValue ||
  97386. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  97387. )) {
  97388. result = false;
  97389. break;
  97390. }
  97391. }
  97392. stack['delete'](array);
  97393. stack['delete'](other);
  97394. return result;
  97395. }
  97396. /* harmony default export */ __webpack_exports__["default"] = (equalArrays);
  97397. /***/ }),
  97398. /***/ "./node_modules/lodash-es/_equalByTag.js":
  97399. /*!***********************************************!*\
  97400. !*** ./node_modules/lodash-es/_equalByTag.js ***!
  97401. \***********************************************/
  97402. /*! exports provided: default */
  97403. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97404. "use strict";
  97405. __webpack_require__.r(__webpack_exports__);
  97406. /* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
  97407. /* harmony import */ var _Uint8Array_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_Uint8Array.js */ "./node_modules/lodash-es/_Uint8Array.js");
  97408. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  97409. /* harmony import */ var _equalArrays_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_equalArrays.js */ "./node_modules/lodash-es/_equalArrays.js");
  97410. /* harmony import */ var _mapToArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_mapToArray.js */ "./node_modules/lodash-es/_mapToArray.js");
  97411. /* harmony import */ var _setToArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_setToArray.js */ "./node_modules/lodash-es/_setToArray.js");
  97412. /** Used to compose bitmasks for value comparisons. */
  97413. var COMPARE_PARTIAL_FLAG = 1,
  97414. COMPARE_UNORDERED_FLAG = 2;
  97415. /** `Object#toString` result references. */
  97416. var boolTag = '[object Boolean]',
  97417. dateTag = '[object Date]',
  97418. errorTag = '[object Error]',
  97419. mapTag = '[object Map]',
  97420. numberTag = '[object Number]',
  97421. regexpTag = '[object RegExp]',
  97422. setTag = '[object Set]',
  97423. stringTag = '[object String]',
  97424. symbolTag = '[object Symbol]';
  97425. var arrayBufferTag = '[object ArrayBuffer]',
  97426. dataViewTag = '[object DataView]';
  97427. /** Used to convert symbols to primitives and strings. */
  97428. var symbolProto = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype : undefined,
  97429. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
  97430. /**
  97431. * A specialized version of `baseIsEqualDeep` for comparing objects of
  97432. * the same `toStringTag`.
  97433. *
  97434. * **Note:** This function only supports comparing values with tags of
  97435. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  97436. *
  97437. * @private
  97438. * @param {Object} object The object to compare.
  97439. * @param {Object} other The other object to compare.
  97440. * @param {string} tag The `toStringTag` of the objects to compare.
  97441. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  97442. * @param {Function} customizer The function to customize comparisons.
  97443. * @param {Function} equalFunc The function to determine equivalents of values.
  97444. * @param {Object} stack Tracks traversed `object` and `other` objects.
  97445. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  97446. */
  97447. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  97448. switch (tag) {
  97449. case dataViewTag:
  97450. if ((object.byteLength != other.byteLength) ||
  97451. (object.byteOffset != other.byteOffset)) {
  97452. return false;
  97453. }
  97454. object = object.buffer;
  97455. other = other.buffer;
  97456. case arrayBufferTag:
  97457. if ((object.byteLength != other.byteLength) ||
  97458. !equalFunc(new _Uint8Array_js__WEBPACK_IMPORTED_MODULE_1__["default"](object), new _Uint8Array_js__WEBPACK_IMPORTED_MODULE_1__["default"](other))) {
  97459. return false;
  97460. }
  97461. return true;
  97462. case boolTag:
  97463. case dateTag:
  97464. case numberTag:
  97465. // Coerce booleans to `1` or `0` and dates to milliseconds.
  97466. // Invalid dates are coerced to `NaN`.
  97467. return Object(_eq_js__WEBPACK_IMPORTED_MODULE_2__["default"])(+object, +other);
  97468. case errorTag:
  97469. return object.name == other.name && object.message == other.message;
  97470. case regexpTag:
  97471. case stringTag:
  97472. // Coerce regexes to strings and treat strings, primitives and objects,
  97473. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  97474. // for more details.
  97475. return object == (other + '');
  97476. case mapTag:
  97477. var convert = _mapToArray_js__WEBPACK_IMPORTED_MODULE_4__["default"];
  97478. case setTag:
  97479. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  97480. convert || (convert = _setToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"]);
  97481. if (object.size != other.size && !isPartial) {
  97482. return false;
  97483. }
  97484. // Assume cyclic values are equal.
  97485. var stacked = stack.get(object);
  97486. if (stacked) {
  97487. return stacked == other;
  97488. }
  97489. bitmask |= COMPARE_UNORDERED_FLAG;
  97490. // Recursively compare objects (susceptible to call stack limits).
  97491. stack.set(object, other);
  97492. var result = Object(_equalArrays_js__WEBPACK_IMPORTED_MODULE_3__["default"])(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  97493. stack['delete'](object);
  97494. return result;
  97495. case symbolTag:
  97496. if (symbolValueOf) {
  97497. return symbolValueOf.call(object) == symbolValueOf.call(other);
  97498. }
  97499. }
  97500. return false;
  97501. }
  97502. /* harmony default export */ __webpack_exports__["default"] = (equalByTag);
  97503. /***/ }),
  97504. /***/ "./node_modules/lodash-es/_equalObjects.js":
  97505. /*!*************************************************!*\
  97506. !*** ./node_modules/lodash-es/_equalObjects.js ***!
  97507. \*************************************************/
  97508. /*! exports provided: default */
  97509. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97510. "use strict";
  97511. __webpack_require__.r(__webpack_exports__);
  97512. /* harmony import */ var _getAllKeys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getAllKeys.js */ "./node_modules/lodash-es/_getAllKeys.js");
  97513. /** Used to compose bitmasks for value comparisons. */
  97514. var COMPARE_PARTIAL_FLAG = 1;
  97515. /** Used for built-in method references. */
  97516. var objectProto = Object.prototype;
  97517. /** Used to check objects for own properties. */
  97518. var hasOwnProperty = objectProto.hasOwnProperty;
  97519. /**
  97520. * A specialized version of `baseIsEqualDeep` for objects with support for
  97521. * partial deep comparisons.
  97522. *
  97523. * @private
  97524. * @param {Object} object The object to compare.
  97525. * @param {Object} other The other object to compare.
  97526. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  97527. * @param {Function} customizer The function to customize comparisons.
  97528. * @param {Function} equalFunc The function to determine equivalents of values.
  97529. * @param {Object} stack Tracks traversed `object` and `other` objects.
  97530. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  97531. */
  97532. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  97533. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  97534. objProps = Object(_getAllKeys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object),
  97535. objLength = objProps.length,
  97536. othProps = Object(_getAllKeys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(other),
  97537. othLength = othProps.length;
  97538. if (objLength != othLength && !isPartial) {
  97539. return false;
  97540. }
  97541. var index = objLength;
  97542. while (index--) {
  97543. var key = objProps[index];
  97544. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  97545. return false;
  97546. }
  97547. }
  97548. // Check that cyclic values are equal.
  97549. var objStacked = stack.get(object);
  97550. var othStacked = stack.get(other);
  97551. if (objStacked && othStacked) {
  97552. return objStacked == other && othStacked == object;
  97553. }
  97554. var result = true;
  97555. stack.set(object, other);
  97556. stack.set(other, object);
  97557. var skipCtor = isPartial;
  97558. while (++index < objLength) {
  97559. key = objProps[index];
  97560. var objValue = object[key],
  97561. othValue = other[key];
  97562. if (customizer) {
  97563. var compared = isPartial
  97564. ? customizer(othValue, objValue, key, other, object, stack)
  97565. : customizer(objValue, othValue, key, object, other, stack);
  97566. }
  97567. // Recursively compare objects (susceptible to call stack limits).
  97568. if (!(compared === undefined
  97569. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  97570. : compared
  97571. )) {
  97572. result = false;
  97573. break;
  97574. }
  97575. skipCtor || (skipCtor = key == 'constructor');
  97576. }
  97577. if (result && !skipCtor) {
  97578. var objCtor = object.constructor,
  97579. othCtor = other.constructor;
  97580. // Non `Object` object instances with different constructors are not equal.
  97581. if (objCtor != othCtor &&
  97582. ('constructor' in object && 'constructor' in other) &&
  97583. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  97584. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  97585. result = false;
  97586. }
  97587. }
  97588. stack['delete'](object);
  97589. stack['delete'](other);
  97590. return result;
  97591. }
  97592. /* harmony default export */ __webpack_exports__["default"] = (equalObjects);
  97593. /***/ }),
  97594. /***/ "./node_modules/lodash-es/_escapeHtmlChar.js":
  97595. /*!***************************************************!*\
  97596. !*** ./node_modules/lodash-es/_escapeHtmlChar.js ***!
  97597. \***************************************************/
  97598. /*! exports provided: default */
  97599. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97600. "use strict";
  97601. __webpack_require__.r(__webpack_exports__);
  97602. /* harmony import */ var _basePropertyOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_basePropertyOf.js */ "./node_modules/lodash-es/_basePropertyOf.js");
  97603. /** Used to map characters to HTML entities. */
  97604. var htmlEscapes = {
  97605. '&': '&amp;',
  97606. '<': '&lt;',
  97607. '>': '&gt;',
  97608. '"': '&quot;',
  97609. "'": '&#39;'
  97610. };
  97611. /**
  97612. * Used by `_.escape` to convert characters to HTML entities.
  97613. *
  97614. * @private
  97615. * @param {string} chr The matched character to escape.
  97616. * @returns {string} Returns the escaped character.
  97617. */
  97618. var escapeHtmlChar = Object(_basePropertyOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(htmlEscapes);
  97619. /* harmony default export */ __webpack_exports__["default"] = (escapeHtmlChar);
  97620. /***/ }),
  97621. /***/ "./node_modules/lodash-es/_escapeStringChar.js":
  97622. /*!*****************************************************!*\
  97623. !*** ./node_modules/lodash-es/_escapeStringChar.js ***!
  97624. \*****************************************************/
  97625. /*! exports provided: default */
  97626. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97627. "use strict";
  97628. __webpack_require__.r(__webpack_exports__);
  97629. /** Used to escape characters for inclusion in compiled string literals. */
  97630. var stringEscapes = {
  97631. '\\': '\\',
  97632. "'": "'",
  97633. '\n': 'n',
  97634. '\r': 'r',
  97635. '\u2028': 'u2028',
  97636. '\u2029': 'u2029'
  97637. };
  97638. /**
  97639. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  97640. *
  97641. * @private
  97642. * @param {string} chr The matched character to escape.
  97643. * @returns {string} Returns the escaped character.
  97644. */
  97645. function escapeStringChar(chr) {
  97646. return '\\' + stringEscapes[chr];
  97647. }
  97648. /* harmony default export */ __webpack_exports__["default"] = (escapeStringChar);
  97649. /***/ }),
  97650. /***/ "./node_modules/lodash-es/_flatRest.js":
  97651. /*!*********************************************!*\
  97652. !*** ./node_modules/lodash-es/_flatRest.js ***!
  97653. \*********************************************/
  97654. /*! exports provided: default */
  97655. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97656. "use strict";
  97657. __webpack_require__.r(__webpack_exports__);
  97658. /* harmony import */ var _flatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./flatten.js */ "./node_modules/lodash-es/flatten.js");
  97659. /* harmony import */ var _overRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_overRest.js */ "./node_modules/lodash-es/_overRest.js");
  97660. /* harmony import */ var _setToString_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_setToString.js */ "./node_modules/lodash-es/_setToString.js");
  97661. /**
  97662. * A specialized version of `baseRest` which flattens the rest array.
  97663. *
  97664. * @private
  97665. * @param {Function} func The function to apply a rest parameter to.
  97666. * @returns {Function} Returns the new function.
  97667. */
  97668. function flatRest(func) {
  97669. return Object(_setToString_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_overRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func, undefined, _flatten_js__WEBPACK_IMPORTED_MODULE_0__["default"]), func + '');
  97670. }
  97671. /* harmony default export */ __webpack_exports__["default"] = (flatRest);
  97672. /***/ }),
  97673. /***/ "./node_modules/lodash-es/_freeGlobal.js":
  97674. /*!***********************************************!*\
  97675. !*** ./node_modules/lodash-es/_freeGlobal.js ***!
  97676. \***********************************************/
  97677. /*! exports provided: default */
  97678. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97679. "use strict";
  97680. __webpack_require__.r(__webpack_exports__);
  97681. /* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */
  97682. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  97683. /* harmony default export */ __webpack_exports__["default"] = (freeGlobal);
  97684. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  97685. /***/ }),
  97686. /***/ "./node_modules/lodash-es/_getAllKeys.js":
  97687. /*!***********************************************!*\
  97688. !*** ./node_modules/lodash-es/_getAllKeys.js ***!
  97689. \***********************************************/
  97690. /*! exports provided: default */
  97691. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97692. "use strict";
  97693. __webpack_require__.r(__webpack_exports__);
  97694. /* harmony import */ var _baseGetAllKeys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetAllKeys.js */ "./node_modules/lodash-es/_baseGetAllKeys.js");
  97695. /* harmony import */ var _getSymbols_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getSymbols.js */ "./node_modules/lodash-es/_getSymbols.js");
  97696. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  97697. /**
  97698. * Creates an array of own enumerable property names and symbols of `object`.
  97699. *
  97700. * @private
  97701. * @param {Object} object The object to query.
  97702. * @returns {Array} Returns the array of property names and symbols.
  97703. */
  97704. function getAllKeys(object) {
  97705. return Object(_baseGetAllKeys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, _keys_js__WEBPACK_IMPORTED_MODULE_2__["default"], _getSymbols_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  97706. }
  97707. /* harmony default export */ __webpack_exports__["default"] = (getAllKeys);
  97708. /***/ }),
  97709. /***/ "./node_modules/lodash-es/_getAllKeysIn.js":
  97710. /*!*************************************************!*\
  97711. !*** ./node_modules/lodash-es/_getAllKeysIn.js ***!
  97712. \*************************************************/
  97713. /*! exports provided: default */
  97714. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97715. "use strict";
  97716. __webpack_require__.r(__webpack_exports__);
  97717. /* harmony import */ var _baseGetAllKeys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetAllKeys.js */ "./node_modules/lodash-es/_baseGetAllKeys.js");
  97718. /* harmony import */ var _getSymbolsIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getSymbolsIn.js */ "./node_modules/lodash-es/_getSymbolsIn.js");
  97719. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  97720. /**
  97721. * Creates an array of own and inherited enumerable property names and
  97722. * symbols of `object`.
  97723. *
  97724. * @private
  97725. * @param {Object} object The object to query.
  97726. * @returns {Array} Returns the array of property names and symbols.
  97727. */
  97728. function getAllKeysIn(object) {
  97729. return Object(_baseGetAllKeys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, _keysIn_js__WEBPACK_IMPORTED_MODULE_2__["default"], _getSymbolsIn_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  97730. }
  97731. /* harmony default export */ __webpack_exports__["default"] = (getAllKeysIn);
  97732. /***/ }),
  97733. /***/ "./node_modules/lodash-es/_getData.js":
  97734. /*!********************************************!*\
  97735. !*** ./node_modules/lodash-es/_getData.js ***!
  97736. \********************************************/
  97737. /*! exports provided: default */
  97738. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97739. "use strict";
  97740. __webpack_require__.r(__webpack_exports__);
  97741. /* harmony import */ var _metaMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_metaMap.js */ "./node_modules/lodash-es/_metaMap.js");
  97742. /* harmony import */ var _noop_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./noop.js */ "./node_modules/lodash-es/noop.js");
  97743. /**
  97744. * Gets metadata for `func`.
  97745. *
  97746. * @private
  97747. * @param {Function} func The function to query.
  97748. * @returns {*} Returns the metadata for `func`.
  97749. */
  97750. var getData = !_metaMap_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _noop_js__WEBPACK_IMPORTED_MODULE_1__["default"] : function(func) {
  97751. return _metaMap_js__WEBPACK_IMPORTED_MODULE_0__["default"].get(func);
  97752. };
  97753. /* harmony default export */ __webpack_exports__["default"] = (getData);
  97754. /***/ }),
  97755. /***/ "./node_modules/lodash-es/_getFuncName.js":
  97756. /*!************************************************!*\
  97757. !*** ./node_modules/lodash-es/_getFuncName.js ***!
  97758. \************************************************/
  97759. /*! exports provided: default */
  97760. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97761. "use strict";
  97762. __webpack_require__.r(__webpack_exports__);
  97763. /* harmony import */ var _realNames_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_realNames.js */ "./node_modules/lodash-es/_realNames.js");
  97764. /** Used for built-in method references. */
  97765. var objectProto = Object.prototype;
  97766. /** Used to check objects for own properties. */
  97767. var hasOwnProperty = objectProto.hasOwnProperty;
  97768. /**
  97769. * Gets the name of `func`.
  97770. *
  97771. * @private
  97772. * @param {Function} func The function to query.
  97773. * @returns {string} Returns the function name.
  97774. */
  97775. function getFuncName(func) {
  97776. var result = (func.name + ''),
  97777. array = _realNames_js__WEBPACK_IMPORTED_MODULE_0__["default"][result],
  97778. length = hasOwnProperty.call(_realNames_js__WEBPACK_IMPORTED_MODULE_0__["default"], result) ? array.length : 0;
  97779. while (length--) {
  97780. var data = array[length],
  97781. otherFunc = data.func;
  97782. if (otherFunc == null || otherFunc == func) {
  97783. return data.name;
  97784. }
  97785. }
  97786. return result;
  97787. }
  97788. /* harmony default export */ __webpack_exports__["default"] = (getFuncName);
  97789. /***/ }),
  97790. /***/ "./node_modules/lodash-es/_getHolder.js":
  97791. /*!**********************************************!*\
  97792. !*** ./node_modules/lodash-es/_getHolder.js ***!
  97793. \**********************************************/
  97794. /*! exports provided: default */
  97795. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97796. "use strict";
  97797. __webpack_require__.r(__webpack_exports__);
  97798. /**
  97799. * Gets the argument placeholder value for `func`.
  97800. *
  97801. * @private
  97802. * @param {Function} func The function to inspect.
  97803. * @returns {*} Returns the placeholder value.
  97804. */
  97805. function getHolder(func) {
  97806. var object = func;
  97807. return object.placeholder;
  97808. }
  97809. /* harmony default export */ __webpack_exports__["default"] = (getHolder);
  97810. /***/ }),
  97811. /***/ "./node_modules/lodash-es/_getMapData.js":
  97812. /*!***********************************************!*\
  97813. !*** ./node_modules/lodash-es/_getMapData.js ***!
  97814. \***********************************************/
  97815. /*! exports provided: default */
  97816. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97817. "use strict";
  97818. __webpack_require__.r(__webpack_exports__);
  97819. /* harmony import */ var _isKeyable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_isKeyable.js */ "./node_modules/lodash-es/_isKeyable.js");
  97820. /**
  97821. * Gets the data for `map`.
  97822. *
  97823. * @private
  97824. * @param {Object} map The map to query.
  97825. * @param {string} key The reference key.
  97826. * @returns {*} Returns the map data.
  97827. */
  97828. function getMapData(map, key) {
  97829. var data = map.__data__;
  97830. return Object(_isKeyable_js__WEBPACK_IMPORTED_MODULE_0__["default"])(key)
  97831. ? data[typeof key == 'string' ? 'string' : 'hash']
  97832. : data.map;
  97833. }
  97834. /* harmony default export */ __webpack_exports__["default"] = (getMapData);
  97835. /***/ }),
  97836. /***/ "./node_modules/lodash-es/_getMatchData.js":
  97837. /*!*************************************************!*\
  97838. !*** ./node_modules/lodash-es/_getMatchData.js ***!
  97839. \*************************************************/
  97840. /*! exports provided: default */
  97841. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97842. "use strict";
  97843. __webpack_require__.r(__webpack_exports__);
  97844. /* harmony import */ var _isStrictComparable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_isStrictComparable.js */ "./node_modules/lodash-es/_isStrictComparable.js");
  97845. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  97846. /**
  97847. * Gets the property names, values, and compare flags of `object`.
  97848. *
  97849. * @private
  97850. * @param {Object} object The object to query.
  97851. * @returns {Array} Returns the match data of `object`.
  97852. */
  97853. function getMatchData(object) {
  97854. var result = Object(_keys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object),
  97855. length = result.length;
  97856. while (length--) {
  97857. var key = result[length],
  97858. value = object[key];
  97859. result[length] = [key, value, Object(_isStrictComparable_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value)];
  97860. }
  97861. return result;
  97862. }
  97863. /* harmony default export */ __webpack_exports__["default"] = (getMatchData);
  97864. /***/ }),
  97865. /***/ "./node_modules/lodash-es/_getNative.js":
  97866. /*!**********************************************!*\
  97867. !*** ./node_modules/lodash-es/_getNative.js ***!
  97868. \**********************************************/
  97869. /*! exports provided: default */
  97870. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97871. "use strict";
  97872. __webpack_require__.r(__webpack_exports__);
  97873. /* harmony import */ var _baseIsNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsNative.js */ "./node_modules/lodash-es/_baseIsNative.js");
  97874. /* harmony import */ var _getValue_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getValue.js */ "./node_modules/lodash-es/_getValue.js");
  97875. /**
  97876. * Gets the native function at `key` of `object`.
  97877. *
  97878. * @private
  97879. * @param {Object} object The object to query.
  97880. * @param {string} key The key of the method to get.
  97881. * @returns {*} Returns the function if it's native, else `undefined`.
  97882. */
  97883. function getNative(object, key) {
  97884. var value = Object(_getValue_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, key);
  97885. return Object(_baseIsNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) ? value : undefined;
  97886. }
  97887. /* harmony default export */ __webpack_exports__["default"] = (getNative);
  97888. /***/ }),
  97889. /***/ "./node_modules/lodash-es/_getPrototype.js":
  97890. /*!*************************************************!*\
  97891. !*** ./node_modules/lodash-es/_getPrototype.js ***!
  97892. \*************************************************/
  97893. /*! exports provided: default */
  97894. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97895. "use strict";
  97896. __webpack_require__.r(__webpack_exports__);
  97897. /* harmony import */ var _overArg_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_overArg.js */ "./node_modules/lodash-es/_overArg.js");
  97898. /** Built-in value references. */
  97899. var getPrototype = Object(_overArg_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object.getPrototypeOf, Object);
  97900. /* harmony default export */ __webpack_exports__["default"] = (getPrototype);
  97901. /***/ }),
  97902. /***/ "./node_modules/lodash-es/_getRawTag.js":
  97903. /*!**********************************************!*\
  97904. !*** ./node_modules/lodash-es/_getRawTag.js ***!
  97905. \**********************************************/
  97906. /*! exports provided: default */
  97907. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97908. "use strict";
  97909. __webpack_require__.r(__webpack_exports__);
  97910. /* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
  97911. /** Used for built-in method references. */
  97912. var objectProto = Object.prototype;
  97913. /** Used to check objects for own properties. */
  97914. var hasOwnProperty = objectProto.hasOwnProperty;
  97915. /**
  97916. * Used to resolve the
  97917. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  97918. * of values.
  97919. */
  97920. var nativeObjectToString = objectProto.toString;
  97921. /** Built-in value references. */
  97922. var symToStringTag = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].toStringTag : undefined;
  97923. /**
  97924. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  97925. *
  97926. * @private
  97927. * @param {*} value The value to query.
  97928. * @returns {string} Returns the raw `toStringTag`.
  97929. */
  97930. function getRawTag(value) {
  97931. var isOwn = hasOwnProperty.call(value, symToStringTag),
  97932. tag = value[symToStringTag];
  97933. try {
  97934. value[symToStringTag] = undefined;
  97935. var unmasked = true;
  97936. } catch (e) {}
  97937. var result = nativeObjectToString.call(value);
  97938. if (unmasked) {
  97939. if (isOwn) {
  97940. value[symToStringTag] = tag;
  97941. } else {
  97942. delete value[symToStringTag];
  97943. }
  97944. }
  97945. return result;
  97946. }
  97947. /* harmony default export */ __webpack_exports__["default"] = (getRawTag);
  97948. /***/ }),
  97949. /***/ "./node_modules/lodash-es/_getSymbols.js":
  97950. /*!***********************************************!*\
  97951. !*** ./node_modules/lodash-es/_getSymbols.js ***!
  97952. \***********************************************/
  97953. /*! exports provided: default */
  97954. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97955. "use strict";
  97956. __webpack_require__.r(__webpack_exports__);
  97957. /* harmony import */ var _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayFilter.js */ "./node_modules/lodash-es/_arrayFilter.js");
  97958. /* harmony import */ var _stubArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./stubArray.js */ "./node_modules/lodash-es/stubArray.js");
  97959. /** Used for built-in method references. */
  97960. var objectProto = Object.prototype;
  97961. /** Built-in value references. */
  97962. var propertyIsEnumerable = objectProto.propertyIsEnumerable;
  97963. /* Built-in method references for those with the same name as other `lodash` methods. */
  97964. var nativeGetSymbols = Object.getOwnPropertySymbols;
  97965. /**
  97966. * Creates an array of the own enumerable symbols of `object`.
  97967. *
  97968. * @private
  97969. * @param {Object} object The object to query.
  97970. * @returns {Array} Returns the array of symbols.
  97971. */
  97972. var getSymbols = !nativeGetSymbols ? _stubArray_js__WEBPACK_IMPORTED_MODULE_1__["default"] : function(object) {
  97973. if (object == null) {
  97974. return [];
  97975. }
  97976. object = Object(object);
  97977. return Object(_arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__["default"])(nativeGetSymbols(object), function(symbol) {
  97978. return propertyIsEnumerable.call(object, symbol);
  97979. });
  97980. };
  97981. /* harmony default export */ __webpack_exports__["default"] = (getSymbols);
  97982. /***/ }),
  97983. /***/ "./node_modules/lodash-es/_getSymbolsIn.js":
  97984. /*!*************************************************!*\
  97985. !*** ./node_modules/lodash-es/_getSymbolsIn.js ***!
  97986. \*************************************************/
  97987. /*! exports provided: default */
  97988. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97989. "use strict";
  97990. __webpack_require__.r(__webpack_exports__);
  97991. /* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayPush.js */ "./node_modules/lodash-es/_arrayPush.js");
  97992. /* harmony import */ var _getPrototype_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getPrototype.js */ "./node_modules/lodash-es/_getPrototype.js");
  97993. /* harmony import */ var _getSymbols_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getSymbols.js */ "./node_modules/lodash-es/_getSymbols.js");
  97994. /* harmony import */ var _stubArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./stubArray.js */ "./node_modules/lodash-es/stubArray.js");
  97995. /* Built-in method references for those with the same name as other `lodash` methods. */
  97996. var nativeGetSymbols = Object.getOwnPropertySymbols;
  97997. /**
  97998. * Creates an array of the own and inherited enumerable symbols of `object`.
  97999. *
  98000. * @private
  98001. * @param {Object} object The object to query.
  98002. * @returns {Array} Returns the array of symbols.
  98003. */
  98004. var getSymbolsIn = !nativeGetSymbols ? _stubArray_js__WEBPACK_IMPORTED_MODULE_3__["default"] : function(object) {
  98005. var result = [];
  98006. while (object) {
  98007. Object(_arrayPush_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, Object(_getSymbols_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object));
  98008. object = Object(_getPrototype_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object);
  98009. }
  98010. return result;
  98011. };
  98012. /* harmony default export */ __webpack_exports__["default"] = (getSymbolsIn);
  98013. /***/ }),
  98014. /***/ "./node_modules/lodash-es/_getTag.js":
  98015. /*!*******************************************!*\
  98016. !*** ./node_modules/lodash-es/_getTag.js ***!
  98017. \*******************************************/
  98018. /*! exports provided: default */
  98019. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98020. "use strict";
  98021. __webpack_require__.r(__webpack_exports__);
  98022. /* harmony import */ var _DataView_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_DataView.js */ "./node_modules/lodash-es/_DataView.js");
  98023. /* harmony import */ var _Map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_Map.js */ "./node_modules/lodash-es/_Map.js");
  98024. /* harmony import */ var _Promise_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_Promise.js */ "./node_modules/lodash-es/_Promise.js");
  98025. /* harmony import */ var _Set_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_Set.js */ "./node_modules/lodash-es/_Set.js");
  98026. /* harmony import */ var _WeakMap_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_WeakMap.js */ "./node_modules/lodash-es/_WeakMap.js");
  98027. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  98028. /* harmony import */ var _toSource_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_toSource.js */ "./node_modules/lodash-es/_toSource.js");
  98029. /** `Object#toString` result references. */
  98030. var mapTag = '[object Map]',
  98031. objectTag = '[object Object]',
  98032. promiseTag = '[object Promise]',
  98033. setTag = '[object Set]',
  98034. weakMapTag = '[object WeakMap]';
  98035. var dataViewTag = '[object DataView]';
  98036. /** Used to detect maps, sets, and weakmaps. */
  98037. var dataViewCtorString = Object(_toSource_js__WEBPACK_IMPORTED_MODULE_6__["default"])(_DataView_js__WEBPACK_IMPORTED_MODULE_0__["default"]),
  98038. mapCtorString = Object(_toSource_js__WEBPACK_IMPORTED_MODULE_6__["default"])(_Map_js__WEBPACK_IMPORTED_MODULE_1__["default"]),
  98039. promiseCtorString = Object(_toSource_js__WEBPACK_IMPORTED_MODULE_6__["default"])(_Promise_js__WEBPACK_IMPORTED_MODULE_2__["default"]),
  98040. setCtorString = Object(_toSource_js__WEBPACK_IMPORTED_MODULE_6__["default"])(_Set_js__WEBPACK_IMPORTED_MODULE_3__["default"]),
  98041. weakMapCtorString = Object(_toSource_js__WEBPACK_IMPORTED_MODULE_6__["default"])(_WeakMap_js__WEBPACK_IMPORTED_MODULE_4__["default"]);
  98042. /**
  98043. * Gets the `toStringTag` of `value`.
  98044. *
  98045. * @private
  98046. * @param {*} value The value to query.
  98047. * @returns {string} Returns the `toStringTag`.
  98048. */
  98049. var getTag = _baseGetTag_js__WEBPACK_IMPORTED_MODULE_5__["default"];
  98050. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  98051. if ((_DataView_js__WEBPACK_IMPORTED_MODULE_0__["default"] && getTag(new _DataView_js__WEBPACK_IMPORTED_MODULE_0__["default"](new ArrayBuffer(1))) != dataViewTag) ||
  98052. (_Map_js__WEBPACK_IMPORTED_MODULE_1__["default"] && getTag(new _Map_js__WEBPACK_IMPORTED_MODULE_1__["default"]) != mapTag) ||
  98053. (_Promise_js__WEBPACK_IMPORTED_MODULE_2__["default"] && getTag(_Promise_js__WEBPACK_IMPORTED_MODULE_2__["default"].resolve()) != promiseTag) ||
  98054. (_Set_js__WEBPACK_IMPORTED_MODULE_3__["default"] && getTag(new _Set_js__WEBPACK_IMPORTED_MODULE_3__["default"]) != setTag) ||
  98055. (_WeakMap_js__WEBPACK_IMPORTED_MODULE_4__["default"] && getTag(new _WeakMap_js__WEBPACK_IMPORTED_MODULE_4__["default"]) != weakMapTag)) {
  98056. getTag = function(value) {
  98057. var result = Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_5__["default"])(value),
  98058. Ctor = result == objectTag ? value.constructor : undefined,
  98059. ctorString = Ctor ? Object(_toSource_js__WEBPACK_IMPORTED_MODULE_6__["default"])(Ctor) : '';
  98060. if (ctorString) {
  98061. switch (ctorString) {
  98062. case dataViewCtorString: return dataViewTag;
  98063. case mapCtorString: return mapTag;
  98064. case promiseCtorString: return promiseTag;
  98065. case setCtorString: return setTag;
  98066. case weakMapCtorString: return weakMapTag;
  98067. }
  98068. }
  98069. return result;
  98070. };
  98071. }
  98072. /* harmony default export */ __webpack_exports__["default"] = (getTag);
  98073. /***/ }),
  98074. /***/ "./node_modules/lodash-es/_getValue.js":
  98075. /*!*********************************************!*\
  98076. !*** ./node_modules/lodash-es/_getValue.js ***!
  98077. \*********************************************/
  98078. /*! exports provided: default */
  98079. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98080. "use strict";
  98081. __webpack_require__.r(__webpack_exports__);
  98082. /**
  98083. * Gets the value at `key` of `object`.
  98084. *
  98085. * @private
  98086. * @param {Object} [object] The object to query.
  98087. * @param {string} key The key of the property to get.
  98088. * @returns {*} Returns the property value.
  98089. */
  98090. function getValue(object, key) {
  98091. return object == null ? undefined : object[key];
  98092. }
  98093. /* harmony default export */ __webpack_exports__["default"] = (getValue);
  98094. /***/ }),
  98095. /***/ "./node_modules/lodash-es/_getView.js":
  98096. /*!********************************************!*\
  98097. !*** ./node_modules/lodash-es/_getView.js ***!
  98098. \********************************************/
  98099. /*! exports provided: default */
  98100. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98101. "use strict";
  98102. __webpack_require__.r(__webpack_exports__);
  98103. /* Built-in method references for those with the same name as other `lodash` methods. */
  98104. var nativeMax = Math.max,
  98105. nativeMin = Math.min;
  98106. /**
  98107. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  98108. *
  98109. * @private
  98110. * @param {number} start The start of the view.
  98111. * @param {number} end The end of the view.
  98112. * @param {Array} transforms The transformations to apply to the view.
  98113. * @returns {Object} Returns an object containing the `start` and `end`
  98114. * positions of the view.
  98115. */
  98116. function getView(start, end, transforms) {
  98117. var index = -1,
  98118. length = transforms.length;
  98119. while (++index < length) {
  98120. var data = transforms[index],
  98121. size = data.size;
  98122. switch (data.type) {
  98123. case 'drop': start += size; break;
  98124. case 'dropRight': end -= size; break;
  98125. case 'take': end = nativeMin(end, start + size); break;
  98126. case 'takeRight': start = nativeMax(start, end - size); break;
  98127. }
  98128. }
  98129. return { 'start': start, 'end': end };
  98130. }
  98131. /* harmony default export */ __webpack_exports__["default"] = (getView);
  98132. /***/ }),
  98133. /***/ "./node_modules/lodash-es/_getWrapDetails.js":
  98134. /*!***************************************************!*\
  98135. !*** ./node_modules/lodash-es/_getWrapDetails.js ***!
  98136. \***************************************************/
  98137. /*! exports provided: default */
  98138. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98139. "use strict";
  98140. __webpack_require__.r(__webpack_exports__);
  98141. /** Used to match wrap detail comments. */
  98142. var reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  98143. reSplitDetails = /,? & /;
  98144. /**
  98145. * Extracts wrapper details from the `source` body comment.
  98146. *
  98147. * @private
  98148. * @param {string} source The source to inspect.
  98149. * @returns {Array} Returns the wrapper details.
  98150. */
  98151. function getWrapDetails(source) {
  98152. var match = source.match(reWrapDetails);
  98153. return match ? match[1].split(reSplitDetails) : [];
  98154. }
  98155. /* harmony default export */ __webpack_exports__["default"] = (getWrapDetails);
  98156. /***/ }),
  98157. /***/ "./node_modules/lodash-es/_hasPath.js":
  98158. /*!********************************************!*\
  98159. !*** ./node_modules/lodash-es/_hasPath.js ***!
  98160. \********************************************/
  98161. /*! exports provided: default */
  98162. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98163. "use strict";
  98164. __webpack_require__.r(__webpack_exports__);
  98165. /* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
  98166. /* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
  98167. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  98168. /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
  98169. /* harmony import */ var _isLength_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isLength.js */ "./node_modules/lodash-es/isLength.js");
  98170. /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
  98171. /**
  98172. * Checks if `path` exists on `object`.
  98173. *
  98174. * @private
  98175. * @param {Object} object The object to query.
  98176. * @param {Array|string} path The path to check.
  98177. * @param {Function} hasFunc The function to check properties.
  98178. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  98179. */
  98180. function hasPath(object, path, hasFunc) {
  98181. path = Object(_castPath_js__WEBPACK_IMPORTED_MODULE_0__["default"])(path, object);
  98182. var index = -1,
  98183. length = path.length,
  98184. result = false;
  98185. while (++index < length) {
  98186. var key = Object(_toKey_js__WEBPACK_IMPORTED_MODULE_5__["default"])(path[index]);
  98187. if (!(result = object != null && hasFunc(object, key))) {
  98188. break;
  98189. }
  98190. object = object[key];
  98191. }
  98192. if (result || ++index != length) {
  98193. return result;
  98194. }
  98195. length = object == null ? 0 : object.length;
  98196. return !!length && Object(_isLength_js__WEBPACK_IMPORTED_MODULE_4__["default"])(length) && Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_3__["default"])(key, length) &&
  98197. (Object(_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object) || Object(_isArguments_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object));
  98198. }
  98199. /* harmony default export */ __webpack_exports__["default"] = (hasPath);
  98200. /***/ }),
  98201. /***/ "./node_modules/lodash-es/_hasUnicode.js":
  98202. /*!***********************************************!*\
  98203. !*** ./node_modules/lodash-es/_hasUnicode.js ***!
  98204. \***********************************************/
  98205. /*! exports provided: default */
  98206. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98207. "use strict";
  98208. __webpack_require__.r(__webpack_exports__);
  98209. /** Used to compose unicode character classes. */
  98210. var rsAstralRange = '\\ud800-\\udfff',
  98211. rsComboMarksRange = '\\u0300-\\u036f',
  98212. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  98213. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  98214. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  98215. rsVarRange = '\\ufe0e\\ufe0f';
  98216. /** Used to compose unicode capture groups. */
  98217. var rsZWJ = '\\u200d';
  98218. /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
  98219. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  98220. /**
  98221. * Checks if `string` contains Unicode symbols.
  98222. *
  98223. * @private
  98224. * @param {string} string The string to inspect.
  98225. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  98226. */
  98227. function hasUnicode(string) {
  98228. return reHasUnicode.test(string);
  98229. }
  98230. /* harmony default export */ __webpack_exports__["default"] = (hasUnicode);
  98231. /***/ }),
  98232. /***/ "./node_modules/lodash-es/_hasUnicodeWord.js":
  98233. /*!***************************************************!*\
  98234. !*** ./node_modules/lodash-es/_hasUnicodeWord.js ***!
  98235. \***************************************************/
  98236. /*! exports provided: default */
  98237. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98238. "use strict";
  98239. __webpack_require__.r(__webpack_exports__);
  98240. /** Used to detect strings that need a more robust regexp to match words. */
  98241. var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
  98242. /**
  98243. * Checks if `string` contains a word composed of Unicode symbols.
  98244. *
  98245. * @private
  98246. * @param {string} string The string to inspect.
  98247. * @returns {boolean} Returns `true` if a word is found, else `false`.
  98248. */
  98249. function hasUnicodeWord(string) {
  98250. return reHasUnicodeWord.test(string);
  98251. }
  98252. /* harmony default export */ __webpack_exports__["default"] = (hasUnicodeWord);
  98253. /***/ }),
  98254. /***/ "./node_modules/lodash-es/_hashClear.js":
  98255. /*!**********************************************!*\
  98256. !*** ./node_modules/lodash-es/_hashClear.js ***!
  98257. \**********************************************/
  98258. /*! exports provided: default */
  98259. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98260. "use strict";
  98261. __webpack_require__.r(__webpack_exports__);
  98262. /* harmony import */ var _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_nativeCreate.js */ "./node_modules/lodash-es/_nativeCreate.js");
  98263. /**
  98264. * Removes all key-value entries from the hash.
  98265. *
  98266. * @private
  98267. * @name clear
  98268. * @memberOf Hash
  98269. */
  98270. function hashClear() {
  98271. this.__data__ = _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? Object(_nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(null) : {};
  98272. this.size = 0;
  98273. }
  98274. /* harmony default export */ __webpack_exports__["default"] = (hashClear);
  98275. /***/ }),
  98276. /***/ "./node_modules/lodash-es/_hashDelete.js":
  98277. /*!***********************************************!*\
  98278. !*** ./node_modules/lodash-es/_hashDelete.js ***!
  98279. \***********************************************/
  98280. /*! exports provided: default */
  98281. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98282. "use strict";
  98283. __webpack_require__.r(__webpack_exports__);
  98284. /**
  98285. * Removes `key` and its value from the hash.
  98286. *
  98287. * @private
  98288. * @name delete
  98289. * @memberOf Hash
  98290. * @param {Object} hash The hash to modify.
  98291. * @param {string} key The key of the value to remove.
  98292. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  98293. */
  98294. function hashDelete(key) {
  98295. var result = this.has(key) && delete this.__data__[key];
  98296. this.size -= result ? 1 : 0;
  98297. return result;
  98298. }
  98299. /* harmony default export */ __webpack_exports__["default"] = (hashDelete);
  98300. /***/ }),
  98301. /***/ "./node_modules/lodash-es/_hashGet.js":
  98302. /*!********************************************!*\
  98303. !*** ./node_modules/lodash-es/_hashGet.js ***!
  98304. \********************************************/
  98305. /*! exports provided: default */
  98306. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98307. "use strict";
  98308. __webpack_require__.r(__webpack_exports__);
  98309. /* harmony import */ var _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_nativeCreate.js */ "./node_modules/lodash-es/_nativeCreate.js");
  98310. /** Used to stand-in for `undefined` hash values. */
  98311. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  98312. /** Used for built-in method references. */
  98313. var objectProto = Object.prototype;
  98314. /** Used to check objects for own properties. */
  98315. var hasOwnProperty = objectProto.hasOwnProperty;
  98316. /**
  98317. * Gets the hash value for `key`.
  98318. *
  98319. * @private
  98320. * @name get
  98321. * @memberOf Hash
  98322. * @param {string} key The key of the value to get.
  98323. * @returns {*} Returns the entry value.
  98324. */
  98325. function hashGet(key) {
  98326. var data = this.__data__;
  98327. if (_nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"]) {
  98328. var result = data[key];
  98329. return result === HASH_UNDEFINED ? undefined : result;
  98330. }
  98331. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  98332. }
  98333. /* harmony default export */ __webpack_exports__["default"] = (hashGet);
  98334. /***/ }),
  98335. /***/ "./node_modules/lodash-es/_hashHas.js":
  98336. /*!********************************************!*\
  98337. !*** ./node_modules/lodash-es/_hashHas.js ***!
  98338. \********************************************/
  98339. /*! exports provided: default */
  98340. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98341. "use strict";
  98342. __webpack_require__.r(__webpack_exports__);
  98343. /* harmony import */ var _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_nativeCreate.js */ "./node_modules/lodash-es/_nativeCreate.js");
  98344. /** Used for built-in method references. */
  98345. var objectProto = Object.prototype;
  98346. /** Used to check objects for own properties. */
  98347. var hasOwnProperty = objectProto.hasOwnProperty;
  98348. /**
  98349. * Checks if a hash value for `key` exists.
  98350. *
  98351. * @private
  98352. * @name has
  98353. * @memberOf Hash
  98354. * @param {string} key The key of the entry to check.
  98355. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  98356. */
  98357. function hashHas(key) {
  98358. var data = this.__data__;
  98359. return _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  98360. }
  98361. /* harmony default export */ __webpack_exports__["default"] = (hashHas);
  98362. /***/ }),
  98363. /***/ "./node_modules/lodash-es/_hashSet.js":
  98364. /*!********************************************!*\
  98365. !*** ./node_modules/lodash-es/_hashSet.js ***!
  98366. \********************************************/
  98367. /*! exports provided: default */
  98368. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98369. "use strict";
  98370. __webpack_require__.r(__webpack_exports__);
  98371. /* harmony import */ var _nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_nativeCreate.js */ "./node_modules/lodash-es/_nativeCreate.js");
  98372. /** Used to stand-in for `undefined` hash values. */
  98373. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  98374. /**
  98375. * Sets the hash `key` to `value`.
  98376. *
  98377. * @private
  98378. * @name set
  98379. * @memberOf Hash
  98380. * @param {string} key The key of the value to set.
  98381. * @param {*} value The value to set.
  98382. * @returns {Object} Returns the hash instance.
  98383. */
  98384. function hashSet(key, value) {
  98385. var data = this.__data__;
  98386. this.size += this.has(key) ? 0 : 1;
  98387. data[key] = (_nativeCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"] && value === undefined) ? HASH_UNDEFINED : value;
  98388. return this;
  98389. }
  98390. /* harmony default export */ __webpack_exports__["default"] = (hashSet);
  98391. /***/ }),
  98392. /***/ "./node_modules/lodash-es/_initCloneArray.js":
  98393. /*!***************************************************!*\
  98394. !*** ./node_modules/lodash-es/_initCloneArray.js ***!
  98395. \***************************************************/
  98396. /*! exports provided: default */
  98397. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98398. "use strict";
  98399. __webpack_require__.r(__webpack_exports__);
  98400. /** Used for built-in method references. */
  98401. var objectProto = Object.prototype;
  98402. /** Used to check objects for own properties. */
  98403. var hasOwnProperty = objectProto.hasOwnProperty;
  98404. /**
  98405. * Initializes an array clone.
  98406. *
  98407. * @private
  98408. * @param {Array} array The array to clone.
  98409. * @returns {Array} Returns the initialized clone.
  98410. */
  98411. function initCloneArray(array) {
  98412. var length = array.length,
  98413. result = new array.constructor(length);
  98414. // Add properties assigned by `RegExp#exec`.
  98415. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  98416. result.index = array.index;
  98417. result.input = array.input;
  98418. }
  98419. return result;
  98420. }
  98421. /* harmony default export */ __webpack_exports__["default"] = (initCloneArray);
  98422. /***/ }),
  98423. /***/ "./node_modules/lodash-es/_initCloneByTag.js":
  98424. /*!***************************************************!*\
  98425. !*** ./node_modules/lodash-es/_initCloneByTag.js ***!
  98426. \***************************************************/
  98427. /*! exports provided: default */
  98428. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98429. "use strict";
  98430. __webpack_require__.r(__webpack_exports__);
  98431. /* harmony import */ var _cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_cloneArrayBuffer.js */ "./node_modules/lodash-es/_cloneArrayBuffer.js");
  98432. /* harmony import */ var _cloneDataView_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_cloneDataView.js */ "./node_modules/lodash-es/_cloneDataView.js");
  98433. /* harmony import */ var _cloneRegExp_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_cloneRegExp.js */ "./node_modules/lodash-es/_cloneRegExp.js");
  98434. /* harmony import */ var _cloneSymbol_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_cloneSymbol.js */ "./node_modules/lodash-es/_cloneSymbol.js");
  98435. /* harmony import */ var _cloneTypedArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_cloneTypedArray.js */ "./node_modules/lodash-es/_cloneTypedArray.js");
  98436. /** `Object#toString` result references. */
  98437. var boolTag = '[object Boolean]',
  98438. dateTag = '[object Date]',
  98439. mapTag = '[object Map]',
  98440. numberTag = '[object Number]',
  98441. regexpTag = '[object RegExp]',
  98442. setTag = '[object Set]',
  98443. stringTag = '[object String]',
  98444. symbolTag = '[object Symbol]';
  98445. var arrayBufferTag = '[object ArrayBuffer]',
  98446. dataViewTag = '[object DataView]',
  98447. float32Tag = '[object Float32Array]',
  98448. float64Tag = '[object Float64Array]',
  98449. int8Tag = '[object Int8Array]',
  98450. int16Tag = '[object Int16Array]',
  98451. int32Tag = '[object Int32Array]',
  98452. uint8Tag = '[object Uint8Array]',
  98453. uint8ClampedTag = '[object Uint8ClampedArray]',
  98454. uint16Tag = '[object Uint16Array]',
  98455. uint32Tag = '[object Uint32Array]';
  98456. /**
  98457. * Initializes an object clone based on its `toStringTag`.
  98458. *
  98459. * **Note:** This function only supports cloning values with tags of
  98460. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  98461. *
  98462. * @private
  98463. * @param {Object} object The object to clone.
  98464. * @param {string} tag The `toStringTag` of the object to clone.
  98465. * @param {boolean} [isDeep] Specify a deep clone.
  98466. * @returns {Object} Returns the initialized clone.
  98467. */
  98468. function initCloneByTag(object, tag, isDeep) {
  98469. var Ctor = object.constructor;
  98470. switch (tag) {
  98471. case arrayBufferTag:
  98472. return Object(_cloneArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object);
  98473. case boolTag:
  98474. case dateTag:
  98475. return new Ctor(+object);
  98476. case dataViewTag:
  98477. return Object(_cloneDataView_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, isDeep);
  98478. case float32Tag: case float64Tag:
  98479. case int8Tag: case int16Tag: case int32Tag:
  98480. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  98481. return Object(_cloneTypedArray_js__WEBPACK_IMPORTED_MODULE_4__["default"])(object, isDeep);
  98482. case mapTag:
  98483. return new Ctor;
  98484. case numberTag:
  98485. case stringTag:
  98486. return new Ctor(object);
  98487. case regexpTag:
  98488. return Object(_cloneRegExp_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object);
  98489. case setTag:
  98490. return new Ctor;
  98491. case symbolTag:
  98492. return Object(_cloneSymbol_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object);
  98493. }
  98494. }
  98495. /* harmony default export */ __webpack_exports__["default"] = (initCloneByTag);
  98496. /***/ }),
  98497. /***/ "./node_modules/lodash-es/_initCloneObject.js":
  98498. /*!****************************************************!*\
  98499. !*** ./node_modules/lodash-es/_initCloneObject.js ***!
  98500. \****************************************************/
  98501. /*! exports provided: default */
  98502. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98503. "use strict";
  98504. __webpack_require__.r(__webpack_exports__);
  98505. /* harmony import */ var _baseCreate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseCreate.js */ "./node_modules/lodash-es/_baseCreate.js");
  98506. /* harmony import */ var _getPrototype_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getPrototype.js */ "./node_modules/lodash-es/_getPrototype.js");
  98507. /* harmony import */ var _isPrototype_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_isPrototype.js */ "./node_modules/lodash-es/_isPrototype.js");
  98508. /**
  98509. * Initializes an object clone.
  98510. *
  98511. * @private
  98512. * @param {Object} object The object to clone.
  98513. * @returns {Object} Returns the initialized clone.
  98514. */
  98515. function initCloneObject(object) {
  98516. return (typeof object.constructor == 'function' && !Object(_isPrototype_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object))
  98517. ? Object(_baseCreate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_getPrototype_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object))
  98518. : {};
  98519. }
  98520. /* harmony default export */ __webpack_exports__["default"] = (initCloneObject);
  98521. /***/ }),
  98522. /***/ "./node_modules/lodash-es/_insertWrapDetails.js":
  98523. /*!******************************************************!*\
  98524. !*** ./node_modules/lodash-es/_insertWrapDetails.js ***!
  98525. \******************************************************/
  98526. /*! exports provided: default */
  98527. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98528. "use strict";
  98529. __webpack_require__.r(__webpack_exports__);
  98530. /** Used to match wrap detail comments. */
  98531. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;
  98532. /**
  98533. * Inserts wrapper `details` in a comment at the top of the `source` body.
  98534. *
  98535. * @private
  98536. * @param {string} source The source to modify.
  98537. * @returns {Array} details The details to insert.
  98538. * @returns {string} Returns the modified source.
  98539. */
  98540. function insertWrapDetails(source, details) {
  98541. var length = details.length;
  98542. if (!length) {
  98543. return source;
  98544. }
  98545. var lastIndex = length - 1;
  98546. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  98547. details = details.join(length > 2 ? ', ' : ' ');
  98548. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  98549. }
  98550. /* harmony default export */ __webpack_exports__["default"] = (insertWrapDetails);
  98551. /***/ }),
  98552. /***/ "./node_modules/lodash-es/_isFlattenable.js":
  98553. /*!**************************************************!*\
  98554. !*** ./node_modules/lodash-es/_isFlattenable.js ***!
  98555. \**************************************************/
  98556. /*! exports provided: default */
  98557. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98558. "use strict";
  98559. __webpack_require__.r(__webpack_exports__);
  98560. /* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
  98561. /* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
  98562. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  98563. /** Built-in value references. */
  98564. var spreadableSymbol = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].isConcatSpreadable : undefined;
  98565. /**
  98566. * Checks if `value` is a flattenable `arguments` object or array.
  98567. *
  98568. * @private
  98569. * @param {*} value The value to check.
  98570. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  98571. */
  98572. function isFlattenable(value) {
  98573. return Object(_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value) || Object(_isArguments_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) ||
  98574. !!(spreadableSymbol && value && value[spreadableSymbol]);
  98575. }
  98576. /* harmony default export */ __webpack_exports__["default"] = (isFlattenable);
  98577. /***/ }),
  98578. /***/ "./node_modules/lodash-es/_isIndex.js":
  98579. /*!********************************************!*\
  98580. !*** ./node_modules/lodash-es/_isIndex.js ***!
  98581. \********************************************/
  98582. /*! exports provided: default */
  98583. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98584. "use strict";
  98585. __webpack_require__.r(__webpack_exports__);
  98586. /** Used as references for various `Number` constants. */
  98587. var MAX_SAFE_INTEGER = 9007199254740991;
  98588. /** Used to detect unsigned integer values. */
  98589. var reIsUint = /^(?:0|[1-9]\d*)$/;
  98590. /**
  98591. * Checks if `value` is a valid array-like index.
  98592. *
  98593. * @private
  98594. * @param {*} value The value to check.
  98595. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  98596. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  98597. */
  98598. function isIndex(value, length) {
  98599. var type = typeof value;
  98600. length = length == null ? MAX_SAFE_INTEGER : length;
  98601. return !!length &&
  98602. (type == 'number' ||
  98603. (type != 'symbol' && reIsUint.test(value))) &&
  98604. (value > -1 && value % 1 == 0 && value < length);
  98605. }
  98606. /* harmony default export */ __webpack_exports__["default"] = (isIndex);
  98607. /***/ }),
  98608. /***/ "./node_modules/lodash-es/_isIterateeCall.js":
  98609. /*!***************************************************!*\
  98610. !*** ./node_modules/lodash-es/_isIterateeCall.js ***!
  98611. \***************************************************/
  98612. /*! exports provided: default */
  98613. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98614. "use strict";
  98615. __webpack_require__.r(__webpack_exports__);
  98616. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  98617. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  98618. /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
  98619. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  98620. /**
  98621. * Checks if the given arguments are from an iteratee call.
  98622. *
  98623. * @private
  98624. * @param {*} value The potential iteratee value argument.
  98625. * @param {*} index The potential iteratee index or key argument.
  98626. * @param {*} object The potential iteratee object argument.
  98627. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  98628. * else `false`.
  98629. */
  98630. function isIterateeCall(value, index, object) {
  98631. if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object)) {
  98632. return false;
  98633. }
  98634. var type = typeof index;
  98635. if (type == 'number'
  98636. ? (Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object) && Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_2__["default"])(index, object.length))
  98637. : (type == 'string' && index in object)
  98638. ) {
  98639. return Object(_eq_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object[index], value);
  98640. }
  98641. return false;
  98642. }
  98643. /* harmony default export */ __webpack_exports__["default"] = (isIterateeCall);
  98644. /***/ }),
  98645. /***/ "./node_modules/lodash-es/_isKey.js":
  98646. /*!******************************************!*\
  98647. !*** ./node_modules/lodash-es/_isKey.js ***!
  98648. \******************************************/
  98649. /*! exports provided: default */
  98650. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98651. "use strict";
  98652. __webpack_require__.r(__webpack_exports__);
  98653. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  98654. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  98655. /** Used to match property names within property paths. */
  98656. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  98657. reIsPlainProp = /^\w*$/;
  98658. /**
  98659. * Checks if `value` is a property name and not a property path.
  98660. *
  98661. * @private
  98662. * @param {*} value The value to check.
  98663. * @param {Object} [object] The object to query keys on.
  98664. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  98665. */
  98666. function isKey(value, object) {
  98667. if (Object(_isArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value)) {
  98668. return false;
  98669. }
  98670. var type = typeof value;
  98671. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  98672. value == null || Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
  98673. return true;
  98674. }
  98675. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  98676. (object != null && value in Object(object));
  98677. }
  98678. /* harmony default export */ __webpack_exports__["default"] = (isKey);
  98679. /***/ }),
  98680. /***/ "./node_modules/lodash-es/_isKeyable.js":
  98681. /*!**********************************************!*\
  98682. !*** ./node_modules/lodash-es/_isKeyable.js ***!
  98683. \**********************************************/
  98684. /*! exports provided: default */
  98685. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98686. "use strict";
  98687. __webpack_require__.r(__webpack_exports__);
  98688. /**
  98689. * Checks if `value` is suitable for use as unique object key.
  98690. *
  98691. * @private
  98692. * @param {*} value The value to check.
  98693. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  98694. */
  98695. function isKeyable(value) {
  98696. var type = typeof value;
  98697. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  98698. ? (value !== '__proto__')
  98699. : (value === null);
  98700. }
  98701. /* harmony default export */ __webpack_exports__["default"] = (isKeyable);
  98702. /***/ }),
  98703. /***/ "./node_modules/lodash-es/_isLaziable.js":
  98704. /*!***********************************************!*\
  98705. !*** ./node_modules/lodash-es/_isLaziable.js ***!
  98706. \***********************************************/
  98707. /*! exports provided: default */
  98708. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98709. "use strict";
  98710. __webpack_require__.r(__webpack_exports__);
  98711. /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
  98712. /* harmony import */ var _getData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getData.js */ "./node_modules/lodash-es/_getData.js");
  98713. /* harmony import */ var _getFuncName_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getFuncName.js */ "./node_modules/lodash-es/_getFuncName.js");
  98714. /* harmony import */ var _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./wrapperLodash.js */ "./node_modules/lodash-es/wrapperLodash.js");
  98715. /**
  98716. * Checks if `func` has a lazy counterpart.
  98717. *
  98718. * @private
  98719. * @param {Function} func The function to check.
  98720. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  98721. * else `false`.
  98722. */
  98723. function isLaziable(func) {
  98724. var funcName = Object(_getFuncName_js__WEBPACK_IMPORTED_MODULE_2__["default"])(func),
  98725. other = _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_3__["default"][funcName];
  98726. if (typeof other != 'function' || !(funcName in _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"].prototype)) {
  98727. return false;
  98728. }
  98729. if (func === other) {
  98730. return true;
  98731. }
  98732. var data = Object(_getData_js__WEBPACK_IMPORTED_MODULE_1__["default"])(other);
  98733. return !!data && func === data[0];
  98734. }
  98735. /* harmony default export */ __webpack_exports__["default"] = (isLaziable);
  98736. /***/ }),
  98737. /***/ "./node_modules/lodash-es/_isMaskable.js":
  98738. /*!***********************************************!*\
  98739. !*** ./node_modules/lodash-es/_isMaskable.js ***!
  98740. \***********************************************/
  98741. /*! exports provided: default */
  98742. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98743. "use strict";
  98744. __webpack_require__.r(__webpack_exports__);
  98745. /* harmony import */ var _coreJsData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_coreJsData.js */ "./node_modules/lodash-es/_coreJsData.js");
  98746. /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
  98747. /* harmony import */ var _stubFalse_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./stubFalse.js */ "./node_modules/lodash-es/stubFalse.js");
  98748. /**
  98749. * Checks if `func` is capable of being masked.
  98750. *
  98751. * @private
  98752. * @param {*} value The value to check.
  98753. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  98754. */
  98755. var isMaskable = _coreJsData_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _isFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"] : _stubFalse_js__WEBPACK_IMPORTED_MODULE_2__["default"];
  98756. /* harmony default export */ __webpack_exports__["default"] = (isMaskable);
  98757. /***/ }),
  98758. /***/ "./node_modules/lodash-es/_isMasked.js":
  98759. /*!*********************************************!*\
  98760. !*** ./node_modules/lodash-es/_isMasked.js ***!
  98761. \*********************************************/
  98762. /*! exports provided: default */
  98763. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98764. "use strict";
  98765. __webpack_require__.r(__webpack_exports__);
  98766. /* harmony import */ var _coreJsData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_coreJsData.js */ "./node_modules/lodash-es/_coreJsData.js");
  98767. /** Used to detect methods masquerading as native. */
  98768. var maskSrcKey = (function() {
  98769. var uid = /[^.]+$/.exec(_coreJsData_js__WEBPACK_IMPORTED_MODULE_0__["default"] && _coreJsData_js__WEBPACK_IMPORTED_MODULE_0__["default"].keys && _coreJsData_js__WEBPACK_IMPORTED_MODULE_0__["default"].keys.IE_PROTO || '');
  98770. return uid ? ('Symbol(src)_1.' + uid) : '';
  98771. }());
  98772. /**
  98773. * Checks if `func` has its source masked.
  98774. *
  98775. * @private
  98776. * @param {Function} func The function to check.
  98777. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  98778. */
  98779. function isMasked(func) {
  98780. return !!maskSrcKey && (maskSrcKey in func);
  98781. }
  98782. /* harmony default export */ __webpack_exports__["default"] = (isMasked);
  98783. /***/ }),
  98784. /***/ "./node_modules/lodash-es/_isPrototype.js":
  98785. /*!************************************************!*\
  98786. !*** ./node_modules/lodash-es/_isPrototype.js ***!
  98787. \************************************************/
  98788. /*! exports provided: default */
  98789. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98790. "use strict";
  98791. __webpack_require__.r(__webpack_exports__);
  98792. /** Used for built-in method references. */
  98793. var objectProto = Object.prototype;
  98794. /**
  98795. * Checks if `value` is likely a prototype object.
  98796. *
  98797. * @private
  98798. * @param {*} value The value to check.
  98799. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  98800. */
  98801. function isPrototype(value) {
  98802. var Ctor = value && value.constructor,
  98803. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  98804. return value === proto;
  98805. }
  98806. /* harmony default export */ __webpack_exports__["default"] = (isPrototype);
  98807. /***/ }),
  98808. /***/ "./node_modules/lodash-es/_isStrictComparable.js":
  98809. /*!*******************************************************!*\
  98810. !*** ./node_modules/lodash-es/_isStrictComparable.js ***!
  98811. \*******************************************************/
  98812. /*! exports provided: default */
  98813. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98814. "use strict";
  98815. __webpack_require__.r(__webpack_exports__);
  98816. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  98817. /**
  98818. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  98819. *
  98820. * @private
  98821. * @param {*} value The value to check.
  98822. * @returns {boolean} Returns `true` if `value` if suitable for strict
  98823. * equality comparisons, else `false`.
  98824. */
  98825. function isStrictComparable(value) {
  98826. return value === value && !Object(_isObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  98827. }
  98828. /* harmony default export */ __webpack_exports__["default"] = (isStrictComparable);
  98829. /***/ }),
  98830. /***/ "./node_modules/lodash-es/_iteratorToArray.js":
  98831. /*!****************************************************!*\
  98832. !*** ./node_modules/lodash-es/_iteratorToArray.js ***!
  98833. \****************************************************/
  98834. /*! exports provided: default */
  98835. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98836. "use strict";
  98837. __webpack_require__.r(__webpack_exports__);
  98838. /**
  98839. * Converts `iterator` to an array.
  98840. *
  98841. * @private
  98842. * @param {Object} iterator The iterator to convert.
  98843. * @returns {Array} Returns the converted array.
  98844. */
  98845. function iteratorToArray(iterator) {
  98846. var data,
  98847. result = [];
  98848. while (!(data = iterator.next()).done) {
  98849. result.push(data.value);
  98850. }
  98851. return result;
  98852. }
  98853. /* harmony default export */ __webpack_exports__["default"] = (iteratorToArray);
  98854. /***/ }),
  98855. /***/ "./node_modules/lodash-es/_lazyClone.js":
  98856. /*!**********************************************!*\
  98857. !*** ./node_modules/lodash-es/_lazyClone.js ***!
  98858. \**********************************************/
  98859. /*! exports provided: default */
  98860. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98861. "use strict";
  98862. __webpack_require__.r(__webpack_exports__);
  98863. /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
  98864. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  98865. /**
  98866. * Creates a clone of the lazy wrapper object.
  98867. *
  98868. * @private
  98869. * @name clone
  98870. * @memberOf LazyWrapper
  98871. * @returns {Object} Returns the cloned `LazyWrapper` object.
  98872. */
  98873. function lazyClone() {
  98874. var result = new _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"](this.__wrapped__);
  98875. result.__actions__ = Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this.__actions__);
  98876. result.__dir__ = this.__dir__;
  98877. result.__filtered__ = this.__filtered__;
  98878. result.__iteratees__ = Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this.__iteratees__);
  98879. result.__takeCount__ = this.__takeCount__;
  98880. result.__views__ = Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this.__views__);
  98881. return result;
  98882. }
  98883. /* harmony default export */ __webpack_exports__["default"] = (lazyClone);
  98884. /***/ }),
  98885. /***/ "./node_modules/lodash-es/_lazyReverse.js":
  98886. /*!************************************************!*\
  98887. !*** ./node_modules/lodash-es/_lazyReverse.js ***!
  98888. \************************************************/
  98889. /*! exports provided: default */
  98890. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98891. "use strict";
  98892. __webpack_require__.r(__webpack_exports__);
  98893. /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
  98894. /**
  98895. * Reverses the direction of lazy iteration.
  98896. *
  98897. * @private
  98898. * @name reverse
  98899. * @memberOf LazyWrapper
  98900. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  98901. */
  98902. function lazyReverse() {
  98903. if (this.__filtered__) {
  98904. var result = new _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"](this);
  98905. result.__dir__ = -1;
  98906. result.__filtered__ = true;
  98907. } else {
  98908. result = this.clone();
  98909. result.__dir__ *= -1;
  98910. }
  98911. return result;
  98912. }
  98913. /* harmony default export */ __webpack_exports__["default"] = (lazyReverse);
  98914. /***/ }),
  98915. /***/ "./node_modules/lodash-es/_lazyValue.js":
  98916. /*!**********************************************!*\
  98917. !*** ./node_modules/lodash-es/_lazyValue.js ***!
  98918. \**********************************************/
  98919. /*! exports provided: default */
  98920. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98921. "use strict";
  98922. __webpack_require__.r(__webpack_exports__);
  98923. /* harmony import */ var _baseWrapperValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseWrapperValue.js */ "./node_modules/lodash-es/_baseWrapperValue.js");
  98924. /* harmony import */ var _getView_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getView.js */ "./node_modules/lodash-es/_getView.js");
  98925. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  98926. /** Used to indicate the type of lazy iteratees. */
  98927. var LAZY_FILTER_FLAG = 1,
  98928. LAZY_MAP_FLAG = 2;
  98929. /* Built-in method references for those with the same name as other `lodash` methods. */
  98930. var nativeMin = Math.min;
  98931. /**
  98932. * Extracts the unwrapped value from its lazy wrapper.
  98933. *
  98934. * @private
  98935. * @name value
  98936. * @memberOf LazyWrapper
  98937. * @returns {*} Returns the unwrapped value.
  98938. */
  98939. function lazyValue() {
  98940. var array = this.__wrapped__.value(),
  98941. dir = this.__dir__,
  98942. isArr = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(array),
  98943. isRight = dir < 0,
  98944. arrLength = isArr ? array.length : 0,
  98945. view = Object(_getView_js__WEBPACK_IMPORTED_MODULE_1__["default"])(0, arrLength, this.__views__),
  98946. start = view.start,
  98947. end = view.end,
  98948. length = end - start,
  98949. index = isRight ? end : (start - 1),
  98950. iteratees = this.__iteratees__,
  98951. iterLength = iteratees.length,
  98952. resIndex = 0,
  98953. takeCount = nativeMin(length, this.__takeCount__);
  98954. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  98955. return Object(_baseWrapperValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, this.__actions__);
  98956. }
  98957. var result = [];
  98958. outer:
  98959. while (length-- && resIndex < takeCount) {
  98960. index += dir;
  98961. var iterIndex = -1,
  98962. value = array[index];
  98963. while (++iterIndex < iterLength) {
  98964. var data = iteratees[iterIndex],
  98965. iteratee = data.iteratee,
  98966. type = data.type,
  98967. computed = iteratee(value);
  98968. if (type == LAZY_MAP_FLAG) {
  98969. value = computed;
  98970. } else if (!computed) {
  98971. if (type == LAZY_FILTER_FLAG) {
  98972. continue outer;
  98973. } else {
  98974. break outer;
  98975. }
  98976. }
  98977. }
  98978. result[resIndex++] = value;
  98979. }
  98980. return result;
  98981. }
  98982. /* harmony default export */ __webpack_exports__["default"] = (lazyValue);
  98983. /***/ }),
  98984. /***/ "./node_modules/lodash-es/_listCacheClear.js":
  98985. /*!***************************************************!*\
  98986. !*** ./node_modules/lodash-es/_listCacheClear.js ***!
  98987. \***************************************************/
  98988. /*! exports provided: default */
  98989. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98990. "use strict";
  98991. __webpack_require__.r(__webpack_exports__);
  98992. /**
  98993. * Removes all key-value entries from the list cache.
  98994. *
  98995. * @private
  98996. * @name clear
  98997. * @memberOf ListCache
  98998. */
  98999. function listCacheClear() {
  99000. this.__data__ = [];
  99001. this.size = 0;
  99002. }
  99003. /* harmony default export */ __webpack_exports__["default"] = (listCacheClear);
  99004. /***/ }),
  99005. /***/ "./node_modules/lodash-es/_listCacheDelete.js":
  99006. /*!****************************************************!*\
  99007. !*** ./node_modules/lodash-es/_listCacheDelete.js ***!
  99008. \****************************************************/
  99009. /*! exports provided: default */
  99010. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99011. "use strict";
  99012. __webpack_require__.r(__webpack_exports__);
  99013. /* harmony import */ var _assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assocIndexOf.js */ "./node_modules/lodash-es/_assocIndexOf.js");
  99014. /** Used for built-in method references. */
  99015. var arrayProto = Array.prototype;
  99016. /** Built-in value references. */
  99017. var splice = arrayProto.splice;
  99018. /**
  99019. * Removes `key` and its value from the list cache.
  99020. *
  99021. * @private
  99022. * @name delete
  99023. * @memberOf ListCache
  99024. * @param {string} key The key of the value to remove.
  99025. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  99026. */
  99027. function listCacheDelete(key) {
  99028. var data = this.__data__,
  99029. index = Object(_assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(data, key);
  99030. if (index < 0) {
  99031. return false;
  99032. }
  99033. var lastIndex = data.length - 1;
  99034. if (index == lastIndex) {
  99035. data.pop();
  99036. } else {
  99037. splice.call(data, index, 1);
  99038. }
  99039. --this.size;
  99040. return true;
  99041. }
  99042. /* harmony default export */ __webpack_exports__["default"] = (listCacheDelete);
  99043. /***/ }),
  99044. /***/ "./node_modules/lodash-es/_listCacheGet.js":
  99045. /*!*************************************************!*\
  99046. !*** ./node_modules/lodash-es/_listCacheGet.js ***!
  99047. \*************************************************/
  99048. /*! exports provided: default */
  99049. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99050. "use strict";
  99051. __webpack_require__.r(__webpack_exports__);
  99052. /* harmony import */ var _assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assocIndexOf.js */ "./node_modules/lodash-es/_assocIndexOf.js");
  99053. /**
  99054. * Gets the list cache value for `key`.
  99055. *
  99056. * @private
  99057. * @name get
  99058. * @memberOf ListCache
  99059. * @param {string} key The key of the value to get.
  99060. * @returns {*} Returns the entry value.
  99061. */
  99062. function listCacheGet(key) {
  99063. var data = this.__data__,
  99064. index = Object(_assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(data, key);
  99065. return index < 0 ? undefined : data[index][1];
  99066. }
  99067. /* harmony default export */ __webpack_exports__["default"] = (listCacheGet);
  99068. /***/ }),
  99069. /***/ "./node_modules/lodash-es/_listCacheHas.js":
  99070. /*!*************************************************!*\
  99071. !*** ./node_modules/lodash-es/_listCacheHas.js ***!
  99072. \*************************************************/
  99073. /*! exports provided: default */
  99074. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99075. "use strict";
  99076. __webpack_require__.r(__webpack_exports__);
  99077. /* harmony import */ var _assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assocIndexOf.js */ "./node_modules/lodash-es/_assocIndexOf.js");
  99078. /**
  99079. * Checks if a list cache value for `key` exists.
  99080. *
  99081. * @private
  99082. * @name has
  99083. * @memberOf ListCache
  99084. * @param {string} key The key of the entry to check.
  99085. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  99086. */
  99087. function listCacheHas(key) {
  99088. return Object(_assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this.__data__, key) > -1;
  99089. }
  99090. /* harmony default export */ __webpack_exports__["default"] = (listCacheHas);
  99091. /***/ }),
  99092. /***/ "./node_modules/lodash-es/_listCacheSet.js":
  99093. /*!*************************************************!*\
  99094. !*** ./node_modules/lodash-es/_listCacheSet.js ***!
  99095. \*************************************************/
  99096. /*! exports provided: default */
  99097. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99098. "use strict";
  99099. __webpack_require__.r(__webpack_exports__);
  99100. /* harmony import */ var _assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assocIndexOf.js */ "./node_modules/lodash-es/_assocIndexOf.js");
  99101. /**
  99102. * Sets the list cache `key` to `value`.
  99103. *
  99104. * @private
  99105. * @name set
  99106. * @memberOf ListCache
  99107. * @param {string} key The key of the value to set.
  99108. * @param {*} value The value to set.
  99109. * @returns {Object} Returns the list cache instance.
  99110. */
  99111. function listCacheSet(key, value) {
  99112. var data = this.__data__,
  99113. index = Object(_assocIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(data, key);
  99114. if (index < 0) {
  99115. ++this.size;
  99116. data.push([key, value]);
  99117. } else {
  99118. data[index][1] = value;
  99119. }
  99120. return this;
  99121. }
  99122. /* harmony default export */ __webpack_exports__["default"] = (listCacheSet);
  99123. /***/ }),
  99124. /***/ "./node_modules/lodash-es/_mapCacheClear.js":
  99125. /*!**************************************************!*\
  99126. !*** ./node_modules/lodash-es/_mapCacheClear.js ***!
  99127. \**************************************************/
  99128. /*! exports provided: default */
  99129. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99130. "use strict";
  99131. __webpack_require__.r(__webpack_exports__);
  99132. /* harmony import */ var _Hash_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Hash.js */ "./node_modules/lodash-es/_Hash.js");
  99133. /* harmony import */ var _ListCache_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_ListCache.js */ "./node_modules/lodash-es/_ListCache.js");
  99134. /* harmony import */ var _Map_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_Map.js */ "./node_modules/lodash-es/_Map.js");
  99135. /**
  99136. * Removes all key-value entries from the map.
  99137. *
  99138. * @private
  99139. * @name clear
  99140. * @memberOf MapCache
  99141. */
  99142. function mapCacheClear() {
  99143. this.size = 0;
  99144. this.__data__ = {
  99145. 'hash': new _Hash_js__WEBPACK_IMPORTED_MODULE_0__["default"],
  99146. 'map': new (_Map_js__WEBPACK_IMPORTED_MODULE_2__["default"] || _ListCache_js__WEBPACK_IMPORTED_MODULE_1__["default"]),
  99147. 'string': new _Hash_js__WEBPACK_IMPORTED_MODULE_0__["default"]
  99148. };
  99149. }
  99150. /* harmony default export */ __webpack_exports__["default"] = (mapCacheClear);
  99151. /***/ }),
  99152. /***/ "./node_modules/lodash-es/_mapCacheDelete.js":
  99153. /*!***************************************************!*\
  99154. !*** ./node_modules/lodash-es/_mapCacheDelete.js ***!
  99155. \***************************************************/
  99156. /*! exports provided: default */
  99157. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99158. "use strict";
  99159. __webpack_require__.r(__webpack_exports__);
  99160. /* harmony import */ var _getMapData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getMapData.js */ "./node_modules/lodash-es/_getMapData.js");
  99161. /**
  99162. * Removes `key` and its value from the map.
  99163. *
  99164. * @private
  99165. * @name delete
  99166. * @memberOf MapCache
  99167. * @param {string} key The key of the value to remove.
  99168. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  99169. */
  99170. function mapCacheDelete(key) {
  99171. var result = Object(_getMapData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, key)['delete'](key);
  99172. this.size -= result ? 1 : 0;
  99173. return result;
  99174. }
  99175. /* harmony default export */ __webpack_exports__["default"] = (mapCacheDelete);
  99176. /***/ }),
  99177. /***/ "./node_modules/lodash-es/_mapCacheGet.js":
  99178. /*!************************************************!*\
  99179. !*** ./node_modules/lodash-es/_mapCacheGet.js ***!
  99180. \************************************************/
  99181. /*! exports provided: default */
  99182. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99183. "use strict";
  99184. __webpack_require__.r(__webpack_exports__);
  99185. /* harmony import */ var _getMapData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getMapData.js */ "./node_modules/lodash-es/_getMapData.js");
  99186. /**
  99187. * Gets the map value for `key`.
  99188. *
  99189. * @private
  99190. * @name get
  99191. * @memberOf MapCache
  99192. * @param {string} key The key of the value to get.
  99193. * @returns {*} Returns the entry value.
  99194. */
  99195. function mapCacheGet(key) {
  99196. return Object(_getMapData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, key).get(key);
  99197. }
  99198. /* harmony default export */ __webpack_exports__["default"] = (mapCacheGet);
  99199. /***/ }),
  99200. /***/ "./node_modules/lodash-es/_mapCacheHas.js":
  99201. /*!************************************************!*\
  99202. !*** ./node_modules/lodash-es/_mapCacheHas.js ***!
  99203. \************************************************/
  99204. /*! exports provided: default */
  99205. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99206. "use strict";
  99207. __webpack_require__.r(__webpack_exports__);
  99208. /* harmony import */ var _getMapData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getMapData.js */ "./node_modules/lodash-es/_getMapData.js");
  99209. /**
  99210. * Checks if a map value for `key` exists.
  99211. *
  99212. * @private
  99213. * @name has
  99214. * @memberOf MapCache
  99215. * @param {string} key The key of the entry to check.
  99216. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  99217. */
  99218. function mapCacheHas(key) {
  99219. return Object(_getMapData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, key).has(key);
  99220. }
  99221. /* harmony default export */ __webpack_exports__["default"] = (mapCacheHas);
  99222. /***/ }),
  99223. /***/ "./node_modules/lodash-es/_mapCacheSet.js":
  99224. /*!************************************************!*\
  99225. !*** ./node_modules/lodash-es/_mapCacheSet.js ***!
  99226. \************************************************/
  99227. /*! exports provided: default */
  99228. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99229. "use strict";
  99230. __webpack_require__.r(__webpack_exports__);
  99231. /* harmony import */ var _getMapData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getMapData.js */ "./node_modules/lodash-es/_getMapData.js");
  99232. /**
  99233. * Sets the map `key` to `value`.
  99234. *
  99235. * @private
  99236. * @name set
  99237. * @memberOf MapCache
  99238. * @param {string} key The key of the value to set.
  99239. * @param {*} value The value to set.
  99240. * @returns {Object} Returns the map cache instance.
  99241. */
  99242. function mapCacheSet(key, value) {
  99243. var data = Object(_getMapData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, key),
  99244. size = data.size;
  99245. data.set(key, value);
  99246. this.size += data.size == size ? 0 : 1;
  99247. return this;
  99248. }
  99249. /* harmony default export */ __webpack_exports__["default"] = (mapCacheSet);
  99250. /***/ }),
  99251. /***/ "./node_modules/lodash-es/_mapToArray.js":
  99252. /*!***********************************************!*\
  99253. !*** ./node_modules/lodash-es/_mapToArray.js ***!
  99254. \***********************************************/
  99255. /*! exports provided: default */
  99256. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99257. "use strict";
  99258. __webpack_require__.r(__webpack_exports__);
  99259. /**
  99260. * Converts `map` to its key-value pairs.
  99261. *
  99262. * @private
  99263. * @param {Object} map The map to convert.
  99264. * @returns {Array} Returns the key-value pairs.
  99265. */
  99266. function mapToArray(map) {
  99267. var index = -1,
  99268. result = Array(map.size);
  99269. map.forEach(function(value, key) {
  99270. result[++index] = [key, value];
  99271. });
  99272. return result;
  99273. }
  99274. /* harmony default export */ __webpack_exports__["default"] = (mapToArray);
  99275. /***/ }),
  99276. /***/ "./node_modules/lodash-es/_matchesStrictComparable.js":
  99277. /*!************************************************************!*\
  99278. !*** ./node_modules/lodash-es/_matchesStrictComparable.js ***!
  99279. \************************************************************/
  99280. /*! exports provided: default */
  99281. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99282. "use strict";
  99283. __webpack_require__.r(__webpack_exports__);
  99284. /**
  99285. * A specialized version of `matchesProperty` for source values suitable
  99286. * for strict equality comparisons, i.e. `===`.
  99287. *
  99288. * @private
  99289. * @param {string} key The key of the property to get.
  99290. * @param {*} srcValue The value to match.
  99291. * @returns {Function} Returns the new spec function.
  99292. */
  99293. function matchesStrictComparable(key, srcValue) {
  99294. return function(object) {
  99295. if (object == null) {
  99296. return false;
  99297. }
  99298. return object[key] === srcValue &&
  99299. (srcValue !== undefined || (key in Object(object)));
  99300. };
  99301. }
  99302. /* harmony default export */ __webpack_exports__["default"] = (matchesStrictComparable);
  99303. /***/ }),
  99304. /***/ "./node_modules/lodash-es/_memoizeCapped.js":
  99305. /*!**************************************************!*\
  99306. !*** ./node_modules/lodash-es/_memoizeCapped.js ***!
  99307. \**************************************************/
  99308. /*! exports provided: default */
  99309. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99310. "use strict";
  99311. __webpack_require__.r(__webpack_exports__);
  99312. /* harmony import */ var _memoize_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./memoize.js */ "./node_modules/lodash-es/memoize.js");
  99313. /** Used as the maximum memoize cache size. */
  99314. var MAX_MEMOIZE_SIZE = 500;
  99315. /**
  99316. * A specialized version of `_.memoize` which clears the memoized function's
  99317. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  99318. *
  99319. * @private
  99320. * @param {Function} func The function to have its output memoized.
  99321. * @returns {Function} Returns the new memoized function.
  99322. */
  99323. function memoizeCapped(func) {
  99324. var result = Object(_memoize_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, function(key) {
  99325. if (cache.size === MAX_MEMOIZE_SIZE) {
  99326. cache.clear();
  99327. }
  99328. return key;
  99329. });
  99330. var cache = result.cache;
  99331. return result;
  99332. }
  99333. /* harmony default export */ __webpack_exports__["default"] = (memoizeCapped);
  99334. /***/ }),
  99335. /***/ "./node_modules/lodash-es/_mergeData.js":
  99336. /*!**********************************************!*\
  99337. !*** ./node_modules/lodash-es/_mergeData.js ***!
  99338. \**********************************************/
  99339. /*! exports provided: default */
  99340. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99341. "use strict";
  99342. __webpack_require__.r(__webpack_exports__);
  99343. /* harmony import */ var _composeArgs_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_composeArgs.js */ "./node_modules/lodash-es/_composeArgs.js");
  99344. /* harmony import */ var _composeArgsRight_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_composeArgsRight.js */ "./node_modules/lodash-es/_composeArgsRight.js");
  99345. /* harmony import */ var _replaceHolders_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_replaceHolders.js */ "./node_modules/lodash-es/_replaceHolders.js");
  99346. /** Used as the internal argument placeholder. */
  99347. var PLACEHOLDER = '__lodash_placeholder__';
  99348. /** Used to compose bitmasks for function metadata. */
  99349. var WRAP_BIND_FLAG = 1,
  99350. WRAP_BIND_KEY_FLAG = 2,
  99351. WRAP_CURRY_BOUND_FLAG = 4,
  99352. WRAP_CURRY_FLAG = 8,
  99353. WRAP_ARY_FLAG = 128,
  99354. WRAP_REARG_FLAG = 256;
  99355. /* Built-in method references for those with the same name as other `lodash` methods. */
  99356. var nativeMin = Math.min;
  99357. /**
  99358. * Merges the function metadata of `source` into `data`.
  99359. *
  99360. * Merging metadata reduces the number of wrappers used to invoke a function.
  99361. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  99362. * may be applied regardless of execution order. Methods like `_.ary` and
  99363. * `_.rearg` modify function arguments, making the order in which they are
  99364. * executed important, preventing the merging of metadata. However, we make
  99365. * an exception for a safe combined case where curried functions have `_.ary`
  99366. * and or `_.rearg` applied.
  99367. *
  99368. * @private
  99369. * @param {Array} data The destination metadata.
  99370. * @param {Array} source The source metadata.
  99371. * @returns {Array} Returns `data`.
  99372. */
  99373. function mergeData(data, source) {
  99374. var bitmask = data[1],
  99375. srcBitmask = source[1],
  99376. newBitmask = bitmask | srcBitmask,
  99377. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  99378. var isCombo =
  99379. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  99380. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  99381. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  99382. // Exit early if metadata can't be merged.
  99383. if (!(isCommon || isCombo)) {
  99384. return data;
  99385. }
  99386. // Use source `thisArg` if available.
  99387. if (srcBitmask & WRAP_BIND_FLAG) {
  99388. data[2] = source[2];
  99389. // Set when currying a bound function.
  99390. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  99391. }
  99392. // Compose partial arguments.
  99393. var value = source[3];
  99394. if (value) {
  99395. var partials = data[3];
  99396. data[3] = partials ? Object(_composeArgs_js__WEBPACK_IMPORTED_MODULE_0__["default"])(partials, value, source[4]) : value;
  99397. data[4] = partials ? Object(_replaceHolders_js__WEBPACK_IMPORTED_MODULE_2__["default"])(data[3], PLACEHOLDER) : source[4];
  99398. }
  99399. // Compose partial right arguments.
  99400. value = source[5];
  99401. if (value) {
  99402. partials = data[5];
  99403. data[5] = partials ? Object(_composeArgsRight_js__WEBPACK_IMPORTED_MODULE_1__["default"])(partials, value, source[6]) : value;
  99404. data[6] = partials ? Object(_replaceHolders_js__WEBPACK_IMPORTED_MODULE_2__["default"])(data[5], PLACEHOLDER) : source[6];
  99405. }
  99406. // Use source `argPos` if available.
  99407. value = source[7];
  99408. if (value) {
  99409. data[7] = value;
  99410. }
  99411. // Use source `ary` if it's smaller.
  99412. if (srcBitmask & WRAP_ARY_FLAG) {
  99413. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  99414. }
  99415. // Use source `arity` if one is not provided.
  99416. if (data[9] == null) {
  99417. data[9] = source[9];
  99418. }
  99419. // Use source `func` and merge bitmasks.
  99420. data[0] = source[0];
  99421. data[1] = newBitmask;
  99422. return data;
  99423. }
  99424. /* harmony default export */ __webpack_exports__["default"] = (mergeData);
  99425. /***/ }),
  99426. /***/ "./node_modules/lodash-es/_metaMap.js":
  99427. /*!********************************************!*\
  99428. !*** ./node_modules/lodash-es/_metaMap.js ***!
  99429. \********************************************/
  99430. /*! exports provided: default */
  99431. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99432. "use strict";
  99433. __webpack_require__.r(__webpack_exports__);
  99434. /* harmony import */ var _WeakMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_WeakMap.js */ "./node_modules/lodash-es/_WeakMap.js");
  99435. /** Used to store function metadata. */
  99436. var metaMap = _WeakMap_js__WEBPACK_IMPORTED_MODULE_0__["default"] && new _WeakMap_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  99437. /* harmony default export */ __webpack_exports__["default"] = (metaMap);
  99438. /***/ }),
  99439. /***/ "./node_modules/lodash-es/_nativeCreate.js":
  99440. /*!*************************************************!*\
  99441. !*** ./node_modules/lodash-es/_nativeCreate.js ***!
  99442. \*************************************************/
  99443. /*! exports provided: default */
  99444. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99445. "use strict";
  99446. __webpack_require__.r(__webpack_exports__);
  99447. /* harmony import */ var _getNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getNative.js */ "./node_modules/lodash-es/_getNative.js");
  99448. /* Built-in method references that are verified to be native. */
  99449. var nativeCreate = Object(_getNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object, 'create');
  99450. /* harmony default export */ __webpack_exports__["default"] = (nativeCreate);
  99451. /***/ }),
  99452. /***/ "./node_modules/lodash-es/_nativeKeys.js":
  99453. /*!***********************************************!*\
  99454. !*** ./node_modules/lodash-es/_nativeKeys.js ***!
  99455. \***********************************************/
  99456. /*! exports provided: default */
  99457. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99458. "use strict";
  99459. __webpack_require__.r(__webpack_exports__);
  99460. /* harmony import */ var _overArg_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_overArg.js */ "./node_modules/lodash-es/_overArg.js");
  99461. /* Built-in method references for those with the same name as other `lodash` methods. */
  99462. var nativeKeys = Object(_overArg_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object.keys, Object);
  99463. /* harmony default export */ __webpack_exports__["default"] = (nativeKeys);
  99464. /***/ }),
  99465. /***/ "./node_modules/lodash-es/_nativeKeysIn.js":
  99466. /*!*************************************************!*\
  99467. !*** ./node_modules/lodash-es/_nativeKeysIn.js ***!
  99468. \*************************************************/
  99469. /*! exports provided: default */
  99470. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99471. "use strict";
  99472. __webpack_require__.r(__webpack_exports__);
  99473. /**
  99474. * This function is like
  99475. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  99476. * except that it includes inherited enumerable properties.
  99477. *
  99478. * @private
  99479. * @param {Object} object The object to query.
  99480. * @returns {Array} Returns the array of property names.
  99481. */
  99482. function nativeKeysIn(object) {
  99483. var result = [];
  99484. if (object != null) {
  99485. for (var key in Object(object)) {
  99486. result.push(key);
  99487. }
  99488. }
  99489. return result;
  99490. }
  99491. /* harmony default export */ __webpack_exports__["default"] = (nativeKeysIn);
  99492. /***/ }),
  99493. /***/ "./node_modules/lodash-es/_nodeUtil.js":
  99494. /*!*********************************************!*\
  99495. !*** ./node_modules/lodash-es/_nodeUtil.js ***!
  99496. \*********************************************/
  99497. /*! exports provided: default */
  99498. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99499. "use strict";
  99500. __webpack_require__.r(__webpack_exports__);
  99501. /* WEBPACK VAR INJECTION */(function(module) {/* harmony import */ var _freeGlobal_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_freeGlobal.js */ "./node_modules/lodash-es/_freeGlobal.js");
  99502. /** Detect free variable `exports`. */
  99503. var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
  99504. /** Detect free variable `module`. */
  99505. var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
  99506. /** Detect the popular CommonJS extension `module.exports`. */
  99507. var moduleExports = freeModule && freeModule.exports === freeExports;
  99508. /** Detect free variable `process` from Node.js. */
  99509. var freeProcess = moduleExports && _freeGlobal_js__WEBPACK_IMPORTED_MODULE_0__["default"].process;
  99510. /** Used to access faster Node.js helpers. */
  99511. var nodeUtil = (function() {
  99512. try {
  99513. // Use `util.types` for Node.js 10+.
  99514. var types = freeModule && freeModule.require && freeModule.require('util').types;
  99515. if (types) {
  99516. return types;
  99517. }
  99518. // Legacy `process.binding('util')` for Node.js < 10.
  99519. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  99520. } catch (e) {}
  99521. }());
  99522. /* harmony default export */ __webpack_exports__["default"] = (nodeUtil);
  99523. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/harmony-module.js */ "./node_modules/webpack/buildin/harmony-module.js")(module)))
  99524. /***/ }),
  99525. /***/ "./node_modules/lodash-es/_objectToString.js":
  99526. /*!***************************************************!*\
  99527. !*** ./node_modules/lodash-es/_objectToString.js ***!
  99528. \***************************************************/
  99529. /*! exports provided: default */
  99530. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99531. "use strict";
  99532. __webpack_require__.r(__webpack_exports__);
  99533. /** Used for built-in method references. */
  99534. var objectProto = Object.prototype;
  99535. /**
  99536. * Used to resolve the
  99537. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  99538. * of values.
  99539. */
  99540. var nativeObjectToString = objectProto.toString;
  99541. /**
  99542. * Converts `value` to a string using `Object.prototype.toString`.
  99543. *
  99544. * @private
  99545. * @param {*} value The value to convert.
  99546. * @returns {string} Returns the converted string.
  99547. */
  99548. function objectToString(value) {
  99549. return nativeObjectToString.call(value);
  99550. }
  99551. /* harmony default export */ __webpack_exports__["default"] = (objectToString);
  99552. /***/ }),
  99553. /***/ "./node_modules/lodash-es/_overArg.js":
  99554. /*!********************************************!*\
  99555. !*** ./node_modules/lodash-es/_overArg.js ***!
  99556. \********************************************/
  99557. /*! exports provided: default */
  99558. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99559. "use strict";
  99560. __webpack_require__.r(__webpack_exports__);
  99561. /**
  99562. * Creates a unary function that invokes `func` with its argument transformed.
  99563. *
  99564. * @private
  99565. * @param {Function} func The function to wrap.
  99566. * @param {Function} transform The argument transform.
  99567. * @returns {Function} Returns the new function.
  99568. */
  99569. function overArg(func, transform) {
  99570. return function(arg) {
  99571. return func(transform(arg));
  99572. };
  99573. }
  99574. /* harmony default export */ __webpack_exports__["default"] = (overArg);
  99575. /***/ }),
  99576. /***/ "./node_modules/lodash-es/_overRest.js":
  99577. /*!*********************************************!*\
  99578. !*** ./node_modules/lodash-es/_overRest.js ***!
  99579. \*********************************************/
  99580. /*! exports provided: default */
  99581. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99582. "use strict";
  99583. __webpack_require__.r(__webpack_exports__);
  99584. /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  99585. /* Built-in method references for those with the same name as other `lodash` methods. */
  99586. var nativeMax = Math.max;
  99587. /**
  99588. * A specialized version of `baseRest` which transforms the rest array.
  99589. *
  99590. * @private
  99591. * @param {Function} func The function to apply a rest parameter to.
  99592. * @param {number} [start=func.length-1] The start position of the rest parameter.
  99593. * @param {Function} transform The rest array transform.
  99594. * @returns {Function} Returns the new function.
  99595. */
  99596. function overRest(func, start, transform) {
  99597. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  99598. return function() {
  99599. var args = arguments,
  99600. index = -1,
  99601. length = nativeMax(args.length - start, 0),
  99602. array = Array(length);
  99603. while (++index < length) {
  99604. array[index] = args[start + index];
  99605. }
  99606. index = -1;
  99607. var otherArgs = Array(start + 1);
  99608. while (++index < start) {
  99609. otherArgs[index] = args[index];
  99610. }
  99611. otherArgs[start] = transform(array);
  99612. return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, this, otherArgs);
  99613. };
  99614. }
  99615. /* harmony default export */ __webpack_exports__["default"] = (overRest);
  99616. /***/ }),
  99617. /***/ "./node_modules/lodash-es/_parent.js":
  99618. /*!*******************************************!*\
  99619. !*** ./node_modules/lodash-es/_parent.js ***!
  99620. \*******************************************/
  99621. /*! exports provided: default */
  99622. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99623. "use strict";
  99624. __webpack_require__.r(__webpack_exports__);
  99625. /* harmony import */ var _baseGet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGet.js */ "./node_modules/lodash-es/_baseGet.js");
  99626. /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
  99627. /**
  99628. * Gets the parent value at `path` of `object`.
  99629. *
  99630. * @private
  99631. * @param {Object} object The object to query.
  99632. * @param {Array} path The path to get the parent value of.
  99633. * @returns {*} Returns the parent value.
  99634. */
  99635. function parent(object, path) {
  99636. return path.length < 2 ? object : Object(_baseGet_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_1__["default"])(path, 0, -1));
  99637. }
  99638. /* harmony default export */ __webpack_exports__["default"] = (parent);
  99639. /***/ }),
  99640. /***/ "./node_modules/lodash-es/_reEscape.js":
  99641. /*!*********************************************!*\
  99642. !*** ./node_modules/lodash-es/_reEscape.js ***!
  99643. \*********************************************/
  99644. /*! exports provided: default */
  99645. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99646. "use strict";
  99647. __webpack_require__.r(__webpack_exports__);
  99648. /** Used to match template delimiters. */
  99649. var reEscape = /<%-([\s\S]+?)%>/g;
  99650. /* harmony default export */ __webpack_exports__["default"] = (reEscape);
  99651. /***/ }),
  99652. /***/ "./node_modules/lodash-es/_reEvaluate.js":
  99653. /*!***********************************************!*\
  99654. !*** ./node_modules/lodash-es/_reEvaluate.js ***!
  99655. \***********************************************/
  99656. /*! exports provided: default */
  99657. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99658. "use strict";
  99659. __webpack_require__.r(__webpack_exports__);
  99660. /** Used to match template delimiters. */
  99661. var reEvaluate = /<%([\s\S]+?)%>/g;
  99662. /* harmony default export */ __webpack_exports__["default"] = (reEvaluate);
  99663. /***/ }),
  99664. /***/ "./node_modules/lodash-es/_reInterpolate.js":
  99665. /*!**************************************************!*\
  99666. !*** ./node_modules/lodash-es/_reInterpolate.js ***!
  99667. \**************************************************/
  99668. /*! exports provided: default */
  99669. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99670. "use strict";
  99671. __webpack_require__.r(__webpack_exports__);
  99672. /** Used to match template delimiters. */
  99673. var reInterpolate = /<%=([\s\S]+?)%>/g;
  99674. /* harmony default export */ __webpack_exports__["default"] = (reInterpolate);
  99675. /***/ }),
  99676. /***/ "./node_modules/lodash-es/_realNames.js":
  99677. /*!**********************************************!*\
  99678. !*** ./node_modules/lodash-es/_realNames.js ***!
  99679. \**********************************************/
  99680. /*! exports provided: default */
  99681. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99682. "use strict";
  99683. __webpack_require__.r(__webpack_exports__);
  99684. /** Used to lookup unminified function names. */
  99685. var realNames = {};
  99686. /* harmony default export */ __webpack_exports__["default"] = (realNames);
  99687. /***/ }),
  99688. /***/ "./node_modules/lodash-es/_reorder.js":
  99689. /*!********************************************!*\
  99690. !*** ./node_modules/lodash-es/_reorder.js ***!
  99691. \********************************************/
  99692. /*! exports provided: default */
  99693. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99694. "use strict";
  99695. __webpack_require__.r(__webpack_exports__);
  99696. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  99697. /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
  99698. /* Built-in method references for those with the same name as other `lodash` methods. */
  99699. var nativeMin = Math.min;
  99700. /**
  99701. * Reorder `array` according to the specified indexes where the element at
  99702. * the first index is assigned as the first element, the element at
  99703. * the second index is assigned as the second element, and so on.
  99704. *
  99705. * @private
  99706. * @param {Array} array The array to reorder.
  99707. * @param {Array} indexes The arranged array indexes.
  99708. * @returns {Array} Returns `array`.
  99709. */
  99710. function reorder(array, indexes) {
  99711. var arrLength = array.length,
  99712. length = nativeMin(indexes.length, arrLength),
  99713. oldArray = Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array);
  99714. while (length--) {
  99715. var index = indexes[length];
  99716. array[length] = Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_1__["default"])(index, arrLength) ? oldArray[index] : undefined;
  99717. }
  99718. return array;
  99719. }
  99720. /* harmony default export */ __webpack_exports__["default"] = (reorder);
  99721. /***/ }),
  99722. /***/ "./node_modules/lodash-es/_replaceHolders.js":
  99723. /*!***************************************************!*\
  99724. !*** ./node_modules/lodash-es/_replaceHolders.js ***!
  99725. \***************************************************/
  99726. /*! exports provided: default */
  99727. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99728. "use strict";
  99729. __webpack_require__.r(__webpack_exports__);
  99730. /** Used as the internal argument placeholder. */
  99731. var PLACEHOLDER = '__lodash_placeholder__';
  99732. /**
  99733. * Replaces all `placeholder` elements in `array` with an internal placeholder
  99734. * and returns an array of their indexes.
  99735. *
  99736. * @private
  99737. * @param {Array} array The array to modify.
  99738. * @param {*} placeholder The placeholder to replace.
  99739. * @returns {Array} Returns the new array of placeholder indexes.
  99740. */
  99741. function replaceHolders(array, placeholder) {
  99742. var index = -1,
  99743. length = array.length,
  99744. resIndex = 0,
  99745. result = [];
  99746. while (++index < length) {
  99747. var value = array[index];
  99748. if (value === placeholder || value === PLACEHOLDER) {
  99749. array[index] = PLACEHOLDER;
  99750. result[resIndex++] = index;
  99751. }
  99752. }
  99753. return result;
  99754. }
  99755. /* harmony default export */ __webpack_exports__["default"] = (replaceHolders);
  99756. /***/ }),
  99757. /***/ "./node_modules/lodash-es/_root.js":
  99758. /*!*****************************************!*\
  99759. !*** ./node_modules/lodash-es/_root.js ***!
  99760. \*****************************************/
  99761. /*! exports provided: default */
  99762. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99763. "use strict";
  99764. __webpack_require__.r(__webpack_exports__);
  99765. /* harmony import */ var _freeGlobal_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_freeGlobal.js */ "./node_modules/lodash-es/_freeGlobal.js");
  99766. /** Detect free variable `self`. */
  99767. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  99768. /** Used as a reference to the global object. */
  99769. var root = _freeGlobal_js__WEBPACK_IMPORTED_MODULE_0__["default"] || freeSelf || Function('return this')();
  99770. /* harmony default export */ __webpack_exports__["default"] = (root);
  99771. /***/ }),
  99772. /***/ "./node_modules/lodash-es/_safeGet.js":
  99773. /*!********************************************!*\
  99774. !*** ./node_modules/lodash-es/_safeGet.js ***!
  99775. \********************************************/
  99776. /*! exports provided: default */
  99777. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99778. "use strict";
  99779. __webpack_require__.r(__webpack_exports__);
  99780. /**
  99781. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  99782. *
  99783. * @private
  99784. * @param {Object} object The object to query.
  99785. * @param {string} key The key of the property to get.
  99786. * @returns {*} Returns the property value.
  99787. */
  99788. function safeGet(object, key) {
  99789. if (key === 'constructor' && typeof object[key] === 'function') {
  99790. return;
  99791. }
  99792. if (key == '__proto__') {
  99793. return;
  99794. }
  99795. return object[key];
  99796. }
  99797. /* harmony default export */ __webpack_exports__["default"] = (safeGet);
  99798. /***/ }),
  99799. /***/ "./node_modules/lodash-es/_setCacheAdd.js":
  99800. /*!************************************************!*\
  99801. !*** ./node_modules/lodash-es/_setCacheAdd.js ***!
  99802. \************************************************/
  99803. /*! exports provided: default */
  99804. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99805. "use strict";
  99806. __webpack_require__.r(__webpack_exports__);
  99807. /** Used to stand-in for `undefined` hash values. */
  99808. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  99809. /**
  99810. * Adds `value` to the array cache.
  99811. *
  99812. * @private
  99813. * @name add
  99814. * @memberOf SetCache
  99815. * @alias push
  99816. * @param {*} value The value to cache.
  99817. * @returns {Object} Returns the cache instance.
  99818. */
  99819. function setCacheAdd(value) {
  99820. this.__data__.set(value, HASH_UNDEFINED);
  99821. return this;
  99822. }
  99823. /* harmony default export */ __webpack_exports__["default"] = (setCacheAdd);
  99824. /***/ }),
  99825. /***/ "./node_modules/lodash-es/_setCacheHas.js":
  99826. /*!************************************************!*\
  99827. !*** ./node_modules/lodash-es/_setCacheHas.js ***!
  99828. \************************************************/
  99829. /*! exports provided: default */
  99830. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99831. "use strict";
  99832. __webpack_require__.r(__webpack_exports__);
  99833. /**
  99834. * Checks if `value` is in the array cache.
  99835. *
  99836. * @private
  99837. * @name has
  99838. * @memberOf SetCache
  99839. * @param {*} value The value to search for.
  99840. * @returns {number} Returns `true` if `value` is found, else `false`.
  99841. */
  99842. function setCacheHas(value) {
  99843. return this.__data__.has(value);
  99844. }
  99845. /* harmony default export */ __webpack_exports__["default"] = (setCacheHas);
  99846. /***/ }),
  99847. /***/ "./node_modules/lodash-es/_setData.js":
  99848. /*!********************************************!*\
  99849. !*** ./node_modules/lodash-es/_setData.js ***!
  99850. \********************************************/
  99851. /*! exports provided: default */
  99852. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99853. "use strict";
  99854. __webpack_require__.r(__webpack_exports__);
  99855. /* harmony import */ var _baseSetData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSetData.js */ "./node_modules/lodash-es/_baseSetData.js");
  99856. /* harmony import */ var _shortOut_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_shortOut.js */ "./node_modules/lodash-es/_shortOut.js");
  99857. /**
  99858. * Sets metadata for `func`.
  99859. *
  99860. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  99861. * period of time, it will trip its breaker and transition to an identity
  99862. * function to avoid garbage collection pauses in V8. See
  99863. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  99864. * for more details.
  99865. *
  99866. * @private
  99867. * @param {Function} func The function to associate metadata with.
  99868. * @param {*} data The metadata.
  99869. * @returns {Function} Returns `func`.
  99870. */
  99871. var setData = Object(_shortOut_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_baseSetData_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  99872. /* harmony default export */ __webpack_exports__["default"] = (setData);
  99873. /***/ }),
  99874. /***/ "./node_modules/lodash-es/_setToArray.js":
  99875. /*!***********************************************!*\
  99876. !*** ./node_modules/lodash-es/_setToArray.js ***!
  99877. \***********************************************/
  99878. /*! exports provided: default */
  99879. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99880. "use strict";
  99881. __webpack_require__.r(__webpack_exports__);
  99882. /**
  99883. * Converts `set` to an array of its values.
  99884. *
  99885. * @private
  99886. * @param {Object} set The set to convert.
  99887. * @returns {Array} Returns the values.
  99888. */
  99889. function setToArray(set) {
  99890. var index = -1,
  99891. result = Array(set.size);
  99892. set.forEach(function(value) {
  99893. result[++index] = value;
  99894. });
  99895. return result;
  99896. }
  99897. /* harmony default export */ __webpack_exports__["default"] = (setToArray);
  99898. /***/ }),
  99899. /***/ "./node_modules/lodash-es/_setToPairs.js":
  99900. /*!***********************************************!*\
  99901. !*** ./node_modules/lodash-es/_setToPairs.js ***!
  99902. \***********************************************/
  99903. /*! exports provided: default */
  99904. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99905. "use strict";
  99906. __webpack_require__.r(__webpack_exports__);
  99907. /**
  99908. * Converts `set` to its value-value pairs.
  99909. *
  99910. * @private
  99911. * @param {Object} set The set to convert.
  99912. * @returns {Array} Returns the value-value pairs.
  99913. */
  99914. function setToPairs(set) {
  99915. var index = -1,
  99916. result = Array(set.size);
  99917. set.forEach(function(value) {
  99918. result[++index] = [value, value];
  99919. });
  99920. return result;
  99921. }
  99922. /* harmony default export */ __webpack_exports__["default"] = (setToPairs);
  99923. /***/ }),
  99924. /***/ "./node_modules/lodash-es/_setToString.js":
  99925. /*!************************************************!*\
  99926. !*** ./node_modules/lodash-es/_setToString.js ***!
  99927. \************************************************/
  99928. /*! exports provided: default */
  99929. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99930. "use strict";
  99931. __webpack_require__.r(__webpack_exports__);
  99932. /* harmony import */ var _baseSetToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSetToString.js */ "./node_modules/lodash-es/_baseSetToString.js");
  99933. /* harmony import */ var _shortOut_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_shortOut.js */ "./node_modules/lodash-es/_shortOut.js");
  99934. /**
  99935. * Sets the `toString` method of `func` to return `string`.
  99936. *
  99937. * @private
  99938. * @param {Function} func The function to modify.
  99939. * @param {Function} string The `toString` result.
  99940. * @returns {Function} Returns `func`.
  99941. */
  99942. var setToString = Object(_shortOut_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_baseSetToString_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  99943. /* harmony default export */ __webpack_exports__["default"] = (setToString);
  99944. /***/ }),
  99945. /***/ "./node_modules/lodash-es/_setWrapToString.js":
  99946. /*!****************************************************!*\
  99947. !*** ./node_modules/lodash-es/_setWrapToString.js ***!
  99948. \****************************************************/
  99949. /*! exports provided: default */
  99950. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99951. "use strict";
  99952. __webpack_require__.r(__webpack_exports__);
  99953. /* harmony import */ var _getWrapDetails_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getWrapDetails.js */ "./node_modules/lodash-es/_getWrapDetails.js");
  99954. /* harmony import */ var _insertWrapDetails_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_insertWrapDetails.js */ "./node_modules/lodash-es/_insertWrapDetails.js");
  99955. /* harmony import */ var _setToString_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_setToString.js */ "./node_modules/lodash-es/_setToString.js");
  99956. /* harmony import */ var _updateWrapDetails_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_updateWrapDetails.js */ "./node_modules/lodash-es/_updateWrapDetails.js");
  99957. /**
  99958. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  99959. * with wrapper details in a comment at the top of the source body.
  99960. *
  99961. * @private
  99962. * @param {Function} wrapper The function to modify.
  99963. * @param {Function} reference The reference function.
  99964. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  99965. * @returns {Function} Returns `wrapper`.
  99966. */
  99967. function setWrapToString(wrapper, reference, bitmask) {
  99968. var source = (reference + '');
  99969. return Object(_setToString_js__WEBPACK_IMPORTED_MODULE_2__["default"])(wrapper, Object(_insertWrapDetails_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source, Object(_updateWrapDetails_js__WEBPACK_IMPORTED_MODULE_3__["default"])(Object(_getWrapDetails_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source), bitmask)));
  99970. }
  99971. /* harmony default export */ __webpack_exports__["default"] = (setWrapToString);
  99972. /***/ }),
  99973. /***/ "./node_modules/lodash-es/_shortOut.js":
  99974. /*!*********************************************!*\
  99975. !*** ./node_modules/lodash-es/_shortOut.js ***!
  99976. \*********************************************/
  99977. /*! exports provided: default */
  99978. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99979. "use strict";
  99980. __webpack_require__.r(__webpack_exports__);
  99981. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  99982. var HOT_COUNT = 800,
  99983. HOT_SPAN = 16;
  99984. /* Built-in method references for those with the same name as other `lodash` methods. */
  99985. var nativeNow = Date.now;
  99986. /**
  99987. * Creates a function that'll short out and invoke `identity` instead
  99988. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  99989. * milliseconds.
  99990. *
  99991. * @private
  99992. * @param {Function} func The function to restrict.
  99993. * @returns {Function} Returns the new shortable function.
  99994. */
  99995. function shortOut(func) {
  99996. var count = 0,
  99997. lastCalled = 0;
  99998. return function() {
  99999. var stamp = nativeNow(),
  100000. remaining = HOT_SPAN - (stamp - lastCalled);
  100001. lastCalled = stamp;
  100002. if (remaining > 0) {
  100003. if (++count >= HOT_COUNT) {
  100004. return arguments[0];
  100005. }
  100006. } else {
  100007. count = 0;
  100008. }
  100009. return func.apply(undefined, arguments);
  100010. };
  100011. }
  100012. /* harmony default export */ __webpack_exports__["default"] = (shortOut);
  100013. /***/ }),
  100014. /***/ "./node_modules/lodash-es/_shuffleSelf.js":
  100015. /*!************************************************!*\
  100016. !*** ./node_modules/lodash-es/_shuffleSelf.js ***!
  100017. \************************************************/
  100018. /*! exports provided: default */
  100019. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100020. "use strict";
  100021. __webpack_require__.r(__webpack_exports__);
  100022. /* harmony import */ var _baseRandom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRandom.js */ "./node_modules/lodash-es/_baseRandom.js");
  100023. /**
  100024. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  100025. *
  100026. * @private
  100027. * @param {Array} array The array to shuffle.
  100028. * @param {number} [size=array.length] The size of `array`.
  100029. * @returns {Array} Returns `array`.
  100030. */
  100031. function shuffleSelf(array, size) {
  100032. var index = -1,
  100033. length = array.length,
  100034. lastIndex = length - 1;
  100035. size = size === undefined ? length : size;
  100036. while (++index < size) {
  100037. var rand = Object(_baseRandom_js__WEBPACK_IMPORTED_MODULE_0__["default"])(index, lastIndex),
  100038. value = array[rand];
  100039. array[rand] = array[index];
  100040. array[index] = value;
  100041. }
  100042. array.length = size;
  100043. return array;
  100044. }
  100045. /* harmony default export */ __webpack_exports__["default"] = (shuffleSelf);
  100046. /***/ }),
  100047. /***/ "./node_modules/lodash-es/_stackClear.js":
  100048. /*!***********************************************!*\
  100049. !*** ./node_modules/lodash-es/_stackClear.js ***!
  100050. \***********************************************/
  100051. /*! exports provided: default */
  100052. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100053. "use strict";
  100054. __webpack_require__.r(__webpack_exports__);
  100055. /* harmony import */ var _ListCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_ListCache.js */ "./node_modules/lodash-es/_ListCache.js");
  100056. /**
  100057. * Removes all key-value entries from the stack.
  100058. *
  100059. * @private
  100060. * @name clear
  100061. * @memberOf Stack
  100062. */
  100063. function stackClear() {
  100064. this.__data__ = new _ListCache_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  100065. this.size = 0;
  100066. }
  100067. /* harmony default export */ __webpack_exports__["default"] = (stackClear);
  100068. /***/ }),
  100069. /***/ "./node_modules/lodash-es/_stackDelete.js":
  100070. /*!************************************************!*\
  100071. !*** ./node_modules/lodash-es/_stackDelete.js ***!
  100072. \************************************************/
  100073. /*! exports provided: default */
  100074. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100075. "use strict";
  100076. __webpack_require__.r(__webpack_exports__);
  100077. /**
  100078. * Removes `key` and its value from the stack.
  100079. *
  100080. * @private
  100081. * @name delete
  100082. * @memberOf Stack
  100083. * @param {string} key The key of the value to remove.
  100084. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  100085. */
  100086. function stackDelete(key) {
  100087. var data = this.__data__,
  100088. result = data['delete'](key);
  100089. this.size = data.size;
  100090. return result;
  100091. }
  100092. /* harmony default export */ __webpack_exports__["default"] = (stackDelete);
  100093. /***/ }),
  100094. /***/ "./node_modules/lodash-es/_stackGet.js":
  100095. /*!*********************************************!*\
  100096. !*** ./node_modules/lodash-es/_stackGet.js ***!
  100097. \*********************************************/
  100098. /*! exports provided: default */
  100099. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100100. "use strict";
  100101. __webpack_require__.r(__webpack_exports__);
  100102. /**
  100103. * Gets the stack value for `key`.
  100104. *
  100105. * @private
  100106. * @name get
  100107. * @memberOf Stack
  100108. * @param {string} key The key of the value to get.
  100109. * @returns {*} Returns the entry value.
  100110. */
  100111. function stackGet(key) {
  100112. return this.__data__.get(key);
  100113. }
  100114. /* harmony default export */ __webpack_exports__["default"] = (stackGet);
  100115. /***/ }),
  100116. /***/ "./node_modules/lodash-es/_stackHas.js":
  100117. /*!*********************************************!*\
  100118. !*** ./node_modules/lodash-es/_stackHas.js ***!
  100119. \*********************************************/
  100120. /*! exports provided: default */
  100121. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100122. "use strict";
  100123. __webpack_require__.r(__webpack_exports__);
  100124. /**
  100125. * Checks if a stack value for `key` exists.
  100126. *
  100127. * @private
  100128. * @name has
  100129. * @memberOf Stack
  100130. * @param {string} key The key of the entry to check.
  100131. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  100132. */
  100133. function stackHas(key) {
  100134. return this.__data__.has(key);
  100135. }
  100136. /* harmony default export */ __webpack_exports__["default"] = (stackHas);
  100137. /***/ }),
  100138. /***/ "./node_modules/lodash-es/_stackSet.js":
  100139. /*!*********************************************!*\
  100140. !*** ./node_modules/lodash-es/_stackSet.js ***!
  100141. \*********************************************/
  100142. /*! exports provided: default */
  100143. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100144. "use strict";
  100145. __webpack_require__.r(__webpack_exports__);
  100146. /* harmony import */ var _ListCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_ListCache.js */ "./node_modules/lodash-es/_ListCache.js");
  100147. /* harmony import */ var _Map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_Map.js */ "./node_modules/lodash-es/_Map.js");
  100148. /* harmony import */ var _MapCache_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_MapCache.js */ "./node_modules/lodash-es/_MapCache.js");
  100149. /** Used as the size to enable large array optimizations. */
  100150. var LARGE_ARRAY_SIZE = 200;
  100151. /**
  100152. * Sets the stack `key` to `value`.
  100153. *
  100154. * @private
  100155. * @name set
  100156. * @memberOf Stack
  100157. * @param {string} key The key of the value to set.
  100158. * @param {*} value The value to set.
  100159. * @returns {Object} Returns the stack cache instance.
  100160. */
  100161. function stackSet(key, value) {
  100162. var data = this.__data__;
  100163. if (data instanceof _ListCache_js__WEBPACK_IMPORTED_MODULE_0__["default"]) {
  100164. var pairs = data.__data__;
  100165. if (!_Map_js__WEBPACK_IMPORTED_MODULE_1__["default"] || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  100166. pairs.push([key, value]);
  100167. this.size = ++data.size;
  100168. return this;
  100169. }
  100170. data = this.__data__ = new _MapCache_js__WEBPACK_IMPORTED_MODULE_2__["default"](pairs);
  100171. }
  100172. data.set(key, value);
  100173. this.size = data.size;
  100174. return this;
  100175. }
  100176. /* harmony default export */ __webpack_exports__["default"] = (stackSet);
  100177. /***/ }),
  100178. /***/ "./node_modules/lodash-es/_strictIndexOf.js":
  100179. /*!**************************************************!*\
  100180. !*** ./node_modules/lodash-es/_strictIndexOf.js ***!
  100181. \**************************************************/
  100182. /*! exports provided: default */
  100183. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100184. "use strict";
  100185. __webpack_require__.r(__webpack_exports__);
  100186. /**
  100187. * A specialized version of `_.indexOf` which performs strict equality
  100188. * comparisons of values, i.e. `===`.
  100189. *
  100190. * @private
  100191. * @param {Array} array The array to inspect.
  100192. * @param {*} value The value to search for.
  100193. * @param {number} fromIndex The index to search from.
  100194. * @returns {number} Returns the index of the matched value, else `-1`.
  100195. */
  100196. function strictIndexOf(array, value, fromIndex) {
  100197. var index = fromIndex - 1,
  100198. length = array.length;
  100199. while (++index < length) {
  100200. if (array[index] === value) {
  100201. return index;
  100202. }
  100203. }
  100204. return -1;
  100205. }
  100206. /* harmony default export */ __webpack_exports__["default"] = (strictIndexOf);
  100207. /***/ }),
  100208. /***/ "./node_modules/lodash-es/_strictLastIndexOf.js":
  100209. /*!******************************************************!*\
  100210. !*** ./node_modules/lodash-es/_strictLastIndexOf.js ***!
  100211. \******************************************************/
  100212. /*! exports provided: default */
  100213. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100214. "use strict";
  100215. __webpack_require__.r(__webpack_exports__);
  100216. /**
  100217. * A specialized version of `_.lastIndexOf` which performs strict equality
  100218. * comparisons of values, i.e. `===`.
  100219. *
  100220. * @private
  100221. * @param {Array} array The array to inspect.
  100222. * @param {*} value The value to search for.
  100223. * @param {number} fromIndex The index to search from.
  100224. * @returns {number} Returns the index of the matched value, else `-1`.
  100225. */
  100226. function strictLastIndexOf(array, value, fromIndex) {
  100227. var index = fromIndex + 1;
  100228. while (index--) {
  100229. if (array[index] === value) {
  100230. return index;
  100231. }
  100232. }
  100233. return index;
  100234. }
  100235. /* harmony default export */ __webpack_exports__["default"] = (strictLastIndexOf);
  100236. /***/ }),
  100237. /***/ "./node_modules/lodash-es/_stringSize.js":
  100238. /*!***********************************************!*\
  100239. !*** ./node_modules/lodash-es/_stringSize.js ***!
  100240. \***********************************************/
  100241. /*! exports provided: default */
  100242. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100243. "use strict";
  100244. __webpack_require__.r(__webpack_exports__);
  100245. /* harmony import */ var _asciiSize_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_asciiSize.js */ "./node_modules/lodash-es/_asciiSize.js");
  100246. /* harmony import */ var _hasUnicode_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_hasUnicode.js */ "./node_modules/lodash-es/_hasUnicode.js");
  100247. /* harmony import */ var _unicodeSize_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_unicodeSize.js */ "./node_modules/lodash-es/_unicodeSize.js");
  100248. /**
  100249. * Gets the number of symbols in `string`.
  100250. *
  100251. * @private
  100252. * @param {string} string The string to inspect.
  100253. * @returns {number} Returns the string size.
  100254. */
  100255. function stringSize(string) {
  100256. return Object(_hasUnicode_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string)
  100257. ? Object(_unicodeSize_js__WEBPACK_IMPORTED_MODULE_2__["default"])(string)
  100258. : Object(_asciiSize_js__WEBPACK_IMPORTED_MODULE_0__["default"])(string);
  100259. }
  100260. /* harmony default export */ __webpack_exports__["default"] = (stringSize);
  100261. /***/ }),
  100262. /***/ "./node_modules/lodash-es/_stringToArray.js":
  100263. /*!**************************************************!*\
  100264. !*** ./node_modules/lodash-es/_stringToArray.js ***!
  100265. \**************************************************/
  100266. /*! exports provided: default */
  100267. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100268. "use strict";
  100269. __webpack_require__.r(__webpack_exports__);
  100270. /* harmony import */ var _asciiToArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_asciiToArray.js */ "./node_modules/lodash-es/_asciiToArray.js");
  100271. /* harmony import */ var _hasUnicode_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_hasUnicode.js */ "./node_modules/lodash-es/_hasUnicode.js");
  100272. /* harmony import */ var _unicodeToArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_unicodeToArray.js */ "./node_modules/lodash-es/_unicodeToArray.js");
  100273. /**
  100274. * Converts `string` to an array.
  100275. *
  100276. * @private
  100277. * @param {string} string The string to convert.
  100278. * @returns {Array} Returns the converted array.
  100279. */
  100280. function stringToArray(string) {
  100281. return Object(_hasUnicode_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string)
  100282. ? Object(_unicodeToArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(string)
  100283. : Object(_asciiToArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(string);
  100284. }
  100285. /* harmony default export */ __webpack_exports__["default"] = (stringToArray);
  100286. /***/ }),
  100287. /***/ "./node_modules/lodash-es/_stringToPath.js":
  100288. /*!*************************************************!*\
  100289. !*** ./node_modules/lodash-es/_stringToPath.js ***!
  100290. \*************************************************/
  100291. /*! exports provided: default */
  100292. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100293. "use strict";
  100294. __webpack_require__.r(__webpack_exports__);
  100295. /* harmony import */ var _memoizeCapped_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_memoizeCapped.js */ "./node_modules/lodash-es/_memoizeCapped.js");
  100296. /** Used to match property names within property paths. */
  100297. var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  100298. /** Used to match backslashes in property paths. */
  100299. var reEscapeChar = /\\(\\)?/g;
  100300. /**
  100301. * Converts `string` to a property path array.
  100302. *
  100303. * @private
  100304. * @param {string} string The string to convert.
  100305. * @returns {Array} Returns the property path array.
  100306. */
  100307. var stringToPath = Object(_memoizeCapped_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(string) {
  100308. var result = [];
  100309. if (string.charCodeAt(0) === 46 /* . */) {
  100310. result.push('');
  100311. }
  100312. string.replace(rePropName, function(match, number, quote, subString) {
  100313. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  100314. });
  100315. return result;
  100316. });
  100317. /* harmony default export */ __webpack_exports__["default"] = (stringToPath);
  100318. /***/ }),
  100319. /***/ "./node_modules/lodash-es/_toKey.js":
  100320. /*!******************************************!*\
  100321. !*** ./node_modules/lodash-es/_toKey.js ***!
  100322. \******************************************/
  100323. /*! exports provided: default */
  100324. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100325. "use strict";
  100326. __webpack_require__.r(__webpack_exports__);
  100327. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  100328. /** Used as references for various `Number` constants. */
  100329. var INFINITY = 1 / 0;
  100330. /**
  100331. * Converts `value` to a string key if it's not a string or symbol.
  100332. *
  100333. * @private
  100334. * @param {*} value The value to inspect.
  100335. * @returns {string|symbol} Returns the key.
  100336. */
  100337. function toKey(value) {
  100338. if (typeof value == 'string' || Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value)) {
  100339. return value;
  100340. }
  100341. var result = (value + '');
  100342. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  100343. }
  100344. /* harmony default export */ __webpack_exports__["default"] = (toKey);
  100345. /***/ }),
  100346. /***/ "./node_modules/lodash-es/_toSource.js":
  100347. /*!*********************************************!*\
  100348. !*** ./node_modules/lodash-es/_toSource.js ***!
  100349. \*********************************************/
  100350. /*! exports provided: default */
  100351. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100352. "use strict";
  100353. __webpack_require__.r(__webpack_exports__);
  100354. /** Used for built-in method references. */
  100355. var funcProto = Function.prototype;
  100356. /** Used to resolve the decompiled source of functions. */
  100357. var funcToString = funcProto.toString;
  100358. /**
  100359. * Converts `func` to its source code.
  100360. *
  100361. * @private
  100362. * @param {Function} func The function to convert.
  100363. * @returns {string} Returns the source code.
  100364. */
  100365. function toSource(func) {
  100366. if (func != null) {
  100367. try {
  100368. return funcToString.call(func);
  100369. } catch (e) {}
  100370. try {
  100371. return (func + '');
  100372. } catch (e) {}
  100373. }
  100374. return '';
  100375. }
  100376. /* harmony default export */ __webpack_exports__["default"] = (toSource);
  100377. /***/ }),
  100378. /***/ "./node_modules/lodash-es/_trimmedEndIndex.js":
  100379. /*!****************************************************!*\
  100380. !*** ./node_modules/lodash-es/_trimmedEndIndex.js ***!
  100381. \****************************************************/
  100382. /*! exports provided: default */
  100383. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100384. "use strict";
  100385. __webpack_require__.r(__webpack_exports__);
  100386. /** Used to match a single whitespace character. */
  100387. var reWhitespace = /\s/;
  100388. /**
  100389. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  100390. * character of `string`.
  100391. *
  100392. * @private
  100393. * @param {string} string The string to inspect.
  100394. * @returns {number} Returns the index of the last non-whitespace character.
  100395. */
  100396. function trimmedEndIndex(string) {
  100397. var index = string.length;
  100398. while (index-- && reWhitespace.test(string.charAt(index))) {}
  100399. return index;
  100400. }
  100401. /* harmony default export */ __webpack_exports__["default"] = (trimmedEndIndex);
  100402. /***/ }),
  100403. /***/ "./node_modules/lodash-es/_unescapeHtmlChar.js":
  100404. /*!*****************************************************!*\
  100405. !*** ./node_modules/lodash-es/_unescapeHtmlChar.js ***!
  100406. \*****************************************************/
  100407. /*! exports provided: default */
  100408. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100409. "use strict";
  100410. __webpack_require__.r(__webpack_exports__);
  100411. /* harmony import */ var _basePropertyOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_basePropertyOf.js */ "./node_modules/lodash-es/_basePropertyOf.js");
  100412. /** Used to map HTML entities to characters. */
  100413. var htmlUnescapes = {
  100414. '&amp;': '&',
  100415. '&lt;': '<',
  100416. '&gt;': '>',
  100417. '&quot;': '"',
  100418. '&#39;': "'"
  100419. };
  100420. /**
  100421. * Used by `_.unescape` to convert HTML entities to characters.
  100422. *
  100423. * @private
  100424. * @param {string} chr The matched character to unescape.
  100425. * @returns {string} Returns the unescaped character.
  100426. */
  100427. var unescapeHtmlChar = Object(_basePropertyOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(htmlUnescapes);
  100428. /* harmony default export */ __webpack_exports__["default"] = (unescapeHtmlChar);
  100429. /***/ }),
  100430. /***/ "./node_modules/lodash-es/_unicodeSize.js":
  100431. /*!************************************************!*\
  100432. !*** ./node_modules/lodash-es/_unicodeSize.js ***!
  100433. \************************************************/
  100434. /*! exports provided: default */
  100435. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100436. "use strict";
  100437. __webpack_require__.r(__webpack_exports__);
  100438. /** Used to compose unicode character classes. */
  100439. var rsAstralRange = '\\ud800-\\udfff',
  100440. rsComboMarksRange = '\\u0300-\\u036f',
  100441. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  100442. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  100443. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  100444. rsVarRange = '\\ufe0e\\ufe0f';
  100445. /** Used to compose unicode capture groups. */
  100446. var rsAstral = '[' + rsAstralRange + ']',
  100447. rsCombo = '[' + rsComboRange + ']',
  100448. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  100449. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  100450. rsNonAstral = '[^' + rsAstralRange + ']',
  100451. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  100452. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  100453. rsZWJ = '\\u200d';
  100454. /** Used to compose unicode regexes. */
  100455. var reOptMod = rsModifier + '?',
  100456. rsOptVar = '[' + rsVarRange + ']?',
  100457. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  100458. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  100459. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  100460. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  100461. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  100462. /**
  100463. * Gets the size of a Unicode `string`.
  100464. *
  100465. * @private
  100466. * @param {string} string The string inspect.
  100467. * @returns {number} Returns the string size.
  100468. */
  100469. function unicodeSize(string) {
  100470. var result = reUnicode.lastIndex = 0;
  100471. while (reUnicode.test(string)) {
  100472. ++result;
  100473. }
  100474. return result;
  100475. }
  100476. /* harmony default export */ __webpack_exports__["default"] = (unicodeSize);
  100477. /***/ }),
  100478. /***/ "./node_modules/lodash-es/_unicodeToArray.js":
  100479. /*!***************************************************!*\
  100480. !*** ./node_modules/lodash-es/_unicodeToArray.js ***!
  100481. \***************************************************/
  100482. /*! exports provided: default */
  100483. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100484. "use strict";
  100485. __webpack_require__.r(__webpack_exports__);
  100486. /** Used to compose unicode character classes. */
  100487. var rsAstralRange = '\\ud800-\\udfff',
  100488. rsComboMarksRange = '\\u0300-\\u036f',
  100489. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  100490. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  100491. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  100492. rsVarRange = '\\ufe0e\\ufe0f';
  100493. /** Used to compose unicode capture groups. */
  100494. var rsAstral = '[' + rsAstralRange + ']',
  100495. rsCombo = '[' + rsComboRange + ']',
  100496. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  100497. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  100498. rsNonAstral = '[^' + rsAstralRange + ']',
  100499. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  100500. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  100501. rsZWJ = '\\u200d';
  100502. /** Used to compose unicode regexes. */
  100503. var reOptMod = rsModifier + '?',
  100504. rsOptVar = '[' + rsVarRange + ']?',
  100505. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  100506. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  100507. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  100508. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  100509. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  100510. /**
  100511. * Converts a Unicode `string` to an array.
  100512. *
  100513. * @private
  100514. * @param {string} string The string to convert.
  100515. * @returns {Array} Returns the converted array.
  100516. */
  100517. function unicodeToArray(string) {
  100518. return string.match(reUnicode) || [];
  100519. }
  100520. /* harmony default export */ __webpack_exports__["default"] = (unicodeToArray);
  100521. /***/ }),
  100522. /***/ "./node_modules/lodash-es/_unicodeWords.js":
  100523. /*!*************************************************!*\
  100524. !*** ./node_modules/lodash-es/_unicodeWords.js ***!
  100525. \*************************************************/
  100526. /*! exports provided: default */
  100527. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100528. "use strict";
  100529. __webpack_require__.r(__webpack_exports__);
  100530. /** Used to compose unicode character classes. */
  100531. var rsAstralRange = '\\ud800-\\udfff',
  100532. rsComboMarksRange = '\\u0300-\\u036f',
  100533. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  100534. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  100535. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  100536. rsDingbatRange = '\\u2700-\\u27bf',
  100537. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  100538. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  100539. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  100540. rsPunctuationRange = '\\u2000-\\u206f',
  100541. rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',
  100542. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  100543. rsVarRange = '\\ufe0e\\ufe0f',
  100544. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  100545. /** Used to compose unicode capture groups. */
  100546. var rsApos = "['\u2019]",
  100547. rsBreak = '[' + rsBreakRange + ']',
  100548. rsCombo = '[' + rsComboRange + ']',
  100549. rsDigits = '\\d+',
  100550. rsDingbat = '[' + rsDingbatRange + ']',
  100551. rsLower = '[' + rsLowerRange + ']',
  100552. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  100553. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  100554. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  100555. rsNonAstral = '[^' + rsAstralRange + ']',
  100556. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  100557. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  100558. rsUpper = '[' + rsUpperRange + ']',
  100559. rsZWJ = '\\u200d';
  100560. /** Used to compose unicode regexes. */
  100561. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  100562. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  100563. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  100564. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  100565. reOptMod = rsModifier + '?',
  100566. rsOptVar = '[' + rsVarRange + ']?',
  100567. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  100568. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  100569. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  100570. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  100571. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq;
  100572. /** Used to match complex or compound words. */
  100573. var reUnicodeWord = RegExp([
  100574. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  100575. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  100576. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  100577. rsUpper + '+' + rsOptContrUpper,
  100578. rsOrdUpper,
  100579. rsOrdLower,
  100580. rsDigits,
  100581. rsEmoji
  100582. ].join('|'), 'g');
  100583. /**
  100584. * Splits a Unicode `string` into an array of its words.
  100585. *
  100586. * @private
  100587. * @param {string} The string to inspect.
  100588. * @returns {Array} Returns the words of `string`.
  100589. */
  100590. function unicodeWords(string) {
  100591. return string.match(reUnicodeWord) || [];
  100592. }
  100593. /* harmony default export */ __webpack_exports__["default"] = (unicodeWords);
  100594. /***/ }),
  100595. /***/ "./node_modules/lodash-es/_updateWrapDetails.js":
  100596. /*!******************************************************!*\
  100597. !*** ./node_modules/lodash-es/_updateWrapDetails.js ***!
  100598. \******************************************************/
  100599. /*! exports provided: default */
  100600. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100601. "use strict";
  100602. __webpack_require__.r(__webpack_exports__);
  100603. /* harmony import */ var _arrayEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayEach.js */ "./node_modules/lodash-es/_arrayEach.js");
  100604. /* harmony import */ var _arrayIncludes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayIncludes.js */ "./node_modules/lodash-es/_arrayIncludes.js");
  100605. /** Used to compose bitmasks for function metadata. */
  100606. var WRAP_BIND_FLAG = 1,
  100607. WRAP_BIND_KEY_FLAG = 2,
  100608. WRAP_CURRY_FLAG = 8,
  100609. WRAP_CURRY_RIGHT_FLAG = 16,
  100610. WRAP_PARTIAL_FLAG = 32,
  100611. WRAP_PARTIAL_RIGHT_FLAG = 64,
  100612. WRAP_ARY_FLAG = 128,
  100613. WRAP_REARG_FLAG = 256,
  100614. WRAP_FLIP_FLAG = 512;
  100615. /** Used to associate wrap methods with their bit flags. */
  100616. var wrapFlags = [
  100617. ['ary', WRAP_ARY_FLAG],
  100618. ['bind', WRAP_BIND_FLAG],
  100619. ['bindKey', WRAP_BIND_KEY_FLAG],
  100620. ['curry', WRAP_CURRY_FLAG],
  100621. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  100622. ['flip', WRAP_FLIP_FLAG],
  100623. ['partial', WRAP_PARTIAL_FLAG],
  100624. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  100625. ['rearg', WRAP_REARG_FLAG]
  100626. ];
  100627. /**
  100628. * Updates wrapper `details` based on `bitmask` flags.
  100629. *
  100630. * @private
  100631. * @returns {Array} details The details to modify.
  100632. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  100633. * @returns {Array} Returns `details`.
  100634. */
  100635. function updateWrapDetails(details, bitmask) {
  100636. Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_0__["default"])(wrapFlags, function(pair) {
  100637. var value = '_.' + pair[0];
  100638. if ((bitmask & pair[1]) && !Object(_arrayIncludes_js__WEBPACK_IMPORTED_MODULE_1__["default"])(details, value)) {
  100639. details.push(value);
  100640. }
  100641. });
  100642. return details.sort();
  100643. }
  100644. /* harmony default export */ __webpack_exports__["default"] = (updateWrapDetails);
  100645. /***/ }),
  100646. /***/ "./node_modules/lodash-es/_wrapperClone.js":
  100647. /*!*************************************************!*\
  100648. !*** ./node_modules/lodash-es/_wrapperClone.js ***!
  100649. \*************************************************/
  100650. /*! exports provided: default */
  100651. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100652. "use strict";
  100653. __webpack_require__.r(__webpack_exports__);
  100654. /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
  100655. /* harmony import */ var _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_LodashWrapper.js */ "./node_modules/lodash-es/_LodashWrapper.js");
  100656. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  100657. /**
  100658. * Creates a clone of `wrapper`.
  100659. *
  100660. * @private
  100661. * @param {Object} wrapper The wrapper to clone.
  100662. * @returns {Object} Returns the cloned wrapper.
  100663. */
  100664. function wrapperClone(wrapper) {
  100665. if (wrapper instanceof _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"]) {
  100666. return wrapper.clone();
  100667. }
  100668. var result = new _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__["default"](wrapper.__wrapped__, wrapper.__chain__);
  100669. result.__actions__ = Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(wrapper.__actions__);
  100670. result.__index__ = wrapper.__index__;
  100671. result.__values__ = wrapper.__values__;
  100672. return result;
  100673. }
  100674. /* harmony default export */ __webpack_exports__["default"] = (wrapperClone);
  100675. /***/ }),
  100676. /***/ "./node_modules/lodash-es/add.js":
  100677. /*!***************************************!*\
  100678. !*** ./node_modules/lodash-es/add.js ***!
  100679. \***************************************/
  100680. /*! exports provided: default */
  100681. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100682. "use strict";
  100683. __webpack_require__.r(__webpack_exports__);
  100684. /* harmony import */ var _createMathOperation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createMathOperation.js */ "./node_modules/lodash-es/_createMathOperation.js");
  100685. /**
  100686. * Adds two numbers.
  100687. *
  100688. * @static
  100689. * @memberOf _
  100690. * @since 3.4.0
  100691. * @category Math
  100692. * @param {number} augend The first number in an addition.
  100693. * @param {number} addend The second number in an addition.
  100694. * @returns {number} Returns the total.
  100695. * @example
  100696. *
  100697. * _.add(6, 4);
  100698. * // => 10
  100699. */
  100700. var add = Object(_createMathOperation_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(augend, addend) {
  100701. return augend + addend;
  100702. }, 0);
  100703. /* harmony default export */ __webpack_exports__["default"] = (add);
  100704. /***/ }),
  100705. /***/ "./node_modules/lodash-es/after.js":
  100706. /*!*****************************************!*\
  100707. !*** ./node_modules/lodash-es/after.js ***!
  100708. \*****************************************/
  100709. /*! exports provided: default */
  100710. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100711. "use strict";
  100712. __webpack_require__.r(__webpack_exports__);
  100713. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  100714. /** Error message constants. */
  100715. var FUNC_ERROR_TEXT = 'Expected a function';
  100716. /**
  100717. * The opposite of `_.before`; this method creates a function that invokes
  100718. * `func` once it's called `n` or more times.
  100719. *
  100720. * @static
  100721. * @memberOf _
  100722. * @since 0.1.0
  100723. * @category Function
  100724. * @param {number} n The number of calls before `func` is invoked.
  100725. * @param {Function} func The function to restrict.
  100726. * @returns {Function} Returns the new restricted function.
  100727. * @example
  100728. *
  100729. * var saves = ['profile', 'settings'];
  100730. *
  100731. * var done = _.after(saves.length, function() {
  100732. * console.log('done saving!');
  100733. * });
  100734. *
  100735. * _.forEach(saves, function(type) {
  100736. * asyncSave({ 'type': type, 'complete': done });
  100737. * });
  100738. * // => Logs 'done saving!' after the two async saves have completed.
  100739. */
  100740. function after(n, func) {
  100741. if (typeof func != 'function') {
  100742. throw new TypeError(FUNC_ERROR_TEXT);
  100743. }
  100744. n = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_0__["default"])(n);
  100745. return function() {
  100746. if (--n < 1) {
  100747. return func.apply(this, arguments);
  100748. }
  100749. };
  100750. }
  100751. /* harmony default export */ __webpack_exports__["default"] = (after);
  100752. /***/ }),
  100753. /***/ "./node_modules/lodash-es/array.default.js":
  100754. /*!*************************************************!*\
  100755. !*** ./node_modules/lodash-es/array.default.js ***!
  100756. \*************************************************/
  100757. /*! exports provided: default */
  100758. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100759. "use strict";
  100760. __webpack_require__.r(__webpack_exports__);
  100761. /* harmony import */ var _chunk_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./chunk.js */ "./node_modules/lodash-es/chunk.js");
  100762. /* harmony import */ var _compact_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./compact.js */ "./node_modules/lodash-es/compact.js");
  100763. /* harmony import */ var _concat_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./concat.js */ "./node_modules/lodash-es/concat.js");
  100764. /* harmony import */ var _difference_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./difference.js */ "./node_modules/lodash-es/difference.js");
  100765. /* harmony import */ var _differenceBy_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./differenceBy.js */ "./node_modules/lodash-es/differenceBy.js");
  100766. /* harmony import */ var _differenceWith_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./differenceWith.js */ "./node_modules/lodash-es/differenceWith.js");
  100767. /* harmony import */ var _drop_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./drop.js */ "./node_modules/lodash-es/drop.js");
  100768. /* harmony import */ var _dropRight_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./dropRight.js */ "./node_modules/lodash-es/dropRight.js");
  100769. /* harmony import */ var _dropRightWhile_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./dropRightWhile.js */ "./node_modules/lodash-es/dropRightWhile.js");
  100770. /* harmony import */ var _dropWhile_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./dropWhile.js */ "./node_modules/lodash-es/dropWhile.js");
  100771. /* harmony import */ var _fill_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./fill.js */ "./node_modules/lodash-es/fill.js");
  100772. /* harmony import */ var _findIndex_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./findIndex.js */ "./node_modules/lodash-es/findIndex.js");
  100773. /* harmony import */ var _findLastIndex_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./findLastIndex.js */ "./node_modules/lodash-es/findLastIndex.js");
  100774. /* harmony import */ var _first_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./first.js */ "./node_modules/lodash-es/first.js");
  100775. /* harmony import */ var _flatten_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./flatten.js */ "./node_modules/lodash-es/flatten.js");
  100776. /* harmony import */ var _flattenDeep_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./flattenDeep.js */ "./node_modules/lodash-es/flattenDeep.js");
  100777. /* harmony import */ var _flattenDepth_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./flattenDepth.js */ "./node_modules/lodash-es/flattenDepth.js");
  100778. /* harmony import */ var _fromPairs_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./fromPairs.js */ "./node_modules/lodash-es/fromPairs.js");
  100779. /* harmony import */ var _head_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./head.js */ "./node_modules/lodash-es/head.js");
  100780. /* harmony import */ var _indexOf_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./indexOf.js */ "./node_modules/lodash-es/indexOf.js");
  100781. /* harmony import */ var _initial_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./initial.js */ "./node_modules/lodash-es/initial.js");
  100782. /* harmony import */ var _intersection_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./intersection.js */ "./node_modules/lodash-es/intersection.js");
  100783. /* harmony import */ var _intersectionBy_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./intersectionBy.js */ "./node_modules/lodash-es/intersectionBy.js");
  100784. /* harmony import */ var _intersectionWith_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./intersectionWith.js */ "./node_modules/lodash-es/intersectionWith.js");
  100785. /* harmony import */ var _join_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./join.js */ "./node_modules/lodash-es/join.js");
  100786. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  100787. /* harmony import */ var _lastIndexOf_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./lastIndexOf.js */ "./node_modules/lodash-es/lastIndexOf.js");
  100788. /* harmony import */ var _nth_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./nth.js */ "./node_modules/lodash-es/nth.js");
  100789. /* harmony import */ var _pull_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./pull.js */ "./node_modules/lodash-es/pull.js");
  100790. /* harmony import */ var _pullAll_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./pullAll.js */ "./node_modules/lodash-es/pullAll.js");
  100791. /* harmony import */ var _pullAllBy_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./pullAllBy.js */ "./node_modules/lodash-es/pullAllBy.js");
  100792. /* harmony import */ var _pullAllWith_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./pullAllWith.js */ "./node_modules/lodash-es/pullAllWith.js");
  100793. /* harmony import */ var _pullAt_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./pullAt.js */ "./node_modules/lodash-es/pullAt.js");
  100794. /* harmony import */ var _remove_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./remove.js */ "./node_modules/lodash-es/remove.js");
  100795. /* harmony import */ var _reverse_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./reverse.js */ "./node_modules/lodash-es/reverse.js");
  100796. /* harmony import */ var _slice_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./slice.js */ "./node_modules/lodash-es/slice.js");
  100797. /* harmony import */ var _sortedIndex_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./sortedIndex.js */ "./node_modules/lodash-es/sortedIndex.js");
  100798. /* harmony import */ var _sortedIndexBy_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./sortedIndexBy.js */ "./node_modules/lodash-es/sortedIndexBy.js");
  100799. /* harmony import */ var _sortedIndexOf_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./sortedIndexOf.js */ "./node_modules/lodash-es/sortedIndexOf.js");
  100800. /* harmony import */ var _sortedLastIndex_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./sortedLastIndex.js */ "./node_modules/lodash-es/sortedLastIndex.js");
  100801. /* harmony import */ var _sortedLastIndexBy_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./sortedLastIndexBy.js */ "./node_modules/lodash-es/sortedLastIndexBy.js");
  100802. /* harmony import */ var _sortedLastIndexOf_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./sortedLastIndexOf.js */ "./node_modules/lodash-es/sortedLastIndexOf.js");
  100803. /* harmony import */ var _sortedUniq_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./sortedUniq.js */ "./node_modules/lodash-es/sortedUniq.js");
  100804. /* harmony import */ var _sortedUniqBy_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./sortedUniqBy.js */ "./node_modules/lodash-es/sortedUniqBy.js");
  100805. /* harmony import */ var _tail_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./tail.js */ "./node_modules/lodash-es/tail.js");
  100806. /* harmony import */ var _take_js__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./take.js */ "./node_modules/lodash-es/take.js");
  100807. /* harmony import */ var _takeRight_js__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./takeRight.js */ "./node_modules/lodash-es/takeRight.js");
  100808. /* harmony import */ var _takeRightWhile_js__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./takeRightWhile.js */ "./node_modules/lodash-es/takeRightWhile.js");
  100809. /* harmony import */ var _takeWhile_js__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./takeWhile.js */ "./node_modules/lodash-es/takeWhile.js");
  100810. /* harmony import */ var _union_js__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./union.js */ "./node_modules/lodash-es/union.js");
  100811. /* harmony import */ var _unionBy_js__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./unionBy.js */ "./node_modules/lodash-es/unionBy.js");
  100812. /* harmony import */ var _unionWith_js__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./unionWith.js */ "./node_modules/lodash-es/unionWith.js");
  100813. /* harmony import */ var _uniq_js__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./uniq.js */ "./node_modules/lodash-es/uniq.js");
  100814. /* harmony import */ var _uniqBy_js__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./uniqBy.js */ "./node_modules/lodash-es/uniqBy.js");
  100815. /* harmony import */ var _uniqWith_js__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./uniqWith.js */ "./node_modules/lodash-es/uniqWith.js");
  100816. /* harmony import */ var _unzip_js__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./unzip.js */ "./node_modules/lodash-es/unzip.js");
  100817. /* harmony import */ var _unzipWith_js__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./unzipWith.js */ "./node_modules/lodash-es/unzipWith.js");
  100818. /* harmony import */ var _without_js__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ./without.js */ "./node_modules/lodash-es/without.js");
  100819. /* harmony import */ var _xor_js__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ./xor.js */ "./node_modules/lodash-es/xor.js");
  100820. /* harmony import */ var _xorBy_js__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ./xorBy.js */ "./node_modules/lodash-es/xorBy.js");
  100821. /* harmony import */ var _xorWith_js__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ./xorWith.js */ "./node_modules/lodash-es/xorWith.js");
  100822. /* harmony import */ var _zip_js__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ./zip.js */ "./node_modules/lodash-es/zip.js");
  100823. /* harmony import */ var _zipObject_js__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ./zipObject.js */ "./node_modules/lodash-es/zipObject.js");
  100824. /* harmony import */ var _zipObjectDeep_js__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! ./zipObjectDeep.js */ "./node_modules/lodash-es/zipObjectDeep.js");
  100825. /* harmony import */ var _zipWith_js__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(/*! ./zipWith.js */ "./node_modules/lodash-es/zipWith.js");
  100826. /* harmony default export */ __webpack_exports__["default"] = ({
  100827. chunk: _chunk_js__WEBPACK_IMPORTED_MODULE_0__["default"], compact: _compact_js__WEBPACK_IMPORTED_MODULE_1__["default"], concat: _concat_js__WEBPACK_IMPORTED_MODULE_2__["default"], difference: _difference_js__WEBPACK_IMPORTED_MODULE_3__["default"], differenceBy: _differenceBy_js__WEBPACK_IMPORTED_MODULE_4__["default"],
  100828. differenceWith: _differenceWith_js__WEBPACK_IMPORTED_MODULE_5__["default"], drop: _drop_js__WEBPACK_IMPORTED_MODULE_6__["default"], dropRight: _dropRight_js__WEBPACK_IMPORTED_MODULE_7__["default"], dropRightWhile: _dropRightWhile_js__WEBPACK_IMPORTED_MODULE_8__["default"], dropWhile: _dropWhile_js__WEBPACK_IMPORTED_MODULE_9__["default"],
  100829. fill: _fill_js__WEBPACK_IMPORTED_MODULE_10__["default"], findIndex: _findIndex_js__WEBPACK_IMPORTED_MODULE_11__["default"], findLastIndex: _findLastIndex_js__WEBPACK_IMPORTED_MODULE_12__["default"], first: _first_js__WEBPACK_IMPORTED_MODULE_13__["default"], flatten: _flatten_js__WEBPACK_IMPORTED_MODULE_14__["default"],
  100830. flattenDeep: _flattenDeep_js__WEBPACK_IMPORTED_MODULE_15__["default"], flattenDepth: _flattenDepth_js__WEBPACK_IMPORTED_MODULE_16__["default"], fromPairs: _fromPairs_js__WEBPACK_IMPORTED_MODULE_17__["default"], head: _head_js__WEBPACK_IMPORTED_MODULE_18__["default"], indexOf: _indexOf_js__WEBPACK_IMPORTED_MODULE_19__["default"],
  100831. initial: _initial_js__WEBPACK_IMPORTED_MODULE_20__["default"], intersection: _intersection_js__WEBPACK_IMPORTED_MODULE_21__["default"], intersectionBy: _intersectionBy_js__WEBPACK_IMPORTED_MODULE_22__["default"], intersectionWith: _intersectionWith_js__WEBPACK_IMPORTED_MODULE_23__["default"], join: _join_js__WEBPACK_IMPORTED_MODULE_24__["default"],
  100832. last: _last_js__WEBPACK_IMPORTED_MODULE_25__["default"], lastIndexOf: _lastIndexOf_js__WEBPACK_IMPORTED_MODULE_26__["default"], nth: _nth_js__WEBPACK_IMPORTED_MODULE_27__["default"], pull: _pull_js__WEBPACK_IMPORTED_MODULE_28__["default"], pullAll: _pullAll_js__WEBPACK_IMPORTED_MODULE_29__["default"],
  100833. pullAllBy: _pullAllBy_js__WEBPACK_IMPORTED_MODULE_30__["default"], pullAllWith: _pullAllWith_js__WEBPACK_IMPORTED_MODULE_31__["default"], pullAt: _pullAt_js__WEBPACK_IMPORTED_MODULE_32__["default"], remove: _remove_js__WEBPACK_IMPORTED_MODULE_33__["default"], reverse: _reverse_js__WEBPACK_IMPORTED_MODULE_34__["default"],
  100834. slice: _slice_js__WEBPACK_IMPORTED_MODULE_35__["default"], sortedIndex: _sortedIndex_js__WEBPACK_IMPORTED_MODULE_36__["default"], sortedIndexBy: _sortedIndexBy_js__WEBPACK_IMPORTED_MODULE_37__["default"], sortedIndexOf: _sortedIndexOf_js__WEBPACK_IMPORTED_MODULE_38__["default"], sortedLastIndex: _sortedLastIndex_js__WEBPACK_IMPORTED_MODULE_39__["default"],
  100835. sortedLastIndexBy: _sortedLastIndexBy_js__WEBPACK_IMPORTED_MODULE_40__["default"], sortedLastIndexOf: _sortedLastIndexOf_js__WEBPACK_IMPORTED_MODULE_41__["default"], sortedUniq: _sortedUniq_js__WEBPACK_IMPORTED_MODULE_42__["default"], sortedUniqBy: _sortedUniqBy_js__WEBPACK_IMPORTED_MODULE_43__["default"], tail: _tail_js__WEBPACK_IMPORTED_MODULE_44__["default"],
  100836. take: _take_js__WEBPACK_IMPORTED_MODULE_45__["default"], takeRight: _takeRight_js__WEBPACK_IMPORTED_MODULE_46__["default"], takeRightWhile: _takeRightWhile_js__WEBPACK_IMPORTED_MODULE_47__["default"], takeWhile: _takeWhile_js__WEBPACK_IMPORTED_MODULE_48__["default"], union: _union_js__WEBPACK_IMPORTED_MODULE_49__["default"],
  100837. unionBy: _unionBy_js__WEBPACK_IMPORTED_MODULE_50__["default"], unionWith: _unionWith_js__WEBPACK_IMPORTED_MODULE_51__["default"], uniq: _uniq_js__WEBPACK_IMPORTED_MODULE_52__["default"], uniqBy: _uniqBy_js__WEBPACK_IMPORTED_MODULE_53__["default"], uniqWith: _uniqWith_js__WEBPACK_IMPORTED_MODULE_54__["default"],
  100838. unzip: _unzip_js__WEBPACK_IMPORTED_MODULE_55__["default"], unzipWith: _unzipWith_js__WEBPACK_IMPORTED_MODULE_56__["default"], without: _without_js__WEBPACK_IMPORTED_MODULE_57__["default"], xor: _xor_js__WEBPACK_IMPORTED_MODULE_58__["default"], xorBy: _xorBy_js__WEBPACK_IMPORTED_MODULE_59__["default"],
  100839. xorWith: _xorWith_js__WEBPACK_IMPORTED_MODULE_60__["default"], zip: _zip_js__WEBPACK_IMPORTED_MODULE_61__["default"], zipObject: _zipObject_js__WEBPACK_IMPORTED_MODULE_62__["default"], zipObjectDeep: _zipObjectDeep_js__WEBPACK_IMPORTED_MODULE_63__["default"], zipWith: _zipWith_js__WEBPACK_IMPORTED_MODULE_64__["default"]
  100840. });
  100841. /***/ }),
  100842. /***/ "./node_modules/lodash-es/array.js":
  100843. /*!*****************************************!*\
  100844. !*** ./node_modules/lodash-es/array.js ***!
  100845. \*****************************************/
  100846. /*! exports provided: chunk, compact, concat, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, fill, findIndex, findLastIndex, first, flatten, flattenDeep, flattenDepth, fromPairs, head, indexOf, initial, intersection, intersectionBy, intersectionWith, join, last, lastIndexOf, nth, pull, pullAll, pullAllBy, pullAllWith, pullAt, remove, reverse, slice, sortedIndex, sortedIndexBy, sortedIndexOf, sortedLastIndex, sortedLastIndexBy, sortedLastIndexOf, sortedUniq, sortedUniqBy, tail, take, takeRight, takeRightWhile, takeWhile, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, without, xor, xorBy, xorWith, zip, zipObject, zipObjectDeep, zipWith, default */
  100847. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100848. "use strict";
  100849. __webpack_require__.r(__webpack_exports__);
  100850. /* harmony import */ var _chunk_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./chunk.js */ "./node_modules/lodash-es/chunk.js");
  100851. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "chunk", function() { return _chunk_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  100852. /* harmony import */ var _compact_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./compact.js */ "./node_modules/lodash-es/compact.js");
  100853. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "compact", function() { return _compact_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  100854. /* harmony import */ var _concat_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./concat.js */ "./node_modules/lodash-es/concat.js");
  100855. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return _concat_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  100856. /* harmony import */ var _difference_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./difference.js */ "./node_modules/lodash-es/difference.js");
  100857. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "difference", function() { return _difference_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  100858. /* harmony import */ var _differenceBy_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./differenceBy.js */ "./node_modules/lodash-es/differenceBy.js");
  100859. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "differenceBy", function() { return _differenceBy_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  100860. /* harmony import */ var _differenceWith_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./differenceWith.js */ "./node_modules/lodash-es/differenceWith.js");
  100861. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "differenceWith", function() { return _differenceWith_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  100862. /* harmony import */ var _drop_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./drop.js */ "./node_modules/lodash-es/drop.js");
  100863. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "drop", function() { return _drop_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  100864. /* harmony import */ var _dropRight_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./dropRight.js */ "./node_modules/lodash-es/dropRight.js");
  100865. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dropRight", function() { return _dropRight_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  100866. /* harmony import */ var _dropRightWhile_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./dropRightWhile.js */ "./node_modules/lodash-es/dropRightWhile.js");
  100867. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dropRightWhile", function() { return _dropRightWhile_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  100868. /* harmony import */ var _dropWhile_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./dropWhile.js */ "./node_modules/lodash-es/dropWhile.js");
  100869. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dropWhile", function() { return _dropWhile_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  100870. /* harmony import */ var _fill_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./fill.js */ "./node_modules/lodash-es/fill.js");
  100871. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fill", function() { return _fill_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  100872. /* harmony import */ var _findIndex_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./findIndex.js */ "./node_modules/lodash-es/findIndex.js");
  100873. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return _findIndex_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  100874. /* harmony import */ var _findLastIndex_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./findLastIndex.js */ "./node_modules/lodash-es/findLastIndex.js");
  100875. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findLastIndex", function() { return _findLastIndex_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  100876. /* harmony import */ var _first_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./first.js */ "./node_modules/lodash-es/first.js");
  100877. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "first", function() { return _first_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  100878. /* harmony import */ var _flatten_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./flatten.js */ "./node_modules/lodash-es/flatten.js");
  100879. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return _flatten_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  100880. /* harmony import */ var _flattenDeep_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./flattenDeep.js */ "./node_modules/lodash-es/flattenDeep.js");
  100881. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flattenDeep", function() { return _flattenDeep_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
  100882. /* harmony import */ var _flattenDepth_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./flattenDepth.js */ "./node_modules/lodash-es/flattenDepth.js");
  100883. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flattenDepth", function() { return _flattenDepth_js__WEBPACK_IMPORTED_MODULE_16__["default"]; });
  100884. /* harmony import */ var _fromPairs_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./fromPairs.js */ "./node_modules/lodash-es/fromPairs.js");
  100885. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fromPairs", function() { return _fromPairs_js__WEBPACK_IMPORTED_MODULE_17__["default"]; });
  100886. /* harmony import */ var _head_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./head.js */ "./node_modules/lodash-es/head.js");
  100887. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "head", function() { return _head_js__WEBPACK_IMPORTED_MODULE_18__["default"]; });
  100888. /* harmony import */ var _indexOf_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./indexOf.js */ "./node_modules/lodash-es/indexOf.js");
  100889. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "indexOf", function() { return _indexOf_js__WEBPACK_IMPORTED_MODULE_19__["default"]; });
  100890. /* harmony import */ var _initial_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./initial.js */ "./node_modules/lodash-es/initial.js");
  100891. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initial", function() { return _initial_js__WEBPACK_IMPORTED_MODULE_20__["default"]; });
  100892. /* harmony import */ var _intersection_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./intersection.js */ "./node_modules/lodash-es/intersection.js");
  100893. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "intersection", function() { return _intersection_js__WEBPACK_IMPORTED_MODULE_21__["default"]; });
  100894. /* harmony import */ var _intersectionBy_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./intersectionBy.js */ "./node_modules/lodash-es/intersectionBy.js");
  100895. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "intersectionBy", function() { return _intersectionBy_js__WEBPACK_IMPORTED_MODULE_22__["default"]; });
  100896. /* harmony import */ var _intersectionWith_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./intersectionWith.js */ "./node_modules/lodash-es/intersectionWith.js");
  100897. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "intersectionWith", function() { return _intersectionWith_js__WEBPACK_IMPORTED_MODULE_23__["default"]; });
  100898. /* harmony import */ var _join_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./join.js */ "./node_modules/lodash-es/join.js");
  100899. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "join", function() { return _join_js__WEBPACK_IMPORTED_MODULE_24__["default"]; });
  100900. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  100901. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "last", function() { return _last_js__WEBPACK_IMPORTED_MODULE_25__["default"]; });
  100902. /* harmony import */ var _lastIndexOf_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./lastIndexOf.js */ "./node_modules/lodash-es/lastIndexOf.js");
  100903. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lastIndexOf", function() { return _lastIndexOf_js__WEBPACK_IMPORTED_MODULE_26__["default"]; });
  100904. /* harmony import */ var _nth_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./nth.js */ "./node_modules/lodash-es/nth.js");
  100905. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "nth", function() { return _nth_js__WEBPACK_IMPORTED_MODULE_27__["default"]; });
  100906. /* harmony import */ var _pull_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./pull.js */ "./node_modules/lodash-es/pull.js");
  100907. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pull", function() { return _pull_js__WEBPACK_IMPORTED_MODULE_28__["default"]; });
  100908. /* harmony import */ var _pullAll_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./pullAll.js */ "./node_modules/lodash-es/pullAll.js");
  100909. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pullAll", function() { return _pullAll_js__WEBPACK_IMPORTED_MODULE_29__["default"]; });
  100910. /* harmony import */ var _pullAllBy_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./pullAllBy.js */ "./node_modules/lodash-es/pullAllBy.js");
  100911. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pullAllBy", function() { return _pullAllBy_js__WEBPACK_IMPORTED_MODULE_30__["default"]; });
  100912. /* harmony import */ var _pullAllWith_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./pullAllWith.js */ "./node_modules/lodash-es/pullAllWith.js");
  100913. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pullAllWith", function() { return _pullAllWith_js__WEBPACK_IMPORTED_MODULE_31__["default"]; });
  100914. /* harmony import */ var _pullAt_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./pullAt.js */ "./node_modules/lodash-es/pullAt.js");
  100915. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pullAt", function() { return _pullAt_js__WEBPACK_IMPORTED_MODULE_32__["default"]; });
  100916. /* harmony import */ var _remove_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./remove.js */ "./node_modules/lodash-es/remove.js");
  100917. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "remove", function() { return _remove_js__WEBPACK_IMPORTED_MODULE_33__["default"]; });
  100918. /* harmony import */ var _reverse_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./reverse.js */ "./node_modules/lodash-es/reverse.js");
  100919. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reverse", function() { return _reverse_js__WEBPACK_IMPORTED_MODULE_34__["default"]; });
  100920. /* harmony import */ var _slice_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./slice.js */ "./node_modules/lodash-es/slice.js");
  100921. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "slice", function() { return _slice_js__WEBPACK_IMPORTED_MODULE_35__["default"]; });
  100922. /* harmony import */ var _sortedIndex_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./sortedIndex.js */ "./node_modules/lodash-es/sortedIndex.js");
  100923. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedIndex", function() { return _sortedIndex_js__WEBPACK_IMPORTED_MODULE_36__["default"]; });
  100924. /* harmony import */ var _sortedIndexBy_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./sortedIndexBy.js */ "./node_modules/lodash-es/sortedIndexBy.js");
  100925. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedIndexBy", function() { return _sortedIndexBy_js__WEBPACK_IMPORTED_MODULE_37__["default"]; });
  100926. /* harmony import */ var _sortedIndexOf_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./sortedIndexOf.js */ "./node_modules/lodash-es/sortedIndexOf.js");
  100927. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedIndexOf", function() { return _sortedIndexOf_js__WEBPACK_IMPORTED_MODULE_38__["default"]; });
  100928. /* harmony import */ var _sortedLastIndex_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./sortedLastIndex.js */ "./node_modules/lodash-es/sortedLastIndex.js");
  100929. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedLastIndex", function() { return _sortedLastIndex_js__WEBPACK_IMPORTED_MODULE_39__["default"]; });
  100930. /* harmony import */ var _sortedLastIndexBy_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./sortedLastIndexBy.js */ "./node_modules/lodash-es/sortedLastIndexBy.js");
  100931. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedLastIndexBy", function() { return _sortedLastIndexBy_js__WEBPACK_IMPORTED_MODULE_40__["default"]; });
  100932. /* harmony import */ var _sortedLastIndexOf_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./sortedLastIndexOf.js */ "./node_modules/lodash-es/sortedLastIndexOf.js");
  100933. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedLastIndexOf", function() { return _sortedLastIndexOf_js__WEBPACK_IMPORTED_MODULE_41__["default"]; });
  100934. /* harmony import */ var _sortedUniq_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./sortedUniq.js */ "./node_modules/lodash-es/sortedUniq.js");
  100935. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedUniq", function() { return _sortedUniq_js__WEBPACK_IMPORTED_MODULE_42__["default"]; });
  100936. /* harmony import */ var _sortedUniqBy_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./sortedUniqBy.js */ "./node_modules/lodash-es/sortedUniqBy.js");
  100937. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedUniqBy", function() { return _sortedUniqBy_js__WEBPACK_IMPORTED_MODULE_43__["default"]; });
  100938. /* harmony import */ var _tail_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./tail.js */ "./node_modules/lodash-es/tail.js");
  100939. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tail", function() { return _tail_js__WEBPACK_IMPORTED_MODULE_44__["default"]; });
  100940. /* harmony import */ var _take_js__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./take.js */ "./node_modules/lodash-es/take.js");
  100941. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "take", function() { return _take_js__WEBPACK_IMPORTED_MODULE_45__["default"]; });
  100942. /* harmony import */ var _takeRight_js__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./takeRight.js */ "./node_modules/lodash-es/takeRight.js");
  100943. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeRight", function() { return _takeRight_js__WEBPACK_IMPORTED_MODULE_46__["default"]; });
  100944. /* harmony import */ var _takeRightWhile_js__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./takeRightWhile.js */ "./node_modules/lodash-es/takeRightWhile.js");
  100945. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeRightWhile", function() { return _takeRightWhile_js__WEBPACK_IMPORTED_MODULE_47__["default"]; });
  100946. /* harmony import */ var _takeWhile_js__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./takeWhile.js */ "./node_modules/lodash-es/takeWhile.js");
  100947. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeWhile", function() { return _takeWhile_js__WEBPACK_IMPORTED_MODULE_48__["default"]; });
  100948. /* harmony import */ var _union_js__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./union.js */ "./node_modules/lodash-es/union.js");
  100949. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "union", function() { return _union_js__WEBPACK_IMPORTED_MODULE_49__["default"]; });
  100950. /* harmony import */ var _unionBy_js__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./unionBy.js */ "./node_modules/lodash-es/unionBy.js");
  100951. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unionBy", function() { return _unionBy_js__WEBPACK_IMPORTED_MODULE_50__["default"]; });
  100952. /* harmony import */ var _unionWith_js__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./unionWith.js */ "./node_modules/lodash-es/unionWith.js");
  100953. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unionWith", function() { return _unionWith_js__WEBPACK_IMPORTED_MODULE_51__["default"]; });
  100954. /* harmony import */ var _uniq_js__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./uniq.js */ "./node_modules/lodash-es/uniq.js");
  100955. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniq", function() { return _uniq_js__WEBPACK_IMPORTED_MODULE_52__["default"]; });
  100956. /* harmony import */ var _uniqBy_js__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./uniqBy.js */ "./node_modules/lodash-es/uniqBy.js");
  100957. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniqBy", function() { return _uniqBy_js__WEBPACK_IMPORTED_MODULE_53__["default"]; });
  100958. /* harmony import */ var _uniqWith_js__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./uniqWith.js */ "./node_modules/lodash-es/uniqWith.js");
  100959. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniqWith", function() { return _uniqWith_js__WEBPACK_IMPORTED_MODULE_54__["default"]; });
  100960. /* harmony import */ var _unzip_js__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./unzip.js */ "./node_modules/lodash-es/unzip.js");
  100961. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unzip", function() { return _unzip_js__WEBPACK_IMPORTED_MODULE_55__["default"]; });
  100962. /* harmony import */ var _unzipWith_js__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./unzipWith.js */ "./node_modules/lodash-es/unzipWith.js");
  100963. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unzipWith", function() { return _unzipWith_js__WEBPACK_IMPORTED_MODULE_56__["default"]; });
  100964. /* harmony import */ var _without_js__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ./without.js */ "./node_modules/lodash-es/without.js");
  100965. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "without", function() { return _without_js__WEBPACK_IMPORTED_MODULE_57__["default"]; });
  100966. /* harmony import */ var _xor_js__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ./xor.js */ "./node_modules/lodash-es/xor.js");
  100967. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "xor", function() { return _xor_js__WEBPACK_IMPORTED_MODULE_58__["default"]; });
  100968. /* harmony import */ var _xorBy_js__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ./xorBy.js */ "./node_modules/lodash-es/xorBy.js");
  100969. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "xorBy", function() { return _xorBy_js__WEBPACK_IMPORTED_MODULE_59__["default"]; });
  100970. /* harmony import */ var _xorWith_js__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ./xorWith.js */ "./node_modules/lodash-es/xorWith.js");
  100971. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "xorWith", function() { return _xorWith_js__WEBPACK_IMPORTED_MODULE_60__["default"]; });
  100972. /* harmony import */ var _zip_js__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ./zip.js */ "./node_modules/lodash-es/zip.js");
  100973. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return _zip_js__WEBPACK_IMPORTED_MODULE_61__["default"]; });
  100974. /* harmony import */ var _zipObject_js__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ./zipObject.js */ "./node_modules/lodash-es/zipObject.js");
  100975. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zipObject", function() { return _zipObject_js__WEBPACK_IMPORTED_MODULE_62__["default"]; });
  100976. /* harmony import */ var _zipObjectDeep_js__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! ./zipObjectDeep.js */ "./node_modules/lodash-es/zipObjectDeep.js");
  100977. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zipObjectDeep", function() { return _zipObjectDeep_js__WEBPACK_IMPORTED_MODULE_63__["default"]; });
  100978. /* harmony import */ var _zipWith_js__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(/*! ./zipWith.js */ "./node_modules/lodash-es/zipWith.js");
  100979. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zipWith", function() { return _zipWith_js__WEBPACK_IMPORTED_MODULE_64__["default"]; });
  100980. /* harmony import */ var _array_default_js__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(/*! ./array.default.js */ "./node_modules/lodash-es/array.default.js");
  100981. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _array_default_js__WEBPACK_IMPORTED_MODULE_65__["default"]; });
  100982. /***/ }),
  100983. /***/ "./node_modules/lodash-es/ary.js":
  100984. /*!***************************************!*\
  100985. !*** ./node_modules/lodash-es/ary.js ***!
  100986. \***************************************/
  100987. /*! exports provided: default */
  100988. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100989. "use strict";
  100990. __webpack_require__.r(__webpack_exports__);
  100991. /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
  100992. /** Used to compose bitmasks for function metadata. */
  100993. var WRAP_ARY_FLAG = 128;
  100994. /**
  100995. * Creates a function that invokes `func`, with up to `n` arguments,
  100996. * ignoring any additional arguments.
  100997. *
  100998. * @static
  100999. * @memberOf _
  101000. * @since 3.0.0
  101001. * @category Function
  101002. * @param {Function} func The function to cap arguments for.
  101003. * @param {number} [n=func.length] The arity cap.
  101004. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  101005. * @returns {Function} Returns the new capped function.
  101006. * @example
  101007. *
  101008. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  101009. * // => [6, 8, 10]
  101010. */
  101011. function ary(func, n, guard) {
  101012. n = guard ? undefined : n;
  101013. n = (func && n == null) ? func.length : n;
  101014. return Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  101015. }
  101016. /* harmony default export */ __webpack_exports__["default"] = (ary);
  101017. /***/ }),
  101018. /***/ "./node_modules/lodash-es/assign.js":
  101019. /*!******************************************!*\
  101020. !*** ./node_modules/lodash-es/assign.js ***!
  101021. \******************************************/
  101022. /*! exports provided: default */
  101023. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101024. "use strict";
  101025. __webpack_require__.r(__webpack_exports__);
  101026. /* harmony import */ var _assignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assignValue.js */ "./node_modules/lodash-es/_assignValue.js");
  101027. /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
  101028. /* harmony import */ var _createAssigner_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_createAssigner.js */ "./node_modules/lodash-es/_createAssigner.js");
  101029. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  101030. /* harmony import */ var _isPrototype_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_isPrototype.js */ "./node_modules/lodash-es/_isPrototype.js");
  101031. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  101032. /** Used for built-in method references. */
  101033. var objectProto = Object.prototype;
  101034. /** Used to check objects for own properties. */
  101035. var hasOwnProperty = objectProto.hasOwnProperty;
  101036. /**
  101037. * Assigns own enumerable string keyed properties of source objects to the
  101038. * destination object. Source objects are applied from left to right.
  101039. * Subsequent sources overwrite property assignments of previous sources.
  101040. *
  101041. * **Note:** This method mutates `object` and is loosely based on
  101042. * [`Object.assign`](https://mdn.io/Object/assign).
  101043. *
  101044. * @static
  101045. * @memberOf _
  101046. * @since 0.10.0
  101047. * @category Object
  101048. * @param {Object} object The destination object.
  101049. * @param {...Object} [sources] The source objects.
  101050. * @returns {Object} Returns `object`.
  101051. * @see _.assignIn
  101052. * @example
  101053. *
  101054. * function Foo() {
  101055. * this.a = 1;
  101056. * }
  101057. *
  101058. * function Bar() {
  101059. * this.c = 3;
  101060. * }
  101061. *
  101062. * Foo.prototype.b = 2;
  101063. * Bar.prototype.d = 4;
  101064. *
  101065. * _.assign({ 'a': 0 }, new Foo, new Bar);
  101066. * // => { 'a': 1, 'c': 3 }
  101067. */
  101068. var assign = Object(_createAssigner_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(object, source) {
  101069. if (Object(_isPrototype_js__WEBPACK_IMPORTED_MODULE_4__["default"])(source) || Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_3__["default"])(source)) {
  101070. Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source, Object(_keys_js__WEBPACK_IMPORTED_MODULE_5__["default"])(source), object);
  101071. return;
  101072. }
  101073. for (var key in source) {
  101074. if (hasOwnProperty.call(source, key)) {
  101075. Object(_assignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, key, source[key]);
  101076. }
  101077. }
  101078. });
  101079. /* harmony default export */ __webpack_exports__["default"] = (assign);
  101080. /***/ }),
  101081. /***/ "./node_modules/lodash-es/assignIn.js":
  101082. /*!********************************************!*\
  101083. !*** ./node_modules/lodash-es/assignIn.js ***!
  101084. \********************************************/
  101085. /*! exports provided: default */
  101086. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101087. "use strict";
  101088. __webpack_require__.r(__webpack_exports__);
  101089. /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
  101090. /* harmony import */ var _createAssigner_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createAssigner.js */ "./node_modules/lodash-es/_createAssigner.js");
  101091. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  101092. /**
  101093. * This method is like `_.assign` except that it iterates over own and
  101094. * inherited source properties.
  101095. *
  101096. * **Note:** This method mutates `object`.
  101097. *
  101098. * @static
  101099. * @memberOf _
  101100. * @since 4.0.0
  101101. * @alias extend
  101102. * @category Object
  101103. * @param {Object} object The destination object.
  101104. * @param {...Object} [sources] The source objects.
  101105. * @returns {Object} Returns `object`.
  101106. * @see _.assign
  101107. * @example
  101108. *
  101109. * function Foo() {
  101110. * this.a = 1;
  101111. * }
  101112. *
  101113. * function Bar() {
  101114. * this.c = 3;
  101115. * }
  101116. *
  101117. * Foo.prototype.b = 2;
  101118. * Bar.prototype.d = 4;
  101119. *
  101120. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  101121. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  101122. */
  101123. var assignIn = Object(_createAssigner_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(object, source) {
  101124. Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, Object(_keysIn_js__WEBPACK_IMPORTED_MODULE_2__["default"])(source), object);
  101125. });
  101126. /* harmony default export */ __webpack_exports__["default"] = (assignIn);
  101127. /***/ }),
  101128. /***/ "./node_modules/lodash-es/assignInWith.js":
  101129. /*!************************************************!*\
  101130. !*** ./node_modules/lodash-es/assignInWith.js ***!
  101131. \************************************************/
  101132. /*! exports provided: default */
  101133. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101134. "use strict";
  101135. __webpack_require__.r(__webpack_exports__);
  101136. /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
  101137. /* harmony import */ var _createAssigner_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createAssigner.js */ "./node_modules/lodash-es/_createAssigner.js");
  101138. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  101139. /**
  101140. * This method is like `_.assignIn` except that it accepts `customizer`
  101141. * which is invoked to produce the assigned values. If `customizer` returns
  101142. * `undefined`, assignment is handled by the method instead. The `customizer`
  101143. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  101144. *
  101145. * **Note:** This method mutates `object`.
  101146. *
  101147. * @static
  101148. * @memberOf _
  101149. * @since 4.0.0
  101150. * @alias extendWith
  101151. * @category Object
  101152. * @param {Object} object The destination object.
  101153. * @param {...Object} sources The source objects.
  101154. * @param {Function} [customizer] The function to customize assigned values.
  101155. * @returns {Object} Returns `object`.
  101156. * @see _.assignWith
  101157. * @example
  101158. *
  101159. * function customizer(objValue, srcValue) {
  101160. * return _.isUndefined(objValue) ? srcValue : objValue;
  101161. * }
  101162. *
  101163. * var defaults = _.partialRight(_.assignInWith, customizer);
  101164. *
  101165. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  101166. * // => { 'a': 1, 'b': 2 }
  101167. */
  101168. var assignInWith = Object(_createAssigner_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(object, source, srcIndex, customizer) {
  101169. Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, Object(_keysIn_js__WEBPACK_IMPORTED_MODULE_2__["default"])(source), object, customizer);
  101170. });
  101171. /* harmony default export */ __webpack_exports__["default"] = (assignInWith);
  101172. /***/ }),
  101173. /***/ "./node_modules/lodash-es/assignWith.js":
  101174. /*!**********************************************!*\
  101175. !*** ./node_modules/lodash-es/assignWith.js ***!
  101176. \**********************************************/
  101177. /*! exports provided: default */
  101178. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101179. "use strict";
  101180. __webpack_require__.r(__webpack_exports__);
  101181. /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
  101182. /* harmony import */ var _createAssigner_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createAssigner.js */ "./node_modules/lodash-es/_createAssigner.js");
  101183. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  101184. /**
  101185. * This method is like `_.assign` except that it accepts `customizer`
  101186. * which is invoked to produce the assigned values. If `customizer` returns
  101187. * `undefined`, assignment is handled by the method instead. The `customizer`
  101188. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  101189. *
  101190. * **Note:** This method mutates `object`.
  101191. *
  101192. * @static
  101193. * @memberOf _
  101194. * @since 4.0.0
  101195. * @category Object
  101196. * @param {Object} object The destination object.
  101197. * @param {...Object} sources The source objects.
  101198. * @param {Function} [customizer] The function to customize assigned values.
  101199. * @returns {Object} Returns `object`.
  101200. * @see _.assignInWith
  101201. * @example
  101202. *
  101203. * function customizer(objValue, srcValue) {
  101204. * return _.isUndefined(objValue) ? srcValue : objValue;
  101205. * }
  101206. *
  101207. * var defaults = _.partialRight(_.assignWith, customizer);
  101208. *
  101209. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  101210. * // => { 'a': 1, 'b': 2 }
  101211. */
  101212. var assignWith = Object(_createAssigner_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(object, source, srcIndex, customizer) {
  101213. Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, Object(_keys_js__WEBPACK_IMPORTED_MODULE_2__["default"])(source), object, customizer);
  101214. });
  101215. /* harmony default export */ __webpack_exports__["default"] = (assignWith);
  101216. /***/ }),
  101217. /***/ "./node_modules/lodash-es/at.js":
  101218. /*!**************************************!*\
  101219. !*** ./node_modules/lodash-es/at.js ***!
  101220. \**************************************/
  101221. /*! exports provided: default */
  101222. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101223. "use strict";
  101224. __webpack_require__.r(__webpack_exports__);
  101225. /* harmony import */ var _baseAt_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAt.js */ "./node_modules/lodash-es/_baseAt.js");
  101226. /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
  101227. /**
  101228. * Creates an array of values corresponding to `paths` of `object`.
  101229. *
  101230. * @static
  101231. * @memberOf _
  101232. * @since 1.0.0
  101233. * @category Object
  101234. * @param {Object} object The object to iterate over.
  101235. * @param {...(string|string[])} [paths] The property paths to pick.
  101236. * @returns {Array} Returns the picked values.
  101237. * @example
  101238. *
  101239. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  101240. *
  101241. * _.at(object, ['a[0].b.c', 'a[1]']);
  101242. * // => [3, 4]
  101243. */
  101244. var at = Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_baseAt_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  101245. /* harmony default export */ __webpack_exports__["default"] = (at);
  101246. /***/ }),
  101247. /***/ "./node_modules/lodash-es/attempt.js":
  101248. /*!*******************************************!*\
  101249. !*** ./node_modules/lodash-es/attempt.js ***!
  101250. \*******************************************/
  101251. /*! exports provided: default */
  101252. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101253. "use strict";
  101254. __webpack_require__.r(__webpack_exports__);
  101255. /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  101256. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  101257. /* harmony import */ var _isError_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isError.js */ "./node_modules/lodash-es/isError.js");
  101258. /**
  101259. * Attempts to invoke `func`, returning either the result or the caught error
  101260. * object. Any additional arguments are provided to `func` when it's invoked.
  101261. *
  101262. * @static
  101263. * @memberOf _
  101264. * @since 3.0.0
  101265. * @category Util
  101266. * @param {Function} func The function to attempt.
  101267. * @param {...*} [args] The arguments to invoke `func` with.
  101268. * @returns {*} Returns the `func` result or error object.
  101269. * @example
  101270. *
  101271. * // Avoid throwing errors for invalid selectors.
  101272. * var elements = _.attempt(function(selector) {
  101273. * return document.querySelectorAll(selector);
  101274. * }, '>_>');
  101275. *
  101276. * if (_.isError(elements)) {
  101277. * elements = [];
  101278. * }
  101279. */
  101280. var attempt = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(func, args) {
  101281. try {
  101282. return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, undefined, args);
  101283. } catch (e) {
  101284. return Object(_isError_js__WEBPACK_IMPORTED_MODULE_2__["default"])(e) ? e : new Error(e);
  101285. }
  101286. });
  101287. /* harmony default export */ __webpack_exports__["default"] = (attempt);
  101288. /***/ }),
  101289. /***/ "./node_modules/lodash-es/before.js":
  101290. /*!******************************************!*\
  101291. !*** ./node_modules/lodash-es/before.js ***!
  101292. \******************************************/
  101293. /*! exports provided: default */
  101294. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101295. "use strict";
  101296. __webpack_require__.r(__webpack_exports__);
  101297. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  101298. /** Error message constants. */
  101299. var FUNC_ERROR_TEXT = 'Expected a function';
  101300. /**
  101301. * Creates a function that invokes `func`, with the `this` binding and arguments
  101302. * of the created function, while it's called less than `n` times. Subsequent
  101303. * calls to the created function return the result of the last `func` invocation.
  101304. *
  101305. * @static
  101306. * @memberOf _
  101307. * @since 3.0.0
  101308. * @category Function
  101309. * @param {number} n The number of calls at which `func` is no longer invoked.
  101310. * @param {Function} func The function to restrict.
  101311. * @returns {Function} Returns the new restricted function.
  101312. * @example
  101313. *
  101314. * jQuery(element).on('click', _.before(5, addContactToList));
  101315. * // => Allows adding up to 4 contacts to the list.
  101316. */
  101317. function before(n, func) {
  101318. var result;
  101319. if (typeof func != 'function') {
  101320. throw new TypeError(FUNC_ERROR_TEXT);
  101321. }
  101322. n = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_0__["default"])(n);
  101323. return function() {
  101324. if (--n > 0) {
  101325. result = func.apply(this, arguments);
  101326. }
  101327. if (n <= 1) {
  101328. func = undefined;
  101329. }
  101330. return result;
  101331. };
  101332. }
  101333. /* harmony default export */ __webpack_exports__["default"] = (before);
  101334. /***/ }),
  101335. /***/ "./node_modules/lodash-es/bind.js":
  101336. /*!****************************************!*\
  101337. !*** ./node_modules/lodash-es/bind.js ***!
  101338. \****************************************/
  101339. /*! exports provided: default */
  101340. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101341. "use strict";
  101342. __webpack_require__.r(__webpack_exports__);
  101343. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  101344. /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
  101345. /* harmony import */ var _getHolder_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getHolder.js */ "./node_modules/lodash-es/_getHolder.js");
  101346. /* harmony import */ var _replaceHolders_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_replaceHolders.js */ "./node_modules/lodash-es/_replaceHolders.js");
  101347. /** Used to compose bitmasks for function metadata. */
  101348. var WRAP_BIND_FLAG = 1,
  101349. WRAP_PARTIAL_FLAG = 32;
  101350. /**
  101351. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  101352. * and `partials` prepended to the arguments it receives.
  101353. *
  101354. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  101355. * may be used as a placeholder for partially applied arguments.
  101356. *
  101357. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  101358. * property of bound functions.
  101359. *
  101360. * @static
  101361. * @memberOf _
  101362. * @since 0.1.0
  101363. * @category Function
  101364. * @param {Function} func The function to bind.
  101365. * @param {*} thisArg The `this` binding of `func`.
  101366. * @param {...*} [partials] The arguments to be partially applied.
  101367. * @returns {Function} Returns the new bound function.
  101368. * @example
  101369. *
  101370. * function greet(greeting, punctuation) {
  101371. * return greeting + ' ' + this.user + punctuation;
  101372. * }
  101373. *
  101374. * var object = { 'user': 'fred' };
  101375. *
  101376. * var bound = _.bind(greet, object, 'hi');
  101377. * bound('!');
  101378. * // => 'hi fred!'
  101379. *
  101380. * // Bound with placeholders.
  101381. * var bound = _.bind(greet, object, _, '!');
  101382. * bound('hi');
  101383. * // => 'hi fred!'
  101384. */
  101385. var bind = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(func, thisArg, partials) {
  101386. var bitmask = WRAP_BIND_FLAG;
  101387. if (partials.length) {
  101388. var holders = Object(_replaceHolders_js__WEBPACK_IMPORTED_MODULE_3__["default"])(partials, Object(_getHolder_js__WEBPACK_IMPORTED_MODULE_2__["default"])(bind));
  101389. bitmask |= WRAP_PARTIAL_FLAG;
  101390. }
  101391. return Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func, bitmask, thisArg, partials, holders);
  101392. });
  101393. // Assign default placeholders.
  101394. bind.placeholder = {};
  101395. /* harmony default export */ __webpack_exports__["default"] = (bind);
  101396. /***/ }),
  101397. /***/ "./node_modules/lodash-es/bindAll.js":
  101398. /*!*******************************************!*\
  101399. !*** ./node_modules/lodash-es/bindAll.js ***!
  101400. \*******************************************/
  101401. /*! exports provided: default */
  101402. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101403. "use strict";
  101404. __webpack_require__.r(__webpack_exports__);
  101405. /* harmony import */ var _arrayEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayEach.js */ "./node_modules/lodash-es/_arrayEach.js");
  101406. /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
  101407. /* harmony import */ var _bind_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./bind.js */ "./node_modules/lodash-es/bind.js");
  101408. /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
  101409. /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
  101410. /**
  101411. * Binds methods of an object to the object itself, overwriting the existing
  101412. * method.
  101413. *
  101414. * **Note:** This method doesn't set the "length" property of bound functions.
  101415. *
  101416. * @static
  101417. * @since 0.1.0
  101418. * @memberOf _
  101419. * @category Util
  101420. * @param {Object} object The object to bind and assign the bound methods to.
  101421. * @param {...(string|string[])} methodNames The object method names to bind.
  101422. * @returns {Object} Returns `object`.
  101423. * @example
  101424. *
  101425. * var view = {
  101426. * 'label': 'docs',
  101427. * 'click': function() {
  101428. * console.log('clicked ' + this.label);
  101429. * }
  101430. * };
  101431. *
  101432. * _.bindAll(view, ['click']);
  101433. * jQuery(element).on('click', view.click);
  101434. * // => Logs 'clicked docs' when clicked.
  101435. */
  101436. var bindAll = Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_3__["default"])(function(object, methodNames) {
  101437. Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_0__["default"])(methodNames, function(key) {
  101438. key = Object(_toKey_js__WEBPACK_IMPORTED_MODULE_4__["default"])(key);
  101439. Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, key, Object(_bind_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object[key], object));
  101440. });
  101441. return object;
  101442. });
  101443. /* harmony default export */ __webpack_exports__["default"] = (bindAll);
  101444. /***/ }),
  101445. /***/ "./node_modules/lodash-es/bindKey.js":
  101446. /*!*******************************************!*\
  101447. !*** ./node_modules/lodash-es/bindKey.js ***!
  101448. \*******************************************/
  101449. /*! exports provided: default */
  101450. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101451. "use strict";
  101452. __webpack_require__.r(__webpack_exports__);
  101453. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  101454. /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
  101455. /* harmony import */ var _getHolder_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getHolder.js */ "./node_modules/lodash-es/_getHolder.js");
  101456. /* harmony import */ var _replaceHolders_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_replaceHolders.js */ "./node_modules/lodash-es/_replaceHolders.js");
  101457. /** Used to compose bitmasks for function metadata. */
  101458. var WRAP_BIND_FLAG = 1,
  101459. WRAP_BIND_KEY_FLAG = 2,
  101460. WRAP_PARTIAL_FLAG = 32;
  101461. /**
  101462. * Creates a function that invokes the method at `object[key]` with `partials`
  101463. * prepended to the arguments it receives.
  101464. *
  101465. * This method differs from `_.bind` by allowing bound functions to reference
  101466. * methods that may be redefined or don't yet exist. See
  101467. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  101468. * for more details.
  101469. *
  101470. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  101471. * builds, may be used as a placeholder for partially applied arguments.
  101472. *
  101473. * @static
  101474. * @memberOf _
  101475. * @since 0.10.0
  101476. * @category Function
  101477. * @param {Object} object The object to invoke the method on.
  101478. * @param {string} key The key of the method.
  101479. * @param {...*} [partials] The arguments to be partially applied.
  101480. * @returns {Function} Returns the new bound function.
  101481. * @example
  101482. *
  101483. * var object = {
  101484. * 'user': 'fred',
  101485. * 'greet': function(greeting, punctuation) {
  101486. * return greeting + ' ' + this.user + punctuation;
  101487. * }
  101488. * };
  101489. *
  101490. * var bound = _.bindKey(object, 'greet', 'hi');
  101491. * bound('!');
  101492. * // => 'hi fred!'
  101493. *
  101494. * object.greet = function(greeting, punctuation) {
  101495. * return greeting + 'ya ' + this.user + punctuation;
  101496. * };
  101497. *
  101498. * bound('!');
  101499. * // => 'hiya fred!'
  101500. *
  101501. * // Bound with placeholders.
  101502. * var bound = _.bindKey(object, 'greet', _, '!');
  101503. * bound('hi');
  101504. * // => 'hiya fred!'
  101505. */
  101506. var bindKey = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(object, key, partials) {
  101507. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  101508. if (partials.length) {
  101509. var holders = Object(_replaceHolders_js__WEBPACK_IMPORTED_MODULE_3__["default"])(partials, Object(_getHolder_js__WEBPACK_IMPORTED_MODULE_2__["default"])(bindKey));
  101510. bitmask |= WRAP_PARTIAL_FLAG;
  101511. }
  101512. return Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(key, bitmask, object, partials, holders);
  101513. });
  101514. // Assign default placeholders.
  101515. bindKey.placeholder = {};
  101516. /* harmony default export */ __webpack_exports__["default"] = (bindKey);
  101517. /***/ }),
  101518. /***/ "./node_modules/lodash-es/camelCase.js":
  101519. /*!*********************************************!*\
  101520. !*** ./node_modules/lodash-es/camelCase.js ***!
  101521. \*********************************************/
  101522. /*! exports provided: default */
  101523. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101524. "use strict";
  101525. __webpack_require__.r(__webpack_exports__);
  101526. /* harmony import */ var _capitalize_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./capitalize.js */ "./node_modules/lodash-es/capitalize.js");
  101527. /* harmony import */ var _createCompounder_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createCompounder.js */ "./node_modules/lodash-es/_createCompounder.js");
  101528. /**
  101529. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  101530. *
  101531. * @static
  101532. * @memberOf _
  101533. * @since 3.0.0
  101534. * @category String
  101535. * @param {string} [string=''] The string to convert.
  101536. * @returns {string} Returns the camel cased string.
  101537. * @example
  101538. *
  101539. * _.camelCase('Foo Bar');
  101540. * // => 'fooBar'
  101541. *
  101542. * _.camelCase('--foo-bar--');
  101543. * // => 'fooBar'
  101544. *
  101545. * _.camelCase('__FOO_BAR__');
  101546. * // => 'fooBar'
  101547. */
  101548. var camelCase = Object(_createCompounder_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(result, word, index) {
  101549. word = word.toLowerCase();
  101550. return result + (index ? Object(_capitalize_js__WEBPACK_IMPORTED_MODULE_0__["default"])(word) : word);
  101551. });
  101552. /* harmony default export */ __webpack_exports__["default"] = (camelCase);
  101553. /***/ }),
  101554. /***/ "./node_modules/lodash-es/capitalize.js":
  101555. /*!**********************************************!*\
  101556. !*** ./node_modules/lodash-es/capitalize.js ***!
  101557. \**********************************************/
  101558. /*! exports provided: default */
  101559. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101560. "use strict";
  101561. __webpack_require__.r(__webpack_exports__);
  101562. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  101563. /* harmony import */ var _upperFirst_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./upperFirst.js */ "./node_modules/lodash-es/upperFirst.js");
  101564. /**
  101565. * Converts the first character of `string` to upper case and the remaining
  101566. * to lower case.
  101567. *
  101568. * @static
  101569. * @memberOf _
  101570. * @since 3.0.0
  101571. * @category String
  101572. * @param {string} [string=''] The string to capitalize.
  101573. * @returns {string} Returns the capitalized string.
  101574. * @example
  101575. *
  101576. * _.capitalize('FRED');
  101577. * // => 'Fred'
  101578. */
  101579. function capitalize(string) {
  101580. return Object(_upperFirst_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_toString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(string).toLowerCase());
  101581. }
  101582. /* harmony default export */ __webpack_exports__["default"] = (capitalize);
  101583. /***/ }),
  101584. /***/ "./node_modules/lodash-es/castArray.js":
  101585. /*!*********************************************!*\
  101586. !*** ./node_modules/lodash-es/castArray.js ***!
  101587. \*********************************************/
  101588. /*! exports provided: default */
  101589. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101590. "use strict";
  101591. __webpack_require__.r(__webpack_exports__);
  101592. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  101593. /**
  101594. * Casts `value` as an array if it's not one.
  101595. *
  101596. * @static
  101597. * @memberOf _
  101598. * @since 4.4.0
  101599. * @category Lang
  101600. * @param {*} value The value to inspect.
  101601. * @returns {Array} Returns the cast array.
  101602. * @example
  101603. *
  101604. * _.castArray(1);
  101605. * // => [1]
  101606. *
  101607. * _.castArray({ 'a': 1 });
  101608. * // => [{ 'a': 1 }]
  101609. *
  101610. * _.castArray('abc');
  101611. * // => ['abc']
  101612. *
  101613. * _.castArray(null);
  101614. * // => [null]
  101615. *
  101616. * _.castArray(undefined);
  101617. * // => [undefined]
  101618. *
  101619. * _.castArray();
  101620. * // => []
  101621. *
  101622. * var array = [1, 2, 3];
  101623. * console.log(_.castArray(array) === array);
  101624. * // => true
  101625. */
  101626. function castArray() {
  101627. if (!arguments.length) {
  101628. return [];
  101629. }
  101630. var value = arguments[0];
  101631. return Object(_isArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) ? value : [value];
  101632. }
  101633. /* harmony default export */ __webpack_exports__["default"] = (castArray);
  101634. /***/ }),
  101635. /***/ "./node_modules/lodash-es/ceil.js":
  101636. /*!****************************************!*\
  101637. !*** ./node_modules/lodash-es/ceil.js ***!
  101638. \****************************************/
  101639. /*! exports provided: default */
  101640. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101641. "use strict";
  101642. __webpack_require__.r(__webpack_exports__);
  101643. /* harmony import */ var _createRound_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createRound.js */ "./node_modules/lodash-es/_createRound.js");
  101644. /**
  101645. * Computes `number` rounded up to `precision`.
  101646. *
  101647. * @static
  101648. * @memberOf _
  101649. * @since 3.10.0
  101650. * @category Math
  101651. * @param {number} number The number to round up.
  101652. * @param {number} [precision=0] The precision to round up to.
  101653. * @returns {number} Returns the rounded up number.
  101654. * @example
  101655. *
  101656. * _.ceil(4.006);
  101657. * // => 5
  101658. *
  101659. * _.ceil(6.004, 2);
  101660. * // => 6.01
  101661. *
  101662. * _.ceil(6040, -2);
  101663. * // => 6100
  101664. */
  101665. var ceil = Object(_createRound_js__WEBPACK_IMPORTED_MODULE_0__["default"])('ceil');
  101666. /* harmony default export */ __webpack_exports__["default"] = (ceil);
  101667. /***/ }),
  101668. /***/ "./node_modules/lodash-es/chain.js":
  101669. /*!*****************************************!*\
  101670. !*** ./node_modules/lodash-es/chain.js ***!
  101671. \*****************************************/
  101672. /*! exports provided: default */
  101673. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101674. "use strict";
  101675. __webpack_require__.r(__webpack_exports__);
  101676. /* harmony import */ var _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrapperLodash.js */ "./node_modules/lodash-es/wrapperLodash.js");
  101677. /**
  101678. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  101679. * chain sequences enabled. The result of such sequences must be unwrapped
  101680. * with `_#value`.
  101681. *
  101682. * @static
  101683. * @memberOf _
  101684. * @since 1.3.0
  101685. * @category Seq
  101686. * @param {*} value The value to wrap.
  101687. * @returns {Object} Returns the new `lodash` wrapper instance.
  101688. * @example
  101689. *
  101690. * var users = [
  101691. * { 'user': 'barney', 'age': 36 },
  101692. * { 'user': 'fred', 'age': 40 },
  101693. * { 'user': 'pebbles', 'age': 1 }
  101694. * ];
  101695. *
  101696. * var youngest = _
  101697. * .chain(users)
  101698. * .sortBy('age')
  101699. * .map(function(o) {
  101700. * return o.user + ' is ' + o.age;
  101701. * })
  101702. * .head()
  101703. * .value();
  101704. * // => 'pebbles is 1'
  101705. */
  101706. function chain(value) {
  101707. var result = Object(_wrapperLodash_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  101708. result.__chain__ = true;
  101709. return result;
  101710. }
  101711. /* harmony default export */ __webpack_exports__["default"] = (chain);
  101712. /***/ }),
  101713. /***/ "./node_modules/lodash-es/chunk.js":
  101714. /*!*****************************************!*\
  101715. !*** ./node_modules/lodash-es/chunk.js ***!
  101716. \*****************************************/
  101717. /*! exports provided: default */
  101718. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101719. "use strict";
  101720. __webpack_require__.r(__webpack_exports__);
  101721. /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
  101722. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  101723. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  101724. /* Built-in method references for those with the same name as other `lodash` methods. */
  101725. var nativeCeil = Math.ceil,
  101726. nativeMax = Math.max;
  101727. /**
  101728. * Creates an array of elements split into groups the length of `size`.
  101729. * If `array` can't be split evenly, the final chunk will be the remaining
  101730. * elements.
  101731. *
  101732. * @static
  101733. * @memberOf _
  101734. * @since 3.0.0
  101735. * @category Array
  101736. * @param {Array} array The array to process.
  101737. * @param {number} [size=1] The length of each chunk
  101738. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  101739. * @returns {Array} Returns the new array of chunks.
  101740. * @example
  101741. *
  101742. * _.chunk(['a', 'b', 'c', 'd'], 2);
  101743. * // => [['a', 'b'], ['c', 'd']]
  101744. *
  101745. * _.chunk(['a', 'b', 'c', 'd'], 3);
  101746. * // => [['a', 'b', 'c'], ['d']]
  101747. */
  101748. function chunk(array, size, guard) {
  101749. if ((guard ? Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, size, guard) : size === undefined)) {
  101750. size = 1;
  101751. } else {
  101752. size = nativeMax(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(size), 0);
  101753. }
  101754. var length = array == null ? 0 : array.length;
  101755. if (!length || size < 1) {
  101756. return [];
  101757. }
  101758. var index = 0,
  101759. resIndex = 0,
  101760. result = Array(nativeCeil(length / size));
  101761. while (index < length) {
  101762. result[resIndex++] = Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, index, (index += size));
  101763. }
  101764. return result;
  101765. }
  101766. /* harmony default export */ __webpack_exports__["default"] = (chunk);
  101767. /***/ }),
  101768. /***/ "./node_modules/lodash-es/clamp.js":
  101769. /*!*****************************************!*\
  101770. !*** ./node_modules/lodash-es/clamp.js ***!
  101771. \*****************************************/
  101772. /*! exports provided: default */
  101773. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101774. "use strict";
  101775. __webpack_require__.r(__webpack_exports__);
  101776. /* harmony import */ var _baseClamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClamp.js */ "./node_modules/lodash-es/_baseClamp.js");
  101777. /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
  101778. /**
  101779. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  101780. *
  101781. * @static
  101782. * @memberOf _
  101783. * @since 4.0.0
  101784. * @category Number
  101785. * @param {number} number The number to clamp.
  101786. * @param {number} [lower] The lower bound.
  101787. * @param {number} upper The upper bound.
  101788. * @returns {number} Returns the clamped number.
  101789. * @example
  101790. *
  101791. * _.clamp(-10, -5, 5);
  101792. * // => -5
  101793. *
  101794. * _.clamp(10, -5, 5);
  101795. * // => 5
  101796. */
  101797. function clamp(number, lower, upper) {
  101798. if (upper === undefined) {
  101799. upper = lower;
  101800. lower = undefined;
  101801. }
  101802. if (upper !== undefined) {
  101803. upper = Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_1__["default"])(upper);
  101804. upper = upper === upper ? upper : 0;
  101805. }
  101806. if (lower !== undefined) {
  101807. lower = Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_1__["default"])(lower);
  101808. lower = lower === lower ? lower : 0;
  101809. }
  101810. return Object(_baseClamp_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_1__["default"])(number), lower, upper);
  101811. }
  101812. /* harmony default export */ __webpack_exports__["default"] = (clamp);
  101813. /***/ }),
  101814. /***/ "./node_modules/lodash-es/clone.js":
  101815. /*!*****************************************!*\
  101816. !*** ./node_modules/lodash-es/clone.js ***!
  101817. \*****************************************/
  101818. /*! exports provided: default */
  101819. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101820. "use strict";
  101821. __webpack_require__.r(__webpack_exports__);
  101822. /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
  101823. /** Used to compose bitmasks for cloning. */
  101824. var CLONE_SYMBOLS_FLAG = 4;
  101825. /**
  101826. * Creates a shallow clone of `value`.
  101827. *
  101828. * **Note:** This method is loosely based on the
  101829. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  101830. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  101831. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  101832. * arrays. The own enumerable properties of `arguments` objects are cloned
  101833. * as plain objects. An empty object is returned for uncloneable values such
  101834. * as error objects, functions, DOM nodes, and WeakMaps.
  101835. *
  101836. * @static
  101837. * @memberOf _
  101838. * @since 0.1.0
  101839. * @category Lang
  101840. * @param {*} value The value to clone.
  101841. * @returns {*} Returns the cloned value.
  101842. * @see _.cloneDeep
  101843. * @example
  101844. *
  101845. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  101846. *
  101847. * var shallow = _.clone(objects);
  101848. * console.log(shallow[0] === objects[0]);
  101849. * // => true
  101850. */
  101851. function clone(value) {
  101852. return Object(_baseClone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, CLONE_SYMBOLS_FLAG);
  101853. }
  101854. /* harmony default export */ __webpack_exports__["default"] = (clone);
  101855. /***/ }),
  101856. /***/ "./node_modules/lodash-es/cloneDeep.js":
  101857. /*!*********************************************!*\
  101858. !*** ./node_modules/lodash-es/cloneDeep.js ***!
  101859. \*********************************************/
  101860. /*! exports provided: default */
  101861. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101862. "use strict";
  101863. __webpack_require__.r(__webpack_exports__);
  101864. /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
  101865. /** Used to compose bitmasks for cloning. */
  101866. var CLONE_DEEP_FLAG = 1,
  101867. CLONE_SYMBOLS_FLAG = 4;
  101868. /**
  101869. * This method is like `_.clone` except that it recursively clones `value`.
  101870. *
  101871. * @static
  101872. * @memberOf _
  101873. * @since 1.0.0
  101874. * @category Lang
  101875. * @param {*} value The value to recursively clone.
  101876. * @returns {*} Returns the deep cloned value.
  101877. * @see _.clone
  101878. * @example
  101879. *
  101880. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  101881. *
  101882. * var deep = _.cloneDeep(objects);
  101883. * console.log(deep[0] === objects[0]);
  101884. * // => false
  101885. */
  101886. function cloneDeep(value) {
  101887. return Object(_baseClone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  101888. }
  101889. /* harmony default export */ __webpack_exports__["default"] = (cloneDeep);
  101890. /***/ }),
  101891. /***/ "./node_modules/lodash-es/cloneDeepWith.js":
  101892. /*!*************************************************!*\
  101893. !*** ./node_modules/lodash-es/cloneDeepWith.js ***!
  101894. \*************************************************/
  101895. /*! exports provided: default */
  101896. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101897. "use strict";
  101898. __webpack_require__.r(__webpack_exports__);
  101899. /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
  101900. /** Used to compose bitmasks for cloning. */
  101901. var CLONE_DEEP_FLAG = 1,
  101902. CLONE_SYMBOLS_FLAG = 4;
  101903. /**
  101904. * This method is like `_.cloneWith` except that it recursively clones `value`.
  101905. *
  101906. * @static
  101907. * @memberOf _
  101908. * @since 4.0.0
  101909. * @category Lang
  101910. * @param {*} value The value to recursively clone.
  101911. * @param {Function} [customizer] The function to customize cloning.
  101912. * @returns {*} Returns the deep cloned value.
  101913. * @see _.cloneWith
  101914. * @example
  101915. *
  101916. * function customizer(value) {
  101917. * if (_.isElement(value)) {
  101918. * return value.cloneNode(true);
  101919. * }
  101920. * }
  101921. *
  101922. * var el = _.cloneDeepWith(document.body, customizer);
  101923. *
  101924. * console.log(el === document.body);
  101925. * // => false
  101926. * console.log(el.nodeName);
  101927. * // => 'BODY'
  101928. * console.log(el.childNodes.length);
  101929. * // => 20
  101930. */
  101931. function cloneDeepWith(value, customizer) {
  101932. customizer = typeof customizer == 'function' ? customizer : undefined;
  101933. return Object(_baseClone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  101934. }
  101935. /* harmony default export */ __webpack_exports__["default"] = (cloneDeepWith);
  101936. /***/ }),
  101937. /***/ "./node_modules/lodash-es/cloneWith.js":
  101938. /*!*********************************************!*\
  101939. !*** ./node_modules/lodash-es/cloneWith.js ***!
  101940. \*********************************************/
  101941. /*! exports provided: default */
  101942. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101943. "use strict";
  101944. __webpack_require__.r(__webpack_exports__);
  101945. /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
  101946. /** Used to compose bitmasks for cloning. */
  101947. var CLONE_SYMBOLS_FLAG = 4;
  101948. /**
  101949. * This method is like `_.clone` except that it accepts `customizer` which
  101950. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  101951. * cloning is handled by the method instead. The `customizer` is invoked with
  101952. * up to four arguments; (value [, index|key, object, stack]).
  101953. *
  101954. * @static
  101955. * @memberOf _
  101956. * @since 4.0.0
  101957. * @category Lang
  101958. * @param {*} value The value to clone.
  101959. * @param {Function} [customizer] The function to customize cloning.
  101960. * @returns {*} Returns the cloned value.
  101961. * @see _.cloneDeepWith
  101962. * @example
  101963. *
  101964. * function customizer(value) {
  101965. * if (_.isElement(value)) {
  101966. * return value.cloneNode(false);
  101967. * }
  101968. * }
  101969. *
  101970. * var el = _.cloneWith(document.body, customizer);
  101971. *
  101972. * console.log(el === document.body);
  101973. * // => false
  101974. * console.log(el.nodeName);
  101975. * // => 'BODY'
  101976. * console.log(el.childNodes.length);
  101977. * // => 0
  101978. */
  101979. function cloneWith(value, customizer) {
  101980. customizer = typeof customizer == 'function' ? customizer : undefined;
  101981. return Object(_baseClone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, CLONE_SYMBOLS_FLAG, customizer);
  101982. }
  101983. /* harmony default export */ __webpack_exports__["default"] = (cloneWith);
  101984. /***/ }),
  101985. /***/ "./node_modules/lodash-es/collection.default.js":
  101986. /*!******************************************************!*\
  101987. !*** ./node_modules/lodash-es/collection.default.js ***!
  101988. \******************************************************/
  101989. /*! exports provided: default */
  101990. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101991. "use strict";
  101992. __webpack_require__.r(__webpack_exports__);
  101993. /* harmony import */ var _countBy_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./countBy.js */ "./node_modules/lodash-es/countBy.js");
  101994. /* harmony import */ var _each_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./each.js */ "./node_modules/lodash-es/each.js");
  101995. /* harmony import */ var _eachRight_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./eachRight.js */ "./node_modules/lodash-es/eachRight.js");
  101996. /* harmony import */ var _every_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./every.js */ "./node_modules/lodash-es/every.js");
  101997. /* harmony import */ var _filter_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./filter.js */ "./node_modules/lodash-es/filter.js");
  101998. /* harmony import */ var _find_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./find.js */ "./node_modules/lodash-es/find.js");
  101999. /* harmony import */ var _findLast_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./findLast.js */ "./node_modules/lodash-es/findLast.js");
  102000. /* harmony import */ var _flatMap_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./flatMap.js */ "./node_modules/lodash-es/flatMap.js");
  102001. /* harmony import */ var _flatMapDeep_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./flatMapDeep.js */ "./node_modules/lodash-es/flatMapDeep.js");
  102002. /* harmony import */ var _flatMapDepth_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./flatMapDepth.js */ "./node_modules/lodash-es/flatMapDepth.js");
  102003. /* harmony import */ var _forEach_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./forEach.js */ "./node_modules/lodash-es/forEach.js");
  102004. /* harmony import */ var _forEachRight_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./forEachRight.js */ "./node_modules/lodash-es/forEachRight.js");
  102005. /* harmony import */ var _groupBy_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./groupBy.js */ "./node_modules/lodash-es/groupBy.js");
  102006. /* harmony import */ var _includes_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./includes.js */ "./node_modules/lodash-es/includes.js");
  102007. /* harmony import */ var _invokeMap_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./invokeMap.js */ "./node_modules/lodash-es/invokeMap.js");
  102008. /* harmony import */ var _keyBy_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./keyBy.js */ "./node_modules/lodash-es/keyBy.js");
  102009. /* harmony import */ var _map_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./map.js */ "./node_modules/lodash-es/map.js");
  102010. /* harmony import */ var _orderBy_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./orderBy.js */ "./node_modules/lodash-es/orderBy.js");
  102011. /* harmony import */ var _partition_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./partition.js */ "./node_modules/lodash-es/partition.js");
  102012. /* harmony import */ var _reduce_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./reduce.js */ "./node_modules/lodash-es/reduce.js");
  102013. /* harmony import */ var _reduceRight_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./reduceRight.js */ "./node_modules/lodash-es/reduceRight.js");
  102014. /* harmony import */ var _reject_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./reject.js */ "./node_modules/lodash-es/reject.js");
  102015. /* harmony import */ var _sample_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./sample.js */ "./node_modules/lodash-es/sample.js");
  102016. /* harmony import */ var _sampleSize_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./sampleSize.js */ "./node_modules/lodash-es/sampleSize.js");
  102017. /* harmony import */ var _shuffle_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./shuffle.js */ "./node_modules/lodash-es/shuffle.js");
  102018. /* harmony import */ var _size_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./size.js */ "./node_modules/lodash-es/size.js");
  102019. /* harmony import */ var _some_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./some.js */ "./node_modules/lodash-es/some.js");
  102020. /* harmony import */ var _sortBy_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./sortBy.js */ "./node_modules/lodash-es/sortBy.js");
  102021. /* harmony default export */ __webpack_exports__["default"] = ({
  102022. countBy: _countBy_js__WEBPACK_IMPORTED_MODULE_0__["default"], each: _each_js__WEBPACK_IMPORTED_MODULE_1__["default"], eachRight: _eachRight_js__WEBPACK_IMPORTED_MODULE_2__["default"], every: _every_js__WEBPACK_IMPORTED_MODULE_3__["default"], filter: _filter_js__WEBPACK_IMPORTED_MODULE_4__["default"],
  102023. find: _find_js__WEBPACK_IMPORTED_MODULE_5__["default"], findLast: _findLast_js__WEBPACK_IMPORTED_MODULE_6__["default"], flatMap: _flatMap_js__WEBPACK_IMPORTED_MODULE_7__["default"], flatMapDeep: _flatMapDeep_js__WEBPACK_IMPORTED_MODULE_8__["default"], flatMapDepth: _flatMapDepth_js__WEBPACK_IMPORTED_MODULE_9__["default"],
  102024. forEach: _forEach_js__WEBPACK_IMPORTED_MODULE_10__["default"], forEachRight: _forEachRight_js__WEBPACK_IMPORTED_MODULE_11__["default"], groupBy: _groupBy_js__WEBPACK_IMPORTED_MODULE_12__["default"], includes: _includes_js__WEBPACK_IMPORTED_MODULE_13__["default"], invokeMap: _invokeMap_js__WEBPACK_IMPORTED_MODULE_14__["default"],
  102025. keyBy: _keyBy_js__WEBPACK_IMPORTED_MODULE_15__["default"], map: _map_js__WEBPACK_IMPORTED_MODULE_16__["default"], orderBy: _orderBy_js__WEBPACK_IMPORTED_MODULE_17__["default"], partition: _partition_js__WEBPACK_IMPORTED_MODULE_18__["default"], reduce: _reduce_js__WEBPACK_IMPORTED_MODULE_19__["default"],
  102026. reduceRight: _reduceRight_js__WEBPACK_IMPORTED_MODULE_20__["default"], reject: _reject_js__WEBPACK_IMPORTED_MODULE_21__["default"], sample: _sample_js__WEBPACK_IMPORTED_MODULE_22__["default"], sampleSize: _sampleSize_js__WEBPACK_IMPORTED_MODULE_23__["default"], shuffle: _shuffle_js__WEBPACK_IMPORTED_MODULE_24__["default"],
  102027. size: _size_js__WEBPACK_IMPORTED_MODULE_25__["default"], some: _some_js__WEBPACK_IMPORTED_MODULE_26__["default"], sortBy: _sortBy_js__WEBPACK_IMPORTED_MODULE_27__["default"]
  102028. });
  102029. /***/ }),
  102030. /***/ "./node_modules/lodash-es/collection.js":
  102031. /*!**********************************************!*\
  102032. !*** ./node_modules/lodash-es/collection.js ***!
  102033. \**********************************************/
  102034. /*! exports provided: countBy, each, eachRight, every, filter, find, findLast, flatMap, flatMapDeep, flatMapDepth, forEach, forEachRight, groupBy, includes, invokeMap, keyBy, map, orderBy, partition, reduce, reduceRight, reject, sample, sampleSize, shuffle, size, some, sortBy, default */
  102035. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102036. "use strict";
  102037. __webpack_require__.r(__webpack_exports__);
  102038. /* harmony import */ var _countBy_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./countBy.js */ "./node_modules/lodash-es/countBy.js");
  102039. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "countBy", function() { return _countBy_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  102040. /* harmony import */ var _each_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./each.js */ "./node_modules/lodash-es/each.js");
  102041. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "each", function() { return _each_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  102042. /* harmony import */ var _eachRight_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./eachRight.js */ "./node_modules/lodash-es/eachRight.js");
  102043. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eachRight", function() { return _eachRight_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  102044. /* harmony import */ var _every_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./every.js */ "./node_modules/lodash-es/every.js");
  102045. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "every", function() { return _every_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  102046. /* harmony import */ var _filter_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./filter.js */ "./node_modules/lodash-es/filter.js");
  102047. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return _filter_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  102048. /* harmony import */ var _find_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./find.js */ "./node_modules/lodash-es/find.js");
  102049. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "find", function() { return _find_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  102050. /* harmony import */ var _findLast_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./findLast.js */ "./node_modules/lodash-es/findLast.js");
  102051. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findLast", function() { return _findLast_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  102052. /* harmony import */ var _flatMap_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./flatMap.js */ "./node_modules/lodash-es/flatMap.js");
  102053. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatMap", function() { return _flatMap_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  102054. /* harmony import */ var _flatMapDeep_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./flatMapDeep.js */ "./node_modules/lodash-es/flatMapDeep.js");
  102055. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatMapDeep", function() { return _flatMapDeep_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  102056. /* harmony import */ var _flatMapDepth_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./flatMapDepth.js */ "./node_modules/lodash-es/flatMapDepth.js");
  102057. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatMapDepth", function() { return _flatMapDepth_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  102058. /* harmony import */ var _forEach_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./forEach.js */ "./node_modules/lodash-es/forEach.js");
  102059. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return _forEach_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  102060. /* harmony import */ var _forEachRight_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./forEachRight.js */ "./node_modules/lodash-es/forEachRight.js");
  102061. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forEachRight", function() { return _forEachRight_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  102062. /* harmony import */ var _groupBy_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./groupBy.js */ "./node_modules/lodash-es/groupBy.js");
  102063. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return _groupBy_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  102064. /* harmony import */ var _includes_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./includes.js */ "./node_modules/lodash-es/includes.js");
  102065. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "includes", function() { return _includes_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  102066. /* harmony import */ var _invokeMap_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./invokeMap.js */ "./node_modules/lodash-es/invokeMap.js");
  102067. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "invokeMap", function() { return _invokeMap_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  102068. /* harmony import */ var _keyBy_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./keyBy.js */ "./node_modules/lodash-es/keyBy.js");
  102069. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "keyBy", function() { return _keyBy_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
  102070. /* harmony import */ var _map_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./map.js */ "./node_modules/lodash-es/map.js");
  102071. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "map", function() { return _map_js__WEBPACK_IMPORTED_MODULE_16__["default"]; });
  102072. /* harmony import */ var _orderBy_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./orderBy.js */ "./node_modules/lodash-es/orderBy.js");
  102073. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "orderBy", function() { return _orderBy_js__WEBPACK_IMPORTED_MODULE_17__["default"]; });
  102074. /* harmony import */ var _partition_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./partition.js */ "./node_modules/lodash-es/partition.js");
  102075. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return _partition_js__WEBPACK_IMPORTED_MODULE_18__["default"]; });
  102076. /* harmony import */ var _reduce_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./reduce.js */ "./node_modules/lodash-es/reduce.js");
  102077. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return _reduce_js__WEBPACK_IMPORTED_MODULE_19__["default"]; });
  102078. /* harmony import */ var _reduceRight_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./reduceRight.js */ "./node_modules/lodash-es/reduceRight.js");
  102079. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reduceRight", function() { return _reduceRight_js__WEBPACK_IMPORTED_MODULE_20__["default"]; });
  102080. /* harmony import */ var _reject_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./reject.js */ "./node_modules/lodash-es/reject.js");
  102081. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reject", function() { return _reject_js__WEBPACK_IMPORTED_MODULE_21__["default"]; });
  102082. /* harmony import */ var _sample_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./sample.js */ "./node_modules/lodash-es/sample.js");
  102083. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return _sample_js__WEBPACK_IMPORTED_MODULE_22__["default"]; });
  102084. /* harmony import */ var _sampleSize_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./sampleSize.js */ "./node_modules/lodash-es/sampleSize.js");
  102085. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sampleSize", function() { return _sampleSize_js__WEBPACK_IMPORTED_MODULE_23__["default"]; });
  102086. /* harmony import */ var _shuffle_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./shuffle.js */ "./node_modules/lodash-es/shuffle.js");
  102087. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "shuffle", function() { return _shuffle_js__WEBPACK_IMPORTED_MODULE_24__["default"]; });
  102088. /* harmony import */ var _size_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./size.js */ "./node_modules/lodash-es/size.js");
  102089. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "size", function() { return _size_js__WEBPACK_IMPORTED_MODULE_25__["default"]; });
  102090. /* harmony import */ var _some_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./some.js */ "./node_modules/lodash-es/some.js");
  102091. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "some", function() { return _some_js__WEBPACK_IMPORTED_MODULE_26__["default"]; });
  102092. /* harmony import */ var _sortBy_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./sortBy.js */ "./node_modules/lodash-es/sortBy.js");
  102093. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortBy", function() { return _sortBy_js__WEBPACK_IMPORTED_MODULE_27__["default"]; });
  102094. /* harmony import */ var _collection_default_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./collection.default.js */ "./node_modules/lodash-es/collection.default.js");
  102095. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _collection_default_js__WEBPACK_IMPORTED_MODULE_28__["default"]; });
  102096. /***/ }),
  102097. /***/ "./node_modules/lodash-es/commit.js":
  102098. /*!******************************************!*\
  102099. !*** ./node_modules/lodash-es/commit.js ***!
  102100. \******************************************/
  102101. /*! exports provided: default */
  102102. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102103. "use strict";
  102104. __webpack_require__.r(__webpack_exports__);
  102105. /* harmony import */ var _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LodashWrapper.js */ "./node_modules/lodash-es/_LodashWrapper.js");
  102106. /**
  102107. * Executes the chain sequence and returns the wrapped result.
  102108. *
  102109. * @name commit
  102110. * @memberOf _
  102111. * @since 3.2.0
  102112. * @category Seq
  102113. * @returns {Object} Returns the new `lodash` wrapper instance.
  102114. * @example
  102115. *
  102116. * var array = [1, 2];
  102117. * var wrapped = _(array).push(3);
  102118. *
  102119. * console.log(array);
  102120. * // => [1, 2]
  102121. *
  102122. * wrapped = wrapped.commit();
  102123. * console.log(array);
  102124. * // => [1, 2, 3]
  102125. *
  102126. * wrapped.last();
  102127. * // => 3
  102128. *
  102129. * console.log(array);
  102130. * // => [1, 2, 3]
  102131. */
  102132. function wrapperCommit() {
  102133. return new _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"](this.value(), this.__chain__);
  102134. }
  102135. /* harmony default export */ __webpack_exports__["default"] = (wrapperCommit);
  102136. /***/ }),
  102137. /***/ "./node_modules/lodash-es/compact.js":
  102138. /*!*******************************************!*\
  102139. !*** ./node_modules/lodash-es/compact.js ***!
  102140. \*******************************************/
  102141. /*! exports provided: default */
  102142. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102143. "use strict";
  102144. __webpack_require__.r(__webpack_exports__);
  102145. /**
  102146. * Creates an array with all falsey values removed. The values `false`, `null`,
  102147. * `0`, `""`, `undefined`, and `NaN` are falsey.
  102148. *
  102149. * @static
  102150. * @memberOf _
  102151. * @since 0.1.0
  102152. * @category Array
  102153. * @param {Array} array The array to compact.
  102154. * @returns {Array} Returns the new array of filtered values.
  102155. * @example
  102156. *
  102157. * _.compact([0, 1, false, 2, '', 3]);
  102158. * // => [1, 2, 3]
  102159. */
  102160. function compact(array) {
  102161. var index = -1,
  102162. length = array == null ? 0 : array.length,
  102163. resIndex = 0,
  102164. result = [];
  102165. while (++index < length) {
  102166. var value = array[index];
  102167. if (value) {
  102168. result[resIndex++] = value;
  102169. }
  102170. }
  102171. return result;
  102172. }
  102173. /* harmony default export */ __webpack_exports__["default"] = (compact);
  102174. /***/ }),
  102175. /***/ "./node_modules/lodash-es/concat.js":
  102176. /*!******************************************!*\
  102177. !*** ./node_modules/lodash-es/concat.js ***!
  102178. \******************************************/
  102179. /*! exports provided: default */
  102180. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102181. "use strict";
  102182. __webpack_require__.r(__webpack_exports__);
  102183. /* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayPush.js */ "./node_modules/lodash-es/_arrayPush.js");
  102184. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  102185. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  102186. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  102187. /**
  102188. * Creates a new array concatenating `array` with any additional arrays
  102189. * and/or values.
  102190. *
  102191. * @static
  102192. * @memberOf _
  102193. * @since 4.0.0
  102194. * @category Array
  102195. * @param {Array} array The array to concatenate.
  102196. * @param {...*} [values] The values to concatenate.
  102197. * @returns {Array} Returns the new concatenated array.
  102198. * @example
  102199. *
  102200. * var array = [1];
  102201. * var other = _.concat(array, 2, [3], [[4]]);
  102202. *
  102203. * console.log(other);
  102204. * // => [1, 2, 3, [4]]
  102205. *
  102206. * console.log(array);
  102207. * // => [1]
  102208. */
  102209. function concat() {
  102210. var length = arguments.length;
  102211. if (!length) {
  102212. return [];
  102213. }
  102214. var args = Array(length - 1),
  102215. array = arguments[0],
  102216. index = length;
  102217. while (index--) {
  102218. args[index - 1] = arguments[index];
  102219. }
  102220. return Object(_arrayPush_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(array) ? Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(array) : [array], Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__["default"])(args, 1));
  102221. }
  102222. /* harmony default export */ __webpack_exports__["default"] = (concat);
  102223. /***/ }),
  102224. /***/ "./node_modules/lodash-es/cond.js":
  102225. /*!****************************************!*\
  102226. !*** ./node_modules/lodash-es/cond.js ***!
  102227. \****************************************/
  102228. /*! exports provided: default */
  102229. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102230. "use strict";
  102231. __webpack_require__.r(__webpack_exports__);
  102232. /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  102233. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  102234. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  102235. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  102236. /** Error message constants. */
  102237. var FUNC_ERROR_TEXT = 'Expected a function';
  102238. /**
  102239. * Creates a function that iterates over `pairs` and invokes the corresponding
  102240. * function of the first predicate to return truthy. The predicate-function
  102241. * pairs are invoked with the `this` binding and arguments of the created
  102242. * function.
  102243. *
  102244. * @static
  102245. * @memberOf _
  102246. * @since 4.0.0
  102247. * @category Util
  102248. * @param {Array} pairs The predicate-function pairs.
  102249. * @returns {Function} Returns the new composite function.
  102250. * @example
  102251. *
  102252. * var func = _.cond([
  102253. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  102254. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  102255. * [_.stubTrue, _.constant('no match')]
  102256. * ]);
  102257. *
  102258. * func({ 'a': 1, 'b': 2 });
  102259. * // => 'matches A'
  102260. *
  102261. * func({ 'a': 0, 'b': 1 });
  102262. * // => 'matches B'
  102263. *
  102264. * func({ 'a': '1', 'b': '2' });
  102265. * // => 'no match'
  102266. */
  102267. function cond(pairs) {
  102268. var length = pairs == null ? 0 : pairs.length,
  102269. toIteratee = _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"];
  102270. pairs = !length ? [] : Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(pairs, function(pair) {
  102271. if (typeof pair[1] != 'function') {
  102272. throw new TypeError(FUNC_ERROR_TEXT);
  102273. }
  102274. return [toIteratee(pair[0]), pair[1]];
  102275. });
  102276. return Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_3__["default"])(function(args) {
  102277. var index = -1;
  102278. while (++index < length) {
  102279. var pair = pairs[index];
  102280. if (Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(pair[0], this, args)) {
  102281. return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(pair[1], this, args);
  102282. }
  102283. }
  102284. });
  102285. }
  102286. /* harmony default export */ __webpack_exports__["default"] = (cond);
  102287. /***/ }),
  102288. /***/ "./node_modules/lodash-es/conforms.js":
  102289. /*!********************************************!*\
  102290. !*** ./node_modules/lodash-es/conforms.js ***!
  102291. \********************************************/
  102292. /*! exports provided: default */
  102293. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102294. "use strict";
  102295. __webpack_require__.r(__webpack_exports__);
  102296. /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
  102297. /* harmony import */ var _baseConforms_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseConforms.js */ "./node_modules/lodash-es/_baseConforms.js");
  102298. /** Used to compose bitmasks for cloning. */
  102299. var CLONE_DEEP_FLAG = 1;
  102300. /**
  102301. * Creates a function that invokes the predicate properties of `source` with
  102302. * the corresponding property values of a given object, returning `true` if
  102303. * all predicates return truthy, else `false`.
  102304. *
  102305. * **Note:** The created function is equivalent to `_.conformsTo` with
  102306. * `source` partially applied.
  102307. *
  102308. * @static
  102309. * @memberOf _
  102310. * @since 4.0.0
  102311. * @category Util
  102312. * @param {Object} source The object of property predicates to conform to.
  102313. * @returns {Function} Returns the new spec function.
  102314. * @example
  102315. *
  102316. * var objects = [
  102317. * { 'a': 2, 'b': 1 },
  102318. * { 'a': 1, 'b': 2 }
  102319. * ];
  102320. *
  102321. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  102322. * // => [{ 'a': 1, 'b': 2 }]
  102323. */
  102324. function conforms(source) {
  102325. return Object(_baseConforms_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_baseClone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, CLONE_DEEP_FLAG));
  102326. }
  102327. /* harmony default export */ __webpack_exports__["default"] = (conforms);
  102328. /***/ }),
  102329. /***/ "./node_modules/lodash-es/conformsTo.js":
  102330. /*!**********************************************!*\
  102331. !*** ./node_modules/lodash-es/conformsTo.js ***!
  102332. \**********************************************/
  102333. /*! exports provided: default */
  102334. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102335. "use strict";
  102336. __webpack_require__.r(__webpack_exports__);
  102337. /* harmony import */ var _baseConformsTo_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseConformsTo.js */ "./node_modules/lodash-es/_baseConformsTo.js");
  102338. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  102339. /**
  102340. * Checks if `object` conforms to `source` by invoking the predicate
  102341. * properties of `source` with the corresponding property values of `object`.
  102342. *
  102343. * **Note:** This method is equivalent to `_.conforms` when `source` is
  102344. * partially applied.
  102345. *
  102346. * @static
  102347. * @memberOf _
  102348. * @since 4.14.0
  102349. * @category Lang
  102350. * @param {Object} object The object to inspect.
  102351. * @param {Object} source The object of property predicates to conform to.
  102352. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  102353. * @example
  102354. *
  102355. * var object = { 'a': 1, 'b': 2 };
  102356. *
  102357. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  102358. * // => true
  102359. *
  102360. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  102361. * // => false
  102362. */
  102363. function conformsTo(object, source) {
  102364. return source == null || Object(_baseConformsTo_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, source, Object(_keys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source));
  102365. }
  102366. /* harmony default export */ __webpack_exports__["default"] = (conformsTo);
  102367. /***/ }),
  102368. /***/ "./node_modules/lodash-es/constant.js":
  102369. /*!********************************************!*\
  102370. !*** ./node_modules/lodash-es/constant.js ***!
  102371. \********************************************/
  102372. /*! exports provided: default */
  102373. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102374. "use strict";
  102375. __webpack_require__.r(__webpack_exports__);
  102376. /**
  102377. * Creates a function that returns `value`.
  102378. *
  102379. * @static
  102380. * @memberOf _
  102381. * @since 2.4.0
  102382. * @category Util
  102383. * @param {*} value The value to return from the new function.
  102384. * @returns {Function} Returns the new constant function.
  102385. * @example
  102386. *
  102387. * var objects = _.times(2, _.constant({ 'a': 1 }));
  102388. *
  102389. * console.log(objects);
  102390. * // => [{ 'a': 1 }, { 'a': 1 }]
  102391. *
  102392. * console.log(objects[0] === objects[1]);
  102393. * // => true
  102394. */
  102395. function constant(value) {
  102396. return function() {
  102397. return value;
  102398. };
  102399. }
  102400. /* harmony default export */ __webpack_exports__["default"] = (constant);
  102401. /***/ }),
  102402. /***/ "./node_modules/lodash-es/countBy.js":
  102403. /*!*******************************************!*\
  102404. !*** ./node_modules/lodash-es/countBy.js ***!
  102405. \*******************************************/
  102406. /*! exports provided: default */
  102407. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102408. "use strict";
  102409. __webpack_require__.r(__webpack_exports__);
  102410. /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
  102411. /* harmony import */ var _createAggregator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createAggregator.js */ "./node_modules/lodash-es/_createAggregator.js");
  102412. /** Used for built-in method references. */
  102413. var objectProto = Object.prototype;
  102414. /** Used to check objects for own properties. */
  102415. var hasOwnProperty = objectProto.hasOwnProperty;
  102416. /**
  102417. * Creates an object composed of keys generated from the results of running
  102418. * each element of `collection` thru `iteratee`. The corresponding value of
  102419. * each key is the number of times the key was returned by `iteratee`. The
  102420. * iteratee is invoked with one argument: (value).
  102421. *
  102422. * @static
  102423. * @memberOf _
  102424. * @since 0.5.0
  102425. * @category Collection
  102426. * @param {Array|Object} collection The collection to iterate over.
  102427. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  102428. * @returns {Object} Returns the composed aggregate object.
  102429. * @example
  102430. *
  102431. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  102432. * // => { '4': 1, '6': 2 }
  102433. *
  102434. * // The `_.property` iteratee shorthand.
  102435. * _.countBy(['one', 'two', 'three'], 'length');
  102436. * // => { '3': 2, '5': 1 }
  102437. */
  102438. var countBy = Object(_createAggregator_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(result, value, key) {
  102439. if (hasOwnProperty.call(result, key)) {
  102440. ++result[key];
  102441. } else {
  102442. Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, key, 1);
  102443. }
  102444. });
  102445. /* harmony default export */ __webpack_exports__["default"] = (countBy);
  102446. /***/ }),
  102447. /***/ "./node_modules/lodash-es/create.js":
  102448. /*!******************************************!*\
  102449. !*** ./node_modules/lodash-es/create.js ***!
  102450. \******************************************/
  102451. /*! exports provided: default */
  102452. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102453. "use strict";
  102454. __webpack_require__.r(__webpack_exports__);
  102455. /* harmony import */ var _baseAssign_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAssign.js */ "./node_modules/lodash-es/_baseAssign.js");
  102456. /* harmony import */ var _baseCreate_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseCreate.js */ "./node_modules/lodash-es/_baseCreate.js");
  102457. /**
  102458. * Creates an object that inherits from the `prototype` object. If a
  102459. * `properties` object is given, its own enumerable string keyed properties
  102460. * are assigned to the created object.
  102461. *
  102462. * @static
  102463. * @memberOf _
  102464. * @since 2.3.0
  102465. * @category Object
  102466. * @param {Object} prototype The object to inherit from.
  102467. * @param {Object} [properties] The properties to assign to the object.
  102468. * @returns {Object} Returns the new object.
  102469. * @example
  102470. *
  102471. * function Shape() {
  102472. * this.x = 0;
  102473. * this.y = 0;
  102474. * }
  102475. *
  102476. * function Circle() {
  102477. * Shape.call(this);
  102478. * }
  102479. *
  102480. * Circle.prototype = _.create(Shape.prototype, {
  102481. * 'constructor': Circle
  102482. * });
  102483. *
  102484. * var circle = new Circle;
  102485. * circle instanceof Circle;
  102486. * // => true
  102487. *
  102488. * circle instanceof Shape;
  102489. * // => true
  102490. */
  102491. function create(prototype, properties) {
  102492. var result = Object(_baseCreate_js__WEBPACK_IMPORTED_MODULE_1__["default"])(prototype);
  102493. return properties == null ? result : Object(_baseAssign_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, properties);
  102494. }
  102495. /* harmony default export */ __webpack_exports__["default"] = (create);
  102496. /***/ }),
  102497. /***/ "./node_modules/lodash-es/curry.js":
  102498. /*!*****************************************!*\
  102499. !*** ./node_modules/lodash-es/curry.js ***!
  102500. \*****************************************/
  102501. /*! exports provided: default */
  102502. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102503. "use strict";
  102504. __webpack_require__.r(__webpack_exports__);
  102505. /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
  102506. /** Used to compose bitmasks for function metadata. */
  102507. var WRAP_CURRY_FLAG = 8;
  102508. /**
  102509. * Creates a function that accepts arguments of `func` and either invokes
  102510. * `func` returning its result, if at least `arity` number of arguments have
  102511. * been provided, or returns a function that accepts the remaining `func`
  102512. * arguments, and so on. The arity of `func` may be specified if `func.length`
  102513. * is not sufficient.
  102514. *
  102515. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  102516. * may be used as a placeholder for provided arguments.
  102517. *
  102518. * **Note:** This method doesn't set the "length" property of curried functions.
  102519. *
  102520. * @static
  102521. * @memberOf _
  102522. * @since 2.0.0
  102523. * @category Function
  102524. * @param {Function} func The function to curry.
  102525. * @param {number} [arity=func.length] The arity of `func`.
  102526. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  102527. * @returns {Function} Returns the new curried function.
  102528. * @example
  102529. *
  102530. * var abc = function(a, b, c) {
  102531. * return [a, b, c];
  102532. * };
  102533. *
  102534. * var curried = _.curry(abc);
  102535. *
  102536. * curried(1)(2)(3);
  102537. * // => [1, 2, 3]
  102538. *
  102539. * curried(1, 2)(3);
  102540. * // => [1, 2, 3]
  102541. *
  102542. * curried(1, 2, 3);
  102543. * // => [1, 2, 3]
  102544. *
  102545. * // Curried with placeholders.
  102546. * curried(1)(_, 3)(2);
  102547. * // => [1, 2, 3]
  102548. */
  102549. function curry(func, arity, guard) {
  102550. arity = guard ? undefined : arity;
  102551. var result = Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  102552. result.placeholder = curry.placeholder;
  102553. return result;
  102554. }
  102555. // Assign default placeholders.
  102556. curry.placeholder = {};
  102557. /* harmony default export */ __webpack_exports__["default"] = (curry);
  102558. /***/ }),
  102559. /***/ "./node_modules/lodash-es/curryRight.js":
  102560. /*!**********************************************!*\
  102561. !*** ./node_modules/lodash-es/curryRight.js ***!
  102562. \**********************************************/
  102563. /*! exports provided: default */
  102564. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102565. "use strict";
  102566. __webpack_require__.r(__webpack_exports__);
  102567. /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
  102568. /** Used to compose bitmasks for function metadata. */
  102569. var WRAP_CURRY_RIGHT_FLAG = 16;
  102570. /**
  102571. * This method is like `_.curry` except that arguments are applied to `func`
  102572. * in the manner of `_.partialRight` instead of `_.partial`.
  102573. *
  102574. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  102575. * builds, may be used as a placeholder for provided arguments.
  102576. *
  102577. * **Note:** This method doesn't set the "length" property of curried functions.
  102578. *
  102579. * @static
  102580. * @memberOf _
  102581. * @since 3.0.0
  102582. * @category Function
  102583. * @param {Function} func The function to curry.
  102584. * @param {number} [arity=func.length] The arity of `func`.
  102585. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  102586. * @returns {Function} Returns the new curried function.
  102587. * @example
  102588. *
  102589. * var abc = function(a, b, c) {
  102590. * return [a, b, c];
  102591. * };
  102592. *
  102593. * var curried = _.curryRight(abc);
  102594. *
  102595. * curried(3)(2)(1);
  102596. * // => [1, 2, 3]
  102597. *
  102598. * curried(2, 3)(1);
  102599. * // => [1, 2, 3]
  102600. *
  102601. * curried(1, 2, 3);
  102602. * // => [1, 2, 3]
  102603. *
  102604. * // Curried with placeholders.
  102605. * curried(3)(1, _)(2);
  102606. * // => [1, 2, 3]
  102607. */
  102608. function curryRight(func, arity, guard) {
  102609. arity = guard ? undefined : arity;
  102610. var result = Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  102611. result.placeholder = curryRight.placeholder;
  102612. return result;
  102613. }
  102614. // Assign default placeholders.
  102615. curryRight.placeholder = {};
  102616. /* harmony default export */ __webpack_exports__["default"] = (curryRight);
  102617. /***/ }),
  102618. /***/ "./node_modules/lodash-es/date.default.js":
  102619. /*!************************************************!*\
  102620. !*** ./node_modules/lodash-es/date.default.js ***!
  102621. \************************************************/
  102622. /*! exports provided: default */
  102623. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102624. "use strict";
  102625. __webpack_require__.r(__webpack_exports__);
  102626. /* harmony import */ var _now_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./now.js */ "./node_modules/lodash-es/now.js");
  102627. /* harmony default export */ __webpack_exports__["default"] = ({
  102628. now: _now_js__WEBPACK_IMPORTED_MODULE_0__["default"]
  102629. });
  102630. /***/ }),
  102631. /***/ "./node_modules/lodash-es/date.js":
  102632. /*!****************************************!*\
  102633. !*** ./node_modules/lodash-es/date.js ***!
  102634. \****************************************/
  102635. /*! exports provided: now, default */
  102636. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102637. "use strict";
  102638. __webpack_require__.r(__webpack_exports__);
  102639. /* harmony import */ var _now_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./now.js */ "./node_modules/lodash-es/now.js");
  102640. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "now", function() { return _now_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  102641. /* harmony import */ var _date_default_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./date.default.js */ "./node_modules/lodash-es/date.default.js");
  102642. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _date_default_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  102643. /***/ }),
  102644. /***/ "./node_modules/lodash-es/debounce.js":
  102645. /*!********************************************!*\
  102646. !*** ./node_modules/lodash-es/debounce.js ***!
  102647. \********************************************/
  102648. /*! exports provided: default */
  102649. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102650. "use strict";
  102651. __webpack_require__.r(__webpack_exports__);
  102652. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  102653. /* harmony import */ var _now_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./now.js */ "./node_modules/lodash-es/now.js");
  102654. /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
  102655. /** Error message constants. */
  102656. var FUNC_ERROR_TEXT = 'Expected a function';
  102657. /* Built-in method references for those with the same name as other `lodash` methods. */
  102658. var nativeMax = Math.max,
  102659. nativeMin = Math.min;
  102660. /**
  102661. * Creates a debounced function that delays invoking `func` until after `wait`
  102662. * milliseconds have elapsed since the last time the debounced function was
  102663. * invoked. The debounced function comes with a `cancel` method to cancel
  102664. * delayed `func` invocations and a `flush` method to immediately invoke them.
  102665. * Provide `options` to indicate whether `func` should be invoked on the
  102666. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  102667. * with the last arguments provided to the debounced function. Subsequent
  102668. * calls to the debounced function return the result of the last `func`
  102669. * invocation.
  102670. *
  102671. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  102672. * invoked on the trailing edge of the timeout only if the debounced function
  102673. * is invoked more than once during the `wait` timeout.
  102674. *
  102675. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  102676. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  102677. *
  102678. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  102679. * for details over the differences between `_.debounce` and `_.throttle`.
  102680. *
  102681. * @static
  102682. * @memberOf _
  102683. * @since 0.1.0
  102684. * @category Function
  102685. * @param {Function} func The function to debounce.
  102686. * @param {number} [wait=0] The number of milliseconds to delay.
  102687. * @param {Object} [options={}] The options object.
  102688. * @param {boolean} [options.leading=false]
  102689. * Specify invoking on the leading edge of the timeout.
  102690. * @param {number} [options.maxWait]
  102691. * The maximum time `func` is allowed to be delayed before it's invoked.
  102692. * @param {boolean} [options.trailing=true]
  102693. * Specify invoking on the trailing edge of the timeout.
  102694. * @returns {Function} Returns the new debounced function.
  102695. * @example
  102696. *
  102697. * // Avoid costly calculations while the window size is in flux.
  102698. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  102699. *
  102700. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  102701. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  102702. * 'leading': true,
  102703. * 'trailing': false
  102704. * }));
  102705. *
  102706. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  102707. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  102708. * var source = new EventSource('/stream');
  102709. * jQuery(source).on('message', debounced);
  102710. *
  102711. * // Cancel the trailing debounced invocation.
  102712. * jQuery(window).on('popstate', debounced.cancel);
  102713. */
  102714. function debounce(func, wait, options) {
  102715. var lastArgs,
  102716. lastThis,
  102717. maxWait,
  102718. result,
  102719. timerId,
  102720. lastCallTime,
  102721. lastInvokeTime = 0,
  102722. leading = false,
  102723. maxing = false,
  102724. trailing = true;
  102725. if (typeof func != 'function') {
  102726. throw new TypeError(FUNC_ERROR_TEXT);
  102727. }
  102728. wait = Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_2__["default"])(wait) || 0;
  102729. if (Object(_isObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(options)) {
  102730. leading = !!options.leading;
  102731. maxing = 'maxWait' in options;
  102732. maxWait = maxing ? nativeMax(Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_2__["default"])(options.maxWait) || 0, wait) : maxWait;
  102733. trailing = 'trailing' in options ? !!options.trailing : trailing;
  102734. }
  102735. function invokeFunc(time) {
  102736. var args = lastArgs,
  102737. thisArg = lastThis;
  102738. lastArgs = lastThis = undefined;
  102739. lastInvokeTime = time;
  102740. result = func.apply(thisArg, args);
  102741. return result;
  102742. }
  102743. function leadingEdge(time) {
  102744. // Reset any `maxWait` timer.
  102745. lastInvokeTime = time;
  102746. // Start the timer for the trailing edge.
  102747. timerId = setTimeout(timerExpired, wait);
  102748. // Invoke the leading edge.
  102749. return leading ? invokeFunc(time) : result;
  102750. }
  102751. function remainingWait(time) {
  102752. var timeSinceLastCall = time - lastCallTime,
  102753. timeSinceLastInvoke = time - lastInvokeTime,
  102754. timeWaiting = wait - timeSinceLastCall;
  102755. return maxing
  102756. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  102757. : timeWaiting;
  102758. }
  102759. function shouldInvoke(time) {
  102760. var timeSinceLastCall = time - lastCallTime,
  102761. timeSinceLastInvoke = time - lastInvokeTime;
  102762. // Either this is the first call, activity has stopped and we're at the
  102763. // trailing edge, the system time has gone backwards and we're treating
  102764. // it as the trailing edge, or we've hit the `maxWait` limit.
  102765. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  102766. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  102767. }
  102768. function timerExpired() {
  102769. var time = Object(_now_js__WEBPACK_IMPORTED_MODULE_1__["default"])();
  102770. if (shouldInvoke(time)) {
  102771. return trailingEdge(time);
  102772. }
  102773. // Restart the timer.
  102774. timerId = setTimeout(timerExpired, remainingWait(time));
  102775. }
  102776. function trailingEdge(time) {
  102777. timerId = undefined;
  102778. // Only invoke if we have `lastArgs` which means `func` has been
  102779. // debounced at least once.
  102780. if (trailing && lastArgs) {
  102781. return invokeFunc(time);
  102782. }
  102783. lastArgs = lastThis = undefined;
  102784. return result;
  102785. }
  102786. function cancel() {
  102787. if (timerId !== undefined) {
  102788. clearTimeout(timerId);
  102789. }
  102790. lastInvokeTime = 0;
  102791. lastArgs = lastCallTime = lastThis = timerId = undefined;
  102792. }
  102793. function flush() {
  102794. return timerId === undefined ? result : trailingEdge(Object(_now_js__WEBPACK_IMPORTED_MODULE_1__["default"])());
  102795. }
  102796. function debounced() {
  102797. var time = Object(_now_js__WEBPACK_IMPORTED_MODULE_1__["default"])(),
  102798. isInvoking = shouldInvoke(time);
  102799. lastArgs = arguments;
  102800. lastThis = this;
  102801. lastCallTime = time;
  102802. if (isInvoking) {
  102803. if (timerId === undefined) {
  102804. return leadingEdge(lastCallTime);
  102805. }
  102806. if (maxing) {
  102807. // Handle invocations in a tight loop.
  102808. clearTimeout(timerId);
  102809. timerId = setTimeout(timerExpired, wait);
  102810. return invokeFunc(lastCallTime);
  102811. }
  102812. }
  102813. if (timerId === undefined) {
  102814. timerId = setTimeout(timerExpired, wait);
  102815. }
  102816. return result;
  102817. }
  102818. debounced.cancel = cancel;
  102819. debounced.flush = flush;
  102820. return debounced;
  102821. }
  102822. /* harmony default export */ __webpack_exports__["default"] = (debounce);
  102823. /***/ }),
  102824. /***/ "./node_modules/lodash-es/deburr.js":
  102825. /*!******************************************!*\
  102826. !*** ./node_modules/lodash-es/deburr.js ***!
  102827. \******************************************/
  102828. /*! exports provided: default */
  102829. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102830. "use strict";
  102831. __webpack_require__.r(__webpack_exports__);
  102832. /* harmony import */ var _deburrLetter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_deburrLetter.js */ "./node_modules/lodash-es/_deburrLetter.js");
  102833. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  102834. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  102835. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  102836. /** Used to compose unicode character classes. */
  102837. var rsComboMarksRange = '\\u0300-\\u036f',
  102838. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  102839. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  102840. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
  102841. /** Used to compose unicode capture groups. */
  102842. var rsCombo = '[' + rsComboRange + ']';
  102843. /**
  102844. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  102845. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  102846. */
  102847. var reComboMark = RegExp(rsCombo, 'g');
  102848. /**
  102849. * Deburrs `string` by converting
  102850. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  102851. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  102852. * letters to basic Latin letters and removing
  102853. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  102854. *
  102855. * @static
  102856. * @memberOf _
  102857. * @since 3.0.0
  102858. * @category String
  102859. * @param {string} [string=''] The string to deburr.
  102860. * @returns {string} Returns the deburred string.
  102861. * @example
  102862. *
  102863. * _.deburr('déjà vu');
  102864. * // => 'deja vu'
  102865. */
  102866. function deburr(string) {
  102867. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string);
  102868. return string && string.replace(reLatin, _deburrLetter_js__WEBPACK_IMPORTED_MODULE_0__["default"]).replace(reComboMark, '');
  102869. }
  102870. /* harmony default export */ __webpack_exports__["default"] = (deburr);
  102871. /***/ }),
  102872. /***/ "./node_modules/lodash-es/defaultTo.js":
  102873. /*!*********************************************!*\
  102874. !*** ./node_modules/lodash-es/defaultTo.js ***!
  102875. \*********************************************/
  102876. /*! exports provided: default */
  102877. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102878. "use strict";
  102879. __webpack_require__.r(__webpack_exports__);
  102880. /**
  102881. * Checks `value` to determine whether a default value should be returned in
  102882. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  102883. * or `undefined`.
  102884. *
  102885. * @static
  102886. * @memberOf _
  102887. * @since 4.14.0
  102888. * @category Util
  102889. * @param {*} value The value to check.
  102890. * @param {*} defaultValue The default value.
  102891. * @returns {*} Returns the resolved value.
  102892. * @example
  102893. *
  102894. * _.defaultTo(1, 10);
  102895. * // => 1
  102896. *
  102897. * _.defaultTo(undefined, 10);
  102898. * // => 10
  102899. */
  102900. function defaultTo(value, defaultValue) {
  102901. return (value == null || value !== value) ? defaultValue : value;
  102902. }
  102903. /* harmony default export */ __webpack_exports__["default"] = (defaultTo);
  102904. /***/ }),
  102905. /***/ "./node_modules/lodash-es/defaults.js":
  102906. /*!********************************************!*\
  102907. !*** ./node_modules/lodash-es/defaults.js ***!
  102908. \********************************************/
  102909. /*! exports provided: default */
  102910. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102911. "use strict";
  102912. __webpack_require__.r(__webpack_exports__);
  102913. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  102914. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  102915. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  102916. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  102917. /** Used for built-in method references. */
  102918. var objectProto = Object.prototype;
  102919. /** Used to check objects for own properties. */
  102920. var hasOwnProperty = objectProto.hasOwnProperty;
  102921. /**
  102922. * Assigns own and inherited enumerable string keyed properties of source
  102923. * objects to the destination object for all destination properties that
  102924. * resolve to `undefined`. Source objects are applied from left to right.
  102925. * Once a property is set, additional values of the same property are ignored.
  102926. *
  102927. * **Note:** This method mutates `object`.
  102928. *
  102929. * @static
  102930. * @since 0.1.0
  102931. * @memberOf _
  102932. * @category Object
  102933. * @param {Object} object The destination object.
  102934. * @param {...Object} [sources] The source objects.
  102935. * @returns {Object} Returns `object`.
  102936. * @see _.defaultsDeep
  102937. * @example
  102938. *
  102939. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  102940. * // => { 'a': 1, 'b': 2 }
  102941. */
  102942. var defaults = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(object, sources) {
  102943. object = Object(object);
  102944. var index = -1;
  102945. var length = sources.length;
  102946. var guard = length > 2 ? sources[2] : undefined;
  102947. if (guard && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_2__["default"])(sources[0], sources[1], guard)) {
  102948. length = 1;
  102949. }
  102950. while (++index < length) {
  102951. var source = sources[index];
  102952. var props = Object(_keysIn_js__WEBPACK_IMPORTED_MODULE_3__["default"])(source);
  102953. var propsIndex = -1;
  102954. var propsLength = props.length;
  102955. while (++propsIndex < propsLength) {
  102956. var key = props[propsIndex];
  102957. var value = object[key];
  102958. if (value === undefined ||
  102959. (Object(_eq_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  102960. object[key] = source[key];
  102961. }
  102962. }
  102963. }
  102964. return object;
  102965. });
  102966. /* harmony default export */ __webpack_exports__["default"] = (defaults);
  102967. /***/ }),
  102968. /***/ "./node_modules/lodash-es/defaultsDeep.js":
  102969. /*!************************************************!*\
  102970. !*** ./node_modules/lodash-es/defaultsDeep.js ***!
  102971. \************************************************/
  102972. /*! exports provided: default */
  102973. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  102974. "use strict";
  102975. __webpack_require__.r(__webpack_exports__);
  102976. /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  102977. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  102978. /* harmony import */ var _customDefaultsMerge_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_customDefaultsMerge.js */ "./node_modules/lodash-es/_customDefaultsMerge.js");
  102979. /* harmony import */ var _mergeWith_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mergeWith.js */ "./node_modules/lodash-es/mergeWith.js");
  102980. /**
  102981. * This method is like `_.defaults` except that it recursively assigns
  102982. * default properties.
  102983. *
  102984. * **Note:** This method mutates `object`.
  102985. *
  102986. * @static
  102987. * @memberOf _
  102988. * @since 3.10.0
  102989. * @category Object
  102990. * @param {Object} object The destination object.
  102991. * @param {...Object} [sources] The source objects.
  102992. * @returns {Object} Returns `object`.
  102993. * @see _.defaults
  102994. * @example
  102995. *
  102996. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  102997. * // => { 'a': { 'b': 2, 'c': 3 } }
  102998. */
  102999. var defaultsDeep = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(args) {
  103000. args.push(undefined, _customDefaultsMerge_js__WEBPACK_IMPORTED_MODULE_2__["default"]);
  103001. return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_mergeWith_js__WEBPACK_IMPORTED_MODULE_3__["default"], undefined, args);
  103002. });
  103003. /* harmony default export */ __webpack_exports__["default"] = (defaultsDeep);
  103004. /***/ }),
  103005. /***/ "./node_modules/lodash-es/defer.js":
  103006. /*!*****************************************!*\
  103007. !*** ./node_modules/lodash-es/defer.js ***!
  103008. \*****************************************/
  103009. /*! exports provided: default */
  103010. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103011. "use strict";
  103012. __webpack_require__.r(__webpack_exports__);
  103013. /* harmony import */ var _baseDelay_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseDelay.js */ "./node_modules/lodash-es/_baseDelay.js");
  103014. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  103015. /**
  103016. * Defers invoking the `func` until the current call stack has cleared. Any
  103017. * additional arguments are provided to `func` when it's invoked.
  103018. *
  103019. * @static
  103020. * @memberOf _
  103021. * @since 0.1.0
  103022. * @category Function
  103023. * @param {Function} func The function to defer.
  103024. * @param {...*} [args] The arguments to invoke `func` with.
  103025. * @returns {number} Returns the timer id.
  103026. * @example
  103027. *
  103028. * _.defer(function(text) {
  103029. * console.log(text);
  103030. * }, 'deferred');
  103031. * // => Logs 'deferred' after one millisecond.
  103032. */
  103033. var defer = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(func, args) {
  103034. return Object(_baseDelay_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, 1, args);
  103035. });
  103036. /* harmony default export */ __webpack_exports__["default"] = (defer);
  103037. /***/ }),
  103038. /***/ "./node_modules/lodash-es/delay.js":
  103039. /*!*****************************************!*\
  103040. !*** ./node_modules/lodash-es/delay.js ***!
  103041. \*****************************************/
  103042. /*! exports provided: default */
  103043. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103044. "use strict";
  103045. __webpack_require__.r(__webpack_exports__);
  103046. /* harmony import */ var _baseDelay_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseDelay.js */ "./node_modules/lodash-es/_baseDelay.js");
  103047. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  103048. /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
  103049. /**
  103050. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  103051. * provided to `func` when it's invoked.
  103052. *
  103053. * @static
  103054. * @memberOf _
  103055. * @since 0.1.0
  103056. * @category Function
  103057. * @param {Function} func The function to delay.
  103058. * @param {number} wait The number of milliseconds to delay invocation.
  103059. * @param {...*} [args] The arguments to invoke `func` with.
  103060. * @returns {number} Returns the timer id.
  103061. * @example
  103062. *
  103063. * _.delay(function(text) {
  103064. * console.log(text);
  103065. * }, 1000, 'later');
  103066. * // => Logs 'later' after one second.
  103067. */
  103068. var delay = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(func, wait, args) {
  103069. return Object(_baseDelay_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_2__["default"])(wait) || 0, args);
  103070. });
  103071. /* harmony default export */ __webpack_exports__["default"] = (delay);
  103072. /***/ }),
  103073. /***/ "./node_modules/lodash-es/difference.js":
  103074. /*!**********************************************!*\
  103075. !*** ./node_modules/lodash-es/difference.js ***!
  103076. \**********************************************/
  103077. /*! exports provided: default */
  103078. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103079. "use strict";
  103080. __webpack_require__.r(__webpack_exports__);
  103081. /* harmony import */ var _baseDifference_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseDifference.js */ "./node_modules/lodash-es/_baseDifference.js");
  103082. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  103083. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  103084. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  103085. /**
  103086. * Creates an array of `array` values not included in the other given arrays
  103087. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  103088. * for equality comparisons. The order and references of result values are
  103089. * determined by the first array.
  103090. *
  103091. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  103092. *
  103093. * @static
  103094. * @memberOf _
  103095. * @since 0.1.0
  103096. * @category Array
  103097. * @param {Array} array The array to inspect.
  103098. * @param {...Array} [values] The values to exclude.
  103099. * @returns {Array} Returns the new array of filtered values.
  103100. * @see _.without, _.xor
  103101. * @example
  103102. *
  103103. * _.difference([2, 1], [2, 3]);
  103104. * // => [1]
  103105. */
  103106. var difference = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(array, values) {
  103107. return Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"])(array)
  103108. ? Object(_baseDifference_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__["default"])(values, 1, _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"], true))
  103109. : [];
  103110. });
  103111. /* harmony default export */ __webpack_exports__["default"] = (difference);
  103112. /***/ }),
  103113. /***/ "./node_modules/lodash-es/differenceBy.js":
  103114. /*!************************************************!*\
  103115. !*** ./node_modules/lodash-es/differenceBy.js ***!
  103116. \************************************************/
  103117. /*! exports provided: default */
  103118. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103119. "use strict";
  103120. __webpack_require__.r(__webpack_exports__);
  103121. /* harmony import */ var _baseDifference_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseDifference.js */ "./node_modules/lodash-es/_baseDifference.js");
  103122. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  103123. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  103124. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  103125. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  103126. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  103127. /**
  103128. * This method is like `_.difference` except that it accepts `iteratee` which
  103129. * is invoked for each element of `array` and `values` to generate the criterion
  103130. * by which they're compared. The order and references of result values are
  103131. * determined by the first array. The iteratee is invoked with one argument:
  103132. * (value).
  103133. *
  103134. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  103135. *
  103136. * @static
  103137. * @memberOf _
  103138. * @since 4.0.0
  103139. * @category Array
  103140. * @param {Array} array The array to inspect.
  103141. * @param {...Array} [values] The values to exclude.
  103142. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  103143. * @returns {Array} Returns the new array of filtered values.
  103144. * @example
  103145. *
  103146. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  103147. * // => [1.2]
  103148. *
  103149. * // The `_.property` iteratee shorthand.
  103150. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  103151. * // => [{ 'x': 2 }]
  103152. */
  103153. var differenceBy = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_3__["default"])(function(array, values) {
  103154. var iteratee = Object(_last_js__WEBPACK_IMPORTED_MODULE_5__["default"])(values);
  103155. if (Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__["default"])(iteratee)) {
  103156. iteratee = undefined;
  103157. }
  103158. return Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__["default"])(array)
  103159. ? Object(_baseDifference_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__["default"])(values, 1, _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__["default"], true), Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee, 2))
  103160. : [];
  103161. });
  103162. /* harmony default export */ __webpack_exports__["default"] = (differenceBy);
  103163. /***/ }),
  103164. /***/ "./node_modules/lodash-es/differenceWith.js":
  103165. /*!**************************************************!*\
  103166. !*** ./node_modules/lodash-es/differenceWith.js ***!
  103167. \**************************************************/
  103168. /*! exports provided: default */
  103169. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103170. "use strict";
  103171. __webpack_require__.r(__webpack_exports__);
  103172. /* harmony import */ var _baseDifference_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseDifference.js */ "./node_modules/lodash-es/_baseDifference.js");
  103173. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  103174. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  103175. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  103176. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  103177. /**
  103178. * This method is like `_.difference` except that it accepts `comparator`
  103179. * which is invoked to compare elements of `array` to `values`. The order and
  103180. * references of result values are determined by the first array. The comparator
  103181. * is invoked with two arguments: (arrVal, othVal).
  103182. *
  103183. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  103184. *
  103185. * @static
  103186. * @memberOf _
  103187. * @since 4.0.0
  103188. * @category Array
  103189. * @param {Array} array The array to inspect.
  103190. * @param {...Array} [values] The values to exclude.
  103191. * @param {Function} [comparator] The comparator invoked per element.
  103192. * @returns {Array} Returns the new array of filtered values.
  103193. * @example
  103194. *
  103195. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  103196. *
  103197. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  103198. * // => [{ 'x': 2, 'y': 1 }]
  103199. */
  103200. var differenceWith = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(array, values) {
  103201. var comparator = Object(_last_js__WEBPACK_IMPORTED_MODULE_4__["default"])(values);
  103202. if (Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"])(comparator)) {
  103203. comparator = undefined;
  103204. }
  103205. return Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"])(array)
  103206. ? Object(_baseDifference_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_1__["default"])(values, 1, _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"], true), undefined, comparator)
  103207. : [];
  103208. });
  103209. /* harmony default export */ __webpack_exports__["default"] = (differenceWith);
  103210. /***/ }),
  103211. /***/ "./node_modules/lodash-es/divide.js":
  103212. /*!******************************************!*\
  103213. !*** ./node_modules/lodash-es/divide.js ***!
  103214. \******************************************/
  103215. /*! exports provided: default */
  103216. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103217. "use strict";
  103218. __webpack_require__.r(__webpack_exports__);
  103219. /* harmony import */ var _createMathOperation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createMathOperation.js */ "./node_modules/lodash-es/_createMathOperation.js");
  103220. /**
  103221. * Divide two numbers.
  103222. *
  103223. * @static
  103224. * @memberOf _
  103225. * @since 4.7.0
  103226. * @category Math
  103227. * @param {number} dividend The first number in a division.
  103228. * @param {number} divisor The second number in a division.
  103229. * @returns {number} Returns the quotient.
  103230. * @example
  103231. *
  103232. * _.divide(6, 4);
  103233. * // => 1.5
  103234. */
  103235. var divide = Object(_createMathOperation_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(dividend, divisor) {
  103236. return dividend / divisor;
  103237. }, 1);
  103238. /* harmony default export */ __webpack_exports__["default"] = (divide);
  103239. /***/ }),
  103240. /***/ "./node_modules/lodash-es/drop.js":
  103241. /*!****************************************!*\
  103242. !*** ./node_modules/lodash-es/drop.js ***!
  103243. \****************************************/
  103244. /*! exports provided: default */
  103245. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103246. "use strict";
  103247. __webpack_require__.r(__webpack_exports__);
  103248. /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
  103249. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  103250. /**
  103251. * Creates a slice of `array` with `n` elements dropped from the beginning.
  103252. *
  103253. * @static
  103254. * @memberOf _
  103255. * @since 0.5.0
  103256. * @category Array
  103257. * @param {Array} array The array to query.
  103258. * @param {number} [n=1] The number of elements to drop.
  103259. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  103260. * @returns {Array} Returns the slice of `array`.
  103261. * @example
  103262. *
  103263. * _.drop([1, 2, 3]);
  103264. * // => [2, 3]
  103265. *
  103266. * _.drop([1, 2, 3], 2);
  103267. * // => [3]
  103268. *
  103269. * _.drop([1, 2, 3], 5);
  103270. * // => []
  103271. *
  103272. * _.drop([1, 2, 3], 0);
  103273. * // => [1, 2, 3]
  103274. */
  103275. function drop(array, n, guard) {
  103276. var length = array == null ? 0 : array.length;
  103277. if (!length) {
  103278. return [];
  103279. }
  103280. n = (guard || n === undefined) ? 1 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(n);
  103281. return Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, n < 0 ? 0 : n, length);
  103282. }
  103283. /* harmony default export */ __webpack_exports__["default"] = (drop);
  103284. /***/ }),
  103285. /***/ "./node_modules/lodash-es/dropRight.js":
  103286. /*!*********************************************!*\
  103287. !*** ./node_modules/lodash-es/dropRight.js ***!
  103288. \*********************************************/
  103289. /*! exports provided: default */
  103290. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103291. "use strict";
  103292. __webpack_require__.r(__webpack_exports__);
  103293. /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
  103294. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  103295. /**
  103296. * Creates a slice of `array` with `n` elements dropped from the end.
  103297. *
  103298. * @static
  103299. * @memberOf _
  103300. * @since 3.0.0
  103301. * @category Array
  103302. * @param {Array} array The array to query.
  103303. * @param {number} [n=1] The number of elements to drop.
  103304. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  103305. * @returns {Array} Returns the slice of `array`.
  103306. * @example
  103307. *
  103308. * _.dropRight([1, 2, 3]);
  103309. * // => [1, 2]
  103310. *
  103311. * _.dropRight([1, 2, 3], 2);
  103312. * // => [1]
  103313. *
  103314. * _.dropRight([1, 2, 3], 5);
  103315. * // => []
  103316. *
  103317. * _.dropRight([1, 2, 3], 0);
  103318. * // => [1, 2, 3]
  103319. */
  103320. function dropRight(array, n, guard) {
  103321. var length = array == null ? 0 : array.length;
  103322. if (!length) {
  103323. return [];
  103324. }
  103325. n = (guard || n === undefined) ? 1 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(n);
  103326. n = length - n;
  103327. return Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, 0, n < 0 ? 0 : n);
  103328. }
  103329. /* harmony default export */ __webpack_exports__["default"] = (dropRight);
  103330. /***/ }),
  103331. /***/ "./node_modules/lodash-es/dropRightWhile.js":
  103332. /*!**************************************************!*\
  103333. !*** ./node_modules/lodash-es/dropRightWhile.js ***!
  103334. \**************************************************/
  103335. /*! exports provided: default */
  103336. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103337. "use strict";
  103338. __webpack_require__.r(__webpack_exports__);
  103339. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  103340. /* harmony import */ var _baseWhile_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseWhile.js */ "./node_modules/lodash-es/_baseWhile.js");
  103341. /**
  103342. * Creates a slice of `array` excluding elements dropped from the end.
  103343. * Elements are dropped until `predicate` returns falsey. The predicate is
  103344. * invoked with three arguments: (value, index, array).
  103345. *
  103346. * @static
  103347. * @memberOf _
  103348. * @since 3.0.0
  103349. * @category Array
  103350. * @param {Array} array The array to query.
  103351. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  103352. * @returns {Array} Returns the slice of `array`.
  103353. * @example
  103354. *
  103355. * var users = [
  103356. * { 'user': 'barney', 'active': true },
  103357. * { 'user': 'fred', 'active': false },
  103358. * { 'user': 'pebbles', 'active': false }
  103359. * ];
  103360. *
  103361. * _.dropRightWhile(users, function(o) { return !o.active; });
  103362. * // => objects for ['barney']
  103363. *
  103364. * // The `_.matches` iteratee shorthand.
  103365. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  103366. * // => objects for ['barney', 'fred']
  103367. *
  103368. * // The `_.matchesProperty` iteratee shorthand.
  103369. * _.dropRightWhile(users, ['active', false]);
  103370. * // => objects for ['barney']
  103371. *
  103372. * // The `_.property` iteratee shorthand.
  103373. * _.dropRightWhile(users, 'active');
  103374. * // => objects for ['barney', 'fred', 'pebbles']
  103375. */
  103376. function dropRightWhile(array, predicate) {
  103377. return (array && array.length)
  103378. ? Object(_baseWhile_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(predicate, 3), true, true)
  103379. : [];
  103380. }
  103381. /* harmony default export */ __webpack_exports__["default"] = (dropRightWhile);
  103382. /***/ }),
  103383. /***/ "./node_modules/lodash-es/dropWhile.js":
  103384. /*!*********************************************!*\
  103385. !*** ./node_modules/lodash-es/dropWhile.js ***!
  103386. \*********************************************/
  103387. /*! exports provided: default */
  103388. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103389. "use strict";
  103390. __webpack_require__.r(__webpack_exports__);
  103391. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  103392. /* harmony import */ var _baseWhile_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseWhile.js */ "./node_modules/lodash-es/_baseWhile.js");
  103393. /**
  103394. * Creates a slice of `array` excluding elements dropped from the beginning.
  103395. * Elements are dropped until `predicate` returns falsey. The predicate is
  103396. * invoked with three arguments: (value, index, array).
  103397. *
  103398. * @static
  103399. * @memberOf _
  103400. * @since 3.0.0
  103401. * @category Array
  103402. * @param {Array} array The array to query.
  103403. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  103404. * @returns {Array} Returns the slice of `array`.
  103405. * @example
  103406. *
  103407. * var users = [
  103408. * { 'user': 'barney', 'active': false },
  103409. * { 'user': 'fred', 'active': false },
  103410. * { 'user': 'pebbles', 'active': true }
  103411. * ];
  103412. *
  103413. * _.dropWhile(users, function(o) { return !o.active; });
  103414. * // => objects for ['pebbles']
  103415. *
  103416. * // The `_.matches` iteratee shorthand.
  103417. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  103418. * // => objects for ['fred', 'pebbles']
  103419. *
  103420. * // The `_.matchesProperty` iteratee shorthand.
  103421. * _.dropWhile(users, ['active', false]);
  103422. * // => objects for ['pebbles']
  103423. *
  103424. * // The `_.property` iteratee shorthand.
  103425. * _.dropWhile(users, 'active');
  103426. * // => objects for ['barney', 'fred', 'pebbles']
  103427. */
  103428. function dropWhile(array, predicate) {
  103429. return (array && array.length)
  103430. ? Object(_baseWhile_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(predicate, 3), true)
  103431. : [];
  103432. }
  103433. /* harmony default export */ __webpack_exports__["default"] = (dropWhile);
  103434. /***/ }),
  103435. /***/ "./node_modules/lodash-es/each.js":
  103436. /*!****************************************!*\
  103437. !*** ./node_modules/lodash-es/each.js ***!
  103438. \****************************************/
  103439. /*! exports provided: default */
  103440. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103441. "use strict";
  103442. __webpack_require__.r(__webpack_exports__);
  103443. /* harmony import */ var _forEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./forEach.js */ "./node_modules/lodash-es/forEach.js");
  103444. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _forEach_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  103445. /***/ }),
  103446. /***/ "./node_modules/lodash-es/eachRight.js":
  103447. /*!*********************************************!*\
  103448. !*** ./node_modules/lodash-es/eachRight.js ***!
  103449. \*********************************************/
  103450. /*! exports provided: default */
  103451. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103452. "use strict";
  103453. __webpack_require__.r(__webpack_exports__);
  103454. /* harmony import */ var _forEachRight_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./forEachRight.js */ "./node_modules/lodash-es/forEachRight.js");
  103455. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _forEachRight_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  103456. /***/ }),
  103457. /***/ "./node_modules/lodash-es/endsWith.js":
  103458. /*!********************************************!*\
  103459. !*** ./node_modules/lodash-es/endsWith.js ***!
  103460. \********************************************/
  103461. /*! exports provided: default */
  103462. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103463. "use strict";
  103464. __webpack_require__.r(__webpack_exports__);
  103465. /* harmony import */ var _baseClamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClamp.js */ "./node_modules/lodash-es/_baseClamp.js");
  103466. /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
  103467. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  103468. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  103469. /**
  103470. * Checks if `string` ends with the given target string.
  103471. *
  103472. * @static
  103473. * @memberOf _
  103474. * @since 3.0.0
  103475. * @category String
  103476. * @param {string} [string=''] The string to inspect.
  103477. * @param {string} [target] The string to search for.
  103478. * @param {number} [position=string.length] The position to search up to.
  103479. * @returns {boolean} Returns `true` if `string` ends with `target`,
  103480. * else `false`.
  103481. * @example
  103482. *
  103483. * _.endsWith('abc', 'c');
  103484. * // => true
  103485. *
  103486. * _.endsWith('abc', 'b');
  103487. * // => false
  103488. *
  103489. * _.endsWith('abc', 'b', 2);
  103490. * // => true
  103491. */
  103492. function endsWith(string, target, position) {
  103493. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string);
  103494. target = Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_1__["default"])(target);
  103495. var length = string.length;
  103496. position = position === undefined
  103497. ? length
  103498. : Object(_baseClamp_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(position), 0, length);
  103499. var end = position;
  103500. position -= target.length;
  103501. return position >= 0 && string.slice(position, end) == target;
  103502. }
  103503. /* harmony default export */ __webpack_exports__["default"] = (endsWith);
  103504. /***/ }),
  103505. /***/ "./node_modules/lodash-es/entries.js":
  103506. /*!*******************************************!*\
  103507. !*** ./node_modules/lodash-es/entries.js ***!
  103508. \*******************************************/
  103509. /*! exports provided: default */
  103510. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103511. "use strict";
  103512. __webpack_require__.r(__webpack_exports__);
  103513. /* harmony import */ var _toPairs_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toPairs.js */ "./node_modules/lodash-es/toPairs.js");
  103514. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _toPairs_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  103515. /***/ }),
  103516. /***/ "./node_modules/lodash-es/entriesIn.js":
  103517. /*!*********************************************!*\
  103518. !*** ./node_modules/lodash-es/entriesIn.js ***!
  103519. \*********************************************/
  103520. /*! exports provided: default */
  103521. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103522. "use strict";
  103523. __webpack_require__.r(__webpack_exports__);
  103524. /* harmony import */ var _toPairsIn_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toPairsIn.js */ "./node_modules/lodash-es/toPairsIn.js");
  103525. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _toPairsIn_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  103526. /***/ }),
  103527. /***/ "./node_modules/lodash-es/eq.js":
  103528. /*!**************************************!*\
  103529. !*** ./node_modules/lodash-es/eq.js ***!
  103530. \**************************************/
  103531. /*! exports provided: default */
  103532. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103533. "use strict";
  103534. __webpack_require__.r(__webpack_exports__);
  103535. /**
  103536. * Performs a
  103537. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  103538. * comparison between two values to determine if they are equivalent.
  103539. *
  103540. * @static
  103541. * @memberOf _
  103542. * @since 4.0.0
  103543. * @category Lang
  103544. * @param {*} value The value to compare.
  103545. * @param {*} other The other value to compare.
  103546. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  103547. * @example
  103548. *
  103549. * var object = { 'a': 1 };
  103550. * var other = { 'a': 1 };
  103551. *
  103552. * _.eq(object, object);
  103553. * // => true
  103554. *
  103555. * _.eq(object, other);
  103556. * // => false
  103557. *
  103558. * _.eq('a', 'a');
  103559. * // => true
  103560. *
  103561. * _.eq('a', Object('a'));
  103562. * // => false
  103563. *
  103564. * _.eq(NaN, NaN);
  103565. * // => true
  103566. */
  103567. function eq(value, other) {
  103568. return value === other || (value !== value && other !== other);
  103569. }
  103570. /* harmony default export */ __webpack_exports__["default"] = (eq);
  103571. /***/ }),
  103572. /***/ "./node_modules/lodash-es/escape.js":
  103573. /*!******************************************!*\
  103574. !*** ./node_modules/lodash-es/escape.js ***!
  103575. \******************************************/
  103576. /*! exports provided: default */
  103577. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103578. "use strict";
  103579. __webpack_require__.r(__webpack_exports__);
  103580. /* harmony import */ var _escapeHtmlChar_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_escapeHtmlChar.js */ "./node_modules/lodash-es/_escapeHtmlChar.js");
  103581. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  103582. /** Used to match HTML entities and HTML characters. */
  103583. var reUnescapedHtml = /[&<>"']/g,
  103584. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  103585. /**
  103586. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  103587. * corresponding HTML entities.
  103588. *
  103589. * **Note:** No other characters are escaped. To escape additional
  103590. * characters use a third-party library like [_he_](https://mths.be/he).
  103591. *
  103592. * Though the ">" character is escaped for symmetry, characters like
  103593. * ">" and "/" don't need escaping in HTML and have no special meaning
  103594. * unless they're part of a tag or unquoted attribute value. See
  103595. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  103596. * (under "semi-related fun fact") for more details.
  103597. *
  103598. * When working with HTML you should always
  103599. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  103600. * XSS vectors.
  103601. *
  103602. * @static
  103603. * @since 0.1.0
  103604. * @memberOf _
  103605. * @category String
  103606. * @param {string} [string=''] The string to escape.
  103607. * @returns {string} Returns the escaped string.
  103608. * @example
  103609. *
  103610. * _.escape('fred, barney, & pebbles');
  103611. * // => 'fred, barney, &amp; pebbles'
  103612. */
  103613. function escape(string) {
  103614. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string);
  103615. return (string && reHasUnescapedHtml.test(string))
  103616. ? string.replace(reUnescapedHtml, _escapeHtmlChar_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  103617. : string;
  103618. }
  103619. /* harmony default export */ __webpack_exports__["default"] = (escape);
  103620. /***/ }),
  103621. /***/ "./node_modules/lodash-es/escapeRegExp.js":
  103622. /*!************************************************!*\
  103623. !*** ./node_modules/lodash-es/escapeRegExp.js ***!
  103624. \************************************************/
  103625. /*! exports provided: default */
  103626. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103627. "use strict";
  103628. __webpack_require__.r(__webpack_exports__);
  103629. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  103630. /**
  103631. * Used to match `RegExp`
  103632. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  103633. */
  103634. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  103635. reHasRegExpChar = RegExp(reRegExpChar.source);
  103636. /**
  103637. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  103638. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  103639. *
  103640. * @static
  103641. * @memberOf _
  103642. * @since 3.0.0
  103643. * @category String
  103644. * @param {string} [string=''] The string to escape.
  103645. * @returns {string} Returns the escaped string.
  103646. * @example
  103647. *
  103648. * _.escapeRegExp('[lodash](https://lodash.com/)');
  103649. * // => '\[lodash\]\(https://lodash\.com/\)'
  103650. */
  103651. function escapeRegExp(string) {
  103652. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(string);
  103653. return (string && reHasRegExpChar.test(string))
  103654. ? string.replace(reRegExpChar, '\\$&')
  103655. : string;
  103656. }
  103657. /* harmony default export */ __webpack_exports__["default"] = (escapeRegExp);
  103658. /***/ }),
  103659. /***/ "./node_modules/lodash-es/every.js":
  103660. /*!*****************************************!*\
  103661. !*** ./node_modules/lodash-es/every.js ***!
  103662. \*****************************************/
  103663. /*! exports provided: default */
  103664. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103665. "use strict";
  103666. __webpack_require__.r(__webpack_exports__);
  103667. /* harmony import */ var _arrayEvery_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayEvery.js */ "./node_modules/lodash-es/_arrayEvery.js");
  103668. /* harmony import */ var _baseEvery_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseEvery.js */ "./node_modules/lodash-es/_baseEvery.js");
  103669. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  103670. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  103671. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  103672. /**
  103673. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  103674. * Iteration is stopped once `predicate` returns falsey. The predicate is
  103675. * invoked with three arguments: (value, index|key, collection).
  103676. *
  103677. * **Note:** This method returns `true` for
  103678. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  103679. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  103680. * elements of empty collections.
  103681. *
  103682. * @static
  103683. * @memberOf _
  103684. * @since 0.1.0
  103685. * @category Collection
  103686. * @param {Array|Object} collection The collection to iterate over.
  103687. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  103688. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  103689. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  103690. * else `false`.
  103691. * @example
  103692. *
  103693. * _.every([true, 1, null, 'yes'], Boolean);
  103694. * // => false
  103695. *
  103696. * var users = [
  103697. * { 'user': 'barney', 'age': 36, 'active': false },
  103698. * { 'user': 'fred', 'age': 40, 'active': false }
  103699. * ];
  103700. *
  103701. * // The `_.matches` iteratee shorthand.
  103702. * _.every(users, { 'user': 'barney', 'active': false });
  103703. * // => false
  103704. *
  103705. * // The `_.matchesProperty` iteratee shorthand.
  103706. * _.every(users, ['active', false]);
  103707. * // => true
  103708. *
  103709. * // The `_.property` iteratee shorthand.
  103710. * _.every(users, 'active');
  103711. * // => false
  103712. */
  103713. function every(collection, predicate, guard) {
  103714. var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection) ? _arrayEvery_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseEvery_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  103715. if (guard && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_4__["default"])(collection, predicate, guard)) {
  103716. predicate = undefined;
  103717. }
  103718. return func(collection, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(predicate, 3));
  103719. }
  103720. /* harmony default export */ __webpack_exports__["default"] = (every);
  103721. /***/ }),
  103722. /***/ "./node_modules/lodash-es/extend.js":
  103723. /*!******************************************!*\
  103724. !*** ./node_modules/lodash-es/extend.js ***!
  103725. \******************************************/
  103726. /*! exports provided: default */
  103727. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103728. "use strict";
  103729. __webpack_require__.r(__webpack_exports__);
  103730. /* harmony import */ var _assignIn_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./assignIn.js */ "./node_modules/lodash-es/assignIn.js");
  103731. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _assignIn_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  103732. /***/ }),
  103733. /***/ "./node_modules/lodash-es/extendWith.js":
  103734. /*!**********************************************!*\
  103735. !*** ./node_modules/lodash-es/extendWith.js ***!
  103736. \**********************************************/
  103737. /*! exports provided: default */
  103738. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103739. "use strict";
  103740. __webpack_require__.r(__webpack_exports__);
  103741. /* harmony import */ var _assignInWith_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./assignInWith.js */ "./node_modules/lodash-es/assignInWith.js");
  103742. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _assignInWith_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  103743. /***/ }),
  103744. /***/ "./node_modules/lodash-es/fill.js":
  103745. /*!****************************************!*\
  103746. !*** ./node_modules/lodash-es/fill.js ***!
  103747. \****************************************/
  103748. /*! exports provided: default */
  103749. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103750. "use strict";
  103751. __webpack_require__.r(__webpack_exports__);
  103752. /* harmony import */ var _baseFill_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFill.js */ "./node_modules/lodash-es/_baseFill.js");
  103753. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  103754. /**
  103755. * Fills elements of `array` with `value` from `start` up to, but not
  103756. * including, `end`.
  103757. *
  103758. * **Note:** This method mutates `array`.
  103759. *
  103760. * @static
  103761. * @memberOf _
  103762. * @since 3.2.0
  103763. * @category Array
  103764. * @param {Array} array The array to fill.
  103765. * @param {*} value The value to fill `array` with.
  103766. * @param {number} [start=0] The start position.
  103767. * @param {number} [end=array.length] The end position.
  103768. * @returns {Array} Returns `array`.
  103769. * @example
  103770. *
  103771. * var array = [1, 2, 3];
  103772. *
  103773. * _.fill(array, 'a');
  103774. * console.log(array);
  103775. * // => ['a', 'a', 'a']
  103776. *
  103777. * _.fill(Array(3), 2);
  103778. * // => [2, 2, 2]
  103779. *
  103780. * _.fill([4, 6, 8, 10], '*', 1, 3);
  103781. * // => [4, '*', '*', 10]
  103782. */
  103783. function fill(array, value, start, end) {
  103784. var length = array == null ? 0 : array.length;
  103785. if (!length) {
  103786. return [];
  103787. }
  103788. if (start && typeof start != 'number' && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, value, start)) {
  103789. start = 0;
  103790. end = length;
  103791. }
  103792. return Object(_baseFill_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, value, start, end);
  103793. }
  103794. /* harmony default export */ __webpack_exports__["default"] = (fill);
  103795. /***/ }),
  103796. /***/ "./node_modules/lodash-es/filter.js":
  103797. /*!******************************************!*\
  103798. !*** ./node_modules/lodash-es/filter.js ***!
  103799. \******************************************/
  103800. /*! exports provided: default */
  103801. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103802. "use strict";
  103803. __webpack_require__.r(__webpack_exports__);
  103804. /* harmony import */ var _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayFilter.js */ "./node_modules/lodash-es/_arrayFilter.js");
  103805. /* harmony import */ var _baseFilter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseFilter.js */ "./node_modules/lodash-es/_baseFilter.js");
  103806. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  103807. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  103808. /**
  103809. * Iterates over elements of `collection`, returning an array of all elements
  103810. * `predicate` returns truthy for. The predicate is invoked with three
  103811. * arguments: (value, index|key, collection).
  103812. *
  103813. * **Note:** Unlike `_.remove`, this method returns a new array.
  103814. *
  103815. * @static
  103816. * @memberOf _
  103817. * @since 0.1.0
  103818. * @category Collection
  103819. * @param {Array|Object} collection The collection to iterate over.
  103820. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  103821. * @returns {Array} Returns the new filtered array.
  103822. * @see _.reject
  103823. * @example
  103824. *
  103825. * var users = [
  103826. * { 'user': 'barney', 'age': 36, 'active': true },
  103827. * { 'user': 'fred', 'age': 40, 'active': false }
  103828. * ];
  103829. *
  103830. * _.filter(users, function(o) { return !o.active; });
  103831. * // => objects for ['fred']
  103832. *
  103833. * // The `_.matches` iteratee shorthand.
  103834. * _.filter(users, { 'age': 36, 'active': true });
  103835. * // => objects for ['barney']
  103836. *
  103837. * // The `_.matchesProperty` iteratee shorthand.
  103838. * _.filter(users, ['active', false]);
  103839. * // => objects for ['fred']
  103840. *
  103841. * // The `_.property` iteratee shorthand.
  103842. * _.filter(users, 'active');
  103843. * // => objects for ['barney']
  103844. *
  103845. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  103846. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  103847. * // => objects for ['fred', 'barney']
  103848. */
  103849. function filter(collection, predicate) {
  103850. var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection) ? _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseFilter_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  103851. return func(collection, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(predicate, 3));
  103852. }
  103853. /* harmony default export */ __webpack_exports__["default"] = (filter);
  103854. /***/ }),
  103855. /***/ "./node_modules/lodash-es/find.js":
  103856. /*!****************************************!*\
  103857. !*** ./node_modules/lodash-es/find.js ***!
  103858. \****************************************/
  103859. /*! exports provided: default */
  103860. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103861. "use strict";
  103862. __webpack_require__.r(__webpack_exports__);
  103863. /* harmony import */ var _createFind_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createFind.js */ "./node_modules/lodash-es/_createFind.js");
  103864. /* harmony import */ var _findIndex_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./findIndex.js */ "./node_modules/lodash-es/findIndex.js");
  103865. /**
  103866. * Iterates over elements of `collection`, returning the first element
  103867. * `predicate` returns truthy for. The predicate is invoked with three
  103868. * arguments: (value, index|key, collection).
  103869. *
  103870. * @static
  103871. * @memberOf _
  103872. * @since 0.1.0
  103873. * @category Collection
  103874. * @param {Array|Object} collection The collection to inspect.
  103875. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  103876. * @param {number} [fromIndex=0] The index to search from.
  103877. * @returns {*} Returns the matched element, else `undefined`.
  103878. * @example
  103879. *
  103880. * var users = [
  103881. * { 'user': 'barney', 'age': 36, 'active': true },
  103882. * { 'user': 'fred', 'age': 40, 'active': false },
  103883. * { 'user': 'pebbles', 'age': 1, 'active': true }
  103884. * ];
  103885. *
  103886. * _.find(users, function(o) { return o.age < 40; });
  103887. * // => object for 'barney'
  103888. *
  103889. * // The `_.matches` iteratee shorthand.
  103890. * _.find(users, { 'age': 1, 'active': true });
  103891. * // => object for 'pebbles'
  103892. *
  103893. * // The `_.matchesProperty` iteratee shorthand.
  103894. * _.find(users, ['active', false]);
  103895. * // => object for 'fred'
  103896. *
  103897. * // The `_.property` iteratee shorthand.
  103898. * _.find(users, 'active');
  103899. * // => object for 'barney'
  103900. */
  103901. var find = Object(_createFind_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_findIndex_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  103902. /* harmony default export */ __webpack_exports__["default"] = (find);
  103903. /***/ }),
  103904. /***/ "./node_modules/lodash-es/findIndex.js":
  103905. /*!*********************************************!*\
  103906. !*** ./node_modules/lodash-es/findIndex.js ***!
  103907. \*********************************************/
  103908. /*! exports provided: default */
  103909. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103910. "use strict";
  103911. __webpack_require__.r(__webpack_exports__);
  103912. /* harmony import */ var _baseFindIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFindIndex.js */ "./node_modules/lodash-es/_baseFindIndex.js");
  103913. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  103914. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  103915. /* Built-in method references for those with the same name as other `lodash` methods. */
  103916. var nativeMax = Math.max;
  103917. /**
  103918. * This method is like `_.find` except that it returns the index of the first
  103919. * element `predicate` returns truthy for instead of the element itself.
  103920. *
  103921. * @static
  103922. * @memberOf _
  103923. * @since 1.1.0
  103924. * @category Array
  103925. * @param {Array} array The array to inspect.
  103926. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  103927. * @param {number} [fromIndex=0] The index to search from.
  103928. * @returns {number} Returns the index of the found element, else `-1`.
  103929. * @example
  103930. *
  103931. * var users = [
  103932. * { 'user': 'barney', 'active': false },
  103933. * { 'user': 'fred', 'active': false },
  103934. * { 'user': 'pebbles', 'active': true }
  103935. * ];
  103936. *
  103937. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  103938. * // => 0
  103939. *
  103940. * // The `_.matches` iteratee shorthand.
  103941. * _.findIndex(users, { 'user': 'fred', 'active': false });
  103942. * // => 1
  103943. *
  103944. * // The `_.matchesProperty` iteratee shorthand.
  103945. * _.findIndex(users, ['active', false]);
  103946. * // => 0
  103947. *
  103948. * // The `_.property` iteratee shorthand.
  103949. * _.findIndex(users, 'active');
  103950. * // => 2
  103951. */
  103952. function findIndex(array, predicate, fromIndex) {
  103953. var length = array == null ? 0 : array.length;
  103954. if (!length) {
  103955. return -1;
  103956. }
  103957. var index = fromIndex == null ? 0 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(fromIndex);
  103958. if (index < 0) {
  103959. index = nativeMax(length + index, 0);
  103960. }
  103961. return Object(_baseFindIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__["default"])(predicate, 3), index);
  103962. }
  103963. /* harmony default export */ __webpack_exports__["default"] = (findIndex);
  103964. /***/ }),
  103965. /***/ "./node_modules/lodash-es/findKey.js":
  103966. /*!*******************************************!*\
  103967. !*** ./node_modules/lodash-es/findKey.js ***!
  103968. \*******************************************/
  103969. /*! exports provided: default */
  103970. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103971. "use strict";
  103972. __webpack_require__.r(__webpack_exports__);
  103973. /* harmony import */ var _baseFindKey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFindKey.js */ "./node_modules/lodash-es/_baseFindKey.js");
  103974. /* harmony import */ var _baseForOwn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseForOwn.js */ "./node_modules/lodash-es/_baseForOwn.js");
  103975. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  103976. /**
  103977. * This method is like `_.find` except that it returns the key of the first
  103978. * element `predicate` returns truthy for instead of the element itself.
  103979. *
  103980. * @static
  103981. * @memberOf _
  103982. * @since 1.1.0
  103983. * @category Object
  103984. * @param {Object} object The object to inspect.
  103985. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  103986. * @returns {string|undefined} Returns the key of the matched element,
  103987. * else `undefined`.
  103988. * @example
  103989. *
  103990. * var users = {
  103991. * 'barney': { 'age': 36, 'active': true },
  103992. * 'fred': { 'age': 40, 'active': false },
  103993. * 'pebbles': { 'age': 1, 'active': true }
  103994. * };
  103995. *
  103996. * _.findKey(users, function(o) { return o.age < 40; });
  103997. * // => 'barney' (iteration order is not guaranteed)
  103998. *
  103999. * // The `_.matches` iteratee shorthand.
  104000. * _.findKey(users, { 'age': 1, 'active': true });
  104001. * // => 'pebbles'
  104002. *
  104003. * // The `_.matchesProperty` iteratee shorthand.
  104004. * _.findKey(users, ['active', false]);
  104005. * // => 'fred'
  104006. *
  104007. * // The `_.property` iteratee shorthand.
  104008. * _.findKey(users, 'active');
  104009. * // => 'barney'
  104010. */
  104011. function findKey(object, predicate) {
  104012. return Object(_baseFindKey_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(predicate, 3), _baseForOwn_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  104013. }
  104014. /* harmony default export */ __webpack_exports__["default"] = (findKey);
  104015. /***/ }),
  104016. /***/ "./node_modules/lodash-es/findLast.js":
  104017. /*!********************************************!*\
  104018. !*** ./node_modules/lodash-es/findLast.js ***!
  104019. \********************************************/
  104020. /*! exports provided: default */
  104021. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104022. "use strict";
  104023. __webpack_require__.r(__webpack_exports__);
  104024. /* harmony import */ var _createFind_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createFind.js */ "./node_modules/lodash-es/_createFind.js");
  104025. /* harmony import */ var _findLastIndex_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./findLastIndex.js */ "./node_modules/lodash-es/findLastIndex.js");
  104026. /**
  104027. * This method is like `_.find` except that it iterates over elements of
  104028. * `collection` from right to left.
  104029. *
  104030. * @static
  104031. * @memberOf _
  104032. * @since 2.0.0
  104033. * @category Collection
  104034. * @param {Array|Object} collection The collection to inspect.
  104035. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  104036. * @param {number} [fromIndex=collection.length-1] The index to search from.
  104037. * @returns {*} Returns the matched element, else `undefined`.
  104038. * @example
  104039. *
  104040. * _.findLast([1, 2, 3, 4], function(n) {
  104041. * return n % 2 == 1;
  104042. * });
  104043. * // => 3
  104044. */
  104045. var findLast = Object(_createFind_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_findLastIndex_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  104046. /* harmony default export */ __webpack_exports__["default"] = (findLast);
  104047. /***/ }),
  104048. /***/ "./node_modules/lodash-es/findLastIndex.js":
  104049. /*!*************************************************!*\
  104050. !*** ./node_modules/lodash-es/findLastIndex.js ***!
  104051. \*************************************************/
  104052. /*! exports provided: default */
  104053. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104054. "use strict";
  104055. __webpack_require__.r(__webpack_exports__);
  104056. /* harmony import */ var _baseFindIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFindIndex.js */ "./node_modules/lodash-es/_baseFindIndex.js");
  104057. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  104058. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  104059. /* Built-in method references for those with the same name as other `lodash` methods. */
  104060. var nativeMax = Math.max,
  104061. nativeMin = Math.min;
  104062. /**
  104063. * This method is like `_.findIndex` except that it iterates over elements
  104064. * of `collection` from right to left.
  104065. *
  104066. * @static
  104067. * @memberOf _
  104068. * @since 2.0.0
  104069. * @category Array
  104070. * @param {Array} array The array to inspect.
  104071. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  104072. * @param {number} [fromIndex=array.length-1] The index to search from.
  104073. * @returns {number} Returns the index of the found element, else `-1`.
  104074. * @example
  104075. *
  104076. * var users = [
  104077. * { 'user': 'barney', 'active': true },
  104078. * { 'user': 'fred', 'active': false },
  104079. * { 'user': 'pebbles', 'active': false }
  104080. * ];
  104081. *
  104082. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  104083. * // => 2
  104084. *
  104085. * // The `_.matches` iteratee shorthand.
  104086. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  104087. * // => 0
  104088. *
  104089. * // The `_.matchesProperty` iteratee shorthand.
  104090. * _.findLastIndex(users, ['active', false]);
  104091. * // => 2
  104092. *
  104093. * // The `_.property` iteratee shorthand.
  104094. * _.findLastIndex(users, 'active');
  104095. * // => 0
  104096. */
  104097. function findLastIndex(array, predicate, fromIndex) {
  104098. var length = array == null ? 0 : array.length;
  104099. if (!length) {
  104100. return -1;
  104101. }
  104102. var index = length - 1;
  104103. if (fromIndex !== undefined) {
  104104. index = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(fromIndex);
  104105. index = fromIndex < 0
  104106. ? nativeMax(length + index, 0)
  104107. : nativeMin(index, length - 1);
  104108. }
  104109. return Object(_baseFindIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__["default"])(predicate, 3), index, true);
  104110. }
  104111. /* harmony default export */ __webpack_exports__["default"] = (findLastIndex);
  104112. /***/ }),
  104113. /***/ "./node_modules/lodash-es/findLastKey.js":
  104114. /*!***********************************************!*\
  104115. !*** ./node_modules/lodash-es/findLastKey.js ***!
  104116. \***********************************************/
  104117. /*! exports provided: default */
  104118. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104119. "use strict";
  104120. __webpack_require__.r(__webpack_exports__);
  104121. /* harmony import */ var _baseFindKey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFindKey.js */ "./node_modules/lodash-es/_baseFindKey.js");
  104122. /* harmony import */ var _baseForOwnRight_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseForOwnRight.js */ "./node_modules/lodash-es/_baseForOwnRight.js");
  104123. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  104124. /**
  104125. * This method is like `_.findKey` except that it iterates over elements of
  104126. * a collection in the opposite order.
  104127. *
  104128. * @static
  104129. * @memberOf _
  104130. * @since 2.0.0
  104131. * @category Object
  104132. * @param {Object} object The object to inspect.
  104133. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  104134. * @returns {string|undefined} Returns the key of the matched element,
  104135. * else `undefined`.
  104136. * @example
  104137. *
  104138. * var users = {
  104139. * 'barney': { 'age': 36, 'active': true },
  104140. * 'fred': { 'age': 40, 'active': false },
  104141. * 'pebbles': { 'age': 1, 'active': true }
  104142. * };
  104143. *
  104144. * _.findLastKey(users, function(o) { return o.age < 40; });
  104145. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  104146. *
  104147. * // The `_.matches` iteratee shorthand.
  104148. * _.findLastKey(users, { 'age': 36, 'active': true });
  104149. * // => 'barney'
  104150. *
  104151. * // The `_.matchesProperty` iteratee shorthand.
  104152. * _.findLastKey(users, ['active', false]);
  104153. * // => 'fred'
  104154. *
  104155. * // The `_.property` iteratee shorthand.
  104156. * _.findLastKey(users, 'active');
  104157. * // => 'pebbles'
  104158. */
  104159. function findLastKey(object, predicate) {
  104160. return Object(_baseFindKey_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(predicate, 3), _baseForOwnRight_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  104161. }
  104162. /* harmony default export */ __webpack_exports__["default"] = (findLastKey);
  104163. /***/ }),
  104164. /***/ "./node_modules/lodash-es/first.js":
  104165. /*!*****************************************!*\
  104166. !*** ./node_modules/lodash-es/first.js ***!
  104167. \*****************************************/
  104168. /*! exports provided: default */
  104169. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104170. "use strict";
  104171. __webpack_require__.r(__webpack_exports__);
  104172. /* harmony import */ var _head_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./head.js */ "./node_modules/lodash-es/head.js");
  104173. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _head_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  104174. /***/ }),
  104175. /***/ "./node_modules/lodash-es/flatMap.js":
  104176. /*!*******************************************!*\
  104177. !*** ./node_modules/lodash-es/flatMap.js ***!
  104178. \*******************************************/
  104179. /*! exports provided: default */
  104180. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104181. "use strict";
  104182. __webpack_require__.r(__webpack_exports__);
  104183. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  104184. /* harmony import */ var _map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./map.js */ "./node_modules/lodash-es/map.js");
  104185. /**
  104186. * Creates a flattened array of values by running each element in `collection`
  104187. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  104188. * with three arguments: (value, index|key, collection).
  104189. *
  104190. * @static
  104191. * @memberOf _
  104192. * @since 4.0.0
  104193. * @category Collection
  104194. * @param {Array|Object} collection The collection to iterate over.
  104195. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  104196. * @returns {Array} Returns the new flattened array.
  104197. * @example
  104198. *
  104199. * function duplicate(n) {
  104200. * return [n, n];
  104201. * }
  104202. *
  104203. * _.flatMap([1, 2], duplicate);
  104204. * // => [1, 1, 2, 2]
  104205. */
  104206. function flatMap(collection, iteratee) {
  104207. return Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_map_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection, iteratee), 1);
  104208. }
  104209. /* harmony default export */ __webpack_exports__["default"] = (flatMap);
  104210. /***/ }),
  104211. /***/ "./node_modules/lodash-es/flatMapDeep.js":
  104212. /*!***********************************************!*\
  104213. !*** ./node_modules/lodash-es/flatMapDeep.js ***!
  104214. \***********************************************/
  104215. /*! exports provided: default */
  104216. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104217. "use strict";
  104218. __webpack_require__.r(__webpack_exports__);
  104219. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  104220. /* harmony import */ var _map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./map.js */ "./node_modules/lodash-es/map.js");
  104221. /** Used as references for various `Number` constants. */
  104222. var INFINITY = 1 / 0;
  104223. /**
  104224. * This method is like `_.flatMap` except that it recursively flattens the
  104225. * mapped results.
  104226. *
  104227. * @static
  104228. * @memberOf _
  104229. * @since 4.7.0
  104230. * @category Collection
  104231. * @param {Array|Object} collection The collection to iterate over.
  104232. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  104233. * @returns {Array} Returns the new flattened array.
  104234. * @example
  104235. *
  104236. * function duplicate(n) {
  104237. * return [[[n, n]]];
  104238. * }
  104239. *
  104240. * _.flatMapDeep([1, 2], duplicate);
  104241. * // => [1, 1, 2, 2]
  104242. */
  104243. function flatMapDeep(collection, iteratee) {
  104244. return Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_map_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection, iteratee), INFINITY);
  104245. }
  104246. /* harmony default export */ __webpack_exports__["default"] = (flatMapDeep);
  104247. /***/ }),
  104248. /***/ "./node_modules/lodash-es/flatMapDepth.js":
  104249. /*!************************************************!*\
  104250. !*** ./node_modules/lodash-es/flatMapDepth.js ***!
  104251. \************************************************/
  104252. /*! exports provided: default */
  104253. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104254. "use strict";
  104255. __webpack_require__.r(__webpack_exports__);
  104256. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  104257. /* harmony import */ var _map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./map.js */ "./node_modules/lodash-es/map.js");
  104258. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  104259. /**
  104260. * This method is like `_.flatMap` except that it recursively flattens the
  104261. * mapped results up to `depth` times.
  104262. *
  104263. * @static
  104264. * @memberOf _
  104265. * @since 4.7.0
  104266. * @category Collection
  104267. * @param {Array|Object} collection The collection to iterate over.
  104268. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  104269. * @param {number} [depth=1] The maximum recursion depth.
  104270. * @returns {Array} Returns the new flattened array.
  104271. * @example
  104272. *
  104273. * function duplicate(n) {
  104274. * return [[[n, n]]];
  104275. * }
  104276. *
  104277. * _.flatMapDepth([1, 2], duplicate, 2);
  104278. * // => [[1, 1], [2, 2]]
  104279. */
  104280. function flatMapDepth(collection, iteratee, depth) {
  104281. depth = depth === undefined ? 1 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(depth);
  104282. return Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_map_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection, iteratee), depth);
  104283. }
  104284. /* harmony default export */ __webpack_exports__["default"] = (flatMapDepth);
  104285. /***/ }),
  104286. /***/ "./node_modules/lodash-es/flatten.js":
  104287. /*!*******************************************!*\
  104288. !*** ./node_modules/lodash-es/flatten.js ***!
  104289. \*******************************************/
  104290. /*! exports provided: default */
  104291. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104292. "use strict";
  104293. __webpack_require__.r(__webpack_exports__);
  104294. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  104295. /**
  104296. * Flattens `array` a single level deep.
  104297. *
  104298. * @static
  104299. * @memberOf _
  104300. * @since 0.1.0
  104301. * @category Array
  104302. * @param {Array} array The array to flatten.
  104303. * @returns {Array} Returns the new flattened array.
  104304. * @example
  104305. *
  104306. * _.flatten([1, [2, [3, [4]], 5]]);
  104307. * // => [1, 2, [3, [4]], 5]
  104308. */
  104309. function flatten(array) {
  104310. var length = array == null ? 0 : array.length;
  104311. return length ? Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, 1) : [];
  104312. }
  104313. /* harmony default export */ __webpack_exports__["default"] = (flatten);
  104314. /***/ }),
  104315. /***/ "./node_modules/lodash-es/flattenDeep.js":
  104316. /*!***********************************************!*\
  104317. !*** ./node_modules/lodash-es/flattenDeep.js ***!
  104318. \***********************************************/
  104319. /*! exports provided: default */
  104320. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104321. "use strict";
  104322. __webpack_require__.r(__webpack_exports__);
  104323. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  104324. /** Used as references for various `Number` constants. */
  104325. var INFINITY = 1 / 0;
  104326. /**
  104327. * Recursively flattens `array`.
  104328. *
  104329. * @static
  104330. * @memberOf _
  104331. * @since 3.0.0
  104332. * @category Array
  104333. * @param {Array} array The array to flatten.
  104334. * @returns {Array} Returns the new flattened array.
  104335. * @example
  104336. *
  104337. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  104338. * // => [1, 2, 3, 4, 5]
  104339. */
  104340. function flattenDeep(array) {
  104341. var length = array == null ? 0 : array.length;
  104342. return length ? Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, INFINITY) : [];
  104343. }
  104344. /* harmony default export */ __webpack_exports__["default"] = (flattenDeep);
  104345. /***/ }),
  104346. /***/ "./node_modules/lodash-es/flattenDepth.js":
  104347. /*!************************************************!*\
  104348. !*** ./node_modules/lodash-es/flattenDepth.js ***!
  104349. \************************************************/
  104350. /*! exports provided: default */
  104351. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104352. "use strict";
  104353. __webpack_require__.r(__webpack_exports__);
  104354. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  104355. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  104356. /**
  104357. * Recursively flatten `array` up to `depth` times.
  104358. *
  104359. * @static
  104360. * @memberOf _
  104361. * @since 4.4.0
  104362. * @category Array
  104363. * @param {Array} array The array to flatten.
  104364. * @param {number} [depth=1] The maximum recursion depth.
  104365. * @returns {Array} Returns the new flattened array.
  104366. * @example
  104367. *
  104368. * var array = [1, [2, [3, [4]], 5]];
  104369. *
  104370. * _.flattenDepth(array, 1);
  104371. * // => [1, 2, [3, [4]], 5]
  104372. *
  104373. * _.flattenDepth(array, 2);
  104374. * // => [1, 2, 3, [4], 5]
  104375. */
  104376. function flattenDepth(array, depth) {
  104377. var length = array == null ? 0 : array.length;
  104378. if (!length) {
  104379. return [];
  104380. }
  104381. depth = depth === undefined ? 1 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(depth);
  104382. return Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, depth);
  104383. }
  104384. /* harmony default export */ __webpack_exports__["default"] = (flattenDepth);
  104385. /***/ }),
  104386. /***/ "./node_modules/lodash-es/flip.js":
  104387. /*!****************************************!*\
  104388. !*** ./node_modules/lodash-es/flip.js ***!
  104389. \****************************************/
  104390. /*! exports provided: default */
  104391. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104392. "use strict";
  104393. __webpack_require__.r(__webpack_exports__);
  104394. /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
  104395. /** Used to compose bitmasks for function metadata. */
  104396. var WRAP_FLIP_FLAG = 512;
  104397. /**
  104398. * Creates a function that invokes `func` with arguments reversed.
  104399. *
  104400. * @static
  104401. * @memberOf _
  104402. * @since 4.0.0
  104403. * @category Function
  104404. * @param {Function} func The function to flip arguments for.
  104405. * @returns {Function} Returns the new flipped function.
  104406. * @example
  104407. *
  104408. * var flipped = _.flip(function() {
  104409. * return _.toArray(arguments);
  104410. * });
  104411. *
  104412. * flipped('a', 'b', 'c', 'd');
  104413. * // => ['d', 'c', 'b', 'a']
  104414. */
  104415. function flip(func) {
  104416. return Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, WRAP_FLIP_FLAG);
  104417. }
  104418. /* harmony default export */ __webpack_exports__["default"] = (flip);
  104419. /***/ }),
  104420. /***/ "./node_modules/lodash-es/floor.js":
  104421. /*!*****************************************!*\
  104422. !*** ./node_modules/lodash-es/floor.js ***!
  104423. \*****************************************/
  104424. /*! exports provided: default */
  104425. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104426. "use strict";
  104427. __webpack_require__.r(__webpack_exports__);
  104428. /* harmony import */ var _createRound_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createRound.js */ "./node_modules/lodash-es/_createRound.js");
  104429. /**
  104430. * Computes `number` rounded down to `precision`.
  104431. *
  104432. * @static
  104433. * @memberOf _
  104434. * @since 3.10.0
  104435. * @category Math
  104436. * @param {number} number The number to round down.
  104437. * @param {number} [precision=0] The precision to round down to.
  104438. * @returns {number} Returns the rounded down number.
  104439. * @example
  104440. *
  104441. * _.floor(4.006);
  104442. * // => 4
  104443. *
  104444. * _.floor(0.046, 2);
  104445. * // => 0.04
  104446. *
  104447. * _.floor(4060, -2);
  104448. * // => 4000
  104449. */
  104450. var floor = Object(_createRound_js__WEBPACK_IMPORTED_MODULE_0__["default"])('floor');
  104451. /* harmony default export */ __webpack_exports__["default"] = (floor);
  104452. /***/ }),
  104453. /***/ "./node_modules/lodash-es/flow.js":
  104454. /*!****************************************!*\
  104455. !*** ./node_modules/lodash-es/flow.js ***!
  104456. \****************************************/
  104457. /*! exports provided: default */
  104458. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104459. "use strict";
  104460. __webpack_require__.r(__webpack_exports__);
  104461. /* harmony import */ var _createFlow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createFlow.js */ "./node_modules/lodash-es/_createFlow.js");
  104462. /**
  104463. * Creates a function that returns the result of invoking the given functions
  104464. * with the `this` binding of the created function, where each successive
  104465. * invocation is supplied the return value of the previous.
  104466. *
  104467. * @static
  104468. * @memberOf _
  104469. * @since 3.0.0
  104470. * @category Util
  104471. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  104472. * @returns {Function} Returns the new composite function.
  104473. * @see _.flowRight
  104474. * @example
  104475. *
  104476. * function square(n) {
  104477. * return n * n;
  104478. * }
  104479. *
  104480. * var addSquare = _.flow([_.add, square]);
  104481. * addSquare(1, 2);
  104482. * // => 9
  104483. */
  104484. var flow = Object(_createFlow_js__WEBPACK_IMPORTED_MODULE_0__["default"])();
  104485. /* harmony default export */ __webpack_exports__["default"] = (flow);
  104486. /***/ }),
  104487. /***/ "./node_modules/lodash-es/flowRight.js":
  104488. /*!*********************************************!*\
  104489. !*** ./node_modules/lodash-es/flowRight.js ***!
  104490. \*********************************************/
  104491. /*! exports provided: default */
  104492. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104493. "use strict";
  104494. __webpack_require__.r(__webpack_exports__);
  104495. /* harmony import */ var _createFlow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createFlow.js */ "./node_modules/lodash-es/_createFlow.js");
  104496. /**
  104497. * This method is like `_.flow` except that it creates a function that
  104498. * invokes the given functions from right to left.
  104499. *
  104500. * @static
  104501. * @since 3.0.0
  104502. * @memberOf _
  104503. * @category Util
  104504. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  104505. * @returns {Function} Returns the new composite function.
  104506. * @see _.flow
  104507. * @example
  104508. *
  104509. * function square(n) {
  104510. * return n * n;
  104511. * }
  104512. *
  104513. * var addSquare = _.flowRight([square, _.add]);
  104514. * addSquare(1, 2);
  104515. * // => 9
  104516. */
  104517. var flowRight = Object(_createFlow_js__WEBPACK_IMPORTED_MODULE_0__["default"])(true);
  104518. /* harmony default export */ __webpack_exports__["default"] = (flowRight);
  104519. /***/ }),
  104520. /***/ "./node_modules/lodash-es/forEach.js":
  104521. /*!*******************************************!*\
  104522. !*** ./node_modules/lodash-es/forEach.js ***!
  104523. \*******************************************/
  104524. /*! exports provided: default */
  104525. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104526. "use strict";
  104527. __webpack_require__.r(__webpack_exports__);
  104528. /* harmony import */ var _arrayEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayEach.js */ "./node_modules/lodash-es/_arrayEach.js");
  104529. /* harmony import */ var _baseEach_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseEach.js */ "./node_modules/lodash-es/_baseEach.js");
  104530. /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
  104531. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  104532. /**
  104533. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  104534. * The iteratee is invoked with three arguments: (value, index|key, collection).
  104535. * Iteratee functions may exit iteration early by explicitly returning `false`.
  104536. *
  104537. * **Note:** As with other "Collections" methods, objects with a "length"
  104538. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  104539. * or `_.forOwn` for object iteration.
  104540. *
  104541. * @static
  104542. * @memberOf _
  104543. * @since 0.1.0
  104544. * @alias each
  104545. * @category Collection
  104546. * @param {Array|Object} collection The collection to iterate over.
  104547. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  104548. * @returns {Array|Object} Returns `collection`.
  104549. * @see _.forEachRight
  104550. * @example
  104551. *
  104552. * _.forEach([1, 2], function(value) {
  104553. * console.log(value);
  104554. * });
  104555. * // => Logs `1` then `2`.
  104556. *
  104557. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  104558. * console.log(key);
  104559. * });
  104560. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  104561. */
  104562. function forEach(collection, iteratee) {
  104563. var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection) ? _arrayEach_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseEach_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  104564. return func(collection, Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee));
  104565. }
  104566. /* harmony default export */ __webpack_exports__["default"] = (forEach);
  104567. /***/ }),
  104568. /***/ "./node_modules/lodash-es/forEachRight.js":
  104569. /*!************************************************!*\
  104570. !*** ./node_modules/lodash-es/forEachRight.js ***!
  104571. \************************************************/
  104572. /*! exports provided: default */
  104573. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104574. "use strict";
  104575. __webpack_require__.r(__webpack_exports__);
  104576. /* harmony import */ var _arrayEachRight_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayEachRight.js */ "./node_modules/lodash-es/_arrayEachRight.js");
  104577. /* harmony import */ var _baseEachRight_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseEachRight.js */ "./node_modules/lodash-es/_baseEachRight.js");
  104578. /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
  104579. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  104580. /**
  104581. * This method is like `_.forEach` except that it iterates over elements of
  104582. * `collection` from right to left.
  104583. *
  104584. * @static
  104585. * @memberOf _
  104586. * @since 2.0.0
  104587. * @alias eachRight
  104588. * @category Collection
  104589. * @param {Array|Object} collection The collection to iterate over.
  104590. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  104591. * @returns {Array|Object} Returns `collection`.
  104592. * @see _.forEach
  104593. * @example
  104594. *
  104595. * _.forEachRight([1, 2], function(value) {
  104596. * console.log(value);
  104597. * });
  104598. * // => Logs `2` then `1`.
  104599. */
  104600. function forEachRight(collection, iteratee) {
  104601. var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection) ? _arrayEachRight_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseEachRight_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  104602. return func(collection, Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee));
  104603. }
  104604. /* harmony default export */ __webpack_exports__["default"] = (forEachRight);
  104605. /***/ }),
  104606. /***/ "./node_modules/lodash-es/forIn.js":
  104607. /*!*****************************************!*\
  104608. !*** ./node_modules/lodash-es/forIn.js ***!
  104609. \*****************************************/
  104610. /*! exports provided: default */
  104611. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104612. "use strict";
  104613. __webpack_require__.r(__webpack_exports__);
  104614. /* harmony import */ var _baseFor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFor.js */ "./node_modules/lodash-es/_baseFor.js");
  104615. /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
  104616. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  104617. /**
  104618. * Iterates over own and inherited enumerable string keyed properties of an
  104619. * object and invokes `iteratee` for each property. The iteratee is invoked
  104620. * with three arguments: (value, key, object). Iteratee functions may exit
  104621. * iteration early by explicitly returning `false`.
  104622. *
  104623. * @static
  104624. * @memberOf _
  104625. * @since 0.3.0
  104626. * @category Object
  104627. * @param {Object} object The object to iterate over.
  104628. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  104629. * @returns {Object} Returns `object`.
  104630. * @see _.forInRight
  104631. * @example
  104632. *
  104633. * function Foo() {
  104634. * this.a = 1;
  104635. * this.b = 2;
  104636. * }
  104637. *
  104638. * Foo.prototype.c = 3;
  104639. *
  104640. * _.forIn(new Foo, function(value, key) {
  104641. * console.log(key);
  104642. * });
  104643. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  104644. */
  104645. function forIn(object, iteratee) {
  104646. return object == null
  104647. ? object
  104648. : Object(_baseFor_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratee), _keysIn_js__WEBPACK_IMPORTED_MODULE_2__["default"]);
  104649. }
  104650. /* harmony default export */ __webpack_exports__["default"] = (forIn);
  104651. /***/ }),
  104652. /***/ "./node_modules/lodash-es/forInRight.js":
  104653. /*!**********************************************!*\
  104654. !*** ./node_modules/lodash-es/forInRight.js ***!
  104655. \**********************************************/
  104656. /*! exports provided: default */
  104657. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104658. "use strict";
  104659. __webpack_require__.r(__webpack_exports__);
  104660. /* harmony import */ var _baseForRight_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseForRight.js */ "./node_modules/lodash-es/_baseForRight.js");
  104661. /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
  104662. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  104663. /**
  104664. * This method is like `_.forIn` except that it iterates over properties of
  104665. * `object` in the opposite order.
  104666. *
  104667. * @static
  104668. * @memberOf _
  104669. * @since 2.0.0
  104670. * @category Object
  104671. * @param {Object} object The object to iterate over.
  104672. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  104673. * @returns {Object} Returns `object`.
  104674. * @see _.forIn
  104675. * @example
  104676. *
  104677. * function Foo() {
  104678. * this.a = 1;
  104679. * this.b = 2;
  104680. * }
  104681. *
  104682. * Foo.prototype.c = 3;
  104683. *
  104684. * _.forInRight(new Foo, function(value, key) {
  104685. * console.log(key);
  104686. * });
  104687. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  104688. */
  104689. function forInRight(object, iteratee) {
  104690. return object == null
  104691. ? object
  104692. : Object(_baseForRight_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratee), _keysIn_js__WEBPACK_IMPORTED_MODULE_2__["default"]);
  104693. }
  104694. /* harmony default export */ __webpack_exports__["default"] = (forInRight);
  104695. /***/ }),
  104696. /***/ "./node_modules/lodash-es/forOwn.js":
  104697. /*!******************************************!*\
  104698. !*** ./node_modules/lodash-es/forOwn.js ***!
  104699. \******************************************/
  104700. /*! exports provided: default */
  104701. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104702. "use strict";
  104703. __webpack_require__.r(__webpack_exports__);
  104704. /* harmony import */ var _baseForOwn_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseForOwn.js */ "./node_modules/lodash-es/_baseForOwn.js");
  104705. /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
  104706. /**
  104707. * Iterates over own enumerable string keyed properties of an object and
  104708. * invokes `iteratee` for each property. The iteratee is invoked with three
  104709. * arguments: (value, key, object). Iteratee functions may exit iteration
  104710. * early by explicitly returning `false`.
  104711. *
  104712. * @static
  104713. * @memberOf _
  104714. * @since 0.3.0
  104715. * @category Object
  104716. * @param {Object} object The object to iterate over.
  104717. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  104718. * @returns {Object} Returns `object`.
  104719. * @see _.forOwnRight
  104720. * @example
  104721. *
  104722. * function Foo() {
  104723. * this.a = 1;
  104724. * this.b = 2;
  104725. * }
  104726. *
  104727. * Foo.prototype.c = 3;
  104728. *
  104729. * _.forOwn(new Foo, function(value, key) {
  104730. * console.log(key);
  104731. * });
  104732. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  104733. */
  104734. function forOwn(object, iteratee) {
  104735. return object && Object(_baseForOwn_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratee));
  104736. }
  104737. /* harmony default export */ __webpack_exports__["default"] = (forOwn);
  104738. /***/ }),
  104739. /***/ "./node_modules/lodash-es/forOwnRight.js":
  104740. /*!***********************************************!*\
  104741. !*** ./node_modules/lodash-es/forOwnRight.js ***!
  104742. \***********************************************/
  104743. /*! exports provided: default */
  104744. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104745. "use strict";
  104746. __webpack_require__.r(__webpack_exports__);
  104747. /* harmony import */ var _baseForOwnRight_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseForOwnRight.js */ "./node_modules/lodash-es/_baseForOwnRight.js");
  104748. /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
  104749. /**
  104750. * This method is like `_.forOwn` except that it iterates over properties of
  104751. * `object` in the opposite order.
  104752. *
  104753. * @static
  104754. * @memberOf _
  104755. * @since 2.0.0
  104756. * @category Object
  104757. * @param {Object} object The object to iterate over.
  104758. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  104759. * @returns {Object} Returns `object`.
  104760. * @see _.forOwn
  104761. * @example
  104762. *
  104763. * function Foo() {
  104764. * this.a = 1;
  104765. * this.b = 2;
  104766. * }
  104767. *
  104768. * Foo.prototype.c = 3;
  104769. *
  104770. * _.forOwnRight(new Foo, function(value, key) {
  104771. * console.log(key);
  104772. * });
  104773. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  104774. */
  104775. function forOwnRight(object, iteratee) {
  104776. return object && Object(_baseForOwnRight_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratee));
  104777. }
  104778. /* harmony default export */ __webpack_exports__["default"] = (forOwnRight);
  104779. /***/ }),
  104780. /***/ "./node_modules/lodash-es/fromPairs.js":
  104781. /*!*********************************************!*\
  104782. !*** ./node_modules/lodash-es/fromPairs.js ***!
  104783. \*********************************************/
  104784. /*! exports provided: default */
  104785. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104786. "use strict";
  104787. __webpack_require__.r(__webpack_exports__);
  104788. /**
  104789. * The inverse of `_.toPairs`; this method returns an object composed
  104790. * from key-value `pairs`.
  104791. *
  104792. * @static
  104793. * @memberOf _
  104794. * @since 4.0.0
  104795. * @category Array
  104796. * @param {Array} pairs The key-value pairs.
  104797. * @returns {Object} Returns the new object.
  104798. * @example
  104799. *
  104800. * _.fromPairs([['a', 1], ['b', 2]]);
  104801. * // => { 'a': 1, 'b': 2 }
  104802. */
  104803. function fromPairs(pairs) {
  104804. var index = -1,
  104805. length = pairs == null ? 0 : pairs.length,
  104806. result = {};
  104807. while (++index < length) {
  104808. var pair = pairs[index];
  104809. result[pair[0]] = pair[1];
  104810. }
  104811. return result;
  104812. }
  104813. /* harmony default export */ __webpack_exports__["default"] = (fromPairs);
  104814. /***/ }),
  104815. /***/ "./node_modules/lodash-es/function.default.js":
  104816. /*!****************************************************!*\
  104817. !*** ./node_modules/lodash-es/function.default.js ***!
  104818. \****************************************************/
  104819. /*! exports provided: default */
  104820. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104821. "use strict";
  104822. __webpack_require__.r(__webpack_exports__);
  104823. /* harmony import */ var _after_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./after.js */ "./node_modules/lodash-es/after.js");
  104824. /* harmony import */ var _ary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ary.js */ "./node_modules/lodash-es/ary.js");
  104825. /* harmony import */ var _before_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./before.js */ "./node_modules/lodash-es/before.js");
  104826. /* harmony import */ var _bind_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./bind.js */ "./node_modules/lodash-es/bind.js");
  104827. /* harmony import */ var _bindKey_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./bindKey.js */ "./node_modules/lodash-es/bindKey.js");
  104828. /* harmony import */ var _curry_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./curry.js */ "./node_modules/lodash-es/curry.js");
  104829. /* harmony import */ var _curryRight_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./curryRight.js */ "./node_modules/lodash-es/curryRight.js");
  104830. /* harmony import */ var _debounce_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./debounce.js */ "./node_modules/lodash-es/debounce.js");
  104831. /* harmony import */ var _defer_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./defer.js */ "./node_modules/lodash-es/defer.js");
  104832. /* harmony import */ var _delay_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./delay.js */ "./node_modules/lodash-es/delay.js");
  104833. /* harmony import */ var _flip_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./flip.js */ "./node_modules/lodash-es/flip.js");
  104834. /* harmony import */ var _memoize_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./memoize.js */ "./node_modules/lodash-es/memoize.js");
  104835. /* harmony import */ var _negate_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./negate.js */ "./node_modules/lodash-es/negate.js");
  104836. /* harmony import */ var _once_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./once.js */ "./node_modules/lodash-es/once.js");
  104837. /* harmony import */ var _overArgs_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./overArgs.js */ "./node_modules/lodash-es/overArgs.js");
  104838. /* harmony import */ var _partial_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./partial.js */ "./node_modules/lodash-es/partial.js");
  104839. /* harmony import */ var _partialRight_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./partialRight.js */ "./node_modules/lodash-es/partialRight.js");
  104840. /* harmony import */ var _rearg_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./rearg.js */ "./node_modules/lodash-es/rearg.js");
  104841. /* harmony import */ var _rest_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./rest.js */ "./node_modules/lodash-es/rest.js");
  104842. /* harmony import */ var _spread_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./spread.js */ "./node_modules/lodash-es/spread.js");
  104843. /* harmony import */ var _throttle_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./throttle.js */ "./node_modules/lodash-es/throttle.js");
  104844. /* harmony import */ var _unary_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./unary.js */ "./node_modules/lodash-es/unary.js");
  104845. /* harmony import */ var _wrap_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./wrap.js */ "./node_modules/lodash-es/wrap.js");
  104846. /* harmony default export */ __webpack_exports__["default"] = ({
  104847. after: _after_js__WEBPACK_IMPORTED_MODULE_0__["default"], ary: _ary_js__WEBPACK_IMPORTED_MODULE_1__["default"], before: _before_js__WEBPACK_IMPORTED_MODULE_2__["default"], bind: _bind_js__WEBPACK_IMPORTED_MODULE_3__["default"], bindKey: _bindKey_js__WEBPACK_IMPORTED_MODULE_4__["default"],
  104848. curry: _curry_js__WEBPACK_IMPORTED_MODULE_5__["default"], curryRight: _curryRight_js__WEBPACK_IMPORTED_MODULE_6__["default"], debounce: _debounce_js__WEBPACK_IMPORTED_MODULE_7__["default"], defer: _defer_js__WEBPACK_IMPORTED_MODULE_8__["default"], delay: _delay_js__WEBPACK_IMPORTED_MODULE_9__["default"],
  104849. flip: _flip_js__WEBPACK_IMPORTED_MODULE_10__["default"], memoize: _memoize_js__WEBPACK_IMPORTED_MODULE_11__["default"], negate: _negate_js__WEBPACK_IMPORTED_MODULE_12__["default"], once: _once_js__WEBPACK_IMPORTED_MODULE_13__["default"], overArgs: _overArgs_js__WEBPACK_IMPORTED_MODULE_14__["default"],
  104850. partial: _partial_js__WEBPACK_IMPORTED_MODULE_15__["default"], partialRight: _partialRight_js__WEBPACK_IMPORTED_MODULE_16__["default"], rearg: _rearg_js__WEBPACK_IMPORTED_MODULE_17__["default"], rest: _rest_js__WEBPACK_IMPORTED_MODULE_18__["default"], spread: _spread_js__WEBPACK_IMPORTED_MODULE_19__["default"],
  104851. throttle: _throttle_js__WEBPACK_IMPORTED_MODULE_20__["default"], unary: _unary_js__WEBPACK_IMPORTED_MODULE_21__["default"], wrap: _wrap_js__WEBPACK_IMPORTED_MODULE_22__["default"]
  104852. });
  104853. /***/ }),
  104854. /***/ "./node_modules/lodash-es/function.js":
  104855. /*!********************************************!*\
  104856. !*** ./node_modules/lodash-es/function.js ***!
  104857. \********************************************/
  104858. /*! exports provided: after, ary, before, bind, bindKey, curry, curryRight, debounce, defer, delay, flip, memoize, negate, once, overArgs, partial, partialRight, rearg, rest, spread, throttle, unary, wrap, default */
  104859. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104860. "use strict";
  104861. __webpack_require__.r(__webpack_exports__);
  104862. /* harmony import */ var _after_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./after.js */ "./node_modules/lodash-es/after.js");
  104863. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "after", function() { return _after_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  104864. /* harmony import */ var _ary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ary.js */ "./node_modules/lodash-es/ary.js");
  104865. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ary", function() { return _ary_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  104866. /* harmony import */ var _before_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./before.js */ "./node_modules/lodash-es/before.js");
  104867. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "before", function() { return _before_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  104868. /* harmony import */ var _bind_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./bind.js */ "./node_modules/lodash-es/bind.js");
  104869. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bind", function() { return _bind_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  104870. /* harmony import */ var _bindKey_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./bindKey.js */ "./node_modules/lodash-es/bindKey.js");
  104871. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bindKey", function() { return _bindKey_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  104872. /* harmony import */ var _curry_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./curry.js */ "./node_modules/lodash-es/curry.js");
  104873. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curry", function() { return _curry_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  104874. /* harmony import */ var _curryRight_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./curryRight.js */ "./node_modules/lodash-es/curryRight.js");
  104875. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curryRight", function() { return _curryRight_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  104876. /* harmony import */ var _debounce_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./debounce.js */ "./node_modules/lodash-es/debounce.js");
  104877. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return _debounce_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  104878. /* harmony import */ var _defer_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./defer.js */ "./node_modules/lodash-es/defer.js");
  104879. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return _defer_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  104880. /* harmony import */ var _delay_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./delay.js */ "./node_modules/lodash-es/delay.js");
  104881. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return _delay_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  104882. /* harmony import */ var _flip_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./flip.js */ "./node_modules/lodash-es/flip.js");
  104883. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flip", function() { return _flip_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  104884. /* harmony import */ var _memoize_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./memoize.js */ "./node_modules/lodash-es/memoize.js");
  104885. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "memoize", function() { return _memoize_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  104886. /* harmony import */ var _negate_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./negate.js */ "./node_modules/lodash-es/negate.js");
  104887. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "negate", function() { return _negate_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  104888. /* harmony import */ var _once_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./once.js */ "./node_modules/lodash-es/once.js");
  104889. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "once", function() { return _once_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  104890. /* harmony import */ var _overArgs_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./overArgs.js */ "./node_modules/lodash-es/overArgs.js");
  104891. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "overArgs", function() { return _overArgs_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  104892. /* harmony import */ var _partial_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./partial.js */ "./node_modules/lodash-es/partial.js");
  104893. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partial", function() { return _partial_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
  104894. /* harmony import */ var _partialRight_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./partialRight.js */ "./node_modules/lodash-es/partialRight.js");
  104895. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partialRight", function() { return _partialRight_js__WEBPACK_IMPORTED_MODULE_16__["default"]; });
  104896. /* harmony import */ var _rearg_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./rearg.js */ "./node_modules/lodash-es/rearg.js");
  104897. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rearg", function() { return _rearg_js__WEBPACK_IMPORTED_MODULE_17__["default"]; });
  104898. /* harmony import */ var _rest_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./rest.js */ "./node_modules/lodash-es/rest.js");
  104899. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rest", function() { return _rest_js__WEBPACK_IMPORTED_MODULE_18__["default"]; });
  104900. /* harmony import */ var _spread_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./spread.js */ "./node_modules/lodash-es/spread.js");
  104901. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "spread", function() { return _spread_js__WEBPACK_IMPORTED_MODULE_19__["default"]; });
  104902. /* harmony import */ var _throttle_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./throttle.js */ "./node_modules/lodash-es/throttle.js");
  104903. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return _throttle_js__WEBPACK_IMPORTED_MODULE_20__["default"]; });
  104904. /* harmony import */ var _unary_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./unary.js */ "./node_modules/lodash-es/unary.js");
  104905. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unary", function() { return _unary_js__WEBPACK_IMPORTED_MODULE_21__["default"]; });
  104906. /* harmony import */ var _wrap_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./wrap.js */ "./node_modules/lodash-es/wrap.js");
  104907. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return _wrap_js__WEBPACK_IMPORTED_MODULE_22__["default"]; });
  104908. /* harmony import */ var _function_default_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./function.default.js */ "./node_modules/lodash-es/function.default.js");
  104909. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _function_default_js__WEBPACK_IMPORTED_MODULE_23__["default"]; });
  104910. /***/ }),
  104911. /***/ "./node_modules/lodash-es/functions.js":
  104912. /*!*********************************************!*\
  104913. !*** ./node_modules/lodash-es/functions.js ***!
  104914. \*********************************************/
  104915. /*! exports provided: default */
  104916. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104917. "use strict";
  104918. __webpack_require__.r(__webpack_exports__);
  104919. /* harmony import */ var _baseFunctions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFunctions.js */ "./node_modules/lodash-es/_baseFunctions.js");
  104920. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  104921. /**
  104922. * Creates an array of function property names from own enumerable properties
  104923. * of `object`.
  104924. *
  104925. * @static
  104926. * @since 0.1.0
  104927. * @memberOf _
  104928. * @category Object
  104929. * @param {Object} object The object to inspect.
  104930. * @returns {Array} Returns the function names.
  104931. * @see _.functionsIn
  104932. * @example
  104933. *
  104934. * function Foo() {
  104935. * this.a = _.constant('a');
  104936. * this.b = _.constant('b');
  104937. * }
  104938. *
  104939. * Foo.prototype.c = _.constant('c');
  104940. *
  104941. * _.functions(new Foo);
  104942. * // => ['a', 'b']
  104943. */
  104944. function functions(object) {
  104945. return object == null ? [] : Object(_baseFunctions_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_keys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object));
  104946. }
  104947. /* harmony default export */ __webpack_exports__["default"] = (functions);
  104948. /***/ }),
  104949. /***/ "./node_modules/lodash-es/functionsIn.js":
  104950. /*!***********************************************!*\
  104951. !*** ./node_modules/lodash-es/functionsIn.js ***!
  104952. \***********************************************/
  104953. /*! exports provided: default */
  104954. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104955. "use strict";
  104956. __webpack_require__.r(__webpack_exports__);
  104957. /* harmony import */ var _baseFunctions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFunctions.js */ "./node_modules/lodash-es/_baseFunctions.js");
  104958. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  104959. /**
  104960. * Creates an array of function property names from own and inherited
  104961. * enumerable properties of `object`.
  104962. *
  104963. * @static
  104964. * @memberOf _
  104965. * @since 4.0.0
  104966. * @category Object
  104967. * @param {Object} object The object to inspect.
  104968. * @returns {Array} Returns the function names.
  104969. * @see _.functions
  104970. * @example
  104971. *
  104972. * function Foo() {
  104973. * this.a = _.constant('a');
  104974. * this.b = _.constant('b');
  104975. * }
  104976. *
  104977. * Foo.prototype.c = _.constant('c');
  104978. *
  104979. * _.functionsIn(new Foo);
  104980. * // => ['a', 'b', 'c']
  104981. */
  104982. function functionsIn(object) {
  104983. return object == null ? [] : Object(_baseFunctions_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_keysIn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object));
  104984. }
  104985. /* harmony default export */ __webpack_exports__["default"] = (functionsIn);
  104986. /***/ }),
  104987. /***/ "./node_modules/lodash-es/get.js":
  104988. /*!***************************************!*\
  104989. !*** ./node_modules/lodash-es/get.js ***!
  104990. \***************************************/
  104991. /*! exports provided: default */
  104992. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104993. "use strict";
  104994. __webpack_require__.r(__webpack_exports__);
  104995. /* harmony import */ var _baseGet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGet.js */ "./node_modules/lodash-es/_baseGet.js");
  104996. /**
  104997. * Gets the value at `path` of `object`. If the resolved value is
  104998. * `undefined`, the `defaultValue` is returned in its place.
  104999. *
  105000. * @static
  105001. * @memberOf _
  105002. * @since 3.7.0
  105003. * @category Object
  105004. * @param {Object} object The object to query.
  105005. * @param {Array|string} path The path of the property to get.
  105006. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  105007. * @returns {*} Returns the resolved value.
  105008. * @example
  105009. *
  105010. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  105011. *
  105012. * _.get(object, 'a[0].b.c');
  105013. * // => 3
  105014. *
  105015. * _.get(object, ['a', '0', 'b', 'c']);
  105016. * // => 3
  105017. *
  105018. * _.get(object, 'a.b.c', 'default');
  105019. * // => 'default'
  105020. */
  105021. function get(object, path, defaultValue) {
  105022. var result = object == null ? undefined : Object(_baseGet_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path);
  105023. return result === undefined ? defaultValue : result;
  105024. }
  105025. /* harmony default export */ __webpack_exports__["default"] = (get);
  105026. /***/ }),
  105027. /***/ "./node_modules/lodash-es/groupBy.js":
  105028. /*!*******************************************!*\
  105029. !*** ./node_modules/lodash-es/groupBy.js ***!
  105030. \*******************************************/
  105031. /*! exports provided: default */
  105032. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105033. "use strict";
  105034. __webpack_require__.r(__webpack_exports__);
  105035. /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
  105036. /* harmony import */ var _createAggregator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createAggregator.js */ "./node_modules/lodash-es/_createAggregator.js");
  105037. /** Used for built-in method references. */
  105038. var objectProto = Object.prototype;
  105039. /** Used to check objects for own properties. */
  105040. var hasOwnProperty = objectProto.hasOwnProperty;
  105041. /**
  105042. * Creates an object composed of keys generated from the results of running
  105043. * each element of `collection` thru `iteratee`. The order of grouped values
  105044. * is determined by the order they occur in `collection`. The corresponding
  105045. * value of each key is an array of elements responsible for generating the
  105046. * key. The iteratee is invoked with one argument: (value).
  105047. *
  105048. * @static
  105049. * @memberOf _
  105050. * @since 0.1.0
  105051. * @category Collection
  105052. * @param {Array|Object} collection The collection to iterate over.
  105053. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  105054. * @returns {Object} Returns the composed aggregate object.
  105055. * @example
  105056. *
  105057. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  105058. * // => { '4': [4.2], '6': [6.1, 6.3] }
  105059. *
  105060. * // The `_.property` iteratee shorthand.
  105061. * _.groupBy(['one', 'two', 'three'], 'length');
  105062. * // => { '3': ['one', 'two'], '5': ['three'] }
  105063. */
  105064. var groupBy = Object(_createAggregator_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(result, value, key) {
  105065. if (hasOwnProperty.call(result, key)) {
  105066. result[key].push(value);
  105067. } else {
  105068. Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, key, [value]);
  105069. }
  105070. });
  105071. /* harmony default export */ __webpack_exports__["default"] = (groupBy);
  105072. /***/ }),
  105073. /***/ "./node_modules/lodash-es/gt.js":
  105074. /*!**************************************!*\
  105075. !*** ./node_modules/lodash-es/gt.js ***!
  105076. \**************************************/
  105077. /*! exports provided: default */
  105078. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105079. "use strict";
  105080. __webpack_require__.r(__webpack_exports__);
  105081. /* harmony import */ var _baseGt_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGt.js */ "./node_modules/lodash-es/_baseGt.js");
  105082. /* harmony import */ var _createRelationalOperation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createRelationalOperation.js */ "./node_modules/lodash-es/_createRelationalOperation.js");
  105083. /**
  105084. * Checks if `value` is greater than `other`.
  105085. *
  105086. * @static
  105087. * @memberOf _
  105088. * @since 3.9.0
  105089. * @category Lang
  105090. * @param {*} value The value to compare.
  105091. * @param {*} other The other value to compare.
  105092. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  105093. * else `false`.
  105094. * @see _.lt
  105095. * @example
  105096. *
  105097. * _.gt(3, 1);
  105098. * // => true
  105099. *
  105100. * _.gt(3, 3);
  105101. * // => false
  105102. *
  105103. * _.gt(1, 3);
  105104. * // => false
  105105. */
  105106. var gt = Object(_createRelationalOperation_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_baseGt_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  105107. /* harmony default export */ __webpack_exports__["default"] = (gt);
  105108. /***/ }),
  105109. /***/ "./node_modules/lodash-es/gte.js":
  105110. /*!***************************************!*\
  105111. !*** ./node_modules/lodash-es/gte.js ***!
  105112. \***************************************/
  105113. /*! exports provided: default */
  105114. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105115. "use strict";
  105116. __webpack_require__.r(__webpack_exports__);
  105117. /* harmony import */ var _createRelationalOperation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createRelationalOperation.js */ "./node_modules/lodash-es/_createRelationalOperation.js");
  105118. /**
  105119. * Checks if `value` is greater than or equal to `other`.
  105120. *
  105121. * @static
  105122. * @memberOf _
  105123. * @since 3.9.0
  105124. * @category Lang
  105125. * @param {*} value The value to compare.
  105126. * @param {*} other The other value to compare.
  105127. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  105128. * `other`, else `false`.
  105129. * @see _.lte
  105130. * @example
  105131. *
  105132. * _.gte(3, 1);
  105133. * // => true
  105134. *
  105135. * _.gte(3, 3);
  105136. * // => true
  105137. *
  105138. * _.gte(1, 3);
  105139. * // => false
  105140. */
  105141. var gte = Object(_createRelationalOperation_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(value, other) {
  105142. return value >= other;
  105143. });
  105144. /* harmony default export */ __webpack_exports__["default"] = (gte);
  105145. /***/ }),
  105146. /***/ "./node_modules/lodash-es/has.js":
  105147. /*!***************************************!*\
  105148. !*** ./node_modules/lodash-es/has.js ***!
  105149. \***************************************/
  105150. /*! exports provided: default */
  105151. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105152. "use strict";
  105153. __webpack_require__.r(__webpack_exports__);
  105154. /* harmony import */ var _baseHas_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseHas.js */ "./node_modules/lodash-es/_baseHas.js");
  105155. /* harmony import */ var _hasPath_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_hasPath.js */ "./node_modules/lodash-es/_hasPath.js");
  105156. /**
  105157. * Checks if `path` is a direct property of `object`.
  105158. *
  105159. * @static
  105160. * @since 0.1.0
  105161. * @memberOf _
  105162. * @category Object
  105163. * @param {Object} object The object to query.
  105164. * @param {Array|string} path The path to check.
  105165. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  105166. * @example
  105167. *
  105168. * var object = { 'a': { 'b': 2 } };
  105169. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  105170. *
  105171. * _.has(object, 'a');
  105172. * // => true
  105173. *
  105174. * _.has(object, 'a.b');
  105175. * // => true
  105176. *
  105177. * _.has(object, ['a', 'b']);
  105178. * // => true
  105179. *
  105180. * _.has(other, 'a');
  105181. * // => false
  105182. */
  105183. function has(object, path) {
  105184. return object != null && Object(_hasPath_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, path, _baseHas_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  105185. }
  105186. /* harmony default export */ __webpack_exports__["default"] = (has);
  105187. /***/ }),
  105188. /***/ "./node_modules/lodash-es/hasIn.js":
  105189. /*!*****************************************!*\
  105190. !*** ./node_modules/lodash-es/hasIn.js ***!
  105191. \*****************************************/
  105192. /*! exports provided: default */
  105193. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105194. "use strict";
  105195. __webpack_require__.r(__webpack_exports__);
  105196. /* harmony import */ var _baseHasIn_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseHasIn.js */ "./node_modules/lodash-es/_baseHasIn.js");
  105197. /* harmony import */ var _hasPath_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_hasPath.js */ "./node_modules/lodash-es/_hasPath.js");
  105198. /**
  105199. * Checks if `path` is a direct or inherited property of `object`.
  105200. *
  105201. * @static
  105202. * @memberOf _
  105203. * @since 4.0.0
  105204. * @category Object
  105205. * @param {Object} object The object to query.
  105206. * @param {Array|string} path The path to check.
  105207. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  105208. * @example
  105209. *
  105210. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  105211. *
  105212. * _.hasIn(object, 'a');
  105213. * // => true
  105214. *
  105215. * _.hasIn(object, 'a.b');
  105216. * // => true
  105217. *
  105218. * _.hasIn(object, ['a', 'b']);
  105219. * // => true
  105220. *
  105221. * _.hasIn(object, 'b');
  105222. * // => false
  105223. */
  105224. function hasIn(object, path) {
  105225. return object != null && Object(_hasPath_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, path, _baseHasIn_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  105226. }
  105227. /* harmony default export */ __webpack_exports__["default"] = (hasIn);
  105228. /***/ }),
  105229. /***/ "./node_modules/lodash-es/head.js":
  105230. /*!****************************************!*\
  105231. !*** ./node_modules/lodash-es/head.js ***!
  105232. \****************************************/
  105233. /*! exports provided: default */
  105234. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105235. "use strict";
  105236. __webpack_require__.r(__webpack_exports__);
  105237. /**
  105238. * Gets the first element of `array`.
  105239. *
  105240. * @static
  105241. * @memberOf _
  105242. * @since 0.1.0
  105243. * @alias first
  105244. * @category Array
  105245. * @param {Array} array The array to query.
  105246. * @returns {*} Returns the first element of `array`.
  105247. * @example
  105248. *
  105249. * _.head([1, 2, 3]);
  105250. * // => 1
  105251. *
  105252. * _.head([]);
  105253. * // => undefined
  105254. */
  105255. function head(array) {
  105256. return (array && array.length) ? array[0] : undefined;
  105257. }
  105258. /* harmony default export */ __webpack_exports__["default"] = (head);
  105259. /***/ }),
  105260. /***/ "./node_modules/lodash-es/identity.js":
  105261. /*!********************************************!*\
  105262. !*** ./node_modules/lodash-es/identity.js ***!
  105263. \********************************************/
  105264. /*! exports provided: default */
  105265. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105266. "use strict";
  105267. __webpack_require__.r(__webpack_exports__);
  105268. /**
  105269. * This method returns the first argument it receives.
  105270. *
  105271. * @static
  105272. * @since 0.1.0
  105273. * @memberOf _
  105274. * @category Util
  105275. * @param {*} value Any value.
  105276. * @returns {*} Returns `value`.
  105277. * @example
  105278. *
  105279. * var object = { 'a': 1 };
  105280. *
  105281. * console.log(_.identity(object) === object);
  105282. * // => true
  105283. */
  105284. function identity(value) {
  105285. return value;
  105286. }
  105287. /* harmony default export */ __webpack_exports__["default"] = (identity);
  105288. /***/ }),
  105289. /***/ "./node_modules/lodash-es/inRange.js":
  105290. /*!*******************************************!*\
  105291. !*** ./node_modules/lodash-es/inRange.js ***!
  105292. \*******************************************/
  105293. /*! exports provided: default */
  105294. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105295. "use strict";
  105296. __webpack_require__.r(__webpack_exports__);
  105297. /* harmony import */ var _baseInRange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseInRange.js */ "./node_modules/lodash-es/_baseInRange.js");
  105298. /* harmony import */ var _toFinite_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toFinite.js */ "./node_modules/lodash-es/toFinite.js");
  105299. /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
  105300. /**
  105301. * Checks if `n` is between `start` and up to, but not including, `end`. If
  105302. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  105303. * If `start` is greater than `end` the params are swapped to support
  105304. * negative ranges.
  105305. *
  105306. * @static
  105307. * @memberOf _
  105308. * @since 3.3.0
  105309. * @category Number
  105310. * @param {number} number The number to check.
  105311. * @param {number} [start=0] The start of the range.
  105312. * @param {number} end The end of the range.
  105313. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  105314. * @see _.range, _.rangeRight
  105315. * @example
  105316. *
  105317. * _.inRange(3, 2, 4);
  105318. * // => true
  105319. *
  105320. * _.inRange(4, 8);
  105321. * // => true
  105322. *
  105323. * _.inRange(4, 2);
  105324. * // => false
  105325. *
  105326. * _.inRange(2, 2);
  105327. * // => false
  105328. *
  105329. * _.inRange(1.2, 2);
  105330. * // => true
  105331. *
  105332. * _.inRange(5.2, 4);
  105333. * // => false
  105334. *
  105335. * _.inRange(-3, -2, -6);
  105336. * // => true
  105337. */
  105338. function inRange(number, start, end) {
  105339. start = Object(_toFinite_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start);
  105340. if (end === undefined) {
  105341. end = start;
  105342. start = 0;
  105343. } else {
  105344. end = Object(_toFinite_js__WEBPACK_IMPORTED_MODULE_1__["default"])(end);
  105345. }
  105346. number = Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_2__["default"])(number);
  105347. return Object(_baseInRange_js__WEBPACK_IMPORTED_MODULE_0__["default"])(number, start, end);
  105348. }
  105349. /* harmony default export */ __webpack_exports__["default"] = (inRange);
  105350. /***/ }),
  105351. /***/ "./node_modules/lodash-es/includes.js":
  105352. /*!********************************************!*\
  105353. !*** ./node_modules/lodash-es/includes.js ***!
  105354. \********************************************/
  105355. /*! exports provided: default */
  105356. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105357. "use strict";
  105358. __webpack_require__.r(__webpack_exports__);
  105359. /* harmony import */ var _baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIndexOf.js */ "./node_modules/lodash-es/_baseIndexOf.js");
  105360. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  105361. /* harmony import */ var _isString_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isString.js */ "./node_modules/lodash-es/isString.js");
  105362. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  105363. /* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./values.js */ "./node_modules/lodash-es/values.js");
  105364. /* Built-in method references for those with the same name as other `lodash` methods. */
  105365. var nativeMax = Math.max;
  105366. /**
  105367. * Checks if `value` is in `collection`. If `collection` is a string, it's
  105368. * checked for a substring of `value`, otherwise
  105369. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  105370. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  105371. * the offset from the end of `collection`.
  105372. *
  105373. * @static
  105374. * @memberOf _
  105375. * @since 0.1.0
  105376. * @category Collection
  105377. * @param {Array|Object|string} collection The collection to inspect.
  105378. * @param {*} value The value to search for.
  105379. * @param {number} [fromIndex=0] The index to search from.
  105380. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  105381. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  105382. * @example
  105383. *
  105384. * _.includes([1, 2, 3], 1);
  105385. * // => true
  105386. *
  105387. * _.includes([1, 2, 3], 1, 2);
  105388. * // => false
  105389. *
  105390. * _.includes({ 'a': 1, 'b': 2 }, 1);
  105391. * // => true
  105392. *
  105393. * _.includes('abcd', 'bc');
  105394. * // => true
  105395. */
  105396. function includes(collection, value, fromIndex, guard) {
  105397. collection = Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection) ? collection : Object(_values_js__WEBPACK_IMPORTED_MODULE_4__["default"])(collection);
  105398. fromIndex = (fromIndex && !guard) ? Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_3__["default"])(fromIndex) : 0;
  105399. var length = collection.length;
  105400. if (fromIndex < 0) {
  105401. fromIndex = nativeMax(length + fromIndex, 0);
  105402. }
  105403. return Object(_isString_js__WEBPACK_IMPORTED_MODULE_2__["default"])(collection)
  105404. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  105405. : (!!length && Object(_baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection, value, fromIndex) > -1);
  105406. }
  105407. /* harmony default export */ __webpack_exports__["default"] = (includes);
  105408. /***/ }),
  105409. /***/ "./node_modules/lodash-es/indexOf.js":
  105410. /*!*******************************************!*\
  105411. !*** ./node_modules/lodash-es/indexOf.js ***!
  105412. \*******************************************/
  105413. /*! exports provided: default */
  105414. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105415. "use strict";
  105416. __webpack_require__.r(__webpack_exports__);
  105417. /* harmony import */ var _baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIndexOf.js */ "./node_modules/lodash-es/_baseIndexOf.js");
  105418. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  105419. /* Built-in method references for those with the same name as other `lodash` methods. */
  105420. var nativeMax = Math.max;
  105421. /**
  105422. * Gets the index at which the first occurrence of `value` is found in `array`
  105423. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  105424. * for equality comparisons. If `fromIndex` is negative, it's used as the
  105425. * offset from the end of `array`.
  105426. *
  105427. * @static
  105428. * @memberOf _
  105429. * @since 0.1.0
  105430. * @category Array
  105431. * @param {Array} array The array to inspect.
  105432. * @param {*} value The value to search for.
  105433. * @param {number} [fromIndex=0] The index to search from.
  105434. * @returns {number} Returns the index of the matched value, else `-1`.
  105435. * @example
  105436. *
  105437. * _.indexOf([1, 2, 1, 2], 2);
  105438. * // => 1
  105439. *
  105440. * // Search from the `fromIndex`.
  105441. * _.indexOf([1, 2, 1, 2], 2, 2);
  105442. * // => 3
  105443. */
  105444. function indexOf(array, value, fromIndex) {
  105445. var length = array == null ? 0 : array.length;
  105446. if (!length) {
  105447. return -1;
  105448. }
  105449. var index = fromIndex == null ? 0 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(fromIndex);
  105450. if (index < 0) {
  105451. index = nativeMax(length + index, 0);
  105452. }
  105453. return Object(_baseIndexOf_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, value, index);
  105454. }
  105455. /* harmony default export */ __webpack_exports__["default"] = (indexOf);
  105456. /***/ }),
  105457. /***/ "./node_modules/lodash-es/initial.js":
  105458. /*!*******************************************!*\
  105459. !*** ./node_modules/lodash-es/initial.js ***!
  105460. \*******************************************/
  105461. /*! exports provided: default */
  105462. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105463. "use strict";
  105464. __webpack_require__.r(__webpack_exports__);
  105465. /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
  105466. /**
  105467. * Gets all but the last element of `array`.
  105468. *
  105469. * @static
  105470. * @memberOf _
  105471. * @since 0.1.0
  105472. * @category Array
  105473. * @param {Array} array The array to query.
  105474. * @returns {Array} Returns the slice of `array`.
  105475. * @example
  105476. *
  105477. * _.initial([1, 2, 3]);
  105478. * // => [1, 2]
  105479. */
  105480. function initial(array) {
  105481. var length = array == null ? 0 : array.length;
  105482. return length ? Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, 0, -1) : [];
  105483. }
  105484. /* harmony default export */ __webpack_exports__["default"] = (initial);
  105485. /***/ }),
  105486. /***/ "./node_modules/lodash-es/intersection.js":
  105487. /*!************************************************!*\
  105488. !*** ./node_modules/lodash-es/intersection.js ***!
  105489. \************************************************/
  105490. /*! exports provided: default */
  105491. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105492. "use strict";
  105493. __webpack_require__.r(__webpack_exports__);
  105494. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  105495. /* harmony import */ var _baseIntersection_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIntersection.js */ "./node_modules/lodash-es/_baseIntersection.js");
  105496. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  105497. /* harmony import */ var _castArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_castArrayLikeObject.js */ "./node_modules/lodash-es/_castArrayLikeObject.js");
  105498. /**
  105499. * Creates an array of unique values that are included in all given arrays
  105500. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  105501. * for equality comparisons. The order and references of result values are
  105502. * determined by the first array.
  105503. *
  105504. * @static
  105505. * @memberOf _
  105506. * @since 0.1.0
  105507. * @category Array
  105508. * @param {...Array} [arrays] The arrays to inspect.
  105509. * @returns {Array} Returns the new array of intersecting values.
  105510. * @example
  105511. *
  105512. * _.intersection([2, 1], [2, 3]);
  105513. * // => [2]
  105514. */
  105515. var intersection = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(arrays) {
  105516. var mapped = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(arrays, _castArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"]);
  105517. return (mapped.length && mapped[0] === arrays[0])
  105518. ? Object(_baseIntersection_js__WEBPACK_IMPORTED_MODULE_1__["default"])(mapped)
  105519. : [];
  105520. });
  105521. /* harmony default export */ __webpack_exports__["default"] = (intersection);
  105522. /***/ }),
  105523. /***/ "./node_modules/lodash-es/intersectionBy.js":
  105524. /*!**************************************************!*\
  105525. !*** ./node_modules/lodash-es/intersectionBy.js ***!
  105526. \**************************************************/
  105527. /*! exports provided: default */
  105528. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105529. "use strict";
  105530. __webpack_require__.r(__webpack_exports__);
  105531. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  105532. /* harmony import */ var _baseIntersection_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIntersection.js */ "./node_modules/lodash-es/_baseIntersection.js");
  105533. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  105534. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  105535. /* harmony import */ var _castArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_castArrayLikeObject.js */ "./node_modules/lodash-es/_castArrayLikeObject.js");
  105536. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  105537. /**
  105538. * This method is like `_.intersection` except that it accepts `iteratee`
  105539. * which is invoked for each element of each `arrays` to generate the criterion
  105540. * by which they're compared. The order and references of result values are
  105541. * determined by the first array. The iteratee is invoked with one argument:
  105542. * (value).
  105543. *
  105544. * @static
  105545. * @memberOf _
  105546. * @since 4.0.0
  105547. * @category Array
  105548. * @param {...Array} [arrays] The arrays to inspect.
  105549. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  105550. * @returns {Array} Returns the new array of intersecting values.
  105551. * @example
  105552. *
  105553. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  105554. * // => [2.1]
  105555. *
  105556. * // The `_.property` iteratee shorthand.
  105557. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  105558. * // => [{ 'x': 1 }]
  105559. */
  105560. var intersectionBy = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_3__["default"])(function(arrays) {
  105561. var iteratee = Object(_last_js__WEBPACK_IMPORTED_MODULE_5__["default"])(arrays),
  105562. mapped = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(arrays, _castArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__["default"]);
  105563. if (iteratee === Object(_last_js__WEBPACK_IMPORTED_MODULE_5__["default"])(mapped)) {
  105564. iteratee = undefined;
  105565. } else {
  105566. mapped.pop();
  105567. }
  105568. return (mapped.length && mapped[0] === arrays[0])
  105569. ? Object(_baseIntersection_js__WEBPACK_IMPORTED_MODULE_1__["default"])(mapped, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee, 2))
  105570. : [];
  105571. });
  105572. /* harmony default export */ __webpack_exports__["default"] = (intersectionBy);
  105573. /***/ }),
  105574. /***/ "./node_modules/lodash-es/intersectionWith.js":
  105575. /*!****************************************************!*\
  105576. !*** ./node_modules/lodash-es/intersectionWith.js ***!
  105577. \****************************************************/
  105578. /*! exports provided: default */
  105579. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105580. "use strict";
  105581. __webpack_require__.r(__webpack_exports__);
  105582. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  105583. /* harmony import */ var _baseIntersection_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIntersection.js */ "./node_modules/lodash-es/_baseIntersection.js");
  105584. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  105585. /* harmony import */ var _castArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_castArrayLikeObject.js */ "./node_modules/lodash-es/_castArrayLikeObject.js");
  105586. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  105587. /**
  105588. * This method is like `_.intersection` except that it accepts `comparator`
  105589. * which is invoked to compare elements of `arrays`. The order and references
  105590. * of result values are determined by the first array. The comparator is
  105591. * invoked with two arguments: (arrVal, othVal).
  105592. *
  105593. * @static
  105594. * @memberOf _
  105595. * @since 4.0.0
  105596. * @category Array
  105597. * @param {...Array} [arrays] The arrays to inspect.
  105598. * @param {Function} [comparator] The comparator invoked per element.
  105599. * @returns {Array} Returns the new array of intersecting values.
  105600. * @example
  105601. *
  105602. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  105603. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  105604. *
  105605. * _.intersectionWith(objects, others, _.isEqual);
  105606. * // => [{ 'x': 1, 'y': 2 }]
  105607. */
  105608. var intersectionWith = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(arrays) {
  105609. var comparator = Object(_last_js__WEBPACK_IMPORTED_MODULE_4__["default"])(arrays),
  105610. mapped = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(arrays, _castArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"]);
  105611. comparator = typeof comparator == 'function' ? comparator : undefined;
  105612. if (comparator) {
  105613. mapped.pop();
  105614. }
  105615. return (mapped.length && mapped[0] === arrays[0])
  105616. ? Object(_baseIntersection_js__WEBPACK_IMPORTED_MODULE_1__["default"])(mapped, undefined, comparator)
  105617. : [];
  105618. });
  105619. /* harmony default export */ __webpack_exports__["default"] = (intersectionWith);
  105620. /***/ }),
  105621. /***/ "./node_modules/lodash-es/invert.js":
  105622. /*!******************************************!*\
  105623. !*** ./node_modules/lodash-es/invert.js ***!
  105624. \******************************************/
  105625. /*! exports provided: default */
  105626. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105627. "use strict";
  105628. __webpack_require__.r(__webpack_exports__);
  105629. /* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constant.js */ "./node_modules/lodash-es/constant.js");
  105630. /* harmony import */ var _createInverter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createInverter.js */ "./node_modules/lodash-es/_createInverter.js");
  105631. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  105632. /** Used for built-in method references. */
  105633. var objectProto = Object.prototype;
  105634. /**
  105635. * Used to resolve the
  105636. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  105637. * of values.
  105638. */
  105639. var nativeObjectToString = objectProto.toString;
  105640. /**
  105641. * Creates an object composed of the inverted keys and values of `object`.
  105642. * If `object` contains duplicate values, subsequent values overwrite
  105643. * property assignments of previous values.
  105644. *
  105645. * @static
  105646. * @memberOf _
  105647. * @since 0.7.0
  105648. * @category Object
  105649. * @param {Object} object The object to invert.
  105650. * @returns {Object} Returns the new inverted object.
  105651. * @example
  105652. *
  105653. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  105654. *
  105655. * _.invert(object);
  105656. * // => { '1': 'c', '2': 'b' }
  105657. */
  105658. var invert = Object(_createInverter_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(result, value, key) {
  105659. if (value != null &&
  105660. typeof value.toString != 'function') {
  105661. value = nativeObjectToString.call(value);
  105662. }
  105663. result[value] = key;
  105664. }, Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_identity_js__WEBPACK_IMPORTED_MODULE_2__["default"]));
  105665. /* harmony default export */ __webpack_exports__["default"] = (invert);
  105666. /***/ }),
  105667. /***/ "./node_modules/lodash-es/invertBy.js":
  105668. /*!********************************************!*\
  105669. !*** ./node_modules/lodash-es/invertBy.js ***!
  105670. \********************************************/
  105671. /*! exports provided: default */
  105672. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105673. "use strict";
  105674. __webpack_require__.r(__webpack_exports__);
  105675. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  105676. /* harmony import */ var _createInverter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createInverter.js */ "./node_modules/lodash-es/_createInverter.js");
  105677. /** Used for built-in method references. */
  105678. var objectProto = Object.prototype;
  105679. /** Used to check objects for own properties. */
  105680. var hasOwnProperty = objectProto.hasOwnProperty;
  105681. /**
  105682. * Used to resolve the
  105683. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  105684. * of values.
  105685. */
  105686. var nativeObjectToString = objectProto.toString;
  105687. /**
  105688. * This method is like `_.invert` except that the inverted object is generated
  105689. * from the results of running each element of `object` thru `iteratee`. The
  105690. * corresponding inverted value of each inverted key is an array of keys
  105691. * responsible for generating the inverted value. The iteratee is invoked
  105692. * with one argument: (value).
  105693. *
  105694. * @static
  105695. * @memberOf _
  105696. * @since 4.1.0
  105697. * @category Object
  105698. * @param {Object} object The object to invert.
  105699. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  105700. * @returns {Object} Returns the new inverted object.
  105701. * @example
  105702. *
  105703. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  105704. *
  105705. * _.invertBy(object);
  105706. * // => { '1': ['a', 'c'], '2': ['b'] }
  105707. *
  105708. * _.invertBy(object, function(value) {
  105709. * return 'group' + value;
  105710. * });
  105711. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  105712. */
  105713. var invertBy = Object(_createInverter_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(result, value, key) {
  105714. if (value != null &&
  105715. typeof value.toString != 'function') {
  105716. value = nativeObjectToString.call(value);
  105717. }
  105718. if (hasOwnProperty.call(result, value)) {
  105719. result[value].push(key);
  105720. } else {
  105721. result[value] = [key];
  105722. }
  105723. }, _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  105724. /* harmony default export */ __webpack_exports__["default"] = (invertBy);
  105725. /***/ }),
  105726. /***/ "./node_modules/lodash-es/invoke.js":
  105727. /*!******************************************!*\
  105728. !*** ./node_modules/lodash-es/invoke.js ***!
  105729. \******************************************/
  105730. /*! exports provided: default */
  105731. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105732. "use strict";
  105733. __webpack_require__.r(__webpack_exports__);
  105734. /* harmony import */ var _baseInvoke_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseInvoke.js */ "./node_modules/lodash-es/_baseInvoke.js");
  105735. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  105736. /**
  105737. * Invokes the method at `path` of `object`.
  105738. *
  105739. * @static
  105740. * @memberOf _
  105741. * @since 4.0.0
  105742. * @category Object
  105743. * @param {Object} object The object to query.
  105744. * @param {Array|string} path The path of the method to invoke.
  105745. * @param {...*} [args] The arguments to invoke the method with.
  105746. * @returns {*} Returns the result of the invoked method.
  105747. * @example
  105748. *
  105749. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  105750. *
  105751. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  105752. * // => [2, 3]
  105753. */
  105754. var invoke = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_baseInvoke_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  105755. /* harmony default export */ __webpack_exports__["default"] = (invoke);
  105756. /***/ }),
  105757. /***/ "./node_modules/lodash-es/invokeMap.js":
  105758. /*!*********************************************!*\
  105759. !*** ./node_modules/lodash-es/invokeMap.js ***!
  105760. \*********************************************/
  105761. /*! exports provided: default */
  105762. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105763. "use strict";
  105764. __webpack_require__.r(__webpack_exports__);
  105765. /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  105766. /* harmony import */ var _baseEach_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseEach.js */ "./node_modules/lodash-es/_baseEach.js");
  105767. /* harmony import */ var _baseInvoke_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseInvoke.js */ "./node_modules/lodash-es/_baseInvoke.js");
  105768. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  105769. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  105770. /**
  105771. * Invokes the method at `path` of each element in `collection`, returning
  105772. * an array of the results of each invoked method. Any additional arguments
  105773. * are provided to each invoked method. If `path` is a function, it's invoked
  105774. * for, and `this` bound to, each element in `collection`.
  105775. *
  105776. * @static
  105777. * @memberOf _
  105778. * @since 4.0.0
  105779. * @category Collection
  105780. * @param {Array|Object} collection The collection to iterate over.
  105781. * @param {Array|Function|string} path The path of the method to invoke or
  105782. * the function invoked per iteration.
  105783. * @param {...*} [args] The arguments to invoke each method with.
  105784. * @returns {Array} Returns the array of results.
  105785. * @example
  105786. *
  105787. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  105788. * // => [[1, 5, 7], [1, 2, 3]]
  105789. *
  105790. * _.invokeMap([123, 456], String.prototype.split, '');
  105791. * // => [['1', '2', '3'], ['4', '5', '6']]
  105792. */
  105793. var invokeMap = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_3__["default"])(function(collection, path, args) {
  105794. var index = -1,
  105795. isFunc = typeof path == 'function',
  105796. result = Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_4__["default"])(collection) ? Array(collection.length) : [];
  105797. Object(_baseEach_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection, function(value) {
  105798. result[++index] = isFunc ? Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(path, value, args) : Object(_baseInvoke_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value, path, args);
  105799. });
  105800. return result;
  105801. });
  105802. /* harmony default export */ __webpack_exports__["default"] = (invokeMap);
  105803. /***/ }),
  105804. /***/ "./node_modules/lodash-es/isArguments.js":
  105805. /*!***********************************************!*\
  105806. !*** ./node_modules/lodash-es/isArguments.js ***!
  105807. \***********************************************/
  105808. /*! exports provided: default */
  105809. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105810. "use strict";
  105811. __webpack_require__.r(__webpack_exports__);
  105812. /* harmony import */ var _baseIsArguments_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsArguments.js */ "./node_modules/lodash-es/_baseIsArguments.js");
  105813. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  105814. /** Used for built-in method references. */
  105815. var objectProto = Object.prototype;
  105816. /** Used to check objects for own properties. */
  105817. var hasOwnProperty = objectProto.hasOwnProperty;
  105818. /** Built-in value references. */
  105819. var propertyIsEnumerable = objectProto.propertyIsEnumerable;
  105820. /**
  105821. * Checks if `value` is likely an `arguments` object.
  105822. *
  105823. * @static
  105824. * @memberOf _
  105825. * @since 0.1.0
  105826. * @category Lang
  105827. * @param {*} value The value to check.
  105828. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  105829. * else `false`.
  105830. * @example
  105831. *
  105832. * _.isArguments(function() { return arguments; }());
  105833. * // => true
  105834. *
  105835. * _.isArguments([1, 2, 3]);
  105836. * // => false
  105837. */
  105838. var isArguments = Object(_baseIsArguments_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function() { return arguments; }()) ? _baseIsArguments_js__WEBPACK_IMPORTED_MODULE_0__["default"] : function(value) {
  105839. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && hasOwnProperty.call(value, 'callee') &&
  105840. !propertyIsEnumerable.call(value, 'callee');
  105841. };
  105842. /* harmony default export */ __webpack_exports__["default"] = (isArguments);
  105843. /***/ }),
  105844. /***/ "./node_modules/lodash-es/isArray.js":
  105845. /*!*******************************************!*\
  105846. !*** ./node_modules/lodash-es/isArray.js ***!
  105847. \*******************************************/
  105848. /*! exports provided: default */
  105849. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105850. "use strict";
  105851. __webpack_require__.r(__webpack_exports__);
  105852. /**
  105853. * Checks if `value` is classified as an `Array` object.
  105854. *
  105855. * @static
  105856. * @memberOf _
  105857. * @since 0.1.0
  105858. * @category Lang
  105859. * @param {*} value The value to check.
  105860. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  105861. * @example
  105862. *
  105863. * _.isArray([1, 2, 3]);
  105864. * // => true
  105865. *
  105866. * _.isArray(document.body.children);
  105867. * // => false
  105868. *
  105869. * _.isArray('abc');
  105870. * // => false
  105871. *
  105872. * _.isArray(_.noop);
  105873. * // => false
  105874. */
  105875. var isArray = Array.isArray;
  105876. /* harmony default export */ __webpack_exports__["default"] = (isArray);
  105877. /***/ }),
  105878. /***/ "./node_modules/lodash-es/isArrayBuffer.js":
  105879. /*!*************************************************!*\
  105880. !*** ./node_modules/lodash-es/isArrayBuffer.js ***!
  105881. \*************************************************/
  105882. /*! exports provided: default */
  105883. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105884. "use strict";
  105885. __webpack_require__.r(__webpack_exports__);
  105886. /* harmony import */ var _baseIsArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsArrayBuffer.js */ "./node_modules/lodash-es/_baseIsArrayBuffer.js");
  105887. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  105888. /* harmony import */ var _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_nodeUtil.js */ "./node_modules/lodash-es/_nodeUtil.js");
  105889. /* Node.js helper references. */
  105890. var nodeIsArrayBuffer = _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"] && _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"].isArrayBuffer;
  105891. /**
  105892. * Checks if `value` is classified as an `ArrayBuffer` object.
  105893. *
  105894. * @static
  105895. * @memberOf _
  105896. * @since 4.3.0
  105897. * @category Lang
  105898. * @param {*} value The value to check.
  105899. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  105900. * @example
  105901. *
  105902. * _.isArrayBuffer(new ArrayBuffer(2));
  105903. * // => true
  105904. *
  105905. * _.isArrayBuffer(new Array(2));
  105906. * // => false
  105907. */
  105908. var isArrayBuffer = nodeIsArrayBuffer ? Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_1__["default"])(nodeIsArrayBuffer) : _baseIsArrayBuffer_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  105909. /* harmony default export */ __webpack_exports__["default"] = (isArrayBuffer);
  105910. /***/ }),
  105911. /***/ "./node_modules/lodash-es/isArrayLike.js":
  105912. /*!***********************************************!*\
  105913. !*** ./node_modules/lodash-es/isArrayLike.js ***!
  105914. \***********************************************/
  105915. /*! exports provided: default */
  105916. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105917. "use strict";
  105918. __webpack_require__.r(__webpack_exports__);
  105919. /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
  105920. /* harmony import */ var _isLength_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isLength.js */ "./node_modules/lodash-es/isLength.js");
  105921. /**
  105922. * Checks if `value` is array-like. A value is considered array-like if it's
  105923. * not a function and has a `value.length` that's an integer greater than or
  105924. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  105925. *
  105926. * @static
  105927. * @memberOf _
  105928. * @since 4.0.0
  105929. * @category Lang
  105930. * @param {*} value The value to check.
  105931. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  105932. * @example
  105933. *
  105934. * _.isArrayLike([1, 2, 3]);
  105935. * // => true
  105936. *
  105937. * _.isArrayLike(document.body.children);
  105938. * // => true
  105939. *
  105940. * _.isArrayLike('abc');
  105941. * // => true
  105942. *
  105943. * _.isArrayLike(_.noop);
  105944. * // => false
  105945. */
  105946. function isArrayLike(value) {
  105947. return value != null && Object(_isLength_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value.length) && !Object(_isFunction_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  105948. }
  105949. /* harmony default export */ __webpack_exports__["default"] = (isArrayLike);
  105950. /***/ }),
  105951. /***/ "./node_modules/lodash-es/isArrayLikeObject.js":
  105952. /*!*****************************************************!*\
  105953. !*** ./node_modules/lodash-es/isArrayLikeObject.js ***!
  105954. \*****************************************************/
  105955. /*! exports provided: default */
  105956. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105957. "use strict";
  105958. __webpack_require__.r(__webpack_exports__);
  105959. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  105960. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  105961. /**
  105962. * This method is like `_.isArrayLike` except that it also checks if `value`
  105963. * is an object.
  105964. *
  105965. * @static
  105966. * @memberOf _
  105967. * @since 4.0.0
  105968. * @category Lang
  105969. * @param {*} value The value to check.
  105970. * @returns {boolean} Returns `true` if `value` is an array-like object,
  105971. * else `false`.
  105972. * @example
  105973. *
  105974. * _.isArrayLikeObject([1, 2, 3]);
  105975. * // => true
  105976. *
  105977. * _.isArrayLikeObject(document.body.children);
  105978. * // => true
  105979. *
  105980. * _.isArrayLikeObject('abc');
  105981. * // => false
  105982. *
  105983. * _.isArrayLikeObject(_.noop);
  105984. * // => false
  105985. */
  105986. function isArrayLikeObject(value) {
  105987. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  105988. }
  105989. /* harmony default export */ __webpack_exports__["default"] = (isArrayLikeObject);
  105990. /***/ }),
  105991. /***/ "./node_modules/lodash-es/isBoolean.js":
  105992. /*!*********************************************!*\
  105993. !*** ./node_modules/lodash-es/isBoolean.js ***!
  105994. \*********************************************/
  105995. /*! exports provided: default */
  105996. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105997. "use strict";
  105998. __webpack_require__.r(__webpack_exports__);
  105999. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  106000. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  106001. /** `Object#toString` result references. */
  106002. var boolTag = '[object Boolean]';
  106003. /**
  106004. * Checks if `value` is classified as a boolean primitive or object.
  106005. *
  106006. * @static
  106007. * @memberOf _
  106008. * @since 0.1.0
  106009. * @category Lang
  106010. * @param {*} value The value to check.
  106011. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  106012. * @example
  106013. *
  106014. * _.isBoolean(false);
  106015. * // => true
  106016. *
  106017. * _.isBoolean(null);
  106018. * // => false
  106019. */
  106020. function isBoolean(value) {
  106021. return value === true || value === false ||
  106022. (Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == boolTag);
  106023. }
  106024. /* harmony default export */ __webpack_exports__["default"] = (isBoolean);
  106025. /***/ }),
  106026. /***/ "./node_modules/lodash-es/isBuffer.js":
  106027. /*!********************************************!*\
  106028. !*** ./node_modules/lodash-es/isBuffer.js ***!
  106029. \********************************************/
  106030. /*! exports provided: default */
  106031. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106032. "use strict";
  106033. __webpack_require__.r(__webpack_exports__);
  106034. /* WEBPACK VAR INJECTION */(function(module) {/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  106035. /* harmony import */ var _stubFalse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./stubFalse.js */ "./node_modules/lodash-es/stubFalse.js");
  106036. /** Detect free variable `exports`. */
  106037. var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
  106038. /** Detect free variable `module`. */
  106039. var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
  106040. /** Detect the popular CommonJS extension `module.exports`. */
  106041. var moduleExports = freeModule && freeModule.exports === freeExports;
  106042. /** Built-in value references. */
  106043. var Buffer = moduleExports ? _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].Buffer : undefined;
  106044. /* Built-in method references for those with the same name as other `lodash` methods. */
  106045. var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
  106046. /**
  106047. * Checks if `value` is a buffer.
  106048. *
  106049. * @static
  106050. * @memberOf _
  106051. * @since 4.3.0
  106052. * @category Lang
  106053. * @param {*} value The value to check.
  106054. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  106055. * @example
  106056. *
  106057. * _.isBuffer(new Buffer(2));
  106058. * // => true
  106059. *
  106060. * _.isBuffer(new Uint8Array(2));
  106061. * // => false
  106062. */
  106063. var isBuffer = nativeIsBuffer || _stubFalse_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  106064. /* harmony default export */ __webpack_exports__["default"] = (isBuffer);
  106065. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/harmony-module.js */ "./node_modules/webpack/buildin/harmony-module.js")(module)))
  106066. /***/ }),
  106067. /***/ "./node_modules/lodash-es/isDate.js":
  106068. /*!******************************************!*\
  106069. !*** ./node_modules/lodash-es/isDate.js ***!
  106070. \******************************************/
  106071. /*! exports provided: default */
  106072. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106073. "use strict";
  106074. __webpack_require__.r(__webpack_exports__);
  106075. /* harmony import */ var _baseIsDate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsDate.js */ "./node_modules/lodash-es/_baseIsDate.js");
  106076. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  106077. /* harmony import */ var _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_nodeUtil.js */ "./node_modules/lodash-es/_nodeUtil.js");
  106078. /* Node.js helper references. */
  106079. var nodeIsDate = _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"] && _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"].isDate;
  106080. /**
  106081. * Checks if `value` is classified as a `Date` object.
  106082. *
  106083. * @static
  106084. * @memberOf _
  106085. * @since 0.1.0
  106086. * @category Lang
  106087. * @param {*} value The value to check.
  106088. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  106089. * @example
  106090. *
  106091. * _.isDate(new Date);
  106092. * // => true
  106093. *
  106094. * _.isDate('Mon April 23 2012');
  106095. * // => false
  106096. */
  106097. var isDate = nodeIsDate ? Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_1__["default"])(nodeIsDate) : _baseIsDate_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  106098. /* harmony default export */ __webpack_exports__["default"] = (isDate);
  106099. /***/ }),
  106100. /***/ "./node_modules/lodash-es/isElement.js":
  106101. /*!*********************************************!*\
  106102. !*** ./node_modules/lodash-es/isElement.js ***!
  106103. \*********************************************/
  106104. /*! exports provided: default */
  106105. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106106. "use strict";
  106107. __webpack_require__.r(__webpack_exports__);
  106108. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  106109. /* harmony import */ var _isPlainObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isPlainObject.js */ "./node_modules/lodash-es/isPlainObject.js");
  106110. /**
  106111. * Checks if `value` is likely a DOM element.
  106112. *
  106113. * @static
  106114. * @memberOf _
  106115. * @since 0.1.0
  106116. * @category Lang
  106117. * @param {*} value The value to check.
  106118. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  106119. * @example
  106120. *
  106121. * _.isElement(document.body);
  106122. * // => true
  106123. *
  106124. * _.isElement('<body>');
  106125. * // => false
  106126. */
  106127. function isElement(value) {
  106128. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) && value.nodeType === 1 && !Object(_isPlainObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value);
  106129. }
  106130. /* harmony default export */ __webpack_exports__["default"] = (isElement);
  106131. /***/ }),
  106132. /***/ "./node_modules/lodash-es/isEmpty.js":
  106133. /*!*******************************************!*\
  106134. !*** ./node_modules/lodash-es/isEmpty.js ***!
  106135. \*******************************************/
  106136. /*! exports provided: default */
  106137. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106138. "use strict";
  106139. __webpack_require__.r(__webpack_exports__);
  106140. /* harmony import */ var _baseKeys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseKeys.js */ "./node_modules/lodash-es/_baseKeys.js");
  106141. /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
  106142. /* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
  106143. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  106144. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  106145. /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
  106146. /* harmony import */ var _isPrototype_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_isPrototype.js */ "./node_modules/lodash-es/_isPrototype.js");
  106147. /* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/lodash-es/isTypedArray.js");
  106148. /** `Object#toString` result references. */
  106149. var mapTag = '[object Map]',
  106150. setTag = '[object Set]';
  106151. /** Used for built-in method references. */
  106152. var objectProto = Object.prototype;
  106153. /** Used to check objects for own properties. */
  106154. var hasOwnProperty = objectProto.hasOwnProperty;
  106155. /**
  106156. * Checks if `value` is an empty object, collection, map, or set.
  106157. *
  106158. * Objects are considered empty if they have no own enumerable string keyed
  106159. * properties.
  106160. *
  106161. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  106162. * jQuery-like collections are considered empty if they have a `length` of `0`.
  106163. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  106164. *
  106165. * @static
  106166. * @memberOf _
  106167. * @since 0.1.0
  106168. * @category Lang
  106169. * @param {*} value The value to check.
  106170. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  106171. * @example
  106172. *
  106173. * _.isEmpty(null);
  106174. * // => true
  106175. *
  106176. * _.isEmpty(true);
  106177. * // => true
  106178. *
  106179. * _.isEmpty(1);
  106180. * // => true
  106181. *
  106182. * _.isEmpty([1, 2, 3]);
  106183. * // => false
  106184. *
  106185. * _.isEmpty({ 'a': 1 });
  106186. * // => false
  106187. */
  106188. function isEmpty(value) {
  106189. if (value == null) {
  106190. return true;
  106191. }
  106192. if (Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_4__["default"])(value) &&
  106193. (Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  106194. Object(_isBuffer_js__WEBPACK_IMPORTED_MODULE_5__["default"])(value) || Object(_isTypedArray_js__WEBPACK_IMPORTED_MODULE_7__["default"])(value) || Object(_isArguments_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value))) {
  106195. return !value.length;
  106196. }
  106197. var tag = Object(_getTag_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value);
  106198. if (tag == mapTag || tag == setTag) {
  106199. return !value.size;
  106200. }
  106201. if (Object(_isPrototype_js__WEBPACK_IMPORTED_MODULE_6__["default"])(value)) {
  106202. return !Object(_baseKeys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value).length;
  106203. }
  106204. for (var key in value) {
  106205. if (hasOwnProperty.call(value, key)) {
  106206. return false;
  106207. }
  106208. }
  106209. return true;
  106210. }
  106211. /* harmony default export */ __webpack_exports__["default"] = (isEmpty);
  106212. /***/ }),
  106213. /***/ "./node_modules/lodash-es/isEqual.js":
  106214. /*!*******************************************!*\
  106215. !*** ./node_modules/lodash-es/isEqual.js ***!
  106216. \*******************************************/
  106217. /*! exports provided: default */
  106218. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106219. "use strict";
  106220. __webpack_require__.r(__webpack_exports__);
  106221. /* harmony import */ var _baseIsEqual_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsEqual.js */ "./node_modules/lodash-es/_baseIsEqual.js");
  106222. /**
  106223. * Performs a deep comparison between two values to determine if they are
  106224. * equivalent.
  106225. *
  106226. * **Note:** This method supports comparing arrays, array buffers, booleans,
  106227. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  106228. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  106229. * by their own, not inherited, enumerable properties. Functions and DOM
  106230. * nodes are compared by strict equality, i.e. `===`.
  106231. *
  106232. * @static
  106233. * @memberOf _
  106234. * @since 0.1.0
  106235. * @category Lang
  106236. * @param {*} value The value to compare.
  106237. * @param {*} other The other value to compare.
  106238. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  106239. * @example
  106240. *
  106241. * var object = { 'a': 1 };
  106242. * var other = { 'a': 1 };
  106243. *
  106244. * _.isEqual(object, other);
  106245. * // => true
  106246. *
  106247. * object === other;
  106248. * // => false
  106249. */
  106250. function isEqual(value, other) {
  106251. return Object(_baseIsEqual_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, other);
  106252. }
  106253. /* harmony default export */ __webpack_exports__["default"] = (isEqual);
  106254. /***/ }),
  106255. /***/ "./node_modules/lodash-es/isEqualWith.js":
  106256. /*!***********************************************!*\
  106257. !*** ./node_modules/lodash-es/isEqualWith.js ***!
  106258. \***********************************************/
  106259. /*! exports provided: default */
  106260. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106261. "use strict";
  106262. __webpack_require__.r(__webpack_exports__);
  106263. /* harmony import */ var _baseIsEqual_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsEqual.js */ "./node_modules/lodash-es/_baseIsEqual.js");
  106264. /**
  106265. * This method is like `_.isEqual` except that it accepts `customizer` which
  106266. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  106267. * are handled by the method instead. The `customizer` is invoked with up to
  106268. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  106269. *
  106270. * @static
  106271. * @memberOf _
  106272. * @since 4.0.0
  106273. * @category Lang
  106274. * @param {*} value The value to compare.
  106275. * @param {*} other The other value to compare.
  106276. * @param {Function} [customizer] The function to customize comparisons.
  106277. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  106278. * @example
  106279. *
  106280. * function isGreeting(value) {
  106281. * return /^h(?:i|ello)$/.test(value);
  106282. * }
  106283. *
  106284. * function customizer(objValue, othValue) {
  106285. * if (isGreeting(objValue) && isGreeting(othValue)) {
  106286. * return true;
  106287. * }
  106288. * }
  106289. *
  106290. * var array = ['hello', 'goodbye'];
  106291. * var other = ['hi', 'goodbye'];
  106292. *
  106293. * _.isEqualWith(array, other, customizer);
  106294. * // => true
  106295. */
  106296. function isEqualWith(value, other, customizer) {
  106297. customizer = typeof customizer == 'function' ? customizer : undefined;
  106298. var result = customizer ? customizer(value, other) : undefined;
  106299. return result === undefined ? Object(_baseIsEqual_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, other, undefined, customizer) : !!result;
  106300. }
  106301. /* harmony default export */ __webpack_exports__["default"] = (isEqualWith);
  106302. /***/ }),
  106303. /***/ "./node_modules/lodash-es/isError.js":
  106304. /*!*******************************************!*\
  106305. !*** ./node_modules/lodash-es/isError.js ***!
  106306. \*******************************************/
  106307. /*! exports provided: default */
  106308. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106309. "use strict";
  106310. __webpack_require__.r(__webpack_exports__);
  106311. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  106312. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  106313. /* harmony import */ var _isPlainObject_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isPlainObject.js */ "./node_modules/lodash-es/isPlainObject.js");
  106314. /** `Object#toString` result references. */
  106315. var domExcTag = '[object DOMException]',
  106316. errorTag = '[object Error]';
  106317. /**
  106318. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  106319. * `SyntaxError`, `TypeError`, or `URIError` object.
  106320. *
  106321. * @static
  106322. * @memberOf _
  106323. * @since 3.0.0
  106324. * @category Lang
  106325. * @param {*} value The value to check.
  106326. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  106327. * @example
  106328. *
  106329. * _.isError(new Error);
  106330. * // => true
  106331. *
  106332. * _.isError(Error);
  106333. * // => false
  106334. */
  106335. function isError(value) {
  106336. if (!Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
  106337. return false;
  106338. }
  106339. var tag = Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  106340. return tag == errorTag || tag == domExcTag ||
  106341. (typeof value.message == 'string' && typeof value.name == 'string' && !Object(_isPlainObject_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value));
  106342. }
  106343. /* harmony default export */ __webpack_exports__["default"] = (isError);
  106344. /***/ }),
  106345. /***/ "./node_modules/lodash-es/isFinite.js":
  106346. /*!********************************************!*\
  106347. !*** ./node_modules/lodash-es/isFinite.js ***!
  106348. \********************************************/
  106349. /*! exports provided: default */
  106350. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106351. "use strict";
  106352. __webpack_require__.r(__webpack_exports__);
  106353. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  106354. /* Built-in method references for those with the same name as other `lodash` methods. */
  106355. var nativeIsFinite = _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFinite;
  106356. /**
  106357. * Checks if `value` is a finite primitive number.
  106358. *
  106359. * **Note:** This method is based on
  106360. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  106361. *
  106362. * @static
  106363. * @memberOf _
  106364. * @since 0.1.0
  106365. * @category Lang
  106366. * @param {*} value The value to check.
  106367. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  106368. * @example
  106369. *
  106370. * _.isFinite(3);
  106371. * // => true
  106372. *
  106373. * _.isFinite(Number.MIN_VALUE);
  106374. * // => true
  106375. *
  106376. * _.isFinite(Infinity);
  106377. * // => false
  106378. *
  106379. * _.isFinite('3');
  106380. * // => false
  106381. */
  106382. function isFinite(value) {
  106383. return typeof value == 'number' && nativeIsFinite(value);
  106384. }
  106385. /* harmony default export */ __webpack_exports__["default"] = (isFinite);
  106386. /***/ }),
  106387. /***/ "./node_modules/lodash-es/isFunction.js":
  106388. /*!**********************************************!*\
  106389. !*** ./node_modules/lodash-es/isFunction.js ***!
  106390. \**********************************************/
  106391. /*! exports provided: default */
  106392. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106393. "use strict";
  106394. __webpack_require__.r(__webpack_exports__);
  106395. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  106396. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  106397. /** `Object#toString` result references. */
  106398. var asyncTag = '[object AsyncFunction]',
  106399. funcTag = '[object Function]',
  106400. genTag = '[object GeneratorFunction]',
  106401. proxyTag = '[object Proxy]';
  106402. /**
  106403. * Checks if `value` is classified as a `Function` object.
  106404. *
  106405. * @static
  106406. * @memberOf _
  106407. * @since 0.1.0
  106408. * @category Lang
  106409. * @param {*} value The value to check.
  106410. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  106411. * @example
  106412. *
  106413. * _.isFunction(_);
  106414. * // => true
  106415. *
  106416. * _.isFunction(/abc/);
  106417. * // => false
  106418. */
  106419. function isFunction(value) {
  106420. if (!Object(_isObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
  106421. return false;
  106422. }
  106423. // The use of `Object#toString` avoids issues with the `typeof` operator
  106424. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  106425. var tag = Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  106426. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  106427. }
  106428. /* harmony default export */ __webpack_exports__["default"] = (isFunction);
  106429. /***/ }),
  106430. /***/ "./node_modules/lodash-es/isInteger.js":
  106431. /*!*********************************************!*\
  106432. !*** ./node_modules/lodash-es/isInteger.js ***!
  106433. \*********************************************/
  106434. /*! exports provided: default */
  106435. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106436. "use strict";
  106437. __webpack_require__.r(__webpack_exports__);
  106438. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  106439. /**
  106440. * Checks if `value` is an integer.
  106441. *
  106442. * **Note:** This method is based on
  106443. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  106444. *
  106445. * @static
  106446. * @memberOf _
  106447. * @since 4.0.0
  106448. * @category Lang
  106449. * @param {*} value The value to check.
  106450. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  106451. * @example
  106452. *
  106453. * _.isInteger(3);
  106454. * // => true
  106455. *
  106456. * _.isInteger(Number.MIN_VALUE);
  106457. * // => false
  106458. *
  106459. * _.isInteger(Infinity);
  106460. * // => false
  106461. *
  106462. * _.isInteger('3');
  106463. * // => false
  106464. */
  106465. function isInteger(value) {
  106466. return typeof value == 'number' && value == Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  106467. }
  106468. /* harmony default export */ __webpack_exports__["default"] = (isInteger);
  106469. /***/ }),
  106470. /***/ "./node_modules/lodash-es/isLength.js":
  106471. /*!********************************************!*\
  106472. !*** ./node_modules/lodash-es/isLength.js ***!
  106473. \********************************************/
  106474. /*! exports provided: default */
  106475. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106476. "use strict";
  106477. __webpack_require__.r(__webpack_exports__);
  106478. /** Used as references for various `Number` constants. */
  106479. var MAX_SAFE_INTEGER = 9007199254740991;
  106480. /**
  106481. * Checks if `value` is a valid array-like length.
  106482. *
  106483. * **Note:** This method is loosely based on
  106484. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  106485. *
  106486. * @static
  106487. * @memberOf _
  106488. * @since 4.0.0
  106489. * @category Lang
  106490. * @param {*} value The value to check.
  106491. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  106492. * @example
  106493. *
  106494. * _.isLength(3);
  106495. * // => true
  106496. *
  106497. * _.isLength(Number.MIN_VALUE);
  106498. * // => false
  106499. *
  106500. * _.isLength(Infinity);
  106501. * // => false
  106502. *
  106503. * _.isLength('3');
  106504. * // => false
  106505. */
  106506. function isLength(value) {
  106507. return typeof value == 'number' &&
  106508. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  106509. }
  106510. /* harmony default export */ __webpack_exports__["default"] = (isLength);
  106511. /***/ }),
  106512. /***/ "./node_modules/lodash-es/isMap.js":
  106513. /*!*****************************************!*\
  106514. !*** ./node_modules/lodash-es/isMap.js ***!
  106515. \*****************************************/
  106516. /*! exports provided: default */
  106517. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106518. "use strict";
  106519. __webpack_require__.r(__webpack_exports__);
  106520. /* harmony import */ var _baseIsMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsMap.js */ "./node_modules/lodash-es/_baseIsMap.js");
  106521. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  106522. /* harmony import */ var _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_nodeUtil.js */ "./node_modules/lodash-es/_nodeUtil.js");
  106523. /* Node.js helper references. */
  106524. var nodeIsMap = _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"] && _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"].isMap;
  106525. /**
  106526. * Checks if `value` is classified as a `Map` object.
  106527. *
  106528. * @static
  106529. * @memberOf _
  106530. * @since 4.3.0
  106531. * @category Lang
  106532. * @param {*} value The value to check.
  106533. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  106534. * @example
  106535. *
  106536. * _.isMap(new Map);
  106537. * // => true
  106538. *
  106539. * _.isMap(new WeakMap);
  106540. * // => false
  106541. */
  106542. var isMap = nodeIsMap ? Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_1__["default"])(nodeIsMap) : _baseIsMap_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  106543. /* harmony default export */ __webpack_exports__["default"] = (isMap);
  106544. /***/ }),
  106545. /***/ "./node_modules/lodash-es/isMatch.js":
  106546. /*!*******************************************!*\
  106547. !*** ./node_modules/lodash-es/isMatch.js ***!
  106548. \*******************************************/
  106549. /*! exports provided: default */
  106550. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106551. "use strict";
  106552. __webpack_require__.r(__webpack_exports__);
  106553. /* harmony import */ var _baseIsMatch_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsMatch.js */ "./node_modules/lodash-es/_baseIsMatch.js");
  106554. /* harmony import */ var _getMatchData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getMatchData.js */ "./node_modules/lodash-es/_getMatchData.js");
  106555. /**
  106556. * Performs a partial deep comparison between `object` and `source` to
  106557. * determine if `object` contains equivalent property values.
  106558. *
  106559. * **Note:** This method is equivalent to `_.matches` when `source` is
  106560. * partially applied.
  106561. *
  106562. * Partial comparisons will match empty array and empty object `source`
  106563. * values against any array or object value, respectively. See `_.isEqual`
  106564. * for a list of supported value comparisons.
  106565. *
  106566. * @static
  106567. * @memberOf _
  106568. * @since 3.0.0
  106569. * @category Lang
  106570. * @param {Object} object The object to inspect.
  106571. * @param {Object} source The object of property values to match.
  106572. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  106573. * @example
  106574. *
  106575. * var object = { 'a': 1, 'b': 2 };
  106576. *
  106577. * _.isMatch(object, { 'b': 2 });
  106578. * // => true
  106579. *
  106580. * _.isMatch(object, { 'b': 1 });
  106581. * // => false
  106582. */
  106583. function isMatch(object, source) {
  106584. return object === source || Object(_baseIsMatch_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, source, Object(_getMatchData_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source));
  106585. }
  106586. /* harmony default export */ __webpack_exports__["default"] = (isMatch);
  106587. /***/ }),
  106588. /***/ "./node_modules/lodash-es/isMatchWith.js":
  106589. /*!***********************************************!*\
  106590. !*** ./node_modules/lodash-es/isMatchWith.js ***!
  106591. \***********************************************/
  106592. /*! exports provided: default */
  106593. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106594. "use strict";
  106595. __webpack_require__.r(__webpack_exports__);
  106596. /* harmony import */ var _baseIsMatch_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsMatch.js */ "./node_modules/lodash-es/_baseIsMatch.js");
  106597. /* harmony import */ var _getMatchData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getMatchData.js */ "./node_modules/lodash-es/_getMatchData.js");
  106598. /**
  106599. * This method is like `_.isMatch` except that it accepts `customizer` which
  106600. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  106601. * are handled by the method instead. The `customizer` is invoked with five
  106602. * arguments: (objValue, srcValue, index|key, object, source).
  106603. *
  106604. * @static
  106605. * @memberOf _
  106606. * @since 4.0.0
  106607. * @category Lang
  106608. * @param {Object} object The object to inspect.
  106609. * @param {Object} source The object of property values to match.
  106610. * @param {Function} [customizer] The function to customize comparisons.
  106611. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  106612. * @example
  106613. *
  106614. * function isGreeting(value) {
  106615. * return /^h(?:i|ello)$/.test(value);
  106616. * }
  106617. *
  106618. * function customizer(objValue, srcValue) {
  106619. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  106620. * return true;
  106621. * }
  106622. * }
  106623. *
  106624. * var object = { 'greeting': 'hello' };
  106625. * var source = { 'greeting': 'hi' };
  106626. *
  106627. * _.isMatchWith(object, source, customizer);
  106628. * // => true
  106629. */
  106630. function isMatchWith(object, source, customizer) {
  106631. customizer = typeof customizer == 'function' ? customizer : undefined;
  106632. return Object(_baseIsMatch_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, source, Object(_getMatchData_js__WEBPACK_IMPORTED_MODULE_1__["default"])(source), customizer);
  106633. }
  106634. /* harmony default export */ __webpack_exports__["default"] = (isMatchWith);
  106635. /***/ }),
  106636. /***/ "./node_modules/lodash-es/isNaN.js":
  106637. /*!*****************************************!*\
  106638. !*** ./node_modules/lodash-es/isNaN.js ***!
  106639. \*****************************************/
  106640. /*! exports provided: default */
  106641. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106642. "use strict";
  106643. __webpack_require__.r(__webpack_exports__);
  106644. /* harmony import */ var _isNumber_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isNumber.js */ "./node_modules/lodash-es/isNumber.js");
  106645. /**
  106646. * Checks if `value` is `NaN`.
  106647. *
  106648. * **Note:** This method is based on
  106649. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  106650. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  106651. * `undefined` and other non-number values.
  106652. *
  106653. * @static
  106654. * @memberOf _
  106655. * @since 0.1.0
  106656. * @category Lang
  106657. * @param {*} value The value to check.
  106658. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  106659. * @example
  106660. *
  106661. * _.isNaN(NaN);
  106662. * // => true
  106663. *
  106664. * _.isNaN(new Number(NaN));
  106665. * // => true
  106666. *
  106667. * isNaN(undefined);
  106668. * // => true
  106669. *
  106670. * _.isNaN(undefined);
  106671. * // => false
  106672. */
  106673. function isNaN(value) {
  106674. // An `NaN` primitive is the only value that is not equal to itself.
  106675. // Perform the `toStringTag` check first to avoid errors with some
  106676. // ActiveX objects in IE.
  106677. return Object(_isNumber_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) && value != +value;
  106678. }
  106679. /* harmony default export */ __webpack_exports__["default"] = (isNaN);
  106680. /***/ }),
  106681. /***/ "./node_modules/lodash-es/isNative.js":
  106682. /*!********************************************!*\
  106683. !*** ./node_modules/lodash-es/isNative.js ***!
  106684. \********************************************/
  106685. /*! exports provided: default */
  106686. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106687. "use strict";
  106688. __webpack_require__.r(__webpack_exports__);
  106689. /* harmony import */ var _baseIsNative_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsNative.js */ "./node_modules/lodash-es/_baseIsNative.js");
  106690. /* harmony import */ var _isMaskable_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isMaskable.js */ "./node_modules/lodash-es/_isMaskable.js");
  106691. /** Error message constants. */
  106692. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.';
  106693. /**
  106694. * Checks if `value` is a pristine native function.
  106695. *
  106696. * **Note:** This method can't reliably detect native functions in the presence
  106697. * of the core-js package because core-js circumvents this kind of detection.
  106698. * Despite multiple requests, the core-js maintainer has made it clear: any
  106699. * attempt to fix the detection will be obstructed. As a result, we're left
  106700. * with little choice but to throw an error. Unfortunately, this also affects
  106701. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  106702. * which rely on core-js.
  106703. *
  106704. * @static
  106705. * @memberOf _
  106706. * @since 3.0.0
  106707. * @category Lang
  106708. * @param {*} value The value to check.
  106709. * @returns {boolean} Returns `true` if `value` is a native function,
  106710. * else `false`.
  106711. * @example
  106712. *
  106713. * _.isNative(Array.prototype.push);
  106714. * // => true
  106715. *
  106716. * _.isNative(_);
  106717. * // => false
  106718. */
  106719. function isNative(value) {
  106720. if (Object(_isMaskable_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
  106721. throw new Error(CORE_ERROR_TEXT);
  106722. }
  106723. return Object(_baseIsNative_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  106724. }
  106725. /* harmony default export */ __webpack_exports__["default"] = (isNative);
  106726. /***/ }),
  106727. /***/ "./node_modules/lodash-es/isNil.js":
  106728. /*!*****************************************!*\
  106729. !*** ./node_modules/lodash-es/isNil.js ***!
  106730. \*****************************************/
  106731. /*! exports provided: default */
  106732. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106733. "use strict";
  106734. __webpack_require__.r(__webpack_exports__);
  106735. /**
  106736. * Checks if `value` is `null` or `undefined`.
  106737. *
  106738. * @static
  106739. * @memberOf _
  106740. * @since 4.0.0
  106741. * @category Lang
  106742. * @param {*} value The value to check.
  106743. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  106744. * @example
  106745. *
  106746. * _.isNil(null);
  106747. * // => true
  106748. *
  106749. * _.isNil(void 0);
  106750. * // => true
  106751. *
  106752. * _.isNil(NaN);
  106753. * // => false
  106754. */
  106755. function isNil(value) {
  106756. return value == null;
  106757. }
  106758. /* harmony default export */ __webpack_exports__["default"] = (isNil);
  106759. /***/ }),
  106760. /***/ "./node_modules/lodash-es/isNull.js":
  106761. /*!******************************************!*\
  106762. !*** ./node_modules/lodash-es/isNull.js ***!
  106763. \******************************************/
  106764. /*! exports provided: default */
  106765. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106766. "use strict";
  106767. __webpack_require__.r(__webpack_exports__);
  106768. /**
  106769. * Checks if `value` is `null`.
  106770. *
  106771. * @static
  106772. * @memberOf _
  106773. * @since 0.1.0
  106774. * @category Lang
  106775. * @param {*} value The value to check.
  106776. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  106777. * @example
  106778. *
  106779. * _.isNull(null);
  106780. * // => true
  106781. *
  106782. * _.isNull(void 0);
  106783. * // => false
  106784. */
  106785. function isNull(value) {
  106786. return value === null;
  106787. }
  106788. /* harmony default export */ __webpack_exports__["default"] = (isNull);
  106789. /***/ }),
  106790. /***/ "./node_modules/lodash-es/isNumber.js":
  106791. /*!********************************************!*\
  106792. !*** ./node_modules/lodash-es/isNumber.js ***!
  106793. \********************************************/
  106794. /*! exports provided: default */
  106795. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106796. "use strict";
  106797. __webpack_require__.r(__webpack_exports__);
  106798. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  106799. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  106800. /** `Object#toString` result references. */
  106801. var numberTag = '[object Number]';
  106802. /**
  106803. * Checks if `value` is classified as a `Number` primitive or object.
  106804. *
  106805. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  106806. * classified as numbers, use the `_.isFinite` method.
  106807. *
  106808. * @static
  106809. * @memberOf _
  106810. * @since 0.1.0
  106811. * @category Lang
  106812. * @param {*} value The value to check.
  106813. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  106814. * @example
  106815. *
  106816. * _.isNumber(3);
  106817. * // => true
  106818. *
  106819. * _.isNumber(Number.MIN_VALUE);
  106820. * // => true
  106821. *
  106822. * _.isNumber(Infinity);
  106823. * // => true
  106824. *
  106825. * _.isNumber('3');
  106826. * // => false
  106827. */
  106828. function isNumber(value) {
  106829. return typeof value == 'number' ||
  106830. (Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == numberTag);
  106831. }
  106832. /* harmony default export */ __webpack_exports__["default"] = (isNumber);
  106833. /***/ }),
  106834. /***/ "./node_modules/lodash-es/isObject.js":
  106835. /*!********************************************!*\
  106836. !*** ./node_modules/lodash-es/isObject.js ***!
  106837. \********************************************/
  106838. /*! exports provided: default */
  106839. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106840. "use strict";
  106841. __webpack_require__.r(__webpack_exports__);
  106842. /**
  106843. * Checks if `value` is the
  106844. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  106845. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  106846. *
  106847. * @static
  106848. * @memberOf _
  106849. * @since 0.1.0
  106850. * @category Lang
  106851. * @param {*} value The value to check.
  106852. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  106853. * @example
  106854. *
  106855. * _.isObject({});
  106856. * // => true
  106857. *
  106858. * _.isObject([1, 2, 3]);
  106859. * // => true
  106860. *
  106861. * _.isObject(_.noop);
  106862. * // => true
  106863. *
  106864. * _.isObject(null);
  106865. * // => false
  106866. */
  106867. function isObject(value) {
  106868. var type = typeof value;
  106869. return value != null && (type == 'object' || type == 'function');
  106870. }
  106871. /* harmony default export */ __webpack_exports__["default"] = (isObject);
  106872. /***/ }),
  106873. /***/ "./node_modules/lodash-es/isObjectLike.js":
  106874. /*!************************************************!*\
  106875. !*** ./node_modules/lodash-es/isObjectLike.js ***!
  106876. \************************************************/
  106877. /*! exports provided: default */
  106878. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106879. "use strict";
  106880. __webpack_require__.r(__webpack_exports__);
  106881. /**
  106882. * Checks if `value` is object-like. A value is object-like if it's not `null`
  106883. * and has a `typeof` result of "object".
  106884. *
  106885. * @static
  106886. * @memberOf _
  106887. * @since 4.0.0
  106888. * @category Lang
  106889. * @param {*} value The value to check.
  106890. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  106891. * @example
  106892. *
  106893. * _.isObjectLike({});
  106894. * // => true
  106895. *
  106896. * _.isObjectLike([1, 2, 3]);
  106897. * // => true
  106898. *
  106899. * _.isObjectLike(_.noop);
  106900. * // => false
  106901. *
  106902. * _.isObjectLike(null);
  106903. * // => false
  106904. */
  106905. function isObjectLike(value) {
  106906. return value != null && typeof value == 'object';
  106907. }
  106908. /* harmony default export */ __webpack_exports__["default"] = (isObjectLike);
  106909. /***/ }),
  106910. /***/ "./node_modules/lodash-es/isPlainObject.js":
  106911. /*!*************************************************!*\
  106912. !*** ./node_modules/lodash-es/isPlainObject.js ***!
  106913. \*************************************************/
  106914. /*! exports provided: default */
  106915. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106916. "use strict";
  106917. __webpack_require__.r(__webpack_exports__);
  106918. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  106919. /* harmony import */ var _getPrototype_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getPrototype.js */ "./node_modules/lodash-es/_getPrototype.js");
  106920. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  106921. /** `Object#toString` result references. */
  106922. var objectTag = '[object Object]';
  106923. /** Used for built-in method references. */
  106924. var funcProto = Function.prototype,
  106925. objectProto = Object.prototype;
  106926. /** Used to resolve the decompiled source of functions. */
  106927. var funcToString = funcProto.toString;
  106928. /** Used to check objects for own properties. */
  106929. var hasOwnProperty = objectProto.hasOwnProperty;
  106930. /** Used to infer the `Object` constructor. */
  106931. var objectCtorString = funcToString.call(Object);
  106932. /**
  106933. * Checks if `value` is a plain object, that is, an object created by the
  106934. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  106935. *
  106936. * @static
  106937. * @memberOf _
  106938. * @since 0.8.0
  106939. * @category Lang
  106940. * @param {*} value The value to check.
  106941. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  106942. * @example
  106943. *
  106944. * function Foo() {
  106945. * this.a = 1;
  106946. * }
  106947. *
  106948. * _.isPlainObject(new Foo);
  106949. * // => false
  106950. *
  106951. * _.isPlainObject([1, 2, 3]);
  106952. * // => false
  106953. *
  106954. * _.isPlainObject({ 'x': 0, 'y': 0 });
  106955. * // => true
  106956. *
  106957. * _.isPlainObject(Object.create(null));
  106958. * // => true
  106959. */
  106960. function isPlainObject(value) {
  106961. if (!Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value) || Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) != objectTag) {
  106962. return false;
  106963. }
  106964. var proto = Object(_getPrototype_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value);
  106965. if (proto === null) {
  106966. return true;
  106967. }
  106968. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  106969. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  106970. funcToString.call(Ctor) == objectCtorString;
  106971. }
  106972. /* harmony default export */ __webpack_exports__["default"] = (isPlainObject);
  106973. /***/ }),
  106974. /***/ "./node_modules/lodash-es/isRegExp.js":
  106975. /*!********************************************!*\
  106976. !*** ./node_modules/lodash-es/isRegExp.js ***!
  106977. \********************************************/
  106978. /*! exports provided: default */
  106979. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  106980. "use strict";
  106981. __webpack_require__.r(__webpack_exports__);
  106982. /* harmony import */ var _baseIsRegExp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsRegExp.js */ "./node_modules/lodash-es/_baseIsRegExp.js");
  106983. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  106984. /* harmony import */ var _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_nodeUtil.js */ "./node_modules/lodash-es/_nodeUtil.js");
  106985. /* Node.js helper references. */
  106986. var nodeIsRegExp = _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"] && _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"].isRegExp;
  106987. /**
  106988. * Checks if `value` is classified as a `RegExp` object.
  106989. *
  106990. * @static
  106991. * @memberOf _
  106992. * @since 0.1.0
  106993. * @category Lang
  106994. * @param {*} value The value to check.
  106995. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  106996. * @example
  106997. *
  106998. * _.isRegExp(/abc/);
  106999. * // => true
  107000. *
  107001. * _.isRegExp('/abc/');
  107002. * // => false
  107003. */
  107004. var isRegExp = nodeIsRegExp ? Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_1__["default"])(nodeIsRegExp) : _baseIsRegExp_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  107005. /* harmony default export */ __webpack_exports__["default"] = (isRegExp);
  107006. /***/ }),
  107007. /***/ "./node_modules/lodash-es/isSafeInteger.js":
  107008. /*!*************************************************!*\
  107009. !*** ./node_modules/lodash-es/isSafeInteger.js ***!
  107010. \*************************************************/
  107011. /*! exports provided: default */
  107012. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107013. "use strict";
  107014. __webpack_require__.r(__webpack_exports__);
  107015. /* harmony import */ var _isInteger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isInteger.js */ "./node_modules/lodash-es/isInteger.js");
  107016. /** Used as references for various `Number` constants. */
  107017. var MAX_SAFE_INTEGER = 9007199254740991;
  107018. /**
  107019. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  107020. * double precision number which isn't the result of a rounded unsafe integer.
  107021. *
  107022. * **Note:** This method is based on
  107023. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  107024. *
  107025. * @static
  107026. * @memberOf _
  107027. * @since 4.0.0
  107028. * @category Lang
  107029. * @param {*} value The value to check.
  107030. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  107031. * @example
  107032. *
  107033. * _.isSafeInteger(3);
  107034. * // => true
  107035. *
  107036. * _.isSafeInteger(Number.MIN_VALUE);
  107037. * // => false
  107038. *
  107039. * _.isSafeInteger(Infinity);
  107040. * // => false
  107041. *
  107042. * _.isSafeInteger('3');
  107043. * // => false
  107044. */
  107045. function isSafeInteger(value) {
  107046. return Object(_isInteger_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  107047. }
  107048. /* harmony default export */ __webpack_exports__["default"] = (isSafeInteger);
  107049. /***/ }),
  107050. /***/ "./node_modules/lodash-es/isSet.js":
  107051. /*!*****************************************!*\
  107052. !*** ./node_modules/lodash-es/isSet.js ***!
  107053. \*****************************************/
  107054. /*! exports provided: default */
  107055. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107056. "use strict";
  107057. __webpack_require__.r(__webpack_exports__);
  107058. /* harmony import */ var _baseIsSet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsSet.js */ "./node_modules/lodash-es/_baseIsSet.js");
  107059. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  107060. /* harmony import */ var _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_nodeUtil.js */ "./node_modules/lodash-es/_nodeUtil.js");
  107061. /* Node.js helper references. */
  107062. var nodeIsSet = _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"] && _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"].isSet;
  107063. /**
  107064. * Checks if `value` is classified as a `Set` object.
  107065. *
  107066. * @static
  107067. * @memberOf _
  107068. * @since 4.3.0
  107069. * @category Lang
  107070. * @param {*} value The value to check.
  107071. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  107072. * @example
  107073. *
  107074. * _.isSet(new Set);
  107075. * // => true
  107076. *
  107077. * _.isSet(new WeakSet);
  107078. * // => false
  107079. */
  107080. var isSet = nodeIsSet ? Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_1__["default"])(nodeIsSet) : _baseIsSet_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  107081. /* harmony default export */ __webpack_exports__["default"] = (isSet);
  107082. /***/ }),
  107083. /***/ "./node_modules/lodash-es/isString.js":
  107084. /*!********************************************!*\
  107085. !*** ./node_modules/lodash-es/isString.js ***!
  107086. \********************************************/
  107087. /*! exports provided: default */
  107088. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107089. "use strict";
  107090. __webpack_require__.r(__webpack_exports__);
  107091. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  107092. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  107093. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  107094. /** `Object#toString` result references. */
  107095. var stringTag = '[object String]';
  107096. /**
  107097. * Checks if `value` is classified as a `String` primitive or object.
  107098. *
  107099. * @static
  107100. * @since 0.1.0
  107101. * @memberOf _
  107102. * @category Lang
  107103. * @param {*} value The value to check.
  107104. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  107105. * @example
  107106. *
  107107. * _.isString('abc');
  107108. * // => true
  107109. *
  107110. * _.isString(1);
  107111. * // => false
  107112. */
  107113. function isString(value) {
  107114. return typeof value == 'string' ||
  107115. (!Object(_isArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value) && Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == stringTag);
  107116. }
  107117. /* harmony default export */ __webpack_exports__["default"] = (isString);
  107118. /***/ }),
  107119. /***/ "./node_modules/lodash-es/isSymbol.js":
  107120. /*!********************************************!*\
  107121. !*** ./node_modules/lodash-es/isSymbol.js ***!
  107122. \********************************************/
  107123. /*! exports provided: default */
  107124. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107125. "use strict";
  107126. __webpack_require__.r(__webpack_exports__);
  107127. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  107128. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  107129. /** `Object#toString` result references. */
  107130. var symbolTag = '[object Symbol]';
  107131. /**
  107132. * Checks if `value` is classified as a `Symbol` primitive or object.
  107133. *
  107134. * @static
  107135. * @memberOf _
  107136. * @since 4.0.0
  107137. * @category Lang
  107138. * @param {*} value The value to check.
  107139. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  107140. * @example
  107141. *
  107142. * _.isSymbol(Symbol.iterator);
  107143. * // => true
  107144. *
  107145. * _.isSymbol('abc');
  107146. * // => false
  107147. */
  107148. function isSymbol(value) {
  107149. return typeof value == 'symbol' ||
  107150. (Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == symbolTag);
  107151. }
  107152. /* harmony default export */ __webpack_exports__["default"] = (isSymbol);
  107153. /***/ }),
  107154. /***/ "./node_modules/lodash-es/isTypedArray.js":
  107155. /*!************************************************!*\
  107156. !*** ./node_modules/lodash-es/isTypedArray.js ***!
  107157. \************************************************/
  107158. /*! exports provided: default */
  107159. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107160. "use strict";
  107161. __webpack_require__.r(__webpack_exports__);
  107162. /* harmony import */ var _baseIsTypedArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIsTypedArray.js */ "./node_modules/lodash-es/_baseIsTypedArray.js");
  107163. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  107164. /* harmony import */ var _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_nodeUtil.js */ "./node_modules/lodash-es/_nodeUtil.js");
  107165. /* Node.js helper references. */
  107166. var nodeIsTypedArray = _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"] && _nodeUtil_js__WEBPACK_IMPORTED_MODULE_2__["default"].isTypedArray;
  107167. /**
  107168. * Checks if `value` is classified as a typed array.
  107169. *
  107170. * @static
  107171. * @memberOf _
  107172. * @since 3.0.0
  107173. * @category Lang
  107174. * @param {*} value The value to check.
  107175. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  107176. * @example
  107177. *
  107178. * _.isTypedArray(new Uint8Array);
  107179. * // => true
  107180. *
  107181. * _.isTypedArray([]);
  107182. * // => false
  107183. */
  107184. var isTypedArray = nodeIsTypedArray ? Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_1__["default"])(nodeIsTypedArray) : _baseIsTypedArray_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  107185. /* harmony default export */ __webpack_exports__["default"] = (isTypedArray);
  107186. /***/ }),
  107187. /***/ "./node_modules/lodash-es/isUndefined.js":
  107188. /*!***********************************************!*\
  107189. !*** ./node_modules/lodash-es/isUndefined.js ***!
  107190. \***********************************************/
  107191. /*! exports provided: default */
  107192. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107193. "use strict";
  107194. __webpack_require__.r(__webpack_exports__);
  107195. /**
  107196. * Checks if `value` is `undefined`.
  107197. *
  107198. * @static
  107199. * @since 0.1.0
  107200. * @memberOf _
  107201. * @category Lang
  107202. * @param {*} value The value to check.
  107203. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  107204. * @example
  107205. *
  107206. * _.isUndefined(void 0);
  107207. * // => true
  107208. *
  107209. * _.isUndefined(null);
  107210. * // => false
  107211. */
  107212. function isUndefined(value) {
  107213. return value === undefined;
  107214. }
  107215. /* harmony default export */ __webpack_exports__["default"] = (isUndefined);
  107216. /***/ }),
  107217. /***/ "./node_modules/lodash-es/isWeakMap.js":
  107218. /*!*********************************************!*\
  107219. !*** ./node_modules/lodash-es/isWeakMap.js ***!
  107220. \*********************************************/
  107221. /*! exports provided: default */
  107222. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107223. "use strict";
  107224. __webpack_require__.r(__webpack_exports__);
  107225. /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
  107226. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  107227. /** `Object#toString` result references. */
  107228. var weakMapTag = '[object WeakMap]';
  107229. /**
  107230. * Checks if `value` is classified as a `WeakMap` object.
  107231. *
  107232. * @static
  107233. * @memberOf _
  107234. * @since 4.3.0
  107235. * @category Lang
  107236. * @param {*} value The value to check.
  107237. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  107238. * @example
  107239. *
  107240. * _.isWeakMap(new WeakMap);
  107241. * // => true
  107242. *
  107243. * _.isWeakMap(new Map);
  107244. * // => false
  107245. */
  107246. function isWeakMap(value) {
  107247. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_getTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == weakMapTag;
  107248. }
  107249. /* harmony default export */ __webpack_exports__["default"] = (isWeakMap);
  107250. /***/ }),
  107251. /***/ "./node_modules/lodash-es/isWeakSet.js":
  107252. /*!*********************************************!*\
  107253. !*** ./node_modules/lodash-es/isWeakSet.js ***!
  107254. \*********************************************/
  107255. /*! exports provided: default */
  107256. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107257. "use strict";
  107258. __webpack_require__.r(__webpack_exports__);
  107259. /* harmony import */ var _baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGetTag.js */ "./node_modules/lodash-es/_baseGetTag.js");
  107260. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  107261. /** `Object#toString` result references. */
  107262. var weakSetTag = '[object WeakSet]';
  107263. /**
  107264. * Checks if `value` is classified as a `WeakSet` object.
  107265. *
  107266. * @static
  107267. * @memberOf _
  107268. * @since 4.3.0
  107269. * @category Lang
  107270. * @param {*} value The value to check.
  107271. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  107272. * @example
  107273. *
  107274. * _.isWeakSet(new WeakSet);
  107275. * // => true
  107276. *
  107277. * _.isWeakSet(new Set);
  107278. * // => false
  107279. */
  107280. function isWeakSet(value) {
  107281. return Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) && Object(_baseGetTag_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value) == weakSetTag;
  107282. }
  107283. /* harmony default export */ __webpack_exports__["default"] = (isWeakSet);
  107284. /***/ }),
  107285. /***/ "./node_modules/lodash-es/iteratee.js":
  107286. /*!********************************************!*\
  107287. !*** ./node_modules/lodash-es/iteratee.js ***!
  107288. \********************************************/
  107289. /*! exports provided: default */
  107290. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107291. "use strict";
  107292. __webpack_require__.r(__webpack_exports__);
  107293. /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
  107294. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  107295. /** Used to compose bitmasks for cloning. */
  107296. var CLONE_DEEP_FLAG = 1;
  107297. /**
  107298. * Creates a function that invokes `func` with the arguments of the created
  107299. * function. If `func` is a property name, the created function returns the
  107300. * property value for a given element. If `func` is an array or object, the
  107301. * created function returns `true` for elements that contain the equivalent
  107302. * source properties, otherwise it returns `false`.
  107303. *
  107304. * @static
  107305. * @since 4.0.0
  107306. * @memberOf _
  107307. * @category Util
  107308. * @param {*} [func=_.identity] The value to convert to a callback.
  107309. * @returns {Function} Returns the callback.
  107310. * @example
  107311. *
  107312. * var users = [
  107313. * { 'user': 'barney', 'age': 36, 'active': true },
  107314. * { 'user': 'fred', 'age': 40, 'active': false }
  107315. * ];
  107316. *
  107317. * // The `_.matches` iteratee shorthand.
  107318. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  107319. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  107320. *
  107321. * // The `_.matchesProperty` iteratee shorthand.
  107322. * _.filter(users, _.iteratee(['user', 'fred']));
  107323. * // => [{ 'user': 'fred', 'age': 40 }]
  107324. *
  107325. * // The `_.property` iteratee shorthand.
  107326. * _.map(users, _.iteratee('user'));
  107327. * // => ['barney', 'fred']
  107328. *
  107329. * // Create custom iteratee shorthands.
  107330. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  107331. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  107332. * return func.test(string);
  107333. * };
  107334. * });
  107335. *
  107336. * _.filter(['abc', 'def'], /ef/);
  107337. * // => ['def']
  107338. */
  107339. function iteratee(func) {
  107340. return Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__["default"])(typeof func == 'function' ? func : Object(_baseClone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, CLONE_DEEP_FLAG));
  107341. }
  107342. /* harmony default export */ __webpack_exports__["default"] = (iteratee);
  107343. /***/ }),
  107344. /***/ "./node_modules/lodash-es/join.js":
  107345. /*!****************************************!*\
  107346. !*** ./node_modules/lodash-es/join.js ***!
  107347. \****************************************/
  107348. /*! exports provided: default */
  107349. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107350. "use strict";
  107351. __webpack_require__.r(__webpack_exports__);
  107352. /** Used for built-in method references. */
  107353. var arrayProto = Array.prototype;
  107354. /* Built-in method references for those with the same name as other `lodash` methods. */
  107355. var nativeJoin = arrayProto.join;
  107356. /**
  107357. * Converts all elements in `array` into a string separated by `separator`.
  107358. *
  107359. * @static
  107360. * @memberOf _
  107361. * @since 4.0.0
  107362. * @category Array
  107363. * @param {Array} array The array to convert.
  107364. * @param {string} [separator=','] The element separator.
  107365. * @returns {string} Returns the joined string.
  107366. * @example
  107367. *
  107368. * _.join(['a', 'b', 'c'], '~');
  107369. * // => 'a~b~c'
  107370. */
  107371. function join(array, separator) {
  107372. return array == null ? '' : nativeJoin.call(array, separator);
  107373. }
  107374. /* harmony default export */ __webpack_exports__["default"] = (join);
  107375. /***/ }),
  107376. /***/ "./node_modules/lodash-es/kebabCase.js":
  107377. /*!*********************************************!*\
  107378. !*** ./node_modules/lodash-es/kebabCase.js ***!
  107379. \*********************************************/
  107380. /*! exports provided: default */
  107381. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107382. "use strict";
  107383. __webpack_require__.r(__webpack_exports__);
  107384. /* harmony import */ var _createCompounder_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createCompounder.js */ "./node_modules/lodash-es/_createCompounder.js");
  107385. /**
  107386. * Converts `string` to
  107387. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  107388. *
  107389. * @static
  107390. * @memberOf _
  107391. * @since 3.0.0
  107392. * @category String
  107393. * @param {string} [string=''] The string to convert.
  107394. * @returns {string} Returns the kebab cased string.
  107395. * @example
  107396. *
  107397. * _.kebabCase('Foo Bar');
  107398. * // => 'foo-bar'
  107399. *
  107400. * _.kebabCase('fooBar');
  107401. * // => 'foo-bar'
  107402. *
  107403. * _.kebabCase('__FOO_BAR__');
  107404. * // => 'foo-bar'
  107405. */
  107406. var kebabCase = Object(_createCompounder_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(result, word, index) {
  107407. return result + (index ? '-' : '') + word.toLowerCase();
  107408. });
  107409. /* harmony default export */ __webpack_exports__["default"] = (kebabCase);
  107410. /***/ }),
  107411. /***/ "./node_modules/lodash-es/keyBy.js":
  107412. /*!*****************************************!*\
  107413. !*** ./node_modules/lodash-es/keyBy.js ***!
  107414. \*****************************************/
  107415. /*! exports provided: default */
  107416. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107417. "use strict";
  107418. __webpack_require__.r(__webpack_exports__);
  107419. /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
  107420. /* harmony import */ var _createAggregator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createAggregator.js */ "./node_modules/lodash-es/_createAggregator.js");
  107421. /**
  107422. * Creates an object composed of keys generated from the results of running
  107423. * each element of `collection` thru `iteratee`. The corresponding value of
  107424. * each key is the last element responsible for generating the key. The
  107425. * iteratee is invoked with one argument: (value).
  107426. *
  107427. * @static
  107428. * @memberOf _
  107429. * @since 4.0.0
  107430. * @category Collection
  107431. * @param {Array|Object} collection The collection to iterate over.
  107432. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  107433. * @returns {Object} Returns the composed aggregate object.
  107434. * @example
  107435. *
  107436. * var array = [
  107437. * { 'dir': 'left', 'code': 97 },
  107438. * { 'dir': 'right', 'code': 100 }
  107439. * ];
  107440. *
  107441. * _.keyBy(array, function(o) {
  107442. * return String.fromCharCode(o.code);
  107443. * });
  107444. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  107445. *
  107446. * _.keyBy(array, 'dir');
  107447. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  107448. */
  107449. var keyBy = Object(_createAggregator_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(result, value, key) {
  107450. Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, key, value);
  107451. });
  107452. /* harmony default export */ __webpack_exports__["default"] = (keyBy);
  107453. /***/ }),
  107454. /***/ "./node_modules/lodash-es/keys.js":
  107455. /*!****************************************!*\
  107456. !*** ./node_modules/lodash-es/keys.js ***!
  107457. \****************************************/
  107458. /*! exports provided: default */
  107459. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107460. "use strict";
  107461. __webpack_require__.r(__webpack_exports__);
  107462. /* harmony import */ var _arrayLikeKeys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayLikeKeys.js */ "./node_modules/lodash-es/_arrayLikeKeys.js");
  107463. /* harmony import */ var _baseKeys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseKeys.js */ "./node_modules/lodash-es/_baseKeys.js");
  107464. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  107465. /**
  107466. * Creates an array of the own enumerable property names of `object`.
  107467. *
  107468. * **Note:** Non-object values are coerced to objects. See the
  107469. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  107470. * for more details.
  107471. *
  107472. * @static
  107473. * @since 0.1.0
  107474. * @memberOf _
  107475. * @category Object
  107476. * @param {Object} object The object to query.
  107477. * @returns {Array} Returns the array of property names.
  107478. * @example
  107479. *
  107480. * function Foo() {
  107481. * this.a = 1;
  107482. * this.b = 2;
  107483. * }
  107484. *
  107485. * Foo.prototype.c = 3;
  107486. *
  107487. * _.keys(new Foo);
  107488. * // => ['a', 'b'] (iteration order is not guaranteed)
  107489. *
  107490. * _.keys('hi');
  107491. * // => ['0', '1']
  107492. */
  107493. function keys(object) {
  107494. return Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object) ? Object(_arrayLikeKeys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object) : Object(_baseKeys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object);
  107495. }
  107496. /* harmony default export */ __webpack_exports__["default"] = (keys);
  107497. /***/ }),
  107498. /***/ "./node_modules/lodash-es/keysIn.js":
  107499. /*!******************************************!*\
  107500. !*** ./node_modules/lodash-es/keysIn.js ***!
  107501. \******************************************/
  107502. /*! exports provided: default */
  107503. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107504. "use strict";
  107505. __webpack_require__.r(__webpack_exports__);
  107506. /* harmony import */ var _arrayLikeKeys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayLikeKeys.js */ "./node_modules/lodash-es/_arrayLikeKeys.js");
  107507. /* harmony import */ var _baseKeysIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseKeysIn.js */ "./node_modules/lodash-es/_baseKeysIn.js");
  107508. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  107509. /**
  107510. * Creates an array of the own and inherited enumerable property names of `object`.
  107511. *
  107512. * **Note:** Non-object values are coerced to objects.
  107513. *
  107514. * @static
  107515. * @memberOf _
  107516. * @since 3.0.0
  107517. * @category Object
  107518. * @param {Object} object The object to query.
  107519. * @returns {Array} Returns the array of property names.
  107520. * @example
  107521. *
  107522. * function Foo() {
  107523. * this.a = 1;
  107524. * this.b = 2;
  107525. * }
  107526. *
  107527. * Foo.prototype.c = 3;
  107528. *
  107529. * _.keysIn(new Foo);
  107530. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  107531. */
  107532. function keysIn(object) {
  107533. return Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object) ? Object(_arrayLikeKeys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, true) : Object(_baseKeysIn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object);
  107534. }
  107535. /* harmony default export */ __webpack_exports__["default"] = (keysIn);
  107536. /***/ }),
  107537. /***/ "./node_modules/lodash-es/lang.default.js":
  107538. /*!************************************************!*\
  107539. !*** ./node_modules/lodash-es/lang.default.js ***!
  107540. \************************************************/
  107541. /*! exports provided: default */
  107542. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107543. "use strict";
  107544. __webpack_require__.r(__webpack_exports__);
  107545. /* harmony import */ var _castArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./castArray.js */ "./node_modules/lodash-es/castArray.js");
  107546. /* harmony import */ var _clone_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./clone.js */ "./node_modules/lodash-es/clone.js");
  107547. /* harmony import */ var _cloneDeep_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cloneDeep.js */ "./node_modules/lodash-es/cloneDeep.js");
  107548. /* harmony import */ var _cloneDeepWith_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./cloneDeepWith.js */ "./node_modules/lodash-es/cloneDeepWith.js");
  107549. /* harmony import */ var _cloneWith_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./cloneWith.js */ "./node_modules/lodash-es/cloneWith.js");
  107550. /* harmony import */ var _conformsTo_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./conformsTo.js */ "./node_modules/lodash-es/conformsTo.js");
  107551. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  107552. /* harmony import */ var _gt_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./gt.js */ "./node_modules/lodash-es/gt.js");
  107553. /* harmony import */ var _gte_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./gte.js */ "./node_modules/lodash-es/gte.js");
  107554. /* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
  107555. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  107556. /* harmony import */ var _isArrayBuffer_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./isArrayBuffer.js */ "./node_modules/lodash-es/isArrayBuffer.js");
  107557. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  107558. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  107559. /* harmony import */ var _isBoolean_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./isBoolean.js */ "./node_modules/lodash-es/isBoolean.js");
  107560. /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
  107561. /* harmony import */ var _isDate_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./isDate.js */ "./node_modules/lodash-es/isDate.js");
  107562. /* harmony import */ var _isElement_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./isElement.js */ "./node_modules/lodash-es/isElement.js");
  107563. /* harmony import */ var _isEmpty_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./isEmpty.js */ "./node_modules/lodash-es/isEmpty.js");
  107564. /* harmony import */ var _isEqual_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./isEqual.js */ "./node_modules/lodash-es/isEqual.js");
  107565. /* harmony import */ var _isEqualWith_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./isEqualWith.js */ "./node_modules/lodash-es/isEqualWith.js");
  107566. /* harmony import */ var _isError_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./isError.js */ "./node_modules/lodash-es/isError.js");
  107567. /* harmony import */ var _isFinite_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./isFinite.js */ "./node_modules/lodash-es/isFinite.js");
  107568. /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
  107569. /* harmony import */ var _isInteger_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./isInteger.js */ "./node_modules/lodash-es/isInteger.js");
  107570. /* harmony import */ var _isLength_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./isLength.js */ "./node_modules/lodash-es/isLength.js");
  107571. /* harmony import */ var _isMap_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./isMap.js */ "./node_modules/lodash-es/isMap.js");
  107572. /* harmony import */ var _isMatch_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./isMatch.js */ "./node_modules/lodash-es/isMatch.js");
  107573. /* harmony import */ var _isMatchWith_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./isMatchWith.js */ "./node_modules/lodash-es/isMatchWith.js");
  107574. /* harmony import */ var _isNaN_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./isNaN.js */ "./node_modules/lodash-es/isNaN.js");
  107575. /* harmony import */ var _isNative_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./isNative.js */ "./node_modules/lodash-es/isNative.js");
  107576. /* harmony import */ var _isNil_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./isNil.js */ "./node_modules/lodash-es/isNil.js");
  107577. /* harmony import */ var _isNull_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./isNull.js */ "./node_modules/lodash-es/isNull.js");
  107578. /* harmony import */ var _isNumber_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./isNumber.js */ "./node_modules/lodash-es/isNumber.js");
  107579. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  107580. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  107581. /* harmony import */ var _isPlainObject_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./isPlainObject.js */ "./node_modules/lodash-es/isPlainObject.js");
  107582. /* harmony import */ var _isRegExp_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./isRegExp.js */ "./node_modules/lodash-es/isRegExp.js");
  107583. /* harmony import */ var _isSafeInteger_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./isSafeInteger.js */ "./node_modules/lodash-es/isSafeInteger.js");
  107584. /* harmony import */ var _isSet_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./isSet.js */ "./node_modules/lodash-es/isSet.js");
  107585. /* harmony import */ var _isString_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./isString.js */ "./node_modules/lodash-es/isString.js");
  107586. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  107587. /* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/lodash-es/isTypedArray.js");
  107588. /* harmony import */ var _isUndefined_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./isUndefined.js */ "./node_modules/lodash-es/isUndefined.js");
  107589. /* harmony import */ var _isWeakMap_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./isWeakMap.js */ "./node_modules/lodash-es/isWeakMap.js");
  107590. /* harmony import */ var _isWeakSet_js__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./isWeakSet.js */ "./node_modules/lodash-es/isWeakSet.js");
  107591. /* harmony import */ var _lt_js__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./lt.js */ "./node_modules/lodash-es/lt.js");
  107592. /* harmony import */ var _lte_js__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./lte.js */ "./node_modules/lodash-es/lte.js");
  107593. /* harmony import */ var _toArray_js__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./toArray.js */ "./node_modules/lodash-es/toArray.js");
  107594. /* harmony import */ var _toFinite_js__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./toFinite.js */ "./node_modules/lodash-es/toFinite.js");
  107595. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  107596. /* harmony import */ var _toLength_js__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./toLength.js */ "./node_modules/lodash-es/toLength.js");
  107597. /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
  107598. /* harmony import */ var _toPlainObject_js__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./toPlainObject.js */ "./node_modules/lodash-es/toPlainObject.js");
  107599. /* harmony import */ var _toSafeInteger_js__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./toSafeInteger.js */ "./node_modules/lodash-es/toSafeInteger.js");
  107600. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  107601. /* harmony default export */ __webpack_exports__["default"] = ({
  107602. castArray: _castArray_js__WEBPACK_IMPORTED_MODULE_0__["default"], clone: _clone_js__WEBPACK_IMPORTED_MODULE_1__["default"], cloneDeep: _cloneDeep_js__WEBPACK_IMPORTED_MODULE_2__["default"], cloneDeepWith: _cloneDeepWith_js__WEBPACK_IMPORTED_MODULE_3__["default"], cloneWith: _cloneWith_js__WEBPACK_IMPORTED_MODULE_4__["default"],
  107603. conformsTo: _conformsTo_js__WEBPACK_IMPORTED_MODULE_5__["default"], eq: _eq_js__WEBPACK_IMPORTED_MODULE_6__["default"], gt: _gt_js__WEBPACK_IMPORTED_MODULE_7__["default"], gte: _gte_js__WEBPACK_IMPORTED_MODULE_8__["default"], isArguments: _isArguments_js__WEBPACK_IMPORTED_MODULE_9__["default"],
  107604. isArray: _isArray_js__WEBPACK_IMPORTED_MODULE_10__["default"], isArrayBuffer: _isArrayBuffer_js__WEBPACK_IMPORTED_MODULE_11__["default"], isArrayLike: _isArrayLike_js__WEBPACK_IMPORTED_MODULE_12__["default"], isArrayLikeObject: _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_13__["default"], isBoolean: _isBoolean_js__WEBPACK_IMPORTED_MODULE_14__["default"],
  107605. isBuffer: _isBuffer_js__WEBPACK_IMPORTED_MODULE_15__["default"], isDate: _isDate_js__WEBPACK_IMPORTED_MODULE_16__["default"], isElement: _isElement_js__WEBPACK_IMPORTED_MODULE_17__["default"], isEmpty: _isEmpty_js__WEBPACK_IMPORTED_MODULE_18__["default"], isEqual: _isEqual_js__WEBPACK_IMPORTED_MODULE_19__["default"],
  107606. isEqualWith: _isEqualWith_js__WEBPACK_IMPORTED_MODULE_20__["default"], isError: _isError_js__WEBPACK_IMPORTED_MODULE_21__["default"], isFinite: _isFinite_js__WEBPACK_IMPORTED_MODULE_22__["default"], isFunction: _isFunction_js__WEBPACK_IMPORTED_MODULE_23__["default"], isInteger: _isInteger_js__WEBPACK_IMPORTED_MODULE_24__["default"],
  107607. isLength: _isLength_js__WEBPACK_IMPORTED_MODULE_25__["default"], isMap: _isMap_js__WEBPACK_IMPORTED_MODULE_26__["default"], isMatch: _isMatch_js__WEBPACK_IMPORTED_MODULE_27__["default"], isMatchWith: _isMatchWith_js__WEBPACK_IMPORTED_MODULE_28__["default"], isNaN: _isNaN_js__WEBPACK_IMPORTED_MODULE_29__["default"],
  107608. isNative: _isNative_js__WEBPACK_IMPORTED_MODULE_30__["default"], isNil: _isNil_js__WEBPACK_IMPORTED_MODULE_31__["default"], isNull: _isNull_js__WEBPACK_IMPORTED_MODULE_32__["default"], isNumber: _isNumber_js__WEBPACK_IMPORTED_MODULE_33__["default"], isObject: _isObject_js__WEBPACK_IMPORTED_MODULE_34__["default"],
  107609. isObjectLike: _isObjectLike_js__WEBPACK_IMPORTED_MODULE_35__["default"], isPlainObject: _isPlainObject_js__WEBPACK_IMPORTED_MODULE_36__["default"], isRegExp: _isRegExp_js__WEBPACK_IMPORTED_MODULE_37__["default"], isSafeInteger: _isSafeInteger_js__WEBPACK_IMPORTED_MODULE_38__["default"], isSet: _isSet_js__WEBPACK_IMPORTED_MODULE_39__["default"],
  107610. isString: _isString_js__WEBPACK_IMPORTED_MODULE_40__["default"], isSymbol: _isSymbol_js__WEBPACK_IMPORTED_MODULE_41__["default"], isTypedArray: _isTypedArray_js__WEBPACK_IMPORTED_MODULE_42__["default"], isUndefined: _isUndefined_js__WEBPACK_IMPORTED_MODULE_43__["default"], isWeakMap: _isWeakMap_js__WEBPACK_IMPORTED_MODULE_44__["default"],
  107611. isWeakSet: _isWeakSet_js__WEBPACK_IMPORTED_MODULE_45__["default"], lt: _lt_js__WEBPACK_IMPORTED_MODULE_46__["default"], lte: _lte_js__WEBPACK_IMPORTED_MODULE_47__["default"], toArray: _toArray_js__WEBPACK_IMPORTED_MODULE_48__["default"], toFinite: _toFinite_js__WEBPACK_IMPORTED_MODULE_49__["default"],
  107612. toInteger: _toInteger_js__WEBPACK_IMPORTED_MODULE_50__["default"], toLength: _toLength_js__WEBPACK_IMPORTED_MODULE_51__["default"], toNumber: _toNumber_js__WEBPACK_IMPORTED_MODULE_52__["default"], toPlainObject: _toPlainObject_js__WEBPACK_IMPORTED_MODULE_53__["default"], toSafeInteger: _toSafeInteger_js__WEBPACK_IMPORTED_MODULE_54__["default"],
  107613. toString: _toString_js__WEBPACK_IMPORTED_MODULE_55__["default"]
  107614. });
  107615. /***/ }),
  107616. /***/ "./node_modules/lodash-es/lang.js":
  107617. /*!****************************************!*\
  107618. !*** ./node_modules/lodash-es/lang.js ***!
  107619. \****************************************/
  107620. /*! exports provided: castArray, clone, cloneDeep, cloneDeepWith, cloneWith, conformsTo, eq, gt, gte, isArguments, isArray, isArrayBuffer, isArrayLike, isArrayLikeObject, isBoolean, isBuffer, isDate, isElement, isEmpty, isEqual, isEqualWith, isError, isFinite, isFunction, isInteger, isLength, isMap, isMatch, isMatchWith, isNaN, isNative, isNil, isNull, isNumber, isObject, isObjectLike, isPlainObject, isRegExp, isSafeInteger, isSet, isString, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, lt, lte, toArray, toFinite, toInteger, toLength, toNumber, toPlainObject, toSafeInteger, toString, default */
  107621. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107622. "use strict";
  107623. __webpack_require__.r(__webpack_exports__);
  107624. /* harmony import */ var _castArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./castArray.js */ "./node_modules/lodash-es/castArray.js");
  107625. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "castArray", function() { return _castArray_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  107626. /* harmony import */ var _clone_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./clone.js */ "./node_modules/lodash-es/clone.js");
  107627. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return _clone_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  107628. /* harmony import */ var _cloneDeep_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cloneDeep.js */ "./node_modules/lodash-es/cloneDeep.js");
  107629. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cloneDeep", function() { return _cloneDeep_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  107630. /* harmony import */ var _cloneDeepWith_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./cloneDeepWith.js */ "./node_modules/lodash-es/cloneDeepWith.js");
  107631. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cloneDeepWith", function() { return _cloneDeepWith_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  107632. /* harmony import */ var _cloneWith_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./cloneWith.js */ "./node_modules/lodash-es/cloneWith.js");
  107633. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cloneWith", function() { return _cloneWith_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  107634. /* harmony import */ var _conformsTo_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./conformsTo.js */ "./node_modules/lodash-es/conformsTo.js");
  107635. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "conformsTo", function() { return _conformsTo_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  107636. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  107637. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eq", function() { return _eq_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  107638. /* harmony import */ var _gt_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./gt.js */ "./node_modules/lodash-es/gt.js");
  107639. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "gt", function() { return _gt_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  107640. /* harmony import */ var _gte_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./gte.js */ "./node_modules/lodash-es/gte.js");
  107641. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "gte", function() { return _gte_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  107642. /* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
  107643. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArguments", function() { return _isArguments_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  107644. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  107645. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return _isArray_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  107646. /* harmony import */ var _isArrayBuffer_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./isArrayBuffer.js */ "./node_modules/lodash-es/isArrayBuffer.js");
  107647. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArrayBuffer", function() { return _isArrayBuffer_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  107648. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  107649. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArrayLike", function() { return _isArrayLike_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  107650. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  107651. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArrayLikeObject", function() { return _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  107652. /* harmony import */ var _isBoolean_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./isBoolean.js */ "./node_modules/lodash-es/isBoolean.js");
  107653. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return _isBoolean_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  107654. /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
  107655. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isBuffer", function() { return _isBuffer_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
  107656. /* harmony import */ var _isDate_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./isDate.js */ "./node_modules/lodash-es/isDate.js");
  107657. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isDate", function() { return _isDate_js__WEBPACK_IMPORTED_MODULE_16__["default"]; });
  107658. /* harmony import */ var _isElement_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./isElement.js */ "./node_modules/lodash-es/isElement.js");
  107659. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isElement", function() { return _isElement_js__WEBPACK_IMPORTED_MODULE_17__["default"]; });
  107660. /* harmony import */ var _isEmpty_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./isEmpty.js */ "./node_modules/lodash-es/isEmpty.js");
  107661. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return _isEmpty_js__WEBPACK_IMPORTED_MODULE_18__["default"]; });
  107662. /* harmony import */ var _isEqual_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./isEqual.js */ "./node_modules/lodash-es/isEqual.js");
  107663. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEqual", function() { return _isEqual_js__WEBPACK_IMPORTED_MODULE_19__["default"]; });
  107664. /* harmony import */ var _isEqualWith_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./isEqualWith.js */ "./node_modules/lodash-es/isEqualWith.js");
  107665. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEqualWith", function() { return _isEqualWith_js__WEBPACK_IMPORTED_MODULE_20__["default"]; });
  107666. /* harmony import */ var _isError_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./isError.js */ "./node_modules/lodash-es/isError.js");
  107667. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isError", function() { return _isError_js__WEBPACK_IMPORTED_MODULE_21__["default"]; });
  107668. /* harmony import */ var _isFinite_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./isFinite.js */ "./node_modules/lodash-es/isFinite.js");
  107669. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isFinite", function() { return _isFinite_js__WEBPACK_IMPORTED_MODULE_22__["default"]; });
  107670. /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
  107671. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return _isFunction_js__WEBPACK_IMPORTED_MODULE_23__["default"]; });
  107672. /* harmony import */ var _isInteger_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./isInteger.js */ "./node_modules/lodash-es/isInteger.js");
  107673. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isInteger", function() { return _isInteger_js__WEBPACK_IMPORTED_MODULE_24__["default"]; });
  107674. /* harmony import */ var _isLength_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./isLength.js */ "./node_modules/lodash-es/isLength.js");
  107675. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isLength", function() { return _isLength_js__WEBPACK_IMPORTED_MODULE_25__["default"]; });
  107676. /* harmony import */ var _isMap_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./isMap.js */ "./node_modules/lodash-es/isMap.js");
  107677. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isMap", function() { return _isMap_js__WEBPACK_IMPORTED_MODULE_26__["default"]; });
  107678. /* harmony import */ var _isMatch_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./isMatch.js */ "./node_modules/lodash-es/isMatch.js");
  107679. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isMatch", function() { return _isMatch_js__WEBPACK_IMPORTED_MODULE_27__["default"]; });
  107680. /* harmony import */ var _isMatchWith_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./isMatchWith.js */ "./node_modules/lodash-es/isMatchWith.js");
  107681. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isMatchWith", function() { return _isMatchWith_js__WEBPACK_IMPORTED_MODULE_28__["default"]; });
  107682. /* harmony import */ var _isNaN_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./isNaN.js */ "./node_modules/lodash-es/isNaN.js");
  107683. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNaN", function() { return _isNaN_js__WEBPACK_IMPORTED_MODULE_29__["default"]; });
  107684. /* harmony import */ var _isNative_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./isNative.js */ "./node_modules/lodash-es/isNative.js");
  107685. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNative", function() { return _isNative_js__WEBPACK_IMPORTED_MODULE_30__["default"]; });
  107686. /* harmony import */ var _isNil_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./isNil.js */ "./node_modules/lodash-es/isNil.js");
  107687. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNil", function() { return _isNil_js__WEBPACK_IMPORTED_MODULE_31__["default"]; });
  107688. /* harmony import */ var _isNull_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./isNull.js */ "./node_modules/lodash-es/isNull.js");
  107689. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNull", function() { return _isNull_js__WEBPACK_IMPORTED_MODULE_32__["default"]; });
  107690. /* harmony import */ var _isNumber_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./isNumber.js */ "./node_modules/lodash-es/isNumber.js");
  107691. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return _isNumber_js__WEBPACK_IMPORTED_MODULE_33__["default"]; });
  107692. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  107693. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return _isObject_js__WEBPACK_IMPORTED_MODULE_34__["default"]; });
  107694. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  107695. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isObjectLike", function() { return _isObjectLike_js__WEBPACK_IMPORTED_MODULE_35__["default"]; });
  107696. /* harmony import */ var _isPlainObject_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./isPlainObject.js */ "./node_modules/lodash-es/isPlainObject.js");
  107697. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPlainObject", function() { return _isPlainObject_js__WEBPACK_IMPORTED_MODULE_36__["default"]; });
  107698. /* harmony import */ var _isRegExp_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./isRegExp.js */ "./node_modules/lodash-es/isRegExp.js");
  107699. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return _isRegExp_js__WEBPACK_IMPORTED_MODULE_37__["default"]; });
  107700. /* harmony import */ var _isSafeInteger_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./isSafeInteger.js */ "./node_modules/lodash-es/isSafeInteger.js");
  107701. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSafeInteger", function() { return _isSafeInteger_js__WEBPACK_IMPORTED_MODULE_38__["default"]; });
  107702. /* harmony import */ var _isSet_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./isSet.js */ "./node_modules/lodash-es/isSet.js");
  107703. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSet", function() { return _isSet_js__WEBPACK_IMPORTED_MODULE_39__["default"]; });
  107704. /* harmony import */ var _isString_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./isString.js */ "./node_modules/lodash-es/isString.js");
  107705. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return _isString_js__WEBPACK_IMPORTED_MODULE_40__["default"]; });
  107706. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  107707. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSymbol", function() { return _isSymbol_js__WEBPACK_IMPORTED_MODULE_41__["default"]; });
  107708. /* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/lodash-es/isTypedArray.js");
  107709. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isTypedArray", function() { return _isTypedArray_js__WEBPACK_IMPORTED_MODULE_42__["default"]; });
  107710. /* harmony import */ var _isUndefined_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./isUndefined.js */ "./node_modules/lodash-es/isUndefined.js");
  107711. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return _isUndefined_js__WEBPACK_IMPORTED_MODULE_43__["default"]; });
  107712. /* harmony import */ var _isWeakMap_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./isWeakMap.js */ "./node_modules/lodash-es/isWeakMap.js");
  107713. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isWeakMap", function() { return _isWeakMap_js__WEBPACK_IMPORTED_MODULE_44__["default"]; });
  107714. /* harmony import */ var _isWeakSet_js__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./isWeakSet.js */ "./node_modules/lodash-es/isWeakSet.js");
  107715. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isWeakSet", function() { return _isWeakSet_js__WEBPACK_IMPORTED_MODULE_45__["default"]; });
  107716. /* harmony import */ var _lt_js__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./lt.js */ "./node_modules/lodash-es/lt.js");
  107717. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lt", function() { return _lt_js__WEBPACK_IMPORTED_MODULE_46__["default"]; });
  107718. /* harmony import */ var _lte_js__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./lte.js */ "./node_modules/lodash-es/lte.js");
  107719. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lte", function() { return _lte_js__WEBPACK_IMPORTED_MODULE_47__["default"]; });
  107720. /* harmony import */ var _toArray_js__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./toArray.js */ "./node_modules/lodash-es/toArray.js");
  107721. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return _toArray_js__WEBPACK_IMPORTED_MODULE_48__["default"]; });
  107722. /* harmony import */ var _toFinite_js__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./toFinite.js */ "./node_modules/lodash-es/toFinite.js");
  107723. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toFinite", function() { return _toFinite_js__WEBPACK_IMPORTED_MODULE_49__["default"]; });
  107724. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  107725. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toInteger", function() { return _toInteger_js__WEBPACK_IMPORTED_MODULE_50__["default"]; });
  107726. /* harmony import */ var _toLength_js__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./toLength.js */ "./node_modules/lodash-es/toLength.js");
  107727. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toLength", function() { return _toLength_js__WEBPACK_IMPORTED_MODULE_51__["default"]; });
  107728. /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
  107729. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toNumber", function() { return _toNumber_js__WEBPACK_IMPORTED_MODULE_52__["default"]; });
  107730. /* harmony import */ var _toPlainObject_js__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./toPlainObject.js */ "./node_modules/lodash-es/toPlainObject.js");
  107731. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toPlainObject", function() { return _toPlainObject_js__WEBPACK_IMPORTED_MODULE_53__["default"]; });
  107732. /* harmony import */ var _toSafeInteger_js__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./toSafeInteger.js */ "./node_modules/lodash-es/toSafeInteger.js");
  107733. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toSafeInteger", function() { return _toSafeInteger_js__WEBPACK_IMPORTED_MODULE_54__["default"]; });
  107734. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  107735. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toString", function() { return _toString_js__WEBPACK_IMPORTED_MODULE_55__["default"]; });
  107736. /* harmony import */ var _lang_default_js__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./lang.default.js */ "./node_modules/lodash-es/lang.default.js");
  107737. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _lang_default_js__WEBPACK_IMPORTED_MODULE_56__["default"]; });
  107738. /***/ }),
  107739. /***/ "./node_modules/lodash-es/last.js":
  107740. /*!****************************************!*\
  107741. !*** ./node_modules/lodash-es/last.js ***!
  107742. \****************************************/
  107743. /*! exports provided: default */
  107744. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107745. "use strict";
  107746. __webpack_require__.r(__webpack_exports__);
  107747. /**
  107748. * Gets the last element of `array`.
  107749. *
  107750. * @static
  107751. * @memberOf _
  107752. * @since 0.1.0
  107753. * @category Array
  107754. * @param {Array} array The array to query.
  107755. * @returns {*} Returns the last element of `array`.
  107756. * @example
  107757. *
  107758. * _.last([1, 2, 3]);
  107759. * // => 3
  107760. */
  107761. function last(array) {
  107762. var length = array == null ? 0 : array.length;
  107763. return length ? array[length - 1] : undefined;
  107764. }
  107765. /* harmony default export */ __webpack_exports__["default"] = (last);
  107766. /***/ }),
  107767. /***/ "./node_modules/lodash-es/lastIndexOf.js":
  107768. /*!***********************************************!*\
  107769. !*** ./node_modules/lodash-es/lastIndexOf.js ***!
  107770. \***********************************************/
  107771. /*! exports provided: default */
  107772. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107773. "use strict";
  107774. __webpack_require__.r(__webpack_exports__);
  107775. /* harmony import */ var _baseFindIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFindIndex.js */ "./node_modules/lodash-es/_baseFindIndex.js");
  107776. /* harmony import */ var _baseIsNaN_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIsNaN.js */ "./node_modules/lodash-es/_baseIsNaN.js");
  107777. /* harmony import */ var _strictLastIndexOf_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_strictLastIndexOf.js */ "./node_modules/lodash-es/_strictLastIndexOf.js");
  107778. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  107779. /* Built-in method references for those with the same name as other `lodash` methods. */
  107780. var nativeMax = Math.max,
  107781. nativeMin = Math.min;
  107782. /**
  107783. * This method is like `_.indexOf` except that it iterates over elements of
  107784. * `array` from right to left.
  107785. *
  107786. * @static
  107787. * @memberOf _
  107788. * @since 0.1.0
  107789. * @category Array
  107790. * @param {Array} array The array to inspect.
  107791. * @param {*} value The value to search for.
  107792. * @param {number} [fromIndex=array.length-1] The index to search from.
  107793. * @returns {number} Returns the index of the matched value, else `-1`.
  107794. * @example
  107795. *
  107796. * _.lastIndexOf([1, 2, 1, 2], 2);
  107797. * // => 3
  107798. *
  107799. * // Search from the `fromIndex`.
  107800. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  107801. * // => 1
  107802. */
  107803. function lastIndexOf(array, value, fromIndex) {
  107804. var length = array == null ? 0 : array.length;
  107805. if (!length) {
  107806. return -1;
  107807. }
  107808. var index = length;
  107809. if (fromIndex !== undefined) {
  107810. index = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_3__["default"])(fromIndex);
  107811. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  107812. }
  107813. return value === value
  107814. ? Object(_strictLastIndexOf_js__WEBPACK_IMPORTED_MODULE_2__["default"])(array, value, index)
  107815. : Object(_baseFindIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, _baseIsNaN_js__WEBPACK_IMPORTED_MODULE_1__["default"], index, true);
  107816. }
  107817. /* harmony default export */ __webpack_exports__["default"] = (lastIndexOf);
  107818. /***/ }),
  107819. /***/ "./node_modules/lodash-es/lodash.default.js":
  107820. /*!**************************************************!*\
  107821. !*** ./node_modules/lodash-es/lodash.default.js ***!
  107822. \**************************************************/
  107823. /*! exports provided: default */
  107824. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  107825. "use strict";
  107826. __webpack_require__.r(__webpack_exports__);
  107827. /* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./array.js */ "./node_modules/lodash-es/array.js");
  107828. /* harmony import */ var _collection_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./collection.js */ "./node_modules/lodash-es/collection.js");
  107829. /* harmony import */ var _date_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./date.js */ "./node_modules/lodash-es/date.js");
  107830. /* harmony import */ var _function_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./function.js */ "./node_modules/lodash-es/function.js");
  107831. /* harmony import */ var _lang_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lang.js */ "./node_modules/lodash-es/lang.js");
  107832. /* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./math.js */ "./node_modules/lodash-es/math.js");
  107833. /* harmony import */ var _number_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./number.js */ "./node_modules/lodash-es/number.js");
  107834. /* harmony import */ var _object_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./object.js */ "./node_modules/lodash-es/object.js");
  107835. /* harmony import */ var _seq_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./seq.js */ "./node_modules/lodash-es/seq.js");
  107836. /* harmony import */ var _string_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./string.js */ "./node_modules/lodash-es/string.js");
  107837. /* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./util.js */ "./node_modules/lodash-es/util.js");
  107838. /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
  107839. /* harmony import */ var _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./_LodashWrapper.js */ "./node_modules/lodash-es/_LodashWrapper.js");
  107840. /* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
  107841. /* harmony import */ var _arrayEach_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./_arrayEach.js */ "./node_modules/lodash-es/_arrayEach.js");
  107842. /* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./_arrayPush.js */ "./node_modules/lodash-es/_arrayPush.js");
  107843. /* harmony import */ var _baseForOwn_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./_baseForOwn.js */ "./node_modules/lodash-es/_baseForOwn.js");
  107844. /* harmony import */ var _baseFunctions_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./_baseFunctions.js */ "./node_modules/lodash-es/_baseFunctions.js");
  107845. /* harmony import */ var _baseInvoke_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./_baseInvoke.js */ "./node_modules/lodash-es/_baseInvoke.js");
  107846. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  107847. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  107848. /* harmony import */ var _createHybrid_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./_createHybrid.js */ "./node_modules/lodash-es/_createHybrid.js");
  107849. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  107850. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  107851. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  107852. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  107853. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  107854. /* harmony import */ var _lazyClone_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./_lazyClone.js */ "./node_modules/lodash-es/_lazyClone.js");
  107855. /* harmony import */ var _lazyReverse_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./_lazyReverse.js */ "./node_modules/lodash-es/_lazyReverse.js");
  107856. /* harmony import */ var _lazyValue_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./_lazyValue.js */ "./node_modules/lodash-es/_lazyValue.js");
  107857. /* harmony import */ var _mixin_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./mixin.js */ "./node_modules/lodash-es/mixin.js");
  107858. /* harmony import */ var _negate_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./negate.js */ "./node_modules/lodash-es/negate.js");
  107859. /* harmony import */ var _realNames_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./_realNames.js */ "./node_modules/lodash-es/_realNames.js");
  107860. /* harmony import */ var _thru_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./thru.js */ "./node_modules/lodash-es/thru.js");
  107861. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  107862. /* harmony import */ var _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./wrapperLodash.js */ "./node_modules/lodash-es/wrapperLodash.js");
  107863. /**
  107864. * @license
  107865. * Lodash (Custom Build) <https://lodash.com/>
  107866. * Build: `lodash modularize exports="es" -o ./`
  107867. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  107868. * Released under MIT license <https://lodash.com/license>
  107869. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  107870. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  107871. */
  107872. /** Used as the semantic version number. */
  107873. var VERSION = '4.17.21';
  107874. /** Used to compose bitmasks for function metadata. */
  107875. var WRAP_BIND_KEY_FLAG = 2;
  107876. /** Used to indicate the type of lazy iteratees. */
  107877. var LAZY_FILTER_FLAG = 1,
  107878. LAZY_WHILE_FLAG = 3;
  107879. /** Used as references for the maximum length and index of an array. */
  107880. var MAX_ARRAY_LENGTH = 4294967295;
  107881. /** Used for built-in method references. */
  107882. var arrayProto = Array.prototype,
  107883. objectProto = Object.prototype;
  107884. /** Used to check objects for own properties. */
  107885. var hasOwnProperty = objectProto.hasOwnProperty;
  107886. /** Built-in value references. */
  107887. var symIterator = _Symbol_js__WEBPACK_IMPORTED_MODULE_13__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_13__["default"].iterator : undefined;
  107888. /* Built-in method references for those with the same name as other `lodash` methods. */
  107889. var nativeMax = Math.max,
  107890. nativeMin = Math.min;
  107891. // wrap `_.mixin` so it works when provided only one argument
  107892. var mixin = (function(func) {
  107893. return function(object, source, options) {
  107894. if (options == null) {
  107895. var isObj = Object(_isObject_js__WEBPACK_IMPORTED_MODULE_24__["default"])(source),
  107896. props = isObj && Object(_keys_js__WEBPACK_IMPORTED_MODULE_25__["default"])(source),
  107897. methodNames = props && props.length && Object(_baseFunctions_js__WEBPACK_IMPORTED_MODULE_17__["default"])(source, props);
  107898. if (!(methodNames ? methodNames.length : isObj)) {
  107899. options = source;
  107900. source = object;
  107901. object = this;
  107902. }
  107903. }
  107904. return func(object, source, options);
  107905. };
  107906. }(_mixin_js__WEBPACK_IMPORTED_MODULE_30__["default"]));
  107907. // Add methods that return wrapped values in chain sequences.
  107908. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].after = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].after;
  107909. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].ary = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].ary;
  107910. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].assign = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].assign;
  107911. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].assignIn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].assignIn;
  107912. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].assignInWith = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].assignInWith;
  107913. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].assignWith = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].assignWith;
  107914. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].at = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].at;
  107915. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].before = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].before;
  107916. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].bind = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].bind;
  107917. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].bindAll = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].bindAll;
  107918. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].bindKey = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].bindKey;
  107919. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].castArray = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].castArray;
  107920. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].chain = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].chain;
  107921. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].chunk = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].chunk;
  107922. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].compact = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].compact;
  107923. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].concat = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].concat;
  107924. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].cond = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].cond;
  107925. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].conforms = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].conforms;
  107926. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].constant = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].constant;
  107927. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].countBy = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].countBy;
  107928. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].create = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].create;
  107929. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].curry = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].curry;
  107930. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].curryRight = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].curryRight;
  107931. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].debounce = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].debounce;
  107932. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].defaults = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].defaults;
  107933. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].defaultsDeep = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].defaultsDeep;
  107934. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].defer = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].defer;
  107935. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].delay = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].delay;
  107936. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].difference = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].difference;
  107937. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].differenceBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].differenceBy;
  107938. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].differenceWith = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].differenceWith;
  107939. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].drop = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].drop;
  107940. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].dropRight = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].dropRight;
  107941. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].dropRightWhile = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].dropRightWhile;
  107942. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].dropWhile = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].dropWhile;
  107943. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].fill = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].fill;
  107944. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].filter = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].filter;
  107945. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flatMap = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].flatMap;
  107946. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flatMapDeep = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].flatMapDeep;
  107947. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flatMapDepth = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].flatMapDepth;
  107948. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flatten = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].flatten;
  107949. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flattenDeep = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].flattenDeep;
  107950. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flattenDepth = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].flattenDepth;
  107951. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flip = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].flip;
  107952. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flow = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].flow;
  107953. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].flowRight = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].flowRight;
  107954. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].fromPairs = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].fromPairs;
  107955. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].functions = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].functions;
  107956. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].functionsIn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].functionsIn;
  107957. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].groupBy = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].groupBy;
  107958. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].initial = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].initial;
  107959. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].intersection = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].intersection;
  107960. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].intersectionBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].intersectionBy;
  107961. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].intersectionWith = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].intersectionWith;
  107962. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].invert = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].invert;
  107963. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].invertBy = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].invertBy;
  107964. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].invokeMap = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].invokeMap;
  107965. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].iteratee = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].iteratee;
  107966. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].keyBy = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].keyBy;
  107967. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].keys = _keys_js__WEBPACK_IMPORTED_MODULE_25__["default"];
  107968. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].keysIn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].keysIn;
  107969. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].map = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].map;
  107970. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].mapKeys = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].mapKeys;
  107971. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].mapValues = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].mapValues;
  107972. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].matches = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].matches;
  107973. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].matchesProperty = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].matchesProperty;
  107974. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].memoize = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].memoize;
  107975. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].merge = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].merge;
  107976. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].mergeWith = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].mergeWith;
  107977. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].method = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].method;
  107978. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].methodOf = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].methodOf;
  107979. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].mixin = mixin;
  107980. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].negate = _negate_js__WEBPACK_IMPORTED_MODULE_31__["default"];
  107981. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].nthArg = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].nthArg;
  107982. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].omit = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].omit;
  107983. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].omitBy = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].omitBy;
  107984. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].once = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].once;
  107985. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].orderBy = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].orderBy;
  107986. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].over = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].over;
  107987. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].overArgs = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].overArgs;
  107988. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].overEvery = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].overEvery;
  107989. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].overSome = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].overSome;
  107990. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].partial = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].partial;
  107991. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].partialRight = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].partialRight;
  107992. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].partition = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].partition;
  107993. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].pick = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].pick;
  107994. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].pickBy = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].pickBy;
  107995. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].property = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].property;
  107996. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].propertyOf = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].propertyOf;
  107997. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].pull = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].pull;
  107998. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].pullAll = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].pullAll;
  107999. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].pullAllBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].pullAllBy;
  108000. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].pullAllWith = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].pullAllWith;
  108001. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].pullAt = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].pullAt;
  108002. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].range = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].range;
  108003. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].rangeRight = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].rangeRight;
  108004. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].rearg = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].rearg;
  108005. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].reject = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].reject;
  108006. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].remove = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].remove;
  108007. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].rest = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].rest;
  108008. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].reverse = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].reverse;
  108009. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sampleSize = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].sampleSize;
  108010. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].set = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].set;
  108011. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].setWith = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].setWith;
  108012. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].shuffle = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].shuffle;
  108013. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].slice = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].slice;
  108014. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortBy = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].sortBy;
  108015. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortedUniq = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].sortedUniq;
  108016. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortedUniqBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].sortedUniqBy;
  108017. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].split = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].split;
  108018. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].spread = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].spread;
  108019. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].tail = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].tail;
  108020. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].take = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].take;
  108021. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].takeRight = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].takeRight;
  108022. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].takeRightWhile = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].takeRightWhile;
  108023. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].takeWhile = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].takeWhile;
  108024. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].tap = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].tap;
  108025. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].throttle = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].throttle;
  108026. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].thru = _thru_js__WEBPACK_IMPORTED_MODULE_33__["default"];
  108027. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toArray = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].toArray;
  108028. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toPairs = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].toPairs;
  108029. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toPairsIn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].toPairsIn;
  108030. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toPath = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].toPath;
  108031. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toPlainObject = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].toPlainObject;
  108032. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].transform = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].transform;
  108033. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].unary = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].unary;
  108034. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].union = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].union;
  108035. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].unionBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].unionBy;
  108036. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].unionWith = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].unionWith;
  108037. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].uniq = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].uniq;
  108038. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].uniqBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].uniqBy;
  108039. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].uniqWith = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].uniqWith;
  108040. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].unset = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].unset;
  108041. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].unzip = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].unzip;
  108042. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].unzipWith = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].unzipWith;
  108043. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].update = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].update;
  108044. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].updateWith = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].updateWith;
  108045. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].values = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].values;
  108046. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].valuesIn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].valuesIn;
  108047. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].without = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].without;
  108048. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].words = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].words;
  108049. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].wrap = _function_js__WEBPACK_IMPORTED_MODULE_3__["default"].wrap;
  108050. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].xor = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].xor;
  108051. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].xorBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].xorBy;
  108052. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].xorWith = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].xorWith;
  108053. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].zip = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].zip;
  108054. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].zipObject = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].zipObject;
  108055. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].zipObjectDeep = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].zipObjectDeep;
  108056. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].zipWith = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].zipWith;
  108057. // Add aliases.
  108058. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].entries = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].toPairs;
  108059. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].entriesIn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].toPairsIn;
  108060. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].extend = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].assignIn;
  108061. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].extendWith = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].assignInWith;
  108062. // Add methods to `lodash.prototype`.
  108063. mixin(_wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"], _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"]);
  108064. // Add methods that return unwrapped values in chain sequences.
  108065. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].add = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].add;
  108066. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].attempt = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].attempt;
  108067. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].camelCase = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].camelCase;
  108068. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].capitalize = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].capitalize;
  108069. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].ceil = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].ceil;
  108070. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].clamp = _number_js__WEBPACK_IMPORTED_MODULE_6__["default"].clamp;
  108071. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].clone = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].clone;
  108072. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].cloneDeep = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].cloneDeep;
  108073. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].cloneDeepWith = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].cloneDeepWith;
  108074. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].cloneWith = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].cloneWith;
  108075. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].conformsTo = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].conformsTo;
  108076. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].deburr = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].deburr;
  108077. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].defaultTo = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].defaultTo;
  108078. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].divide = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].divide;
  108079. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].endsWith = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].endsWith;
  108080. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].eq = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].eq;
  108081. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].escape = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].escape;
  108082. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].escapeRegExp = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].escapeRegExp;
  108083. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].every = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].every;
  108084. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].find = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].find;
  108085. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].findIndex = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].findIndex;
  108086. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].findKey = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].findKey;
  108087. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].findLast = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].findLast;
  108088. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].findLastIndex = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].findLastIndex;
  108089. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].findLastKey = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].findLastKey;
  108090. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].floor = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].floor;
  108091. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].forEach = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].forEach;
  108092. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].forEachRight = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].forEachRight;
  108093. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].forIn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].forIn;
  108094. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].forInRight = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].forInRight;
  108095. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].forOwn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].forOwn;
  108096. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].forOwnRight = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].forOwnRight;
  108097. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].get = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].get;
  108098. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].gt = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].gt;
  108099. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].gte = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].gte;
  108100. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].has = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].has;
  108101. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].hasIn = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].hasIn;
  108102. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].head = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].head;
  108103. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].identity = _identity_js__WEBPACK_IMPORTED_MODULE_22__["default"];
  108104. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].includes = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].includes;
  108105. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].indexOf = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].indexOf;
  108106. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].inRange = _number_js__WEBPACK_IMPORTED_MODULE_6__["default"].inRange;
  108107. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].invoke = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].invoke;
  108108. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isArguments = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isArguments;
  108109. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isArray = _isArray_js__WEBPACK_IMPORTED_MODULE_23__["default"];
  108110. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isArrayBuffer = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isArrayBuffer;
  108111. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isArrayLike = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isArrayLike;
  108112. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isArrayLikeObject = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isArrayLikeObject;
  108113. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isBoolean = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isBoolean;
  108114. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isBuffer = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isBuffer;
  108115. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isDate = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isDate;
  108116. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isElement = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isElement;
  108117. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isEmpty = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isEmpty;
  108118. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isEqual = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isEqual;
  108119. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isEqualWith = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isEqualWith;
  108120. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isError = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isError;
  108121. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isFinite = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isFinite;
  108122. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isFunction = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isFunction;
  108123. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isInteger = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isInteger;
  108124. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isLength = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isLength;
  108125. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isMap = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isMap;
  108126. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isMatch = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isMatch;
  108127. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isMatchWith = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isMatchWith;
  108128. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isNaN = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isNaN;
  108129. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isNative = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isNative;
  108130. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isNil = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isNil;
  108131. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isNull = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isNull;
  108132. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isNumber = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isNumber;
  108133. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isObject = _isObject_js__WEBPACK_IMPORTED_MODULE_24__["default"];
  108134. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isObjectLike = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isObjectLike;
  108135. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isPlainObject = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isPlainObject;
  108136. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isRegExp = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isRegExp;
  108137. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isSafeInteger = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isSafeInteger;
  108138. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isSet = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isSet;
  108139. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isString = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isString;
  108140. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isSymbol = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isSymbol;
  108141. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isTypedArray = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isTypedArray;
  108142. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isUndefined = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isUndefined;
  108143. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isWeakMap = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isWeakMap;
  108144. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].isWeakSet = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].isWeakSet;
  108145. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].join = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].join;
  108146. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].kebabCase = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].kebabCase;
  108147. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].last = _last_js__WEBPACK_IMPORTED_MODULE_26__["default"];
  108148. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].lastIndexOf = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].lastIndexOf;
  108149. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].lowerCase = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].lowerCase;
  108150. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].lowerFirst = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].lowerFirst;
  108151. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].lt = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].lt;
  108152. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].lte = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].lte;
  108153. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].max = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].max;
  108154. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].maxBy = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].maxBy;
  108155. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].mean = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].mean;
  108156. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].meanBy = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].meanBy;
  108157. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].min = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].min;
  108158. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].minBy = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].minBy;
  108159. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].stubArray = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].stubArray;
  108160. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].stubFalse = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].stubFalse;
  108161. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].stubObject = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].stubObject;
  108162. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].stubString = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].stubString;
  108163. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].stubTrue = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].stubTrue;
  108164. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].multiply = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].multiply;
  108165. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].nth = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].nth;
  108166. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].noop = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].noop;
  108167. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].now = _date_js__WEBPACK_IMPORTED_MODULE_2__["default"].now;
  108168. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].pad = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].pad;
  108169. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].padEnd = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].padEnd;
  108170. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].padStart = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].padStart;
  108171. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].parseInt = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].parseInt;
  108172. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].random = _number_js__WEBPACK_IMPORTED_MODULE_6__["default"].random;
  108173. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].reduce = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].reduce;
  108174. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].reduceRight = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].reduceRight;
  108175. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].repeat = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].repeat;
  108176. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].replace = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].replace;
  108177. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].result = _object_js__WEBPACK_IMPORTED_MODULE_7__["default"].result;
  108178. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].round = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].round;
  108179. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sample = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].sample;
  108180. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].size = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].size;
  108181. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].snakeCase = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].snakeCase;
  108182. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].some = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].some;
  108183. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortedIndex = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].sortedIndex;
  108184. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortedIndexBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].sortedIndexBy;
  108185. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortedIndexOf = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].sortedIndexOf;
  108186. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortedLastIndex = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].sortedLastIndex;
  108187. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortedLastIndexBy = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].sortedLastIndexBy;
  108188. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sortedLastIndexOf = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].sortedLastIndexOf;
  108189. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].startCase = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].startCase;
  108190. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].startsWith = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].startsWith;
  108191. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].subtract = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].subtract;
  108192. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sum = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].sum;
  108193. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].sumBy = _math_js__WEBPACK_IMPORTED_MODULE_5__["default"].sumBy;
  108194. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].template = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].template;
  108195. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].times = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].times;
  108196. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toFinite = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].toFinite;
  108197. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toInteger = _toInteger_js__WEBPACK_IMPORTED_MODULE_34__["default"];
  108198. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toLength = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].toLength;
  108199. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toLower = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].toLower;
  108200. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toNumber = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].toNumber;
  108201. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toSafeInteger = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].toSafeInteger;
  108202. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toString = _lang_js__WEBPACK_IMPORTED_MODULE_4__["default"].toString;
  108203. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].toUpper = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].toUpper;
  108204. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].trim = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].trim;
  108205. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].trimEnd = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].trimEnd;
  108206. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].trimStart = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].trimStart;
  108207. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].truncate = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].truncate;
  108208. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].unescape = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].unescape;
  108209. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].uniqueId = _util_js__WEBPACK_IMPORTED_MODULE_10__["default"].uniqueId;
  108210. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].upperCase = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].upperCase;
  108211. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].upperFirst = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].upperFirst;
  108212. // Add aliases.
  108213. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].each = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].forEach;
  108214. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].eachRight = _collection_js__WEBPACK_IMPORTED_MODULE_1__["default"].forEachRight;
  108215. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].first = _array_js__WEBPACK_IMPORTED_MODULE_0__["default"].head;
  108216. mixin(_wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"], (function() {
  108217. var source = {};
  108218. Object(_baseForOwn_js__WEBPACK_IMPORTED_MODULE_16__["default"])(_wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"], function(func, methodName) {
  108219. if (!hasOwnProperty.call(_wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype, methodName)) {
  108220. source[methodName] = func;
  108221. }
  108222. });
  108223. return source;
  108224. }()), { 'chain': false });
  108225. /**
  108226. * The semantic version number.
  108227. *
  108228. * @static
  108229. * @memberOf _
  108230. * @type {string}
  108231. */
  108232. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].VERSION = VERSION;
  108233. (_wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].templateSettings = _string_js__WEBPACK_IMPORTED_MODULE_9__["default"].templateSettings).imports._ = _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"];
  108234. // Assign default placeholders.
  108235. Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_14__["default"])(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  108236. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"][methodName].placeholder = _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"];
  108237. });
  108238. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  108239. Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_14__["default"])(['drop', 'take'], function(methodName, index) {
  108240. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype[methodName] = function(n) {
  108241. n = n === undefined ? 1 : nativeMax(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_34__["default"])(n), 0);
  108242. var result = (this.__filtered__ && !index)
  108243. ? new _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"](this)
  108244. : this.clone();
  108245. if (result.__filtered__) {
  108246. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  108247. } else {
  108248. result.__views__.push({
  108249. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  108250. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  108251. });
  108252. }
  108253. return result;
  108254. };
  108255. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype[methodName + 'Right'] = function(n) {
  108256. return this.reverse()[methodName](n).reverse();
  108257. };
  108258. });
  108259. // Add `LazyWrapper` methods that accept an `iteratee` value.
  108260. Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_14__["default"])(['filter', 'map', 'takeWhile'], function(methodName, index) {
  108261. var type = index + 1,
  108262. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  108263. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype[methodName] = function(iteratee) {
  108264. var result = this.clone();
  108265. result.__iteratees__.push({
  108266. 'iteratee': Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_19__["default"])(iteratee, 3),
  108267. 'type': type
  108268. });
  108269. result.__filtered__ = result.__filtered__ || isFilter;
  108270. return result;
  108271. };
  108272. });
  108273. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  108274. Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_14__["default"])(['head', 'last'], function(methodName, index) {
  108275. var takeName = 'take' + (index ? 'Right' : '');
  108276. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype[methodName] = function() {
  108277. return this[takeName](1).value()[0];
  108278. };
  108279. });
  108280. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  108281. Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_14__["default"])(['initial', 'tail'], function(methodName, index) {
  108282. var dropName = 'drop' + (index ? '' : 'Right');
  108283. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype[methodName] = function() {
  108284. return this.__filtered__ ? new _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"](this) : this[dropName](1);
  108285. };
  108286. });
  108287. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.compact = function() {
  108288. return this.filter(_identity_js__WEBPACK_IMPORTED_MODULE_22__["default"]);
  108289. };
  108290. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.find = function(predicate) {
  108291. return this.filter(predicate).head();
  108292. };
  108293. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.findLast = function(predicate) {
  108294. return this.reverse().find(predicate);
  108295. };
  108296. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.invokeMap = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_20__["default"])(function(path, args) {
  108297. if (typeof path == 'function') {
  108298. return new _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"](this);
  108299. }
  108300. return this.map(function(value) {
  108301. return Object(_baseInvoke_js__WEBPACK_IMPORTED_MODULE_18__["default"])(value, path, args);
  108302. });
  108303. });
  108304. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.reject = function(predicate) {
  108305. return this.filter(Object(_negate_js__WEBPACK_IMPORTED_MODULE_31__["default"])(Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_19__["default"])(predicate)));
  108306. };
  108307. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.slice = function(start, end) {
  108308. start = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_34__["default"])(start);
  108309. var result = this;
  108310. if (result.__filtered__ && (start > 0 || end < 0)) {
  108311. return new _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"](result);
  108312. }
  108313. if (start < 0) {
  108314. result = result.takeRight(-start);
  108315. } else if (start) {
  108316. result = result.drop(start);
  108317. }
  108318. if (end !== undefined) {
  108319. end = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_34__["default"])(end);
  108320. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  108321. }
  108322. return result;
  108323. };
  108324. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.takeRightWhile = function(predicate) {
  108325. return this.reverse().takeWhile(predicate).reverse();
  108326. };
  108327. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.toArray = function() {
  108328. return this.take(MAX_ARRAY_LENGTH);
  108329. };
  108330. // Add `LazyWrapper` methods to `lodash.prototype`.
  108331. Object(_baseForOwn_js__WEBPACK_IMPORTED_MODULE_16__["default"])(_LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype, function(func, methodName) {
  108332. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  108333. isTaker = /^(?:head|last)$/.test(methodName),
  108334. lodashFunc = _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"][isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  108335. retUnwrapped = isTaker || /^find/.test(methodName);
  108336. if (!lodashFunc) {
  108337. return;
  108338. }
  108339. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype[methodName] = function() {
  108340. var value = this.__wrapped__,
  108341. args = isTaker ? [1] : arguments,
  108342. isLazy = value instanceof _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"],
  108343. iteratee = args[0],
  108344. useLazy = isLazy || Object(_isArray_js__WEBPACK_IMPORTED_MODULE_23__["default"])(value);
  108345. var interceptor = function(value) {
  108346. var result = lodashFunc.apply(_wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"], Object(_arrayPush_js__WEBPACK_IMPORTED_MODULE_15__["default"])([value], args));
  108347. return (isTaker && chainAll) ? result[0] : result;
  108348. };
  108349. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  108350. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  108351. isLazy = useLazy = false;
  108352. }
  108353. var chainAll = this.__chain__,
  108354. isHybrid = !!this.__actions__.length,
  108355. isUnwrapped = retUnwrapped && !chainAll,
  108356. onlyLazy = isLazy && !isHybrid;
  108357. if (!retUnwrapped && useLazy) {
  108358. value = onlyLazy ? value : new _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"](this);
  108359. var result = func.apply(value, args);
  108360. result.__actions__.push({ 'func': _thru_js__WEBPACK_IMPORTED_MODULE_33__["default"], 'args': [interceptor], 'thisArg': undefined });
  108361. return new _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_12__["default"](result, chainAll);
  108362. }
  108363. if (isUnwrapped && onlyLazy) {
  108364. return func.apply(this, args);
  108365. }
  108366. result = this.thru(interceptor);
  108367. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  108368. };
  108369. });
  108370. // Add `Array` methods to `lodash.prototype`.
  108371. Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_14__["default"])(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  108372. var func = arrayProto[methodName],
  108373. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  108374. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  108375. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype[methodName] = function() {
  108376. var args = arguments;
  108377. if (retUnwrapped && !this.__chain__) {
  108378. var value = this.value();
  108379. return func.apply(Object(_isArray_js__WEBPACK_IMPORTED_MODULE_23__["default"])(value) ? value : [], args);
  108380. }
  108381. return this[chainName](function(value) {
  108382. return func.apply(Object(_isArray_js__WEBPACK_IMPORTED_MODULE_23__["default"])(value) ? value : [], args);
  108383. });
  108384. };
  108385. });
  108386. // Map minified method names to their real names.
  108387. Object(_baseForOwn_js__WEBPACK_IMPORTED_MODULE_16__["default"])(_LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype, function(func, methodName) {
  108388. var lodashFunc = _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"][methodName];
  108389. if (lodashFunc) {
  108390. var key = lodashFunc.name + '';
  108391. if (!hasOwnProperty.call(_realNames_js__WEBPACK_IMPORTED_MODULE_32__["default"], key)) {
  108392. _realNames_js__WEBPACK_IMPORTED_MODULE_32__["default"][key] = [];
  108393. }
  108394. _realNames_js__WEBPACK_IMPORTED_MODULE_32__["default"][key].push({ 'name': methodName, 'func': lodashFunc });
  108395. }
  108396. });
  108397. _realNames_js__WEBPACK_IMPORTED_MODULE_32__["default"][Object(_createHybrid_js__WEBPACK_IMPORTED_MODULE_21__["default"])(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  108398. 'name': 'wrapper',
  108399. 'func': undefined
  108400. }];
  108401. // Add methods to `LazyWrapper`.
  108402. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.clone = _lazyClone_js__WEBPACK_IMPORTED_MODULE_27__["default"];
  108403. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.reverse = _lazyReverse_js__WEBPACK_IMPORTED_MODULE_28__["default"];
  108404. _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_11__["default"].prototype.value = _lazyValue_js__WEBPACK_IMPORTED_MODULE_29__["default"];
  108405. // Add chain sequence methods to the `lodash` wrapper.
  108406. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.at = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].at;
  108407. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.chain = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].wrapperChain;
  108408. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.commit = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].commit;
  108409. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.next = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].next;
  108410. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.plant = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].plant;
  108411. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.reverse = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].reverse;
  108412. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.toJSON = _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.valueOf = _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.value = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].value;
  108413. // Add lazy aliases.
  108414. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.first = _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype.head;
  108415. if (symIterator) {
  108416. _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"].prototype[symIterator] = _seq_js__WEBPACK_IMPORTED_MODULE_8__["default"].toIterator;
  108417. }
  108418. /* harmony default export */ __webpack_exports__["default"] = (_wrapperLodash_js__WEBPACK_IMPORTED_MODULE_35__["default"]);
  108419. /***/ }),
  108420. /***/ "./node_modules/lodash-es/lodash.js":
  108421. /*!******************************************!*\
  108422. !*** ./node_modules/lodash-es/lodash.js ***!
  108423. \******************************************/
  108424. /*! exports provided: add, after, ary, assign, assignIn, assignInWith, assignWith, at, attempt, before, bind, bindAll, bindKey, camelCase, capitalize, castArray, ceil, chain, chunk, clamp, clone, cloneDeep, cloneDeepWith, cloneWith, commit, compact, concat, cond, conforms, conformsTo, constant, countBy, create, curry, curryRight, debounce, deburr, defaultTo, defaults, defaultsDeep, defer, delay, difference, differenceBy, differenceWith, divide, drop, dropRight, dropRightWhile, dropWhile, each, eachRight, endsWith, entries, entriesIn, eq, escape, escapeRegExp, every, extend, extendWith, fill, filter, find, findIndex, findKey, findLast, findLastIndex, findLastKey, first, flatMap, flatMapDeep, flatMapDepth, flatten, flattenDeep, flattenDepth, flip, floor, flow, flowRight, forEach, forEachRight, forIn, forInRight, forOwn, forOwnRight, fromPairs, functions, functionsIn, get, groupBy, gt, gte, has, hasIn, head, identity, inRange, includes, indexOf, initial, intersection, intersectionBy, intersectionWith, invert, invertBy, invoke, invokeMap, isArguments, isArray, isArrayBuffer, isArrayLike, isArrayLikeObject, isBoolean, isBuffer, isDate, isElement, isEmpty, isEqual, isEqualWith, isError, isFinite, isFunction, isInteger, isLength, isMap, isMatch, isMatchWith, isNaN, isNative, isNil, isNull, isNumber, isObject, isObjectLike, isPlainObject, isRegExp, isSafeInteger, isSet, isString, isSymbol, isTypedArray, isUndefined, isWeakMap, isWeakSet, iteratee, join, kebabCase, keyBy, keys, keysIn, last, lastIndexOf, lodash, lowerCase, lowerFirst, lt, lte, map, mapKeys, mapValues, matches, matchesProperty, max, maxBy, mean, meanBy, memoize, merge, mergeWith, method, methodOf, min, minBy, mixin, multiply, negate, next, noop, now, nth, nthArg, omit, omitBy, once, orderBy, over, overArgs, overEvery, overSome, pad, padEnd, padStart, parseInt, partial, partialRight, partition, pick, pickBy, plant, property, propertyOf, pull, pullAll, pullAllBy, pullAllWith, pullAt, random, range, rangeRight, rearg, reduce, reduceRight, reject, remove, repeat, replace, rest, result, reverse, round, sample, sampleSize, set, setWith, shuffle, size, slice, snakeCase, some, sortBy, sortedIndex, sortedIndexBy, sortedIndexOf, sortedLastIndex, sortedLastIndexBy, sortedLastIndexOf, sortedUniq, sortedUniqBy, split, spread, startCase, startsWith, stubArray, stubFalse, stubObject, stubString, stubTrue, subtract, sum, sumBy, tail, take, takeRight, takeRightWhile, takeWhile, tap, template, templateSettings, throttle, thru, times, toArray, toFinite, toInteger, toIterator, toJSON, toLength, toLower, toNumber, toPairs, toPairsIn, toPath, toPlainObject, toSafeInteger, toString, toUpper, transform, trim, trimEnd, trimStart, truncate, unary, unescape, union, unionBy, unionWith, uniq, uniqBy, uniqWith, uniqueId, unset, unzip, unzipWith, update, updateWith, upperCase, upperFirst, value, valueOf, values, valuesIn, without, words, wrap, wrapperAt, wrapperChain, wrapperCommit, wrapperLodash, wrapperNext, wrapperPlant, wrapperReverse, wrapperToIterator, wrapperValue, xor, xorBy, xorWith, zip, zipObject, zipObjectDeep, zipWith, default */
  108425. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108426. "use strict";
  108427. __webpack_require__.r(__webpack_exports__);
  108428. /* harmony import */ var _add_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./add.js */ "./node_modules/lodash-es/add.js");
  108429. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "add", function() { return _add_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  108430. /* harmony import */ var _after_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./after.js */ "./node_modules/lodash-es/after.js");
  108431. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "after", function() { return _after_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  108432. /* harmony import */ var _ary_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ary.js */ "./node_modules/lodash-es/ary.js");
  108433. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ary", function() { return _ary_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  108434. /* harmony import */ var _assign_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./assign.js */ "./node_modules/lodash-es/assign.js");
  108435. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assign", function() { return _assign_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  108436. /* harmony import */ var _assignIn_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./assignIn.js */ "./node_modules/lodash-es/assignIn.js");
  108437. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assignIn", function() { return _assignIn_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  108438. /* harmony import */ var _assignInWith_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./assignInWith.js */ "./node_modules/lodash-es/assignInWith.js");
  108439. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assignInWith", function() { return _assignInWith_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  108440. /* harmony import */ var _assignWith_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./assignWith.js */ "./node_modules/lodash-es/assignWith.js");
  108441. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assignWith", function() { return _assignWith_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  108442. /* harmony import */ var _at_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./at.js */ "./node_modules/lodash-es/at.js");
  108443. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "at", function() { return _at_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  108444. /* harmony import */ var _attempt_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./attempt.js */ "./node_modules/lodash-es/attempt.js");
  108445. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "attempt", function() { return _attempt_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  108446. /* harmony import */ var _before_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./before.js */ "./node_modules/lodash-es/before.js");
  108447. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "before", function() { return _before_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  108448. /* harmony import */ var _bind_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./bind.js */ "./node_modules/lodash-es/bind.js");
  108449. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bind", function() { return _bind_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  108450. /* harmony import */ var _bindAll_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./bindAll.js */ "./node_modules/lodash-es/bindAll.js");
  108451. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bindAll", function() { return _bindAll_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  108452. /* harmony import */ var _bindKey_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./bindKey.js */ "./node_modules/lodash-es/bindKey.js");
  108453. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bindKey", function() { return _bindKey_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  108454. /* harmony import */ var _camelCase_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./camelCase.js */ "./node_modules/lodash-es/camelCase.js");
  108455. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "camelCase", function() { return _camelCase_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  108456. /* harmony import */ var _capitalize_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./capitalize.js */ "./node_modules/lodash-es/capitalize.js");
  108457. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "capitalize", function() { return _capitalize_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  108458. /* harmony import */ var _castArray_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./castArray.js */ "./node_modules/lodash-es/castArray.js");
  108459. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "castArray", function() { return _castArray_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
  108460. /* harmony import */ var _ceil_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./ceil.js */ "./node_modules/lodash-es/ceil.js");
  108461. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ceil", function() { return _ceil_js__WEBPACK_IMPORTED_MODULE_16__["default"]; });
  108462. /* harmony import */ var _chain_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./chain.js */ "./node_modules/lodash-es/chain.js");
  108463. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "chain", function() { return _chain_js__WEBPACK_IMPORTED_MODULE_17__["default"]; });
  108464. /* harmony import */ var _chunk_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./chunk.js */ "./node_modules/lodash-es/chunk.js");
  108465. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "chunk", function() { return _chunk_js__WEBPACK_IMPORTED_MODULE_18__["default"]; });
  108466. /* harmony import */ var _clamp_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./clamp.js */ "./node_modules/lodash-es/clamp.js");
  108467. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "clamp", function() { return _clamp_js__WEBPACK_IMPORTED_MODULE_19__["default"]; });
  108468. /* harmony import */ var _clone_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./clone.js */ "./node_modules/lodash-es/clone.js");
  108469. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return _clone_js__WEBPACK_IMPORTED_MODULE_20__["default"]; });
  108470. /* harmony import */ var _cloneDeep_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./cloneDeep.js */ "./node_modules/lodash-es/cloneDeep.js");
  108471. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cloneDeep", function() { return _cloneDeep_js__WEBPACK_IMPORTED_MODULE_21__["default"]; });
  108472. /* harmony import */ var _cloneDeepWith_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./cloneDeepWith.js */ "./node_modules/lodash-es/cloneDeepWith.js");
  108473. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cloneDeepWith", function() { return _cloneDeepWith_js__WEBPACK_IMPORTED_MODULE_22__["default"]; });
  108474. /* harmony import */ var _cloneWith_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./cloneWith.js */ "./node_modules/lodash-es/cloneWith.js");
  108475. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cloneWith", function() { return _cloneWith_js__WEBPACK_IMPORTED_MODULE_23__["default"]; });
  108476. /* harmony import */ var _commit_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./commit.js */ "./node_modules/lodash-es/commit.js");
  108477. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "commit", function() { return _commit_js__WEBPACK_IMPORTED_MODULE_24__["default"]; });
  108478. /* harmony import */ var _compact_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./compact.js */ "./node_modules/lodash-es/compact.js");
  108479. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "compact", function() { return _compact_js__WEBPACK_IMPORTED_MODULE_25__["default"]; });
  108480. /* harmony import */ var _concat_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./concat.js */ "./node_modules/lodash-es/concat.js");
  108481. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return _concat_js__WEBPACK_IMPORTED_MODULE_26__["default"]; });
  108482. /* harmony import */ var _cond_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./cond.js */ "./node_modules/lodash-es/cond.js");
  108483. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cond", function() { return _cond_js__WEBPACK_IMPORTED_MODULE_27__["default"]; });
  108484. /* harmony import */ var _conforms_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./conforms.js */ "./node_modules/lodash-es/conforms.js");
  108485. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "conforms", function() { return _conforms_js__WEBPACK_IMPORTED_MODULE_28__["default"]; });
  108486. /* harmony import */ var _conformsTo_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./conformsTo.js */ "./node_modules/lodash-es/conformsTo.js");
  108487. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "conformsTo", function() { return _conformsTo_js__WEBPACK_IMPORTED_MODULE_29__["default"]; });
  108488. /* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./constant.js */ "./node_modules/lodash-es/constant.js");
  108489. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "constant", function() { return _constant_js__WEBPACK_IMPORTED_MODULE_30__["default"]; });
  108490. /* harmony import */ var _countBy_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./countBy.js */ "./node_modules/lodash-es/countBy.js");
  108491. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "countBy", function() { return _countBy_js__WEBPACK_IMPORTED_MODULE_31__["default"]; });
  108492. /* harmony import */ var _create_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./create.js */ "./node_modules/lodash-es/create.js");
  108493. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "create", function() { return _create_js__WEBPACK_IMPORTED_MODULE_32__["default"]; });
  108494. /* harmony import */ var _curry_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./curry.js */ "./node_modules/lodash-es/curry.js");
  108495. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curry", function() { return _curry_js__WEBPACK_IMPORTED_MODULE_33__["default"]; });
  108496. /* harmony import */ var _curryRight_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./curryRight.js */ "./node_modules/lodash-es/curryRight.js");
  108497. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "curryRight", function() { return _curryRight_js__WEBPACK_IMPORTED_MODULE_34__["default"]; });
  108498. /* harmony import */ var _debounce_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./debounce.js */ "./node_modules/lodash-es/debounce.js");
  108499. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return _debounce_js__WEBPACK_IMPORTED_MODULE_35__["default"]; });
  108500. /* harmony import */ var _deburr_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./deburr.js */ "./node_modules/lodash-es/deburr.js");
  108501. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "deburr", function() { return _deburr_js__WEBPACK_IMPORTED_MODULE_36__["default"]; });
  108502. /* harmony import */ var _defaultTo_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./defaultTo.js */ "./node_modules/lodash-es/defaultTo.js");
  108503. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultTo", function() { return _defaultTo_js__WEBPACK_IMPORTED_MODULE_37__["default"]; });
  108504. /* harmony import */ var _defaults_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./defaults.js */ "./node_modules/lodash-es/defaults.js");
  108505. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaults", function() { return _defaults_js__WEBPACK_IMPORTED_MODULE_38__["default"]; });
  108506. /* harmony import */ var _defaultsDeep_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./defaultsDeep.js */ "./node_modules/lodash-es/defaultsDeep.js");
  108507. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultsDeep", function() { return _defaultsDeep_js__WEBPACK_IMPORTED_MODULE_39__["default"]; });
  108508. /* harmony import */ var _defer_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./defer.js */ "./node_modules/lodash-es/defer.js");
  108509. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return _defer_js__WEBPACK_IMPORTED_MODULE_40__["default"]; });
  108510. /* harmony import */ var _delay_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./delay.js */ "./node_modules/lodash-es/delay.js");
  108511. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return _delay_js__WEBPACK_IMPORTED_MODULE_41__["default"]; });
  108512. /* harmony import */ var _difference_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./difference.js */ "./node_modules/lodash-es/difference.js");
  108513. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "difference", function() { return _difference_js__WEBPACK_IMPORTED_MODULE_42__["default"]; });
  108514. /* harmony import */ var _differenceBy_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./differenceBy.js */ "./node_modules/lodash-es/differenceBy.js");
  108515. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "differenceBy", function() { return _differenceBy_js__WEBPACK_IMPORTED_MODULE_43__["default"]; });
  108516. /* harmony import */ var _differenceWith_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./differenceWith.js */ "./node_modules/lodash-es/differenceWith.js");
  108517. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "differenceWith", function() { return _differenceWith_js__WEBPACK_IMPORTED_MODULE_44__["default"]; });
  108518. /* harmony import */ var _divide_js__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./divide.js */ "./node_modules/lodash-es/divide.js");
  108519. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "divide", function() { return _divide_js__WEBPACK_IMPORTED_MODULE_45__["default"]; });
  108520. /* harmony import */ var _drop_js__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./drop.js */ "./node_modules/lodash-es/drop.js");
  108521. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "drop", function() { return _drop_js__WEBPACK_IMPORTED_MODULE_46__["default"]; });
  108522. /* harmony import */ var _dropRight_js__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./dropRight.js */ "./node_modules/lodash-es/dropRight.js");
  108523. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dropRight", function() { return _dropRight_js__WEBPACK_IMPORTED_MODULE_47__["default"]; });
  108524. /* harmony import */ var _dropRightWhile_js__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./dropRightWhile.js */ "./node_modules/lodash-es/dropRightWhile.js");
  108525. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dropRightWhile", function() { return _dropRightWhile_js__WEBPACK_IMPORTED_MODULE_48__["default"]; });
  108526. /* harmony import */ var _dropWhile_js__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./dropWhile.js */ "./node_modules/lodash-es/dropWhile.js");
  108527. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dropWhile", function() { return _dropWhile_js__WEBPACK_IMPORTED_MODULE_49__["default"]; });
  108528. /* harmony import */ var _each_js__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./each.js */ "./node_modules/lodash-es/each.js");
  108529. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "each", function() { return _each_js__WEBPACK_IMPORTED_MODULE_50__["default"]; });
  108530. /* harmony import */ var _eachRight_js__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./eachRight.js */ "./node_modules/lodash-es/eachRight.js");
  108531. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eachRight", function() { return _eachRight_js__WEBPACK_IMPORTED_MODULE_51__["default"]; });
  108532. /* harmony import */ var _endsWith_js__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./endsWith.js */ "./node_modules/lodash-es/endsWith.js");
  108533. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "endsWith", function() { return _endsWith_js__WEBPACK_IMPORTED_MODULE_52__["default"]; });
  108534. /* harmony import */ var _entries_js__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./entries.js */ "./node_modules/lodash-es/entries.js");
  108535. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "entries", function() { return _entries_js__WEBPACK_IMPORTED_MODULE_53__["default"]; });
  108536. /* harmony import */ var _entriesIn_js__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./entriesIn.js */ "./node_modules/lodash-es/entriesIn.js");
  108537. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "entriesIn", function() { return _entriesIn_js__WEBPACK_IMPORTED_MODULE_54__["default"]; });
  108538. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  108539. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "eq", function() { return _eq_js__WEBPACK_IMPORTED_MODULE_55__["default"]; });
  108540. /* harmony import */ var _escape_js__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./escape.js */ "./node_modules/lodash-es/escape.js");
  108541. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "escape", function() { return _escape_js__WEBPACK_IMPORTED_MODULE_56__["default"]; });
  108542. /* harmony import */ var _escapeRegExp_js__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ./escapeRegExp.js */ "./node_modules/lodash-es/escapeRegExp.js");
  108543. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "escapeRegExp", function() { return _escapeRegExp_js__WEBPACK_IMPORTED_MODULE_57__["default"]; });
  108544. /* harmony import */ var _every_js__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ./every.js */ "./node_modules/lodash-es/every.js");
  108545. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "every", function() { return _every_js__WEBPACK_IMPORTED_MODULE_58__["default"]; });
  108546. /* harmony import */ var _extend_js__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ./extend.js */ "./node_modules/lodash-es/extend.js");
  108547. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return _extend_js__WEBPACK_IMPORTED_MODULE_59__["default"]; });
  108548. /* harmony import */ var _extendWith_js__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ./extendWith.js */ "./node_modules/lodash-es/extendWith.js");
  108549. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "extendWith", function() { return _extendWith_js__WEBPACK_IMPORTED_MODULE_60__["default"]; });
  108550. /* harmony import */ var _fill_js__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ./fill.js */ "./node_modules/lodash-es/fill.js");
  108551. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fill", function() { return _fill_js__WEBPACK_IMPORTED_MODULE_61__["default"]; });
  108552. /* harmony import */ var _filter_js__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ./filter.js */ "./node_modules/lodash-es/filter.js");
  108553. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return _filter_js__WEBPACK_IMPORTED_MODULE_62__["default"]; });
  108554. /* harmony import */ var _find_js__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! ./find.js */ "./node_modules/lodash-es/find.js");
  108555. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "find", function() { return _find_js__WEBPACK_IMPORTED_MODULE_63__["default"]; });
  108556. /* harmony import */ var _findIndex_js__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(/*! ./findIndex.js */ "./node_modules/lodash-es/findIndex.js");
  108557. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return _findIndex_js__WEBPACK_IMPORTED_MODULE_64__["default"]; });
  108558. /* harmony import */ var _findKey_js__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(/*! ./findKey.js */ "./node_modules/lodash-es/findKey.js");
  108559. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findKey", function() { return _findKey_js__WEBPACK_IMPORTED_MODULE_65__["default"]; });
  108560. /* harmony import */ var _findLast_js__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(/*! ./findLast.js */ "./node_modules/lodash-es/findLast.js");
  108561. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findLast", function() { return _findLast_js__WEBPACK_IMPORTED_MODULE_66__["default"]; });
  108562. /* harmony import */ var _findLastIndex_js__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(/*! ./findLastIndex.js */ "./node_modules/lodash-es/findLastIndex.js");
  108563. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findLastIndex", function() { return _findLastIndex_js__WEBPACK_IMPORTED_MODULE_67__["default"]; });
  108564. /* harmony import */ var _findLastKey_js__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(/*! ./findLastKey.js */ "./node_modules/lodash-es/findLastKey.js");
  108565. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findLastKey", function() { return _findLastKey_js__WEBPACK_IMPORTED_MODULE_68__["default"]; });
  108566. /* harmony import */ var _first_js__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(/*! ./first.js */ "./node_modules/lodash-es/first.js");
  108567. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "first", function() { return _first_js__WEBPACK_IMPORTED_MODULE_69__["default"]; });
  108568. /* harmony import */ var _flatMap_js__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(/*! ./flatMap.js */ "./node_modules/lodash-es/flatMap.js");
  108569. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatMap", function() { return _flatMap_js__WEBPACK_IMPORTED_MODULE_70__["default"]; });
  108570. /* harmony import */ var _flatMapDeep_js__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(/*! ./flatMapDeep.js */ "./node_modules/lodash-es/flatMapDeep.js");
  108571. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatMapDeep", function() { return _flatMapDeep_js__WEBPACK_IMPORTED_MODULE_71__["default"]; });
  108572. /* harmony import */ var _flatMapDepth_js__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(/*! ./flatMapDepth.js */ "./node_modules/lodash-es/flatMapDepth.js");
  108573. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatMapDepth", function() { return _flatMapDepth_js__WEBPACK_IMPORTED_MODULE_72__["default"]; });
  108574. /* harmony import */ var _flatten_js__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(/*! ./flatten.js */ "./node_modules/lodash-es/flatten.js");
  108575. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return _flatten_js__WEBPACK_IMPORTED_MODULE_73__["default"]; });
  108576. /* harmony import */ var _flattenDeep_js__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(/*! ./flattenDeep.js */ "./node_modules/lodash-es/flattenDeep.js");
  108577. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flattenDeep", function() { return _flattenDeep_js__WEBPACK_IMPORTED_MODULE_74__["default"]; });
  108578. /* harmony import */ var _flattenDepth_js__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(/*! ./flattenDepth.js */ "./node_modules/lodash-es/flattenDepth.js");
  108579. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flattenDepth", function() { return _flattenDepth_js__WEBPACK_IMPORTED_MODULE_75__["default"]; });
  108580. /* harmony import */ var _flip_js__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(/*! ./flip.js */ "./node_modules/lodash-es/flip.js");
  108581. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flip", function() { return _flip_js__WEBPACK_IMPORTED_MODULE_76__["default"]; });
  108582. /* harmony import */ var _floor_js__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(/*! ./floor.js */ "./node_modules/lodash-es/floor.js");
  108583. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "floor", function() { return _floor_js__WEBPACK_IMPORTED_MODULE_77__["default"]; });
  108584. /* harmony import */ var _flow_js__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(/*! ./flow.js */ "./node_modules/lodash-es/flow.js");
  108585. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flow", function() { return _flow_js__WEBPACK_IMPORTED_MODULE_78__["default"]; });
  108586. /* harmony import */ var _flowRight_js__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(/*! ./flowRight.js */ "./node_modules/lodash-es/flowRight.js");
  108587. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flowRight", function() { return _flowRight_js__WEBPACK_IMPORTED_MODULE_79__["default"]; });
  108588. /* harmony import */ var _forEach_js__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(/*! ./forEach.js */ "./node_modules/lodash-es/forEach.js");
  108589. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return _forEach_js__WEBPACK_IMPORTED_MODULE_80__["default"]; });
  108590. /* harmony import */ var _forEachRight_js__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(/*! ./forEachRight.js */ "./node_modules/lodash-es/forEachRight.js");
  108591. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forEachRight", function() { return _forEachRight_js__WEBPACK_IMPORTED_MODULE_81__["default"]; });
  108592. /* harmony import */ var _forIn_js__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(/*! ./forIn.js */ "./node_modules/lodash-es/forIn.js");
  108593. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forIn", function() { return _forIn_js__WEBPACK_IMPORTED_MODULE_82__["default"]; });
  108594. /* harmony import */ var _forInRight_js__WEBPACK_IMPORTED_MODULE_83__ = __webpack_require__(/*! ./forInRight.js */ "./node_modules/lodash-es/forInRight.js");
  108595. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forInRight", function() { return _forInRight_js__WEBPACK_IMPORTED_MODULE_83__["default"]; });
  108596. /* harmony import */ var _forOwn_js__WEBPACK_IMPORTED_MODULE_84__ = __webpack_require__(/*! ./forOwn.js */ "./node_modules/lodash-es/forOwn.js");
  108597. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forOwn", function() { return _forOwn_js__WEBPACK_IMPORTED_MODULE_84__["default"]; });
  108598. /* harmony import */ var _forOwnRight_js__WEBPACK_IMPORTED_MODULE_85__ = __webpack_require__(/*! ./forOwnRight.js */ "./node_modules/lodash-es/forOwnRight.js");
  108599. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forOwnRight", function() { return _forOwnRight_js__WEBPACK_IMPORTED_MODULE_85__["default"]; });
  108600. /* harmony import */ var _fromPairs_js__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(/*! ./fromPairs.js */ "./node_modules/lodash-es/fromPairs.js");
  108601. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fromPairs", function() { return _fromPairs_js__WEBPACK_IMPORTED_MODULE_86__["default"]; });
  108602. /* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(/*! ./functions.js */ "./node_modules/lodash-es/functions.js");
  108603. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "functions", function() { return _functions_js__WEBPACK_IMPORTED_MODULE_87__["default"]; });
  108604. /* harmony import */ var _functionsIn_js__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(/*! ./functionsIn.js */ "./node_modules/lodash-es/functionsIn.js");
  108605. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "functionsIn", function() { return _functionsIn_js__WEBPACK_IMPORTED_MODULE_88__["default"]; });
  108606. /* harmony import */ var _get_js__WEBPACK_IMPORTED_MODULE_89__ = __webpack_require__(/*! ./get.js */ "./node_modules/lodash-es/get.js");
  108607. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "get", function() { return _get_js__WEBPACK_IMPORTED_MODULE_89__["default"]; });
  108608. /* harmony import */ var _groupBy_js__WEBPACK_IMPORTED_MODULE_90__ = __webpack_require__(/*! ./groupBy.js */ "./node_modules/lodash-es/groupBy.js");
  108609. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return _groupBy_js__WEBPACK_IMPORTED_MODULE_90__["default"]; });
  108610. /* harmony import */ var _gt_js__WEBPACK_IMPORTED_MODULE_91__ = __webpack_require__(/*! ./gt.js */ "./node_modules/lodash-es/gt.js");
  108611. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "gt", function() { return _gt_js__WEBPACK_IMPORTED_MODULE_91__["default"]; });
  108612. /* harmony import */ var _gte_js__WEBPACK_IMPORTED_MODULE_92__ = __webpack_require__(/*! ./gte.js */ "./node_modules/lodash-es/gte.js");
  108613. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "gte", function() { return _gte_js__WEBPACK_IMPORTED_MODULE_92__["default"]; });
  108614. /* harmony import */ var _has_js__WEBPACK_IMPORTED_MODULE_93__ = __webpack_require__(/*! ./has.js */ "./node_modules/lodash-es/has.js");
  108615. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "has", function() { return _has_js__WEBPACK_IMPORTED_MODULE_93__["default"]; });
  108616. /* harmony import */ var _hasIn_js__WEBPACK_IMPORTED_MODULE_94__ = __webpack_require__(/*! ./hasIn.js */ "./node_modules/lodash-es/hasIn.js");
  108617. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hasIn", function() { return _hasIn_js__WEBPACK_IMPORTED_MODULE_94__["default"]; });
  108618. /* harmony import */ var _head_js__WEBPACK_IMPORTED_MODULE_95__ = __webpack_require__(/*! ./head.js */ "./node_modules/lodash-es/head.js");
  108619. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "head", function() { return _head_js__WEBPACK_IMPORTED_MODULE_95__["default"]; });
  108620. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_96__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  108621. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return _identity_js__WEBPACK_IMPORTED_MODULE_96__["default"]; });
  108622. /* harmony import */ var _inRange_js__WEBPACK_IMPORTED_MODULE_97__ = __webpack_require__(/*! ./inRange.js */ "./node_modules/lodash-es/inRange.js");
  108623. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "inRange", function() { return _inRange_js__WEBPACK_IMPORTED_MODULE_97__["default"]; });
  108624. /* harmony import */ var _includes_js__WEBPACK_IMPORTED_MODULE_98__ = __webpack_require__(/*! ./includes.js */ "./node_modules/lodash-es/includes.js");
  108625. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "includes", function() { return _includes_js__WEBPACK_IMPORTED_MODULE_98__["default"]; });
  108626. /* harmony import */ var _indexOf_js__WEBPACK_IMPORTED_MODULE_99__ = __webpack_require__(/*! ./indexOf.js */ "./node_modules/lodash-es/indexOf.js");
  108627. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "indexOf", function() { return _indexOf_js__WEBPACK_IMPORTED_MODULE_99__["default"]; });
  108628. /* harmony import */ var _initial_js__WEBPACK_IMPORTED_MODULE_100__ = __webpack_require__(/*! ./initial.js */ "./node_modules/lodash-es/initial.js");
  108629. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initial", function() { return _initial_js__WEBPACK_IMPORTED_MODULE_100__["default"]; });
  108630. /* harmony import */ var _intersection_js__WEBPACK_IMPORTED_MODULE_101__ = __webpack_require__(/*! ./intersection.js */ "./node_modules/lodash-es/intersection.js");
  108631. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "intersection", function() { return _intersection_js__WEBPACK_IMPORTED_MODULE_101__["default"]; });
  108632. /* harmony import */ var _intersectionBy_js__WEBPACK_IMPORTED_MODULE_102__ = __webpack_require__(/*! ./intersectionBy.js */ "./node_modules/lodash-es/intersectionBy.js");
  108633. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "intersectionBy", function() { return _intersectionBy_js__WEBPACK_IMPORTED_MODULE_102__["default"]; });
  108634. /* harmony import */ var _intersectionWith_js__WEBPACK_IMPORTED_MODULE_103__ = __webpack_require__(/*! ./intersectionWith.js */ "./node_modules/lodash-es/intersectionWith.js");
  108635. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "intersectionWith", function() { return _intersectionWith_js__WEBPACK_IMPORTED_MODULE_103__["default"]; });
  108636. /* harmony import */ var _invert_js__WEBPACK_IMPORTED_MODULE_104__ = __webpack_require__(/*! ./invert.js */ "./node_modules/lodash-es/invert.js");
  108637. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return _invert_js__WEBPACK_IMPORTED_MODULE_104__["default"]; });
  108638. /* harmony import */ var _invertBy_js__WEBPACK_IMPORTED_MODULE_105__ = __webpack_require__(/*! ./invertBy.js */ "./node_modules/lodash-es/invertBy.js");
  108639. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "invertBy", function() { return _invertBy_js__WEBPACK_IMPORTED_MODULE_105__["default"]; });
  108640. /* harmony import */ var _invoke_js__WEBPACK_IMPORTED_MODULE_106__ = __webpack_require__(/*! ./invoke.js */ "./node_modules/lodash-es/invoke.js");
  108641. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "invoke", function() { return _invoke_js__WEBPACK_IMPORTED_MODULE_106__["default"]; });
  108642. /* harmony import */ var _invokeMap_js__WEBPACK_IMPORTED_MODULE_107__ = __webpack_require__(/*! ./invokeMap.js */ "./node_modules/lodash-es/invokeMap.js");
  108643. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "invokeMap", function() { return _invokeMap_js__WEBPACK_IMPORTED_MODULE_107__["default"]; });
  108644. /* harmony import */ var _isArguments_js__WEBPACK_IMPORTED_MODULE_108__ = __webpack_require__(/*! ./isArguments.js */ "./node_modules/lodash-es/isArguments.js");
  108645. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArguments", function() { return _isArguments_js__WEBPACK_IMPORTED_MODULE_108__["default"]; });
  108646. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_109__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  108647. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return _isArray_js__WEBPACK_IMPORTED_MODULE_109__["default"]; });
  108648. /* harmony import */ var _isArrayBuffer_js__WEBPACK_IMPORTED_MODULE_110__ = __webpack_require__(/*! ./isArrayBuffer.js */ "./node_modules/lodash-es/isArrayBuffer.js");
  108649. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArrayBuffer", function() { return _isArrayBuffer_js__WEBPACK_IMPORTED_MODULE_110__["default"]; });
  108650. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_111__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  108651. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArrayLike", function() { return _isArrayLike_js__WEBPACK_IMPORTED_MODULE_111__["default"]; });
  108652. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_112__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  108653. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArrayLikeObject", function() { return _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_112__["default"]; });
  108654. /* harmony import */ var _isBoolean_js__WEBPACK_IMPORTED_MODULE_113__ = __webpack_require__(/*! ./isBoolean.js */ "./node_modules/lodash-es/isBoolean.js");
  108655. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return _isBoolean_js__WEBPACK_IMPORTED_MODULE_113__["default"]; });
  108656. /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_114__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
  108657. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isBuffer", function() { return _isBuffer_js__WEBPACK_IMPORTED_MODULE_114__["default"]; });
  108658. /* harmony import */ var _isDate_js__WEBPACK_IMPORTED_MODULE_115__ = __webpack_require__(/*! ./isDate.js */ "./node_modules/lodash-es/isDate.js");
  108659. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isDate", function() { return _isDate_js__WEBPACK_IMPORTED_MODULE_115__["default"]; });
  108660. /* harmony import */ var _isElement_js__WEBPACK_IMPORTED_MODULE_116__ = __webpack_require__(/*! ./isElement.js */ "./node_modules/lodash-es/isElement.js");
  108661. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isElement", function() { return _isElement_js__WEBPACK_IMPORTED_MODULE_116__["default"]; });
  108662. /* harmony import */ var _isEmpty_js__WEBPACK_IMPORTED_MODULE_117__ = __webpack_require__(/*! ./isEmpty.js */ "./node_modules/lodash-es/isEmpty.js");
  108663. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return _isEmpty_js__WEBPACK_IMPORTED_MODULE_117__["default"]; });
  108664. /* harmony import */ var _isEqual_js__WEBPACK_IMPORTED_MODULE_118__ = __webpack_require__(/*! ./isEqual.js */ "./node_modules/lodash-es/isEqual.js");
  108665. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEqual", function() { return _isEqual_js__WEBPACK_IMPORTED_MODULE_118__["default"]; });
  108666. /* harmony import */ var _isEqualWith_js__WEBPACK_IMPORTED_MODULE_119__ = __webpack_require__(/*! ./isEqualWith.js */ "./node_modules/lodash-es/isEqualWith.js");
  108667. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEqualWith", function() { return _isEqualWith_js__WEBPACK_IMPORTED_MODULE_119__["default"]; });
  108668. /* harmony import */ var _isError_js__WEBPACK_IMPORTED_MODULE_120__ = __webpack_require__(/*! ./isError.js */ "./node_modules/lodash-es/isError.js");
  108669. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isError", function() { return _isError_js__WEBPACK_IMPORTED_MODULE_120__["default"]; });
  108670. /* harmony import */ var _isFinite_js__WEBPACK_IMPORTED_MODULE_121__ = __webpack_require__(/*! ./isFinite.js */ "./node_modules/lodash-es/isFinite.js");
  108671. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isFinite", function() { return _isFinite_js__WEBPACK_IMPORTED_MODULE_121__["default"]; });
  108672. /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_122__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
  108673. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return _isFunction_js__WEBPACK_IMPORTED_MODULE_122__["default"]; });
  108674. /* harmony import */ var _isInteger_js__WEBPACK_IMPORTED_MODULE_123__ = __webpack_require__(/*! ./isInteger.js */ "./node_modules/lodash-es/isInteger.js");
  108675. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isInteger", function() { return _isInteger_js__WEBPACK_IMPORTED_MODULE_123__["default"]; });
  108676. /* harmony import */ var _isLength_js__WEBPACK_IMPORTED_MODULE_124__ = __webpack_require__(/*! ./isLength.js */ "./node_modules/lodash-es/isLength.js");
  108677. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isLength", function() { return _isLength_js__WEBPACK_IMPORTED_MODULE_124__["default"]; });
  108678. /* harmony import */ var _isMap_js__WEBPACK_IMPORTED_MODULE_125__ = __webpack_require__(/*! ./isMap.js */ "./node_modules/lodash-es/isMap.js");
  108679. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isMap", function() { return _isMap_js__WEBPACK_IMPORTED_MODULE_125__["default"]; });
  108680. /* harmony import */ var _isMatch_js__WEBPACK_IMPORTED_MODULE_126__ = __webpack_require__(/*! ./isMatch.js */ "./node_modules/lodash-es/isMatch.js");
  108681. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isMatch", function() { return _isMatch_js__WEBPACK_IMPORTED_MODULE_126__["default"]; });
  108682. /* harmony import */ var _isMatchWith_js__WEBPACK_IMPORTED_MODULE_127__ = __webpack_require__(/*! ./isMatchWith.js */ "./node_modules/lodash-es/isMatchWith.js");
  108683. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isMatchWith", function() { return _isMatchWith_js__WEBPACK_IMPORTED_MODULE_127__["default"]; });
  108684. /* harmony import */ var _isNaN_js__WEBPACK_IMPORTED_MODULE_128__ = __webpack_require__(/*! ./isNaN.js */ "./node_modules/lodash-es/isNaN.js");
  108685. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNaN", function() { return _isNaN_js__WEBPACK_IMPORTED_MODULE_128__["default"]; });
  108686. /* harmony import */ var _isNative_js__WEBPACK_IMPORTED_MODULE_129__ = __webpack_require__(/*! ./isNative.js */ "./node_modules/lodash-es/isNative.js");
  108687. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNative", function() { return _isNative_js__WEBPACK_IMPORTED_MODULE_129__["default"]; });
  108688. /* harmony import */ var _isNil_js__WEBPACK_IMPORTED_MODULE_130__ = __webpack_require__(/*! ./isNil.js */ "./node_modules/lodash-es/isNil.js");
  108689. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNil", function() { return _isNil_js__WEBPACK_IMPORTED_MODULE_130__["default"]; });
  108690. /* harmony import */ var _isNull_js__WEBPACK_IMPORTED_MODULE_131__ = __webpack_require__(/*! ./isNull.js */ "./node_modules/lodash-es/isNull.js");
  108691. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNull", function() { return _isNull_js__WEBPACK_IMPORTED_MODULE_131__["default"]; });
  108692. /* harmony import */ var _isNumber_js__WEBPACK_IMPORTED_MODULE_132__ = __webpack_require__(/*! ./isNumber.js */ "./node_modules/lodash-es/isNumber.js");
  108693. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return _isNumber_js__WEBPACK_IMPORTED_MODULE_132__["default"]; });
  108694. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_133__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  108695. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return _isObject_js__WEBPACK_IMPORTED_MODULE_133__["default"]; });
  108696. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_134__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  108697. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isObjectLike", function() { return _isObjectLike_js__WEBPACK_IMPORTED_MODULE_134__["default"]; });
  108698. /* harmony import */ var _isPlainObject_js__WEBPACK_IMPORTED_MODULE_135__ = __webpack_require__(/*! ./isPlainObject.js */ "./node_modules/lodash-es/isPlainObject.js");
  108699. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isPlainObject", function() { return _isPlainObject_js__WEBPACK_IMPORTED_MODULE_135__["default"]; });
  108700. /* harmony import */ var _isRegExp_js__WEBPACK_IMPORTED_MODULE_136__ = __webpack_require__(/*! ./isRegExp.js */ "./node_modules/lodash-es/isRegExp.js");
  108701. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return _isRegExp_js__WEBPACK_IMPORTED_MODULE_136__["default"]; });
  108702. /* harmony import */ var _isSafeInteger_js__WEBPACK_IMPORTED_MODULE_137__ = __webpack_require__(/*! ./isSafeInteger.js */ "./node_modules/lodash-es/isSafeInteger.js");
  108703. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSafeInteger", function() { return _isSafeInteger_js__WEBPACK_IMPORTED_MODULE_137__["default"]; });
  108704. /* harmony import */ var _isSet_js__WEBPACK_IMPORTED_MODULE_138__ = __webpack_require__(/*! ./isSet.js */ "./node_modules/lodash-es/isSet.js");
  108705. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSet", function() { return _isSet_js__WEBPACK_IMPORTED_MODULE_138__["default"]; });
  108706. /* harmony import */ var _isString_js__WEBPACK_IMPORTED_MODULE_139__ = __webpack_require__(/*! ./isString.js */ "./node_modules/lodash-es/isString.js");
  108707. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return _isString_js__WEBPACK_IMPORTED_MODULE_139__["default"]; });
  108708. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_140__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  108709. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isSymbol", function() { return _isSymbol_js__WEBPACK_IMPORTED_MODULE_140__["default"]; });
  108710. /* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_141__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/lodash-es/isTypedArray.js");
  108711. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isTypedArray", function() { return _isTypedArray_js__WEBPACK_IMPORTED_MODULE_141__["default"]; });
  108712. /* harmony import */ var _isUndefined_js__WEBPACK_IMPORTED_MODULE_142__ = __webpack_require__(/*! ./isUndefined.js */ "./node_modules/lodash-es/isUndefined.js");
  108713. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return _isUndefined_js__WEBPACK_IMPORTED_MODULE_142__["default"]; });
  108714. /* harmony import */ var _isWeakMap_js__WEBPACK_IMPORTED_MODULE_143__ = __webpack_require__(/*! ./isWeakMap.js */ "./node_modules/lodash-es/isWeakMap.js");
  108715. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isWeakMap", function() { return _isWeakMap_js__WEBPACK_IMPORTED_MODULE_143__["default"]; });
  108716. /* harmony import */ var _isWeakSet_js__WEBPACK_IMPORTED_MODULE_144__ = __webpack_require__(/*! ./isWeakSet.js */ "./node_modules/lodash-es/isWeakSet.js");
  108717. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isWeakSet", function() { return _isWeakSet_js__WEBPACK_IMPORTED_MODULE_144__["default"]; });
  108718. /* harmony import */ var _iteratee_js__WEBPACK_IMPORTED_MODULE_145__ = __webpack_require__(/*! ./iteratee.js */ "./node_modules/lodash-es/iteratee.js");
  108719. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "iteratee", function() { return _iteratee_js__WEBPACK_IMPORTED_MODULE_145__["default"]; });
  108720. /* harmony import */ var _join_js__WEBPACK_IMPORTED_MODULE_146__ = __webpack_require__(/*! ./join.js */ "./node_modules/lodash-es/join.js");
  108721. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "join", function() { return _join_js__WEBPACK_IMPORTED_MODULE_146__["default"]; });
  108722. /* harmony import */ var _kebabCase_js__WEBPACK_IMPORTED_MODULE_147__ = __webpack_require__(/*! ./kebabCase.js */ "./node_modules/lodash-es/kebabCase.js");
  108723. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "kebabCase", function() { return _kebabCase_js__WEBPACK_IMPORTED_MODULE_147__["default"]; });
  108724. /* harmony import */ var _keyBy_js__WEBPACK_IMPORTED_MODULE_148__ = __webpack_require__(/*! ./keyBy.js */ "./node_modules/lodash-es/keyBy.js");
  108725. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "keyBy", function() { return _keyBy_js__WEBPACK_IMPORTED_MODULE_148__["default"]; });
  108726. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_149__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  108727. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "keys", function() { return _keys_js__WEBPACK_IMPORTED_MODULE_149__["default"]; });
  108728. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_150__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  108729. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "keysIn", function() { return _keysIn_js__WEBPACK_IMPORTED_MODULE_150__["default"]; });
  108730. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_151__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  108731. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "last", function() { return _last_js__WEBPACK_IMPORTED_MODULE_151__["default"]; });
  108732. /* harmony import */ var _lastIndexOf_js__WEBPACK_IMPORTED_MODULE_152__ = __webpack_require__(/*! ./lastIndexOf.js */ "./node_modules/lodash-es/lastIndexOf.js");
  108733. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lastIndexOf", function() { return _lastIndexOf_js__WEBPACK_IMPORTED_MODULE_152__["default"]; });
  108734. /* harmony import */ var _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_153__ = __webpack_require__(/*! ./wrapperLodash.js */ "./node_modules/lodash-es/wrapperLodash.js");
  108735. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lodash", function() { return _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_153__["default"]; });
  108736. /* harmony import */ var _lowerCase_js__WEBPACK_IMPORTED_MODULE_154__ = __webpack_require__(/*! ./lowerCase.js */ "./node_modules/lodash-es/lowerCase.js");
  108737. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lowerCase", function() { return _lowerCase_js__WEBPACK_IMPORTED_MODULE_154__["default"]; });
  108738. /* harmony import */ var _lowerFirst_js__WEBPACK_IMPORTED_MODULE_155__ = __webpack_require__(/*! ./lowerFirst.js */ "./node_modules/lodash-es/lowerFirst.js");
  108739. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lowerFirst", function() { return _lowerFirst_js__WEBPACK_IMPORTED_MODULE_155__["default"]; });
  108740. /* harmony import */ var _lt_js__WEBPACK_IMPORTED_MODULE_156__ = __webpack_require__(/*! ./lt.js */ "./node_modules/lodash-es/lt.js");
  108741. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lt", function() { return _lt_js__WEBPACK_IMPORTED_MODULE_156__["default"]; });
  108742. /* harmony import */ var _lte_js__WEBPACK_IMPORTED_MODULE_157__ = __webpack_require__(/*! ./lte.js */ "./node_modules/lodash-es/lte.js");
  108743. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lte", function() { return _lte_js__WEBPACK_IMPORTED_MODULE_157__["default"]; });
  108744. /* harmony import */ var _map_js__WEBPACK_IMPORTED_MODULE_158__ = __webpack_require__(/*! ./map.js */ "./node_modules/lodash-es/map.js");
  108745. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "map", function() { return _map_js__WEBPACK_IMPORTED_MODULE_158__["default"]; });
  108746. /* harmony import */ var _mapKeys_js__WEBPACK_IMPORTED_MODULE_159__ = __webpack_require__(/*! ./mapKeys.js */ "./node_modules/lodash-es/mapKeys.js");
  108747. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mapKeys", function() { return _mapKeys_js__WEBPACK_IMPORTED_MODULE_159__["default"]; });
  108748. /* harmony import */ var _mapValues_js__WEBPACK_IMPORTED_MODULE_160__ = __webpack_require__(/*! ./mapValues.js */ "./node_modules/lodash-es/mapValues.js");
  108749. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mapValues", function() { return _mapValues_js__WEBPACK_IMPORTED_MODULE_160__["default"]; });
  108750. /* harmony import */ var _matches_js__WEBPACK_IMPORTED_MODULE_161__ = __webpack_require__(/*! ./matches.js */ "./node_modules/lodash-es/matches.js");
  108751. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "matches", function() { return _matches_js__WEBPACK_IMPORTED_MODULE_161__["default"]; });
  108752. /* harmony import */ var _matchesProperty_js__WEBPACK_IMPORTED_MODULE_162__ = __webpack_require__(/*! ./matchesProperty.js */ "./node_modules/lodash-es/matchesProperty.js");
  108753. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "matchesProperty", function() { return _matchesProperty_js__WEBPACK_IMPORTED_MODULE_162__["default"]; });
  108754. /* harmony import */ var _max_js__WEBPACK_IMPORTED_MODULE_163__ = __webpack_require__(/*! ./max.js */ "./node_modules/lodash-es/max.js");
  108755. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "max", function() { return _max_js__WEBPACK_IMPORTED_MODULE_163__["default"]; });
  108756. /* harmony import */ var _maxBy_js__WEBPACK_IMPORTED_MODULE_164__ = __webpack_require__(/*! ./maxBy.js */ "./node_modules/lodash-es/maxBy.js");
  108757. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "maxBy", function() { return _maxBy_js__WEBPACK_IMPORTED_MODULE_164__["default"]; });
  108758. /* harmony import */ var _mean_js__WEBPACK_IMPORTED_MODULE_165__ = __webpack_require__(/*! ./mean.js */ "./node_modules/lodash-es/mean.js");
  108759. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mean", function() { return _mean_js__WEBPACK_IMPORTED_MODULE_165__["default"]; });
  108760. /* harmony import */ var _meanBy_js__WEBPACK_IMPORTED_MODULE_166__ = __webpack_require__(/*! ./meanBy.js */ "./node_modules/lodash-es/meanBy.js");
  108761. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "meanBy", function() { return _meanBy_js__WEBPACK_IMPORTED_MODULE_166__["default"]; });
  108762. /* harmony import */ var _memoize_js__WEBPACK_IMPORTED_MODULE_167__ = __webpack_require__(/*! ./memoize.js */ "./node_modules/lodash-es/memoize.js");
  108763. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "memoize", function() { return _memoize_js__WEBPACK_IMPORTED_MODULE_167__["default"]; });
  108764. /* harmony import */ var _merge_js__WEBPACK_IMPORTED_MODULE_168__ = __webpack_require__(/*! ./merge.js */ "./node_modules/lodash-es/merge.js");
  108765. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return _merge_js__WEBPACK_IMPORTED_MODULE_168__["default"]; });
  108766. /* harmony import */ var _mergeWith_js__WEBPACK_IMPORTED_MODULE_169__ = __webpack_require__(/*! ./mergeWith.js */ "./node_modules/lodash-es/mergeWith.js");
  108767. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mergeWith", function() { return _mergeWith_js__WEBPACK_IMPORTED_MODULE_169__["default"]; });
  108768. /* harmony import */ var _method_js__WEBPACK_IMPORTED_MODULE_170__ = __webpack_require__(/*! ./method.js */ "./node_modules/lodash-es/method.js");
  108769. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "method", function() { return _method_js__WEBPACK_IMPORTED_MODULE_170__["default"]; });
  108770. /* harmony import */ var _methodOf_js__WEBPACK_IMPORTED_MODULE_171__ = __webpack_require__(/*! ./methodOf.js */ "./node_modules/lodash-es/methodOf.js");
  108771. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "methodOf", function() { return _methodOf_js__WEBPACK_IMPORTED_MODULE_171__["default"]; });
  108772. /* harmony import */ var _min_js__WEBPACK_IMPORTED_MODULE_172__ = __webpack_require__(/*! ./min.js */ "./node_modules/lodash-es/min.js");
  108773. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "min", function() { return _min_js__WEBPACK_IMPORTED_MODULE_172__["default"]; });
  108774. /* harmony import */ var _minBy_js__WEBPACK_IMPORTED_MODULE_173__ = __webpack_require__(/*! ./minBy.js */ "./node_modules/lodash-es/minBy.js");
  108775. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "minBy", function() { return _minBy_js__WEBPACK_IMPORTED_MODULE_173__["default"]; });
  108776. /* harmony import */ var _mixin_js__WEBPACK_IMPORTED_MODULE_174__ = __webpack_require__(/*! ./mixin.js */ "./node_modules/lodash-es/mixin.js");
  108777. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mixin", function() { return _mixin_js__WEBPACK_IMPORTED_MODULE_174__["default"]; });
  108778. /* harmony import */ var _multiply_js__WEBPACK_IMPORTED_MODULE_175__ = __webpack_require__(/*! ./multiply.js */ "./node_modules/lodash-es/multiply.js");
  108779. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "multiply", function() { return _multiply_js__WEBPACK_IMPORTED_MODULE_175__["default"]; });
  108780. /* harmony import */ var _negate_js__WEBPACK_IMPORTED_MODULE_176__ = __webpack_require__(/*! ./negate.js */ "./node_modules/lodash-es/negate.js");
  108781. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "negate", function() { return _negate_js__WEBPACK_IMPORTED_MODULE_176__["default"]; });
  108782. /* harmony import */ var _next_js__WEBPACK_IMPORTED_MODULE_177__ = __webpack_require__(/*! ./next.js */ "./node_modules/lodash-es/next.js");
  108783. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "next", function() { return _next_js__WEBPACK_IMPORTED_MODULE_177__["default"]; });
  108784. /* harmony import */ var _noop_js__WEBPACK_IMPORTED_MODULE_178__ = __webpack_require__(/*! ./noop.js */ "./node_modules/lodash-es/noop.js");
  108785. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return _noop_js__WEBPACK_IMPORTED_MODULE_178__["default"]; });
  108786. /* harmony import */ var _now_js__WEBPACK_IMPORTED_MODULE_179__ = __webpack_require__(/*! ./now.js */ "./node_modules/lodash-es/now.js");
  108787. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "now", function() { return _now_js__WEBPACK_IMPORTED_MODULE_179__["default"]; });
  108788. /* harmony import */ var _nth_js__WEBPACK_IMPORTED_MODULE_180__ = __webpack_require__(/*! ./nth.js */ "./node_modules/lodash-es/nth.js");
  108789. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "nth", function() { return _nth_js__WEBPACK_IMPORTED_MODULE_180__["default"]; });
  108790. /* harmony import */ var _nthArg_js__WEBPACK_IMPORTED_MODULE_181__ = __webpack_require__(/*! ./nthArg.js */ "./node_modules/lodash-es/nthArg.js");
  108791. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "nthArg", function() { return _nthArg_js__WEBPACK_IMPORTED_MODULE_181__["default"]; });
  108792. /* harmony import */ var _omit_js__WEBPACK_IMPORTED_MODULE_182__ = __webpack_require__(/*! ./omit.js */ "./node_modules/lodash-es/omit.js");
  108793. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "omit", function() { return _omit_js__WEBPACK_IMPORTED_MODULE_182__["default"]; });
  108794. /* harmony import */ var _omitBy_js__WEBPACK_IMPORTED_MODULE_183__ = __webpack_require__(/*! ./omitBy.js */ "./node_modules/lodash-es/omitBy.js");
  108795. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "omitBy", function() { return _omitBy_js__WEBPACK_IMPORTED_MODULE_183__["default"]; });
  108796. /* harmony import */ var _once_js__WEBPACK_IMPORTED_MODULE_184__ = __webpack_require__(/*! ./once.js */ "./node_modules/lodash-es/once.js");
  108797. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "once", function() { return _once_js__WEBPACK_IMPORTED_MODULE_184__["default"]; });
  108798. /* harmony import */ var _orderBy_js__WEBPACK_IMPORTED_MODULE_185__ = __webpack_require__(/*! ./orderBy.js */ "./node_modules/lodash-es/orderBy.js");
  108799. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "orderBy", function() { return _orderBy_js__WEBPACK_IMPORTED_MODULE_185__["default"]; });
  108800. /* harmony import */ var _over_js__WEBPACK_IMPORTED_MODULE_186__ = __webpack_require__(/*! ./over.js */ "./node_modules/lodash-es/over.js");
  108801. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "over", function() { return _over_js__WEBPACK_IMPORTED_MODULE_186__["default"]; });
  108802. /* harmony import */ var _overArgs_js__WEBPACK_IMPORTED_MODULE_187__ = __webpack_require__(/*! ./overArgs.js */ "./node_modules/lodash-es/overArgs.js");
  108803. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "overArgs", function() { return _overArgs_js__WEBPACK_IMPORTED_MODULE_187__["default"]; });
  108804. /* harmony import */ var _overEvery_js__WEBPACK_IMPORTED_MODULE_188__ = __webpack_require__(/*! ./overEvery.js */ "./node_modules/lodash-es/overEvery.js");
  108805. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "overEvery", function() { return _overEvery_js__WEBPACK_IMPORTED_MODULE_188__["default"]; });
  108806. /* harmony import */ var _overSome_js__WEBPACK_IMPORTED_MODULE_189__ = __webpack_require__(/*! ./overSome.js */ "./node_modules/lodash-es/overSome.js");
  108807. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "overSome", function() { return _overSome_js__WEBPACK_IMPORTED_MODULE_189__["default"]; });
  108808. /* harmony import */ var _pad_js__WEBPACK_IMPORTED_MODULE_190__ = __webpack_require__(/*! ./pad.js */ "./node_modules/lodash-es/pad.js");
  108809. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pad", function() { return _pad_js__WEBPACK_IMPORTED_MODULE_190__["default"]; });
  108810. /* harmony import */ var _padEnd_js__WEBPACK_IMPORTED_MODULE_191__ = __webpack_require__(/*! ./padEnd.js */ "./node_modules/lodash-es/padEnd.js");
  108811. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "padEnd", function() { return _padEnd_js__WEBPACK_IMPORTED_MODULE_191__["default"]; });
  108812. /* harmony import */ var _padStart_js__WEBPACK_IMPORTED_MODULE_192__ = __webpack_require__(/*! ./padStart.js */ "./node_modules/lodash-es/padStart.js");
  108813. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "padStart", function() { return _padStart_js__WEBPACK_IMPORTED_MODULE_192__["default"]; });
  108814. /* harmony import */ var _parseInt_js__WEBPACK_IMPORTED_MODULE_193__ = __webpack_require__(/*! ./parseInt.js */ "./node_modules/lodash-es/parseInt.js");
  108815. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseInt", function() { return _parseInt_js__WEBPACK_IMPORTED_MODULE_193__["default"]; });
  108816. /* harmony import */ var _partial_js__WEBPACK_IMPORTED_MODULE_194__ = __webpack_require__(/*! ./partial.js */ "./node_modules/lodash-es/partial.js");
  108817. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partial", function() { return _partial_js__WEBPACK_IMPORTED_MODULE_194__["default"]; });
  108818. /* harmony import */ var _partialRight_js__WEBPACK_IMPORTED_MODULE_195__ = __webpack_require__(/*! ./partialRight.js */ "./node_modules/lodash-es/partialRight.js");
  108819. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partialRight", function() { return _partialRight_js__WEBPACK_IMPORTED_MODULE_195__["default"]; });
  108820. /* harmony import */ var _partition_js__WEBPACK_IMPORTED_MODULE_196__ = __webpack_require__(/*! ./partition.js */ "./node_modules/lodash-es/partition.js");
  108821. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return _partition_js__WEBPACK_IMPORTED_MODULE_196__["default"]; });
  108822. /* harmony import */ var _pick_js__WEBPACK_IMPORTED_MODULE_197__ = __webpack_require__(/*! ./pick.js */ "./node_modules/lodash-es/pick.js");
  108823. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pick", function() { return _pick_js__WEBPACK_IMPORTED_MODULE_197__["default"]; });
  108824. /* harmony import */ var _pickBy_js__WEBPACK_IMPORTED_MODULE_198__ = __webpack_require__(/*! ./pickBy.js */ "./node_modules/lodash-es/pickBy.js");
  108825. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pickBy", function() { return _pickBy_js__WEBPACK_IMPORTED_MODULE_198__["default"]; });
  108826. /* harmony import */ var _plant_js__WEBPACK_IMPORTED_MODULE_199__ = __webpack_require__(/*! ./plant.js */ "./node_modules/lodash-es/plant.js");
  108827. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "plant", function() { return _plant_js__WEBPACK_IMPORTED_MODULE_199__["default"]; });
  108828. /* harmony import */ var _property_js__WEBPACK_IMPORTED_MODULE_200__ = __webpack_require__(/*! ./property.js */ "./node_modules/lodash-es/property.js");
  108829. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "property", function() { return _property_js__WEBPACK_IMPORTED_MODULE_200__["default"]; });
  108830. /* harmony import */ var _propertyOf_js__WEBPACK_IMPORTED_MODULE_201__ = __webpack_require__(/*! ./propertyOf.js */ "./node_modules/lodash-es/propertyOf.js");
  108831. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "propertyOf", function() { return _propertyOf_js__WEBPACK_IMPORTED_MODULE_201__["default"]; });
  108832. /* harmony import */ var _pull_js__WEBPACK_IMPORTED_MODULE_202__ = __webpack_require__(/*! ./pull.js */ "./node_modules/lodash-es/pull.js");
  108833. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pull", function() { return _pull_js__WEBPACK_IMPORTED_MODULE_202__["default"]; });
  108834. /* harmony import */ var _pullAll_js__WEBPACK_IMPORTED_MODULE_203__ = __webpack_require__(/*! ./pullAll.js */ "./node_modules/lodash-es/pullAll.js");
  108835. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pullAll", function() { return _pullAll_js__WEBPACK_IMPORTED_MODULE_203__["default"]; });
  108836. /* harmony import */ var _pullAllBy_js__WEBPACK_IMPORTED_MODULE_204__ = __webpack_require__(/*! ./pullAllBy.js */ "./node_modules/lodash-es/pullAllBy.js");
  108837. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pullAllBy", function() { return _pullAllBy_js__WEBPACK_IMPORTED_MODULE_204__["default"]; });
  108838. /* harmony import */ var _pullAllWith_js__WEBPACK_IMPORTED_MODULE_205__ = __webpack_require__(/*! ./pullAllWith.js */ "./node_modules/lodash-es/pullAllWith.js");
  108839. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pullAllWith", function() { return _pullAllWith_js__WEBPACK_IMPORTED_MODULE_205__["default"]; });
  108840. /* harmony import */ var _pullAt_js__WEBPACK_IMPORTED_MODULE_206__ = __webpack_require__(/*! ./pullAt.js */ "./node_modules/lodash-es/pullAt.js");
  108841. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pullAt", function() { return _pullAt_js__WEBPACK_IMPORTED_MODULE_206__["default"]; });
  108842. /* harmony import */ var _random_js__WEBPACK_IMPORTED_MODULE_207__ = __webpack_require__(/*! ./random.js */ "./node_modules/lodash-es/random.js");
  108843. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "random", function() { return _random_js__WEBPACK_IMPORTED_MODULE_207__["default"]; });
  108844. /* harmony import */ var _range_js__WEBPACK_IMPORTED_MODULE_208__ = __webpack_require__(/*! ./range.js */ "./node_modules/lodash-es/range.js");
  108845. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "range", function() { return _range_js__WEBPACK_IMPORTED_MODULE_208__["default"]; });
  108846. /* harmony import */ var _rangeRight_js__WEBPACK_IMPORTED_MODULE_209__ = __webpack_require__(/*! ./rangeRight.js */ "./node_modules/lodash-es/rangeRight.js");
  108847. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rangeRight", function() { return _rangeRight_js__WEBPACK_IMPORTED_MODULE_209__["default"]; });
  108848. /* harmony import */ var _rearg_js__WEBPACK_IMPORTED_MODULE_210__ = __webpack_require__(/*! ./rearg.js */ "./node_modules/lodash-es/rearg.js");
  108849. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rearg", function() { return _rearg_js__WEBPACK_IMPORTED_MODULE_210__["default"]; });
  108850. /* harmony import */ var _reduce_js__WEBPACK_IMPORTED_MODULE_211__ = __webpack_require__(/*! ./reduce.js */ "./node_modules/lodash-es/reduce.js");
  108851. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return _reduce_js__WEBPACK_IMPORTED_MODULE_211__["default"]; });
  108852. /* harmony import */ var _reduceRight_js__WEBPACK_IMPORTED_MODULE_212__ = __webpack_require__(/*! ./reduceRight.js */ "./node_modules/lodash-es/reduceRight.js");
  108853. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reduceRight", function() { return _reduceRight_js__WEBPACK_IMPORTED_MODULE_212__["default"]; });
  108854. /* harmony import */ var _reject_js__WEBPACK_IMPORTED_MODULE_213__ = __webpack_require__(/*! ./reject.js */ "./node_modules/lodash-es/reject.js");
  108855. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reject", function() { return _reject_js__WEBPACK_IMPORTED_MODULE_213__["default"]; });
  108856. /* harmony import */ var _remove_js__WEBPACK_IMPORTED_MODULE_214__ = __webpack_require__(/*! ./remove.js */ "./node_modules/lodash-es/remove.js");
  108857. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "remove", function() { return _remove_js__WEBPACK_IMPORTED_MODULE_214__["default"]; });
  108858. /* harmony import */ var _repeat_js__WEBPACK_IMPORTED_MODULE_215__ = __webpack_require__(/*! ./repeat.js */ "./node_modules/lodash-es/repeat.js");
  108859. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "repeat", function() { return _repeat_js__WEBPACK_IMPORTED_MODULE_215__["default"]; });
  108860. /* harmony import */ var _replace_js__WEBPACK_IMPORTED_MODULE_216__ = __webpack_require__(/*! ./replace.js */ "./node_modules/lodash-es/replace.js");
  108861. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "replace", function() { return _replace_js__WEBPACK_IMPORTED_MODULE_216__["default"]; });
  108862. /* harmony import */ var _rest_js__WEBPACK_IMPORTED_MODULE_217__ = __webpack_require__(/*! ./rest.js */ "./node_modules/lodash-es/rest.js");
  108863. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rest", function() { return _rest_js__WEBPACK_IMPORTED_MODULE_217__["default"]; });
  108864. /* harmony import */ var _result_js__WEBPACK_IMPORTED_MODULE_218__ = __webpack_require__(/*! ./result.js */ "./node_modules/lodash-es/result.js");
  108865. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "result", function() { return _result_js__WEBPACK_IMPORTED_MODULE_218__["default"]; });
  108866. /* harmony import */ var _reverse_js__WEBPACK_IMPORTED_MODULE_219__ = __webpack_require__(/*! ./reverse.js */ "./node_modules/lodash-es/reverse.js");
  108867. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reverse", function() { return _reverse_js__WEBPACK_IMPORTED_MODULE_219__["default"]; });
  108868. /* harmony import */ var _round_js__WEBPACK_IMPORTED_MODULE_220__ = __webpack_require__(/*! ./round.js */ "./node_modules/lodash-es/round.js");
  108869. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "round", function() { return _round_js__WEBPACK_IMPORTED_MODULE_220__["default"]; });
  108870. /* harmony import */ var _sample_js__WEBPACK_IMPORTED_MODULE_221__ = __webpack_require__(/*! ./sample.js */ "./node_modules/lodash-es/sample.js");
  108871. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return _sample_js__WEBPACK_IMPORTED_MODULE_221__["default"]; });
  108872. /* harmony import */ var _sampleSize_js__WEBPACK_IMPORTED_MODULE_222__ = __webpack_require__(/*! ./sampleSize.js */ "./node_modules/lodash-es/sampleSize.js");
  108873. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sampleSize", function() { return _sampleSize_js__WEBPACK_IMPORTED_MODULE_222__["default"]; });
  108874. /* harmony import */ var _set_js__WEBPACK_IMPORTED_MODULE_223__ = __webpack_require__(/*! ./set.js */ "./node_modules/lodash-es/set.js");
  108875. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "set", function() { return _set_js__WEBPACK_IMPORTED_MODULE_223__["default"]; });
  108876. /* harmony import */ var _setWith_js__WEBPACK_IMPORTED_MODULE_224__ = __webpack_require__(/*! ./setWith.js */ "./node_modules/lodash-es/setWith.js");
  108877. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setWith", function() { return _setWith_js__WEBPACK_IMPORTED_MODULE_224__["default"]; });
  108878. /* harmony import */ var _shuffle_js__WEBPACK_IMPORTED_MODULE_225__ = __webpack_require__(/*! ./shuffle.js */ "./node_modules/lodash-es/shuffle.js");
  108879. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "shuffle", function() { return _shuffle_js__WEBPACK_IMPORTED_MODULE_225__["default"]; });
  108880. /* harmony import */ var _size_js__WEBPACK_IMPORTED_MODULE_226__ = __webpack_require__(/*! ./size.js */ "./node_modules/lodash-es/size.js");
  108881. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "size", function() { return _size_js__WEBPACK_IMPORTED_MODULE_226__["default"]; });
  108882. /* harmony import */ var _slice_js__WEBPACK_IMPORTED_MODULE_227__ = __webpack_require__(/*! ./slice.js */ "./node_modules/lodash-es/slice.js");
  108883. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "slice", function() { return _slice_js__WEBPACK_IMPORTED_MODULE_227__["default"]; });
  108884. /* harmony import */ var _snakeCase_js__WEBPACK_IMPORTED_MODULE_228__ = __webpack_require__(/*! ./snakeCase.js */ "./node_modules/lodash-es/snakeCase.js");
  108885. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "snakeCase", function() { return _snakeCase_js__WEBPACK_IMPORTED_MODULE_228__["default"]; });
  108886. /* harmony import */ var _some_js__WEBPACK_IMPORTED_MODULE_229__ = __webpack_require__(/*! ./some.js */ "./node_modules/lodash-es/some.js");
  108887. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "some", function() { return _some_js__WEBPACK_IMPORTED_MODULE_229__["default"]; });
  108888. /* harmony import */ var _sortBy_js__WEBPACK_IMPORTED_MODULE_230__ = __webpack_require__(/*! ./sortBy.js */ "./node_modules/lodash-es/sortBy.js");
  108889. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortBy", function() { return _sortBy_js__WEBPACK_IMPORTED_MODULE_230__["default"]; });
  108890. /* harmony import */ var _sortedIndex_js__WEBPACK_IMPORTED_MODULE_231__ = __webpack_require__(/*! ./sortedIndex.js */ "./node_modules/lodash-es/sortedIndex.js");
  108891. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedIndex", function() { return _sortedIndex_js__WEBPACK_IMPORTED_MODULE_231__["default"]; });
  108892. /* harmony import */ var _sortedIndexBy_js__WEBPACK_IMPORTED_MODULE_232__ = __webpack_require__(/*! ./sortedIndexBy.js */ "./node_modules/lodash-es/sortedIndexBy.js");
  108893. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedIndexBy", function() { return _sortedIndexBy_js__WEBPACK_IMPORTED_MODULE_232__["default"]; });
  108894. /* harmony import */ var _sortedIndexOf_js__WEBPACK_IMPORTED_MODULE_233__ = __webpack_require__(/*! ./sortedIndexOf.js */ "./node_modules/lodash-es/sortedIndexOf.js");
  108895. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedIndexOf", function() { return _sortedIndexOf_js__WEBPACK_IMPORTED_MODULE_233__["default"]; });
  108896. /* harmony import */ var _sortedLastIndex_js__WEBPACK_IMPORTED_MODULE_234__ = __webpack_require__(/*! ./sortedLastIndex.js */ "./node_modules/lodash-es/sortedLastIndex.js");
  108897. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedLastIndex", function() { return _sortedLastIndex_js__WEBPACK_IMPORTED_MODULE_234__["default"]; });
  108898. /* harmony import */ var _sortedLastIndexBy_js__WEBPACK_IMPORTED_MODULE_235__ = __webpack_require__(/*! ./sortedLastIndexBy.js */ "./node_modules/lodash-es/sortedLastIndexBy.js");
  108899. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedLastIndexBy", function() { return _sortedLastIndexBy_js__WEBPACK_IMPORTED_MODULE_235__["default"]; });
  108900. /* harmony import */ var _sortedLastIndexOf_js__WEBPACK_IMPORTED_MODULE_236__ = __webpack_require__(/*! ./sortedLastIndexOf.js */ "./node_modules/lodash-es/sortedLastIndexOf.js");
  108901. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedLastIndexOf", function() { return _sortedLastIndexOf_js__WEBPACK_IMPORTED_MODULE_236__["default"]; });
  108902. /* harmony import */ var _sortedUniq_js__WEBPACK_IMPORTED_MODULE_237__ = __webpack_require__(/*! ./sortedUniq.js */ "./node_modules/lodash-es/sortedUniq.js");
  108903. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedUniq", function() { return _sortedUniq_js__WEBPACK_IMPORTED_MODULE_237__["default"]; });
  108904. /* harmony import */ var _sortedUniqBy_js__WEBPACK_IMPORTED_MODULE_238__ = __webpack_require__(/*! ./sortedUniqBy.js */ "./node_modules/lodash-es/sortedUniqBy.js");
  108905. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sortedUniqBy", function() { return _sortedUniqBy_js__WEBPACK_IMPORTED_MODULE_238__["default"]; });
  108906. /* harmony import */ var _split_js__WEBPACK_IMPORTED_MODULE_239__ = __webpack_require__(/*! ./split.js */ "./node_modules/lodash-es/split.js");
  108907. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "split", function() { return _split_js__WEBPACK_IMPORTED_MODULE_239__["default"]; });
  108908. /* harmony import */ var _spread_js__WEBPACK_IMPORTED_MODULE_240__ = __webpack_require__(/*! ./spread.js */ "./node_modules/lodash-es/spread.js");
  108909. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "spread", function() { return _spread_js__WEBPACK_IMPORTED_MODULE_240__["default"]; });
  108910. /* harmony import */ var _startCase_js__WEBPACK_IMPORTED_MODULE_241__ = __webpack_require__(/*! ./startCase.js */ "./node_modules/lodash-es/startCase.js");
  108911. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startCase", function() { return _startCase_js__WEBPACK_IMPORTED_MODULE_241__["default"]; });
  108912. /* harmony import */ var _startsWith_js__WEBPACK_IMPORTED_MODULE_242__ = __webpack_require__(/*! ./startsWith.js */ "./node_modules/lodash-es/startsWith.js");
  108913. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startsWith", function() { return _startsWith_js__WEBPACK_IMPORTED_MODULE_242__["default"]; });
  108914. /* harmony import */ var _stubArray_js__WEBPACK_IMPORTED_MODULE_243__ = __webpack_require__(/*! ./stubArray.js */ "./node_modules/lodash-es/stubArray.js");
  108915. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubArray", function() { return _stubArray_js__WEBPACK_IMPORTED_MODULE_243__["default"]; });
  108916. /* harmony import */ var _stubFalse_js__WEBPACK_IMPORTED_MODULE_244__ = __webpack_require__(/*! ./stubFalse.js */ "./node_modules/lodash-es/stubFalse.js");
  108917. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubFalse", function() { return _stubFalse_js__WEBPACK_IMPORTED_MODULE_244__["default"]; });
  108918. /* harmony import */ var _stubObject_js__WEBPACK_IMPORTED_MODULE_245__ = __webpack_require__(/*! ./stubObject.js */ "./node_modules/lodash-es/stubObject.js");
  108919. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubObject", function() { return _stubObject_js__WEBPACK_IMPORTED_MODULE_245__["default"]; });
  108920. /* harmony import */ var _stubString_js__WEBPACK_IMPORTED_MODULE_246__ = __webpack_require__(/*! ./stubString.js */ "./node_modules/lodash-es/stubString.js");
  108921. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubString", function() { return _stubString_js__WEBPACK_IMPORTED_MODULE_246__["default"]; });
  108922. /* harmony import */ var _stubTrue_js__WEBPACK_IMPORTED_MODULE_247__ = __webpack_require__(/*! ./stubTrue.js */ "./node_modules/lodash-es/stubTrue.js");
  108923. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubTrue", function() { return _stubTrue_js__WEBPACK_IMPORTED_MODULE_247__["default"]; });
  108924. /* harmony import */ var _subtract_js__WEBPACK_IMPORTED_MODULE_248__ = __webpack_require__(/*! ./subtract.js */ "./node_modules/lodash-es/subtract.js");
  108925. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "subtract", function() { return _subtract_js__WEBPACK_IMPORTED_MODULE_248__["default"]; });
  108926. /* harmony import */ var _sum_js__WEBPACK_IMPORTED_MODULE_249__ = __webpack_require__(/*! ./sum.js */ "./node_modules/lodash-es/sum.js");
  108927. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sum", function() { return _sum_js__WEBPACK_IMPORTED_MODULE_249__["default"]; });
  108928. /* harmony import */ var _sumBy_js__WEBPACK_IMPORTED_MODULE_250__ = __webpack_require__(/*! ./sumBy.js */ "./node_modules/lodash-es/sumBy.js");
  108929. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sumBy", function() { return _sumBy_js__WEBPACK_IMPORTED_MODULE_250__["default"]; });
  108930. /* harmony import */ var _tail_js__WEBPACK_IMPORTED_MODULE_251__ = __webpack_require__(/*! ./tail.js */ "./node_modules/lodash-es/tail.js");
  108931. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tail", function() { return _tail_js__WEBPACK_IMPORTED_MODULE_251__["default"]; });
  108932. /* harmony import */ var _take_js__WEBPACK_IMPORTED_MODULE_252__ = __webpack_require__(/*! ./take.js */ "./node_modules/lodash-es/take.js");
  108933. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "take", function() { return _take_js__WEBPACK_IMPORTED_MODULE_252__["default"]; });
  108934. /* harmony import */ var _takeRight_js__WEBPACK_IMPORTED_MODULE_253__ = __webpack_require__(/*! ./takeRight.js */ "./node_modules/lodash-es/takeRight.js");
  108935. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeRight", function() { return _takeRight_js__WEBPACK_IMPORTED_MODULE_253__["default"]; });
  108936. /* harmony import */ var _takeRightWhile_js__WEBPACK_IMPORTED_MODULE_254__ = __webpack_require__(/*! ./takeRightWhile.js */ "./node_modules/lodash-es/takeRightWhile.js");
  108937. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeRightWhile", function() { return _takeRightWhile_js__WEBPACK_IMPORTED_MODULE_254__["default"]; });
  108938. /* harmony import */ var _takeWhile_js__WEBPACK_IMPORTED_MODULE_255__ = __webpack_require__(/*! ./takeWhile.js */ "./node_modules/lodash-es/takeWhile.js");
  108939. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeWhile", function() { return _takeWhile_js__WEBPACK_IMPORTED_MODULE_255__["default"]; });
  108940. /* harmony import */ var _tap_js__WEBPACK_IMPORTED_MODULE_256__ = __webpack_require__(/*! ./tap.js */ "./node_modules/lodash-es/tap.js");
  108941. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return _tap_js__WEBPACK_IMPORTED_MODULE_256__["default"]; });
  108942. /* harmony import */ var _template_js__WEBPACK_IMPORTED_MODULE_257__ = __webpack_require__(/*! ./template.js */ "./node_modules/lodash-es/template.js");
  108943. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "template", function() { return _template_js__WEBPACK_IMPORTED_MODULE_257__["default"]; });
  108944. /* harmony import */ var _templateSettings_js__WEBPACK_IMPORTED_MODULE_258__ = __webpack_require__(/*! ./templateSettings.js */ "./node_modules/lodash-es/templateSettings.js");
  108945. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "templateSettings", function() { return _templateSettings_js__WEBPACK_IMPORTED_MODULE_258__["default"]; });
  108946. /* harmony import */ var _throttle_js__WEBPACK_IMPORTED_MODULE_259__ = __webpack_require__(/*! ./throttle.js */ "./node_modules/lodash-es/throttle.js");
  108947. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return _throttle_js__WEBPACK_IMPORTED_MODULE_259__["default"]; });
  108948. /* harmony import */ var _thru_js__WEBPACK_IMPORTED_MODULE_260__ = __webpack_require__(/*! ./thru.js */ "./node_modules/lodash-es/thru.js");
  108949. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "thru", function() { return _thru_js__WEBPACK_IMPORTED_MODULE_260__["default"]; });
  108950. /* harmony import */ var _times_js__WEBPACK_IMPORTED_MODULE_261__ = __webpack_require__(/*! ./times.js */ "./node_modules/lodash-es/times.js");
  108951. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "times", function() { return _times_js__WEBPACK_IMPORTED_MODULE_261__["default"]; });
  108952. /* harmony import */ var _toArray_js__WEBPACK_IMPORTED_MODULE_262__ = __webpack_require__(/*! ./toArray.js */ "./node_modules/lodash-es/toArray.js");
  108953. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return _toArray_js__WEBPACK_IMPORTED_MODULE_262__["default"]; });
  108954. /* harmony import */ var _toFinite_js__WEBPACK_IMPORTED_MODULE_263__ = __webpack_require__(/*! ./toFinite.js */ "./node_modules/lodash-es/toFinite.js");
  108955. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toFinite", function() { return _toFinite_js__WEBPACK_IMPORTED_MODULE_263__["default"]; });
  108956. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_264__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  108957. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toInteger", function() { return _toInteger_js__WEBPACK_IMPORTED_MODULE_264__["default"]; });
  108958. /* harmony import */ var _toIterator_js__WEBPACK_IMPORTED_MODULE_265__ = __webpack_require__(/*! ./toIterator.js */ "./node_modules/lodash-es/toIterator.js");
  108959. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toIterator", function() { return _toIterator_js__WEBPACK_IMPORTED_MODULE_265__["default"]; });
  108960. /* harmony import */ var _toJSON_js__WEBPACK_IMPORTED_MODULE_266__ = __webpack_require__(/*! ./toJSON.js */ "./node_modules/lodash-es/toJSON.js");
  108961. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toJSON", function() { return _toJSON_js__WEBPACK_IMPORTED_MODULE_266__["default"]; });
  108962. /* harmony import */ var _toLength_js__WEBPACK_IMPORTED_MODULE_267__ = __webpack_require__(/*! ./toLength.js */ "./node_modules/lodash-es/toLength.js");
  108963. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toLength", function() { return _toLength_js__WEBPACK_IMPORTED_MODULE_267__["default"]; });
  108964. /* harmony import */ var _toLower_js__WEBPACK_IMPORTED_MODULE_268__ = __webpack_require__(/*! ./toLower.js */ "./node_modules/lodash-es/toLower.js");
  108965. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toLower", function() { return _toLower_js__WEBPACK_IMPORTED_MODULE_268__["default"]; });
  108966. /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_269__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
  108967. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toNumber", function() { return _toNumber_js__WEBPACK_IMPORTED_MODULE_269__["default"]; });
  108968. /* harmony import */ var _toPairs_js__WEBPACK_IMPORTED_MODULE_270__ = __webpack_require__(/*! ./toPairs.js */ "./node_modules/lodash-es/toPairs.js");
  108969. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toPairs", function() { return _toPairs_js__WEBPACK_IMPORTED_MODULE_270__["default"]; });
  108970. /* harmony import */ var _toPairsIn_js__WEBPACK_IMPORTED_MODULE_271__ = __webpack_require__(/*! ./toPairsIn.js */ "./node_modules/lodash-es/toPairsIn.js");
  108971. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toPairsIn", function() { return _toPairsIn_js__WEBPACK_IMPORTED_MODULE_271__["default"]; });
  108972. /* harmony import */ var _toPath_js__WEBPACK_IMPORTED_MODULE_272__ = __webpack_require__(/*! ./toPath.js */ "./node_modules/lodash-es/toPath.js");
  108973. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toPath", function() { return _toPath_js__WEBPACK_IMPORTED_MODULE_272__["default"]; });
  108974. /* harmony import */ var _toPlainObject_js__WEBPACK_IMPORTED_MODULE_273__ = __webpack_require__(/*! ./toPlainObject.js */ "./node_modules/lodash-es/toPlainObject.js");
  108975. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toPlainObject", function() { return _toPlainObject_js__WEBPACK_IMPORTED_MODULE_273__["default"]; });
  108976. /* harmony import */ var _toSafeInteger_js__WEBPACK_IMPORTED_MODULE_274__ = __webpack_require__(/*! ./toSafeInteger.js */ "./node_modules/lodash-es/toSafeInteger.js");
  108977. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toSafeInteger", function() { return _toSafeInteger_js__WEBPACK_IMPORTED_MODULE_274__["default"]; });
  108978. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_275__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  108979. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toString", function() { return _toString_js__WEBPACK_IMPORTED_MODULE_275__["default"]; });
  108980. /* harmony import */ var _toUpper_js__WEBPACK_IMPORTED_MODULE_276__ = __webpack_require__(/*! ./toUpper.js */ "./node_modules/lodash-es/toUpper.js");
  108981. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toUpper", function() { return _toUpper_js__WEBPACK_IMPORTED_MODULE_276__["default"]; });
  108982. /* harmony import */ var _transform_js__WEBPACK_IMPORTED_MODULE_277__ = __webpack_require__(/*! ./transform.js */ "./node_modules/lodash-es/transform.js");
  108983. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "transform", function() { return _transform_js__WEBPACK_IMPORTED_MODULE_277__["default"]; });
  108984. /* harmony import */ var _trim_js__WEBPACK_IMPORTED_MODULE_278__ = __webpack_require__(/*! ./trim.js */ "./node_modules/lodash-es/trim.js");
  108985. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "trim", function() { return _trim_js__WEBPACK_IMPORTED_MODULE_278__["default"]; });
  108986. /* harmony import */ var _trimEnd_js__WEBPACK_IMPORTED_MODULE_279__ = __webpack_require__(/*! ./trimEnd.js */ "./node_modules/lodash-es/trimEnd.js");
  108987. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "trimEnd", function() { return _trimEnd_js__WEBPACK_IMPORTED_MODULE_279__["default"]; });
  108988. /* harmony import */ var _trimStart_js__WEBPACK_IMPORTED_MODULE_280__ = __webpack_require__(/*! ./trimStart.js */ "./node_modules/lodash-es/trimStart.js");
  108989. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "trimStart", function() { return _trimStart_js__WEBPACK_IMPORTED_MODULE_280__["default"]; });
  108990. /* harmony import */ var _truncate_js__WEBPACK_IMPORTED_MODULE_281__ = __webpack_require__(/*! ./truncate.js */ "./node_modules/lodash-es/truncate.js");
  108991. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "truncate", function() { return _truncate_js__WEBPACK_IMPORTED_MODULE_281__["default"]; });
  108992. /* harmony import */ var _unary_js__WEBPACK_IMPORTED_MODULE_282__ = __webpack_require__(/*! ./unary.js */ "./node_modules/lodash-es/unary.js");
  108993. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unary", function() { return _unary_js__WEBPACK_IMPORTED_MODULE_282__["default"]; });
  108994. /* harmony import */ var _unescape_js__WEBPACK_IMPORTED_MODULE_283__ = __webpack_require__(/*! ./unescape.js */ "./node_modules/lodash-es/unescape.js");
  108995. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unescape", function() { return _unescape_js__WEBPACK_IMPORTED_MODULE_283__["default"]; });
  108996. /* harmony import */ var _union_js__WEBPACK_IMPORTED_MODULE_284__ = __webpack_require__(/*! ./union.js */ "./node_modules/lodash-es/union.js");
  108997. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "union", function() { return _union_js__WEBPACK_IMPORTED_MODULE_284__["default"]; });
  108998. /* harmony import */ var _unionBy_js__WEBPACK_IMPORTED_MODULE_285__ = __webpack_require__(/*! ./unionBy.js */ "./node_modules/lodash-es/unionBy.js");
  108999. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unionBy", function() { return _unionBy_js__WEBPACK_IMPORTED_MODULE_285__["default"]; });
  109000. /* harmony import */ var _unionWith_js__WEBPACK_IMPORTED_MODULE_286__ = __webpack_require__(/*! ./unionWith.js */ "./node_modules/lodash-es/unionWith.js");
  109001. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unionWith", function() { return _unionWith_js__WEBPACK_IMPORTED_MODULE_286__["default"]; });
  109002. /* harmony import */ var _uniq_js__WEBPACK_IMPORTED_MODULE_287__ = __webpack_require__(/*! ./uniq.js */ "./node_modules/lodash-es/uniq.js");
  109003. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniq", function() { return _uniq_js__WEBPACK_IMPORTED_MODULE_287__["default"]; });
  109004. /* harmony import */ var _uniqBy_js__WEBPACK_IMPORTED_MODULE_288__ = __webpack_require__(/*! ./uniqBy.js */ "./node_modules/lodash-es/uniqBy.js");
  109005. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniqBy", function() { return _uniqBy_js__WEBPACK_IMPORTED_MODULE_288__["default"]; });
  109006. /* harmony import */ var _uniqWith_js__WEBPACK_IMPORTED_MODULE_289__ = __webpack_require__(/*! ./uniqWith.js */ "./node_modules/lodash-es/uniqWith.js");
  109007. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniqWith", function() { return _uniqWith_js__WEBPACK_IMPORTED_MODULE_289__["default"]; });
  109008. /* harmony import */ var _uniqueId_js__WEBPACK_IMPORTED_MODULE_290__ = __webpack_require__(/*! ./uniqueId.js */ "./node_modules/lodash-es/uniqueId.js");
  109009. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniqueId", function() { return _uniqueId_js__WEBPACK_IMPORTED_MODULE_290__["default"]; });
  109010. /* harmony import */ var _unset_js__WEBPACK_IMPORTED_MODULE_291__ = __webpack_require__(/*! ./unset.js */ "./node_modules/lodash-es/unset.js");
  109011. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unset", function() { return _unset_js__WEBPACK_IMPORTED_MODULE_291__["default"]; });
  109012. /* harmony import */ var _unzip_js__WEBPACK_IMPORTED_MODULE_292__ = __webpack_require__(/*! ./unzip.js */ "./node_modules/lodash-es/unzip.js");
  109013. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unzip", function() { return _unzip_js__WEBPACK_IMPORTED_MODULE_292__["default"]; });
  109014. /* harmony import */ var _unzipWith_js__WEBPACK_IMPORTED_MODULE_293__ = __webpack_require__(/*! ./unzipWith.js */ "./node_modules/lodash-es/unzipWith.js");
  109015. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unzipWith", function() { return _unzipWith_js__WEBPACK_IMPORTED_MODULE_293__["default"]; });
  109016. /* harmony import */ var _update_js__WEBPACK_IMPORTED_MODULE_294__ = __webpack_require__(/*! ./update.js */ "./node_modules/lodash-es/update.js");
  109017. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "update", function() { return _update_js__WEBPACK_IMPORTED_MODULE_294__["default"]; });
  109018. /* harmony import */ var _updateWith_js__WEBPACK_IMPORTED_MODULE_295__ = __webpack_require__(/*! ./updateWith.js */ "./node_modules/lodash-es/updateWith.js");
  109019. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "updateWith", function() { return _updateWith_js__WEBPACK_IMPORTED_MODULE_295__["default"]; });
  109020. /* harmony import */ var _upperCase_js__WEBPACK_IMPORTED_MODULE_296__ = __webpack_require__(/*! ./upperCase.js */ "./node_modules/lodash-es/upperCase.js");
  109021. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "upperCase", function() { return _upperCase_js__WEBPACK_IMPORTED_MODULE_296__["default"]; });
  109022. /* harmony import */ var _upperFirst_js__WEBPACK_IMPORTED_MODULE_297__ = __webpack_require__(/*! ./upperFirst.js */ "./node_modules/lodash-es/upperFirst.js");
  109023. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "upperFirst", function() { return _upperFirst_js__WEBPACK_IMPORTED_MODULE_297__["default"]; });
  109024. /* harmony import */ var _value_js__WEBPACK_IMPORTED_MODULE_298__ = __webpack_require__(/*! ./value.js */ "./node_modules/lodash-es/value.js");
  109025. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "value", function() { return _value_js__WEBPACK_IMPORTED_MODULE_298__["default"]; });
  109026. /* harmony import */ var _valueOf_js__WEBPACK_IMPORTED_MODULE_299__ = __webpack_require__(/*! ./valueOf.js */ "./node_modules/lodash-es/valueOf.js");
  109027. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "valueOf", function() { return _valueOf_js__WEBPACK_IMPORTED_MODULE_299__["default"]; });
  109028. /* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_300__ = __webpack_require__(/*! ./values.js */ "./node_modules/lodash-es/values.js");
  109029. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "values", function() { return _values_js__WEBPACK_IMPORTED_MODULE_300__["default"]; });
  109030. /* harmony import */ var _valuesIn_js__WEBPACK_IMPORTED_MODULE_301__ = __webpack_require__(/*! ./valuesIn.js */ "./node_modules/lodash-es/valuesIn.js");
  109031. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "valuesIn", function() { return _valuesIn_js__WEBPACK_IMPORTED_MODULE_301__["default"]; });
  109032. /* harmony import */ var _without_js__WEBPACK_IMPORTED_MODULE_302__ = __webpack_require__(/*! ./without.js */ "./node_modules/lodash-es/without.js");
  109033. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "without", function() { return _without_js__WEBPACK_IMPORTED_MODULE_302__["default"]; });
  109034. /* harmony import */ var _words_js__WEBPACK_IMPORTED_MODULE_303__ = __webpack_require__(/*! ./words.js */ "./node_modules/lodash-es/words.js");
  109035. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "words", function() { return _words_js__WEBPACK_IMPORTED_MODULE_303__["default"]; });
  109036. /* harmony import */ var _wrap_js__WEBPACK_IMPORTED_MODULE_304__ = __webpack_require__(/*! ./wrap.js */ "./node_modules/lodash-es/wrap.js");
  109037. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return _wrap_js__WEBPACK_IMPORTED_MODULE_304__["default"]; });
  109038. /* harmony import */ var _wrapperAt_js__WEBPACK_IMPORTED_MODULE_305__ = __webpack_require__(/*! ./wrapperAt.js */ "./node_modules/lodash-es/wrapperAt.js");
  109039. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperAt", function() { return _wrapperAt_js__WEBPACK_IMPORTED_MODULE_305__["default"]; });
  109040. /* harmony import */ var _wrapperChain_js__WEBPACK_IMPORTED_MODULE_306__ = __webpack_require__(/*! ./wrapperChain.js */ "./node_modules/lodash-es/wrapperChain.js");
  109041. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperChain", function() { return _wrapperChain_js__WEBPACK_IMPORTED_MODULE_306__["default"]; });
  109042. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperCommit", function() { return _commit_js__WEBPACK_IMPORTED_MODULE_24__["default"]; });
  109043. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperLodash", function() { return _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_153__["default"]; });
  109044. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperNext", function() { return _next_js__WEBPACK_IMPORTED_MODULE_177__["default"]; });
  109045. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperPlant", function() { return _plant_js__WEBPACK_IMPORTED_MODULE_199__["default"]; });
  109046. /* harmony import */ var _wrapperReverse_js__WEBPACK_IMPORTED_MODULE_307__ = __webpack_require__(/*! ./wrapperReverse.js */ "./node_modules/lodash-es/wrapperReverse.js");
  109047. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperReverse", function() { return _wrapperReverse_js__WEBPACK_IMPORTED_MODULE_307__["default"]; });
  109048. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperToIterator", function() { return _toIterator_js__WEBPACK_IMPORTED_MODULE_265__["default"]; });
  109049. /* harmony import */ var _wrapperValue_js__WEBPACK_IMPORTED_MODULE_308__ = __webpack_require__(/*! ./wrapperValue.js */ "./node_modules/lodash-es/wrapperValue.js");
  109050. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperValue", function() { return _wrapperValue_js__WEBPACK_IMPORTED_MODULE_308__["default"]; });
  109051. /* harmony import */ var _xor_js__WEBPACK_IMPORTED_MODULE_309__ = __webpack_require__(/*! ./xor.js */ "./node_modules/lodash-es/xor.js");
  109052. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "xor", function() { return _xor_js__WEBPACK_IMPORTED_MODULE_309__["default"]; });
  109053. /* harmony import */ var _xorBy_js__WEBPACK_IMPORTED_MODULE_310__ = __webpack_require__(/*! ./xorBy.js */ "./node_modules/lodash-es/xorBy.js");
  109054. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "xorBy", function() { return _xorBy_js__WEBPACK_IMPORTED_MODULE_310__["default"]; });
  109055. /* harmony import */ var _xorWith_js__WEBPACK_IMPORTED_MODULE_311__ = __webpack_require__(/*! ./xorWith.js */ "./node_modules/lodash-es/xorWith.js");
  109056. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "xorWith", function() { return _xorWith_js__WEBPACK_IMPORTED_MODULE_311__["default"]; });
  109057. /* harmony import */ var _zip_js__WEBPACK_IMPORTED_MODULE_312__ = __webpack_require__(/*! ./zip.js */ "./node_modules/lodash-es/zip.js");
  109058. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return _zip_js__WEBPACK_IMPORTED_MODULE_312__["default"]; });
  109059. /* harmony import */ var _zipObject_js__WEBPACK_IMPORTED_MODULE_313__ = __webpack_require__(/*! ./zipObject.js */ "./node_modules/lodash-es/zipObject.js");
  109060. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zipObject", function() { return _zipObject_js__WEBPACK_IMPORTED_MODULE_313__["default"]; });
  109061. /* harmony import */ var _zipObjectDeep_js__WEBPACK_IMPORTED_MODULE_314__ = __webpack_require__(/*! ./zipObjectDeep.js */ "./node_modules/lodash-es/zipObjectDeep.js");
  109062. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zipObjectDeep", function() { return _zipObjectDeep_js__WEBPACK_IMPORTED_MODULE_314__["default"]; });
  109063. /* harmony import */ var _zipWith_js__WEBPACK_IMPORTED_MODULE_315__ = __webpack_require__(/*! ./zipWith.js */ "./node_modules/lodash-es/zipWith.js");
  109064. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zipWith", function() { return _zipWith_js__WEBPACK_IMPORTED_MODULE_315__["default"]; });
  109065. /* harmony import */ var _lodash_default_js__WEBPACK_IMPORTED_MODULE_316__ = __webpack_require__(/*! ./lodash.default.js */ "./node_modules/lodash-es/lodash.default.js");
  109066. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _lodash_default_js__WEBPACK_IMPORTED_MODULE_316__["default"]; });
  109067. /**
  109068. * @license
  109069. * Lodash (Custom Build) <https://lodash.com/>
  109070. * Build: `lodash modularize exports="es" -o ./`
  109071. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  109072. * Released under MIT license <https://lodash.com/license>
  109073. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  109074. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  109075. */
  109076. /***/ }),
  109077. /***/ "./node_modules/lodash-es/lowerCase.js":
  109078. /*!*********************************************!*\
  109079. !*** ./node_modules/lodash-es/lowerCase.js ***!
  109080. \*********************************************/
  109081. /*! exports provided: default */
  109082. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109083. "use strict";
  109084. __webpack_require__.r(__webpack_exports__);
  109085. /* harmony import */ var _createCompounder_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createCompounder.js */ "./node_modules/lodash-es/_createCompounder.js");
  109086. /**
  109087. * Converts `string`, as space separated words, to lower case.
  109088. *
  109089. * @static
  109090. * @memberOf _
  109091. * @since 4.0.0
  109092. * @category String
  109093. * @param {string} [string=''] The string to convert.
  109094. * @returns {string} Returns the lower cased string.
  109095. * @example
  109096. *
  109097. * _.lowerCase('--Foo-Bar--');
  109098. * // => 'foo bar'
  109099. *
  109100. * _.lowerCase('fooBar');
  109101. * // => 'foo bar'
  109102. *
  109103. * _.lowerCase('__FOO_BAR__');
  109104. * // => 'foo bar'
  109105. */
  109106. var lowerCase = Object(_createCompounder_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(result, word, index) {
  109107. return result + (index ? ' ' : '') + word.toLowerCase();
  109108. });
  109109. /* harmony default export */ __webpack_exports__["default"] = (lowerCase);
  109110. /***/ }),
  109111. /***/ "./node_modules/lodash-es/lowerFirst.js":
  109112. /*!**********************************************!*\
  109113. !*** ./node_modules/lodash-es/lowerFirst.js ***!
  109114. \**********************************************/
  109115. /*! exports provided: default */
  109116. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109117. "use strict";
  109118. __webpack_require__.r(__webpack_exports__);
  109119. /* harmony import */ var _createCaseFirst_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createCaseFirst.js */ "./node_modules/lodash-es/_createCaseFirst.js");
  109120. /**
  109121. * Converts the first character of `string` to lower case.
  109122. *
  109123. * @static
  109124. * @memberOf _
  109125. * @since 4.0.0
  109126. * @category String
  109127. * @param {string} [string=''] The string to convert.
  109128. * @returns {string} Returns the converted string.
  109129. * @example
  109130. *
  109131. * _.lowerFirst('Fred');
  109132. * // => 'fred'
  109133. *
  109134. * _.lowerFirst('FRED');
  109135. * // => 'fRED'
  109136. */
  109137. var lowerFirst = Object(_createCaseFirst_js__WEBPACK_IMPORTED_MODULE_0__["default"])('toLowerCase');
  109138. /* harmony default export */ __webpack_exports__["default"] = (lowerFirst);
  109139. /***/ }),
  109140. /***/ "./node_modules/lodash-es/lt.js":
  109141. /*!**************************************!*\
  109142. !*** ./node_modules/lodash-es/lt.js ***!
  109143. \**************************************/
  109144. /*! exports provided: default */
  109145. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109146. "use strict";
  109147. __webpack_require__.r(__webpack_exports__);
  109148. /* harmony import */ var _baseLt_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseLt.js */ "./node_modules/lodash-es/_baseLt.js");
  109149. /* harmony import */ var _createRelationalOperation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createRelationalOperation.js */ "./node_modules/lodash-es/_createRelationalOperation.js");
  109150. /**
  109151. * Checks if `value` is less than `other`.
  109152. *
  109153. * @static
  109154. * @memberOf _
  109155. * @since 3.9.0
  109156. * @category Lang
  109157. * @param {*} value The value to compare.
  109158. * @param {*} other The other value to compare.
  109159. * @returns {boolean} Returns `true` if `value` is less than `other`,
  109160. * else `false`.
  109161. * @see _.gt
  109162. * @example
  109163. *
  109164. * _.lt(1, 3);
  109165. * // => true
  109166. *
  109167. * _.lt(3, 3);
  109168. * // => false
  109169. *
  109170. * _.lt(3, 1);
  109171. * // => false
  109172. */
  109173. var lt = Object(_createRelationalOperation_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_baseLt_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  109174. /* harmony default export */ __webpack_exports__["default"] = (lt);
  109175. /***/ }),
  109176. /***/ "./node_modules/lodash-es/lte.js":
  109177. /*!***************************************!*\
  109178. !*** ./node_modules/lodash-es/lte.js ***!
  109179. \***************************************/
  109180. /*! exports provided: default */
  109181. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109182. "use strict";
  109183. __webpack_require__.r(__webpack_exports__);
  109184. /* harmony import */ var _createRelationalOperation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createRelationalOperation.js */ "./node_modules/lodash-es/_createRelationalOperation.js");
  109185. /**
  109186. * Checks if `value` is less than or equal to `other`.
  109187. *
  109188. * @static
  109189. * @memberOf _
  109190. * @since 3.9.0
  109191. * @category Lang
  109192. * @param {*} value The value to compare.
  109193. * @param {*} other The other value to compare.
  109194. * @returns {boolean} Returns `true` if `value` is less than or equal to
  109195. * `other`, else `false`.
  109196. * @see _.gte
  109197. * @example
  109198. *
  109199. * _.lte(1, 3);
  109200. * // => true
  109201. *
  109202. * _.lte(3, 3);
  109203. * // => true
  109204. *
  109205. * _.lte(3, 1);
  109206. * // => false
  109207. */
  109208. var lte = Object(_createRelationalOperation_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(value, other) {
  109209. return value <= other;
  109210. });
  109211. /* harmony default export */ __webpack_exports__["default"] = (lte);
  109212. /***/ }),
  109213. /***/ "./node_modules/lodash-es/map.js":
  109214. /*!***************************************!*\
  109215. !*** ./node_modules/lodash-es/map.js ***!
  109216. \***************************************/
  109217. /*! exports provided: default */
  109218. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109219. "use strict";
  109220. __webpack_require__.r(__webpack_exports__);
  109221. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  109222. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  109223. /* harmony import */ var _baseMap_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseMap.js */ "./node_modules/lodash-es/_baseMap.js");
  109224. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  109225. /**
  109226. * Creates an array of values by running each element in `collection` thru
  109227. * `iteratee`. The iteratee is invoked with three arguments:
  109228. * (value, index|key, collection).
  109229. *
  109230. * Many lodash methods are guarded to work as iteratees for methods like
  109231. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  109232. *
  109233. * The guarded methods are:
  109234. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  109235. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  109236. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  109237. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  109238. *
  109239. * @static
  109240. * @memberOf _
  109241. * @since 0.1.0
  109242. * @category Collection
  109243. * @param {Array|Object} collection The collection to iterate over.
  109244. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  109245. * @returns {Array} Returns the new mapped array.
  109246. * @example
  109247. *
  109248. * function square(n) {
  109249. * return n * n;
  109250. * }
  109251. *
  109252. * _.map([4, 8], square);
  109253. * // => [16, 64]
  109254. *
  109255. * _.map({ 'a': 4, 'b': 8 }, square);
  109256. * // => [16, 64] (iteration order is not guaranteed)
  109257. *
  109258. * var users = [
  109259. * { 'user': 'barney' },
  109260. * { 'user': 'fred' }
  109261. * ];
  109262. *
  109263. * // The `_.property` iteratee shorthand.
  109264. * _.map(users, 'user');
  109265. * // => ['barney', 'fred']
  109266. */
  109267. function map(collection, iteratee) {
  109268. var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection) ? _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseMap_js__WEBPACK_IMPORTED_MODULE_2__["default"];
  109269. return func(collection, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratee, 3));
  109270. }
  109271. /* harmony default export */ __webpack_exports__["default"] = (map);
  109272. /***/ }),
  109273. /***/ "./node_modules/lodash-es/mapKeys.js":
  109274. /*!*******************************************!*\
  109275. !*** ./node_modules/lodash-es/mapKeys.js ***!
  109276. \*******************************************/
  109277. /*! exports provided: default */
  109278. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109279. "use strict";
  109280. __webpack_require__.r(__webpack_exports__);
  109281. /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
  109282. /* harmony import */ var _baseForOwn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseForOwn.js */ "./node_modules/lodash-es/_baseForOwn.js");
  109283. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  109284. /**
  109285. * The opposite of `_.mapValues`; this method creates an object with the
  109286. * same values as `object` and keys generated by running each own enumerable
  109287. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  109288. * with three arguments: (value, key, object).
  109289. *
  109290. * @static
  109291. * @memberOf _
  109292. * @since 3.8.0
  109293. * @category Object
  109294. * @param {Object} object The object to iterate over.
  109295. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  109296. * @returns {Object} Returns the new mapped object.
  109297. * @see _.mapValues
  109298. * @example
  109299. *
  109300. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  109301. * return key + value;
  109302. * });
  109303. * // => { 'a1': 1, 'b2': 2 }
  109304. */
  109305. function mapKeys(object, iteratee) {
  109306. var result = {};
  109307. iteratee = Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee, 3);
  109308. Object(_baseForOwn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, function(value, key, object) {
  109309. Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, iteratee(value, key, object), value);
  109310. });
  109311. return result;
  109312. }
  109313. /* harmony default export */ __webpack_exports__["default"] = (mapKeys);
  109314. /***/ }),
  109315. /***/ "./node_modules/lodash-es/mapValues.js":
  109316. /*!*********************************************!*\
  109317. !*** ./node_modules/lodash-es/mapValues.js ***!
  109318. \*********************************************/
  109319. /*! exports provided: default */
  109320. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109321. "use strict";
  109322. __webpack_require__.r(__webpack_exports__);
  109323. /* harmony import */ var _baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseAssignValue.js */ "./node_modules/lodash-es/_baseAssignValue.js");
  109324. /* harmony import */ var _baseForOwn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseForOwn.js */ "./node_modules/lodash-es/_baseForOwn.js");
  109325. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  109326. /**
  109327. * Creates an object with the same keys as `object` and values generated
  109328. * by running each own enumerable string keyed property of `object` thru
  109329. * `iteratee`. The iteratee is invoked with three arguments:
  109330. * (value, key, object).
  109331. *
  109332. * @static
  109333. * @memberOf _
  109334. * @since 2.4.0
  109335. * @category Object
  109336. * @param {Object} object The object to iterate over.
  109337. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  109338. * @returns {Object} Returns the new mapped object.
  109339. * @see _.mapKeys
  109340. * @example
  109341. *
  109342. * var users = {
  109343. * 'fred': { 'user': 'fred', 'age': 40 },
  109344. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  109345. * };
  109346. *
  109347. * _.mapValues(users, function(o) { return o.age; });
  109348. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  109349. *
  109350. * // The `_.property` iteratee shorthand.
  109351. * _.mapValues(users, 'age');
  109352. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  109353. */
  109354. function mapValues(object, iteratee) {
  109355. var result = {};
  109356. iteratee = Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee, 3);
  109357. Object(_baseForOwn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object, function(value, key, object) {
  109358. Object(_baseAssignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(result, key, iteratee(value, key, object));
  109359. });
  109360. return result;
  109361. }
  109362. /* harmony default export */ __webpack_exports__["default"] = (mapValues);
  109363. /***/ }),
  109364. /***/ "./node_modules/lodash-es/matches.js":
  109365. /*!*******************************************!*\
  109366. !*** ./node_modules/lodash-es/matches.js ***!
  109367. \*******************************************/
  109368. /*! exports provided: default */
  109369. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109370. "use strict";
  109371. __webpack_require__.r(__webpack_exports__);
  109372. /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
  109373. /* harmony import */ var _baseMatches_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseMatches.js */ "./node_modules/lodash-es/_baseMatches.js");
  109374. /** Used to compose bitmasks for cloning. */
  109375. var CLONE_DEEP_FLAG = 1;
  109376. /**
  109377. * Creates a function that performs a partial deep comparison between a given
  109378. * object and `source`, returning `true` if the given object has equivalent
  109379. * property values, else `false`.
  109380. *
  109381. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  109382. * partially applied.
  109383. *
  109384. * Partial comparisons will match empty array and empty object `source`
  109385. * values against any array or object value, respectively. See `_.isEqual`
  109386. * for a list of supported value comparisons.
  109387. *
  109388. * **Note:** Multiple values can be checked by combining several matchers
  109389. * using `_.overSome`
  109390. *
  109391. * @static
  109392. * @memberOf _
  109393. * @since 3.0.0
  109394. * @category Util
  109395. * @param {Object} source The object of property values to match.
  109396. * @returns {Function} Returns the new spec function.
  109397. * @example
  109398. *
  109399. * var objects = [
  109400. * { 'a': 1, 'b': 2, 'c': 3 },
  109401. * { 'a': 4, 'b': 5, 'c': 6 }
  109402. * ];
  109403. *
  109404. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  109405. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  109406. *
  109407. * // Checking for several possible values
  109408. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  109409. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  109410. */
  109411. function matches(source) {
  109412. return Object(_baseMatches_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_baseClone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(source, CLONE_DEEP_FLAG));
  109413. }
  109414. /* harmony default export */ __webpack_exports__["default"] = (matches);
  109415. /***/ }),
  109416. /***/ "./node_modules/lodash-es/matchesProperty.js":
  109417. /*!***************************************************!*\
  109418. !*** ./node_modules/lodash-es/matchesProperty.js ***!
  109419. \***************************************************/
  109420. /*! exports provided: default */
  109421. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109422. "use strict";
  109423. __webpack_require__.r(__webpack_exports__);
  109424. /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
  109425. /* harmony import */ var _baseMatchesProperty_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseMatchesProperty.js */ "./node_modules/lodash-es/_baseMatchesProperty.js");
  109426. /** Used to compose bitmasks for cloning. */
  109427. var CLONE_DEEP_FLAG = 1;
  109428. /**
  109429. * Creates a function that performs a partial deep comparison between the
  109430. * value at `path` of a given object to `srcValue`, returning `true` if the
  109431. * object value is equivalent, else `false`.
  109432. *
  109433. * **Note:** Partial comparisons will match empty array and empty object
  109434. * `srcValue` values against any array or object value, respectively. See
  109435. * `_.isEqual` for a list of supported value comparisons.
  109436. *
  109437. * **Note:** Multiple values can be checked by combining several matchers
  109438. * using `_.overSome`
  109439. *
  109440. * @static
  109441. * @memberOf _
  109442. * @since 3.2.0
  109443. * @category Util
  109444. * @param {Array|string} path The path of the property to get.
  109445. * @param {*} srcValue The value to match.
  109446. * @returns {Function} Returns the new spec function.
  109447. * @example
  109448. *
  109449. * var objects = [
  109450. * { 'a': 1, 'b': 2, 'c': 3 },
  109451. * { 'a': 4, 'b': 5, 'c': 6 }
  109452. * ];
  109453. *
  109454. * _.find(objects, _.matchesProperty('a', 4));
  109455. * // => { 'a': 4, 'b': 5, 'c': 6 }
  109456. *
  109457. * // Checking for several possible values
  109458. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  109459. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  109460. */
  109461. function matchesProperty(path, srcValue) {
  109462. return Object(_baseMatchesProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(path, Object(_baseClone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(srcValue, CLONE_DEEP_FLAG));
  109463. }
  109464. /* harmony default export */ __webpack_exports__["default"] = (matchesProperty);
  109465. /***/ }),
  109466. /***/ "./node_modules/lodash-es/math.default.js":
  109467. /*!************************************************!*\
  109468. !*** ./node_modules/lodash-es/math.default.js ***!
  109469. \************************************************/
  109470. /*! exports provided: default */
  109471. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109472. "use strict";
  109473. __webpack_require__.r(__webpack_exports__);
  109474. /* harmony import */ var _add_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./add.js */ "./node_modules/lodash-es/add.js");
  109475. /* harmony import */ var _ceil_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ceil.js */ "./node_modules/lodash-es/ceil.js");
  109476. /* harmony import */ var _divide_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./divide.js */ "./node_modules/lodash-es/divide.js");
  109477. /* harmony import */ var _floor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./floor.js */ "./node_modules/lodash-es/floor.js");
  109478. /* harmony import */ var _max_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./max.js */ "./node_modules/lodash-es/max.js");
  109479. /* harmony import */ var _maxBy_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./maxBy.js */ "./node_modules/lodash-es/maxBy.js");
  109480. /* harmony import */ var _mean_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./mean.js */ "./node_modules/lodash-es/mean.js");
  109481. /* harmony import */ var _meanBy_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./meanBy.js */ "./node_modules/lodash-es/meanBy.js");
  109482. /* harmony import */ var _min_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./min.js */ "./node_modules/lodash-es/min.js");
  109483. /* harmony import */ var _minBy_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./minBy.js */ "./node_modules/lodash-es/minBy.js");
  109484. /* harmony import */ var _multiply_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./multiply.js */ "./node_modules/lodash-es/multiply.js");
  109485. /* harmony import */ var _round_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./round.js */ "./node_modules/lodash-es/round.js");
  109486. /* harmony import */ var _subtract_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./subtract.js */ "./node_modules/lodash-es/subtract.js");
  109487. /* harmony import */ var _sum_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./sum.js */ "./node_modules/lodash-es/sum.js");
  109488. /* harmony import */ var _sumBy_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./sumBy.js */ "./node_modules/lodash-es/sumBy.js");
  109489. /* harmony default export */ __webpack_exports__["default"] = ({
  109490. add: _add_js__WEBPACK_IMPORTED_MODULE_0__["default"], ceil: _ceil_js__WEBPACK_IMPORTED_MODULE_1__["default"], divide: _divide_js__WEBPACK_IMPORTED_MODULE_2__["default"], floor: _floor_js__WEBPACK_IMPORTED_MODULE_3__["default"], max: _max_js__WEBPACK_IMPORTED_MODULE_4__["default"],
  109491. maxBy: _maxBy_js__WEBPACK_IMPORTED_MODULE_5__["default"], mean: _mean_js__WEBPACK_IMPORTED_MODULE_6__["default"], meanBy: _meanBy_js__WEBPACK_IMPORTED_MODULE_7__["default"], min: _min_js__WEBPACK_IMPORTED_MODULE_8__["default"], minBy: _minBy_js__WEBPACK_IMPORTED_MODULE_9__["default"],
  109492. multiply: _multiply_js__WEBPACK_IMPORTED_MODULE_10__["default"], round: _round_js__WEBPACK_IMPORTED_MODULE_11__["default"], subtract: _subtract_js__WEBPACK_IMPORTED_MODULE_12__["default"], sum: _sum_js__WEBPACK_IMPORTED_MODULE_13__["default"], sumBy: _sumBy_js__WEBPACK_IMPORTED_MODULE_14__["default"]
  109493. });
  109494. /***/ }),
  109495. /***/ "./node_modules/lodash-es/math.js":
  109496. /*!****************************************!*\
  109497. !*** ./node_modules/lodash-es/math.js ***!
  109498. \****************************************/
  109499. /*! exports provided: add, ceil, divide, floor, max, maxBy, mean, meanBy, min, minBy, multiply, round, subtract, sum, sumBy, default */
  109500. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109501. "use strict";
  109502. __webpack_require__.r(__webpack_exports__);
  109503. /* harmony import */ var _add_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./add.js */ "./node_modules/lodash-es/add.js");
  109504. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "add", function() { return _add_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  109505. /* harmony import */ var _ceil_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ceil.js */ "./node_modules/lodash-es/ceil.js");
  109506. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ceil", function() { return _ceil_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  109507. /* harmony import */ var _divide_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./divide.js */ "./node_modules/lodash-es/divide.js");
  109508. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "divide", function() { return _divide_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  109509. /* harmony import */ var _floor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./floor.js */ "./node_modules/lodash-es/floor.js");
  109510. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "floor", function() { return _floor_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  109511. /* harmony import */ var _max_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./max.js */ "./node_modules/lodash-es/max.js");
  109512. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "max", function() { return _max_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  109513. /* harmony import */ var _maxBy_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./maxBy.js */ "./node_modules/lodash-es/maxBy.js");
  109514. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "maxBy", function() { return _maxBy_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  109515. /* harmony import */ var _mean_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./mean.js */ "./node_modules/lodash-es/mean.js");
  109516. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mean", function() { return _mean_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  109517. /* harmony import */ var _meanBy_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./meanBy.js */ "./node_modules/lodash-es/meanBy.js");
  109518. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "meanBy", function() { return _meanBy_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  109519. /* harmony import */ var _min_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./min.js */ "./node_modules/lodash-es/min.js");
  109520. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "min", function() { return _min_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  109521. /* harmony import */ var _minBy_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./minBy.js */ "./node_modules/lodash-es/minBy.js");
  109522. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "minBy", function() { return _minBy_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  109523. /* harmony import */ var _multiply_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./multiply.js */ "./node_modules/lodash-es/multiply.js");
  109524. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "multiply", function() { return _multiply_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  109525. /* harmony import */ var _round_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./round.js */ "./node_modules/lodash-es/round.js");
  109526. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "round", function() { return _round_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  109527. /* harmony import */ var _subtract_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./subtract.js */ "./node_modules/lodash-es/subtract.js");
  109528. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "subtract", function() { return _subtract_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  109529. /* harmony import */ var _sum_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./sum.js */ "./node_modules/lodash-es/sum.js");
  109530. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sum", function() { return _sum_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  109531. /* harmony import */ var _sumBy_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./sumBy.js */ "./node_modules/lodash-es/sumBy.js");
  109532. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sumBy", function() { return _sumBy_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  109533. /* harmony import */ var _math_default_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./math.default.js */ "./node_modules/lodash-es/math.default.js");
  109534. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _math_default_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
  109535. /***/ }),
  109536. /***/ "./node_modules/lodash-es/max.js":
  109537. /*!***************************************!*\
  109538. !*** ./node_modules/lodash-es/max.js ***!
  109539. \***************************************/
  109540. /*! exports provided: default */
  109541. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109542. "use strict";
  109543. __webpack_require__.r(__webpack_exports__);
  109544. /* harmony import */ var _baseExtremum_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseExtremum.js */ "./node_modules/lodash-es/_baseExtremum.js");
  109545. /* harmony import */ var _baseGt_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseGt.js */ "./node_modules/lodash-es/_baseGt.js");
  109546. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  109547. /**
  109548. * Computes the maximum value of `array`. If `array` is empty or falsey,
  109549. * `undefined` is returned.
  109550. *
  109551. * @static
  109552. * @since 0.1.0
  109553. * @memberOf _
  109554. * @category Math
  109555. * @param {Array} array The array to iterate over.
  109556. * @returns {*} Returns the maximum value.
  109557. * @example
  109558. *
  109559. * _.max([4, 2, 8, 6]);
  109560. * // => 8
  109561. *
  109562. * _.max([]);
  109563. * // => undefined
  109564. */
  109565. function max(array) {
  109566. return (array && array.length)
  109567. ? Object(_baseExtremum_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, _identity_js__WEBPACK_IMPORTED_MODULE_2__["default"], _baseGt_js__WEBPACK_IMPORTED_MODULE_1__["default"])
  109568. : undefined;
  109569. }
  109570. /* harmony default export */ __webpack_exports__["default"] = (max);
  109571. /***/ }),
  109572. /***/ "./node_modules/lodash-es/maxBy.js":
  109573. /*!*****************************************!*\
  109574. !*** ./node_modules/lodash-es/maxBy.js ***!
  109575. \*****************************************/
  109576. /*! exports provided: default */
  109577. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109578. "use strict";
  109579. __webpack_require__.r(__webpack_exports__);
  109580. /* harmony import */ var _baseExtremum_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseExtremum.js */ "./node_modules/lodash-es/_baseExtremum.js");
  109581. /* harmony import */ var _baseGt_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseGt.js */ "./node_modules/lodash-es/_baseGt.js");
  109582. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  109583. /**
  109584. * This method is like `_.max` except that it accepts `iteratee` which is
  109585. * invoked for each element in `array` to generate the criterion by which
  109586. * the value is ranked. The iteratee is invoked with one argument: (value).
  109587. *
  109588. * @static
  109589. * @memberOf _
  109590. * @since 4.0.0
  109591. * @category Math
  109592. * @param {Array} array The array to iterate over.
  109593. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  109594. * @returns {*} Returns the maximum value.
  109595. * @example
  109596. *
  109597. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  109598. *
  109599. * _.maxBy(objects, function(o) { return o.n; });
  109600. * // => { 'n': 2 }
  109601. *
  109602. * // The `_.property` iteratee shorthand.
  109603. * _.maxBy(objects, 'n');
  109604. * // => { 'n': 2 }
  109605. */
  109606. function maxBy(array, iteratee) {
  109607. return (array && array.length)
  109608. ? Object(_baseExtremum_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee, 2), _baseGt_js__WEBPACK_IMPORTED_MODULE_1__["default"])
  109609. : undefined;
  109610. }
  109611. /* harmony default export */ __webpack_exports__["default"] = (maxBy);
  109612. /***/ }),
  109613. /***/ "./node_modules/lodash-es/mean.js":
  109614. /*!****************************************!*\
  109615. !*** ./node_modules/lodash-es/mean.js ***!
  109616. \****************************************/
  109617. /*! exports provided: default */
  109618. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109619. "use strict";
  109620. __webpack_require__.r(__webpack_exports__);
  109621. /* harmony import */ var _baseMean_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseMean.js */ "./node_modules/lodash-es/_baseMean.js");
  109622. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  109623. /**
  109624. * Computes the mean of the values in `array`.
  109625. *
  109626. * @static
  109627. * @memberOf _
  109628. * @since 4.0.0
  109629. * @category Math
  109630. * @param {Array} array The array to iterate over.
  109631. * @returns {number} Returns the mean.
  109632. * @example
  109633. *
  109634. * _.mean([4, 2, 8, 6]);
  109635. * // => 5
  109636. */
  109637. function mean(array) {
  109638. return Object(_baseMean_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, _identity_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  109639. }
  109640. /* harmony default export */ __webpack_exports__["default"] = (mean);
  109641. /***/ }),
  109642. /***/ "./node_modules/lodash-es/meanBy.js":
  109643. /*!******************************************!*\
  109644. !*** ./node_modules/lodash-es/meanBy.js ***!
  109645. \******************************************/
  109646. /*! exports provided: default */
  109647. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109648. "use strict";
  109649. __webpack_require__.r(__webpack_exports__);
  109650. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  109651. /* harmony import */ var _baseMean_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseMean.js */ "./node_modules/lodash-es/_baseMean.js");
  109652. /**
  109653. * This method is like `_.mean` except that it accepts `iteratee` which is
  109654. * invoked for each element in `array` to generate the value to be averaged.
  109655. * The iteratee is invoked with one argument: (value).
  109656. *
  109657. * @static
  109658. * @memberOf _
  109659. * @since 4.7.0
  109660. * @category Math
  109661. * @param {Array} array The array to iterate over.
  109662. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  109663. * @returns {number} Returns the mean.
  109664. * @example
  109665. *
  109666. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  109667. *
  109668. * _.meanBy(objects, function(o) { return o.n; });
  109669. * // => 5
  109670. *
  109671. * // The `_.property` iteratee shorthand.
  109672. * _.meanBy(objects, 'n');
  109673. * // => 5
  109674. */
  109675. function meanBy(array, iteratee) {
  109676. return Object(_baseMean_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, 2));
  109677. }
  109678. /* harmony default export */ __webpack_exports__["default"] = (meanBy);
  109679. /***/ }),
  109680. /***/ "./node_modules/lodash-es/memoize.js":
  109681. /*!*******************************************!*\
  109682. !*** ./node_modules/lodash-es/memoize.js ***!
  109683. \*******************************************/
  109684. /*! exports provided: default */
  109685. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109686. "use strict";
  109687. __webpack_require__.r(__webpack_exports__);
  109688. /* harmony import */ var _MapCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_MapCache.js */ "./node_modules/lodash-es/_MapCache.js");
  109689. /** Error message constants. */
  109690. var FUNC_ERROR_TEXT = 'Expected a function';
  109691. /**
  109692. * Creates a function that memoizes the result of `func`. If `resolver` is
  109693. * provided, it determines the cache key for storing the result based on the
  109694. * arguments provided to the memoized function. By default, the first argument
  109695. * provided to the memoized function is used as the map cache key. The `func`
  109696. * is invoked with the `this` binding of the memoized function.
  109697. *
  109698. * **Note:** The cache is exposed as the `cache` property on the memoized
  109699. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  109700. * constructor with one whose instances implement the
  109701. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  109702. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  109703. *
  109704. * @static
  109705. * @memberOf _
  109706. * @since 0.1.0
  109707. * @category Function
  109708. * @param {Function} func The function to have its output memoized.
  109709. * @param {Function} [resolver] The function to resolve the cache key.
  109710. * @returns {Function} Returns the new memoized function.
  109711. * @example
  109712. *
  109713. * var object = { 'a': 1, 'b': 2 };
  109714. * var other = { 'c': 3, 'd': 4 };
  109715. *
  109716. * var values = _.memoize(_.values);
  109717. * values(object);
  109718. * // => [1, 2]
  109719. *
  109720. * values(other);
  109721. * // => [3, 4]
  109722. *
  109723. * object.a = 2;
  109724. * values(object);
  109725. * // => [1, 2]
  109726. *
  109727. * // Modify the result cache.
  109728. * values.cache.set(object, ['a', 'b']);
  109729. * values(object);
  109730. * // => ['a', 'b']
  109731. *
  109732. * // Replace `_.memoize.Cache`.
  109733. * _.memoize.Cache = WeakMap;
  109734. */
  109735. function memoize(func, resolver) {
  109736. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  109737. throw new TypeError(FUNC_ERROR_TEXT);
  109738. }
  109739. var memoized = function() {
  109740. var args = arguments,
  109741. key = resolver ? resolver.apply(this, args) : args[0],
  109742. cache = memoized.cache;
  109743. if (cache.has(key)) {
  109744. return cache.get(key);
  109745. }
  109746. var result = func.apply(this, args);
  109747. memoized.cache = cache.set(key, result) || cache;
  109748. return result;
  109749. };
  109750. memoized.cache = new (memoize.Cache || _MapCache_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  109751. return memoized;
  109752. }
  109753. // Expose `MapCache`.
  109754. memoize.Cache = _MapCache_js__WEBPACK_IMPORTED_MODULE_0__["default"];
  109755. /* harmony default export */ __webpack_exports__["default"] = (memoize);
  109756. /***/ }),
  109757. /***/ "./node_modules/lodash-es/merge.js":
  109758. /*!*****************************************!*\
  109759. !*** ./node_modules/lodash-es/merge.js ***!
  109760. \*****************************************/
  109761. /*! exports provided: default */
  109762. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109763. "use strict";
  109764. __webpack_require__.r(__webpack_exports__);
  109765. /* harmony import */ var _baseMerge_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseMerge.js */ "./node_modules/lodash-es/_baseMerge.js");
  109766. /* harmony import */ var _createAssigner_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createAssigner.js */ "./node_modules/lodash-es/_createAssigner.js");
  109767. /**
  109768. * This method is like `_.assign` except that it recursively merges own and
  109769. * inherited enumerable string keyed properties of source objects into the
  109770. * destination object. Source properties that resolve to `undefined` are
  109771. * skipped if a destination value exists. Array and plain object properties
  109772. * are merged recursively. Other objects and value types are overridden by
  109773. * assignment. Source objects are applied from left to right. Subsequent
  109774. * sources overwrite property assignments of previous sources.
  109775. *
  109776. * **Note:** This method mutates `object`.
  109777. *
  109778. * @static
  109779. * @memberOf _
  109780. * @since 0.5.0
  109781. * @category Object
  109782. * @param {Object} object The destination object.
  109783. * @param {...Object} [sources] The source objects.
  109784. * @returns {Object} Returns `object`.
  109785. * @example
  109786. *
  109787. * var object = {
  109788. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  109789. * };
  109790. *
  109791. * var other = {
  109792. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  109793. * };
  109794. *
  109795. * _.merge(object, other);
  109796. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  109797. */
  109798. var merge = Object(_createAssigner_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(object, source, srcIndex) {
  109799. Object(_baseMerge_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, source, srcIndex);
  109800. });
  109801. /* harmony default export */ __webpack_exports__["default"] = (merge);
  109802. /***/ }),
  109803. /***/ "./node_modules/lodash-es/mergeWith.js":
  109804. /*!*********************************************!*\
  109805. !*** ./node_modules/lodash-es/mergeWith.js ***!
  109806. \*********************************************/
  109807. /*! exports provided: default */
  109808. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109809. "use strict";
  109810. __webpack_require__.r(__webpack_exports__);
  109811. /* harmony import */ var _baseMerge_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseMerge.js */ "./node_modules/lodash-es/_baseMerge.js");
  109812. /* harmony import */ var _createAssigner_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createAssigner.js */ "./node_modules/lodash-es/_createAssigner.js");
  109813. /**
  109814. * This method is like `_.merge` except that it accepts `customizer` which
  109815. * is invoked to produce the merged values of the destination and source
  109816. * properties. If `customizer` returns `undefined`, merging is handled by the
  109817. * method instead. The `customizer` is invoked with six arguments:
  109818. * (objValue, srcValue, key, object, source, stack).
  109819. *
  109820. * **Note:** This method mutates `object`.
  109821. *
  109822. * @static
  109823. * @memberOf _
  109824. * @since 4.0.0
  109825. * @category Object
  109826. * @param {Object} object The destination object.
  109827. * @param {...Object} sources The source objects.
  109828. * @param {Function} customizer The function to customize assigned values.
  109829. * @returns {Object} Returns `object`.
  109830. * @example
  109831. *
  109832. * function customizer(objValue, srcValue) {
  109833. * if (_.isArray(objValue)) {
  109834. * return objValue.concat(srcValue);
  109835. * }
  109836. * }
  109837. *
  109838. * var object = { 'a': [1], 'b': [2] };
  109839. * var other = { 'a': [3], 'b': [4] };
  109840. *
  109841. * _.mergeWith(object, other, customizer);
  109842. * // => { 'a': [1, 3], 'b': [2, 4] }
  109843. */
  109844. var mergeWith = Object(_createAssigner_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(object, source, srcIndex, customizer) {
  109845. Object(_baseMerge_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, source, srcIndex, customizer);
  109846. });
  109847. /* harmony default export */ __webpack_exports__["default"] = (mergeWith);
  109848. /***/ }),
  109849. /***/ "./node_modules/lodash-es/method.js":
  109850. /*!******************************************!*\
  109851. !*** ./node_modules/lodash-es/method.js ***!
  109852. \******************************************/
  109853. /*! exports provided: default */
  109854. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109855. "use strict";
  109856. __webpack_require__.r(__webpack_exports__);
  109857. /* harmony import */ var _baseInvoke_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseInvoke.js */ "./node_modules/lodash-es/_baseInvoke.js");
  109858. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  109859. /**
  109860. * Creates a function that invokes the method at `path` of a given object.
  109861. * Any additional arguments are provided to the invoked method.
  109862. *
  109863. * @static
  109864. * @memberOf _
  109865. * @since 3.7.0
  109866. * @category Util
  109867. * @param {Array|string} path The path of the method to invoke.
  109868. * @param {...*} [args] The arguments to invoke the method with.
  109869. * @returns {Function} Returns the new invoker function.
  109870. * @example
  109871. *
  109872. * var objects = [
  109873. * { 'a': { 'b': _.constant(2) } },
  109874. * { 'a': { 'b': _.constant(1) } }
  109875. * ];
  109876. *
  109877. * _.map(objects, _.method('a.b'));
  109878. * // => [2, 1]
  109879. *
  109880. * _.map(objects, _.method(['a', 'b']));
  109881. * // => [2, 1]
  109882. */
  109883. var method = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(path, args) {
  109884. return function(object) {
  109885. return Object(_baseInvoke_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path, args);
  109886. };
  109887. });
  109888. /* harmony default export */ __webpack_exports__["default"] = (method);
  109889. /***/ }),
  109890. /***/ "./node_modules/lodash-es/methodOf.js":
  109891. /*!********************************************!*\
  109892. !*** ./node_modules/lodash-es/methodOf.js ***!
  109893. \********************************************/
  109894. /*! exports provided: default */
  109895. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109896. "use strict";
  109897. __webpack_require__.r(__webpack_exports__);
  109898. /* harmony import */ var _baseInvoke_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseInvoke.js */ "./node_modules/lodash-es/_baseInvoke.js");
  109899. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  109900. /**
  109901. * The opposite of `_.method`; this method creates a function that invokes
  109902. * the method at a given path of `object`. Any additional arguments are
  109903. * provided to the invoked method.
  109904. *
  109905. * @static
  109906. * @memberOf _
  109907. * @since 3.7.0
  109908. * @category Util
  109909. * @param {Object} object The object to query.
  109910. * @param {...*} [args] The arguments to invoke the method with.
  109911. * @returns {Function} Returns the new invoker function.
  109912. * @example
  109913. *
  109914. * var array = _.times(3, _.constant),
  109915. * object = { 'a': array, 'b': array, 'c': array };
  109916. *
  109917. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  109918. * // => [2, 0]
  109919. *
  109920. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  109921. * // => [2, 0]
  109922. */
  109923. var methodOf = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(object, args) {
  109924. return function(path) {
  109925. return Object(_baseInvoke_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path, args);
  109926. };
  109927. });
  109928. /* harmony default export */ __webpack_exports__["default"] = (methodOf);
  109929. /***/ }),
  109930. /***/ "./node_modules/lodash-es/min.js":
  109931. /*!***************************************!*\
  109932. !*** ./node_modules/lodash-es/min.js ***!
  109933. \***************************************/
  109934. /*! exports provided: default */
  109935. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109936. "use strict";
  109937. __webpack_require__.r(__webpack_exports__);
  109938. /* harmony import */ var _baseExtremum_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseExtremum.js */ "./node_modules/lodash-es/_baseExtremum.js");
  109939. /* harmony import */ var _baseLt_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseLt.js */ "./node_modules/lodash-es/_baseLt.js");
  109940. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  109941. /**
  109942. * Computes the minimum value of `array`. If `array` is empty or falsey,
  109943. * `undefined` is returned.
  109944. *
  109945. * @static
  109946. * @since 0.1.0
  109947. * @memberOf _
  109948. * @category Math
  109949. * @param {Array} array The array to iterate over.
  109950. * @returns {*} Returns the minimum value.
  109951. * @example
  109952. *
  109953. * _.min([4, 2, 8, 6]);
  109954. * // => 2
  109955. *
  109956. * _.min([]);
  109957. * // => undefined
  109958. */
  109959. function min(array) {
  109960. return (array && array.length)
  109961. ? Object(_baseExtremum_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, _identity_js__WEBPACK_IMPORTED_MODULE_2__["default"], _baseLt_js__WEBPACK_IMPORTED_MODULE_1__["default"])
  109962. : undefined;
  109963. }
  109964. /* harmony default export */ __webpack_exports__["default"] = (min);
  109965. /***/ }),
  109966. /***/ "./node_modules/lodash-es/minBy.js":
  109967. /*!*****************************************!*\
  109968. !*** ./node_modules/lodash-es/minBy.js ***!
  109969. \*****************************************/
  109970. /*! exports provided: default */
  109971. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109972. "use strict";
  109973. __webpack_require__.r(__webpack_exports__);
  109974. /* harmony import */ var _baseExtremum_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseExtremum.js */ "./node_modules/lodash-es/_baseExtremum.js");
  109975. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  109976. /* harmony import */ var _baseLt_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseLt.js */ "./node_modules/lodash-es/_baseLt.js");
  109977. /**
  109978. * This method is like `_.min` except that it accepts `iteratee` which is
  109979. * invoked for each element in `array` to generate the criterion by which
  109980. * the value is ranked. The iteratee is invoked with one argument: (value).
  109981. *
  109982. * @static
  109983. * @memberOf _
  109984. * @since 4.0.0
  109985. * @category Math
  109986. * @param {Array} array The array to iterate over.
  109987. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  109988. * @returns {*} Returns the minimum value.
  109989. * @example
  109990. *
  109991. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  109992. *
  109993. * _.minBy(objects, function(o) { return o.n; });
  109994. * // => { 'n': 1 }
  109995. *
  109996. * // The `_.property` iteratee shorthand.
  109997. * _.minBy(objects, 'n');
  109998. * // => { 'n': 1 }
  109999. */
  110000. function minBy(array, iteratee) {
  110001. return (array && array.length)
  110002. ? Object(_baseExtremum_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratee, 2), _baseLt_js__WEBPACK_IMPORTED_MODULE_2__["default"])
  110003. : undefined;
  110004. }
  110005. /* harmony default export */ __webpack_exports__["default"] = (minBy);
  110006. /***/ }),
  110007. /***/ "./node_modules/lodash-es/mixin.js":
  110008. /*!*****************************************!*\
  110009. !*** ./node_modules/lodash-es/mixin.js ***!
  110010. \*****************************************/
  110011. /*! exports provided: default */
  110012. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110013. "use strict";
  110014. __webpack_require__.r(__webpack_exports__);
  110015. /* harmony import */ var _arrayEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayEach.js */ "./node_modules/lodash-es/_arrayEach.js");
  110016. /* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayPush.js */ "./node_modules/lodash-es/_arrayPush.js");
  110017. /* harmony import */ var _baseFunctions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseFunctions.js */ "./node_modules/lodash-es/_baseFunctions.js");
  110018. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  110019. /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
  110020. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  110021. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  110022. /**
  110023. * Adds all own enumerable string keyed function properties of a source
  110024. * object to the destination object. If `object` is a function, then methods
  110025. * are added to its prototype as well.
  110026. *
  110027. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  110028. * avoid conflicts caused by modifying the original.
  110029. *
  110030. * @static
  110031. * @since 0.1.0
  110032. * @memberOf _
  110033. * @category Util
  110034. * @param {Function|Object} [object=lodash] The destination object.
  110035. * @param {Object} source The object of functions to add.
  110036. * @param {Object} [options={}] The options object.
  110037. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  110038. * @returns {Function|Object} Returns `object`.
  110039. * @example
  110040. *
  110041. * function vowels(string) {
  110042. * return _.filter(string, function(v) {
  110043. * return /[aeiou]/i.test(v);
  110044. * });
  110045. * }
  110046. *
  110047. * _.mixin({ 'vowels': vowels });
  110048. * _.vowels('fred');
  110049. * // => ['e']
  110050. *
  110051. * _('fred').vowels().value();
  110052. * // => ['e']
  110053. *
  110054. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  110055. * _('fred').vowels();
  110056. * // => ['e']
  110057. */
  110058. function mixin(object, source, options) {
  110059. var props = Object(_keys_js__WEBPACK_IMPORTED_MODULE_6__["default"])(source),
  110060. methodNames = Object(_baseFunctions_js__WEBPACK_IMPORTED_MODULE_2__["default"])(source, props);
  110061. var chain = !(Object(_isObject_js__WEBPACK_IMPORTED_MODULE_5__["default"])(options) && 'chain' in options) || !!options.chain,
  110062. isFunc = Object(_isFunction_js__WEBPACK_IMPORTED_MODULE_4__["default"])(object);
  110063. Object(_arrayEach_js__WEBPACK_IMPORTED_MODULE_0__["default"])(methodNames, function(methodName) {
  110064. var func = source[methodName];
  110065. object[methodName] = func;
  110066. if (isFunc) {
  110067. object.prototype[methodName] = function() {
  110068. var chainAll = this.__chain__;
  110069. if (chain || chainAll) {
  110070. var result = object(this.__wrapped__),
  110071. actions = result.__actions__ = Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(this.__actions__);
  110072. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  110073. result.__chain__ = chainAll;
  110074. return result;
  110075. }
  110076. return func.apply(object, Object(_arrayPush_js__WEBPACK_IMPORTED_MODULE_1__["default"])([this.value()], arguments));
  110077. };
  110078. }
  110079. });
  110080. return object;
  110081. }
  110082. /* harmony default export */ __webpack_exports__["default"] = (mixin);
  110083. /***/ }),
  110084. /***/ "./node_modules/lodash-es/multiply.js":
  110085. /*!********************************************!*\
  110086. !*** ./node_modules/lodash-es/multiply.js ***!
  110087. \********************************************/
  110088. /*! exports provided: default */
  110089. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110090. "use strict";
  110091. __webpack_require__.r(__webpack_exports__);
  110092. /* harmony import */ var _createMathOperation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createMathOperation.js */ "./node_modules/lodash-es/_createMathOperation.js");
  110093. /**
  110094. * Multiply two numbers.
  110095. *
  110096. * @static
  110097. * @memberOf _
  110098. * @since 4.7.0
  110099. * @category Math
  110100. * @param {number} multiplier The first number in a multiplication.
  110101. * @param {number} multiplicand The second number in a multiplication.
  110102. * @returns {number} Returns the product.
  110103. * @example
  110104. *
  110105. * _.multiply(6, 4);
  110106. * // => 24
  110107. */
  110108. var multiply = Object(_createMathOperation_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(multiplier, multiplicand) {
  110109. return multiplier * multiplicand;
  110110. }, 1);
  110111. /* harmony default export */ __webpack_exports__["default"] = (multiply);
  110112. /***/ }),
  110113. /***/ "./node_modules/lodash-es/negate.js":
  110114. /*!******************************************!*\
  110115. !*** ./node_modules/lodash-es/negate.js ***!
  110116. \******************************************/
  110117. /*! exports provided: default */
  110118. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110119. "use strict";
  110120. __webpack_require__.r(__webpack_exports__);
  110121. /** Error message constants. */
  110122. var FUNC_ERROR_TEXT = 'Expected a function';
  110123. /**
  110124. * Creates a function that negates the result of the predicate `func`. The
  110125. * `func` predicate is invoked with the `this` binding and arguments of the
  110126. * created function.
  110127. *
  110128. * @static
  110129. * @memberOf _
  110130. * @since 3.0.0
  110131. * @category Function
  110132. * @param {Function} predicate The predicate to negate.
  110133. * @returns {Function} Returns the new negated function.
  110134. * @example
  110135. *
  110136. * function isEven(n) {
  110137. * return n % 2 == 0;
  110138. * }
  110139. *
  110140. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  110141. * // => [1, 3, 5]
  110142. */
  110143. function negate(predicate) {
  110144. if (typeof predicate != 'function') {
  110145. throw new TypeError(FUNC_ERROR_TEXT);
  110146. }
  110147. return function() {
  110148. var args = arguments;
  110149. switch (args.length) {
  110150. case 0: return !predicate.call(this);
  110151. case 1: return !predicate.call(this, args[0]);
  110152. case 2: return !predicate.call(this, args[0], args[1]);
  110153. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  110154. }
  110155. return !predicate.apply(this, args);
  110156. };
  110157. }
  110158. /* harmony default export */ __webpack_exports__["default"] = (negate);
  110159. /***/ }),
  110160. /***/ "./node_modules/lodash-es/next.js":
  110161. /*!****************************************!*\
  110162. !*** ./node_modules/lodash-es/next.js ***!
  110163. \****************************************/
  110164. /*! exports provided: default */
  110165. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110166. "use strict";
  110167. __webpack_require__.r(__webpack_exports__);
  110168. /* harmony import */ var _toArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toArray.js */ "./node_modules/lodash-es/toArray.js");
  110169. /**
  110170. * Gets the next value on a wrapped object following the
  110171. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  110172. *
  110173. * @name next
  110174. * @memberOf _
  110175. * @since 4.0.0
  110176. * @category Seq
  110177. * @returns {Object} Returns the next iterator value.
  110178. * @example
  110179. *
  110180. * var wrapped = _([1, 2]);
  110181. *
  110182. * wrapped.next();
  110183. * // => { 'done': false, 'value': 1 }
  110184. *
  110185. * wrapped.next();
  110186. * // => { 'done': false, 'value': 2 }
  110187. *
  110188. * wrapped.next();
  110189. * // => { 'done': true, 'value': undefined }
  110190. */
  110191. function wrapperNext() {
  110192. if (this.__values__ === undefined) {
  110193. this.__values__ = Object(_toArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this.value());
  110194. }
  110195. var done = this.__index__ >= this.__values__.length,
  110196. value = done ? undefined : this.__values__[this.__index__++];
  110197. return { 'done': done, 'value': value };
  110198. }
  110199. /* harmony default export */ __webpack_exports__["default"] = (wrapperNext);
  110200. /***/ }),
  110201. /***/ "./node_modules/lodash-es/noop.js":
  110202. /*!****************************************!*\
  110203. !*** ./node_modules/lodash-es/noop.js ***!
  110204. \****************************************/
  110205. /*! exports provided: default */
  110206. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110207. "use strict";
  110208. __webpack_require__.r(__webpack_exports__);
  110209. /**
  110210. * This method returns `undefined`.
  110211. *
  110212. * @static
  110213. * @memberOf _
  110214. * @since 2.3.0
  110215. * @category Util
  110216. * @example
  110217. *
  110218. * _.times(2, _.noop);
  110219. * // => [undefined, undefined]
  110220. */
  110221. function noop() {
  110222. // No operation performed.
  110223. }
  110224. /* harmony default export */ __webpack_exports__["default"] = (noop);
  110225. /***/ }),
  110226. /***/ "./node_modules/lodash-es/now.js":
  110227. /*!***************************************!*\
  110228. !*** ./node_modules/lodash-es/now.js ***!
  110229. \***************************************/
  110230. /*! exports provided: default */
  110231. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110232. "use strict";
  110233. __webpack_require__.r(__webpack_exports__);
  110234. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  110235. /**
  110236. * Gets the timestamp of the number of milliseconds that have elapsed since
  110237. * the Unix epoch (1 January 1970 00:00:00 UTC).
  110238. *
  110239. * @static
  110240. * @memberOf _
  110241. * @since 2.4.0
  110242. * @category Date
  110243. * @returns {number} Returns the timestamp.
  110244. * @example
  110245. *
  110246. * _.defer(function(stamp) {
  110247. * console.log(_.now() - stamp);
  110248. * }, _.now());
  110249. * // => Logs the number of milliseconds it took for the deferred invocation.
  110250. */
  110251. var now = function() {
  110252. return _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].Date.now();
  110253. };
  110254. /* harmony default export */ __webpack_exports__["default"] = (now);
  110255. /***/ }),
  110256. /***/ "./node_modules/lodash-es/nth.js":
  110257. /*!***************************************!*\
  110258. !*** ./node_modules/lodash-es/nth.js ***!
  110259. \***************************************/
  110260. /*! exports provided: default */
  110261. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110262. "use strict";
  110263. __webpack_require__.r(__webpack_exports__);
  110264. /* harmony import */ var _baseNth_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseNth.js */ "./node_modules/lodash-es/_baseNth.js");
  110265. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  110266. /**
  110267. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  110268. * element from the end is returned.
  110269. *
  110270. * @static
  110271. * @memberOf _
  110272. * @since 4.11.0
  110273. * @category Array
  110274. * @param {Array} array The array to query.
  110275. * @param {number} [n=0] The index of the element to return.
  110276. * @returns {*} Returns the nth element of `array`.
  110277. * @example
  110278. *
  110279. * var array = ['a', 'b', 'c', 'd'];
  110280. *
  110281. * _.nth(array, 1);
  110282. * // => 'b'
  110283. *
  110284. * _.nth(array, -2);
  110285. * // => 'c';
  110286. */
  110287. function nth(array, n) {
  110288. return (array && array.length) ? Object(_baseNth_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(n)) : undefined;
  110289. }
  110290. /* harmony default export */ __webpack_exports__["default"] = (nth);
  110291. /***/ }),
  110292. /***/ "./node_modules/lodash-es/nthArg.js":
  110293. /*!******************************************!*\
  110294. !*** ./node_modules/lodash-es/nthArg.js ***!
  110295. \******************************************/
  110296. /*! exports provided: default */
  110297. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110298. "use strict";
  110299. __webpack_require__.r(__webpack_exports__);
  110300. /* harmony import */ var _baseNth_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseNth.js */ "./node_modules/lodash-es/_baseNth.js");
  110301. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  110302. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  110303. /**
  110304. * Creates a function that gets the argument at index `n`. If `n` is negative,
  110305. * the nth argument from the end is returned.
  110306. *
  110307. * @static
  110308. * @memberOf _
  110309. * @since 4.0.0
  110310. * @category Util
  110311. * @param {number} [n=0] The index of the argument to return.
  110312. * @returns {Function} Returns the new pass-thru function.
  110313. * @example
  110314. *
  110315. * var func = _.nthArg(1);
  110316. * func('a', 'b', 'c', 'd');
  110317. * // => 'b'
  110318. *
  110319. * var func = _.nthArg(-2);
  110320. * func('a', 'b', 'c', 'd');
  110321. * // => 'c'
  110322. */
  110323. function nthArg(n) {
  110324. n = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(n);
  110325. return Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(args) {
  110326. return Object(_baseNth_js__WEBPACK_IMPORTED_MODULE_0__["default"])(args, n);
  110327. });
  110328. }
  110329. /* harmony default export */ __webpack_exports__["default"] = (nthArg);
  110330. /***/ }),
  110331. /***/ "./node_modules/lodash-es/number.default.js":
  110332. /*!**************************************************!*\
  110333. !*** ./node_modules/lodash-es/number.default.js ***!
  110334. \**************************************************/
  110335. /*! exports provided: default */
  110336. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110337. "use strict";
  110338. __webpack_require__.r(__webpack_exports__);
  110339. /* harmony import */ var _clamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./clamp.js */ "./node_modules/lodash-es/clamp.js");
  110340. /* harmony import */ var _inRange_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./inRange.js */ "./node_modules/lodash-es/inRange.js");
  110341. /* harmony import */ var _random_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./random.js */ "./node_modules/lodash-es/random.js");
  110342. /* harmony default export */ __webpack_exports__["default"] = ({
  110343. clamp: _clamp_js__WEBPACK_IMPORTED_MODULE_0__["default"], inRange: _inRange_js__WEBPACK_IMPORTED_MODULE_1__["default"], random: _random_js__WEBPACK_IMPORTED_MODULE_2__["default"]
  110344. });
  110345. /***/ }),
  110346. /***/ "./node_modules/lodash-es/number.js":
  110347. /*!******************************************!*\
  110348. !*** ./node_modules/lodash-es/number.js ***!
  110349. \******************************************/
  110350. /*! exports provided: clamp, inRange, random, default */
  110351. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110352. "use strict";
  110353. __webpack_require__.r(__webpack_exports__);
  110354. /* harmony import */ var _clamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./clamp.js */ "./node_modules/lodash-es/clamp.js");
  110355. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "clamp", function() { return _clamp_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  110356. /* harmony import */ var _inRange_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./inRange.js */ "./node_modules/lodash-es/inRange.js");
  110357. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "inRange", function() { return _inRange_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  110358. /* harmony import */ var _random_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./random.js */ "./node_modules/lodash-es/random.js");
  110359. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "random", function() { return _random_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  110360. /* harmony import */ var _number_default_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./number.default.js */ "./node_modules/lodash-es/number.default.js");
  110361. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _number_default_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  110362. /***/ }),
  110363. /***/ "./node_modules/lodash-es/object.default.js":
  110364. /*!**************************************************!*\
  110365. !*** ./node_modules/lodash-es/object.default.js ***!
  110366. \**************************************************/
  110367. /*! exports provided: default */
  110368. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110369. "use strict";
  110370. __webpack_require__.r(__webpack_exports__);
  110371. /* harmony import */ var _assign_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./assign.js */ "./node_modules/lodash-es/assign.js");
  110372. /* harmony import */ var _assignIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./assignIn.js */ "./node_modules/lodash-es/assignIn.js");
  110373. /* harmony import */ var _assignInWith_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./assignInWith.js */ "./node_modules/lodash-es/assignInWith.js");
  110374. /* harmony import */ var _assignWith_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./assignWith.js */ "./node_modules/lodash-es/assignWith.js");
  110375. /* harmony import */ var _at_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./at.js */ "./node_modules/lodash-es/at.js");
  110376. /* harmony import */ var _create_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./create.js */ "./node_modules/lodash-es/create.js");
  110377. /* harmony import */ var _defaults_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./defaults.js */ "./node_modules/lodash-es/defaults.js");
  110378. /* harmony import */ var _defaultsDeep_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./defaultsDeep.js */ "./node_modules/lodash-es/defaultsDeep.js");
  110379. /* harmony import */ var _entries_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./entries.js */ "./node_modules/lodash-es/entries.js");
  110380. /* harmony import */ var _entriesIn_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./entriesIn.js */ "./node_modules/lodash-es/entriesIn.js");
  110381. /* harmony import */ var _extend_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./extend.js */ "./node_modules/lodash-es/extend.js");
  110382. /* harmony import */ var _extendWith_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./extendWith.js */ "./node_modules/lodash-es/extendWith.js");
  110383. /* harmony import */ var _findKey_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./findKey.js */ "./node_modules/lodash-es/findKey.js");
  110384. /* harmony import */ var _findLastKey_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./findLastKey.js */ "./node_modules/lodash-es/findLastKey.js");
  110385. /* harmony import */ var _forIn_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./forIn.js */ "./node_modules/lodash-es/forIn.js");
  110386. /* harmony import */ var _forInRight_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./forInRight.js */ "./node_modules/lodash-es/forInRight.js");
  110387. /* harmony import */ var _forOwn_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./forOwn.js */ "./node_modules/lodash-es/forOwn.js");
  110388. /* harmony import */ var _forOwnRight_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./forOwnRight.js */ "./node_modules/lodash-es/forOwnRight.js");
  110389. /* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./functions.js */ "./node_modules/lodash-es/functions.js");
  110390. /* harmony import */ var _functionsIn_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./functionsIn.js */ "./node_modules/lodash-es/functionsIn.js");
  110391. /* harmony import */ var _get_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./get.js */ "./node_modules/lodash-es/get.js");
  110392. /* harmony import */ var _has_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./has.js */ "./node_modules/lodash-es/has.js");
  110393. /* harmony import */ var _hasIn_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./hasIn.js */ "./node_modules/lodash-es/hasIn.js");
  110394. /* harmony import */ var _invert_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./invert.js */ "./node_modules/lodash-es/invert.js");
  110395. /* harmony import */ var _invertBy_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./invertBy.js */ "./node_modules/lodash-es/invertBy.js");
  110396. /* harmony import */ var _invoke_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./invoke.js */ "./node_modules/lodash-es/invoke.js");
  110397. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  110398. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  110399. /* harmony import */ var _mapKeys_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./mapKeys.js */ "./node_modules/lodash-es/mapKeys.js");
  110400. /* harmony import */ var _mapValues_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./mapValues.js */ "./node_modules/lodash-es/mapValues.js");
  110401. /* harmony import */ var _merge_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./merge.js */ "./node_modules/lodash-es/merge.js");
  110402. /* harmony import */ var _mergeWith_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./mergeWith.js */ "./node_modules/lodash-es/mergeWith.js");
  110403. /* harmony import */ var _omit_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./omit.js */ "./node_modules/lodash-es/omit.js");
  110404. /* harmony import */ var _omitBy_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./omitBy.js */ "./node_modules/lodash-es/omitBy.js");
  110405. /* harmony import */ var _pick_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./pick.js */ "./node_modules/lodash-es/pick.js");
  110406. /* harmony import */ var _pickBy_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./pickBy.js */ "./node_modules/lodash-es/pickBy.js");
  110407. /* harmony import */ var _result_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./result.js */ "./node_modules/lodash-es/result.js");
  110408. /* harmony import */ var _set_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./set.js */ "./node_modules/lodash-es/set.js");
  110409. /* harmony import */ var _setWith_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./setWith.js */ "./node_modules/lodash-es/setWith.js");
  110410. /* harmony import */ var _toPairs_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./toPairs.js */ "./node_modules/lodash-es/toPairs.js");
  110411. /* harmony import */ var _toPairsIn_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./toPairsIn.js */ "./node_modules/lodash-es/toPairsIn.js");
  110412. /* harmony import */ var _transform_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./transform.js */ "./node_modules/lodash-es/transform.js");
  110413. /* harmony import */ var _unset_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./unset.js */ "./node_modules/lodash-es/unset.js");
  110414. /* harmony import */ var _update_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./update.js */ "./node_modules/lodash-es/update.js");
  110415. /* harmony import */ var _updateWith_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./updateWith.js */ "./node_modules/lodash-es/updateWith.js");
  110416. /* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./values.js */ "./node_modules/lodash-es/values.js");
  110417. /* harmony import */ var _valuesIn_js__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./valuesIn.js */ "./node_modules/lodash-es/valuesIn.js");
  110418. /* harmony default export */ __webpack_exports__["default"] = ({
  110419. assign: _assign_js__WEBPACK_IMPORTED_MODULE_0__["default"], assignIn: _assignIn_js__WEBPACK_IMPORTED_MODULE_1__["default"], assignInWith: _assignInWith_js__WEBPACK_IMPORTED_MODULE_2__["default"], assignWith: _assignWith_js__WEBPACK_IMPORTED_MODULE_3__["default"], at: _at_js__WEBPACK_IMPORTED_MODULE_4__["default"],
  110420. create: _create_js__WEBPACK_IMPORTED_MODULE_5__["default"], defaults: _defaults_js__WEBPACK_IMPORTED_MODULE_6__["default"], defaultsDeep: _defaultsDeep_js__WEBPACK_IMPORTED_MODULE_7__["default"], entries: _entries_js__WEBPACK_IMPORTED_MODULE_8__["default"], entriesIn: _entriesIn_js__WEBPACK_IMPORTED_MODULE_9__["default"],
  110421. extend: _extend_js__WEBPACK_IMPORTED_MODULE_10__["default"], extendWith: _extendWith_js__WEBPACK_IMPORTED_MODULE_11__["default"], findKey: _findKey_js__WEBPACK_IMPORTED_MODULE_12__["default"], findLastKey: _findLastKey_js__WEBPACK_IMPORTED_MODULE_13__["default"], forIn: _forIn_js__WEBPACK_IMPORTED_MODULE_14__["default"],
  110422. forInRight: _forInRight_js__WEBPACK_IMPORTED_MODULE_15__["default"], forOwn: _forOwn_js__WEBPACK_IMPORTED_MODULE_16__["default"], forOwnRight: _forOwnRight_js__WEBPACK_IMPORTED_MODULE_17__["default"], functions: _functions_js__WEBPACK_IMPORTED_MODULE_18__["default"], functionsIn: _functionsIn_js__WEBPACK_IMPORTED_MODULE_19__["default"],
  110423. get: _get_js__WEBPACK_IMPORTED_MODULE_20__["default"], has: _has_js__WEBPACK_IMPORTED_MODULE_21__["default"], hasIn: _hasIn_js__WEBPACK_IMPORTED_MODULE_22__["default"], invert: _invert_js__WEBPACK_IMPORTED_MODULE_23__["default"], invertBy: _invertBy_js__WEBPACK_IMPORTED_MODULE_24__["default"],
  110424. invoke: _invoke_js__WEBPACK_IMPORTED_MODULE_25__["default"], keys: _keys_js__WEBPACK_IMPORTED_MODULE_26__["default"], keysIn: _keysIn_js__WEBPACK_IMPORTED_MODULE_27__["default"], mapKeys: _mapKeys_js__WEBPACK_IMPORTED_MODULE_28__["default"], mapValues: _mapValues_js__WEBPACK_IMPORTED_MODULE_29__["default"],
  110425. merge: _merge_js__WEBPACK_IMPORTED_MODULE_30__["default"], mergeWith: _mergeWith_js__WEBPACK_IMPORTED_MODULE_31__["default"], omit: _omit_js__WEBPACK_IMPORTED_MODULE_32__["default"], omitBy: _omitBy_js__WEBPACK_IMPORTED_MODULE_33__["default"], pick: _pick_js__WEBPACK_IMPORTED_MODULE_34__["default"],
  110426. pickBy: _pickBy_js__WEBPACK_IMPORTED_MODULE_35__["default"], result: _result_js__WEBPACK_IMPORTED_MODULE_36__["default"], set: _set_js__WEBPACK_IMPORTED_MODULE_37__["default"], setWith: _setWith_js__WEBPACK_IMPORTED_MODULE_38__["default"], toPairs: _toPairs_js__WEBPACK_IMPORTED_MODULE_39__["default"],
  110427. toPairsIn: _toPairsIn_js__WEBPACK_IMPORTED_MODULE_40__["default"], transform: _transform_js__WEBPACK_IMPORTED_MODULE_41__["default"], unset: _unset_js__WEBPACK_IMPORTED_MODULE_42__["default"], update: _update_js__WEBPACK_IMPORTED_MODULE_43__["default"], updateWith: _updateWith_js__WEBPACK_IMPORTED_MODULE_44__["default"],
  110428. values: _values_js__WEBPACK_IMPORTED_MODULE_45__["default"], valuesIn: _valuesIn_js__WEBPACK_IMPORTED_MODULE_46__["default"]
  110429. });
  110430. /***/ }),
  110431. /***/ "./node_modules/lodash-es/object.js":
  110432. /*!******************************************!*\
  110433. !*** ./node_modules/lodash-es/object.js ***!
  110434. \******************************************/
  110435. /*! exports provided: assign, assignIn, assignInWith, assignWith, at, create, defaults, defaultsDeep, entries, entriesIn, extend, extendWith, findKey, findLastKey, forIn, forInRight, forOwn, forOwnRight, functions, functionsIn, get, has, hasIn, invert, invertBy, invoke, keys, keysIn, mapKeys, mapValues, merge, mergeWith, omit, omitBy, pick, pickBy, result, set, setWith, toPairs, toPairsIn, transform, unset, update, updateWith, values, valuesIn, default */
  110436. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110437. "use strict";
  110438. __webpack_require__.r(__webpack_exports__);
  110439. /* harmony import */ var _assign_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./assign.js */ "./node_modules/lodash-es/assign.js");
  110440. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assign", function() { return _assign_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  110441. /* harmony import */ var _assignIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./assignIn.js */ "./node_modules/lodash-es/assignIn.js");
  110442. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assignIn", function() { return _assignIn_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  110443. /* harmony import */ var _assignInWith_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./assignInWith.js */ "./node_modules/lodash-es/assignInWith.js");
  110444. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assignInWith", function() { return _assignInWith_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  110445. /* harmony import */ var _assignWith_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./assignWith.js */ "./node_modules/lodash-es/assignWith.js");
  110446. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "assignWith", function() { return _assignWith_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  110447. /* harmony import */ var _at_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./at.js */ "./node_modules/lodash-es/at.js");
  110448. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "at", function() { return _at_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  110449. /* harmony import */ var _create_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./create.js */ "./node_modules/lodash-es/create.js");
  110450. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "create", function() { return _create_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  110451. /* harmony import */ var _defaults_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./defaults.js */ "./node_modules/lodash-es/defaults.js");
  110452. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaults", function() { return _defaults_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  110453. /* harmony import */ var _defaultsDeep_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./defaultsDeep.js */ "./node_modules/lodash-es/defaultsDeep.js");
  110454. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultsDeep", function() { return _defaultsDeep_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  110455. /* harmony import */ var _entries_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./entries.js */ "./node_modules/lodash-es/entries.js");
  110456. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "entries", function() { return _entries_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  110457. /* harmony import */ var _entriesIn_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./entriesIn.js */ "./node_modules/lodash-es/entriesIn.js");
  110458. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "entriesIn", function() { return _entriesIn_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  110459. /* harmony import */ var _extend_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./extend.js */ "./node_modules/lodash-es/extend.js");
  110460. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return _extend_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  110461. /* harmony import */ var _extendWith_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./extendWith.js */ "./node_modules/lodash-es/extendWith.js");
  110462. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "extendWith", function() { return _extendWith_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  110463. /* harmony import */ var _findKey_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./findKey.js */ "./node_modules/lodash-es/findKey.js");
  110464. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findKey", function() { return _findKey_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  110465. /* harmony import */ var _findLastKey_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./findLastKey.js */ "./node_modules/lodash-es/findLastKey.js");
  110466. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findLastKey", function() { return _findLastKey_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  110467. /* harmony import */ var _forIn_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./forIn.js */ "./node_modules/lodash-es/forIn.js");
  110468. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forIn", function() { return _forIn_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  110469. /* harmony import */ var _forInRight_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./forInRight.js */ "./node_modules/lodash-es/forInRight.js");
  110470. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forInRight", function() { return _forInRight_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
  110471. /* harmony import */ var _forOwn_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./forOwn.js */ "./node_modules/lodash-es/forOwn.js");
  110472. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forOwn", function() { return _forOwn_js__WEBPACK_IMPORTED_MODULE_16__["default"]; });
  110473. /* harmony import */ var _forOwnRight_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./forOwnRight.js */ "./node_modules/lodash-es/forOwnRight.js");
  110474. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forOwnRight", function() { return _forOwnRight_js__WEBPACK_IMPORTED_MODULE_17__["default"]; });
  110475. /* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./functions.js */ "./node_modules/lodash-es/functions.js");
  110476. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "functions", function() { return _functions_js__WEBPACK_IMPORTED_MODULE_18__["default"]; });
  110477. /* harmony import */ var _functionsIn_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./functionsIn.js */ "./node_modules/lodash-es/functionsIn.js");
  110478. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "functionsIn", function() { return _functionsIn_js__WEBPACK_IMPORTED_MODULE_19__["default"]; });
  110479. /* harmony import */ var _get_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./get.js */ "./node_modules/lodash-es/get.js");
  110480. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "get", function() { return _get_js__WEBPACK_IMPORTED_MODULE_20__["default"]; });
  110481. /* harmony import */ var _has_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./has.js */ "./node_modules/lodash-es/has.js");
  110482. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "has", function() { return _has_js__WEBPACK_IMPORTED_MODULE_21__["default"]; });
  110483. /* harmony import */ var _hasIn_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./hasIn.js */ "./node_modules/lodash-es/hasIn.js");
  110484. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hasIn", function() { return _hasIn_js__WEBPACK_IMPORTED_MODULE_22__["default"]; });
  110485. /* harmony import */ var _invert_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./invert.js */ "./node_modules/lodash-es/invert.js");
  110486. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return _invert_js__WEBPACK_IMPORTED_MODULE_23__["default"]; });
  110487. /* harmony import */ var _invertBy_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./invertBy.js */ "./node_modules/lodash-es/invertBy.js");
  110488. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "invertBy", function() { return _invertBy_js__WEBPACK_IMPORTED_MODULE_24__["default"]; });
  110489. /* harmony import */ var _invoke_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./invoke.js */ "./node_modules/lodash-es/invoke.js");
  110490. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "invoke", function() { return _invoke_js__WEBPACK_IMPORTED_MODULE_25__["default"]; });
  110491. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  110492. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "keys", function() { return _keys_js__WEBPACK_IMPORTED_MODULE_26__["default"]; });
  110493. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  110494. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "keysIn", function() { return _keysIn_js__WEBPACK_IMPORTED_MODULE_27__["default"]; });
  110495. /* harmony import */ var _mapKeys_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./mapKeys.js */ "./node_modules/lodash-es/mapKeys.js");
  110496. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mapKeys", function() { return _mapKeys_js__WEBPACK_IMPORTED_MODULE_28__["default"]; });
  110497. /* harmony import */ var _mapValues_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./mapValues.js */ "./node_modules/lodash-es/mapValues.js");
  110498. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mapValues", function() { return _mapValues_js__WEBPACK_IMPORTED_MODULE_29__["default"]; });
  110499. /* harmony import */ var _merge_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./merge.js */ "./node_modules/lodash-es/merge.js");
  110500. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return _merge_js__WEBPACK_IMPORTED_MODULE_30__["default"]; });
  110501. /* harmony import */ var _mergeWith_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./mergeWith.js */ "./node_modules/lodash-es/mergeWith.js");
  110502. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mergeWith", function() { return _mergeWith_js__WEBPACK_IMPORTED_MODULE_31__["default"]; });
  110503. /* harmony import */ var _omit_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./omit.js */ "./node_modules/lodash-es/omit.js");
  110504. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "omit", function() { return _omit_js__WEBPACK_IMPORTED_MODULE_32__["default"]; });
  110505. /* harmony import */ var _omitBy_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./omitBy.js */ "./node_modules/lodash-es/omitBy.js");
  110506. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "omitBy", function() { return _omitBy_js__WEBPACK_IMPORTED_MODULE_33__["default"]; });
  110507. /* harmony import */ var _pick_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./pick.js */ "./node_modules/lodash-es/pick.js");
  110508. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pick", function() { return _pick_js__WEBPACK_IMPORTED_MODULE_34__["default"]; });
  110509. /* harmony import */ var _pickBy_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./pickBy.js */ "./node_modules/lodash-es/pickBy.js");
  110510. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pickBy", function() { return _pickBy_js__WEBPACK_IMPORTED_MODULE_35__["default"]; });
  110511. /* harmony import */ var _result_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./result.js */ "./node_modules/lodash-es/result.js");
  110512. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "result", function() { return _result_js__WEBPACK_IMPORTED_MODULE_36__["default"]; });
  110513. /* harmony import */ var _set_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./set.js */ "./node_modules/lodash-es/set.js");
  110514. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "set", function() { return _set_js__WEBPACK_IMPORTED_MODULE_37__["default"]; });
  110515. /* harmony import */ var _setWith_js__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./setWith.js */ "./node_modules/lodash-es/setWith.js");
  110516. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setWith", function() { return _setWith_js__WEBPACK_IMPORTED_MODULE_38__["default"]; });
  110517. /* harmony import */ var _toPairs_js__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./toPairs.js */ "./node_modules/lodash-es/toPairs.js");
  110518. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toPairs", function() { return _toPairs_js__WEBPACK_IMPORTED_MODULE_39__["default"]; });
  110519. /* harmony import */ var _toPairsIn_js__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./toPairsIn.js */ "./node_modules/lodash-es/toPairsIn.js");
  110520. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toPairsIn", function() { return _toPairsIn_js__WEBPACK_IMPORTED_MODULE_40__["default"]; });
  110521. /* harmony import */ var _transform_js__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./transform.js */ "./node_modules/lodash-es/transform.js");
  110522. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "transform", function() { return _transform_js__WEBPACK_IMPORTED_MODULE_41__["default"]; });
  110523. /* harmony import */ var _unset_js__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./unset.js */ "./node_modules/lodash-es/unset.js");
  110524. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unset", function() { return _unset_js__WEBPACK_IMPORTED_MODULE_42__["default"]; });
  110525. /* harmony import */ var _update_js__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./update.js */ "./node_modules/lodash-es/update.js");
  110526. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "update", function() { return _update_js__WEBPACK_IMPORTED_MODULE_43__["default"]; });
  110527. /* harmony import */ var _updateWith_js__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./updateWith.js */ "./node_modules/lodash-es/updateWith.js");
  110528. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "updateWith", function() { return _updateWith_js__WEBPACK_IMPORTED_MODULE_44__["default"]; });
  110529. /* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./values.js */ "./node_modules/lodash-es/values.js");
  110530. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "values", function() { return _values_js__WEBPACK_IMPORTED_MODULE_45__["default"]; });
  110531. /* harmony import */ var _valuesIn_js__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./valuesIn.js */ "./node_modules/lodash-es/valuesIn.js");
  110532. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "valuesIn", function() { return _valuesIn_js__WEBPACK_IMPORTED_MODULE_46__["default"]; });
  110533. /* harmony import */ var _object_default_js__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./object.default.js */ "./node_modules/lodash-es/object.default.js");
  110534. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _object_default_js__WEBPACK_IMPORTED_MODULE_47__["default"]; });
  110535. /***/ }),
  110536. /***/ "./node_modules/lodash-es/omit.js":
  110537. /*!****************************************!*\
  110538. !*** ./node_modules/lodash-es/omit.js ***!
  110539. \****************************************/
  110540. /*! exports provided: default */
  110541. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110542. "use strict";
  110543. __webpack_require__.r(__webpack_exports__);
  110544. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  110545. /* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseClone.js */ "./node_modules/lodash-es/_baseClone.js");
  110546. /* harmony import */ var _baseUnset_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseUnset.js */ "./node_modules/lodash-es/_baseUnset.js");
  110547. /* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
  110548. /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
  110549. /* harmony import */ var _customOmitClone_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_customOmitClone.js */ "./node_modules/lodash-es/_customOmitClone.js");
  110550. /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
  110551. /* harmony import */ var _getAllKeysIn_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./_getAllKeysIn.js */ "./node_modules/lodash-es/_getAllKeysIn.js");
  110552. /** Used to compose bitmasks for cloning. */
  110553. var CLONE_DEEP_FLAG = 1,
  110554. CLONE_FLAT_FLAG = 2,
  110555. CLONE_SYMBOLS_FLAG = 4;
  110556. /**
  110557. * The opposite of `_.pick`; this method creates an object composed of the
  110558. * own and inherited enumerable property paths of `object` that are not omitted.
  110559. *
  110560. * **Note:** This method is considerably slower than `_.pick`.
  110561. *
  110562. * @static
  110563. * @since 0.1.0
  110564. * @memberOf _
  110565. * @category Object
  110566. * @param {Object} object The source object.
  110567. * @param {...(string|string[])} [paths] The property paths to omit.
  110568. * @returns {Object} Returns the new object.
  110569. * @example
  110570. *
  110571. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  110572. *
  110573. * _.omit(object, ['a', 'c']);
  110574. * // => { 'b': '2' }
  110575. */
  110576. var omit = Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_6__["default"])(function(object, paths) {
  110577. var result = {};
  110578. if (object == null) {
  110579. return result;
  110580. }
  110581. var isDeep = false;
  110582. paths = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(paths, function(path) {
  110583. path = Object(_castPath_js__WEBPACK_IMPORTED_MODULE_3__["default"])(path, object);
  110584. isDeep || (isDeep = path.length > 1);
  110585. return path;
  110586. });
  110587. Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_4__["default"])(object, Object(_getAllKeysIn_js__WEBPACK_IMPORTED_MODULE_7__["default"])(object), result);
  110588. if (isDeep) {
  110589. result = Object(_baseClone_js__WEBPACK_IMPORTED_MODULE_1__["default"])(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, _customOmitClone_js__WEBPACK_IMPORTED_MODULE_5__["default"]);
  110590. }
  110591. var length = paths.length;
  110592. while (length--) {
  110593. Object(_baseUnset_js__WEBPACK_IMPORTED_MODULE_2__["default"])(result, paths[length]);
  110594. }
  110595. return result;
  110596. });
  110597. /* harmony default export */ __webpack_exports__["default"] = (omit);
  110598. /***/ }),
  110599. /***/ "./node_modules/lodash-es/omitBy.js":
  110600. /*!******************************************!*\
  110601. !*** ./node_modules/lodash-es/omitBy.js ***!
  110602. \******************************************/
  110603. /*! exports provided: default */
  110604. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110605. "use strict";
  110606. __webpack_require__.r(__webpack_exports__);
  110607. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  110608. /* harmony import */ var _negate_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./negate.js */ "./node_modules/lodash-es/negate.js");
  110609. /* harmony import */ var _pickBy_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./pickBy.js */ "./node_modules/lodash-es/pickBy.js");
  110610. /**
  110611. * The opposite of `_.pickBy`; this method creates an object composed of
  110612. * the own and inherited enumerable string keyed properties of `object` that
  110613. * `predicate` doesn't return truthy for. The predicate is invoked with two
  110614. * arguments: (value, key).
  110615. *
  110616. * @static
  110617. * @memberOf _
  110618. * @since 4.0.0
  110619. * @category Object
  110620. * @param {Object} object The source object.
  110621. * @param {Function} [predicate=_.identity] The function invoked per property.
  110622. * @returns {Object} Returns the new object.
  110623. * @example
  110624. *
  110625. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  110626. *
  110627. * _.omitBy(object, _.isNumber);
  110628. * // => { 'b': '2' }
  110629. */
  110630. function omitBy(object, predicate) {
  110631. return Object(_pickBy_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object, Object(_negate_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(predicate)));
  110632. }
  110633. /* harmony default export */ __webpack_exports__["default"] = (omitBy);
  110634. /***/ }),
  110635. /***/ "./node_modules/lodash-es/once.js":
  110636. /*!****************************************!*\
  110637. !*** ./node_modules/lodash-es/once.js ***!
  110638. \****************************************/
  110639. /*! exports provided: default */
  110640. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110641. "use strict";
  110642. __webpack_require__.r(__webpack_exports__);
  110643. /* harmony import */ var _before_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./before.js */ "./node_modules/lodash-es/before.js");
  110644. /**
  110645. * Creates a function that is restricted to invoking `func` once. Repeat calls
  110646. * to the function return the value of the first invocation. The `func` is
  110647. * invoked with the `this` binding and arguments of the created function.
  110648. *
  110649. * @static
  110650. * @memberOf _
  110651. * @since 0.1.0
  110652. * @category Function
  110653. * @param {Function} func The function to restrict.
  110654. * @returns {Function} Returns the new restricted function.
  110655. * @example
  110656. *
  110657. * var initialize = _.once(createApplication);
  110658. * initialize();
  110659. * initialize();
  110660. * // => `createApplication` is invoked once
  110661. */
  110662. function once(func) {
  110663. return Object(_before_js__WEBPACK_IMPORTED_MODULE_0__["default"])(2, func);
  110664. }
  110665. /* harmony default export */ __webpack_exports__["default"] = (once);
  110666. /***/ }),
  110667. /***/ "./node_modules/lodash-es/orderBy.js":
  110668. /*!*******************************************!*\
  110669. !*** ./node_modules/lodash-es/orderBy.js ***!
  110670. \*******************************************/
  110671. /*! exports provided: default */
  110672. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110673. "use strict";
  110674. __webpack_require__.r(__webpack_exports__);
  110675. /* harmony import */ var _baseOrderBy_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseOrderBy.js */ "./node_modules/lodash-es/_baseOrderBy.js");
  110676. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  110677. /**
  110678. * This method is like `_.sortBy` except that it allows specifying the sort
  110679. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  110680. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  110681. * descending or "asc" for ascending sort order of corresponding values.
  110682. *
  110683. * @static
  110684. * @memberOf _
  110685. * @since 4.0.0
  110686. * @category Collection
  110687. * @param {Array|Object} collection The collection to iterate over.
  110688. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  110689. * The iteratees to sort by.
  110690. * @param {string[]} [orders] The sort orders of `iteratees`.
  110691. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  110692. * @returns {Array} Returns the new sorted array.
  110693. * @example
  110694. *
  110695. * var users = [
  110696. * { 'user': 'fred', 'age': 48 },
  110697. * { 'user': 'barney', 'age': 34 },
  110698. * { 'user': 'fred', 'age': 40 },
  110699. * { 'user': 'barney', 'age': 36 }
  110700. * ];
  110701. *
  110702. * // Sort by `user` in ascending order and by `age` in descending order.
  110703. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  110704. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  110705. */
  110706. function orderBy(collection, iteratees, orders, guard) {
  110707. if (collection == null) {
  110708. return [];
  110709. }
  110710. if (!Object(_isArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratees)) {
  110711. iteratees = iteratees == null ? [] : [iteratees];
  110712. }
  110713. orders = guard ? undefined : orders;
  110714. if (!Object(_isArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(orders)) {
  110715. orders = orders == null ? [] : [orders];
  110716. }
  110717. return Object(_baseOrderBy_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection, iteratees, orders);
  110718. }
  110719. /* harmony default export */ __webpack_exports__["default"] = (orderBy);
  110720. /***/ }),
  110721. /***/ "./node_modules/lodash-es/over.js":
  110722. /*!****************************************!*\
  110723. !*** ./node_modules/lodash-es/over.js ***!
  110724. \****************************************/
  110725. /*! exports provided: default */
  110726. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110727. "use strict";
  110728. __webpack_require__.r(__webpack_exports__);
  110729. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  110730. /* harmony import */ var _createOver_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createOver.js */ "./node_modules/lodash-es/_createOver.js");
  110731. /**
  110732. * Creates a function that invokes `iteratees` with the arguments it receives
  110733. * and returns their results.
  110734. *
  110735. * @static
  110736. * @memberOf _
  110737. * @since 4.0.0
  110738. * @category Util
  110739. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  110740. * The iteratees to invoke.
  110741. * @returns {Function} Returns the new function.
  110742. * @example
  110743. *
  110744. * var func = _.over([Math.max, Math.min]);
  110745. *
  110746. * func(1, 2, 3, 4);
  110747. * // => [4, 1]
  110748. */
  110749. var over = Object(_createOver_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  110750. /* harmony default export */ __webpack_exports__["default"] = (over);
  110751. /***/ }),
  110752. /***/ "./node_modules/lodash-es/overArgs.js":
  110753. /*!********************************************!*\
  110754. !*** ./node_modules/lodash-es/overArgs.js ***!
  110755. \********************************************/
  110756. /*! exports provided: default */
  110757. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110758. "use strict";
  110759. __webpack_require__.r(__webpack_exports__);
  110760. /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  110761. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  110762. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  110763. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  110764. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  110765. /* harmony import */ var _baseUnary_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_baseUnary.js */ "./node_modules/lodash-es/_baseUnary.js");
  110766. /* harmony import */ var _castRest_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_castRest.js */ "./node_modules/lodash-es/_castRest.js");
  110767. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  110768. /* Built-in method references for those with the same name as other `lodash` methods. */
  110769. var nativeMin = Math.min;
  110770. /**
  110771. * Creates a function that invokes `func` with its arguments transformed.
  110772. *
  110773. * @static
  110774. * @since 4.0.0
  110775. * @memberOf _
  110776. * @category Function
  110777. * @param {Function} func The function to wrap.
  110778. * @param {...(Function|Function[])} [transforms=[_.identity]]
  110779. * The argument transforms.
  110780. * @returns {Function} Returns the new function.
  110781. * @example
  110782. *
  110783. * function doubled(n) {
  110784. * return n * 2;
  110785. * }
  110786. *
  110787. * function square(n) {
  110788. * return n * n;
  110789. * }
  110790. *
  110791. * var func = _.overArgs(function(x, y) {
  110792. * return [x, y];
  110793. * }, [square, doubled]);
  110794. *
  110795. * func(9, 3);
  110796. * // => [81, 6]
  110797. *
  110798. * func(10, 5);
  110799. * // => [100, 10]
  110800. */
  110801. var overArgs = Object(_castRest_js__WEBPACK_IMPORTED_MODULE_6__["default"])(function(func, transforms) {
  110802. transforms = (transforms.length == 1 && Object(_isArray_js__WEBPACK_IMPORTED_MODULE_7__["default"])(transforms[0]))
  110803. ? Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(transforms[0], Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_5__["default"])(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_3__["default"]))
  110804. : Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_2__["default"])(transforms, 1), Object(_baseUnary_js__WEBPACK_IMPORTED_MODULE_5__["default"])(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_3__["default"]));
  110805. var funcsLength = transforms.length;
  110806. return Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_4__["default"])(function(args) {
  110807. var index = -1,
  110808. length = nativeMin(args.length, funcsLength);
  110809. while (++index < length) {
  110810. args[index] = transforms[index].call(this, args[index]);
  110811. }
  110812. return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, this, args);
  110813. });
  110814. });
  110815. /* harmony default export */ __webpack_exports__["default"] = (overArgs);
  110816. /***/ }),
  110817. /***/ "./node_modules/lodash-es/overEvery.js":
  110818. /*!*********************************************!*\
  110819. !*** ./node_modules/lodash-es/overEvery.js ***!
  110820. \*********************************************/
  110821. /*! exports provided: default */
  110822. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110823. "use strict";
  110824. __webpack_require__.r(__webpack_exports__);
  110825. /* harmony import */ var _arrayEvery_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayEvery.js */ "./node_modules/lodash-es/_arrayEvery.js");
  110826. /* harmony import */ var _createOver_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createOver.js */ "./node_modules/lodash-es/_createOver.js");
  110827. /**
  110828. * Creates a function that checks if **all** of the `predicates` return
  110829. * truthy when invoked with the arguments it receives.
  110830. *
  110831. * Following shorthands are possible for providing predicates.
  110832. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  110833. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  110834. *
  110835. * @static
  110836. * @memberOf _
  110837. * @since 4.0.0
  110838. * @category Util
  110839. * @param {...(Function|Function[])} [predicates=[_.identity]]
  110840. * The predicates to check.
  110841. * @returns {Function} Returns the new function.
  110842. * @example
  110843. *
  110844. * var func = _.overEvery([Boolean, isFinite]);
  110845. *
  110846. * func('1');
  110847. * // => true
  110848. *
  110849. * func(null);
  110850. * // => false
  110851. *
  110852. * func(NaN);
  110853. * // => false
  110854. */
  110855. var overEvery = Object(_createOver_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_arrayEvery_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  110856. /* harmony default export */ __webpack_exports__["default"] = (overEvery);
  110857. /***/ }),
  110858. /***/ "./node_modules/lodash-es/overSome.js":
  110859. /*!********************************************!*\
  110860. !*** ./node_modules/lodash-es/overSome.js ***!
  110861. \********************************************/
  110862. /*! exports provided: default */
  110863. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110864. "use strict";
  110865. __webpack_require__.r(__webpack_exports__);
  110866. /* harmony import */ var _arraySome_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arraySome.js */ "./node_modules/lodash-es/_arraySome.js");
  110867. /* harmony import */ var _createOver_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createOver.js */ "./node_modules/lodash-es/_createOver.js");
  110868. /**
  110869. * Creates a function that checks if **any** of the `predicates` return
  110870. * truthy when invoked with the arguments it receives.
  110871. *
  110872. * Following shorthands are possible for providing predicates.
  110873. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  110874. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  110875. *
  110876. * @static
  110877. * @memberOf _
  110878. * @since 4.0.0
  110879. * @category Util
  110880. * @param {...(Function|Function[])} [predicates=[_.identity]]
  110881. * The predicates to check.
  110882. * @returns {Function} Returns the new function.
  110883. * @example
  110884. *
  110885. * var func = _.overSome([Boolean, isFinite]);
  110886. *
  110887. * func('1');
  110888. * // => true
  110889. *
  110890. * func(null);
  110891. * // => true
  110892. *
  110893. * func(NaN);
  110894. * // => false
  110895. *
  110896. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  110897. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  110898. */
  110899. var overSome = Object(_createOver_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_arraySome_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  110900. /* harmony default export */ __webpack_exports__["default"] = (overSome);
  110901. /***/ }),
  110902. /***/ "./node_modules/lodash-es/pad.js":
  110903. /*!***************************************!*\
  110904. !*** ./node_modules/lodash-es/pad.js ***!
  110905. \***************************************/
  110906. /*! exports provided: default */
  110907. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110908. "use strict";
  110909. __webpack_require__.r(__webpack_exports__);
  110910. /* harmony import */ var _createPadding_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createPadding.js */ "./node_modules/lodash-es/_createPadding.js");
  110911. /* harmony import */ var _stringSize_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_stringSize.js */ "./node_modules/lodash-es/_stringSize.js");
  110912. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  110913. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  110914. /* Built-in method references for those with the same name as other `lodash` methods. */
  110915. var nativeCeil = Math.ceil,
  110916. nativeFloor = Math.floor;
  110917. /**
  110918. * Pads `string` on the left and right sides if it's shorter than `length`.
  110919. * Padding characters are truncated if they can't be evenly divided by `length`.
  110920. *
  110921. * @static
  110922. * @memberOf _
  110923. * @since 3.0.0
  110924. * @category String
  110925. * @param {string} [string=''] The string to pad.
  110926. * @param {number} [length=0] The padding length.
  110927. * @param {string} [chars=' '] The string used as padding.
  110928. * @returns {string} Returns the padded string.
  110929. * @example
  110930. *
  110931. * _.pad('abc', 8);
  110932. * // => ' abc '
  110933. *
  110934. * _.pad('abc', 8, '_-');
  110935. * // => '_-abc_-_'
  110936. *
  110937. * _.pad('abc', 3);
  110938. * // => 'abc'
  110939. */
  110940. function pad(string, length, chars) {
  110941. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string);
  110942. length = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(length);
  110943. var strLength = length ? Object(_stringSize_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string) : 0;
  110944. if (!length || strLength >= length) {
  110945. return string;
  110946. }
  110947. var mid = (length - strLength) / 2;
  110948. return (
  110949. Object(_createPadding_js__WEBPACK_IMPORTED_MODULE_0__["default"])(nativeFloor(mid), chars) +
  110950. string +
  110951. Object(_createPadding_js__WEBPACK_IMPORTED_MODULE_0__["default"])(nativeCeil(mid), chars)
  110952. );
  110953. }
  110954. /* harmony default export */ __webpack_exports__["default"] = (pad);
  110955. /***/ }),
  110956. /***/ "./node_modules/lodash-es/padEnd.js":
  110957. /*!******************************************!*\
  110958. !*** ./node_modules/lodash-es/padEnd.js ***!
  110959. \******************************************/
  110960. /*! exports provided: default */
  110961. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110962. "use strict";
  110963. __webpack_require__.r(__webpack_exports__);
  110964. /* harmony import */ var _createPadding_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createPadding.js */ "./node_modules/lodash-es/_createPadding.js");
  110965. /* harmony import */ var _stringSize_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_stringSize.js */ "./node_modules/lodash-es/_stringSize.js");
  110966. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  110967. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  110968. /**
  110969. * Pads `string` on the right side if it's shorter than `length`. Padding
  110970. * characters are truncated if they exceed `length`.
  110971. *
  110972. * @static
  110973. * @memberOf _
  110974. * @since 4.0.0
  110975. * @category String
  110976. * @param {string} [string=''] The string to pad.
  110977. * @param {number} [length=0] The padding length.
  110978. * @param {string} [chars=' '] The string used as padding.
  110979. * @returns {string} Returns the padded string.
  110980. * @example
  110981. *
  110982. * _.padEnd('abc', 6);
  110983. * // => 'abc '
  110984. *
  110985. * _.padEnd('abc', 6, '_-');
  110986. * // => 'abc_-_'
  110987. *
  110988. * _.padEnd('abc', 3);
  110989. * // => 'abc'
  110990. */
  110991. function padEnd(string, length, chars) {
  110992. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string);
  110993. length = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(length);
  110994. var strLength = length ? Object(_stringSize_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string) : 0;
  110995. return (length && strLength < length)
  110996. ? (string + Object(_createPadding_js__WEBPACK_IMPORTED_MODULE_0__["default"])(length - strLength, chars))
  110997. : string;
  110998. }
  110999. /* harmony default export */ __webpack_exports__["default"] = (padEnd);
  111000. /***/ }),
  111001. /***/ "./node_modules/lodash-es/padStart.js":
  111002. /*!********************************************!*\
  111003. !*** ./node_modules/lodash-es/padStart.js ***!
  111004. \********************************************/
  111005. /*! exports provided: default */
  111006. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111007. "use strict";
  111008. __webpack_require__.r(__webpack_exports__);
  111009. /* harmony import */ var _createPadding_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createPadding.js */ "./node_modules/lodash-es/_createPadding.js");
  111010. /* harmony import */ var _stringSize_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_stringSize.js */ "./node_modules/lodash-es/_stringSize.js");
  111011. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  111012. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  111013. /**
  111014. * Pads `string` on the left side if it's shorter than `length`. Padding
  111015. * characters are truncated if they exceed `length`.
  111016. *
  111017. * @static
  111018. * @memberOf _
  111019. * @since 4.0.0
  111020. * @category String
  111021. * @param {string} [string=''] The string to pad.
  111022. * @param {number} [length=0] The padding length.
  111023. * @param {string} [chars=' '] The string used as padding.
  111024. * @returns {string} Returns the padded string.
  111025. * @example
  111026. *
  111027. * _.padStart('abc', 6);
  111028. * // => ' abc'
  111029. *
  111030. * _.padStart('abc', 6, '_-');
  111031. * // => '_-_abc'
  111032. *
  111033. * _.padStart('abc', 3);
  111034. * // => 'abc'
  111035. */
  111036. function padStart(string, length, chars) {
  111037. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string);
  111038. length = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(length);
  111039. var strLength = length ? Object(_stringSize_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string) : 0;
  111040. return (length && strLength < length)
  111041. ? (Object(_createPadding_js__WEBPACK_IMPORTED_MODULE_0__["default"])(length - strLength, chars) + string)
  111042. : string;
  111043. }
  111044. /* harmony default export */ __webpack_exports__["default"] = (padStart);
  111045. /***/ }),
  111046. /***/ "./node_modules/lodash-es/parseInt.js":
  111047. /*!********************************************!*\
  111048. !*** ./node_modules/lodash-es/parseInt.js ***!
  111049. \********************************************/
  111050. /*! exports provided: default */
  111051. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111052. "use strict";
  111053. __webpack_require__.r(__webpack_exports__);
  111054. /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_root.js */ "./node_modules/lodash-es/_root.js");
  111055. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  111056. /** Used to match leading whitespace. */
  111057. var reTrimStart = /^\s+/;
  111058. /* Built-in method references for those with the same name as other `lodash` methods. */
  111059. var nativeParseInt = _root_js__WEBPACK_IMPORTED_MODULE_0__["default"].parseInt;
  111060. /**
  111061. * Converts `string` to an integer of the specified radix. If `radix` is
  111062. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  111063. * hexadecimal, in which case a `radix` of `16` is used.
  111064. *
  111065. * **Note:** This method aligns with the
  111066. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  111067. *
  111068. * @static
  111069. * @memberOf _
  111070. * @since 1.1.0
  111071. * @category String
  111072. * @param {string} string The string to convert.
  111073. * @param {number} [radix=10] The radix to interpret `value` by.
  111074. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  111075. * @returns {number} Returns the converted integer.
  111076. * @example
  111077. *
  111078. * _.parseInt('08');
  111079. * // => 8
  111080. *
  111081. * _.map(['6', '08', '10'], _.parseInt);
  111082. * // => [6, 8, 10]
  111083. */
  111084. function parseInt(string, radix, guard) {
  111085. if (guard || radix == null) {
  111086. radix = 0;
  111087. } else if (radix) {
  111088. radix = +radix;
  111089. }
  111090. return nativeParseInt(Object(_toString_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string).replace(reTrimStart, ''), radix || 0);
  111091. }
  111092. /* harmony default export */ __webpack_exports__["default"] = (parseInt);
  111093. /***/ }),
  111094. /***/ "./node_modules/lodash-es/partial.js":
  111095. /*!*******************************************!*\
  111096. !*** ./node_modules/lodash-es/partial.js ***!
  111097. \*******************************************/
  111098. /*! exports provided: default */
  111099. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111100. "use strict";
  111101. __webpack_require__.r(__webpack_exports__);
  111102. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  111103. /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
  111104. /* harmony import */ var _getHolder_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getHolder.js */ "./node_modules/lodash-es/_getHolder.js");
  111105. /* harmony import */ var _replaceHolders_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_replaceHolders.js */ "./node_modules/lodash-es/_replaceHolders.js");
  111106. /** Used to compose bitmasks for function metadata. */
  111107. var WRAP_PARTIAL_FLAG = 32;
  111108. /**
  111109. * Creates a function that invokes `func` with `partials` prepended to the
  111110. * arguments it receives. This method is like `_.bind` except it does **not**
  111111. * alter the `this` binding.
  111112. *
  111113. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  111114. * builds, may be used as a placeholder for partially applied arguments.
  111115. *
  111116. * **Note:** This method doesn't set the "length" property of partially
  111117. * applied functions.
  111118. *
  111119. * @static
  111120. * @memberOf _
  111121. * @since 0.2.0
  111122. * @category Function
  111123. * @param {Function} func The function to partially apply arguments to.
  111124. * @param {...*} [partials] The arguments to be partially applied.
  111125. * @returns {Function} Returns the new partially applied function.
  111126. * @example
  111127. *
  111128. * function greet(greeting, name) {
  111129. * return greeting + ' ' + name;
  111130. * }
  111131. *
  111132. * var sayHelloTo = _.partial(greet, 'hello');
  111133. * sayHelloTo('fred');
  111134. * // => 'hello fred'
  111135. *
  111136. * // Partially applied with placeholders.
  111137. * var greetFred = _.partial(greet, _, 'fred');
  111138. * greetFred('hi');
  111139. * // => 'hi fred'
  111140. */
  111141. var partial = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(func, partials) {
  111142. var holders = Object(_replaceHolders_js__WEBPACK_IMPORTED_MODULE_3__["default"])(partials, Object(_getHolder_js__WEBPACK_IMPORTED_MODULE_2__["default"])(partial));
  111143. return Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  111144. });
  111145. // Assign default placeholders.
  111146. partial.placeholder = {};
  111147. /* harmony default export */ __webpack_exports__["default"] = (partial);
  111148. /***/ }),
  111149. /***/ "./node_modules/lodash-es/partialRight.js":
  111150. /*!************************************************!*\
  111151. !*** ./node_modules/lodash-es/partialRight.js ***!
  111152. \************************************************/
  111153. /*! exports provided: default */
  111154. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111155. "use strict";
  111156. __webpack_require__.r(__webpack_exports__);
  111157. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  111158. /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
  111159. /* harmony import */ var _getHolder_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getHolder.js */ "./node_modules/lodash-es/_getHolder.js");
  111160. /* harmony import */ var _replaceHolders_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_replaceHolders.js */ "./node_modules/lodash-es/_replaceHolders.js");
  111161. /** Used to compose bitmasks for function metadata. */
  111162. var WRAP_PARTIAL_RIGHT_FLAG = 64;
  111163. /**
  111164. * This method is like `_.partial` except that partially applied arguments
  111165. * are appended to the arguments it receives.
  111166. *
  111167. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  111168. * builds, may be used as a placeholder for partially applied arguments.
  111169. *
  111170. * **Note:** This method doesn't set the "length" property of partially
  111171. * applied functions.
  111172. *
  111173. * @static
  111174. * @memberOf _
  111175. * @since 1.0.0
  111176. * @category Function
  111177. * @param {Function} func The function to partially apply arguments to.
  111178. * @param {...*} [partials] The arguments to be partially applied.
  111179. * @returns {Function} Returns the new partially applied function.
  111180. * @example
  111181. *
  111182. * function greet(greeting, name) {
  111183. * return greeting + ' ' + name;
  111184. * }
  111185. *
  111186. * var greetFred = _.partialRight(greet, 'fred');
  111187. * greetFred('hi');
  111188. * // => 'hi fred'
  111189. *
  111190. * // Partially applied with placeholders.
  111191. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  111192. * sayHelloTo('fred');
  111193. * // => 'hello fred'
  111194. */
  111195. var partialRight = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(func, partials) {
  111196. var holders = Object(_replaceHolders_js__WEBPACK_IMPORTED_MODULE_3__["default"])(partials, Object(_getHolder_js__WEBPACK_IMPORTED_MODULE_2__["default"])(partialRight));
  111197. return Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  111198. });
  111199. // Assign default placeholders.
  111200. partialRight.placeholder = {};
  111201. /* harmony default export */ __webpack_exports__["default"] = (partialRight);
  111202. /***/ }),
  111203. /***/ "./node_modules/lodash-es/partition.js":
  111204. /*!*********************************************!*\
  111205. !*** ./node_modules/lodash-es/partition.js ***!
  111206. \*********************************************/
  111207. /*! exports provided: default */
  111208. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111209. "use strict";
  111210. __webpack_require__.r(__webpack_exports__);
  111211. /* harmony import */ var _createAggregator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createAggregator.js */ "./node_modules/lodash-es/_createAggregator.js");
  111212. /**
  111213. * Creates an array of elements split into two groups, the first of which
  111214. * contains elements `predicate` returns truthy for, the second of which
  111215. * contains elements `predicate` returns falsey for. The predicate is
  111216. * invoked with one argument: (value).
  111217. *
  111218. * @static
  111219. * @memberOf _
  111220. * @since 3.0.0
  111221. * @category Collection
  111222. * @param {Array|Object} collection The collection to iterate over.
  111223. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  111224. * @returns {Array} Returns the array of grouped elements.
  111225. * @example
  111226. *
  111227. * var users = [
  111228. * { 'user': 'barney', 'age': 36, 'active': false },
  111229. * { 'user': 'fred', 'age': 40, 'active': true },
  111230. * { 'user': 'pebbles', 'age': 1, 'active': false }
  111231. * ];
  111232. *
  111233. * _.partition(users, function(o) { return o.active; });
  111234. * // => objects for [['fred'], ['barney', 'pebbles']]
  111235. *
  111236. * // The `_.matches` iteratee shorthand.
  111237. * _.partition(users, { 'age': 1, 'active': false });
  111238. * // => objects for [['pebbles'], ['barney', 'fred']]
  111239. *
  111240. * // The `_.matchesProperty` iteratee shorthand.
  111241. * _.partition(users, ['active', false]);
  111242. * // => objects for [['barney', 'pebbles'], ['fred']]
  111243. *
  111244. * // The `_.property` iteratee shorthand.
  111245. * _.partition(users, 'active');
  111246. * // => objects for [['fred'], ['barney', 'pebbles']]
  111247. */
  111248. var partition = Object(_createAggregator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(result, value, key) {
  111249. result[key ? 0 : 1].push(value);
  111250. }, function() { return [[], []]; });
  111251. /* harmony default export */ __webpack_exports__["default"] = (partition);
  111252. /***/ }),
  111253. /***/ "./node_modules/lodash-es/pick.js":
  111254. /*!****************************************!*\
  111255. !*** ./node_modules/lodash-es/pick.js ***!
  111256. \****************************************/
  111257. /*! exports provided: default */
  111258. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111259. "use strict";
  111260. __webpack_require__.r(__webpack_exports__);
  111261. /* harmony import */ var _basePick_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_basePick.js */ "./node_modules/lodash-es/_basePick.js");
  111262. /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
  111263. /**
  111264. * Creates an object composed of the picked `object` properties.
  111265. *
  111266. * @static
  111267. * @since 0.1.0
  111268. * @memberOf _
  111269. * @category Object
  111270. * @param {Object} object The source object.
  111271. * @param {...(string|string[])} [paths] The property paths to pick.
  111272. * @returns {Object} Returns the new object.
  111273. * @example
  111274. *
  111275. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  111276. *
  111277. * _.pick(object, ['a', 'c']);
  111278. * // => { 'a': 1, 'c': 3 }
  111279. */
  111280. var pick = Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(object, paths) {
  111281. return object == null ? {} : Object(_basePick_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, paths);
  111282. });
  111283. /* harmony default export */ __webpack_exports__["default"] = (pick);
  111284. /***/ }),
  111285. /***/ "./node_modules/lodash-es/pickBy.js":
  111286. /*!******************************************!*\
  111287. !*** ./node_modules/lodash-es/pickBy.js ***!
  111288. \******************************************/
  111289. /*! exports provided: default */
  111290. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111291. "use strict";
  111292. __webpack_require__.r(__webpack_exports__);
  111293. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  111294. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  111295. /* harmony import */ var _basePickBy_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_basePickBy.js */ "./node_modules/lodash-es/_basePickBy.js");
  111296. /* harmony import */ var _getAllKeysIn_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_getAllKeysIn.js */ "./node_modules/lodash-es/_getAllKeysIn.js");
  111297. /**
  111298. * Creates an object composed of the `object` properties `predicate` returns
  111299. * truthy for. The predicate is invoked with two arguments: (value, key).
  111300. *
  111301. * @static
  111302. * @memberOf _
  111303. * @since 4.0.0
  111304. * @category Object
  111305. * @param {Object} object The source object.
  111306. * @param {Function} [predicate=_.identity] The function invoked per property.
  111307. * @returns {Object} Returns the new object.
  111308. * @example
  111309. *
  111310. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  111311. *
  111312. * _.pickBy(object, _.isNumber);
  111313. * // => { 'a': 1, 'c': 3 }
  111314. */
  111315. function pickBy(object, predicate) {
  111316. if (object == null) {
  111317. return {};
  111318. }
  111319. var props = Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_getAllKeysIn_js__WEBPACK_IMPORTED_MODULE_3__["default"])(object), function(prop) {
  111320. return [prop];
  111321. });
  111322. predicate = Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__["default"])(predicate);
  111323. return Object(_basePickBy_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object, props, function(value, path) {
  111324. return predicate(value, path[0]);
  111325. });
  111326. }
  111327. /* harmony default export */ __webpack_exports__["default"] = (pickBy);
  111328. /***/ }),
  111329. /***/ "./node_modules/lodash-es/plant.js":
  111330. /*!*****************************************!*\
  111331. !*** ./node_modules/lodash-es/plant.js ***!
  111332. \*****************************************/
  111333. /*! exports provided: default */
  111334. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111335. "use strict";
  111336. __webpack_require__.r(__webpack_exports__);
  111337. /* harmony import */ var _baseLodash_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseLodash.js */ "./node_modules/lodash-es/_baseLodash.js");
  111338. /* harmony import */ var _wrapperClone_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_wrapperClone.js */ "./node_modules/lodash-es/_wrapperClone.js");
  111339. /**
  111340. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  111341. *
  111342. * @name plant
  111343. * @memberOf _
  111344. * @since 3.2.0
  111345. * @category Seq
  111346. * @param {*} value The value to plant.
  111347. * @returns {Object} Returns the new `lodash` wrapper instance.
  111348. * @example
  111349. *
  111350. * function square(n) {
  111351. * return n * n;
  111352. * }
  111353. *
  111354. * var wrapped = _([1, 2]).map(square);
  111355. * var other = wrapped.plant([3, 4]);
  111356. *
  111357. * other.value();
  111358. * // => [9, 16]
  111359. *
  111360. * wrapped.value();
  111361. * // => [1, 4]
  111362. */
  111363. function wrapperPlant(value) {
  111364. var result,
  111365. parent = this;
  111366. while (parent instanceof _baseLodash_js__WEBPACK_IMPORTED_MODULE_0__["default"]) {
  111367. var clone = Object(_wrapperClone_js__WEBPACK_IMPORTED_MODULE_1__["default"])(parent);
  111368. clone.__index__ = 0;
  111369. clone.__values__ = undefined;
  111370. if (result) {
  111371. previous.__wrapped__ = clone;
  111372. } else {
  111373. result = clone;
  111374. }
  111375. var previous = clone;
  111376. parent = parent.__wrapped__;
  111377. }
  111378. previous.__wrapped__ = value;
  111379. return result;
  111380. }
  111381. /* harmony default export */ __webpack_exports__["default"] = (wrapperPlant);
  111382. /***/ }),
  111383. /***/ "./node_modules/lodash-es/property.js":
  111384. /*!********************************************!*\
  111385. !*** ./node_modules/lodash-es/property.js ***!
  111386. \********************************************/
  111387. /*! exports provided: default */
  111388. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111389. "use strict";
  111390. __webpack_require__.r(__webpack_exports__);
  111391. /* harmony import */ var _baseProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseProperty.js */ "./node_modules/lodash-es/_baseProperty.js");
  111392. /* harmony import */ var _basePropertyDeep_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_basePropertyDeep.js */ "./node_modules/lodash-es/_basePropertyDeep.js");
  111393. /* harmony import */ var _isKey_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_isKey.js */ "./node_modules/lodash-es/_isKey.js");
  111394. /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
  111395. /**
  111396. * Creates a function that returns the value at `path` of a given object.
  111397. *
  111398. * @static
  111399. * @memberOf _
  111400. * @since 2.4.0
  111401. * @category Util
  111402. * @param {Array|string} path The path of the property to get.
  111403. * @returns {Function} Returns the new accessor function.
  111404. * @example
  111405. *
  111406. * var objects = [
  111407. * { 'a': { 'b': 2 } },
  111408. * { 'a': { 'b': 1 } }
  111409. * ];
  111410. *
  111411. * _.map(objects, _.property('a.b'));
  111412. * // => [2, 1]
  111413. *
  111414. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  111415. * // => [1, 2]
  111416. */
  111417. function property(path) {
  111418. return Object(_isKey_js__WEBPACK_IMPORTED_MODULE_2__["default"])(path) ? Object(_baseProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_toKey_js__WEBPACK_IMPORTED_MODULE_3__["default"])(path)) : Object(_basePropertyDeep_js__WEBPACK_IMPORTED_MODULE_1__["default"])(path);
  111419. }
  111420. /* harmony default export */ __webpack_exports__["default"] = (property);
  111421. /***/ }),
  111422. /***/ "./node_modules/lodash-es/propertyOf.js":
  111423. /*!**********************************************!*\
  111424. !*** ./node_modules/lodash-es/propertyOf.js ***!
  111425. \**********************************************/
  111426. /*! exports provided: default */
  111427. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111428. "use strict";
  111429. __webpack_require__.r(__webpack_exports__);
  111430. /* harmony import */ var _baseGet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseGet.js */ "./node_modules/lodash-es/_baseGet.js");
  111431. /**
  111432. * The opposite of `_.property`; this method creates a function that returns
  111433. * the value at a given path of `object`.
  111434. *
  111435. * @static
  111436. * @memberOf _
  111437. * @since 3.0.0
  111438. * @category Util
  111439. * @param {Object} object The object to query.
  111440. * @returns {Function} Returns the new accessor function.
  111441. * @example
  111442. *
  111443. * var array = [0, 1, 2],
  111444. * object = { 'a': array, 'b': array, 'c': array };
  111445. *
  111446. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  111447. * // => [2, 0]
  111448. *
  111449. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  111450. * // => [2, 0]
  111451. */
  111452. function propertyOf(object) {
  111453. return function(path) {
  111454. return object == null ? undefined : Object(_baseGet_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path);
  111455. };
  111456. }
  111457. /* harmony default export */ __webpack_exports__["default"] = (propertyOf);
  111458. /***/ }),
  111459. /***/ "./node_modules/lodash-es/pull.js":
  111460. /*!****************************************!*\
  111461. !*** ./node_modules/lodash-es/pull.js ***!
  111462. \****************************************/
  111463. /*! exports provided: default */
  111464. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111465. "use strict";
  111466. __webpack_require__.r(__webpack_exports__);
  111467. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  111468. /* harmony import */ var _pullAll_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pullAll.js */ "./node_modules/lodash-es/pullAll.js");
  111469. /**
  111470. * Removes all given values from `array` using
  111471. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  111472. * for equality comparisons.
  111473. *
  111474. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  111475. * to remove elements from an array by predicate.
  111476. *
  111477. * @static
  111478. * @memberOf _
  111479. * @since 2.0.0
  111480. * @category Array
  111481. * @param {Array} array The array to modify.
  111482. * @param {...*} [values] The values to remove.
  111483. * @returns {Array} Returns `array`.
  111484. * @example
  111485. *
  111486. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  111487. *
  111488. * _.pull(array, 'a', 'c');
  111489. * console.log(array);
  111490. * // => ['b', 'b']
  111491. */
  111492. var pull = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_pullAll_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  111493. /* harmony default export */ __webpack_exports__["default"] = (pull);
  111494. /***/ }),
  111495. /***/ "./node_modules/lodash-es/pullAll.js":
  111496. /*!*******************************************!*\
  111497. !*** ./node_modules/lodash-es/pullAll.js ***!
  111498. \*******************************************/
  111499. /*! exports provided: default */
  111500. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111501. "use strict";
  111502. __webpack_require__.r(__webpack_exports__);
  111503. /* harmony import */ var _basePullAll_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_basePullAll.js */ "./node_modules/lodash-es/_basePullAll.js");
  111504. /**
  111505. * This method is like `_.pull` except that it accepts an array of values to remove.
  111506. *
  111507. * **Note:** Unlike `_.difference`, this method mutates `array`.
  111508. *
  111509. * @static
  111510. * @memberOf _
  111511. * @since 4.0.0
  111512. * @category Array
  111513. * @param {Array} array The array to modify.
  111514. * @param {Array} values The values to remove.
  111515. * @returns {Array} Returns `array`.
  111516. * @example
  111517. *
  111518. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  111519. *
  111520. * _.pullAll(array, ['a', 'c']);
  111521. * console.log(array);
  111522. * // => ['b', 'b']
  111523. */
  111524. function pullAll(array, values) {
  111525. return (array && array.length && values && values.length)
  111526. ? Object(_basePullAll_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, values)
  111527. : array;
  111528. }
  111529. /* harmony default export */ __webpack_exports__["default"] = (pullAll);
  111530. /***/ }),
  111531. /***/ "./node_modules/lodash-es/pullAllBy.js":
  111532. /*!*********************************************!*\
  111533. !*** ./node_modules/lodash-es/pullAllBy.js ***!
  111534. \*********************************************/
  111535. /*! exports provided: default */
  111536. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111537. "use strict";
  111538. __webpack_require__.r(__webpack_exports__);
  111539. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  111540. /* harmony import */ var _basePullAll_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_basePullAll.js */ "./node_modules/lodash-es/_basePullAll.js");
  111541. /**
  111542. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  111543. * invoked for each element of `array` and `values` to generate the criterion
  111544. * by which they're compared. The iteratee is invoked with one argument: (value).
  111545. *
  111546. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  111547. *
  111548. * @static
  111549. * @memberOf _
  111550. * @since 4.0.0
  111551. * @category Array
  111552. * @param {Array} array The array to modify.
  111553. * @param {Array} values The values to remove.
  111554. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  111555. * @returns {Array} Returns `array`.
  111556. * @example
  111557. *
  111558. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  111559. *
  111560. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  111561. * console.log(array);
  111562. * // => [{ 'x': 2 }]
  111563. */
  111564. function pullAllBy(array, values, iteratee) {
  111565. return (array && array.length && values && values.length)
  111566. ? Object(_basePullAll_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, values, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, 2))
  111567. : array;
  111568. }
  111569. /* harmony default export */ __webpack_exports__["default"] = (pullAllBy);
  111570. /***/ }),
  111571. /***/ "./node_modules/lodash-es/pullAllWith.js":
  111572. /*!***********************************************!*\
  111573. !*** ./node_modules/lodash-es/pullAllWith.js ***!
  111574. \***********************************************/
  111575. /*! exports provided: default */
  111576. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111577. "use strict";
  111578. __webpack_require__.r(__webpack_exports__);
  111579. /* harmony import */ var _basePullAll_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_basePullAll.js */ "./node_modules/lodash-es/_basePullAll.js");
  111580. /**
  111581. * This method is like `_.pullAll` except that it accepts `comparator` which
  111582. * is invoked to compare elements of `array` to `values`. The comparator is
  111583. * invoked with two arguments: (arrVal, othVal).
  111584. *
  111585. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  111586. *
  111587. * @static
  111588. * @memberOf _
  111589. * @since 4.6.0
  111590. * @category Array
  111591. * @param {Array} array The array to modify.
  111592. * @param {Array} values The values to remove.
  111593. * @param {Function} [comparator] The comparator invoked per element.
  111594. * @returns {Array} Returns `array`.
  111595. * @example
  111596. *
  111597. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  111598. *
  111599. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  111600. * console.log(array);
  111601. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  111602. */
  111603. function pullAllWith(array, values, comparator) {
  111604. return (array && array.length && values && values.length)
  111605. ? Object(_basePullAll_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, values, undefined, comparator)
  111606. : array;
  111607. }
  111608. /* harmony default export */ __webpack_exports__["default"] = (pullAllWith);
  111609. /***/ }),
  111610. /***/ "./node_modules/lodash-es/pullAt.js":
  111611. /*!******************************************!*\
  111612. !*** ./node_modules/lodash-es/pullAt.js ***!
  111613. \******************************************/
  111614. /*! exports provided: default */
  111615. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111616. "use strict";
  111617. __webpack_require__.r(__webpack_exports__);
  111618. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  111619. /* harmony import */ var _baseAt_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseAt.js */ "./node_modules/lodash-es/_baseAt.js");
  111620. /* harmony import */ var _basePullAt_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_basePullAt.js */ "./node_modules/lodash-es/_basePullAt.js");
  111621. /* harmony import */ var _compareAscending_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_compareAscending.js */ "./node_modules/lodash-es/_compareAscending.js");
  111622. /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
  111623. /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
  111624. /**
  111625. * Removes elements from `array` corresponding to `indexes` and returns an
  111626. * array of removed elements.
  111627. *
  111628. * **Note:** Unlike `_.at`, this method mutates `array`.
  111629. *
  111630. * @static
  111631. * @memberOf _
  111632. * @since 3.0.0
  111633. * @category Array
  111634. * @param {Array} array The array to modify.
  111635. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  111636. * @returns {Array} Returns the new array of removed elements.
  111637. * @example
  111638. *
  111639. * var array = ['a', 'b', 'c', 'd'];
  111640. * var pulled = _.pullAt(array, [1, 3]);
  111641. *
  111642. * console.log(array);
  111643. * // => ['a', 'c']
  111644. *
  111645. * console.log(pulled);
  111646. * // => ['b', 'd']
  111647. */
  111648. var pullAt = Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_4__["default"])(function(array, indexes) {
  111649. var length = array == null ? 0 : array.length,
  111650. result = Object(_baseAt_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, indexes);
  111651. Object(_basePullAt_js__WEBPACK_IMPORTED_MODULE_2__["default"])(array, Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(indexes, function(index) {
  111652. return Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_5__["default"])(index, length) ? +index : index;
  111653. }).sort(_compareAscending_js__WEBPACK_IMPORTED_MODULE_3__["default"]));
  111654. return result;
  111655. });
  111656. /* harmony default export */ __webpack_exports__["default"] = (pullAt);
  111657. /***/ }),
  111658. /***/ "./node_modules/lodash-es/random.js":
  111659. /*!******************************************!*\
  111660. !*** ./node_modules/lodash-es/random.js ***!
  111661. \******************************************/
  111662. /*! exports provided: default */
  111663. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111664. "use strict";
  111665. __webpack_require__.r(__webpack_exports__);
  111666. /* harmony import */ var _baseRandom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRandom.js */ "./node_modules/lodash-es/_baseRandom.js");
  111667. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  111668. /* harmony import */ var _toFinite_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toFinite.js */ "./node_modules/lodash-es/toFinite.js");
  111669. /** Built-in method references without a dependency on `root`. */
  111670. var freeParseFloat = parseFloat;
  111671. /* Built-in method references for those with the same name as other `lodash` methods. */
  111672. var nativeMin = Math.min,
  111673. nativeRandom = Math.random;
  111674. /**
  111675. * Produces a random number between the inclusive `lower` and `upper` bounds.
  111676. * If only one argument is provided a number between `0` and the given number
  111677. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  111678. * floats, a floating-point number is returned instead of an integer.
  111679. *
  111680. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  111681. * floating-point values which can produce unexpected results.
  111682. *
  111683. * @static
  111684. * @memberOf _
  111685. * @since 0.7.0
  111686. * @category Number
  111687. * @param {number} [lower=0] The lower bound.
  111688. * @param {number} [upper=1] The upper bound.
  111689. * @param {boolean} [floating] Specify returning a floating-point number.
  111690. * @returns {number} Returns the random number.
  111691. * @example
  111692. *
  111693. * _.random(0, 5);
  111694. * // => an integer between 0 and 5
  111695. *
  111696. * _.random(5);
  111697. * // => also an integer between 0 and 5
  111698. *
  111699. * _.random(5, true);
  111700. * // => a floating-point number between 0 and 5
  111701. *
  111702. * _.random(1.2, 5.2);
  111703. * // => a floating-point number between 1.2 and 5.2
  111704. */
  111705. function random(lower, upper, floating) {
  111706. if (floating && typeof floating != 'boolean' && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__["default"])(lower, upper, floating)) {
  111707. upper = floating = undefined;
  111708. }
  111709. if (floating === undefined) {
  111710. if (typeof upper == 'boolean') {
  111711. floating = upper;
  111712. upper = undefined;
  111713. }
  111714. else if (typeof lower == 'boolean') {
  111715. floating = lower;
  111716. lower = undefined;
  111717. }
  111718. }
  111719. if (lower === undefined && upper === undefined) {
  111720. lower = 0;
  111721. upper = 1;
  111722. }
  111723. else {
  111724. lower = Object(_toFinite_js__WEBPACK_IMPORTED_MODULE_2__["default"])(lower);
  111725. if (upper === undefined) {
  111726. upper = lower;
  111727. lower = 0;
  111728. } else {
  111729. upper = Object(_toFinite_js__WEBPACK_IMPORTED_MODULE_2__["default"])(upper);
  111730. }
  111731. }
  111732. if (lower > upper) {
  111733. var temp = lower;
  111734. lower = upper;
  111735. upper = temp;
  111736. }
  111737. if (floating || lower % 1 || upper % 1) {
  111738. var rand = nativeRandom();
  111739. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  111740. }
  111741. return Object(_baseRandom_js__WEBPACK_IMPORTED_MODULE_0__["default"])(lower, upper);
  111742. }
  111743. /* harmony default export */ __webpack_exports__["default"] = (random);
  111744. /***/ }),
  111745. /***/ "./node_modules/lodash-es/range.js":
  111746. /*!*****************************************!*\
  111747. !*** ./node_modules/lodash-es/range.js ***!
  111748. \*****************************************/
  111749. /*! exports provided: default */
  111750. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111751. "use strict";
  111752. __webpack_require__.r(__webpack_exports__);
  111753. /* harmony import */ var _createRange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createRange.js */ "./node_modules/lodash-es/_createRange.js");
  111754. /**
  111755. * Creates an array of numbers (positive and/or negative) progressing from
  111756. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  111757. * `start` is specified without an `end` or `step`. If `end` is not specified,
  111758. * it's set to `start` with `start` then set to `0`.
  111759. *
  111760. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  111761. * floating-point values which can produce unexpected results.
  111762. *
  111763. * @static
  111764. * @since 0.1.0
  111765. * @memberOf _
  111766. * @category Util
  111767. * @param {number} [start=0] The start of the range.
  111768. * @param {number} end The end of the range.
  111769. * @param {number} [step=1] The value to increment or decrement by.
  111770. * @returns {Array} Returns the range of numbers.
  111771. * @see _.inRange, _.rangeRight
  111772. * @example
  111773. *
  111774. * _.range(4);
  111775. * // => [0, 1, 2, 3]
  111776. *
  111777. * _.range(-4);
  111778. * // => [0, -1, -2, -3]
  111779. *
  111780. * _.range(1, 5);
  111781. * // => [1, 2, 3, 4]
  111782. *
  111783. * _.range(0, 20, 5);
  111784. * // => [0, 5, 10, 15]
  111785. *
  111786. * _.range(0, -4, -1);
  111787. * // => [0, -1, -2, -3]
  111788. *
  111789. * _.range(1, 4, 0);
  111790. * // => [1, 1, 1]
  111791. *
  111792. * _.range(0);
  111793. * // => []
  111794. */
  111795. var range = Object(_createRange_js__WEBPACK_IMPORTED_MODULE_0__["default"])();
  111796. /* harmony default export */ __webpack_exports__["default"] = (range);
  111797. /***/ }),
  111798. /***/ "./node_modules/lodash-es/rangeRight.js":
  111799. /*!**********************************************!*\
  111800. !*** ./node_modules/lodash-es/rangeRight.js ***!
  111801. \**********************************************/
  111802. /*! exports provided: default */
  111803. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111804. "use strict";
  111805. __webpack_require__.r(__webpack_exports__);
  111806. /* harmony import */ var _createRange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createRange.js */ "./node_modules/lodash-es/_createRange.js");
  111807. /**
  111808. * This method is like `_.range` except that it populates values in
  111809. * descending order.
  111810. *
  111811. * @static
  111812. * @memberOf _
  111813. * @since 4.0.0
  111814. * @category Util
  111815. * @param {number} [start=0] The start of the range.
  111816. * @param {number} end The end of the range.
  111817. * @param {number} [step=1] The value to increment or decrement by.
  111818. * @returns {Array} Returns the range of numbers.
  111819. * @see _.inRange, _.range
  111820. * @example
  111821. *
  111822. * _.rangeRight(4);
  111823. * // => [3, 2, 1, 0]
  111824. *
  111825. * _.rangeRight(-4);
  111826. * // => [-3, -2, -1, 0]
  111827. *
  111828. * _.rangeRight(1, 5);
  111829. * // => [4, 3, 2, 1]
  111830. *
  111831. * _.rangeRight(0, 20, 5);
  111832. * // => [15, 10, 5, 0]
  111833. *
  111834. * _.rangeRight(0, -4, -1);
  111835. * // => [-3, -2, -1, 0]
  111836. *
  111837. * _.rangeRight(1, 4, 0);
  111838. * // => [1, 1, 1]
  111839. *
  111840. * _.rangeRight(0);
  111841. * // => []
  111842. */
  111843. var rangeRight = Object(_createRange_js__WEBPACK_IMPORTED_MODULE_0__["default"])(true);
  111844. /* harmony default export */ __webpack_exports__["default"] = (rangeRight);
  111845. /***/ }),
  111846. /***/ "./node_modules/lodash-es/rearg.js":
  111847. /*!*****************************************!*\
  111848. !*** ./node_modules/lodash-es/rearg.js ***!
  111849. \*****************************************/
  111850. /*! exports provided: default */
  111851. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111852. "use strict";
  111853. __webpack_require__.r(__webpack_exports__);
  111854. /* harmony import */ var _createWrap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createWrap.js */ "./node_modules/lodash-es/_createWrap.js");
  111855. /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
  111856. /** Used to compose bitmasks for function metadata. */
  111857. var WRAP_REARG_FLAG = 256;
  111858. /**
  111859. * Creates a function that invokes `func` with arguments arranged according
  111860. * to the specified `indexes` where the argument value at the first index is
  111861. * provided as the first argument, the argument value at the second index is
  111862. * provided as the second argument, and so on.
  111863. *
  111864. * @static
  111865. * @memberOf _
  111866. * @since 3.0.0
  111867. * @category Function
  111868. * @param {Function} func The function to rearrange arguments for.
  111869. * @param {...(number|number[])} indexes The arranged argument indexes.
  111870. * @returns {Function} Returns the new function.
  111871. * @example
  111872. *
  111873. * var rearged = _.rearg(function(a, b, c) {
  111874. * return [a, b, c];
  111875. * }, [2, 0, 1]);
  111876. *
  111877. * rearged('b', 'c', 'a')
  111878. * // => ['a', 'b', 'c']
  111879. */
  111880. var rearg = Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(func, indexes) {
  111881. return Object(_createWrap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  111882. });
  111883. /* harmony default export */ __webpack_exports__["default"] = (rearg);
  111884. /***/ }),
  111885. /***/ "./node_modules/lodash-es/reduce.js":
  111886. /*!******************************************!*\
  111887. !*** ./node_modules/lodash-es/reduce.js ***!
  111888. \******************************************/
  111889. /*! exports provided: default */
  111890. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111891. "use strict";
  111892. __webpack_require__.r(__webpack_exports__);
  111893. /* harmony import */ var _arrayReduce_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayReduce.js */ "./node_modules/lodash-es/_arrayReduce.js");
  111894. /* harmony import */ var _baseEach_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseEach.js */ "./node_modules/lodash-es/_baseEach.js");
  111895. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  111896. /* harmony import */ var _baseReduce_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseReduce.js */ "./node_modules/lodash-es/_baseReduce.js");
  111897. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  111898. /**
  111899. * Reduces `collection` to a value which is the accumulated result of running
  111900. * each element in `collection` thru `iteratee`, where each successive
  111901. * invocation is supplied the return value of the previous. If `accumulator`
  111902. * is not given, the first element of `collection` is used as the initial
  111903. * value. The iteratee is invoked with four arguments:
  111904. * (accumulator, value, index|key, collection).
  111905. *
  111906. * Many lodash methods are guarded to work as iteratees for methods like
  111907. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  111908. *
  111909. * The guarded methods are:
  111910. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  111911. * and `sortBy`
  111912. *
  111913. * @static
  111914. * @memberOf _
  111915. * @since 0.1.0
  111916. * @category Collection
  111917. * @param {Array|Object} collection The collection to iterate over.
  111918. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  111919. * @param {*} [accumulator] The initial value.
  111920. * @returns {*} Returns the accumulated value.
  111921. * @see _.reduceRight
  111922. * @example
  111923. *
  111924. * _.reduce([1, 2], function(sum, n) {
  111925. * return sum + n;
  111926. * }, 0);
  111927. * // => 3
  111928. *
  111929. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  111930. * (result[value] || (result[value] = [])).push(key);
  111931. * return result;
  111932. * }, {});
  111933. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  111934. */
  111935. function reduce(collection, iteratee, accumulator) {
  111936. var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_4__["default"])(collection) ? _arrayReduce_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseReduce_js__WEBPACK_IMPORTED_MODULE_3__["default"],
  111937. initAccum = arguments.length < 3;
  111938. return func(collection, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee, 4), accumulator, initAccum, _baseEach_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  111939. }
  111940. /* harmony default export */ __webpack_exports__["default"] = (reduce);
  111941. /***/ }),
  111942. /***/ "./node_modules/lodash-es/reduceRight.js":
  111943. /*!***********************************************!*\
  111944. !*** ./node_modules/lodash-es/reduceRight.js ***!
  111945. \***********************************************/
  111946. /*! exports provided: default */
  111947. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111948. "use strict";
  111949. __webpack_require__.r(__webpack_exports__);
  111950. /* harmony import */ var _arrayReduceRight_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayReduceRight.js */ "./node_modules/lodash-es/_arrayReduceRight.js");
  111951. /* harmony import */ var _baseEachRight_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseEachRight.js */ "./node_modules/lodash-es/_baseEachRight.js");
  111952. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  111953. /* harmony import */ var _baseReduce_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseReduce.js */ "./node_modules/lodash-es/_baseReduce.js");
  111954. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  111955. /**
  111956. * This method is like `_.reduce` except that it iterates over elements of
  111957. * `collection` from right to left.
  111958. *
  111959. * @static
  111960. * @memberOf _
  111961. * @since 0.1.0
  111962. * @category Collection
  111963. * @param {Array|Object} collection The collection to iterate over.
  111964. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  111965. * @param {*} [accumulator] The initial value.
  111966. * @returns {*} Returns the accumulated value.
  111967. * @see _.reduce
  111968. * @example
  111969. *
  111970. * var array = [[0, 1], [2, 3], [4, 5]];
  111971. *
  111972. * _.reduceRight(array, function(flattened, other) {
  111973. * return flattened.concat(other);
  111974. * }, []);
  111975. * // => [4, 5, 2, 3, 0, 1]
  111976. */
  111977. function reduceRight(collection, iteratee, accumulator) {
  111978. var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_4__["default"])(collection) ? _arrayReduceRight_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseReduce_js__WEBPACK_IMPORTED_MODULE_3__["default"],
  111979. initAccum = arguments.length < 3;
  111980. return func(collection, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(iteratee, 4), accumulator, initAccum, _baseEachRight_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  111981. }
  111982. /* harmony default export */ __webpack_exports__["default"] = (reduceRight);
  111983. /***/ }),
  111984. /***/ "./node_modules/lodash-es/reject.js":
  111985. /*!******************************************!*\
  111986. !*** ./node_modules/lodash-es/reject.js ***!
  111987. \******************************************/
  111988. /*! exports provided: default */
  111989. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111990. "use strict";
  111991. __webpack_require__.r(__webpack_exports__);
  111992. /* harmony import */ var _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayFilter.js */ "./node_modules/lodash-es/_arrayFilter.js");
  111993. /* harmony import */ var _baseFilter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseFilter.js */ "./node_modules/lodash-es/_baseFilter.js");
  111994. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  111995. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  111996. /* harmony import */ var _negate_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./negate.js */ "./node_modules/lodash-es/negate.js");
  111997. /**
  111998. * The opposite of `_.filter`; this method returns the elements of `collection`
  111999. * that `predicate` does **not** return truthy for.
  112000. *
  112001. * @static
  112002. * @memberOf _
  112003. * @since 0.1.0
  112004. * @category Collection
  112005. * @param {Array|Object} collection The collection to iterate over.
  112006. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  112007. * @returns {Array} Returns the new filtered array.
  112008. * @see _.filter
  112009. * @example
  112010. *
  112011. * var users = [
  112012. * { 'user': 'barney', 'age': 36, 'active': false },
  112013. * { 'user': 'fred', 'age': 40, 'active': true }
  112014. * ];
  112015. *
  112016. * _.reject(users, function(o) { return !o.active; });
  112017. * // => objects for ['fred']
  112018. *
  112019. * // The `_.matches` iteratee shorthand.
  112020. * _.reject(users, { 'age': 40, 'active': true });
  112021. * // => objects for ['barney']
  112022. *
  112023. * // The `_.matchesProperty` iteratee shorthand.
  112024. * _.reject(users, ['active', false]);
  112025. * // => objects for ['fred']
  112026. *
  112027. * // The `_.property` iteratee shorthand.
  112028. * _.reject(users, 'active');
  112029. * // => objects for ['barney']
  112030. */
  112031. function reject(collection, predicate) {
  112032. var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection) ? _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseFilter_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  112033. return func(collection, Object(_negate_js__WEBPACK_IMPORTED_MODULE_4__["default"])(Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_2__["default"])(predicate, 3)));
  112034. }
  112035. /* harmony default export */ __webpack_exports__["default"] = (reject);
  112036. /***/ }),
  112037. /***/ "./node_modules/lodash-es/remove.js":
  112038. /*!******************************************!*\
  112039. !*** ./node_modules/lodash-es/remove.js ***!
  112040. \******************************************/
  112041. /*! exports provided: default */
  112042. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112043. "use strict";
  112044. __webpack_require__.r(__webpack_exports__);
  112045. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  112046. /* harmony import */ var _basePullAt_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_basePullAt.js */ "./node_modules/lodash-es/_basePullAt.js");
  112047. /**
  112048. * Removes all elements from `array` that `predicate` returns truthy for
  112049. * and returns an array of the removed elements. The predicate is invoked
  112050. * with three arguments: (value, index, array).
  112051. *
  112052. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  112053. * to pull elements from an array by value.
  112054. *
  112055. * @static
  112056. * @memberOf _
  112057. * @since 2.0.0
  112058. * @category Array
  112059. * @param {Array} array The array to modify.
  112060. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  112061. * @returns {Array} Returns the new array of removed elements.
  112062. * @example
  112063. *
  112064. * var array = [1, 2, 3, 4];
  112065. * var evens = _.remove(array, function(n) {
  112066. * return n % 2 == 0;
  112067. * });
  112068. *
  112069. * console.log(array);
  112070. * // => [1, 3]
  112071. *
  112072. * console.log(evens);
  112073. * // => [2, 4]
  112074. */
  112075. function remove(array, predicate) {
  112076. var result = [];
  112077. if (!(array && array.length)) {
  112078. return result;
  112079. }
  112080. var index = -1,
  112081. indexes = [],
  112082. length = array.length;
  112083. predicate = Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(predicate, 3);
  112084. while (++index < length) {
  112085. var value = array[index];
  112086. if (predicate(value, index, array)) {
  112087. result.push(value);
  112088. indexes.push(index);
  112089. }
  112090. }
  112091. Object(_basePullAt_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, indexes);
  112092. return result;
  112093. }
  112094. /* harmony default export */ __webpack_exports__["default"] = (remove);
  112095. /***/ }),
  112096. /***/ "./node_modules/lodash-es/repeat.js":
  112097. /*!******************************************!*\
  112098. !*** ./node_modules/lodash-es/repeat.js ***!
  112099. \******************************************/
  112100. /*! exports provided: default */
  112101. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112102. "use strict";
  112103. __webpack_require__.r(__webpack_exports__);
  112104. /* harmony import */ var _baseRepeat_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRepeat.js */ "./node_modules/lodash-es/_baseRepeat.js");
  112105. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  112106. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  112107. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  112108. /**
  112109. * Repeats the given string `n` times.
  112110. *
  112111. * @static
  112112. * @memberOf _
  112113. * @since 3.0.0
  112114. * @category String
  112115. * @param {string} [string=''] The string to repeat.
  112116. * @param {number} [n=1] The number of times to repeat the string.
  112117. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  112118. * @returns {string} Returns the repeated string.
  112119. * @example
  112120. *
  112121. * _.repeat('*', 3);
  112122. * // => '***'
  112123. *
  112124. * _.repeat('abc', 2);
  112125. * // => 'abcabc'
  112126. *
  112127. * _.repeat('abc', 0);
  112128. * // => ''
  112129. */
  112130. function repeat(string, n, guard) {
  112131. if ((guard ? Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string, n, guard) : n === undefined)) {
  112132. n = 1;
  112133. } else {
  112134. n = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(n);
  112135. }
  112136. return Object(_baseRepeat_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string), n);
  112137. }
  112138. /* harmony default export */ __webpack_exports__["default"] = (repeat);
  112139. /***/ }),
  112140. /***/ "./node_modules/lodash-es/replace.js":
  112141. /*!*******************************************!*\
  112142. !*** ./node_modules/lodash-es/replace.js ***!
  112143. \*******************************************/
  112144. /*! exports provided: default */
  112145. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112146. "use strict";
  112147. __webpack_require__.r(__webpack_exports__);
  112148. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  112149. /**
  112150. * Replaces matches for `pattern` in `string` with `replacement`.
  112151. *
  112152. * **Note:** This method is based on
  112153. * [`String#replace`](https://mdn.io/String/replace).
  112154. *
  112155. * @static
  112156. * @memberOf _
  112157. * @since 4.0.0
  112158. * @category String
  112159. * @param {string} [string=''] The string to modify.
  112160. * @param {RegExp|string} pattern The pattern to replace.
  112161. * @param {Function|string} replacement The match replacement.
  112162. * @returns {string} Returns the modified string.
  112163. * @example
  112164. *
  112165. * _.replace('Hi Fred', 'Fred', 'Barney');
  112166. * // => 'Hi Barney'
  112167. */
  112168. function replace() {
  112169. var args = arguments,
  112170. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(args[0]);
  112171. return args.length < 3 ? string : string.replace(args[1], args[2]);
  112172. }
  112173. /* harmony default export */ __webpack_exports__["default"] = (replace);
  112174. /***/ }),
  112175. /***/ "./node_modules/lodash-es/rest.js":
  112176. /*!****************************************!*\
  112177. !*** ./node_modules/lodash-es/rest.js ***!
  112178. \****************************************/
  112179. /*! exports provided: default */
  112180. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112181. "use strict";
  112182. __webpack_require__.r(__webpack_exports__);
  112183. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  112184. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  112185. /** Error message constants. */
  112186. var FUNC_ERROR_TEXT = 'Expected a function';
  112187. /**
  112188. * Creates a function that invokes `func` with the `this` binding of the
  112189. * created function and arguments from `start` and beyond provided as
  112190. * an array.
  112191. *
  112192. * **Note:** This method is based on the
  112193. * [rest parameter](https://mdn.io/rest_parameters).
  112194. *
  112195. * @static
  112196. * @memberOf _
  112197. * @since 4.0.0
  112198. * @category Function
  112199. * @param {Function} func The function to apply a rest parameter to.
  112200. * @param {number} [start=func.length-1] The start position of the rest parameter.
  112201. * @returns {Function} Returns the new function.
  112202. * @example
  112203. *
  112204. * var say = _.rest(function(what, names) {
  112205. * return what + ' ' + _.initial(names).join(', ') +
  112206. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  112207. * });
  112208. *
  112209. * say('hello', 'fred', 'barney', 'pebbles');
  112210. * // => 'hello fred, barney, & pebbles'
  112211. */
  112212. function rest(func, start) {
  112213. if (typeof func != 'function') {
  112214. throw new TypeError(FUNC_ERROR_TEXT);
  112215. }
  112216. start = start === undefined ? start : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(start);
  112217. return Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, start);
  112218. }
  112219. /* harmony default export */ __webpack_exports__["default"] = (rest);
  112220. /***/ }),
  112221. /***/ "./node_modules/lodash-es/result.js":
  112222. /*!******************************************!*\
  112223. !*** ./node_modules/lodash-es/result.js ***!
  112224. \******************************************/
  112225. /*! exports provided: default */
  112226. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112227. "use strict";
  112228. __webpack_require__.r(__webpack_exports__);
  112229. /* harmony import */ var _castPath_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_castPath.js */ "./node_modules/lodash-es/_castPath.js");
  112230. /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
  112231. /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
  112232. /**
  112233. * This method is like `_.get` except that if the resolved value is a
  112234. * function it's invoked with the `this` binding of its parent object and
  112235. * its result is returned.
  112236. *
  112237. * @static
  112238. * @since 0.1.0
  112239. * @memberOf _
  112240. * @category Object
  112241. * @param {Object} object The object to query.
  112242. * @param {Array|string} path The path of the property to resolve.
  112243. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  112244. * @returns {*} Returns the resolved value.
  112245. * @example
  112246. *
  112247. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  112248. *
  112249. * _.result(object, 'a[0].b.c1');
  112250. * // => 3
  112251. *
  112252. * _.result(object, 'a[0].b.c2');
  112253. * // => 4
  112254. *
  112255. * _.result(object, 'a[0].b.c3', 'default');
  112256. * // => 'default'
  112257. *
  112258. * _.result(object, 'a[0].b.c3', _.constant('default'));
  112259. * // => 'default'
  112260. */
  112261. function result(object, path, defaultValue) {
  112262. path = Object(_castPath_js__WEBPACK_IMPORTED_MODULE_0__["default"])(path, object);
  112263. var index = -1,
  112264. length = path.length;
  112265. // Ensure the loop is entered when path is empty.
  112266. if (!length) {
  112267. length = 1;
  112268. object = undefined;
  112269. }
  112270. while (++index < length) {
  112271. var value = object == null ? undefined : object[Object(_toKey_js__WEBPACK_IMPORTED_MODULE_2__["default"])(path[index])];
  112272. if (value === undefined) {
  112273. index = length;
  112274. value = defaultValue;
  112275. }
  112276. object = Object(_isFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value) ? value.call(object) : value;
  112277. }
  112278. return object;
  112279. }
  112280. /* harmony default export */ __webpack_exports__["default"] = (result);
  112281. /***/ }),
  112282. /***/ "./node_modules/lodash-es/reverse.js":
  112283. /*!*******************************************!*\
  112284. !*** ./node_modules/lodash-es/reverse.js ***!
  112285. \*******************************************/
  112286. /*! exports provided: default */
  112287. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112288. "use strict";
  112289. __webpack_require__.r(__webpack_exports__);
  112290. /** Used for built-in method references. */
  112291. var arrayProto = Array.prototype;
  112292. /* Built-in method references for those with the same name as other `lodash` methods. */
  112293. var nativeReverse = arrayProto.reverse;
  112294. /**
  112295. * Reverses `array` so that the first element becomes the last, the second
  112296. * element becomes the second to last, and so on.
  112297. *
  112298. * **Note:** This method mutates `array` and is based on
  112299. * [`Array#reverse`](https://mdn.io/Array/reverse).
  112300. *
  112301. * @static
  112302. * @memberOf _
  112303. * @since 4.0.0
  112304. * @category Array
  112305. * @param {Array} array The array to modify.
  112306. * @returns {Array} Returns `array`.
  112307. * @example
  112308. *
  112309. * var array = [1, 2, 3];
  112310. *
  112311. * _.reverse(array);
  112312. * // => [3, 2, 1]
  112313. *
  112314. * console.log(array);
  112315. * // => [3, 2, 1]
  112316. */
  112317. function reverse(array) {
  112318. return array == null ? array : nativeReverse.call(array);
  112319. }
  112320. /* harmony default export */ __webpack_exports__["default"] = (reverse);
  112321. /***/ }),
  112322. /***/ "./node_modules/lodash-es/round.js":
  112323. /*!*****************************************!*\
  112324. !*** ./node_modules/lodash-es/round.js ***!
  112325. \*****************************************/
  112326. /*! exports provided: default */
  112327. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112328. "use strict";
  112329. __webpack_require__.r(__webpack_exports__);
  112330. /* harmony import */ var _createRound_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createRound.js */ "./node_modules/lodash-es/_createRound.js");
  112331. /**
  112332. * Computes `number` rounded to `precision`.
  112333. *
  112334. * @static
  112335. * @memberOf _
  112336. * @since 3.10.0
  112337. * @category Math
  112338. * @param {number} number The number to round.
  112339. * @param {number} [precision=0] The precision to round to.
  112340. * @returns {number} Returns the rounded number.
  112341. * @example
  112342. *
  112343. * _.round(4.006);
  112344. * // => 4
  112345. *
  112346. * _.round(4.006, 2);
  112347. * // => 4.01
  112348. *
  112349. * _.round(4060, -2);
  112350. * // => 4100
  112351. */
  112352. var round = Object(_createRound_js__WEBPACK_IMPORTED_MODULE_0__["default"])('round');
  112353. /* harmony default export */ __webpack_exports__["default"] = (round);
  112354. /***/ }),
  112355. /***/ "./node_modules/lodash-es/sample.js":
  112356. /*!******************************************!*\
  112357. !*** ./node_modules/lodash-es/sample.js ***!
  112358. \******************************************/
  112359. /*! exports provided: default */
  112360. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112361. "use strict";
  112362. __webpack_require__.r(__webpack_exports__);
  112363. /* harmony import */ var _arraySample_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arraySample.js */ "./node_modules/lodash-es/_arraySample.js");
  112364. /* harmony import */ var _baseSample_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSample.js */ "./node_modules/lodash-es/_baseSample.js");
  112365. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  112366. /**
  112367. * Gets a random element from `collection`.
  112368. *
  112369. * @static
  112370. * @memberOf _
  112371. * @since 2.0.0
  112372. * @category Collection
  112373. * @param {Array|Object} collection The collection to sample.
  112374. * @returns {*} Returns the random element.
  112375. * @example
  112376. *
  112377. * _.sample([1, 2, 3, 4]);
  112378. * // => 2
  112379. */
  112380. function sample(collection) {
  112381. var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(collection) ? _arraySample_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseSample_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  112382. return func(collection);
  112383. }
  112384. /* harmony default export */ __webpack_exports__["default"] = (sample);
  112385. /***/ }),
  112386. /***/ "./node_modules/lodash-es/sampleSize.js":
  112387. /*!**********************************************!*\
  112388. !*** ./node_modules/lodash-es/sampleSize.js ***!
  112389. \**********************************************/
  112390. /*! exports provided: default */
  112391. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112392. "use strict";
  112393. __webpack_require__.r(__webpack_exports__);
  112394. /* harmony import */ var _arraySampleSize_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arraySampleSize.js */ "./node_modules/lodash-es/_arraySampleSize.js");
  112395. /* harmony import */ var _baseSampleSize_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSampleSize.js */ "./node_modules/lodash-es/_baseSampleSize.js");
  112396. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  112397. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  112398. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  112399. /**
  112400. * Gets `n` random elements at unique keys from `collection` up to the
  112401. * size of `collection`.
  112402. *
  112403. * @static
  112404. * @memberOf _
  112405. * @since 4.0.0
  112406. * @category Collection
  112407. * @param {Array|Object} collection The collection to sample.
  112408. * @param {number} [n=1] The number of elements to sample.
  112409. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  112410. * @returns {Array} Returns the random elements.
  112411. * @example
  112412. *
  112413. * _.sampleSize([1, 2, 3], 2);
  112414. * // => [3, 1]
  112415. *
  112416. * _.sampleSize([1, 2, 3], 4);
  112417. * // => [2, 3, 1]
  112418. */
  112419. function sampleSize(collection, n, guard) {
  112420. if ((guard ? Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection, n, guard) : n === undefined)) {
  112421. n = 1;
  112422. } else {
  112423. n = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_4__["default"])(n);
  112424. }
  112425. var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(collection) ? _arraySampleSize_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseSampleSize_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  112426. return func(collection, n);
  112427. }
  112428. /* harmony default export */ __webpack_exports__["default"] = (sampleSize);
  112429. /***/ }),
  112430. /***/ "./node_modules/lodash-es/seq.default.js":
  112431. /*!***********************************************!*\
  112432. !*** ./node_modules/lodash-es/seq.default.js ***!
  112433. \***********************************************/
  112434. /*! exports provided: default */
  112435. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112436. "use strict";
  112437. __webpack_require__.r(__webpack_exports__);
  112438. /* harmony import */ var _wrapperAt_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrapperAt.js */ "./node_modules/lodash-es/wrapperAt.js");
  112439. /* harmony import */ var _chain_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./chain.js */ "./node_modules/lodash-es/chain.js");
  112440. /* harmony import */ var _commit_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./commit.js */ "./node_modules/lodash-es/commit.js");
  112441. /* harmony import */ var _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./wrapperLodash.js */ "./node_modules/lodash-es/wrapperLodash.js");
  112442. /* harmony import */ var _next_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./next.js */ "./node_modules/lodash-es/next.js");
  112443. /* harmony import */ var _plant_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./plant.js */ "./node_modules/lodash-es/plant.js");
  112444. /* harmony import */ var _wrapperReverse_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./wrapperReverse.js */ "./node_modules/lodash-es/wrapperReverse.js");
  112445. /* harmony import */ var _tap_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./tap.js */ "./node_modules/lodash-es/tap.js");
  112446. /* harmony import */ var _thru_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./thru.js */ "./node_modules/lodash-es/thru.js");
  112447. /* harmony import */ var _toIterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./toIterator.js */ "./node_modules/lodash-es/toIterator.js");
  112448. /* harmony import */ var _toJSON_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./toJSON.js */ "./node_modules/lodash-es/toJSON.js");
  112449. /* harmony import */ var _wrapperValue_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./wrapperValue.js */ "./node_modules/lodash-es/wrapperValue.js");
  112450. /* harmony import */ var _valueOf_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./valueOf.js */ "./node_modules/lodash-es/valueOf.js");
  112451. /* harmony import */ var _wrapperChain_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./wrapperChain.js */ "./node_modules/lodash-es/wrapperChain.js");
  112452. /* harmony default export */ __webpack_exports__["default"] = ({
  112453. at: _wrapperAt_js__WEBPACK_IMPORTED_MODULE_0__["default"], chain: _chain_js__WEBPACK_IMPORTED_MODULE_1__["default"], commit: _commit_js__WEBPACK_IMPORTED_MODULE_2__["default"], lodash: _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_3__["default"], next: _next_js__WEBPACK_IMPORTED_MODULE_4__["default"],
  112454. plant: _plant_js__WEBPACK_IMPORTED_MODULE_5__["default"], reverse: _wrapperReverse_js__WEBPACK_IMPORTED_MODULE_6__["default"], tap: _tap_js__WEBPACK_IMPORTED_MODULE_7__["default"], thru: _thru_js__WEBPACK_IMPORTED_MODULE_8__["default"], toIterator: _toIterator_js__WEBPACK_IMPORTED_MODULE_9__["default"],
  112455. toJSON: _toJSON_js__WEBPACK_IMPORTED_MODULE_10__["default"], value: _wrapperValue_js__WEBPACK_IMPORTED_MODULE_11__["default"], valueOf: _valueOf_js__WEBPACK_IMPORTED_MODULE_12__["default"], wrapperChain: _wrapperChain_js__WEBPACK_IMPORTED_MODULE_13__["default"]
  112456. });
  112457. /***/ }),
  112458. /***/ "./node_modules/lodash-es/seq.js":
  112459. /*!***************************************!*\
  112460. !*** ./node_modules/lodash-es/seq.js ***!
  112461. \***************************************/
  112462. /*! exports provided: at, chain, commit, lodash, next, plant, reverse, tap, thru, toIterator, toJSON, value, valueOf, wrapperChain, default */
  112463. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112464. "use strict";
  112465. __webpack_require__.r(__webpack_exports__);
  112466. /* harmony import */ var _wrapperAt_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrapperAt.js */ "./node_modules/lodash-es/wrapperAt.js");
  112467. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "at", function() { return _wrapperAt_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  112468. /* harmony import */ var _chain_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./chain.js */ "./node_modules/lodash-es/chain.js");
  112469. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "chain", function() { return _chain_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  112470. /* harmony import */ var _commit_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./commit.js */ "./node_modules/lodash-es/commit.js");
  112471. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "commit", function() { return _commit_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  112472. /* harmony import */ var _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./wrapperLodash.js */ "./node_modules/lodash-es/wrapperLodash.js");
  112473. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lodash", function() { return _wrapperLodash_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  112474. /* harmony import */ var _next_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./next.js */ "./node_modules/lodash-es/next.js");
  112475. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "next", function() { return _next_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  112476. /* harmony import */ var _plant_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./plant.js */ "./node_modules/lodash-es/plant.js");
  112477. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "plant", function() { return _plant_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  112478. /* harmony import */ var _wrapperReverse_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./wrapperReverse.js */ "./node_modules/lodash-es/wrapperReverse.js");
  112479. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reverse", function() { return _wrapperReverse_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  112480. /* harmony import */ var _tap_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./tap.js */ "./node_modules/lodash-es/tap.js");
  112481. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return _tap_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  112482. /* harmony import */ var _thru_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./thru.js */ "./node_modules/lodash-es/thru.js");
  112483. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "thru", function() { return _thru_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  112484. /* harmony import */ var _toIterator_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./toIterator.js */ "./node_modules/lodash-es/toIterator.js");
  112485. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toIterator", function() { return _toIterator_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  112486. /* harmony import */ var _toJSON_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./toJSON.js */ "./node_modules/lodash-es/toJSON.js");
  112487. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toJSON", function() { return _toJSON_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  112488. /* harmony import */ var _wrapperValue_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./wrapperValue.js */ "./node_modules/lodash-es/wrapperValue.js");
  112489. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "value", function() { return _wrapperValue_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  112490. /* harmony import */ var _valueOf_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./valueOf.js */ "./node_modules/lodash-es/valueOf.js");
  112491. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "valueOf", function() { return _valueOf_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  112492. /* harmony import */ var _wrapperChain_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./wrapperChain.js */ "./node_modules/lodash-es/wrapperChain.js");
  112493. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "wrapperChain", function() { return _wrapperChain_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  112494. /* harmony import */ var _seq_default_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./seq.default.js */ "./node_modules/lodash-es/seq.default.js");
  112495. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _seq_default_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  112496. /***/ }),
  112497. /***/ "./node_modules/lodash-es/set.js":
  112498. /*!***************************************!*\
  112499. !*** ./node_modules/lodash-es/set.js ***!
  112500. \***************************************/
  112501. /*! exports provided: default */
  112502. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112503. "use strict";
  112504. __webpack_require__.r(__webpack_exports__);
  112505. /* harmony import */ var _baseSet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSet.js */ "./node_modules/lodash-es/_baseSet.js");
  112506. /**
  112507. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  112508. * it's created. Arrays are created for missing index properties while objects
  112509. * are created for all other missing properties. Use `_.setWith` to customize
  112510. * `path` creation.
  112511. *
  112512. * **Note:** This method mutates `object`.
  112513. *
  112514. * @static
  112515. * @memberOf _
  112516. * @since 3.7.0
  112517. * @category Object
  112518. * @param {Object} object The object to modify.
  112519. * @param {Array|string} path The path of the property to set.
  112520. * @param {*} value The value to set.
  112521. * @returns {Object} Returns `object`.
  112522. * @example
  112523. *
  112524. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  112525. *
  112526. * _.set(object, 'a[0].b.c', 4);
  112527. * console.log(object.a[0].b.c);
  112528. * // => 4
  112529. *
  112530. * _.set(object, ['x', '0', 'y', 'z'], 5);
  112531. * console.log(object.x[0].y.z);
  112532. * // => 5
  112533. */
  112534. function set(object, path, value) {
  112535. return object == null ? object : Object(_baseSet_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path, value);
  112536. }
  112537. /* harmony default export */ __webpack_exports__["default"] = (set);
  112538. /***/ }),
  112539. /***/ "./node_modules/lodash-es/setWith.js":
  112540. /*!*******************************************!*\
  112541. !*** ./node_modules/lodash-es/setWith.js ***!
  112542. \*******************************************/
  112543. /*! exports provided: default */
  112544. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112545. "use strict";
  112546. __webpack_require__.r(__webpack_exports__);
  112547. /* harmony import */ var _baseSet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSet.js */ "./node_modules/lodash-es/_baseSet.js");
  112548. /**
  112549. * This method is like `_.set` except that it accepts `customizer` which is
  112550. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  112551. * path creation is handled by the method instead. The `customizer` is invoked
  112552. * with three arguments: (nsValue, key, nsObject).
  112553. *
  112554. * **Note:** This method mutates `object`.
  112555. *
  112556. * @static
  112557. * @memberOf _
  112558. * @since 4.0.0
  112559. * @category Object
  112560. * @param {Object} object The object to modify.
  112561. * @param {Array|string} path The path of the property to set.
  112562. * @param {*} value The value to set.
  112563. * @param {Function} [customizer] The function to customize assigned values.
  112564. * @returns {Object} Returns `object`.
  112565. * @example
  112566. *
  112567. * var object = {};
  112568. *
  112569. * _.setWith(object, '[0][1]', 'a', Object);
  112570. * // => { '0': { '1': 'a' } }
  112571. */
  112572. function setWith(object, path, value, customizer) {
  112573. customizer = typeof customizer == 'function' ? customizer : undefined;
  112574. return object == null ? object : Object(_baseSet_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path, value, customizer);
  112575. }
  112576. /* harmony default export */ __webpack_exports__["default"] = (setWith);
  112577. /***/ }),
  112578. /***/ "./node_modules/lodash-es/shuffle.js":
  112579. /*!*******************************************!*\
  112580. !*** ./node_modules/lodash-es/shuffle.js ***!
  112581. \*******************************************/
  112582. /*! exports provided: default */
  112583. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112584. "use strict";
  112585. __webpack_require__.r(__webpack_exports__);
  112586. /* harmony import */ var _arrayShuffle_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayShuffle.js */ "./node_modules/lodash-es/_arrayShuffle.js");
  112587. /* harmony import */ var _baseShuffle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseShuffle.js */ "./node_modules/lodash-es/_baseShuffle.js");
  112588. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  112589. /**
  112590. * Creates an array of shuffled values, using a version of the
  112591. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  112592. *
  112593. * @static
  112594. * @memberOf _
  112595. * @since 0.1.0
  112596. * @category Collection
  112597. * @param {Array|Object} collection The collection to shuffle.
  112598. * @returns {Array} Returns the new shuffled array.
  112599. * @example
  112600. *
  112601. * _.shuffle([1, 2, 3, 4]);
  112602. * // => [4, 1, 3, 2]
  112603. */
  112604. function shuffle(collection) {
  112605. var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(collection) ? _arrayShuffle_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseShuffle_js__WEBPACK_IMPORTED_MODULE_1__["default"];
  112606. return func(collection);
  112607. }
  112608. /* harmony default export */ __webpack_exports__["default"] = (shuffle);
  112609. /***/ }),
  112610. /***/ "./node_modules/lodash-es/size.js":
  112611. /*!****************************************!*\
  112612. !*** ./node_modules/lodash-es/size.js ***!
  112613. \****************************************/
  112614. /*! exports provided: default */
  112615. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112616. "use strict";
  112617. __webpack_require__.r(__webpack_exports__);
  112618. /* harmony import */ var _baseKeys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseKeys.js */ "./node_modules/lodash-es/_baseKeys.js");
  112619. /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
  112620. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  112621. /* harmony import */ var _isString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isString.js */ "./node_modules/lodash-es/isString.js");
  112622. /* harmony import */ var _stringSize_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_stringSize.js */ "./node_modules/lodash-es/_stringSize.js");
  112623. /** `Object#toString` result references. */
  112624. var mapTag = '[object Map]',
  112625. setTag = '[object Set]';
  112626. /**
  112627. * Gets the size of `collection` by returning its length for array-like
  112628. * values or the number of own enumerable string keyed properties for objects.
  112629. *
  112630. * @static
  112631. * @memberOf _
  112632. * @since 0.1.0
  112633. * @category Collection
  112634. * @param {Array|Object|string} collection The collection to inspect.
  112635. * @returns {number} Returns the collection size.
  112636. * @example
  112637. *
  112638. * _.size([1, 2, 3]);
  112639. * // => 3
  112640. *
  112641. * _.size({ 'a': 1, 'b': 2 });
  112642. * // => 2
  112643. *
  112644. * _.size('pebbles');
  112645. * // => 7
  112646. */
  112647. function size(collection) {
  112648. if (collection == null) {
  112649. return 0;
  112650. }
  112651. if (Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_2__["default"])(collection)) {
  112652. return Object(_isString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection) ? Object(_stringSize_js__WEBPACK_IMPORTED_MODULE_4__["default"])(collection) : collection.length;
  112653. }
  112654. var tag = Object(_getTag_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection);
  112655. if (tag == mapTag || tag == setTag) {
  112656. return collection.size;
  112657. }
  112658. return Object(_baseKeys_js__WEBPACK_IMPORTED_MODULE_0__["default"])(collection).length;
  112659. }
  112660. /* harmony default export */ __webpack_exports__["default"] = (size);
  112661. /***/ }),
  112662. /***/ "./node_modules/lodash-es/slice.js":
  112663. /*!*****************************************!*\
  112664. !*** ./node_modules/lodash-es/slice.js ***!
  112665. \*****************************************/
  112666. /*! exports provided: default */
  112667. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112668. "use strict";
  112669. __webpack_require__.r(__webpack_exports__);
  112670. /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
  112671. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  112672. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  112673. /**
  112674. * Creates a slice of `array` from `start` up to, but not including, `end`.
  112675. *
  112676. * **Note:** This method is used instead of
  112677. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  112678. * returned.
  112679. *
  112680. * @static
  112681. * @memberOf _
  112682. * @since 3.0.0
  112683. * @category Array
  112684. * @param {Array} array The array to slice.
  112685. * @param {number} [start=0] The start position.
  112686. * @param {number} [end=array.length] The end position.
  112687. * @returns {Array} Returns the slice of `array`.
  112688. */
  112689. function slice(array, start, end) {
  112690. var length = array == null ? 0 : array.length;
  112691. if (!length) {
  112692. return [];
  112693. }
  112694. if (end && typeof end != 'number' && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, start, end)) {
  112695. start = 0;
  112696. end = length;
  112697. }
  112698. else {
  112699. start = start == null ? 0 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(start);
  112700. end = end === undefined ? length : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(end);
  112701. }
  112702. return Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, start, end);
  112703. }
  112704. /* harmony default export */ __webpack_exports__["default"] = (slice);
  112705. /***/ }),
  112706. /***/ "./node_modules/lodash-es/snakeCase.js":
  112707. /*!*********************************************!*\
  112708. !*** ./node_modules/lodash-es/snakeCase.js ***!
  112709. \*********************************************/
  112710. /*! exports provided: default */
  112711. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112712. "use strict";
  112713. __webpack_require__.r(__webpack_exports__);
  112714. /* harmony import */ var _createCompounder_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createCompounder.js */ "./node_modules/lodash-es/_createCompounder.js");
  112715. /**
  112716. * Converts `string` to
  112717. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  112718. *
  112719. * @static
  112720. * @memberOf _
  112721. * @since 3.0.0
  112722. * @category String
  112723. * @param {string} [string=''] The string to convert.
  112724. * @returns {string} Returns the snake cased string.
  112725. * @example
  112726. *
  112727. * _.snakeCase('Foo Bar');
  112728. * // => 'foo_bar'
  112729. *
  112730. * _.snakeCase('fooBar');
  112731. * // => 'foo_bar'
  112732. *
  112733. * _.snakeCase('--FOO-BAR--');
  112734. * // => 'foo_bar'
  112735. */
  112736. var snakeCase = Object(_createCompounder_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(result, word, index) {
  112737. return result + (index ? '_' : '') + word.toLowerCase();
  112738. });
  112739. /* harmony default export */ __webpack_exports__["default"] = (snakeCase);
  112740. /***/ }),
  112741. /***/ "./node_modules/lodash-es/some.js":
  112742. /*!****************************************!*\
  112743. !*** ./node_modules/lodash-es/some.js ***!
  112744. \****************************************/
  112745. /*! exports provided: default */
  112746. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112747. "use strict";
  112748. __webpack_require__.r(__webpack_exports__);
  112749. /* harmony import */ var _arraySome_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arraySome.js */ "./node_modules/lodash-es/_arraySome.js");
  112750. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  112751. /* harmony import */ var _baseSome_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseSome.js */ "./node_modules/lodash-es/_baseSome.js");
  112752. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  112753. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  112754. /**
  112755. * Checks if `predicate` returns truthy for **any** element of `collection`.
  112756. * Iteration is stopped once `predicate` returns truthy. The predicate is
  112757. * invoked with three arguments: (value, index|key, collection).
  112758. *
  112759. * @static
  112760. * @memberOf _
  112761. * @since 0.1.0
  112762. * @category Collection
  112763. * @param {Array|Object} collection The collection to iterate over.
  112764. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  112765. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  112766. * @returns {boolean} Returns `true` if any element passes the predicate check,
  112767. * else `false`.
  112768. * @example
  112769. *
  112770. * _.some([null, 0, 'yes', false], Boolean);
  112771. * // => true
  112772. *
  112773. * var users = [
  112774. * { 'user': 'barney', 'active': true },
  112775. * { 'user': 'fred', 'active': false }
  112776. * ];
  112777. *
  112778. * // The `_.matches` iteratee shorthand.
  112779. * _.some(users, { 'user': 'barney', 'active': false });
  112780. * // => false
  112781. *
  112782. * // The `_.matchesProperty` iteratee shorthand.
  112783. * _.some(users, ['active', false]);
  112784. * // => true
  112785. *
  112786. * // The `_.property` iteratee shorthand.
  112787. * _.some(users, 'active');
  112788. * // => true
  112789. */
  112790. function some(collection, predicate, guard) {
  112791. var func = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection) ? _arraySome_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseSome_js__WEBPACK_IMPORTED_MODULE_2__["default"];
  112792. if (guard && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_4__["default"])(collection, predicate, guard)) {
  112793. predicate = undefined;
  112794. }
  112795. return func(collection, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__["default"])(predicate, 3));
  112796. }
  112797. /* harmony default export */ __webpack_exports__["default"] = (some);
  112798. /***/ }),
  112799. /***/ "./node_modules/lodash-es/sortBy.js":
  112800. /*!******************************************!*\
  112801. !*** ./node_modules/lodash-es/sortBy.js ***!
  112802. \******************************************/
  112803. /*! exports provided: default */
  112804. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112805. "use strict";
  112806. __webpack_require__.r(__webpack_exports__);
  112807. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  112808. /* harmony import */ var _baseOrderBy_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseOrderBy.js */ "./node_modules/lodash-es/_baseOrderBy.js");
  112809. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  112810. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  112811. /**
  112812. * Creates an array of elements, sorted in ascending order by the results of
  112813. * running each element in a collection thru each iteratee. This method
  112814. * performs a stable sort, that is, it preserves the original sort order of
  112815. * equal elements. The iteratees are invoked with one argument: (value).
  112816. *
  112817. * @static
  112818. * @memberOf _
  112819. * @since 0.1.0
  112820. * @category Collection
  112821. * @param {Array|Object} collection The collection to iterate over.
  112822. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  112823. * The iteratees to sort by.
  112824. * @returns {Array} Returns the new sorted array.
  112825. * @example
  112826. *
  112827. * var users = [
  112828. * { 'user': 'fred', 'age': 48 },
  112829. * { 'user': 'barney', 'age': 36 },
  112830. * { 'user': 'fred', 'age': 30 },
  112831. * { 'user': 'barney', 'age': 34 }
  112832. * ];
  112833. *
  112834. * _.sortBy(users, [function(o) { return o.user; }]);
  112835. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  112836. *
  112837. * _.sortBy(users, ['user', 'age']);
  112838. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  112839. */
  112840. var sortBy = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(collection, iteratees) {
  112841. if (collection == null) {
  112842. return [];
  112843. }
  112844. var length = iteratees.length;
  112845. if (length > 1 && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_3__["default"])(collection, iteratees[0], iteratees[1])) {
  112846. iteratees = [];
  112847. } else if (length > 2 && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_3__["default"])(iteratees[0], iteratees[1], iteratees[2])) {
  112848. iteratees = [iteratees[0]];
  112849. }
  112850. return Object(_baseOrderBy_js__WEBPACK_IMPORTED_MODULE_1__["default"])(collection, Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratees, 1), []);
  112851. });
  112852. /* harmony default export */ __webpack_exports__["default"] = (sortBy);
  112853. /***/ }),
  112854. /***/ "./node_modules/lodash-es/sortedIndex.js":
  112855. /*!***********************************************!*\
  112856. !*** ./node_modules/lodash-es/sortedIndex.js ***!
  112857. \***********************************************/
  112858. /*! exports provided: default */
  112859. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112860. "use strict";
  112861. __webpack_require__.r(__webpack_exports__);
  112862. /* harmony import */ var _baseSortedIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSortedIndex.js */ "./node_modules/lodash-es/_baseSortedIndex.js");
  112863. /**
  112864. * Uses a binary search to determine the lowest index at which `value`
  112865. * should be inserted into `array` in order to maintain its sort order.
  112866. *
  112867. * @static
  112868. * @memberOf _
  112869. * @since 0.1.0
  112870. * @category Array
  112871. * @param {Array} array The sorted array to inspect.
  112872. * @param {*} value The value to evaluate.
  112873. * @returns {number} Returns the index at which `value` should be inserted
  112874. * into `array`.
  112875. * @example
  112876. *
  112877. * _.sortedIndex([30, 50], 40);
  112878. * // => 1
  112879. */
  112880. function sortedIndex(array, value) {
  112881. return Object(_baseSortedIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, value);
  112882. }
  112883. /* harmony default export */ __webpack_exports__["default"] = (sortedIndex);
  112884. /***/ }),
  112885. /***/ "./node_modules/lodash-es/sortedIndexBy.js":
  112886. /*!*************************************************!*\
  112887. !*** ./node_modules/lodash-es/sortedIndexBy.js ***!
  112888. \*************************************************/
  112889. /*! exports provided: default */
  112890. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112891. "use strict";
  112892. __webpack_require__.r(__webpack_exports__);
  112893. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  112894. /* harmony import */ var _baseSortedIndexBy_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSortedIndexBy.js */ "./node_modules/lodash-es/_baseSortedIndexBy.js");
  112895. /**
  112896. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  112897. * which is invoked for `value` and each element of `array` to compute their
  112898. * sort ranking. The iteratee is invoked with one argument: (value).
  112899. *
  112900. * @static
  112901. * @memberOf _
  112902. * @since 4.0.0
  112903. * @category Array
  112904. * @param {Array} array The sorted array to inspect.
  112905. * @param {*} value The value to evaluate.
  112906. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  112907. * @returns {number} Returns the index at which `value` should be inserted
  112908. * into `array`.
  112909. * @example
  112910. *
  112911. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  112912. *
  112913. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  112914. * // => 0
  112915. *
  112916. * // The `_.property` iteratee shorthand.
  112917. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  112918. * // => 0
  112919. */
  112920. function sortedIndexBy(array, value, iteratee) {
  112921. return Object(_baseSortedIndexBy_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, value, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, 2));
  112922. }
  112923. /* harmony default export */ __webpack_exports__["default"] = (sortedIndexBy);
  112924. /***/ }),
  112925. /***/ "./node_modules/lodash-es/sortedIndexOf.js":
  112926. /*!*************************************************!*\
  112927. !*** ./node_modules/lodash-es/sortedIndexOf.js ***!
  112928. \*************************************************/
  112929. /*! exports provided: default */
  112930. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112931. "use strict";
  112932. __webpack_require__.r(__webpack_exports__);
  112933. /* harmony import */ var _baseSortedIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSortedIndex.js */ "./node_modules/lodash-es/_baseSortedIndex.js");
  112934. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  112935. /**
  112936. * This method is like `_.indexOf` except that it performs a binary
  112937. * search on a sorted `array`.
  112938. *
  112939. * @static
  112940. * @memberOf _
  112941. * @since 4.0.0
  112942. * @category Array
  112943. * @param {Array} array The array to inspect.
  112944. * @param {*} value The value to search for.
  112945. * @returns {number} Returns the index of the matched value, else `-1`.
  112946. * @example
  112947. *
  112948. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  112949. * // => 1
  112950. */
  112951. function sortedIndexOf(array, value) {
  112952. var length = array == null ? 0 : array.length;
  112953. if (length) {
  112954. var index = Object(_baseSortedIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, value);
  112955. if (index < length && Object(_eq_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array[index], value)) {
  112956. return index;
  112957. }
  112958. }
  112959. return -1;
  112960. }
  112961. /* harmony default export */ __webpack_exports__["default"] = (sortedIndexOf);
  112962. /***/ }),
  112963. /***/ "./node_modules/lodash-es/sortedLastIndex.js":
  112964. /*!***************************************************!*\
  112965. !*** ./node_modules/lodash-es/sortedLastIndex.js ***!
  112966. \***************************************************/
  112967. /*! exports provided: default */
  112968. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  112969. "use strict";
  112970. __webpack_require__.r(__webpack_exports__);
  112971. /* harmony import */ var _baseSortedIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSortedIndex.js */ "./node_modules/lodash-es/_baseSortedIndex.js");
  112972. /**
  112973. * This method is like `_.sortedIndex` except that it returns the highest
  112974. * index at which `value` should be inserted into `array` in order to
  112975. * maintain its sort order.
  112976. *
  112977. * @static
  112978. * @memberOf _
  112979. * @since 3.0.0
  112980. * @category Array
  112981. * @param {Array} array The sorted array to inspect.
  112982. * @param {*} value The value to evaluate.
  112983. * @returns {number} Returns the index at which `value` should be inserted
  112984. * into `array`.
  112985. * @example
  112986. *
  112987. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  112988. * // => 4
  112989. */
  112990. function sortedLastIndex(array, value) {
  112991. return Object(_baseSortedIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, value, true);
  112992. }
  112993. /* harmony default export */ __webpack_exports__["default"] = (sortedLastIndex);
  112994. /***/ }),
  112995. /***/ "./node_modules/lodash-es/sortedLastIndexBy.js":
  112996. /*!*****************************************************!*\
  112997. !*** ./node_modules/lodash-es/sortedLastIndexBy.js ***!
  112998. \*****************************************************/
  112999. /*! exports provided: default */
  113000. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113001. "use strict";
  113002. __webpack_require__.r(__webpack_exports__);
  113003. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  113004. /* harmony import */ var _baseSortedIndexBy_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSortedIndexBy.js */ "./node_modules/lodash-es/_baseSortedIndexBy.js");
  113005. /**
  113006. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  113007. * which is invoked for `value` and each element of `array` to compute their
  113008. * sort ranking. The iteratee is invoked with one argument: (value).
  113009. *
  113010. * @static
  113011. * @memberOf _
  113012. * @since 4.0.0
  113013. * @category Array
  113014. * @param {Array} array The sorted array to inspect.
  113015. * @param {*} value The value to evaluate.
  113016. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  113017. * @returns {number} Returns the index at which `value` should be inserted
  113018. * into `array`.
  113019. * @example
  113020. *
  113021. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  113022. *
  113023. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  113024. * // => 1
  113025. *
  113026. * // The `_.property` iteratee shorthand.
  113027. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  113028. * // => 1
  113029. */
  113030. function sortedLastIndexBy(array, value, iteratee) {
  113031. return Object(_baseSortedIndexBy_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, value, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, 2), true);
  113032. }
  113033. /* harmony default export */ __webpack_exports__["default"] = (sortedLastIndexBy);
  113034. /***/ }),
  113035. /***/ "./node_modules/lodash-es/sortedLastIndexOf.js":
  113036. /*!*****************************************************!*\
  113037. !*** ./node_modules/lodash-es/sortedLastIndexOf.js ***!
  113038. \*****************************************************/
  113039. /*! exports provided: default */
  113040. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113041. "use strict";
  113042. __webpack_require__.r(__webpack_exports__);
  113043. /* harmony import */ var _baseSortedIndex_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSortedIndex.js */ "./node_modules/lodash-es/_baseSortedIndex.js");
  113044. /* harmony import */ var _eq_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./eq.js */ "./node_modules/lodash-es/eq.js");
  113045. /**
  113046. * This method is like `_.lastIndexOf` except that it performs a binary
  113047. * search on a sorted `array`.
  113048. *
  113049. * @static
  113050. * @memberOf _
  113051. * @since 4.0.0
  113052. * @category Array
  113053. * @param {Array} array The array to inspect.
  113054. * @param {*} value The value to search for.
  113055. * @returns {number} Returns the index of the matched value, else `-1`.
  113056. * @example
  113057. *
  113058. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  113059. * // => 3
  113060. */
  113061. function sortedLastIndexOf(array, value) {
  113062. var length = array == null ? 0 : array.length;
  113063. if (length) {
  113064. var index = Object(_baseSortedIndex_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, value, true) - 1;
  113065. if (Object(_eq_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array[index], value)) {
  113066. return index;
  113067. }
  113068. }
  113069. return -1;
  113070. }
  113071. /* harmony default export */ __webpack_exports__["default"] = (sortedLastIndexOf);
  113072. /***/ }),
  113073. /***/ "./node_modules/lodash-es/sortedUniq.js":
  113074. /*!**********************************************!*\
  113075. !*** ./node_modules/lodash-es/sortedUniq.js ***!
  113076. \**********************************************/
  113077. /*! exports provided: default */
  113078. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113079. "use strict";
  113080. __webpack_require__.r(__webpack_exports__);
  113081. /* harmony import */ var _baseSortedUniq_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSortedUniq.js */ "./node_modules/lodash-es/_baseSortedUniq.js");
  113082. /**
  113083. * This method is like `_.uniq` except that it's designed and optimized
  113084. * for sorted arrays.
  113085. *
  113086. * @static
  113087. * @memberOf _
  113088. * @since 4.0.0
  113089. * @category Array
  113090. * @param {Array} array The array to inspect.
  113091. * @returns {Array} Returns the new duplicate free array.
  113092. * @example
  113093. *
  113094. * _.sortedUniq([1, 1, 2]);
  113095. * // => [1, 2]
  113096. */
  113097. function sortedUniq(array) {
  113098. return (array && array.length)
  113099. ? Object(_baseSortedUniq_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array)
  113100. : [];
  113101. }
  113102. /* harmony default export */ __webpack_exports__["default"] = (sortedUniq);
  113103. /***/ }),
  113104. /***/ "./node_modules/lodash-es/sortedUniqBy.js":
  113105. /*!************************************************!*\
  113106. !*** ./node_modules/lodash-es/sortedUniqBy.js ***!
  113107. \************************************************/
  113108. /*! exports provided: default */
  113109. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113110. "use strict";
  113111. __webpack_require__.r(__webpack_exports__);
  113112. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  113113. /* harmony import */ var _baseSortedUniq_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSortedUniq.js */ "./node_modules/lodash-es/_baseSortedUniq.js");
  113114. /**
  113115. * This method is like `_.uniqBy` except that it's designed and optimized
  113116. * for sorted arrays.
  113117. *
  113118. * @static
  113119. * @memberOf _
  113120. * @since 4.0.0
  113121. * @category Array
  113122. * @param {Array} array The array to inspect.
  113123. * @param {Function} [iteratee] The iteratee invoked per element.
  113124. * @returns {Array} Returns the new duplicate free array.
  113125. * @example
  113126. *
  113127. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  113128. * // => [1.1, 2.3]
  113129. */
  113130. function sortedUniqBy(array, iteratee) {
  113131. return (array && array.length)
  113132. ? Object(_baseSortedUniq_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, 2))
  113133. : [];
  113134. }
  113135. /* harmony default export */ __webpack_exports__["default"] = (sortedUniqBy);
  113136. /***/ }),
  113137. /***/ "./node_modules/lodash-es/split.js":
  113138. /*!*****************************************!*\
  113139. !*** ./node_modules/lodash-es/split.js ***!
  113140. \*****************************************/
  113141. /*! exports provided: default */
  113142. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113143. "use strict";
  113144. __webpack_require__.r(__webpack_exports__);
  113145. /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
  113146. /* harmony import */ var _castSlice_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castSlice.js */ "./node_modules/lodash-es/_castSlice.js");
  113147. /* harmony import */ var _hasUnicode_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_hasUnicode.js */ "./node_modules/lodash-es/_hasUnicode.js");
  113148. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  113149. /* harmony import */ var _isRegExp_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isRegExp.js */ "./node_modules/lodash-es/isRegExp.js");
  113150. /* harmony import */ var _stringToArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_stringToArray.js */ "./node_modules/lodash-es/_stringToArray.js");
  113151. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  113152. /** Used as references for the maximum length and index of an array. */
  113153. var MAX_ARRAY_LENGTH = 4294967295;
  113154. /**
  113155. * Splits `string` by `separator`.
  113156. *
  113157. * **Note:** This method is based on
  113158. * [`String#split`](https://mdn.io/String/split).
  113159. *
  113160. * @static
  113161. * @memberOf _
  113162. * @since 4.0.0
  113163. * @category String
  113164. * @param {string} [string=''] The string to split.
  113165. * @param {RegExp|string} separator The separator pattern to split by.
  113166. * @param {number} [limit] The length to truncate results to.
  113167. * @returns {Array} Returns the string segments.
  113168. * @example
  113169. *
  113170. * _.split('a-b-c', '-', 2);
  113171. * // => ['a', 'b']
  113172. */
  113173. function split(string, separator, limit) {
  113174. if (limit && typeof limit != 'number' && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string, separator, limit)) {
  113175. separator = limit = undefined;
  113176. }
  113177. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  113178. if (!limit) {
  113179. return [];
  113180. }
  113181. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_6__["default"])(string);
  113182. if (string && (
  113183. typeof separator == 'string' ||
  113184. (separator != null && !Object(_isRegExp_js__WEBPACK_IMPORTED_MODULE_4__["default"])(separator))
  113185. )) {
  113186. separator = Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(separator);
  113187. if (!separator && Object(_hasUnicode_js__WEBPACK_IMPORTED_MODULE_2__["default"])(string)) {
  113188. return Object(_castSlice_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(string), 0, limit);
  113189. }
  113190. }
  113191. return string.split(separator, limit);
  113192. }
  113193. /* harmony default export */ __webpack_exports__["default"] = (split);
  113194. /***/ }),
  113195. /***/ "./node_modules/lodash-es/spread.js":
  113196. /*!******************************************!*\
  113197. !*** ./node_modules/lodash-es/spread.js ***!
  113198. \******************************************/
  113199. /*! exports provided: default */
  113200. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113201. "use strict";
  113202. __webpack_require__.r(__webpack_exports__);
  113203. /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  113204. /* harmony import */ var _arrayPush_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayPush.js */ "./node_modules/lodash-es/_arrayPush.js");
  113205. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  113206. /* harmony import */ var _castSlice_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_castSlice.js */ "./node_modules/lodash-es/_castSlice.js");
  113207. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  113208. /** Error message constants. */
  113209. var FUNC_ERROR_TEXT = 'Expected a function';
  113210. /* Built-in method references for those with the same name as other `lodash` methods. */
  113211. var nativeMax = Math.max;
  113212. /**
  113213. * Creates a function that invokes `func` with the `this` binding of the
  113214. * create function and an array of arguments much like
  113215. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  113216. *
  113217. * **Note:** This method is based on the
  113218. * [spread operator](https://mdn.io/spread_operator).
  113219. *
  113220. * @static
  113221. * @memberOf _
  113222. * @since 3.2.0
  113223. * @category Function
  113224. * @param {Function} func The function to spread arguments over.
  113225. * @param {number} [start=0] The start position of the spread.
  113226. * @returns {Function} Returns the new function.
  113227. * @example
  113228. *
  113229. * var say = _.spread(function(who, what) {
  113230. * return who + ' says ' + what;
  113231. * });
  113232. *
  113233. * say(['fred', 'hello']);
  113234. * // => 'fred says hello'
  113235. *
  113236. * var numbers = Promise.all([
  113237. * Promise.resolve(40),
  113238. * Promise.resolve(36)
  113239. * ]);
  113240. *
  113241. * numbers.then(_.spread(function(x, y) {
  113242. * return x + y;
  113243. * }));
  113244. * // => a Promise of 76
  113245. */
  113246. function spread(func, start) {
  113247. if (typeof func != 'function') {
  113248. throw new TypeError(FUNC_ERROR_TEXT);
  113249. }
  113250. start = start == null ? 0 : nativeMax(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_4__["default"])(start), 0);
  113251. return Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(args) {
  113252. var array = args[start],
  113253. otherArgs = Object(_castSlice_js__WEBPACK_IMPORTED_MODULE_3__["default"])(args, 0, start);
  113254. if (array) {
  113255. Object(_arrayPush_js__WEBPACK_IMPORTED_MODULE_1__["default"])(otherArgs, array);
  113256. }
  113257. return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, this, otherArgs);
  113258. });
  113259. }
  113260. /* harmony default export */ __webpack_exports__["default"] = (spread);
  113261. /***/ }),
  113262. /***/ "./node_modules/lodash-es/startCase.js":
  113263. /*!*********************************************!*\
  113264. !*** ./node_modules/lodash-es/startCase.js ***!
  113265. \*********************************************/
  113266. /*! exports provided: default */
  113267. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113268. "use strict";
  113269. __webpack_require__.r(__webpack_exports__);
  113270. /* harmony import */ var _createCompounder_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createCompounder.js */ "./node_modules/lodash-es/_createCompounder.js");
  113271. /* harmony import */ var _upperFirst_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./upperFirst.js */ "./node_modules/lodash-es/upperFirst.js");
  113272. /**
  113273. * Converts `string` to
  113274. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  113275. *
  113276. * @static
  113277. * @memberOf _
  113278. * @since 3.1.0
  113279. * @category String
  113280. * @param {string} [string=''] The string to convert.
  113281. * @returns {string} Returns the start cased string.
  113282. * @example
  113283. *
  113284. * _.startCase('--foo-bar--');
  113285. * // => 'Foo Bar'
  113286. *
  113287. * _.startCase('fooBar');
  113288. * // => 'Foo Bar'
  113289. *
  113290. * _.startCase('__FOO_BAR__');
  113291. * // => 'FOO BAR'
  113292. */
  113293. var startCase = Object(_createCompounder_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(result, word, index) {
  113294. return result + (index ? ' ' : '') + Object(_upperFirst_js__WEBPACK_IMPORTED_MODULE_1__["default"])(word);
  113295. });
  113296. /* harmony default export */ __webpack_exports__["default"] = (startCase);
  113297. /***/ }),
  113298. /***/ "./node_modules/lodash-es/startsWith.js":
  113299. /*!**********************************************!*\
  113300. !*** ./node_modules/lodash-es/startsWith.js ***!
  113301. \**********************************************/
  113302. /*! exports provided: default */
  113303. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113304. "use strict";
  113305. __webpack_require__.r(__webpack_exports__);
  113306. /* harmony import */ var _baseClamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClamp.js */ "./node_modules/lodash-es/_baseClamp.js");
  113307. /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
  113308. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  113309. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  113310. /**
  113311. * Checks if `string` starts with the given target string.
  113312. *
  113313. * @static
  113314. * @memberOf _
  113315. * @since 3.0.0
  113316. * @category String
  113317. * @param {string} [string=''] The string to inspect.
  113318. * @param {string} [target] The string to search for.
  113319. * @param {number} [position=0] The position to search from.
  113320. * @returns {boolean} Returns `true` if `string` starts with `target`,
  113321. * else `false`.
  113322. * @example
  113323. *
  113324. * _.startsWith('abc', 'a');
  113325. * // => true
  113326. *
  113327. * _.startsWith('abc', 'b');
  113328. * // => false
  113329. *
  113330. * _.startsWith('abc', 'b', 1);
  113331. * // => true
  113332. */
  113333. function startsWith(string, target, position) {
  113334. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string);
  113335. position = position == null
  113336. ? 0
  113337. : Object(_baseClamp_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(position), 0, string.length);
  113338. target = Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_1__["default"])(target);
  113339. return string.slice(position, position + target.length) == target;
  113340. }
  113341. /* harmony default export */ __webpack_exports__["default"] = (startsWith);
  113342. /***/ }),
  113343. /***/ "./node_modules/lodash-es/string.default.js":
  113344. /*!**************************************************!*\
  113345. !*** ./node_modules/lodash-es/string.default.js ***!
  113346. \**************************************************/
  113347. /*! exports provided: default */
  113348. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113349. "use strict";
  113350. __webpack_require__.r(__webpack_exports__);
  113351. /* harmony import */ var _camelCase_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./camelCase.js */ "./node_modules/lodash-es/camelCase.js");
  113352. /* harmony import */ var _capitalize_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./capitalize.js */ "./node_modules/lodash-es/capitalize.js");
  113353. /* harmony import */ var _deburr_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./deburr.js */ "./node_modules/lodash-es/deburr.js");
  113354. /* harmony import */ var _endsWith_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./endsWith.js */ "./node_modules/lodash-es/endsWith.js");
  113355. /* harmony import */ var _escape_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./escape.js */ "./node_modules/lodash-es/escape.js");
  113356. /* harmony import */ var _escapeRegExp_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./escapeRegExp.js */ "./node_modules/lodash-es/escapeRegExp.js");
  113357. /* harmony import */ var _kebabCase_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./kebabCase.js */ "./node_modules/lodash-es/kebabCase.js");
  113358. /* harmony import */ var _lowerCase_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./lowerCase.js */ "./node_modules/lodash-es/lowerCase.js");
  113359. /* harmony import */ var _lowerFirst_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./lowerFirst.js */ "./node_modules/lodash-es/lowerFirst.js");
  113360. /* harmony import */ var _pad_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./pad.js */ "./node_modules/lodash-es/pad.js");
  113361. /* harmony import */ var _padEnd_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./padEnd.js */ "./node_modules/lodash-es/padEnd.js");
  113362. /* harmony import */ var _padStart_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./padStart.js */ "./node_modules/lodash-es/padStart.js");
  113363. /* harmony import */ var _parseInt_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./parseInt.js */ "./node_modules/lodash-es/parseInt.js");
  113364. /* harmony import */ var _repeat_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./repeat.js */ "./node_modules/lodash-es/repeat.js");
  113365. /* harmony import */ var _replace_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./replace.js */ "./node_modules/lodash-es/replace.js");
  113366. /* harmony import */ var _snakeCase_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./snakeCase.js */ "./node_modules/lodash-es/snakeCase.js");
  113367. /* harmony import */ var _split_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./split.js */ "./node_modules/lodash-es/split.js");
  113368. /* harmony import */ var _startCase_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./startCase.js */ "./node_modules/lodash-es/startCase.js");
  113369. /* harmony import */ var _startsWith_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./startsWith.js */ "./node_modules/lodash-es/startsWith.js");
  113370. /* harmony import */ var _template_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./template.js */ "./node_modules/lodash-es/template.js");
  113371. /* harmony import */ var _templateSettings_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./templateSettings.js */ "./node_modules/lodash-es/templateSettings.js");
  113372. /* harmony import */ var _toLower_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./toLower.js */ "./node_modules/lodash-es/toLower.js");
  113373. /* harmony import */ var _toUpper_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./toUpper.js */ "./node_modules/lodash-es/toUpper.js");
  113374. /* harmony import */ var _trim_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./trim.js */ "./node_modules/lodash-es/trim.js");
  113375. /* harmony import */ var _trimEnd_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./trimEnd.js */ "./node_modules/lodash-es/trimEnd.js");
  113376. /* harmony import */ var _trimStart_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./trimStart.js */ "./node_modules/lodash-es/trimStart.js");
  113377. /* harmony import */ var _truncate_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./truncate.js */ "./node_modules/lodash-es/truncate.js");
  113378. /* harmony import */ var _unescape_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./unescape.js */ "./node_modules/lodash-es/unescape.js");
  113379. /* harmony import */ var _upperCase_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./upperCase.js */ "./node_modules/lodash-es/upperCase.js");
  113380. /* harmony import */ var _upperFirst_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./upperFirst.js */ "./node_modules/lodash-es/upperFirst.js");
  113381. /* harmony import */ var _words_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./words.js */ "./node_modules/lodash-es/words.js");
  113382. /* harmony default export */ __webpack_exports__["default"] = ({
  113383. camelCase: _camelCase_js__WEBPACK_IMPORTED_MODULE_0__["default"], capitalize: _capitalize_js__WEBPACK_IMPORTED_MODULE_1__["default"], deburr: _deburr_js__WEBPACK_IMPORTED_MODULE_2__["default"], endsWith: _endsWith_js__WEBPACK_IMPORTED_MODULE_3__["default"], escape: _escape_js__WEBPACK_IMPORTED_MODULE_4__["default"],
  113384. escapeRegExp: _escapeRegExp_js__WEBPACK_IMPORTED_MODULE_5__["default"], kebabCase: _kebabCase_js__WEBPACK_IMPORTED_MODULE_6__["default"], lowerCase: _lowerCase_js__WEBPACK_IMPORTED_MODULE_7__["default"], lowerFirst: _lowerFirst_js__WEBPACK_IMPORTED_MODULE_8__["default"], pad: _pad_js__WEBPACK_IMPORTED_MODULE_9__["default"],
  113385. padEnd: _padEnd_js__WEBPACK_IMPORTED_MODULE_10__["default"], padStart: _padStart_js__WEBPACK_IMPORTED_MODULE_11__["default"], parseInt: _parseInt_js__WEBPACK_IMPORTED_MODULE_12__["default"], repeat: _repeat_js__WEBPACK_IMPORTED_MODULE_13__["default"], replace: _replace_js__WEBPACK_IMPORTED_MODULE_14__["default"],
  113386. snakeCase: _snakeCase_js__WEBPACK_IMPORTED_MODULE_15__["default"], split: _split_js__WEBPACK_IMPORTED_MODULE_16__["default"], startCase: _startCase_js__WEBPACK_IMPORTED_MODULE_17__["default"], startsWith: _startsWith_js__WEBPACK_IMPORTED_MODULE_18__["default"], template: _template_js__WEBPACK_IMPORTED_MODULE_19__["default"],
  113387. templateSettings: _templateSettings_js__WEBPACK_IMPORTED_MODULE_20__["default"], toLower: _toLower_js__WEBPACK_IMPORTED_MODULE_21__["default"], toUpper: _toUpper_js__WEBPACK_IMPORTED_MODULE_22__["default"], trim: _trim_js__WEBPACK_IMPORTED_MODULE_23__["default"], trimEnd: _trimEnd_js__WEBPACK_IMPORTED_MODULE_24__["default"],
  113388. trimStart: _trimStart_js__WEBPACK_IMPORTED_MODULE_25__["default"], truncate: _truncate_js__WEBPACK_IMPORTED_MODULE_26__["default"], unescape: _unescape_js__WEBPACK_IMPORTED_MODULE_27__["default"], upperCase: _upperCase_js__WEBPACK_IMPORTED_MODULE_28__["default"], upperFirst: _upperFirst_js__WEBPACK_IMPORTED_MODULE_29__["default"],
  113389. words: _words_js__WEBPACK_IMPORTED_MODULE_30__["default"]
  113390. });
  113391. /***/ }),
  113392. /***/ "./node_modules/lodash-es/string.js":
  113393. /*!******************************************!*\
  113394. !*** ./node_modules/lodash-es/string.js ***!
  113395. \******************************************/
  113396. /*! exports provided: camelCase, capitalize, deburr, endsWith, escape, escapeRegExp, kebabCase, lowerCase, lowerFirst, pad, padEnd, padStart, parseInt, repeat, replace, snakeCase, split, startCase, startsWith, template, templateSettings, toLower, toUpper, trim, trimEnd, trimStart, truncate, unescape, upperCase, upperFirst, words, default */
  113397. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113398. "use strict";
  113399. __webpack_require__.r(__webpack_exports__);
  113400. /* harmony import */ var _camelCase_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./camelCase.js */ "./node_modules/lodash-es/camelCase.js");
  113401. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "camelCase", function() { return _camelCase_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  113402. /* harmony import */ var _capitalize_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./capitalize.js */ "./node_modules/lodash-es/capitalize.js");
  113403. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "capitalize", function() { return _capitalize_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  113404. /* harmony import */ var _deburr_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./deburr.js */ "./node_modules/lodash-es/deburr.js");
  113405. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "deburr", function() { return _deburr_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  113406. /* harmony import */ var _endsWith_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./endsWith.js */ "./node_modules/lodash-es/endsWith.js");
  113407. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "endsWith", function() { return _endsWith_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  113408. /* harmony import */ var _escape_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./escape.js */ "./node_modules/lodash-es/escape.js");
  113409. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "escape", function() { return _escape_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  113410. /* harmony import */ var _escapeRegExp_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./escapeRegExp.js */ "./node_modules/lodash-es/escapeRegExp.js");
  113411. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "escapeRegExp", function() { return _escapeRegExp_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  113412. /* harmony import */ var _kebabCase_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./kebabCase.js */ "./node_modules/lodash-es/kebabCase.js");
  113413. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "kebabCase", function() { return _kebabCase_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  113414. /* harmony import */ var _lowerCase_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./lowerCase.js */ "./node_modules/lodash-es/lowerCase.js");
  113415. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lowerCase", function() { return _lowerCase_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  113416. /* harmony import */ var _lowerFirst_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./lowerFirst.js */ "./node_modules/lodash-es/lowerFirst.js");
  113417. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lowerFirst", function() { return _lowerFirst_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  113418. /* harmony import */ var _pad_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./pad.js */ "./node_modules/lodash-es/pad.js");
  113419. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pad", function() { return _pad_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  113420. /* harmony import */ var _padEnd_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./padEnd.js */ "./node_modules/lodash-es/padEnd.js");
  113421. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "padEnd", function() { return _padEnd_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  113422. /* harmony import */ var _padStart_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./padStart.js */ "./node_modules/lodash-es/padStart.js");
  113423. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "padStart", function() { return _padStart_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  113424. /* harmony import */ var _parseInt_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./parseInt.js */ "./node_modules/lodash-es/parseInt.js");
  113425. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseInt", function() { return _parseInt_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  113426. /* harmony import */ var _repeat_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./repeat.js */ "./node_modules/lodash-es/repeat.js");
  113427. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "repeat", function() { return _repeat_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  113428. /* harmony import */ var _replace_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./replace.js */ "./node_modules/lodash-es/replace.js");
  113429. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "replace", function() { return _replace_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  113430. /* harmony import */ var _snakeCase_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./snakeCase.js */ "./node_modules/lodash-es/snakeCase.js");
  113431. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "snakeCase", function() { return _snakeCase_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
  113432. /* harmony import */ var _split_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./split.js */ "./node_modules/lodash-es/split.js");
  113433. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "split", function() { return _split_js__WEBPACK_IMPORTED_MODULE_16__["default"]; });
  113434. /* harmony import */ var _startCase_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./startCase.js */ "./node_modules/lodash-es/startCase.js");
  113435. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startCase", function() { return _startCase_js__WEBPACK_IMPORTED_MODULE_17__["default"]; });
  113436. /* harmony import */ var _startsWith_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./startsWith.js */ "./node_modules/lodash-es/startsWith.js");
  113437. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startsWith", function() { return _startsWith_js__WEBPACK_IMPORTED_MODULE_18__["default"]; });
  113438. /* harmony import */ var _template_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./template.js */ "./node_modules/lodash-es/template.js");
  113439. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "template", function() { return _template_js__WEBPACK_IMPORTED_MODULE_19__["default"]; });
  113440. /* harmony import */ var _templateSettings_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./templateSettings.js */ "./node_modules/lodash-es/templateSettings.js");
  113441. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "templateSettings", function() { return _templateSettings_js__WEBPACK_IMPORTED_MODULE_20__["default"]; });
  113442. /* harmony import */ var _toLower_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./toLower.js */ "./node_modules/lodash-es/toLower.js");
  113443. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toLower", function() { return _toLower_js__WEBPACK_IMPORTED_MODULE_21__["default"]; });
  113444. /* harmony import */ var _toUpper_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./toUpper.js */ "./node_modules/lodash-es/toUpper.js");
  113445. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toUpper", function() { return _toUpper_js__WEBPACK_IMPORTED_MODULE_22__["default"]; });
  113446. /* harmony import */ var _trim_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./trim.js */ "./node_modules/lodash-es/trim.js");
  113447. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "trim", function() { return _trim_js__WEBPACK_IMPORTED_MODULE_23__["default"]; });
  113448. /* harmony import */ var _trimEnd_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./trimEnd.js */ "./node_modules/lodash-es/trimEnd.js");
  113449. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "trimEnd", function() { return _trimEnd_js__WEBPACK_IMPORTED_MODULE_24__["default"]; });
  113450. /* harmony import */ var _trimStart_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./trimStart.js */ "./node_modules/lodash-es/trimStart.js");
  113451. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "trimStart", function() { return _trimStart_js__WEBPACK_IMPORTED_MODULE_25__["default"]; });
  113452. /* harmony import */ var _truncate_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./truncate.js */ "./node_modules/lodash-es/truncate.js");
  113453. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "truncate", function() { return _truncate_js__WEBPACK_IMPORTED_MODULE_26__["default"]; });
  113454. /* harmony import */ var _unescape_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./unescape.js */ "./node_modules/lodash-es/unescape.js");
  113455. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "unescape", function() { return _unescape_js__WEBPACK_IMPORTED_MODULE_27__["default"]; });
  113456. /* harmony import */ var _upperCase_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./upperCase.js */ "./node_modules/lodash-es/upperCase.js");
  113457. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "upperCase", function() { return _upperCase_js__WEBPACK_IMPORTED_MODULE_28__["default"]; });
  113458. /* harmony import */ var _upperFirst_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./upperFirst.js */ "./node_modules/lodash-es/upperFirst.js");
  113459. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "upperFirst", function() { return _upperFirst_js__WEBPACK_IMPORTED_MODULE_29__["default"]; });
  113460. /* harmony import */ var _words_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./words.js */ "./node_modules/lodash-es/words.js");
  113461. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "words", function() { return _words_js__WEBPACK_IMPORTED_MODULE_30__["default"]; });
  113462. /* harmony import */ var _string_default_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./string.default.js */ "./node_modules/lodash-es/string.default.js");
  113463. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _string_default_js__WEBPACK_IMPORTED_MODULE_31__["default"]; });
  113464. /***/ }),
  113465. /***/ "./node_modules/lodash-es/stubArray.js":
  113466. /*!*********************************************!*\
  113467. !*** ./node_modules/lodash-es/stubArray.js ***!
  113468. \*********************************************/
  113469. /*! exports provided: default */
  113470. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113471. "use strict";
  113472. __webpack_require__.r(__webpack_exports__);
  113473. /**
  113474. * This method returns a new empty array.
  113475. *
  113476. * @static
  113477. * @memberOf _
  113478. * @since 4.13.0
  113479. * @category Util
  113480. * @returns {Array} Returns the new empty array.
  113481. * @example
  113482. *
  113483. * var arrays = _.times(2, _.stubArray);
  113484. *
  113485. * console.log(arrays);
  113486. * // => [[], []]
  113487. *
  113488. * console.log(arrays[0] === arrays[1]);
  113489. * // => false
  113490. */
  113491. function stubArray() {
  113492. return [];
  113493. }
  113494. /* harmony default export */ __webpack_exports__["default"] = (stubArray);
  113495. /***/ }),
  113496. /***/ "./node_modules/lodash-es/stubFalse.js":
  113497. /*!*********************************************!*\
  113498. !*** ./node_modules/lodash-es/stubFalse.js ***!
  113499. \*********************************************/
  113500. /*! exports provided: default */
  113501. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113502. "use strict";
  113503. __webpack_require__.r(__webpack_exports__);
  113504. /**
  113505. * This method returns `false`.
  113506. *
  113507. * @static
  113508. * @memberOf _
  113509. * @since 4.13.0
  113510. * @category Util
  113511. * @returns {boolean} Returns `false`.
  113512. * @example
  113513. *
  113514. * _.times(2, _.stubFalse);
  113515. * // => [false, false]
  113516. */
  113517. function stubFalse() {
  113518. return false;
  113519. }
  113520. /* harmony default export */ __webpack_exports__["default"] = (stubFalse);
  113521. /***/ }),
  113522. /***/ "./node_modules/lodash-es/stubObject.js":
  113523. /*!**********************************************!*\
  113524. !*** ./node_modules/lodash-es/stubObject.js ***!
  113525. \**********************************************/
  113526. /*! exports provided: default */
  113527. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113528. "use strict";
  113529. __webpack_require__.r(__webpack_exports__);
  113530. /**
  113531. * This method returns a new empty object.
  113532. *
  113533. * @static
  113534. * @memberOf _
  113535. * @since 4.13.0
  113536. * @category Util
  113537. * @returns {Object} Returns the new empty object.
  113538. * @example
  113539. *
  113540. * var objects = _.times(2, _.stubObject);
  113541. *
  113542. * console.log(objects);
  113543. * // => [{}, {}]
  113544. *
  113545. * console.log(objects[0] === objects[1]);
  113546. * // => false
  113547. */
  113548. function stubObject() {
  113549. return {};
  113550. }
  113551. /* harmony default export */ __webpack_exports__["default"] = (stubObject);
  113552. /***/ }),
  113553. /***/ "./node_modules/lodash-es/stubString.js":
  113554. /*!**********************************************!*\
  113555. !*** ./node_modules/lodash-es/stubString.js ***!
  113556. \**********************************************/
  113557. /*! exports provided: default */
  113558. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113559. "use strict";
  113560. __webpack_require__.r(__webpack_exports__);
  113561. /**
  113562. * This method returns an empty string.
  113563. *
  113564. * @static
  113565. * @memberOf _
  113566. * @since 4.13.0
  113567. * @category Util
  113568. * @returns {string} Returns the empty string.
  113569. * @example
  113570. *
  113571. * _.times(2, _.stubString);
  113572. * // => ['', '']
  113573. */
  113574. function stubString() {
  113575. return '';
  113576. }
  113577. /* harmony default export */ __webpack_exports__["default"] = (stubString);
  113578. /***/ }),
  113579. /***/ "./node_modules/lodash-es/stubTrue.js":
  113580. /*!********************************************!*\
  113581. !*** ./node_modules/lodash-es/stubTrue.js ***!
  113582. \********************************************/
  113583. /*! exports provided: default */
  113584. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113585. "use strict";
  113586. __webpack_require__.r(__webpack_exports__);
  113587. /**
  113588. * This method returns `true`.
  113589. *
  113590. * @static
  113591. * @memberOf _
  113592. * @since 4.13.0
  113593. * @category Util
  113594. * @returns {boolean} Returns `true`.
  113595. * @example
  113596. *
  113597. * _.times(2, _.stubTrue);
  113598. * // => [true, true]
  113599. */
  113600. function stubTrue() {
  113601. return true;
  113602. }
  113603. /* harmony default export */ __webpack_exports__["default"] = (stubTrue);
  113604. /***/ }),
  113605. /***/ "./node_modules/lodash-es/subtract.js":
  113606. /*!********************************************!*\
  113607. !*** ./node_modules/lodash-es/subtract.js ***!
  113608. \********************************************/
  113609. /*! exports provided: default */
  113610. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113611. "use strict";
  113612. __webpack_require__.r(__webpack_exports__);
  113613. /* harmony import */ var _createMathOperation_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createMathOperation.js */ "./node_modules/lodash-es/_createMathOperation.js");
  113614. /**
  113615. * Subtract two numbers.
  113616. *
  113617. * @static
  113618. * @memberOf _
  113619. * @since 4.0.0
  113620. * @category Math
  113621. * @param {number} minuend The first number in a subtraction.
  113622. * @param {number} subtrahend The second number in a subtraction.
  113623. * @returns {number} Returns the difference.
  113624. * @example
  113625. *
  113626. * _.subtract(6, 4);
  113627. * // => 2
  113628. */
  113629. var subtract = Object(_createMathOperation_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(minuend, subtrahend) {
  113630. return minuend - subtrahend;
  113631. }, 0);
  113632. /* harmony default export */ __webpack_exports__["default"] = (subtract);
  113633. /***/ }),
  113634. /***/ "./node_modules/lodash-es/sum.js":
  113635. /*!***************************************!*\
  113636. !*** ./node_modules/lodash-es/sum.js ***!
  113637. \***************************************/
  113638. /*! exports provided: default */
  113639. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113640. "use strict";
  113641. __webpack_require__.r(__webpack_exports__);
  113642. /* harmony import */ var _baseSum_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSum.js */ "./node_modules/lodash-es/_baseSum.js");
  113643. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  113644. /**
  113645. * Computes the sum of the values in `array`.
  113646. *
  113647. * @static
  113648. * @memberOf _
  113649. * @since 3.4.0
  113650. * @category Math
  113651. * @param {Array} array The array to iterate over.
  113652. * @returns {number} Returns the sum.
  113653. * @example
  113654. *
  113655. * _.sum([4, 2, 8, 6]);
  113656. * // => 20
  113657. */
  113658. function sum(array) {
  113659. return (array && array.length)
  113660. ? Object(_baseSum_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, _identity_js__WEBPACK_IMPORTED_MODULE_1__["default"])
  113661. : 0;
  113662. }
  113663. /* harmony default export */ __webpack_exports__["default"] = (sum);
  113664. /***/ }),
  113665. /***/ "./node_modules/lodash-es/sumBy.js":
  113666. /*!*****************************************!*\
  113667. !*** ./node_modules/lodash-es/sumBy.js ***!
  113668. \*****************************************/
  113669. /*! exports provided: default */
  113670. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113671. "use strict";
  113672. __webpack_require__.r(__webpack_exports__);
  113673. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  113674. /* harmony import */ var _baseSum_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseSum.js */ "./node_modules/lodash-es/_baseSum.js");
  113675. /**
  113676. * This method is like `_.sum` except that it accepts `iteratee` which is
  113677. * invoked for each element in `array` to generate the value to be summed.
  113678. * The iteratee is invoked with one argument: (value).
  113679. *
  113680. * @static
  113681. * @memberOf _
  113682. * @since 4.0.0
  113683. * @category Math
  113684. * @param {Array} array The array to iterate over.
  113685. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  113686. * @returns {number} Returns the sum.
  113687. * @example
  113688. *
  113689. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  113690. *
  113691. * _.sumBy(objects, function(o) { return o.n; });
  113692. * // => 20
  113693. *
  113694. * // The `_.property` iteratee shorthand.
  113695. * _.sumBy(objects, 'n');
  113696. * // => 20
  113697. */
  113698. function sumBy(array, iteratee) {
  113699. return (array && array.length)
  113700. ? Object(_baseSum_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, 2))
  113701. : 0;
  113702. }
  113703. /* harmony default export */ __webpack_exports__["default"] = (sumBy);
  113704. /***/ }),
  113705. /***/ "./node_modules/lodash-es/tail.js":
  113706. /*!****************************************!*\
  113707. !*** ./node_modules/lodash-es/tail.js ***!
  113708. \****************************************/
  113709. /*! exports provided: default */
  113710. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113711. "use strict";
  113712. __webpack_require__.r(__webpack_exports__);
  113713. /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
  113714. /**
  113715. * Gets all but the first element of `array`.
  113716. *
  113717. * @static
  113718. * @memberOf _
  113719. * @since 4.0.0
  113720. * @category Array
  113721. * @param {Array} array The array to query.
  113722. * @returns {Array} Returns the slice of `array`.
  113723. * @example
  113724. *
  113725. * _.tail([1, 2, 3]);
  113726. * // => [2, 3]
  113727. */
  113728. function tail(array) {
  113729. var length = array == null ? 0 : array.length;
  113730. return length ? Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, 1, length) : [];
  113731. }
  113732. /* harmony default export */ __webpack_exports__["default"] = (tail);
  113733. /***/ }),
  113734. /***/ "./node_modules/lodash-es/take.js":
  113735. /*!****************************************!*\
  113736. !*** ./node_modules/lodash-es/take.js ***!
  113737. \****************************************/
  113738. /*! exports provided: default */
  113739. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113740. "use strict";
  113741. __webpack_require__.r(__webpack_exports__);
  113742. /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
  113743. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  113744. /**
  113745. * Creates a slice of `array` with `n` elements taken from the beginning.
  113746. *
  113747. * @static
  113748. * @memberOf _
  113749. * @since 0.1.0
  113750. * @category Array
  113751. * @param {Array} array The array to query.
  113752. * @param {number} [n=1] The number of elements to take.
  113753. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  113754. * @returns {Array} Returns the slice of `array`.
  113755. * @example
  113756. *
  113757. * _.take([1, 2, 3]);
  113758. * // => [1]
  113759. *
  113760. * _.take([1, 2, 3], 2);
  113761. * // => [1, 2]
  113762. *
  113763. * _.take([1, 2, 3], 5);
  113764. * // => [1, 2, 3]
  113765. *
  113766. * _.take([1, 2, 3], 0);
  113767. * // => []
  113768. */
  113769. function take(array, n, guard) {
  113770. if (!(array && array.length)) {
  113771. return [];
  113772. }
  113773. n = (guard || n === undefined) ? 1 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(n);
  113774. return Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, 0, n < 0 ? 0 : n);
  113775. }
  113776. /* harmony default export */ __webpack_exports__["default"] = (take);
  113777. /***/ }),
  113778. /***/ "./node_modules/lodash-es/takeRight.js":
  113779. /*!*********************************************!*\
  113780. !*** ./node_modules/lodash-es/takeRight.js ***!
  113781. \*********************************************/
  113782. /*! exports provided: default */
  113783. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113784. "use strict";
  113785. __webpack_require__.r(__webpack_exports__);
  113786. /* harmony import */ var _baseSlice_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSlice.js */ "./node_modules/lodash-es/_baseSlice.js");
  113787. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  113788. /**
  113789. * Creates a slice of `array` with `n` elements taken from the end.
  113790. *
  113791. * @static
  113792. * @memberOf _
  113793. * @since 3.0.0
  113794. * @category Array
  113795. * @param {Array} array The array to query.
  113796. * @param {number} [n=1] The number of elements to take.
  113797. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  113798. * @returns {Array} Returns the slice of `array`.
  113799. * @example
  113800. *
  113801. * _.takeRight([1, 2, 3]);
  113802. * // => [3]
  113803. *
  113804. * _.takeRight([1, 2, 3], 2);
  113805. * // => [2, 3]
  113806. *
  113807. * _.takeRight([1, 2, 3], 5);
  113808. * // => [1, 2, 3]
  113809. *
  113810. * _.takeRight([1, 2, 3], 0);
  113811. * // => []
  113812. */
  113813. function takeRight(array, n, guard) {
  113814. var length = array == null ? 0 : array.length;
  113815. if (!length) {
  113816. return [];
  113817. }
  113818. n = (guard || n === undefined) ? 1 : Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(n);
  113819. n = length - n;
  113820. return Object(_baseSlice_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, n < 0 ? 0 : n, length);
  113821. }
  113822. /* harmony default export */ __webpack_exports__["default"] = (takeRight);
  113823. /***/ }),
  113824. /***/ "./node_modules/lodash-es/takeRightWhile.js":
  113825. /*!**************************************************!*\
  113826. !*** ./node_modules/lodash-es/takeRightWhile.js ***!
  113827. \**************************************************/
  113828. /*! exports provided: default */
  113829. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113830. "use strict";
  113831. __webpack_require__.r(__webpack_exports__);
  113832. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  113833. /* harmony import */ var _baseWhile_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseWhile.js */ "./node_modules/lodash-es/_baseWhile.js");
  113834. /**
  113835. * Creates a slice of `array` with elements taken from the end. Elements are
  113836. * taken until `predicate` returns falsey. The predicate is invoked with
  113837. * three arguments: (value, index, array).
  113838. *
  113839. * @static
  113840. * @memberOf _
  113841. * @since 3.0.0
  113842. * @category Array
  113843. * @param {Array} array The array to query.
  113844. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  113845. * @returns {Array} Returns the slice of `array`.
  113846. * @example
  113847. *
  113848. * var users = [
  113849. * { 'user': 'barney', 'active': true },
  113850. * { 'user': 'fred', 'active': false },
  113851. * { 'user': 'pebbles', 'active': false }
  113852. * ];
  113853. *
  113854. * _.takeRightWhile(users, function(o) { return !o.active; });
  113855. * // => objects for ['fred', 'pebbles']
  113856. *
  113857. * // The `_.matches` iteratee shorthand.
  113858. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  113859. * // => objects for ['pebbles']
  113860. *
  113861. * // The `_.matchesProperty` iteratee shorthand.
  113862. * _.takeRightWhile(users, ['active', false]);
  113863. * // => objects for ['fred', 'pebbles']
  113864. *
  113865. * // The `_.property` iteratee shorthand.
  113866. * _.takeRightWhile(users, 'active');
  113867. * // => []
  113868. */
  113869. function takeRightWhile(array, predicate) {
  113870. return (array && array.length)
  113871. ? Object(_baseWhile_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(predicate, 3), false, true)
  113872. : [];
  113873. }
  113874. /* harmony default export */ __webpack_exports__["default"] = (takeRightWhile);
  113875. /***/ }),
  113876. /***/ "./node_modules/lodash-es/takeWhile.js":
  113877. /*!*********************************************!*\
  113878. !*** ./node_modules/lodash-es/takeWhile.js ***!
  113879. \*********************************************/
  113880. /*! exports provided: default */
  113881. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113882. "use strict";
  113883. __webpack_require__.r(__webpack_exports__);
  113884. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  113885. /* harmony import */ var _baseWhile_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseWhile.js */ "./node_modules/lodash-es/_baseWhile.js");
  113886. /**
  113887. * Creates a slice of `array` with elements taken from the beginning. Elements
  113888. * are taken until `predicate` returns falsey. The predicate is invoked with
  113889. * three arguments: (value, index, array).
  113890. *
  113891. * @static
  113892. * @memberOf _
  113893. * @since 3.0.0
  113894. * @category Array
  113895. * @param {Array} array The array to query.
  113896. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  113897. * @returns {Array} Returns the slice of `array`.
  113898. * @example
  113899. *
  113900. * var users = [
  113901. * { 'user': 'barney', 'active': false },
  113902. * { 'user': 'fred', 'active': false },
  113903. * { 'user': 'pebbles', 'active': true }
  113904. * ];
  113905. *
  113906. * _.takeWhile(users, function(o) { return !o.active; });
  113907. * // => objects for ['barney', 'fred']
  113908. *
  113909. * // The `_.matches` iteratee shorthand.
  113910. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  113911. * // => objects for ['barney']
  113912. *
  113913. * // The `_.matchesProperty` iteratee shorthand.
  113914. * _.takeWhile(users, ['active', false]);
  113915. * // => objects for ['barney', 'fred']
  113916. *
  113917. * // The `_.property` iteratee shorthand.
  113918. * _.takeWhile(users, 'active');
  113919. * // => []
  113920. */
  113921. function takeWhile(array, predicate) {
  113922. return (array && array.length)
  113923. ? Object(_baseWhile_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(predicate, 3))
  113924. : [];
  113925. }
  113926. /* harmony default export */ __webpack_exports__["default"] = (takeWhile);
  113927. /***/ }),
  113928. /***/ "./node_modules/lodash-es/tap.js":
  113929. /*!***************************************!*\
  113930. !*** ./node_modules/lodash-es/tap.js ***!
  113931. \***************************************/
  113932. /*! exports provided: default */
  113933. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113934. "use strict";
  113935. __webpack_require__.r(__webpack_exports__);
  113936. /**
  113937. * This method invokes `interceptor` and returns `value`. The interceptor
  113938. * is invoked with one argument; (value). The purpose of this method is to
  113939. * "tap into" a method chain sequence in order to modify intermediate results.
  113940. *
  113941. * @static
  113942. * @memberOf _
  113943. * @since 0.1.0
  113944. * @category Seq
  113945. * @param {*} value The value to provide to `interceptor`.
  113946. * @param {Function} interceptor The function to invoke.
  113947. * @returns {*} Returns `value`.
  113948. * @example
  113949. *
  113950. * _([1, 2, 3])
  113951. * .tap(function(array) {
  113952. * // Mutate input array.
  113953. * array.pop();
  113954. * })
  113955. * .reverse()
  113956. * .value();
  113957. * // => [2, 1]
  113958. */
  113959. function tap(value, interceptor) {
  113960. interceptor(value);
  113961. return value;
  113962. }
  113963. /* harmony default export */ __webpack_exports__["default"] = (tap);
  113964. /***/ }),
  113965. /***/ "./node_modules/lodash-es/template.js":
  113966. /*!********************************************!*\
  113967. !*** ./node_modules/lodash-es/template.js ***!
  113968. \********************************************/
  113969. /*! exports provided: default */
  113970. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  113971. "use strict";
  113972. __webpack_require__.r(__webpack_exports__);
  113973. /* harmony import */ var _assignInWith_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./assignInWith.js */ "./node_modules/lodash-es/assignInWith.js");
  113974. /* harmony import */ var _attempt_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./attempt.js */ "./node_modules/lodash-es/attempt.js");
  113975. /* harmony import */ var _baseValues_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseValues.js */ "./node_modules/lodash-es/_baseValues.js");
  113976. /* harmony import */ var _customDefaultsAssignIn_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_customDefaultsAssignIn.js */ "./node_modules/lodash-es/_customDefaultsAssignIn.js");
  113977. /* harmony import */ var _escapeStringChar_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_escapeStringChar.js */ "./node_modules/lodash-es/_escapeStringChar.js");
  113978. /* harmony import */ var _isError_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isError.js */ "./node_modules/lodash-es/isError.js");
  113979. /* harmony import */ var _isIterateeCall_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_isIterateeCall.js */ "./node_modules/lodash-es/_isIterateeCall.js");
  113980. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  113981. /* harmony import */ var _reInterpolate_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./_reInterpolate.js */ "./node_modules/lodash-es/_reInterpolate.js");
  113982. /* harmony import */ var _templateSettings_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./templateSettings.js */ "./node_modules/lodash-es/templateSettings.js");
  113983. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  113984. /** Error message constants. */
  113985. var INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  113986. /** Used to match empty string literals in compiled template source. */
  113987. var reEmptyStringLeading = /\b__p \+= '';/g,
  113988. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  113989. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  113990. /**
  113991. * Used to validate the `validate` option in `_.template` variable.
  113992. *
  113993. * Forbids characters which could potentially change the meaning of the function argument definition:
  113994. * - "()," (modification of function parameters)
  113995. * - "=" (default value)
  113996. * - "[]{}" (destructuring of function parameters)
  113997. * - "/" (beginning of a comment)
  113998. * - whitespace
  113999. */
  114000. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  114001. /**
  114002. * Used to match
  114003. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  114004. */
  114005. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  114006. /** Used to ensure capturing order of template delimiters. */
  114007. var reNoMatch = /($^)/;
  114008. /** Used to match unescaped characters in compiled string literals. */
  114009. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  114010. /** Used for built-in method references. */
  114011. var objectProto = Object.prototype;
  114012. /** Used to check objects for own properties. */
  114013. var hasOwnProperty = objectProto.hasOwnProperty;
  114014. /**
  114015. * Creates a compiled template function that can interpolate data properties
  114016. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  114017. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  114018. * properties may be accessed as free variables in the template. If a setting
  114019. * object is given, it takes precedence over `_.templateSettings` values.
  114020. *
  114021. * **Note:** In the development build `_.template` utilizes
  114022. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  114023. * for easier debugging.
  114024. *
  114025. * For more information on precompiling templates see
  114026. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  114027. *
  114028. * For more information on Chrome extension sandboxes see
  114029. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  114030. *
  114031. * @static
  114032. * @since 0.1.0
  114033. * @memberOf _
  114034. * @category String
  114035. * @param {string} [string=''] The template string.
  114036. * @param {Object} [options={}] The options object.
  114037. * @param {RegExp} [options.escape=_.templateSettings.escape]
  114038. * The HTML "escape" delimiter.
  114039. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  114040. * The "evaluate" delimiter.
  114041. * @param {Object} [options.imports=_.templateSettings.imports]
  114042. * An object to import into the template as free variables.
  114043. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  114044. * The "interpolate" delimiter.
  114045. * @param {string} [options.sourceURL='templateSources[n]']
  114046. * The sourceURL of the compiled template.
  114047. * @param {string} [options.variable='obj']
  114048. * The data object variable name.
  114049. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  114050. * @returns {Function} Returns the compiled template function.
  114051. * @example
  114052. *
  114053. * // Use the "interpolate" delimiter to create a compiled template.
  114054. * var compiled = _.template('hello <%= user %>!');
  114055. * compiled({ 'user': 'fred' });
  114056. * // => 'hello fred!'
  114057. *
  114058. * // Use the HTML "escape" delimiter to escape data property values.
  114059. * var compiled = _.template('<b><%- value %></b>');
  114060. * compiled({ 'value': '<script>' });
  114061. * // => '<b>&lt;script&gt;</b>'
  114062. *
  114063. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  114064. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  114065. * compiled({ 'users': ['fred', 'barney'] });
  114066. * // => '<li>fred</li><li>barney</li>'
  114067. *
  114068. * // Use the internal `print` function in "evaluate" delimiters.
  114069. * var compiled = _.template('<% print("hello " + user); %>!');
  114070. * compiled({ 'user': 'barney' });
  114071. * // => 'hello barney!'
  114072. *
  114073. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  114074. * // Disable support by replacing the "interpolate" delimiter.
  114075. * var compiled = _.template('hello ${ user }!');
  114076. * compiled({ 'user': 'pebbles' });
  114077. * // => 'hello pebbles!'
  114078. *
  114079. * // Use backslashes to treat delimiters as plain text.
  114080. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  114081. * compiled({ 'value': 'ignored' });
  114082. * // => '<%- value %>'
  114083. *
  114084. * // Use the `imports` option to import `jQuery` as `jq`.
  114085. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  114086. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  114087. * compiled({ 'users': ['fred', 'barney'] });
  114088. * // => '<li>fred</li><li>barney</li>'
  114089. *
  114090. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  114091. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  114092. * compiled(data);
  114093. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  114094. *
  114095. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  114096. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  114097. * compiled.source;
  114098. * // => function(data) {
  114099. * // var __t, __p = '';
  114100. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  114101. * // return __p;
  114102. * // }
  114103. *
  114104. * // Use custom template delimiters.
  114105. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  114106. * var compiled = _.template('hello {{ user }}!');
  114107. * compiled({ 'user': 'mustache' });
  114108. * // => 'hello mustache!'
  114109. *
  114110. * // Use the `source` property to inline compiled templates for meaningful
  114111. * // line numbers in error messages and stack traces.
  114112. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  114113. * var JST = {\
  114114. * "main": ' + _.template(mainText).source + '\
  114115. * };\
  114116. * ');
  114117. */
  114118. function template(string, options, guard) {
  114119. // Based on John Resig's `tmpl` implementation
  114120. // (http://ejohn.org/blog/javascript-micro-templating/)
  114121. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  114122. var settings = _templateSettings_js__WEBPACK_IMPORTED_MODULE_9__["default"].imports._.templateSettings || _templateSettings_js__WEBPACK_IMPORTED_MODULE_9__["default"];
  114123. if (guard && Object(_isIterateeCall_js__WEBPACK_IMPORTED_MODULE_6__["default"])(string, options, guard)) {
  114124. options = undefined;
  114125. }
  114126. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_10__["default"])(string);
  114127. options = Object(_assignInWith_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, options, settings, _customDefaultsAssignIn_js__WEBPACK_IMPORTED_MODULE_3__["default"]);
  114128. var imports = Object(_assignInWith_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, options.imports, settings.imports, _customDefaultsAssignIn_js__WEBPACK_IMPORTED_MODULE_3__["default"]),
  114129. importsKeys = Object(_keys_js__WEBPACK_IMPORTED_MODULE_7__["default"])(imports),
  114130. importsValues = Object(_baseValues_js__WEBPACK_IMPORTED_MODULE_2__["default"])(imports, importsKeys);
  114131. var isEscaping,
  114132. isEvaluating,
  114133. index = 0,
  114134. interpolate = options.interpolate || reNoMatch,
  114135. source = "__p += '";
  114136. // Compile the regexp to match each delimiter.
  114137. var reDelimiters = RegExp(
  114138. (options.escape || reNoMatch).source + '|' +
  114139. interpolate.source + '|' +
  114140. (interpolate === _reInterpolate_js__WEBPACK_IMPORTED_MODULE_8__["default"] ? reEsTemplate : reNoMatch).source + '|' +
  114141. (options.evaluate || reNoMatch).source + '|$'
  114142. , 'g');
  114143. // Use a sourceURL for easier debugging.
  114144. // The sourceURL gets injected into the source that's eval-ed, so be careful
  114145. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  114146. // and escape the comment, thus injecting code that gets evaled.
  114147. var sourceURL = hasOwnProperty.call(options, 'sourceURL')
  114148. ? ('//# sourceURL=' +
  114149. (options.sourceURL + '').replace(/\s/g, ' ') +
  114150. '\n')
  114151. : '';
  114152. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  114153. interpolateValue || (interpolateValue = esTemplateValue);
  114154. // Escape characters that can't be included in string literals.
  114155. source += string.slice(index, offset).replace(reUnescapedString, _escapeStringChar_js__WEBPACK_IMPORTED_MODULE_4__["default"]);
  114156. // Replace delimiters with snippets.
  114157. if (escapeValue) {
  114158. isEscaping = true;
  114159. source += "' +\n__e(" + escapeValue + ") +\n'";
  114160. }
  114161. if (evaluateValue) {
  114162. isEvaluating = true;
  114163. source += "';\n" + evaluateValue + ";\n__p += '";
  114164. }
  114165. if (interpolateValue) {
  114166. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  114167. }
  114168. index = offset + match.length;
  114169. // The JS engine embedded in Adobe products needs `match` returned in
  114170. // order to produce the correct `offset` value.
  114171. return match;
  114172. });
  114173. source += "';\n";
  114174. // If `variable` is not specified wrap a with-statement around the generated
  114175. // code to add the data object to the top of the scope chain.
  114176. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  114177. if (!variable) {
  114178. source = 'with (obj) {\n' + source + '\n}\n';
  114179. }
  114180. // Throw an error if a forbidden character was found in `variable`, to prevent
  114181. // potential command injection attacks.
  114182. else if (reForbiddenIdentifierChars.test(variable)) {
  114183. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  114184. }
  114185. // Cleanup code by stripping empty strings.
  114186. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  114187. .replace(reEmptyStringMiddle, '$1')
  114188. .replace(reEmptyStringTrailing, '$1;');
  114189. // Frame code as the function body.
  114190. source = 'function(' + (variable || 'obj') + ') {\n' +
  114191. (variable
  114192. ? ''
  114193. : 'obj || (obj = {});\n'
  114194. ) +
  114195. "var __t, __p = ''" +
  114196. (isEscaping
  114197. ? ', __e = _.escape'
  114198. : ''
  114199. ) +
  114200. (isEvaluating
  114201. ? ', __j = Array.prototype.join;\n' +
  114202. "function print() { __p += __j.call(arguments, '') }\n"
  114203. : ';\n'
  114204. ) +
  114205. source +
  114206. 'return __p\n}';
  114207. var result = Object(_attempt_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function() {
  114208. return Function(importsKeys, sourceURL + 'return ' + source)
  114209. .apply(undefined, importsValues);
  114210. });
  114211. // Provide the compiled function's source by its `toString` method or
  114212. // the `source` property as a convenience for inlining compiled templates.
  114213. result.source = source;
  114214. if (Object(_isError_js__WEBPACK_IMPORTED_MODULE_5__["default"])(result)) {
  114215. throw result;
  114216. }
  114217. return result;
  114218. }
  114219. /* harmony default export */ __webpack_exports__["default"] = (template);
  114220. /***/ }),
  114221. /***/ "./node_modules/lodash-es/templateSettings.js":
  114222. /*!****************************************************!*\
  114223. !*** ./node_modules/lodash-es/templateSettings.js ***!
  114224. \****************************************************/
  114225. /*! exports provided: default */
  114226. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114227. "use strict";
  114228. __webpack_require__.r(__webpack_exports__);
  114229. /* harmony import */ var _escape_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./escape.js */ "./node_modules/lodash-es/escape.js");
  114230. /* harmony import */ var _reEscape_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_reEscape.js */ "./node_modules/lodash-es/_reEscape.js");
  114231. /* harmony import */ var _reEvaluate_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_reEvaluate.js */ "./node_modules/lodash-es/_reEvaluate.js");
  114232. /* harmony import */ var _reInterpolate_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_reInterpolate.js */ "./node_modules/lodash-es/_reInterpolate.js");
  114233. /**
  114234. * By default, the template delimiters used by lodash are like those in
  114235. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  114236. * following template settings to use alternative delimiters.
  114237. *
  114238. * @static
  114239. * @memberOf _
  114240. * @type {Object}
  114241. */
  114242. var templateSettings = {
  114243. /**
  114244. * Used to detect `data` property values to be HTML-escaped.
  114245. *
  114246. * @memberOf _.templateSettings
  114247. * @type {RegExp}
  114248. */
  114249. 'escape': _reEscape_js__WEBPACK_IMPORTED_MODULE_1__["default"],
  114250. /**
  114251. * Used to detect code to be evaluated.
  114252. *
  114253. * @memberOf _.templateSettings
  114254. * @type {RegExp}
  114255. */
  114256. 'evaluate': _reEvaluate_js__WEBPACK_IMPORTED_MODULE_2__["default"],
  114257. /**
  114258. * Used to detect `data` property values to inject.
  114259. *
  114260. * @memberOf _.templateSettings
  114261. * @type {RegExp}
  114262. */
  114263. 'interpolate': _reInterpolate_js__WEBPACK_IMPORTED_MODULE_3__["default"],
  114264. /**
  114265. * Used to reference the data object in the template text.
  114266. *
  114267. * @memberOf _.templateSettings
  114268. * @type {string}
  114269. */
  114270. 'variable': '',
  114271. /**
  114272. * Used to import variables into the compiled template.
  114273. *
  114274. * @memberOf _.templateSettings
  114275. * @type {Object}
  114276. */
  114277. 'imports': {
  114278. /**
  114279. * A reference to the `lodash` function.
  114280. *
  114281. * @memberOf _.templateSettings.imports
  114282. * @type {Function}
  114283. */
  114284. '_': { 'escape': _escape_js__WEBPACK_IMPORTED_MODULE_0__["default"] }
  114285. }
  114286. };
  114287. /* harmony default export */ __webpack_exports__["default"] = (templateSettings);
  114288. /***/ }),
  114289. /***/ "./node_modules/lodash-es/throttle.js":
  114290. /*!********************************************!*\
  114291. !*** ./node_modules/lodash-es/throttle.js ***!
  114292. \********************************************/
  114293. /*! exports provided: default */
  114294. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114295. "use strict";
  114296. __webpack_require__.r(__webpack_exports__);
  114297. /* harmony import */ var _debounce_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./debounce.js */ "./node_modules/lodash-es/debounce.js");
  114298. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  114299. /** Error message constants. */
  114300. var FUNC_ERROR_TEXT = 'Expected a function';
  114301. /**
  114302. * Creates a throttled function that only invokes `func` at most once per
  114303. * every `wait` milliseconds. The throttled function comes with a `cancel`
  114304. * method to cancel delayed `func` invocations and a `flush` method to
  114305. * immediately invoke them. Provide `options` to indicate whether `func`
  114306. * should be invoked on the leading and/or trailing edge of the `wait`
  114307. * timeout. The `func` is invoked with the last arguments provided to the
  114308. * throttled function. Subsequent calls to the throttled function return the
  114309. * result of the last `func` invocation.
  114310. *
  114311. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  114312. * invoked on the trailing edge of the timeout only if the throttled function
  114313. * is invoked more than once during the `wait` timeout.
  114314. *
  114315. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  114316. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  114317. *
  114318. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  114319. * for details over the differences between `_.throttle` and `_.debounce`.
  114320. *
  114321. * @static
  114322. * @memberOf _
  114323. * @since 0.1.0
  114324. * @category Function
  114325. * @param {Function} func The function to throttle.
  114326. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  114327. * @param {Object} [options={}] The options object.
  114328. * @param {boolean} [options.leading=true]
  114329. * Specify invoking on the leading edge of the timeout.
  114330. * @param {boolean} [options.trailing=true]
  114331. * Specify invoking on the trailing edge of the timeout.
  114332. * @returns {Function} Returns the new throttled function.
  114333. * @example
  114334. *
  114335. * // Avoid excessively updating the position while scrolling.
  114336. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  114337. *
  114338. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  114339. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  114340. * jQuery(element).on('click', throttled);
  114341. *
  114342. * // Cancel the trailing throttled invocation.
  114343. * jQuery(window).on('popstate', throttled.cancel);
  114344. */
  114345. function throttle(func, wait, options) {
  114346. var leading = true,
  114347. trailing = true;
  114348. if (typeof func != 'function') {
  114349. throw new TypeError(FUNC_ERROR_TEXT);
  114350. }
  114351. if (Object(_isObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(options)) {
  114352. leading = 'leading' in options ? !!options.leading : leading;
  114353. trailing = 'trailing' in options ? !!options.trailing : trailing;
  114354. }
  114355. return Object(_debounce_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, wait, {
  114356. 'leading': leading,
  114357. 'maxWait': wait,
  114358. 'trailing': trailing
  114359. });
  114360. }
  114361. /* harmony default export */ __webpack_exports__["default"] = (throttle);
  114362. /***/ }),
  114363. /***/ "./node_modules/lodash-es/thru.js":
  114364. /*!****************************************!*\
  114365. !*** ./node_modules/lodash-es/thru.js ***!
  114366. \****************************************/
  114367. /*! exports provided: default */
  114368. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114369. "use strict";
  114370. __webpack_require__.r(__webpack_exports__);
  114371. /**
  114372. * This method is like `_.tap` except that it returns the result of `interceptor`.
  114373. * The purpose of this method is to "pass thru" values replacing intermediate
  114374. * results in a method chain sequence.
  114375. *
  114376. * @static
  114377. * @memberOf _
  114378. * @since 3.0.0
  114379. * @category Seq
  114380. * @param {*} value The value to provide to `interceptor`.
  114381. * @param {Function} interceptor The function to invoke.
  114382. * @returns {*} Returns the result of `interceptor`.
  114383. * @example
  114384. *
  114385. * _(' abc ')
  114386. * .chain()
  114387. * .trim()
  114388. * .thru(function(value) {
  114389. * return [value];
  114390. * })
  114391. * .value();
  114392. * // => ['abc']
  114393. */
  114394. function thru(value, interceptor) {
  114395. return interceptor(value);
  114396. }
  114397. /* harmony default export */ __webpack_exports__["default"] = (thru);
  114398. /***/ }),
  114399. /***/ "./node_modules/lodash-es/times.js":
  114400. /*!*****************************************!*\
  114401. !*** ./node_modules/lodash-es/times.js ***!
  114402. \*****************************************/
  114403. /*! exports provided: default */
  114404. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114405. "use strict";
  114406. __webpack_require__.r(__webpack_exports__);
  114407. /* harmony import */ var _baseTimes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseTimes.js */ "./node_modules/lodash-es/_baseTimes.js");
  114408. /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
  114409. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  114410. /** Used as references for various `Number` constants. */
  114411. var MAX_SAFE_INTEGER = 9007199254740991;
  114412. /** Used as references for the maximum length and index of an array. */
  114413. var MAX_ARRAY_LENGTH = 4294967295;
  114414. /* Built-in method references for those with the same name as other `lodash` methods. */
  114415. var nativeMin = Math.min;
  114416. /**
  114417. * Invokes the iteratee `n` times, returning an array of the results of
  114418. * each invocation. The iteratee is invoked with one argument; (index).
  114419. *
  114420. * @static
  114421. * @since 0.1.0
  114422. * @memberOf _
  114423. * @category Util
  114424. * @param {number} n The number of times to invoke `iteratee`.
  114425. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  114426. * @returns {Array} Returns the array of results.
  114427. * @example
  114428. *
  114429. * _.times(3, String);
  114430. * // => ['0', '1', '2']
  114431. *
  114432. * _.times(4, _.constant(0));
  114433. * // => [0, 0, 0, 0]
  114434. */
  114435. function times(n, iteratee) {
  114436. n = Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_2__["default"])(n);
  114437. if (n < 1 || n > MAX_SAFE_INTEGER) {
  114438. return [];
  114439. }
  114440. var index = MAX_ARRAY_LENGTH,
  114441. length = nativeMin(n, MAX_ARRAY_LENGTH);
  114442. iteratee = Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratee);
  114443. n -= MAX_ARRAY_LENGTH;
  114444. var result = Object(_baseTimes_js__WEBPACK_IMPORTED_MODULE_0__["default"])(length, iteratee);
  114445. while (++index < n) {
  114446. iteratee(index);
  114447. }
  114448. return result;
  114449. }
  114450. /* harmony default export */ __webpack_exports__["default"] = (times);
  114451. /***/ }),
  114452. /***/ "./node_modules/lodash-es/toArray.js":
  114453. /*!*******************************************!*\
  114454. !*** ./node_modules/lodash-es/toArray.js ***!
  114455. \*******************************************/
  114456. /*! exports provided: default */
  114457. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114458. "use strict";
  114459. __webpack_require__.r(__webpack_exports__);
  114460. /* harmony import */ var _Symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_Symbol.js */ "./node_modules/lodash-es/_Symbol.js");
  114461. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  114462. /* harmony import */ var _getTag_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_getTag.js */ "./node_modules/lodash-es/_getTag.js");
  114463. /* harmony import */ var _isArrayLike_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArrayLike.js */ "./node_modules/lodash-es/isArrayLike.js");
  114464. /* harmony import */ var _isString_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isString.js */ "./node_modules/lodash-es/isString.js");
  114465. /* harmony import */ var _iteratorToArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_iteratorToArray.js */ "./node_modules/lodash-es/_iteratorToArray.js");
  114466. /* harmony import */ var _mapToArray_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_mapToArray.js */ "./node_modules/lodash-es/_mapToArray.js");
  114467. /* harmony import */ var _setToArray_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./_setToArray.js */ "./node_modules/lodash-es/_setToArray.js");
  114468. /* harmony import */ var _stringToArray_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./_stringToArray.js */ "./node_modules/lodash-es/_stringToArray.js");
  114469. /* harmony import */ var _values_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./values.js */ "./node_modules/lodash-es/values.js");
  114470. /** `Object#toString` result references. */
  114471. var mapTag = '[object Map]',
  114472. setTag = '[object Set]';
  114473. /** Built-in value references. */
  114474. var symIterator = _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"] ? _Symbol_js__WEBPACK_IMPORTED_MODULE_0__["default"].iterator : undefined;
  114475. /**
  114476. * Converts `value` to an array.
  114477. *
  114478. * @static
  114479. * @since 0.1.0
  114480. * @memberOf _
  114481. * @category Lang
  114482. * @param {*} value The value to convert.
  114483. * @returns {Array} Returns the converted array.
  114484. * @example
  114485. *
  114486. * _.toArray({ 'a': 1, 'b': 2 });
  114487. * // => [1, 2]
  114488. *
  114489. * _.toArray('abc');
  114490. * // => ['a', 'b', 'c']
  114491. *
  114492. * _.toArray(1);
  114493. * // => []
  114494. *
  114495. * _.toArray(null);
  114496. * // => []
  114497. */
  114498. function toArray(value) {
  114499. if (!value) {
  114500. return [];
  114501. }
  114502. if (Object(_isArrayLike_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value)) {
  114503. return Object(_isString_js__WEBPACK_IMPORTED_MODULE_4__["default"])(value) ? Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_8__["default"])(value) : Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value);
  114504. }
  114505. if (symIterator && value[symIterator]) {
  114506. return Object(_iteratorToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(value[symIterator]());
  114507. }
  114508. var tag = Object(_getTag_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value),
  114509. func = tag == mapTag ? _mapToArray_js__WEBPACK_IMPORTED_MODULE_6__["default"] : (tag == setTag ? _setToArray_js__WEBPACK_IMPORTED_MODULE_7__["default"] : _values_js__WEBPACK_IMPORTED_MODULE_9__["default"]);
  114510. return func(value);
  114511. }
  114512. /* harmony default export */ __webpack_exports__["default"] = (toArray);
  114513. /***/ }),
  114514. /***/ "./node_modules/lodash-es/toFinite.js":
  114515. /*!********************************************!*\
  114516. !*** ./node_modules/lodash-es/toFinite.js ***!
  114517. \********************************************/
  114518. /*! exports provided: default */
  114519. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114520. "use strict";
  114521. __webpack_require__.r(__webpack_exports__);
  114522. /* harmony import */ var _toNumber_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toNumber.js */ "./node_modules/lodash-es/toNumber.js");
  114523. /** Used as references for various `Number` constants. */
  114524. var INFINITY = 1 / 0,
  114525. MAX_INTEGER = 1.7976931348623157e+308;
  114526. /**
  114527. * Converts `value` to a finite number.
  114528. *
  114529. * @static
  114530. * @memberOf _
  114531. * @since 4.12.0
  114532. * @category Lang
  114533. * @param {*} value The value to convert.
  114534. * @returns {number} Returns the converted number.
  114535. * @example
  114536. *
  114537. * _.toFinite(3.2);
  114538. * // => 3.2
  114539. *
  114540. * _.toFinite(Number.MIN_VALUE);
  114541. * // => 5e-324
  114542. *
  114543. * _.toFinite(Infinity);
  114544. * // => 1.7976931348623157e+308
  114545. *
  114546. * _.toFinite('3.2');
  114547. * // => 3.2
  114548. */
  114549. function toFinite(value) {
  114550. if (!value) {
  114551. return value === 0 ? value : 0;
  114552. }
  114553. value = Object(_toNumber_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  114554. if (value === INFINITY || value === -INFINITY) {
  114555. var sign = (value < 0 ? -1 : 1);
  114556. return sign * MAX_INTEGER;
  114557. }
  114558. return value === value ? value : 0;
  114559. }
  114560. /* harmony default export */ __webpack_exports__["default"] = (toFinite);
  114561. /***/ }),
  114562. /***/ "./node_modules/lodash-es/toInteger.js":
  114563. /*!*********************************************!*\
  114564. !*** ./node_modules/lodash-es/toInteger.js ***!
  114565. \*********************************************/
  114566. /*! exports provided: default */
  114567. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114568. "use strict";
  114569. __webpack_require__.r(__webpack_exports__);
  114570. /* harmony import */ var _toFinite_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toFinite.js */ "./node_modules/lodash-es/toFinite.js");
  114571. /**
  114572. * Converts `value` to an integer.
  114573. *
  114574. * **Note:** This method is loosely based on
  114575. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  114576. *
  114577. * @static
  114578. * @memberOf _
  114579. * @since 4.0.0
  114580. * @category Lang
  114581. * @param {*} value The value to convert.
  114582. * @returns {number} Returns the converted integer.
  114583. * @example
  114584. *
  114585. * _.toInteger(3.2);
  114586. * // => 3
  114587. *
  114588. * _.toInteger(Number.MIN_VALUE);
  114589. * // => 0
  114590. *
  114591. * _.toInteger(Infinity);
  114592. * // => 1.7976931348623157e+308
  114593. *
  114594. * _.toInteger('3.2');
  114595. * // => 3
  114596. */
  114597. function toInteger(value) {
  114598. var result = Object(_toFinite_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value),
  114599. remainder = result % 1;
  114600. return result === result ? (remainder ? result - remainder : result) : 0;
  114601. }
  114602. /* harmony default export */ __webpack_exports__["default"] = (toInteger);
  114603. /***/ }),
  114604. /***/ "./node_modules/lodash-es/toIterator.js":
  114605. /*!**********************************************!*\
  114606. !*** ./node_modules/lodash-es/toIterator.js ***!
  114607. \**********************************************/
  114608. /*! exports provided: default */
  114609. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114610. "use strict";
  114611. __webpack_require__.r(__webpack_exports__);
  114612. /**
  114613. * Enables the wrapper to be iterable.
  114614. *
  114615. * @name Symbol.iterator
  114616. * @memberOf _
  114617. * @since 4.0.0
  114618. * @category Seq
  114619. * @returns {Object} Returns the wrapper object.
  114620. * @example
  114621. *
  114622. * var wrapped = _([1, 2]);
  114623. *
  114624. * wrapped[Symbol.iterator]() === wrapped;
  114625. * // => true
  114626. *
  114627. * Array.from(wrapped);
  114628. * // => [1, 2]
  114629. */
  114630. function wrapperToIterator() {
  114631. return this;
  114632. }
  114633. /* harmony default export */ __webpack_exports__["default"] = (wrapperToIterator);
  114634. /***/ }),
  114635. /***/ "./node_modules/lodash-es/toJSON.js":
  114636. /*!******************************************!*\
  114637. !*** ./node_modules/lodash-es/toJSON.js ***!
  114638. \******************************************/
  114639. /*! exports provided: default */
  114640. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114641. "use strict";
  114642. __webpack_require__.r(__webpack_exports__);
  114643. /* harmony import */ var _wrapperValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrapperValue.js */ "./node_modules/lodash-es/wrapperValue.js");
  114644. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _wrapperValue_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  114645. /***/ }),
  114646. /***/ "./node_modules/lodash-es/toLength.js":
  114647. /*!********************************************!*\
  114648. !*** ./node_modules/lodash-es/toLength.js ***!
  114649. \********************************************/
  114650. /*! exports provided: default */
  114651. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114652. "use strict";
  114653. __webpack_require__.r(__webpack_exports__);
  114654. /* harmony import */ var _baseClamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClamp.js */ "./node_modules/lodash-es/_baseClamp.js");
  114655. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  114656. /** Used as references for the maximum length and index of an array. */
  114657. var MAX_ARRAY_LENGTH = 4294967295;
  114658. /**
  114659. * Converts `value` to an integer suitable for use as the length of an
  114660. * array-like object.
  114661. *
  114662. * **Note:** This method is based on
  114663. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  114664. *
  114665. * @static
  114666. * @memberOf _
  114667. * @since 4.0.0
  114668. * @category Lang
  114669. * @param {*} value The value to convert.
  114670. * @returns {number} Returns the converted integer.
  114671. * @example
  114672. *
  114673. * _.toLength(3.2);
  114674. * // => 3
  114675. *
  114676. * _.toLength(Number.MIN_VALUE);
  114677. * // => 0
  114678. *
  114679. * _.toLength(Infinity);
  114680. * // => 4294967295
  114681. *
  114682. * _.toLength('3.2');
  114683. * // => 3
  114684. */
  114685. function toLength(value) {
  114686. return value ? Object(_baseClamp_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value), 0, MAX_ARRAY_LENGTH) : 0;
  114687. }
  114688. /* harmony default export */ __webpack_exports__["default"] = (toLength);
  114689. /***/ }),
  114690. /***/ "./node_modules/lodash-es/toLower.js":
  114691. /*!*******************************************!*\
  114692. !*** ./node_modules/lodash-es/toLower.js ***!
  114693. \*******************************************/
  114694. /*! exports provided: default */
  114695. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114696. "use strict";
  114697. __webpack_require__.r(__webpack_exports__);
  114698. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  114699. /**
  114700. * Converts `string`, as a whole, to lower case just like
  114701. * [String#toLowerCase](https://mdn.io/toLowerCase).
  114702. *
  114703. * @static
  114704. * @memberOf _
  114705. * @since 4.0.0
  114706. * @category String
  114707. * @param {string} [string=''] The string to convert.
  114708. * @returns {string} Returns the lower cased string.
  114709. * @example
  114710. *
  114711. * _.toLower('--Foo-Bar--');
  114712. * // => '--foo-bar--'
  114713. *
  114714. * _.toLower('fooBar');
  114715. * // => 'foobar'
  114716. *
  114717. * _.toLower('__FOO_BAR__');
  114718. * // => '__foo_bar__'
  114719. */
  114720. function toLower(value) {
  114721. return Object(_toString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value).toLowerCase();
  114722. }
  114723. /* harmony default export */ __webpack_exports__["default"] = (toLower);
  114724. /***/ }),
  114725. /***/ "./node_modules/lodash-es/toNumber.js":
  114726. /*!********************************************!*\
  114727. !*** ./node_modules/lodash-es/toNumber.js ***!
  114728. \********************************************/
  114729. /*! exports provided: default */
  114730. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114731. "use strict";
  114732. __webpack_require__.r(__webpack_exports__);
  114733. /* harmony import */ var _baseTrim_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseTrim.js */ "./node_modules/lodash-es/_baseTrim.js");
  114734. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  114735. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  114736. /** Used as references for various `Number` constants. */
  114737. var NAN = 0 / 0;
  114738. /** Used to detect bad signed hexadecimal string values. */
  114739. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  114740. /** Used to detect binary string values. */
  114741. var reIsBinary = /^0b[01]+$/i;
  114742. /** Used to detect octal string values. */
  114743. var reIsOctal = /^0o[0-7]+$/i;
  114744. /** Built-in method references without a dependency on `root`. */
  114745. var freeParseInt = parseInt;
  114746. /**
  114747. * Converts `value` to a number.
  114748. *
  114749. * @static
  114750. * @memberOf _
  114751. * @since 4.0.0
  114752. * @category Lang
  114753. * @param {*} value The value to process.
  114754. * @returns {number} Returns the number.
  114755. * @example
  114756. *
  114757. * _.toNumber(3.2);
  114758. * // => 3.2
  114759. *
  114760. * _.toNumber(Number.MIN_VALUE);
  114761. * // => 5e-324
  114762. *
  114763. * _.toNumber(Infinity);
  114764. * // => Infinity
  114765. *
  114766. * _.toNumber('3.2');
  114767. * // => 3.2
  114768. */
  114769. function toNumber(value) {
  114770. if (typeof value == 'number') {
  114771. return value;
  114772. }
  114773. if (Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value)) {
  114774. return NAN;
  114775. }
  114776. if (Object(_isObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
  114777. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  114778. value = Object(_isObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(other) ? (other + '') : other;
  114779. }
  114780. if (typeof value != 'string') {
  114781. return value === 0 ? value : +value;
  114782. }
  114783. value = Object(_baseTrim_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  114784. var isBinary = reIsBinary.test(value);
  114785. return (isBinary || reIsOctal.test(value))
  114786. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  114787. : (reIsBadHex.test(value) ? NAN : +value);
  114788. }
  114789. /* harmony default export */ __webpack_exports__["default"] = (toNumber);
  114790. /***/ }),
  114791. /***/ "./node_modules/lodash-es/toPairs.js":
  114792. /*!*******************************************!*\
  114793. !*** ./node_modules/lodash-es/toPairs.js ***!
  114794. \*******************************************/
  114795. /*! exports provided: default */
  114796. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114797. "use strict";
  114798. __webpack_require__.r(__webpack_exports__);
  114799. /* harmony import */ var _createToPairs_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createToPairs.js */ "./node_modules/lodash-es/_createToPairs.js");
  114800. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  114801. /**
  114802. * Creates an array of own enumerable string keyed-value pairs for `object`
  114803. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  114804. * entries are returned.
  114805. *
  114806. * @static
  114807. * @memberOf _
  114808. * @since 4.0.0
  114809. * @alias entries
  114810. * @category Object
  114811. * @param {Object} object The object to query.
  114812. * @returns {Array} Returns the key-value pairs.
  114813. * @example
  114814. *
  114815. * function Foo() {
  114816. * this.a = 1;
  114817. * this.b = 2;
  114818. * }
  114819. *
  114820. * Foo.prototype.c = 3;
  114821. *
  114822. * _.toPairs(new Foo);
  114823. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  114824. */
  114825. var toPairs = Object(_createToPairs_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_keys_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  114826. /* harmony default export */ __webpack_exports__["default"] = (toPairs);
  114827. /***/ }),
  114828. /***/ "./node_modules/lodash-es/toPairsIn.js":
  114829. /*!*********************************************!*\
  114830. !*** ./node_modules/lodash-es/toPairsIn.js ***!
  114831. \*********************************************/
  114832. /*! exports provided: default */
  114833. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114834. "use strict";
  114835. __webpack_require__.r(__webpack_exports__);
  114836. /* harmony import */ var _createToPairs_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createToPairs.js */ "./node_modules/lodash-es/_createToPairs.js");
  114837. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  114838. /**
  114839. * Creates an array of own and inherited enumerable string keyed-value pairs
  114840. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  114841. * or set, its entries are returned.
  114842. *
  114843. * @static
  114844. * @memberOf _
  114845. * @since 4.0.0
  114846. * @alias entriesIn
  114847. * @category Object
  114848. * @param {Object} object The object to query.
  114849. * @returns {Array} Returns the key-value pairs.
  114850. * @example
  114851. *
  114852. * function Foo() {
  114853. * this.a = 1;
  114854. * this.b = 2;
  114855. * }
  114856. *
  114857. * Foo.prototype.c = 3;
  114858. *
  114859. * _.toPairsIn(new Foo);
  114860. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  114861. */
  114862. var toPairsIn = Object(_createToPairs_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_keysIn_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  114863. /* harmony default export */ __webpack_exports__["default"] = (toPairsIn);
  114864. /***/ }),
  114865. /***/ "./node_modules/lodash-es/toPath.js":
  114866. /*!******************************************!*\
  114867. !*** ./node_modules/lodash-es/toPath.js ***!
  114868. \******************************************/
  114869. /*! exports provided: default */
  114870. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114871. "use strict";
  114872. __webpack_require__.r(__webpack_exports__);
  114873. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  114874. /* harmony import */ var _copyArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_copyArray.js */ "./node_modules/lodash-es/_copyArray.js");
  114875. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  114876. /* harmony import */ var _isSymbol_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isSymbol.js */ "./node_modules/lodash-es/isSymbol.js");
  114877. /* harmony import */ var _stringToPath_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_stringToPath.js */ "./node_modules/lodash-es/_stringToPath.js");
  114878. /* harmony import */ var _toKey_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_toKey.js */ "./node_modules/lodash-es/_toKey.js");
  114879. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  114880. /**
  114881. * Converts `value` to a property path array.
  114882. *
  114883. * @static
  114884. * @memberOf _
  114885. * @since 4.0.0
  114886. * @category Util
  114887. * @param {*} value The value to convert.
  114888. * @returns {Array} Returns the new property path array.
  114889. * @example
  114890. *
  114891. * _.toPath('a.b.c');
  114892. * // => ['a', 'b', 'c']
  114893. *
  114894. * _.toPath('a[0].b.c');
  114895. * // => ['a', '0', 'b', 'c']
  114896. */
  114897. function toPath(value) {
  114898. if (Object(_isArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(value)) {
  114899. return Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, _toKey_js__WEBPACK_IMPORTED_MODULE_5__["default"]);
  114900. }
  114901. return Object(_isSymbol_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value) ? [value] : Object(_copyArray_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_stringToPath_js__WEBPACK_IMPORTED_MODULE_4__["default"])(Object(_toString_js__WEBPACK_IMPORTED_MODULE_6__["default"])(value)));
  114902. }
  114903. /* harmony default export */ __webpack_exports__["default"] = (toPath);
  114904. /***/ }),
  114905. /***/ "./node_modules/lodash-es/toPlainObject.js":
  114906. /*!*************************************************!*\
  114907. !*** ./node_modules/lodash-es/toPlainObject.js ***!
  114908. \*************************************************/
  114909. /*! exports provided: default */
  114910. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114911. "use strict";
  114912. __webpack_require__.r(__webpack_exports__);
  114913. /* harmony import */ var _copyObject_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_copyObject.js */ "./node_modules/lodash-es/_copyObject.js");
  114914. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  114915. /**
  114916. * Converts `value` to a plain object flattening inherited enumerable string
  114917. * keyed properties of `value` to own properties of the plain object.
  114918. *
  114919. * @static
  114920. * @memberOf _
  114921. * @since 3.0.0
  114922. * @category Lang
  114923. * @param {*} value The value to convert.
  114924. * @returns {Object} Returns the converted plain object.
  114925. * @example
  114926. *
  114927. * function Foo() {
  114928. * this.b = 2;
  114929. * }
  114930. *
  114931. * Foo.prototype.c = 3;
  114932. *
  114933. * _.assign({ 'a': 1 }, new Foo);
  114934. * // => { 'a': 1, 'b': 2 }
  114935. *
  114936. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  114937. * // => { 'a': 1, 'b': 2, 'c': 3 }
  114938. */
  114939. function toPlainObject(value) {
  114940. return Object(_copyObject_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, Object(_keysIn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value));
  114941. }
  114942. /* harmony default export */ __webpack_exports__["default"] = (toPlainObject);
  114943. /***/ }),
  114944. /***/ "./node_modules/lodash-es/toSafeInteger.js":
  114945. /*!*************************************************!*\
  114946. !*** ./node_modules/lodash-es/toSafeInteger.js ***!
  114947. \*************************************************/
  114948. /*! exports provided: default */
  114949. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114950. "use strict";
  114951. __webpack_require__.r(__webpack_exports__);
  114952. /* harmony import */ var _baseClamp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClamp.js */ "./node_modules/lodash-es/_baseClamp.js");
  114953. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  114954. /** Used as references for various `Number` constants. */
  114955. var MAX_SAFE_INTEGER = 9007199254740991;
  114956. /**
  114957. * Converts `value` to a safe integer. A safe integer can be compared and
  114958. * represented correctly.
  114959. *
  114960. * @static
  114961. * @memberOf _
  114962. * @since 4.0.0
  114963. * @category Lang
  114964. * @param {*} value The value to convert.
  114965. * @returns {number} Returns the converted integer.
  114966. * @example
  114967. *
  114968. * _.toSafeInteger(3.2);
  114969. * // => 3
  114970. *
  114971. * _.toSafeInteger(Number.MIN_VALUE);
  114972. * // => 0
  114973. *
  114974. * _.toSafeInteger(Infinity);
  114975. * // => 9007199254740991
  114976. *
  114977. * _.toSafeInteger('3.2');
  114978. * // => 3
  114979. */
  114980. function toSafeInteger(value) {
  114981. return value
  114982. ? Object(_baseClamp_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  114983. : (value === 0 ? value : 0);
  114984. }
  114985. /* harmony default export */ __webpack_exports__["default"] = (toSafeInteger);
  114986. /***/ }),
  114987. /***/ "./node_modules/lodash-es/toString.js":
  114988. /*!********************************************!*\
  114989. !*** ./node_modules/lodash-es/toString.js ***!
  114990. \********************************************/
  114991. /*! exports provided: default */
  114992. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114993. "use strict";
  114994. __webpack_require__.r(__webpack_exports__);
  114995. /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
  114996. /**
  114997. * Converts `value` to a string. An empty string is returned for `null`
  114998. * and `undefined` values. The sign of `-0` is preserved.
  114999. *
  115000. * @static
  115001. * @memberOf _
  115002. * @since 4.0.0
  115003. * @category Lang
  115004. * @param {*} value The value to convert.
  115005. * @returns {string} Returns the converted string.
  115006. * @example
  115007. *
  115008. * _.toString(null);
  115009. * // => ''
  115010. *
  115011. * _.toString(-0);
  115012. * // => '-0'
  115013. *
  115014. * _.toString([1, 2, 3]);
  115015. * // => '1,2,3'
  115016. */
  115017. function toString(value) {
  115018. return value == null ? '' : Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
  115019. }
  115020. /* harmony default export */ __webpack_exports__["default"] = (toString);
  115021. /***/ }),
  115022. /***/ "./node_modules/lodash-es/toUpper.js":
  115023. /*!*******************************************!*\
  115024. !*** ./node_modules/lodash-es/toUpper.js ***!
  115025. \*******************************************/
  115026. /*! exports provided: default */
  115027. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115028. "use strict";
  115029. __webpack_require__.r(__webpack_exports__);
  115030. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  115031. /**
  115032. * Converts `string`, as a whole, to upper case just like
  115033. * [String#toUpperCase](https://mdn.io/toUpperCase).
  115034. *
  115035. * @static
  115036. * @memberOf _
  115037. * @since 4.0.0
  115038. * @category String
  115039. * @param {string} [string=''] The string to convert.
  115040. * @returns {string} Returns the upper cased string.
  115041. * @example
  115042. *
  115043. * _.toUpper('--foo-bar--');
  115044. * // => '--FOO-BAR--'
  115045. *
  115046. * _.toUpper('fooBar');
  115047. * // => 'FOOBAR'
  115048. *
  115049. * _.toUpper('__foo_bar__');
  115050. * // => '__FOO_BAR__'
  115051. */
  115052. function toUpper(value) {
  115053. return Object(_toString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value).toUpperCase();
  115054. }
  115055. /* harmony default export */ __webpack_exports__["default"] = (toUpper);
  115056. /***/ }),
  115057. /***/ "./node_modules/lodash-es/transform.js":
  115058. /*!*********************************************!*\
  115059. !*** ./node_modules/lodash-es/transform.js ***!
  115060. \*********************************************/
  115061. /*! exports provided: default */
  115062. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115063. "use strict";
  115064. __webpack_require__.r(__webpack_exports__);
  115065. /* harmony import */ var _arrayEach_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayEach.js */ "./node_modules/lodash-es/_arrayEach.js");
  115066. /* harmony import */ var _baseCreate_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseCreate.js */ "./node_modules/lodash-es/_baseCreate.js");
  115067. /* harmony import */ var _baseForOwn_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseForOwn.js */ "./node_modules/lodash-es/_baseForOwn.js");
  115068. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  115069. /* harmony import */ var _getPrototype_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_getPrototype.js */ "./node_modules/lodash-es/_getPrototype.js");
  115070. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  115071. /* harmony import */ var _isBuffer_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./isBuffer.js */ "./node_modules/lodash-es/isBuffer.js");
  115072. /* harmony import */ var _isFunction_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./isFunction.js */ "./node_modules/lodash-es/isFunction.js");
  115073. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  115074. /* harmony import */ var _isTypedArray_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./isTypedArray.js */ "./node_modules/lodash-es/isTypedArray.js");
  115075. /**
  115076. * An alternative to `_.reduce`; this method transforms `object` to a new
  115077. * `accumulator` object which is the result of running each of its own
  115078. * enumerable string keyed properties thru `iteratee`, with each invocation
  115079. * potentially mutating the `accumulator` object. If `accumulator` is not
  115080. * provided, a new object with the same `[[Prototype]]` will be used. The
  115081. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  115082. * Iteratee functions may exit iteration early by explicitly returning `false`.
  115083. *
  115084. * @static
  115085. * @memberOf _
  115086. * @since 1.3.0
  115087. * @category Object
  115088. * @param {Object} object The object to iterate over.
  115089. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  115090. * @param {*} [accumulator] The custom accumulator value.
  115091. * @returns {*} Returns the accumulated value.
  115092. * @example
  115093. *
  115094. * _.transform([2, 3, 4], function(result, n) {
  115095. * result.push(n *= n);
  115096. * return n % 2 == 0;
  115097. * }, []);
  115098. * // => [4, 9]
  115099. *
  115100. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  115101. * (result[value] || (result[value] = [])).push(key);
  115102. * }, {});
  115103. * // => { '1': ['a', 'c'], '2': ['b'] }
  115104. */
  115105. function transform(object, iteratee, accumulator) {
  115106. var isArr = Object(_isArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(object),
  115107. isArrLike = isArr || Object(_isBuffer_js__WEBPACK_IMPORTED_MODULE_6__["default"])(object) || Object(_isTypedArray_js__WEBPACK_IMPORTED_MODULE_9__["default"])(object);
  115108. iteratee = Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_3__["default"])(iteratee, 4);
  115109. if (accumulator == null) {
  115110. var Ctor = object && object.constructor;
  115111. if (isArrLike) {
  115112. accumulator = isArr ? new Ctor : [];
  115113. }
  115114. else if (Object(_isObject_js__WEBPACK_IMPORTED_MODULE_8__["default"])(object)) {
  115115. accumulator = Object(_isFunction_js__WEBPACK_IMPORTED_MODULE_7__["default"])(Ctor) ? Object(_baseCreate_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_getPrototype_js__WEBPACK_IMPORTED_MODULE_4__["default"])(object)) : {};
  115116. }
  115117. else {
  115118. accumulator = {};
  115119. }
  115120. }
  115121. (isArrLike ? _arrayEach_js__WEBPACK_IMPORTED_MODULE_0__["default"] : _baseForOwn_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object, function(value, index, object) {
  115122. return iteratee(accumulator, value, index, object);
  115123. });
  115124. return accumulator;
  115125. }
  115126. /* harmony default export */ __webpack_exports__["default"] = (transform);
  115127. /***/ }),
  115128. /***/ "./node_modules/lodash-es/trim.js":
  115129. /*!****************************************!*\
  115130. !*** ./node_modules/lodash-es/trim.js ***!
  115131. \****************************************/
  115132. /*! exports provided: default */
  115133. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115134. "use strict";
  115135. __webpack_require__.r(__webpack_exports__);
  115136. /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
  115137. /* harmony import */ var _baseTrim_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseTrim.js */ "./node_modules/lodash-es/_baseTrim.js");
  115138. /* harmony import */ var _castSlice_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_castSlice.js */ "./node_modules/lodash-es/_castSlice.js");
  115139. /* harmony import */ var _charsEndIndex_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_charsEndIndex.js */ "./node_modules/lodash-es/_charsEndIndex.js");
  115140. /* harmony import */ var _charsStartIndex_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_charsStartIndex.js */ "./node_modules/lodash-es/_charsStartIndex.js");
  115141. /* harmony import */ var _stringToArray_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_stringToArray.js */ "./node_modules/lodash-es/_stringToArray.js");
  115142. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  115143. /**
  115144. * Removes leading and trailing whitespace or specified characters from `string`.
  115145. *
  115146. * @static
  115147. * @memberOf _
  115148. * @since 3.0.0
  115149. * @category String
  115150. * @param {string} [string=''] The string to trim.
  115151. * @param {string} [chars=whitespace] The characters to trim.
  115152. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  115153. * @returns {string} Returns the trimmed string.
  115154. * @example
  115155. *
  115156. * _.trim(' abc ');
  115157. * // => 'abc'
  115158. *
  115159. * _.trim('-_-abc-_-', '_-');
  115160. * // => 'abc'
  115161. *
  115162. * _.map([' foo ', ' bar '], _.trim);
  115163. * // => ['foo', 'bar']
  115164. */
  115165. function trim(string, chars, guard) {
  115166. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_6__["default"])(string);
  115167. if (string && (guard || chars === undefined)) {
  115168. return Object(_baseTrim_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string);
  115169. }
  115170. if (!string || !(chars = Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(chars))) {
  115171. return string;
  115172. }
  115173. var strSymbols = Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(string),
  115174. chrSymbols = Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_5__["default"])(chars),
  115175. start = Object(_charsStartIndex_js__WEBPACK_IMPORTED_MODULE_4__["default"])(strSymbols, chrSymbols),
  115176. end = Object(_charsEndIndex_js__WEBPACK_IMPORTED_MODULE_3__["default"])(strSymbols, chrSymbols) + 1;
  115177. return Object(_castSlice_js__WEBPACK_IMPORTED_MODULE_2__["default"])(strSymbols, start, end).join('');
  115178. }
  115179. /* harmony default export */ __webpack_exports__["default"] = (trim);
  115180. /***/ }),
  115181. /***/ "./node_modules/lodash-es/trimEnd.js":
  115182. /*!*******************************************!*\
  115183. !*** ./node_modules/lodash-es/trimEnd.js ***!
  115184. \*******************************************/
  115185. /*! exports provided: default */
  115186. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115187. "use strict";
  115188. __webpack_require__.r(__webpack_exports__);
  115189. /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
  115190. /* harmony import */ var _castSlice_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castSlice.js */ "./node_modules/lodash-es/_castSlice.js");
  115191. /* harmony import */ var _charsEndIndex_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_charsEndIndex.js */ "./node_modules/lodash-es/_charsEndIndex.js");
  115192. /* harmony import */ var _stringToArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_stringToArray.js */ "./node_modules/lodash-es/_stringToArray.js");
  115193. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  115194. /* harmony import */ var _trimmedEndIndex_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_trimmedEndIndex.js */ "./node_modules/lodash-es/_trimmedEndIndex.js");
  115195. /**
  115196. * Removes trailing whitespace or specified characters from `string`.
  115197. *
  115198. * @static
  115199. * @memberOf _
  115200. * @since 4.0.0
  115201. * @category String
  115202. * @param {string} [string=''] The string to trim.
  115203. * @param {string} [chars=whitespace] The characters to trim.
  115204. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  115205. * @returns {string} Returns the trimmed string.
  115206. * @example
  115207. *
  115208. * _.trimEnd(' abc ');
  115209. * // => ' abc'
  115210. *
  115211. * _.trimEnd('-_-abc-_-', '_-');
  115212. * // => '-_-abc'
  115213. */
  115214. function trimEnd(string, chars, guard) {
  115215. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_4__["default"])(string);
  115216. if (string && (guard || chars === undefined)) {
  115217. return string.slice(0, Object(_trimmedEndIndex_js__WEBPACK_IMPORTED_MODULE_5__["default"])(string) + 1);
  115218. }
  115219. if (!string || !(chars = Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(chars))) {
  115220. return string;
  115221. }
  115222. var strSymbols = Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string),
  115223. end = Object(_charsEndIndex_js__WEBPACK_IMPORTED_MODULE_2__["default"])(strSymbols, Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(chars)) + 1;
  115224. return Object(_castSlice_js__WEBPACK_IMPORTED_MODULE_1__["default"])(strSymbols, 0, end).join('');
  115225. }
  115226. /* harmony default export */ __webpack_exports__["default"] = (trimEnd);
  115227. /***/ }),
  115228. /***/ "./node_modules/lodash-es/trimStart.js":
  115229. /*!*********************************************!*\
  115230. !*** ./node_modules/lodash-es/trimStart.js ***!
  115231. \*********************************************/
  115232. /*! exports provided: default */
  115233. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115234. "use strict";
  115235. __webpack_require__.r(__webpack_exports__);
  115236. /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
  115237. /* harmony import */ var _castSlice_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castSlice.js */ "./node_modules/lodash-es/_castSlice.js");
  115238. /* harmony import */ var _charsStartIndex_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_charsStartIndex.js */ "./node_modules/lodash-es/_charsStartIndex.js");
  115239. /* harmony import */ var _stringToArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_stringToArray.js */ "./node_modules/lodash-es/_stringToArray.js");
  115240. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  115241. /** Used to match leading whitespace. */
  115242. var reTrimStart = /^\s+/;
  115243. /**
  115244. * Removes leading whitespace or specified characters from `string`.
  115245. *
  115246. * @static
  115247. * @memberOf _
  115248. * @since 4.0.0
  115249. * @category String
  115250. * @param {string} [string=''] The string to trim.
  115251. * @param {string} [chars=whitespace] The characters to trim.
  115252. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  115253. * @returns {string} Returns the trimmed string.
  115254. * @example
  115255. *
  115256. * _.trimStart(' abc ');
  115257. * // => 'abc '
  115258. *
  115259. * _.trimStart('-_-abc-_-', '_-');
  115260. * // => 'abc-_-'
  115261. */
  115262. function trimStart(string, chars, guard) {
  115263. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_4__["default"])(string);
  115264. if (string && (guard || chars === undefined)) {
  115265. return string.replace(reTrimStart, '');
  115266. }
  115267. if (!string || !(chars = Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(chars))) {
  115268. return string;
  115269. }
  115270. var strSymbols = Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string),
  115271. start = Object(_charsStartIndex_js__WEBPACK_IMPORTED_MODULE_2__["default"])(strSymbols, Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(chars));
  115272. return Object(_castSlice_js__WEBPACK_IMPORTED_MODULE_1__["default"])(strSymbols, start).join('');
  115273. }
  115274. /* harmony default export */ __webpack_exports__["default"] = (trimStart);
  115275. /***/ }),
  115276. /***/ "./node_modules/lodash-es/truncate.js":
  115277. /*!********************************************!*\
  115278. !*** ./node_modules/lodash-es/truncate.js ***!
  115279. \********************************************/
  115280. /*! exports provided: default */
  115281. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115282. "use strict";
  115283. __webpack_require__.r(__webpack_exports__);
  115284. /* harmony import */ var _baseToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseToString.js */ "./node_modules/lodash-es/_baseToString.js");
  115285. /* harmony import */ var _castSlice_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castSlice.js */ "./node_modules/lodash-es/_castSlice.js");
  115286. /* harmony import */ var _hasUnicode_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_hasUnicode.js */ "./node_modules/lodash-es/_hasUnicode.js");
  115287. /* harmony import */ var _isObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isObject.js */ "./node_modules/lodash-es/isObject.js");
  115288. /* harmony import */ var _isRegExp_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isRegExp.js */ "./node_modules/lodash-es/isRegExp.js");
  115289. /* harmony import */ var _stringSize_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_stringSize.js */ "./node_modules/lodash-es/_stringSize.js");
  115290. /* harmony import */ var _stringToArray_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_stringToArray.js */ "./node_modules/lodash-es/_stringToArray.js");
  115291. /* harmony import */ var _toInteger_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./toInteger.js */ "./node_modules/lodash-es/toInteger.js");
  115292. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  115293. /** Used as default options for `_.truncate`. */
  115294. var DEFAULT_TRUNC_LENGTH = 30,
  115295. DEFAULT_TRUNC_OMISSION = '...';
  115296. /** Used to match `RegExp` flags from their coerced string values. */
  115297. var reFlags = /\w*$/;
  115298. /**
  115299. * Truncates `string` if it's longer than the given maximum string length.
  115300. * The last characters of the truncated string are replaced with the omission
  115301. * string which defaults to "...".
  115302. *
  115303. * @static
  115304. * @memberOf _
  115305. * @since 4.0.0
  115306. * @category String
  115307. * @param {string} [string=''] The string to truncate.
  115308. * @param {Object} [options={}] The options object.
  115309. * @param {number} [options.length=30] The maximum string length.
  115310. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  115311. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  115312. * @returns {string} Returns the truncated string.
  115313. * @example
  115314. *
  115315. * _.truncate('hi-diddly-ho there, neighborino');
  115316. * // => 'hi-diddly-ho there, neighbo...'
  115317. *
  115318. * _.truncate('hi-diddly-ho there, neighborino', {
  115319. * 'length': 24,
  115320. * 'separator': ' '
  115321. * });
  115322. * // => 'hi-diddly-ho there,...'
  115323. *
  115324. * _.truncate('hi-diddly-ho there, neighborino', {
  115325. * 'length': 24,
  115326. * 'separator': /,? +/
  115327. * });
  115328. * // => 'hi-diddly-ho there...'
  115329. *
  115330. * _.truncate('hi-diddly-ho there, neighborino', {
  115331. * 'omission': ' [...]'
  115332. * });
  115333. * // => 'hi-diddly-ho there, neig [...]'
  115334. */
  115335. function truncate(string, options) {
  115336. var length = DEFAULT_TRUNC_LENGTH,
  115337. omission = DEFAULT_TRUNC_OMISSION;
  115338. if (Object(_isObject_js__WEBPACK_IMPORTED_MODULE_3__["default"])(options)) {
  115339. var separator = 'separator' in options ? options.separator : separator;
  115340. length = 'length' in options ? Object(_toInteger_js__WEBPACK_IMPORTED_MODULE_7__["default"])(options.length) : length;
  115341. omission = 'omission' in options ? Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(options.omission) : omission;
  115342. }
  115343. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_8__["default"])(string);
  115344. var strLength = string.length;
  115345. if (Object(_hasUnicode_js__WEBPACK_IMPORTED_MODULE_2__["default"])(string)) {
  115346. var strSymbols = Object(_stringToArray_js__WEBPACK_IMPORTED_MODULE_6__["default"])(string);
  115347. strLength = strSymbols.length;
  115348. }
  115349. if (length >= strLength) {
  115350. return string;
  115351. }
  115352. var end = length - Object(_stringSize_js__WEBPACK_IMPORTED_MODULE_5__["default"])(omission);
  115353. if (end < 1) {
  115354. return omission;
  115355. }
  115356. var result = strSymbols
  115357. ? Object(_castSlice_js__WEBPACK_IMPORTED_MODULE_1__["default"])(strSymbols, 0, end).join('')
  115358. : string.slice(0, end);
  115359. if (separator === undefined) {
  115360. return result + omission;
  115361. }
  115362. if (strSymbols) {
  115363. end += (result.length - end);
  115364. }
  115365. if (Object(_isRegExp_js__WEBPACK_IMPORTED_MODULE_4__["default"])(separator)) {
  115366. if (string.slice(end).search(separator)) {
  115367. var match,
  115368. substring = result;
  115369. if (!separator.global) {
  115370. separator = RegExp(separator.source, Object(_toString_js__WEBPACK_IMPORTED_MODULE_8__["default"])(reFlags.exec(separator)) + 'g');
  115371. }
  115372. separator.lastIndex = 0;
  115373. while ((match = separator.exec(substring))) {
  115374. var newEnd = match.index;
  115375. }
  115376. result = result.slice(0, newEnd === undefined ? end : newEnd);
  115377. }
  115378. } else if (string.indexOf(Object(_baseToString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(separator), end) != end) {
  115379. var index = result.lastIndexOf(separator);
  115380. if (index > -1) {
  115381. result = result.slice(0, index);
  115382. }
  115383. }
  115384. return result + omission;
  115385. }
  115386. /* harmony default export */ __webpack_exports__["default"] = (truncate);
  115387. /***/ }),
  115388. /***/ "./node_modules/lodash-es/unary.js":
  115389. /*!*****************************************!*\
  115390. !*** ./node_modules/lodash-es/unary.js ***!
  115391. \*****************************************/
  115392. /*! exports provided: default */
  115393. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115394. "use strict";
  115395. __webpack_require__.r(__webpack_exports__);
  115396. /* harmony import */ var _ary_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ary.js */ "./node_modules/lodash-es/ary.js");
  115397. /**
  115398. * Creates a function that accepts up to one argument, ignoring any
  115399. * additional arguments.
  115400. *
  115401. * @static
  115402. * @memberOf _
  115403. * @since 4.0.0
  115404. * @category Function
  115405. * @param {Function} func The function to cap arguments for.
  115406. * @returns {Function} Returns the new capped function.
  115407. * @example
  115408. *
  115409. * _.map(['6', '8', '10'], _.unary(parseInt));
  115410. * // => [6, 8, 10]
  115411. */
  115412. function unary(func) {
  115413. return Object(_ary_js__WEBPACK_IMPORTED_MODULE_0__["default"])(func, 1);
  115414. }
  115415. /* harmony default export */ __webpack_exports__["default"] = (unary);
  115416. /***/ }),
  115417. /***/ "./node_modules/lodash-es/unescape.js":
  115418. /*!********************************************!*\
  115419. !*** ./node_modules/lodash-es/unescape.js ***!
  115420. \********************************************/
  115421. /*! exports provided: default */
  115422. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115423. "use strict";
  115424. __webpack_require__.r(__webpack_exports__);
  115425. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  115426. /* harmony import */ var _unescapeHtmlChar_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_unescapeHtmlChar.js */ "./node_modules/lodash-es/_unescapeHtmlChar.js");
  115427. /** Used to match HTML entities and HTML characters. */
  115428. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  115429. reHasEscapedHtml = RegExp(reEscapedHtml.source);
  115430. /**
  115431. * The inverse of `_.escape`; this method converts the HTML entities
  115432. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  115433. * their corresponding characters.
  115434. *
  115435. * **Note:** No other HTML entities are unescaped. To unescape additional
  115436. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  115437. *
  115438. * @static
  115439. * @memberOf _
  115440. * @since 0.6.0
  115441. * @category String
  115442. * @param {string} [string=''] The string to unescape.
  115443. * @returns {string} Returns the unescaped string.
  115444. * @example
  115445. *
  115446. * _.unescape('fred, barney, &amp; pebbles');
  115447. * // => 'fred, barney, & pebbles'
  115448. */
  115449. function unescape(string) {
  115450. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(string);
  115451. return (string && reHasEscapedHtml.test(string))
  115452. ? string.replace(reEscapedHtml, _unescapeHtmlChar_js__WEBPACK_IMPORTED_MODULE_1__["default"])
  115453. : string;
  115454. }
  115455. /* harmony default export */ __webpack_exports__["default"] = (unescape);
  115456. /***/ }),
  115457. /***/ "./node_modules/lodash-es/union.js":
  115458. /*!*****************************************!*\
  115459. !*** ./node_modules/lodash-es/union.js ***!
  115460. \*****************************************/
  115461. /*! exports provided: default */
  115462. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115463. "use strict";
  115464. __webpack_require__.r(__webpack_exports__);
  115465. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  115466. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  115467. /* harmony import */ var _baseUniq_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseUniq.js */ "./node_modules/lodash-es/_baseUniq.js");
  115468. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  115469. /**
  115470. * Creates an array of unique values, in order, from all given arrays using
  115471. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  115472. * for equality comparisons.
  115473. *
  115474. * @static
  115475. * @memberOf _
  115476. * @since 0.1.0
  115477. * @category Array
  115478. * @param {...Array} [arrays] The arrays to inspect.
  115479. * @returns {Array} Returns the new array of combined values.
  115480. * @example
  115481. *
  115482. * _.union([2], [1, 2]);
  115483. * // => [2, 1]
  115484. */
  115485. var union = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(arrays) {
  115486. return Object(_baseUniq_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(arrays, 1, _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"], true));
  115487. });
  115488. /* harmony default export */ __webpack_exports__["default"] = (union);
  115489. /***/ }),
  115490. /***/ "./node_modules/lodash-es/unionBy.js":
  115491. /*!*******************************************!*\
  115492. !*** ./node_modules/lodash-es/unionBy.js ***!
  115493. \*******************************************/
  115494. /*! exports provided: default */
  115495. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115496. "use strict";
  115497. __webpack_require__.r(__webpack_exports__);
  115498. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  115499. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  115500. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  115501. /* harmony import */ var _baseUniq_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseUniq.js */ "./node_modules/lodash-es/_baseUniq.js");
  115502. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  115503. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  115504. /**
  115505. * This method is like `_.union` except that it accepts `iteratee` which is
  115506. * invoked for each element of each `arrays` to generate the criterion by
  115507. * which uniqueness is computed. Result values are chosen from the first
  115508. * array in which the value occurs. The iteratee is invoked with one argument:
  115509. * (value).
  115510. *
  115511. * @static
  115512. * @memberOf _
  115513. * @since 4.0.0
  115514. * @category Array
  115515. * @param {...Array} [arrays] The arrays to inspect.
  115516. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  115517. * @returns {Array} Returns the new array of combined values.
  115518. * @example
  115519. *
  115520. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  115521. * // => [2.1, 1.2]
  115522. *
  115523. * // The `_.property` iteratee shorthand.
  115524. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  115525. * // => [{ 'x': 1 }, { 'x': 2 }]
  115526. */
  115527. var unionBy = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(arrays) {
  115528. var iteratee = Object(_last_js__WEBPACK_IMPORTED_MODULE_5__["default"])(arrays);
  115529. if (Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__["default"])(iteratee)) {
  115530. iteratee = undefined;
  115531. }
  115532. return Object(_baseUniq_js__WEBPACK_IMPORTED_MODULE_3__["default"])(Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(arrays, 1, _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__["default"], true), Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratee, 2));
  115533. });
  115534. /* harmony default export */ __webpack_exports__["default"] = (unionBy);
  115535. /***/ }),
  115536. /***/ "./node_modules/lodash-es/unionWith.js":
  115537. /*!*********************************************!*\
  115538. !*** ./node_modules/lodash-es/unionWith.js ***!
  115539. \*********************************************/
  115540. /*! exports provided: default */
  115541. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115542. "use strict";
  115543. __webpack_require__.r(__webpack_exports__);
  115544. /* harmony import */ var _baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseFlatten.js */ "./node_modules/lodash-es/_baseFlatten.js");
  115545. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  115546. /* harmony import */ var _baseUniq_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseUniq.js */ "./node_modules/lodash-es/_baseUniq.js");
  115547. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  115548. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  115549. /**
  115550. * This method is like `_.union` except that it accepts `comparator` which
  115551. * is invoked to compare elements of `arrays`. Result values are chosen from
  115552. * the first array in which the value occurs. The comparator is invoked
  115553. * with two arguments: (arrVal, othVal).
  115554. *
  115555. * @static
  115556. * @memberOf _
  115557. * @since 4.0.0
  115558. * @category Array
  115559. * @param {...Array} [arrays] The arrays to inspect.
  115560. * @param {Function} [comparator] The comparator invoked per element.
  115561. * @returns {Array} Returns the new array of combined values.
  115562. * @example
  115563. *
  115564. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  115565. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  115566. *
  115567. * _.unionWith(objects, others, _.isEqual);
  115568. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  115569. */
  115570. var unionWith = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(arrays) {
  115571. var comparator = Object(_last_js__WEBPACK_IMPORTED_MODULE_4__["default"])(arrays);
  115572. comparator = typeof comparator == 'function' ? comparator : undefined;
  115573. return Object(_baseUniq_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_baseFlatten_js__WEBPACK_IMPORTED_MODULE_0__["default"])(arrays, 1, _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"], true), undefined, comparator);
  115574. });
  115575. /* harmony default export */ __webpack_exports__["default"] = (unionWith);
  115576. /***/ }),
  115577. /***/ "./node_modules/lodash-es/uniq.js":
  115578. /*!****************************************!*\
  115579. !*** ./node_modules/lodash-es/uniq.js ***!
  115580. \****************************************/
  115581. /*! exports provided: default */
  115582. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115583. "use strict";
  115584. __webpack_require__.r(__webpack_exports__);
  115585. /* harmony import */ var _baseUniq_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseUniq.js */ "./node_modules/lodash-es/_baseUniq.js");
  115586. /**
  115587. * Creates a duplicate-free version of an array, using
  115588. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  115589. * for equality comparisons, in which only the first occurrence of each element
  115590. * is kept. The order of result values is determined by the order they occur
  115591. * in the array.
  115592. *
  115593. * @static
  115594. * @memberOf _
  115595. * @since 0.1.0
  115596. * @category Array
  115597. * @param {Array} array The array to inspect.
  115598. * @returns {Array} Returns the new duplicate free array.
  115599. * @example
  115600. *
  115601. * _.uniq([2, 1, 2]);
  115602. * // => [2, 1]
  115603. */
  115604. function uniq(array) {
  115605. return (array && array.length) ? Object(_baseUniq_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array) : [];
  115606. }
  115607. /* harmony default export */ __webpack_exports__["default"] = (uniq);
  115608. /***/ }),
  115609. /***/ "./node_modules/lodash-es/uniqBy.js":
  115610. /*!******************************************!*\
  115611. !*** ./node_modules/lodash-es/uniqBy.js ***!
  115612. \******************************************/
  115613. /*! exports provided: default */
  115614. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115615. "use strict";
  115616. __webpack_require__.r(__webpack_exports__);
  115617. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  115618. /* harmony import */ var _baseUniq_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseUniq.js */ "./node_modules/lodash-es/_baseUniq.js");
  115619. /**
  115620. * This method is like `_.uniq` except that it accepts `iteratee` which is
  115621. * invoked for each element in `array` to generate the criterion by which
  115622. * uniqueness is computed. The order of result values is determined by the
  115623. * order they occur in the array. The iteratee is invoked with one argument:
  115624. * (value).
  115625. *
  115626. * @static
  115627. * @memberOf _
  115628. * @since 4.0.0
  115629. * @category Array
  115630. * @param {Array} array The array to inspect.
  115631. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  115632. * @returns {Array} Returns the new duplicate free array.
  115633. * @example
  115634. *
  115635. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  115636. * // => [2.1, 1.2]
  115637. *
  115638. * // The `_.property` iteratee shorthand.
  115639. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  115640. * // => [{ 'x': 1 }, { 'x': 2 }]
  115641. */
  115642. function uniqBy(array, iteratee) {
  115643. return (array && array.length) ? Object(_baseUniq_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, 2)) : [];
  115644. }
  115645. /* harmony default export */ __webpack_exports__["default"] = (uniqBy);
  115646. /***/ }),
  115647. /***/ "./node_modules/lodash-es/uniqWith.js":
  115648. /*!********************************************!*\
  115649. !*** ./node_modules/lodash-es/uniqWith.js ***!
  115650. \********************************************/
  115651. /*! exports provided: default */
  115652. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115653. "use strict";
  115654. __webpack_require__.r(__webpack_exports__);
  115655. /* harmony import */ var _baseUniq_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseUniq.js */ "./node_modules/lodash-es/_baseUniq.js");
  115656. /**
  115657. * This method is like `_.uniq` except that it accepts `comparator` which
  115658. * is invoked to compare elements of `array`. The order of result values is
  115659. * determined by the order they occur in the array.The comparator is invoked
  115660. * with two arguments: (arrVal, othVal).
  115661. *
  115662. * @static
  115663. * @memberOf _
  115664. * @since 4.0.0
  115665. * @category Array
  115666. * @param {Array} array The array to inspect.
  115667. * @param {Function} [comparator] The comparator invoked per element.
  115668. * @returns {Array} Returns the new duplicate free array.
  115669. * @example
  115670. *
  115671. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  115672. *
  115673. * _.uniqWith(objects, _.isEqual);
  115674. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  115675. */
  115676. function uniqWith(array, comparator) {
  115677. comparator = typeof comparator == 'function' ? comparator : undefined;
  115678. return (array && array.length) ? Object(_baseUniq_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, undefined, comparator) : [];
  115679. }
  115680. /* harmony default export */ __webpack_exports__["default"] = (uniqWith);
  115681. /***/ }),
  115682. /***/ "./node_modules/lodash-es/uniqueId.js":
  115683. /*!********************************************!*\
  115684. !*** ./node_modules/lodash-es/uniqueId.js ***!
  115685. \********************************************/
  115686. /*! exports provided: default */
  115687. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115688. "use strict";
  115689. __webpack_require__.r(__webpack_exports__);
  115690. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  115691. /** Used to generate unique IDs. */
  115692. var idCounter = 0;
  115693. /**
  115694. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  115695. *
  115696. * @static
  115697. * @since 0.1.0
  115698. * @memberOf _
  115699. * @category Util
  115700. * @param {string} [prefix=''] The value to prefix the ID with.
  115701. * @returns {string} Returns the unique ID.
  115702. * @example
  115703. *
  115704. * _.uniqueId('contact_');
  115705. * // => 'contact_104'
  115706. *
  115707. * _.uniqueId();
  115708. * // => '105'
  115709. */
  115710. function uniqueId(prefix) {
  115711. var id = ++idCounter;
  115712. return Object(_toString_js__WEBPACK_IMPORTED_MODULE_0__["default"])(prefix) + id;
  115713. }
  115714. /* harmony default export */ __webpack_exports__["default"] = (uniqueId);
  115715. /***/ }),
  115716. /***/ "./node_modules/lodash-es/unset.js":
  115717. /*!*****************************************!*\
  115718. !*** ./node_modules/lodash-es/unset.js ***!
  115719. \*****************************************/
  115720. /*! exports provided: default */
  115721. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115722. "use strict";
  115723. __webpack_require__.r(__webpack_exports__);
  115724. /* harmony import */ var _baseUnset_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseUnset.js */ "./node_modules/lodash-es/_baseUnset.js");
  115725. /**
  115726. * Removes the property at `path` of `object`.
  115727. *
  115728. * **Note:** This method mutates `object`.
  115729. *
  115730. * @static
  115731. * @memberOf _
  115732. * @since 4.0.0
  115733. * @category Object
  115734. * @param {Object} object The object to modify.
  115735. * @param {Array|string} path The path of the property to unset.
  115736. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  115737. * @example
  115738. *
  115739. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  115740. * _.unset(object, 'a[0].b.c');
  115741. * // => true
  115742. *
  115743. * console.log(object);
  115744. * // => { 'a': [{ 'b': {} }] };
  115745. *
  115746. * _.unset(object, ['a', '0', 'b', 'c']);
  115747. * // => true
  115748. *
  115749. * console.log(object);
  115750. * // => { 'a': [{ 'b': {} }] };
  115751. */
  115752. function unset(object, path) {
  115753. return object == null ? true : Object(_baseUnset_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path);
  115754. }
  115755. /* harmony default export */ __webpack_exports__["default"] = (unset);
  115756. /***/ }),
  115757. /***/ "./node_modules/lodash-es/unzip.js":
  115758. /*!*****************************************!*\
  115759. !*** ./node_modules/lodash-es/unzip.js ***!
  115760. \*****************************************/
  115761. /*! exports provided: default */
  115762. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115763. "use strict";
  115764. __webpack_require__.r(__webpack_exports__);
  115765. /* harmony import */ var _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayFilter.js */ "./node_modules/lodash-es/_arrayFilter.js");
  115766. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  115767. /* harmony import */ var _baseProperty_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseProperty.js */ "./node_modules/lodash-es/_baseProperty.js");
  115768. /* harmony import */ var _baseTimes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseTimes.js */ "./node_modules/lodash-es/_baseTimes.js");
  115769. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  115770. /* Built-in method references for those with the same name as other `lodash` methods. */
  115771. var nativeMax = Math.max;
  115772. /**
  115773. * This method is like `_.zip` except that it accepts an array of grouped
  115774. * elements and creates an array regrouping the elements to their pre-zip
  115775. * configuration.
  115776. *
  115777. * @static
  115778. * @memberOf _
  115779. * @since 1.2.0
  115780. * @category Array
  115781. * @param {Array} array The array of grouped elements to process.
  115782. * @returns {Array} Returns the new array of regrouped elements.
  115783. * @example
  115784. *
  115785. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  115786. * // => [['a', 1, true], ['b', 2, false]]
  115787. *
  115788. * _.unzip(zipped);
  115789. * // => [['a', 'b'], [1, 2], [true, false]]
  115790. */
  115791. function unzip(array) {
  115792. if (!(array && array.length)) {
  115793. return [];
  115794. }
  115795. var length = 0;
  115796. array = Object(_arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, function(group) {
  115797. if (Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__["default"])(group)) {
  115798. length = nativeMax(group.length, length);
  115799. return true;
  115800. }
  115801. });
  115802. return Object(_baseTimes_js__WEBPACK_IMPORTED_MODULE_3__["default"])(length, function(index) {
  115803. return Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(array, Object(_baseProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(index));
  115804. });
  115805. }
  115806. /* harmony default export */ __webpack_exports__["default"] = (unzip);
  115807. /***/ }),
  115808. /***/ "./node_modules/lodash-es/unzipWith.js":
  115809. /*!*********************************************!*\
  115810. !*** ./node_modules/lodash-es/unzipWith.js ***!
  115811. \*********************************************/
  115812. /*! exports provided: default */
  115813. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115814. "use strict";
  115815. __webpack_require__.r(__webpack_exports__);
  115816. /* harmony import */ var _apply_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_apply.js */ "./node_modules/lodash-es/_apply.js");
  115817. /* harmony import */ var _arrayMap_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_arrayMap.js */ "./node_modules/lodash-es/_arrayMap.js");
  115818. /* harmony import */ var _unzip_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./unzip.js */ "./node_modules/lodash-es/unzip.js");
  115819. /**
  115820. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  115821. * how regrouped values should be combined. The iteratee is invoked with the
  115822. * elements of each group: (...group).
  115823. *
  115824. * @static
  115825. * @memberOf _
  115826. * @since 3.8.0
  115827. * @category Array
  115828. * @param {Array} array The array of grouped elements to process.
  115829. * @param {Function} [iteratee=_.identity] The function to combine
  115830. * regrouped values.
  115831. * @returns {Array} Returns the new array of regrouped elements.
  115832. * @example
  115833. *
  115834. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  115835. * // => [[1, 10, 100], [2, 20, 200]]
  115836. *
  115837. * _.unzipWith(zipped, _.add);
  115838. * // => [3, 30, 300]
  115839. */
  115840. function unzipWith(array, iteratee) {
  115841. if (!(array && array.length)) {
  115842. return [];
  115843. }
  115844. var result = Object(_unzip_js__WEBPACK_IMPORTED_MODULE_2__["default"])(array);
  115845. if (iteratee == null) {
  115846. return result;
  115847. }
  115848. return Object(_arrayMap_js__WEBPACK_IMPORTED_MODULE_1__["default"])(result, function(group) {
  115849. return Object(_apply_js__WEBPACK_IMPORTED_MODULE_0__["default"])(iteratee, undefined, group);
  115850. });
  115851. }
  115852. /* harmony default export */ __webpack_exports__["default"] = (unzipWith);
  115853. /***/ }),
  115854. /***/ "./node_modules/lodash-es/update.js":
  115855. /*!******************************************!*\
  115856. !*** ./node_modules/lodash-es/update.js ***!
  115857. \******************************************/
  115858. /*! exports provided: default */
  115859. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115860. "use strict";
  115861. __webpack_require__.r(__webpack_exports__);
  115862. /* harmony import */ var _baseUpdate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseUpdate.js */ "./node_modules/lodash-es/_baseUpdate.js");
  115863. /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
  115864. /**
  115865. * This method is like `_.set` except that accepts `updater` to produce the
  115866. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  115867. * is invoked with one argument: (value).
  115868. *
  115869. * **Note:** This method mutates `object`.
  115870. *
  115871. * @static
  115872. * @memberOf _
  115873. * @since 4.6.0
  115874. * @category Object
  115875. * @param {Object} object The object to modify.
  115876. * @param {Array|string} path The path of the property to set.
  115877. * @param {Function} updater The function to produce the updated value.
  115878. * @returns {Object} Returns `object`.
  115879. * @example
  115880. *
  115881. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  115882. *
  115883. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  115884. * console.log(object.a[0].b.c);
  115885. * // => 9
  115886. *
  115887. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  115888. * console.log(object.x[0].y.z);
  115889. * // => 0
  115890. */
  115891. function update(object, path, updater) {
  115892. return object == null ? object : Object(_baseUpdate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path, Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(updater));
  115893. }
  115894. /* harmony default export */ __webpack_exports__["default"] = (update);
  115895. /***/ }),
  115896. /***/ "./node_modules/lodash-es/updateWith.js":
  115897. /*!**********************************************!*\
  115898. !*** ./node_modules/lodash-es/updateWith.js ***!
  115899. \**********************************************/
  115900. /*! exports provided: default */
  115901. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115902. "use strict";
  115903. __webpack_require__.r(__webpack_exports__);
  115904. /* harmony import */ var _baseUpdate_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseUpdate.js */ "./node_modules/lodash-es/_baseUpdate.js");
  115905. /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
  115906. /**
  115907. * This method is like `_.update` except that it accepts `customizer` which is
  115908. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  115909. * path creation is handled by the method instead. The `customizer` is invoked
  115910. * with three arguments: (nsValue, key, nsObject).
  115911. *
  115912. * **Note:** This method mutates `object`.
  115913. *
  115914. * @static
  115915. * @memberOf _
  115916. * @since 4.6.0
  115917. * @category Object
  115918. * @param {Object} object The object to modify.
  115919. * @param {Array|string} path The path of the property to set.
  115920. * @param {Function} updater The function to produce the updated value.
  115921. * @param {Function} [customizer] The function to customize assigned values.
  115922. * @returns {Object} Returns `object`.
  115923. * @example
  115924. *
  115925. * var object = {};
  115926. *
  115927. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  115928. * // => { '0': { '1': 'a' } }
  115929. */
  115930. function updateWith(object, path, updater, customizer) {
  115931. customizer = typeof customizer == 'function' ? customizer : undefined;
  115932. return object == null ? object : Object(_baseUpdate_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, path, Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_1__["default"])(updater), customizer);
  115933. }
  115934. /* harmony default export */ __webpack_exports__["default"] = (updateWith);
  115935. /***/ }),
  115936. /***/ "./node_modules/lodash-es/upperCase.js":
  115937. /*!*********************************************!*\
  115938. !*** ./node_modules/lodash-es/upperCase.js ***!
  115939. \*********************************************/
  115940. /*! exports provided: default */
  115941. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115942. "use strict";
  115943. __webpack_require__.r(__webpack_exports__);
  115944. /* harmony import */ var _createCompounder_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createCompounder.js */ "./node_modules/lodash-es/_createCompounder.js");
  115945. /**
  115946. * Converts `string`, as space separated words, to upper case.
  115947. *
  115948. * @static
  115949. * @memberOf _
  115950. * @since 4.0.0
  115951. * @category String
  115952. * @param {string} [string=''] The string to convert.
  115953. * @returns {string} Returns the upper cased string.
  115954. * @example
  115955. *
  115956. * _.upperCase('--foo-bar');
  115957. * // => 'FOO BAR'
  115958. *
  115959. * _.upperCase('fooBar');
  115960. * // => 'FOO BAR'
  115961. *
  115962. * _.upperCase('__foo_bar__');
  115963. * // => 'FOO BAR'
  115964. */
  115965. var upperCase = Object(_createCompounder_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(result, word, index) {
  115966. return result + (index ? ' ' : '') + word.toUpperCase();
  115967. });
  115968. /* harmony default export */ __webpack_exports__["default"] = (upperCase);
  115969. /***/ }),
  115970. /***/ "./node_modules/lodash-es/upperFirst.js":
  115971. /*!**********************************************!*\
  115972. !*** ./node_modules/lodash-es/upperFirst.js ***!
  115973. \**********************************************/
  115974. /*! exports provided: default */
  115975. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  115976. "use strict";
  115977. __webpack_require__.r(__webpack_exports__);
  115978. /* harmony import */ var _createCaseFirst_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_createCaseFirst.js */ "./node_modules/lodash-es/_createCaseFirst.js");
  115979. /**
  115980. * Converts the first character of `string` to upper case.
  115981. *
  115982. * @static
  115983. * @memberOf _
  115984. * @since 4.0.0
  115985. * @category String
  115986. * @param {string} [string=''] The string to convert.
  115987. * @returns {string} Returns the converted string.
  115988. * @example
  115989. *
  115990. * _.upperFirst('fred');
  115991. * // => 'Fred'
  115992. *
  115993. * _.upperFirst('FRED');
  115994. * // => 'FRED'
  115995. */
  115996. var upperFirst = Object(_createCaseFirst_js__WEBPACK_IMPORTED_MODULE_0__["default"])('toUpperCase');
  115997. /* harmony default export */ __webpack_exports__["default"] = (upperFirst);
  115998. /***/ }),
  115999. /***/ "./node_modules/lodash-es/util.default.js":
  116000. /*!************************************************!*\
  116001. !*** ./node_modules/lodash-es/util.default.js ***!
  116002. \************************************************/
  116003. /*! exports provided: default */
  116004. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116005. "use strict";
  116006. __webpack_require__.r(__webpack_exports__);
  116007. /* harmony import */ var _attempt_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./attempt.js */ "./node_modules/lodash-es/attempt.js");
  116008. /* harmony import */ var _bindAll_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bindAll.js */ "./node_modules/lodash-es/bindAll.js");
  116009. /* harmony import */ var _cond_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cond.js */ "./node_modules/lodash-es/cond.js");
  116010. /* harmony import */ var _conforms_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./conforms.js */ "./node_modules/lodash-es/conforms.js");
  116011. /* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./constant.js */ "./node_modules/lodash-es/constant.js");
  116012. /* harmony import */ var _defaultTo_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./defaultTo.js */ "./node_modules/lodash-es/defaultTo.js");
  116013. /* harmony import */ var _flow_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./flow.js */ "./node_modules/lodash-es/flow.js");
  116014. /* harmony import */ var _flowRight_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./flowRight.js */ "./node_modules/lodash-es/flowRight.js");
  116015. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  116016. /* harmony import */ var _iteratee_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./iteratee.js */ "./node_modules/lodash-es/iteratee.js");
  116017. /* harmony import */ var _matches_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./matches.js */ "./node_modules/lodash-es/matches.js");
  116018. /* harmony import */ var _matchesProperty_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./matchesProperty.js */ "./node_modules/lodash-es/matchesProperty.js");
  116019. /* harmony import */ var _method_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./method.js */ "./node_modules/lodash-es/method.js");
  116020. /* harmony import */ var _methodOf_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./methodOf.js */ "./node_modules/lodash-es/methodOf.js");
  116021. /* harmony import */ var _mixin_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./mixin.js */ "./node_modules/lodash-es/mixin.js");
  116022. /* harmony import */ var _noop_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./noop.js */ "./node_modules/lodash-es/noop.js");
  116023. /* harmony import */ var _nthArg_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./nthArg.js */ "./node_modules/lodash-es/nthArg.js");
  116024. /* harmony import */ var _over_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./over.js */ "./node_modules/lodash-es/over.js");
  116025. /* harmony import */ var _overEvery_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./overEvery.js */ "./node_modules/lodash-es/overEvery.js");
  116026. /* harmony import */ var _overSome_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./overSome.js */ "./node_modules/lodash-es/overSome.js");
  116027. /* harmony import */ var _property_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./property.js */ "./node_modules/lodash-es/property.js");
  116028. /* harmony import */ var _propertyOf_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./propertyOf.js */ "./node_modules/lodash-es/propertyOf.js");
  116029. /* harmony import */ var _range_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./range.js */ "./node_modules/lodash-es/range.js");
  116030. /* harmony import */ var _rangeRight_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./rangeRight.js */ "./node_modules/lodash-es/rangeRight.js");
  116031. /* harmony import */ var _stubArray_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./stubArray.js */ "./node_modules/lodash-es/stubArray.js");
  116032. /* harmony import */ var _stubFalse_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./stubFalse.js */ "./node_modules/lodash-es/stubFalse.js");
  116033. /* harmony import */ var _stubObject_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./stubObject.js */ "./node_modules/lodash-es/stubObject.js");
  116034. /* harmony import */ var _stubString_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./stubString.js */ "./node_modules/lodash-es/stubString.js");
  116035. /* harmony import */ var _stubTrue_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./stubTrue.js */ "./node_modules/lodash-es/stubTrue.js");
  116036. /* harmony import */ var _times_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./times.js */ "./node_modules/lodash-es/times.js");
  116037. /* harmony import */ var _toPath_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./toPath.js */ "./node_modules/lodash-es/toPath.js");
  116038. /* harmony import */ var _uniqueId_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./uniqueId.js */ "./node_modules/lodash-es/uniqueId.js");
  116039. /* harmony default export */ __webpack_exports__["default"] = ({
  116040. attempt: _attempt_js__WEBPACK_IMPORTED_MODULE_0__["default"], bindAll: _bindAll_js__WEBPACK_IMPORTED_MODULE_1__["default"], cond: _cond_js__WEBPACK_IMPORTED_MODULE_2__["default"], conforms: _conforms_js__WEBPACK_IMPORTED_MODULE_3__["default"], constant: _constant_js__WEBPACK_IMPORTED_MODULE_4__["default"],
  116041. defaultTo: _defaultTo_js__WEBPACK_IMPORTED_MODULE_5__["default"], flow: _flow_js__WEBPACK_IMPORTED_MODULE_6__["default"], flowRight: _flowRight_js__WEBPACK_IMPORTED_MODULE_7__["default"], identity: _identity_js__WEBPACK_IMPORTED_MODULE_8__["default"], iteratee: _iteratee_js__WEBPACK_IMPORTED_MODULE_9__["default"],
  116042. matches: _matches_js__WEBPACK_IMPORTED_MODULE_10__["default"], matchesProperty: _matchesProperty_js__WEBPACK_IMPORTED_MODULE_11__["default"], method: _method_js__WEBPACK_IMPORTED_MODULE_12__["default"], methodOf: _methodOf_js__WEBPACK_IMPORTED_MODULE_13__["default"], mixin: _mixin_js__WEBPACK_IMPORTED_MODULE_14__["default"],
  116043. noop: _noop_js__WEBPACK_IMPORTED_MODULE_15__["default"], nthArg: _nthArg_js__WEBPACK_IMPORTED_MODULE_16__["default"], over: _over_js__WEBPACK_IMPORTED_MODULE_17__["default"], overEvery: _overEvery_js__WEBPACK_IMPORTED_MODULE_18__["default"], overSome: _overSome_js__WEBPACK_IMPORTED_MODULE_19__["default"],
  116044. property: _property_js__WEBPACK_IMPORTED_MODULE_20__["default"], propertyOf: _propertyOf_js__WEBPACK_IMPORTED_MODULE_21__["default"], range: _range_js__WEBPACK_IMPORTED_MODULE_22__["default"], rangeRight: _rangeRight_js__WEBPACK_IMPORTED_MODULE_23__["default"], stubArray: _stubArray_js__WEBPACK_IMPORTED_MODULE_24__["default"],
  116045. stubFalse: _stubFalse_js__WEBPACK_IMPORTED_MODULE_25__["default"], stubObject: _stubObject_js__WEBPACK_IMPORTED_MODULE_26__["default"], stubString: _stubString_js__WEBPACK_IMPORTED_MODULE_27__["default"], stubTrue: _stubTrue_js__WEBPACK_IMPORTED_MODULE_28__["default"], times: _times_js__WEBPACK_IMPORTED_MODULE_29__["default"],
  116046. toPath: _toPath_js__WEBPACK_IMPORTED_MODULE_30__["default"], uniqueId: _uniqueId_js__WEBPACK_IMPORTED_MODULE_31__["default"]
  116047. });
  116048. /***/ }),
  116049. /***/ "./node_modules/lodash-es/util.js":
  116050. /*!****************************************!*\
  116051. !*** ./node_modules/lodash-es/util.js ***!
  116052. \****************************************/
  116053. /*! exports provided: attempt, bindAll, cond, conforms, constant, defaultTo, flow, flowRight, identity, iteratee, matches, matchesProperty, method, methodOf, mixin, noop, nthArg, over, overEvery, overSome, property, propertyOf, range, rangeRight, stubArray, stubFalse, stubObject, stubString, stubTrue, times, toPath, uniqueId, default */
  116054. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116055. "use strict";
  116056. __webpack_require__.r(__webpack_exports__);
  116057. /* harmony import */ var _attempt_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./attempt.js */ "./node_modules/lodash-es/attempt.js");
  116058. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "attempt", function() { return _attempt_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  116059. /* harmony import */ var _bindAll_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bindAll.js */ "./node_modules/lodash-es/bindAll.js");
  116060. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bindAll", function() { return _bindAll_js__WEBPACK_IMPORTED_MODULE_1__["default"]; });
  116061. /* harmony import */ var _cond_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cond.js */ "./node_modules/lodash-es/cond.js");
  116062. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cond", function() { return _cond_js__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  116063. /* harmony import */ var _conforms_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./conforms.js */ "./node_modules/lodash-es/conforms.js");
  116064. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "conforms", function() { return _conforms_js__WEBPACK_IMPORTED_MODULE_3__["default"]; });
  116065. /* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./constant.js */ "./node_modules/lodash-es/constant.js");
  116066. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "constant", function() { return _constant_js__WEBPACK_IMPORTED_MODULE_4__["default"]; });
  116067. /* harmony import */ var _defaultTo_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./defaultTo.js */ "./node_modules/lodash-es/defaultTo.js");
  116068. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultTo", function() { return _defaultTo_js__WEBPACK_IMPORTED_MODULE_5__["default"]; });
  116069. /* harmony import */ var _flow_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./flow.js */ "./node_modules/lodash-es/flow.js");
  116070. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flow", function() { return _flow_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
  116071. /* harmony import */ var _flowRight_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./flowRight.js */ "./node_modules/lodash-es/flowRight.js");
  116072. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flowRight", function() { return _flowRight_js__WEBPACK_IMPORTED_MODULE_7__["default"]; });
  116073. /* harmony import */ var _identity_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./identity.js */ "./node_modules/lodash-es/identity.js");
  116074. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return _identity_js__WEBPACK_IMPORTED_MODULE_8__["default"]; });
  116075. /* harmony import */ var _iteratee_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./iteratee.js */ "./node_modules/lodash-es/iteratee.js");
  116076. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "iteratee", function() { return _iteratee_js__WEBPACK_IMPORTED_MODULE_9__["default"]; });
  116077. /* harmony import */ var _matches_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./matches.js */ "./node_modules/lodash-es/matches.js");
  116078. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "matches", function() { return _matches_js__WEBPACK_IMPORTED_MODULE_10__["default"]; });
  116079. /* harmony import */ var _matchesProperty_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./matchesProperty.js */ "./node_modules/lodash-es/matchesProperty.js");
  116080. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "matchesProperty", function() { return _matchesProperty_js__WEBPACK_IMPORTED_MODULE_11__["default"]; });
  116081. /* harmony import */ var _method_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./method.js */ "./node_modules/lodash-es/method.js");
  116082. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "method", function() { return _method_js__WEBPACK_IMPORTED_MODULE_12__["default"]; });
  116083. /* harmony import */ var _methodOf_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./methodOf.js */ "./node_modules/lodash-es/methodOf.js");
  116084. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "methodOf", function() { return _methodOf_js__WEBPACK_IMPORTED_MODULE_13__["default"]; });
  116085. /* harmony import */ var _mixin_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./mixin.js */ "./node_modules/lodash-es/mixin.js");
  116086. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mixin", function() { return _mixin_js__WEBPACK_IMPORTED_MODULE_14__["default"]; });
  116087. /* harmony import */ var _noop_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./noop.js */ "./node_modules/lodash-es/noop.js");
  116088. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return _noop_js__WEBPACK_IMPORTED_MODULE_15__["default"]; });
  116089. /* harmony import */ var _nthArg_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./nthArg.js */ "./node_modules/lodash-es/nthArg.js");
  116090. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "nthArg", function() { return _nthArg_js__WEBPACK_IMPORTED_MODULE_16__["default"]; });
  116091. /* harmony import */ var _over_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./over.js */ "./node_modules/lodash-es/over.js");
  116092. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "over", function() { return _over_js__WEBPACK_IMPORTED_MODULE_17__["default"]; });
  116093. /* harmony import */ var _overEvery_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./overEvery.js */ "./node_modules/lodash-es/overEvery.js");
  116094. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "overEvery", function() { return _overEvery_js__WEBPACK_IMPORTED_MODULE_18__["default"]; });
  116095. /* harmony import */ var _overSome_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./overSome.js */ "./node_modules/lodash-es/overSome.js");
  116096. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "overSome", function() { return _overSome_js__WEBPACK_IMPORTED_MODULE_19__["default"]; });
  116097. /* harmony import */ var _property_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./property.js */ "./node_modules/lodash-es/property.js");
  116098. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "property", function() { return _property_js__WEBPACK_IMPORTED_MODULE_20__["default"]; });
  116099. /* harmony import */ var _propertyOf_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./propertyOf.js */ "./node_modules/lodash-es/propertyOf.js");
  116100. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "propertyOf", function() { return _propertyOf_js__WEBPACK_IMPORTED_MODULE_21__["default"]; });
  116101. /* harmony import */ var _range_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./range.js */ "./node_modules/lodash-es/range.js");
  116102. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "range", function() { return _range_js__WEBPACK_IMPORTED_MODULE_22__["default"]; });
  116103. /* harmony import */ var _rangeRight_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./rangeRight.js */ "./node_modules/lodash-es/rangeRight.js");
  116104. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rangeRight", function() { return _rangeRight_js__WEBPACK_IMPORTED_MODULE_23__["default"]; });
  116105. /* harmony import */ var _stubArray_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./stubArray.js */ "./node_modules/lodash-es/stubArray.js");
  116106. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubArray", function() { return _stubArray_js__WEBPACK_IMPORTED_MODULE_24__["default"]; });
  116107. /* harmony import */ var _stubFalse_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./stubFalse.js */ "./node_modules/lodash-es/stubFalse.js");
  116108. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubFalse", function() { return _stubFalse_js__WEBPACK_IMPORTED_MODULE_25__["default"]; });
  116109. /* harmony import */ var _stubObject_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./stubObject.js */ "./node_modules/lodash-es/stubObject.js");
  116110. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubObject", function() { return _stubObject_js__WEBPACK_IMPORTED_MODULE_26__["default"]; });
  116111. /* harmony import */ var _stubString_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./stubString.js */ "./node_modules/lodash-es/stubString.js");
  116112. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubString", function() { return _stubString_js__WEBPACK_IMPORTED_MODULE_27__["default"]; });
  116113. /* harmony import */ var _stubTrue_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./stubTrue.js */ "./node_modules/lodash-es/stubTrue.js");
  116114. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "stubTrue", function() { return _stubTrue_js__WEBPACK_IMPORTED_MODULE_28__["default"]; });
  116115. /* harmony import */ var _times_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./times.js */ "./node_modules/lodash-es/times.js");
  116116. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "times", function() { return _times_js__WEBPACK_IMPORTED_MODULE_29__["default"]; });
  116117. /* harmony import */ var _toPath_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./toPath.js */ "./node_modules/lodash-es/toPath.js");
  116118. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toPath", function() { return _toPath_js__WEBPACK_IMPORTED_MODULE_30__["default"]; });
  116119. /* harmony import */ var _uniqueId_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./uniqueId.js */ "./node_modules/lodash-es/uniqueId.js");
  116120. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uniqueId", function() { return _uniqueId_js__WEBPACK_IMPORTED_MODULE_31__["default"]; });
  116121. /* harmony import */ var _util_default_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./util.default.js */ "./node_modules/lodash-es/util.default.js");
  116122. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _util_default_js__WEBPACK_IMPORTED_MODULE_32__["default"]; });
  116123. /***/ }),
  116124. /***/ "./node_modules/lodash-es/value.js":
  116125. /*!*****************************************!*\
  116126. !*** ./node_modules/lodash-es/value.js ***!
  116127. \*****************************************/
  116128. /*! exports provided: default */
  116129. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116130. "use strict";
  116131. __webpack_require__.r(__webpack_exports__);
  116132. /* harmony import */ var _wrapperValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrapperValue.js */ "./node_modules/lodash-es/wrapperValue.js");
  116133. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _wrapperValue_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  116134. /***/ }),
  116135. /***/ "./node_modules/lodash-es/valueOf.js":
  116136. /*!*******************************************!*\
  116137. !*** ./node_modules/lodash-es/valueOf.js ***!
  116138. \*******************************************/
  116139. /*! exports provided: default */
  116140. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116141. "use strict";
  116142. __webpack_require__.r(__webpack_exports__);
  116143. /* harmony import */ var _wrapperValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wrapperValue.js */ "./node_modules/lodash-es/wrapperValue.js");
  116144. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _wrapperValue_js__WEBPACK_IMPORTED_MODULE_0__["default"]; });
  116145. /***/ }),
  116146. /***/ "./node_modules/lodash-es/values.js":
  116147. /*!******************************************!*\
  116148. !*** ./node_modules/lodash-es/values.js ***!
  116149. \******************************************/
  116150. /*! exports provided: default */
  116151. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116152. "use strict";
  116153. __webpack_require__.r(__webpack_exports__);
  116154. /* harmony import */ var _baseValues_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseValues.js */ "./node_modules/lodash-es/_baseValues.js");
  116155. /* harmony import */ var _keys_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys.js */ "./node_modules/lodash-es/keys.js");
  116156. /**
  116157. * Creates an array of the own enumerable string keyed property values of `object`.
  116158. *
  116159. * **Note:** Non-object values are coerced to objects.
  116160. *
  116161. * @static
  116162. * @since 0.1.0
  116163. * @memberOf _
  116164. * @category Object
  116165. * @param {Object} object The object to query.
  116166. * @returns {Array} Returns the array of property values.
  116167. * @example
  116168. *
  116169. * function Foo() {
  116170. * this.a = 1;
  116171. * this.b = 2;
  116172. * }
  116173. *
  116174. * Foo.prototype.c = 3;
  116175. *
  116176. * _.values(new Foo);
  116177. * // => [1, 2] (iteration order is not guaranteed)
  116178. *
  116179. * _.values('hi');
  116180. * // => ['h', 'i']
  116181. */
  116182. function values(object) {
  116183. return object == null ? [] : Object(_baseValues_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_keys_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object));
  116184. }
  116185. /* harmony default export */ __webpack_exports__["default"] = (values);
  116186. /***/ }),
  116187. /***/ "./node_modules/lodash-es/valuesIn.js":
  116188. /*!********************************************!*\
  116189. !*** ./node_modules/lodash-es/valuesIn.js ***!
  116190. \********************************************/
  116191. /*! exports provided: default */
  116192. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116193. "use strict";
  116194. __webpack_require__.r(__webpack_exports__);
  116195. /* harmony import */ var _baseValues_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseValues.js */ "./node_modules/lodash-es/_baseValues.js");
  116196. /* harmony import */ var _keysIn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keysIn.js */ "./node_modules/lodash-es/keysIn.js");
  116197. /**
  116198. * Creates an array of the own and inherited enumerable string keyed property
  116199. * values of `object`.
  116200. *
  116201. * **Note:** Non-object values are coerced to objects.
  116202. *
  116203. * @static
  116204. * @memberOf _
  116205. * @since 3.0.0
  116206. * @category Object
  116207. * @param {Object} object The object to query.
  116208. * @returns {Array} Returns the array of property values.
  116209. * @example
  116210. *
  116211. * function Foo() {
  116212. * this.a = 1;
  116213. * this.b = 2;
  116214. * }
  116215. *
  116216. * Foo.prototype.c = 3;
  116217. *
  116218. * _.valuesIn(new Foo);
  116219. * // => [1, 2, 3] (iteration order is not guaranteed)
  116220. */
  116221. function valuesIn(object) {
  116222. return object == null ? [] : Object(_baseValues_js__WEBPACK_IMPORTED_MODULE_0__["default"])(object, Object(_keysIn_js__WEBPACK_IMPORTED_MODULE_1__["default"])(object));
  116223. }
  116224. /* harmony default export */ __webpack_exports__["default"] = (valuesIn);
  116225. /***/ }),
  116226. /***/ "./node_modules/lodash-es/without.js":
  116227. /*!*******************************************!*\
  116228. !*** ./node_modules/lodash-es/without.js ***!
  116229. \*******************************************/
  116230. /*! exports provided: default */
  116231. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116232. "use strict";
  116233. __webpack_require__.r(__webpack_exports__);
  116234. /* harmony import */ var _baseDifference_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseDifference.js */ "./node_modules/lodash-es/_baseDifference.js");
  116235. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  116236. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  116237. /**
  116238. * Creates an array excluding all given values using
  116239. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  116240. * for equality comparisons.
  116241. *
  116242. * **Note:** Unlike `_.pull`, this method returns a new array.
  116243. *
  116244. * @static
  116245. * @memberOf _
  116246. * @since 0.1.0
  116247. * @category Array
  116248. * @param {Array} array The array to inspect.
  116249. * @param {...*} [values] The values to exclude.
  116250. * @returns {Array} Returns the new array of filtered values.
  116251. * @see _.difference, _.xor
  116252. * @example
  116253. *
  116254. * _.without([2, 1, 2, 3], 1, 2);
  116255. * // => [3]
  116256. */
  116257. var without = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(array, values) {
  116258. return Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_2__["default"])(array)
  116259. ? Object(_baseDifference_js__WEBPACK_IMPORTED_MODULE_0__["default"])(array, values)
  116260. : [];
  116261. });
  116262. /* harmony default export */ __webpack_exports__["default"] = (without);
  116263. /***/ }),
  116264. /***/ "./node_modules/lodash-es/words.js":
  116265. /*!*****************************************!*\
  116266. !*** ./node_modules/lodash-es/words.js ***!
  116267. \*****************************************/
  116268. /*! exports provided: default */
  116269. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116270. "use strict";
  116271. __webpack_require__.r(__webpack_exports__);
  116272. /* harmony import */ var _asciiWords_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_asciiWords.js */ "./node_modules/lodash-es/_asciiWords.js");
  116273. /* harmony import */ var _hasUnicodeWord_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_hasUnicodeWord.js */ "./node_modules/lodash-es/_hasUnicodeWord.js");
  116274. /* harmony import */ var _toString_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toString.js */ "./node_modules/lodash-es/toString.js");
  116275. /* harmony import */ var _unicodeWords_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_unicodeWords.js */ "./node_modules/lodash-es/_unicodeWords.js");
  116276. /**
  116277. * Splits `string` into an array of its words.
  116278. *
  116279. * @static
  116280. * @memberOf _
  116281. * @since 3.0.0
  116282. * @category String
  116283. * @param {string} [string=''] The string to inspect.
  116284. * @param {RegExp|string} [pattern] The pattern to match words.
  116285. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  116286. * @returns {Array} Returns the words of `string`.
  116287. * @example
  116288. *
  116289. * _.words('fred, barney, & pebbles');
  116290. * // => ['fred', 'barney', 'pebbles']
  116291. *
  116292. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  116293. * // => ['fred', 'barney', '&', 'pebbles']
  116294. */
  116295. function words(string, pattern, guard) {
  116296. string = Object(_toString_js__WEBPACK_IMPORTED_MODULE_2__["default"])(string);
  116297. pattern = guard ? undefined : pattern;
  116298. if (pattern === undefined) {
  116299. return Object(_hasUnicodeWord_js__WEBPACK_IMPORTED_MODULE_1__["default"])(string) ? Object(_unicodeWords_js__WEBPACK_IMPORTED_MODULE_3__["default"])(string) : Object(_asciiWords_js__WEBPACK_IMPORTED_MODULE_0__["default"])(string);
  116300. }
  116301. return string.match(pattern) || [];
  116302. }
  116303. /* harmony default export */ __webpack_exports__["default"] = (words);
  116304. /***/ }),
  116305. /***/ "./node_modules/lodash-es/wrap.js":
  116306. /*!****************************************!*\
  116307. !*** ./node_modules/lodash-es/wrap.js ***!
  116308. \****************************************/
  116309. /*! exports provided: default */
  116310. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116311. "use strict";
  116312. __webpack_require__.r(__webpack_exports__);
  116313. /* harmony import */ var _castFunction_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_castFunction.js */ "./node_modules/lodash-es/_castFunction.js");
  116314. /* harmony import */ var _partial_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./partial.js */ "./node_modules/lodash-es/partial.js");
  116315. /**
  116316. * Creates a function that provides `value` to `wrapper` as its first
  116317. * argument. Any additional arguments provided to the function are appended
  116318. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  116319. * binding of the created function.
  116320. *
  116321. * @static
  116322. * @memberOf _
  116323. * @since 0.1.0
  116324. * @category Function
  116325. * @param {*} value The value to wrap.
  116326. * @param {Function} [wrapper=identity] The wrapper function.
  116327. * @returns {Function} Returns the new function.
  116328. * @example
  116329. *
  116330. * var p = _.wrap(_.escape, function(func, text) {
  116331. * return '<p>' + func(text) + '</p>';
  116332. * });
  116333. *
  116334. * p('fred, barney, & pebbles');
  116335. * // => '<p>fred, barney, &amp; pebbles</p>'
  116336. */
  116337. function wrap(value, wrapper) {
  116338. return Object(_partial_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Object(_castFunction_js__WEBPACK_IMPORTED_MODULE_0__["default"])(wrapper), value);
  116339. }
  116340. /* harmony default export */ __webpack_exports__["default"] = (wrap);
  116341. /***/ }),
  116342. /***/ "./node_modules/lodash-es/wrapperAt.js":
  116343. /*!*********************************************!*\
  116344. !*** ./node_modules/lodash-es/wrapperAt.js ***!
  116345. \*********************************************/
  116346. /*! exports provided: default */
  116347. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116348. "use strict";
  116349. __webpack_require__.r(__webpack_exports__);
  116350. /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
  116351. /* harmony import */ var _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_LodashWrapper.js */ "./node_modules/lodash-es/_LodashWrapper.js");
  116352. /* harmony import */ var _baseAt_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseAt.js */ "./node_modules/lodash-es/_baseAt.js");
  116353. /* harmony import */ var _flatRest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_flatRest.js */ "./node_modules/lodash-es/_flatRest.js");
  116354. /* harmony import */ var _isIndex_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_isIndex.js */ "./node_modules/lodash-es/_isIndex.js");
  116355. /* harmony import */ var _thru_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./thru.js */ "./node_modules/lodash-es/thru.js");
  116356. /**
  116357. * This method is the wrapper version of `_.at`.
  116358. *
  116359. * @name at
  116360. * @memberOf _
  116361. * @since 1.0.0
  116362. * @category Seq
  116363. * @param {...(string|string[])} [paths] The property paths to pick.
  116364. * @returns {Object} Returns the new `lodash` wrapper instance.
  116365. * @example
  116366. *
  116367. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  116368. *
  116369. * _(object).at(['a[0].b.c', 'a[1]']).value();
  116370. * // => [3, 4]
  116371. */
  116372. var wrapperAt = Object(_flatRest_js__WEBPACK_IMPORTED_MODULE_3__["default"])(function(paths) {
  116373. var length = paths.length,
  116374. start = length ? paths[0] : 0,
  116375. value = this.__wrapped__,
  116376. interceptor = function(object) { return Object(_baseAt_js__WEBPACK_IMPORTED_MODULE_2__["default"])(object, paths); };
  116377. if (length > 1 || this.__actions__.length ||
  116378. !(value instanceof _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"]) || !Object(_isIndex_js__WEBPACK_IMPORTED_MODULE_4__["default"])(start)) {
  116379. return this.thru(interceptor);
  116380. }
  116381. value = value.slice(start, +start + (length ? 1 : 0));
  116382. value.__actions__.push({
  116383. 'func': _thru_js__WEBPACK_IMPORTED_MODULE_5__["default"],
  116384. 'args': [interceptor],
  116385. 'thisArg': undefined
  116386. });
  116387. return new _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__["default"](value, this.__chain__).thru(function(array) {
  116388. if (length && !array.length) {
  116389. array.push(undefined);
  116390. }
  116391. return array;
  116392. });
  116393. });
  116394. /* harmony default export */ __webpack_exports__["default"] = (wrapperAt);
  116395. /***/ }),
  116396. /***/ "./node_modules/lodash-es/wrapperChain.js":
  116397. /*!************************************************!*\
  116398. !*** ./node_modules/lodash-es/wrapperChain.js ***!
  116399. \************************************************/
  116400. /*! exports provided: default */
  116401. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116402. "use strict";
  116403. __webpack_require__.r(__webpack_exports__);
  116404. /* harmony import */ var _chain_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./chain.js */ "./node_modules/lodash-es/chain.js");
  116405. /**
  116406. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  116407. *
  116408. * @name chain
  116409. * @memberOf _
  116410. * @since 0.1.0
  116411. * @category Seq
  116412. * @returns {Object} Returns the new `lodash` wrapper instance.
  116413. * @example
  116414. *
  116415. * var users = [
  116416. * { 'user': 'barney', 'age': 36 },
  116417. * { 'user': 'fred', 'age': 40 }
  116418. * ];
  116419. *
  116420. * // A sequence without explicit chaining.
  116421. * _(users).head();
  116422. * // => { 'user': 'barney', 'age': 36 }
  116423. *
  116424. * // A sequence with explicit chaining.
  116425. * _(users)
  116426. * .chain()
  116427. * .head()
  116428. * .pick('user')
  116429. * .value();
  116430. * // => { 'user': 'barney' }
  116431. */
  116432. function wrapperChain() {
  116433. return Object(_chain_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this);
  116434. }
  116435. /* harmony default export */ __webpack_exports__["default"] = (wrapperChain);
  116436. /***/ }),
  116437. /***/ "./node_modules/lodash-es/wrapperLodash.js":
  116438. /*!*************************************************!*\
  116439. !*** ./node_modules/lodash-es/wrapperLodash.js ***!
  116440. \*************************************************/
  116441. /*! exports provided: default */
  116442. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116443. "use strict";
  116444. __webpack_require__.r(__webpack_exports__);
  116445. /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
  116446. /* harmony import */ var _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_LodashWrapper.js */ "./node_modules/lodash-es/_LodashWrapper.js");
  116447. /* harmony import */ var _baseLodash_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseLodash.js */ "./node_modules/lodash-es/_baseLodash.js");
  116448. /* harmony import */ var _isArray_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArray.js */ "./node_modules/lodash-es/isArray.js");
  116449. /* harmony import */ var _isObjectLike_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isObjectLike.js */ "./node_modules/lodash-es/isObjectLike.js");
  116450. /* harmony import */ var _wrapperClone_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_wrapperClone.js */ "./node_modules/lodash-es/_wrapperClone.js");
  116451. /** Used for built-in method references. */
  116452. var objectProto = Object.prototype;
  116453. /** Used to check objects for own properties. */
  116454. var hasOwnProperty = objectProto.hasOwnProperty;
  116455. /**
  116456. * Creates a `lodash` object which wraps `value` to enable implicit method
  116457. * chain sequences. Methods that operate on and return arrays, collections,
  116458. * and functions can be chained together. Methods that retrieve a single value
  116459. * or may return a primitive value will automatically end the chain sequence
  116460. * and return the unwrapped value. Otherwise, the value must be unwrapped
  116461. * with `_#value`.
  116462. *
  116463. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  116464. * enabled using `_.chain`.
  116465. *
  116466. * The execution of chained methods is lazy, that is, it's deferred until
  116467. * `_#value` is implicitly or explicitly called.
  116468. *
  116469. * Lazy evaluation allows several methods to support shortcut fusion.
  116470. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  116471. * the creation of intermediate arrays and can greatly reduce the number of
  116472. * iteratee executions. Sections of a chain sequence qualify for shortcut
  116473. * fusion if the section is applied to an array and iteratees accept only
  116474. * one argument. The heuristic for whether a section qualifies for shortcut
  116475. * fusion is subject to change.
  116476. *
  116477. * Chaining is supported in custom builds as long as the `_#value` method is
  116478. * directly or indirectly included in the build.
  116479. *
  116480. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  116481. *
  116482. * The wrapper `Array` methods are:
  116483. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  116484. *
  116485. * The wrapper `String` methods are:
  116486. * `replace` and `split`
  116487. *
  116488. * The wrapper methods that support shortcut fusion are:
  116489. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  116490. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  116491. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  116492. *
  116493. * The chainable wrapper methods are:
  116494. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  116495. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  116496. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  116497. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  116498. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  116499. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  116500. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  116501. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  116502. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  116503. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  116504. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  116505. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  116506. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  116507. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  116508. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  116509. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  116510. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  116511. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  116512. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  116513. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  116514. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  116515. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  116516. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  116517. * `zipObject`, `zipObjectDeep`, and `zipWith`
  116518. *
  116519. * The wrapper methods that are **not** chainable by default are:
  116520. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  116521. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  116522. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  116523. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  116524. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  116525. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  116526. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  116527. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  116528. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  116529. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  116530. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  116531. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  116532. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  116533. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  116534. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  116535. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  116536. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  116537. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  116538. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  116539. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  116540. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  116541. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  116542. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  116543. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  116544. * `upperFirst`, `value`, and `words`
  116545. *
  116546. * @name _
  116547. * @constructor
  116548. * @category Seq
  116549. * @param {*} value The value to wrap in a `lodash` instance.
  116550. * @returns {Object} Returns the new `lodash` wrapper instance.
  116551. * @example
  116552. *
  116553. * function square(n) {
  116554. * return n * n;
  116555. * }
  116556. *
  116557. * var wrapped = _([1, 2, 3]);
  116558. *
  116559. * // Returns an unwrapped value.
  116560. * wrapped.reduce(_.add);
  116561. * // => 6
  116562. *
  116563. * // Returns a wrapped value.
  116564. * var squares = wrapped.map(square);
  116565. *
  116566. * _.isArray(squares);
  116567. * // => false
  116568. *
  116569. * _.isArray(squares.value());
  116570. * // => true
  116571. */
  116572. function lodash(value) {
  116573. if (Object(_isObjectLike_js__WEBPACK_IMPORTED_MODULE_4__["default"])(value) && !Object(_isArray_js__WEBPACK_IMPORTED_MODULE_3__["default"])(value) && !(value instanceof _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"])) {
  116574. if (value instanceof _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__["default"]) {
  116575. return value;
  116576. }
  116577. if (hasOwnProperty.call(value, '__wrapped__')) {
  116578. return Object(_wrapperClone_js__WEBPACK_IMPORTED_MODULE_5__["default"])(value);
  116579. }
  116580. }
  116581. return new _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__["default"](value);
  116582. }
  116583. // Ensure wrappers are instances of `baseLodash`.
  116584. lodash.prototype = _baseLodash_js__WEBPACK_IMPORTED_MODULE_2__["default"].prototype;
  116585. lodash.prototype.constructor = lodash;
  116586. /* harmony default export */ __webpack_exports__["default"] = (lodash);
  116587. /***/ }),
  116588. /***/ "./node_modules/lodash-es/wrapperReverse.js":
  116589. /*!**************************************************!*\
  116590. !*** ./node_modules/lodash-es/wrapperReverse.js ***!
  116591. \**************************************************/
  116592. /*! exports provided: default */
  116593. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116594. "use strict";
  116595. __webpack_require__.r(__webpack_exports__);
  116596. /* harmony import */ var _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_LazyWrapper.js */ "./node_modules/lodash-es/_LazyWrapper.js");
  116597. /* harmony import */ var _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_LodashWrapper.js */ "./node_modules/lodash-es/_LodashWrapper.js");
  116598. /* harmony import */ var _reverse_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./reverse.js */ "./node_modules/lodash-es/reverse.js");
  116599. /* harmony import */ var _thru_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./thru.js */ "./node_modules/lodash-es/thru.js");
  116600. /**
  116601. * This method is the wrapper version of `_.reverse`.
  116602. *
  116603. * **Note:** This method mutates the wrapped array.
  116604. *
  116605. * @name reverse
  116606. * @memberOf _
  116607. * @since 0.1.0
  116608. * @category Seq
  116609. * @returns {Object} Returns the new `lodash` wrapper instance.
  116610. * @example
  116611. *
  116612. * var array = [1, 2, 3];
  116613. *
  116614. * _(array).reverse().value()
  116615. * // => [3, 2, 1]
  116616. *
  116617. * console.log(array);
  116618. * // => [3, 2, 1]
  116619. */
  116620. function wrapperReverse() {
  116621. var value = this.__wrapped__;
  116622. if (value instanceof _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"]) {
  116623. var wrapped = value;
  116624. if (this.__actions__.length) {
  116625. wrapped = new _LazyWrapper_js__WEBPACK_IMPORTED_MODULE_0__["default"](this);
  116626. }
  116627. wrapped = wrapped.reverse();
  116628. wrapped.__actions__.push({
  116629. 'func': _thru_js__WEBPACK_IMPORTED_MODULE_3__["default"],
  116630. 'args': [_reverse_js__WEBPACK_IMPORTED_MODULE_2__["default"]],
  116631. 'thisArg': undefined
  116632. });
  116633. return new _LodashWrapper_js__WEBPACK_IMPORTED_MODULE_1__["default"](wrapped, this.__chain__);
  116634. }
  116635. return this.thru(_reverse_js__WEBPACK_IMPORTED_MODULE_2__["default"]);
  116636. }
  116637. /* harmony default export */ __webpack_exports__["default"] = (wrapperReverse);
  116638. /***/ }),
  116639. /***/ "./node_modules/lodash-es/wrapperValue.js":
  116640. /*!************************************************!*\
  116641. !*** ./node_modules/lodash-es/wrapperValue.js ***!
  116642. \************************************************/
  116643. /*! exports provided: default */
  116644. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116645. "use strict";
  116646. __webpack_require__.r(__webpack_exports__);
  116647. /* harmony import */ var _baseWrapperValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseWrapperValue.js */ "./node_modules/lodash-es/_baseWrapperValue.js");
  116648. /**
  116649. * Executes the chain sequence to resolve the unwrapped value.
  116650. *
  116651. * @name value
  116652. * @memberOf _
  116653. * @since 0.1.0
  116654. * @alias toJSON, valueOf
  116655. * @category Seq
  116656. * @returns {*} Returns the resolved unwrapped value.
  116657. * @example
  116658. *
  116659. * _([1, 2, 3]).value();
  116660. * // => [1, 2, 3]
  116661. */
  116662. function wrapperValue() {
  116663. return Object(_baseWrapperValue_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this.__wrapped__, this.__actions__);
  116664. }
  116665. /* harmony default export */ __webpack_exports__["default"] = (wrapperValue);
  116666. /***/ }),
  116667. /***/ "./node_modules/lodash-es/xor.js":
  116668. /*!***************************************!*\
  116669. !*** ./node_modules/lodash-es/xor.js ***!
  116670. \***************************************/
  116671. /*! exports provided: default */
  116672. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116673. "use strict";
  116674. __webpack_require__.r(__webpack_exports__);
  116675. /* harmony import */ var _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayFilter.js */ "./node_modules/lodash-es/_arrayFilter.js");
  116676. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  116677. /* harmony import */ var _baseXor_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseXor.js */ "./node_modules/lodash-es/_baseXor.js");
  116678. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  116679. /**
  116680. * Creates an array of unique values that is the
  116681. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  116682. * of the given arrays. The order of result values is determined by the order
  116683. * they occur in the arrays.
  116684. *
  116685. * @static
  116686. * @memberOf _
  116687. * @since 2.4.0
  116688. * @category Array
  116689. * @param {...Array} [arrays] The arrays to inspect.
  116690. * @returns {Array} Returns the new array of filtered values.
  116691. * @see _.difference, _.without
  116692. * @example
  116693. *
  116694. * _.xor([2, 1], [2, 3]);
  116695. * // => [1, 3]
  116696. */
  116697. var xor = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(arrays) {
  116698. return Object(_baseXor_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__["default"])(arrays, _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"]));
  116699. });
  116700. /* harmony default export */ __webpack_exports__["default"] = (xor);
  116701. /***/ }),
  116702. /***/ "./node_modules/lodash-es/xorBy.js":
  116703. /*!*****************************************!*\
  116704. !*** ./node_modules/lodash-es/xorBy.js ***!
  116705. \*****************************************/
  116706. /*! exports provided: default */
  116707. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116708. "use strict";
  116709. __webpack_require__.r(__webpack_exports__);
  116710. /* harmony import */ var _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayFilter.js */ "./node_modules/lodash-es/_arrayFilter.js");
  116711. /* harmony import */ var _baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseIteratee.js */ "./node_modules/lodash-es/_baseIteratee.js");
  116712. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  116713. /* harmony import */ var _baseXor_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_baseXor.js */ "./node_modules/lodash-es/_baseXor.js");
  116714. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  116715. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  116716. /**
  116717. * This method is like `_.xor` except that it accepts `iteratee` which is
  116718. * invoked for each element of each `arrays` to generate the criterion by
  116719. * which by which they're compared. The order of result values is determined
  116720. * by the order they occur in the arrays. The iteratee is invoked with one
  116721. * argument: (value).
  116722. *
  116723. * @static
  116724. * @memberOf _
  116725. * @since 4.0.0
  116726. * @category Array
  116727. * @param {...Array} [arrays] The arrays to inspect.
  116728. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  116729. * @returns {Array} Returns the new array of filtered values.
  116730. * @example
  116731. *
  116732. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  116733. * // => [1.2, 3.4]
  116734. *
  116735. * // The `_.property` iteratee shorthand.
  116736. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  116737. * // => [{ 'x': 2 }]
  116738. */
  116739. var xorBy = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_2__["default"])(function(arrays) {
  116740. var iteratee = Object(_last_js__WEBPACK_IMPORTED_MODULE_5__["default"])(arrays);
  116741. if (Object(_isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__["default"])(iteratee)) {
  116742. iteratee = undefined;
  116743. }
  116744. return Object(_baseXor_js__WEBPACK_IMPORTED_MODULE_3__["default"])(Object(_arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__["default"])(arrays, _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_4__["default"]), Object(_baseIteratee_js__WEBPACK_IMPORTED_MODULE_1__["default"])(iteratee, 2));
  116745. });
  116746. /* harmony default export */ __webpack_exports__["default"] = (xorBy);
  116747. /***/ }),
  116748. /***/ "./node_modules/lodash-es/xorWith.js":
  116749. /*!*******************************************!*\
  116750. !*** ./node_modules/lodash-es/xorWith.js ***!
  116751. \*******************************************/
  116752. /*! exports provided: default */
  116753. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116754. "use strict";
  116755. __webpack_require__.r(__webpack_exports__);
  116756. /* harmony import */ var _arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_arrayFilter.js */ "./node_modules/lodash-es/_arrayFilter.js");
  116757. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  116758. /* harmony import */ var _baseXor_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_baseXor.js */ "./node_modules/lodash-es/_baseXor.js");
  116759. /* harmony import */ var _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isArrayLikeObject.js */ "./node_modules/lodash-es/isArrayLikeObject.js");
  116760. /* harmony import */ var _last_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./last.js */ "./node_modules/lodash-es/last.js");
  116761. /**
  116762. * This method is like `_.xor` except that it accepts `comparator` which is
  116763. * invoked to compare elements of `arrays`. The order of result values is
  116764. * determined by the order they occur in the arrays. The comparator is invoked
  116765. * with two arguments: (arrVal, othVal).
  116766. *
  116767. * @static
  116768. * @memberOf _
  116769. * @since 4.0.0
  116770. * @category Array
  116771. * @param {...Array} [arrays] The arrays to inspect.
  116772. * @param {Function} [comparator] The comparator invoked per element.
  116773. * @returns {Array} Returns the new array of filtered values.
  116774. * @example
  116775. *
  116776. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  116777. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  116778. *
  116779. * _.xorWith(objects, others, _.isEqual);
  116780. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  116781. */
  116782. var xorWith = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function(arrays) {
  116783. var comparator = Object(_last_js__WEBPACK_IMPORTED_MODULE_4__["default"])(arrays);
  116784. comparator = typeof comparator == 'function' ? comparator : undefined;
  116785. return Object(_baseXor_js__WEBPACK_IMPORTED_MODULE_2__["default"])(Object(_arrayFilter_js__WEBPACK_IMPORTED_MODULE_0__["default"])(arrays, _isArrayLikeObject_js__WEBPACK_IMPORTED_MODULE_3__["default"]), undefined, comparator);
  116786. });
  116787. /* harmony default export */ __webpack_exports__["default"] = (xorWith);
  116788. /***/ }),
  116789. /***/ "./node_modules/lodash-es/zip.js":
  116790. /*!***************************************!*\
  116791. !*** ./node_modules/lodash-es/zip.js ***!
  116792. \***************************************/
  116793. /*! exports provided: default */
  116794. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116795. "use strict";
  116796. __webpack_require__.r(__webpack_exports__);
  116797. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  116798. /* harmony import */ var _unzip_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./unzip.js */ "./node_modules/lodash-es/unzip.js");
  116799. /**
  116800. * Creates an array of grouped elements, the first of which contains the
  116801. * first elements of the given arrays, the second of which contains the
  116802. * second elements of the given arrays, and so on.
  116803. *
  116804. * @static
  116805. * @memberOf _
  116806. * @since 0.1.0
  116807. * @category Array
  116808. * @param {...Array} [arrays] The arrays to process.
  116809. * @returns {Array} Returns the new array of grouped elements.
  116810. * @example
  116811. *
  116812. * _.zip(['a', 'b'], [1, 2], [true, false]);
  116813. * // => [['a', 1, true], ['b', 2, false]]
  116814. */
  116815. var zip = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_unzip_js__WEBPACK_IMPORTED_MODULE_1__["default"]);
  116816. /* harmony default export */ __webpack_exports__["default"] = (zip);
  116817. /***/ }),
  116818. /***/ "./node_modules/lodash-es/zipObject.js":
  116819. /*!*********************************************!*\
  116820. !*** ./node_modules/lodash-es/zipObject.js ***!
  116821. \*********************************************/
  116822. /*! exports provided: default */
  116823. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116824. "use strict";
  116825. __webpack_require__.r(__webpack_exports__);
  116826. /* harmony import */ var _assignValue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_assignValue.js */ "./node_modules/lodash-es/_assignValue.js");
  116827. /* harmony import */ var _baseZipObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseZipObject.js */ "./node_modules/lodash-es/_baseZipObject.js");
  116828. /**
  116829. * This method is like `_.fromPairs` except that it accepts two arrays,
  116830. * one of property identifiers and one of corresponding values.
  116831. *
  116832. * @static
  116833. * @memberOf _
  116834. * @since 0.4.0
  116835. * @category Array
  116836. * @param {Array} [props=[]] The property identifiers.
  116837. * @param {Array} [values=[]] The property values.
  116838. * @returns {Object} Returns the new object.
  116839. * @example
  116840. *
  116841. * _.zipObject(['a', 'b'], [1, 2]);
  116842. * // => { 'a': 1, 'b': 2 }
  116843. */
  116844. function zipObject(props, values) {
  116845. return Object(_baseZipObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(props || [], values || [], _assignValue_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  116846. }
  116847. /* harmony default export */ __webpack_exports__["default"] = (zipObject);
  116848. /***/ }),
  116849. /***/ "./node_modules/lodash-es/zipObjectDeep.js":
  116850. /*!*************************************************!*\
  116851. !*** ./node_modules/lodash-es/zipObjectDeep.js ***!
  116852. \*************************************************/
  116853. /*! exports provided: default */
  116854. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116855. "use strict";
  116856. __webpack_require__.r(__webpack_exports__);
  116857. /* harmony import */ var _baseSet_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseSet.js */ "./node_modules/lodash-es/_baseSet.js");
  116858. /* harmony import */ var _baseZipObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_baseZipObject.js */ "./node_modules/lodash-es/_baseZipObject.js");
  116859. /**
  116860. * This method is like `_.zipObject` except that it supports property paths.
  116861. *
  116862. * @static
  116863. * @memberOf _
  116864. * @since 4.1.0
  116865. * @category Array
  116866. * @param {Array} [props=[]] The property identifiers.
  116867. * @param {Array} [values=[]] The property values.
  116868. * @returns {Object} Returns the new object.
  116869. * @example
  116870. *
  116871. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  116872. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  116873. */
  116874. function zipObjectDeep(props, values) {
  116875. return Object(_baseZipObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(props || [], values || [], _baseSet_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
  116876. }
  116877. /* harmony default export */ __webpack_exports__["default"] = (zipObjectDeep);
  116878. /***/ }),
  116879. /***/ "./node_modules/lodash-es/zipWith.js":
  116880. /*!*******************************************!*\
  116881. !*** ./node_modules/lodash-es/zipWith.js ***!
  116882. \*******************************************/
  116883. /*! exports provided: default */
  116884. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  116885. "use strict";
  116886. __webpack_require__.r(__webpack_exports__);
  116887. /* harmony import */ var _baseRest_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseRest.js */ "./node_modules/lodash-es/_baseRest.js");
  116888. /* harmony import */ var _unzipWith_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./unzipWith.js */ "./node_modules/lodash-es/unzipWith.js");
  116889. /**
  116890. * This method is like `_.zip` except that it accepts `iteratee` to specify
  116891. * how grouped values should be combined. The iteratee is invoked with the
  116892. * elements of each group: (...group).
  116893. *
  116894. * @static
  116895. * @memberOf _
  116896. * @since 3.8.0
  116897. * @category Array
  116898. * @param {...Array} [arrays] The arrays to process.
  116899. * @param {Function} [iteratee=_.identity] The function to combine
  116900. * grouped values.
  116901. * @returns {Array} Returns the new array of grouped elements.
  116902. * @example
  116903. *
  116904. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  116905. * return a + b + c;
  116906. * });
  116907. * // => [111, 222]
  116908. */
  116909. var zipWith = Object(_baseRest_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function(arrays) {
  116910. var length = arrays.length,
  116911. iteratee = length > 1 ? arrays[length - 1] : undefined;
  116912. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  116913. return Object(_unzipWith_js__WEBPACK_IMPORTED_MODULE_1__["default"])(arrays, iteratee);
  116914. });
  116915. /* harmony default export */ __webpack_exports__["default"] = (zipWith);
  116916. /***/ }),
  116917. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css":
  116918. /*!***********************************************************************************************************************!*\
  116919. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css ***!
  116920. \***********************************************************************************************************************/
  116921. /*! no static exports found */
  116922. /***/ (function(module, exports) {
  116923. module.exports = ".ck-content blockquote{overflow:hidden;padding-right:1.5em;padding-left:1.5em;margin-left:0;margin-right:0;font-style:italic;border-left:5px solid #ccc}.ck-content[dir=rtl] blockquote{border-left:0;border-right:5px solid #ccc}"
  116924. /***/ }),
  116925. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css":
  116926. /*!*****************************************************************************************************************************!*\
  116927. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css ***!
  116928. \*****************************************************************************************************************************/
  116929. /*! no static exports found */
  116930. /***/ (function(module, exports) {
  116931. module.exports = ".ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-modal)}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-bottom-width:0}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar{border-bottom-width:1px;border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:0}.ck.ck-editor__main>.ck-editor__editable{background:var(--ck-color-base-background);border-radius:0}.ck-rounded-corners .ck.ck-editor__main>.ck-editor__editable,.ck.ck-editor__main>.ck-editor__editable.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}.ck.ck-editor__main>.ck-editor__editable:not(.ck-focused){border-color:var(--ck-color-base-border)}"
  116932. /***/ }),
  116933. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css":
  116934. /*!*******************************************************************************************************************!*\
  116935. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css ***!
  116936. \*******************************************************************************************************************/
  116937. /*! no static exports found */
  116938. /***/ (function(module, exports) {
  116939. module.exports = ".ck.ck-placeholder:before,.ck .ck-placeholder:before{content:attr(data-placeholder);pointer-events:none}.ck.ck-read-only .ck-placeholder:before{display:none}.ck.ck-placeholder:before,.ck .ck-placeholder:before{cursor:text;color:var(--ck-color-engine-placeholder-text)}"
  116940. /***/ }),
  116941. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-font/theme/fontcolor.css":
  116942. /*!***************************************************************************************************************!*\
  116943. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-font/theme/fontcolor.css ***!
  116944. \***************************************************************************************************************/
  116945. /*! no static exports found */
  116946. /***/ (function(module, exports) {
  116947. module.exports = ".ck .ck-button.ck-color-table__remove-color{display:flex;align-items:center;width:100%}label.ck.ck-color-grid__label{font-weight:unset}.ck .ck-button.ck-color-table__remove-color{padding:calc(var(--ck-spacing-standard)/2) var(--ck-spacing-standard);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck .ck-button.ck-color-table__remove-color:not(:focus){border-bottom:1px solid var(--ck-color-base-border)}[dir=ltr] .ck .ck-button.ck-color-table__remove-color .ck.ck-icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck .ck-button.ck-color-table__remove-color .ck.ck-icon{margin-left:var(--ck-spacing-standard)}"
  116948. /***/ }),
  116949. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css":
  116950. /*!****************************************************************************************************************!*\
  116951. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css ***!
  116952. \****************************************************************************************************************/
  116953. /*! no static exports found */
  116954. /***/ (function(module, exports) {
  116955. module.exports = ".ck.ck-heading_heading1{font-size:20px}.ck.ck-heading_heading2{font-size:17px}.ck.ck-heading_heading3{font-size:14px}.ck[class*=ck-heading_heading]{font-weight:700}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__button .ck-button__label{width:8em}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__panel .ck-list__item{min-width:18em}"
  116956. /***/ }),
  116957. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/image.css":
  116958. /*!************************************************************************************************************!*\
  116959. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-image/theme/image.css ***!
  116960. \************************************************************************************************************/
  116961. /*! no static exports found */
  116962. /***/ (function(module, exports) {
  116963. module.exports = ".ck-content .image{display:table;clear:both;text-align:center;margin:1em auto}.ck-content .image img{display:block;margin:0 auto;max-width:100%;min-width:50px}"
  116964. /***/ }),
  116965. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imagecaption.css":
  116966. /*!*******************************************************************************************************************!*\
  116967. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-image/theme/imagecaption.css ***!
  116968. \*******************************************************************************************************************/
  116969. /*! no static exports found */
  116970. /***/ (function(module, exports) {
  116971. module.exports = ".ck-content .image>figcaption{display:table-caption;caption-side:bottom;word-break:break-word;color:#333;background-color:#f7f7f7;padding:.6em;font-size:.75em;outline-offset:-1px}"
  116972. /***/ }),
  116973. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imageresize.css":
  116974. /*!******************************************************************************************************************!*\
  116975. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-image/theme/imageresize.css ***!
  116976. \******************************************************************************************************************/
  116977. /*! no static exports found */
  116978. /***/ (function(module, exports) {
  116979. module.exports = ".ck-content .image.image_resized{max-width:100%;display:block;box-sizing:border-box}.ck-content .image.image_resized img{width:100%}.ck-content .image.image_resized>figcaption{display:block}[dir=ltr] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon{margin-left:var(--ck-spacing-standard)}.ck.ck-dropdown .ck-button.ck-resize-image-button .ck-button__label{width:4em}"
  116980. /***/ }),
  116981. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imagestyle.css":
  116982. /*!*****************************************************************************************************************!*\
  116983. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-image/theme/imagestyle.css ***!
  116984. \*****************************************************************************************************************/
  116985. /*! no static exports found */
  116986. /***/ (function(module, exports) {
  116987. module.exports = ":root{--ck-image-style-spacing:1.5em}.ck-content .image-style-side{float:right;margin-left:var(--ck-image-style-spacing);max-width:50%}.ck-content .image-style-align-left{float:left;margin-right:var(--ck-image-style-spacing)}.ck-content .image-style-align-center{margin-left:auto;margin-right:auto}.ck-content .image-style-align-right{float:right;margin-left:var(--ck-image-style-spacing)}"
  116988. /***/ }),
  116989. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css":
  116990. /*!**********************************************************************************************************************!*\
  116991. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css ***!
  116992. \**********************************************************************************************************************/
  116993. /*! no static exports found */
  116994. /***/ (function(module, exports) {
  116995. module.exports = ".ck-image-upload-complete-icon{display:block;position:absolute;top:10px;right:10px;border-radius:50%}.ck-image-upload-complete-icon:after{content:\"\";position:absolute}:root{--ck-color-image-upload-icon:#fff;--ck-color-image-upload-icon-background:#008a00;--ck-image-upload-icon-size:20px;--ck-image-upload-icon-width:2px}.ck-image-upload-complete-icon{width:var(--ck-image-upload-icon-size);height:var(--ck-image-upload-icon-size);opacity:0;background:var(--ck-color-image-upload-icon-background);animation-name:ck-upload-complete-icon-show,ck-upload-complete-icon-hide;animation-fill-mode:forwards,forwards;animation-duration:.5s,.5s;font-size:var(--ck-image-upload-icon-size);animation-delay:0ms,3s}.ck-image-upload-complete-icon:after{left:25%;top:50%;opacity:0;height:0;width:0;transform:scaleX(-1) rotate(135deg);transform-origin:left top;border-top:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);border-right:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);animation-name:ck-upload-complete-icon-check;animation-duration:.5s;animation-delay:.5s;animation-fill-mode:forwards;box-sizing:border-box}@keyframes ck-upload-complete-icon-show{0%{opacity:0}to{opacity:1}}@keyframes ck-upload-complete-icon-hide{0%{opacity:1}to{opacity:0}}@keyframes ck-upload-complete-icon-check{0%{opacity:1;width:0;height:0}33%{width:.3em;height:0}to{opacity:1;width:.3em;height:.45em}}"
  116996. /***/ }),
  116997. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css":
  116998. /*!************************************************************************************************************************!*\
  116999. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css ***!
  117000. \************************************************************************************************************************/
  117001. /*! no static exports found */
  117002. /***/ (function(module, exports) {
  117003. module.exports = ".ck .ck-upload-placeholder-loader{position:absolute;display:flex;align-items:center;justify-content:center;top:0;left:0}.ck .ck-upload-placeholder-loader:before{content:\"\";position:relative}:root{--ck-color-upload-placeholder-loader:#b3b3b3;--ck-upload-placeholder-loader-size:32px}.ck .ck-image-upload-placeholder{width:100%;margin:0}.ck .ck-upload-placeholder-loader{width:100%;height:100%}.ck .ck-upload-placeholder-loader:before{width:var(--ck-upload-placeholder-loader-size);height:var(--ck-upload-placeholder-loader-size);border-radius:50%;border-top:3px solid var(--ck-color-upload-placeholder-loader);border-right:2px solid transparent;animation:ck-upload-placeholder-loader 1s linear infinite}@keyframes ck-upload-placeholder-loader{to{transform:rotate(1turn)}}"
  117004. /***/ }),
  117005. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css":
  117006. /*!**************************************************************************************************************************!*\
  117007. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css ***!
  117008. \**************************************************************************************************************************/
  117009. /*! no static exports found */
  117010. /***/ (function(module, exports) {
  117011. module.exports = ".ck.ck-editor__editable .image{position:relative}.ck.ck-editor__editable .image .ck-progress-bar{position:absolute;top:0;left:0}.ck.ck-editor__editable .image.ck-appear{animation:fadeIn .7s}.ck.ck-editor__editable .image .ck-progress-bar{height:2px;width:0;background:var(--ck-color-upload-bar-background);transition:width .1s}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}"
  117012. /***/ }),
  117013. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css":
  117014. /*!**************************************************************************************************************************!*\
  117015. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css ***!
  117016. \**************************************************************************************************************************/
  117017. /*! no static exports found */
  117018. /***/ (function(module, exports) {
  117019. module.exports = ".ck.ck-text-alternative-form{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-text-alternative-form .ck-labeled-field-view{display:inline-block}.ck.ck-text-alternative-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-text-alternative-form{flex-wrap:wrap}.ck.ck-text-alternative-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-text-alternative-form .ck-button{flex-basis:50%}}"
  117020. /***/ }),
  117021. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-link/theme/link.css":
  117022. /*!**********************************************************************************************************!*\
  117023. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-link/theme/link.css ***!
  117024. \**********************************************************************************************************/
  117025. /*! no static exports found */
  117026. /***/ (function(module, exports) {
  117027. module.exports = ".ck .ck-link_selected{background:var(--ck-color-link-selected-background)}.ck .ck-fake-link-selection{background:var(--ck-color-link-fake-selection)}.ck .ck-fake-link-selection_collapsed{height:100%;border-right:1px solid var(--ck-color-base-text);margin-right:-1px;outline:1px solid hsla(0,0%,100%,.5)}"
  117028. /***/ }),
  117029. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css":
  117030. /*!*****************************************************************************************************************!*\
  117031. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css ***!
  117032. \*****************************************************************************************************************/
  117033. /*! no static exports found */
  117034. /***/ (function(module, exports) {
  117035. module.exports = ".ck.ck-link-actions{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-link-actions .ck-link-actions__preview{display:inline-block}.ck.ck-link-actions .ck-link-actions__preview .ck-button__label{overflow:hidden}@media screen and (max-width:600px){.ck.ck-link-actions{flex-wrap:wrap}.ck.ck-link-actions .ck-link-actions__preview{flex-basis:100%}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){flex-basis:50%}}.ck.ck-link-actions .ck-button.ck-link-actions__preview{padding-left:0;padding-right:0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{padding:0 var(--ck-spacing-medium);color:var(--ck-color-link-default);text-overflow:ellipsis;cursor:pointer;max-width:var(--ck-input-text-width);min-width:3em;text-align:center}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label:hover{text-decoration:underline}.ck.ck-link-actions .ck-button.ck-link-actions__preview,.ck.ck-link-actions .ck-button.ck-link-actions__preview:active,.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus,.ck.ck-link-actions .ck-button.ck-link-actions__preview:hover{background:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:active{box-shadow:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus .ck-button__label{text-decoration:underline}[dir=ltr] .ck.ck-link-actions .ck-button:not(:first-child),[dir=rtl] .ck.ck-link-actions .ck-button:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-link-actions .ck-button.ck-link-actions__preview{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{min-width:0;max-width:100%}[dir=ltr] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview),[dir=rtl] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:0}}"
  117036. /***/ }),
  117037. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-link/theme/linkform.css":
  117038. /*!**************************************************************************************************************!*\
  117039. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-link/theme/linkform.css ***!
  117040. \**************************************************************************************************************/
  117041. /*! no static exports found */
  117042. /***/ (function(module, exports) {
  117043. module.exports = ".ck.ck-link-form{display:flex}.ck.ck-link-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-link-form{flex-wrap:wrap}.ck.ck-link-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-link-form .ck-button{flex-basis:50%}}.ck.ck-link-form_layout-vertical{display:block;padding:0;min-width:var(--ck-input-text-width)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) var(--ck-spacing-small)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-link-form_layout-vertical .ck-button{padding:var(--ck-spacing-standard);margin:0;border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border);width:50%}[dir=ltr] .ck.ck-link-form_layout-vertical .ck-button,[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button{margin-left:0}[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}.ck.ck-link-form_layout-vertical .ck.ck-list{margin-left:0}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton{border:0;width:100%}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton:hover{background:none}"
  117044. /***/ }),
  117045. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-link/theme/linkimage.css":
  117046. /*!***************************************************************************************************************!*\
  117047. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-link/theme/linkimage.css ***!
  117048. \***************************************************************************************************************/
  117049. /*! no static exports found */
  117050. /***/ (function(module, exports) {
  117051. module.exports = ".ck.ck-link-image_icon{position:absolute;top:var(--ck-spacing-medium);right:var(--ck-spacing-medium);width:28px;height:28px;padding:4px;box-sizing:border-box;border-radius:var(--ck-border-radius)}.ck.ck-link-image_icon svg{fill:currentColor}.ck.ck-link-image_icon{color:#fff;background:rgba(0,0,0,.4)}"
  117052. /***/ }),
  117053. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css":
  117054. /*!******************************************************************************************************************!*\
  117055. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css ***!
  117056. \******************************************************************************************************************/
  117057. /*! no static exports found */
  117058. /***/ (function(module, exports) {
  117059. module.exports = ".ck .ck-insert-table-dropdown__grid{display:flex;flex-direction:row;flex-wrap:wrap}:root{--ck-insert-table-dropdown-padding:10px;--ck-insert-table-dropdown-box-height:11px;--ck-insert-table-dropdown-box-width:12px;--ck-insert-table-dropdown-box-margin:1px}.ck .ck-insert-table-dropdown__grid{width:calc(var(--ck-insert-table-dropdown-box-width)*10 + var(--ck-insert-table-dropdown-box-margin)*20 + var(--ck-insert-table-dropdown-padding)*2);padding:var(--ck-insert-table-dropdown-padding) var(--ck-insert-table-dropdown-padding) 0}.ck .ck-insert-table-dropdown__label{text-align:center}.ck .ck-insert-table-dropdown-grid-box{width:var(--ck-insert-table-dropdown-box-width);height:var(--ck-insert-table-dropdown-box-height);margin:var(--ck-insert-table-dropdown-box-margin);border:1px solid var(--ck-color-base-border);border-radius:1px}.ck .ck-insert-table-dropdown-grid-box.ck-on{border-color:var(--ck-color-focus-border);background:var(--ck-color-focus-outer-shadow)}"
  117060. /***/ }),
  117061. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-table/theme/table.css":
  117062. /*!************************************************************************************************************!*\
  117063. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-table/theme/table.css ***!
  117064. \************************************************************************************************************/
  117065. /*! no static exports found */
  117066. /***/ (function(module, exports) {
  117067. module.exports = ".ck-content .table{margin:1em auto;display:table}.ck-content .table table{border-collapse:collapse;border-spacing:0;width:100%;height:100%;border:1px double #b3b3b3}.ck-content .table table td,.ck-content .table table th{min-width:2em;padding:.4em;border:1px solid #bfbfbf}.ck-content .table table th{font-weight:700;background:hsla(0,0%,0%,5%)}.ck-content[dir=rtl] .table th{text-align:right}.ck-content[dir=ltr] .table th{text-align:left}"
  117068. /***/ }),
  117069. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-table/theme/tableediting.css":
  117070. /*!*******************************************************************************************************************!*\
  117071. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-table/theme/tableediting.css ***!
  117072. \*******************************************************************************************************************/
  117073. /*! no static exports found */
  117074. /***/ (function(module, exports) {
  117075. module.exports = ":root{--ck-color-table-focused-cell-background:rgba(158,207,250,0.3)}.ck-widget.table td.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table td.ck-editor__nested-editable:focus,.ck-widget.table th.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table th.ck-editor__nested-editable:focus{background:var(--ck-color-table-focused-cell-background);border-style:none;outline:1px solid var(--ck-color-focus-border);outline-offset:-1px}"
  117076. /***/ }),
  117077. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-table/theme/tableselection.css":
  117078. /*!*********************************************************************************************************************!*\
  117079. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-table/theme/tableselection.css ***!
  117080. \*********************************************************************************************************************/
  117081. /*! no static exports found */
  117082. /***/ (function(module, exports) {
  117083. module.exports = ":root{--ck-table-selected-cell-background:rgba(158,207,250,0.3)}.ck.ck-editor__editable .table table td.ck-editor__editable_selected,.ck.ck-editor__editable .table table th.ck-editor__editable_selected{position:relative;caret-color:transparent;outline:unset;box-shadow:unset}.ck.ck-editor__editable .table table td.ck-editor__editable_selected:after,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:after{content:\"\";pointer-events:none;background-color:var(--ck-table-selected-cell-background);position:absolute;top:0;left:0;right:0;bottom:0}.ck.ck-editor__editable .table table td.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table td.ck-editor__editable_selected:focus,.ck.ck-editor__editable .table table th.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:focus{background-color:transparent}.ck.ck-editor__editable .table table td.ck-editor__editable_selected .ck-widget_selected,.ck.ck-editor__editable .table table th.ck-editor__editable_selected .ck-widget_selected{outline:unset}"
  117084. /***/ }),
  117085. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/button.css":
  117086. /*!****************************************************************************************************************************!*\
  117087. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/button.css ***!
  117088. \****************************************************************************************************************************/
  117089. /*! no static exports found */
  117090. /***/ (function(module, exports) {
  117091. module.exports = ".ck.ck-button,a.ck.ck-button{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:block}@media (hover:none){.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:none}}.ck.ck-button,a.ck.ck-button{position:relative;display:inline-flex;align-items:center;justify-content:left}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{display:none}.ck.ck-button.ck-button_with-text .ck-button__label,a.ck.ck-button.ck-button_with-text .ck-button__label{display:inline-block}.ck.ck-button:not(.ck-button_with-text),a.ck.ck-button:not(.ck-button_with-text){justify-content:center}.ck.ck-button:hover .ck-tooltip,a.ck.ck-button:hover .ck-tooltip{visibility:visible;opacity:1}.ck.ck-button:focus:not(:hover) .ck-tooltip,a.ck.ck-button:focus:not(:hover) .ck-tooltip{display:none}.ck.ck-button,a.ck.ck-button{background:var(--ck-color-button-default-background)}.ck.ck-button:not(.ck-disabled):hover,a.ck.ck-button:not(.ck-disabled):hover{background:var(--ck-color-button-default-hover-background)}.ck.ck-button:not(.ck-disabled):active,a.ck.ck-button:not(.ck-disabled):active{background:var(--ck-color-button-default-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-default-active-shadow)}.ck.ck-button.ck-disabled,a.ck.ck-button.ck-disabled{background:var(--ck-color-button-default-disabled-background)}.ck.ck-button,a.ck.ck-button{border-radius:0}.ck-rounded-corners .ck.ck-button,.ck-rounded-corners a.ck.ck-button,.ck.ck-button.ck-rounded-corners,a.ck.ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-button,a.ck.ck-button{white-space:nowrap;cursor:default;vertical-align:middle;padding:var(--ck-spacing-tiny);text-align:center;min-width:var(--ck-ui-component-min-height);min-height:var(--ck-ui-component-min-height);line-height:1;font-size:inherit;border:1px solid transparent;transition:box-shadow .2s ease-in-out,border .2s ease-in-out;-webkit-appearance:none}.ck.ck-button:active,.ck.ck-button:focus,a.ck.ck-button:active,a.ck.ck-button:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-button .ck-button__icon use,.ck.ck-button .ck-button__icon use *,a.ck.ck-button .ck-button__icon use,a.ck.ck-button .ck-button__icon use *{color:inherit}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{font-size:inherit;font-weight:inherit;color:inherit;cursor:inherit;vertical-align:middle}[dir=ltr] .ck.ck-button .ck-button__label,[dir=ltr] a.ck.ck-button .ck-button__label{text-align:left}[dir=rtl] .ck.ck-button .ck-button__label,[dir=rtl] a.ck.ck-button .ck-button__label{text-align:right}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{color:inherit}[dir=ltr] .ck.ck-button .ck-button__keystroke,[dir=ltr] a.ck.ck-button .ck-button__keystroke{margin-left:var(--ck-spacing-large)}[dir=rtl] .ck.ck-button .ck-button__keystroke,[dir=rtl] a.ck.ck-button .ck-button__keystroke{margin-right:var(--ck-spacing-large)}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{font-weight:700;opacity:.7}.ck.ck-button.ck-disabled:active,.ck.ck-button.ck-disabled:focus,a.ck.ck-button.ck-disabled:active,a.ck.ck-button.ck-disabled:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-button.ck-disabled .ck-button__icon,a.ck.ck-button.ck-disabled .ck-button__icon{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__label,a.ck.ck-button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__keystroke,a.ck.ck-button.ck-disabled .ck-button__keystroke{opacity:.3}.ck.ck-button.ck-button_with-text,a.ck.ck-button.ck-button_with-text{padding:var(--ck-spacing-tiny) var(--ck-spacing-standard)}[dir=ltr] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=ltr] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-left:calc(var(--ck-spacing-small)*-1);margin-right:var(--ck-spacing-small)}[dir=rtl] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=rtl] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-right:calc(var(--ck-spacing-small)*-1);margin-left:var(--ck-spacing-small)}.ck.ck-button.ck-button_with-keystroke .ck-button__label,a.ck.ck-button.ck-button_with-keystroke .ck-button__label{flex-grow:1}.ck.ck-button.ck-on,a.ck.ck-button.ck-on{background:var(--ck-color-button-on-background)}.ck.ck-button.ck-on:not(.ck-disabled):hover,a.ck.ck-button.ck-on:not(.ck-disabled):hover{background:var(--ck-color-button-on-hover-background)}.ck.ck-button.ck-on:not(.ck-disabled):active,a.ck.ck-button.ck-on:not(.ck-disabled):active{background:var(--ck-color-button-on-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-on-active-shadow)}.ck.ck-button.ck-on.ck-disabled,a.ck.ck-button.ck-on.ck-disabled{background:var(--ck-color-button-on-disabled-background)}.ck.ck-button.ck-button-save,a.ck.ck-button.ck-button-save{color:var(--ck-color-button-save)}.ck.ck-button.ck-button-cancel,a.ck.ck-button.ck-button-cancel{color:var(--ck-color-button-cancel)}.ck.ck-button-action,a.ck.ck-button-action{background:var(--ck-color-button-action-background)}.ck.ck-button-action:not(.ck-disabled):hover,a.ck.ck-button-action:not(.ck-disabled):hover{background:var(--ck-color-button-action-hover-background)}.ck.ck-button-action:not(.ck-disabled):active,a.ck.ck-button-action:not(.ck-disabled):active{background:var(--ck-color-button-action-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-action-active-shadow)}.ck.ck-button-action.ck-disabled,a.ck.ck-button-action.ck-disabled{background:var(--ck-color-button-action-disabled-background)}.ck.ck-button-action,a.ck.ck-button-action{color:var(--ck-color-button-action-text)}.ck.ck-button-bold,a.ck.ck-button-bold{font-weight:700}"
  117092. /***/ }),
  117093. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/switchbutton.css":
  117094. /*!**********************************************************************************************************************************!*\
  117095. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/switchbutton.css ***!
  117096. \**********************************************************************************************************************************/
  117097. /*! no static exports found */
  117098. /***/ (function(module, exports) {
  117099. module.exports = ".ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{display:block}:root{--ck-switch-button-toggle-width:2.6153846154em;--ck-switch-button-toggle-inner-size:1.0769230769em;--ck-switch-button-toggle-spacing:1px;--ck-switch-button-translation:calc(var(--ck-switch-button-toggle-width) - var(--ck-switch-button-toggle-inner-size) - var(--ck-switch-button-toggle-spacing)*2)}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__label{margin-right:calc(var(--ck-spacing-large)*2)}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__label{margin-left:calc(var(--ck-spacing-large)*2)}.ck.ck-button.ck-switchbutton .ck-button__toggle{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle.ck-rounded-corners{border-radius:var(--ck-border-radius)}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-left:auto}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-right:auto}.ck.ck-button.ck-switchbutton .ck-button__toggle{transition:background .4s ease;width:var(--ck-switch-button-toggle-width);background:var(--ck-color-switch-button-off-background)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:calc(var(--ck-border-radius)*0.5)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{margin:var(--ck-switch-button-toggle-spacing);width:var(--ck-switch-button-toggle-inner-size);height:var(--ck-switch-button-toggle-inner-size);background:var(--ck-color-switch-button-inner-background);transition:all .3s ease}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover{background:var(--ck-color-switch-button-off-hover-background)}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover .ck-button__toggle__inner{box-shadow:0 0 0 5px var(--ck-color-switch-button-inner-shadow)}.ck.ck-button.ck-switchbutton.ck-disabled .ck-button__toggle{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle{background:var(--ck-color-switch-button-on-background)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle:hover{background:var(--ck-color-switch-button-on-hover-background)}[dir=ltr] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(var(--ck-switch-button-translation))}[dir=rtl] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(calc(var(--ck-switch-button-translation)*-1))}"
  117100. /***/ }),
  117101. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorgrid/colorgrid.css":
  117102. /*!**********************************************************************************************************************************!*\
  117103. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorgrid/colorgrid.css ***!
  117104. \**********************************************************************************************************************************/
  117105. /*! no static exports found */
  117106. /***/ (function(module, exports) {
  117107. module.exports = ".ck.ck-color-grid{display:grid}:root{--ck-color-grid-tile-size:24px;--ck-color-color-grid-check-icon:#000}.ck.ck-color-grid{grid-gap:5px;padding:8px}.ck.ck-color-grid__tile{width:var(--ck-color-grid-tile-size);height:var(--ck-color-grid-tile-size);min-width:var(--ck-color-grid-tile-size);min-height:var(--ck-color-grid-tile-size);padding:0;transition:box-shadow .2s ease;border:0}.ck.ck-color-grid__tile.ck-disabled{cursor:unset;transition:unset}.ck.ck-color-grid__tile.ck-color-table__color-tile_bordered{box-shadow:0 0 0 1px var(--ck-color-base-border)}.ck.ck-color-grid__tile .ck.ck-icon{display:none;color:var(--ck-color-color-grid-check-icon)}.ck.ck-color-grid__tile.ck-on{box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-base-text)}.ck.ck-color-grid__tile.ck-on .ck.ck-icon{display:block}.ck.ck-color-grid__tile.ck-on,.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){border:0}.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-focus-border)}.ck.ck-color-grid__label{padding:0 var(--ck-spacing-standard)}"
  117108. /***/ }),
  117109. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/dropdown.css":
  117110. /*!********************************************************************************************************************************!*\
  117111. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/dropdown.css ***!
  117112. \********************************************************************************************************************************/
  117113. /*! no static exports found */
  117114. /***/ (function(module, exports) {
  117115. module.exports = ".ck.ck-dropdown{display:inline-block;position:relative}.ck.ck-dropdown .ck-dropdown__arrow{pointer-events:none;z-index:var(--ck-z-default)}.ck.ck-dropdown .ck-button.ck-dropdown__button{width:100%}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on .ck-tooltip{display:none}.ck.ck-dropdown .ck-dropdown__panel{-webkit-backface-visibility:hidden;display:none;z-index:var(--ck-z-modal);position:absolute}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel-visible{display:inline-block}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw{bottom:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{top:100%;bottom:auto}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se{left:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{right:0}.ck.ck-toolbar .ck-dropdown__panel{z-index:calc(var(--ck-z-modal) + 1)}:root{--ck-dropdown-arrow-size:calc(var(--ck-icon-size)*0.5)}.ck.ck-dropdown{font-size:inherit}.ck.ck-dropdown .ck-dropdown__arrow{width:var(--ck-dropdown-arrow-size)}[dir=ltr] .ck.ck-dropdown .ck-dropdown__arrow{right:var(--ck-spacing-standard);margin-left:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-dropdown .ck-dropdown__arrow{left:var(--ck-spacing-standard);margin-right:var(--ck-spacing-small)}.ck.ck-dropdown.ck-disabled .ck-dropdown__arrow{opacity:var(--ck-disabled-opacity)}[dir=ltr] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-right:var(--ck-spacing-small)}.ck.ck-dropdown .ck-button.ck-dropdown__button .ck-button__label{width:7em;overflow:hidden;text-overflow:ellipsis}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on{border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-dropdown__button_label-width_auto .ck-button__label{width:auto}.ck.ck-dropdown__panel{border-radius:0}.ck-rounded-corners .ck.ck-dropdown__panel,.ck.ck-dropdown__panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-dropdown__panel{box-shadow:var(--ck-drop-shadow),0 0;background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);bottom:0;min-width:100%}.ck.ck-dropdown__panel.ck-dropdown__panel_se{border-top-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_sw{border-top-right-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_ne{border-bottom-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_nw{border-bottom-right-radius:0}"
  117116. /***/ }),
  117117. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/listdropdown.css":
  117118. /*!************************************************************************************************************************************!*\
  117119. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/listdropdown.css ***!
  117120. \************************************************************************************************************************************/
  117121. /*! no static exports found */
  117122. /***/ (function(module, exports) {
  117123. module.exports = ".ck.ck-dropdown .ck-dropdown__panel .ck-list{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list,.ck.ck-dropdown .ck-dropdown__panel .ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}"
  117124. /***/ }),
  117125. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/splitbutton.css":
  117126. /*!***********************************************************************************************************************************!*\
  117127. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/splitbutton.css ***!
  117128. \***********************************************************************************************************************************/
  117129. /*! no static exports found */
  117130. /***/ (function(module, exports) {
  117131. module.exports = ".ck.ck-splitbutton{font-size:inherit}.ck.ck-splitbutton .ck-splitbutton__action:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-button .ck-tooltip{display:none}:root{--ck-color-split-button-hover-background:#ebebeb;--ck-color-split-button-hover-border:#b3b3b3}[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__action{border-top-right-radius:unset;border-bottom-right-radius:unset}[dir=rtl] .ck.ck-splitbutton>.ck-splitbutton__action{border-top-left-radius:unset;border-bottom-left-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow{min-width:unset}[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-radius:0}.ck-rounded-corners [dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow,[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:unset;border-bottom-left-radius:unset}[dir=rtl] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-top-right-radius:unset;border-bottom-right-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow svg{width:var(--ck-dropdown-arrow-size)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover),.ck.ck-splitbutton:hover>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover){background:var(--ck-color-split-button-hover-background)}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled),[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled){border-left-color:var(--ck-color-split-button-hover-border)}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled),[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled){border-right-color:var(--ck-color-split-button-hover-border)}.ck.ck-splitbutton.ck-splitbutton_open{border-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__action{border-bottom-left-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__arrow{border-bottom-right-radius:0}"
  117132. /***/ }),
  117133. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css":
  117134. /*!***************************************************************************************************************************************!*\
  117135. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css ***!
  117136. \***************************************************************************************************************************************/
  117137. /*! no static exports found */
  117138. /***/ (function(module, exports) {
  117139. module.exports = ".ck.ck-toolbar-dropdown .ck.ck-toolbar .ck.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar-dropdown .ck-dropdown__panel .ck-button:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-toolbar-dropdown .ck-toolbar{border:0}"
  117140. /***/ }),
  117141. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/editorui/editorui.css":
  117142. /*!********************************************************************************************************************************!*\
  117143. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/editorui/editorui.css ***!
  117144. \********************************************************************************************************************************/
  117145. /*! no static exports found */
  117146. /***/ (function(module, exports) {
  117147. module.exports = ":root{--ck-color-editable-blur-selection:#d9d9d9}.ck.ck-editor__editable:not(.ck-editor__nested-editable){border-radius:0}.ck-rounded-corners .ck.ck-editor__editable:not(.ck-editor__nested-editable),.ck.ck-editor__editable:not(.ck-editor__nested-editable).ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-editor__editable:not(.ck-editor__nested-editable).ck-focused{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0}.ck.ck-editor__editable_inline{overflow:auto;padding:0 var(--ck-spacing-standard);border:1px solid transparent}.ck.ck-editor__editable_inline[dir=ltr]{text-align:left}.ck.ck-editor__editable_inline[dir=rtl]{text-align:right}.ck.ck-editor__editable_inline>:first-child{margin-top:var(--ck-spacing-large)}.ck.ck-editor__editable_inline>:last-child{margin-bottom:var(--ck-spacing-large)}.ck.ck-editor__editable_inline.ck-blurred ::selection{background:var(--ck-color-editable-blur-selection)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_n]:after{border-bottom-color:var(--ck-color-base-foreground)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_s]:after{border-top-color:var(--ck-color-base-foreground)}"
  117148. /***/ }),
  117149. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/icon/icon.css":
  117150. /*!************************************************************************************************************************!*\
  117151. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/icon/icon.css ***!
  117152. \************************************************************************************************************************/
  117153. /*! no static exports found */
  117154. /***/ (function(module, exports) {
  117155. module.exports = ".ck.ck-icon{vertical-align:middle}:root{--ck-icon-size:calc(var(--ck-line-height-base)*var(--ck-font-size-normal))}.ck.ck-icon{width:var(--ck-icon-size);height:var(--ck-icon-size);font-size:.8333350694em;will-change:transform}.ck.ck-icon,.ck.ck-icon *{color:inherit;cursor:inherit}.ck.ck-icon :not([fill]){fill:currentColor}"
  117156. /***/ }),
  117157. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/inputtext/inputtext.css":
  117158. /*!**********************************************************************************************************************************!*\
  117159. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/inputtext/inputtext.css ***!
  117160. \**********************************************************************************************************************************/
  117161. /*! no static exports found */
  117162. /***/ (function(module, exports) {
  117163. module.exports = ":root{--ck-input-text-width:18em}.ck.ck-input-text{border-radius:0}.ck-rounded-corners .ck.ck-input-text,.ck.ck-input-text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input-text{box-shadow:var(--ck-inner-shadow),0 0;background:var(--ck-color-input-background);border:1px solid var(--ck-color-input-border);padding:var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);min-width:var(--ck-input-text-width);min-height:var(--ck-ui-component-min-height);transition:box-shadow .2s ease-in-out,border .2s ease-in-out}.ck.ck-input-text:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),var(--ck-inner-shadow)}.ck.ck-input-text[readonly]{border:1px solid var(--ck-color-input-disabled-border);background:var(--ck-color-input-disabled-background);color:var(--ck-color-input-disabled-text)}.ck.ck-input-text[readonly]:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),var(--ck-inner-shadow)}.ck.ck-input-text.ck-error{border-color:var(--ck-color-input-error-border);animation:ck-text-input-shake .3s ease both}.ck.ck-input-text.ck-error:focus{box-shadow:var(--ck-focus-error-outer-shadow),var(--ck-inner-shadow)}@keyframes ck-text-input-shake{20%{transform:translateX(-2px)}40%{transform:translateX(2px)}60%{transform:translateX(-1px)}80%{transform:translateX(1px)}}"
  117164. /***/ }),
  117165. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/label/label.css":
  117166. /*!**************************************************************************************************************************!*\
  117167. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/label/label.css ***!
  117168. \**************************************************************************************************************************/
  117169. /*! no static exports found */
  117170. /***/ (function(module, exports) {
  117171. module.exports = ".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}"
  117172. /***/ }),
  117173. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css":
  117174. /*!********************************************************************************************************************************************!*\
  117175. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css ***!
  117176. \********************************************************************************************************************************************/
  117177. /*! no static exports found */
  117178. /***/ (function(module, exports) {
  117179. module.exports = ".ck.ck-labeled-field-view .ck-labeled-field-view__status{font-size:var(--ck-font-size-small);margin-top:var(--ck-spacing-small);white-space:normal}.ck.ck-labeled-field-view .ck-labeled-field-view__status_error{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view>.ck.ck-label{width:100%;text-overflow:ellipsis;overflow:hidden}"
  117180. /***/ }),
  117181. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/list/list.css":
  117182. /*!************************************************************************************************************************!*\
  117183. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/list/list.css ***!
  117184. \************************************************************************************************************************/
  117185. /*! no static exports found */
  117186. /***/ (function(module, exports) {
  117187. module.exports = ".ck.ck-list{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-direction:column}.ck.ck-list .ck-list__item,.ck.ck-list .ck-list__separator{display:block}.ck.ck-list .ck-list__item>:focus{position:relative;z-index:var(--ck-z-default)}.ck.ck-list{border-radius:0}.ck-rounded-corners .ck.ck-list,.ck.ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-list{list-style-type:none;background:var(--ck-color-list-background)}.ck.ck-list__item{cursor:default;min-width:12em}.ck.ck-list__item .ck-button{min-height:unset;width:100%;text-align:left;border-radius:0;padding:calc(var(--ck-line-height-base)*0.2*var(--ck-font-size-base)) calc(var(--ck-line-height-base)*0.4*var(--ck-font-size-base))}.ck.ck-list__item .ck-button .ck-button__label{line-height:calc(var(--ck-line-height-base)*1.2*var(--ck-font-size-base))}.ck.ck-list__item .ck-button:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on{background:var(--ck-color-list-button-on-background);color:var(--ck-color-list-button-on-text)}.ck.ck-list__item .ck-button.ck-on:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on:hover:not(.ck-disabled){background:var(--ck-color-list-button-on-background-focus)}.ck.ck-list__item .ck-button.ck-on:focus:not(.ck-disabled){border-color:var(--ck-color-base-background)}.ck.ck-list__item .ck-button:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background)}.ck.ck-list__item .ck-switchbutton.ck-on{background:var(--ck-color-list-background);color:inherit}.ck.ck-list__item .ck-switchbutton.ck-on:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background);color:inherit}.ck.ck-list__separator{height:1px;width:100%;background:var(--ck-color-base-border)}"
  117188. /***/ }),
  117189. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonpanel.css":
  117190. /*!*********************************************************************************************************************************!*\
  117191. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonpanel.css ***!
  117192. \*********************************************************************************************************************************/
  117193. /*! no static exports found */
  117194. /***/ (function(module, exports) {
  117195. module.exports = ":root{--ck-balloon-panel-arrow-z-index:calc(var(--ck-z-default) - 3)}.ck.ck-balloon-panel{display:none;position:absolute;z-index:var(--ck-z-modal)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{content:\"\";position:absolute}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_n]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_n]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_s]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_s]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel.ck-balloon-panel_visible{display:block}:root{--ck-balloon-arrow-offset:2px;--ck-balloon-arrow-height:10px;--ck-balloon-arrow-half-width:8px;--ck-balloon-arrow-drop-shadow:0 2px 2px var(--ck-color-shadow-drop)}.ck.ck-balloon-panel{border-radius:0}.ck-rounded-corners .ck.ck-balloon-panel,.ck.ck-balloon-panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-balloon-panel{box-shadow:var(--ck-drop-shadow),0 0;min-height:15px;background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{width:0;height:0;border-style:solid}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:var(--ck-balloon-arrow-height);border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:0}.ck.ck-balloon-panel[class*=arrow_n]:before{border-bottom-color:var(--ck-color-panel-border)}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-color:transparent;border-right-color:transparent;border-top-color:transparent}.ck.ck-balloon-panel[class*=arrow_n]:after{border-bottom-color:var(--ck-color-panel-background);margin-top:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:0;border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:var(--ck-balloon-arrow-height)}.ck.ck-balloon-panel[class*=arrow_s]:before{border-top-color:var(--ck-color-panel-border);filter:drop-shadow(var(--ck-balloon-arrow-drop-shadow))}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent}.ck.ck-balloon-panel[class*=arrow_s]:after{border-top-color:var(--ck-color-panel-background);margin-bottom:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:before{left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:before{left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:before{right:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:before{left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:before{left:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:before{right:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:before{right:25%;margin-right:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:before{left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:before{right:25%;margin-right:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:before{left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}"
  117196. /***/ }),
  117197. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonrotator.css":
  117198. /*!***********************************************************************************************************************************!*\
  117199. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonrotator.css ***!
  117200. \***********************************************************************************************************************************/
  117201. /*! no static exports found */
  117202. /***/ (function(module, exports) {
  117203. module.exports = ".ck .ck-balloon-rotator__navigation{display:flex;align-items:center;justify-content:center}.ck .ck-balloon-rotator__content .ck-toolbar{justify-content:center}.ck .ck-balloon-rotator__navigation{background:var(--ck-color-toolbar-background);border-bottom:1px solid var(--ck-color-toolbar-border);padding:0 var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation>*{margin-right:var(--ck-spacing-small);margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation .ck-balloon-rotator__counter{margin-right:var(--ck-spacing-standard);margin-left:var(--ck-spacing-small)}.ck .ck-balloon-rotator__content .ck.ck-annotation-wrapper{box-shadow:none}"
  117204. /***/ }),
  117205. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/fakepanel.css":
  117206. /*!******************************************************************************************************************************!*\
  117207. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/fakepanel.css ***!
  117208. \******************************************************************************************************************************/
  117209. /*! no static exports found */
  117210. /***/ (function(module, exports) {
  117211. module.exports = ".ck .ck-fake-panel{position:absolute;z-index:calc(var(--ck-z-modal) - 1)}.ck .ck-fake-panel div{position:absolute}.ck .ck-fake-panel div:first-child{z-index:2}.ck .ck-fake-panel div:nth-child(2){z-index:1}:root{--ck-balloon-fake-panel-offset-horizontal:6px;--ck-balloon-fake-panel-offset-vertical:6px}.ck .ck-fake-panel div{box-shadow:var(--ck-drop-shadow),0 0;min-height:15px;background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border);border-radius:var(--ck-border-radius);width:100%;height:100%}.ck .ck-fake-panel div:first-child{margin-left:var(--ck-balloon-fake-panel-offset-horizontal);margin-top:var(--ck-balloon-fake-panel-offset-vertical)}.ck .ck-fake-panel div:nth-child(2){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*2);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*2)}.ck .ck-fake-panel div:nth-child(3){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*3);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*3)}.ck .ck-balloon-panel_arrow_s+.ck-fake-panel,.ck .ck-balloon-panel_arrow_se+.ck-fake-panel,.ck .ck-balloon-panel_arrow_sw+.ck-fake-panel{--ck-balloon-fake-panel-offset-vertical:-6px}"
  117212. /***/ }),
  117213. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/stickypanel.css":
  117214. /*!********************************************************************************************************************************!*\
  117215. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/stickypanel.css ***!
  117216. \********************************************************************************************************************************/
  117217. /*! no static exports found */
  117218. /***/ (function(module, exports) {
  117219. module.exports = ".ck.ck-sticky-panel .ck-sticky-panel__content_sticky{z-index:var(--ck-z-modal);position:fixed;top:0}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky_bottom-limit{top:auto;position:absolute}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{box-shadow:var(--ck-drop-shadow),0 0;border-width:0 1px 1px;border-top-left-radius:0;border-top-right-radius:0}"
  117220. /***/ }),
  117221. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css":
  117222. /*!*********************************************************************************************************************************************!*\
  117223. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css ***!
  117224. \*********************************************************************************************************************************************/
  117225. /*! no static exports found */
  117226. /***/ (function(module, exports) {
  117227. module.exports = ".ck-vertical-form .ck-button:after{content:\"\";width:0;position:absolute;right:-1px;top:var(--ck-spacing-small);bottom:var(--ck-spacing-small);z-index:1}@media screen and (max-width:600px){.ck.ck-responsive-form .ck-button:after{content:\"\";width:0;position:absolute;right:-1px;top:var(--ck-spacing-small);bottom:var(--ck-spacing-small);z-index:1}}.ck-vertical-form>.ck-button:nth-last-child(2):after{border-right:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form{padding:var(--ck-spacing-standard)}.ck.ck-responsive-form:focus{outline:none}[dir=ltr] .ck.ck-responsive-form>:not(:first-child),[dir=rtl] .ck.ck-responsive-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-responsive-form{padding:0;width:calc(var(--ck-input-text-width)*0.8)}.ck.ck-responsive-form .ck-labeled-field-view{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-responsive-form .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-responsive-form .ck-labeled-field-view .ck-labeled-field-view__error{white-space:normal}.ck.ck-responsive-form>.ck-button:last-child,.ck.ck-responsive-form>.ck-button:nth-last-child(2){padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-standard);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-responsive-form>.ck-button:last-child,[dir=ltr] .ck.ck-responsive-form>.ck-button:nth-last-child(2),[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2){margin-left:0}.ck.ck-responsive-form>.ck-button:nth-last-child(2):after,[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child:last-of-type,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2):last-of-type{border-right:1px solid var(--ck-color-base-border)}}"
  117228. /***/ }),
  117229. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css":
  117230. /*!******************************************************************************************************************************!*\
  117231. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css ***!
  117232. \******************************************************************************************************************************/
  117233. /*! no static exports found */
  117234. /***/ (function(module, exports) {
  117235. module.exports = ".ck.ck-toolbar{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-flow:row nowrap;align-items:center}.ck.ck-toolbar>.ck-toolbar__items{display:flex;flex-flow:row wrap;align-items:center;flex-grow:1}.ck.ck-toolbar .ck.ck-toolbar__separator{display:inline-block}.ck.ck-toolbar .ck.ck-toolbar__separator:first-child,.ck.ck-toolbar .ck.ck-toolbar__separator:last-child{display:none}.ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items{flex-direction:column}.ck.ck-toolbar.ck-toolbar_floating>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck-dropdown__button .ck-dropdown__arrow{display:none}.ck.ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-toolbar,.ck.ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-toolbar{background:var(--ck-color-toolbar-background);padding:0 var(--ck-spacing-small);border:1px solid var(--ck-color-toolbar-border)}.ck.ck-toolbar .ck.ck-toolbar__separator{align-self:stretch;width:1px;min-width:1px;background:var(--ck-color-toolbar-border);margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck.ck-toolbar>.ck-toolbar__items>*{margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small);margin-right:var(--ck-spacing-small)}.ck.ck-toolbar>.ck-toolbar__items:empty+.ck.ck-toolbar__separator{display:none}.ck.ck-toolbar>.ck-toolbar__items>*,.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown{margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck.ck-toolbar.ck-toolbar_vertical{padding:0}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items>.ck{width:100%;margin:0;border-radius:0;border:0}.ck.ck-toolbar.ck-toolbar_compact{padding:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>*{margin:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>:not(:first-child):not(:last-child){border-radius:0}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck.ck-button.ck-dropdown__button{padding-left:var(--ck-spacing-tiny)}.ck-toolbar-container .ck.ck-toolbar{border:0}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck{margin-right:0}.ck.ck-toolbar[dir=rtl]:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-left:0}.ck.ck-toolbar[dir=rtl].ck-toolbar_compact>.ck-toolbar__items>.ck:first-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.ck.ck-toolbar[dir=rtl].ck-toolbar_compact>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-top-right-radius:0;border-bottom-right-radius:0}.ck.ck-toolbar[dir=rtl]>.ck.ck-toolbar__separator,[dir=rtl] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl].ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=rtl] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child){margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr]>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-right:0}.ck.ck-toolbar[dir=ltr].ck-toolbar_compact>.ck-toolbar__items>.ck:first-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.ck.ck-toolbar[dir=ltr].ck-toolbar_compact>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.ck.ck-toolbar[dir=ltr]>.ck.ck-toolbar__separator,[dir=ltr] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-right:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr].ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=ltr] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child){margin-right:var(--ck-spacing-small)}"
  117236. /***/ }),
  117237. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/tooltip.css":
  117238. /*!******************************************************************************************************************************!*\
  117239. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/tooltip.css ***!
  117240. \******************************************************************************************************************************/
  117241. /*! no static exports found */
  117242. /***/ (function(module, exports) {
  117243. module.exports = ".ck.ck-tooltip,.ck.ck-tooltip .ck-tooltip__text:after{position:absolute;pointer-events:none;-webkit-backface-visibility:hidden}.ck.ck-tooltip{visibility:hidden;opacity:0;display:none;z-index:var(--ck-z-modal)}.ck.ck-tooltip .ck-tooltip__text{display:inline-block}.ck.ck-tooltip .ck-tooltip__text:after{content:\"\";width:0;height:0}:root{--ck-tooltip-arrow-size:5px}.ck.ck-tooltip{left:50%;top:0;transition:opacity .2s ease-in-out .2s}.ck.ck-tooltip .ck-tooltip__text{border-radius:0}.ck-rounded-corners .ck.ck-tooltip .ck-tooltip__text,.ck.ck-tooltip .ck-tooltip__text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-tooltip .ck-tooltip__text{font-size:.9em;line-height:1.5;color:var(--ck-color-tooltip-text);padding:var(--ck-spacing-small) var(--ck-spacing-medium);background:var(--ck-color-tooltip-background);position:relative;left:-50%}.ck.ck-tooltip .ck-tooltip__text:after{transition:opacity .2s ease-in-out .2s;border-style:solid;left:50%}.ck.ck-tooltip.ck-tooltip_s,.ck.ck-tooltip.ck-tooltip_sw{bottom:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateY(100%)}.ck.ck-tooltip.ck-tooltip_s .ck-tooltip__text:after,.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text:after{top:calc(var(--ck-tooltip-arrow-size)*-1 + 1px);transform:translateX(-50%);border-left-color:transparent;border-bottom-color:var(--ck-color-tooltip-background);border-right-color:transparent;border-top-color:transparent;border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:var(--ck-tooltip-arrow-size);border-top-width:0}.ck.ck-tooltip.ck-tooltip_sw{right:50%;left:auto}.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text{left:auto;right:calc(var(--ck-tooltip-arrow-size)*-2)}.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text:after{left:auto;right:0}.ck.ck-tooltip.ck-tooltip_n{top:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateY(-100%)}.ck.ck-tooltip.ck-tooltip_n .ck-tooltip__text:after{bottom:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateX(-50%);border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent;border-top-color:var(--ck-color-tooltip-background);border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:0;border-right-width:var(--ck-tooltip-arrow-size);border-top-width:var(--ck-tooltip-arrow-size)}"
  117244. /***/ }),
  117245. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-ui/theme/globals/globals.css":
  117246. /*!*******************************************************************************************************************!*\
  117247. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-ui/theme/globals/globals.css ***!
  117248. \*******************************************************************************************************************/
  117249. /*! no static exports found */
  117250. /***/ (function(module, exports) {
  117251. module.exports = ".ck-hidden{display:none!important}.ck.ck-reset,.ck.ck-reset_all,.ck.ck-reset_all *{box-sizing:border-box;width:auto;height:auto;position:static}:root{--ck-z-default:1;--ck-z-modal:calc(var(--ck-z-default) + 999);--ck-color-base-foreground:#fafafa;--ck-color-base-background:#fff;--ck-color-base-border:#c4c4c4;--ck-color-base-action:#61b045;--ck-color-base-focus:#6cb5f9;--ck-color-base-text:#333;--ck-color-base-active:#198cf0;--ck-color-base-active-focus:#0e7fe1;--ck-color-base-error:#db3700;--ck-color-focus-border-coordinates:208,79%,51%;--ck-color-focus-border:hsl(var(--ck-color-focus-border-coordinates));--ck-color-focus-outer-shadow:#bcdefb;--ck-color-focus-disabled-shadow:rgba(119,186,248,0.3);--ck-color-focus-error-shadow:rgba(255,64,31,0.3);--ck-color-text:var(--ck-color-base-text);--ck-color-shadow-drop:rgba(0,0,0,0.15);--ck-color-shadow-drop-active:rgba(0,0,0,0.2);--ck-color-shadow-inner:rgba(0,0,0,0.1);--ck-color-button-default-background:transparent;--ck-color-button-default-hover-background:#e6e6e6;--ck-color-button-default-active-background:#d9d9d9;--ck-color-button-default-active-shadow:#bfbfbf;--ck-color-button-default-disabled-background:transparent;--ck-color-button-on-background:#dedede;--ck-color-button-on-hover-background:#c4c4c4;--ck-color-button-on-active-background:#bababa;--ck-color-button-on-active-shadow:#a1a1a1;--ck-color-button-on-disabled-background:#dedede;--ck-color-button-action-background:var(--ck-color-base-action);--ck-color-button-action-hover-background:#579e3d;--ck-color-button-action-active-background:#53973b;--ck-color-button-action-active-shadow:#498433;--ck-color-button-action-disabled-background:#7ec365;--ck-color-button-action-text:var(--ck-color-base-background);--ck-color-button-save:#008a00;--ck-color-button-cancel:#db3700;--ck-color-switch-button-off-background:#b0b0b0;--ck-color-switch-button-off-hover-background:#a3a3a3;--ck-color-switch-button-on-background:var(--ck-color-button-action-background);--ck-color-switch-button-on-hover-background:#579e3d;--ck-color-switch-button-inner-background:var(--ck-color-base-background);--ck-color-switch-button-inner-shadow:rgba(0,0,0,0.1);--ck-color-dropdown-panel-background:var(--ck-color-base-background);--ck-color-dropdown-panel-border:var(--ck-color-base-border);--ck-color-input-background:var(--ck-color-base-background);--ck-color-input-border:#c7c7c7;--ck-color-input-error-border:var(--ck-color-base-error);--ck-color-input-text:var(--ck-color-base-text);--ck-color-input-disabled-background:#f2f2f2;--ck-color-input-disabled-border:#c7c7c7;--ck-color-input-disabled-text:#5c5c5c;--ck-color-list-background:var(--ck-color-base-background);--ck-color-list-button-hover-background:var(--ck-color-button-default-hover-background);--ck-color-list-button-on-background:var(--ck-color-base-active);--ck-color-list-button-on-background-focus:var(--ck-color-base-active-focus);--ck-color-list-button-on-text:var(--ck-color-base-background);--ck-color-panel-background:var(--ck-color-base-background);--ck-color-panel-border:var(--ck-color-base-border);--ck-color-toolbar-background:var(--ck-color-base-foreground);--ck-color-toolbar-border:var(--ck-color-base-border);--ck-color-tooltip-background:var(--ck-color-base-text);--ck-color-tooltip-text:var(--ck-color-base-background);--ck-color-engine-placeholder-text:#707070;--ck-color-upload-bar-background:#6cb5f9;--ck-color-link-default:#0000f0;--ck-color-link-selected-background:rgba(31,177,255,0.1);--ck-color-link-fake-selection:rgba(31,177,255,0.3);--ck-disabled-opacity:.5;--ck-focus-outer-shadow-geometry:0 0 0 3px;--ck-focus-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-outer-shadow);--ck-focus-disabled-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-disabled-shadow);--ck-focus-error-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-error-shadow);--ck-focus-ring:1px solid var(--ck-color-focus-border);--ck-font-size-base:13px;--ck-line-height-base:1.84615;--ck-font-face:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;--ck-font-size-tiny:0.7em;--ck-font-size-small:0.75em;--ck-font-size-normal:1em;--ck-font-size-big:1.4em;--ck-font-size-large:1.8em;--ck-ui-component-min-height:2.3em}.ck.ck-reset,.ck.ck-reset_all,.ck.ck-reset_all *{margin:0;padding:0;border:0;background:transparent;text-decoration:none;vertical-align:middle;transition:none;word-wrap:break-word}.ck.ck-reset_all,.ck.ck-reset_all *{border-collapse:collapse;font:normal normal normal var(--ck-font-size-base)/var(--ck-line-height-base) var(--ck-font-face);color:var(--ck-color-text);text-align:left;white-space:nowrap;cursor:auto;float:none}.ck.ck-reset_all .ck-rtl *{text-align:right}.ck.ck-reset_all iframe{vertical-align:inherit}.ck.ck-reset_all textarea{white-space:pre-wrap}.ck.ck-reset_all input[type=password],.ck.ck-reset_all input[type=text],.ck.ck-reset_all textarea{cursor:text}.ck.ck-reset_all input[type=password][disabled],.ck.ck-reset_all input[type=text][disabled],.ck.ck-reset_all textarea[disabled]{cursor:default}.ck.ck-reset_all fieldset{padding:10px;border:2px groove #dfdee3}.ck.ck-reset_all button::-moz-focus-inner{padding:0;border:0}.ck[dir=rtl],.ck[dir=rtl] .ck{text-align:right}:root{--ck-border-radius:2px;--ck-inner-shadow:2px 2px 3px var(--ck-color-shadow-inner) inset;--ck-drop-shadow:0 1px 2px 1px var(--ck-color-shadow-drop);--ck-drop-shadow-active:0 3px 6px 1px var(--ck-color-shadow-drop-active);--ck-spacing-unit:0.6em;--ck-spacing-large:calc(var(--ck-spacing-unit)*1.5);--ck-spacing-standard:var(--ck-spacing-unit);--ck-spacing-medium:calc(var(--ck-spacing-unit)*0.8);--ck-spacing-small:calc(var(--ck-spacing-unit)*0.5);--ck-spacing-tiny:calc(var(--ck-spacing-unit)*0.3);--ck-spacing-extra-tiny:calc(var(--ck-spacing-unit)*0.16)}"
  117252. /***/ }),
  117253. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-widget/theme/widget.css":
  117254. /*!**************************************************************************************************************!*\
  117255. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-widget/theme/widget.css ***!
  117256. \**************************************************************************************************************/
  117257. /*! no static exports found */
  117258. /***/ (function(module, exports) {
  117259. module.exports = ":root{--ck-color-resizer:var(--ck-color-focus-border);--ck-resizer-size:10px;--ck-resizer-border-width:1px;--ck-resizer-border-radius:2px;--ck-resizer-offset:calc(var(--ck-resizer-size)/-2 - 2px);--ck-resizer-tooltip-offset:10px;--ck-color-resizer-tooltip-background:#262626;--ck-color-resizer-tooltip-text:#f2f2f2}.ck .ck-widget,.ck .ck-widget.ck-widget_with-selection-handle{position:relative}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{position:absolute}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{display:block}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected .ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle:hover .ck-widget__selection-handle{visibility:visible}.ck .ck-size-view{background:var(--ck-color-resizer-tooltip-background);color:var(--ck-color-resizer-tooltip-text);border:1px solid var(--ck-color-resizer-tooltip-text);border-radius:var(--ck-resizer-border-radius);font-size:var(--ck-font-size-tiny);display:block;padding:var(--ck-spacing-small)}.ck .ck-size-view.ck-orientation-bottom-left,.ck .ck-size-view.ck-orientation-bottom-right,.ck .ck-size-view.ck-orientation-top-left,.ck .ck-size-view.ck-orientation-top-right{position:absolute}.ck .ck-size-view.ck-orientation-top-left{top:var(--ck-resizer-tooltip-offset);left:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-top-right{top:var(--ck-resizer-tooltip-offset);right:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-right{bottom:var(--ck-resizer-tooltip-offset);right:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-left{bottom:var(--ck-resizer-tooltip-offset);left:var(--ck-resizer-tooltip-offset)}:root{--ck-widget-outline-thickness:3px;--ck-widget-handler-icon-size:16px;--ck-widget-handler-animation-duration:200ms;--ck-widget-handler-animation-curve:ease;--ck-color-widget-blurred-border:#dedede;--ck-color-widget-hover-border:#ffc83d;--ck-color-widget-editable-focus-background:var(--ck-color-base-background);--ck-color-widget-drag-handler-icon-color:var(--ck-color-base-background)}.ck .ck-widget{outline-width:var(--ck-widget-outline-thickness);outline-style:solid;outline-color:transparent;transition:outline-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_selected,.ck .ck-widget.ck-widget_selected:hover{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-focus-border)}.ck .ck-widget:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-editor__nested-editable{border:1px solid transparent}.ck .ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck .ck-editor__nested-editable:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;background-color:var(--ck-color-widget-editable-focus-background)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{padding:4px;box-sizing:border-box;background-color:transparent;opacity:0;transition:background-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),visibility var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);border-radius:var(--ck-border-radius) var(--ck-border-radius) 0 0;transform:translateY(-100%);left:calc(0px - var(--ck-widget-outline-thickness))}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{width:var(--ck-widget-handler-icon-size);height:var(--ck-widget-handler-icon-size);color:var(--ck-color-widget-drag-handler-icon-color)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:0;transition:opacity .3s var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover .ck-icon .ck-icon__selected-indicator{opacity:1}.ck .ck-widget.ck-widget_with-selection-handle:hover .ck-widget__selection-handle{opacity:1;background-color:var(--ck-color-widget-hover-border)}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected .ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover .ck-widget__selection-handle{opacity:1;background-color:var(--ck-color-focus-border)}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:1}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{left:auto;right:calc(0px - var(--ck-widget-outline-thickness))}.ck.ck-editor__editable.ck-read-only .ck-widget{transition:none}.ck.ck-editor__editable.ck-read-only .ck-widget:not(.ck-widget_selected){--ck-widget-outline-thickness:0px}.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle,.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover{outline-color:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle .ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle .ck-widget__selection-handle:hover,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover.ck-widget_with-selection-handle .ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover.ck-widget_with-selection-handle .ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable>.ck-widget.ck-widget_with-selection-handle:first-child,.ck.ck-editor__editable blockquote>.ck-widget.ck-widget_with-selection-handle:first-child{margin-top:calc(1em + var(--ck-widget-handler-icon-size))}"
  117260. /***/ }),
  117261. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css":
  117262. /*!********************************************************************************************************************!*\
  117263. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css ***!
  117264. \********************************************************************************************************************/
  117265. /*! no static exports found */
  117266. /***/ (function(module, exports) {
  117267. module.exports = ".ck .ck-widget_with-resizer{position:relative}.ck .ck-widget__resizer{display:none;position:absolute;pointer-events:none;left:0;top:0;outline:1px solid var(--ck-color-resizer)}.ck-focused .ck-widget_with-resizer.ck-widget_selected>.ck-widget__resizer{display:block}.ck .ck-widget__resizer__handle{position:absolute;pointer-events:all;width:var(--ck-resizer-size);height:var(--ck-resizer-size);background:var(--ck-color-focus-border);border:var(--ck-resizer-border-width) solid #fff;border-radius:var(--ck-resizer-border-radius)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{top:var(--ck-resizer-offset);left:var(--ck-resizer-offset);cursor:nwse-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{top:var(--ck-resizer-offset);right:var(--ck-resizer-offset);cursor:nesw-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right{bottom:var(--ck-resizer-offset);right:var(--ck-resizer-offset);cursor:nwse-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left{bottom:var(--ck-resizer-offset);left:var(--ck-resizer-offset);cursor:nesw-resize}"
  117268. /***/ }),
  117269. /***/ "./node_modules/postcss-loader/src/index.js?!./node_modules/@ckeditor/ckeditor5-widget/theme/widgettypearound.css":
  117270. /*!************************************************************************************************************************!*\
  117271. !*** ./node_modules/postcss-loader/src??ref--5-1!./node_modules/@ckeditor/ckeditor5-widget/theme/widgettypearound.css ***!
  117272. \************************************************************************************************************************/
  117273. /*! no static exports found */
  117274. /***/ (function(module, exports) {
  117275. module.exports = ".ck .ck-widget .ck-widget__type-around__button{display:block;position:absolute;overflow:hidden;z-index:var(--ck-z-default)}.ck .ck-widget .ck-widget__type-around__button svg{position:absolute;top:50%;left:50%;z-index:calc(var(--ck-z-default) + 2)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_before{top:calc(var(--ck-widget-outline-thickness)*-0.5);left:min(10%,30px);transform:translateY(-50%)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_after{bottom:calc(var(--ck-widget-outline-thickness)*-0.5);right:min(10%,30px);transform:translateY(50%)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{content:\"\";display:block;position:absolute;top:1px;left:1px;z-index:calc(var(--ck-z-default) + 1)}.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:none;position:absolute;left:0;right:0}.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__fake-caret{left:calc(var(--ck-widget-outline-thickness)*-1);right:calc(var(--ck-widget-outline-thickness)*-1)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__fake-caret{top:calc(var(--ck-widget-outline-thickness)*-1 - 1px);display:block}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__fake-caret{bottom:calc(var(--ck-widget-outline-thickness)*-1 - 1px);display:block}.ck.ck-editor__editable.ck-read-only .ck-widget__type-around,.ck.ck-editor__editable.ck-restricted-editing_mode_restricted .ck-widget__type-around,.ck.ck-editor__editable.ck-widget__type-around_disabled .ck-widget__type-around{display:none}:root{--ck-widget-type-around-button-size:20px;--ck-color-widget-type-around-button-active:var(--ck-color-focus-border);--ck-color-widget-type-around-button-hover:var(--ck-color-widget-hover-border);--ck-color-widget-type-around-button-blurred-editable:var(--ck-color-widget-blurred-border);--ck-color-widget-type-around-button-radar-start-alpha:0;--ck-color-widget-type-around-button-radar-end-alpha:.3;--ck-color-widget-type-around-button-icon:var(--ck-color-base-background)}.ck .ck-widget .ck-widget__type-around__button{width:var(--ck-widget-type-around-button-size);height:var(--ck-widget-type-around-button-size);background:var(--ck-color-widget-type-around-button);border-radius:100px;transition:opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);opacity:0;pointer-events:none}.ck .ck-widget .ck-widget__type-around__button svg{width:10px;height:8px;transform:translate(-50%,-50%);transition:transform .5s ease;margin-top:1px}.ck .ck-widget .ck-widget__type-around__button svg *{stroke-dasharray:10;stroke-dashoffset:0;fill:none;stroke:var(--ck-color-widget-type-around-button-icon);stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round}.ck .ck-widget .ck-widget__type-around__button svg line{stroke-dasharray:7}.ck .ck-widget .ck-widget__type-around__button:hover{animation:ck-widget-type-around-button-sonar 1s ease infinite}.ck .ck-widget .ck-widget__type-around__button:hover svg polyline{animation:ck-widget-type-around-arrow-dash 2s linear}.ck .ck-widget .ck-widget__type-around__button:hover svg line{animation:ck-widget-type-around-arrow-tip-dash 2s linear}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:1;pointer-events:auto}.ck .ck-widget:not(.ck-widget_selected)>.ck-widget__type-around>.ck-widget__type-around__button{background:var(--ck-color-widget-type-around-button-hover)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover{background:var(--ck-color-widget-type-around-button-active)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{width:calc(var(--ck-widget-type-around-button-size) - 2px);height:calc(var(--ck-widget-type-around-button-size) - 2px);border-radius:100px;background:linear-gradient(135deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3))}.ck .ck-widget.ck-widget_with-selection-handle>.ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:20px}.ck .ck-widget .ck-widget__type-around__fake-caret{pointer-events:none;height:1px;animation:ck-widget-type-around-fake-caret-pulse 1s linear infinite normal forwards;outline:1px solid hsla(0,0%,100%,.5);background:var(--ck-color-base-text)}.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_after,.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_before{outline-color:transparent}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected:hover,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{opacity:0}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer{opacity:0}.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover){background:var(--ck-color-widget-type-around-button-blurred-editable)}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover) svg *{stroke:#999}@keyframes ck-widget-type-around-arrow-dash{0%{stroke-dashoffset:10}20%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-arrow-tip-dash{0%,20%{stroke-dashoffset:7}40%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-button-sonar{0%{box-shadow:0 0 0 0 hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}50%{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-end-alpha))}to{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}}@keyframes ck-widget-type-around-fake-caret-pulse{0%{opacity:1}49%{opacity:1}50%{opacity:0}99%{opacity:0}to{opacity:1}}"
  117276. /***/ }),
  117277. /***/ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js":
  117278. /*!****************************************************************************!*\
  117279. !*** ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js ***!
  117280. \****************************************************************************/
  117281. /*! no static exports found */
  117282. /***/ (function(module, exports, __webpack_require__) {
  117283. "use strict";
  117284. var isOldIE = function isOldIE() {
  117285. var memo;
  117286. return function memorize() {
  117287. if (typeof memo === 'undefined') {
  117288. // Test for IE <= 9 as proposed by Browserhacks
  117289. // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
  117290. // Tests for existence of standard globals is to allow style-loader
  117291. // to operate correctly into non-standard environments
  117292. // @see https://github.com/webpack-contrib/style-loader/issues/177
  117293. memo = Boolean(window && document && document.all && !window.atob);
  117294. }
  117295. return memo;
  117296. };
  117297. }();
  117298. var getTarget = function getTarget() {
  117299. var memo = {};
  117300. return function memorize(target) {
  117301. if (typeof memo[target] === 'undefined') {
  117302. var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself
  117303. if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
  117304. try {
  117305. // This will throw an exception if access to iframe is blocked
  117306. // due to cross-origin restrictions
  117307. styleTarget = styleTarget.contentDocument.head;
  117308. } catch (e) {
  117309. // istanbul ignore next
  117310. styleTarget = null;
  117311. }
  117312. }
  117313. memo[target] = styleTarget;
  117314. }
  117315. return memo[target];
  117316. };
  117317. }();
  117318. var stylesInDom = [];
  117319. function getIndexByIdentifier(identifier) {
  117320. var result = -1;
  117321. for (var i = 0; i < stylesInDom.length; i++) {
  117322. if (stylesInDom[i].identifier === identifier) {
  117323. result = i;
  117324. break;
  117325. }
  117326. }
  117327. return result;
  117328. }
  117329. function modulesToDom(list, options) {
  117330. var idCountMap = {};
  117331. var identifiers = [];
  117332. for (var i = 0; i < list.length; i++) {
  117333. var item = list[i];
  117334. var id = options.base ? item[0] + options.base : item[0];
  117335. var count = idCountMap[id] || 0;
  117336. var identifier = "".concat(id, " ").concat(count);
  117337. idCountMap[id] = count + 1;
  117338. var index = getIndexByIdentifier(identifier);
  117339. var obj = {
  117340. css: item[1],
  117341. media: item[2],
  117342. sourceMap: item[3]
  117343. };
  117344. if (index !== -1) {
  117345. stylesInDom[index].references++;
  117346. stylesInDom[index].updater(obj);
  117347. } else {
  117348. stylesInDom.push({
  117349. identifier: identifier,
  117350. updater: addStyle(obj, options),
  117351. references: 1
  117352. });
  117353. }
  117354. identifiers.push(identifier);
  117355. }
  117356. return identifiers;
  117357. }
  117358. function insertStyleElement(options) {
  117359. var style = document.createElement('style');
  117360. var attributes = options.attributes || {};
  117361. if (typeof attributes.nonce === 'undefined') {
  117362. var nonce = true ? __webpack_require__.nc : undefined;
  117363. if (nonce) {
  117364. attributes.nonce = nonce;
  117365. }
  117366. }
  117367. Object.keys(attributes).forEach(function (key) {
  117368. style.setAttribute(key, attributes[key]);
  117369. });
  117370. if (typeof options.insert === 'function') {
  117371. options.insert(style);
  117372. } else {
  117373. var target = getTarget(options.insert || 'head');
  117374. if (!target) {
  117375. throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
  117376. }
  117377. target.appendChild(style);
  117378. }
  117379. return style;
  117380. }
  117381. function removeStyleElement(style) {
  117382. // istanbul ignore if
  117383. if (style.parentNode === null) {
  117384. return false;
  117385. }
  117386. style.parentNode.removeChild(style);
  117387. }
  117388. /* istanbul ignore next */
  117389. var replaceText = function replaceText() {
  117390. var textStore = [];
  117391. return function replace(index, replacement) {
  117392. textStore[index] = replacement;
  117393. return textStore.filter(Boolean).join('\n');
  117394. };
  117395. }();
  117396. function applyToSingletonTag(style, index, remove, obj) {
  117397. var css = remove ? '' : obj.media ? "@media ".concat(obj.media, " {").concat(obj.css, "}") : obj.css; // For old IE
  117398. /* istanbul ignore if */
  117399. if (style.styleSheet) {
  117400. style.styleSheet.cssText = replaceText(index, css);
  117401. } else {
  117402. var cssNode = document.createTextNode(css);
  117403. var childNodes = style.childNodes;
  117404. if (childNodes[index]) {
  117405. style.removeChild(childNodes[index]);
  117406. }
  117407. if (childNodes.length) {
  117408. style.insertBefore(cssNode, childNodes[index]);
  117409. } else {
  117410. style.appendChild(cssNode);
  117411. }
  117412. }
  117413. }
  117414. function applyToTag(style, options, obj) {
  117415. var css = obj.css;
  117416. var media = obj.media;
  117417. var sourceMap = obj.sourceMap;
  117418. if (media) {
  117419. style.setAttribute('media', media);
  117420. } else {
  117421. style.removeAttribute('media');
  117422. }
  117423. if (sourceMap && typeof btoa !== 'undefined') {
  117424. css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
  117425. } // For old IE
  117426. /* istanbul ignore if */
  117427. if (style.styleSheet) {
  117428. style.styleSheet.cssText = css;
  117429. } else {
  117430. while (style.firstChild) {
  117431. style.removeChild(style.firstChild);
  117432. }
  117433. style.appendChild(document.createTextNode(css));
  117434. }
  117435. }
  117436. var singleton = null;
  117437. var singletonCounter = 0;
  117438. function addStyle(obj, options) {
  117439. var style;
  117440. var update;
  117441. var remove;
  117442. if (options.singleton) {
  117443. var styleIndex = singletonCounter++;
  117444. style = singleton || (singleton = insertStyleElement(options));
  117445. update = applyToSingletonTag.bind(null, style, styleIndex, false);
  117446. remove = applyToSingletonTag.bind(null, style, styleIndex, true);
  117447. } else {
  117448. style = insertStyleElement(options);
  117449. update = applyToTag.bind(null, style, options);
  117450. remove = function remove() {
  117451. removeStyleElement(style);
  117452. };
  117453. }
  117454. update(obj);
  117455. return function updateStyle(newObj) {
  117456. if (newObj) {
  117457. if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {
  117458. return;
  117459. }
  117460. update(obj = newObj);
  117461. } else {
  117462. remove();
  117463. }
  117464. };
  117465. }
  117466. module.exports = function (list, options) {
  117467. options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
  117468. // tags it will allow on a page
  117469. if (!options.singleton && typeof options.singleton !== 'boolean') {
  117470. options.singleton = isOldIE();
  117471. }
  117472. list = list || [];
  117473. var lastIdentifiers = modulesToDom(list, options);
  117474. return function update(newList) {
  117475. newList = newList || [];
  117476. if (Object.prototype.toString.call(newList) !== '[object Array]') {
  117477. return;
  117478. }
  117479. for (var i = 0; i < lastIdentifiers.length; i++) {
  117480. var identifier = lastIdentifiers[i];
  117481. var index = getIndexByIdentifier(identifier);
  117482. stylesInDom[index].references--;
  117483. }
  117484. var newLastIdentifiers = modulesToDom(newList, options);
  117485. for (var _i = 0; _i < lastIdentifiers.length; _i++) {
  117486. var _identifier = lastIdentifiers[_i];
  117487. var _index = getIndexByIdentifier(_identifier);
  117488. if (stylesInDom[_index].references === 0) {
  117489. stylesInDom[_index].updater();
  117490. stylesInDom.splice(_index, 1);
  117491. }
  117492. }
  117493. lastIdentifiers = newLastIdentifiers;
  117494. };
  117495. };
  117496. /***/ }),
  117497. /***/ "./node_modules/webpack/buildin/global.js":
  117498. /*!***********************************!*\
  117499. !*** (webpack)/buildin/global.js ***!
  117500. \***********************************/
  117501. /*! no static exports found */
  117502. /***/ (function(module, exports) {
  117503. var g;
  117504. // This works in non-strict mode
  117505. g = (function() {
  117506. return this;
  117507. })();
  117508. try {
  117509. // This works if eval is allowed (see CSP)
  117510. g = g || new Function("return this")();
  117511. } catch (e) {
  117512. // This works if the window reference is available
  117513. if (typeof window === "object") g = window;
  117514. }
  117515. // g can still be undefined, but nothing to do about it...
  117516. // We return undefined, instead of nothing here, so it's
  117517. // easier to handle this case. if(!global) { ...}
  117518. module.exports = g;
  117519. /***/ }),
  117520. /***/ "./node_modules/webpack/buildin/harmony-module.js":
  117521. /*!*******************************************!*\
  117522. !*** (webpack)/buildin/harmony-module.js ***!
  117523. \*******************************************/
  117524. /*! no static exports found */
  117525. /***/ (function(module, exports) {
  117526. module.exports = function(originalModule) {
  117527. if (!originalModule.webpackPolyfill) {
  117528. var module = Object.create(originalModule);
  117529. // module.parent = undefined by default
  117530. if (!module.children) module.children = [];
  117531. Object.defineProperty(module, "loaded", {
  117532. enumerable: true,
  117533. get: function() {
  117534. return module.l;
  117535. }
  117536. });
  117537. Object.defineProperty(module, "id", {
  117538. enumerable: true,
  117539. get: function() {
  117540. return module.i;
  117541. }
  117542. });
  117543. Object.defineProperty(module, "exports", {
  117544. enumerable: true
  117545. });
  117546. module.webpackPolyfill = 1;
  117547. }
  117548. return module;
  117549. };
  117550. /***/ }),
  117551. /***/ "./src/ckeditor.js":
  117552. /*!*************************!*\
  117553. !*** ./src/ckeditor.js ***!
  117554. \*************************/
  117555. /*! exports provided: default */
  117556. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  117557. "use strict";
  117558. __webpack_require__.r(__webpack_exports__);
  117559. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ClassicEditor; });
  117560. /* harmony import */ var _ckeditor_ckeditor5_editor_classic_src_classiceditor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-editor-classic/src/classiceditor */ "./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditor.js");
  117561. /* harmony import */ var _ckeditor_ckeditor5_essentials_src_essentials__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-essentials/src/essentials */ "./node_modules/@ckeditor/ckeditor5-essentials/src/essentials.js");
  117562. /* harmony import */ var _ckeditor_ckeditor5_adapter_ckfinder_src_uploadadapter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter */ "./node_modules/@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter.js");
  117563. /* harmony import */ var _ckeditor_ckeditor5_autoformat_src_autoformat__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-autoformat/src/autoformat */ "./node_modules/@ckeditor/ckeditor5-autoformat/src/autoformat.js");
  117564. /* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_bold__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/bold */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold.js");
  117565. /* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_italic__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/italic */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic.js");
  117566. /* harmony import */ var _ckeditor_ckeditor5_block_quote_src_blockquote__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-block-quote/src/blockquote */ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquote.js");
  117567. /* harmony import */ var _ckeditor_ckeditor5_ckfinder_src_ckfinder__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-ckfinder/src/ckfinder */ "./node_modules/@ckeditor/ckeditor5-ckfinder/src/ckfinder.js");
  117568. /* harmony import */ var _ckeditor_ckeditor5_easy_image_src_easyimage__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-easy-image/src/easyimage */ "./node_modules/@ckeditor/ckeditor5-easy-image/src/easyimage.js");
  117569. /* harmony import */ var _ckeditor_ckeditor5_heading_src_heading__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ckeditor/ckeditor5-heading/src/heading */ "./node_modules/@ckeditor/ckeditor5-heading/src/heading.js");
  117570. /* harmony import */ var _ckeditor_ckeditor5_image_src_image__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ckeditor/ckeditor5-image/src/image */ "./node_modules/@ckeditor/ckeditor5-image/src/image.js");
  117571. /* harmony import */ var _ckeditor_ckeditor5_image_src_imagecaption__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @ckeditor/ckeditor5-image/src/imagecaption */ "./node_modules/@ckeditor/ckeditor5-image/src/imagecaption.js");
  117572. /* harmony import */ var _ckeditor_ckeditor5_image_src_imagestyle__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @ckeditor/ckeditor5-image/src/imagestyle */ "./node_modules/@ckeditor/ckeditor5-image/src/imagestyle.js");
  117573. /* harmony import */ var _ckeditor_ckeditor5_image_src_imagetoolbar__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @ckeditor/ckeditor5-image/src/imagetoolbar */ "./node_modules/@ckeditor/ckeditor5-image/src/imagetoolbar.js");
  117574. /* harmony import */ var _ckeditor_ckeditor5_image_src_imageupload__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @ckeditor/ckeditor5-image/src/imageupload */ "./node_modules/@ckeditor/ckeditor5-image/src/imageupload.js");
  117575. /* harmony import */ var _ckeditor_ckeditor5_image_src_imageresize__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @ckeditor/ckeditor5-image/src/imageresize */ "./node_modules/@ckeditor/ckeditor5-image/src/imageresize.js");
  117576. /* harmony import */ var _ckeditor_ckeditor5_link_src_linkimage__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @ckeditor/ckeditor5-link/src/linkimage */ "./node_modules/@ckeditor/ckeditor5-link/src/linkimage.js");
  117577. /* harmony import */ var _ckeditor_ckeditor5_indent_src_indent__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @ckeditor/ckeditor5-indent/src/indent */ "./node_modules/@ckeditor/ckeditor5-indent/src/indent.js");
  117578. /* harmony import */ var _ckeditor_ckeditor5_link_src_link__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @ckeditor/ckeditor5-link/src/link */ "./node_modules/@ckeditor/ckeditor5-link/src/link.js");
  117579. /* harmony import */ var _ckeditor_ckeditor5_list_src_list__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @ckeditor/ckeditor5-list/src/list */ "./node_modules/@ckeditor/ckeditor5-list/src/list.js");
  117580. /* harmony import */ var _ckeditor_ckeditor5_paragraph_src_paragraph__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @ckeditor/ckeditor5-paragraph/src/paragraph */ "./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraph.js");
  117581. /* harmony import */ var _ckeditor_ckeditor5_paste_from_office_src_pastefromoffice__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @ckeditor/ckeditor5-paste-from-office/src/pastefromoffice */ "./node_modules/@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice.js");
  117582. /* harmony import */ var _ckeditor_ckeditor5_table_src_table__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @ckeditor/ckeditor5-table/src/table */ "./node_modules/@ckeditor/ckeditor5-table/src/table.js");
  117583. /* harmony import */ var _ckeditor_ckeditor5_table_src_tabletoolbar__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @ckeditor/ckeditor5-table/src/tabletoolbar */ "./node_modules/@ckeditor/ckeditor5-table/src/tabletoolbar.js");
  117584. /* harmony import */ var _ckeditor_ckeditor5_typing_src_texttransformation__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @ckeditor/ckeditor5-typing/src/texttransformation */ "./node_modules/@ckeditor/ckeditor5-typing/src/texttransformation.js");
  117585. /* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_superscript__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/superscript */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript.js");
  117586. /* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_subscript__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/subscript */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript.js");
  117587. /* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_strikethrough__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/strikethrough */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough.js");
  117588. /* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_underline__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/underline */ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline.js");
  117589. /* harmony import */ var _ckeditor_ckeditor5_font_src_fontcolor__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! @ckeditor/ckeditor5-font/src/fontcolor */ "./node_modules/@ckeditor/ckeditor5-font/src/fontcolor.js");
  117590. /* harmony import */ var _ckeditor_ckeditor5_font_src_fontbackgroundcolor__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! @ckeditor/ckeditor5-font/src/fontbackgroundcolor */ "./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor.js");
  117591. /* harmony import */ var _ckeditor_ckeditor5_alignment_src_alignment__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! @ckeditor/ckeditor5-alignment/src/alignment */ "./node_modules/@ckeditor/ckeditor5-alignment/src/alignment.js");
  117592. // import MediaEmbed from '@ckeditor/ckeditor5-media-embed/src/mediaembed';
  117593. class ClassicEditor extends _ckeditor_ckeditor5_editor_classic_src_classiceditor__WEBPACK_IMPORTED_MODULE_0__["default"] {
  117594. }
  117595. // Plugins to include in the build.
  117596. ClassicEditor.builtinPlugins = [
  117597. _ckeditor_ckeditor5_essentials_src_essentials__WEBPACK_IMPORTED_MODULE_1__["default"],
  117598. _ckeditor_ckeditor5_adapter_ckfinder_src_uploadadapter__WEBPACK_IMPORTED_MODULE_2__["default"],
  117599. _ckeditor_ckeditor5_autoformat_src_autoformat__WEBPACK_IMPORTED_MODULE_3__["default"],
  117600. _ckeditor_ckeditor5_basic_styles_src_bold__WEBPACK_IMPORTED_MODULE_4__["default"],
  117601. _ckeditor_ckeditor5_basic_styles_src_italic__WEBPACK_IMPORTED_MODULE_5__["default"],
  117602. _ckeditor_ckeditor5_basic_styles_src_underline__WEBPACK_IMPORTED_MODULE_28__["default"],
  117603. _ckeditor_ckeditor5_basic_styles_src_strikethrough__WEBPACK_IMPORTED_MODULE_27__["default"],
  117604. _ckeditor_ckeditor5_basic_styles_src_subscript__WEBPACK_IMPORTED_MODULE_26__["default"],
  117605. _ckeditor_ckeditor5_basic_styles_src_superscript__WEBPACK_IMPORTED_MODULE_25__["default"],
  117606. _ckeditor_ckeditor5_block_quote_src_blockquote__WEBPACK_IMPORTED_MODULE_6__["default"],
  117607. _ckeditor_ckeditor5_ckfinder_src_ckfinder__WEBPACK_IMPORTED_MODULE_7__["default"],
  117608. _ckeditor_ckeditor5_easy_image_src_easyimage__WEBPACK_IMPORTED_MODULE_8__["default"],
  117609. _ckeditor_ckeditor5_heading_src_heading__WEBPACK_IMPORTED_MODULE_9__["default"],
  117610. _ckeditor_ckeditor5_image_src_image__WEBPACK_IMPORTED_MODULE_10__["default"],
  117611. _ckeditor_ckeditor5_image_src_imagecaption__WEBPACK_IMPORTED_MODULE_11__["default"],
  117612. _ckeditor_ckeditor5_image_src_imagestyle__WEBPACK_IMPORTED_MODULE_12__["default"],
  117613. _ckeditor_ckeditor5_image_src_imagetoolbar__WEBPACK_IMPORTED_MODULE_13__["default"],
  117614. _ckeditor_ckeditor5_image_src_imageupload__WEBPACK_IMPORTED_MODULE_14__["default"],
  117615. _ckeditor_ckeditor5_image_src_imageresize__WEBPACK_IMPORTED_MODULE_15__["default"],
  117616. _ckeditor_ckeditor5_link_src_linkimage__WEBPACK_IMPORTED_MODULE_16__["default"],
  117617. _ckeditor_ckeditor5_indent_src_indent__WEBPACK_IMPORTED_MODULE_17__["default"],
  117618. _ckeditor_ckeditor5_link_src_link__WEBPACK_IMPORTED_MODULE_18__["default"],
  117619. _ckeditor_ckeditor5_list_src_list__WEBPACK_IMPORTED_MODULE_19__["default"],
  117620. // MediaEmbed,
  117621. _ckeditor_ckeditor5_paragraph_src_paragraph__WEBPACK_IMPORTED_MODULE_20__["default"],
  117622. _ckeditor_ckeditor5_paste_from_office_src_pastefromoffice__WEBPACK_IMPORTED_MODULE_21__["default"],
  117623. _ckeditor_ckeditor5_table_src_table__WEBPACK_IMPORTED_MODULE_22__["default"],
  117624. _ckeditor_ckeditor5_table_src_tabletoolbar__WEBPACK_IMPORTED_MODULE_23__["default"],
  117625. _ckeditor_ckeditor5_typing_src_texttransformation__WEBPACK_IMPORTED_MODULE_24__["default"],
  117626. _ckeditor_ckeditor5_font_src_fontcolor__WEBPACK_IMPORTED_MODULE_29__["default"],
  117627. _ckeditor_ckeditor5_font_src_fontbackgroundcolor__WEBPACK_IMPORTED_MODULE_30__["default"],
  117628. _ckeditor_ckeditor5_alignment_src_alignment__WEBPACK_IMPORTED_MODULE_31__["default"]
  117629. ];
  117630. // Editor configuration.
  117631. ClassicEditor.defaultConfig = {
  117632. toolbar: {
  117633. items: [
  117634. 'heading',
  117635. '|',
  117636. 'bold', 'italic', 'underline', 'strikethrough', 'subscript', 'superscript',
  117637. 'link', 'bulletedList', 'numberedList',
  117638. '|',
  117639. 'indent', 'outdent',
  117640. '|',
  117641. 'imageUpload', 'blockQuote', 'insertTable',
  117642. // 'mediaEmbed',
  117643. 'undo', 'redo'
  117644. ]
  117645. },
  117646. image: {
  117647. toolbar: [
  117648. 'imageStyle:full',
  117649. 'imageStyle:side',
  117650. 'imageStyle:alignLeft', 'imageStyle:alignCenter', 'imageStyle:alignRight',
  117651. 'imageStyle:alignBlockLeft', 'imageStyle:alignBlockRight',
  117652. '|',
  117653. 'imageResize',
  117654. '|',
  117655. 'imageTextAlternative',
  117656. ]
  117657. },
  117658. table: {
  117659. contentToolbar: [
  117660. 'tableColumn',
  117661. 'tableRow',
  117662. 'mergeTableCells'
  117663. ]
  117664. },
  117665. // This value must be kept in sync with the language defined in webpack.config.js.
  117666. language: 'en'
  117667. };
  117668. /***/ })
  117669. /******/ })["default"];
  117670. });
  117671. //# sourceMappingURL=ckeditor.js.map